pixel-priya 1.3.45 → 1.3.46
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/components/ConditionalDropdown/ConditionalDropdown.js +38 -9
- package/lib/components/ConditionalDropdown/ConditionalDropdown.js.map +1 -1
- package/lib/components/ConditionalDropdown/OptionsDropdown.js +4 -3
- package/lib/components/ConditionalDropdown/OptionsDropdown.js.map +1 -1
- package/lib/components/Editor/VariableDropdown.js +2 -2
- package/lib/components/Editor/VariableDropdown.js.map +1 -1
- package/lib/index.js +2 -2
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -33,7 +33,7 @@ object-assign
|
|
|
33
33
|
*
|
|
34
34
|
* This source code is licensed under the MIT license found in the
|
|
35
35
|
* LICENSE file in the root directory of this source tree.
|
|
36
|
-
*/var xy,Vy=(Ly||(Ly=1,"production"===process.env.NODE_ENV?Ey.exports=(wy||(wy=1,function(e){function t(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,a=e[r];if(!(0<i(a,t)))break e;e[r]=t,e[n]=a,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,a=e.length,o=a>>>1;r<o;){var l=2*(r+1)-1,s=e[l],c=l+1,d=e[c];if(0>i(s,n))c<a&&0>i(d,s)?(e[r]=d,e[c]=n,r=c):(e[r]=s,e[l]=n,r=l);else{if(!(c<a&&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(e.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var s=[],c=[],d=1,u=null,f=3,h=!1,C=!1,p=!1,m=!1,A="function"==typeof setTimeout?setTimeout:null,g="function"==typeof clearTimeout?clearTimeout:null,v="undefined"!=typeof setImmediate?setImmediate:null;function y(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 w(e){if(p=!1,y(e),!C)if(null!==n(s))C=!0,b||(b=!0,E());else{var t=n(c);null!==t&&z(w,t.startTime-e)}}var E,b=!1,M=-1,L=5,H=-1;function x(){return!(!m&&e.unstable_now()-H<L)}function V(){if(m=!1,b){var t=e.unstable_now();H=t;var i=!0;try{e:{C=!1,p&&(p=!1,g(M),M=-1),h=!0;var a=f;try{t:{for(y(t),u=n(s);null!==u&&!(u.expirationTime>t&&x());){var o=u.callback;if("function"==typeof o){u.callback=null,f=u.priorityLevel;var l=o(u.expirationTime<=t);if(t=e.unstable_now(),"function"==typeof l){u.callback=l,y(t),i=!0;break t}u===n(s)&&r(s),y(t)}else r(s);u=n(s)}if(null!==u)i=!0;else{var d=n(c);null!==d&&z(w,d.startTime-t),i=!1}}break e}finally{u=null,f=a,h=!1}i=void 0}}finally{i?E():b=!1}}}if("function"==typeof v)E=function(){v(V)};else if("undefined"!=typeof MessageChannel){var k=new MessageChannel,S=k.port2;k.port1.onmessage=V,E=function(){S.postMessage(null)}}else E=function(){A(V,0)};function z(t,n){M=A(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_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_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_requestPaint=function(){m=!0},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,a){var o=e.unstable_now();switch(a="object"==typeof a&&null!==a&&"number"==typeof(a=a.delay)&&0<a?o+a:o,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:a,expirationTime:l=a+l,sortIndex:-1},a>o?(r.sortIndex=a,t(c,r),null===n(s)&&r===n(c)&&(p?(g(M),M=-1):p=!0,z(w,a-o))):(r.sortIndex=l,t(s,r),C||h||(C=!0,b||(b=!0,E()))),r},e.unstable_shouldYield=x,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}}(by)),by):Ey.exports=(My||(My=1,xy=Hy,"production"!==process.env.NODE_ENV&&function(){function e(){if(y=!1,M){var e=xy.unstable_now();x=e;var t=!0;try{e:{g=!1,v&&(v=!1,E(L),L=-1),A=!0;var i=m;try{t:{for(a(e),p=n(f);null!==p&&!(p.expirationTime>e&&l());){var c=p.callback;if("function"==typeof c){p.callback=null,m=p.priorityLevel;var d=c(p.expirationTime<=e);if(e=xy.unstable_now(),"function"==typeof d){p.callback=d,a(e),t=!0;break t}p===n(f)&&r(f),a(e)}else r(f);p=n(f)}if(null!==p)t=!0;else{var u=n(h);null!==u&&s(o,u.startTime-e),t=!1}}break e}finally{p=null,m=i,A=!1}t=void 0}}finally{t?V():M=!1}}}function t(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,a=e[r];if(!(0<i(a,t)))break e;e[r]=t,e[n]=a,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,a=e.length,o=a>>>1;r<o;){var l=2*(r+1)-1,s=e[l],c=l+1,d=e[c];if(0>i(s,n))c<a&&0>i(d,s)?(e[r]=d,e[c]=n,r=c):(e[r]=s,e[l]=n,r=l);else{if(!(c<a&&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}function a(e){for(var i=n(h);null!==i;){if(null===i.callback)r(h);else{if(!(i.startTime<=e))break;r(h),i.sortIndex=i.expirationTime,t(f,i)}i=n(h)}}function o(e){if(v=!1,a(e),!g)if(null!==n(f))g=!0,M||(M=!0,V());else{var t=n(h);null!==t&&s(o,t.startTime-e)}}function l(){return!(!y&&xy.unstable_now()-x<H)}function s(e,t){L=w(function(){e(xy.unstable_now())},t)}if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()),xy.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var c=performance;xy.unstable_now=function(){return c.now()}}else{var d=Date,u=d.now();xy.unstable_now=function(){return d.now()-u}}var f=[],h=[],C=1,p=null,m=3,A=!1,g=!1,v=!1,y=!1,w="function"==typeof setTimeout?setTimeout:null,E="function"==typeof clearTimeout?clearTimeout:null,b="undefined"!=typeof setImmediate?setImmediate:null,M=!1,L=-1,H=5,x=-1;if("function"==typeof b)var V=function(){b(e)};else if("undefined"!=typeof MessageChannel){var k=new MessageChannel,S=k.port2;k.port1.onmessage=e,V=function(){S.postMessage(null)}}else V=function(){w(e,0)};xy.unstable_IdlePriority=5,xy.unstable_ImmediatePriority=1,xy.unstable_LowPriority=4,xy.unstable_NormalPriority=3,xy.unstable_Profiling=null,xy.unstable_UserBlockingPriority=2,xy.unstable_cancelCallback=function(e){e.callback=null},xy.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"):H=0<e?Math.floor(1e3/e):5},xy.unstable_getCurrentPriorityLevel=function(){return m},xy.unstable_next=function(e){switch(m){case 1:case 2:case 3:var t=3;break;default:t=m}var n=m;m=t;try{return e()}finally{m=n}},xy.unstable_requestPaint=function(){y=!0},xy.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=m;m=e;try{return t()}finally{m=n}},xy.unstable_scheduleCallback=function(e,r,i){var a=xy.unstable_now();switch(i="object"==typeof i&&null!==i&&"number"==typeof(i=i.delay)&&0<i?a+i:a,e){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 e={id:C++,callback:r,priorityLevel:e,startTime:i,expirationTime:l=i+l,sortIndex:-1},i>a?(e.sortIndex=i,t(h,e),null===n(f)&&e===n(h)&&(v?(E(L),L=-1):v=!0,s(o,i-a))):(e.sortIndex=l,t(f,e),g||A||(g=!0,M||(M=!0,V()))),e},xy.unstable_shouldYield=l,xy.unstable_wrapCallback=function(e){var t=m;return function(){var n=m;m=t;try{return e.apply(this,arguments)}finally{m=n}}},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Hy)),Ey.exports);const ky=Symbol(),Sy=Symbol(),zy="undefined"==typeof window||/ServerSideRendering/.test(window.navigator&&window.navigator.userAgent)?l:u,Zy=Vy.unstable_runWithPriority?e=>{try{Vy.unstable_runWithPriority(Vy.unstable_NormalPriority,e)}catch(t){if("Not implemented."!==t.message)throw t;e()}}:e=>e();function Oy(e,t){const n=d(e)[ky];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:a}=n,o=t(r),[l,s]=g((e,n)=>{if(!n)return[r,o];if("p"in n)throw n.p;if(n.n===i)return Object.is(e[1],o)?e:[r,o];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,o]);return Object.is(l[1],o)||s(),zy(()=>(a.add(s),()=>{a.delete(s)}),[a]),l[1]}const Ny=function(e){const t=s({[ky]:{v:{current:e},n:{current:-1},l:new Set,u:e=>e()}});var n;return t[Sy]=t.Provider,t.Provider=(n=t.Provider,({value:e,children:t})=>{const r=o(e),i=o(0),[a,l]=c(null);a&&(a(e),l(null));const s=o();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={[ky]:{v:r,n:i,l:e,u:t}}}return zy(()=>{r.current=e,i.current+=1,Zy(()=>{s.current[ky].l.forEach(t=>{t({n:i.current,v:e})})})},[e]),p(n,{value:s.current},t)}),delete t.Consumer,t}([vy,()=>{}]),Ty=({children:t,useTableRef:n,totalWidth:r})=>{const i=o(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})},Iy=t=>e("tr",{...t}),Dy=t=>e("tr",{className:"ff-spreadsheet-row-header",...t});function Fy(){return Oy(Ny,([,e])=>e)}function Ry(e){return Oy(Ny,([t])=>e(t))}const Py=({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:T("corner-header",{"ff-spreadsheet-header--selected":t}),children:e(q,{variant:t?"dark":"light",color:t?"var(--hover-color)":"var(--text-color)",name:"excel_corner_menu"})})})},jy=t=>function(n){const i=Fy(),a=r.useCallback(()=>i({type:xA}),[i]),o=Ry(e=>e.selected instanceof fv);return e(t,{...n,selected:o,onSelect:a})},By=t=>function(n){const i=Fy(),a=r.useCallback((e,t)=>i(function(e,t){return{type:HA,payload:{column:e,extend:t}}}(e,t)),[i]),o=Ry(e=>e.selected.hasEntireColumn(n.column)),l=Ry(e=>e.selectedColumn??void 0),s=Ry(e=>e.active?Qg(e.active,e.model.data):void 0);return e(t,{...n,cell:s,selected:o,selectedColumn:l,onSelect:a,scrollToColumn:n.scrollToColumn})},_y=By(({column:t,label:i,selected:a,onSelect:o,setContextMenu:l,deleteColumn:s,addColumnLeft:c,addColumnRight:d,columnContextEnable:u,cell:f,selectedColumn:C,minimumColumnWidth:p,maxColLimit:m,disableDeleteOption:A,contextMenu:g,onAddColumn:v,onDeleteColumn:y,setVisibleRange:w,scrollToColumn:E})=>{const b=Fy(),M=Ry(e=>e.model.data),L=Ry(e=>e.columnDimensions[t]?.width??p),H=Ry(e=>e.model.data),{columnCount:x}=jv(H),V=e=>{w(t=>{const n={...t,end:"increment"===e?t.end+1:t.end-1};return C&&E(C),n})},k=h(()=>[{label:"Add Column Left",value:"Add Column Left",iconName:"plus_icon",action:()=>{V("increment"),c(p),v?.(C??t,!0)},disableTooltip:"Column limit reached",visible:f?.contextDisable?.["Add Column Left"]??!1,disable:x>=m},{label:"Add Column Right",value:"Add Column Right",iconName:"plus_icon",action:()=>{V("increment"),d(p),v?.(C??t,!1)},disableTooltip:"Column limit reached",visible:f?.contextDisable?.["Add Column Right"]??!1,disable:x>=m},...A?[]:[{label:"Delete Column",value:"Delete Column",iconName:"delete",action:()=>{V("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);o(i,e.shiftKey);const a=e.clientX,l=Number(L),s=e=>{const t=e.clientX-a,n=Math.max(p,l+t);b(function(e,t){return{type:lg,payload:{column:e,width:t}}}(i,n))},c=()=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",c),b(_g())};document.addEventListener("mousemove",s),document.addEventListener("mouseup",c),b(Bg())},[t,L]),z=r.useCallback(e=>b(Dg(e)),[b]),Z=r.useCallback(e=>{o(t,e.shiftKey)},[o,t]),O=r.useCallback(e=>{e.preventDefault(),o(t,e.shiftKey),l({open:u,contextType:"column",options:k})},[t,C,u,k]);return r.useEffect(()=>{void 0!==C&&"column"===g?.contextType&&l(e=>({open:e.open,contextType:"column",options:k}))},[t,C,u,k,"column"===g?.contextType]),n("th",{className:T("ff-spreadsheet-header",{"ff-spreadsheet-header--selected":a}),style:{width:`${L}px`,minWidth:"100px"},onClick:Z,onContextMenu:O,tabIndex:0,children:[e(U,{fontWeight:"medium",children:i??qy(t)}),e("div",{className:"drag-column-selector drag-column-left",onMouseDown:e=>S(e,!1),onDoubleClick:()=>b(mg(t,L)),onClick:()=>z({row:-1,column:t})}),e("div",{className:"drag-column-selector drag-column-right",onMouseDown:e=>S(e,!0),onDoubleClick:()=>b(mg(t,L)),onClick:()=>z({row:-1,column:t})})]},t)});function qy(e){let t="",n=e;for(;n>=0;)t=String.fromCharCode(65+n%26)+t,n=Math.floor(n/26)-1;return t}const Uy=({row:t,label:i,selected:a,onSelect:o,setContextMenu:l,addRowTop:s,addRowBottom:c,deleteRow:d,rowContextEnable:u,selectedRow:f,cell:h,maxRowLimit:C,disableDeleteOption:p,contextMenu:m,setVisibleRange:A,scrollToRow:g})=>{const v=Fy(),y=Ry(e=>e.rowDimensions[t]?.height||32),w=Ry(e=>e.model.data),{rowCount:E}=jv(w),b=e=>{A(t=>{const n={...t,end:"increment"===e?t.end+1:t.end-1};return f&&g(f),n})},M=r.useMemo(()=>[{label:"Add Row Top",value:"Add Row Top",iconName:"plus_icon",action:()=>{b("increment"),s()},disableTooltip:"Row limit reached",visible:h?.contextDisable?.["Add Row Top"]??!1,disable:E>=C},{label:"Add Row Bottom",value:"Add Row Bottom",iconName:"plus_icon",action:()=>{b("increment"),c()},disableTooltip:"Row limit reached",visible:h?.contextDisable?.["Add Row Bottom"]??!1,disable:E>=C},...p?[]:[{label:"Delete Row",value:"Delete Row",iconName:"delete",action:()=>{b("decrement"),d()},disableTooltip:"",visible:h?.contextDisable?.["Delete Row"]??!1,disable:!1}]],[f,t]),L=r.useCallback((e,n)=>{const r=n?t:t-1,i=Math.max(r,0);o(i,e.shiftKey);const a=e.clientY,l=y,s=e=>{const t=e.clientY-a,n=Math.max(32,l+t);v(pg(i,n))},c=()=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",c),v(_g())};document.addEventListener("mousemove",s),document.addEventListener("mouseup",c)},[y,t]),H=r.useCallback(e=>v(Dg(e)),[v]),x=r.useCallback(e=>{o(t,e.shiftKey)},[t]),V=r.useCallback(e=>{e.preventDefault(),o(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:T("ff-spreadsheet-header",{"ff-spreadsheet-header--selected":a}),style:{height:`${y}px`,minHeight:"32px"},onClick:x,onContextMenu:V,tabIndex:0,children:[e(U,{fontWeight:"medium",children:void 0!==i?i:t+1}),e("div",{className:"drag-row-selector drag-row-down",onMouseDown:e=>L(e,!0),onDoubleClick:()=>v(pg(t,y)),onClick:()=>H({row:t,column:-1})}),e("div",{className:"drag-row-selector drag-row-up",onMouseDown:e=>L(e,!1),onDoubleClick:()=>v(pg(t,y)),onClick:()=>H({row:t,column:-1})})]})},Wy=t=>function(n){const i=Fy(),a=Ry(e=>e.selected.hasEntireRow(n.row)),o=Ry(e=>e.active?Qg(e.active,e.model.data):void 0),l=Ry(e=>e.selectedRow??void 0),s=r.useCallback((e,t)=>i(function(e,t){return{type:LA,payload:{row:e,extend:t}}}(e,t)),[i]);return e(t,{...n,selected:a,cell:o,selectedRow:l,onSelect:s,scrollToRow:n.scrollToRow})},Xy=r.memo(({row:t,column:n,DataViewer:i,active:a,dragging:o,mode:l,data:s,evaluatedData:c,select:d,activate:u,edit:f,editable:h,setCellDimensions:C,setCellData:p})=>{const m=r.useRef(null),A=r.useMemo(()=>({row:t,column:n}),[t,n]),g=r.useCallback(e=>{e.preventDefault(),window.getSelection()?.removeAllRanges(),"view"===l&&(C(A,Ev(e.currentTarget)),e.shiftKey?d(A):(u(A),"dropDown"===s?.inputType?.type&&h&&!s?.readOnly&&f()))},[l,C,A,d,u,f,h,s]),v=r.useCallback(e=>{o&&(C(A,Ev(e.currentTarget)),d(A))},[C,d,o,A]);return r.useEffect(()=>{const e=m.current;if(!e)return;const t=()=>{o||C(A,Ev(e))};t();const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[C,A,o]),s&&s.DataViewer&&(i=s.DataViewer),e("td",{ref:m,style:{...s?.style,..."dropDown"===s?.inputType?.type&&{fontSize:"12px"},textDecoration:"underline"===s?.style?.textDecoration?s?.style?.textDecoration:"none"},className:T("ff-spreadsheet-cell",s?.className,{"ff-spreadsheet-active-cell":a||o}),onMouseEnter:v,onMouseDown:g,tabIndex:0,children:e(i,{row:t,column:n,cell:s,active:a,evaluatedCell:c,setCellData:p,inputValue:()=>null})})}),Qy=t=>function(n){const{row:i,column:a}=n,o=Fy(),l=r.useMemo(()=>({row:i,column:a}),[i,a]),s=r.useCallback(e=>o(Fg(l,e)),[o,l]),c=r.useCallback(e=>o(function(e){return{type:kA,payload:{point:e}}}(e)),[o]),d=r.useCallback(e=>o(Dg(e)),[o]),u=r.useCallback(()=>o(Wg()),[o]),f=r.useCallback((e,t)=>o(Rg(e,t)),[o]),h=Ry(e=>wv(e.active,l)),C=Ry(e=>h?e.mode:"view"),p=Ry(e=>e.editable),m=Ry(e=>Qg(l,e.model.data)),A=Ry(e=>Qg(l,e.model.evaluatedData)),g=Ry(e=>e.dragging),v=Ry(e=>e.copied?.has(l)||!1);return e(t,{...n,active:h,copied:v,dragging:g,mode:C,evaluatedData:A,data:m,select:c,activate:d,edit:u,editable:p,setCellDimensions:f,setCellData:s})},Gy=({cell:r,evaluatedCell:i,active:a})=>{const o=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 o?{className:"ff-spreadsheet-data-viewer ff-spreadsheet-data-viewer--boolean",children:Ky(o)}:{className:T("ff-spreadsheet-data-viewer",{"ff-spreadsheet-data-viewer--preserve-breaks":Nv(o)}),children:a||"dropDown"!==r?.inputType?.type?a||"file"!==r?.inputType?.type?!a&&o:e(t,{children:K(r?.value)?n("div",{className:"ff-spreadsheet-data-viewer--without-fileType",children:[e(q,{name:"attachment_icon"})," Attachment"]}):(n=>{if(K(n))return e(t,{});return JSON.parse(n).map(t=>e("div",{className:"ff-spreadsheet-data-viewer--fileType",children:e(zi,{width:r?.style?.width??100,title:t?.name?.split("*")?.[0]??""})},t.name))})(o)}):n("div",{className:"ff-spreadsheet-data-viewer--dropdownType",children:[o,e(q,{name:"arrow_down",height:8,className:"dropdownType-icon"})]})})};function Ky(e){return e?"TRUE":"FALSE"}const Yy=i.forwardRef(({initialValue:t="",onChange:n,className:r="",style:a={}},s)=>{const c=o(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:a,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"}})})}),Jy=({onChange:t,cell:n})=>{const i=r.useRef(null),a=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(Yy,{ref:i,initialValue:n?.value??"",onChange:a,className:"ff-spreadsheet-cell-textarea",style:{...n?.style,width:"100%",height:"100%",borderTop:"",borderBottom:"",borderLeft:"",borderRight:""}})})},$y=t=>{const i=r.useRef(null),a=r.useRef(null),o=Fy(),l=r.useCallback((e,t)=>o(Fg(e,t)),[o]),s=r.useCallback(e=>o(Dg(e)),[o]),c=r.useCallback(()=>o(Wg()),[o]),d=r.useCallback(e=>o({type:cg,payload:{autofill:e}}),[o]),u=r.useCallback(e=>o(function(e){return{type:_A,payload:{changes:e}}}(e)),[o]),f=r.useCallback(()=>{o({type:DA})},[o]),h=Ry(e=>e.rowDimensions),C=Ry(e=>e.active),p=Ry(e=>e.mode),m=Ry(e=>e.active?Qg(e.active,e.model.data):void 0),A=Ry(e=>e.selected),g=Ry(e=>A&&Sv(e.rowDimensions,e.columnDimensions,e.model.data,e.selected)),v=Ry(e=>{let t=C?Vv(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||!v||C.row<t.visibleRowRange.start||C.row>=t.visibleRowRange.end||C.column<t.visibleColRange.start||C.column>=t.visibleColRange.end,[C,v,t.visibleRowRange,t.visibleColRange]),w=r.useRef(void 0),E=r.useRef(null),b=r.useRef(void 0),M=r.useCallback(e=>{C&&l(C,e)},[l,C]),[L,H]=r.useState({value:"",name:""}),[x,V]=r.useState(!1),[k,S]=r.useState(),[z,Z]=r.useState([]),[O,N]=r.useState("var(--ff-select-text-color)");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)){H({value:m?.value,name:m?.value}),N(m?.style?.color),V(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,color:t.color}));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"));Z(e)}catch(e){console.error("Error parsing cell value for files:",e),Z([])}else Z([])},[m?.inputType?.type,m?.value]),r.useEffect(()=>{"dropDown"===m?.inputType?.type&&m?.value!==L.value&&H({value:m?.value,name:m?.value})},[m?.value,m?.inputType?.type,L.value]),r.useEffect(()=>{const e=E.current,t=b.current;if(E.current=C,b.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 I=m&&m.DataEditor||t.DataEditor,D=m&&m.readOnly,F=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 a=()=>{i&&(cancelAnimationFrame(i),i=null)},o=e=>{const n=t.getBoundingClientRect();let r=0,o=0;e.clientY<n.top+50?o=-12:e.clientY>n.bottom-50&&(o=12),e.clientX<n.left+50?r=-12:e.clientX>n.right-50&&(r=12),0!==r||0!==o?(e=>{a();const n=()=>{const{x:r,y:a}=e;0!==r&&(t.scrollLeft+=r),0!==a&&(t.scrollTop+=a),i=requestAnimationFrame(n)};i=requestAnimationFrame(n)})({x:r,y:o}):a()},l=()=>{a(),document.body.style.userSelect=n,document.body.style.overflow=r,document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",l)};document.addEventListener("mousemove",o),document.addEventListener("mouseup",l),d(!0)},[s,d,C]),R=r.useCallback(e=>{e.preventDefault(),t.setContextMenu({open:t.contextOption?.open??!1,contextType:t.contextOption?.contextType??null,options:t.contextOption?.options||[]})},[t]),P=g?.height!==v?.height||g?.width!==v?.width,j=r.useCallback(e=>{C&&P&&(Rg(C,Ev(e.currentTarget)),s(C))},[C,P]),B=t.isAtRight?t.maxWidth-(v?.left-t.scrollPos.left)+100:t.maxWidth,_=t.isAtBottom?t.maxHeight-(v?.top-t.scrollPos.top)+64:t.maxHeight,q=["file","dropDown"].includes(m?.inputType?.type||""),U="dropDown"===m?.inputType?.type;return n("div",{ref:i,className:T("ff-spreadsheet-active-cell",`ff-spreadsheet-active-cell--${p}`,{"ff-spreadsheet-active-cell--hidden":y,"ff-spreadsheet-active-cell--dragging":P&&"text"!==m?.inputType?.type}),onMouseDown:j,style:{...v,backgroundColor:m?.style?.backgroundColor,...q?{display:"flex",alignItems:U?"center":m?.style?.alignContent,justifyContent:U?"flex-start":m?.style?.textAlign}:{},..."edit"===p&&C?{minWidth:Math.min(v?.width,t.maxWidth),minHeight:Math.min(v?.height,t.maxHeight),height:"auto",maxWidth:`${B}px`,maxHeight:`${_}px`,overflow:"auto",..."dropDown"===m?.inputType?.type?{}:{padding:"2px 4px 0px 4px",width:"max-content"}}:{}},onContextMenu:R,onClick:"view"!==p||D?void 0:c,tabIndex:0,children:[e("div",{className:q?"":"active-cell-main",style:U?{width:"100%"}:void 0,children:"dropDown"===m?.inputType?.type?e(ka,{...m?.inputType?.inputProps,dropDownRef:a,showOptions:{open:!("edit"!==p||!C),toggle:x},selectedOption:L,optionsList:k||[],height:26,showLabel:!1,disabled:!t.editable,showBorder:!1,selectedOptionColor:O,optionZIndex:5e3,onChange:e=>{const t=K(e.color)?m?.style:{...m?.style,color:e.color};H({value:e.value,name:e.label}),N(e.color||"var(--ff-select-text-color)"),M({...m,value:e.value,style:t,inputType:m?.inputType})}}):"file"===m?.inputType?.type?e(lA,{...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 a=e[i];t.attachmentAction.viewAttachment(a.id,a.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 a=e.name.split("*")[0],o=i.findIndex(e=>e.name.split("*")[0]===a)!==t,l=n.some(e=>e.name.split("*")[0]===a);return!o&&!l||(r++,!1)});if(n.length+i.length>5)return void sc.info("Cannot upload more than 5 files.");if(t.attachmentAction?.addAttachment&&i.length>0)try{let e=0,r=0,a=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?a++: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}),o(pg(C?.row||0,Math.max(s,h?.[C.row]?.height||s))),Z(c.map(e=>new File([new Blob],e.name?.split("*")[0]??"default")))}a>0&&sc.info("No memory available to add the file"),e>0&&sc.success(`${e} file${e>1?"s":""} uploaded successfully`),r>0&&sc.info(`${r} unsupported ${r>1?"files":"file"}. Please check the file formats.`)}catch(e){console.error("Upload operation failed:",e),sc.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]),a=e[n]?.id;if(-1!==n&&a&&t.attachmentAction?.deleteAttachment)try{const o=await t.attachmentAction.deleteAttachment(a);"SUCCESS"===o||"object"==typeof o&&null!==o&&("status"in o&&"SUCCESS"===o.status||"responseCode"in o&&200===o.responseCode)?(e.splice(n,1),r++):console.error(`Delete failed for ${i.name}: Invalid response`,o)}catch(e){console.error(`Delete error for ${i.name}:`,e),sc.error("Error deleting file")}else console.error(`Cannot delete ${i.name}: Invalid fileId or no match`,{index:n,fileId:a,hasDeleteAttachment:!!t.attachmentAction?.deleteAttachment}),sc.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}),Z(e?.map(e=>new File([new Blob],e.name.split("*")[0]))),sc.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}),Z(t.map(e=>new File([new Blob],e.name.split("*")[0]))),sc.error("Failed to delete file(s). Invalid file data detected.")}else sc.error("Failed to delete file(s). No valid files removed.")}}catch(e){console.error("Delete operation failed:",e),sc.error("Delete operation failed")}}catch(e){console.error("handleFilesChange error:",e),sc.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:(v?.width??0)-60}):"edit"===p&&C&&t.editable?e(I,{row:C.row,column:C.column,cell:m,onChange:M,exitEditMode:f}):e(Yy,{initialValue:m?.value,onChange:()=>{},className:"ff-spreadsheet-cell-textarea",style:{...m?.style,height:"100%",width:"100%",textDecoration:"underline"===m?.style?.textDecoration?"underline":"none",backgroundColor:P?"#1e161f00":m?.style?.backgroundColor,pointerEvents:"none",borderTop:"",borderBottom:"",borderLeft:"",borderRight:""}})}),!["file"].includes(m?.inputType?.type??"")&&("edit"===p||C&&e("div",{onMouseDown:F,className:"select_dot"}))]},`${C?.row}-${C?.column}`)},ew=({dimensions:t,dragging:n,hidden:r,variant:i})=>{const a=Ry(e=>e.active),o=Ry(e=>e.autoFill),l=Ry(e=>a?Vv(a,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 o.open&&s&&c&&l&&(s-h>c-f?(C=s,p=l.height):(p=c,C=l.width)),e("div",{className:T("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}})},tw=({scrollPos:t={top:0,left:0}})=>{const n=Ry(e=>e.selected),i=Ry(e=>e.dragging),a=Ry(e=>e.selected.size(e.model.data)<2),o=Ry(e=>n&&Sv(e.rowDimensions,e.columnDimensions,e.model.data,e.selected)),l=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(ew,{variant:"selected",dimensions:l,dragging:i,hidden:a||!o})},nw=({scrollPos:t={top:0,left:0}})=>{const n=Ry(e=>e.copied),i=null===n,a=Ry(e=>n&&kv(e.rowDimensions,e.columnDimensions,n)),o=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(ew,{variant:"copied",dimensions:o,hidden:i||!a,dragging:!1})},rw=i.forwardRef(({getColorValue:t,disabled:n,initialColor:r},a)=>{const l=o(null);i.useImperativeHandle(a,()=>l.current);const[s,d]=c(r);return e("div",{className:T("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:T("ff-excel-color-selector-picker",{"color-selector-disabled":n}),ref:l,onChange:e=>{d(e.target.value),t(e.target.value.replace("#",""))}})})});rw.displayName="ColorBarSelector";const iw=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"}},aw=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"}},ow=e=>Rv.reduce((t,n)=>Math.abs(n-parseFloat(e))<Math.abs(t-parseFloat(e))?n:t);function lw(e,t=100){const{border:n}=e;let r="",i="",a="",o="";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&&(a="MEDIUM"===n.bottom?"2px solid var(--input-hover-border-color)":"1px solid var(--excel-header-border)"),"THIN"!==n.left&&(o="MEDIUM"===n.left?"2px solid var(--input-hover-border-color)":"1px solid var(--excel-header-border)"),{fontSize:Tv(ow(String(e.size))),fontFamily:(l=e.name,Fv.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:a,borderLeft:o,textAlign:iw(e.alignment.horizontal),alignContent:iw(e.alignment.vertical),height:e.height??32,width:e.width??t};var l}const sw=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"},cw=(e,t=100)=>({name:e.fontFamily||"Arial",size:Iv(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:sw(e.borderTop?e.borderTop.toString():void 0),right:sw(e.borderRight?e.borderRight.toString():void 0),bottom:sw(e.borderBottom?e.borderBottom.toString():void 0),left:sw(e.borderLeft?e.borderLeft.toString():void 0)},alignment:{horizontal:aw(e.textAlign),vertical:aw(e.alignContent),wrapText:!1},width:e.width||t,height:e.height||32}),dw=({toolbar:t="show",editable:r,onBold:i,onItalic:a,setUnderlineType:s,setColor:d,setFontSize:u,setFontFamily:f,setTextAlign:h,setBackgroundColor:C,setBorderType:p,setFormatePainter:m})=>{const A=Ry(e=>e.selected instanceof fv),[g,v]=c("disable"===t||!r),y=Ry(e=>e.active?Qg(e.active,e.model.data):null),w=Ry(e=>e.model.data),E=Ry(e=>e.formattedStyle.open),b={...Dv.style,color:"#1e161f",backgroundColor:"#ffffff",borderColor:"#1e161f"},[M,L]=c(y?.style||b),H=o(null);l(()=>{y?.style&&JSON.stringify(y.style)!==JSON.stringify(M)&&L(y?.style||b),A?v(!r):y&&"boolean"==typeof y.readOnly&&v(y.readOnly||"disable"===t||!r||"dropDown"===y?.inputType?.type)},[y,r]);const x=cw(M),[V,k]=c("border-none"),[S,z]=c({label:"",value:""}),[Z,O]=c({label:"",value:""}),[N,T]=c({color:b.color,backgroundColor:b.backgroundColor,borderColor:b.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"}],D=Rv.map(e=>({label:e,value:e})),F=o(null),R=o(null);l(()=>{let e=setTimeout(()=>{d(w,N.color)},0);return()=>{clearTimeout(e)}},[N.color]),l(()=>{let e=setTimeout(()=>{C(w,N.backgroundColor)},0);return()=>{clearTimeout(e)}},[N.backgroundColor]);return l(()=>{const e=M.fontFamily,t=`${Iv(M.fontSize)}`;z({label:e??"Times New Roman",value:e??"Times New Roman"}),O({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(ka,{disabled:g,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:Fv,selectedOption:S})}),e("div",{className:"ff-excel-toolbar-font-size",children:e(ka,{disabled:g,height:24,showLabel:!1,optionZIndex:2e3,required:!1,onChange:e=>{O({label:e.label,value:e.value}),u(w,e.value)},optionsList:D,selectedOption:Z})})]}),e("div",{className:"ff-excel-toolbar-divider"}),n("div",{className:"ff-excel-toolbar-icon",children:[e(Y,{placement:"top",title:"Text Left",children:e(q,{disabled:g,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(q,{disabled:g,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(q,{disabled:g,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(q,{disabled:g,variant:x.bold?"dark":"light",hoverEffect:!x.bold,onClick:()=>i(w),name:"bold"})}),e(Y,{placement:"top",title:"Italic",children:e(q,{disabled:g,variant:x.italic?"dark":"light",hoverEffect:!x.italic,onClick:()=>a(w),name:"italic"})}),e(Y,{placement:"top",title:"Underline",children:e("div",{className:"ff-excel-toolbar-icon-underline",children:e(q,{disabled:g,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(q,{disabled:g,variant:E?"dark":"light",hoverEffect:!E,onClick:()=>{m(w)},name:"formate_painter"})}),e(Y,{placement:"top",title:"Text Color",children:n("div",{className:"ff-excel-toolbar-icon-color",children:[e(q,{disabled:g,hoverEffect:!0,width:12,height:10,onClick:()=>{d(w,N.color),F.current?.click()},name:"text_color"}),e(rw,{ref:F,disabled:g,getColorValue:e=>{T(t=>({...t,color:e}))},initialColor:N.color})]})}),e(Y,{placement:"top",title:"Background Color",children:n("div",{className:"ff-excel-toolbar-icon-color",children:[e(q,{disabled:g,hoverEffect:!0,width:12,height:10,onClick:()=>{C(w,N.backgroundColor),R.current?.click()},name:"fill_color"}),e(rw,{ref:R,disabled:g,getColorValue:e=>{T(t=>({...t,backgroundColor:e}))},initialColor:N.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(q,{hoverEffect:!0,disabled:g,onClick:()=>p(w,V,"var(--input-hover-border-color)"),name:(()=>{const e=I.find(e=>e.value===V);return e?e.icon:""})()})}),e("span",{ref:H,children:e(Ta,{disabled:g,iconName:"arrow_down",targetRef:H,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)"),k(t)}})})]})})]})},uw=(e,t)=>{let n,r=null;const i=function(...i){const a=this;null===r||Date.now()-r>=t?(e.apply(a,i),r=Date.now()):(n&&clearTimeout(n),n=setTimeout(()=>{e.apply(a,i),r=Date.now()},t-(Date.now()-r)))};return i.cancel=()=>{n&&clearTimeout(n),n=null,r=null},i},fw=r.forwardRef(function(t,i){const{className:a,columnLabels:o=[],rowLabels:l=[],toolbar:s,editable:c,onKeyDown:d,Table:u=Ty,Row:f=Iy,sheetHeight:h,HeaderRow:C=Dy,DataEditor:p=Jy,DataViewer:m=Gy,onSelect:A=()=>{},onActivate:g=()=>{},onEvaluatedDataChange:v=()=>{},contextOption:y,attachmentAction:w,workRef:E,minimumColumnWidth:b,setContextMenu:M,maxRowLimit:L,maxColLimit:H,disableDeleteOption:x,contextMenu:V,getActiveCell:k,onAddColumn:S,onDeleteColumn:z}=t,Z=32,O=b||100,N=r.useRef(!1),I=Ry(e=>e.model.data),[D,F]=r.useState(!1),[R,P]=r.useState(0),[j,B]=r.useState(0),[_,q]=r.useState({top:0,left:0}),[U,W]=r.useState(!1),[X,Q]=r.useState(!1),G=r.useMemo(()=>{const e=t.createFormulaParser||_v,n=new Qv(e,t.data);let r={},i={};t.data.forEach((e,t)=>{let n=Z;e.forEach(e=>{if(e){const t=parseFloat(String(e.style?.height).replace("px",""))||Z;n=Math.max(n,t)}}),r[t]={top:0,height:n}});const a=t.data[0]?t.data[0].length:0;for(let e=0;e<a;e++){let n=O;t.data.forEach(t=>{const r=t[e];if(r){const e=parseFloat(String(r.style?.width).replace("px",""))||O;n=Math.max(n,e)}}),i[e]={left:0,width:n}}return F(e=>!e),{...vy,model:n,selected:t.selected||vy.selected,rowDimensions:r,columnDimensions:i}},[t.createFormulaParser,t.data,t.selected]),K=r.useReducer(yy,G),[Y,J]=K,$=r.useMemo(()=>function(e,t,n){const{columns:r,rows:i}=nv(e);return{rows:t?Math.max(i,t.length):i,columns:n?Math.max(r,n.length):r}}(Y.model.data,l,o),[Y.model.data,l,o]),[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+=Y.rowDimensions[n]?.height||Z;return t},[Y.rowDimensions,Z]),ae=r.useCallback(e=>{let t=0;for(let n=0;n<e;n++)t+=Y.columnDimensions[n]?.width||O;return t},[Y.columnDimensions,O]),oe=r.useRef(!0);r.useEffect(()=>{oe.current?oe.current=!1:J(function(e){return{type:dg,payload:{minimumColumnWidth:e}}}(b))},[b]);const le=ie($.rows),se=ae($.columns),ce=ie(ee.start),de=le-ie(ee.end),ue=ae(ne.start),fe=se-ae(ne.end),he=Y.mode,Ce=r.useRef(null),pe=e=>r.useCallback((...t)=>J(e(...t)),[e]),me=pe(Cg),Ae=pe(Ug),ge=pe(qg),ve=pe(Xg),ye=pe(Pg),we=pe(jg),Ee=pe(Og),be=pe(Bg),Me=pe(_g),Le=pe(Ng),He=pe(Tg),xe=pe(Ig),Ve=pe(Ag),ke=pe(gg),Se=pe(yg),ze=pe(bg),Ze=pe(wg),Oe=pe(Eg),Ne=pe(vg),Te=pe(Mg),Ie=pe(Lg),De=pe(Hg),Fe=pe(hg),Re=pe(xg),Pe=pe(Vg),je=pe(kg),Be=pe(Sg),_e=pe(zg),qe=pe(Zg);r.useImperativeHandle(i,()=>({removeSelect:ve}));const Ue=r.useRef(Y.active);r.useEffect(()=>{if(Y.active!==Ue.current)if(Y.active)g(Y.active);else{const e=E.current;e&&Ov(e)&&document.activeElement&&document.activeElement.blur()}Ue.current=Y.active},[g,Y.active]);const We=r.useRef(Y.model.evaluatedData);r.useEffect(()=>{Y?.model?.evaluatedData!==We?.current&&v(Y?.model?.evaluatedData),We.current=Y.model.evaluatedData},[Y?.model?.evaluatedData,v]);const Xe=r.useRef(Y.selected);r.useEffect(()=>{Y.selected.equals(Xe.current)||t.selected&&Y.selected.equals(t.selected)||A(Y.selected),Xe.current=Y.selected},[Y.selected,A,t.selected]);const Qe=r.useRef(t.selected);r.useEffect(()=>{t.selected&&Qe.current&&!t.selected.equals(Qe.current)&&xe(t.selected),Qe.current=t.selected},[t.selected,xe]);let Ge=r.useRef();r.useEffect(()=>{me(c),void 0!==Ge.current&&t.data!==Ge.current&&Le(t.data),Ge.current=t.data},[t.data,Le,c]);const Ke=r.useRef(t.createFormulaParser);r.useEffect(()=>{t.createFormulaParser!==Ke.current&&t.createFormulaParser&&He(t.createFormulaParser),Ke.current=t.createFormulaParser},[t.createFormulaParser,He]);const Ye=r.useCallback(e=>{const{model:t,selected:n}=Y,{data:r}=t,i=n.toRange(r);if(i){!function(e,t){e.clipboardData?.setData(vv,t)}(e,zv(function(e,t,n){const r=[],i=t.column-e.column;for(let a=e.row;a<=t.row;a++){const o=a-e.row;r[o]=r[o]||Array(i);for(let i=e.column;i<=t.column;i++)r[o][i-e.column]=Qg({row:a,column:i},n)}return r}(i.start,i.end,r)))}},[Y]),Je=r.useCallback(e=>{Zv(Ce.current,he)&&(e.preventDefault(),e.stopPropagation(),Ye(e),Ae())},[he,Ye,Ae]),$e=r.useCallback(e=>{Zv(Ce.current,he)&&(e.preventDefault(),e.stopPropagation(),Ye(e),ge())},[he,Ye,ge]),et=r.useCallback(e=>{if(Zv(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(vv):""}(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(),Ve(I)):t&&"i"===n?(e.preventDefault(),ke(I)):t&&"u"===n&&(e.preventDefault(),Se(I)),d&&d(e),e.defaultPrevented||(function(e,t){return void 0!==Cy(e,t)}(Y,e)&&e.nativeEvent.preventDefault(),we(e))},[Y,d,we]),nt=r.useCallback(()=>{Y.formattedStyle.open&&Y.active&&Fe(Y.active)},[Y]),rt=r.useCallback(()=>{Me(),document.removeEventListener("mouseup",rt)},[Me]),it=r.useCallback(e=>{Y.dragging||1!==e.buttons||"view"!==he||(be(),document.addEventListener("mouseup",rt))},[Y,be,rt,he]),at=r.useMemo(()=>Qy(t.Cell||Xy),[t.Cell,D,c]),ot=r.useMemo(()=>jy(t.CornerIndicator||Py),[t.CornerIndicator,D]),lt=r.useMemo(()=>Wy(t.RowIndicator||Uy),[t.RowIndicator,D]),st=r.useMemo(()=>By(t.ColumnIndicator||_y),[t.ColumnIndicator,D]);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;B(Math.min(Ce.current.clientHeight,n)),P(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:a}=t;q({top:n,left:i});let o=0;for(;o<$.rows&&ie(o)<n;)o++;let l=o;for(;l<$.rows&&ie(l)<n+r;)l++;o=Math.max(0,o-10),l=Math.min($.rows,l+10),te({start:o,end:l});const s=l===$.rows;W(s);let c=0;for(;c<$.columns&&ae(c)<i;)c++;let d=c;for(;d<$.columns&&ae(d)<i+a;)d++;c=Math.max(0,c-10),d=Math.min($.columns,d+10),re({start:c,end:d});const u=d===$.columns;Q(u),V.open&&M({open:!1,contextType:null,options:[{label:"",value:"",iconName:"",action:()=>{},disableTooltip:"",visible:!1,disable:!1}]})},[$.rows,$.columns,ie,ae]),ut=r.useMemo(()=>uw(dt,16),[dt]),ft=e=>{N.current=!0,requestAnimationFrame(()=>{let t=0;for(let n=0;n<=e;n++)t+=Y.rowDimensions?.[n]?.height||Z;requestAnimationFrame(()=>{Ce.current&&e>=$.rows-1&&Ce?.current?.scrollTo({top:t+Z,behavior:"smooth"})})})},ht=e=>{N.current=!0,requestAnimationFrame(()=>{let t=0;for(let n=0;n<=e;n++)t+=Y.columnDimensions?.[n]?.width||O;requestAnimationFrame(()=>{Ce.current&&e>=$.columns-1&&Ce.current.scrollTo({left:t+60,behavior:"smooth"})})})};r.useEffect(()=>{N.current||(te({start:0,end:Math.min(20,$.rows)}),re({start:0,end:Math.min(15,$.columns)}))},[$.rows,$.columns,N.current]);const Ct=yv(ee.end,ee.start),pt=yv(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:`${Y.columnDimensions[t]?.width||O}px`}},t)),e("col",{style:{width:`${fe}px`}},"right-spacer")," "]}),At=r.useMemo(()=>n(u,{useTableRef:ct,totalWidth:se,children:[mt,n("tbody",{children:[n(C,{children:[e(ot,{}),e("div",{className:"spacer left"}),pt.map(n=>e(st,{column:n,minimumColumnWidth:b,setContextMenu:t.setContextMenu,label:n in o?o[n]:void 0,deleteColumn:qe,addColumnLeft:je,addColumnRight:Be,columnContextEnable:t.columnContextEnable,maxColLimit:H,disableDeleteOption:x,contextMenu:V,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:Re,addRowBottom:Pe,deleteRow:_e,setContextMenu:t.setContextMenu,rowContextEnable:t.rowContextEnable,maxRowLimit:L,disableDeleteOption:x,contextMenu:V,setVisibleRange:te,scrollToRow:ft},r),e("div",{className:"spacer left"}),pt.map(t=>e(at,{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,ot,o,st,l,lt,at,m,ee,ne,ce,de,ue,fe,Y.rowDimensions,Y.columnDimensions]),gt=r.useMemo(()=>e($y,{attachmentAction:w,contextOption:y,getActiveCell:k,setContextMenu:t.setContextMenu,DataEditor:p,visibleRowRange:ee,visibleColRange:ne,maxHeight:j-64,maxWidth:R-b,totalHeight:le,totalWidth:se,isAtBottom:U,isAtRight:X,scrollPos:_,editable:c},Y.active?`${Y.active.row}-${Y.active.column}`:"no-active"),[p,ee,ne,Y.active,j,R,le,se,U,X,c]),vt=r.useMemo(()=>n("div",{className:"ff-excel-spreadsheet-container",children:[e("div",{style:{width:`${R}px`},className:T("ff-excel-header-column-hider",{"ff-excel-header-extend":["show","disable"].includes(s||""),"ff-excel-header-hider":"hide"===s})}),e("div",{style:{height:`${j}px`},className:T("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(dw,{editable:c,toolbar:s,onBold:Ve,onItalic:ke,setUnderlineType:Se,setColor:Te,setBorderType:Ne,setFontSize:Ze,setFontFamily:Oe,setTextAlign:ze,setBackgroundColor:Ie,setFormatePainter:De})}),n("div",{ref:Ce,style:{height:h},className:T("ff-excel-spreadsheet",a),onKeyPress:Ee,onKeyDown:tt,onClick:nt,onMouseMove:it,onScroll:e=>ut(e),children:[At,gt,e(tw,{scrollPos:_}),e(nw,{scrollPos:_})]})]}),[a,Ee,tt,it,At,gt,R]);return e(Ny.Provider,{value:K,children:vt})}),hw=({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(q,{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(U,{as:"label",children:t.label})]})},t.label)}var r;return null})})},Cw=({excelData:r,contextOption:a,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:A=()=>Promise.resolve(),onSaveInfoChange:g,attachmentAction:v={addAttachment:()=>Promise.resolve(""),deleteAttachment:()=>Promise.resolve(""),viewAttachment:()=>Promise.resolve()},onSaveDelay:y=3e3,scroller:w=!1,columnContextEnable:E=!0,rowContextEnable:b=!0,sheetBarContextEnable:M=!0,minimumColumnWidth:L=100,disableDeleteOption:H=!1,maxRowLimit:x=1/0,maxColLimit:V=1/0,maxSheetLimit:k=1/0,getActiveCell:S=()=>{}})=>{const z=o(null),[Z,O]=c([]),[N,I]=c(""),[D,F]=i.useState({open:!1,contextType:null,options:[{label:"",value:"",iconName:"",action:()=>{},disableTooltip:"",disable:!1,visible:!1}]}),[R,P]=c({name:"defaultSheet",index:0}),[j,B]=c({defaultSheet:[[Dv]]}),[_,W]=c([[Dv]]),[X,Q]=c((A.length,{})),[G,J]=c({x:0,y:0}),$=o(""),ee=o(null),te=o(null),ne=o(null);l(()=>{const e=r;if(e){const t=e.map(e=>e.sheetName);O(t),K(t.length)||($.current=t[0]||"",P({name:t[0]||"",index:0}));const n={},r={};e.forEach(e=>{const t=e.sheetName,i=e.data,a=Math.max(u,i.length),o=Math.max(f,Math.max(...i.map(e=>e.length)));let l=Array.from({length:a},()=>Array(o).fill({value:"",style:Dv.style,readOnly:!1,inputType:void 0}));i.forEach((e,t)=>{e.forEach((e,n)=>{var r;t<a&&n<o&&(l[t]||(l[t]=[]),l[t][n]={value:(r=e.value,null==r?null:r),style:K(e?.style)?Dv.style:lw(e?.style,L),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}`),a=((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||Dv);l[n][r]={...t,value:t?.value??"",readOnly:t?.readOnly?t.readOnly:i,inputType:a,contextDisable:t?.contextDisable}})}),n[t]=l,A.length>1){const e=i[0]||[];r[t]=Array.from({length:o},(t,n)=>({newData:"",oldData:e[n]?.value||""}))}}),B(n),A.length>1&&Q(r);const i=Object.keys(n)[0];i&&void 0!==n[i]&&W(n[i])}},[r]),l(()=>{g&&g(N),"File saved"===N&&setTimeout(()=>{I("")},2e3)},[N]),l(()=>{I("Saving..."),re(ae())},[j,$.current]);const re=i.useCallback(Ks(e=>{if(A.length>1){const t={...X};Z.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=Z.map(e=>({sheetName:e,headers:t[e]||[]}));A(e,n)}else A(e);I("File saved")},y),[A,X,Z]),ie=i.useCallback(e=>{e.ctrlKey&&"s"===e.key&&(e.preventDefault(),e.stopPropagation(),re(ae()))},[A]);i.useEffect(()=>(document.addEventListener("keydown",ie),()=>{document.removeEventListener("keydown",ie)}),[ie]);const ae=()=>Z.map(e=>{const t=j[e]?.map(e=>{const t=e.reduce((e,t,n)=>{const r=""!==String(t?.value??"").trim(),i=t?.style?.width,a=t?.style?.height;return r||(void 0!==i&&i!==L||void 0!==a&&32!==a)?n:e},-1),n=e.map((e,n)=>e&&e.style&&n<=t?{value:e.value,style:cw(e.style,L),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:K(n.length)?[[]]:n}}),[oe,le]=c(null),se=()=>Z.length>=k,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",Z),t=Array.from({length:u},()=>Array.from({length:f},()=>Dv));O(t=>[...t,e]),P({index:Z?.length,name:e}),B({...j,[e]:t}),W(t),A.length>1&&Q(t=>({...t,[e]:Array.from({length:f},()=>({newData:"",oldData:""}))})),$.current=e},de=(e=[[Dv]])=>{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 sc.warning("Sheet name cannot be empty."),r.textContent=R.name,void le(null);if(i.length>50)return sc.warning("The sheet name cannot be greater than 50 characters"),r.textContent=R.name,void le(null);if(Z.map(e=>e.toLowerCase()).includes(i.toLowerCase())&&n.trim()?.toLowerCase()!==i?.toLowerCase())return sc.warning("Sheet name already exists"),r.textContent=R.name,void le(null);let a=Z;de(j?.[n]),a.splice(t,1,i);const o=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??[]}}(j,n,i);$.current=i,P(e=>({...e,name:i})),B(o),A.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!==R.name&&t!==R.index&&(P({index:t,name:e}),O(n=>{const r=[...n];return r[t]=e,r}),de(j[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)&&D.open&&(F({open:!1,contextType:null,options:[{label:"",value:"",iconName:"",action:()=>{},disableTooltip:"",visible:!1,disable:!1}]}),t||(e.preventDefault(),e.stopPropagation()))},[D.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()},...H?[]:[{label:"Delete Sheet",value:"Delete Sheet",iconName:"delete",action:()=>((e,t)=>{if(Z.length>1){let n=Z.slice();n.splice(t,1);const r={...j};delete r[e];const i=Math.min(t,n.length-1);O(n),B(r),A.length>1&&Q(t=>{const n={...t};return delete n[e],n});const a=n[i]?n[i]:"";P({index:i,name:a}),de(r?.[a]),$.current=a}else sc.warning("Cannot delete the last sheet.")})(t,n),disableTooltip:"",visible:!1,disable:!1}]];F(e=>({...e,open:!0,contextType:"sheet",options:r}))};l(()=>{ne.current?.removeSelect()},[R.name]);return e(t,{children:Z.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,a=e.clientY-(t?.top||0)+r;const o=300,l=window.innerWidth,s=window.innerHeight,c=l-e.clientX,d=e.clientX,u=s-e.clientY,f=e.clientY;c<o&&d>=o?i=e.clientX-(t?.left||0)+n-150:i+=2,u<200&&f>=200?a=e.clientY-(t?.top||0)+r-20:a+=2,e.target.classList.contains("ff-excel-tab-list")?J({x:i,y:a-(H?32:65)}):(i+o>l&&(i=l-o-2),i<0&&(i=2),J({x:i+m,y:a+p}))},onClick:e=>{e.stopPropagation(),D.open&&F({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(fw,{ref:ne,editable:C,attachmentAction:v,toolbar:s,sheetHeight:h,setContextMenu:F,contextOption:a,data:_,columnContextEnable:E,rowContextEnable:b,minimumColumnWidth:L,onEvaluatedDataChange:e=>{B(t=>({...t,[$.current]:e}))},workRef:ee,scroller:w,maxRowLimit:x,maxColLimit:V,disableDeleteOption:H,contextMenu:D,getActiveCell:S,onAddColumn:(e,t)=>{A.length>1&&Q(n=>{const r=R.name,i=[...n[r]||[]],a=t?e:e+1;return i.splice(a,0,{newData:"",oldData:""}),{...n,[r]:i}})},onDeleteColumn:e=>{A.length>1&&Q(t=>{const n=R.name,r=[...t[n]||[]];return r.splice(e,1),{...t,[n]:r}})}},R.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(q,{disabled:!C||se(),className:"ff-excel-add-sheet-icon",hoverEffect:!0,onClick:ce,name:"plus_icon",height:20,width:20})}),e(Ta,{options:(t=>t.map((t,r)=>({label:n("div",{style:{display:"flex",gap:"8px"},children:[R?.name===t?e(q,{height:16,width:16,name:"tick"}):e("div",{style:{height:"16px",width:"24px"}}),e(Y,{title:xn(t,20,"count")?t:"",children:e(U,{children:Hn(t,20,"count")})})]}),name:r,value:t})))(Z),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:R.name})]}),e("div",{className:"ff-excel-tab-container",children:Z.map((t,n)=>e(U,{lineHeight:"16px",children:e("div",{onContextMenu:e=>{fe(t,n),M&&Ce(e,t,n)},className:T("ff-excel-tab-list",{active:t===R.name}),onClick:()=>{fe(t,n)},suppressContentEditableWarning:oe===n,onDoubleClick:e=>{"show"===d&&(le(n),null===oe&&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&&oe===n,onBlur:e=>{ue(e,n,t)},onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),ue(e,n,t))},children:t})},t))})]}),D.open&&e(hw,{contextMenu:D,position:G,editable:C}),e(lc,{})]})})},pw=({label:t="",isActive:n=!0,onClick:r=()=>{},isFilterChip:i=!1})=>{const a=i?"filter":"module";return e("div",{className:T("ff-module-chip",{"ff-filter-chip":i,[`ff-${a}-chip--active`]:n,[`ff-${a}-chip--hover`]:!n}),onClick:r,children:e(U,{lineHeight:"18px",className:"module-typography",children:t})})},mw=({x:e,y:t,radius:n,startAngle:r,endAngle:i})=>{const a=e+n*Math.cos(r),o=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 ${a} ${o} A ${n} ${n} 0 ${c} 1 ${l} ${s}`},Aw=({radius:t=15,lineWidth:r=5,label:i,percentageValue:a,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}),[A,g]=c(!1),v=o(null);let y=-Math.PI/2;const w=2*(t+r),{backgroundArcPath:E,foregroundArcPath:b}=((e,t,n)=>{const r=t,i=r+Math.max(0,Math.min(e,100))/100*2*Math.PI;return{backgroundArcPath:mw({x:0,y:0,radius:n,startAngle:0,endAngle:2*Math.PI}),foregroundArcPath:mw({x:0,y:0,radius:n,startAngle:r,endAngle:i})}})(a,y,t),M=()=>{g(!0)},L=()=>{m({x:0,y:0}),g(!1)},H=e=>{if(v.current){const t=v.current.getBoundingClientRect();m({x:e.clientX-t.left,y:e.clientY-t.top})}};return n("div",{ref:v,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:E,fill:"none",stroke:f,strokeWidth:r,onMouseEnter:M,onMouseLeave:L,onMouseMove:H}),e("path",{d:b,fill:"none",stroke:u,strokeWidth:r,onMouseEnter:M,onMouseLeave:L,onMouseMove:H}),h&&e("path",{d:b,fill:"none",stroke:"var(--dotted-border-color)",strokeOpacity:"0.4",strokeWidth:r,onMouseEnter:M,onMouseLeave:L,onMouseMove:H}),l?e("foreignObject",{x:"-10",y:"-10",width:"20",height:"20",children:e(q,{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(a)}%`})]})}),A&&n("div",{className:"ff-icon-radial-chart-tooltip",style:{position:"absolute",left:`${p.x+15}px`,top:p.y-5+"px"},children:[e(U,{children:`${i} : `}),n(U,{children:[a,"%"]})]})]})},gw=({mediaSrc:t,fileId:r,onExpandClick:i,onDeleteClick:a,onDownloadClick:o,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(q,{name:"download_file_icon",height:10,width:10,onClick:o,color:"var(--icons-default-color)"})})}),u&&e("div",{className:"ff-icon-container",children:e(Y,{title:"Delete",placement:"bottom",children:e(q,{name:"delete",height:10,width:10,color:"var(--ff-delete-button-attachment)",onClick:()=>{a&&a(r)}})})})]}),e("div",{className:"ff-expand-icon-container",children:e(Y,{title:"Maximize",placement:"bottom",children:e(q,{name:"expand_icon",height:16,width:16,onClick:i})})})]}),e(U,{color:"var(--text-area-default-color)",fontWeight:"medium",className:"ff-media-text",children:c})]})}),vw=({icon:r,status:i,count:a,text:o,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(q,{name:r,height:20,width:20,hoverEffect:!1})}),!C.includes(i.toLowerCase())&&e(U,{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(U,{fontWeight:"semi-bold",fontSize:"10px",className:"ff-text",lineHeight:"15px",color:"var(--ff-chip-text-color)",children:o}),e(U,{fontWeight:"semi-bold",fontSize:"24px",className:"ff-number",lineHeight:"36px",children:"defect density"===i.toLowerCase()?n(t,{children:[a.toString().padStart(2,"0"),e(U,{fontSize:"15px",fontWeight:"semi-bold",children:"/ Modules"})]}):"quality score"===i.toLowerCase()?`${parseFloat(a.toString()).toFixed(2)}%`:a.toString().padStart(2,"0")})]}:{children:[e(U,{fontWeight:"semi-bold",fontSize:"24px",className:"ff-number",lineHeight:"24px",color:f?"var(--base-bg-color)":"",children:a.toString().padStart(2,"0")}),e(U,{className:"ff-text",lineHeight:"18px",color:f?"var(--base-bg-color)":"var(--ff-chip-text-color)",children:o})]})})]})},yw=({option:t})=>{const r=o(null),[i,a]=c(!1);l(()=>{const e=r.current;if(!e)return;const t=()=>{a(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(q,{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})]})};function ww(e){return()=>e}function Ew(e){e()}function bw(e,t){return n=>e(t(n))}function Mw(e,t){return()=>e(t)}function Lw(e){return void 0!==e}function Hw(){}function xw(e,t){return t(e),e}function Vw(e,t){return t(e)}function kw(...e){return e}function Sw(e,t){return e(1,t)}function zw(e,t){e(0,t)}function Zw(e){e(2)}function Ow(e){return e(4)}function Nw(e,t){return Sw(e,function(e,t){return n=>e(t,n)}(t,0))}function Tw(e,t){const n=e(1,e=>{n(),t(e)});return n}function Iw(e){let t,n;return r=>i=>{t=i,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function Dw(e,t){return e===t}function Fw(e=Dw){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function Rw(e){return t=>n=>{e(n)&&t(n)}}function Pw(e){return t=>bw(t,e)}function jw(e){return t=>()=>{t(e)}}function Bw(e,...t){const n=function(...e){return t=>e.reduceRight(Vw,t)}(...t);return(t,r)=>{switch(t){case 2:return void Zw(e);case 1:return Sw(e,n(r))}}}function _w(e,t){return n=>r=>{n(t=e(t,r))}}function qw(e){return t=>n=>{e>0?e--:t(n)}}function Uw(e){let t,n=null;return r=>i=>{n=i,!t&&(t=setTimeout(()=>{t=void 0,r(n)},e))}}function Ww(...e){const t=new Array(e.length);let n=0,r=null;const i=2**e.length-1;return e.forEach((e,a)=>{const o=2**a;Sw(e,e=>{const l=n;n|=o,t[a]=e,l!==i&&n===i&&r&&(r(),r=null)})}),e=>a=>{const o=()=>{e([a].concat(t))};n===i?o():r=o}}function Xw(e){let t=e;const n=Gw();return(e,r)=>{switch(e){case 0:t=r;break;case 1:r(t);break;case 4:return t}return n(e,r)}}function Qw(e,t){return xw(Xw(t),t=>Nw(e,t))}function Gw(){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 Kw(e){return xw(Gw(),t=>Nw(e,t))}function Yw(e,t=[],{singleton:n}={singleton:!0}){return{constructor:e,dependencies:t,id:Jw(),singleton:n}}const Jw=()=>Symbol();function $w(...e){const t=Gw(),n=new Array(e.length);let r=0;const i=2**e.length-1;return e.forEach((e,a)=>{const o=2**a;Sw(e,e=>{n[a]=e,r|=o,r===i&&zw(t,n)})}),function(e,a){switch(e){case 2:return void Zw(t);case 1:return r===i&&a(n),Sw(t,a)}}}function eE(e,t=Dw){return Bw(e,Fw(t))}function tE(...e){return function(t,n){switch(t){case 2:return;case 1:return function(...e){return()=>{e.map(Ew)}}(...e.map(e=>Sw(e,n)))}}}const nE=0,rE=1,iE=2,aE=3,oE={[nE]:"debug",[aE]:"error",[rE]:"log",[iE]:"warn"},lE=Yw(()=>{const e=Xw(aE);return{log:Xw((t,n,r=rE)=>{r>=((typeof globalThis>"u"?window:globalThis).VIRTUOSO_LOG_LEVEL??Ow(e))&&console[oE[r]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,n)}),logLevel:e}},[],{singleton:!0});function sE(e,t,n){return cE(e,t,n).callbackRef}function cE(e,t,n){const r=i.useRef(null);let a=e=>{};const o=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 a=e=>{e&&t?(o?.observe(e),r.current=e):(r.current&&o?.unobserve(r.current),r.current=null)},{callbackRef:a,ref:r}}function dE(e,t,n,r,a,o,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 a=[];for(let o=0;o<i;o++){const i=e.item(o);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},aE),c===s)continue;const d=a[a.length-1];0===a.length||d.size!==c||d.endIndex!==l-1?a.push({endIndex:l,size:c,startIndex:l}):a[a.length-1].endIndex++}return a}(n.children,t,s?"offsetWidth":"offsetHeight",a);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.scrollLeft:l.scrollTop:d?s?u.scrollX||u.document.documentElement.scrollLeft:u.scrollY||u.document.documentElement.scrollTop:s?c.scrollLeft:c.scrollTop,h=l?s?l.scrollWidth:l.scrollHeight:d?s?u.document.documentElement.scrollWidth:u.document.documentElement.scrollHeight:s?c.scrollWidth:c.scrollHeight,C=l?s?l.offsetWidth:l.offsetHeight:d?s?u.innerWidth:u.innerHeight:s?c.offsetWidth:c.offsetHeight;r({scrollHeight:h,scrollTop:Math.max(f,0),viewportHeight:C}),o?.(s?uE("column-gap",getComputedStyle(n).columnGap,a):uE("row-gap",getComputedStyle(n).rowGap,a)),null!==i&&e(i)},[e,t,a,o,l,r,s]);return cE(d,n,c)}function uE(e,t,n){return"normal"!==t&&!0!==t?.endsWith("px")&&n(`${e} was not resolved to pixel value correctly`,t,iE),"normal"===t?0:parseInt(t??"0",10)}function fE(e,t,n){const r=i.useRef(null),a=i.useCallback(n=>{if(!n?.offsetParent)return;const i=n.getBoundingClientRect(),a=i.width;let o,s;if(t){const e=t.getBoundingClientRect(),n=i.top-e.top;s=e.height-Math.max(0,n),o=n+t.scrollTop}else{const e=l.current.ownerDocument.defaultView;s=e.innerHeight-Math.max(0,i.top),o=i.top+e.scrollY}r.current={offsetTop:o,visibleHeight:s,visibleWidth:a},e(r.current)},[e,t]),{callbackRef:o,ref:l}=cE(a,!0,n),s=i.useCallback(()=>{a(l.current)},[a,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]),o}const hE=Yw(()=>{const e=Gw(),t=Gw(),n=Xw(0),r=Gw(),i=Xw(0),a=Gw(),o=Gw(),l=Xw(0),s=Xw(0),c=Xw(0),d=Xw(0),u=Gw(),f=Gw(),h=Xw(!1),C=Xw(!1),p=Xw(!1);return Nw(Bw(e,Pw(({scrollTop:e})=>e)),t),Nw(Bw(e,Pw(({scrollHeight:e})=>e)),o),Nw(t,i),{deviation:n,fixedFooterHeight:c,fixedHeaderHeight:s,footerHeight:d,headerHeight:l,horizontalDirection:C,scrollBy:f,scrollContainerState:e,scrollHeight:o,scrollingInProgress:h,scrollTo:u,scrollTop:t,skipAnimationFrameInResizeObserver:p,smoothScrollTargetReached:r,statefulScrollTop:i,viewportHeight:a}},[],{singleton:!0}),CE={lvl:0};function pE(e,t){const n=e.length;if(0===n)return[];let{index:r,value:i}=t(e[0]);const a=[];for(let o=1;o<n;o++){const{index:n,value:l}=t(e[o]);a.push({end:n-1,start:r,value:i}),r=n,i=l}return a.push({end:1/0,start:r,value:i}),a}function mE(e){return e===CE}function AE(e,t){if(!mE(e))return t===e.k?e.v:t<e.k?AE(e.l,t):AE(e.r,t)}function gE(e,t,n="k"){if(mE(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){const r=gE(e.r,t,n);return r[0]===-1/0?[e.k,e.v]:r}return gE(e.l,t,n)}function vE(e,t,n){return mE(e)?SE(t,n,1):t===e.k?HE(e,{k:t,v:n}):t<e.k?zE(HE(e,{l:vE(e.l,t,n)})):zE(HE(e,{r:vE(e.r,t,n)}))}function yE(){return CE}function wE(e,t,n){if(mE(e))return[];return function(e){return pE(e,({k:e,v:t})=>({index:e,value:t}))}(ME(e,gE(e,t)[0],n))}function EE(e,t){if(mE(e))return CE;const{k:n,l:r,r:i}=e;if(t===n){if(mE(r))return i;if(mE(i))return r;const[t,n]=kE(r);return LE(HE(e,{k:t,l:xE(r),v:n}))}return LE(HE(e,t<n?{l:EE(r,t)}:{r:EE(i,t)}))}function bE(e){return mE(e)?[]:[...bE(e.l),{k:e.k,v:e.v},...bE(e.r)]}function ME(e,t,n){if(mE(e))return[];const{k:r,l:i,r:a,v:o}=e;let l=[];return r>t&&(l=l.concat(ME(i,t,n))),r>=t&&r<=n&&l.push({k:r,v:o}),r<=n&&(l=l.concat(ME(a,t,n))),l}function LE(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(VE(t))return ZE(HE(e,{lvl:n-1}));if(!mE(t)&&!mE(t.r))return HE(t.r,{l:HE(t,{r:t.r.l}),lvl:n,r:HE(e,{l:t.r.r,lvl:n-1})});throw new Error("Unexpected empty nodes")}if(VE(e))return OE(HE(e,{lvl:n-1}));if(!mE(r)&&!mE(r.l)){const t=r.l,i=VE(t)?r.lvl-1:r.lvl;return HE(t,{l:HE(e,{lvl:n-1,r:t.l}),lvl:t.lvl+1,r:OE(HE(r,{l:t.r,lvl:i}))})}throw new Error("Unexpected empty nodes")}function HE(e,t){return SE(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 xE(e){return mE(e.r)?e.l:LE(HE(e,{r:xE(e.r)}))}function VE(e){return mE(e)||e.lvl>e.r.lvl}function kE(e){return mE(e.r)?[e.k,e.v]:kE(e.r)}function SE(e,t,n,r=CE,i=CE){return{k:e,l:r,lvl:n,r:i,v:t}}function zE(e){return OE(ZE(e))}function ZE(e){const{l:t}=e;return mE(t)||t.lvl!==e.lvl?e:HE(t,{r:HE(e,{l:t.r})})}function OE(e){const{lvl:t,r:n}=e;return mE(n)||mE(n.r)||n.lvl!==t||n.r.lvl!==t?e:HE(n,{l:HE(e,{r:n.l}),lvl:t+1})}function NE(e,t){return!(!e||e.startIndex!==t.startIndex||e.endIndex!==t.endIndex)}function TE(e,t){return!(!e||e[0]!==t[0]||e[1]!==t[1])}const IE=Yw(()=>({recalcInProgress:Xw(!1)}),[],{singleton:!0});function DE(e,t,n){return e[FE(e,t,n)]}function FE(e,t,n,r=0){let i=e.length-1;for(;r<=i;){const a=Math.floor((r+i)/2),o=n(e[a],t);if(0===o)return a;if(-1===o){if(i-r<2)return a-1;i=a-1}else{if(i===r)return a;r=a+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function RE(e,t){return Math.round(e.getBoundingClientRect()[t])}function PE(e){return!mE(e.groupOffsetTree)}function jE({index:e},t){return t===e?0:t<e?-1:1}function BE({offset:e},t){return t===e?0:t<e?-1:1}function _E(e,t,n){if(0===t.length)return 0;const{index:r,offset:i,size:a}=DE(t,e,jE),o=e-r,l=a*o+(o-1)*n+i;return l>0?l+n:l}function qE(e,t){if(!PE(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function UE(e,t,n){if(function(e){return typeof e.groupIndex<"u"}(e))return t.groupIndices[e.groupIndex]+1;let r=qE("LAST"===e.index?n:e.index,t);return r=Math.max(0,r,Math.min(n,r)),r}function WE(e,t,n,r=0){return r>0&&(t=Math.max(t,DE(e,r,jE).offset)),pE(function(e,t,n,r){const i=FE(e,t,r),a=FE(e,n,r,i);return e.slice(i,a+1)}(e,t,n,BE),KE)}function XE(e,[t,n,r,i]){t.length>0&&r("received item sizes",t,nE);const a=e.sizeTree;let o=a,l=0;if(n.length>0&&mE(a)&&2===t.length){const e=t[0].size,r=t[1].size;o=n.reduce((t,n)=>vE(vE(t,n,e),n+1,r),o)}else[o,l]=function(e,t){let n=mE(e)?0:1/0;for(const r of t){const{endIndex:t,size:i,startIndex:a}=r;if(n=Math.min(n,a),mE(e)){e=vE(e,0,i);continue}const o=wE(e,a-1,t+1);if(o.some(YE(r)))continue;let l=!1,s=!1;for(const{end:n,start:r,value:a}of o)l?(t>=r||i===a)&&(e=EE(e,r)):(s=a!==i,l=!0),n>t&&t>=r&&a!==i&&(e=vE(e,t+1,a));s&&(e=vE(e,a,i))}return[e,n]}(o,t);if(o===a)return e;const{lastIndex:s,lastOffset:c,lastSize:d,offsetTree:u}=GE(e.offsetTree,l,o,i);return{groupIndices:n,groupOffsetTree:n.reduce((e,t)=>vE(e,t,_E(t,u,i)),yE()),lastIndex:s,lastOffset:c,lastSize:d,offsetTree:u,sizeTree:o}}function QE(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 GE(e,t,n,r){let i=e,a=0,o=0,l=0,s=0;if(0!==t){s=FE(i,t-1,jE),l=i[s].offset;const e=gE(n,t-1);a=e[0],o=e[1],i.length&&i[s].size===gE(n,t)[1]&&(s-=1),i=i.slice(0,s+1)}else i=[];for(const{start:e,value:s}of wE(n,t,1/0)){const t=e-a,n=t*o+l+t*r;i.push({index:e,offset:n,size:s}),a=e,l=n,o=s}return{lastIndex:a,lastOffset:l,lastSize:o,offsetTree:i}}function KE(e){return{index:e.index,value:e}}function YE(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 JE={offsetHeight:"height",offsetWidth:"width"},$E=Yw(([{log:e},{recalcInProgress:t}])=>{const n=Gw(),r=Gw(),i=Qw(r,0),a=Gw(),o=Gw(),l=Xw(0),s=Xw([]),c=Xw(void 0),d=Xw(void 0),u=Xw(void 0),f=Xw(void 0),h=Xw((e,t)=>RE(e,JE[t])),C=Xw(void 0),p=Xw(0),m={groupIndices:[],groupOffsetTree:yE(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:yE()},A=Qw(Bw(n,Ww(s,e,p),_w(XE,m),Fw()),m),g=Qw(Bw(s,Fw(),_w((e,t)=>({current:t,prev:e.current}),{current:[],prev:[]}),Pw(({prev:e})=>e)),[]);Nw(Bw(s,Rw(e=>e.length>0),Ww(A,p),Pw(([e,t,n])=>{const r=e.reduce((e,r,i)=>vE(e,r,_E(r,t.offsetTree,n)||i),yE());return{...t,groupIndices:e,groupOffsetTree:r}})),A),Nw(Bw(r,Ww(A),Rw(([e,{lastIndex:t}])=>e<t),Pw(([e,{lastIndex:t,lastSize:n}])=>[{endIndex:t,size:n,startIndex:e}])),n),Nw(c,d);const v=Qw(Bw(c,Pw(e=>void 0===e)),!0);Nw(Bw(d,Rw(e=>void 0!==e&&mE(Ow(A).sizeTree)),Pw(e=>{const t=Ow(u),n=Ow(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),Nw(Bw(f,Rw(e=>void 0!==e&&e.length>0&&mE(Ow(A).sizeTree)),Pw(e=>{const t=[];let n=e[0],r=0;for(let i=1;i<e.length;i++){const a=e[i];a!==n&&(t.push({endIndex:i-1,size:n,startIndex:r}),n=a,r=i)}return t.push({endIndex:e.length-1,size:n,startIndex:r}),t})),n),Nw(Bw(s,Ww(u,d),Rw(([,e,t])=>void 0!==e&&void 0!==t),Pw(([e,t,n])=>{const r=[];for(let i=0;i<e.length;i++){const a=e[i],o=e[i+1];r.push({startIndex:a,endIndex:a,size:t}),void 0!==o&&r.push({startIndex:a+1,endIndex:o-1,size:n})}return r})),n);const y=Kw(Bw(n,Ww(A),_w(({sizes:e},[t,n])=>({changed:n!==e,sizes:n}),{changed:!1,sizes:m}),Pw(e=>e.changed)));Sw(Bw(l,_w((e,t)=>({diff:e.prev-t,prev:t}),{diff:0,prev:0}),Pw(e=>e.diff)),e=>{const{groupIndices:n}=Ow(A);if(e>0)zw(t,!0),zw(a,e+QE(e,n));else if(e<0){const t=Ow(g);t.length>0&&(e-=QE(-e,t)),zw(o,e)}}),Sw(Bw(l,Ww(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},aE)});const w=Kw(a);Nw(Bw(a,Ww(A),Pw(([e,t])=>{const n=t.groupIndices.length>0,r=[],i=t.lastSize;if(n){const n=AE(t.sizeTree,0);let a=0,o=0;for(;a<e;){const e=t.groupIndices[o],l=t.groupIndices.length===o+1?1/0:t.groupIndices[o+1]-e-1;r.push({endIndex:e,size:n,startIndex:e}),r.push({endIndex:e+1+l-1,size:i,startIndex:e+1}),o++,a+=l+1}const l=bE(t.sizeTree);return a!==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 bE(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 E=Kw(Bw(o,Ww(A,p),Pw(([e,{offsetTree:t},n])=>_E(-e,t,n))));return Nw(Bw(o,Ww(A,p),Pw(([e,t,n])=>{if(t.groupIndices.length>0){if(mE(t.sizeTree))return t;let r=yE();const i=Ow(g);let a=0,o=0,l=0;for(;a<-e;){l=i[o];const e=i[o+1]-l-1;o++,a+=e+1}if(r=bE(t.sizeTree).reduce((t,{k:n,v:r})=>vE(t,Math.max(0,n+e),r),r),a!==-e){r=vE(r,0,AE(t.sizeTree,l));r=vE(r,1,gE(t.sizeTree,1-e)[1])}return{...t,sizeTree:r,...GE(t.offsetTree,0,r,n)}}const r=bE(t.sizeTree).reduce((t,{k:n,v:r})=>vE(t,Math.max(0,n+e),r),yE());return{...t,sizeTree:r,...GE(t.offsetTree,0,r,n)}})),A),{beforeUnshiftWith:w,data:C,defaultItemSize:d,firstItemIndex:l,fixedItemSize:c,fixedGroupSize:u,gap:p,groupIndices:s,heightEstimates:f,itemSize:h,listRefresh:y,shiftWith:o,shiftWithOffset:E,sizeRanges:n,sizes:A,statefulTotalCount:i,totalCount:r,trackItemSizes:v,unshiftWith:a}},kw(lE,IE),{singleton:!0});function eb(e){return e.reduce((e,t)=>(e.groupIndices.push(e.totalCount),e.totalCount+=t+1,e),{groupIndices:[],totalCount:0})}const tb=Yw(([{groupIndices:e,sizes:t,totalCount:n},{headerHeight:r,scrollTop:i}])=>{const a=Gw(),o=Gw(),l=Kw(Bw(a,Pw(eb)));return Nw(Bw(l,Pw(e=>e.totalCount)),n),Nw(Bw(l,Pw(e=>e.groupIndices)),e),Nw(Bw($w(i,t,r),Rw(([e,t])=>PE(t)),Pw(([e,t,n])=>gE(t.groupOffsetTree,Math.max(e-n,0),"v")[0]),Fw(),Pw(e=>[e])),o),{groupCounts:a,topItemsIndexes:o}},kw($E,hE)),nb=Yw(([{log:e}])=>{const t=Xw(!1),n=Kw(Bw(t,Rw(e=>e),Fw()));return Sw(t,t=>{t&&Ow(e)("props updated",{},nE)}),{didMount:n,propsReady:t}},kw(lE),{singleton:!0}),rb=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function ib(e){const t="number"==typeof e?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!rb)&&(t.behavior="auto"),void 0===t.offset&&(t.offset=0),t}const ab=Yw(([{gap:e,listRefresh:t,sizes:n,totalCount:r},{fixedFooterHeight:i,fixedHeaderHeight:a,footerHeight:o,headerHeight:l,scrollingInProgress:s,scrollTo:c,smoothScrollTargetReached:d,viewportHeight:u},{log:f}])=>{const h=Gw(),C=Gw(),p=Xw(0);let m=null,A=null,g=null;function v(){null!==m&&(m(),m=null),null!==g&&(g(),g=null),A&&(clearTimeout(A),A=null),zw(s,!1)}return Nw(Bw(h,Ww(n,u,r,p,l,o,f),Ww(e,a,i),Pw(([[e,n,r,i,a,o,l,c],u,f,p])=>{const y=ib(e),{align:w,behavior:E,offset:b}=y,M=i-1,L=UE(y,n,M);let H=_E(L,n.offsetTree,u)+o;"end"===w?(H+=f+gE(n.sizeTree,L)[1]-r+p,L===M&&(H+=l)):"center"===w?H+=(f+gE(n.sizeTree,L)[1]-r+p)/2:H-=a,void 0!==b&&0!==b&&(H+=b);const x=t=>{v(),t?(c("retrying to scroll to",{location:e},nE),zw(h,e)):(zw(C,!0),c("list did not change, scroll successful",{},nE))};if(v(),"smooth"===E){let e=!1;g=Sw(t,t=>{e=e||t}),m=Tw(d,()=>{x(e)})}else m=Tw(Bw(t,function(e){return t=>{const n=setTimeout(()=>{t(!1)},e);return e=>{e&&(t(!0),clearTimeout(n))}}}(150)),x);return A=setTimeout(()=>{v()},1200),zw(s,!0),c("scrolling from index to",{behavior:E,index:L,top:H},nE),{behavior:E,top:H}})),c),{scrollTargetReached:C,scrollToIndex:h,topListHeight:p}},kw($E,hE,lE),{singleton:!0});function ob(e,t){0===e?t():requestAnimationFrame(()=>{ob(e-1,t)})}function lb(e,t){const n=t-1;return"number"==typeof e?e:"LAST"===e.index?n:e.index}const sb=Yw(([{defaultItemSize:e,listRefresh:t,sizes:n},{scrollTop:r},{scrollTargetReached:i,scrollToIndex:a},{didMount:o}])=>{const l=Xw(!0),s=Xw(0),c=Xw(!0);return Nw(Bw(o,Ww(s),Rw(([e,t])=>0!==t),jw(!1)),l),Nw(Bw(o,Ww(s),Rw(([e,t])=>0!==t),jw(!1)),c),Sw(Bw($w(t,o),Ww(l,n,e,c),Rw(([[,e],t,{sizeTree:n},r,i])=>e&&(!mE(n)||Lw(r))&&!t&&!i),Ww(s)),([,e])=>{Tw(i,()=>{zw(c,!0)}),ob(4,()=>{Tw(r,()=>{zw(l,!0)}),zw(a,e)})}),{initialItemFinalLocationReached:c,initialTopMostItemIndex:s,scrolledToInitialItem:l}},kw($E,hE,ab,nb),{singleton:!0});function cb(e,t){return Math.abs(e-t)<1.01}const db="up",ub="down",fb={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},hb=Yw(([{footerHeight:e,headerHeight:t,scrollBy:n,scrollContainerState:r,scrollTop:i,viewportHeight:a}])=>{const o=Xw(!1),l=Xw(!0),s=Gw(),c=Gw(),d=Xw(4),u=Xw(0),f=Qw(Bw(tE(Bw(eE(i),qw(1),jw(!0)),Bw(eE(i),qw(1),jw(!1),Iw(100))),Fw()),!1),h=Qw(Bw(tE(Bw(n,jw(!0)),Bw(n,jw(!1),Iw(200))),Fw()),!1);Nw(Bw($w(eE(i),eE(u)),Pw(([e,t])=>e<=t),Fw()),l),Nw(Bw(l,Uw(50)),c);const C=Kw(Bw($w(r,eE(a),eE(t),eE(e),eE(d)),_w((e,[{scrollHeight:t,scrollTop:n},r,i,a,o])=>{const l={scrollHeight:t,scrollTop:n,viewportHeight:r};if(n+r-t>-o){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}},fb),Fw((e,t)=>void 0!==e&&e.atBottom===t.atBottom))),p=Qw(Bw(r,_w((e,{scrollHeight:t,scrollTop:n,viewportHeight:r})=>{if(!cb(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}),Rw(e=>e.changed),Pw(e=>e.jump)),0);Nw(Bw(C,Pw(e=>e.atBottom)),o),Nw(Bw(o,Uw(50)),s);const m=Xw(ub);Nw(Bw(r,Pw(({scrollTop:e})=>e),Fw(),_w((e,t)=>Ow(h)?{direction:e.direction,prevScrollTop:t}:{direction:t<e.prevScrollTop?db:ub,prevScrollTop:t},{direction:ub,prevScrollTop:0}),Pw(e=>e.direction)),m),Nw(Bw(r,Uw(50),jw("none")),m);const A=Xw(0);return Nw(Bw(f,Rw(e=>!e),jw(0)),A),Nw(Bw(i,Uw(100),Ww(f),Rw(([e,t])=>t),_w(([e,t],[n])=>[t,n],[0,0]),Pw(([e,t])=>t-e)),A),{atBottomState:C,atBottomStateChange:s,atBottomThreshold:d,atTopStateChange:c,atTopThreshold:u,isAtBottom:o,isAtTop:l,isScrolling:f,lastJumpDueToItemResize:p,scrollDirection:m,scrollVelocity:A}},kw(hE)),Cb="top",pb="bottom",mb="none";function Ab(e,t,n){return"number"==typeof e?n===db&&t===Cb||n===ub&&t===pb?e:0:n===db?t===Cb?e.main:e.reverse:t===pb?e.main:e.reverse}function gb(e,t){return"number"==typeof e?e:e[t]??0}const vb=Yw(([{deviation:e,fixedHeaderHeight:t,headerHeight:n,scrollTop:r,viewportHeight:i}])=>{const a=Gw(),o=Xw(0),l=Xw(0),s=Xw(0);return{increaseViewportBy:l,listBoundary:a,overscan:s,topListHeight:o,visibleRange:Qw(Bw($w(eE(r),eE(i),eE(n),eE(a,TE),eE(s),eE(o),eE(t),eE(e),eE(l)),Pw(([e,t,n,[r,i],a,o,l,s,c])=>{const d=e-s,u=o+l,f=Math.max(n-d,0);let h=mb;const C=gb(c,Cb),p=gb(c,pb);return r-=s,i+=n+l,(r+=n+l)>e+u-C&&(h=db),(i-=s)<e-f+t+p&&(h=ub),h!==mb?[Math.max(d-n-Ab(a,Cb,h)-C,0),d-f-l+t+Ab(a,pb,h)+p]:null}),Rw(e=>null!==e),Fw(TE)),[0,0])}},kw(hE),{singleton:!0});const yb={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function wb(e,t,n,r,i,a){const{lastIndex:o,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-o,f=c,h=l+u*s+(u-1)*r-d;return{bottom:d,firstItemIndex:a,items:bb(e,i,a),offsetBottom:h,offsetTop:c,top:f,topItems:bb(t,i,a),topListHeight:t.reduce((e,t)=>t.size+e,0),totalCount:n}}function Eb(e,t,n,r,i,a){let o=0;if(n.groupIndices.length>0)for(const t of n.groupIndices){if(t-o>=e)break;o++}const l=e+o,s=lb(t,l);return wb(Array.from({length:l}).map((e,t)=>({data:a[t+s],index:t+s,offset:0,size:0})),[],l,i,n,r)}function bb(e,t,n){if(0===e.length)return[];if(!PE(t))return e.map(e=>({...e,index:e.index+n,originalIndex:e.index}));const r=e[0].index,i=e[e.length-1].index,a=[],o=wE(t.groupOffsetTree,r,i);let l,s=0;for(const r of e){let e;(!l||l.end<r.index)&&(l=o.shift(),s=t.groupIndices.indexOf(l.start)),e=r.index===l.start?{index:s,type:"group"}:{groupIndex:s,index:r.index-(s+1)+n},a.push({...e,data:r.data,offset:r.offset,originalIndex:r.index,size:r.size})}return a}function Mb(e,t){return void 0===e?0:"number"==typeof e?e:e[t]??0}const Lb=Yw(([{data:e,firstItemIndex:t,gap:n,sizes:r,totalCount:i},a,{listBoundary:o,topListHeight:l,visibleRange:s},{initialTopMostItemIndex:c,scrolledToInitialItem:d},{topListHeight:u},f,{didMount:h},{recalcInProgress:C}])=>{const p=Xw([]),m=Xw(0),A=Gw(),g=Xw(0);Nw(a.topItemsIndexes,p);const v=Qw(Bw($w(h,C,eE(s,TE),eE(i),eE(r),eE(c),d,eE(p),eE(t),eE(n),eE(g),e),Rw(([e,t,,n,,,,,,,,r])=>{const i=void 0!==r&&r.length!==n;return e&&!t&&!i}),Pw(([,,[e,t],n,r,i,a,o,l,s,c,d])=>{const u=r,{offsetTree:f,sizeTree:h}=u,C=Ow(m);if(0===n)return{...yb,totalCount:n};if(0===e&&0===t)return 0===C?{...yb,totalCount:n}:Eb(C,i,r,l,s,d||[]);if(mE(h))return C>0?null:wb(function(e,t,n){if(PE(t)){const r=qE(e,t);return[{index:gE(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}]}(lb(i,n),u,d),[],n,s,u,l);const p=[];if(o.length>0){const e=o[0],t=o[o.length-1];let n=0;for(const r of wE(h,e,t)){const i=r.value,a=Math.max(r.start,e),o=Math.min(r.end,t);for(let e=a;e<=o;e++)p.push({data:d?.[e],index:e,offset:n,size:i}),n+=i}}if(!a)return wb([],p,n,s,u,l);const A=o.length>0?o[o.length-1]+1:0,g=WE(f,e,t,A);if(0===g.length)return null;const v=n-1,y=xw([],n=>{for(const r of g){const i=r.value;let a=i.offset,o=r.start;const l=i.size;if(i.offset<e){o+=Math.floor((e-i.offset+s)/(l+s));const t=o-r.start;a+=t*l+t*s}o<A&&(a+=(A-o)*l,o=A);const c=Math.min(r.end,v);for(let e=o;e<=c&&!(a>=t);e++)n.push({data:d?.[e],index:e,offset:a,size:l}),a+=l+s}}),w=Mb(c,Cb),E=Mb(c,pb);if(y.length>0&&(w>0||E>0)){const e=y[0],t=y[y.length-1];if(w>0&&e.index>A){const t=Math.min(w,e.index-A),n=[];let r=e.offset;for(let i=e.index-1;i>=e.index-t;i--){const t=wE(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(E>0&&t.index<v){const e=Math.min(E,v-t.index);let n=t.offset+t.size+s;for(let r=t.index+1;r<=t.index+e;r++){const e=wE(h,r,r)[0]?.value??t.size;y.push({data:d?.[r],index:r,offset:n,size:e}),n+=e+s}}}return wb(y,p,n,s,u,l)}),Rw(e=>null!==e),Fw()),yb);Nw(Bw(e,Rw(Lw),Pw(e=>e?.length)),i),Nw(Bw(v,Pw(e=>e.topListHeight)),u),Nw(u,l),Nw(Bw(v,Pw(e=>[e.top,e.bottom])),o),Nw(Bw(v,Pw(e=>e.items)),A);const y=Kw(Bw(v,Rw(({items:e})=>e.length>0),Ww(i,e),Rw(([{items:e},t])=>e[e.length-1].originalIndex===t-1),Pw(([,e,t])=>[e-1,t]),Fw(TE),Pw(([e])=>e))),w=Kw(Bw(v,Uw(200),Rw(({items:e,topItems:t})=>e.length>0&&e[0].originalIndex===t.length),Pw(({items:e})=>e[0].index),Fw())),E=Kw(Bw(v,Rw(({items:e})=>e.length>0),Pw(({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}}),Fw(NE)));return{endReached:y,initialItemCount:m,itemsRendered:A,listState:v,minOverscanItemCount:g,rangeChanged:E,startReached:w,topItemsIndexes:p,...f}},kw($E,tb,vb,sb,ab,hb,nb,IE),{singleton:!0}),Hb=Yw(([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:n,headerHeight:r},{listState:i}])=>{const a=Gw(),o=Qw(Bw($w(n,e,r,t,i),Pw(([e,t,n,r,i])=>e+t+n+r+i.offsetBottom+i.bottom)),0);return Nw(eE(o),a),{totalListHeight:o,totalListHeightChanged:a}},kw(hE,Lb),{singleton:!0}),xb=Yw(([{viewportHeight:e},{totalListHeight:t}])=>{const n=Xw(!1);return{alignToBottom:n,paddingTopAddition:Qw(Bw($w(n,e,t),Rw(([e])=>e),Pw(([,e,t])=>Math.max(0,e-t)),Uw(0),Fw()),0)}},kw(hE,Hb),{singleton:!0}),Vb=Yw(()=>({context:Xw(null)})),kb=({itemBottom:e,itemTop:t,locationParams:{align:n,behavior:r,...i},viewportBottom:a,viewportTop:o})=>t<o?{...i,align:n??"start",...void 0!==r?{behavior:r}:{}}:e>a?{...i,align:n??"end",...void 0!==r?{behavior:r}:{}}:null,Sb=Yw(([{gap:e,sizes:t,totalCount:n},{fixedFooterHeight:r,fixedHeaderHeight:i,headerHeight:a,scrollingInProgress:o,scrollTop:l,viewportHeight:s},{scrollToIndex:c}])=>{const d=Gw();return Nw(Bw(d,Ww(t,s,n,a,i,r,l),Ww(e),Pw(([[e,t,n,r,i,a,l,s],c])=>{const{calculateViewLocation:d=kb,done:u,...f}=e,h=UE(e,t,r-1),C=_E(h,t.offsetTree,c)+i+a,p=d({itemBottom:C+gE(t.sizeTree,h)[1],itemTop:C,locationParams:f,viewportBottom:s+n-l,viewportTop:s+a});return null!==p?u&&Tw(Bw(o,Rw(e=>!e),qw(Ow(o)?1:2)),u):u?.(),p}),Rw(e=>null!==e)),c),{scrollIntoView:d}},kw($E,hE,ab,Lb,lE),{singleton:!0});function zb(e){return!1!==e&&("smooth"===e?"smooth":"auto")}const Zb=Yw(([{listRefresh:e,totalCount:t,fixedItemSize:n,data:r},{atBottomState:i,isAtBottom:a},{scrollToIndex:o},{scrolledToInitialItem:l},{didMount:s,propsReady:c},{log:d},{scrollingInProgress:u},{context:f},{scrollIntoView:h}])=>{const C=Xw(!1),p=Gw();let m=null;function A(e){zw(o,{align:"end",behavior:e,index:"LAST"})}function g(e){const t=Tw(i,t=>{e&&!t.atBottom&&"SIZE_INCREASED"===t.notAtBottomBecause&&null===m&&(Ow(d)("scrolling to bottom due to increased size",{},nE),A("auto"))});setTimeout(t,100)}Sw(Bw($w(Bw(eE(t),qw(1)),s),Ww(eE(C),a,l,u),Pw(([[e,t],n,r,i,a])=>{let o=t&&i,l="auto";return o&&(l=((e,t)=>"function"==typeof e?zb(e(t)):t&&zb(e))(n,r||a),o=o&&!1!==l),{followOutputBehavior:l,shouldFollow:o,totalCount:e}}),Rw(({shouldFollow:e})=>e)),({followOutputBehavior:t,totalCount:r})=>{null!==m&&(m(),m=null),void 0!==Ow(n)?requestAnimationFrame(()=>{Ow(d)("following output to ",{totalCount:r},nE),A(t)}):m=Tw(e,()=>{Ow(d)("following output to ",{totalCount:r},nE),A(t),m=null})}),Sw(Bw($w(eE(C),t,c),Rw(([e,,t])=>!1!==e&&t),_w(({value:e},[,t])=>({refreshed:e===t,value:t}),{refreshed:!1,value:0}),Rw(({refreshed:e})=>e),Ww(C,t)),([,e])=>{Ow(l)&&g(!1!==e)}),Sw(p,()=>{g(!1!==Ow(C))}),Sw($w(eE(C),i),([e,t])=>{!1!==e&&!t.atBottom&&"VIEWPORT_HEIGHT_DECREASING"===t.notAtBottomBecause&&A("auto")});const v=Xw(null),y=Gw();return Nw(tE(Bw(eE(r),Pw(e=>e?.length??0)),Bw(eE(t))),y),Sw(Bw($w(Bw(y,qw(1)),s),Ww(eE(v),l,u,f),Pw(([[e,t],n,r,i,a])=>t&&r&&n?.({context:a,totalCount:e,scrollingInProgress:i})),Rw(e=>!!e),Uw(0)),t=>{null!==m&&(m(),m=null),void 0!==Ow(n)?requestAnimationFrame(()=>{Ow(d)("scrolling into view",{}),zw(h,t)}):m=Tw(e,()=>{Ow(d)("scrolling into view",{}),zw(h,t),m=null})}),{autoscrollToBottom:p,followOutput:C,scrollIntoViewOnChange:v}},kw($E,hb,ab,sb,nb,lE,hE,Vb,Sb)),Ob=Yw(([{data:e,firstItemIndex:t,gap:n,sizes:r},{initialTopMostItemIndex:i},{initialItemCount:a,listState:o},{didMount:l}])=>(Nw(Bw(l,Ww(a),Rw(([,e])=>0!==e),Ww(i,r,t,n,e),Pw(([[,e],t,n,r,i,a=[]])=>Eb(e,t,n,r,i,a))),o),{}),kw($E,sb,Lb,nb),{singleton:!0}),Nb=Yw(([{didMount:e},{scrollTo:t},{listState:n}])=>{const r=Xw(0);return Sw(Bw(e,Ww(r),Rw(([,e])=>0!==e),Pw(([,e])=>({top:e}))),e=>{Tw(Bw(n,qw(1),Rw(e=>e.items.length>1)),()=>{requestAnimationFrame(()=>{zw(t,e)})})}),{initialScrollTop:r}},kw(nb,hE,Lb),{singleton:!0}),Tb=Yw(([{scrollVelocity:e}])=>{const t=Xw(!1),n=Gw(),r=Xw(!1);return Nw(Bw(e,Ww(r,t,n),Rw(([e,t])=>!1!==t&&void 0!==t),Pw(([e,t,n,r])=>{const{enter:i,exit:a}=t;if(n){if(a(e,r))return!1}else if(i(e,r))return!0;return n}),Fw()),t),Sw(Bw($w(t,e,n),Ww(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}},kw(hb),{singleton:!0}),Ib=Yw(([{scrollContainerState:e,scrollTo:t}])=>{const n=Gw(),r=Gw(),i=Gw(),a=Xw(!1),o=Xw(void 0);return Nw(Bw($w(n,r),Pw(([{scrollHeight:e,scrollTop:t,viewportHeight:n},{offsetTop:r}])=>({scrollHeight:e,scrollTop:Math.max(0,t-r),viewportHeight:n}))),e),Nw(Bw(t,Ww(r),Pw(([e,{offsetTop:t}])=>({...e,top:e.top+t}))),i),{customScrollParent:o,useWindowScroll:a,windowScrollContainerState:n,windowScrollTo:i,windowViewportRect:r}},kw(hE)),Db=Yw(([{sizeRanges:e,sizes:t},{headerHeight:n,scrollTop:r},{initialTopMostItemIndex:i},{didMount:a},{useWindowScroll:o,windowScrollContainerState:l,windowViewportRect:s}])=>{const c=Gw(),d=Xw(void 0),u=Xw(null),f=Xw(null);return Nw(l,u),Nw(s,f),Sw(Bw(c,Ww(t,r,o,u,f,n)),([e,t,n,r,i,a,o])=>{const l=function(e){return bE(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!==a&&(n=i.scrollTop-a.offsetTop),e({ranges:l,scrollTop:n-=o})}),Nw(Bw(d,Rw(Lw),Pw(Fb)),i),Nw(Bw(a,Ww(d),Rw(([,e])=>void 0!==e),Fw(),Pw(([,e])=>e.ranges)),e),{getState:c,restoreStateFrom:d}},kw($E,hE,sb,nb,Ib));function Fb(e){return{align:"start",index:0,offset:e.scrollTop}}const Rb=Yw(([{topItemsIndexes:e}])=>{const t=Xw(0);return Nw(Bw(t,Rw(e=>e>=0),Pw(e=>Array.from({length:e}).map((e,t)=>t))),e),{topItemCount:t}},kw(Lb));function Pb(e){let t,n=!1;return()=>(n||(n=!0,t=e()),t)}const jb=Pb(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),Bb=Yw(([{deviation:e,scrollBy:t,scrollingInProgress:n,scrollTop:r},{isAtBottom:i,isScrolling:a,lastJumpDueToItemResize:o,scrollDirection:l},{listState:s},{beforeUnshiftWith:c,gap:d,shiftWithOffset:u,sizes:f},{log:h},{recalcInProgress:C}])=>{const p=Kw(Bw(s,Ww(o),_w(([,e,t,n],[{bottom:r,items:i,offsetBottom:a,totalCount:o},l])=>{const s=r+a;let c=0;return t===o&&e.length>0&&i.length>0&&(0===i[0].originalIndex&&0===e[0].originalIndex||(c=s-n,0!==c&&(c+=l))),[c,i,o,s]},[0,[],0,0]),Rw(([e])=>0!==e),Ww(r,l,n,i,h,C),Rw(([,e,t,n,,,r])=>!r&&!n&&0!==e&&t===db),Pw(([[e],,,,,t])=>(t("Upward scrolling compensation",{amount:e},nE),e))));function m(n){n>0?(zw(t,{behavior:"auto",top:-n}),zw(e,0)):(zw(e,0),zw(t,{behavior:"auto",top:-n}))}return Sw(Bw(p,Ww(e,a)),([t,n,r])=>{r&&jb()?zw(e,n-t):m(-t)}),Sw(Bw($w(Qw(a,!1),e,C),Rw(([e,t,n])=>!e&&!n&&0!==t),Pw(([e,t])=>t),Uw(1)),m),Nw(Bw(u,Pw(e=>({top:-e}))),t),Sw(Bw(c,Ww(f,d),Pw(([e,{groupIndices:t,lastSize:n,sizeTree:r},i])=>{function a(e){return e*(n+i)}if(0===t.length)return a(e);let o=0;const l=AE(r,0);let s=0,c=0;for(;s<e;){s++,o+=l;let n=t.length===c+1?1/0:t[c+1]-t[c]-1;s+n>e&&(o-=l,n=e-s+1),s+=n,o+=a(n),c++}return o})),n=>{zw(e,n),requestAnimationFrame(()=>{zw(t,{top:n}),requestAnimationFrame(()=>{zw(e,0),zw(C,!1)})})}),{deviation:e}},kw(hE,hb,Lb,$E,lE,IE)),_b=Yw(([e,t,n,r,i,a,o,l,s,c,d])=>({...e,...t,...n,...r,...i,...a,...o,...l,...s,...c,...d}),kw(vb,Ob,nb,Tb,Hb,Nb,xb,Ib,Sb,lE,Vb)),qb=Yw(([{data:e,defaultItemSize:t,firstItemIndex:n,fixedItemSize:r,fixedGroupSize:i,gap:a,groupIndices:o,heightEstimates:l,itemSize:s,sizeRanges:c,sizes:d,statefulTotalCount:u,totalCount:f,trackItemSizes:h},{initialItemFinalLocationReached:C,initialTopMostItemIndex:p,scrolledToInitialItem:m},A,g,v,y,{scrollToIndex:w},E,{topItemCount:b},{groupCounts:M},L])=>{const{listState:H,minOverscanItemCount:x,topItemsIndexes:V,rangeChanged:k,...S}=y;return Nw(k,L.scrollSeekRangeChanged),Nw(Bw(L.windowViewportRect,Pw(e=>e.visibleHeight)),A.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:n,fixedItemHeight:r,fixedGroupHeight:i,gap:a,groupCounts:M,heightEstimates:l,initialItemFinalLocationReached:C,initialTopMostItemIndex:p,scrolledToInitialItem:m,sizeRanges:c,topItemCount:b,topItemsIndexes:V,totalCount:f,...v,groupIndices:o,itemSize:s,listState:H,minOverscanItemCount:x,scrollToIndex:w,statefulTotalCount:u,trackItemSizes:h,rangeChanged:k,...S,...L,...A,sizes:d,...g}},kw($E,sb,hE,Db,Zb,Lb,ab,Bb,Rb,tb,_b));function Ub(e,t){const n={},r={};let i=0;const a=e.length;for(;i<a;)r[e[i]]=1,i+=1;for(const e in t)Object.hasOwn(r,e)||(n[e]=t[e]);return n}const Wb=typeof document<"u"?i.useLayoutEffect:i.useEffect;function Xb(t,n,r){const a=Object.keys(n.required||{}),o=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&&zw(e.propsReady,!1);for(const r of a){zw(e[n.required[r]],t[r])}for(const r of o)if(r in t){zw(e[n.optional[r]],t[r])}void 0!==e.propsReady&&zw(e.propsReady,!0)}function u(e){return s.reduce((t,r)=>(t[r]=function(e){let t,n;const r=()=>t?.();return function(i,a){switch(i){case 1:return a?n===a?void 0:(r(),n=a,t=Sw(e,a),t):(r(),Hw);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(()=>xw(function(e){const t=new Map,n=({constructor:e,dependencies:r,id:i,singleton:a})=>{if(a&&t.has(i))return t.get(i);const o=e(r.map(e=>n(e)));return a&&t.set(i,o),o};return n(e)}(t),e=>{d(e,p)})),[A]=i.useState(Mw(u,m));var g;Wb(()=>{for(const e of s)e in p&&Sw(A[e],p[e]);return()=>{Object.values(A).map(Zw)}},[p,A,m]),Wb(()=>{d(m,p)}),i.useImperativeHandle(h,ww((g=m,l.reduce((e,t)=>(e[t]=e=>{zw(g[n.methods[t]],e)},e),{}))));const v=r;return e(c.Provider,{value:m,children:void 0!==r?e(v,{...Ub([...a,...o,...s],p),children:C}):C})});return{Component:f,useEmitter:(e,t)=>{const n=i.useContext(c)[e];Wb(()=>Sw(n,t),[t,n])},useEmitterValue:i.version.startsWith("18")?e=>{const t=i.useContext(c)[e],n=i.useCallback(e=>Sw(t,e),[t]);return i.useSyncExternalStore(n,()=>Ow(t),()=>Ow(t))}:e=>{const t=i.useContext(c)[e],[n,r]=i.useState(Mw(Ow,t));return Wb(()=>Sw(t,e=>{e!==n&&r(ww(e))}),[t,n]),n},usePublisher:e=>{const t=i.useContext(c);return i.useCallback(n=>{zw(t[e],n)},[t,e])}}}const Qb=i.createContext(void 0),Gb=i.createContext(void 0),Kb="-webkit-sticky",Yb="sticky",Jb=Pb(()=>{if(typeof document>"u")return Yb;const e=document.createElement("div");return e.style.position=Kb,e.style.position===Kb?Kb:Yb}),$b=typeof document<"u"?i.useLayoutEffect:i.useEffect;function eM(e){return"self"in e}function tM(e,t,n,r=Hw,a,o){const l=i.useRef(null),s=i.useRef(null),c=i.useRef(null),d=i.useCallback(n=>{let r,i,a;const l=n.target;if(function(e){return"body"in e}(l)||eM(l)){const e=eM(l)?l:l.defaultView;a=!0===o?e.scrollX:e.scrollY,r=!0===o?e.document.documentElement.scrollWidth:e.document.documentElement.scrollHeight,i=!0===o?e.innerWidth:e.innerHeight}else a=!0===o?l.scrollLeft:l.scrollTop,r=!0===o?l.scrollWidth:l.scrollHeight,i=!0===o?l.offsetWidth:l.offsetHeight;const d=()=>{e({scrollHeight:r,scrollTop:Math.max(a,0),viewportHeight:i})};!0===n.suppressFlushSync?d():M.flushSync(d),null!==s.current&&(a===s.current||a<=0||a===r-i)&&(s.current=null,t(!0),c.current&&(clearTimeout(c.current),c.current=null))},[e,t,o]);return i.useEffect(()=>{const e=a||l.current;return r(a||l.current),d({suppressFlushSync:!0,target:e}),e.addEventListener("scroll",d,{passive:!0}),()=>{r(null),e.removeEventListener("scroll",d)}},[l,d,n,r,a]),{scrollByCallback:function(e){!0===o&&(e={...void 0!==e.behavior?{behavior:e.behavior}:{},...void 0!==e.top?{left:e.top}:{}}),l.current.scrollBy(e)},scrollerRef:l,scrollToCallback:function(n){const r=l.current;if(!r||(!0===o?"offsetWidth"in r&&0===r.offsetWidth:"offsetHeight"in r&&0===r.offsetHeight))return;const i="smooth"===n.behavior;let a,d,u;eM(r)?(d=Math.max(RE(r.document.documentElement,!0===o?"width":"height"),!0===o?r.document.documentElement.scrollWidth:r.document.documentElement.scrollHeight),a=!0===o?r.innerWidth:r.innerHeight,u=!0===o?window.scrollX:window.scrollY):(d=r[!0===o?"scrollWidth":"scrollHeight"],a=RE(r,!0===o?"width":"height"),u=r[!0===o?"scrollLeft":"scrollTop"]);const f=d-a;if(n.top=Math.ceil(Math.max(Math.min(f,n.top),0)),cb(a,d)||n.top===u)return e({scrollHeight:d,scrollTop:u,viewportHeight:a}),void(i&&t(!0));i?(s.current=n.top,c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{c.current=null,s.current=null,t(!0)},1e3)):s.current=null,!0===o&&(n={...void 0!==n.behavior?{behavior:n.behavior}:{},left:n.top}),r.scrollTo(n)}}}function nM(e){return e}const rM=Yw(()=>{const e=Xw(e=>`Item ${e}`),t=Xw(e=>`Group ${e}`),n=Xw({}),r=Xw(nM),i=Xw("div"),a=Xw(Hw),o=(e,t=null)=>Qw(Bw(n,Pw(t=>t[e]),Fw()),t);return{components:n,computeItemKey:r,EmptyPlaceholder:o("EmptyPlaceholder"),FooterComponent:o("Footer"),GroupComponent:o("Group","div"),groupContent:t,HeaderComponent:o("Header"),HeaderFooterTag:i,ItemComponent:o("Item","div"),itemContent:e,ListComponent:o("List","div"),ScrollerComponent:o("Scroller","div"),scrollerRef:a,ScrollSeekPlaceholder:o("ScrollSeekPlaceholder"),TopItemListComponent:o("TopItemList")}}),iM=Yw(([e,t])=>({...e,...t}),kw(qb,rM)),aM=({height:t})=>e("div",{style:{height:t}}),oM={overflowAnchor:"none",position:Jb(),zIndex:1},lM={overflowAnchor:"none"},sM={...lM,display:"inline-block",height:"100%"},cM=i.memo(function({showTopList:t=!1}){const n=HM("listState"),r=xM("sizeRanges"),a=HM("useWindowScroll"),o=HM("customScrollParent"),l=xM("windowScrollContainerState"),s=xM("scrollContainerState"),c=o||a?l:s,d=HM("itemContent"),u=HM("context"),f=HM("groupContent"),h=HM("trackItemSizes"),C=HM("itemSize"),m=HM("log"),A=xM("gap"),g=HM("horizontalDirection"),{callbackRef:v}=dE(r,C,h,t?Hw:c,m,A,o,g,HM("skipAnimationFrameInResizeObserver")),[y,w]=i.useState(0);LM("deviation",e=>{y!==e&&w(e)});const E=HM("EmptyPlaceholder"),b=HM("ScrollSeekPlaceholder")??aM,M=HM("ListComponent"),L=HM("ItemComponent"),H=HM("GroupComponent"),x=HM("computeItemKey"),V=HM("isSeeking"),k=HM("groupIndices").length>0,S=HM("alignToBottom"),z=HM("initialItemFinalLocationReached"),Z=t?{}:{boxSizing:"border-box",...g?{display:"inline-block",height:"100%",marginLeft:0!==y?y:S?"auto":0,paddingLeft:n.offsetTop,paddingRight:n.offsetBottom,whiteSpace:"nowrap"}:{marginTop:0!==y?y:S?"auto":0,paddingBottom:n.offsetBottom,paddingTop:n.offsetTop},...z?{}:{visibility:"hidden"}};return t||0!==n.totalCount||null==E?e(M,{...CM(M,u),"data-testid":t?"virtuoso-top-item-list":"virtuoso-item-list",ref:v,style:Z,children:(t?n.topItems:n.items).map(e=>{const t=e.originalIndex,r=x(t+n.firstItemIndex,e.data,u);return V?p(b,{...CM(b,u),height:e.size,index:e.index,key:r,type:e.type||"item",..."group"===e.type?{}:{groupIndex:e.groupIndex}}):"group"===e.type?p(H,{...CM(H,u),"data-index":t,"data-item-index":e.index,"data-known-size":e.size,key:r,style:oM},f(e.index,u)):p(L,{...CM(L,u),...pM(L,e.data),"data-index":t,"data-item-group-index":e.groupIndex,"data-item-index":e.index,"data-known-size":e.size,key:r,style:g?sM:lM},k?d(e.index,e.groupIndex,e.data,u):d(e.index,e.data,u))})}):e(E,{...CM(E,u)})}),dM={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},uM={outline:"none",overflowX:"auto",position:"relative"},fM=e=>({height:"100%",position:"absolute",top:0,width:"100%",...e?{display:"flex",flexDirection:"column"}:void 0}),hM={position:Jb(),top:0,width:"100%",zIndex:1};function CM(e,t){if("string"!=typeof e)return{context:t}}function pM(e,t){return{item:"string"==typeof e?void 0:t}}const mM=i.memo(function(){const t=HM("HeaderComponent"),n=xM("headerHeight"),r=HM("HeaderFooterTag"),a=sE(i.useMemo(()=>e=>{n(RE(e,"height"))},[n]),!0,HM("skipAnimationFrameInResizeObserver")),o=HM("context");return null!=t?e(r,{ref:a,children:e(t,{...CM(t,o)})}):null}),AM=i.memo(function(){const t=HM("FooterComponent"),n=xM("footerHeight"),r=HM("HeaderFooterTag"),a=sE(i.useMemo(()=>e=>{n(RE(e,"height"))},[n]),!0,HM("skipAnimationFrameInResizeObserver")),o=HM("context");return null!=t?e(r,{ref:a,children:e(t,{...CM(t,o)})}):null});function gM({useEmitter:t,useEmitterValue:n,usePublisher:r}){return i.memo(function({children:i,style:a,context:o,...l}){const s=r("scrollContainerState"),c=n("ScrollerComponent"),d=r("smoothScrollTargetReached"),u=n("scrollerRef"),f=n("horizontalDirection")||!1,{scrollByCallback:h,scrollerRef:C,scrollToCallback:p}=tM(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?uM:dM,...a},tabIndex:0,...l,...CM(c,o),children:i})})}function vM({useEmitter:t,useEmitterValue:n,usePublisher:r}){return i.memo(function({children:a,style:o,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:A,scrollerRef:g,scrollToCallback:v}=tM(c,u,d,m,C);return $b(()=>(g.current=C||p.current?.ownerDocument.defaultView,()=>{g.current=null}),[g,C]),t("windowScrollTo",v),t("scrollBy",A),e(d,{ref:p,"data-virtuoso-scroller":!0,style:{position:"relative",...o,...0!==f?{height:f+h}:void 0},...s,...CM(d,l),children:a})})}const yM=({children:t})=>{const n=i.useContext(Qb),r=xM("viewportHeight"),a=xM("fixedItemHeight"),o=HM("alignToBottom"),l=HM("horizontalDirection"),s=sE(i.useMemo(()=>bw(r,e=>RE(e,l?"width":"height")),[r,l]),!0,HM("skipAnimationFrameInResizeObserver"));return i.useEffect(()=>{n&&(r(n.viewportHeight),a(n.itemHeight))},[n,r,a]),e("div",{"data-viewport-type":"element",ref:s,style:fM(o),children:t})},wM=({children:t})=>{const n=i.useContext(Qb),r=xM("windowViewportRect"),a=xM("fixedItemHeight"),o=HM("customScrollParent"),l=fE(r,o,HM("skipAnimationFrameInResizeObserver")),s=HM("alignToBottom");return i.useEffect(()=>{n&&(a(n.itemHeight),r({offsetTop:0,visibleHeight:n.viewportHeight,visibleWidth:100}))},[n,r,a]),e("div",{"data-viewport-type":"window",ref:l,style:fM(s),children:t})},EM=({children:t})=>{const n=HM("TopItemListComponent")??"div",r=HM("headerHeight"),i={...hM,marginTop:`${r}px`},a=HM("context");return e(n,{style:i,...CM(n,a),children:t})},bM=i.memo(function(t){const r=HM("useWindowScroll"),i=HM("topItemsIndexes").length>0,a=HM("customScrollParent"),o=HM("context");return n(a||r?kM:VM,{...t,context:o,children:[i&&e(EM,{children:e(cM,{showTopList:!0})}),n(a||r?wM:yM,{children:[e(mM,{}),e(cM,{}),e(AM,{})]})]})}),{Component:MM,useEmitter:LM,useEmitterValue:HM,usePublisher:xM}=Xb(iM,{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"}},bM),VM=gM({useEmitter:LM,useEmitterValue:HM,usePublisher:xM}),kM=vM({useEmitter:LM,useEmitterValue:HM,usePublisher:xM}),SM=MM,zM=Yw(()=>{const e=Xw(e=>n("td",{children:["Item $",e]})),t=Xw(null),r=Xw(e=>n("td",{colSpan:1e3,children:["Group ",e]})),i=Xw(null),a=Xw(null),o=Xw({}),l=Xw(nM),s=Xw(Hw),c=(e,t=null)=>Qw(Bw(o,Pw(t=>t[e]),Fw()),t);return{components:o,computeItemKey:l,context:t,EmptyPlaceholder:c("EmptyPlaceholder"),FillerRow:c("FillerRow"),fixedFooterContent:a,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")}});kw(qb,zM),Jb();const ZM={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},OM={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:NM,floor:TM,max:IM,min:DM,round:FM}=Math;function RM(e,t,n){return Array.from({length:t-e+1}).map((t,r)=>({data:null===n?null:n[r+e],index:r+e}))}function PM(e,t){return void 0!==e&&e.width===t.width&&e.height===t.height}function jM(e,t){return void 0!==e&&e.column===t.column&&e.row===t.row}const BM=Yw(([{increaseViewportBy:e,listBoundary:t,overscan:n,visibleRange:r},{footerHeight:i,headerHeight:a,scrollBy:o,scrollContainerState:l,scrollTo:s,scrollTop:c,smoothScrollTargetReached:d,viewportHeight:u},f,h,{didMount:C,propsReady:p},{customScrollParent:m,useWindowScroll:A,windowScrollContainerState:g,windowScrollTo:v,windowViewportRect:y},w])=>{const E=Xw(0),b=Xw(0),M=Xw(ZM),L=Xw({height:0,width:0}),H=Xw({height:0,width:0}),x=Gw(),V=Gw(),k=Xw(0),S=Xw(null),z=Xw({column:0,row:0}),Z=Gw(),O=Gw(),N=Xw(!1),T=Xw(0),I=Xw(!0),D=Xw(!1),F=Xw(!1);Sw(Bw(C,Ww(T),Rw(([e,t])=>0!==t)),()=>{zw(I,!1)}),Sw(Bw($w(C,I,H,L,T,D),Rw(([e,t,n,r,,i])=>e&&!t&&0!==n.height&&0!==r.height&&!i)),([,,,,e])=>{zw(D,!0),ob(1,()=>{zw(x,e)}),Tw(Bw(c),()=>{zw(t,[0,0]),zw(I,!0)})}),Nw(Bw(O,Rw(e=>null!=e&&e.scrollTop>0),jw(0)),b),Sw(Bw(C,Ww(O),Rw(([,e])=>null!=e)),([,e])=>{e&&(zw(L,e.viewport),zw(H,e.item),zw(z,e.gap),e.scrollTop>0&&(zw(N,!0),Tw(Bw(c,qw(1)),e=>{zw(N,!1)}),zw(s,{top:e.scrollTop})))}),Nw(Bw(L,Pw(({height:e})=>e)),u),Nw(Bw($w(eE(L,PM),eE(H,PM),eE(z,(e,t)=>void 0!==e&&e.column===t.column&&e.row===t.row),eE(c)),Pw(([e,t,n,r])=>({gap:n,item:t,scrollTop:r,viewport:e}))),Z),Nw(Bw($w(eE(E),r,eE(z,jM),eE(H,PM),eE(L,PM),eE(S),eE(b),eE(N),eE(I),eE(T)),Rw(([,,,,,,,e])=>!e),Pw(([e,[t,n],r,i,a,o,l,,s,c])=>{const{column:d,row:u}=r,{height:f,width:h}=i,{width:C}=a;if(0===l&&(0===e||0===C))return ZM;if(0===h){const t=lb(c,e);return function(e){return{...OM,items:e}}(RM(t,t+Math.max(l-1,0),o))}const p=_M(C,h,d);let m,A;s?0===t&&0===n&&l>0?(m=0,A=l-1):(m=p*TM((t+u)/(f+u)),A=p*NM((n+u)/(f+u))-1,A=DM(e-1,IM(A,p-1)),m=DM(A,IM(0,m))):(m=0,A=-1);const g=RM(m,A,o),{bottom:v,top:y}=qM(a,r,i,g),w=NM(e/p);return{bottom:v,itemHeight:f,items:g,itemWidth:h,offsetBottom:w*f+(w-1)*u-v,offsetTop:y,top:y}})),M),Nw(Bw(S,Rw(e=>null!==e),Pw(e=>e.length)),E),Nw(Bw($w(L,H,M,z),Rw(([e,t,{items:n}])=>n.length>0&&0!==t.height&&0!==e.height),Pw(([e,t,{items:n},r])=>{const{bottom:i,top:a}=qM(e,r,t,n);return[a,i]}),Fw(TE)),t);const R=Xw(!1);Nw(Bw(c,Ww(R),Pw(([e,t])=>t||0!==e)),R);const P=Kw(Bw($w(M,E),Rw(([{items:e}])=>e.length>0),Ww(R),Rw(([[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}),Pw(([[,e]])=>e-1),Fw())),j=Kw(Bw(eE(M),Rw(({items:e})=>e.length>0&&0===e[0].index),jw(0),Fw())),B=Kw(Bw(eE(M),Ww(N),Rw(([{items:e},t])=>e.length>0&&!t),Pw(([{items:e}])=>({endIndex:e[e.length-1].index,startIndex:e[0].index})),Fw(NE),Uw(0)));Nw(B,h.scrollSeekRangeChanged),Nw(Bw(x,Ww(L,H,E,z),Pw(([e,t,n,r,i])=>{const a=ib(e),{align:o,behavior:l,offset:s}=a;let c=a.index;"LAST"===c&&(c=r-1),c=IM(0,c,DM(r-1,c));let d=UM(t,i,n,c);return"end"===o?d=FM(d-t.height+n.height):"center"===o&&(d=FM(d-t.height/2+n.height/2)),void 0!==s&&0!==s&&(d+=s),{behavior:l,top:d}})),s);const _=Qw(Bw(M,Pw(e=>e.offsetBottom+e.bottom)),0);return Nw(Bw(y,Pw(e=>({height:e.visibleHeight,width:e.visibleWidth}))),L),{customScrollParent:m,data:S,deviation:k,footerHeight:i,gap:z,headerHeight:a,increaseViewportBy:e,initialItemCount:b,itemDimensions:H,overscan:n,restoreStateFrom:O,scrollBy:o,scrollContainerState:l,scrollHeight:V,scrollTo:s,scrollToIndex:x,scrollTop:c,smoothScrollTargetReached:d,totalCount:E,useWindowScroll:A,viewportDimensions:L,windowScrollContainerState:g,windowScrollTo:v,windowViewportRect:y,...h,gridState:M,horizontalDirection:F,initialTopMostItemIndex:T,totalListHeight:_,...f,endReached:P,propsReady:p,rangeChanged:B,startReached:j,stateChanged:Z,stateRestoreInProgress:N,...w}},kw(vb,hE,hb,Tb,nb,Ib,lE));function _M(e,t,n){return IM(1,TM((e+n)/(TM(t)+n)))}function qM(e,t,n,r){const{height:i}=n;if(void 0===i||0===r.length)return{bottom:0,top:0};const a=UM(e,t,n,r[0].index);return{bottom:UM(e,t,n,r[r.length-1].index)+i,top:a}}function UM(e,t,n,r){const i=_M(e.width,n.width,t.column),a=TM(r/i),o=a*n.height+IM(0,a-1)*t.row;return o>0?o+t.row:o}const WM=Yw(()=>{const e=Xw(e=>`Item ${e}`),t=Xw({}),n=Xw(null),r=Xw("virtuoso-grid-item"),i=Xw("virtuoso-grid-list"),a=Xw(nM),o=Xw("div"),l=Xw(Hw),s=(e,n=null)=>Qw(Bw(t,Pw(t=>t[e]),Fw()),n),c=Xw(!1),d=Xw(!1);return Nw(eE(d),c),{components:t,computeItemKey:a,context:n,FooterComponent:s("Footer"),HeaderComponent:s("Header"),headerFooterTag:o,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")}}),XM=Yw(([e,t])=>({...e,...t}),kw(BM,WM)),QM=i.memo(function(){const t=tL("gridState"),n=tL("listClassName"),r=tL("itemClassName"),a=tL("itemContent"),o=tL("computeItemKey"),l=tL("isSeeking"),s=nL("scrollHeight"),c=tL("ItemComponent"),d=tL("ListComponent"),u=tL("ScrollSeekPlaceholder"),f=tL("context"),h=nL("itemDimensions"),C=nL("gap"),m=tL("log"),A=tL("stateRestoreInProgress"),g=nL("reportReadyState"),v=sE(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:aL("column-gap",getComputedStyle(e).columnGap,m),row:aL("row-gap",getComputedStyle(e).rowGap,m)})},[s,h,C,m]),!0,!1);return $b(()=>{t.itemHeight>0&&t.itemWidth>0&&g(!0)},[t]),A?null:e(d,{className:n,ref:v,...CM(d,f),"data-testid":"virtuoso-item-list",style:{paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},children:t.items.map(n=>{const i=o(n.index,n.data,f);return l?e(u,{...CM(u,f),height:t.itemHeight,index:n.index,width:t.itemWidth},i):p(c,{...CM(c,f),className:r,"data-index":n.index,key:i},a(n.index,n.data,f))})})}),GM=i.memo(function(){const t=tL("HeaderComponent"),n=nL("headerHeight"),r=tL("headerFooterTag"),a=sE(i.useMemo(()=>e=>{n(RE(e,"height"))},[n]),!0,!1),o=tL("context");return null!=t?e(r,{ref:a,children:e(t,{...CM(t,o)})}):null}),KM=i.memo(function(){const t=tL("FooterComponent"),n=nL("footerHeight"),r=tL("headerFooterTag"),a=sE(i.useMemo(()=>e=>{n(RE(e,"height"))},[n]),!0,!1),o=tL("context");return null!=t?e(r,{ref:a,children:e(t,{...CM(t,o)})}):null}),YM=({children:t})=>{const n=i.useContext(Gb),r=nL("itemDimensions"),a=nL("viewportDimensions"),o=sE(i.useMemo(()=>e=>{a(e.getBoundingClientRect())},[a]),!0,!1);return i.useEffect(()=>{n&&(a({height:n.viewportHeight,width:n.viewportWidth}),r({height:n.itemHeight,width:n.itemWidth}))},[n,a,r]),e("div",{ref:o,style:fM(!1),children:t})},JM=({children:t})=>{const n=i.useContext(Gb),r=nL("windowViewportRect"),a=nL("itemDimensions"),o=tL("customScrollParent"),l=fE(r,o,!1);return i.useEffect(()=>{n&&(a({height:n.itemHeight,width:n.itemWidth}),r({offsetTop:0,visibleHeight:n.viewportHeight,visibleWidth:n.viewportWidth}))},[n,r,a]),e("div",{ref:l,style:fM(!1),children:t})},$M=i.memo(function({...t}){const r=tL("useWindowScroll"),i=tL("customScrollParent"),a=i||r?iL:rL,o=i||r?JM:YM,l=tL("context");return e(a,{...t,...CM(a,l),children:n(o,{children:[e(GM,{}),e(QM,{}),e(KM,{})]})})}),{useEmitter:eL,useEmitterValue:tL,usePublisher:nL}=Xb(XM,{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),rL=gM({useEmitter:eL,useEmitterValue:tL,usePublisher:nL}),iL=vM({useEmitter:eL,useEmitterValue:tL,usePublisher:nL});function aL(e,t,n){return"normal"!==t&&!0!==t?.endsWith("px")&&n(`${e} was not resolved to pixel value correctly`,t,iE),"normal"===t?0:parseInt(t??"0",10)}const oL=({optionsList:r=[],onSelectVariable:i,dropdownPosition:a,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 A=o(null);l(()=>{void 0!==f&&f>=0&&requestAnimationFrame(()=>{A.current?.scrollToIndex({index:f,behavior:"auto",align:"center"})})},[f,r]);return e("div",{className:T("ff-variable-dropdown",s),style:a?{top:a.top+30,left:a.left-30,width:c,height:d,zIndex:u}:{width:c,height:d,zIndex:u},children:K(r)?e("div",{className:"ff-variable-option ff-variable-option-no-data",children:e(U,{as:"span",fontSize:12,children:"No Option"})}):e(SM,{totalCount:r.length,ref:A,data:r,itemContent:a=>{const o=r[a];return o?e("div",{className:T("ff-variable-data",{"ff-variable-data--highlighted":f===a}),onMouseDown:()=>i(o),children:c.endsWith("px")?n(t,{children:[e(Y,{title:xn(p(o),m(c),"pixel")?p(o):"",style:{width:`${m(c)}px`},children:e(U,{as:"span",fontSize:12,className:"ff-truncated_text",children:p(o)})}),e(q,{name:C(o),height:24,width:24})]}):e(yw,{option:o})},`${o.id}-${a}`):null},style:{height:d,fontSize:"12px"},overscan:10,fixedItemHeight:32})})},lL=({data:r=[],width:i,height:a,lineChartWidth:o,yAxisLabel:s,xAxisLabel:d,yAxisValueColor:u,xAxisColor:f,yAxisColor:h,yAxisLabelColor:C,textSize:p,fontWeight:m,numberSize:A,chartName:g,shouldCenterSinglePoint:v,xAxisLabelGap:y=16,isLeftOverflow:w=!1})=>{const E=40,b=i-80,M=a-80,[L,H]=c(!1),[x,V]=c({cursorX:null,hoverValues:{},dotPositions:{},tooltip:{visible:!1,left:0,top:0},currentXValue:null});l(()=>{const e=()=>{H(!1),V(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,o=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:a},children:e(U,{className:"ff-line-chart-yAxisLabel",fontSize:p,fontWeight:"semi-bold",children:s})}),e("div",{className:"ff-line-chart-svg",children:e("svg",{height:a,width:i,className:"ff-line-chart-svg",children:n("g",{transform:"translate(40, 40)",children:[e("line",{x1:0,y1:M,x2:b,y2:M,stroke:f,strokeWidth:1}),e("text",{x:b/2.1,y:M+E/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*(b/(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:A},children:t},t)),Array.from({length:o}).map((t,n)=>{const i=n*r/(o-1),a=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:A},children:a?.toFixed(1)},`y-${n}`)})]})})})]})}function k(e){if(!isNaN(e))return parseFloat(e);const t=Vr,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",Z=S?"totalMemory":"value",O=e=>{const t=r?.[0]?.data?.length;if(1===t)return v?b/2:b;const n=r[0].data.findIndex(t=>t[z]===e);return-1===n?0:n/(t-1)*b},N=Math.max(...r?.flatMap(e=>e?.data?.map(e=>k(e[Z]))),5),T=e=>{if("memory"===g){const t=Math.max(...r?.flatMap(e=>e?.data?.map(e=>k(e[Z]))));return M-e*M/(t>1024?t:1024)}return M-e*M/(0===N?1024:N)},I=e=>{if(1===e?.length){const t=e?.[0],n=O(t[z]),r=T(k(t[Z]));return`M 0 ${T(0)} L ${n} ${r}`}return e?.reduce((t,n,r)=>{const i=O(n[z]),a=T(k(n[Z]));if(0===r)return`M ${i} ${a}`;const o=e[r-1],l=o?O(o[z]):0;return`${t} C ${l+(i-l)/2} ${o?T(k(o[Z])):0}, ${i-(i-l)/2} ${a}, ${i} ${a}`},"")},D=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:a},children:e(U,{className:"ff-line-chart-yAxisLabel",fontSize:p,fontWeight:"semi-bold",children:s})}),n("div",{className:"ff-line-chart-svg",children:[e("svg",{height:a,width:i,onMouseMove:e=>{const t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left-E;if(e.clientY-t.top-E>M)return H(!1),void V({cursorX:null,hoverValues:{},dotPositions:{},tooltip:{visible:!1,left:0,top:0},currentXValue:null});let i={hoverValues:{},dotPositions:{}},a=null;r.forEach((e,t)=>{const r=e.data.reduce((e,t)=>{const r=Math.abs(n-O(t[z]));return r<e.distance?{point:t,distance:r}:e},{point:null,distance:1/0}).point;r&&(a=r[z],i.hoverValues[t]=((e,t=2)=>{let n="";if("string"==typeof e){const t=e.match(Lr),r=e.match(Hr);t&&(e=parseFloat(t[0])),r&&(n=r[0])}const r=Math.pow(10,t);return`${Math.ceil(e*r)/r} ${n}`.trim()})(r[Z]),i.dotPositions[t]={x:O(r[z]),y:T(k(r[Z]))})}),H(!0),V({cursorX:n,hoverValues:i.hoverValues,dotPositions:i.dotPositions,currentXValue:a,tooltip:a?{visible:!0,left:e.clientX+10,top:e.clientY-20}:{visible:!1,left:0,top:0}})},onMouseLeave:()=>V({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:b,y2:M,stroke:f,strokeWidth:1}),e("text",{x:b/2.1,y:M+E/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:o,opacity:(a=r.data,a.every(e=>0===k(e[Z]))?.5:1)}),x.dotPositions[i]&&n(t,{children:[e("line",{x1:x.dotPositions[i].x,y1:0,x2:x.dotPositions[i].x,y2:M,stroke:"gray",strokeWidth:.5,strokeDasharray:"4"}),e("circle",{cx:x.dotPositions[i].x,cy:x.dotPositions[i].y,r:5,fill:"white",stroke:r.color,strokeWidth:o,style:{transition:"cx 0.1s, cy 0.1s"}}),e("line",{x1:0,y1:x.dotPositions[i].y,x2:b,y2:x.dotPositions[i].y,stroke:"gray",strokeWidth:.5,strokeDasharray:"4"})]})]},i):null;var a}),(()=>{if(1===D.length){const t=D?.[0];return e("text",{x:v?b/2:b,y:M+15,textAnchor:v?"middle":"end",fill:h,className:"ff--line-chart-x-line-data",style:{fontSize:A},children:null!=t[z]?String(t[z]):""},String(t[z]))}if(D.length<7)return D.map(t=>e("text",{x:O(t[z]),y:M+15,textAnchor:"middle",fill:h,className:"ff--line-chart-x-line-data",style:{fontSize:A},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*(D?.length-1)/6),a=D[i];return e("text",{x:r*t,y:M+15,fill:h,className:"ff--line-chart-x-line-data",style:{fontSize:A},children:null!=a?.[z]?String(a?.[z]):""},String(a?.[z]))})}})(),(()=>{if("memory"===g){const t=Math.max(N,1024);return Array.from({length:6}).map((n,r)=>{const i=r*t/5,a=i/1024;return e("text",{x:-10,y:T(i),textAnchor:"end",fill:u,className:"ff-line-chart-y-axis-text",style:{fontSize:A},children:a.toFixed(1)},`y-${r}`)})}return Array.from({length:6}).map((t,n)=>{const r=n*N/5;return e("text",{x:-10,y:T(r),textAnchor:"end",fill:u,className:"ff-line-chart-y-axis-text",style:{fontSize:A},children:r.toFixed(0)},`y-${n}`)})})()]})}),L&&x.tooltip.visible&&n("div",{className:"ff-line-chart-tooltip",style:{left:w&&x.tooltip.left/2>i/1.75?x.tooltip.left-180:x.tooltip.left,top:x.tooltip.top},children:[e("div",{className:"ff-line-chart-date",children:x.currentXValue}),Object.entries(x.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))]})]})]})},sL=({onClose:t,top:r="100px",left:i="0px",className:a,description:o="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 ${a}`,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(U,{fontWeight:"semi-bold",lineHeight:"32px",className:"ff-download-client-header-text",children:"Download client"}),e(q,{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(U,{as:"div",color:"var(--download-client-content-text-color)",fontWeight:"semi-bold",textAlign:"center",lineHeight:"26px",children:o}),e(U,{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(q,{name:t,height:36,width:36})},t))})]})]})},cL=({legendName:t,height:r,width:i,children:a})=>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(U,{color:"var(--license_header_text_color)",fontSize:8,lineHeight:"12px",children:t})}),e("div",{className:"ff_children_container",children:a})]})}),dL=({onSelectVariable:t,dropdownPosition:n,filteredOptions:r=[],position:i="relative",width:a="100%",zIndex:s,truncateTextValue:c=34,highlightedIndex:d})=>{const u=o(null);return l(()=>{u.current?.scrollIntoView({block:"nearest"})},[d]),e("div",{className:T(`ff-variable-dropdown-container ${i}`),style:n?{top:n.top+30,left:n.left-30,width:a,zIndex:s}:{width:a,zIndex:s},children:K(r)?e("div",{className:"ff-variable-option no-data",children:e(U,{as:"div",children:"No Option",fontSize:14})}):r?.map((n,r)=>e("div",{className:T("ff-variable-option",{"ff-variable-option--highlighted":d===r}),onMouseDown:()=>t(n),ref:d===r?u:null,children:e(Y,{title:xn(n?.name,c,"pixel")?n?.name:"",children:e(U,{children:Hn(n?.name,c,"pixel")})})},n?.id))})},uL=a(({label:t="",hashInputValue:r="",setHashInputValue:i,variableList:a=[],placeholder:s="Enter text",onChange:d,onPaste:u,onCreateVariableClick:f,handleClearInput:h,value:C="",dropdownWidth:p="100%",dropdownHeight:m="160px",isHash:A=!1,isOnlyHash:g=!1,dataFiles:v=[],showAddVariableIcon:y=!0,helperText:E="",error:b,autoComplete:M="off",required:L=!1,zIndex:H=9999,truncateTextValue:x=34,formProps:V={},getSelectedVariable:k=()=>{},symbol:S="$",type:z="text",clearIcon:Z=!0,inputTitle:O="",onBlur:N,helperTextWidth:I,iconProps:D={isShowIcon:!1,iconName:"",iconToolTipTitle:"",isIconDisable:!1,iconColor:"",onIconClick:()=>{}},...F},R)=>{const[P,j]=c(!1),[B,_]=c(!1),[W,X]=c(0),[Q,G]=c(!1),[J,$]=c(null),[ee,te]=c(0),[ne,re]=c(!1),[ie,ae]=c([]),oe=o(null),le=o(null),[se,ce]=c("auto"),de=D?.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(R,()=>oe.current),l(()=>{null!==J&&oe.current&&(oe.current.setSelectionRange(J,J),oe.current.focus())},[J]),l(()=>{A&&j(C.startsWith("#"));const e=v?.find(e=>e.name===C),t=a?.find(e=>e?.name===C);if(C.startsWith("#")&&A){const e=C.slice(1).toLowerCase(),t=v.filter(t=>t.name.toLowerCase().includes(e));ae(t),j(!0)}const n=null!==e&&C.startsWith("#"),r=null!==t&&C.startsWith("$"),i=C.length>(t?.name.length||0),o=C.length>0&&!r||C.startsWith("#");g?re(!1):r||n||C.includes("$")||C.includes("#")?(re(!1),o&&re(!0)):i&&!C.includes("$")&&re(!0)},[C]);const ue=()=>{oe.current&&te(oe.current.selectionStart||0)},fe=ue,he=ue;l(()=>{oe.current&&te(oe.current.selectionStart||0)},[C]);const Ce=e=>{if(oe.current){const{selectionStart:t,selectionEnd:n}=oe.current,r=`${e.name}`;let a;if(a=A&&"#"===C[0]?e.name+C.slice(n||1):e.name,d){d({target:{value:a}},e),k(e.name)}oe.current.value=a,i?.(e),$((t||0)+r.length),j(!1),_(!0)}};const pe=function(e,t,n){let r=!1,i="";const a="}"===C[t-1];if(t<0||t>e.length)return{showDropdown:r,searchString:i};const o=e.lastIndexOf(S,t-1),l=e.indexOf(S,t);if(-1!==o&&(g&&"$"===e[o]?r=!1:t===o+1?(r=!0,i=""):(i=e.slice(o+1,-1===l?void 0:l),t>o+1&&(i=e.slice(o+1,t)),r=!0),B&&a&&(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,a),me=()=>a?.filter(e=>e?.name?.toLowerCase()?.includes(pe?.searchString?.toLowerCase())),Ae=C.startsWith("#"),ge=Ae?ie:me();l(()=>{X(0)},[A,pe?.showDropdown]);const ve=Boolean(pe?.showDropdown&&Q),ye=Boolean(P&&A&&Q),we=Boolean((Ae?ye:ve)&&ge.length);return n("div",{className:"ff-add-variable-container",children:[n("div",{className:"ff-add-variable-input",ref:le,children:[e(Y,{title:O,style:{width:"100%"},children:e(Hi,{...F,name:"add_variable",ref:oe,type:z,className:T("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<ge.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=ge[W];t&&Ce(t);break}case"Escape":if(!we)return;e.preventDefault(),e.stopPropagation(),j(!1),G(!1),X(0)}},onChange:d,onPaste:()=>{re(!0)},variant:"primary",label:t,placeholder:s,onClick:fe,onKeyUp:he,onFocus:()=>G(!0),onBlur:e=>{(e=>{e.relatedTarget&&e.relatedTarget.closest(".dropdown-container")||G(!1)})(e),N?.(e)},autoComplete:M,helperText:E,error:b,required:L,helperTextWidth:I,...V})}),!K(C)&&ne&&y&&e("div",{className:"ff-create-variable-container",onClick:f,children:e(U,{fontWeight:"regular",fontSize:"10px",color:"var(--brand-color)",cursor:"pointer",children:"Create Variable"})}),!K(C)&&!g&&e("div",{className:T("ff-cancel-icon-container",{"ff-cancel-icon-container--show-icon":de}),children:Z&&e(Y,{title:"Cancel",style:{zIndex:99999},children:e(q,{onClick:h,name:"close",height:16,width:16,hoverEffect:!0})})}),de&&e("div",{className:"ff-info-icon-container",children:e(Y,{title:de&&!D?.isIconDisable?D?.iconToolTipTitle:"",children:e(q,{name:D?.iconName||"",hoverEffect:!1,height:16,width:16,color:D?.iconColor||"var(--text-area-default-color)",onClick:e=>{D?.onIconClick&&D?.onIconClick(e)},disabled:D?.isIconDisable,cursorType:"pointer"})})})]}),pe?.showDropdown&&Q&&e(oL,{position:"absolute",zIndex:H,truncateTextValue:x,width:se,height:K(me())?"auto":m,optionsList:ge,onSelectVariable:Ce,highlightedIndex:W}),P&&A&&Q&&e(dL,{position:"relative",zIndex:H,truncateTextValue:x,width:se,filteredOptions:ge,onSelectVariable:Ce,highlightedIndex:W})]})}),fL=({isOpen:t,variableTypesList:r=[],onClose:i,onNameChange:a,onValueChange:o,variableName:s,variableValue:d,onVariableTypeChange:u,selectedVariableType:f,hideValue:h=!1,onHideChange:C,handleSubmit:p,mode:m="create",disabled:A,dataFiles:g=[],truncateTextValue:v=34,isEnterKeySubmit:y=!1,showHideValueOption:w=!0})=>{const[E,b]=c(!1),[M,L]=c(""),[H,x]=c(),[V,k]=c(!1),[S,z]=c(!1),[Z,O]=c({name:"",value:"",isChecked:!1});l(()=>{t&&"edit"===m&&O({name:s,value:d,isChecked:h})},[]);const N=e=>e&&0!==e.length?" "===e[0]||" "===e[e.length-1]?"Space is not allowed at starting and at the end":qn.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=qn.test(e),r=$r.test(e),i=e.length>=3&&e.length<=25;return t&&n&&r&&i}l(()=>{const e=N(s);b(!!e),L(e)},[s]),l(()=>{if("edit"!==m)return;const{name:e,value:t,isChecked:n}=Z;z(s!==e||d!==t||h!==n)},[m,s,d,h,Z]);const I=()=>{!V&&T(s)&&(k(!0),p())};l(()=>{if(!y)return;const e=e=>{if("Enter"===e.key){e.preventDefault();!T(s)||V||"edit"===m&&!S||I()}};return window.addEventListener("keydown",e),()=>{window.removeEventListener("keydown",e)}},[y,s,d,h,V,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(W,{onClick:i,label:"Cancel",variant:"tertiary"}),e(W,{variant:"primary",label:"create"===m?"Create":"Update",type:"submit",onClick:I,disabled:!T(s)||V||"edit"===m&&!S})]}),{}),children:n("div",{className:"ff-create-variable-slider",children:[e("div",{className:"ff-create-variable-slider-input",children:e(Hi,{label:"Variable Name",required:!0,type:"text",name:"variableName",value:s||"",onChange:e=>{k(!1),a(e.target.value)},error:E,helperText:M,onBlur:e=>{const t=e.target.value,n=N(t);b(!!n),L(n)}})}),e(ka,{label:"Variable Type",required:!0,onChange:e=>{u(e),k(!1)},selectedOption:f,optionsList:r,optionZIndex:99999,valueAccessor:"label",disabled:"edit"===m}),e(uL,{label:"Variable Value",placeholder:"Enter Variable value or select path using #",isHash:!0,isOnlyHash:!0,zIndex:99999,truncateTextValue:v,dataFiles:g,dropdownWidth:"100%",setHashInputValue:x,hashInputValue:H||{},value:d||"",type:h?"password":"text",onChange:(e,t)=>{const n=e.target.value;o(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:A}),e(Y,{title:"Once the value is hidden, it cannot be undone",children:e(q,{name:"info",width:12,height:12})})]})]})})},hL=e=>{if(null==e||""===e)return{};return{width:e,flex:`0 0 ${"number"==typeof e?`${e}px`:e}`}},CL=({highlightText:t="",tableMeta:r=[],tableData:i=[],accordionType:a="row",noDataContent:o,height:l="100%",withFixedHeader:s=!1,headerType:d,TableAccordionStateIconWidth:u=4,TableAccordionStateIconHeight:f=8})=>{const[h,C]=c(-1),p="number"==typeof r[0]?.width?Math.max(r[0]?.width-8,0):void 0,m=(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:"--"},A=t=>t.map((t,n)=>e("table",{className:"ff-table-accordion__table",cellSpacing:0,children:e("tbody",{className:"ff-table-accordion__tbody",children:e("tr",{className:"ff-table-accordion__body-row",children:r.map((n,r)=>e("td",{className:"ff-table-accordion__body-cell",style:hL(n.width),children:"column"===a&&0===r?"":e(U,{as:"div",className:"ff-table-accordion__cell-typography",children:n.cell?m(t,n):e(Ws,{placement:"bottom",children:m(t,n)})})},n.accessor+r))},t.id||n)})},`accordion-table-${n}`));return n("div",{style:{height:l},className:T("ff-table-accordion",{"ff-table-accordion--fixed-header":s}),children:[e("table",{cellSpacing:0,className:T("ff-table-accordion__table",{"ff-table-accordion__table--fixed-header":s}),children:e("thead",{children:e("tr",{className:"ff-table-accordion__header-row",children:r.map(t=>e("th",{style:hL(t.width),className:T("ff-table-accordion__header-cell",d&&`ff-table-accordion__header-cell--${d}`),children:e("div",{children:e(U,{fontWeight:"semi-bold",fontSize:12,children:t.header})})},`header-${t.header}`))})})}),"row"===a&&i.map((n,r)=>e(wn,{highlightText:t,headerTitle:"string"==typeof n.title?e("div",{style:{maxWidth:void 0!==p?`${p}px`:"100%"},children:e(Ws,{children:e(yn,{text:n.title,highlight:t})})}):e(Ws,{children:"row.title"}),color:"var(--text-color)",accordionContent:A(n.data),disable:n.disable,disableInfoMessage:n.disableInfoMessage,accordionStateIconName:"arrows_down_icon",AccordionStateIconWidth:u,AccordionStateIconHeight:f,className:"ff-table-accordion__row-accordion"},`accordion-row-${r}`)),"column"===a&&i.map((i,a)=>n("div",{className:"ff-table-accordion__column-group",children:[e("div",{className:"ff-display-flex",children:n("div",{className:`ff-table-accordion__column-header ${i.disable&&"ff-table-accordion__column-header--disabled"}`,style:r[0]?hL(r[0].width):{},children:[e("div",{className:"ff-table-accordion__column-label",children:e(U,{as:"div",children:e(Ws,{children:e(yn,{text:"string"==typeof i.title?i.title:"",highlight:t})})})}),e("div",{className:"ff-table-accordion__column-toggle",onClick:()=>{!i.disable&&(e=>{C(e===h?-1:e)})(a)},children:e(q,{name:h===a?"arrows_down_icon":"arrows_right_icon",color:"var(--table-with-accordion-icon-color)",width:u,height:f,hoverEffect:!1})})]})}),h===a&&e("div",{children:A(i.data)})]},`column-accordion-${a}`)),K(i)&&e("div",{className:"ff-table-accordion__empty-state",style:{height:`calc(${l} - 50px)`},children:o})]})},pL=({progressPercentage:t,totalMemory:r,usedMemory:i,color:a="var(--brand-color)",trackColor:o="#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,A=s;if(void 0!==r&&void 0!==i){const e=p(i),t=p(r);t>0?(m=e/t*100,A=s||i):(m=0,A="0MB")}else m=t||0;const g=Math.max(0,Math.min(m,100));return n("div",{className:"ff-progress-bar-container "+(A?"ff-has-label":""),style:{width:C},children:[e("div",{className:"ff-progress-bar-track",style:{backgroundColor:o,height:`${l}px`},children:e("div",{className:"ff-progress-bar",style:{width:`${g}%`,backgroundColor:a,height:`${l}px`},children:u&&e(U,{className:"ff-progress-bar-percentage",fontSize:f,color:h,children:`${Math.round(g)}%`})})}),A&&e("div",{className:"ff-progress-bar-label",children:e(U,{fontSize:c,color:d,children:e(Y,{title:xn(A,10,"count")?A:"",children:Hn(A,10,"count")})})})]})},mL=({variant:t="primary",size:n="small",onClick:r,label:i="Choose File",disabled:a=!1,type:l="button",className:s="",style:d={},iconName:f,isChooseFile:h=!1,buttonWidth:C="auto",buttonHeight:p="auto",selectedFile:m={},handleCloseIcon:A,isMandatory:g=!1})=>{const v=o(null),[y,w]=c(0);u(()=>{v.current&&w(v.current.getBoundingClientRect().width-10)},[C]);const E=m?.name||i,b=y?Hn(E,y,"pixel"):E,M=!!y&&xn(E,y,"pixel");return e("div",{ref:v,style:{width:C},children:e(Y,{title:M?E:"",children:e(W,{variant:t,label:b,type:l,onClick:r,buttonWidth:C,buttonHeight:p,isChooseFile:h,size:n,disabled:a,className:s,iconName:f,style:d,iconPosition:"right",selectedFile:m,handleCloseIcon:A,isMandatory:g})})})},AL=({selected:t="text",handleClick:r,tabList:i})=>{const a=i?.includes("Automation"),o=i?.includes("Manual");return n("div",{className:"ff-script-switch-container",children:[e(Y,{title:a?"Automation":"Add Automation",zIndex:1e3,children:e("div",{className:"ff-script-switch-button "+("Automation"===t?"active":""),onClick:()=>r(a?"Automation":"Add Automation"),children:e(q,{name:a?"automation_testcase":"add_testcase",color:"Automation"===t?"var(--primary-button-text-color)":"var(--description-text)"})})}),e(Y,{title:o?"Manual":"Add Manual",zIndex:1e3,children:e("div",{className:"ff-script-switch-button "+("Manual"===t?"active":""),onClick:()=>r(o?"Manual":"Add Manual"),children:e(q,{name:o?"manual_testcase":"add_testcase",color:"Manual"===t?"var(--primary-button-text-color)":"var(--description-text)"})})})]})},gL=({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(q,{name:r.icon,color:t===r.name?"var(--primary-button-text-color)":"var(--description-text)"})})},r.name))}),vL=({onModalClose:t,MediaSrc:r,fileName:a,onDeleteClick:o,mediaType:s,fileId:d,thumbnailMediaSrc:u,isDelete:f=!0,onExpandClick:h,onDownloadClick:C,isMediaIcon:p=!1,previewOnly:m=!1,iconName:A="video_preview",isDisabled:g=!1})=>{const[v,y]=c(!1),w=i.useRef(null),E=()=>{y(!0),h&&h(d)},b=()=>{t?.(),y(!1)},M=()=>{C&&C(d)};return l(()=>{m&&y(!0)},[m]),n("div",{children:[!m&&(p?e(q,{name:A,hoverEffect:!0,onClick:E,disabled:g}):e(gw,{mediaSrc:r,mediaType:s,onDownloadClick:M,onDeleteClick:()=>o?.(r),onExpandClick:E,fileName:a,fileId:d,thumbnailMediaSrc:u,isDelete:f})),v&&e(kp,{isOpen:v,onClose:b,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(q,{name:"download_file_icon",onClick:M,color:"var(--icons-default-color)",className:"header-icons"})}),e(Y,{title:"Expand",children:e(q,{name:"expand",onClick:E,color:"var(--icons-default-color)",className:"header-icons"})}),e(Y,{title:"close",children:e(q,{name:"close",onClick:b,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)})}}})]})})]})},yL=({children:t,orientation:r="",navBarIcons:a=[],mobileHeight:o=448,mobileWidth:l=220,UtilityBar:s,tooltip:c={},background:d,navBarPosition:u="bottom"})=>{const f="portrait"===r,h=f?o:l,C=f?l:o,p=s&&"top"===u,m=s&&"bottom"===u,A=s&&"left"===u;return n("div",{className:["ff-mobileskin-wrapper",f?"portrait":"landscape",A?"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:a.map(({title:t,name:n,className:r,...i},o)=>{const l=c?.[n]??o;return e(Y,{title:c?.[n]||"",placement:"top",children:e("div",{className:`ff-nav-bar-icon ${r||""} ${o===a.length-1?"last-icon":""} ${p?"navbar-top":""}`,children:e(q,{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*o+"px"}})})})}),s&&m&&e("div",{className:"ff-nav-bar",children:a?.map((t,n)=>{const{title:r,...i}=t;return e("div",{className:`ff-nav-bar-icon ${t?.className||""} ${n===a.length-1?"last-icon":""}`,children:e(Y,{title:r,children:e(q,{...i})})},n)})}),s&&A&&e("div",{className:"ff-side-nav-bar",children:a?.map((t,n)=>{const{title:r,...i}=t;return e("div",{className:`ff-sidebar ${t?.className||""} ${n===a.length-1?"last-icon":""}`,children:e(Y,{title:r,placement:"bottom",children:e(q,{...i})})},n)})})]})},wL=a(({width:t=300,height:r=40,iconHeight:i=16,iconWidth:a=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:A,onFocus:g,disableInput:v,isAdditionalIcon:y=!1,additionalIconName:w,additionIconToolTip:E,onAdditionalIconClick:b},M)=>{const L=o(null);zn([{key:"Enter",action:()=>H()}],L);const H=e=>{f&&p?.(f.trim())};return n("div",{className:T("ff-prompt-container",{"icon-left":"left"===c,"icon-right":"left"!==c}),style:{width:`${t}px`,height:`${r}px`,borderRadius:d},ref:L,children:[e(Y,{placement:"top",title:C,children:e(q,{name:s,className:"ff-prompt-icon",height:i,width:a,onClick:p,color:h,disabled:K(f)})}),e("input",{ref:M,className:"ff-prompt-input",type:"text",placeholder:l,autoFocus:u,onChange:m,onFocus:g,onBlur:A,value:f,readOnly:v}),y&&w&&e(Y,{placement:"top",title:E,children:e(q,{name:w,className:"ff-prompt-icon additional-icon",height:i,width:a,onClick:b})})]})}),EL=({content:t,isVisible:n,maxWidth:r=300,onClick:i,isClickable:a=!0,arrowPosition:o="left"})=>e("div",{onClick:i,style:{width:`${r}px`,"--triangle-position":r-4+"px"},className:T("ff-chat-msg-box",{visible:n,hidden:!n,pointer:a,default:!a,"chat-arrow-left":"left"===o,"chat-arrow-right":"left"!==o}),children:e("div",{className:T("content",`arrow-${o}`),children:e(U,{children:t})})}),bL=({iconName:r,iconPosition:{top:i,left:a,bottom:o,right:l},hoverIconPosition:{top:s,left:d,bottom:u,right:f},modalPosition:{top:h,left:C,bottom:p,right:m},modalWidth:A,modalHeight:g,headerContent:v="Header Content",footerContent:y="Footer Content",iconWidth:w,iconHeight:E,modalHeading:b="Ask Fia",children:M,onClearChat:H})=>{const[x,V]=c(!1),[k,S]=c(!1);return n(t,{children:[n("div",{style:{top:void 0!==i?`${i}px`:void 0,left:void 0!==a?`${a}px`:void 0,bottom:void 0!==o?`${o}px`:void 0,right:void 0!==l?`${l}px`:void 0},className:"ff-dynamic-icon-container",children:[e(q,{className:"ff-dynamic-icon",name:r,onClick:()=>{S(e=>!e),setTimeout(()=>V(e=>!e),10)},height:E,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(q,{name:"ask_fia_icon",height:32,width:82})})]}),k&&L(e("div",{className:T("ff-dynamic-modal",{open:x}),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:g,width:A},children:n("div",{className:"ff-dynamic-modal-content",children:[v&&e("div",{className:"ff-dynamic-modal-header",children:n("div",{className:"header-container",children:[n("div",{className:"header-left",children:[e(q,{height:16,width:16,name:"fia_icon"}),e(U,{fontWeight:"medium",children:b})]}),n("div",{className:"header-right",children:[e("span",{className:"action",children:e(Y,{title:"Clear chat",placement:"bottom",children:e(q,{height:16,width:16,name:"delete",color:"var(--tooltip-text-color)",onClick:H})})}),e("span",{className:"action",children:e(Y,{title:"Close",placement:"bottom",children:e(q,{height:16,width:16,name:"close",color:"var(--tooltip-text-color)",onClick:()=>(V(!1),void setTimeout(()=>S(!1),300))})})})]})]})}),e("div",{className:"ff-dynamic-modal-body",children:M}),y&&e("div",{className:"ff-dynamic-modal-footer",children:y})]})}),document.body)]})},ML=a(({iconName:r,hoverTitle:i,iconPosition:{top:a,left:o,bottom:l,right:s},hoverIconPosition:{top:c,left:d,bottom:u,right:f},modalPosition:{top:h,left:C,bottom:p,right:m},modalWidth:A,modalHeight:g,headerContent:v="Header Content",footerContent:y="Footer Content",iconWidth:E,iconHeight:b,children:M,isVisible:H,isOpen:x,onOpen:V,onClose:k,isIconVisible:S},z)=>(w(z,()=>({closeModal:k})),n(t,{children:[S&&n("div",{style:{top:void 0!==a?`${a}px`:void 0,left:void 0!==o?`${o}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(q,{className:"ff-ai-dynamic-icon",name:r,onClick:V,height:b,width:E}),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(U,{fontWeight:"bold",fontSize:14,color:"var(--chatbot-leaf-text)",children:i})})})]}),H&&L(e("div",{className:T("ff-ai-dynamic-modal",{open:x}),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:g,width:A},children:n("div",{className:"ff-ai-dynamic-modal-content",children:[v&&e("div",{className:"ff-ai-dynamic-modal-header",children:v}),e("div",{className:"ff-ai-dynamic-modal-body",children:M}),y&&e("div",{className:"ff-ai-dynamic-modal-footer",children:y})]})}),document.body)]}))),LL=({variant:t,title:r,tabTitle:i,comment:a,profileShortName:o})=>n("div",{className:"ff-history-card",children:[e("div",{className:T("header",`header--${t}`),children:e(U,{fontWeight:"semi-bold",children:i})}),n("div",{className:"body",children:[e("div",{className:"title",children:n("div",{className:"profile",children:[e(U,{className:T("avatar",`avatar--${t}`),children:o}),e(U,{children:r})]})}),n("div",{className:"comment-container",children:[e(U,{fontWeight:"semi-bold",className:"heading",children:"Comments:"}),e(U,{color:"var(--details-page-value-color)",className:"comment",children:a})]})]})]}),HL=({onChange:t,disabled:r,checked:i=!1,id:a="toggle",path:o})=>n("div",{className:"ff--ai-switch-container",children:[e("input",{className:"ff--ai-switch-checkbox",id:`ff-toggle-${a}`,type:"checkbox",disabled:!!r,onChange:e=>{t&&t(e)},checked:i}),e("label",{className:T("ff--ai-switch-label",{"ff--ai-switch-label--disabled":r}),htmlFor:`ff-toggle-${a}`,children:e("span",{className:"ff--ai-switch-content",children:n("span",{className:"ff--ai-switch-content",children:[e(U,{className:T("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:o,alt:"AI image"})]})})})]}),xL=a(({name:t,height:n=30,width:r=30,path:i="",onClick:a,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,...A},g)=>{if(!_[t])return null;const v=o(null);l(()=>{v.current&&(void 0!==C&&v.current.setAttribute("x",String(C)),void 0!==p&&v.current.setAttribute("y",String(p)))},[C,p]);const y={ref:g,onClick:u?void 0:a,style:{height:`${n}px`,width:`${r}px`,cursor:u?"not-allowed":"pointer",opacity:u?.3:1},tabIndex:m,...A};return e("span",{...y,children:e("img",{height:n,width:r,src:i,alt:""})})}),VL=({id:r=0,serialNumber:i,activeId:a,setActiveId:s,children:d,onIconClick:u,numberChildren:f,onContainerClick:h,onNextClick:C,onPreviousClick:p,disabled:m,isEditAccess:A,versionsLength:g,count:v,hiddenActions:y=[]})=>{const[w,E]=c(!1),[b,M]=c(!1),L=o(null),H=Array.isArray(y)?y:y?[y]:[],x=(e,t)=>{e.stopPropagation(),t()};l(()=>{L.current&&(()=>{if(L.current){const e=getComputedStyle(L.current),t=1.2*parseFloat(e.fontSize)*6;L.current.scrollHeight>t&&M(!0)}})()},[]);const V=e=>{e.stopPropagation(),E(!w)};return n("div",{className:`ff-prompt-container-Block ${a===r?"active":"inactive"} `,onClick:()=>{s(r),h()},children:[e(U,{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:L,children:[d,w&&n(t,{children:[e("span",{role:"button","aria-label":"toggleExpand",onClick:V,className:"read-less-btn",children:e(U,{color:"var(--brand-color)",fontWeight:"semi-bold",className:"read-more-btn-text",children:"Read Less"})})," "]})]}),b&&!w&&e("div",{role:"button","aria-label":"toggleExpand",onClick:V,className:"read-more-btn",children:e(U,{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=>!H.includes(e.action)).map((t,n)=>{const r=A&&"delete"===t?.action||"regenerate"===t?.action&&(g??0)>=3||m;return e(Y,{title:t.title,placement:"bottom",children:e(q,{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(q,{disabled:1===v,className:"ff-prompt-icons-style",name:"arrow_left_accordian",color:"var(--table-column-text-color)",width:18,height:18,onClick:e=>x(e,p),cursorType:"pointer"}),f,e(q,{disabled:v===g,className:"ff-prompt-icons-style",name:"arrow_right_icon",color:"var(--table-column-text-color)",width:18,height:18,onClick:e=>x(e,C),cursorType:"pointer"})]})]})]})},kL=a(({type:t="text",variant:r="primary",name:i="",label:a,disabled:o=!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:A,autoComplete:g="off",autoFocus:v=!1,minValue:y=-1/0,maxValue:w=1/0,transparentBackground:E=!1,size:b="small",isLabelRequired:M=!0,onClick:L,onKeyUp:H,isViewMode:x=!1,...V},k)=>{const S=!K(d);return n("fieldset",{className:T("ff-link-input-fieldset",{"ff-link-input-fieldset--disabled":o}),children:[n("div",{className:T("ff-link-input-container",{"ff-link-input-container--float":S,"ff-link-input-container--disabled":!!o}),children:[M&&n("label",{className:T(`ff-link-input-label-container ff-link-input-label-container--${b}`,{"ff-link-input-label-container--danger":!!u}),htmlFor:i,children:[s&&e("span",{className:"required-asterisk",children:"*"}),e("span",{className:T(`ff-link-input-label ff-link-input-label--${r}`,{"ff-link-input-label--no-hover":!!d,"ff-link-input-label--disabled":!!o,"ff-link-input-label--danger":!!u}),children:a})]}),e("input",{ref:k,name:i,value:d,type:t,spellCheck:!1,id:i,className:T(`ff-link-input ff-link-input-${r} default-input ff-link-input--${b}`,{"ff-link-input--transparentBackground":!!E,"ff-link-input--no-hover":!!d,"ff-link-input--disabled":!!o,"ff-link-input--danger":!!u,"ff-link-input--no-border":!!h,"ff-link-input--placeholder":!M},`${C}`),placeholder:c,disabled:x||o,onChange:p,onFocus:A,onBlur:m,autoComplete:g,autoFocus:v,min:y,max:w,onClick:L,onKeyUp:H,...V}),e("div",{className:"input-link-icon",children:l||u||!S?e(q,{name:"link",disabled:!0}):e(Y,{title:"Click here to navigate",children:e("span",{children:e(q,{name:"link",disabled:!1,onClick:()=>{d&&!u&&window.open(d,"_blank")}})})})})]}),f&&u&&e("span",{className:T("ff-link-input-message",{"ff-link-input-message--danger":!!u}),children:f})]})}),SL=({labelsList:r=[],height:i=""})=>{const a=pi(),o=e("div",{className:"ff-chip-tooltip",children:r.filter((e,t)=>t>0).map((t,n)=>e(U,{as:"div",className:"ff-chip-tooltip-label",children:t},`label-${n}-${t}`))});return e(t,{children:!K(r)&&n("div",{className:"ff-chip-with-count-container",children:[e(U,{as:"div",fontWeight:"medium",className:"ff-chip-label",style:i?{height:i}:void 0,children:e(Ws,{children:r[0]||""})}),r.length>1&&n(t,{children:[n(U,{as:"div",className:"ff-chip-count","data-tooltip-id":`tooltip-${a}`,fontWeight:"medium",children:["+",r.length-1]}),e("div",{id:`tooltip-${a}`,className:"ff-chip-tooltip-template",children:e(U,{as:"div",children:o})})]})]})})};class zL extends E{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 ZL=({iconName:t="",onButtonClick:r,buttonLabel:i="Label",buttonText:a="To Add Group",disableButton:o=!1,stepCount:l=1,iconWidth:s=120,iconHeight:c=120,addContentLabel:d="step"})=>n("div",{className:"add-content-button "+(o?"disabled":""),children:[!K(t)&&e("div",{className:"icon-container",children:e(q,{name:t,width:s,height:c})}),n("div",{className:"typography-label-button",children:[n(U,{fontSize:"12px",fontWeight:"regular",lineHeight:"18px",children:[d+l," :"]}),e(U,{fontSize:"12px",fontWeight:"semi-bold",lineHeight:"18px",children:"Click"}),e(Vp,{label:i,onClick:r,iconName:"plus_user_icon",isDisable:o}),e(U,{fontSize:"12px",fontWeight:"semi-bold",lineHeight:"18px",children:a})]})]}),OL=({variant:t="default",tabsData:r,activeTabId:i,onTabClick:a,noBorder:o=!1,noPadding:l=!1,titleSize:s="12px"})=>{const[d,u]=c(0);return n("div",{className:"ff-tabs-slider-container",children:[n("div",{className:T(`ff-tab-row--${t} ff-tab-row-section`,{"ff-tab-row--no-border":o,"ff-tab-row--no-padding":l,"ff-tab-row--position":r.length>4}),children:[r.length>4&&e(q,{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&&a(r.id),disabled:r.disabled,className:T(`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(U,{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:T("ff-tab-label",{"ff-tab-label--active":i===r.id})})}),"default"===t&&r.count&&e("span",{className:T("tab-count",{"tab-count--active":i===r.id}),children:r.count})]}),e("div",{className:T("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(q,{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})]})},NL=a(({label:t="Status",iconName:r="update_icon",onClick:i,isDisable:a=!1,variant:o="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:a,onClick:i,className:`\n ff-status-indicator\n ff-status-indicator--${o}\n ${l?`ff-status-indicator--with-bg ff-status-indicator--${o}-bg`:""}\n ${s?`ff-status-indicator--with-border ff-status-indicator--${o}-border`:""}\n `,ref:c,children:n("div",{className:"ff-status-indicator__content",children:[e(q,{name:"danger"===o?"close":r,color:d[o]||d.default,className:`ff-status-indicator__icon ff-status-indicator__icon--${o}`}),e(U,{as:"div",fontSize:12,className:`ff-status-indicator__label ff-status-indicator__label--${o}`,fontWeight:"medium",lineHeight:"20px",children:t})]})})}),TL=({rootLabel:t,childrenLabels:r,align:i="center",direction:a="horizontal"})=>{const o=r.length;return n("div","vertical"===a?{className:"ff-os-tree-vertical",style:{"--child-count":o},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":o},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))})]})},IL=({handleClose:t,handleResend:r,handleOtp:i,resendTimeout:a=30})=>{const[s,d]=c(Array(6).fill("")),[u,f]=c(a),[h,C]=c(!0),p=o(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(kp,{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(U,{fontSize:24,lineHeight:"36px",fontWeight:"semi-bold",children:"OTP Verification"}),e(q,{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(W,{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(a),C(!0),d(Array(6).fill("")),r()},children:["Re-send OTP",u>0?` (${u}s)`:""]})]})})},DL=({isOpen:t,onClose:r,isPlaying:i,onTogglePlay:a,mediaType:s,src:d,headerTitle:u,onDownload:f,onExpand:h,showHeader:p=!0,showDownload:m=!0,showExpand:A=!0,width:g="800px",height:v="432px",showControls:y=!0,customStyle:w,overlay:E=!0,children:b,showControlDownload:M=!1,showControlExpand:L=!1,isFullscreen:H=!1})=>{const x=o(null),V=o(null),[k,S]=c(0),[z,Z]=c(0),[O,N]=c(!1),[T,I]=c(0);l(()=>{"video"===s&&x.current&&!b&&(i?x.current.play():x.current.pause())},[i,s,b]);const D=C(()=>{if(x.current&&!O){const e=x.current.currentTime/x.current.duration*100;I(e||0),S(x.current.currentTime)}},[O]),F=C(()=>{x.current&&Z(x.current.duration)},[]),R=C(()=>{S(0),I(0),a?.()},[a]),P=C(e=>`${Math.floor(e/60)}:${Math.floor(e%60).toString().padStart(2,"0")}`,[]),j=C(e=>{if(x.current){const t=e/100*x.current.duration;x.current.currentTime=t,I(e),S(t)}},[]),B=C(e=>{if(O||!V.current)return;const t=V.current.getBoundingClientRect(),n=e.clientX-t.left,r=t.width,i=Math.max(0,Math.min(100,n/r*100));j(i)},[j,O]),_=C(e=>{if(!V.current)return;N(!0);const t=V.current.getBoundingClientRect(),n=e.clientX-t.left,r=t.width,i=Math.max(0,Math.min(100,n/r*100));j(i)},[j]),W=C(e=>{if(!O||!V.current||!x.current)return;const t=V.current.getBoundingClientRect(),n=e.clientX-t.left,r=t.width,i=Math.max(0,Math.min(100,n/r*100));j(i)},[O,j]),X=C(()=>{N(!1)},[]);return l(()=>{if(O)return document.addEventListener("mousemove",W),document.addEventListener("mouseup",X),()=>{document.removeEventListener("mousemove",W),document.removeEventListener("mouseup",X)}},[O,W,X]),t?e(ru,{isOpen:t,onClose:r,isMaximized:!1,showHeader:p,overlay:E,downloadHandler:()=>{},customStyle:w,header:n("div",{className:"ff-header-content",children:[e(q,{width:23,height:23,name:"automatic_locator"}),e(U,{children:e("span",{className:"ff-header-title",children:u})})]}),icons:e(Y,{title:"Close",children:e(q,{name:"close",onClick:r})}),width:g,height:v,zIndex:999,children:n("div",{className:"ff-video-wrapper",children:[b||("video"===s?e("video",{ref:x,src:d,className:"ff-media-video",onTimeUpdate:D,onLoadedMetadata:F,onEnded:R}):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(q,{name:"download_file",color:"white",onClick:f})}),A&&e(Y,{title:H?"Minimize":"Maximize",children:e(q,{name:H?"collapse_icon":"expand_icon",color:"white",onClick:h})})]}),"video"===s&&y&&!b&&n("div",{className:"ff-media-controls",children:[e("button",{onClick:a,className:"ff-play-pause-btn",children:e(Y,{title:i?"Pause":"Play",children:e(q,{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:P(k)}),e("input",{type:"range",className:"ff-seek-bar",min:0,max:100,value:T,onChange:e=>j(parseFloat(e.target.value)),onClick:B,onMouseDown:_,ref:V}),e("span",{className:"ff-total-time",children:P(z)})]}),n("div",{className:"ff-control-icons",children:[M&&e(Y,{title:"Download",children:e(q,{name:"download_file",color:"white",onClick:f,cursorType:"pointer"})}),L&&e(Y,{title:H?"Minimize":"Maximize",children:e(q,{name:H?"collapse_icon":"expand_icon",color:"white",onClick:h,cursorType:"pointer"})})]})]})]})}):null},FL=({header:r,secondaryHeader:i,primaryCount:a,secondaryCount:o,primaryItems:l,secondaryItems:s,width:c,activeTab:d="primary",activeTabId:u,onPrimaryTabClick:f,onSecondaryTabClick:h,onTabClick:C,actions:p,tabsData:m,notchPosition:A="top-left"})=>{const g=i&&"secondary"===d?s:l,v=o&&parseInt(o)>0,y=a&&parseInt(a)>0,w=i&&(y||v),{tooltip:E="Download",iconName:b="download_file",disabled:M=!1,onClick:L,className:H=""}=p?.download||{},{tooltip:x="Delete",iconName:V="delete_icon",disabled:k=!1,onClick:S,className:z=""}=p?.delete||{},Z=()=>n("div",{className:"ff-dropdown-header-icons",children:[p?.download&&e(Y,{title:E,children:e(q,{name:b||"",className:`ff-dropdown-icon ff-download-icon ${H}`,onClick:L,width:18,height:20,disabled:M,hoverEffect:!0})}),p?.delete&&e(Y,{title:x,children:e(q,{name:V||"",className:`ff-dropdown-icon ff-delete-icon ${z}`,onClick:S,width:25,height:25,disabled:k,hoverEffect:!0})})]});return n("div",{className:"ff-resolution-dropdown",style:c?{minWidth:c}:{},children:[e("div",{className:"ff-dropdown-notch "+("bottom-center"===A?"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&&Z()]}):i&&w?n("div",{className:"ff-dropdown-header-dual",children:[n("div",{className:"ff-dropdown-header-item "+("primary"===d?"active":""),onClick:f,children:[e(U,{fontWeight:"semi-bold",className:"ff-dropdown-text",children:r}),a&&e("span",{className:"ff-dropdown-count",children:a})]}),n("div",{className:"ff-dropdown-header-item "+("secondary"===d?"active":""),onClick:h,children:[e(U,{fontWeight:"semi-bold",className:"ff-dropdown-text",children:i}),o&&e("span",{className:"ff-dropdown-count",children:o})]}),Z()]}):i?n("div",{className:"ff-dropdown-header-dual",children:[n("div",{className:"ff-dropdown-header-item "+("primary"===d?"active":""),onClick:f,children:[e(U,{fontWeight:"semi-bold",className:"ff-dropdown-text",children:r}),a&&e("span",{className:"ff-dropdown-count",children:a})]}),n("div",{className:"ff-dropdown-header-item "+("secondary"===d?"active":""),onClick:h,children:[e(U,{fontWeight:"semi-bold",className:"ff-dropdown-text",children:i}),o&&e("span",{className:"ff-dropdown-count",children:o})]})]}):e(U,{fontSize:16,fontWeight:"semi-bold",children:r})})}),e("ul",{className:"ff-dropdown-list",children:g?.map((t,n)=>e("li",{className:"ff-dropdown-item",children:t},n))})]})},RL=(e,t,n,r)=>{const i=e[t.accessor];if(t.cell){const a=e._id||e.id;return t.cell({value:i,row:e,column:t.accessor,index:n,tableType:r,...a&&{refId:a}})}return t.accessor||i&&"object"!=typeof i?i:"--"},PL=(t,n=[],r,i,a)=>{let o=n;const l=void 0!==i?!i:r;return K(n)&&(isNaN(t)||(o=Array(t).fill(!0))),e("div",{className:"tree-table-fn-space-container",children:o?.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":""} ${a?"folder":""}`},r))})},jL=i.memo(({treeRowRef:r,col:i,colIndex:a,columnMeta:o,node:l,selected:s,select:c,onCheckBoxChange:d,onToggleExpand:u,onAddConfirm:f,onAddCancel:h,handleEditFieldError:C,isExpanding:p,columnTextColor:m,hideOnDisable:A,addModuleInputWidth:g,addModuleSelectWidth:v,disableEditLabelConfirmIcon:y,isEditable:w,setIsEditable:E})=>{const b={color:`${m||"var(--ff-primary-text-color)"}`,width:o?.width??i?.width,position:o?.sticky?"sticky":void 0,left:o?.sticky?o.left:void 0,zIndex:o?.sticky?o.zIndex:void 0};return n("div",{className:`ff-table-tree-fn-td ${i.isTree&&l.container?"folder":""} ${o?.sticky?"sticky-tree-column":""}`,"data-col-index":a,style:b,children:[i.isTree&&PL(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:I,{})]})}),n("span",{className:"tree-table-fn-td-content "+(i.isTree&&l.container?"folder":""),children:[!l?.isNewNode&&n(t,{children:[i.isTree&&"checkbox"===c&&!(A&&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&&!(A&&l.unselectable)&&e("span",{className:"tree-table-fn-td-content-select",children:e(dc,{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:g,selectFieldWidth:v,confirmIconTooltip:l.confirmIconTooltip,cancelIconTooltip:l.cancelIconTooltip,isEditable:w,setIsEditable:E,isOnBlurTrue:!1,isDisable:{confirm:y},isTableTree:!0}):n(t,{children:[e("span",{className:"tree-table-fn-td-content-text",children:RL(l,i)}),i.actions&&!l?.isNewNode&&e("div",{className:"table-tree-fn-row-action",children:i.actions(l,r)})]})})]})]})]})});jL.displayName="TableCell";const BL=i.memo(({node:t,columnsData:n,columnMeta:r,selected:i,select:a,onRowClick:l,onToggleExpand:s,onCheckBoxChange:c,onAddConfirm:d,onAddCancel:u,handleEditFieldError:f,isExpanding:h,index:C,selectedNode:p,hideOnDisable:m,addModuleInputWidth:A,addModuleSelectWidth:g,disableEditLabelConfirmIcon:v,isEditable:y,setIsEditable:w,style:E})=>{const b=o(null);return e("div",{"data-level":t.hierarchy,ref:b,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:E,children:n.map((n,o)=>e(jL,{treeRowRef:b,col:n,colIndex:o,node:t,selected:i,select:a,onCheckBoxChange:c,onToggleExpand:s,onAddConfirm:d,onAddCancel:u,handleEditFieldError:f,isExpanding:h,hideOnDisable:m,addModuleInputWidth:A,addModuleSelectWidth:g,disableEditLabelConfirmIcon:v,isEditable:y,setIsEditable:w,columnMeta:r?.[o]},n.name))})});BL.displayName="TableRow";const _L=({flattenedTreeData:t,columnsData:n,columnMeta:r,rowHeight:i=32,startIndex:a=0,totalHeight:o=0,selected:l,select:s,onRowClick:c,onToggleExpand:d,onCheckBoxChange:u,onAddConfirm:f,onAddCancel:h,handleEditFieldError:C,expanding:p,selectedNode:m,hideOnDisable:A,addModuleInputWidth:g,addModuleSelectWidth:v,disableEditLabelConfirmIcon:y,isEditable:w,setIsEditable:E})=>e("div",{className:"ff-table-tree-fn-body",style:{height:`${o}px`,position:"relative"},children:t?.map((t,o)=>e(BL,{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:a+o,selectedNode:m,hideOnDisable:A,addModuleInputWidth:g,addModuleSelectWidth:v,disableEditLabelConfirmIcon:y,isEditable:w,setIsEditable:E,style:{transform:`translateY(${(a+o)*i}px)`,height:`${i}px`,position:"absolute",top:0,left:0,right:0}},t.key))}),qL=i.memo(({columnsData:t,columnMeta:r,totalWidth:i,rootNode:a,selected:s,onCheckBoxChange:d,selectedNode:u,tableHeaderBgColor:f,hideOnDisable:h,transparentHeader:C,showHeader:p=!0})=>{const m=o(null),[A,g]=c(!1);l(()=>{g(!0)},[]);const v=(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:{...v(i,n),backgroundColor:C?"transparent":f,pointerEvents:C?"none":"auto"},children:t},t))}),a&&e("div",{className:"ff-table-tree-fn-row show-tree "+(u&&u===a?.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:v(i,t.width),children:n("span",{className:"tree-table-fn-default-content "+(0===i?"ff-table-root-index-0":""),children:[0===i&&"checkbox"===a.select&&!(h&&a.node.isDisabled)&&e(bn,{checked:"partially"!==a?.node?.selectedStatus&&("completely"===a?.node?.selectedStatus||!1),partial:"partially"===a?.node?.selectedStatus,onChange:e=>d(e,a?.node),disabled:a?.node?.isDisabled}),0===i&&"radio"===a.select&&!(h&&a.node.isDisabled)&&e(dc,{name:a.node.key,checked:s.includes(a.node.key),value:a.node.key,onChange:e=>d(e,a.node),disabled:a.node.isDisabled}),n("div",{className:"tree-table-cell-flex",children:[e(Ws,{children:"name"===t.accessor?a.node[t.accessor]:RL(a.node,t)}),a.cell&&0===i&&e("span",{className:"table-tree--fn-root-cell",children:a.cell(a.node)}),a.actions&&0===i&&A&&m.current&&e("div",{className:"table-tree-fn-row-action",children:a.actions(a.node,m)})]})]})},i))})]})});qL.displayName="TableHead";const UL=32,WL="__root__",XL=(e,t)=>{if(!e?.length)return[];const n=new Map,r=new Map,i=new Map,a=new Map;t&&t.key&&n.set(String(t.key),t),e.forEach(e=>{n.set(String(e.key),e);const t=e.parentId?String(e.parentId):WL;r.has(t)||(r.set(t,[]),a.set(t,{container:0,resource:0})),r.get(t)?.push(e);const i=a.get(t);i&&(e.container?i.container++:i.resource++)}),r.forEach(e=>{e.forEach((e,t)=>{i.set(String(e.key),t)})});const o=e=>{const t=e.parentId?String(e.parentId):WL,o=r.get(t);if(!o||0===o.length)return!1;if((i.get(String(e.key))??0)<o.length-1)return!0;const l=n.get(t),s=a.get(t);if(l&&s){const t=o.filter(e=>e.container).reduce((e,t)=>e+(t.totalResourceCount??0),0),n=o.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(String(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,i=r?t.parentSiblings:(e=>{const t=[];let r=e;for(;r&&(r.parentId&&t.unshift(o(r)),r.parentId);)r=n.get(String(r.parentId));return t})(e),a=r?t.hierarchy:i.length;return{...e,lastChild:!o(e),parentSiblings:i,hierarchy:a,selectedStatus:l(e)}})},QL=a(({treeData:t,columnsData:r,selected:i=[],select:a=null,onChange:s=()=>{},onClick:d=()=>{},onExpand:f=()=>{},loadMore:p=()=>{},tableBorder:m,height:A="calc(100vh - 134px)",newNode:g,onAddConfirm:v=()=>{},onAddCancel:y=()=>{},handleEditFieldError:w,loading:E=!1,rootNode:b,pagination:M=!0,selectedNode:L,tableHeaderBgColor:H="var(--border-color)",hideOnDisable:x=!1,freezeColumns:V,addModuleInputWidth:k=150,addModuleSelectWidth:S,onScroll:z,onScrollEnd:Z,disableEditLabelConfirmIcon:O=!1,transparentHeader:N=!1,navigateTreeNode:T=null,handleRemoveNavigateTreeNode:I=()=>{},scrollThreshold:D=128,showHeader:F=!0,resetScroll:R=!1,setResetScroll:P=()=>{}},j)=>{const[B,_]=c(null),[q,U]=c(null),[W,X]=c({start:0,end:20}),[Q,G]=c(!1),Y=o(null),J=o(null),$=o(0),ee=o(E),te=o(null),ne=o(null),re=o({lastScrollTop:0}),ie=o([]),ae=o(0),oe=o(null),le=o(null),se=o(null),ce=o({key:null,attempts:0}),de=o(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:a}=ue(n.width,400),o=!!V&&r<V,l="%"===a?`${i}%`:`${i}px`,s=`calc(${e}px + ${t}%)`;return o&&("%"===a?t+=i:e+=i),{width:l,sticky:o,left:s,zIndex:o?100+(V??0)-r:1}})},[r,V]),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(!V)return"0px";let e=0,t=0;return fe.slice(0,V).forEach(n=>{const r=parseFloat(n.width)||0;n.width.endsWith("%")?t+=r:e+=r}),`calc(${e}px + ${t}%)`},[fe,V]),pe=h(()=>((e,t,n)=>{if(!t?.sourceId||!t.action)return e;const{sourceId:r,action:i,value:a="",error:o="",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})),A=d?{label:d,value:d}:void 0,g=new Map;e.forEach(e=>g.set(e.key,e)),n&&g.set(n.key,n);const v=g.get(r);let y;h&&(y=g.get(h));let w=v??("addInside"===i?y:void 0);!w&&"addInside"===i&&C&&(w=g.get(C));const E="addInside"===i&&!w&&e.length>=0;if(!w&&!E)return e;const b=[...e],M=w?e.findIndex(e=>e.key===w.key):-1;let L=null,H=0,x=M+1;switch(i){case"addAbove":{const t=w;if(!t)return e;L=t.parentId,H=t.hierarchy;break}case"addBelow":{const t=w;if(!t)return e;L=y?.parentId??t.parentId,H=y?.hierarchy??t.hierarchy;break}case"addInside":{if(E){L=C??h??r??null,H=p??1,x=b.length;break}const t=y??w;if(!t)return e;L=t.key,H=(t.hierarchy??0)+1;const n=b.findIndex(e=>e.key===r);-1!==n&&(x=n+1);break}}const V={hierarchy:H,parentId:L,sourceId:w?.key??r??h??"new-node",isNewNode:!0,key:"new-node",value:a,error:o,label:l,type:s,options:m,selectedOption:A,confirmIconTooltip:u,cancelIconTooltip:f};switch(i){case"addAbove":b.splice(M,0,V);break;case"addBelow":b.splice(M+1,0,V);break;case"addInside":b.splice(Math.max(0,x),0,V)}return b})(t,g,b?.node),[t,g,b]),me=h(()=>XL(pe,b?.node),[pe,b?.node]),Ae=h(()=>me.filter(e=>!e.hide),[me]),ge=h(()=>{const e=new Map;return me.forEach(t=>e.set(t.key,t)),e},[me]),ve=h(()=>{const e=new Map;return Ae.forEach((t,n)=>e.set(t.key,n)),e},[Ae]),ye=C(e=>{_(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=E},[E]),l(()=>{te.current=q},[q]);const we=C(e=>{te.current=e,U(e)},[]),Ee=C(()=>{const e=Y.current;if(!e)return;const t=$.current||0,n=Math.max(0,e.scrollTop-t),r=e.clientHeight-t;let i=Math.floor(n/UL)-6,a=Math.ceil((n+r)/UL)+6;i=Math.max(0,i),a=Math.min(Ae.length,a),X(e=>e.start===i&&e.end===a?e:{start:i,end:a})},[Ae.length]),be=C(()=>{null===ne.current&&(ne.current=requestAnimationFrame(()=>{ne.current=null,Ee()}))},[Ee]),Me=C(()=>{const e=Y.current;if(!e)return;const n=e.scrollTop,r=n>re.current.lastScrollTop?"down":"up";if(re.current.lastScrollTop=n,be(),z?.(),oe.current?.(),!M||E||te.current||K(t))return;const i=e.scrollHeight,a=e.clientHeight;"down"===r&&i-(n+a)<D&&!t[t.length-1]?.lastResource&&(we("below"),p("below"))},[t,M,E,q,D,be,z,p,we]);l(()=>{if(E||!M||K(t))return;const e=t[0],n=!e?.lastResource,{totalSubContainerCount:r=0,totalResourceCount:i=0}=b?.node||{},a=r+i,o=Ae.length<10&&Ae.length<a;n&&o&&(we("above"),p("above"))},[E,M,t,Ae.length,b,p,we]),u(()=>{const e=ie.current,t=Ae,n=Y.current;if(R&&n)return n.scrollTop=0,re.current.lastScrollTop=0,void P(!1);if(n&&e.length>0&&t.length>0&&!E){const r=re.current.lastScrollTop,i=Math.max(0,Math.floor(r/UL));let a=-1,o=-1;for(let t=i;t<e.length;t++){const n=e[t]?.key,r=ve.get(n??"");if(void 0!==r){a=t,o=r;break}}if(-1===a)for(let t=i-1;t>=0;t--){const n=e[t]?.key,r=ve.get(n??"");if(void 0!==r){a=t,o=r;break}}if(-1!==a&&-1!==o){const e=o-a,t=Math.max(0,r+e*UL);n.scrollTop!==t&&(n.scrollTop=t,re.current.lastScrollTop=n.scrollTop,Ee())}else if("above"===q)0!==n.scrollTop&&(n.scrollTop=0,re.current.lastScrollTop=0,Ee());else{const e=$.current||0,r=Math.max(0,t.length*UL-(n.clientHeight-e));n.scrollTop>r&&(n.scrollTop=r,re.current.lastScrollTop=r,Ee())}q&&we(null)}ie.current=t},[E,q,ve,Ae,we,Ee,R,P]),l(()=>{const e=Y.current;if(!e)return;const n=n=>{n.deltaY>=0||!M||K(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=Y.current;if(e)return oe.current=Z?Ks(()=>{Z?.()},150):null,e.addEventListener("scroll",Me,{passive:!0}),()=>{e.removeEventListener("scroll",Me),oe.current?.cancel()}},[Me,Z]),l(()=>{const e=Y.current;if(!e)return;const t=e=>{Date.now()<ae.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,Ee()});return t.observe(e),()=>t.disconnect()},[Ee]),u(()=>{if(!g||!Y.current)return;const e=Y.current,t=ve.get("new-node");if(void 0===t)return;const n=$.current||0,r=e.clientHeight-n;if(r<=0)return;const i=t*UL,a=i+UL,o=Math.max(0,e.scrollTop-n);let l=o;i<o?l=i:a>o+r&&(l=Math.max(0,a-r)),l!==o&&(ae.current=Date.now()+300,e.scrollTop=l+n,re.current.lastScrollTop=e.scrollTop,Ee());const s=requestAnimationFrame(()=>{G(!0)});return()=>cancelAnimationFrame(s)},[g,ve,Ee]),l(()=>{g||G(!1)},[g]),u(()=>{if(!B||E)return;const e=le.current;if(!e||e.key!==B){const e=requestAnimationFrame(()=>{ye(B)});return()=>cancelAnimationFrame(e)}const t=ge.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)},[ge,B,E,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||g)return;const e=Y.current;if(!e)return;const n=ve.get(T);if(void 0!==n){ce.current={key:T,attempts:0};const t=$.current||0,r=Math.max(UL,e.clientHeight-t),i=n*UL+16,a=Math.max(0,i-r/2)+t;return ae.current=Date.now()+400,e.scrollTo({top:a,behavior:"smooth"}),be(),de.current&&clearTimeout(de.current),void(de.current=setTimeout(()=>{I?.()},350))}if(E||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,g,ve,E,q,M,t,p,be,I,we]);const Le=C(e=>{if(B)return;const t=!e?.expanded;_(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)},[B,f,ye]),He=C((e,t)=>{B||s?.(e,t)},[s,B]),xe=C((e,t)=>{B||d?.(e,t)},[d,B]);l(()=>()=>{null!==ne.current&&(cancelAnimationFrame(ne.current),ne.current=null),se.current&&clearTimeout(se.current),de.current&&clearTimeout(de.current)},[]);const Ve=Ae.length*UL,ke=Ae.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:j,children:e("div",{className:"table-fn-scrollable "+(Ae.length?"":"table-fn-empty"),ref:Y,style:{"--table-height":Ae.length?A:"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(qL,{columnsData:r,columnMeta:fe,totalWidth:he,rootNode:b,onCheckBoxChange:He,selected:i,selectedNode:L,tableHeaderBgColor:H,hideOnDisable:x,transparentHeader:N,showHeader:F})}),e(_L,{flattenedTreeData:ke,columnsData:r,columnMeta:fe,totalWidth:he,rowHeight:UL,startIndex:W.start,totalHeight:Ve,selected:i,select:a,onRowClick:xe,onToggleExpand:Le,onCheckBoxChange:He,onAddConfirm:v,onAddCancel:y,handleEditFieldError:w,expanding:B,selectedNode:L,hideOnDisable:x,addModuleInputWidth:k,addModuleSelectWidth:S,disableEditLabelConfirmIcon:O,isEditable:g?Q:void 0,setIsEditable:g?e=>{G(Boolean(e))}:void 0})]})})})})});QL.displayName="TableTreeFn";const GL=t=>e(dA,{logo:()=>"FireFlink"===t?.name?e(q,{height:100,width:100,name:"fire_flink_loader_logo"}):e("img",{src:t?.loaderName,width:100,height:100,alt:"loader"})}),KL=({isVisible:t})=>t?n("div",{className:"no_data_message",children:[e(q,{name:"no_content",width:120,height:120}),e(U,{fontSize:"20px",lineHeight:"30px",fontWeight:"semi-bold",children:"No Data Available"})]}):null,YL=({text:t=" No Results Found",iconName:r="no_license_found",fontSize:i="24px",textAlign:a="left",direction:o="column",iconWidth:l=120,iconHeight:s=120,fontWeight:c="semi-bold",marginTop:d="0px"})=>e("article",{className:"no_results_container",children:n("div",{className:`no_results_container__${o}`,style:{marginTop:d},children:[e(q,{name:r,width:l,height:s}),e("div",{children:e(U,{as:"div",fontSize:i,lineHeight:"36px",fontWeight:c,color:"var(--text-color)",textAlign:a,children:t})})]})}),JL=({drawerProps:n,showDrawer:r,children:i,zIndex:a=1200,top:o="56px"})=>r?e(vn,{isOpen:n?.isOpen??!0,...n,zIndex:a,top:o,children:i}):e(t,{children:i});const $L=({children:n,offlineContent:r,hasError:i=!1,onNetworkStatusChange:a,overlayClassName:o,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(()=>{a&&a(f)},[f,a]),i||!f?e("div",{className:`offlineOverlay ${o??""}`,style:{zIndex:s},children:r||e(q,{name:"offline_404_icon",height:u,width:d})}):e(t,{children:n})},eH=e=>{const t=Number.isFinite(e)&&e>0?e:0,n=Math.floor(t/60),r=Math.floor(t%60);return`${n.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`},tH=[.5,1,1.5,2],nH=({duration:r,currentTime:i,isPlaying:a=!1,onPlayPause:l=()=>{},onSeek:s=()=>{},isMuted:d=!1,onMuteToggle:u=()=>{},menuOptions:f,onMenuOptionClick:h=()=>{},playbackRate:C=1,onPlaybackRateChange:p=()=>{},disabled:m=!1,seekStep:A=5,formatTime:g=eH,className:v="",style:y={}})=>{const w=r>0?i/r*100:0,E=o(null),b=o(null),[M,L]=c(!1),[H,x]=c({top:0,left:0}),[V,k]=c(0),S=o(null),z=f??[{label:"Captions",value:"captions",icon:"captions"},{label:n("div",{ref:b,className:"playback-menu-option",children:["Playback Speed ",e(Li,{label:`${C.toFixed(1)} x`})]}),value:"playback-speed",icon:"playback",keepMenuOpen:!0}],Z=e=>Math.min(Math.max(e,0),r||0);return n("div",{className:`ff-audio-player ${v}`,style:y,"aria-disabled":m,tabIndex:m?-1:0,role:"group","aria-label":"Audio player",onKeyDown:e=>{if(m)return;if("INPUT"!==e.target.tagName)switch(e.key){case" ":case"Spacebar":e.preventDefault(),l();break;case"m":case"M":e.preventDefault(),u();break;case"ArrowRight":e.preventDefault(),s(Z(i+A));break;case"ArrowLeft":e.preventDefault(),s(Z(i-A))}},children:[e("button",{type:"button",className:"ff-audio-play-btn",onClick:l,disabled:m,"aria-label":a?"Pause":"Play",children:a?n("span",{className:"ff-audio-pause-shape",children:[e("span",{className:"ff-audio-pause-bar"}),e("span",{className:"ff-audio-pause-bar"})]}):e(q,{name:"play",width:8,height:8,cursorType:"pointer",withPadding:!1,className:"ff-audio-play"})}),e(U,{fontSize:8,className:"ff-audio-time",children:g(i)}),n("div",{className:"ff-audio-seek-wrap",children:[e("div",{className:"ff-audio-seek-track"}),e("div",{className:"ff-audio-seek-fill",style:{width:`${w}%`}}),e("input",{type:"range",className:"ff-audio-seek",min:0,max:r||0,step:1,value:i,disabled:m,onChange:e=>{s(Number(e.target.value))},"aria-label":"Seek"})]}),e(U,{fontSize:8,className:"ff-audio-time",children:g(r)}),e(q,{name:"speaker",onClick:m?()=>{}:u,disabled:m,withPadding:!1,className:"ff-audio-speaker-icon"+(d?" ff-audio-speaker-muted":""),cursorType:"pointer"}),e("div",{className:"ff-audio-more-wrap",ref:E,children:e(Ta,{iconName:"more",options:z,onOptionClick:e=>{if("playback-speed"===e.value){const e=b.current?.getBoundingClientRect(),t=b.current?.closest(".ff-option-card"),n=t?.getBoundingClientRect();e&&n&&x({top:n.top,left:e.right+8});const r=tH.indexOf(C);return k(r>=0?r:0),L(!0),void requestAnimationFrame(()=>S.current?.focus())}h(e)},dropdownPlacement:"bottomLeft",displayCard:!0,disabled:m,iconSize:12})}),M&&n(t,{children:[e("div",{className:"ff-audio-speed-overlay",onClick:()=>L(!1)}),e("div",{className:"ff-audio-speed-menu",style:{top:H.top,left:H.left},ref:S,tabIndex:-1,role:"listbox","aria-label":"Playback speed",onKeyDown:e=>{switch(e.key){case"ArrowDown":e.preventDefault(),k(e=>(e+1)%tH.length);break;case"ArrowUp":e.preventDefault(),k(e=>(e-1+tH.length)%tH.length);break;case"Enter":e.preventDefault(),p(tH[V]),L(!1);break;case"Escape":e.preventDefault(),L(!1)}},children:tH.map((t,r)=>{const i=t===C;return e("button",{type:"button",role:"option","aria-selected":i,className:["ff-audio-speed-option",r===V&&"ff-audio-speed-option-highlighted",i&&"ff-audio-speed-option-selected"].filter(Boolean).join(" "),onMouseEnter:()=>k(r),onMouseDown:e=>{e.stopPropagation()},onClick:e=>{e.stopPropagation(),p(t),L(!1)},children:n(U,{fontSize:10,children:[t.toFixed(1),"x"]})},t)})})]})]})};function rH(e,t,n,r,i,a="children"){return function e(o){for(let l=0;l<o.length;l++){const s=o[l];if(s&&s[t]===n){const e=[...o];return"replace"===i?e[l]=r:e.splice("above"===i?l:l+1,0,r),{updatedArray:e}}if(s&&s[a]&&Array.isArray(s[a])){const t=e(s[a]);if(t)return{updatedArray:o.map((e,n)=>n===l?{...e,[a]:t.updatedArray}:e)}}}return null}(e)}const iH=(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),a=r?t:Object.keys(t);if(i.length!==a.length)return!1;if(n)return i.every((e,t)=>iH(e,a[t]));{const n=new Set(a);return i.every(r=>n.has(r)&&iH(e[r],t[r]))}},aH=(e,t)=>!(!Array.isArray(e)||!Array.isArray(t))&&(e.length===t.length&&e.every((e,n)=>{const r=t[n];return iH(e,r)}));function oH(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function lH(e,t){return e&t}function sH(e,t){return e|t}function cH(e,t){return e^t}function dH(e,t){return e&~t}function uH(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 fH(e){for(var t=0;0!=e;)e&=e-1,++t;return t}var hH,CH="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function pH(e){var t,n,r="";for(t=0;t+3<=e.length;t+=3)n=parseInt(e.substring(t,t+3),16),r+=CH.charAt(n>>6)+CH.charAt(63&n);for(t+1==e.length?(n=parseInt(e.substring(t,t+1),16),r+=CH.charAt(n<<2)):t+2==e.length&&(n=parseInt(e.substring(t,t+2),16),r+=CH.charAt(n>>2)+CH.charAt((3&n)<<4));(3&r.length)>0;)r+="=";return r}function mH(e){var t,n="",r=0,i=0;for(t=0;t<e.length&&"="!=e.charAt(t);++t){var a=CH.indexOf(e.charAt(t));a<0||(0==r?(n+=oH(a>>2),i=3&a,r=1):1==r?(n+=oH(i<<2|a>>4),i=15&a,r=2):2==r?(n+=oH(i),n+=oH(a>>2),i=3&a,r=3):(n+=oH(i<<2|a>>4),n+=oH(15&a),r=0))}return 1==r&&(n+=oH(i<<2)),n}var AH,gH=function(e){var t;if(void 0===hH){var n="0123456789ABCDEF",r=" \f\n\r\t \u2028\u2029";for(hH={},t=0;t<16;++t)hH[n.charAt(t)]=t;for(n=n.toLowerCase(),t=10;t<16;++t)hH[n.charAt(t)]=t;for(t=0;t<8;++t)hH[r.charAt(t)]=-1}var i=[],a=0,o=0;for(t=0;t<e.length;++t){var l=e.charAt(t);if("="==l)break;if(-1!=(l=hH[l])){if(void 0===l)throw new Error("Illegal character at offset "+t);a|=l,++o>=2?(i[i.length]=a,a=0,o=0):a<<=4}}if(o)throw new Error("Hex encoding incomplete: 4 bits missing");return i},vH={decode:function(e){var t;if(void 0===AH){var n="= \f\n\r\t \u2028\u2029";for(AH=Object.create(null),t=0;t<64;++t)AH["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t)]=t;for(AH["-"]=62,AH._=63,t=0;t<9;++t)AH[n.charAt(t)]=-1}var r=[],i=0,a=0;for(t=0;t<e.length;++t){var o=e.charAt(t);if("="==o)break;if(-1!=(o=AH[o])){if(void 0===o)throw new Error("Illegal character at offset "+t);i|=o,++a>=4?(r[r.length]=i>>16,r[r.length]=i>>8&255,r[r.length]=255&i,i=0,a=0):i<<=6}}switch(a){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=vH.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 vH.decode(e)}},yH=1e13,wH=function(){function e(e){this.buf=[+e||0]}return e.prototype.mulAdd=function(e,t){var n,r,i=this.buf,a=i.length;for(n=0;n<a;++n)(r=i[n]*e+t)<yH?t=0:r-=(t=0|r/yH)*yH,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+=yH,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+=(yH+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*yH+e[n];return t},e.prototype.simplify=function(){var e=this.buf;return 1==e.length?e[0]:this},e}(),EH=/^(\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)?)?$/,bH=/^(\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 MH(e,t){return e.length>t&&(e=e.substring(0,t)+"…"),e}var LH,HH=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="",a=e;a<t;)n=this.get(a++),r=this.get(a++),i+=String.fromCharCode(n<<8|r);return i},e.prototype.parseTime=function(e,t,n){var r=this.parseStringISO(e,t),i=(n?EH:bH).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,a=i?255:0,o="";r==a&&++e<t;)r=this.get(e);if(0===(n=t-e))return i?-1:0;if(n>4){for(o=r,n<<=3;!(128&(+o^a));)o=+o<<1,--n;o="("+n+" bit)\n"}i&&(r-=256);for(var l=new wH(r),s=e+1;s<t;++s)l.mulAdd(256,this.get(s));return o+l.toString()},e.prototype.parseBitString=function(e,t,n){for(var r=this.get(e),i="("+((t-e-1<<3)-r)+" bit)\n",a="",o=e+1;o<t;++o){for(var l=this.get(o),s=o==t-1?r:0,c=7;c>=s;--c)a+=l>>c&1?"1":"0";if(a.length>n)return i+MH(a,n)}return i+a},e.prototype.parseOctetString=function(e,t,n){if(this.isASCII(e,t))return MH(this.parseStringISO(e,t),n);var r=t-e,i="("+r+" byte)\n";r>(n/=2)&&(t=e+n);for(var a=e;a<t;++a)i+=this.hexByte(this.get(a));return r>n&&(i+="…"),i},e.prototype.parseOID=function(e,t,n){for(var r="",i=new wH,a=0,o=e;o<t;++o){var l=this.get(o);if(i.mulAdd(128,127&l),a+=7,!(128&l)){if(""===r)if((i=i.simplify())instanceof wH)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 MH(r,n);i=new wH,a=0}}return a>0&&(r+=".incomplete"),r},e}(),xH=function(){function e(e,t,n,r,i){if(!(r instanceof VH))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 MH(this.stream.parseStringUTF(t,t+n),e);case 18:case 19:case 20:case 21:case 22:case 26:return MH(this.stream.parseStringISO(t,t+n),e);case 30:return MH(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 HH?t:new HH(t,0);var r=new HH(n),i=new VH(n),a=e.decodeLength(n),o=n.pos,l=o-r.pos,s=null,c=function(){var t=[];if(null!==a){for(var r=o+a;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 "+o)}else try{for(;;){var i=e.decode(n);if(i.tag.isEOC())break;t[t.length]=i}a=o-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===a)throw new Error("We can't skip over an invalid tag with undefined length at offset "+o);n.pos=o+Math.abs(a)}return new e(r,l,a,i,s)},e}(),VH=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 wH;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}(),kH=[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],SH=(1<<26)/kH[kH.length-1],zH=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,a="",o=this.t,l=this.DB-o*this.DB%t;if(o-- >0)for(l<this.DB&&(n=this[o]>>l)>0&&(i=!0,a=oH(n));o>=0;)l<t?(n=(this[o]&(1<<l)-1)<<t-l,n|=this[--o]>>(l+=this.DB-t)):(n=this[o]>>(l-=t)&r,l<=0&&(l+=this.DB,--o)),n>0&&(i=!0),i&&(a+=oH(n));return i?a:"0"},e.prototype.negate=function(){var t=IH();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)+qH(this[this.t-1]^this.s&this.DM)},e.prototype.mod=function(t){var n=IH();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 OH(t):new NH(t),this.exp(e,n)},e.prototype.clone=function(){var e=IH();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=IH();return this.bitwiseTo(e,lH,t),t},e.prototype.or=function(e){var t=IH();return this.bitwiseTo(e,sH,t),t},e.prototype.xor=function(e){var t=IH();return this.bitwiseTo(e,cH,t),t},e.prototype.andNot=function(e){var t=IH();return this.bitwiseTo(e,dH,t),t},e.prototype.not=function(){for(var e=IH(),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=IH();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},e.prototype.shiftRight=function(e){var t=IH();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+uH(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+=fH(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,sH)},e.prototype.clearBit=function(e){return this.changeBit(e,dH)},e.prototype.flipBit=function(e){return this.changeBit(e,cH)},e.prototype.add=function(e){var t=IH();return this.addTo(e,t),t},e.prototype.subtract=function(e){var t=IH();return this.subTo(e,t),t},e.prototype.multiply=function(e){var t=IH();return this.multiplyTo(e,t),t},e.prototype.divide=function(e){var t=IH();return this.divRemTo(e,t,null),t},e.prototype.remainder=function(e){var t=IH();return this.divRemTo(e,null,t),t},e.prototype.divideAndRemainder=function(e){var t=IH(),n=IH();return this.divRemTo(e,t,n),[t,n]},e.prototype.modPow=function(e,t){var n,r,i=e.bitLength(),a=_H(1);if(i<=0)return a;n=i<18?1:i<48?3:i<144?4:i<768?5:6,r=i<8?new OH(t):t.isEven()?new TH(t):new NH(t);var o=[],l=3,s=n-1,c=(1<<n)-1;if(o[1]=r.convert(this),n>1){var d=IH();for(r.sqrTo(o[1],d);l<=c;)o[l]=IH(),r.mulTo(d,o[l-2],o[l]),l+=2}var u,f,h=e.t-1,C=!0,p=IH();for(i=qH(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)o[u].copyTo(a),C=!1;else{for(;l>1;)r.sqrTo(a,p),r.sqrTo(p,a),l-=2;l>0?r.sqrTo(a,p):(f=a,a=p,p=f),r.mulTo(p,o[u],a)}for(;h>=0&&!(e[h]&1<<i);)r.sqrTo(a,p),f=a,a=p,p=f,--i<0&&(i=this.DB-1,--h)}return r.revert(a)},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(),a=_H(1),o=_H(0),l=_H(0),s=_H(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),n?(a.isEven()&&o.isEven()||(a.addTo(this,a),o.subTo(t,o)),a.rShiftTo(1,a)):o.isEven()||o.subTo(t,o),o.rShiftTo(1,o);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&&a.subTo(l,a),o.subTo(s,o)):(i.subTo(r,i),n&&l.subTo(a,l),s.subTo(o,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 ZH)},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(),a=n.getLowestSetBit();if(a<0)return t;for(i<a&&(a=i),a>0&&(t.rShiftTo(a,t),n.rShiftTo(a,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 a>0&&n.lShiftTo(a,n),n},e.prototype.isProbablePrime=function(e){var t,n=this.abs();if(1==n.t&&n[0]<=kH[kH.length-1]){for(t=0;t<kH.length;++t)if(n[0]==kH[t])return!0;return!1}if(n.isEven())return!1;for(t=1;t<kH.length;){for(var r=kH[t],i=t+1;i<kH.length&&r<SH;)r*=kH[i++];for(r=n.modInt(r);t<i;)if(r%kH[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,a=!1,o=0;--i>=0;){var l=8==r?255&+t[i]:BH(t,i);l<0?"-"==t.charAt(i)&&(a=!0):(a=!1,0==o?this[this.t++]=l:o+r>this.DB?(this[this.t-1]|=(l&(1<<this.DB-o)-1)<<o,this[this.t++]=l>>this.DB-o):this[this.t-1]|=l<<o,(o+=r)>=this.DB&&(o-=this.DB))}8==r&&128&+t[0]&&(this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),a&&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,a=Math.floor(e/this.DB),o=this.s<<n&this.DM,l=this.t-1;l>=0;--l)t[l+a+1]=this[l]>>r|o,o=(this[l]&i)<<n;for(l=a-1;l>=0;--l)t[l]=0;t[a]=o,t.t=this.t+a+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,a=(1<<r)-1;t[0]=this[n]>>r;for(var o=n+1;o<this.t;++o)t[o-n-1]|=(this[o]&a)<<i,t[o-n]=this[o]>>r;r>0&&(t[this.t-n-1]|=(this.s&a)<<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(),a=r.t;for(n.t=a+i.t;--a>=0;)n[a]=0;for(a=0;a<i.t;++a)n[a+r.t]=r.am(0,i[a],n,a,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 a=this.abs();if(a.t<i.t)return null!=n&&n.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=IH());var o=IH(),l=this.s,s=t.s,c=this.DB-qH(i[i.t-1]);c>0?(i.lShiftTo(c,o),a.lShiftTo(c,r)):(i.copyTo(o),a.copyTo(r));var d=o.t,u=o[d-1];if(0!=u){var f=u*(1<<this.F1)+(d>1?o[d-2]>>this.F2:0),h=this.FV/f,C=(1<<this.F1)/f,p=1<<this.F2,m=r.t,A=m-d,g=null==n?IH():n;for(o.dlShiftTo(A,g),r.compareTo(g)>=0&&(r[r.t++]=1,r.subTo(g,r)),e.ONE.dlShiftTo(d,g),g.subTo(o,o);o.t<d;)o[o.t++]=0;for(;--A>=0;){var v=r[--m]==u?this.DM:Math.floor(r[m]*h+(r[m-1]+p)*C);if((r[m]+=o.am(0,v,r,A,0,d))<v)for(o.dlShiftTo(A,g),r.subTo(g,r);r[m]<--v;)r.subTo(g,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=IH(),i=IH(),a=n.convert(this),o=qH(t)-1;for(a.copyTo(r);--o>=0;)if(n.sqrTo(r,i),(t&1<<o)>0)n.mulTo(i,a,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=_H(n),i=IH(),a=IH(),o="";for(this.divRemTo(r,i,a);i.signum()>0;)o=(n+a.intValue()).toString(e).substring(1)+o,i.divRemTo(r,i,a);return a.intValue().toString(e)+o},e.prototype.fromRadix=function(t,n){this.fromInt(0),null==n&&(n=10);for(var r=this.chunkSize(n),i=Math.pow(n,r),a=!1,o=0,l=0,s=0;s<t.length;++s){var c=BH(t,s);c<0?"-"==t.charAt(s)&&0==this.signum()&&(a=!0):(l=n*l+c,++o>=r&&(this.dMultiply(i),this.dAddOffset(l,0),o=0,l=0))}o>0&&(this.dMultiply(Math.pow(n,o)),this.dAddOffset(l,0)),a&&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),sH,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=[],a=7&t;i.length=1+(t>>3),n.nextBytes(i),a>0?i[0]&=(1<<a)-1:i[0]=0,this.fromString(i,256)}},e.prototype.bitwiseTo=function(e,t,n){var r,i,a=Math.min(e.t,this.t);for(r=0;r<a;++r)n[r]=t(this[r],e[r]);if(e.t<this.t){for(i=e.s&this.DM,r=a;r<this.t;++r)n[r]=t(this[r],i);n.t=this.t}else{for(i=this.s&this.DM,r=a;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)>kH.length&&(t=kH.length);for(var a=IH(),o=0;o<t;++o){a.fromInt(kH[Math.floor(Math.random()*kH.length)]);var l=a.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=IH();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 a=n.getLowestSetBit(),o=r.getLowestSetBit();if(o<0)t(n);else{a<o&&(o=a),o>0&&(n.rShiftTo(o,n),r.rShiftTo(o,r));var l=function(){(a=n.getLowestSetBit())>0&&n.rShiftTo(a,n),(a=r.getLowestSetBit())>0&&r.rShiftTo(a,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):(o>0&&r.lShiftTo(o,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),sH,this),this.isEven()&&this.dAddOffset(1,0);var a=this,o=function(){a.dAddOffset(2,0),a.bitLength()>t&&a.subTo(e.ONE.shiftLeft(t-1),a),a.isProbablePrime(n)?setTimeout(function(){i()},0):setTimeout(o,0)};setTimeout(o,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}(),ZH=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}(),OH=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}(),NH=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=IH();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(zH.ZERO)>0&&this.m.subTo(t,t),t},e.prototype.revert=function(e){var t=IH();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}(),TH=function(){function e(e){this.m=e,this.r2=IH(),this.q3=IH(),zH.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=IH();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 IH(){return new zH(null)}function DH(e,t){return new zH(e,t)}var FH="undefined"!=typeof navigator;FH&&"Microsoft Internet Explorer"==navigator.appName?(zH.prototype.am=function(e,t,n,r,i,a){for(var o=32767&t,l=t>>15;--a>=0;){var s=32767&this[e],c=this[e++]>>15,d=l*s+c*o;i=((s=o*s+((32767&d)<<15)+n[r]+(1073741823&i))>>>30)+(d>>>15)+l*c+(i>>>30),n[r++]=1073741823&s}return i},LH=30):FH&&"Netscape"!=navigator.appName?(zH.prototype.am=function(e,t,n,r,i,a){for(;--a>=0;){var o=t*this[e++]+n[r]+i;i=Math.floor(o/67108864),n[r++]=67108863&o}return i},LH=26):(zH.prototype.am=function(e,t,n,r,i,a){for(var o=16383&t,l=t>>14;--a>=0;){var s=16383&this[e],c=this[e++]>>14,d=l*s+c*o;i=((s=o*s+((16383&d)<<14)+n[r]+i)>>28)+(d>>14)+l*c,n[r++]=268435455&s}return i},LH=28),zH.prototype.DB=LH,zH.prototype.DM=(1<<LH)-1,zH.prototype.DV=1<<LH;zH.prototype.FV=Math.pow(2,52),zH.prototype.F1=52-LH,zH.prototype.F2=2*LH-52;var RH,PH,jH=[];for(RH="0".charCodeAt(0),PH=0;PH<=9;++PH)jH[RH++]=PH;for(RH="a".charCodeAt(0),PH=10;PH<36;++PH)jH[RH++]=PH;for(RH="A".charCodeAt(0),PH=10;PH<36;++PH)jH[RH++]=PH;function BH(e,t){var n=jH[e.charCodeAt(t)];return null==n?-1:n}function _H(e){var t=IH();return t.fromInt(e),t}function qH(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}zH.ZERO=_H(0),zH.ONE=_H(1);var UH=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 WH,XH,QH=null;if(null==QH){QH=[],XH=0;var GH=void 0;if("undefined"!=typeof window&&self.crypto&&self.crypto.getRandomValues){var KH=new Uint32Array(256);for(self.crypto.getRandomValues(KH),GH=0;GH<KH.length;++GH)QH[XH++]=255&KH[GH]}var YH=0,JH=function(e){if((YH=YH||0)>=256||XH>=256)self.removeEventListener?self.removeEventListener("mousemove",JH,!1):self.detachEvent&&self.detachEvent("onmousemove",JH);else try{var t=e.x+e.y;QH[XH++]=255&t,YH+=1}catch(e){}};"undefined"!=typeof window&&(self.addEventListener?self.addEventListener("mousemove",JH,!1):self.attachEvent&&self.attachEvent("onmousemove",JH))}function $H(){if(null==WH){for(WH=new UH;XH<256;){var e=Math.floor(65536*Math.random());QH[XH++]=255&e}for(WH.init(QH),XH=0;XH<QH.length;++XH)QH[XH]=0;XH=0}return WH.next()}var ex=function(){function e(){}return e.prototype.nextBytes=function(e){for(var t=0;t<e.length;++t)e[t]=$H()},e}();function tx(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,a,o,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],a=C[3],o=C[4],l=C[5],s=C[6],c=C[7],u=0;u<64;u++)p[u]=u<16?e[u+d]:fx(fx(fx(dx(p[u-2]),p[u-7]),cx(p[u-15])),p[u-16]),f=fx(fx(fx(fx(c,sx(o)),ax(o,l,s)),ux[u]),p[u]),h=fx(lx(n),ox(n,r,i)),c=s,s=l,l=o,o=fx(a,f),a=i,i=r,r=n,n=fx(f,h);C[0]=fx(n,C[0]),C[1]=fx(r,C[1]),C[2]=fx(i,C[2]),C[3]=fx(a,C[3]),C[4]=fx(o,C[4]),C[5]=fx(l,C[5]),C[6]=fx(s,C[6]),C[7]=fx(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 nx(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 rx(e,t){return e>>>t|e<<32-t}function ix(e,t){return e>>>t}function ax(e,t,n){return e&t^~e&n}function ox(e,t,n){return e&t^e&n^t&n}function lx(e){return rx(e,2)^rx(e,13)^rx(e,22)}function sx(e){return rx(e,6)^rx(e,11)^rx(e,25)}function cx(e){return rx(e,7)^rx(e,18)^ix(e,3)}function dx(e){return rx(e,17)^rx(e,19)^ix(e,10)}var ux=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 fx(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function hx(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 a=new ex,o=[];t>2;){for(o[0]=0;0==o[0];)a.nextBytes(o);n[--t]=o[0]}return n[--t]=2,n[--t]=0,new zH(n)}function Cx(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 px(e,t){var n=tx;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 a=n("")+i+""+e,o=new Array(32);(new ex).nextBytes(o);var l=Cx(o,a.length,n),s=[];for(r=0;r<a.length;r+=1)s[r]=a.charCodeAt(r)^l.charCodeAt(r);var c=Cx(s,o.length,n),d=[0];for(r=0;r<o.length;r+=1)d[r+1]=o[r]^c.charCodeAt(r);return new zH(d.concat(s))}var mx=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=DH(e,16),this.e=parseInt(t,16)):console.error("Invalid RSA public key")},e.prototype.encrypt=function(e,t){void 0===t&&(t=hx);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 a=i.toString(16),o=a.length,l=0;l<2*n-o;l++)a="0"+a;return a},e.prototype.setPrivate=function(e,t,n){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=DH(e,16),this.e=parseInt(t,16),this.d=DH(n,16)):console.error("Invalid RSA private key")},e.prototype.setPrivateEx=function(e,t,n,r,i,a,o,l){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=DH(e,16),this.e=parseInt(t,16),this.d=DH(n,16),this.p=DH(r,16),this.q=DH(i,16),this.dmp1=DH(a,16),this.dmq1=DH(o,16),this.coeff=DH(l,16)):console.error("Invalid RSA private key")},e.prototype.generate=function(e,t){var n=new ex,r=e>>1;this.e=parseInt(t,16);for(var i=new zH(t,16);;){for(;this.p=new zH(e-r,1,n),0!=this.p.subtract(zH.ONE).gcd(i).compareTo(zH.ONE)||!this.p.isProbablePrime(10););for(;this.q=new zH(r,1,n),0!=this.q.subtract(zH.ONE).gcd(i).compareTo(zH.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var a=this.p;this.p=this.q,this.q=a}var o=this.p.subtract(zH.ONE),l=this.q.subtract(zH.ONE),s=o.multiply(l);if(0==s.gcd(i).compareTo(zH.ONE)){this.n=this.p.multiply(this.q),this.d=i.modInverse(s),this.dmp1=this.d.mod(o),this.dmq1=this.d.mod(l),this.coeff=this.q.modInverse(this.p);break}}},e.prototype.decrypt=function(e){var t=DH(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 a=255&n[r];a<128?i+=String.fromCharCode(a):a>191&&a<224?(i+=String.fromCharCode((31&a)<<6|63&n[r+1]),++r):(i+=String.fromCharCode((15&a)<<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 ex,i=e>>1;this.e=parseInt(t,16);var a=new zH(t,16),o=this,l=function(){var t=function(){if(o.p.compareTo(o.q)<=0){var e=o.p;o.p=o.q,o.q=e}var t=o.p.subtract(zH.ONE),r=o.q.subtract(zH.ONE),i=t.multiply(r);0==i.gcd(a).compareTo(zH.ONE)?(o.n=o.p.multiply(o.q),o.d=a.modInverse(i),o.dmp1=o.d.mod(t),o.dmq1=o.d.mod(r),o.coeff=o.q.modInverse(o.p),setTimeout(function(){n()},0)):setTimeout(l,0)},s=function(){o.q=IH(),o.q.fromNumberAsync(i,1,r,function(){o.q.subtract(zH.ONE).gcda(a,function(e){0==e.compareTo(zH.ONE)&&o.q.isProbablePrime(10)?setTimeout(t,0):setTimeout(s,0)})})},c=function(){o.p=IH(),o.p.fromNumberAsync(e-i,1,r,function(){o.p.subtract(zH.ONE).gcda(a,function(e){0==e.compareTo(zH.ONE)&&o.p.isProbablePrime(10)?setTimeout(s,0):setTimeout(c,0)})})};setTimeout(c,0)};setTimeout(l,0)},e.prototype.sign=function(e,t,n){var r=(Ax[n]||"")+t(e).toString(),i=this.n.bitLength()/4,a=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 DH("0001"+r+"00"+e,16)}(r,i);if(null==a)return null;var o=this.doPrivate(a);if(null==o)return null;for(var l=o.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=DH(t,16),i=this.doPublic(r);return null==i?null:function(e){for(var t in Ax)if(Ax.hasOwnProperty(t)){var n=Ax[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 Ax={md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",ripemd160:"3021300906052b2403020105000414"};function gx(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)}
|
|
36
|
+
*/var xy,Vy=(Ly||(Ly=1,"production"===process.env.NODE_ENV?Ey.exports=(wy||(wy=1,function(e){function t(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,a=e[r];if(!(0<i(a,t)))break e;e[r]=t,e[n]=a,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,a=e.length,o=a>>>1;r<o;){var l=2*(r+1)-1,s=e[l],c=l+1,d=e[c];if(0>i(s,n))c<a&&0>i(d,s)?(e[r]=d,e[c]=n,r=c):(e[r]=s,e[l]=n,r=l);else{if(!(c<a&&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(e.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var s=[],c=[],d=1,u=null,f=3,h=!1,C=!1,p=!1,m=!1,A="function"==typeof setTimeout?setTimeout:null,g="function"==typeof clearTimeout?clearTimeout:null,v="undefined"!=typeof setImmediate?setImmediate:null;function y(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 w(e){if(p=!1,y(e),!C)if(null!==n(s))C=!0,b||(b=!0,E());else{var t=n(c);null!==t&&z(w,t.startTime-e)}}var E,b=!1,M=-1,L=5,H=-1;function x(){return!(!m&&e.unstable_now()-H<L)}function V(){if(m=!1,b){var t=e.unstable_now();H=t;var i=!0;try{e:{C=!1,p&&(p=!1,g(M),M=-1),h=!0;var a=f;try{t:{for(y(t),u=n(s);null!==u&&!(u.expirationTime>t&&x());){var o=u.callback;if("function"==typeof o){u.callback=null,f=u.priorityLevel;var l=o(u.expirationTime<=t);if(t=e.unstable_now(),"function"==typeof l){u.callback=l,y(t),i=!0;break t}u===n(s)&&r(s),y(t)}else r(s);u=n(s)}if(null!==u)i=!0;else{var d=n(c);null!==d&&z(w,d.startTime-t),i=!1}}break e}finally{u=null,f=a,h=!1}i=void 0}}finally{i?E():b=!1}}}if("function"==typeof v)E=function(){v(V)};else if("undefined"!=typeof MessageChannel){var k=new MessageChannel,S=k.port2;k.port1.onmessage=V,E=function(){S.postMessage(null)}}else E=function(){A(V,0)};function z(t,n){M=A(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_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_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_requestPaint=function(){m=!0},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,a){var o=e.unstable_now();switch(a="object"==typeof a&&null!==a&&"number"==typeof(a=a.delay)&&0<a?o+a:o,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:a,expirationTime:l=a+l,sortIndex:-1},a>o?(r.sortIndex=a,t(c,r),null===n(s)&&r===n(c)&&(p?(g(M),M=-1):p=!0,z(w,a-o))):(r.sortIndex=l,t(s,r),C||h||(C=!0,b||(b=!0,E()))),r},e.unstable_shouldYield=x,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}}(by)),by):Ey.exports=(My||(My=1,xy=Hy,"production"!==process.env.NODE_ENV&&function(){function e(){if(y=!1,M){var e=xy.unstable_now();x=e;var t=!0;try{e:{g=!1,v&&(v=!1,E(L),L=-1),A=!0;var i=m;try{t:{for(a(e),p=n(f);null!==p&&!(p.expirationTime>e&&l());){var c=p.callback;if("function"==typeof c){p.callback=null,m=p.priorityLevel;var d=c(p.expirationTime<=e);if(e=xy.unstable_now(),"function"==typeof d){p.callback=d,a(e),t=!0;break t}p===n(f)&&r(f),a(e)}else r(f);p=n(f)}if(null!==p)t=!0;else{var u=n(h);null!==u&&s(o,u.startTime-e),t=!1}}break e}finally{p=null,m=i,A=!1}t=void 0}}finally{t?V():M=!1}}}function t(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,a=e[r];if(!(0<i(a,t)))break e;e[r]=t,e[n]=a,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,a=e.length,o=a>>>1;r<o;){var l=2*(r+1)-1,s=e[l],c=l+1,d=e[c];if(0>i(s,n))c<a&&0>i(d,s)?(e[r]=d,e[c]=n,r=c):(e[r]=s,e[l]=n,r=l);else{if(!(c<a&&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}function a(e){for(var i=n(h);null!==i;){if(null===i.callback)r(h);else{if(!(i.startTime<=e))break;r(h),i.sortIndex=i.expirationTime,t(f,i)}i=n(h)}}function o(e){if(v=!1,a(e),!g)if(null!==n(f))g=!0,M||(M=!0,V());else{var t=n(h);null!==t&&s(o,t.startTime-e)}}function l(){return!(!y&&xy.unstable_now()-x<H)}function s(e,t){L=w(function(){e(xy.unstable_now())},t)}if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()),xy.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var c=performance;xy.unstable_now=function(){return c.now()}}else{var d=Date,u=d.now();xy.unstable_now=function(){return d.now()-u}}var f=[],h=[],C=1,p=null,m=3,A=!1,g=!1,v=!1,y=!1,w="function"==typeof setTimeout?setTimeout:null,E="function"==typeof clearTimeout?clearTimeout:null,b="undefined"!=typeof setImmediate?setImmediate:null,M=!1,L=-1,H=5,x=-1;if("function"==typeof b)var V=function(){b(e)};else if("undefined"!=typeof MessageChannel){var k=new MessageChannel,S=k.port2;k.port1.onmessage=e,V=function(){S.postMessage(null)}}else V=function(){w(e,0)};xy.unstable_IdlePriority=5,xy.unstable_ImmediatePriority=1,xy.unstable_LowPriority=4,xy.unstable_NormalPriority=3,xy.unstable_Profiling=null,xy.unstable_UserBlockingPriority=2,xy.unstable_cancelCallback=function(e){e.callback=null},xy.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"):H=0<e?Math.floor(1e3/e):5},xy.unstable_getCurrentPriorityLevel=function(){return m},xy.unstable_next=function(e){switch(m){case 1:case 2:case 3:var t=3;break;default:t=m}var n=m;m=t;try{return e()}finally{m=n}},xy.unstable_requestPaint=function(){y=!0},xy.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=m;m=e;try{return t()}finally{m=n}},xy.unstable_scheduleCallback=function(e,r,i){var a=xy.unstable_now();switch(i="object"==typeof i&&null!==i&&"number"==typeof(i=i.delay)&&0<i?a+i:a,e){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 e={id:C++,callback:r,priorityLevel:e,startTime:i,expirationTime:l=i+l,sortIndex:-1},i>a?(e.sortIndex=i,t(h,e),null===n(f)&&e===n(h)&&(v?(E(L),L=-1):v=!0,s(o,i-a))):(e.sortIndex=l,t(f,e),g||A||(g=!0,M||(M=!0,V()))),e},xy.unstable_shouldYield=l,xy.unstable_wrapCallback=function(e){var t=m;return function(){var n=m;m=t;try{return e.apply(this,arguments)}finally{m=n}}},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Hy)),Ey.exports);const ky=Symbol(),Sy=Symbol(),zy="undefined"==typeof window||/ServerSideRendering/.test(window.navigator&&window.navigator.userAgent)?l:u,Zy=Vy.unstable_runWithPriority?e=>{try{Vy.unstable_runWithPriority(Vy.unstable_NormalPriority,e)}catch(t){if("Not implemented."!==t.message)throw t;e()}}:e=>e();function Oy(e,t){const n=d(e)[ky];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:a}=n,o=t(r),[l,s]=g((e,n)=>{if(!n)return[r,o];if("p"in n)throw n.p;if(n.n===i)return Object.is(e[1],o)?e:[r,o];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,o]);return Object.is(l[1],o)||s(),zy(()=>(a.add(s),()=>{a.delete(s)}),[a]),l[1]}const Ny=function(e){const t=s({[ky]:{v:{current:e},n:{current:-1},l:new Set,u:e=>e()}});var n;return t[Sy]=t.Provider,t.Provider=(n=t.Provider,({value:e,children:t})=>{const r=o(e),i=o(0),[a,l]=c(null);a&&(a(e),l(null));const s=o();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={[ky]:{v:r,n:i,l:e,u:t}}}return zy(()=>{r.current=e,i.current+=1,Zy(()=>{s.current[ky].l.forEach(t=>{t({n:i.current,v:e})})})},[e]),p(n,{value:s.current},t)}),delete t.Consumer,t}([vy,()=>{}]),Ty=({children:t,useTableRef:n,totalWidth:r})=>{const i=o(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})},Iy=t=>e("tr",{...t}),Dy=t=>e("tr",{className:"ff-spreadsheet-row-header",...t});function Fy(){return Oy(Ny,([,e])=>e)}function Ry(e){return Oy(Ny,([t])=>e(t))}const Py=({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:T("corner-header",{"ff-spreadsheet-header--selected":t}),children:e(q,{variant:t?"dark":"light",color:t?"var(--hover-color)":"var(--text-color)",name:"excel_corner_menu"})})})},jy=t=>function(n){const i=Fy(),a=r.useCallback(()=>i({type:xA}),[i]),o=Ry(e=>e.selected instanceof fv);return e(t,{...n,selected:o,onSelect:a})},By=t=>function(n){const i=Fy(),a=r.useCallback((e,t)=>i(function(e,t){return{type:HA,payload:{column:e,extend:t}}}(e,t)),[i]),o=Ry(e=>e.selected.hasEntireColumn(n.column)),l=Ry(e=>e.selectedColumn??void 0),s=Ry(e=>e.active?Qg(e.active,e.model.data):void 0);return e(t,{...n,cell:s,selected:o,selectedColumn:l,onSelect:a,scrollToColumn:n.scrollToColumn})},_y=By(({column:t,label:i,selected:a,onSelect:o,setContextMenu:l,deleteColumn:s,addColumnLeft:c,addColumnRight:d,columnContextEnable:u,cell:f,selectedColumn:C,minimumColumnWidth:p,maxColLimit:m,disableDeleteOption:A,contextMenu:g,onAddColumn:v,onDeleteColumn:y,setVisibleRange:w,scrollToColumn:E})=>{const b=Fy(),M=Ry(e=>e.model.data),L=Ry(e=>e.columnDimensions[t]?.width??p),H=Ry(e=>e.model.data),{columnCount:x}=jv(H),V=e=>{w(t=>{const n={...t,end:"increment"===e?t.end+1:t.end-1};return C&&E(C),n})},k=h(()=>[{label:"Add Column Left",value:"Add Column Left",iconName:"plus_icon",action:()=>{V("increment"),c(p),v?.(C??t,!0)},disableTooltip:"Column limit reached",visible:f?.contextDisable?.["Add Column Left"]??!1,disable:x>=m},{label:"Add Column Right",value:"Add Column Right",iconName:"plus_icon",action:()=>{V("increment"),d(p),v?.(C??t,!1)},disableTooltip:"Column limit reached",visible:f?.contextDisable?.["Add Column Right"]??!1,disable:x>=m},...A?[]:[{label:"Delete Column",value:"Delete Column",iconName:"delete",action:()=>{V("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);o(i,e.shiftKey);const a=e.clientX,l=Number(L),s=e=>{const t=e.clientX-a,n=Math.max(p,l+t);b(function(e,t){return{type:lg,payload:{column:e,width:t}}}(i,n))},c=()=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",c),b(_g())};document.addEventListener("mousemove",s),document.addEventListener("mouseup",c),b(Bg())},[t,L]),z=r.useCallback(e=>b(Dg(e)),[b]),Z=r.useCallback(e=>{o(t,e.shiftKey)},[o,t]),O=r.useCallback(e=>{e.preventDefault(),o(t,e.shiftKey),l({open:u,contextType:"column",options:k})},[t,C,u,k]);return r.useEffect(()=>{void 0!==C&&"column"===g?.contextType&&l(e=>({open:e.open,contextType:"column",options:k}))},[t,C,u,k,"column"===g?.contextType]),n("th",{className:T("ff-spreadsheet-header",{"ff-spreadsheet-header--selected":a}),style:{width:`${L}px`,minWidth:"100px"},onClick:Z,onContextMenu:O,tabIndex:0,children:[e(U,{fontWeight:"medium",children:i??qy(t)}),e("div",{className:"drag-column-selector drag-column-left",onMouseDown:e=>S(e,!1),onDoubleClick:()=>b(mg(t,L)),onClick:()=>z({row:-1,column:t})}),e("div",{className:"drag-column-selector drag-column-right",onMouseDown:e=>S(e,!0),onDoubleClick:()=>b(mg(t,L)),onClick:()=>z({row:-1,column:t})})]},t)});function qy(e){let t="",n=e;for(;n>=0;)t=String.fromCharCode(65+n%26)+t,n=Math.floor(n/26)-1;return t}const Uy=({row:t,label:i,selected:a,onSelect:o,setContextMenu:l,addRowTop:s,addRowBottom:c,deleteRow:d,rowContextEnable:u,selectedRow:f,cell:h,maxRowLimit:C,disableDeleteOption:p,contextMenu:m,setVisibleRange:A,scrollToRow:g})=>{const v=Fy(),y=Ry(e=>e.rowDimensions[t]?.height||32),w=Ry(e=>e.model.data),{rowCount:E}=jv(w),b=e=>{A(t=>{const n={...t,end:"increment"===e?t.end+1:t.end-1};return f&&g(f),n})},M=r.useMemo(()=>[{label:"Add Row Top",value:"Add Row Top",iconName:"plus_icon",action:()=>{b("increment"),s()},disableTooltip:"Row limit reached",visible:h?.contextDisable?.["Add Row Top"]??!1,disable:E>=C},{label:"Add Row Bottom",value:"Add Row Bottom",iconName:"plus_icon",action:()=>{b("increment"),c()},disableTooltip:"Row limit reached",visible:h?.contextDisable?.["Add Row Bottom"]??!1,disable:E>=C},...p?[]:[{label:"Delete Row",value:"Delete Row",iconName:"delete",action:()=>{b("decrement"),d()},disableTooltip:"",visible:h?.contextDisable?.["Delete Row"]??!1,disable:!1}]],[f,t]),L=r.useCallback((e,n)=>{const r=n?t:t-1,i=Math.max(r,0);o(i,e.shiftKey);const a=e.clientY,l=y,s=e=>{const t=e.clientY-a,n=Math.max(32,l+t);v(pg(i,n))},c=()=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",c),v(_g())};document.addEventListener("mousemove",s),document.addEventListener("mouseup",c)},[y,t]),H=r.useCallback(e=>v(Dg(e)),[v]),x=r.useCallback(e=>{o(t,e.shiftKey)},[t]),V=r.useCallback(e=>{e.preventDefault(),o(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:T("ff-spreadsheet-header",{"ff-spreadsheet-header--selected":a}),style:{height:`${y}px`,minHeight:"32px"},onClick:x,onContextMenu:V,tabIndex:0,children:[e(U,{fontWeight:"medium",children:void 0!==i?i:t+1}),e("div",{className:"drag-row-selector drag-row-down",onMouseDown:e=>L(e,!0),onDoubleClick:()=>v(pg(t,y)),onClick:()=>H({row:t,column:-1})}),e("div",{className:"drag-row-selector drag-row-up",onMouseDown:e=>L(e,!1),onDoubleClick:()=>v(pg(t,y)),onClick:()=>H({row:t,column:-1})})]})},Wy=t=>function(n){const i=Fy(),a=Ry(e=>e.selected.hasEntireRow(n.row)),o=Ry(e=>e.active?Qg(e.active,e.model.data):void 0),l=Ry(e=>e.selectedRow??void 0),s=r.useCallback((e,t)=>i(function(e,t){return{type:LA,payload:{row:e,extend:t}}}(e,t)),[i]);return e(t,{...n,selected:a,cell:o,selectedRow:l,onSelect:s,scrollToRow:n.scrollToRow})},Xy=r.memo(({row:t,column:n,DataViewer:i,active:a,dragging:o,mode:l,data:s,evaluatedData:c,select:d,activate:u,edit:f,editable:h,setCellDimensions:C,setCellData:p})=>{const m=r.useRef(null),A=r.useMemo(()=>({row:t,column:n}),[t,n]),g=r.useCallback(e=>{e.preventDefault(),window.getSelection()?.removeAllRanges(),"view"===l&&(C(A,Ev(e.currentTarget)),e.shiftKey?d(A):(u(A),"dropDown"===s?.inputType?.type&&h&&!s?.readOnly&&f()))},[l,C,A,d,u,f,h,s]),v=r.useCallback(e=>{o&&(C(A,Ev(e.currentTarget)),d(A))},[C,d,o,A]);return r.useEffect(()=>{const e=m.current;if(!e)return;const t=()=>{o||C(A,Ev(e))};t();const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[C,A,o]),s&&s.DataViewer&&(i=s.DataViewer),e("td",{ref:m,style:{...s?.style,..."dropDown"===s?.inputType?.type&&{fontSize:"12px"},textDecoration:"underline"===s?.style?.textDecoration?s?.style?.textDecoration:"none"},className:T("ff-spreadsheet-cell",s?.className,{"ff-spreadsheet-active-cell":a||o}),onMouseEnter:v,onMouseDown:g,tabIndex:0,children:e(i,{row:t,column:n,cell:s,active:a,evaluatedCell:c,setCellData:p,inputValue:()=>null})})}),Qy=t=>function(n){const{row:i,column:a}=n,o=Fy(),l=r.useMemo(()=>({row:i,column:a}),[i,a]),s=r.useCallback(e=>o(Fg(l,e)),[o,l]),c=r.useCallback(e=>o(function(e){return{type:kA,payload:{point:e}}}(e)),[o]),d=r.useCallback(e=>o(Dg(e)),[o]),u=r.useCallback(()=>o(Wg()),[o]),f=r.useCallback((e,t)=>o(Rg(e,t)),[o]),h=Ry(e=>wv(e.active,l)),C=Ry(e=>h?e.mode:"view"),p=Ry(e=>e.editable),m=Ry(e=>Qg(l,e.model.data)),A=Ry(e=>Qg(l,e.model.evaluatedData)),g=Ry(e=>e.dragging),v=Ry(e=>e.copied?.has(l)||!1);return e(t,{...n,active:h,copied:v,dragging:g,mode:C,evaluatedData:A,data:m,select:c,activate:d,edit:u,editable:p,setCellDimensions:f,setCellData:s})},Gy=({cell:r,evaluatedCell:i,active:a})=>{const o=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 o?{className:"ff-spreadsheet-data-viewer ff-spreadsheet-data-viewer--boolean",children:Ky(o)}:{className:T("ff-spreadsheet-data-viewer",{"ff-spreadsheet-data-viewer--preserve-breaks":Nv(o)}),children:a||"dropDown"!==r?.inputType?.type?a||"file"!==r?.inputType?.type?!a&&o:e(t,{children:K(r?.value)?n("div",{className:"ff-spreadsheet-data-viewer--without-fileType",children:[e(q,{name:"attachment_icon"})," Attachment"]}):(n=>{if(K(n))return e(t,{});return JSON.parse(n).map(t=>e("div",{className:"ff-spreadsheet-data-viewer--fileType",children:e(zi,{width:r?.style?.width??100,title:t?.name?.split("*")?.[0]??""})},t.name))})(o)}):n("div",{className:"ff-spreadsheet-data-viewer--dropdownType",children:[o,e(q,{name:"arrow_down",height:8,className:"dropdownType-icon"})]})})};function Ky(e){return e?"TRUE":"FALSE"}const Yy=i.forwardRef(({initialValue:t="",onChange:n,className:r="",style:a={}},s)=>{const c=o(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:a,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"}})})}),Jy=({onChange:t,cell:n})=>{const i=r.useRef(null),a=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(Yy,{ref:i,initialValue:n?.value??"",onChange:a,className:"ff-spreadsheet-cell-textarea",style:{...n?.style,width:"100%",height:"100%",borderTop:"",borderBottom:"",borderLeft:"",borderRight:""}})})},$y=t=>{const i=r.useRef(null),a=r.useRef(null),o=Fy(),l=r.useCallback((e,t)=>o(Fg(e,t)),[o]),s=r.useCallback(e=>o(Dg(e)),[o]),c=r.useCallback(()=>o(Wg()),[o]),d=r.useCallback(e=>o({type:cg,payload:{autofill:e}}),[o]),u=r.useCallback(e=>o(function(e){return{type:_A,payload:{changes:e}}}(e)),[o]),f=r.useCallback(()=>{o({type:DA})},[o]),h=Ry(e=>e.rowDimensions),C=Ry(e=>e.active),p=Ry(e=>e.mode),m=Ry(e=>e.active?Qg(e.active,e.model.data):void 0),A=Ry(e=>e.selected),g=Ry(e=>A&&Sv(e.rowDimensions,e.columnDimensions,e.model.data,e.selected)),v=Ry(e=>{let t=C?Vv(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||!v||C.row<t.visibleRowRange.start||C.row>=t.visibleRowRange.end||C.column<t.visibleColRange.start||C.column>=t.visibleColRange.end,[C,v,t.visibleRowRange,t.visibleColRange]),w=r.useRef(void 0),E=r.useRef(null),b=r.useRef(void 0),M=r.useCallback(e=>{C&&l(C,e)},[l,C]),[L,H]=r.useState({value:"",name:""}),[x,V]=r.useState(!1),[k,S]=r.useState(),[z,Z]=r.useState([]),[O,N]=r.useState("var(--ff-select-text-color)");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)){H({value:m?.value,name:m?.value}),N(m?.style?.color),V(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,color:t.color}));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"));Z(e)}catch(e){console.error("Error parsing cell value for files:",e),Z([])}else Z([])},[m?.inputType?.type,m?.value]),r.useEffect(()=>{"dropDown"===m?.inputType?.type&&m?.value!==L.value&&H({value:m?.value,name:m?.value})},[m?.value,m?.inputType?.type,L.value]),r.useEffect(()=>{const e=E.current,t=b.current;if(E.current=C,b.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 I=m&&m.DataEditor||t.DataEditor,D=m&&m.readOnly,F=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 a=()=>{i&&(cancelAnimationFrame(i),i=null)},o=e=>{const n=t.getBoundingClientRect();let r=0,o=0;e.clientY<n.top+50?o=-12:e.clientY>n.bottom-50&&(o=12),e.clientX<n.left+50?r=-12:e.clientX>n.right-50&&(r=12),0!==r||0!==o?(e=>{a();const n=()=>{const{x:r,y:a}=e;0!==r&&(t.scrollLeft+=r),0!==a&&(t.scrollTop+=a),i=requestAnimationFrame(n)};i=requestAnimationFrame(n)})({x:r,y:o}):a()},l=()=>{a(),document.body.style.userSelect=n,document.body.style.overflow=r,document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",l)};document.addEventListener("mousemove",o),document.addEventListener("mouseup",l),d(!0)},[s,d,C]),R=r.useCallback(e=>{e.preventDefault(),t.setContextMenu({open:t.contextOption?.open??!1,contextType:t.contextOption?.contextType??null,options:t.contextOption?.options||[]})},[t]),P=g?.height!==v?.height||g?.width!==v?.width,j=r.useCallback(e=>{C&&P&&(Rg(C,Ev(e.currentTarget)),s(C))},[C,P]),B=t.isAtRight?t.maxWidth-(v?.left-t.scrollPos.left)+100:t.maxWidth,_=t.isAtBottom?t.maxHeight-(v?.top-t.scrollPos.top)+64:t.maxHeight,q=["file","dropDown"].includes(m?.inputType?.type||""),U="dropDown"===m?.inputType?.type;return n("div",{ref:i,className:T("ff-spreadsheet-active-cell",`ff-spreadsheet-active-cell--${p}`,{"ff-spreadsheet-active-cell--hidden":y,"ff-spreadsheet-active-cell--dragging":P&&"text"!==m?.inputType?.type}),onMouseDown:j,style:{...v,backgroundColor:m?.style?.backgroundColor,...q?{display:"flex",alignItems:U?"center":m?.style?.alignContent,justifyContent:U?"flex-start":m?.style?.textAlign}:{},..."edit"===p&&C?{minWidth:Math.min(v?.width,t.maxWidth),minHeight:Math.min(v?.height,t.maxHeight),height:"auto",maxWidth:`${B}px`,maxHeight:`${_}px`,overflow:"auto",..."dropDown"===m?.inputType?.type?{}:{padding:"2px 4px 0px 4px",width:"max-content"}}:{}},onContextMenu:R,onClick:"view"!==p||D?void 0:c,tabIndex:0,children:[e("div",{className:q?"":"active-cell-main",style:U?{width:"100%"}:void 0,children:"dropDown"===m?.inputType?.type?e(ka,{...m?.inputType?.inputProps,dropDownRef:a,showOptions:{open:!("edit"!==p||!C),toggle:x},selectedOption:L,optionsList:k||[],height:26,showLabel:!1,disabled:!t.editable,showBorder:!1,selectedOptionColor:O,optionZIndex:5e3,onChange:e=>{const t=K(e.color)?m?.style:{...m?.style,color:e.color};H({value:e.value,name:e.label}),N(e.color||"var(--ff-select-text-color)"),M({...m,value:e.value,style:t,inputType:m?.inputType})}}):"file"===m?.inputType?.type?e(lA,{...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 a=e[i];t.attachmentAction.viewAttachment(a.id,a.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 a=e.name.split("*")[0],o=i.findIndex(e=>e.name.split("*")[0]===a)!==t,l=n.some(e=>e.name.split("*")[0]===a);return!o&&!l||(r++,!1)});if(n.length+i.length>5)return void sc.info("Cannot upload more than 5 files.");if(t.attachmentAction?.addAttachment&&i.length>0)try{let e=0,r=0,a=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?a++: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}),o(pg(C?.row||0,Math.max(s,h?.[C.row]?.height||s))),Z(c.map(e=>new File([new Blob],e.name?.split("*")[0]??"default")))}a>0&&sc.info("No memory available to add the file"),e>0&&sc.success(`${e} file${e>1?"s":""} uploaded successfully`),r>0&&sc.info(`${r} unsupported ${r>1?"files":"file"}. Please check the file formats.`)}catch(e){console.error("Upload operation failed:",e),sc.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]),a=e[n]?.id;if(-1!==n&&a&&t.attachmentAction?.deleteAttachment)try{const o=await t.attachmentAction.deleteAttachment(a);"SUCCESS"===o||"object"==typeof o&&null!==o&&("status"in o&&"SUCCESS"===o.status||"responseCode"in o&&200===o.responseCode)?(e.splice(n,1),r++):console.error(`Delete failed for ${i.name}: Invalid response`,o)}catch(e){console.error(`Delete error for ${i.name}:`,e),sc.error("Error deleting file")}else console.error(`Cannot delete ${i.name}: Invalid fileId or no match`,{index:n,fileId:a,hasDeleteAttachment:!!t.attachmentAction?.deleteAttachment}),sc.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}),Z(e?.map(e=>new File([new Blob],e.name.split("*")[0]))),sc.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}),Z(t.map(e=>new File([new Blob],e.name.split("*")[0]))),sc.error("Failed to delete file(s). Invalid file data detected.")}else sc.error("Failed to delete file(s). No valid files removed.")}}catch(e){console.error("Delete operation failed:",e),sc.error("Delete operation failed")}}catch(e){console.error("handleFilesChange error:",e),sc.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:(v?.width??0)-60}):"edit"===p&&C&&t.editable?e(I,{row:C.row,column:C.column,cell:m,onChange:M,exitEditMode:f}):e(Yy,{initialValue:m?.value,onChange:()=>{},className:"ff-spreadsheet-cell-textarea",style:{...m?.style,height:"100%",width:"100%",textDecoration:"underline"===m?.style?.textDecoration?"underline":"none",backgroundColor:P?"#1e161f00":m?.style?.backgroundColor,pointerEvents:"none",borderTop:"",borderBottom:"",borderLeft:"",borderRight:""}})}),!["file"].includes(m?.inputType?.type??"")&&("edit"===p||C&&e("div",{onMouseDown:F,className:"select_dot"}))]},`${C?.row}-${C?.column}`)},ew=({dimensions:t,dragging:n,hidden:r,variant:i})=>{const a=Ry(e=>e.active),o=Ry(e=>e.autoFill),l=Ry(e=>a?Vv(a,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 o.open&&s&&c&&l&&(s-h>c-f?(C=s,p=l.height):(p=c,C=l.width)),e("div",{className:T("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}})},tw=({scrollPos:t={top:0,left:0}})=>{const n=Ry(e=>e.selected),i=Ry(e=>e.dragging),a=Ry(e=>e.selected.size(e.model.data)<2),o=Ry(e=>n&&Sv(e.rowDimensions,e.columnDimensions,e.model.data,e.selected)),l=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(ew,{variant:"selected",dimensions:l,dragging:i,hidden:a||!o})},nw=({scrollPos:t={top:0,left:0}})=>{const n=Ry(e=>e.copied),i=null===n,a=Ry(e=>n&&kv(e.rowDimensions,e.columnDimensions,n)),o=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(ew,{variant:"copied",dimensions:o,hidden:i||!a,dragging:!1})},rw=i.forwardRef(({getColorValue:t,disabled:n,initialColor:r},a)=>{const l=o(null);i.useImperativeHandle(a,()=>l.current);const[s,d]=c(r);return e("div",{className:T("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:T("ff-excel-color-selector-picker",{"color-selector-disabled":n}),ref:l,onChange:e=>{d(e.target.value),t(e.target.value.replace("#",""))}})})});rw.displayName="ColorBarSelector";const iw=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"}},aw=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"}},ow=e=>Rv.reduce((t,n)=>Math.abs(n-parseFloat(e))<Math.abs(t-parseFloat(e))?n:t);function lw(e,t=100){const{border:n}=e;let r="",i="",a="",o="";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&&(a="MEDIUM"===n.bottom?"2px solid var(--input-hover-border-color)":"1px solid var(--excel-header-border)"),"THIN"!==n.left&&(o="MEDIUM"===n.left?"2px solid var(--input-hover-border-color)":"1px solid var(--excel-header-border)"),{fontSize:Tv(ow(String(e.size))),fontFamily:(l=e.name,Fv.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:a,borderLeft:o,textAlign:iw(e.alignment.horizontal),alignContent:iw(e.alignment.vertical),height:e.height??32,width:e.width??t};var l}const sw=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"},cw=(e,t=100)=>({name:e.fontFamily||"Arial",size:Iv(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:sw(e.borderTop?e.borderTop.toString():void 0),right:sw(e.borderRight?e.borderRight.toString():void 0),bottom:sw(e.borderBottom?e.borderBottom.toString():void 0),left:sw(e.borderLeft?e.borderLeft.toString():void 0)},alignment:{horizontal:aw(e.textAlign),vertical:aw(e.alignContent),wrapText:!1},width:e.width||t,height:e.height||32}),dw=({toolbar:t="show",editable:r,onBold:i,onItalic:a,setUnderlineType:s,setColor:d,setFontSize:u,setFontFamily:f,setTextAlign:h,setBackgroundColor:C,setBorderType:p,setFormatePainter:m})=>{const A=Ry(e=>e.selected instanceof fv),[g,v]=c("disable"===t||!r),y=Ry(e=>e.active?Qg(e.active,e.model.data):null),w=Ry(e=>e.model.data),E=Ry(e=>e.formattedStyle.open),b={...Dv.style,color:"#1e161f",backgroundColor:"#ffffff",borderColor:"#1e161f"},[M,L]=c(y?.style||b),H=o(null);l(()=>{y?.style&&JSON.stringify(y.style)!==JSON.stringify(M)&&L(y?.style||b),A?v(!r):y&&"boolean"==typeof y.readOnly&&v(y.readOnly||"disable"===t||!r||"dropDown"===y?.inputType?.type)},[y,r]);const x=cw(M),[V,k]=c("border-none"),[S,z]=c({label:"",value:""}),[Z,O]=c({label:"",value:""}),[N,T]=c({color:b.color,backgroundColor:b.backgroundColor,borderColor:b.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"}],D=Rv.map(e=>({label:e,value:e})),F=o(null),R=o(null);l(()=>{let e=setTimeout(()=>{d(w,N.color)},0);return()=>{clearTimeout(e)}},[N.color]),l(()=>{let e=setTimeout(()=>{C(w,N.backgroundColor)},0);return()=>{clearTimeout(e)}},[N.backgroundColor]);return l(()=>{const e=M.fontFamily,t=`${Iv(M.fontSize)}`;z({label:e??"Times New Roman",value:e??"Times New Roman"}),O({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(ka,{disabled:g,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:Fv,selectedOption:S})}),e("div",{className:"ff-excel-toolbar-font-size",children:e(ka,{disabled:g,height:24,showLabel:!1,optionZIndex:2e3,required:!1,onChange:e=>{O({label:e.label,value:e.value}),u(w,e.value)},optionsList:D,selectedOption:Z})})]}),e("div",{className:"ff-excel-toolbar-divider"}),n("div",{className:"ff-excel-toolbar-icon",children:[e(Y,{placement:"top",title:"Text Left",children:e(q,{disabled:g,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(q,{disabled:g,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(q,{disabled:g,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(q,{disabled:g,variant:x.bold?"dark":"light",hoverEffect:!x.bold,onClick:()=>i(w),name:"bold"})}),e(Y,{placement:"top",title:"Italic",children:e(q,{disabled:g,variant:x.italic?"dark":"light",hoverEffect:!x.italic,onClick:()=>a(w),name:"italic"})}),e(Y,{placement:"top",title:"Underline",children:e("div",{className:"ff-excel-toolbar-icon-underline",children:e(q,{disabled:g,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(q,{disabled:g,variant:E?"dark":"light",hoverEffect:!E,onClick:()=>{m(w)},name:"formate_painter"})}),e(Y,{placement:"top",title:"Text Color",children:n("div",{className:"ff-excel-toolbar-icon-color",children:[e(q,{disabled:g,hoverEffect:!0,width:12,height:10,onClick:()=>{d(w,N.color),F.current?.click()},name:"text_color"}),e(rw,{ref:F,disabled:g,getColorValue:e=>{T(t=>({...t,color:e}))},initialColor:N.color})]})}),e(Y,{placement:"top",title:"Background Color",children:n("div",{className:"ff-excel-toolbar-icon-color",children:[e(q,{disabled:g,hoverEffect:!0,width:12,height:10,onClick:()=>{C(w,N.backgroundColor),R.current?.click()},name:"fill_color"}),e(rw,{ref:R,disabled:g,getColorValue:e=>{T(t=>({...t,backgroundColor:e}))},initialColor:N.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(q,{hoverEffect:!0,disabled:g,onClick:()=>p(w,V,"var(--input-hover-border-color)"),name:(()=>{const e=I.find(e=>e.value===V);return e?e.icon:""})()})}),e("span",{ref:H,children:e(Ta,{disabled:g,iconName:"arrow_down",targetRef:H,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)"),k(t)}})})]})})]})},uw=(e,t)=>{let n,r=null;const i=function(...i){const a=this;null===r||Date.now()-r>=t?(e.apply(a,i),r=Date.now()):(n&&clearTimeout(n),n=setTimeout(()=>{e.apply(a,i),r=Date.now()},t-(Date.now()-r)))};return i.cancel=()=>{n&&clearTimeout(n),n=null,r=null},i},fw=r.forwardRef(function(t,i){const{className:a,columnLabels:o=[],rowLabels:l=[],toolbar:s,editable:c,onKeyDown:d,Table:u=Ty,Row:f=Iy,sheetHeight:h,HeaderRow:C=Dy,DataEditor:p=Jy,DataViewer:m=Gy,onSelect:A=()=>{},onActivate:g=()=>{},onEvaluatedDataChange:v=()=>{},contextOption:y,attachmentAction:w,workRef:E,minimumColumnWidth:b,setContextMenu:M,maxRowLimit:L,maxColLimit:H,disableDeleteOption:x,contextMenu:V,getActiveCell:k,onAddColumn:S,onDeleteColumn:z}=t,Z=32,O=b||100,N=r.useRef(!1),I=Ry(e=>e.model.data),[D,F]=r.useState(!1),[R,P]=r.useState(0),[j,B]=r.useState(0),[_,q]=r.useState({top:0,left:0}),[U,W]=r.useState(!1),[X,Q]=r.useState(!1),G=r.useMemo(()=>{const e=t.createFormulaParser||_v,n=new Qv(e,t.data);let r={},i={};t.data.forEach((e,t)=>{let n=Z;e.forEach(e=>{if(e){const t=parseFloat(String(e.style?.height).replace("px",""))||Z;n=Math.max(n,t)}}),r[t]={top:0,height:n}});const a=t.data[0]?t.data[0].length:0;for(let e=0;e<a;e++){let n=O;t.data.forEach(t=>{const r=t[e];if(r){const e=parseFloat(String(r.style?.width).replace("px",""))||O;n=Math.max(n,e)}}),i[e]={left:0,width:n}}return F(e=>!e),{...vy,model:n,selected:t.selected||vy.selected,rowDimensions:r,columnDimensions:i}},[t.createFormulaParser,t.data,t.selected]),K=r.useReducer(yy,G),[Y,J]=K,$=r.useMemo(()=>function(e,t,n){const{columns:r,rows:i}=nv(e);return{rows:t?Math.max(i,t.length):i,columns:n?Math.max(r,n.length):r}}(Y.model.data,l,o),[Y.model.data,l,o]),[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+=Y.rowDimensions[n]?.height||Z;return t},[Y.rowDimensions,Z]),ae=r.useCallback(e=>{let t=0;for(let n=0;n<e;n++)t+=Y.columnDimensions[n]?.width||O;return t},[Y.columnDimensions,O]),oe=r.useRef(!0);r.useEffect(()=>{oe.current?oe.current=!1:J(function(e){return{type:dg,payload:{minimumColumnWidth:e}}}(b))},[b]);const le=ie($.rows),se=ae($.columns),ce=ie(ee.start),de=le-ie(ee.end),ue=ae(ne.start),fe=se-ae(ne.end),he=Y.mode,Ce=r.useRef(null),pe=e=>r.useCallback((...t)=>J(e(...t)),[e]),me=pe(Cg),Ae=pe(Ug),ge=pe(qg),ve=pe(Xg),ye=pe(Pg),we=pe(jg),Ee=pe(Og),be=pe(Bg),Me=pe(_g),Le=pe(Ng),He=pe(Tg),xe=pe(Ig),Ve=pe(Ag),ke=pe(gg),Se=pe(yg),ze=pe(bg),Ze=pe(wg),Oe=pe(Eg),Ne=pe(vg),Te=pe(Mg),Ie=pe(Lg),De=pe(Hg),Fe=pe(hg),Re=pe(xg),Pe=pe(Vg),je=pe(kg),Be=pe(Sg),_e=pe(zg),qe=pe(Zg);r.useImperativeHandle(i,()=>({removeSelect:ve}));const Ue=r.useRef(Y.active);r.useEffect(()=>{if(Y.active!==Ue.current)if(Y.active)g(Y.active);else{const e=E.current;e&&Ov(e)&&document.activeElement&&document.activeElement.blur()}Ue.current=Y.active},[g,Y.active]);const We=r.useRef(Y.model.evaluatedData);r.useEffect(()=>{Y?.model?.evaluatedData!==We?.current&&v(Y?.model?.evaluatedData),We.current=Y.model.evaluatedData},[Y?.model?.evaluatedData,v]);const Xe=r.useRef(Y.selected);r.useEffect(()=>{Y.selected.equals(Xe.current)||t.selected&&Y.selected.equals(t.selected)||A(Y.selected),Xe.current=Y.selected},[Y.selected,A,t.selected]);const Qe=r.useRef(t.selected);r.useEffect(()=>{t.selected&&Qe.current&&!t.selected.equals(Qe.current)&&xe(t.selected),Qe.current=t.selected},[t.selected,xe]);let Ge=r.useRef();r.useEffect(()=>{me(c),void 0!==Ge.current&&t.data!==Ge.current&&Le(t.data),Ge.current=t.data},[t.data,Le,c]);const Ke=r.useRef(t.createFormulaParser);r.useEffect(()=>{t.createFormulaParser!==Ke.current&&t.createFormulaParser&&He(t.createFormulaParser),Ke.current=t.createFormulaParser},[t.createFormulaParser,He]);const Ye=r.useCallback(e=>{const{model:t,selected:n}=Y,{data:r}=t,i=n.toRange(r);if(i){!function(e,t){e.clipboardData?.setData(vv,t)}(e,zv(function(e,t,n){const r=[],i=t.column-e.column;for(let a=e.row;a<=t.row;a++){const o=a-e.row;r[o]=r[o]||Array(i);for(let i=e.column;i<=t.column;i++)r[o][i-e.column]=Qg({row:a,column:i},n)}return r}(i.start,i.end,r)))}},[Y]),Je=r.useCallback(e=>{Zv(Ce.current,he)&&(e.preventDefault(),e.stopPropagation(),Ye(e),Ae())},[he,Ye,Ae]),$e=r.useCallback(e=>{Zv(Ce.current,he)&&(e.preventDefault(),e.stopPropagation(),Ye(e),ge())},[he,Ye,ge]),et=r.useCallback(e=>{if(Zv(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(vv):""}(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(),Ve(I)):t&&"i"===n?(e.preventDefault(),ke(I)):t&&"u"===n&&(e.preventDefault(),Se(I)),d&&d(e),e.defaultPrevented||(function(e,t){return void 0!==Cy(e,t)}(Y,e)&&e.nativeEvent.preventDefault(),we(e))},[Y,d,we]),nt=r.useCallback(()=>{Y.formattedStyle.open&&Y.active&&Fe(Y.active)},[Y]),rt=r.useCallback(()=>{Me(),document.removeEventListener("mouseup",rt)},[Me]),it=r.useCallback(e=>{Y.dragging||1!==e.buttons||"view"!==he||(be(),document.addEventListener("mouseup",rt))},[Y,be,rt,he]),at=r.useMemo(()=>Qy(t.Cell||Xy),[t.Cell,D,c]),ot=r.useMemo(()=>jy(t.CornerIndicator||Py),[t.CornerIndicator,D]),lt=r.useMemo(()=>Wy(t.RowIndicator||Uy),[t.RowIndicator,D]),st=r.useMemo(()=>By(t.ColumnIndicator||_y),[t.ColumnIndicator,D]);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;B(Math.min(Ce.current.clientHeight,n)),P(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:a}=t;q({top:n,left:i});let o=0;for(;o<$.rows&&ie(o)<n;)o++;let l=o;for(;l<$.rows&&ie(l)<n+r;)l++;o=Math.max(0,o-10),l=Math.min($.rows,l+10),te({start:o,end:l});const s=l===$.rows;W(s);let c=0;for(;c<$.columns&&ae(c)<i;)c++;let d=c;for(;d<$.columns&&ae(d)<i+a;)d++;c=Math.max(0,c-10),d=Math.min($.columns,d+10),re({start:c,end:d});const u=d===$.columns;Q(u),V.open&&M({open:!1,contextType:null,options:[{label:"",value:"",iconName:"",action:()=>{},disableTooltip:"",visible:!1,disable:!1}]})},[$.rows,$.columns,ie,ae]),ut=r.useMemo(()=>uw(dt,16),[dt]),ft=e=>{N.current=!0,requestAnimationFrame(()=>{let t=0;for(let n=0;n<=e;n++)t+=Y.rowDimensions?.[n]?.height||Z;requestAnimationFrame(()=>{Ce.current&&e>=$.rows-1&&Ce?.current?.scrollTo({top:t+Z,behavior:"smooth"})})})},ht=e=>{N.current=!0,requestAnimationFrame(()=>{let t=0;for(let n=0;n<=e;n++)t+=Y.columnDimensions?.[n]?.width||O;requestAnimationFrame(()=>{Ce.current&&e>=$.columns-1&&Ce.current.scrollTo({left:t+60,behavior:"smooth"})})})};r.useEffect(()=>{N.current||(te({start:0,end:Math.min(20,$.rows)}),re({start:0,end:Math.min(15,$.columns)}))},[$.rows,$.columns,N.current]);const Ct=yv(ee.end,ee.start),pt=yv(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:`${Y.columnDimensions[t]?.width||O}px`}},t)),e("col",{style:{width:`${fe}px`}},"right-spacer")," "]}),At=r.useMemo(()=>n(u,{useTableRef:ct,totalWidth:se,children:[mt,n("tbody",{children:[n(C,{children:[e(ot,{}),e("div",{className:"spacer left"}),pt.map(n=>e(st,{column:n,minimumColumnWidth:b,setContextMenu:t.setContextMenu,label:n in o?o[n]:void 0,deleteColumn:qe,addColumnLeft:je,addColumnRight:Be,columnContextEnable:t.columnContextEnable,maxColLimit:H,disableDeleteOption:x,contextMenu:V,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:Re,addRowBottom:Pe,deleteRow:_e,setContextMenu:t.setContextMenu,rowContextEnable:t.rowContextEnable,maxRowLimit:L,disableDeleteOption:x,contextMenu:V,setVisibleRange:te,scrollToRow:ft},r),e("div",{className:"spacer left"}),pt.map(t=>e(at,{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,ot,o,st,l,lt,at,m,ee,ne,ce,de,ue,fe,Y.rowDimensions,Y.columnDimensions]),gt=r.useMemo(()=>e($y,{attachmentAction:w,contextOption:y,getActiveCell:k,setContextMenu:t.setContextMenu,DataEditor:p,visibleRowRange:ee,visibleColRange:ne,maxHeight:j-64,maxWidth:R-b,totalHeight:le,totalWidth:se,isAtBottom:U,isAtRight:X,scrollPos:_,editable:c},Y.active?`${Y.active.row}-${Y.active.column}`:"no-active"),[p,ee,ne,Y.active,j,R,le,se,U,X,c]),vt=r.useMemo(()=>n("div",{className:"ff-excel-spreadsheet-container",children:[e("div",{style:{width:`${R}px`},className:T("ff-excel-header-column-hider",{"ff-excel-header-extend":["show","disable"].includes(s||""),"ff-excel-header-hider":"hide"===s})}),e("div",{style:{height:`${j}px`},className:T("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(dw,{editable:c,toolbar:s,onBold:Ve,onItalic:ke,setUnderlineType:Se,setColor:Te,setBorderType:Ne,setFontSize:Ze,setFontFamily:Oe,setTextAlign:ze,setBackgroundColor:Ie,setFormatePainter:De})}),n("div",{ref:Ce,style:{height:h},className:T("ff-excel-spreadsheet",a),onKeyPress:Ee,onKeyDown:tt,onClick:nt,onMouseMove:it,onScroll:e=>ut(e),children:[At,gt,e(tw,{scrollPos:_}),e(nw,{scrollPos:_})]})]}),[a,Ee,tt,it,At,gt,R]);return e(Ny.Provider,{value:K,children:vt})}),hw=({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(q,{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(U,{as:"label",children:t.label})]})},t.label)}var r;return null})})},Cw=({excelData:r,contextOption:a,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:A=()=>Promise.resolve(),onSaveInfoChange:g,attachmentAction:v={addAttachment:()=>Promise.resolve(""),deleteAttachment:()=>Promise.resolve(""),viewAttachment:()=>Promise.resolve()},onSaveDelay:y=3e3,scroller:w=!1,columnContextEnable:E=!0,rowContextEnable:b=!0,sheetBarContextEnable:M=!0,minimumColumnWidth:L=100,disableDeleteOption:H=!1,maxRowLimit:x=1/0,maxColLimit:V=1/0,maxSheetLimit:k=1/0,getActiveCell:S=()=>{}})=>{const z=o(null),[Z,O]=c([]),[N,I]=c(""),[D,F]=i.useState({open:!1,contextType:null,options:[{label:"",value:"",iconName:"",action:()=>{},disableTooltip:"",disable:!1,visible:!1}]}),[R,P]=c({name:"defaultSheet",index:0}),[j,B]=c({defaultSheet:[[Dv]]}),[_,W]=c([[Dv]]),[X,Q]=c((A.length,{})),[G,J]=c({x:0,y:0}),$=o(""),ee=o(null),te=o(null),ne=o(null);l(()=>{const e=r;if(e){const t=e.map(e=>e.sheetName);O(t),K(t.length)||($.current=t[0]||"",P({name:t[0]||"",index:0}));const n={},r={};e.forEach(e=>{const t=e.sheetName,i=e.data,a=Math.max(u,i.length),o=Math.max(f,Math.max(...i.map(e=>e.length)));let l=Array.from({length:a},()=>Array(o).fill({value:"",style:Dv.style,readOnly:!1,inputType:void 0}));i.forEach((e,t)=>{e.forEach((e,n)=>{var r;t<a&&n<o&&(l[t]||(l[t]=[]),l[t][n]={value:(r=e.value,null==r?null:r),style:K(e?.style)?Dv.style:lw(e?.style,L),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}`),a=((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||Dv);l[n][r]={...t,value:t?.value??"",readOnly:t?.readOnly?t.readOnly:i,inputType:a,contextDisable:t?.contextDisable}})}),n[t]=l,A.length>1){const e=i[0]||[];r[t]=Array.from({length:o},(t,n)=>({newData:"",oldData:e[n]?.value||""}))}}),B(n),A.length>1&&Q(r);const i=Object.keys(n)[0];i&&void 0!==n[i]&&W(n[i])}},[r]),l(()=>{g&&g(N),"File saved"===N&&setTimeout(()=>{I("")},2e3)},[N]),l(()=>{I("Saving..."),re(ae())},[j,$.current]);const re=i.useCallback(Ks(e=>{if(A.length>1){const t={...X};Z.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=Z.map(e=>({sheetName:e,headers:t[e]||[]}));A(e,n)}else A(e);I("File saved")},y),[A,X,Z]),ie=i.useCallback(e=>{e.ctrlKey&&"s"===e.key&&(e.preventDefault(),e.stopPropagation(),re(ae()))},[A]);i.useEffect(()=>(document.addEventListener("keydown",ie),()=>{document.removeEventListener("keydown",ie)}),[ie]);const ae=()=>Z.map(e=>{const t=j[e]?.map(e=>{const t=e.reduce((e,t,n)=>{const r=""!==String(t?.value??"").trim(),i=t?.style?.width,a=t?.style?.height;return r||(void 0!==i&&i!==L||void 0!==a&&32!==a)?n:e},-1),n=e.map((e,n)=>e&&e.style&&n<=t?{value:e.value,style:cw(e.style,L),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:K(n.length)?[[]]:n}}),[oe,le]=c(null),se=()=>Z.length>=k,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",Z),t=Array.from({length:u},()=>Array.from({length:f},()=>Dv));O(t=>[...t,e]),P({index:Z?.length,name:e}),B({...j,[e]:t}),W(t),A.length>1&&Q(t=>({...t,[e]:Array.from({length:f},()=>({newData:"",oldData:""}))})),$.current=e},de=(e=[[Dv]])=>{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 sc.warning("Sheet name cannot be empty."),r.textContent=R.name,void le(null);if(i.length>50)return sc.warning("The sheet name cannot be greater than 50 characters"),r.textContent=R.name,void le(null);if(Z.map(e=>e.toLowerCase()).includes(i.toLowerCase())&&n.trim()?.toLowerCase()!==i?.toLowerCase())return sc.warning("Sheet name already exists"),r.textContent=R.name,void le(null);let a=Z;de(j?.[n]),a.splice(t,1,i);const o=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??[]}}(j,n,i);$.current=i,P(e=>({...e,name:i})),B(o),A.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!==R.name&&t!==R.index&&(P({index:t,name:e}),O(n=>{const r=[...n];return r[t]=e,r}),de(j[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)&&D.open&&(F({open:!1,contextType:null,options:[{label:"",value:"",iconName:"",action:()=>{},disableTooltip:"",visible:!1,disable:!1}]}),t||(e.preventDefault(),e.stopPropagation()))},[D.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()},...H?[]:[{label:"Delete Sheet",value:"Delete Sheet",iconName:"delete",action:()=>((e,t)=>{if(Z.length>1){let n=Z.slice();n.splice(t,1);const r={...j};delete r[e];const i=Math.min(t,n.length-1);O(n),B(r),A.length>1&&Q(t=>{const n={...t};return delete n[e],n});const a=n[i]?n[i]:"";P({index:i,name:a}),de(r?.[a]),$.current=a}else sc.warning("Cannot delete the last sheet.")})(t,n),disableTooltip:"",visible:!1,disable:!1}]];F(e=>({...e,open:!0,contextType:"sheet",options:r}))};l(()=>{ne.current?.removeSelect()},[R.name]);return e(t,{children:Z.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,a=e.clientY-(t?.top||0)+r;const o=300,l=window.innerWidth,s=window.innerHeight,c=l-e.clientX,d=e.clientX,u=s-e.clientY,f=e.clientY;c<o&&d>=o?i=e.clientX-(t?.left||0)+n-150:i+=2,u<200&&f>=200?a=e.clientY-(t?.top||0)+r-20:a+=2,e.target.classList.contains("ff-excel-tab-list")?J({x:i,y:a-(H?32:65)}):(i+o>l&&(i=l-o-2),i<0&&(i=2),J({x:i+m,y:a+p}))},onClick:e=>{e.stopPropagation(),D.open&&F({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(fw,{ref:ne,editable:C,attachmentAction:v,toolbar:s,sheetHeight:h,setContextMenu:F,contextOption:a,data:_,columnContextEnable:E,rowContextEnable:b,minimumColumnWidth:L,onEvaluatedDataChange:e=>{B(t=>({...t,[$.current]:e}))},workRef:ee,scroller:w,maxRowLimit:x,maxColLimit:V,disableDeleteOption:H,contextMenu:D,getActiveCell:S,onAddColumn:(e,t)=>{A.length>1&&Q(n=>{const r=R.name,i=[...n[r]||[]],a=t?e:e+1;return i.splice(a,0,{newData:"",oldData:""}),{...n,[r]:i}})},onDeleteColumn:e=>{A.length>1&&Q(t=>{const n=R.name,r=[...t[n]||[]];return r.splice(e,1),{...t,[n]:r}})}},R.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(q,{disabled:!C||se(),className:"ff-excel-add-sheet-icon",hoverEffect:!0,onClick:ce,name:"plus_icon",height:20,width:20})}),e(Ta,{options:(t=>t.map((t,r)=>({label:n("div",{style:{display:"flex",gap:"8px"},children:[R?.name===t?e(q,{height:16,width:16,name:"tick"}):e("div",{style:{height:"16px",width:"24px"}}),e(Y,{title:xn(t,20,"count")?t:"",children:e(U,{children:Hn(t,20,"count")})})]}),name:r,value:t})))(Z),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:R.name})]}),e("div",{className:"ff-excel-tab-container",children:Z.map((t,n)=>e(U,{lineHeight:"16px",children:e("div",{onContextMenu:e=>{fe(t,n),M&&Ce(e,t,n)},className:T("ff-excel-tab-list",{active:t===R.name}),onClick:()=>{fe(t,n)},suppressContentEditableWarning:oe===n,onDoubleClick:e=>{"show"===d&&(le(n),null===oe&&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&&oe===n,onBlur:e=>{ue(e,n,t)},onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),ue(e,n,t))},children:t})},t))})]}),D.open&&e(hw,{contextMenu:D,position:G,editable:C}),e(lc,{})]})})},pw=({label:t="",isActive:n=!0,onClick:r=()=>{},isFilterChip:i=!1})=>{const a=i?"filter":"module";return e("div",{className:T("ff-module-chip",{"ff-filter-chip":i,[`ff-${a}-chip--active`]:n,[`ff-${a}-chip--hover`]:!n}),onClick:r,children:e(U,{lineHeight:"18px",className:"module-typography",children:t})})},mw=({x:e,y:t,radius:n,startAngle:r,endAngle:i})=>{const a=e+n*Math.cos(r),o=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 ${a} ${o} A ${n} ${n} 0 ${c} 1 ${l} ${s}`},Aw=({radius:t=15,lineWidth:r=5,label:i,percentageValue:a,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}),[A,g]=c(!1),v=o(null);let y=-Math.PI/2;const w=2*(t+r),{backgroundArcPath:E,foregroundArcPath:b}=((e,t,n)=>{const r=t,i=r+Math.max(0,Math.min(e,100))/100*2*Math.PI;return{backgroundArcPath:mw({x:0,y:0,radius:n,startAngle:0,endAngle:2*Math.PI}),foregroundArcPath:mw({x:0,y:0,radius:n,startAngle:r,endAngle:i})}})(a,y,t),M=()=>{g(!0)},L=()=>{m({x:0,y:0}),g(!1)},H=e=>{if(v.current){const t=v.current.getBoundingClientRect();m({x:e.clientX-t.left,y:e.clientY-t.top})}};return n("div",{ref:v,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:E,fill:"none",stroke:f,strokeWidth:r,onMouseEnter:M,onMouseLeave:L,onMouseMove:H}),e("path",{d:b,fill:"none",stroke:u,strokeWidth:r,onMouseEnter:M,onMouseLeave:L,onMouseMove:H}),h&&e("path",{d:b,fill:"none",stroke:"var(--dotted-border-color)",strokeOpacity:"0.4",strokeWidth:r,onMouseEnter:M,onMouseLeave:L,onMouseMove:H}),l?e("foreignObject",{x:"-10",y:"-10",width:"20",height:"20",children:e(q,{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(a)}%`})]})}),A&&n("div",{className:"ff-icon-radial-chart-tooltip",style:{position:"absolute",left:`${p.x+15}px`,top:p.y-5+"px"},children:[e(U,{children:`${i} : `}),n(U,{children:[a,"%"]})]})]})},gw=({mediaSrc:t,fileId:r,onExpandClick:i,onDeleteClick:a,onDownloadClick:o,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(q,{name:"download_file_icon",height:10,width:10,onClick:o,color:"var(--icons-default-color)"})})}),u&&e("div",{className:"ff-icon-container",children:e(Y,{title:"Delete",placement:"bottom",children:e(q,{name:"delete",height:10,width:10,color:"var(--ff-delete-button-attachment)",onClick:()=>{a&&a(r)}})})})]}),e("div",{className:"ff-expand-icon-container",children:e(Y,{title:"Maximize",placement:"bottom",children:e(q,{name:"expand_icon",height:16,width:16,onClick:i})})})]}),e(U,{color:"var(--text-area-default-color)",fontWeight:"medium",className:"ff-media-text",children:c})]})}),vw=({icon:r,status:i,count:a,text:o,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(q,{name:r,height:20,width:20,hoverEffect:!1})}),!C.includes(i.toLowerCase())&&e(U,{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(U,{fontWeight:"semi-bold",fontSize:"10px",className:"ff-text",lineHeight:"15px",color:"var(--ff-chip-text-color)",children:o}),e(U,{fontWeight:"semi-bold",fontSize:"24px",className:"ff-number",lineHeight:"36px",children:"defect density"===i.toLowerCase()?n(t,{children:[a.toString().padStart(2,"0"),e(U,{fontSize:"15px",fontWeight:"semi-bold",children:"/ Modules"})]}):"quality score"===i.toLowerCase()?`${parseFloat(a.toString()).toFixed(2)}%`:a.toString().padStart(2,"0")})]}:{children:[e(U,{fontWeight:"semi-bold",fontSize:"24px",className:"ff-number",lineHeight:"24px",color:f?"var(--base-bg-color)":"",children:a.toString().padStart(2,"0")}),e(U,{className:"ff-text",lineHeight:"18px",color:f?"var(--base-bg-color)":"var(--ff-chip-text-color)",children:o})]})})]})},yw=({option:t})=>{const r=o(null),[i,a]=c(!1);l(()=>{const e=r.current;if(!e)return;const t=()=>{a(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(q,{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})]})};function ww(e){return()=>e}function Ew(e){e()}function bw(e,t){return n=>e(t(n))}function Mw(e,t){return()=>e(t)}function Lw(e){return void 0!==e}function Hw(){}function xw(e,t){return t(e),e}function Vw(e,t){return t(e)}function kw(...e){return e}function Sw(e,t){return e(1,t)}function zw(e,t){e(0,t)}function Zw(e){e(2)}function Ow(e){return e(4)}function Nw(e,t){return Sw(e,function(e,t){return n=>e(t,n)}(t,0))}function Tw(e,t){const n=e(1,e=>{n(),t(e)});return n}function Iw(e){let t,n;return r=>i=>{t=i,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function Dw(e,t){return e===t}function Fw(e=Dw){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function Rw(e){return t=>n=>{e(n)&&t(n)}}function Pw(e){return t=>bw(t,e)}function jw(e){return t=>()=>{t(e)}}function Bw(e,...t){const n=function(...e){return t=>e.reduceRight(Vw,t)}(...t);return(t,r)=>{switch(t){case 2:return void Zw(e);case 1:return Sw(e,n(r))}}}function _w(e,t){return n=>r=>{n(t=e(t,r))}}function qw(e){return t=>n=>{e>0?e--:t(n)}}function Uw(e){let t,n=null;return r=>i=>{n=i,!t&&(t=setTimeout(()=>{t=void 0,r(n)},e))}}function Ww(...e){const t=new Array(e.length);let n=0,r=null;const i=2**e.length-1;return e.forEach((e,a)=>{const o=2**a;Sw(e,e=>{const l=n;n|=o,t[a]=e,l!==i&&n===i&&r&&(r(),r=null)})}),e=>a=>{const o=()=>{e([a].concat(t))};n===i?o():r=o}}function Xw(e){let t=e;const n=Gw();return(e,r)=>{switch(e){case 0:t=r;break;case 1:r(t);break;case 4:return t}return n(e,r)}}function Qw(e,t){return xw(Xw(t),t=>Nw(e,t))}function Gw(){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 Kw(e){return xw(Gw(),t=>Nw(e,t))}function Yw(e,t=[],{singleton:n}={singleton:!0}){return{constructor:e,dependencies:t,id:Jw(),singleton:n}}const Jw=()=>Symbol();function $w(...e){const t=Gw(),n=new Array(e.length);let r=0;const i=2**e.length-1;return e.forEach((e,a)=>{const o=2**a;Sw(e,e=>{n[a]=e,r|=o,r===i&&zw(t,n)})}),function(e,a){switch(e){case 2:return void Zw(t);case 1:return r===i&&a(n),Sw(t,a)}}}function eE(e,t=Dw){return Bw(e,Fw(t))}function tE(...e){return function(t,n){switch(t){case 2:return;case 1:return function(...e){return()=>{e.map(Ew)}}(...e.map(e=>Sw(e,n)))}}}const nE=0,rE=1,iE=2,aE=3,oE={[nE]:"debug",[aE]:"error",[rE]:"log",[iE]:"warn"},lE=Yw(()=>{const e=Xw(aE);return{log:Xw((t,n,r=rE)=>{r>=((typeof globalThis>"u"?window:globalThis).VIRTUOSO_LOG_LEVEL??Ow(e))&&console[oE[r]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,n)}),logLevel:e}},[],{singleton:!0});function sE(e,t,n){return cE(e,t,n).callbackRef}function cE(e,t,n){const r=i.useRef(null);let a=e=>{};const o=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 a=e=>{e&&t?(o?.observe(e),r.current=e):(r.current&&o?.unobserve(r.current),r.current=null)},{callbackRef:a,ref:r}}function dE(e,t,n,r,a,o,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 a=[];for(let o=0;o<i;o++){const i=e.item(o);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},aE),c===s)continue;const d=a[a.length-1];0===a.length||d.size!==c||d.endIndex!==l-1?a.push({endIndex:l,size:c,startIndex:l}):a[a.length-1].endIndex++}return a}(n.children,t,s?"offsetWidth":"offsetHeight",a);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.scrollLeft:l.scrollTop:d?s?u.scrollX||u.document.documentElement.scrollLeft:u.scrollY||u.document.documentElement.scrollTop:s?c.scrollLeft:c.scrollTop,h=l?s?l.scrollWidth:l.scrollHeight:d?s?u.document.documentElement.scrollWidth:u.document.documentElement.scrollHeight:s?c.scrollWidth:c.scrollHeight,C=l?s?l.offsetWidth:l.offsetHeight:d?s?u.innerWidth:u.innerHeight:s?c.offsetWidth:c.offsetHeight;r({scrollHeight:h,scrollTop:Math.max(f,0),viewportHeight:C}),o?.(s?uE("column-gap",getComputedStyle(n).columnGap,a):uE("row-gap",getComputedStyle(n).rowGap,a)),null!==i&&e(i)},[e,t,a,o,l,r,s]);return cE(d,n,c)}function uE(e,t,n){return"normal"!==t&&!0!==t?.endsWith("px")&&n(`${e} was not resolved to pixel value correctly`,t,iE),"normal"===t?0:parseInt(t??"0",10)}function fE(e,t,n){const r=i.useRef(null),a=i.useCallback(n=>{if(!n?.offsetParent)return;const i=n.getBoundingClientRect(),a=i.width;let o,s;if(t){const e=t.getBoundingClientRect(),n=i.top-e.top;s=e.height-Math.max(0,n),o=n+t.scrollTop}else{const e=l.current.ownerDocument.defaultView;s=e.innerHeight-Math.max(0,i.top),o=i.top+e.scrollY}r.current={offsetTop:o,visibleHeight:s,visibleWidth:a},e(r.current)},[e,t]),{callbackRef:o,ref:l}=cE(a,!0,n),s=i.useCallback(()=>{a(l.current)},[a,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]),o}const hE=Yw(()=>{const e=Gw(),t=Gw(),n=Xw(0),r=Gw(),i=Xw(0),a=Gw(),o=Gw(),l=Xw(0),s=Xw(0),c=Xw(0),d=Xw(0),u=Gw(),f=Gw(),h=Xw(!1),C=Xw(!1),p=Xw(!1);return Nw(Bw(e,Pw(({scrollTop:e})=>e)),t),Nw(Bw(e,Pw(({scrollHeight:e})=>e)),o),Nw(t,i),{deviation:n,fixedFooterHeight:c,fixedHeaderHeight:s,footerHeight:d,headerHeight:l,horizontalDirection:C,scrollBy:f,scrollContainerState:e,scrollHeight:o,scrollingInProgress:h,scrollTo:u,scrollTop:t,skipAnimationFrameInResizeObserver:p,smoothScrollTargetReached:r,statefulScrollTop:i,viewportHeight:a}},[],{singleton:!0}),CE={lvl:0};function pE(e,t){const n=e.length;if(0===n)return[];let{index:r,value:i}=t(e[0]);const a=[];for(let o=1;o<n;o++){const{index:n,value:l}=t(e[o]);a.push({end:n-1,start:r,value:i}),r=n,i=l}return a.push({end:1/0,start:r,value:i}),a}function mE(e){return e===CE}function AE(e,t){if(!mE(e))return t===e.k?e.v:t<e.k?AE(e.l,t):AE(e.r,t)}function gE(e,t,n="k"){if(mE(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){const r=gE(e.r,t,n);return r[0]===-1/0?[e.k,e.v]:r}return gE(e.l,t,n)}function vE(e,t,n){return mE(e)?SE(t,n,1):t===e.k?HE(e,{k:t,v:n}):t<e.k?zE(HE(e,{l:vE(e.l,t,n)})):zE(HE(e,{r:vE(e.r,t,n)}))}function yE(){return CE}function wE(e,t,n){if(mE(e))return[];return function(e){return pE(e,({k:e,v:t})=>({index:e,value:t}))}(ME(e,gE(e,t)[0],n))}function EE(e,t){if(mE(e))return CE;const{k:n,l:r,r:i}=e;if(t===n){if(mE(r))return i;if(mE(i))return r;const[t,n]=kE(r);return LE(HE(e,{k:t,l:xE(r),v:n}))}return LE(HE(e,t<n?{l:EE(r,t)}:{r:EE(i,t)}))}function bE(e){return mE(e)?[]:[...bE(e.l),{k:e.k,v:e.v},...bE(e.r)]}function ME(e,t,n){if(mE(e))return[];const{k:r,l:i,r:a,v:o}=e;let l=[];return r>t&&(l=l.concat(ME(i,t,n))),r>=t&&r<=n&&l.push({k:r,v:o}),r<=n&&(l=l.concat(ME(a,t,n))),l}function LE(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(VE(t))return ZE(HE(e,{lvl:n-1}));if(!mE(t)&&!mE(t.r))return HE(t.r,{l:HE(t,{r:t.r.l}),lvl:n,r:HE(e,{l:t.r.r,lvl:n-1})});throw new Error("Unexpected empty nodes")}if(VE(e))return OE(HE(e,{lvl:n-1}));if(!mE(r)&&!mE(r.l)){const t=r.l,i=VE(t)?r.lvl-1:r.lvl;return HE(t,{l:HE(e,{lvl:n-1,r:t.l}),lvl:t.lvl+1,r:OE(HE(r,{l:t.r,lvl:i}))})}throw new Error("Unexpected empty nodes")}function HE(e,t){return SE(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 xE(e){return mE(e.r)?e.l:LE(HE(e,{r:xE(e.r)}))}function VE(e){return mE(e)||e.lvl>e.r.lvl}function kE(e){return mE(e.r)?[e.k,e.v]:kE(e.r)}function SE(e,t,n,r=CE,i=CE){return{k:e,l:r,lvl:n,r:i,v:t}}function zE(e){return OE(ZE(e))}function ZE(e){const{l:t}=e;return mE(t)||t.lvl!==e.lvl?e:HE(t,{r:HE(e,{l:t.r})})}function OE(e){const{lvl:t,r:n}=e;return mE(n)||mE(n.r)||n.lvl!==t||n.r.lvl!==t?e:HE(n,{l:HE(e,{r:n.l}),lvl:t+1})}function NE(e,t){return!(!e||e.startIndex!==t.startIndex||e.endIndex!==t.endIndex)}function TE(e,t){return!(!e||e[0]!==t[0]||e[1]!==t[1])}const IE=Yw(()=>({recalcInProgress:Xw(!1)}),[],{singleton:!0});function DE(e,t,n){return e[FE(e,t,n)]}function FE(e,t,n,r=0){let i=e.length-1;for(;r<=i;){const a=Math.floor((r+i)/2),o=n(e[a],t);if(0===o)return a;if(-1===o){if(i-r<2)return a-1;i=a-1}else{if(i===r)return a;r=a+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function RE(e,t){return Math.round(e.getBoundingClientRect()[t])}function PE(e){return!mE(e.groupOffsetTree)}function jE({index:e},t){return t===e?0:t<e?-1:1}function BE({offset:e},t){return t===e?0:t<e?-1:1}function _E(e,t,n){if(0===t.length)return 0;const{index:r,offset:i,size:a}=DE(t,e,jE),o=e-r,l=a*o+(o-1)*n+i;return l>0?l+n:l}function qE(e,t){if(!PE(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function UE(e,t,n){if(function(e){return typeof e.groupIndex<"u"}(e))return t.groupIndices[e.groupIndex]+1;let r=qE("LAST"===e.index?n:e.index,t);return r=Math.max(0,r,Math.min(n,r)),r}function WE(e,t,n,r=0){return r>0&&(t=Math.max(t,DE(e,r,jE).offset)),pE(function(e,t,n,r){const i=FE(e,t,r),a=FE(e,n,r,i);return e.slice(i,a+1)}(e,t,n,BE),KE)}function XE(e,[t,n,r,i]){t.length>0&&r("received item sizes",t,nE);const a=e.sizeTree;let o=a,l=0;if(n.length>0&&mE(a)&&2===t.length){const e=t[0].size,r=t[1].size;o=n.reduce((t,n)=>vE(vE(t,n,e),n+1,r),o)}else[o,l]=function(e,t){let n=mE(e)?0:1/0;for(const r of t){const{endIndex:t,size:i,startIndex:a}=r;if(n=Math.min(n,a),mE(e)){e=vE(e,0,i);continue}const o=wE(e,a-1,t+1);if(o.some(YE(r)))continue;let l=!1,s=!1;for(const{end:n,start:r,value:a}of o)l?(t>=r||i===a)&&(e=EE(e,r)):(s=a!==i,l=!0),n>t&&t>=r&&a!==i&&(e=vE(e,t+1,a));s&&(e=vE(e,a,i))}return[e,n]}(o,t);if(o===a)return e;const{lastIndex:s,lastOffset:c,lastSize:d,offsetTree:u}=GE(e.offsetTree,l,o,i);return{groupIndices:n,groupOffsetTree:n.reduce((e,t)=>vE(e,t,_E(t,u,i)),yE()),lastIndex:s,lastOffset:c,lastSize:d,offsetTree:u,sizeTree:o}}function QE(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 GE(e,t,n,r){let i=e,a=0,o=0,l=0,s=0;if(0!==t){s=FE(i,t-1,jE),l=i[s].offset;const e=gE(n,t-1);a=e[0],o=e[1],i.length&&i[s].size===gE(n,t)[1]&&(s-=1),i=i.slice(0,s+1)}else i=[];for(const{start:e,value:s}of wE(n,t,1/0)){const t=e-a,n=t*o+l+t*r;i.push({index:e,offset:n,size:s}),a=e,l=n,o=s}return{lastIndex:a,lastOffset:l,lastSize:o,offsetTree:i}}function KE(e){return{index:e.index,value:e}}function YE(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 JE={offsetHeight:"height",offsetWidth:"width"},$E=Yw(([{log:e},{recalcInProgress:t}])=>{const n=Gw(),r=Gw(),i=Qw(r,0),a=Gw(),o=Gw(),l=Xw(0),s=Xw([]),c=Xw(void 0),d=Xw(void 0),u=Xw(void 0),f=Xw(void 0),h=Xw((e,t)=>RE(e,JE[t])),C=Xw(void 0),p=Xw(0),m={groupIndices:[],groupOffsetTree:yE(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:yE()},A=Qw(Bw(n,Ww(s,e,p),_w(XE,m),Fw()),m),g=Qw(Bw(s,Fw(),_w((e,t)=>({current:t,prev:e.current}),{current:[],prev:[]}),Pw(({prev:e})=>e)),[]);Nw(Bw(s,Rw(e=>e.length>0),Ww(A,p),Pw(([e,t,n])=>{const r=e.reduce((e,r,i)=>vE(e,r,_E(r,t.offsetTree,n)||i),yE());return{...t,groupIndices:e,groupOffsetTree:r}})),A),Nw(Bw(r,Ww(A),Rw(([e,{lastIndex:t}])=>e<t),Pw(([e,{lastIndex:t,lastSize:n}])=>[{endIndex:t,size:n,startIndex:e}])),n),Nw(c,d);const v=Qw(Bw(c,Pw(e=>void 0===e)),!0);Nw(Bw(d,Rw(e=>void 0!==e&&mE(Ow(A).sizeTree)),Pw(e=>{const t=Ow(u),n=Ow(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),Nw(Bw(f,Rw(e=>void 0!==e&&e.length>0&&mE(Ow(A).sizeTree)),Pw(e=>{const t=[];let n=e[0],r=0;for(let i=1;i<e.length;i++){const a=e[i];a!==n&&(t.push({endIndex:i-1,size:n,startIndex:r}),n=a,r=i)}return t.push({endIndex:e.length-1,size:n,startIndex:r}),t})),n),Nw(Bw(s,Ww(u,d),Rw(([,e,t])=>void 0!==e&&void 0!==t),Pw(([e,t,n])=>{const r=[];for(let i=0;i<e.length;i++){const a=e[i],o=e[i+1];r.push({startIndex:a,endIndex:a,size:t}),void 0!==o&&r.push({startIndex:a+1,endIndex:o-1,size:n})}return r})),n);const y=Kw(Bw(n,Ww(A),_w(({sizes:e},[t,n])=>({changed:n!==e,sizes:n}),{changed:!1,sizes:m}),Pw(e=>e.changed)));Sw(Bw(l,_w((e,t)=>({diff:e.prev-t,prev:t}),{diff:0,prev:0}),Pw(e=>e.diff)),e=>{const{groupIndices:n}=Ow(A);if(e>0)zw(t,!0),zw(a,e+QE(e,n));else if(e<0){const t=Ow(g);t.length>0&&(e-=QE(-e,t)),zw(o,e)}}),Sw(Bw(l,Ww(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},aE)});const w=Kw(a);Nw(Bw(a,Ww(A),Pw(([e,t])=>{const n=t.groupIndices.length>0,r=[],i=t.lastSize;if(n){const n=AE(t.sizeTree,0);let a=0,o=0;for(;a<e;){const e=t.groupIndices[o],l=t.groupIndices.length===o+1?1/0:t.groupIndices[o+1]-e-1;r.push({endIndex:e,size:n,startIndex:e}),r.push({endIndex:e+1+l-1,size:i,startIndex:e+1}),o++,a+=l+1}const l=bE(t.sizeTree);return a!==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 bE(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 E=Kw(Bw(o,Ww(A,p),Pw(([e,{offsetTree:t},n])=>_E(-e,t,n))));return Nw(Bw(o,Ww(A,p),Pw(([e,t,n])=>{if(t.groupIndices.length>0){if(mE(t.sizeTree))return t;let r=yE();const i=Ow(g);let a=0,o=0,l=0;for(;a<-e;){l=i[o];const e=i[o+1]-l-1;o++,a+=e+1}if(r=bE(t.sizeTree).reduce((t,{k:n,v:r})=>vE(t,Math.max(0,n+e),r),r),a!==-e){r=vE(r,0,AE(t.sizeTree,l));r=vE(r,1,gE(t.sizeTree,1-e)[1])}return{...t,sizeTree:r,...GE(t.offsetTree,0,r,n)}}const r=bE(t.sizeTree).reduce((t,{k:n,v:r})=>vE(t,Math.max(0,n+e),r),yE());return{...t,sizeTree:r,...GE(t.offsetTree,0,r,n)}})),A),{beforeUnshiftWith:w,data:C,defaultItemSize:d,firstItemIndex:l,fixedItemSize:c,fixedGroupSize:u,gap:p,groupIndices:s,heightEstimates:f,itemSize:h,listRefresh:y,shiftWith:o,shiftWithOffset:E,sizeRanges:n,sizes:A,statefulTotalCount:i,totalCount:r,trackItemSizes:v,unshiftWith:a}},kw(lE,IE),{singleton:!0});function eb(e){return e.reduce((e,t)=>(e.groupIndices.push(e.totalCount),e.totalCount+=t+1,e),{groupIndices:[],totalCount:0})}const tb=Yw(([{groupIndices:e,sizes:t,totalCount:n},{headerHeight:r,scrollTop:i}])=>{const a=Gw(),o=Gw(),l=Kw(Bw(a,Pw(eb)));return Nw(Bw(l,Pw(e=>e.totalCount)),n),Nw(Bw(l,Pw(e=>e.groupIndices)),e),Nw(Bw($w(i,t,r),Rw(([e,t])=>PE(t)),Pw(([e,t,n])=>gE(t.groupOffsetTree,Math.max(e-n,0),"v")[0]),Fw(),Pw(e=>[e])),o),{groupCounts:a,topItemsIndexes:o}},kw($E,hE)),nb=Yw(([{log:e}])=>{const t=Xw(!1),n=Kw(Bw(t,Rw(e=>e),Fw()));return Sw(t,t=>{t&&Ow(e)("props updated",{},nE)}),{didMount:n,propsReady:t}},kw(lE),{singleton:!0}),rb=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function ib(e){const t="number"==typeof e?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!rb)&&(t.behavior="auto"),void 0===t.offset&&(t.offset=0),t}const ab=Yw(([{gap:e,listRefresh:t,sizes:n,totalCount:r},{fixedFooterHeight:i,fixedHeaderHeight:a,footerHeight:o,headerHeight:l,scrollingInProgress:s,scrollTo:c,smoothScrollTargetReached:d,viewportHeight:u},{log:f}])=>{const h=Gw(),C=Gw(),p=Xw(0);let m=null,A=null,g=null;function v(){null!==m&&(m(),m=null),null!==g&&(g(),g=null),A&&(clearTimeout(A),A=null),zw(s,!1)}return Nw(Bw(h,Ww(n,u,r,p,l,o,f),Ww(e,a,i),Pw(([[e,n,r,i,a,o,l,c],u,f,p])=>{const y=ib(e),{align:w,behavior:E,offset:b}=y,M=i-1,L=UE(y,n,M);let H=_E(L,n.offsetTree,u)+o;"end"===w?(H+=f+gE(n.sizeTree,L)[1]-r+p,L===M&&(H+=l)):"center"===w?H+=(f+gE(n.sizeTree,L)[1]-r+p)/2:H-=a,void 0!==b&&0!==b&&(H+=b);const x=t=>{v(),t?(c("retrying to scroll to",{location:e},nE),zw(h,e)):(zw(C,!0),c("list did not change, scroll successful",{},nE))};if(v(),"smooth"===E){let e=!1;g=Sw(t,t=>{e=e||t}),m=Tw(d,()=>{x(e)})}else m=Tw(Bw(t,function(e){return t=>{const n=setTimeout(()=>{t(!1)},e);return e=>{e&&(t(!0),clearTimeout(n))}}}(150)),x);return A=setTimeout(()=>{v()},1200),zw(s,!0),c("scrolling from index to",{behavior:E,index:L,top:H},nE),{behavior:E,top:H}})),c),{scrollTargetReached:C,scrollToIndex:h,topListHeight:p}},kw($E,hE,lE),{singleton:!0});function ob(e,t){0===e?t():requestAnimationFrame(()=>{ob(e-1,t)})}function lb(e,t){const n=t-1;return"number"==typeof e?e:"LAST"===e.index?n:e.index}const sb=Yw(([{defaultItemSize:e,listRefresh:t,sizes:n},{scrollTop:r},{scrollTargetReached:i,scrollToIndex:a},{didMount:o}])=>{const l=Xw(!0),s=Xw(0),c=Xw(!0);return Nw(Bw(o,Ww(s),Rw(([e,t])=>0!==t),jw(!1)),l),Nw(Bw(o,Ww(s),Rw(([e,t])=>0!==t),jw(!1)),c),Sw(Bw($w(t,o),Ww(l,n,e,c),Rw(([[,e],t,{sizeTree:n},r,i])=>e&&(!mE(n)||Lw(r))&&!t&&!i),Ww(s)),([,e])=>{Tw(i,()=>{zw(c,!0)}),ob(4,()=>{Tw(r,()=>{zw(l,!0)}),zw(a,e)})}),{initialItemFinalLocationReached:c,initialTopMostItemIndex:s,scrolledToInitialItem:l}},kw($E,hE,ab,nb),{singleton:!0});function cb(e,t){return Math.abs(e-t)<1.01}const db="up",ub="down",fb={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},hb=Yw(([{footerHeight:e,headerHeight:t,scrollBy:n,scrollContainerState:r,scrollTop:i,viewportHeight:a}])=>{const o=Xw(!1),l=Xw(!0),s=Gw(),c=Gw(),d=Xw(4),u=Xw(0),f=Qw(Bw(tE(Bw(eE(i),qw(1),jw(!0)),Bw(eE(i),qw(1),jw(!1),Iw(100))),Fw()),!1),h=Qw(Bw(tE(Bw(n,jw(!0)),Bw(n,jw(!1),Iw(200))),Fw()),!1);Nw(Bw($w(eE(i),eE(u)),Pw(([e,t])=>e<=t),Fw()),l),Nw(Bw(l,Uw(50)),c);const C=Kw(Bw($w(r,eE(a),eE(t),eE(e),eE(d)),_w((e,[{scrollHeight:t,scrollTop:n},r,i,a,o])=>{const l={scrollHeight:t,scrollTop:n,viewportHeight:r};if(n+r-t>-o){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}},fb),Fw((e,t)=>void 0!==e&&e.atBottom===t.atBottom))),p=Qw(Bw(r,_w((e,{scrollHeight:t,scrollTop:n,viewportHeight:r})=>{if(!cb(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}),Rw(e=>e.changed),Pw(e=>e.jump)),0);Nw(Bw(C,Pw(e=>e.atBottom)),o),Nw(Bw(o,Uw(50)),s);const m=Xw(ub);Nw(Bw(r,Pw(({scrollTop:e})=>e),Fw(),_w((e,t)=>Ow(h)?{direction:e.direction,prevScrollTop:t}:{direction:t<e.prevScrollTop?db:ub,prevScrollTop:t},{direction:ub,prevScrollTop:0}),Pw(e=>e.direction)),m),Nw(Bw(r,Uw(50),jw("none")),m);const A=Xw(0);return Nw(Bw(f,Rw(e=>!e),jw(0)),A),Nw(Bw(i,Uw(100),Ww(f),Rw(([e,t])=>t),_w(([e,t],[n])=>[t,n],[0,0]),Pw(([e,t])=>t-e)),A),{atBottomState:C,atBottomStateChange:s,atBottomThreshold:d,atTopStateChange:c,atTopThreshold:u,isAtBottom:o,isAtTop:l,isScrolling:f,lastJumpDueToItemResize:p,scrollDirection:m,scrollVelocity:A}},kw(hE)),Cb="top",pb="bottom",mb="none";function Ab(e,t,n){return"number"==typeof e?n===db&&t===Cb||n===ub&&t===pb?e:0:n===db?t===Cb?e.main:e.reverse:t===pb?e.main:e.reverse}function gb(e,t){return"number"==typeof e?e:e[t]??0}const vb=Yw(([{deviation:e,fixedHeaderHeight:t,headerHeight:n,scrollTop:r,viewportHeight:i}])=>{const a=Gw(),o=Xw(0),l=Xw(0),s=Xw(0);return{increaseViewportBy:l,listBoundary:a,overscan:s,topListHeight:o,visibleRange:Qw(Bw($w(eE(r),eE(i),eE(n),eE(a,TE),eE(s),eE(o),eE(t),eE(e),eE(l)),Pw(([e,t,n,[r,i],a,o,l,s,c])=>{const d=e-s,u=o+l,f=Math.max(n-d,0);let h=mb;const C=gb(c,Cb),p=gb(c,pb);return r-=s,i+=n+l,(r+=n+l)>e+u-C&&(h=db),(i-=s)<e-f+t+p&&(h=ub),h!==mb?[Math.max(d-n-Ab(a,Cb,h)-C,0),d-f-l+t+Ab(a,pb,h)+p]:null}),Rw(e=>null!==e),Fw(TE)),[0,0])}},kw(hE),{singleton:!0});const yb={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function wb(e,t,n,r,i,a){const{lastIndex:o,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-o,f=c,h=l+u*s+(u-1)*r-d;return{bottom:d,firstItemIndex:a,items:bb(e,i,a),offsetBottom:h,offsetTop:c,top:f,topItems:bb(t,i,a),topListHeight:t.reduce((e,t)=>t.size+e,0),totalCount:n}}function Eb(e,t,n,r,i,a){let o=0;if(n.groupIndices.length>0)for(const t of n.groupIndices){if(t-o>=e)break;o++}const l=e+o,s=lb(t,l);return wb(Array.from({length:l}).map((e,t)=>({data:a[t+s],index:t+s,offset:0,size:0})),[],l,i,n,r)}function bb(e,t,n){if(0===e.length)return[];if(!PE(t))return e.map(e=>({...e,index:e.index+n,originalIndex:e.index}));const r=e[0].index,i=e[e.length-1].index,a=[],o=wE(t.groupOffsetTree,r,i);let l,s=0;for(const r of e){let e;(!l||l.end<r.index)&&(l=o.shift(),s=t.groupIndices.indexOf(l.start)),e=r.index===l.start?{index:s,type:"group"}:{groupIndex:s,index:r.index-(s+1)+n},a.push({...e,data:r.data,offset:r.offset,originalIndex:r.index,size:r.size})}return a}function Mb(e,t){return void 0===e?0:"number"==typeof e?e:e[t]??0}const Lb=Yw(([{data:e,firstItemIndex:t,gap:n,sizes:r,totalCount:i},a,{listBoundary:o,topListHeight:l,visibleRange:s},{initialTopMostItemIndex:c,scrolledToInitialItem:d},{topListHeight:u},f,{didMount:h},{recalcInProgress:C}])=>{const p=Xw([]),m=Xw(0),A=Gw(),g=Xw(0);Nw(a.topItemsIndexes,p);const v=Qw(Bw($w(h,C,eE(s,TE),eE(i),eE(r),eE(c),d,eE(p),eE(t),eE(n),eE(g),e),Rw(([e,t,,n,,,,,,,,r])=>{const i=void 0!==r&&r.length!==n;return e&&!t&&!i}),Pw(([,,[e,t],n,r,i,a,o,l,s,c,d])=>{const u=r,{offsetTree:f,sizeTree:h}=u,C=Ow(m);if(0===n)return{...yb,totalCount:n};if(0===e&&0===t)return 0===C?{...yb,totalCount:n}:Eb(C,i,r,l,s,d||[]);if(mE(h))return C>0?null:wb(function(e,t,n){if(PE(t)){const r=qE(e,t);return[{index:gE(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}]}(lb(i,n),u,d),[],n,s,u,l);const p=[];if(o.length>0){const e=o[0],t=o[o.length-1];let n=0;for(const r of wE(h,e,t)){const i=r.value,a=Math.max(r.start,e),o=Math.min(r.end,t);for(let e=a;e<=o;e++)p.push({data:d?.[e],index:e,offset:n,size:i}),n+=i}}if(!a)return wb([],p,n,s,u,l);const A=o.length>0?o[o.length-1]+1:0,g=WE(f,e,t,A);if(0===g.length)return null;const v=n-1,y=xw([],n=>{for(const r of g){const i=r.value;let a=i.offset,o=r.start;const l=i.size;if(i.offset<e){o+=Math.floor((e-i.offset+s)/(l+s));const t=o-r.start;a+=t*l+t*s}o<A&&(a+=(A-o)*l,o=A);const c=Math.min(r.end,v);for(let e=o;e<=c&&!(a>=t);e++)n.push({data:d?.[e],index:e,offset:a,size:l}),a+=l+s}}),w=Mb(c,Cb),E=Mb(c,pb);if(y.length>0&&(w>0||E>0)){const e=y[0],t=y[y.length-1];if(w>0&&e.index>A){const t=Math.min(w,e.index-A),n=[];let r=e.offset;for(let i=e.index-1;i>=e.index-t;i--){const t=wE(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(E>0&&t.index<v){const e=Math.min(E,v-t.index);let n=t.offset+t.size+s;for(let r=t.index+1;r<=t.index+e;r++){const e=wE(h,r,r)[0]?.value??t.size;y.push({data:d?.[r],index:r,offset:n,size:e}),n+=e+s}}}return wb(y,p,n,s,u,l)}),Rw(e=>null!==e),Fw()),yb);Nw(Bw(e,Rw(Lw),Pw(e=>e?.length)),i),Nw(Bw(v,Pw(e=>e.topListHeight)),u),Nw(u,l),Nw(Bw(v,Pw(e=>[e.top,e.bottom])),o),Nw(Bw(v,Pw(e=>e.items)),A);const y=Kw(Bw(v,Rw(({items:e})=>e.length>0),Ww(i,e),Rw(([{items:e},t])=>e[e.length-1].originalIndex===t-1),Pw(([,e,t])=>[e-1,t]),Fw(TE),Pw(([e])=>e))),w=Kw(Bw(v,Uw(200),Rw(({items:e,topItems:t})=>e.length>0&&e[0].originalIndex===t.length),Pw(({items:e})=>e[0].index),Fw())),E=Kw(Bw(v,Rw(({items:e})=>e.length>0),Pw(({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}}),Fw(NE)));return{endReached:y,initialItemCount:m,itemsRendered:A,listState:v,minOverscanItemCount:g,rangeChanged:E,startReached:w,topItemsIndexes:p,...f}},kw($E,tb,vb,sb,ab,hb,nb,IE),{singleton:!0}),Hb=Yw(([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:n,headerHeight:r},{listState:i}])=>{const a=Gw(),o=Qw(Bw($w(n,e,r,t,i),Pw(([e,t,n,r,i])=>e+t+n+r+i.offsetBottom+i.bottom)),0);return Nw(eE(o),a),{totalListHeight:o,totalListHeightChanged:a}},kw(hE,Lb),{singleton:!0}),xb=Yw(([{viewportHeight:e},{totalListHeight:t}])=>{const n=Xw(!1);return{alignToBottom:n,paddingTopAddition:Qw(Bw($w(n,e,t),Rw(([e])=>e),Pw(([,e,t])=>Math.max(0,e-t)),Uw(0),Fw()),0)}},kw(hE,Hb),{singleton:!0}),Vb=Yw(()=>({context:Xw(null)})),kb=({itemBottom:e,itemTop:t,locationParams:{align:n,behavior:r,...i},viewportBottom:a,viewportTop:o})=>t<o?{...i,align:n??"start",...void 0!==r?{behavior:r}:{}}:e>a?{...i,align:n??"end",...void 0!==r?{behavior:r}:{}}:null,Sb=Yw(([{gap:e,sizes:t,totalCount:n},{fixedFooterHeight:r,fixedHeaderHeight:i,headerHeight:a,scrollingInProgress:o,scrollTop:l,viewportHeight:s},{scrollToIndex:c}])=>{const d=Gw();return Nw(Bw(d,Ww(t,s,n,a,i,r,l),Ww(e),Pw(([[e,t,n,r,i,a,l,s],c])=>{const{calculateViewLocation:d=kb,done:u,...f}=e,h=UE(e,t,r-1),C=_E(h,t.offsetTree,c)+i+a,p=d({itemBottom:C+gE(t.sizeTree,h)[1],itemTop:C,locationParams:f,viewportBottom:s+n-l,viewportTop:s+a});return null!==p?u&&Tw(Bw(o,Rw(e=>!e),qw(Ow(o)?1:2)),u):u?.(),p}),Rw(e=>null!==e)),c),{scrollIntoView:d}},kw($E,hE,ab,Lb,lE),{singleton:!0});function zb(e){return!1!==e&&("smooth"===e?"smooth":"auto")}const Zb=Yw(([{listRefresh:e,totalCount:t,fixedItemSize:n,data:r},{atBottomState:i,isAtBottom:a},{scrollToIndex:o},{scrolledToInitialItem:l},{didMount:s,propsReady:c},{log:d},{scrollingInProgress:u},{context:f},{scrollIntoView:h}])=>{const C=Xw(!1),p=Gw();let m=null;function A(e){zw(o,{align:"end",behavior:e,index:"LAST"})}function g(e){const t=Tw(i,t=>{e&&!t.atBottom&&"SIZE_INCREASED"===t.notAtBottomBecause&&null===m&&(Ow(d)("scrolling to bottom due to increased size",{},nE),A("auto"))});setTimeout(t,100)}Sw(Bw($w(Bw(eE(t),qw(1)),s),Ww(eE(C),a,l,u),Pw(([[e,t],n,r,i,a])=>{let o=t&&i,l="auto";return o&&(l=((e,t)=>"function"==typeof e?zb(e(t)):t&&zb(e))(n,r||a),o=o&&!1!==l),{followOutputBehavior:l,shouldFollow:o,totalCount:e}}),Rw(({shouldFollow:e})=>e)),({followOutputBehavior:t,totalCount:r})=>{null!==m&&(m(),m=null),void 0!==Ow(n)?requestAnimationFrame(()=>{Ow(d)("following output to ",{totalCount:r},nE),A(t)}):m=Tw(e,()=>{Ow(d)("following output to ",{totalCount:r},nE),A(t),m=null})}),Sw(Bw($w(eE(C),t,c),Rw(([e,,t])=>!1!==e&&t),_w(({value:e},[,t])=>({refreshed:e===t,value:t}),{refreshed:!1,value:0}),Rw(({refreshed:e})=>e),Ww(C,t)),([,e])=>{Ow(l)&&g(!1!==e)}),Sw(p,()=>{g(!1!==Ow(C))}),Sw($w(eE(C),i),([e,t])=>{!1!==e&&!t.atBottom&&"VIEWPORT_HEIGHT_DECREASING"===t.notAtBottomBecause&&A("auto")});const v=Xw(null),y=Gw();return Nw(tE(Bw(eE(r),Pw(e=>e?.length??0)),Bw(eE(t))),y),Sw(Bw($w(Bw(y,qw(1)),s),Ww(eE(v),l,u,f),Pw(([[e,t],n,r,i,a])=>t&&r&&n?.({context:a,totalCount:e,scrollingInProgress:i})),Rw(e=>!!e),Uw(0)),t=>{null!==m&&(m(),m=null),void 0!==Ow(n)?requestAnimationFrame(()=>{Ow(d)("scrolling into view",{}),zw(h,t)}):m=Tw(e,()=>{Ow(d)("scrolling into view",{}),zw(h,t),m=null})}),{autoscrollToBottom:p,followOutput:C,scrollIntoViewOnChange:v}},kw($E,hb,ab,sb,nb,lE,hE,Vb,Sb)),Ob=Yw(([{data:e,firstItemIndex:t,gap:n,sizes:r},{initialTopMostItemIndex:i},{initialItemCount:a,listState:o},{didMount:l}])=>(Nw(Bw(l,Ww(a),Rw(([,e])=>0!==e),Ww(i,r,t,n,e),Pw(([[,e],t,n,r,i,a=[]])=>Eb(e,t,n,r,i,a))),o),{}),kw($E,sb,Lb,nb),{singleton:!0}),Nb=Yw(([{didMount:e},{scrollTo:t},{listState:n}])=>{const r=Xw(0);return Sw(Bw(e,Ww(r),Rw(([,e])=>0!==e),Pw(([,e])=>({top:e}))),e=>{Tw(Bw(n,qw(1),Rw(e=>e.items.length>1)),()=>{requestAnimationFrame(()=>{zw(t,e)})})}),{initialScrollTop:r}},kw(nb,hE,Lb),{singleton:!0}),Tb=Yw(([{scrollVelocity:e}])=>{const t=Xw(!1),n=Gw(),r=Xw(!1);return Nw(Bw(e,Ww(r,t,n),Rw(([e,t])=>!1!==t&&void 0!==t),Pw(([e,t,n,r])=>{const{enter:i,exit:a}=t;if(n){if(a(e,r))return!1}else if(i(e,r))return!0;return n}),Fw()),t),Sw(Bw($w(t,e,n),Ww(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}},kw(hb),{singleton:!0}),Ib=Yw(([{scrollContainerState:e,scrollTo:t}])=>{const n=Gw(),r=Gw(),i=Gw(),a=Xw(!1),o=Xw(void 0);return Nw(Bw($w(n,r),Pw(([{scrollHeight:e,scrollTop:t,viewportHeight:n},{offsetTop:r}])=>({scrollHeight:e,scrollTop:Math.max(0,t-r),viewportHeight:n}))),e),Nw(Bw(t,Ww(r),Pw(([e,{offsetTop:t}])=>({...e,top:e.top+t}))),i),{customScrollParent:o,useWindowScroll:a,windowScrollContainerState:n,windowScrollTo:i,windowViewportRect:r}},kw(hE)),Db=Yw(([{sizeRanges:e,sizes:t},{headerHeight:n,scrollTop:r},{initialTopMostItemIndex:i},{didMount:a},{useWindowScroll:o,windowScrollContainerState:l,windowViewportRect:s}])=>{const c=Gw(),d=Xw(void 0),u=Xw(null),f=Xw(null);return Nw(l,u),Nw(s,f),Sw(Bw(c,Ww(t,r,o,u,f,n)),([e,t,n,r,i,a,o])=>{const l=function(e){return bE(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!==a&&(n=i.scrollTop-a.offsetTop),e({ranges:l,scrollTop:n-=o})}),Nw(Bw(d,Rw(Lw),Pw(Fb)),i),Nw(Bw(a,Ww(d),Rw(([,e])=>void 0!==e),Fw(),Pw(([,e])=>e.ranges)),e),{getState:c,restoreStateFrom:d}},kw($E,hE,sb,nb,Ib));function Fb(e){return{align:"start",index:0,offset:e.scrollTop}}const Rb=Yw(([{topItemsIndexes:e}])=>{const t=Xw(0);return Nw(Bw(t,Rw(e=>e>=0),Pw(e=>Array.from({length:e}).map((e,t)=>t))),e),{topItemCount:t}},kw(Lb));function Pb(e){let t,n=!1;return()=>(n||(n=!0,t=e()),t)}const jb=Pb(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),Bb=Yw(([{deviation:e,scrollBy:t,scrollingInProgress:n,scrollTop:r},{isAtBottom:i,isScrolling:a,lastJumpDueToItemResize:o,scrollDirection:l},{listState:s},{beforeUnshiftWith:c,gap:d,shiftWithOffset:u,sizes:f},{log:h},{recalcInProgress:C}])=>{const p=Kw(Bw(s,Ww(o),_w(([,e,t,n],[{bottom:r,items:i,offsetBottom:a,totalCount:o},l])=>{const s=r+a;let c=0;return t===o&&e.length>0&&i.length>0&&(0===i[0].originalIndex&&0===e[0].originalIndex||(c=s-n,0!==c&&(c+=l))),[c,i,o,s]},[0,[],0,0]),Rw(([e])=>0!==e),Ww(r,l,n,i,h,C),Rw(([,e,t,n,,,r])=>!r&&!n&&0!==e&&t===db),Pw(([[e],,,,,t])=>(t("Upward scrolling compensation",{amount:e},nE),e))));function m(n){n>0?(zw(t,{behavior:"auto",top:-n}),zw(e,0)):(zw(e,0),zw(t,{behavior:"auto",top:-n}))}return Sw(Bw(p,Ww(e,a)),([t,n,r])=>{r&&jb()?zw(e,n-t):m(-t)}),Sw(Bw($w(Qw(a,!1),e,C),Rw(([e,t,n])=>!e&&!n&&0!==t),Pw(([e,t])=>t),Uw(1)),m),Nw(Bw(u,Pw(e=>({top:-e}))),t),Sw(Bw(c,Ww(f,d),Pw(([e,{groupIndices:t,lastSize:n,sizeTree:r},i])=>{function a(e){return e*(n+i)}if(0===t.length)return a(e);let o=0;const l=AE(r,0);let s=0,c=0;for(;s<e;){s++,o+=l;let n=t.length===c+1?1/0:t[c+1]-t[c]-1;s+n>e&&(o-=l,n=e-s+1),s+=n,o+=a(n),c++}return o})),n=>{zw(e,n),requestAnimationFrame(()=>{zw(t,{top:n}),requestAnimationFrame(()=>{zw(e,0),zw(C,!1)})})}),{deviation:e}},kw(hE,hb,Lb,$E,lE,IE)),_b=Yw(([e,t,n,r,i,a,o,l,s,c,d])=>({...e,...t,...n,...r,...i,...a,...o,...l,...s,...c,...d}),kw(vb,Ob,nb,Tb,Hb,Nb,xb,Ib,Sb,lE,Vb)),qb=Yw(([{data:e,defaultItemSize:t,firstItemIndex:n,fixedItemSize:r,fixedGroupSize:i,gap:a,groupIndices:o,heightEstimates:l,itemSize:s,sizeRanges:c,sizes:d,statefulTotalCount:u,totalCount:f,trackItemSizes:h},{initialItemFinalLocationReached:C,initialTopMostItemIndex:p,scrolledToInitialItem:m},A,g,v,y,{scrollToIndex:w},E,{topItemCount:b},{groupCounts:M},L])=>{const{listState:H,minOverscanItemCount:x,topItemsIndexes:V,rangeChanged:k,...S}=y;return Nw(k,L.scrollSeekRangeChanged),Nw(Bw(L.windowViewportRect,Pw(e=>e.visibleHeight)),A.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:n,fixedItemHeight:r,fixedGroupHeight:i,gap:a,groupCounts:M,heightEstimates:l,initialItemFinalLocationReached:C,initialTopMostItemIndex:p,scrolledToInitialItem:m,sizeRanges:c,topItemCount:b,topItemsIndexes:V,totalCount:f,...v,groupIndices:o,itemSize:s,listState:H,minOverscanItemCount:x,scrollToIndex:w,statefulTotalCount:u,trackItemSizes:h,rangeChanged:k,...S,...L,...A,sizes:d,...g}},kw($E,sb,hE,Db,Zb,Lb,ab,Bb,Rb,tb,_b));function Ub(e,t){const n={},r={};let i=0;const a=e.length;for(;i<a;)r[e[i]]=1,i+=1;for(const e in t)Object.hasOwn(r,e)||(n[e]=t[e]);return n}const Wb=typeof document<"u"?i.useLayoutEffect:i.useEffect;function Xb(t,n,r){const a=Object.keys(n.required||{}),o=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&&zw(e.propsReady,!1);for(const r of a){zw(e[n.required[r]],t[r])}for(const r of o)if(r in t){zw(e[n.optional[r]],t[r])}void 0!==e.propsReady&&zw(e.propsReady,!0)}function u(e){return s.reduce((t,r)=>(t[r]=function(e){let t,n;const r=()=>t?.();return function(i,a){switch(i){case 1:return a?n===a?void 0:(r(),n=a,t=Sw(e,a),t):(r(),Hw);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(()=>xw(function(e){const t=new Map,n=({constructor:e,dependencies:r,id:i,singleton:a})=>{if(a&&t.has(i))return t.get(i);const o=e(r.map(e=>n(e)));return a&&t.set(i,o),o};return n(e)}(t),e=>{d(e,p)})),[A]=i.useState(Mw(u,m));var g;Wb(()=>{for(const e of s)e in p&&Sw(A[e],p[e]);return()=>{Object.values(A).map(Zw)}},[p,A,m]),Wb(()=>{d(m,p)}),i.useImperativeHandle(h,ww((g=m,l.reduce((e,t)=>(e[t]=e=>{zw(g[n.methods[t]],e)},e),{}))));const v=r;return e(c.Provider,{value:m,children:void 0!==r?e(v,{...Ub([...a,...o,...s],p),children:C}):C})});return{Component:f,useEmitter:(e,t)=>{const n=i.useContext(c)[e];Wb(()=>Sw(n,t),[t,n])},useEmitterValue:i.version.startsWith("18")?e=>{const t=i.useContext(c)[e],n=i.useCallback(e=>Sw(t,e),[t]);return i.useSyncExternalStore(n,()=>Ow(t),()=>Ow(t))}:e=>{const t=i.useContext(c)[e],[n,r]=i.useState(Mw(Ow,t));return Wb(()=>Sw(t,e=>{e!==n&&r(ww(e))}),[t,n]),n},usePublisher:e=>{const t=i.useContext(c);return i.useCallback(n=>{zw(t[e],n)},[t,e])}}}const Qb=i.createContext(void 0),Gb=i.createContext(void 0),Kb="-webkit-sticky",Yb="sticky",Jb=Pb(()=>{if(typeof document>"u")return Yb;const e=document.createElement("div");return e.style.position=Kb,e.style.position===Kb?Kb:Yb}),$b=typeof document<"u"?i.useLayoutEffect:i.useEffect;function eM(e){return"self"in e}function tM(e,t,n,r=Hw,a,o){const l=i.useRef(null),s=i.useRef(null),c=i.useRef(null),d=i.useCallback(n=>{let r,i,a;const l=n.target;if(function(e){return"body"in e}(l)||eM(l)){const e=eM(l)?l:l.defaultView;a=!0===o?e.scrollX:e.scrollY,r=!0===o?e.document.documentElement.scrollWidth:e.document.documentElement.scrollHeight,i=!0===o?e.innerWidth:e.innerHeight}else a=!0===o?l.scrollLeft:l.scrollTop,r=!0===o?l.scrollWidth:l.scrollHeight,i=!0===o?l.offsetWidth:l.offsetHeight;const d=()=>{e({scrollHeight:r,scrollTop:Math.max(a,0),viewportHeight:i})};!0===n.suppressFlushSync?d():M.flushSync(d),null!==s.current&&(a===s.current||a<=0||a===r-i)&&(s.current=null,t(!0),c.current&&(clearTimeout(c.current),c.current=null))},[e,t,o]);return i.useEffect(()=>{const e=a||l.current;return r(a||l.current),d({suppressFlushSync:!0,target:e}),e.addEventListener("scroll",d,{passive:!0}),()=>{r(null),e.removeEventListener("scroll",d)}},[l,d,n,r,a]),{scrollByCallback:function(e){!0===o&&(e={...void 0!==e.behavior?{behavior:e.behavior}:{},...void 0!==e.top?{left:e.top}:{}}),l.current.scrollBy(e)},scrollerRef:l,scrollToCallback:function(n){const r=l.current;if(!r||(!0===o?"offsetWidth"in r&&0===r.offsetWidth:"offsetHeight"in r&&0===r.offsetHeight))return;const i="smooth"===n.behavior;let a,d,u;eM(r)?(d=Math.max(RE(r.document.documentElement,!0===o?"width":"height"),!0===o?r.document.documentElement.scrollWidth:r.document.documentElement.scrollHeight),a=!0===o?r.innerWidth:r.innerHeight,u=!0===o?window.scrollX:window.scrollY):(d=r[!0===o?"scrollWidth":"scrollHeight"],a=RE(r,!0===o?"width":"height"),u=r[!0===o?"scrollLeft":"scrollTop"]);const f=d-a;if(n.top=Math.ceil(Math.max(Math.min(f,n.top),0)),cb(a,d)||n.top===u)return e({scrollHeight:d,scrollTop:u,viewportHeight:a}),void(i&&t(!0));i?(s.current=n.top,c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{c.current=null,s.current=null,t(!0)},1e3)):s.current=null,!0===o&&(n={...void 0!==n.behavior?{behavior:n.behavior}:{},left:n.top}),r.scrollTo(n)}}}function nM(e){return e}const rM=Yw(()=>{const e=Xw(e=>`Item ${e}`),t=Xw(e=>`Group ${e}`),n=Xw({}),r=Xw(nM),i=Xw("div"),a=Xw(Hw),o=(e,t=null)=>Qw(Bw(n,Pw(t=>t[e]),Fw()),t);return{components:n,computeItemKey:r,EmptyPlaceholder:o("EmptyPlaceholder"),FooterComponent:o("Footer"),GroupComponent:o("Group","div"),groupContent:t,HeaderComponent:o("Header"),HeaderFooterTag:i,ItemComponent:o("Item","div"),itemContent:e,ListComponent:o("List","div"),ScrollerComponent:o("Scroller","div"),scrollerRef:a,ScrollSeekPlaceholder:o("ScrollSeekPlaceholder"),TopItemListComponent:o("TopItemList")}}),iM=Yw(([e,t])=>({...e,...t}),kw(qb,rM)),aM=({height:t})=>e("div",{style:{height:t}}),oM={overflowAnchor:"none",position:Jb(),zIndex:1},lM={overflowAnchor:"none"},sM={...lM,display:"inline-block",height:"100%"},cM=i.memo(function({showTopList:t=!1}){const n=HM("listState"),r=xM("sizeRanges"),a=HM("useWindowScroll"),o=HM("customScrollParent"),l=xM("windowScrollContainerState"),s=xM("scrollContainerState"),c=o||a?l:s,d=HM("itemContent"),u=HM("context"),f=HM("groupContent"),h=HM("trackItemSizes"),C=HM("itemSize"),m=HM("log"),A=xM("gap"),g=HM("horizontalDirection"),{callbackRef:v}=dE(r,C,h,t?Hw:c,m,A,o,g,HM("skipAnimationFrameInResizeObserver")),[y,w]=i.useState(0);LM("deviation",e=>{y!==e&&w(e)});const E=HM("EmptyPlaceholder"),b=HM("ScrollSeekPlaceholder")??aM,M=HM("ListComponent"),L=HM("ItemComponent"),H=HM("GroupComponent"),x=HM("computeItemKey"),V=HM("isSeeking"),k=HM("groupIndices").length>0,S=HM("alignToBottom"),z=HM("initialItemFinalLocationReached"),Z=t?{}:{boxSizing:"border-box",...g?{display:"inline-block",height:"100%",marginLeft:0!==y?y:S?"auto":0,paddingLeft:n.offsetTop,paddingRight:n.offsetBottom,whiteSpace:"nowrap"}:{marginTop:0!==y?y:S?"auto":0,paddingBottom:n.offsetBottom,paddingTop:n.offsetTop},...z?{}:{visibility:"hidden"}};return t||0!==n.totalCount||null==E?e(M,{...CM(M,u),"data-testid":t?"virtuoso-top-item-list":"virtuoso-item-list",ref:v,style:Z,children:(t?n.topItems:n.items).map(e=>{const t=e.originalIndex,r=x(t+n.firstItemIndex,e.data,u);return V?p(b,{...CM(b,u),height:e.size,index:e.index,key:r,type:e.type||"item",..."group"===e.type?{}:{groupIndex:e.groupIndex}}):"group"===e.type?p(H,{...CM(H,u),"data-index":t,"data-item-index":e.index,"data-known-size":e.size,key:r,style:oM},f(e.index,u)):p(L,{...CM(L,u),...pM(L,e.data),"data-index":t,"data-item-group-index":e.groupIndex,"data-item-index":e.index,"data-known-size":e.size,key:r,style:g?sM:lM},k?d(e.index,e.groupIndex,e.data,u):d(e.index,e.data,u))})}):e(E,{...CM(E,u)})}),dM={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},uM={outline:"none",overflowX:"auto",position:"relative"},fM=e=>({height:"100%",position:"absolute",top:0,width:"100%",...e?{display:"flex",flexDirection:"column"}:void 0}),hM={position:Jb(),top:0,width:"100%",zIndex:1};function CM(e,t){if("string"!=typeof e)return{context:t}}function pM(e,t){return{item:"string"==typeof e?void 0:t}}const mM=i.memo(function(){const t=HM("HeaderComponent"),n=xM("headerHeight"),r=HM("HeaderFooterTag"),a=sE(i.useMemo(()=>e=>{n(RE(e,"height"))},[n]),!0,HM("skipAnimationFrameInResizeObserver")),o=HM("context");return null!=t?e(r,{ref:a,children:e(t,{...CM(t,o)})}):null}),AM=i.memo(function(){const t=HM("FooterComponent"),n=xM("footerHeight"),r=HM("HeaderFooterTag"),a=sE(i.useMemo(()=>e=>{n(RE(e,"height"))},[n]),!0,HM("skipAnimationFrameInResizeObserver")),o=HM("context");return null!=t?e(r,{ref:a,children:e(t,{...CM(t,o)})}):null});function gM({useEmitter:t,useEmitterValue:n,usePublisher:r}){return i.memo(function({children:i,style:a,context:o,...l}){const s=r("scrollContainerState"),c=n("ScrollerComponent"),d=r("smoothScrollTargetReached"),u=n("scrollerRef"),f=n("horizontalDirection")||!1,{scrollByCallback:h,scrollerRef:C,scrollToCallback:p}=tM(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?uM:dM,...a},tabIndex:0,...l,...CM(c,o),children:i})})}function vM({useEmitter:t,useEmitterValue:n,usePublisher:r}){return i.memo(function({children:a,style:o,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:A,scrollerRef:g,scrollToCallback:v}=tM(c,u,d,m,C);return $b(()=>(g.current=C||p.current?.ownerDocument.defaultView,()=>{g.current=null}),[g,C]),t("windowScrollTo",v),t("scrollBy",A),e(d,{ref:p,"data-virtuoso-scroller":!0,style:{position:"relative",...o,...0!==f?{height:f+h}:void 0},...s,...CM(d,l),children:a})})}const yM=({children:t})=>{const n=i.useContext(Qb),r=xM("viewportHeight"),a=xM("fixedItemHeight"),o=HM("alignToBottom"),l=HM("horizontalDirection"),s=sE(i.useMemo(()=>bw(r,e=>RE(e,l?"width":"height")),[r,l]),!0,HM("skipAnimationFrameInResizeObserver"));return i.useEffect(()=>{n&&(r(n.viewportHeight),a(n.itemHeight))},[n,r,a]),e("div",{"data-viewport-type":"element",ref:s,style:fM(o),children:t})},wM=({children:t})=>{const n=i.useContext(Qb),r=xM("windowViewportRect"),a=xM("fixedItemHeight"),o=HM("customScrollParent"),l=fE(r,o,HM("skipAnimationFrameInResizeObserver")),s=HM("alignToBottom");return i.useEffect(()=>{n&&(a(n.itemHeight),r({offsetTop:0,visibleHeight:n.viewportHeight,visibleWidth:100}))},[n,r,a]),e("div",{"data-viewport-type":"window",ref:l,style:fM(s),children:t})},EM=({children:t})=>{const n=HM("TopItemListComponent")??"div",r=HM("headerHeight"),i={...hM,marginTop:`${r}px`},a=HM("context");return e(n,{style:i,...CM(n,a),children:t})},bM=i.memo(function(t){const r=HM("useWindowScroll"),i=HM("topItemsIndexes").length>0,a=HM("customScrollParent"),o=HM("context");return n(a||r?kM:VM,{...t,context:o,children:[i&&e(EM,{children:e(cM,{showTopList:!0})}),n(a||r?wM:yM,{children:[e(mM,{}),e(cM,{}),e(AM,{})]})]})}),{Component:MM,useEmitter:LM,useEmitterValue:HM,usePublisher:xM}=Xb(iM,{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"}},bM),VM=gM({useEmitter:LM,useEmitterValue:HM,usePublisher:xM}),kM=vM({useEmitter:LM,useEmitterValue:HM,usePublisher:xM}),SM=MM,zM=Yw(()=>{const e=Xw(e=>n("td",{children:["Item $",e]})),t=Xw(null),r=Xw(e=>n("td",{colSpan:1e3,children:["Group ",e]})),i=Xw(null),a=Xw(null),o=Xw({}),l=Xw(nM),s=Xw(Hw),c=(e,t=null)=>Qw(Bw(o,Pw(t=>t[e]),Fw()),t);return{components:o,computeItemKey:l,context:t,EmptyPlaceholder:c("EmptyPlaceholder"),FillerRow:c("FillerRow"),fixedFooterContent:a,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")}});kw(qb,zM),Jb();const ZM={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},OM={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:NM,floor:TM,max:IM,min:DM,round:FM}=Math;function RM(e,t,n){return Array.from({length:t-e+1}).map((t,r)=>({data:null===n?null:n[r+e],index:r+e}))}function PM(e,t){return void 0!==e&&e.width===t.width&&e.height===t.height}function jM(e,t){return void 0!==e&&e.column===t.column&&e.row===t.row}const BM=Yw(([{increaseViewportBy:e,listBoundary:t,overscan:n,visibleRange:r},{footerHeight:i,headerHeight:a,scrollBy:o,scrollContainerState:l,scrollTo:s,scrollTop:c,smoothScrollTargetReached:d,viewportHeight:u},f,h,{didMount:C,propsReady:p},{customScrollParent:m,useWindowScroll:A,windowScrollContainerState:g,windowScrollTo:v,windowViewportRect:y},w])=>{const E=Xw(0),b=Xw(0),M=Xw(ZM),L=Xw({height:0,width:0}),H=Xw({height:0,width:0}),x=Gw(),V=Gw(),k=Xw(0),S=Xw(null),z=Xw({column:0,row:0}),Z=Gw(),O=Gw(),N=Xw(!1),T=Xw(0),I=Xw(!0),D=Xw(!1),F=Xw(!1);Sw(Bw(C,Ww(T),Rw(([e,t])=>0!==t)),()=>{zw(I,!1)}),Sw(Bw($w(C,I,H,L,T,D),Rw(([e,t,n,r,,i])=>e&&!t&&0!==n.height&&0!==r.height&&!i)),([,,,,e])=>{zw(D,!0),ob(1,()=>{zw(x,e)}),Tw(Bw(c),()=>{zw(t,[0,0]),zw(I,!0)})}),Nw(Bw(O,Rw(e=>null!=e&&e.scrollTop>0),jw(0)),b),Sw(Bw(C,Ww(O),Rw(([,e])=>null!=e)),([,e])=>{e&&(zw(L,e.viewport),zw(H,e.item),zw(z,e.gap),e.scrollTop>0&&(zw(N,!0),Tw(Bw(c,qw(1)),e=>{zw(N,!1)}),zw(s,{top:e.scrollTop})))}),Nw(Bw(L,Pw(({height:e})=>e)),u),Nw(Bw($w(eE(L,PM),eE(H,PM),eE(z,(e,t)=>void 0!==e&&e.column===t.column&&e.row===t.row),eE(c)),Pw(([e,t,n,r])=>({gap:n,item:t,scrollTop:r,viewport:e}))),Z),Nw(Bw($w(eE(E),r,eE(z,jM),eE(H,PM),eE(L,PM),eE(S),eE(b),eE(N),eE(I),eE(T)),Rw(([,,,,,,,e])=>!e),Pw(([e,[t,n],r,i,a,o,l,,s,c])=>{const{column:d,row:u}=r,{height:f,width:h}=i,{width:C}=a;if(0===l&&(0===e||0===C))return ZM;if(0===h){const t=lb(c,e);return function(e){return{...OM,items:e}}(RM(t,t+Math.max(l-1,0),o))}const p=_M(C,h,d);let m,A;s?0===t&&0===n&&l>0?(m=0,A=l-1):(m=p*TM((t+u)/(f+u)),A=p*NM((n+u)/(f+u))-1,A=DM(e-1,IM(A,p-1)),m=DM(A,IM(0,m))):(m=0,A=-1);const g=RM(m,A,o),{bottom:v,top:y}=qM(a,r,i,g),w=NM(e/p);return{bottom:v,itemHeight:f,items:g,itemWidth:h,offsetBottom:w*f+(w-1)*u-v,offsetTop:y,top:y}})),M),Nw(Bw(S,Rw(e=>null!==e),Pw(e=>e.length)),E),Nw(Bw($w(L,H,M,z),Rw(([e,t,{items:n}])=>n.length>0&&0!==t.height&&0!==e.height),Pw(([e,t,{items:n},r])=>{const{bottom:i,top:a}=qM(e,r,t,n);return[a,i]}),Fw(TE)),t);const R=Xw(!1);Nw(Bw(c,Ww(R),Pw(([e,t])=>t||0!==e)),R);const P=Kw(Bw($w(M,E),Rw(([{items:e}])=>e.length>0),Ww(R),Rw(([[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}),Pw(([[,e]])=>e-1),Fw())),j=Kw(Bw(eE(M),Rw(({items:e})=>e.length>0&&0===e[0].index),jw(0),Fw())),B=Kw(Bw(eE(M),Ww(N),Rw(([{items:e},t])=>e.length>0&&!t),Pw(([{items:e}])=>({endIndex:e[e.length-1].index,startIndex:e[0].index})),Fw(NE),Uw(0)));Nw(B,h.scrollSeekRangeChanged),Nw(Bw(x,Ww(L,H,E,z),Pw(([e,t,n,r,i])=>{const a=ib(e),{align:o,behavior:l,offset:s}=a;let c=a.index;"LAST"===c&&(c=r-1),c=IM(0,c,DM(r-1,c));let d=UM(t,i,n,c);return"end"===o?d=FM(d-t.height+n.height):"center"===o&&(d=FM(d-t.height/2+n.height/2)),void 0!==s&&0!==s&&(d+=s),{behavior:l,top:d}})),s);const _=Qw(Bw(M,Pw(e=>e.offsetBottom+e.bottom)),0);return Nw(Bw(y,Pw(e=>({height:e.visibleHeight,width:e.visibleWidth}))),L),{customScrollParent:m,data:S,deviation:k,footerHeight:i,gap:z,headerHeight:a,increaseViewportBy:e,initialItemCount:b,itemDimensions:H,overscan:n,restoreStateFrom:O,scrollBy:o,scrollContainerState:l,scrollHeight:V,scrollTo:s,scrollToIndex:x,scrollTop:c,smoothScrollTargetReached:d,totalCount:E,useWindowScroll:A,viewportDimensions:L,windowScrollContainerState:g,windowScrollTo:v,windowViewportRect:y,...h,gridState:M,horizontalDirection:F,initialTopMostItemIndex:T,totalListHeight:_,...f,endReached:P,propsReady:p,rangeChanged:B,startReached:j,stateChanged:Z,stateRestoreInProgress:N,...w}},kw(vb,hE,hb,Tb,nb,Ib,lE));function _M(e,t,n){return IM(1,TM((e+n)/(TM(t)+n)))}function qM(e,t,n,r){const{height:i}=n;if(void 0===i||0===r.length)return{bottom:0,top:0};const a=UM(e,t,n,r[0].index);return{bottom:UM(e,t,n,r[r.length-1].index)+i,top:a}}function UM(e,t,n,r){const i=_M(e.width,n.width,t.column),a=TM(r/i),o=a*n.height+IM(0,a-1)*t.row;return o>0?o+t.row:o}const WM=Yw(()=>{const e=Xw(e=>`Item ${e}`),t=Xw({}),n=Xw(null),r=Xw("virtuoso-grid-item"),i=Xw("virtuoso-grid-list"),a=Xw(nM),o=Xw("div"),l=Xw(Hw),s=(e,n=null)=>Qw(Bw(t,Pw(t=>t[e]),Fw()),n),c=Xw(!1),d=Xw(!1);return Nw(eE(d),c),{components:t,computeItemKey:a,context:n,FooterComponent:s("Footer"),HeaderComponent:s("Header"),headerFooterTag:o,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")}}),XM=Yw(([e,t])=>({...e,...t}),kw(BM,WM)),QM=i.memo(function(){const t=tL("gridState"),n=tL("listClassName"),r=tL("itemClassName"),a=tL("itemContent"),o=tL("computeItemKey"),l=tL("isSeeking"),s=nL("scrollHeight"),c=tL("ItemComponent"),d=tL("ListComponent"),u=tL("ScrollSeekPlaceholder"),f=tL("context"),h=nL("itemDimensions"),C=nL("gap"),m=tL("log"),A=tL("stateRestoreInProgress"),g=nL("reportReadyState"),v=sE(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:aL("column-gap",getComputedStyle(e).columnGap,m),row:aL("row-gap",getComputedStyle(e).rowGap,m)})},[s,h,C,m]),!0,!1);return $b(()=>{t.itemHeight>0&&t.itemWidth>0&&g(!0)},[t]),A?null:e(d,{className:n,ref:v,...CM(d,f),"data-testid":"virtuoso-item-list",style:{paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},children:t.items.map(n=>{const i=o(n.index,n.data,f);return l?e(u,{...CM(u,f),height:t.itemHeight,index:n.index,width:t.itemWidth},i):p(c,{...CM(c,f),className:r,"data-index":n.index,key:i},a(n.index,n.data,f))})})}),GM=i.memo(function(){const t=tL("HeaderComponent"),n=nL("headerHeight"),r=tL("headerFooterTag"),a=sE(i.useMemo(()=>e=>{n(RE(e,"height"))},[n]),!0,!1),o=tL("context");return null!=t?e(r,{ref:a,children:e(t,{...CM(t,o)})}):null}),KM=i.memo(function(){const t=tL("FooterComponent"),n=nL("footerHeight"),r=tL("headerFooterTag"),a=sE(i.useMemo(()=>e=>{n(RE(e,"height"))},[n]),!0,!1),o=tL("context");return null!=t?e(r,{ref:a,children:e(t,{...CM(t,o)})}):null}),YM=({children:t})=>{const n=i.useContext(Gb),r=nL("itemDimensions"),a=nL("viewportDimensions"),o=sE(i.useMemo(()=>e=>{a(e.getBoundingClientRect())},[a]),!0,!1);return i.useEffect(()=>{n&&(a({height:n.viewportHeight,width:n.viewportWidth}),r({height:n.itemHeight,width:n.itemWidth}))},[n,a,r]),e("div",{ref:o,style:fM(!1),children:t})},JM=({children:t})=>{const n=i.useContext(Gb),r=nL("windowViewportRect"),a=nL("itemDimensions"),o=tL("customScrollParent"),l=fE(r,o,!1);return i.useEffect(()=>{n&&(a({height:n.itemHeight,width:n.itemWidth}),r({offsetTop:0,visibleHeight:n.viewportHeight,visibleWidth:n.viewportWidth}))},[n,r,a]),e("div",{ref:l,style:fM(!1),children:t})},$M=i.memo(function({...t}){const r=tL("useWindowScroll"),i=tL("customScrollParent"),a=i||r?iL:rL,o=i||r?JM:YM,l=tL("context");return e(a,{...t,...CM(a,l),children:n(o,{children:[e(GM,{}),e(QM,{}),e(KM,{})]})})}),{useEmitter:eL,useEmitterValue:tL,usePublisher:nL}=Xb(XM,{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),rL=gM({useEmitter:eL,useEmitterValue:tL,usePublisher:nL}),iL=vM({useEmitter:eL,useEmitterValue:tL,usePublisher:nL});function aL(e,t,n){return"normal"!==t&&!0!==t?.endsWith("px")&&n(`${e} was not resolved to pixel value correctly`,t,iE),"normal"===t?0:parseInt(t??"0",10)}const oL=({optionsList:r=[],onSelectVariable:i,dropdownPosition:a,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 A=o(null);l(()=>{void 0!==f&&f>=0&&requestAnimationFrame(()=>{A.current?.scrollToIndex({index:f,behavior:"auto",align:"center"})})},[f,r]);return e("div",{className:T("ff-variable-dropdown",s),style:a?{top:a.top,left:a.left,width:c,height:d,zIndex:u}:{width:c,height:d,zIndex:u},children:K(r)?e("div",{className:"ff-variable-option ff-variable-option-no-data",children:e(U,{as:"span",fontSize:12,children:"No Option"})}):e(SM,{totalCount:r.length,ref:A,data:r,itemContent:a=>{const o=r[a];return o?e("div",{className:T("ff-variable-data",{"ff-variable-data--highlighted":f===a}),onMouseDown:()=>i(o),children:c.endsWith("px")?n(t,{children:[e(Y,{title:xn(p(o),m(c),"pixel")?p(o):"",style:{width:`${m(c)}px`},children:e(U,{as:"span",fontSize:12,className:"ff-truncated_text",children:p(o)})}),e(q,{name:C(o),height:24,width:24})]}):e(yw,{option:o})},`${o.id}-${a}`):null},style:{height:d,fontSize:"12px"},overscan:10,fixedItemHeight:32})})},lL=({data:r=[],width:i,height:a,lineChartWidth:o,yAxisLabel:s,xAxisLabel:d,yAxisValueColor:u,xAxisColor:f,yAxisColor:h,yAxisLabelColor:C,textSize:p,fontWeight:m,numberSize:A,chartName:g,shouldCenterSinglePoint:v,xAxisLabelGap:y=16,isLeftOverflow:w=!1})=>{const E=40,b=i-80,M=a-80,[L,H]=c(!1),[x,V]=c({cursorX:null,hoverValues:{},dotPositions:{},tooltip:{visible:!1,left:0,top:0},currentXValue:null});l(()=>{const e=()=>{H(!1),V(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,o=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:a},children:e(U,{className:"ff-line-chart-yAxisLabel",fontSize:p,fontWeight:"semi-bold",children:s})}),e("div",{className:"ff-line-chart-svg",children:e("svg",{height:a,width:i,className:"ff-line-chart-svg",children:n("g",{transform:"translate(40, 40)",children:[e("line",{x1:0,y1:M,x2:b,y2:M,stroke:f,strokeWidth:1}),e("text",{x:b/2.1,y:M+E/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*(b/(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:A},children:t},t)),Array.from({length:o}).map((t,n)=>{const i=n*r/(o-1),a=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:A},children:a?.toFixed(1)},`y-${n}`)})]})})})]})}function k(e){if(!isNaN(e))return parseFloat(e);const t=Vr,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",Z=S?"totalMemory":"value",O=e=>{const t=r?.[0]?.data?.length;if(1===t)return v?b/2:b;const n=r[0].data.findIndex(t=>t[z]===e);return-1===n?0:n/(t-1)*b},N=Math.max(...r?.flatMap(e=>e?.data?.map(e=>k(e[Z]))),5),T=e=>{if("memory"===g){const t=Math.max(...r?.flatMap(e=>e?.data?.map(e=>k(e[Z]))));return M-e*M/(t>1024?t:1024)}return M-e*M/(0===N?1024:N)},I=e=>{if(1===e?.length){const t=e?.[0],n=O(t[z]),r=T(k(t[Z]));return`M 0 ${T(0)} L ${n} ${r}`}return e?.reduce((t,n,r)=>{const i=O(n[z]),a=T(k(n[Z]));if(0===r)return`M ${i} ${a}`;const o=e[r-1],l=o?O(o[z]):0;return`${t} C ${l+(i-l)/2} ${o?T(k(o[Z])):0}, ${i-(i-l)/2} ${a}, ${i} ${a}`},"")},D=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:a},children:e(U,{className:"ff-line-chart-yAxisLabel",fontSize:p,fontWeight:"semi-bold",children:s})}),n("div",{className:"ff-line-chart-svg",children:[e("svg",{height:a,width:i,onMouseMove:e=>{const t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left-E;if(e.clientY-t.top-E>M)return H(!1),void V({cursorX:null,hoverValues:{},dotPositions:{},tooltip:{visible:!1,left:0,top:0},currentXValue:null});let i={hoverValues:{},dotPositions:{}},a=null;r.forEach((e,t)=>{const r=e.data.reduce((e,t)=>{const r=Math.abs(n-O(t[z]));return r<e.distance?{point:t,distance:r}:e},{point:null,distance:1/0}).point;r&&(a=r[z],i.hoverValues[t]=((e,t=2)=>{let n="";if("string"==typeof e){const t=e.match(Lr),r=e.match(Hr);t&&(e=parseFloat(t[0])),r&&(n=r[0])}const r=Math.pow(10,t);return`${Math.ceil(e*r)/r} ${n}`.trim()})(r[Z]),i.dotPositions[t]={x:O(r[z]),y:T(k(r[Z]))})}),H(!0),V({cursorX:n,hoverValues:i.hoverValues,dotPositions:i.dotPositions,currentXValue:a,tooltip:a?{visible:!0,left:e.clientX+10,top:e.clientY-20}:{visible:!1,left:0,top:0}})},onMouseLeave:()=>V({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:b,y2:M,stroke:f,strokeWidth:1}),e("text",{x:b/2.1,y:M+E/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:o,opacity:(a=r.data,a.every(e=>0===k(e[Z]))?.5:1)}),x.dotPositions[i]&&n(t,{children:[e("line",{x1:x.dotPositions[i].x,y1:0,x2:x.dotPositions[i].x,y2:M,stroke:"gray",strokeWidth:.5,strokeDasharray:"4"}),e("circle",{cx:x.dotPositions[i].x,cy:x.dotPositions[i].y,r:5,fill:"white",stroke:r.color,strokeWidth:o,style:{transition:"cx 0.1s, cy 0.1s"}}),e("line",{x1:0,y1:x.dotPositions[i].y,x2:b,y2:x.dotPositions[i].y,stroke:"gray",strokeWidth:.5,strokeDasharray:"4"})]})]},i):null;var a}),(()=>{if(1===D.length){const t=D?.[0];return e("text",{x:v?b/2:b,y:M+15,textAnchor:v?"middle":"end",fill:h,className:"ff--line-chart-x-line-data",style:{fontSize:A},children:null!=t[z]?String(t[z]):""},String(t[z]))}if(D.length<7)return D.map(t=>e("text",{x:O(t[z]),y:M+15,textAnchor:"middle",fill:h,className:"ff--line-chart-x-line-data",style:{fontSize:A},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*(D?.length-1)/6),a=D[i];return e("text",{x:r*t,y:M+15,fill:h,className:"ff--line-chart-x-line-data",style:{fontSize:A},children:null!=a?.[z]?String(a?.[z]):""},String(a?.[z]))})}})(),(()=>{if("memory"===g){const t=Math.max(N,1024);return Array.from({length:6}).map((n,r)=>{const i=r*t/5,a=i/1024;return e("text",{x:-10,y:T(i),textAnchor:"end",fill:u,className:"ff-line-chart-y-axis-text",style:{fontSize:A},children:a.toFixed(1)},`y-${r}`)})}return Array.from({length:6}).map((t,n)=>{const r=n*N/5;return e("text",{x:-10,y:T(r),textAnchor:"end",fill:u,className:"ff-line-chart-y-axis-text",style:{fontSize:A},children:r.toFixed(0)},`y-${n}`)})})()]})}),L&&x.tooltip.visible&&n("div",{className:"ff-line-chart-tooltip",style:{left:w&&x.tooltip.left/2>i/1.75?x.tooltip.left-180:x.tooltip.left,top:x.tooltip.top},children:[e("div",{className:"ff-line-chart-date",children:x.currentXValue}),Object.entries(x.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))]})]})]})},sL=({onClose:t,top:r="100px",left:i="0px",className:a,description:o="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 ${a}`,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(U,{fontWeight:"semi-bold",lineHeight:"32px",className:"ff-download-client-header-text",children:"Download client"}),e(q,{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(U,{as:"div",color:"var(--download-client-content-text-color)",fontWeight:"semi-bold",textAlign:"center",lineHeight:"26px",children:o}),e(U,{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(q,{name:t,height:36,width:36})},t))})]})]})},cL=({legendName:t,height:r,width:i,children:a})=>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(U,{color:"var(--license_header_text_color)",fontSize:8,lineHeight:"12px",children:t})}),e("div",{className:"ff_children_container",children:a})]})}),dL=({onSelectVariable:t,dropdownPosition:n,filteredOptions:r=[],position:i="relative",width:a="100%",zIndex:s,truncateTextValue:c=34,highlightedIndex:d})=>{const u=o(null);return l(()=>{u.current?.scrollIntoView({block:"nearest"})},[d]),e("div",{className:T(`ff-variable-dropdown-container ${i}`),style:n?{top:n.top+30,left:n.left-30,width:a,zIndex:s}:{width:a,zIndex:s},children:K(r)?e("div",{className:"ff-variable-option no-data",children:e(U,{as:"div",children:"No Option",fontSize:14})}):r?.map((n,r)=>e("div",{className:T("ff-variable-option",{"ff-variable-option--highlighted":d===r}),onMouseDown:()=>t(n),ref:d===r?u:null,children:e(Y,{title:xn(n?.name,c,"pixel")?n?.name:"",children:e(U,{children:Hn(n?.name,c,"pixel")})})},n?.id))})},uL=a(({label:t="",hashInputValue:r="",setHashInputValue:i,variableList:a=[],placeholder:s="Enter text",onChange:d,onPaste:u,onCreateVariableClick:f,handleClearInput:h,value:C="",dropdownWidth:p="100%",dropdownHeight:m="160px",isHash:A=!1,isOnlyHash:g=!1,dataFiles:v=[],showAddVariableIcon:y=!0,helperText:E="",error:b,autoComplete:M="off",required:L=!1,zIndex:H=9999,truncateTextValue:x=34,formProps:V={},getSelectedVariable:k=()=>{},symbol:S="$",type:z="text",clearIcon:Z=!0,inputTitle:O="",onBlur:N,helperTextWidth:I,iconProps:D={isShowIcon:!1,iconName:"",iconToolTipTitle:"",isIconDisable:!1,iconColor:"",onIconClick:()=>{}},...F},R)=>{const[P,j]=c(!1),[B,_]=c(!1),[W,X]=c(0),[Q,G]=c(!1),[J,$]=c(null),[ee,te]=c(0),[ne,re]=c(!1),[ie,ae]=c([]),oe=o(null),le=o(null),[se,ce]=c("auto"),de=D?.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(R,()=>oe.current),l(()=>{null!==J&&oe.current&&(oe.current.setSelectionRange(J,J),oe.current.focus())},[J]),l(()=>{A&&j(C.startsWith("#"));const e=v?.find(e=>e.name===C),t=a?.find(e=>e?.name===C);if(C.startsWith("#")&&A){const e=C.slice(1).toLowerCase(),t=v.filter(t=>t.name.toLowerCase().includes(e));ae(t),j(!0)}const n=null!==e&&C.startsWith("#"),r=null!==t&&C.startsWith("$"),i=C.length>(t?.name.length||0),o=C.length>0&&!r||C.startsWith("#");g?re(!1):r||n||C.includes("$")||C.includes("#")?(re(!1),o&&re(!0)):i&&!C.includes("$")&&re(!0)},[C]);const ue=()=>{oe.current&&te(oe.current.selectionStart||0)},fe=ue,he=ue;l(()=>{oe.current&&te(oe.current.selectionStart||0)},[C]);const Ce=e=>{if(oe.current){const{selectionStart:t,selectionEnd:n}=oe.current,r=`${e.name}`;let a;if(a=A&&"#"===C[0]?e.name+C.slice(n||1):e.name,d){d({target:{value:a}},e),k(e.name)}oe.current.value=a,i?.(e),$((t||0)+r.length),j(!1),_(!0)}};const pe=function(e,t,n){let r=!1,i="";const a="}"===C[t-1];if(t<0||t>e.length)return{showDropdown:r,searchString:i};const o=e.lastIndexOf(S,t-1),l=e.indexOf(S,t);if(-1!==o&&(g&&"$"===e[o]?r=!1:t===o+1?(r=!0,i=""):(i=e.slice(o+1,-1===l?void 0:l),t>o+1&&(i=e.slice(o+1,t)),r=!0),B&&a&&(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,a),me=()=>a?.filter(e=>e?.name?.toLowerCase()?.includes(pe?.searchString?.toLowerCase())),Ae=C.startsWith("#"),ge=Ae?ie:me();l(()=>{X(0)},[A,pe?.showDropdown]);const ve=Boolean(pe?.showDropdown&&Q),ye=Boolean(P&&A&&Q),we=Boolean((Ae?ye:ve)&&ge.length);return n("div",{className:"ff-add-variable-container",children:[n("div",{className:"ff-add-variable-input",ref:le,children:[e(Y,{title:O,style:{width:"100%"},children:e(Hi,{...F,name:"add_variable",ref:oe,type:z,className:T("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<ge.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=ge[W];t&&Ce(t);break}case"Escape":if(!we)return;e.preventDefault(),e.stopPropagation(),j(!1),G(!1),X(0)}},onChange:d,onPaste:()=>{re(!0)},variant:"primary",label:t,placeholder:s,onClick:fe,onKeyUp:he,onFocus:()=>G(!0),onBlur:e=>{(e=>{e.relatedTarget&&e.relatedTarget.closest(".dropdown-container")||G(!1)})(e),N?.(e)},autoComplete:M,helperText:E,error:b,required:L,helperTextWidth:I,...V})}),!K(C)&&ne&&y&&e("div",{className:"ff-create-variable-container",onClick:f,children:e(U,{fontWeight:"regular",fontSize:"10px",color:"var(--brand-color)",cursor:"pointer",children:"Create Variable"})}),!K(C)&&!g&&e("div",{className:T("ff-cancel-icon-container",{"ff-cancel-icon-container--show-icon":de}),children:Z&&e(Y,{title:"Cancel",style:{zIndex:99999},children:e(q,{onClick:h,name:"close",height:16,width:16,hoverEffect:!0})})}),de&&e("div",{className:"ff-info-icon-container",children:e(Y,{title:de&&!D?.isIconDisable?D?.iconToolTipTitle:"",children:e(q,{name:D?.iconName||"",hoverEffect:!1,height:16,width:16,color:D?.iconColor||"var(--text-area-default-color)",onClick:e=>{D?.onIconClick&&D?.onIconClick(e)},disabled:D?.isIconDisable,cursorType:"pointer"})})})]}),pe?.showDropdown&&Q&&e(oL,{position:"absolute",zIndex:H,truncateTextValue:x,width:se,height:K(me())?"auto":m,optionsList:ge,onSelectVariable:Ce,highlightedIndex:W}),P&&A&&Q&&e(dL,{position:"relative",zIndex:H,truncateTextValue:x,width:se,filteredOptions:ge,onSelectVariable:Ce,highlightedIndex:W})]})}),fL=({isOpen:t,variableTypesList:r=[],onClose:i,onNameChange:a,onValueChange:o,variableName:s,variableValue:d,onVariableTypeChange:u,selectedVariableType:f,hideValue:h=!1,onHideChange:C,handleSubmit:p,mode:m="create",disabled:A,dataFiles:g=[],truncateTextValue:v=34,isEnterKeySubmit:y=!1,showHideValueOption:w=!0})=>{const[E,b]=c(!1),[M,L]=c(""),[H,x]=c(),[V,k]=c(!1),[S,z]=c(!1),[Z,O]=c({name:"",value:"",isChecked:!1});l(()=>{t&&"edit"===m&&O({name:s,value:d,isChecked:h})},[]);const N=e=>e&&0!==e.length?" "===e[0]||" "===e[e.length-1]?"Space is not allowed at starting and at the end":qn.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=qn.test(e),r=$r.test(e),i=e.length>=3&&e.length<=25;return t&&n&&r&&i}l(()=>{const e=N(s);b(!!e),L(e)},[s]),l(()=>{if("edit"!==m)return;const{name:e,value:t,isChecked:n}=Z;z(s!==e||d!==t||h!==n)},[m,s,d,h,Z]);const I=()=>{!V&&T(s)&&(k(!0),p())};l(()=>{if(!y)return;const e=e=>{if("Enter"===e.key){e.preventDefault();!T(s)||V||"edit"===m&&!S||I()}};return window.addEventListener("keydown",e),()=>{window.removeEventListener("keydown",e)}},[y,s,d,h,V,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(W,{onClick:i,label:"Cancel",variant:"tertiary"}),e(W,{variant:"primary",label:"create"===m?"Create":"Update",type:"submit",onClick:I,disabled:!T(s)||V||"edit"===m&&!S})]}),{}),children:n("div",{className:"ff-create-variable-slider",children:[e("div",{className:"ff-create-variable-slider-input",children:e(Hi,{label:"Variable Name",required:!0,type:"text",name:"variableName",value:s||"",onChange:e=>{k(!1),a(e.target.value)},error:E,helperText:M,onBlur:e=>{const t=e.target.value,n=N(t);b(!!n),L(n)}})}),e(ka,{label:"Variable Type",required:!0,onChange:e=>{u(e),k(!1)},selectedOption:f,optionsList:r,optionZIndex:99999,valueAccessor:"label",disabled:"edit"===m}),e(uL,{label:"Variable Value",placeholder:"Enter Variable value or select path using #",isHash:!0,isOnlyHash:!0,zIndex:99999,truncateTextValue:v,dataFiles:g,dropdownWidth:"100%",setHashInputValue:x,hashInputValue:H||{},value:d||"",type:h?"password":"text",onChange:(e,t)=>{const n=e.target.value;o(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:A}),e(Y,{title:"Once the value is hidden, it cannot be undone",children:e(q,{name:"info",width:12,height:12})})]})]})})},hL=e=>{if(null==e||""===e)return{};return{width:e,flex:`0 0 ${"number"==typeof e?`${e}px`:e}`}},CL=({highlightText:t="",tableMeta:r=[],tableData:i=[],accordionType:a="row",noDataContent:o,height:l="100%",withFixedHeader:s=!1,headerType:d,TableAccordionStateIconWidth:u=4,TableAccordionStateIconHeight:f=8})=>{const[h,C]=c(-1),p="number"==typeof r[0]?.width?Math.max(r[0]?.width-8,0):void 0,m=(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:"--"},A=t=>t.map((t,n)=>e("table",{className:"ff-table-accordion__table",cellSpacing:0,children:e("tbody",{className:"ff-table-accordion__tbody",children:e("tr",{className:"ff-table-accordion__body-row",children:r.map((n,r)=>e("td",{className:"ff-table-accordion__body-cell",style:hL(n.width),children:"column"===a&&0===r?"":e(U,{as:"div",className:"ff-table-accordion__cell-typography",children:n.cell?m(t,n):e(Ws,{placement:"bottom",children:m(t,n)})})},n.accessor+r))},t.id||n)})},`accordion-table-${n}`));return n("div",{style:{height:l},className:T("ff-table-accordion",{"ff-table-accordion--fixed-header":s}),children:[e("table",{cellSpacing:0,className:T("ff-table-accordion__table",{"ff-table-accordion__table--fixed-header":s}),children:e("thead",{children:e("tr",{className:"ff-table-accordion__header-row",children:r.map(t=>e("th",{style:hL(t.width),className:T("ff-table-accordion__header-cell",d&&`ff-table-accordion__header-cell--${d}`),children:e("div",{children:e(U,{fontWeight:"semi-bold",fontSize:12,children:t.header})})},`header-${t.header}`))})})}),"row"===a&&i.map((n,r)=>e(wn,{highlightText:t,headerTitle:"string"==typeof n.title?e("div",{style:{maxWidth:void 0!==p?`${p}px`:"100%"},children:e(Ws,{children:e(yn,{text:n.title,highlight:t})})}):e(Ws,{children:"row.title"}),color:"var(--text-color)",accordionContent:A(n.data),disable:n.disable,disableInfoMessage:n.disableInfoMessage,accordionStateIconName:"arrows_down_icon",AccordionStateIconWidth:u,AccordionStateIconHeight:f,className:"ff-table-accordion__row-accordion"},`accordion-row-${r}`)),"column"===a&&i.map((i,a)=>n("div",{className:"ff-table-accordion__column-group",children:[e("div",{className:"ff-display-flex",children:n("div",{className:`ff-table-accordion__column-header ${i.disable&&"ff-table-accordion__column-header--disabled"}`,style:r[0]?hL(r[0].width):{},children:[e("div",{className:"ff-table-accordion__column-label",children:e(U,{as:"div",children:e(Ws,{children:e(yn,{text:"string"==typeof i.title?i.title:"",highlight:t})})})}),e("div",{className:"ff-table-accordion__column-toggle",onClick:()=>{!i.disable&&(e=>{C(e===h?-1:e)})(a)},children:e(q,{name:h===a?"arrows_down_icon":"arrows_right_icon",color:"var(--table-with-accordion-icon-color)",width:u,height:f,hoverEffect:!1})})]})}),h===a&&e("div",{children:A(i.data)})]},`column-accordion-${a}`)),K(i)&&e("div",{className:"ff-table-accordion__empty-state",style:{height:`calc(${l} - 50px)`},children:o})]})},pL=({progressPercentage:t,totalMemory:r,usedMemory:i,color:a="var(--brand-color)",trackColor:o="#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,A=s;if(void 0!==r&&void 0!==i){const e=p(i),t=p(r);t>0?(m=e/t*100,A=s||i):(m=0,A="0MB")}else m=t||0;const g=Math.max(0,Math.min(m,100));return n("div",{className:"ff-progress-bar-container "+(A?"ff-has-label":""),style:{width:C},children:[e("div",{className:"ff-progress-bar-track",style:{backgroundColor:o,height:`${l}px`},children:e("div",{className:"ff-progress-bar",style:{width:`${g}%`,backgroundColor:a,height:`${l}px`},children:u&&e(U,{className:"ff-progress-bar-percentage",fontSize:f,color:h,children:`${Math.round(g)}%`})})}),A&&e("div",{className:"ff-progress-bar-label",children:e(U,{fontSize:c,color:d,children:e(Y,{title:xn(A,10,"count")?A:"",children:Hn(A,10,"count")})})})]})},mL=({variant:t="primary",size:n="small",onClick:r,label:i="Choose File",disabled:a=!1,type:l="button",className:s="",style:d={},iconName:f,isChooseFile:h=!1,buttonWidth:C="auto",buttonHeight:p="auto",selectedFile:m={},handleCloseIcon:A,isMandatory:g=!1})=>{const v=o(null),[y,w]=c(0);u(()=>{v.current&&w(v.current.getBoundingClientRect().width-10)},[C]);const E=m?.name||i,b=y?Hn(E,y,"pixel"):E,M=!!y&&xn(E,y,"pixel");return e("div",{ref:v,style:{width:C},children:e(Y,{title:M?E:"",children:e(W,{variant:t,label:b,type:l,onClick:r,buttonWidth:C,buttonHeight:p,isChooseFile:h,size:n,disabled:a,className:s,iconName:f,style:d,iconPosition:"right",selectedFile:m,handleCloseIcon:A,isMandatory:g})})})},AL=({selected:t="text",handleClick:r,tabList:i})=>{const a=i?.includes("Automation"),o=i?.includes("Manual");return n("div",{className:"ff-script-switch-container",children:[e(Y,{title:a?"Automation":"Add Automation",zIndex:1e3,children:e("div",{className:"ff-script-switch-button "+("Automation"===t?"active":""),onClick:()=>r(a?"Automation":"Add Automation"),children:e(q,{name:a?"automation_testcase":"add_testcase",color:"Automation"===t?"var(--primary-button-text-color)":"var(--description-text)"})})}),e(Y,{title:o?"Manual":"Add Manual",zIndex:1e3,children:e("div",{className:"ff-script-switch-button "+("Manual"===t?"active":""),onClick:()=>r(o?"Manual":"Add Manual"),children:e(q,{name:o?"manual_testcase":"add_testcase",color:"Manual"===t?"var(--primary-button-text-color)":"var(--description-text)"})})})]})},gL=({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(q,{name:r.icon,color:t===r.name?"var(--primary-button-text-color)":"var(--description-text)"})})},r.name))}),vL=({onModalClose:t,MediaSrc:r,fileName:a,onDeleteClick:o,mediaType:s,fileId:d,thumbnailMediaSrc:u,isDelete:f=!0,onExpandClick:h,onDownloadClick:C,isMediaIcon:p=!1,previewOnly:m=!1,iconName:A="video_preview",isDisabled:g=!1})=>{const[v,y]=c(!1),w=i.useRef(null),E=()=>{y(!0),h&&h(d)},b=()=>{t?.(),y(!1)},M=()=>{C&&C(d)};return l(()=>{m&&y(!0)},[m]),n("div",{children:[!m&&(p?e(q,{name:A,hoverEffect:!0,onClick:E,disabled:g}):e(gw,{mediaSrc:r,mediaType:s,onDownloadClick:M,onDeleteClick:()=>o?.(r),onExpandClick:E,fileName:a,fileId:d,thumbnailMediaSrc:u,isDelete:f})),v&&e(kp,{isOpen:v,onClose:b,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(q,{name:"download_file_icon",onClick:M,color:"var(--icons-default-color)",className:"header-icons"})}),e(Y,{title:"Expand",children:e(q,{name:"expand",onClick:E,color:"var(--icons-default-color)",className:"header-icons"})}),e(Y,{title:"close",children:e(q,{name:"close",onClick:b,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)})}}})]})})]})},yL=({children:t,orientation:r="",navBarIcons:a=[],mobileHeight:o=448,mobileWidth:l=220,UtilityBar:s,tooltip:c={},background:d,navBarPosition:u="bottom"})=>{const f="portrait"===r,h=f?o:l,C=f?l:o,p=s&&"top"===u,m=s&&"bottom"===u,A=s&&"left"===u;return n("div",{className:["ff-mobileskin-wrapper",f?"portrait":"landscape",A?"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:a.map(({title:t,name:n,className:r,...i},o)=>{const l=c?.[n]??o;return e(Y,{title:c?.[n]||"",placement:"top",children:e("div",{className:`ff-nav-bar-icon ${r||""} ${o===a.length-1?"last-icon":""} ${p?"navbar-top":""}`,children:e(q,{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*o+"px"}})})})}),s&&m&&e("div",{className:"ff-nav-bar",children:a?.map((t,n)=>{const{title:r,...i}=t;return e("div",{className:`ff-nav-bar-icon ${t?.className||""} ${n===a.length-1?"last-icon":""}`,children:e(Y,{title:r,children:e(q,{...i})})},n)})}),s&&A&&e("div",{className:"ff-side-nav-bar",children:a?.map((t,n)=>{const{title:r,...i}=t;return e("div",{className:`ff-sidebar ${t?.className||""} ${n===a.length-1?"last-icon":""}`,children:e(Y,{title:r,placement:"bottom",children:e(q,{...i})})},n)})})]})},wL=a(({width:t=300,height:r=40,iconHeight:i=16,iconWidth:a=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:A,onFocus:g,disableInput:v,isAdditionalIcon:y=!1,additionalIconName:w,additionIconToolTip:E,onAdditionalIconClick:b},M)=>{const L=o(null);zn([{key:"Enter",action:()=>H()}],L);const H=e=>{f&&p?.(f.trim())};return n("div",{className:T("ff-prompt-container",{"icon-left":"left"===c,"icon-right":"left"!==c}),style:{width:`${t}px`,height:`${r}px`,borderRadius:d},ref:L,children:[e(Y,{placement:"top",title:C,children:e(q,{name:s,className:"ff-prompt-icon",height:i,width:a,onClick:p,color:h,disabled:K(f)})}),e("input",{ref:M,className:"ff-prompt-input",type:"text",placeholder:l,autoFocus:u,onChange:m,onFocus:g,onBlur:A,value:f,readOnly:v}),y&&w&&e(Y,{placement:"top",title:E,children:e(q,{name:w,className:"ff-prompt-icon additional-icon",height:i,width:a,onClick:b})})]})}),EL=({content:t,isVisible:n,maxWidth:r=300,onClick:i,isClickable:a=!0,arrowPosition:o="left"})=>e("div",{onClick:i,style:{width:`${r}px`,"--triangle-position":r-4+"px"},className:T("ff-chat-msg-box",{visible:n,hidden:!n,pointer:a,default:!a,"chat-arrow-left":"left"===o,"chat-arrow-right":"left"!==o}),children:e("div",{className:T("content",`arrow-${o}`),children:e(U,{children:t})})}),bL=({iconName:r,iconPosition:{top:i,left:a,bottom:o,right:l},hoverIconPosition:{top:s,left:d,bottom:u,right:f},modalPosition:{top:h,left:C,bottom:p,right:m},modalWidth:A,modalHeight:g,headerContent:v="Header Content",footerContent:y="Footer Content",iconWidth:w,iconHeight:E,modalHeading:b="Ask Fia",children:M,onClearChat:H})=>{const[x,V]=c(!1),[k,S]=c(!1);return n(t,{children:[n("div",{style:{top:void 0!==i?`${i}px`:void 0,left:void 0!==a?`${a}px`:void 0,bottom:void 0!==o?`${o}px`:void 0,right:void 0!==l?`${l}px`:void 0},className:"ff-dynamic-icon-container",children:[e(q,{className:"ff-dynamic-icon",name:r,onClick:()=>{S(e=>!e),setTimeout(()=>V(e=>!e),10)},height:E,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(q,{name:"ask_fia_icon",height:32,width:82})})]}),k&&L(e("div",{className:T("ff-dynamic-modal",{open:x}),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:g,width:A},children:n("div",{className:"ff-dynamic-modal-content",children:[v&&e("div",{className:"ff-dynamic-modal-header",children:n("div",{className:"header-container",children:[n("div",{className:"header-left",children:[e(q,{height:16,width:16,name:"fia_icon"}),e(U,{fontWeight:"medium",children:b})]}),n("div",{className:"header-right",children:[e("span",{className:"action",children:e(Y,{title:"Clear chat",placement:"bottom",children:e(q,{height:16,width:16,name:"delete",color:"var(--tooltip-text-color)",onClick:H})})}),e("span",{className:"action",children:e(Y,{title:"Close",placement:"bottom",children:e(q,{height:16,width:16,name:"close",color:"var(--tooltip-text-color)",onClick:()=>(V(!1),void setTimeout(()=>S(!1),300))})})})]})]})}),e("div",{className:"ff-dynamic-modal-body",children:M}),y&&e("div",{className:"ff-dynamic-modal-footer",children:y})]})}),document.body)]})},ML=a(({iconName:r,hoverTitle:i,iconPosition:{top:a,left:o,bottom:l,right:s},hoverIconPosition:{top:c,left:d,bottom:u,right:f},modalPosition:{top:h,left:C,bottom:p,right:m},modalWidth:A,modalHeight:g,headerContent:v="Header Content",footerContent:y="Footer Content",iconWidth:E,iconHeight:b,children:M,isVisible:H,isOpen:x,onOpen:V,onClose:k,isIconVisible:S},z)=>(w(z,()=>({closeModal:k})),n(t,{children:[S&&n("div",{style:{top:void 0!==a?`${a}px`:void 0,left:void 0!==o?`${o}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(q,{className:"ff-ai-dynamic-icon",name:r,onClick:V,height:b,width:E}),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(U,{fontWeight:"bold",fontSize:14,color:"var(--chatbot-leaf-text)",children:i})})})]}),H&&L(e("div",{className:T("ff-ai-dynamic-modal",{open:x}),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:g,width:A},children:n("div",{className:"ff-ai-dynamic-modal-content",children:[v&&e("div",{className:"ff-ai-dynamic-modal-header",children:v}),e("div",{className:"ff-ai-dynamic-modal-body",children:M}),y&&e("div",{className:"ff-ai-dynamic-modal-footer",children:y})]})}),document.body)]}))),LL=({variant:t,title:r,tabTitle:i,comment:a,profileShortName:o})=>n("div",{className:"ff-history-card",children:[e("div",{className:T("header",`header--${t}`),children:e(U,{fontWeight:"semi-bold",children:i})}),n("div",{className:"body",children:[e("div",{className:"title",children:n("div",{className:"profile",children:[e(U,{className:T("avatar",`avatar--${t}`),children:o}),e(U,{children:r})]})}),n("div",{className:"comment-container",children:[e(U,{fontWeight:"semi-bold",className:"heading",children:"Comments:"}),e(U,{color:"var(--details-page-value-color)",className:"comment",children:a})]})]})]}),HL=({onChange:t,disabled:r,checked:i=!1,id:a="toggle",path:o})=>n("div",{className:"ff--ai-switch-container",children:[e("input",{className:"ff--ai-switch-checkbox",id:`ff-toggle-${a}`,type:"checkbox",disabled:!!r,onChange:e=>{t&&t(e)},checked:i}),e("label",{className:T("ff--ai-switch-label",{"ff--ai-switch-label--disabled":r}),htmlFor:`ff-toggle-${a}`,children:e("span",{className:"ff--ai-switch-content",children:n("span",{className:"ff--ai-switch-content",children:[e(U,{className:T("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:o,alt:"AI image"})]})})})]}),xL=a(({name:t,height:n=30,width:r=30,path:i="",onClick:a,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,...A},g)=>{if(!_[t])return null;const v=o(null);l(()=>{v.current&&(void 0!==C&&v.current.setAttribute("x",String(C)),void 0!==p&&v.current.setAttribute("y",String(p)))},[C,p]);const y={ref:g,onClick:u?void 0:a,style:{height:`${n}px`,width:`${r}px`,cursor:u?"not-allowed":"pointer",opacity:u?.3:1},tabIndex:m,...A};return e("span",{...y,children:e("img",{height:n,width:r,src:i,alt:""})})}),VL=({id:r=0,serialNumber:i,activeId:a,setActiveId:s,children:d,onIconClick:u,numberChildren:f,onContainerClick:h,onNextClick:C,onPreviousClick:p,disabled:m,isEditAccess:A,versionsLength:g,count:v,hiddenActions:y=[]})=>{const[w,E]=c(!1),[b,M]=c(!1),L=o(null),H=Array.isArray(y)?y:y?[y]:[],x=(e,t)=>{e.stopPropagation(),t()};l(()=>{L.current&&(()=>{if(L.current){const e=getComputedStyle(L.current),t=1.2*parseFloat(e.fontSize)*6;L.current.scrollHeight>t&&M(!0)}})()},[]);const V=e=>{e.stopPropagation(),E(!w)};return n("div",{className:`ff-prompt-container-Block ${a===r?"active":"inactive"} `,onClick:()=>{s(r),h()},children:[e(U,{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:L,children:[d,w&&n(t,{children:[e("span",{role:"button","aria-label":"toggleExpand",onClick:V,className:"read-less-btn",children:e(U,{color:"var(--brand-color)",fontWeight:"semi-bold",className:"read-more-btn-text",children:"Read Less"})})," "]})]}),b&&!w&&e("div",{role:"button","aria-label":"toggleExpand",onClick:V,className:"read-more-btn",children:e(U,{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=>!H.includes(e.action)).map((t,n)=>{const r=A&&"delete"===t?.action||"regenerate"===t?.action&&(g??0)>=3||m;return e(Y,{title:t.title,placement:"bottom",children:e(q,{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(q,{disabled:1===v,className:"ff-prompt-icons-style",name:"arrow_left_accordian",color:"var(--table-column-text-color)",width:18,height:18,onClick:e=>x(e,p),cursorType:"pointer"}),f,e(q,{disabled:v===g,className:"ff-prompt-icons-style",name:"arrow_right_icon",color:"var(--table-column-text-color)",width:18,height:18,onClick:e=>x(e,C),cursorType:"pointer"})]})]})]})},kL=a(({type:t="text",variant:r="primary",name:i="",label:a,disabled:o=!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:A,autoComplete:g="off",autoFocus:v=!1,minValue:y=-1/0,maxValue:w=1/0,transparentBackground:E=!1,size:b="small",isLabelRequired:M=!0,onClick:L,onKeyUp:H,isViewMode:x=!1,...V},k)=>{const S=!K(d);return n("fieldset",{className:T("ff-link-input-fieldset",{"ff-link-input-fieldset--disabled":o}),children:[n("div",{className:T("ff-link-input-container",{"ff-link-input-container--float":S,"ff-link-input-container--disabled":!!o}),children:[M&&n("label",{className:T(`ff-link-input-label-container ff-link-input-label-container--${b}`,{"ff-link-input-label-container--danger":!!u}),htmlFor:i,children:[s&&e("span",{className:"required-asterisk",children:"*"}),e("span",{className:T(`ff-link-input-label ff-link-input-label--${r}`,{"ff-link-input-label--no-hover":!!d,"ff-link-input-label--disabled":!!o,"ff-link-input-label--danger":!!u}),children:a})]}),e("input",{ref:k,name:i,value:d,type:t,spellCheck:!1,id:i,className:T(`ff-link-input ff-link-input-${r} default-input ff-link-input--${b}`,{"ff-link-input--transparentBackground":!!E,"ff-link-input--no-hover":!!d,"ff-link-input--disabled":!!o,"ff-link-input--danger":!!u,"ff-link-input--no-border":!!h,"ff-link-input--placeholder":!M},`${C}`),placeholder:c,disabled:x||o,onChange:p,onFocus:A,onBlur:m,autoComplete:g,autoFocus:v,min:y,max:w,onClick:L,onKeyUp:H,...V}),e("div",{className:"input-link-icon",children:l||u||!S?e(q,{name:"link",disabled:!0}):e(Y,{title:"Click here to navigate",children:e("span",{children:e(q,{name:"link",disabled:!1,onClick:()=>{d&&!u&&window.open(d,"_blank")}})})})})]}),f&&u&&e("span",{className:T("ff-link-input-message",{"ff-link-input-message--danger":!!u}),children:f})]})}),SL=({labelsList:r=[],height:i=""})=>{const a=pi(),o=e("div",{className:"ff-chip-tooltip",children:r.filter((e,t)=>t>0).map((t,n)=>e(U,{as:"div",className:"ff-chip-tooltip-label",children:t},`label-${n}-${t}`))});return e(t,{children:!K(r)&&n("div",{className:"ff-chip-with-count-container",children:[e(U,{as:"div",fontWeight:"medium",className:"ff-chip-label",style:i?{height:i}:void 0,children:e(Ws,{children:r[0]||""})}),r.length>1&&n(t,{children:[n(U,{as:"div",className:"ff-chip-count","data-tooltip-id":`tooltip-${a}`,fontWeight:"medium",children:["+",r.length-1]}),e("div",{id:`tooltip-${a}`,className:"ff-chip-tooltip-template",children:e(U,{as:"div",children:o})})]})]})})};class zL extends E{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 ZL=({iconName:t="",onButtonClick:r,buttonLabel:i="Label",buttonText:a="To Add Group",disableButton:o=!1,stepCount:l=1,iconWidth:s=120,iconHeight:c=120,addContentLabel:d="step"})=>n("div",{className:"add-content-button "+(o?"disabled":""),children:[!K(t)&&e("div",{className:"icon-container",children:e(q,{name:t,width:s,height:c})}),n("div",{className:"typography-label-button",children:[n(U,{fontSize:"12px",fontWeight:"regular",lineHeight:"18px",children:[d+l," :"]}),e(U,{fontSize:"12px",fontWeight:"semi-bold",lineHeight:"18px",children:"Click"}),e(Vp,{label:i,onClick:r,iconName:"plus_user_icon",isDisable:o}),e(U,{fontSize:"12px",fontWeight:"semi-bold",lineHeight:"18px",children:a})]})]}),OL=({variant:t="default",tabsData:r,activeTabId:i,onTabClick:a,noBorder:o=!1,noPadding:l=!1,titleSize:s="12px"})=>{const[d,u]=c(0);return n("div",{className:"ff-tabs-slider-container",children:[n("div",{className:T(`ff-tab-row--${t} ff-tab-row-section`,{"ff-tab-row--no-border":o,"ff-tab-row--no-padding":l,"ff-tab-row--position":r.length>4}),children:[r.length>4&&e(q,{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&&a(r.id),disabled:r.disabled,className:T(`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(U,{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:T("ff-tab-label",{"ff-tab-label--active":i===r.id})})}),"default"===t&&r.count&&e("span",{className:T("tab-count",{"tab-count--active":i===r.id}),children:r.count})]}),e("div",{className:T("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(q,{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})]})},NL=a(({label:t="Status",iconName:r="update_icon",onClick:i,isDisable:a=!1,variant:o="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:a,onClick:i,className:`\n ff-status-indicator\n ff-status-indicator--${o}\n ${l?`ff-status-indicator--with-bg ff-status-indicator--${o}-bg`:""}\n ${s?`ff-status-indicator--with-border ff-status-indicator--${o}-border`:""}\n `,ref:c,children:n("div",{className:"ff-status-indicator__content",children:[e(q,{name:"danger"===o?"close":r,color:d[o]||d.default,className:`ff-status-indicator__icon ff-status-indicator__icon--${o}`}),e(U,{as:"div",fontSize:12,className:`ff-status-indicator__label ff-status-indicator__label--${o}`,fontWeight:"medium",lineHeight:"20px",children:t})]})})}),TL=({rootLabel:t,childrenLabels:r,align:i="center",direction:a="horizontal"})=>{const o=r.length;return n("div","vertical"===a?{className:"ff-os-tree-vertical",style:{"--child-count":o},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":o},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))})]})},IL=({handleClose:t,handleResend:r,handleOtp:i,resendTimeout:a=30})=>{const[s,d]=c(Array(6).fill("")),[u,f]=c(a),[h,C]=c(!0),p=o(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(kp,{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(U,{fontSize:24,lineHeight:"36px",fontWeight:"semi-bold",children:"OTP Verification"}),e(q,{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(W,{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(a),C(!0),d(Array(6).fill("")),r()},children:["Re-send OTP",u>0?` (${u}s)`:""]})]})})},DL=({isOpen:t,onClose:r,isPlaying:i,onTogglePlay:a,mediaType:s,src:d,headerTitle:u,onDownload:f,onExpand:h,showHeader:p=!0,showDownload:m=!0,showExpand:A=!0,width:g="800px",height:v="432px",showControls:y=!0,customStyle:w,overlay:E=!0,children:b,showControlDownload:M=!1,showControlExpand:L=!1,isFullscreen:H=!1})=>{const x=o(null),V=o(null),[k,S]=c(0),[z,Z]=c(0),[O,N]=c(!1),[T,I]=c(0);l(()=>{"video"===s&&x.current&&!b&&(i?x.current.play():x.current.pause())},[i,s,b]);const D=C(()=>{if(x.current&&!O){const e=x.current.currentTime/x.current.duration*100;I(e||0),S(x.current.currentTime)}},[O]),F=C(()=>{x.current&&Z(x.current.duration)},[]),R=C(()=>{S(0),I(0),a?.()},[a]),P=C(e=>`${Math.floor(e/60)}:${Math.floor(e%60).toString().padStart(2,"0")}`,[]),j=C(e=>{if(x.current){const t=e/100*x.current.duration;x.current.currentTime=t,I(e),S(t)}},[]),B=C(e=>{if(O||!V.current)return;const t=V.current.getBoundingClientRect(),n=e.clientX-t.left,r=t.width,i=Math.max(0,Math.min(100,n/r*100));j(i)},[j,O]),_=C(e=>{if(!V.current)return;N(!0);const t=V.current.getBoundingClientRect(),n=e.clientX-t.left,r=t.width,i=Math.max(0,Math.min(100,n/r*100));j(i)},[j]),W=C(e=>{if(!O||!V.current||!x.current)return;const t=V.current.getBoundingClientRect(),n=e.clientX-t.left,r=t.width,i=Math.max(0,Math.min(100,n/r*100));j(i)},[O,j]),X=C(()=>{N(!1)},[]);return l(()=>{if(O)return document.addEventListener("mousemove",W),document.addEventListener("mouseup",X),()=>{document.removeEventListener("mousemove",W),document.removeEventListener("mouseup",X)}},[O,W,X]),t?e(ru,{isOpen:t,onClose:r,isMaximized:!1,showHeader:p,overlay:E,downloadHandler:()=>{},customStyle:w,header:n("div",{className:"ff-header-content",children:[e(q,{width:23,height:23,name:"automatic_locator"}),e(U,{children:e("span",{className:"ff-header-title",children:u})})]}),icons:e(Y,{title:"Close",children:e(q,{name:"close",onClick:r})}),width:g,height:v,zIndex:999,children:n("div",{className:"ff-video-wrapper",children:[b||("video"===s?e("video",{ref:x,src:d,className:"ff-media-video",onTimeUpdate:D,onLoadedMetadata:F,onEnded:R}):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(q,{name:"download_file",color:"white",onClick:f})}),A&&e(Y,{title:H?"Minimize":"Maximize",children:e(q,{name:H?"collapse_icon":"expand_icon",color:"white",onClick:h})})]}),"video"===s&&y&&!b&&n("div",{className:"ff-media-controls",children:[e("button",{onClick:a,className:"ff-play-pause-btn",children:e(Y,{title:i?"Pause":"Play",children:e(q,{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:P(k)}),e("input",{type:"range",className:"ff-seek-bar",min:0,max:100,value:T,onChange:e=>j(parseFloat(e.target.value)),onClick:B,onMouseDown:_,ref:V}),e("span",{className:"ff-total-time",children:P(z)})]}),n("div",{className:"ff-control-icons",children:[M&&e(Y,{title:"Download",children:e(q,{name:"download_file",color:"white",onClick:f,cursorType:"pointer"})}),L&&e(Y,{title:H?"Minimize":"Maximize",children:e(q,{name:H?"collapse_icon":"expand_icon",color:"white",onClick:h,cursorType:"pointer"})})]})]})]})}):null},FL=({header:r,secondaryHeader:i,primaryCount:a,secondaryCount:o,primaryItems:l,secondaryItems:s,width:c,activeTab:d="primary",activeTabId:u,onPrimaryTabClick:f,onSecondaryTabClick:h,onTabClick:C,actions:p,tabsData:m,notchPosition:A="top-left"})=>{const g=i&&"secondary"===d?s:l,v=o&&parseInt(o)>0,y=a&&parseInt(a)>0,w=i&&(y||v),{tooltip:E="Download",iconName:b="download_file",disabled:M=!1,onClick:L,className:H=""}=p?.download||{},{tooltip:x="Delete",iconName:V="delete_icon",disabled:k=!1,onClick:S,className:z=""}=p?.delete||{},Z=()=>n("div",{className:"ff-dropdown-header-icons",children:[p?.download&&e(Y,{title:E,children:e(q,{name:b||"",className:`ff-dropdown-icon ff-download-icon ${H}`,onClick:L,width:18,height:20,disabled:M,hoverEffect:!0})}),p?.delete&&e(Y,{title:x,children:e(q,{name:V||"",className:`ff-dropdown-icon ff-delete-icon ${z}`,onClick:S,width:25,height:25,disabled:k,hoverEffect:!0})})]});return n("div",{className:"ff-resolution-dropdown",style:c?{minWidth:c}:{},children:[e("div",{className:"ff-dropdown-notch "+("bottom-center"===A?"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&&Z()]}):i&&w?n("div",{className:"ff-dropdown-header-dual",children:[n("div",{className:"ff-dropdown-header-item "+("primary"===d?"active":""),onClick:f,children:[e(U,{fontWeight:"semi-bold",className:"ff-dropdown-text",children:r}),a&&e("span",{className:"ff-dropdown-count",children:a})]}),n("div",{className:"ff-dropdown-header-item "+("secondary"===d?"active":""),onClick:h,children:[e(U,{fontWeight:"semi-bold",className:"ff-dropdown-text",children:i}),o&&e("span",{className:"ff-dropdown-count",children:o})]}),Z()]}):i?n("div",{className:"ff-dropdown-header-dual",children:[n("div",{className:"ff-dropdown-header-item "+("primary"===d?"active":""),onClick:f,children:[e(U,{fontWeight:"semi-bold",className:"ff-dropdown-text",children:r}),a&&e("span",{className:"ff-dropdown-count",children:a})]}),n("div",{className:"ff-dropdown-header-item "+("secondary"===d?"active":""),onClick:h,children:[e(U,{fontWeight:"semi-bold",className:"ff-dropdown-text",children:i}),o&&e("span",{className:"ff-dropdown-count",children:o})]})]}):e(U,{fontSize:16,fontWeight:"semi-bold",children:r})})}),e("ul",{className:"ff-dropdown-list",children:g?.map((t,n)=>e("li",{className:"ff-dropdown-item",children:t},n))})]})},RL=(e,t,n,r)=>{const i=e[t.accessor];if(t.cell){const a=e._id||e.id;return t.cell({value:i,row:e,column:t.accessor,index:n,tableType:r,...a&&{refId:a}})}return t.accessor||i&&"object"!=typeof i?i:"--"},PL=(t,n=[],r,i,a)=>{let o=n;const l=void 0!==i?!i:r;return K(n)&&(isNaN(t)||(o=Array(t).fill(!0))),e("div",{className:"tree-table-fn-space-container",children:o?.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":""} ${a?"folder":""}`},r))})},jL=i.memo(({treeRowRef:r,col:i,colIndex:a,columnMeta:o,node:l,selected:s,select:c,onCheckBoxChange:d,onToggleExpand:u,onAddConfirm:f,onAddCancel:h,handleEditFieldError:C,isExpanding:p,columnTextColor:m,hideOnDisable:A,addModuleInputWidth:g,addModuleSelectWidth:v,disableEditLabelConfirmIcon:y,isEditable:w,setIsEditable:E})=>{const b={color:`${m||"var(--ff-primary-text-color)"}`,width:o?.width??i?.width,position:o?.sticky?"sticky":void 0,left:o?.sticky?o.left:void 0,zIndex:o?.sticky?o.zIndex:void 0};return n("div",{className:`ff-table-tree-fn-td ${i.isTree&&l.container?"folder":""} ${o?.sticky?"sticky-tree-column":""}`,"data-col-index":a,style:b,children:[i.isTree&&PL(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:I,{})]})}),n("span",{className:"tree-table-fn-td-content "+(i.isTree&&l.container?"folder":""),children:[!l?.isNewNode&&n(t,{children:[i.isTree&&"checkbox"===c&&!(A&&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&&!(A&&l.unselectable)&&e("span",{className:"tree-table-fn-td-content-select",children:e(dc,{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:g,selectFieldWidth:v,confirmIconTooltip:l.confirmIconTooltip,cancelIconTooltip:l.cancelIconTooltip,isEditable:w,setIsEditable:E,isOnBlurTrue:!1,isDisable:{confirm:y},isTableTree:!0}):n(t,{children:[e("span",{className:"tree-table-fn-td-content-text",children:RL(l,i)}),i.actions&&!l?.isNewNode&&e("div",{className:"table-tree-fn-row-action",children:i.actions(l,r)})]})})]})]})]})});jL.displayName="TableCell";const BL=i.memo(({node:t,columnsData:n,columnMeta:r,selected:i,select:a,onRowClick:l,onToggleExpand:s,onCheckBoxChange:c,onAddConfirm:d,onAddCancel:u,handleEditFieldError:f,isExpanding:h,index:C,selectedNode:p,hideOnDisable:m,addModuleInputWidth:A,addModuleSelectWidth:g,disableEditLabelConfirmIcon:v,isEditable:y,setIsEditable:w,style:E})=>{const b=o(null);return e("div",{"data-level":t.hierarchy,ref:b,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:E,children:n.map((n,o)=>e(jL,{treeRowRef:b,col:n,colIndex:o,node:t,selected:i,select:a,onCheckBoxChange:c,onToggleExpand:s,onAddConfirm:d,onAddCancel:u,handleEditFieldError:f,isExpanding:h,hideOnDisable:m,addModuleInputWidth:A,addModuleSelectWidth:g,disableEditLabelConfirmIcon:v,isEditable:y,setIsEditable:w,columnMeta:r?.[o]},n.name))})});BL.displayName="TableRow";const _L=({flattenedTreeData:t,columnsData:n,columnMeta:r,rowHeight:i=32,startIndex:a=0,totalHeight:o=0,selected:l,select:s,onRowClick:c,onToggleExpand:d,onCheckBoxChange:u,onAddConfirm:f,onAddCancel:h,handleEditFieldError:C,expanding:p,selectedNode:m,hideOnDisable:A,addModuleInputWidth:g,addModuleSelectWidth:v,disableEditLabelConfirmIcon:y,isEditable:w,setIsEditable:E})=>e("div",{className:"ff-table-tree-fn-body",style:{height:`${o}px`,position:"relative"},children:t?.map((t,o)=>e(BL,{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:a+o,selectedNode:m,hideOnDisable:A,addModuleInputWidth:g,addModuleSelectWidth:v,disableEditLabelConfirmIcon:y,isEditable:w,setIsEditable:E,style:{transform:`translateY(${(a+o)*i}px)`,height:`${i}px`,position:"absolute",top:0,left:0,right:0}},t.key))}),qL=i.memo(({columnsData:t,columnMeta:r,totalWidth:i,rootNode:a,selected:s,onCheckBoxChange:d,selectedNode:u,tableHeaderBgColor:f,hideOnDisable:h,transparentHeader:C,showHeader:p=!0})=>{const m=o(null),[A,g]=c(!1);l(()=>{g(!0)},[]);const v=(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:{...v(i,n),backgroundColor:C?"transparent":f,pointerEvents:C?"none":"auto"},children:t},t))}),a&&e("div",{className:"ff-table-tree-fn-row show-tree "+(u&&u===a?.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:v(i,t.width),children:n("span",{className:"tree-table-fn-default-content "+(0===i?"ff-table-root-index-0":""),children:[0===i&&"checkbox"===a.select&&!(h&&a.node.isDisabled)&&e(bn,{checked:"partially"!==a?.node?.selectedStatus&&("completely"===a?.node?.selectedStatus||!1),partial:"partially"===a?.node?.selectedStatus,onChange:e=>d(e,a?.node),disabled:a?.node?.isDisabled}),0===i&&"radio"===a.select&&!(h&&a.node.isDisabled)&&e(dc,{name:a.node.key,checked:s.includes(a.node.key),value:a.node.key,onChange:e=>d(e,a.node),disabled:a.node.isDisabled}),n("div",{className:"tree-table-cell-flex",children:[e(Ws,{children:"name"===t.accessor?a.node[t.accessor]:RL(a.node,t)}),a.cell&&0===i&&e("span",{className:"table-tree--fn-root-cell",children:a.cell(a.node)}),a.actions&&0===i&&A&&m.current&&e("div",{className:"table-tree-fn-row-action",children:a.actions(a.node,m)})]})]})},i))})]})});qL.displayName="TableHead";const UL=32,WL="__root__",XL=(e,t)=>{if(!e?.length)return[];const n=new Map,r=new Map,i=new Map,a=new Map;t&&t.key&&n.set(String(t.key),t),e.forEach(e=>{n.set(String(e.key),e);const t=e.parentId?String(e.parentId):WL;r.has(t)||(r.set(t,[]),a.set(t,{container:0,resource:0})),r.get(t)?.push(e);const i=a.get(t);i&&(e.container?i.container++:i.resource++)}),r.forEach(e=>{e.forEach((e,t)=>{i.set(String(e.key),t)})});const o=e=>{const t=e.parentId?String(e.parentId):WL,o=r.get(t);if(!o||0===o.length)return!1;if((i.get(String(e.key))??0)<o.length-1)return!0;const l=n.get(t),s=a.get(t);if(l&&s){const t=o.filter(e=>e.container).reduce((e,t)=>e+(t.totalResourceCount??0),0),n=o.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(String(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,i=r?t.parentSiblings:(e=>{const t=[];let r=e;for(;r&&(r.parentId&&t.unshift(o(r)),r.parentId);)r=n.get(String(r.parentId));return t})(e),a=r?t.hierarchy:i.length;return{...e,lastChild:!o(e),parentSiblings:i,hierarchy:a,selectedStatus:l(e)}})},QL=a(({treeData:t,columnsData:r,selected:i=[],select:a=null,onChange:s=()=>{},onClick:d=()=>{},onExpand:f=()=>{},loadMore:p=()=>{},tableBorder:m,height:A="calc(100vh - 134px)",newNode:g,onAddConfirm:v=()=>{},onAddCancel:y=()=>{},handleEditFieldError:w,loading:E=!1,rootNode:b,pagination:M=!0,selectedNode:L,tableHeaderBgColor:H="var(--border-color)",hideOnDisable:x=!1,freezeColumns:V,addModuleInputWidth:k=150,addModuleSelectWidth:S,onScroll:z,onScrollEnd:Z,disableEditLabelConfirmIcon:O=!1,transparentHeader:N=!1,navigateTreeNode:T=null,handleRemoveNavigateTreeNode:I=()=>{},scrollThreshold:D=128,showHeader:F=!0,resetScroll:R=!1,setResetScroll:P=()=>{}},j)=>{const[B,_]=c(null),[q,U]=c(null),[W,X]=c({start:0,end:20}),[Q,G]=c(!1),Y=o(null),J=o(null),$=o(0),ee=o(E),te=o(null),ne=o(null),re=o({lastScrollTop:0}),ie=o([]),ae=o(0),oe=o(null),le=o(null),se=o(null),ce=o({key:null,attempts:0}),de=o(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:a}=ue(n.width,400),o=!!V&&r<V,l="%"===a?`${i}%`:`${i}px`,s=`calc(${e}px + ${t}%)`;return o&&("%"===a?t+=i:e+=i),{width:l,sticky:o,left:s,zIndex:o?100+(V??0)-r:1}})},[r,V]),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(!V)return"0px";let e=0,t=0;return fe.slice(0,V).forEach(n=>{const r=parseFloat(n.width)||0;n.width.endsWith("%")?t+=r:e+=r}),`calc(${e}px + ${t}%)`},[fe,V]),pe=h(()=>((e,t,n)=>{if(!t?.sourceId||!t.action)return e;const{sourceId:r,action:i,value:a="",error:o="",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})),A=d?{label:d,value:d}:void 0,g=new Map;e.forEach(e=>g.set(e.key,e)),n&&g.set(n.key,n);const v=g.get(r);let y;h&&(y=g.get(h));let w=v??("addInside"===i?y:void 0);!w&&"addInside"===i&&C&&(w=g.get(C));const E="addInside"===i&&!w&&e.length>=0;if(!w&&!E)return e;const b=[...e],M=w?e.findIndex(e=>e.key===w.key):-1;let L=null,H=0,x=M+1;switch(i){case"addAbove":{const t=w;if(!t)return e;L=t.parentId,H=t.hierarchy;break}case"addBelow":{const t=w;if(!t)return e;L=y?.parentId??t.parentId,H=y?.hierarchy??t.hierarchy;break}case"addInside":{if(E){L=C??h??r??null,H=p??1,x=b.length;break}const t=y??w;if(!t)return e;L=t.key,H=(t.hierarchy??0)+1;const n=b.findIndex(e=>e.key===r);-1!==n&&(x=n+1);break}}const V={hierarchy:H,parentId:L,sourceId:w?.key??r??h??"new-node",isNewNode:!0,key:"new-node",value:a,error:o,label:l,type:s,options:m,selectedOption:A,confirmIconTooltip:u,cancelIconTooltip:f};switch(i){case"addAbove":b.splice(M,0,V);break;case"addBelow":b.splice(M+1,0,V);break;case"addInside":b.splice(Math.max(0,x),0,V)}return b})(t,g,b?.node),[t,g,b]),me=h(()=>XL(pe,b?.node),[pe,b?.node]),Ae=h(()=>me.filter(e=>!e.hide),[me]),ge=h(()=>{const e=new Map;return me.forEach(t=>e.set(t.key,t)),e},[me]),ve=h(()=>{const e=new Map;return Ae.forEach((t,n)=>e.set(t.key,n)),e},[Ae]),ye=C(e=>{_(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=E},[E]),l(()=>{te.current=q},[q]);const we=C(e=>{te.current=e,U(e)},[]),Ee=C(()=>{const e=Y.current;if(!e)return;const t=$.current||0,n=Math.max(0,e.scrollTop-t),r=e.clientHeight-t;let i=Math.floor(n/UL)-6,a=Math.ceil((n+r)/UL)+6;i=Math.max(0,i),a=Math.min(Ae.length,a),X(e=>e.start===i&&e.end===a?e:{start:i,end:a})},[Ae.length]),be=C(()=>{null===ne.current&&(ne.current=requestAnimationFrame(()=>{ne.current=null,Ee()}))},[Ee]),Me=C(()=>{const e=Y.current;if(!e)return;const n=e.scrollTop,r=n>re.current.lastScrollTop?"down":"up";if(re.current.lastScrollTop=n,be(),z?.(),oe.current?.(),!M||E||te.current||K(t))return;const i=e.scrollHeight,a=e.clientHeight;"down"===r&&i-(n+a)<D&&!t[t.length-1]?.lastResource&&(we("below"),p("below"))},[t,M,E,q,D,be,z,p,we]);l(()=>{if(E||!M||K(t))return;const e=t[0],n=!e?.lastResource,{totalSubContainerCount:r=0,totalResourceCount:i=0}=b?.node||{},a=r+i,o=Ae.length<10&&Ae.length<a;n&&o&&(we("above"),p("above"))},[E,M,t,Ae.length,b,p,we]),u(()=>{const e=ie.current,t=Ae,n=Y.current;if(R&&n)return n.scrollTop=0,re.current.lastScrollTop=0,void P(!1);if(n&&e.length>0&&t.length>0&&!E){const r=re.current.lastScrollTop,i=Math.max(0,Math.floor(r/UL));let a=-1,o=-1;for(let t=i;t<e.length;t++){const n=e[t]?.key,r=ve.get(n??"");if(void 0!==r){a=t,o=r;break}}if(-1===a)for(let t=i-1;t>=0;t--){const n=e[t]?.key,r=ve.get(n??"");if(void 0!==r){a=t,o=r;break}}if(-1!==a&&-1!==o){const e=o-a,t=Math.max(0,r+e*UL);n.scrollTop!==t&&(n.scrollTop=t,re.current.lastScrollTop=n.scrollTop,Ee())}else if("above"===q)0!==n.scrollTop&&(n.scrollTop=0,re.current.lastScrollTop=0,Ee());else{const e=$.current||0,r=Math.max(0,t.length*UL-(n.clientHeight-e));n.scrollTop>r&&(n.scrollTop=r,re.current.lastScrollTop=r,Ee())}q&&we(null)}ie.current=t},[E,q,ve,Ae,we,Ee,R,P]),l(()=>{const e=Y.current;if(!e)return;const n=n=>{n.deltaY>=0||!M||K(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=Y.current;if(e)return oe.current=Z?Ks(()=>{Z?.()},150):null,e.addEventListener("scroll",Me,{passive:!0}),()=>{e.removeEventListener("scroll",Me),oe.current?.cancel()}},[Me,Z]),l(()=>{const e=Y.current;if(!e)return;const t=e=>{Date.now()<ae.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,Ee()});return t.observe(e),()=>t.disconnect()},[Ee]),u(()=>{if(!g||!Y.current)return;const e=Y.current,t=ve.get("new-node");if(void 0===t)return;const n=$.current||0,r=e.clientHeight-n;if(r<=0)return;const i=t*UL,a=i+UL,o=Math.max(0,e.scrollTop-n);let l=o;i<o?l=i:a>o+r&&(l=Math.max(0,a-r)),l!==o&&(ae.current=Date.now()+300,e.scrollTop=l+n,re.current.lastScrollTop=e.scrollTop,Ee());const s=requestAnimationFrame(()=>{G(!0)});return()=>cancelAnimationFrame(s)},[g,ve,Ee]),l(()=>{g||G(!1)},[g]),u(()=>{if(!B||E)return;const e=le.current;if(!e||e.key!==B){const e=requestAnimationFrame(()=>{ye(B)});return()=>cancelAnimationFrame(e)}const t=ge.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)},[ge,B,E,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||g)return;const e=Y.current;if(!e)return;const n=ve.get(T);if(void 0!==n){ce.current={key:T,attempts:0};const t=$.current||0,r=Math.max(UL,e.clientHeight-t),i=n*UL+16,a=Math.max(0,i-r/2)+t;return ae.current=Date.now()+400,e.scrollTo({top:a,behavior:"smooth"}),be(),de.current&&clearTimeout(de.current),void(de.current=setTimeout(()=>{I?.()},350))}if(E||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,g,ve,E,q,M,t,p,be,I,we]);const Le=C(e=>{if(B)return;const t=!e?.expanded;_(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)},[B,f,ye]),He=C((e,t)=>{B||s?.(e,t)},[s,B]),xe=C((e,t)=>{B||d?.(e,t)},[d,B]);l(()=>()=>{null!==ne.current&&(cancelAnimationFrame(ne.current),ne.current=null),se.current&&clearTimeout(se.current),de.current&&clearTimeout(de.current)},[]);const Ve=Ae.length*UL,ke=Ae.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:j,children:e("div",{className:"table-fn-scrollable "+(Ae.length?"":"table-fn-empty"),ref:Y,style:{"--table-height":Ae.length?A:"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(qL,{columnsData:r,columnMeta:fe,totalWidth:he,rootNode:b,onCheckBoxChange:He,selected:i,selectedNode:L,tableHeaderBgColor:H,hideOnDisable:x,transparentHeader:N,showHeader:F})}),e(_L,{flattenedTreeData:ke,columnsData:r,columnMeta:fe,totalWidth:he,rowHeight:UL,startIndex:W.start,totalHeight:Ve,selected:i,select:a,onRowClick:xe,onToggleExpand:Le,onCheckBoxChange:He,onAddConfirm:v,onAddCancel:y,handleEditFieldError:w,expanding:B,selectedNode:L,hideOnDisable:x,addModuleInputWidth:k,addModuleSelectWidth:S,disableEditLabelConfirmIcon:O,isEditable:g?Q:void 0,setIsEditable:g?e=>{G(Boolean(e))}:void 0})]})})})})});QL.displayName="TableTreeFn";const GL=t=>e(dA,{logo:()=>"FireFlink"===t?.name?e(q,{height:100,width:100,name:"fire_flink_loader_logo"}):e("img",{src:t?.loaderName,width:100,height:100,alt:"loader"})}),KL=({isVisible:t})=>t?n("div",{className:"no_data_message",children:[e(q,{name:"no_content",width:120,height:120}),e(U,{fontSize:"20px",lineHeight:"30px",fontWeight:"semi-bold",children:"No Data Available"})]}):null,YL=({text:t=" No Results Found",iconName:r="no_license_found",fontSize:i="24px",textAlign:a="left",direction:o="column",iconWidth:l=120,iconHeight:s=120,fontWeight:c="semi-bold",marginTop:d="0px"})=>e("article",{className:"no_results_container",children:n("div",{className:`no_results_container__${o}`,style:{marginTop:d},children:[e(q,{name:r,width:l,height:s}),e("div",{children:e(U,{as:"div",fontSize:i,lineHeight:"36px",fontWeight:c,color:"var(--text-color)",textAlign:a,children:t})})]})}),JL=({drawerProps:n,showDrawer:r,children:i,zIndex:a=1200,top:o="56px"})=>r?e(vn,{isOpen:n?.isOpen??!0,...n,zIndex:a,top:o,children:i}):e(t,{children:i});const $L=({children:n,offlineContent:r,hasError:i=!1,onNetworkStatusChange:a,overlayClassName:o,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(()=>{a&&a(f)},[f,a]),i||!f?e("div",{className:`offlineOverlay ${o??""}`,style:{zIndex:s},children:r||e(q,{name:"offline_404_icon",height:u,width:d})}):e(t,{children:n})},eH=e=>{const t=Number.isFinite(e)&&e>0?e:0,n=Math.floor(t/60),r=Math.floor(t%60);return`${n.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`},tH=[.5,1,1.5,2],nH=({duration:r,currentTime:i,isPlaying:a=!1,onPlayPause:l=()=>{},onSeek:s=()=>{},isMuted:d=!1,onMuteToggle:u=()=>{},menuOptions:f,onMenuOptionClick:h=()=>{},playbackRate:C=1,onPlaybackRateChange:p=()=>{},disabled:m=!1,seekStep:A=5,formatTime:g=eH,className:v="",style:y={}})=>{const w=r>0?i/r*100:0,E=o(null),b=o(null),[M,L]=c(!1),[H,x]=c({top:0,left:0}),[V,k]=c(0),S=o(null),z=f??[{label:"Captions",value:"captions",icon:"captions"},{label:n("div",{ref:b,className:"playback-menu-option",children:["Playback Speed ",e(Li,{label:`${C.toFixed(1)} x`})]}),value:"playback-speed",icon:"playback",keepMenuOpen:!0}],Z=e=>Math.min(Math.max(e,0),r||0);return n("div",{className:`ff-audio-player ${v}`,style:y,"aria-disabled":m,tabIndex:m?-1:0,role:"group","aria-label":"Audio player",onKeyDown:e=>{if(m)return;if("INPUT"!==e.target.tagName)switch(e.key){case" ":case"Spacebar":e.preventDefault(),l();break;case"m":case"M":e.preventDefault(),u();break;case"ArrowRight":e.preventDefault(),s(Z(i+A));break;case"ArrowLeft":e.preventDefault(),s(Z(i-A))}},children:[e("button",{type:"button",className:"ff-audio-play-btn",onClick:l,disabled:m,"aria-label":a?"Pause":"Play",children:a?n("span",{className:"ff-audio-pause-shape",children:[e("span",{className:"ff-audio-pause-bar"}),e("span",{className:"ff-audio-pause-bar"})]}):e(q,{name:"play",width:8,height:8,cursorType:"pointer",withPadding:!1,className:"ff-audio-play"})}),e(U,{fontSize:8,className:"ff-audio-time",children:g(i)}),n("div",{className:"ff-audio-seek-wrap",children:[e("div",{className:"ff-audio-seek-track"}),e("div",{className:"ff-audio-seek-fill",style:{width:`${w}%`}}),e("input",{type:"range",className:"ff-audio-seek",min:0,max:r||0,step:1,value:i,disabled:m,onChange:e=>{s(Number(e.target.value))},"aria-label":"Seek"})]}),e(U,{fontSize:8,className:"ff-audio-time",children:g(r)}),e(q,{name:"speaker",onClick:m?()=>{}:u,disabled:m,withPadding:!1,className:"ff-audio-speaker-icon"+(d?" ff-audio-speaker-muted":""),cursorType:"pointer"}),e("div",{className:"ff-audio-more-wrap",ref:E,children:e(Ta,{iconName:"more",options:z,onOptionClick:e=>{if("playback-speed"===e.value){const e=b.current?.getBoundingClientRect(),t=b.current?.closest(".ff-option-card"),n=t?.getBoundingClientRect();e&&n&&x({top:n.top,left:e.right+8});const r=tH.indexOf(C);return k(r>=0?r:0),L(!0),void requestAnimationFrame(()=>S.current?.focus())}h(e)},dropdownPlacement:"bottomLeft",displayCard:!0,disabled:m,iconSize:12})}),M&&n(t,{children:[e("div",{className:"ff-audio-speed-overlay",onClick:()=>L(!1)}),e("div",{className:"ff-audio-speed-menu",style:{top:H.top,left:H.left},ref:S,tabIndex:-1,role:"listbox","aria-label":"Playback speed",onKeyDown:e=>{switch(e.key){case"ArrowDown":e.preventDefault(),k(e=>(e+1)%tH.length);break;case"ArrowUp":e.preventDefault(),k(e=>(e-1+tH.length)%tH.length);break;case"Enter":e.preventDefault(),p(tH[V]),L(!1);break;case"Escape":e.preventDefault(),L(!1)}},children:tH.map((t,r)=>{const i=t===C;return e("button",{type:"button",role:"option","aria-selected":i,className:["ff-audio-speed-option",r===V&&"ff-audio-speed-option-highlighted",i&&"ff-audio-speed-option-selected"].filter(Boolean).join(" "),onMouseEnter:()=>k(r),onMouseDown:e=>{e.stopPropagation()},onClick:e=>{e.stopPropagation(),p(t),L(!1)},children:n(U,{fontSize:10,children:[t.toFixed(1),"x"]})},t)})})]})]})};function rH(e,t,n,r,i,a="children"){return function e(o){for(let l=0;l<o.length;l++){const s=o[l];if(s&&s[t]===n){const e=[...o];return"replace"===i?e[l]=r:e.splice("above"===i?l:l+1,0,r),{updatedArray:e}}if(s&&s[a]&&Array.isArray(s[a])){const t=e(s[a]);if(t)return{updatedArray:o.map((e,n)=>n===l?{...e,[a]:t.updatedArray}:e)}}}return null}(e)}const iH=(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),a=r?t:Object.keys(t);if(i.length!==a.length)return!1;if(n)return i.every((e,t)=>iH(e,a[t]));{const n=new Set(a);return i.every(r=>n.has(r)&&iH(e[r],t[r]))}},aH=(e,t)=>!(!Array.isArray(e)||!Array.isArray(t))&&(e.length===t.length&&e.every((e,n)=>{const r=t[n];return iH(e,r)}));function oH(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function lH(e,t){return e&t}function sH(e,t){return e|t}function cH(e,t){return e^t}function dH(e,t){return e&~t}function uH(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 fH(e){for(var t=0;0!=e;)e&=e-1,++t;return t}var hH,CH="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function pH(e){var t,n,r="";for(t=0;t+3<=e.length;t+=3)n=parseInt(e.substring(t,t+3),16),r+=CH.charAt(n>>6)+CH.charAt(63&n);for(t+1==e.length?(n=parseInt(e.substring(t,t+1),16),r+=CH.charAt(n<<2)):t+2==e.length&&(n=parseInt(e.substring(t,t+2),16),r+=CH.charAt(n>>2)+CH.charAt((3&n)<<4));(3&r.length)>0;)r+="=";return r}function mH(e){var t,n="",r=0,i=0;for(t=0;t<e.length&&"="!=e.charAt(t);++t){var a=CH.indexOf(e.charAt(t));a<0||(0==r?(n+=oH(a>>2),i=3&a,r=1):1==r?(n+=oH(i<<2|a>>4),i=15&a,r=2):2==r?(n+=oH(i),n+=oH(a>>2),i=3&a,r=3):(n+=oH(i<<2|a>>4),n+=oH(15&a),r=0))}return 1==r&&(n+=oH(i<<2)),n}var AH,gH=function(e){var t;if(void 0===hH){var n="0123456789ABCDEF",r=" \f\n\r\t \u2028\u2029";for(hH={},t=0;t<16;++t)hH[n.charAt(t)]=t;for(n=n.toLowerCase(),t=10;t<16;++t)hH[n.charAt(t)]=t;for(t=0;t<8;++t)hH[r.charAt(t)]=-1}var i=[],a=0,o=0;for(t=0;t<e.length;++t){var l=e.charAt(t);if("="==l)break;if(-1!=(l=hH[l])){if(void 0===l)throw new Error("Illegal character at offset "+t);a|=l,++o>=2?(i[i.length]=a,a=0,o=0):a<<=4}}if(o)throw new Error("Hex encoding incomplete: 4 bits missing");return i},vH={decode:function(e){var t;if(void 0===AH){var n="= \f\n\r\t \u2028\u2029";for(AH=Object.create(null),t=0;t<64;++t)AH["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t)]=t;for(AH["-"]=62,AH._=63,t=0;t<9;++t)AH[n.charAt(t)]=-1}var r=[],i=0,a=0;for(t=0;t<e.length;++t){var o=e.charAt(t);if("="==o)break;if(-1!=(o=AH[o])){if(void 0===o)throw new Error("Illegal character at offset "+t);i|=o,++a>=4?(r[r.length]=i>>16,r[r.length]=i>>8&255,r[r.length]=255&i,i=0,a=0):i<<=6}}switch(a){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=vH.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 vH.decode(e)}},yH=1e13,wH=function(){function e(e){this.buf=[+e||0]}return e.prototype.mulAdd=function(e,t){var n,r,i=this.buf,a=i.length;for(n=0;n<a;++n)(r=i[n]*e+t)<yH?t=0:r-=(t=0|r/yH)*yH,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+=yH,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+=(yH+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*yH+e[n];return t},e.prototype.simplify=function(){var e=this.buf;return 1==e.length?e[0]:this},e}(),EH=/^(\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)?)?$/,bH=/^(\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 MH(e,t){return e.length>t&&(e=e.substring(0,t)+"…"),e}var LH,HH=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="",a=e;a<t;)n=this.get(a++),r=this.get(a++),i+=String.fromCharCode(n<<8|r);return i},e.prototype.parseTime=function(e,t,n){var r=this.parseStringISO(e,t),i=(n?EH:bH).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,a=i?255:0,o="";r==a&&++e<t;)r=this.get(e);if(0===(n=t-e))return i?-1:0;if(n>4){for(o=r,n<<=3;!(128&(+o^a));)o=+o<<1,--n;o="("+n+" bit)\n"}i&&(r-=256);for(var l=new wH(r),s=e+1;s<t;++s)l.mulAdd(256,this.get(s));return o+l.toString()},e.prototype.parseBitString=function(e,t,n){for(var r=this.get(e),i="("+((t-e-1<<3)-r)+" bit)\n",a="",o=e+1;o<t;++o){for(var l=this.get(o),s=o==t-1?r:0,c=7;c>=s;--c)a+=l>>c&1?"1":"0";if(a.length>n)return i+MH(a,n)}return i+a},e.prototype.parseOctetString=function(e,t,n){if(this.isASCII(e,t))return MH(this.parseStringISO(e,t),n);var r=t-e,i="("+r+" byte)\n";r>(n/=2)&&(t=e+n);for(var a=e;a<t;++a)i+=this.hexByte(this.get(a));return r>n&&(i+="…"),i},e.prototype.parseOID=function(e,t,n){for(var r="",i=new wH,a=0,o=e;o<t;++o){var l=this.get(o);if(i.mulAdd(128,127&l),a+=7,!(128&l)){if(""===r)if((i=i.simplify())instanceof wH)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 MH(r,n);i=new wH,a=0}}return a>0&&(r+=".incomplete"),r},e}(),xH=function(){function e(e,t,n,r,i){if(!(r instanceof VH))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 MH(this.stream.parseStringUTF(t,t+n),e);case 18:case 19:case 20:case 21:case 22:case 26:return MH(this.stream.parseStringISO(t,t+n),e);case 30:return MH(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 HH?t:new HH(t,0);var r=new HH(n),i=new VH(n),a=e.decodeLength(n),o=n.pos,l=o-r.pos,s=null,c=function(){var t=[];if(null!==a){for(var r=o+a;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 "+o)}else try{for(;;){var i=e.decode(n);if(i.tag.isEOC())break;t[t.length]=i}a=o-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===a)throw new Error("We can't skip over an invalid tag with undefined length at offset "+o);n.pos=o+Math.abs(a)}return new e(r,l,a,i,s)},e}(),VH=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 wH;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}(),kH=[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],SH=(1<<26)/kH[kH.length-1],zH=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,a="",o=this.t,l=this.DB-o*this.DB%t;if(o-- >0)for(l<this.DB&&(n=this[o]>>l)>0&&(i=!0,a=oH(n));o>=0;)l<t?(n=(this[o]&(1<<l)-1)<<t-l,n|=this[--o]>>(l+=this.DB-t)):(n=this[o]>>(l-=t)&r,l<=0&&(l+=this.DB,--o)),n>0&&(i=!0),i&&(a+=oH(n));return i?a:"0"},e.prototype.negate=function(){var t=IH();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)+qH(this[this.t-1]^this.s&this.DM)},e.prototype.mod=function(t){var n=IH();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 OH(t):new NH(t),this.exp(e,n)},e.prototype.clone=function(){var e=IH();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=IH();return this.bitwiseTo(e,lH,t),t},e.prototype.or=function(e){var t=IH();return this.bitwiseTo(e,sH,t),t},e.prototype.xor=function(e){var t=IH();return this.bitwiseTo(e,cH,t),t},e.prototype.andNot=function(e){var t=IH();return this.bitwiseTo(e,dH,t),t},e.prototype.not=function(){for(var e=IH(),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=IH();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},e.prototype.shiftRight=function(e){var t=IH();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+uH(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+=fH(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,sH)},e.prototype.clearBit=function(e){return this.changeBit(e,dH)},e.prototype.flipBit=function(e){return this.changeBit(e,cH)},e.prototype.add=function(e){var t=IH();return this.addTo(e,t),t},e.prototype.subtract=function(e){var t=IH();return this.subTo(e,t),t},e.prototype.multiply=function(e){var t=IH();return this.multiplyTo(e,t),t},e.prototype.divide=function(e){var t=IH();return this.divRemTo(e,t,null),t},e.prototype.remainder=function(e){var t=IH();return this.divRemTo(e,null,t),t},e.prototype.divideAndRemainder=function(e){var t=IH(),n=IH();return this.divRemTo(e,t,n),[t,n]},e.prototype.modPow=function(e,t){var n,r,i=e.bitLength(),a=_H(1);if(i<=0)return a;n=i<18?1:i<48?3:i<144?4:i<768?5:6,r=i<8?new OH(t):t.isEven()?new TH(t):new NH(t);var o=[],l=3,s=n-1,c=(1<<n)-1;if(o[1]=r.convert(this),n>1){var d=IH();for(r.sqrTo(o[1],d);l<=c;)o[l]=IH(),r.mulTo(d,o[l-2],o[l]),l+=2}var u,f,h=e.t-1,C=!0,p=IH();for(i=qH(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)o[u].copyTo(a),C=!1;else{for(;l>1;)r.sqrTo(a,p),r.sqrTo(p,a),l-=2;l>0?r.sqrTo(a,p):(f=a,a=p,p=f),r.mulTo(p,o[u],a)}for(;h>=0&&!(e[h]&1<<i);)r.sqrTo(a,p),f=a,a=p,p=f,--i<0&&(i=this.DB-1,--h)}return r.revert(a)},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(),a=_H(1),o=_H(0),l=_H(0),s=_H(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),n?(a.isEven()&&o.isEven()||(a.addTo(this,a),o.subTo(t,o)),a.rShiftTo(1,a)):o.isEven()||o.subTo(t,o),o.rShiftTo(1,o);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&&a.subTo(l,a),o.subTo(s,o)):(i.subTo(r,i),n&&l.subTo(a,l),s.subTo(o,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 ZH)},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(),a=n.getLowestSetBit();if(a<0)return t;for(i<a&&(a=i),a>0&&(t.rShiftTo(a,t),n.rShiftTo(a,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 a>0&&n.lShiftTo(a,n),n},e.prototype.isProbablePrime=function(e){var t,n=this.abs();if(1==n.t&&n[0]<=kH[kH.length-1]){for(t=0;t<kH.length;++t)if(n[0]==kH[t])return!0;return!1}if(n.isEven())return!1;for(t=1;t<kH.length;){for(var r=kH[t],i=t+1;i<kH.length&&r<SH;)r*=kH[i++];for(r=n.modInt(r);t<i;)if(r%kH[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,a=!1,o=0;--i>=0;){var l=8==r?255&+t[i]:BH(t,i);l<0?"-"==t.charAt(i)&&(a=!0):(a=!1,0==o?this[this.t++]=l:o+r>this.DB?(this[this.t-1]|=(l&(1<<this.DB-o)-1)<<o,this[this.t++]=l>>this.DB-o):this[this.t-1]|=l<<o,(o+=r)>=this.DB&&(o-=this.DB))}8==r&&128&+t[0]&&(this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),a&&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,a=Math.floor(e/this.DB),o=this.s<<n&this.DM,l=this.t-1;l>=0;--l)t[l+a+1]=this[l]>>r|o,o=(this[l]&i)<<n;for(l=a-1;l>=0;--l)t[l]=0;t[a]=o,t.t=this.t+a+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,a=(1<<r)-1;t[0]=this[n]>>r;for(var o=n+1;o<this.t;++o)t[o-n-1]|=(this[o]&a)<<i,t[o-n]=this[o]>>r;r>0&&(t[this.t-n-1]|=(this.s&a)<<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(),a=r.t;for(n.t=a+i.t;--a>=0;)n[a]=0;for(a=0;a<i.t;++a)n[a+r.t]=r.am(0,i[a],n,a,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 a=this.abs();if(a.t<i.t)return null!=n&&n.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=IH());var o=IH(),l=this.s,s=t.s,c=this.DB-qH(i[i.t-1]);c>0?(i.lShiftTo(c,o),a.lShiftTo(c,r)):(i.copyTo(o),a.copyTo(r));var d=o.t,u=o[d-1];if(0!=u){var f=u*(1<<this.F1)+(d>1?o[d-2]>>this.F2:0),h=this.FV/f,C=(1<<this.F1)/f,p=1<<this.F2,m=r.t,A=m-d,g=null==n?IH():n;for(o.dlShiftTo(A,g),r.compareTo(g)>=0&&(r[r.t++]=1,r.subTo(g,r)),e.ONE.dlShiftTo(d,g),g.subTo(o,o);o.t<d;)o[o.t++]=0;for(;--A>=0;){var v=r[--m]==u?this.DM:Math.floor(r[m]*h+(r[m-1]+p)*C);if((r[m]+=o.am(0,v,r,A,0,d))<v)for(o.dlShiftTo(A,g),r.subTo(g,r);r[m]<--v;)r.subTo(g,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=IH(),i=IH(),a=n.convert(this),o=qH(t)-1;for(a.copyTo(r);--o>=0;)if(n.sqrTo(r,i),(t&1<<o)>0)n.mulTo(i,a,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=_H(n),i=IH(),a=IH(),o="";for(this.divRemTo(r,i,a);i.signum()>0;)o=(n+a.intValue()).toString(e).substring(1)+o,i.divRemTo(r,i,a);return a.intValue().toString(e)+o},e.prototype.fromRadix=function(t,n){this.fromInt(0),null==n&&(n=10);for(var r=this.chunkSize(n),i=Math.pow(n,r),a=!1,o=0,l=0,s=0;s<t.length;++s){var c=BH(t,s);c<0?"-"==t.charAt(s)&&0==this.signum()&&(a=!0):(l=n*l+c,++o>=r&&(this.dMultiply(i),this.dAddOffset(l,0),o=0,l=0))}o>0&&(this.dMultiply(Math.pow(n,o)),this.dAddOffset(l,0)),a&&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),sH,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=[],a=7&t;i.length=1+(t>>3),n.nextBytes(i),a>0?i[0]&=(1<<a)-1:i[0]=0,this.fromString(i,256)}},e.prototype.bitwiseTo=function(e,t,n){var r,i,a=Math.min(e.t,this.t);for(r=0;r<a;++r)n[r]=t(this[r],e[r]);if(e.t<this.t){for(i=e.s&this.DM,r=a;r<this.t;++r)n[r]=t(this[r],i);n.t=this.t}else{for(i=this.s&this.DM,r=a;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)>kH.length&&(t=kH.length);for(var a=IH(),o=0;o<t;++o){a.fromInt(kH[Math.floor(Math.random()*kH.length)]);var l=a.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=IH();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 a=n.getLowestSetBit(),o=r.getLowestSetBit();if(o<0)t(n);else{a<o&&(o=a),o>0&&(n.rShiftTo(o,n),r.rShiftTo(o,r));var l=function(){(a=n.getLowestSetBit())>0&&n.rShiftTo(a,n),(a=r.getLowestSetBit())>0&&r.rShiftTo(a,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):(o>0&&r.lShiftTo(o,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),sH,this),this.isEven()&&this.dAddOffset(1,0);var a=this,o=function(){a.dAddOffset(2,0),a.bitLength()>t&&a.subTo(e.ONE.shiftLeft(t-1),a),a.isProbablePrime(n)?setTimeout(function(){i()},0):setTimeout(o,0)};setTimeout(o,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}(),ZH=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}(),OH=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}(),NH=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=IH();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(zH.ZERO)>0&&this.m.subTo(t,t),t},e.prototype.revert=function(e){var t=IH();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}(),TH=function(){function e(e){this.m=e,this.r2=IH(),this.q3=IH(),zH.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=IH();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 IH(){return new zH(null)}function DH(e,t){return new zH(e,t)}var FH="undefined"!=typeof navigator;FH&&"Microsoft Internet Explorer"==navigator.appName?(zH.prototype.am=function(e,t,n,r,i,a){for(var o=32767&t,l=t>>15;--a>=0;){var s=32767&this[e],c=this[e++]>>15,d=l*s+c*o;i=((s=o*s+((32767&d)<<15)+n[r]+(1073741823&i))>>>30)+(d>>>15)+l*c+(i>>>30),n[r++]=1073741823&s}return i},LH=30):FH&&"Netscape"!=navigator.appName?(zH.prototype.am=function(e,t,n,r,i,a){for(;--a>=0;){var o=t*this[e++]+n[r]+i;i=Math.floor(o/67108864),n[r++]=67108863&o}return i},LH=26):(zH.prototype.am=function(e,t,n,r,i,a){for(var o=16383&t,l=t>>14;--a>=0;){var s=16383&this[e],c=this[e++]>>14,d=l*s+c*o;i=((s=o*s+((16383&d)<<14)+n[r]+i)>>28)+(d>>14)+l*c,n[r++]=268435455&s}return i},LH=28),zH.prototype.DB=LH,zH.prototype.DM=(1<<LH)-1,zH.prototype.DV=1<<LH;zH.prototype.FV=Math.pow(2,52),zH.prototype.F1=52-LH,zH.prototype.F2=2*LH-52;var RH,PH,jH=[];for(RH="0".charCodeAt(0),PH=0;PH<=9;++PH)jH[RH++]=PH;for(RH="a".charCodeAt(0),PH=10;PH<36;++PH)jH[RH++]=PH;for(RH="A".charCodeAt(0),PH=10;PH<36;++PH)jH[RH++]=PH;function BH(e,t){var n=jH[e.charCodeAt(t)];return null==n?-1:n}function _H(e){var t=IH();return t.fromInt(e),t}function qH(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}zH.ZERO=_H(0),zH.ONE=_H(1);var UH=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 WH,XH,QH=null;if(null==QH){QH=[],XH=0;var GH=void 0;if("undefined"!=typeof window&&self.crypto&&self.crypto.getRandomValues){var KH=new Uint32Array(256);for(self.crypto.getRandomValues(KH),GH=0;GH<KH.length;++GH)QH[XH++]=255&KH[GH]}var YH=0,JH=function(e){if((YH=YH||0)>=256||XH>=256)self.removeEventListener?self.removeEventListener("mousemove",JH,!1):self.detachEvent&&self.detachEvent("onmousemove",JH);else try{var t=e.x+e.y;QH[XH++]=255&t,YH+=1}catch(e){}};"undefined"!=typeof window&&(self.addEventListener?self.addEventListener("mousemove",JH,!1):self.attachEvent&&self.attachEvent("onmousemove",JH))}function $H(){if(null==WH){for(WH=new UH;XH<256;){var e=Math.floor(65536*Math.random());QH[XH++]=255&e}for(WH.init(QH),XH=0;XH<QH.length;++XH)QH[XH]=0;XH=0}return WH.next()}var ex=function(){function e(){}return e.prototype.nextBytes=function(e){for(var t=0;t<e.length;++t)e[t]=$H()},e}();function tx(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,a,o,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],a=C[3],o=C[4],l=C[5],s=C[6],c=C[7],u=0;u<64;u++)p[u]=u<16?e[u+d]:fx(fx(fx(dx(p[u-2]),p[u-7]),cx(p[u-15])),p[u-16]),f=fx(fx(fx(fx(c,sx(o)),ax(o,l,s)),ux[u]),p[u]),h=fx(lx(n),ox(n,r,i)),c=s,s=l,l=o,o=fx(a,f),a=i,i=r,r=n,n=fx(f,h);C[0]=fx(n,C[0]),C[1]=fx(r,C[1]),C[2]=fx(i,C[2]),C[3]=fx(a,C[3]),C[4]=fx(o,C[4]),C[5]=fx(l,C[5]),C[6]=fx(s,C[6]),C[7]=fx(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 nx(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 rx(e,t){return e>>>t|e<<32-t}function ix(e,t){return e>>>t}function ax(e,t,n){return e&t^~e&n}function ox(e,t,n){return e&t^e&n^t&n}function lx(e){return rx(e,2)^rx(e,13)^rx(e,22)}function sx(e){return rx(e,6)^rx(e,11)^rx(e,25)}function cx(e){return rx(e,7)^rx(e,18)^ix(e,3)}function dx(e){return rx(e,17)^rx(e,19)^ix(e,10)}var ux=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 fx(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function hx(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 a=new ex,o=[];t>2;){for(o[0]=0;0==o[0];)a.nextBytes(o);n[--t]=o[0]}return n[--t]=2,n[--t]=0,new zH(n)}function Cx(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 px(e,t){var n=tx;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 a=n("")+i+""+e,o=new Array(32);(new ex).nextBytes(o);var l=Cx(o,a.length,n),s=[];for(r=0;r<a.length;r+=1)s[r]=a.charCodeAt(r)^l.charCodeAt(r);var c=Cx(s,o.length,n),d=[0];for(r=0;r<o.length;r+=1)d[r+1]=o[r]^c.charCodeAt(r);return new zH(d.concat(s))}var mx=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=DH(e,16),this.e=parseInt(t,16)):console.error("Invalid RSA public key")},e.prototype.encrypt=function(e,t){void 0===t&&(t=hx);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 a=i.toString(16),o=a.length,l=0;l<2*n-o;l++)a="0"+a;return a},e.prototype.setPrivate=function(e,t,n){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=DH(e,16),this.e=parseInt(t,16),this.d=DH(n,16)):console.error("Invalid RSA private key")},e.prototype.setPrivateEx=function(e,t,n,r,i,a,o,l){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=DH(e,16),this.e=parseInt(t,16),this.d=DH(n,16),this.p=DH(r,16),this.q=DH(i,16),this.dmp1=DH(a,16),this.dmq1=DH(o,16),this.coeff=DH(l,16)):console.error("Invalid RSA private key")},e.prototype.generate=function(e,t){var n=new ex,r=e>>1;this.e=parseInt(t,16);for(var i=new zH(t,16);;){for(;this.p=new zH(e-r,1,n),0!=this.p.subtract(zH.ONE).gcd(i).compareTo(zH.ONE)||!this.p.isProbablePrime(10););for(;this.q=new zH(r,1,n),0!=this.q.subtract(zH.ONE).gcd(i).compareTo(zH.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var a=this.p;this.p=this.q,this.q=a}var o=this.p.subtract(zH.ONE),l=this.q.subtract(zH.ONE),s=o.multiply(l);if(0==s.gcd(i).compareTo(zH.ONE)){this.n=this.p.multiply(this.q),this.d=i.modInverse(s),this.dmp1=this.d.mod(o),this.dmq1=this.d.mod(l),this.coeff=this.q.modInverse(this.p);break}}},e.prototype.decrypt=function(e){var t=DH(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 a=255&n[r];a<128?i+=String.fromCharCode(a):a>191&&a<224?(i+=String.fromCharCode((31&a)<<6|63&n[r+1]),++r):(i+=String.fromCharCode((15&a)<<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 ex,i=e>>1;this.e=parseInt(t,16);var a=new zH(t,16),o=this,l=function(){var t=function(){if(o.p.compareTo(o.q)<=0){var e=o.p;o.p=o.q,o.q=e}var t=o.p.subtract(zH.ONE),r=o.q.subtract(zH.ONE),i=t.multiply(r);0==i.gcd(a).compareTo(zH.ONE)?(o.n=o.p.multiply(o.q),o.d=a.modInverse(i),o.dmp1=o.d.mod(t),o.dmq1=o.d.mod(r),o.coeff=o.q.modInverse(o.p),setTimeout(function(){n()},0)):setTimeout(l,0)},s=function(){o.q=IH(),o.q.fromNumberAsync(i,1,r,function(){o.q.subtract(zH.ONE).gcda(a,function(e){0==e.compareTo(zH.ONE)&&o.q.isProbablePrime(10)?setTimeout(t,0):setTimeout(s,0)})})},c=function(){o.p=IH(),o.p.fromNumberAsync(e-i,1,r,function(){o.p.subtract(zH.ONE).gcda(a,function(e){0==e.compareTo(zH.ONE)&&o.p.isProbablePrime(10)?setTimeout(s,0):setTimeout(c,0)})})};setTimeout(c,0)};setTimeout(l,0)},e.prototype.sign=function(e,t,n){var r=(Ax[n]||"")+t(e).toString(),i=this.n.bitLength()/4,a=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 DH("0001"+r+"00"+e,16)}(r,i);if(null==a)return null;var o=this.doPrivate(a);if(null==o)return null;for(var l=o.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=DH(t,16),i=this.doPublic(r);return null==i?null:function(e){for(var t in Ax)if(Ax.hasOwnProperty(t)){var n=Ax[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 Ax={md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",ripemd160:"3021300906052b2403020105000414"};function gx(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)}
|
|
37
37
|
/**
|
|
38
38
|
* @fileOverview
|
|
39
39
|
* @name asn1-1.0.js
|
|
@@ -41,7 +41,7 @@ object-assign
|
|
|
41
41
|
* @version asn1 1.0.13 (2017-Jun-02)
|
|
42
42
|
* @since jsrsasign 2.1
|
|
43
43
|
* @license <a href="https://kjur.github.io/jsrsasign/license/">MIT License</a>
|
|
44
|
-
*/var vx={};void 0!==vx.asn1&&vx.asn1||(vx.asn1={}),vx.asn1.ASN1Util=new function(){this.integerToByteHex=function(e){var t=e.toString(16);return t.length%2==1&&(t="0"+t),t},this.bigIntToMinTwosComplementsHex=function(e){var t=e.toString(16);if("-"!=t.substring(0,1))t.length%2==1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t);else{var n=t.substring(1).length;n%2==1?n+=1:t.match(/^[0-7]/)||(n+=2);for(var r="",i=0;i<n;i++)r+="f";t=new zH(r,16).xor(e).add(zH.ONE).toString(16).replace(/^-/,"")}return t},this.getPEMStringFromHex=function(e,t){return hextopem(e,t)},this.newObject=function(e){var t=vx.asn1,n=t.DERBoolean,r=t.DERInteger,i=t.DERBitString,a=t.DEROctetString,o=t.DERNull,l=t.DERObjectIdentifier,s=t.DEREnumerated,c=t.DERUTF8String,d=t.DERNumericString,u=t.DERPrintableString,f=t.DERTeletexString,h=t.DERIA5String,C=t.DERUTCTime,p=t.DERGeneralizedTime,m=t.DERSequence,A=t.DERSet,g=t.DERTaggedObject,v=t.ASN1Util.newObject,y=Object.keys(e);if(1!=y.length)throw"key of param shall be only one.";var w=y[0];if(-1==":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+w+":"))throw"undefined key: "+w;if("bool"==w)return new n(e[w]);if("int"==w)return new r(e[w]);if("bitstr"==w)return new i(e[w]);if("octstr"==w)return new a(e[w]);if("null"==w)return new o(e[w]);if("oid"==w)return new l(e[w]);if("enum"==w)return new s(e[w]);if("utf8str"==w)return new c(e[w]);if("numstr"==w)return new d(e[w]);if("prnstr"==w)return new u(e[w]);if("telstr"==w)return new f(e[w]);if("ia5str"==w)return new h(e[w]);if("utctime"==w)return new C(e[w]);if("gentime"==w)return new p(e[w]);if("seq"==w){for(var E=e[w],b=[],M=0;M<E.length;M++){var L=v(E[M]);b.push(L)}return new m({array:b})}if("set"==w){for(E=e[w],b=[],M=0;M<E.length;M++){L=v(E[M]);b.push(L)}return new A({array:b})}if("tag"==w){var H=e[w];if("[object Array]"===Object.prototype.toString.call(H)&&3==H.length){var x=v(H[2]);return new g({tag:H[0],explicit:H[1],obj:x})}var V={};if(void 0!==H.explicit&&(V.explicit=H.explicit),void 0!==H.tag&&(V.tag=H.tag),void 0===H.obj)throw"obj shall be specified for 'tag'.";return V.obj=v(H.obj),new g(V)}},this.jsonToASN1HEX=function(e){return this.newObject(e).getEncodedHex()}},vx.asn1.ASN1Util.oidHexToInt=function(e){for(var t="",n=parseInt(e.substring(0,2),16),r=(t=Math.floor(n/40)+"."+n%40,""),i=2;i<e.length;i+=2){var a=("00000000"+parseInt(e.substring(i,i+2),16).toString(2)).slice(-8);if(r+=a.substring(1,8),"0"==a.substring(0,1))t=t+"."+new zH(r,2).toString(10),r=""}return t},vx.asn1.ASN1Util.oidIntToHex=function(e){var t=function(e){var t=e.toString(16);return 1==t.length&&(t="0"+t),t},n=function(e){var n="",r=new zH(e,10).toString(2),i=7-r.length%7;7==i&&(i=0);for(var a="",o=0;o<i;o++)a+="0";r=a+r;for(o=0;o<r.length-1;o+=7){var l=r.substring(o,o+7);o!=r.length-7&&(l="1"+l),n+=t(parseInt(l,2))}return n};if(!e.match(/^[0-9.]+$/))throw"malformed oid string: "+e;var r="",i=e.split("."),a=40*parseInt(i[0])+parseInt(i[1]);r+=t(a),i.splice(0,2);for(var o=0;o<i.length;o++)r+=n(i[o]);return r},vx.asn1.ASN1Object=function(){this.getLengthHexFromValue=function(){if(void 0===this.hV||null==this.hV)throw"this.hV is null or undefined.";if(this.hV.length%2==1)throw"value hex must be even length: n=0,v="+this.hV;var e=this.hV.length/2,t=e.toString(16);if(t.length%2==1&&(t="0"+t),e<128)return t;var n=t.length/2;if(n>15)throw"ASN.1 length too long to represent by 8x: n = "+e.toString(16);return(128+n).toString(16)+t},this.getEncodedHex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""}},vx.asn1.DERAbstractString=function(e){vx.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=stohex(this.s)},this.setStringHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e?this.setString(e):void 0!==e.str?this.setString(e.str):void 0!==e.hex&&this.setStringHex(e.hex))},gx(vx.asn1.DERAbstractString,vx.asn1.ASN1Object),vx.asn1.DERAbstractTime=function(e){vx.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(e){return utc=e.getTime()+6e4*e.getTimezoneOffset(),new Date(utc)},this.formatDate=function(e,t,n){var r=this.zeroPadding,i=this.localDateToUTC(e),a=String(i.getFullYear());"utc"==t&&(a=a.substring(2,4));var o=a+r(String(i.getMonth()+1),2)+r(String(i.getDate()),2)+r(String(i.getHours()),2)+r(String(i.getMinutes()),2)+r(String(i.getSeconds()),2);if(!0===n){var l=i.getMilliseconds();if(0!=l){var s=r(String(l),3);o=o+"."+(s=s.replace(/[0]+$/,""))}}return o+"Z"},this.zeroPadding=function(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e},this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=stohex(e)},this.setByDateValue=function(e,t,n,r,i,a){var o=new Date(Date.UTC(e,t-1,n,r,i,a,0));this.setByDate(o)},this.getFreshValueHex=function(){return this.hV}},gx(vx.asn1.DERAbstractTime,vx.asn1.ASN1Object),vx.asn1.DERAbstractStructured=function(e){vx.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array=e},this.appendASN1Object=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array.push(e)},this.asn1Array=new Array,void 0!==e&&void 0!==e.array&&(this.asn1Array=e.array)},gx(vx.asn1.DERAbstractStructured,vx.asn1.ASN1Object),vx.asn1.DERBoolean=function(){vx.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},gx(vx.asn1.DERBoolean,vx.asn1.ASN1Object),vx.asn1.DERInteger=function(e){vx.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=vx.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new zH(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.bigint?this.setByBigInteger(e.bigint):void 0!==e.int?this.setByInteger(e.int):"number"==typeof e?this.setByInteger(e):void 0!==e.hex&&this.setValueHex(e.hex))},gx(vx.asn1.DERInteger,vx.asn1.ASN1Object),vx.asn1.DERBitString=function(e){if(void 0!==e&&void 0!==e.obj){var t=vx.asn1.ASN1Util.newObject(e.obj);e.hex="00"+t.getEncodedHex()}vx.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(e){this.hTLV=null,this.isModified=!0,this.hV=e},this.setUnusedBitsAndHexValue=function(e,t){if(e<0||7<e)throw"unused bits shall be from 0 to 7: u = "+e;var n="0"+e;this.hTLV=null,this.isModified=!0,this.hV=n+t},this.setByBinaryString=function(e){var t=8-(e=e.replace(/0+$/,"")).length%8;8==t&&(t=0);for(var n=0;n<=t;n++)e+="0";var r="";for(n=0;n<e.length-1;n+=8){var i=e.substring(n,n+8),a=parseInt(i,2).toString(16);1==a.length&&(a="0"+a),r+=a}this.hTLV=null,this.isModified=!0,this.hV="0"+t+r},this.setByBooleanArray=function(e){for(var t="",n=0;n<e.length;n++)1==e[n]?t+="1":t+="0";this.setByBinaryString(t)},this.newFalseArray=function(e){for(var t=new Array(e),n=0;n<e;n++)t[n]=!1;return t},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e&&e.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(e):void 0!==e.hex?this.setHexValueIncludingUnusedBits(e.hex):void 0!==e.bin?this.setByBinaryString(e.bin):void 0!==e.array&&this.setByBooleanArray(e.array))},gx(vx.asn1.DERBitString,vx.asn1.ASN1Object),vx.asn1.DEROctetString=function(e){if(void 0!==e&&void 0!==e.obj){var t=vx.asn1.ASN1Util.newObject(e.obj);e.hex=t.getEncodedHex()}vx.asn1.DEROctetString.superclass.constructor.call(this,e),this.hT="04"},gx(vx.asn1.DEROctetString,vx.asn1.DERAbstractString),vx.asn1.DERNull=function(){vx.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},gx(vx.asn1.DERNull,vx.asn1.ASN1Object),vx.asn1.DERObjectIdentifier=function(e){var t=function(e){var t=e.toString(16);return 1==t.length&&(t="0"+t),t},n=function(e){var n="",r=new zH(e,10).toString(2),i=7-r.length%7;7==i&&(i=0);for(var a="",o=0;o<i;o++)a+="0";r=a+r;for(o=0;o<r.length-1;o+=7){var l=r.substring(o,o+7);o!=r.length-7&&(l="1"+l),n+=t(parseInt(l,2))}return n};vx.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.setValueOidString=function(e){if(!e.match(/^[0-9.]+$/))throw"malformed oid string: "+e;var r="",i=e.split("."),a=40*parseInt(i[0])+parseInt(i[1]);r+=t(a),i.splice(0,2);for(var o=0;o<i.length;o++)r+=n(i[o]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=r},this.setValueName=function(e){var t=vx.asn1.x509.OID.name2oid(e);if(""===t)throw"DERObjectIdentifier oidName undefined: "+e;this.setValueOidString(t)},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e?e.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(e):this.setValueName(e):void 0!==e.oid?this.setValueOidString(e.oid):void 0!==e.hex?this.setValueHex(e.hex):void 0!==e.name&&this.setValueName(e.name))},gx(vx.asn1.DERObjectIdentifier,vx.asn1.ASN1Object),vx.asn1.DEREnumerated=function(e){vx.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=vx.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new zH(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.int?this.setByInteger(e.int):"number"==typeof e?this.setByInteger(e):void 0!==e.hex&&this.setValueHex(e.hex))},gx(vx.asn1.DEREnumerated,vx.asn1.ASN1Object),vx.asn1.DERUTF8String=function(e){vx.asn1.DERUTF8String.superclass.constructor.call(this,e),this.hT="0c"},gx(vx.asn1.DERUTF8String,vx.asn1.DERAbstractString),vx.asn1.DERNumericString=function(e){vx.asn1.DERNumericString.superclass.constructor.call(this,e),this.hT="12"},gx(vx.asn1.DERNumericString,vx.asn1.DERAbstractString),vx.asn1.DERPrintableString=function(e){vx.asn1.DERPrintableString.superclass.constructor.call(this,e),this.hT="13"},gx(vx.asn1.DERPrintableString,vx.asn1.DERAbstractString),vx.asn1.DERTeletexString=function(e){vx.asn1.DERTeletexString.superclass.constructor.call(this,e),this.hT="14"},gx(vx.asn1.DERTeletexString,vx.asn1.DERAbstractString),vx.asn1.DERIA5String=function(e){vx.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="16"},gx(vx.asn1.DERIA5String,vx.asn1.DERAbstractString),vx.asn1.DERUTCTime=function(e){vx.asn1.DERUTCTime.superclass.constructor.call(this,e),this.hT="17",this.setByDate=function(e){this.hTLV=null,this.isModified=!0,this.date=e,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)),this.hV},void 0!==e&&(void 0!==e.str?this.setString(e.str):"string"==typeof e&&e.match(/^[0-9]{12}Z$/)?this.setString(e):void 0!==e.hex?this.setStringHex(e.hex):void 0!==e.date&&this.setByDate(e.date))},gx(vx.asn1.DERUTCTime,vx.asn1.DERAbstractTime),vx.asn1.DERGeneralizedTime=function(e){vx.asn1.DERGeneralizedTime.superclass.constructor.call(this,e),this.hT="18",this.withMillis=!1,this.setByDate=function(e){this.hTLV=null,this.isModified=!0,this.date=e,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)),this.hV},void 0!==e&&(void 0!==e.str?this.setString(e.str):"string"==typeof e&&e.match(/^[0-9]{14}Z$/)?this.setString(e):void 0!==e.hex?this.setStringHex(e.hex):void 0!==e.date&&this.setByDate(e.date),!0===e.millis&&(this.withMillis=!0))},gx(vx.asn1.DERGeneralizedTime,vx.asn1.DERAbstractTime),vx.asn1.DERSequence=function(e){vx.asn1.DERSequence.superclass.constructor.call(this,e),this.hT="30",this.getFreshValueHex=function(){for(var e="",t=0;t<this.asn1Array.length;t++){e+=this.asn1Array[t].getEncodedHex()}return this.hV=e,this.hV}},gx(vx.asn1.DERSequence,vx.asn1.DERAbstractStructured),vx.asn1.DERSet=function(e){vx.asn1.DERSet.superclass.constructor.call(this,e),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var e=new Array,t=0;t<this.asn1Array.length;t++){var n=this.asn1Array[t];e.push(n.getEncodedHex())}return 1==this.sortFlag&&e.sort(),this.hV=e.join(""),this.hV},void 0!==e&&void 0!==e.sortflag&&0==e.sortflag&&(this.sortFlag=!1)},gx(vx.asn1.DERSet,vx.asn1.DERAbstractStructured),vx.asn1.DERTaggedObject=function(e){vx.asn1.DERTaggedObject.superclass.constructor.call(this),this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(e,t,n){this.hT=t,this.isExplicit=e,this.asn1Object=n,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=n.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,t),this.isModified=!1)},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.tag&&(this.hT=e.tag),void 0!==e.explicit&&(this.isExplicit=e.explicit),void 0!==e.obj&&(this.asn1Object=e.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))},gx(vx.asn1.DERTaggedObject,vx.asn1.ASN1Object);var yx,wx,Ex=window&&window.__extends||(yx=function(e,t){return yx=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},yx(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}yx(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),bx=function(e){function t(n){var r=e.call(this)||this;return n&&("string"==typeof n?r.parseKey(n):(t.hasPrivateKeyProperty(n)||t.hasPublicKeyProperty(n))&&r.parsePropertiesFrom(n)),r}return Ex(t,e),t.prototype.parseKey=function(e){try{var t=0,n=0,r=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/.test(e)?gH(e):vH.unarmor(e),i=xH.decode(r);if(3===i.sub.length&&(i=i.sub[2].sub[0]),9===i.sub.length){t=i.sub[1].getHexStringValue(),this.n=DH(t,16),n=i.sub[2].getHexStringValue(),this.e=parseInt(n,16);var a=i.sub[3].getHexStringValue();this.d=DH(a,16);var o=i.sub[4].getHexStringValue();this.p=DH(o,16);var l=i.sub[5].getHexStringValue();this.q=DH(l,16);var s=i.sub[6].getHexStringValue();this.dmp1=DH(s,16);var c=i.sub[7].getHexStringValue();this.dmq1=DH(c,16);var d=i.sub[8].getHexStringValue();this.coeff=DH(d,16)}else{if(2!==i.sub.length)return!1;if(i.sub[0].sub){var u=i.sub[1].sub[0];t=u.sub[0].getHexStringValue(),this.n=DH(t,16),n=u.sub[1].getHexStringValue(),this.e=parseInt(n,16)}else t=i.sub[0].getHexStringValue(),this.n=DH(t,16),n=i.sub[1].getHexStringValue(),this.e=parseInt(n,16)}return!0}catch(e){return!1}},t.prototype.getPrivateBaseKey=function(){var e={array:[new vx.asn1.DERInteger({int:0}),new vx.asn1.DERInteger({bigint:this.n}),new vx.asn1.DERInteger({int:this.e}),new vx.asn1.DERInteger({bigint:this.d}),new vx.asn1.DERInteger({bigint:this.p}),new vx.asn1.DERInteger({bigint:this.q}),new vx.asn1.DERInteger({bigint:this.dmp1}),new vx.asn1.DERInteger({bigint:this.dmq1}),new vx.asn1.DERInteger({bigint:this.coeff})]};return new vx.asn1.DERSequence(e).getEncodedHex()},t.prototype.getPrivateBaseKeyB64=function(){return pH(this.getPrivateBaseKey())},t.prototype.getPublicBaseKey=function(){var e=new vx.asn1.DERSequence({array:[new vx.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new vx.asn1.DERNull]}),t=new vx.asn1.DERSequence({array:[new vx.asn1.DERInteger({bigint:this.n}),new vx.asn1.DERInteger({int:this.e})]}),n=new vx.asn1.DERBitString({hex:"00"+t.getEncodedHex()});return new vx.asn1.DERSequence({array:[e,n]}).getEncodedHex()},t.prototype.getPublicBaseKeyB64=function(){return pH(this.getPublicBaseKey())},t.wordwrap=function(e,t){if(!e)return e;var n="(.{1,"+(t=t||64)+"})( +|$\n?)|(.{1,"+t+"})";return e.match(RegExp(n,"g")).join("\n")},t.prototype.getPrivateKey=function(){var e="-----BEGIN RSA PRIVATE KEY-----\n";return e+=t.wordwrap(this.getPrivateBaseKeyB64())+"\n",e+="-----END RSA PRIVATE KEY-----"},t.prototype.getPublicKey=function(){var e="-----BEGIN PUBLIC KEY-----\n";return e+=t.wordwrap(this.getPublicBaseKeyB64())+"\n",e+="-----END PUBLIC KEY-----"},t.hasPublicKeyProperty=function(e){return(e=e||{}).hasOwnProperty("n")&&e.hasOwnProperty("e")},t.hasPrivateKeyProperty=function(e){return(e=e||{}).hasOwnProperty("n")&&e.hasOwnProperty("e")&&e.hasOwnProperty("d")&&e.hasOwnProperty("p")&&e.hasOwnProperty("q")&&e.hasOwnProperty("dmp1")&&e.hasOwnProperty("dmq1")&&e.hasOwnProperty("coeff")},t.prototype.parsePropertiesFrom=function(e){this.n=e.n,this.e=e.e,e.hasOwnProperty("d")&&(this.d=e.d,this.p=e.p,this.q=e.q,this.dmp1=e.dmp1,this.dmq1=e.dmq1,this.coeff=e.coeff)},t}(mx),Mx="undefined"!=typeof process?null===(wx=process.env)||void 0===wx?void 0:wx.npm_package_version:void 0,Lx=function(){function e(e){void 0===e&&(e={}),this.default_key_size=e.default_key_size?parseInt(e.default_key_size,10):1024,this.default_public_exponent=e.default_public_exponent||"010001",this.log=e.log||!1,this.key=e.key||null}return e.prototype.setKey=function(e){e?(this.log&&this.key&&console.warn("A key was already set, overriding existing."),this.key=new bx(e)):!this.key&&this.log&&console.error("A key was not set.")},e.prototype.setPrivateKey=function(e){this.setKey(e)},e.prototype.setPublicKey=function(e){this.setKey(e)},e.prototype.decrypt=function(e){try{return this.getKey().decrypt(mH(e))}catch(e){return!1}},e.prototype.encrypt=function(e){try{return pH(this.getKey().encrypt(e))}catch(e){return!1}},e.prototype.encryptOAEP=function(e){try{return pH(this.getKey().encrypt(e,px))}catch(e){return!1}},e.prototype.sign=function(e,t,n){void 0===t&&(t=function(e){return e}),void 0===n&&(n="");try{return pH(this.getKey().sign(e,t,n))}catch(e){return!1}},e.prototype.signSha256=function(e){return this.sign(e,function(e){return nx(tx(e))},"sha256")},e.prototype.verify=function(e,t,n){void 0===n&&(n=function(e){return e});try{return this.getKey().verify(e,mH(t),n)}catch(e){return!1}},e.prototype.verifySha256=function(e,t){return this.verify(e,t,function(e){return nx(tx(e))})},e.prototype.getKey=function(e){if(!this.key){if(this.key=new bx,e&&"[object Function]"==={}.toString.call(e))return void this.key.generateAsync(this.default_key_size,this.default_public_exponent,e);this.key.generate(this.default_key_size,this.default_public_exponent)}return this.key},e.prototype.getPrivateKey=function(){return this.getKey().getPrivateKey()},e.prototype.getPrivateKeyB64=function(){return this.getKey().getPrivateBaseKeyB64()},e.prototype.getPublicKey=function(){return this.getKey().getPublicKey()},e.prototype.getPublicKeyB64=function(){return this.getKey().getPublicBaseKeyB64()},e.version=Mx,e}();async function Hx(e,t,n="https"){if("http"===n){const n=new Lx;n.setPublicKey(t);const r=n.encrypt(e);if(!r)throw new Error("JSEncrypt failed: Encryption returned false (check key or data length).");return r}{const n=Uint8Array.from(atob(t),e=>e.charCodeAt(0)),r=await crypto.subtle.importKey("spki",n,{name:"RSA-OAEP",hash:"SHA-256"},!1,["encrypt"]),i=(new TextEncoder).encode(e),a=await crypto.subtle.encrypt({name:"RSA-OAEP"},r,i);return btoa(String.fromCharCode(...new Uint8Array(a)))}}const xx=e=>{const t=e.toLowerCase().trim(),n=parseFloat(t);switch(t.replace(/[0-9.]/g,"").trim()){case"gb":return 1024*n*1024*1024;case"mb":return 1024*n*1024;case"kb":return 1024*n;default:return n}},Vx=e=>{const t=e.toLowerCase().trim(),n=parseFloat(t);switch(t.replace(/[0-9.]/g,"").trim()){case"gb":default:return n;case"mb":return n/1024;case"kb":return n/1048576;case"b":return n/1073741824}},kx=({data:r,isYaxisSticky:i=!1,barWidth:a,height:s,barGap:d=20,colors:u=[],xAxisLabel:f,isTruncateText:h=!0,yAxisLabel:C,padding:p=20,yAxisDivisions:m=5,barBorderRadius:A=0,legend:g=!0,showXAxisLabels:v=!0,icons:y=[],iconSize:w,legendPosition:E="bottom",legendGap:b=5,extendBarChartRightWidth:M=0,isYAxisValuePercentage:L=!1,selectedBar:H,setSelectedBar:x,onSelectedBar:V,totalLabel:k="Total Execution",customToolTip:S=!1,isOnclick:z=!1,isDashboardVersions:Z,type:O="",isMemory:N,tooltipWidth:T="fit-content"})=>{const I=o(null),[D,F]=c(null),[R,P]=c(!1);l(()=>{const e=()=>{const e=I.current;e&&R&&(e.style.display="none")};return window.addEventListener("scroll",e,!0),()=>window.removeEventListener("scroll",e,!0)},[R]);const j=(e=>{const t=["TB","GB","MB","KB"];for(const n of t){if(e.some(e=>"string"==typeof e.value&&e.value.toLowerCase().includes(n.toLowerCase())))return n}return null})(r),B=r.map(e=>{if("string"==typeof e.value){let t=0;if("memory"===O)t=Vx(e.value);else if(N)switch(j){case"TB":t=(e=>{const t=e.toLowerCase().trim(),n=parseFloat(t);switch(t.replace(/[0-9.]/g,"").trim()){case"tb":default:return n;case"gb":return n/1024;case"mb":return n/1048576;case"kb":return n/1073741824;case"b":return n/1099511627776}})(e.value);break;case"GB":t=Vx(e.value);break;case"MB":t=(e=>{const t=e.toLowerCase().trim(),n=parseFloat(t);switch(t.replace(/[0-9.]/g,"").trim()){case"mb":default:return n;case"gb":return 1024*n;case"tb":return 1024*n*1024;case"kb":return n/1024;case"b":return n/1048576}})(e.value);break;case"KB":t=(e=>{const t=e.toLowerCase().trim(),n=parseFloat(t);switch(t.replace(/[0-9.]/g,"").trim()){case"kb":default:return n;case"mb":return 1024*n;case"gb":return 1024*n*1024;case"tb":return 1024*n*1024*1024;case"b":return n/1024}})(e.value)}else t=parseFloat(e.value);return{...e,normalizedValue:t}}return{...e,normalizedValue:e.value}});let _=0;"memory"===O&&(_=r.reduce((e,t)=>"string"==typeof t.value?e+xx(t.value):e+1024*Number(t.value)*1024*1024,0));const W=_/1048576,X=W<1024?`${Math.round(W)} mb`:`${(W/1024).toFixed(1)} gb`;let Q=Math.max(...B.map(e=>e.normalizedValue));Q="memory"===O?Math.max(Q,1):Math.max(Q,m);const G=40,K=40,Y=B.length*a+(B.length-1)*d+(i?K:90)+M,J=Date.now(),$=t=>t.filter(e=>e.length>1).map((t,n)=>e("defs",{children:e("linearGradient",{id:`gradient-${J}-${O}-${n}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:t.map((r,i)=>e("stop",{offset:i/(t.length-1)*100+"%",stopColor:r},`${n}-${i}`))})},n)),ee=e=>{if(!u.length)return"grey";const t=u[e%u.length];return 1===t?.length?t[0]:`url(#gradient-${J}-${O}-${e%u.length})`},te=(e,t,n,r,i)=>{P(!0);const a=I.current;if(a)if(a.style.display="block",S)a.innerHTML=`<div>\n <div><Typography fontWeight='semi-bold'>${e}</Typography></div>\n <div><Typography>${n||""}</Typography></div>\n <div><Typography>${k} : ${t} ${r?"("+Number(r)+"%)":""}</Typography></div>\n </div>`;else if(Z){const e=i?i.join(", "):"";a.innerHTML=`\n <div>\n <div><Typography>${k} : ${t}</Typography></div>\n ${e?`<div><Typography>Versions : ${e}</Typography></div>`:""}\n </div>`}else a.innerHTML="memory"===O?`<strong>${e}</strong>: ${t} / ${X}`:`<strong>${e}</strong>: ${t} ${L?"%":""}`},ne=e=>{const t=I.current;if(t){const n=t.parentElement,r=n?.getBoundingClientRect();if(!r)return;const i=t.offsetWidth,a=t.offsetHeight,o=e.clientX-r.left,l=e.clientY-r.top,s=10;let c=o+s,d=l-a-s;c+i>r.width&&(c=o-i-s),c<0&&(c=s),d<0&&(d=l+s),d+a>r.height&&(d=r.height-a-s),t.style.left=`${c}px`,t.style.top=`${d}px`}},re=()=>{P(!1);const e=I.current;e&&(e.style.display="none")},ie=(e,t)=>{x&&x(e),z&&V?.(e,t)},ae=e=>{if(h){if(Hn(e,10).endsWith("...")){const t=I.current;t&&(t.style.display="block",t.innerHTML=e)}}},oe=(e,t,n)=>{if(h){Hn(t,10).endsWith("...")&&ne(e)}};return n("div",{className:"ff-bar-chart-container",children:[e("div",{ref:I,className:"ff-bar-chart-tooltip",style:{width:T}}),g&&"top"===E&&e("div",{className:"ff-legend-container",children:e("div",{className:"ff-bar-chart-legend",style:{gap:`${b}px`},children:B.map((t,r)=>n("div",{className:"ff-bar-chart-legend-item",onMouseEnter:()=>F(r),onMouseLeave:()=>F(null),children:[y[r]&&"string"==typeof y[r]?e(q,{name:String(y[r]),width:w,height:w}):e("span",{className:"ff-bar-chart-legend-item-circle",style:{backgroundColor:u[r%u.length]?.[0]||"grey"}}),e(U,{as:"div",fontSize:10,fontWeight:"regular",className:"ff-legend-label",children:t.label})]},t.label))})}),i?n("div",{className:"ff-bar-chart-wrapper",children:[e("div",{className:"ff-y-axis",children:e("svg",{width:60,height:s+G+(f?20:0),children:n(t,{children:[Array.from({length:m+1}).map((t,n)=>{const r=s-n/m*s+G+4,i=n*Q/m,a="memory"===O?i.toFixed(1):L?`${i.toFixed(0).padStart(2,"0")}%`:i.toFixed(0).padStart(2,"0");return e("text",{x:50,y:r,fill:"black",textAnchor:"middle",className:"ff-bar-chart-labels",children:a},n)}),C&&e("text",{x:-(s/2+35),y:i?20:10,transform:"rotate(-90)",fill:"black",textAnchor:"middle",alignmentBaseline:"middle",className:"ff-bar-chart-labels",fontWeight:600,children:C})]})})}),e("div",{className:"ff-chart-scrollable",children:n("svg",{width:Y,height:s+G+5+(v?20:0)+(f?20:0),children:[Array.isArray(u)&&u.length>0&&$(u),B.map((t,r)=>{const i=t.normalizedValue/Q*s,o=t.normalizedValue<1?2:i,l=r*(a+d)+p,c=s-o+G,u=w||20,f=l+a/2-u/2,C=c-u,m=H===t.label,g=D===r;return n("g",{children:[y[r]&&"string"==typeof y[r]&&e("g",{onMouseEnter:()=>te(t.label,"memory"===O?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ne(e),onMouseLeave:re,children:e(q,{name:String(y[r]),x:String(f),y:String(C),width:u,height:u,chartIcon:!0})}),e("rect",{x:l,y:c,width:a,height:o,fill:ee(r),rx:A,ry:A,style:{strokeWidth:m?3:0,opacity:null===D||g?1:.3,cursor:z?"pointer":"default",transition:"opacity 0.5s ease"},onMouseEnter:()=>te(t.label,"memory"===O||N?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ne(e),onMouseLeave:re,onClick:()=>ie(t.label,t)}),m&&z&&e("rect",{x:l,y:c,width:a,height:o,fill:"var(--select-chart-highlight-color)",rx:A,ry:A,onMouseEnter:()=>te(t.label,"memory"===O?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ne(e),onMouseLeave:re}),v&&e("text",{onMouseEnter:()=>ae(t.label),onMouseMove:e=>oe(e,t.label),onMouseLeave:re,x:l+a/2,textAnchor:"middle",y:s+G+15,className:"ff-bar-chart-labels",fill:m?"var(--brand-color)":"black",fontWeight:m?"bold":"normal",children:h?Hn(t.label,10):t.label})]},r)}),e("line",{x1:i?0:p,y1:s+G,x2:Y,y2:s+G,stroke:"#D9D9D9",strokeWidth:"1"}),!i&&f&&e("text",{x:Y/2,y:s+G+(v?40:20),fontSize:"12",fill:"black",textAnchor:"middle",className:"ff-bar-chart-labels",fontWeight:600,children:f})]})}),e("div",{className:"ff-bar-chart-x-axis-label",children:f})]}):e("div",{children:n("svg",{width:Y,height:s+G+5+(v?20:0)+(f?20:0),children:[Array.isArray(u)&&u.length>0&&$(u),Array.from({length:m+1}).map((t,n)=>{const r=s-n/m*s+G+4,i=n*Q/m,a="memory"===O?i.toFixed(1):L?`${i.toFixed(0).padStart(2,"0")}%`:i.toFixed(0).padStart(2,"0");return e("text",{x:K,y:r,fill:"black",textAnchor:"middle",className:"ff-bar-chart-labels",children:a},n)}),B.map((t,r)=>{const i=t.normalizedValue/Q*s,o=t.normalizedValue<1?2:i,l=r*(a+d)+K+p,c=s-o+G,u=w||20,f=l+a/2-u/2,C=c-u,m=H===t.label,g=D===r;return n("g",{children:[y[r]&&"string"==typeof y[r]&&e("g",{onMouseEnter:()=>te(t.label,"memory"===O?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ne(e),onMouseLeave:re,onClick:()=>ie(t.label,t),children:e(q,{name:String(y[r]),x:String(f),y:String(C),width:u,height:u,chartIcon:!0})}),e("rect",{x:l,y:c,width:a,height:o,fill:ee(r),rx:A,ry:A,style:{strokeWidth:m?3:0,opacity:null===D||g?1:.3,cursor:z?"pointer":"default",transition:"opacity 0.5s ease"},onMouseEnter:()=>te(t.label,"memory"===O||N?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ne(e),onMouseLeave:re,onClick:()=>ie(t.label,t)}),m&&z&&e("rect",{x:l,y:c,width:a,height:o,fill:"var(--select-chart-highlight-color)",rx:A,ry:A,onMouseEnter:()=>te(t.label,"memory"===O?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ne(e),onMouseLeave:re}),v&&e("g",{children:e("text",{x:l+a/2,textAnchor:"middle",y:s+G+15,className:"ff-bar-chart-labels",fill:m?"var(--brand-color)":"black",fontWeight:m?"bold":"normal",onMouseEnter:()=>ae(t.label),onMouseMove:e=>oe(e,t.label),onMouseLeave:re,children:h?Hn(t.label,10):t.label})})]},r)}),e("line",{x1:60,y1:s+G,x2:Y,y2:s+G,stroke:"#D9D9D9",strokeWidth:"1"}),f&&e("text",{x:Y/2,y:s+G+(v?40:20),fontSize:"12",fill:"black",textAnchor:"middle",className:"ff-bar-chart-labels",fontWeight:600,children:f}),C&&e("text",{x:-(s/2+35),y:10,transform:"rotate(-90)",fill:"black",textAnchor:"middle",alignmentBaseline:"middle",className:"ff-bar-chart-labels",fontWeight:600,children:C})]})}),g&&"bottom"===E&&e("div",{className:"ff-legend-container",children:e("div",{className:"ff-bar-chart-legend",style:{gap:`${b}px`},children:r.map((t,r)=>n("div",{className:"ff-bar-chart-legend-item",onMouseEnter:()=>F(r),onMouseLeave:()=>F(null),children:[y[r]&&"string"==typeof y[r]?e(q,{name:String(y[r]),width:w,height:w}):e("span",{className:"ff-bar-chart-legend-item-circle",style:{backgroundColor:u[r%u.length]?.[0]||"grey"}}),e("div",{children:e(U,{as:"div",fontSize:10,fontWeight:"regular",className:"ff-legend-label",children:t.label})})]},t.label))})})]})},Sx=({data:t,chartId:r,barWidth:i=24,height:a=250,barGap:o=40,barBorderRadius:l=0,xAxisLabel:s,yAxisLabel:c,yAxisDivisions:d=5,padding:u=20,legend:f=!0,legendPosition:h="bottom",showXAxisLabels:C=!0,isTruncateText:p=!0,isOnclick:m=!1,onSelectedBar:A,onSegmentClick:g})=>{const v=b(),y=r??v,w=40,E=Math.max(...t?.map(e=>e?.segments?.reduce((e,t)=>e+t?.value,0)),d),M=Array.from(new Set(t.flatMap(e=>e?.segments?.map(e=>e?.key)))),L={};t.forEach(e=>e?.segments.forEach(e=>{L[e.key]||(L[e.key]=e.color)}));const H=t.length>0?t.length*i+(t.length-1)*o:0,x=i+o,V=H+u+x,k=a+w+5+(C?20:0)+(s?20:0),S=k+(s?17:0),z=(e,t)=>{m&&A?.(e,t)},Z=(e,t,n)=>{g?.(e,t,n)},O=()=>e("div",{className:"ff-stacked-bar-legend",children:M.map(t=>n("div",{className:"ff-stacked-bar-legend-item",children:[e("span",{className:"ff-stacked-bar-legend-dot",style:{backgroundColor:L[t]}}),p?e(Ws,{className:"ff-stacked-bar-legend-label",placement:"top"===h?"bottom":"top",children:t}):e(U,{as:"span",className:"ff-stacked-bar-legend-label",fontSize:10,fontWeight:"regular",children:t})]},t))});return n("div",{className:"ff-stacked-bar-container",children:[f&&"top"===h&&O(),n("div",{className:"ff-stacked-bar-wrapper",style:{minHeight:S},children:[e("div",{className:"ff-stacked-bar-y-axis",children:n("svg",{width:60,height:k,children:[Array.from({length:d+1}).map((t,n)=>{const r=a-n/d*a+w+4,i=(n*E/d).toFixed(0).padStart(2,"0");return e("text",{x:50,y:r,textAnchor:"middle",className:"ff-stacked-bar-label",children:i},n)}),c&&e("text",{x:-(a/2+35),y:20,transform:"rotate(-90)",textAnchor:"middle",alignmentBaseline:"middle",className:"ff-stacked-bar-label ff-stacked-bar-y-axis-label",children:c})]})}),e("div",{className:"ff-stacked-bar-scrollable",children:n("svg",{width:V,height:k,style:{minWidth:V},children:[t?.map((t,r)=>{const s=t?.segments?.reduce((e,t)=>e+t.value,0),c=r*(i+o)+u;if(1===t?.segments?.length&&0===t?.segments?.[0]?.value){const o=t.segments[0],s=`zero-bar-tooltip-${y}-${o.uniqueId}`;return n("g",{onClick:()=>z(t,r),style:{cursor:m?"pointer":"default"},children:[e("rect",{x:c,y:a+w-2,width:i,height:2,fill:o.color,rx:l,ry:l}),n("foreignObject",{x:c,y:a+w-2,width:i,height:8,style:{overflow:"visible"},children:[e("div",{"data-tooltip-id":s,"data-tooltip-placement":"right",style:{width:i,height:8},onClick:()=>Z(t.label,o,0)}),n("div",{id:s,className:"ff-stacked-bar-tooltip-content",style:{display:"none"},children:[e(U,{as:"div",fontWeight:"semi-bold",children:t.label}),n("div",{className:"ff-stacked-bar-tooltip-row",children:[e(U,{fontWeight:"semi-bold",children:o.key}),n(U,{fontWeight:"semi-bold",children:[": ",o.value]})]})]})]}),C&&e("foreignObject",{x:c+i/2-x/2,y:a+w+5,width:x,height:20,className:"ff-stacked-bar-x-label-wrapper",children:e(Ws,{className:"ff-stacked-bar-x-label",children:t.label})})]},r)}let d=a+w;return n("g",{onClick:()=>z(t,r),style:{cursor:m?"pointer":"default"},children:[t?.segments?.map((r,o)=>{const u=s>0?r.value/E*a:0;d-=u;const f=o===t.segments.length-1,h=d,C=`stacked-bar-tooltip-${y}-${r?.uniqueId}-${o}`;return n("g",{children:[e("rect",{x:c,y:h,width:i,height:u,fill:r.color,rx:f?l:0,ry:f?l:0}),n("foreignObject",{x:c,y:h,width:i,height:u,children:[e("div",{"data-tooltip-id":C,"data-tooltip-placement":"right",style:{width:i,height:u},onClick:()=>Z(t?.label,r,o)}),n("div",{id:C,className:"ff-stacked-bar-tooltip-content",style:{display:"none"},children:[e(U,{as:"div",fontWeight:"semi-bold",children:t?.label}),n("div",{className:"ff-stacked-bar-tooltip-row",children:[e(U,{fontWeight:"semi-bold",children:r.key}),n(U,{fontWeight:"semi-bold",children:[": ",r.value]})]})]})]})]},`${r?.uniqueId}-${o}`)}),C&&e("foreignObject",{x:c+i/2-x/2,y:a+w+5,width:x,height:20,className:"ff-stacked-bar-x-label-wrapper",children:e(Ws,{className:"ff-stacked-bar-x-label",children:t?.label})})]},r)}),e("line",{x1:0,y1:a+w,x2:V,y2:a+w,stroke:"var(--ff-select-scroll-track-bg)",strokeWidth:"1"})]})}),s&&e(U,{as:"div",className:"ff-stacked-bar-label ff-stacked-bar-x-axis-label",fontWeight:"semi-bold",children:s})]}),f&&"bottom"===h&&O()]})},zx=(e,t,n,r,i)=>{const a=e+n*Math.cos(r),o=t+n*Math.sin(r),l=e+n*Math.cos(i),s=t+n*Math.sin(i);return`M ${a} ${o} A ${n} ${n} 0 ${i-r>Math.PI?1:0} 1 ${l} ${s}`},Zx=({radius:r,lineWidth:i,lineCap:a,barValues:o,labelHeading:l,legendType:s="numberLegend",isLegendDetails:d=!0,isPillValueVisible:u=!0,chartToLegendGap:f="16px",legendGap:h="8px",labelFontSize:C=12,subLabelFontSize:p=8,gapBetweenArch:m=10,capsuleStyle:A={padding:"4px"}})=>{const[g,v]=c({visible:!1,x:0,y:0,content:"",isArc:!1}),[y,w]=c(null),E=(e,t)=>Array.isArray(e.arcColor)?`url(#gradient-${t})`:e.arcColor,b=e=>Array.isArray(e.arcColor)?e.arcColor[0]:e.arcColor,M=o.map(e=>{if("string"==typeof e.value){const t=(e=>{if("string"!=typeof e)return e;{const t=e.trim().match(/^([\d.]+)\s*([a-zA-Z%]*)$/);if(!t)return 0;const n=parseFloat(t[1]??"0"),r=t[2]?.toUpperCase()||"";if(isNaN(n))return 0;switch(r){case"TB":return 1024*n*1024;case"GB":return 1024*n;case"MB":default:return n;case"KB":return n/1024}}})(e.value),n=isNaN(t)?0:t;return{...e,normalizedValue:n,labelValue:Number.isInteger(n)?n:n.toFixed(2)}}return{...e,normalizedValue:e.value,labelValue:Number.isInteger(e.value)?e.value:e.value?.toFixed(2)}}),L=M.reduce((e,t)=>e+t.normalizedValue,0),H=r,x=i+m,V=2*(H+x*(M.length-1)+i),k=[...M].reverse(),S=(e=>{const t=e.trim().replace(/\s+/g," "),n=t.match(/^(.*\D)\s+(\d+(?:\.\d+)?\s*[a-zA-Z%]+)$/);return n?[n[1]?.trim()??"",n[2]?.trim()??""].filter(Boolean):t.split(" ")})(l),z=(e,t,n)=>{const{clientX:r,clientY:i}=e;v({visible:!0,x:r,y:i,content:t,isArc:n})},Z=e=>{const{clientX:t,clientY:n}=e;v(e=>({...e,x:t,y:n}))},O=()=>{v({visible:!1,x:0,y:0,content:"",isArc:!1})},N=-18*(S.length-1)/2;return n("div",{className:"ff-multi-radial-chart-container "+("numberLegend"===s?"ff-multi-radial-chart-number":"ff-multi-radial-chart-pill"),style:{gap:f},children:[e("div",{className:"relative",style:{width:V,height:V},children:n("svg",{width:V,height:V,viewBox:`0 0 ${V} ${V}`,className:"absolute top-0 left-0",children:[e("defs",{children:o.map((t,n)=>Array.isArray(t.arcColor)?e("linearGradient",{id:`gradient-${n}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%",gradientTransform:"rotate(90)",children:t.arcColor.map((n,r)=>e("stop",{offset:r/(t.arcColor.length-1)*100+"%",stopColor:n},r))},`gradient-${n}`):null)}),n("g",{transform:`translate(${V/2+1}, ${V/2+1})`,children:[k.map((t,r)=>{const o=M.length-1-r,l=2*(t.normalizedValue/L)*Math.PI;let s=-Math.PI/2,c=s+l;t.normalizedValue===L&&(s=0,c=2*Math.PI);const d=H+x*o,u=zx(0,0,d,0,2*Math.PI),f={opacity:null!==y?t.barLabel===y?1:.2:1,transition:"opacity 0.3s ease"};if(0===t.normalizedValue){const r=d*Math.cos(-Math.PI/2),a=d*Math.sin(-Math.PI/2);return n("g",{children:[e("path",{d:u,fill:"none",stroke:t.arcBackgroundColor,strokeWidth:i,className:"transition-all duration-300",style:f}),e("circle",{cx:r,cy:a,r:i+1,fill:E({...t,label:t.barLabel||"",key:t.labelValue?.toString()||""},o),onMouseEnter:e=>z(e,`${t.barLabel||"Data"}: ${t.value}`,!0),onMouseMove:Z,onMouseLeave:O,style:f})]},o)}const h=zx(0,0,d,s,c);return n("g",{children:[e("path",{d:u,fill:"none",stroke:t.arcBackgroundColor,strokeWidth:i,className:"transition-all duration-300",style:f}),e("path",{d:h,fill:"none",stroke:E({...t,label:t.barLabel||"",key:t.labelValue?.toString()||""},o),strokeWidth:i,strokeLinecap:"square"===a?"butt":"round",onMouseEnter:e=>z(e,`${t.barLabel||"Data"}: ${t.value}`,!0),onMouseMove:Z,onMouseLeave:O,style:{pointerEvents:"stroke",...f}})]},o)}),e("text",{x:"0",y:g.visible?`-${i+m+2}`:N,fill:(()=>{if(!g.visible)return"";const e=g.content.split(":")[0]?.trim();if(void 0===e)return"";const t=M.find(t=>t.barLabel===e);if(!t)return"";const n={...t,label:t.barLabel,key:t.labelValue?.toString()??""};return b(n)})(),textAnchor:"middle",dominantBaseline:"central",children:g.visible?n(t,{children:[e("tspan",{x:"0",dy:"0",className:"ff-center-text-tooltip",children:(T=g.content.split(":")[1]?.trim()||"",I=9,T.length>I?T.slice(0,I)+"...":T)}),g.content.split(":")[0]?.split(" ").map((t,n)=>e("tspan",{x:"0",dy:0===n?`${i+m+5}`:18,className:"ff-center-text-tooltip",children:t},n))]}):e(t,{children:S.map((t,n)=>e("tspan",{x:"0",dy:0===n?0:18,className:0===n?"ff-center-first-text":"ff-center-text",style:{fontSize:`${0===n?C:p}px`},children:t},n))})})]})]})}),g.visible&&e("div",{className:"ff-multi-radial-tooltip",style:{position:"fixed",top:`${g.y+10}px`,left:`${g.x+15}px`,zIndex:1e3,pointerEvents:"none"},children:g.content}),d&&((t,r)=>{switch(r){case"numberLegend":return e("div",{className:"ff-legend-container ff-number-legend",style:{gap:h},children:t.map((t,r)=>n("div",{className:"ff-legend-item",onMouseEnter:e=>{w(t.barLabel||t.label),z(e,`${t.barLabel||"Data"}: ${t.value}`,!1)},onMouseMove:Z,onMouseLeave:()=>{w(null),O()},children:[e(U,{fontSize:20,fontWeight:"semi-bold",className:"ff-legend-value",color:b(t),children:t.key.padStart(2,"0")}),e(U,{fontSize:10,className:"ff-legend-key",color:"var(--text-color)",children:t.label})]},r))});case"pillLegend":return e("div",{className:"ff-legend-container ff-pill-legend",style:{gap:h},children:t.slice().reverse().map((t,r)=>n("div",{className:"ff-legend-item",onMouseEnter:e=>{w(t.barLabel||t.label),z(e,`${t.barLabel||"Data"}: ${t.value}`,!1)},onMouseMove:Z,onMouseLeave:()=>{w(null),O()},children:[e("span",{className:"ff-legend-capsule",style:{backgroundColor:b(t)},children:e(U,{fontSize:10,color:"var(--tooltip-text-color)",style:A,children:u&&t.value})}),e(U,{className:"ff-legend-key",children:t.label})]},r))});default:return null}})(M.map(e=>({...e,label:e?.barLabel,key:e.labelValue?.toString()})),s)]});var T,I};var Ox,Nx={exports:{}},Tx={},Ix={exports:{}},Dx={},Fx={};function Rx(){if(Ox)return Fx;function e(e){this.__parent=e,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}function t(e,t){this.__cache=[""],this.__indent_size=e.indent_size,this.__indent_string=e.indent_char,e.indent_with_tabs||(this.__indent_string=new Array(e.indent_size+1).join(e.indent_char)),t=t||"",e.indent_level>0&&(t=new Array(e.indent_level+1).join(this.__indent_string)),this.__base_string=t,this.__base_string_length=t.length}function n(n,r){this.__indent_cache=new t(n,r),this.raw=!1,this._end_with_newline=n.end_with_newline,this.indent_size=n.indent_size,this.wrap_line_length=n.wrap_line_length,this.indent_empty_lines=n.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new e(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}return Ox=1,e.prototype.clone_empty=function(){var t=new e(this.__parent);return t.set_indent(this.__indent_count,this.__alignment_count),t},e.prototype.item=function(e){return e<0?this.__items[this.__items.length+e]:this.__items[e]},e.prototype.has_match=function(e){for(var t=this.__items.length-1;t>=0;t--)if(this.__items[t].match(e))return!0;return!1},e.prototype.set_indent=function(e,t){this.is_empty()&&(this.__indent_count=e||0,this.__alignment_count=t||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},e.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},e.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},e.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var e=this.__parent.current_line;return e.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),e.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),e.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===e.__items[0]&&(e.__items.splice(0,1),e.__character_count-=1),!0}return!1},e.prototype.is_empty=function(){return 0===this.__items.length},e.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},e.prototype.push=function(e){this.__items.push(e);var t=e.lastIndexOf("\n");-1!==t?this.__character_count=e.length-t:this.__character_count+=e.length},e.prototype.pop=function(){var e=null;return this.is_empty()||(e=this.__items.pop(),this.__character_count-=e.length),e},e.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},e.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},e.prototype.trim=function(){for(;" "===this.last();)this.__items.pop(),this.__character_count-=1},e.prototype.toString=function(){var e="";return this.is_empty()?this.__parent.indent_empty_lines&&(e=this.__parent.get_indent_string(this.__indent_count)):(e=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),e+=this.__items.join("")),e},t.prototype.get_indent_size=function(e,t){var n=this.__base_string_length;return t=t||0,e<0&&(n=0),n+=e*this.__indent_size,n+=t},t.prototype.get_indent_string=function(e,t){var n=this.__base_string;return t=t||0,e<0&&(e=0,n=""),t+=e*this.__indent_size,this.__ensure_cache(t),n+=this.__cache[t]},t.prototype.__ensure_cache=function(e){for(;e>=this.__cache.length;)this.__add_column()},t.prototype.__add_column=function(){var e=this.__cache.length,t=0,n="";this.__indent_size&&e>=this.__indent_size&&(e-=(t=Math.floor(e/this.__indent_size))*this.__indent_size,n=new Array(t+1).join(this.__indent_string)),e&&(n+=new Array(e+1).join(" ")),this.__cache.push(n)},n.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},n.prototype.get_line_number=function(){return this.__lines.length},n.prototype.get_indent_string=function(e,t){return this.__indent_cache.get_indent_string(e,t)},n.prototype.get_indent_size=function(e,t){return this.__indent_cache.get_indent_size(e,t)},n.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},n.prototype.add_new_line=function(e){return!(this.is_empty()||!e&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},n.prototype.get_code=function(e){this.trim(!0);var t=this.current_line.pop();t&&("\n"===t[t.length-1]&&(t=t.replace(/\n+$/g,"")),this.current_line.push(t)),this._end_with_newline&&this.__add_outputline();var n=this.__lines.join("\n");return"\n"!==e&&(n=n.replace(/[\n]/g,e)),n},n.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},n.prototype.set_indent=function(e,t){return e=e||0,t=t||0,this.next_line.set_indent(e,t),this.__lines.length>1?(this.current_line.set_indent(e,t),!0):(this.current_line.set_indent(),!1)},n.prototype.add_raw_token=function(e){for(var t=0;t<e.newlines;t++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(e.whitespace_before),this.current_line.push(e.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},n.prototype.add_token=function(e){this.__add_space_before_token(),this.current_line.push(e),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},n.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},n.prototype.remove_indent=function(e){for(var t=this.__lines.length;e<t;)this.__lines[e]._remove_indent(),e++;this.current_line._remove_wrap_indent()},n.prototype.trim=function(e){for(e=void 0!==e&&e,this.current_line.trim();e&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},n.prototype.just_added_newline=function(){return this.current_line.is_empty()},n.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},n.prototype.ensure_empty_line_above=function(t,n){for(var r=this.__lines.length-2;r>=0;){var i=this.__lines[r];if(i.is_empty())break;if(0!==i.item(0).indexOf(t)&&i.item(-1)!==n){this.__lines.splice(r+1,0,new e(this)),this.previous_line=this.__lines[this.__lines.length-2];break}r--}},Fx.Output=n,Fx}var Px,jx={};function Bx(){if(Px)return jx;return Px=1,jx.Token=function(e,t,n,r){this.type=e,this.text=t,this.comments_before=null,this.newlines=n||0,this.whitespace_before=r||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null},jx}var _x,qx={};function Ux(){return _x||(_x=1,function(e){var t="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",n="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",r="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",i="\\\\u[0-9a-fA-F]{4}|\\\\u\\{[0-9a-fA-F]+\\}",a="(?:"+i+"|[\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a"+n+"])",o="(?:"+i+"|["+t+n+r+"])*";e.identifier=new RegExp(a+o,"g"),e.identifierStart=new RegExp(a),e.identifierMatch=new RegExp("(?:"+i+"|["+t+n+r+"])+"),e.newline=/[\n\r\u2028\u2029]/,e.lineBreak=new RegExp("\r\n|"+e.newline.source),e.allLineBreaks=new RegExp(e.lineBreak.source,"g")}(qx)),qx}var Wx,Xx,Qx={},Gx={};function Kx(){if(Wx)return Gx;function e(e,n){this.raw_options=t(e,n),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs","\t"===this.indent_char),this.indent_with_tabs&&(this.indent_char="\t",1===this.indent_size&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}function t(e,t){var r,i={};for(r in e=n(e))r!==t&&(i[r]=e[r]);if(t&&e[t])for(r in e[t])i[r]=e[t][r];return i}function n(e){var t,n={};for(t in e){n[t.replace(/-/g,"_")]=e[t]}return n}return Wx=1,e.prototype._get_array=function(e,t){var n=this.raw_options[e],r=t||[];return"object"==typeof n?null!==n&&"function"==typeof n.concat&&(r=n.concat()):"string"==typeof n&&(r=n.split(/[^a-zA-Z0-9_\/\-]+/)),r},e.prototype._get_boolean=function(e,t){var n=this.raw_options[e];return void 0===n?!!t:!!n},e.prototype._get_characters=function(e,t){var n=this.raw_options[e],r=t||"";return"string"==typeof n&&(r=n.replace(/\\r/,"\r").replace(/\\n/,"\n").replace(/\\t/,"\t")),r},e.prototype._get_number=function(e,t){var n=this.raw_options[e];t=parseInt(t,10),isNaN(t)&&(t=0);var r=parseInt(n,10);return isNaN(r)&&(r=t),r},e.prototype._get_selection=function(e,t,n){var r=this._get_selection_list(e,t,n);if(1!==r.length)throw new Error("Invalid Option Value: The option '"+e+"' can only be one of the following values:\n"+t+"\nYou passed in: '"+this.raw_options[e]+"'");return r[0]},e.prototype._get_selection_list=function(e,t,n){if(!t||0===t.length)throw new Error("Selection list cannot be empty.");if(n=n||[t[0]],!this._is_valid_selection(n,t))throw new Error("Invalid Default Value!");var r=this._get_array(e,n);if(!this._is_valid_selection(r,t))throw new Error("Invalid Option Value: The option '"+e+"' can contain only the following values:\n"+t+"\nYou passed in: '"+this.raw_options[e]+"'");return r},e.prototype._is_valid_selection=function(e,t){return e.length&&t.length&&!e.some(function(e){return-1===t.indexOf(e)})},Gx.Options=e,Gx.normalizeOpts=n,Gx.mergeOpts=t,Gx}function Yx(){if(Xx)return Qx;Xx=1;var e=Kx().Options,t=["before-newline","after-newline","preserve-newline"];function n(n){e.call(this,n,"js");var r=this.raw_options.brace_style||null;"expand-strict"===r?this.raw_options.brace_style="expand":"collapse-preserve-inline"===r?this.raw_options.brace_style="collapse,preserve-inline":void 0!==this.raw_options.braces_on_own_line&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var i=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var a=0;a<i.length;a++)"preserve-inline"===i[a]?this.brace_preserve_inline=!0:this.brace_style=i[a];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",t),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}return n.prototype=new e,Qx.Options=n,Qx}var Jx,$x={},eV={};function tV(){if(Jx)return eV;Jx=1;var e=RegExp.prototype.hasOwnProperty("sticky");function t(e){this.__input=e||"",this.__input_length=this.__input.length,this.__position=0}return t.prototype.restart=function(){this.__position=0},t.prototype.back=function(){this.__position>0&&(this.__position-=1)},t.prototype.hasNext=function(){return this.__position<this.__input_length},t.prototype.next=function(){var e=null;return this.hasNext()&&(e=this.__input.charAt(this.__position),this.__position+=1),e},t.prototype.peek=function(e){var t=null;return e=e||0,(e+=this.__position)>=0&&e<this.__input_length&&(t=this.__input.charAt(e)),t},t.prototype.__match=function(t,n){t.lastIndex=n;var r=t.exec(this.__input);return!r||e&&t.sticky||r.index!==n&&(r=null),r},t.prototype.test=function(e,t){return t=t||0,(t+=this.__position)>=0&&t<this.__input_length&&!!this.__match(e,t)},t.prototype.testChar=function(e,t){var n=this.peek(t);return e.lastIndex=0,null!==n&&e.test(n)},t.prototype.match=function(e){var t=this.__match(e,this.__position);return t?this.__position+=t[0].length:t=null,t},t.prototype.read=function(e,t,n){var r,i="";return e&&(r=this.match(e))&&(i+=r[0]),!t||!r&&e||(i+=this.readUntil(t,n)),i},t.prototype.readUntil=function(e,t){var n,r=this.__position;e.lastIndex=this.__position;var i=e.exec(this.__input);return i?(r=i.index,t&&(r+=i[0].length)):r=this.__input_length,n=this.__input.substring(this.__position,r),this.__position=r,n},t.prototype.readUntilAfter=function(e){return this.readUntil(e,!0)},t.prototype.get_regexp=function(t,n){var r=null,i="g";return n&&e&&(i="y"),"string"==typeof t&&""!==t?r=new RegExp(t,i):t&&(r=new RegExp(t.source,i)),r},t.prototype.get_literal_regexp=function(e){return RegExp(e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},t.prototype.peekUntilAfter=function(e){var t=this.__position,n=this.readUntilAfter(e);return this.__position=t,n},t.prototype.lookBack=function(e){var t=this.__position-1;return t>=e.length&&this.__input.substring(t-e.length,t).toLowerCase()===e},eV.InputScanner=t,eV}var nV,rV={},iV={};var aV,oV,lV,sV={},cV={};function dV(){if(aV)return cV;function e(e,t){this._input=e,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,t&&(this._starting_pattern=this._input.get_regexp(t._starting_pattern,!0),this._match_pattern=this._input.get_regexp(t._match_pattern,!0),this._until_pattern=this._input.get_regexp(t._until_pattern),this._until_after=t._until_after)}return aV=1,e.prototype.read=function(){var e=this._input.read(this._starting_pattern);return this._starting_pattern&&!e||(e+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),e},e.prototype.read_match=function(){return this._input.match(this._match_pattern)},e.prototype.until_after=function(e){var t=this._create();return t._until_after=!0,t._until_pattern=this._input.get_regexp(e),t._update(),t},e.prototype.until=function(e){var t=this._create();return t._until_after=!1,t._until_pattern=this._input.get_regexp(e),t._update(),t},e.prototype.starting_with=function(e){var t=this._create();return t._starting_pattern=this._input.get_regexp(e,!0),t._update(),t},e.prototype.matching=function(e){var t=this._create();return t._match_pattern=this._input.get_regexp(e,!0),t._update(),t},e.prototype._create=function(){return new e(this._input,this)},e.prototype._update=function(){},cV.Pattern=e,cV}function uV(){if(lV)return rV;lV=1;var e=tV().InputScanner,t=Bx().Token,n=function(){if(nV)return iV;function e(e){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=e}return nV=1,e.prototype.restart=function(){this.__position=0},e.prototype.isEmpty=function(){return 0===this.__tokens_length},e.prototype.hasNext=function(){return this.__position<this.__tokens_length},e.prototype.next=function(){var e=null;return this.hasNext()&&(e=this.__tokens[this.__position],this.__position+=1),e},e.prototype.peek=function(e){var t=null;return e=e||0,(e+=this.__position)>=0&&e<this.__tokens_length&&(t=this.__tokens[e]),t},e.prototype.add=function(e){this.__parent_token&&(e.parent=this.__parent_token),this.__tokens.push(e),this.__tokens_length+=1},iV.TokenStream=e,iV}().TokenStream,r=function(){if(oV)return sV;oV=1;var e=dV().Pattern;function t(t,n){e.call(this,t,n),n?this._line_regexp=this._input.get_regexp(n._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}return t.prototype=new e,t.prototype.__set_whitespace_patterns=function(e,t){e+="\\t ",t+="\\n\\r",this._match_pattern=this._input.get_regexp("["+e+t+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+t+"]")},t.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var e=this._input.read(this._match_pattern);if(" "===e)this.whitespace_before_token=" ";else if(e){var t=this.__split(this._newline_regexp,e);this.newline_count=t.length-1,this.whitespace_before_token=t[this.newline_count]}return e},t.prototype.matching=function(e,t){var n=this._create();return n.__set_whitespace_patterns(e,t),n._update(),n},t.prototype._create=function(){return new t(this._input,this)},t.prototype.__split=function(e,t){e.lastIndex=0;for(var n=0,r=[],i=e.exec(t);i;)r.push(t.substring(n,i.index)),n=i.index+i[0].length,i=e.exec(t);return n<t.length?r.push(t.substring(n,t.length)):r.push(""),r},sV.WhitespacePattern=t,sV}().WhitespacePattern,i={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},a=function(t,n){this._input=new e(t),this._options=n||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new r(this._input)};return a.prototype.tokenize=function(){var e;this._input.restart(),this.__tokens=new n,this._reset();for(var r=new t(i.START,""),a=null,o=[],l=new n;r.type!==i.EOF;){for(e=this._get_next_token(r,a);this._is_comment(e);)l.add(e),e=this._get_next_token(r,a);l.isEmpty()||(e.comments_before=l,l=new n),e.parent=a,this._is_opening(e)?(o.push(a),a=e):a&&this._is_closing(e,a)&&(e.opened=a,a.closed=e,a=o.pop(),e.parent=a),e.previous=r,r.next=e,this.__tokens.add(e),r=e}return this.__tokens},a.prototype._is_first_token=function(){return this.__tokens.isEmpty()},a.prototype._reset=function(){},a.prototype._get_next_token=function(e,t){this._readWhitespace();var n=this._input.read(/.+/g);return n?this._create_token(i.RAW,n):this._create_token(i.EOF,"")},a.prototype._is_comment=function(e){return!1},a.prototype._is_opening=function(e){return!1},a.prototype._is_closing=function(e,t){return!1},a.prototype._create_token=function(e,n){return new t(e,n,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token)},a.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},rV.Tokenizer=a,rV.TOKEN=i,rV}var fV,hV={};function CV(){if(fV)return hV;function e(e,t){e="string"==typeof e?e:e.source,t="string"==typeof t?t:t.source,this.__directives_block_pattern=new RegExp(e+/ beautify( \w+[:]\w+)+ /.source+t,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(e+/\sbeautify\signore:end\s/.source+t,"g")}return fV=1,e.prototype.get_directives=function(e){if(!e.match(this.__directives_block_pattern))return null;var t={};this.__directive_pattern.lastIndex=0;for(var n=this.__directive_pattern.exec(e);n;)t[n[1]]=n[2],n=this.__directive_pattern.exec(e);return t},e.prototype.readIgnored=function(e){return e.readUntilAfter(this.__directives_end_ignore_pattern)},hV.Directives=e,hV}var pV,mV,AV,gV,vV={};function yV(){if(pV)return vV;pV=1;var e=dV().Pattern,t={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function n(n,r){e.call(this,n,r),this.__template_pattern=null,this._disabled=Object.assign({},t),this._excluded=Object.assign({},t),r&&(this.__template_pattern=this._input.get_regexp(r.__template_pattern),this._excluded=Object.assign(this._excluded,r._excluded),this._disabled=Object.assign(this._disabled,r._disabled));var i=new e(n);this.__patterns={handlebars_comment:i.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:i.starting_with(/{{{/).until_after(/}}}/),handlebars:i.starting_with(/{{/).until_after(/}}/),php:i.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:i.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:i.starting_with(/{%/).until_after(/%}/),django_value:i.starting_with(/{{/).until_after(/}}/),django_comment:i.starting_with(/{#/).until_after(/#}/),smarty:i.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:i.starting_with(/{\*/).until_after(/\*}/),smarty_literal:i.starting_with(/{literal}/).until_after(/{\/literal}/)}}return n.prototype=new e,n.prototype._create=function(){return new n(this._input,this)},n.prototype._update=function(){this.__set_templated_pattern()},n.prototype.disable=function(e){var t=this._create();return t._disabled[e]=!0,t._update(),t},n.prototype.read_options=function(e){var n=this._create();for(var r in t)n._disabled[r]=-1===e.templating.indexOf(r);return n._update(),n},n.prototype.exclude=function(e){var t=this._create();return t._excluded[e]=!0,t._update(),t},n.prototype.read=function(){var e="";e=this._match_pattern?this._input.read(this._starting_pattern):this._input.read(this._starting_pattern,this.__template_pattern);for(var t=this._read_template();t;)this._match_pattern?t+=this._input.read(this._match_pattern):t+=this._input.readUntil(this.__template_pattern),e+=t,t=this._read_template();return this._until_after&&(e+=this._input.readUntilAfter(this._until_pattern)),e},n.prototype.__set_templated_pattern=function(){var e=[];this._disabled.php||e.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||e.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||e.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||e.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(e.push(this.__patterns.django._starting_pattern.source),e.push(this.__patterns.django_value._starting_pattern.source),e.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||e.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&e.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+e.join("|")+")")},n.prototype._read_template=function(){var e="",t=this._input.peek();if("<"===t){var n=this._input.peek(1);this._disabled.php||this._excluded.php||"?"!==n||(e=e||this.__patterns.php.read()),this._disabled.erb||this._excluded.erb||"%"!==n||(e=e||this.__patterns.erb.read())}else"{"===t&&(this._disabled.handlebars||this._excluded.handlebars||(e=(e=(e=e||this.__patterns.handlebars_comment.read())||this.__patterns.handlebars_unescaped.read())||this.__patterns.handlebars.read()),this._disabled.django||(this._excluded.django||this._excluded.handlebars||(e=e||this.__patterns.django_value.read()),this._excluded.django||(e=(e=e||this.__patterns.django_comment.read())||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(e=(e=(e=e||this.__patterns.smarty_comment.read())||this.__patterns.smarty_literal.read())||this.__patterns.smarty.read()));return e},vV.TemplatablePattern=n,vV}function wV(){if(mV)return $x;mV=1;var e=tV().InputScanner,t=uV().Tokenizer,n=uV().TOKEN,r=CV().Directives,i=Ux(),a=dV().Pattern,o=yV().TemplatablePattern;function l(e,t){return-1!==t.indexOf(e)}var s={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:n.START,RAW:n.RAW,EOF:n.EOF},c=new r(/\/\*/,/\*\//),d=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,u=/[0-9]/,f=/[^\d\.]/,h=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),C=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";C=(C="\\?\\.(?!\\d) "+(C=C.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"))).replace(/ /g,"|");var p,m=new RegExp(C),A="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),g=A.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),v=new RegExp("^(?:"+g.join("|")+")$"),y=function(e,n){t.call(this,e,n),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var r=new a(this._input),l=new o(this._input).read_options(this._options);this.__patterns={template:l,identifier:l.starting_with(i.identifier).matching(i.identifierMatch),number:r.matching(d),punct:r.matching(m),comment:r.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:r.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:r.matching(/<!--/),html_comment_end:r.matching(/-->/),include:r.starting_with(/#include/).until_after(i.lineBreak),shebang:r.starting_with(/#!/).until_after(i.lineBreak),xml:r.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:l.until(/['\\\n\r\u2028\u2029]/),double_quote:l.until(/["\\\n\r\u2028\u2029]/),template_text:l.until(/[`\\$]/),template_expression:l.until(/[`}\\]/)}};return(y.prototype=new t)._is_comment=function(e){return e.type===s.COMMENT||e.type===s.BLOCK_COMMENT||e.type===s.UNKNOWN},y.prototype._is_opening=function(e){return e.type===s.START_BLOCK||e.type===s.START_EXPR},y.prototype._is_closing=function(e,t){return(e.type===s.END_BLOCK||e.type===s.END_EXPR)&&t&&("]"===e.text&&"["===t.text||")"===e.text&&"("===t.text||"}"===e.text&&"{"===t.text)},y.prototype._reset=function(){p=!1},y.prototype._get_next_token=function(e,t){var n=null;this._readWhitespace();var r=this._input.peek();return null===r?this._create_token(s.EOF,""):n=(n=(n=(n=(n=(n=(n=(n=(n=(n=n||this._read_non_javascript(r))||this._read_string(r))||this._read_pair(r,this._input.peek(1)))||this._read_word(e))||this._read_singles(r))||this._read_comment(r))||this._read_regexp(r,e))||this._read_xml(r,e))||this._read_punctuation())||this._create_token(s.UNKNOWN,this._input.next())},y.prototype._read_word=function(e){var t;return""!==(t=this.__patterns.identifier.read())?(t=t.replace(i.allLineBreaks,"\n"),e.type!==s.DOT&&(e.type!==s.RESERVED||"set"!==e.text&&"get"!==e.text)&&v.test(t)?"in"!==t&&"of"!==t||e.type!==s.WORD&&e.type!==s.STRING?this._create_token(s.RESERVED,t):this._create_token(s.OPERATOR,t):this._create_token(s.WORD,t)):""!==(t=this.__patterns.number.read())?this._create_token(s.WORD,t):void 0},y.prototype._read_singles=function(e){var t=null;return"("===e||"["===e?t=this._create_token(s.START_EXPR,e):")"===e||"]"===e?t=this._create_token(s.END_EXPR,e):"{"===e?t=this._create_token(s.START_BLOCK,e):"}"===e?t=this._create_token(s.END_BLOCK,e):";"===e?t=this._create_token(s.SEMICOLON,e):"."===e&&f.test(this._input.peek(1))?t=this._create_token(s.DOT,e):","===e&&(t=this._create_token(s.COMMA,e)),t&&this._input.next(),t},y.prototype._read_pair=function(e,t){var n=null;return"#"===e&&"{"===t&&(n=this._create_token(s.START_BLOCK,e+t)),n&&(this._input.next(),this._input.next()),n},y.prototype._read_punctuation=function(){var e=this.__patterns.punct.read();if(""!==e)return"="===e?this._create_token(s.EQUALS,e):"?."===e?this._create_token(s.DOT,e):this._create_token(s.OPERATOR,e)},y.prototype._read_non_javascript=function(e){var t="";if("#"===e){if(this._is_first_token()&&(t=this.__patterns.shebang.read()))return this._create_token(s.UNKNOWN,t.trim()+"\n");if(t=this.__patterns.include.read())return this._create_token(s.UNKNOWN,t.trim()+"\n");e=this._input.next();var n="#";if(this._input.hasNext()&&this._input.testChar(u)){do{n+=e=this._input.next()}while(this._input.hasNext()&&"#"!==e&&"="!==e);return"#"===e||("["===this._input.peek()&&"]"===this._input.peek(1)?(n+="[]",this._input.next(),this._input.next()):"{"===this._input.peek()&&"}"===this._input.peek(1)&&(n+="{}",this._input.next(),this._input.next())),this._create_token(s.WORD,n)}this._input.back()}else if("<"===e&&this._is_first_token()){if(t=this.__patterns.html_comment_start.read()){for(;this._input.hasNext()&&!this._input.testChar(i.newline);)t+=this._input.next();return p=!0,this._create_token(s.COMMENT,t)}}else if(p&&"-"===e&&(t=this.__patterns.html_comment_end.read()))return p=!1,this._create_token(s.COMMENT,t);return null},y.prototype._read_comment=function(e){var t=null;if("/"===e){var n="";if("*"===this._input.peek(1)){n=this.__patterns.block_comment.read();var r=c.get_directives(n);r&&"start"===r.ignore&&(n+=c.readIgnored(this._input)),n=n.replace(i.allLineBreaks,"\n"),(t=this._create_token(s.BLOCK_COMMENT,n)).directives=r}else"/"===this._input.peek(1)&&(n=this.__patterns.comment.read(),t=this._create_token(s.COMMENT,n))}return t},y.prototype._read_string=function(t){if("`"===t||"'"===t||'"'===t){var n=this._input.next();return this.has_char_escapes=!1,n+="`"===t?this._read_string_recursive("`",!0,"${"):this._read_string_recursive(t),this.has_char_escapes&&this._options.unescape_strings&&(n=function(t){var n="",r=0,i=new e(t),a=null;for(;i.hasNext();)if((a=i.match(/([\s]|[^\\]|\\\\)+/g))&&(n+=a[0]),"\\"===i.peek()){if(i.next(),"x"===i.peek())a=i.match(/x([0-9A-Fa-f]{2})/g);else{if("u"!==i.peek()){n+="\\",i.hasNext()&&(n+=i.next());continue}(a=i.match(/u([0-9A-Fa-f]{4})/g))||(a=i.match(/u\{([0-9A-Fa-f]+)\}/g))}if(!a)return t;if((r=parseInt(a[1],16))>126&&r<=255&&0===a[0].indexOf("x"))return t;n+=r>=0&&r<32||r>1114111?"\\"+a[0]:34===r||39===r||92===r?"\\"+String.fromCharCode(r):String.fromCharCode(r)}return n}(n)),this._input.peek()===t&&(n+=this._input.next()),n=n.replace(i.allLineBreaks,"\n"),this._create_token(s.STRING,n)}return null},y.prototype._allow_regexp_or_xml=function(e){return e.type===s.RESERVED&&l(e.text,["return","case","throw","else","do","typeof","yield"])||e.type===s.END_EXPR&&")"===e.text&&e.opened.previous.type===s.RESERVED&&l(e.opened.previous.text,["if","while","for"])||l(e.type,[s.COMMENT,s.START_EXPR,s.START_BLOCK,s.START,s.END_BLOCK,s.OPERATOR,s.EQUALS,s.EOF,s.SEMICOLON,s.COMMA])},y.prototype._read_regexp=function(e,t){if("/"===e&&this._allow_regexp_or_xml(t)){for(var n=this._input.next(),r=!1,a=!1;this._input.hasNext()&&(r||a||this._input.peek()!==e)&&!this._input.testChar(i.newline);)n+=this._input.peek(),r?r=!1:(r="\\"===this._input.peek(),"["===this._input.peek()?a=!0:"]"===this._input.peek()&&(a=!1)),this._input.next();return this._input.peek()===e&&(n+=this._input.next(),n+=this._input.read(i.identifier)),this._create_token(s.STRING,n)}return null},y.prototype._read_xml=function(e,t){if(this._options.e4x&&"<"===e&&this._allow_regexp_or_xml(t)){var n="",r=this.__patterns.xml.read_match();if(r){for(var a=r[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),o=0===a.indexOf("{"),l=0;r;){var c=!!r[1],d=r[2];if(!(!!r[r.length-1]||"![CDATA["===d.slice(0,8))&&(d===a||o&&d.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(c?--l:++l),n+=r[0],l<=0)break;r=this.__patterns.xml.read_match()}return r||(n+=this._input.match(/[\s\S]*/g)[0]),n=n.replace(i.allLineBreaks,"\n"),this._create_token(s.STRING,n)}}return null},y.prototype._read_string_recursive=function(e,t,n){var r,a;"'"===e?a=this.__patterns.single_quote:'"'===e?a=this.__patterns.double_quote:"`"===e?a=this.__patterns.template_text:"}"===e&&(a=this.__patterns.template_expression);for(var o=a.read(),l="";this._input.hasNext();){if((l=this._input.next())===e||!t&&i.newline.test(l)){this._input.back();break}"\\"===l&&this._input.hasNext()?("x"===(r=this._input.peek())||"u"===r?this.has_char_escapes=!0:"\r"===r&&"\n"===this._input.peek(1)&&this._input.next(),l+=this._input.next()):n&&("${"===n&&"$"===l&&"{"===this._input.peek()&&(l+=this._input.next()),n===l&&(l+="`"===e?this._read_string_recursive("}",t,"`"):this._read_string_recursive("`",t,"${"),this._input.hasNext()&&(l+=this._input.next()))),o+=l+=a.read()}return o},$x.Tokenizer=y,$x.TOKEN=s,$x.positionable_operators=h.slice(),$x.line_starters=A.slice(),$x}function EV(){if(AV)return Dx;AV=1;var e=Rx().Output,t=Bx().Token,n=Ux(),r=Yx().Options,i=wV().Tokenizer,a=wV().line_starters,o=wV().positionable_operators,l=wV().TOKEN;function s(e,t){return-1!==t.indexOf(e)}function c(e){return e.replace(/^\s+/g,"")}function d(e,t){return e&&e.type===l.RESERVED&&e.text===t}function u(e,t){return e&&e.type===l.RESERVED&&s(e.text,t)}var f=["case","return","do","if","throw","else","await","break","continue","async"],h=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].replace(/-/g,"_")]=e[n];return t}(["before-newline","after-newline","preserve-newline"]),C=[h.before_newline,h.preserve_newline],p="BlockStatement",m="Statement",A="ObjectLiteral",g="ArrayLiteral",v="ForInitializer",y="Conditional",w="Expression";function E(e,t){t.multiline_frame||t.mode===v||t.mode===y||e.remove_indent(t.start_line_index)}function b(e){return e===g}function M(e){return s(e,[w,v,y])}function L(e,t){t=t||{},this._source_text=e||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new r(t)}L.prototype.create_flags=function(e,n){var r=0;return e&&(r=e.indentation_level,!this._output.just_added_newline()&&e.line_indent_level>r&&(r=e.line_indent_level)),{mode:n,parent:e,last_token:e?e.last_token:new t(l.START_BLOCK,""),last_word:e?e.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:r,alignment:0,line_indent_level:e?e.line_indent_level:r,start_line_index:this._output.get_line_number(),ternary_depth:0}},L.prototype._reset=function(t){var n=t.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new e(this._options,n),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(p);var r=new i(t,this._options);return this._tokens=r.tokenize(),t},L.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var e=this._reset(this._source_text),t=this._options.eol;"auto"===this._options.eol&&(t="\n",e&&n.lineBreak.test(e||"")&&(t=e.match(n.lineBreak)[0]));for(var r=this._tokens.next();r;)this.handle_token(r),this._last_last_text=this._flags.last_token.text,this._flags.last_token=r,r=this._tokens.next();return this._output.get_code(t)},L.prototype.handle_token=function(e,t){e.type===l.START_EXPR?this.handle_start_expr(e):e.type===l.END_EXPR?this.handle_end_expr(e):e.type===l.START_BLOCK?this.handle_start_block(e):e.type===l.END_BLOCK?this.handle_end_block(e):e.type===l.WORD||e.type===l.RESERVED?this.handle_word(e):e.type===l.SEMICOLON?this.handle_semicolon(e):e.type===l.STRING?this.handle_string(e):e.type===l.EQUALS?this.handle_equals(e):e.type===l.OPERATOR?this.handle_operator(e):e.type===l.COMMA?this.handle_comma(e):e.type===l.BLOCK_COMMENT?this.handle_block_comment(e,t):e.type===l.COMMENT?this.handle_comment(e,t):e.type===l.DOT?this.handle_dot(e):e.type===l.EOF?this.handle_eof(e):(e.type,l.UNKNOWN,this.handle_unknown(e,t))},L.prototype.handle_whitespace_and_comments=function(e,t){var n=e.newlines,r=this._options.keep_array_indentation&&b(this._flags.mode);if(e.comments_before)for(var i=e.comments_before.next();i;)this.handle_whitespace_and_comments(i,t),this.handle_token(i,t),i=e.comments_before.next();if(r)for(var a=0;a<n;a+=1)this.print_newline(a>0,t);else if(this._options.max_preserve_newlines&&n>this._options.max_preserve_newlines&&(n=this._options.max_preserve_newlines),this._options.preserve_newlines&&n>1){this.print_newline(!1,t);for(var o=1;o<n;o+=1)this.print_newline(!0,t)}};var H=["async","break","continue","return","throw","yield"];return L.prototype.allow_wrap_or_preserved_newline=function(e,t){if(t=void 0!==t&&t,!this._output.just_added_newline()){var n=this._options.preserve_newlines&&e.newlines||t;if(s(this._flags.last_token.text,o)||s(e.text,o)){var r=s(this._flags.last_token.text,o)&&s(this._options.operator_position,C)||s(e.text,o);n=n&&r}if(n)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(u(this._flags.last_token,H))return;this._output.set_wrap_point()}}},L.prototype.print_newline=function(e,t){if(!t&&";"!==this._flags.last_token.text&&","!==this._flags.last_token.text&&"="!==this._flags.last_token.text&&(this._flags.last_token.type!==l.OPERATOR||"--"===this._flags.last_token.text||"++"===this._flags.last_token.text))for(var n=this._tokens.peek();!(this._flags.mode!==m||this._flags.if_block&&d(n,"else")||this._flags.do_block);)this.restore_mode();this._output.add_new_line(e)&&(this._flags.multiline_frame=!0)},L.prototype.print_token_line_indentation=function(e){this._output.just_added_newline()&&(this._options.keep_array_indentation&&e.newlines&&("["===e.text||b(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(e.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},L.prototype.print_token=function(e){if(this._output.raw)this._output.add_raw_token(e);else{if(this._options.comma_first&&e.previous&&e.previous.type===l.COMMA&&this._output.just_added_newline()&&","===this._output.previous_line.last()){var t=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(t),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(e),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(e),this._output.non_breaking_space=!0,this._output.add_token(e.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)}},L.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},L.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},L.prototype.set_mode=function(e){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,e),this._flags=this.create_flags(this._previous_flags,e),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},L.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===m&&E(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},L.prototype.start_of_object_property=function(){return this._flags.parent.mode===A&&this._flags.mode===m&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||u(this._flags.last_token,["get","set"]))},L.prototype.start_of_statement=function(e){var t=!1;return!!(t=(t=(t=(t=(t=(t=(t=t||u(this._flags.last_token,["var","let","const"])&&e.type===l.WORD)||d(this._flags.last_token,"do"))||!(this._flags.parent.mode===A&&this._flags.mode===m)&&u(this._flags.last_token,H)&&!e.newlines)||d(this._flags.last_token,"else")&&!(d(e,"if")&&!e.comments_before))||this._flags.last_token.type===l.END_EXPR&&(this._previous_flags.mode===v||this._previous_flags.mode===y))||this._flags.last_token.type===l.WORD&&this._flags.mode===p&&!this._flags.in_case&&!("--"===e.text||"++"===e.text)&&"function"!==this._last_last_text&&e.type!==l.WORD&&e.type!==l.RESERVED)||this._flags.mode===A&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||u(this._flags.last_token,["get","set"])))&&(this.set_mode(m),this.indent(),this.handle_whitespace_and_comments(e,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(e,u(e,["do","for","if","while"])),!0)},L.prototype.handle_start_expr=function(e){this.start_of_statement(e)||this.handle_whitespace_and_comments(e);var t=w;if("["===e.text){if(this._flags.last_token.type===l.WORD||")"===this._flags.last_token.text)return u(this._flags.last_token,a)&&(this._output.space_before_token=!0),this.print_token(e),this.set_mode(t),this.indent(),void(this._options.space_in_paren&&(this._output.space_before_token=!0));t=g,b(this._flags.mode)&&("["!==this._flags.last_token.text&&(","!==this._flags.last_token.text||"]"!==this._last_last_text&&"}"!==this._last_last_text)||this._options.keep_array_indentation||this.print_newline()),s(this._flags.last_token.type,[l.START_EXPR,l.END_EXPR,l.WORD,l.OPERATOR,l.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===l.RESERVED)"for"===this._flags.last_token.text?(this._output.space_before_token=this._options.space_before_conditional,t=v):s(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,t=y):s(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:"import"===this._flags.last_token.text&&""===e.whitespace_before?this._output.space_before_token=!1:(s(this._flags.last_token.text,a)||"catch"===this._flags.last_token.text)&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===l.EQUALS||this._flags.last_token.type===l.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(e);else if(this._flags.last_token.type===l.WORD){this._output.space_before_token=!1;var n=this._tokens.peek(-3);if(this._options.space_after_named_function&&n){var r=this._tokens.peek(-4);u(n,["async","function"])||"*"===n.text&&u(r,["async","function"])?this._output.space_before_token=!0:this._flags.mode===A?"{"!==n.text&&","!==n.text&&("*"!==n.text||"{"!==r.text&&","!==r.text)||(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(e);(this._flags.last_token.type===l.RESERVED&&("function"===this._flags.last_word||"typeof"===this._flags.last_word)||"*"===this._flags.last_token.text&&(s(this._last_last_text,["function","yield"])||this._flags.mode===A&&s(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}";"===this._flags.last_token.text||this._flags.last_token.type===l.START_BLOCK?this.print_newline():this._flags.last_token.type!==l.END_EXPR&&this._flags.last_token.type!==l.START_EXPR&&this._flags.last_token.type!==l.END_BLOCK&&"."!==this._flags.last_token.text&&this._flags.last_token.type!==l.COMMA||this.allow_wrap_or_preserved_newline(e,e.newlines),this.print_token(e),this.set_mode(t),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},L.prototype.handle_end_expr=function(e){for(;this._flags.mode===m;)this.restore_mode();this.handle_whitespace_and_comments(e),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(e,"]"===e.text&&b(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type!==l.START_EXPR||this._options.space_in_empty_paren?this._output.space_before_token=!0:(this._output.trim(),this._output.space_before_token=!1)),this.deindent(),this.print_token(e),this.restore_mode(),E(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===y&&(this._previous_flags.mode=w,this._flags.do_block=!1,this._flags.do_while=!1)},L.prototype.handle_start_block=function(e){this.handle_whitespace_and_comments(e);var t=this._tokens.peek(),n=this._tokens.peek(1);"switch"===this._flags.last_word&&this._flags.last_token.type===l.END_EXPR?(this.set_mode(p),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(p):n&&(s(n.text,[":",","])&&s(t.type,[l.STRING,l.WORD,l.RESERVED])||s(t.text,["get","set","..."])&&s(n.type,[l.WORD,l.RESERVED]))?s(this._last_last_text,["class","interface"])&&!s(n.text,[":",","])?this.set_mode(p):this.set_mode(A):this._flags.last_token.type===l.OPERATOR&&"=>"===this._flags.last_token.text?this.set_mode(p):s(this._flags.last_token.type,[l.EQUALS,l.START_EXPR,l.COMMA,l.OPERATOR])||u(this._flags.last_token,["return","throw","import","default"])?this.set_mode(A):this.set_mode(p),this._flags.last_token&&u(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0);var r=!t.comments_before&&"}"===t.text,i=r&&"function"===this._flags.last_word&&this._flags.last_token.type===l.END_EXPR;if(this._options.brace_preserve_inline){var a=0,o=null;this._flags.inline_frame=!0;do{if(a+=1,(o=this._tokens.peek(a-1)).newlines){this._flags.inline_frame=!1;break}}while(o.type!==l.EOF&&(o.type!==l.END_BLOCK||o.opened!==e))}("expand"===this._options.brace_style||"none"===this._options.brace_style&&e.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==l.OPERATOR&&(i||this._flags.last_token.type===l.EQUALS||u(this._flags.last_token,f)&&"else"!==this._flags.last_token.text)?this._output.space_before_token=!0:this.print_newline(!1,!0):(!b(this._previous_flags.mode)||this._flags.last_token.type!==l.START_EXPR&&this._flags.last_token.type!==l.COMMA||((this._flags.last_token.type===l.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===l.COMMA||this._flags.last_token.type===l.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(e),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==l.OPERATOR&&this._flags.last_token.type!==l.START_EXPR&&(s(this._flags.last_token.type,[l.START_BLOCK,l.SEMICOLON])&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(e),this.indent(),r||this._options.brace_preserve_inline&&this._flags.inline_frame||this.print_newline()},L.prototype.handle_end_block=function(e){for(this.handle_whitespace_and_comments(e);this._flags.mode===m;)this.restore_mode();var t=this._flags.last_token.type===l.START_BLOCK;this._flags.inline_frame&&!t?this._output.space_before_token=!0:"expand"===this._options.brace_style?t||this.print_newline():t||(b(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(e)},L.prototype.handle_word=function(e){if(e.type===l.RESERVED)if(s(e.text,["set","get"])&&this._flags.mode!==A)e.type=l.WORD;else if("import"===e.text&&s(this._tokens.peek().text,["(","."]))e.type=l.WORD;else if(s(e.text,["as","from"])&&!this._flags.import_block)e.type=l.WORD;else if(this._flags.mode===A){":"===this._tokens.peek().text&&(e.type=l.WORD)}if(this.start_of_statement(e)?u(this._flags.last_token,["var","let","const"])&&e.type===l.WORD&&(this._flags.declaration_statement=!0):!e.newlines||M(this._flags.mode)||this._flags.last_token.type===l.OPERATOR&&"--"!==this._flags.last_token.text&&"++"!==this._flags.last_token.text||this._flags.last_token.type===l.EQUALS||!this._options.preserve_newlines&&u(this._flags.last_token,["var","let","const","set","get"])?this.handle_whitespace_and_comments(e):(this.handle_whitespace_and_comments(e),this.print_newline()),this._flags.do_block&&!this._flags.do_while){if(d(e,"while"))return this._output.space_before_token=!0,this.print_token(e),this._output.space_before_token=!0,void(this._flags.do_while=!0);this.print_newline(),this._flags.do_block=!1}if(this._flags.if_block)if(!this._flags.else_block&&d(e,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===m;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&u(e,["case","default"]))return this.print_newline(),this._flags.case_block||!this._flags.case_body&&!this._options.jslint_happy||this.deindent(),this._flags.case_body=!1,this.print_token(e),void(this._flags.in_case=!0);if(this._flags.last_token.type!==l.COMMA&&this._flags.last_token.type!==l.START_EXPR&&this._flags.last_token.type!==l.EQUALS&&this._flags.last_token.type!==l.OPERATOR||this.start_of_object_property()||s(this._flags.last_token.text,["+","-"])&&":"===this._last_last_text&&this._flags.parent.mode===A||this.allow_wrap_or_preserved_newline(e),d(e,"function"))return(s(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!s(this._flags.last_token.text,["(","[","{",":","=",","])&&this._flags.last_token.type!==l.OPERATOR)&&(this._output.just_added_blankline()||e.comments_before||(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===l.RESERVED||this._flags.last_token.type===l.WORD?u(this._flags.last_token,["get","set","new","export"])||u(this._flags.last_token,H)||d(this._flags.last_token,"default")&&"export"===this._last_last_text||"declare"===this._flags.last_token.text?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===l.OPERATOR||"="===this._flags.last_token.text?this._output.space_before_token=!0:(this._flags.multiline_frame||!M(this._flags.mode)&&!b(this._flags.mode))&&this.print_newline(),this.print_token(e),void(this._flags.last_word=e.text);var t="NONE";(this._flags.last_token.type===l.END_BLOCK?this._previous_flags.inline_frame?t="SPACE":u(e,["else","catch","finally","from"])?"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&e.newlines?t="NEWLINE":(t="SPACE",this._output.space_before_token=!0):t="NEWLINE":this._flags.last_token.type===l.SEMICOLON&&this._flags.mode===p?t="NEWLINE":this._flags.last_token.type===l.SEMICOLON&&M(this._flags.mode)?t="SPACE":this._flags.last_token.type===l.STRING?t="NEWLINE":this._flags.last_token.type===l.RESERVED||this._flags.last_token.type===l.WORD||"*"===this._flags.last_token.text&&(s(this._last_last_text,["function","yield"])||this._flags.mode===A&&s(this._last_last_text,["{",","]))?t="SPACE":this._flags.last_token.type===l.START_BLOCK?t=this._flags.inline_frame?"SPACE":"NEWLINE":this._flags.last_token.type===l.END_EXPR&&(this._output.space_before_token=!0,t="NEWLINE"),u(e,a)&&")"!==this._flags.last_token.text&&(t=this._flags.inline_frame||"else"===this._flags.last_token.text||"export"===this._flags.last_token.text?"SPACE":"NEWLINE"),u(e,["else","catch","finally"]))?(this._flags.last_token.type!==l.END_BLOCK||this._previous_flags.mode!==p||"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&e.newlines)&&!this._flags.inline_frame?this.print_newline():(this._output.trim(!0),"}"!==this._output.current_line.last()&&this.print_newline(),this._output.space_before_token=!0):"NEWLINE"===t?u(this._flags.last_token,f)||"declare"===this._flags.last_token.text&&u(e,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==l.END_EXPR?this._flags.last_token.type===l.START_EXPR&&u(e,["var","let","const"])||":"===this._flags.last_token.text||(d(e,"if")&&d(e.previous,"else")?this._output.space_before_token=!0:this.print_newline()):u(e,a)&&")"!==this._flags.last_token.text&&this.print_newline():this._flags.multiline_frame&&b(this._flags.mode)&&","===this._flags.last_token.text&&"}"===this._last_last_text?this.print_newline():"SPACE"===t&&(this._output.space_before_token=!0);!e.previous||e.previous.type!==l.WORD&&e.previous.type!==l.RESERVED||(this._output.space_before_token=!0),this.print_token(e),this._flags.last_word=e.text,e.type===l.RESERVED&&("do"===e.text?this._flags.do_block=!0:"if"===e.text?this._flags.if_block=!0:"import"===e.text?this._flags.import_block=!0:this._flags.import_block&&d(e,"from")&&(this._flags.import_block=!1))},L.prototype.handle_semicolon=function(e){this.start_of_statement(e)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(e);for(var t=this._tokens.peek();!(this._flags.mode!==m||this._flags.if_block&&d(t,"else")||this._flags.do_block);)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(e)},L.prototype.handle_string=function(e){(!e.text.startsWith("`")||0!==e.newlines||""!==e.whitespace_before||")"!==e.previous.text&&this._flags.last_token.type!==l.WORD)&&(this.start_of_statement(e)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(e),this._flags.last_token.type===l.RESERVED||this._flags.last_token.type===l.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===l.COMMA||this._flags.last_token.type===l.START_EXPR||this._flags.last_token.type===l.EQUALS||this._flags.last_token.type===l.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(e):!e.text.startsWith("`")||this._flags.last_token.type!==l.END_EXPR||"]"!==e.previous.text&&")"!==e.previous.text||0!==e.newlines?this.print_newline():this._output.space_before_token=!0)),this.print_token(e)},L.prototype.handle_equals=function(e){this.start_of_statement(e)||this.handle_whitespace_and_comments(e),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(e),this._output.space_before_token=!0},L.prototype.handle_comma=function(e){this.handle_whitespace_and_comments(e,!0),this.print_token(e),this._output.space_before_token=!0,this._flags.declaration_statement?(M(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(e)):this._flags.mode===A||this._flags.mode===m&&this._flags.parent.mode===A?(this._flags.mode===m&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(e)},L.prototype.handle_operator=function(e){var t="*"===e.text&&(u(this._flags.last_token,["function","yield"])||s(this._flags.last_token.type,[l.START_BLOCK,l.COMMA,l.END_BLOCK,l.SEMICOLON])),n=s(e.text,["-","+"])&&(s(this._flags.last_token.type,[l.START_BLOCK,l.START_EXPR,l.EQUALS,l.OPERATOR])||s(this._flags.last_token.text,a)||","===this._flags.last_token.text);if(this.start_of_statement(e));else{var r=!t;this.handle_whitespace_and_comments(e,r)}if("*"!==e.text||this._flags.last_token.type!==l.DOT)if("::"!==e.text)if(s(e.text,["-","+"])&&this.start_of_object_property())this.print_token(e);else{if(this._flags.last_token.type===l.OPERATOR&&s(this._options.operator_position,C)&&this.allow_wrap_or_preserved_newline(e),":"===e.text&&this._flags.in_case)return this.print_token(e),this._flags.in_case=!1,this._flags.case_body=!0,void(this._tokens.peek().type!==l.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0));var i=!0,c=!0,d=!1;if(":"===e.text?0===this._flags.ternary_depth?i=!1:(this._flags.ternary_depth-=1,d=!0):"?"===e.text&&(this._flags.ternary_depth+=1),!n&&!t&&this._options.preserve_newlines&&s(e.text,o)){var A=":"===e.text,g=A&&d,v=A&&!d;switch(this._options.operator_position){case h.before_newline:return this._output.space_before_token=!v,this.print_token(e),A&&!g||this.allow_wrap_or_preserved_newline(e),void(this._output.space_before_token=!0);case h.after_newline:return this._output.space_before_token=!0,!A||g?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(e):this._output.space_before_token=!1,this.print_token(e),void(this._output.space_before_token=!0);case h.preserve_newline:return v||this.allow_wrap_or_preserved_newline(e),i=!(this._output.just_added_newline()||v),this._output.space_before_token=i,this.print_token(e),void(this._output.space_before_token=!0)}}if(t){this.allow_wrap_or_preserved_newline(e),i=!1;var y=this._tokens.peek();c=y&&s(y.type,[l.WORD,l.RESERVED])}else if("..."===e.text)this.allow_wrap_or_preserved_newline(e),i=this._flags.last_token.type===l.START_BLOCK,c=!1;else if(s(e.text,["--","++","!","~"])||n){if(this._flags.last_token.type!==l.COMMA&&this._flags.last_token.type!==l.START_EXPR||this.allow_wrap_or_preserved_newline(e),i=!1,c=!1,e.newlines&&("--"===e.text||"++"===e.text||"~"===e.text)){var w=u(this._flags.last_token,f)&&e.newlines;w&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(w,!0)}";"===this._flags.last_token.text&&M(this._flags.mode)&&(i=!0),this._flags.last_token.type===l.RESERVED?i=!0:this._flags.last_token.type===l.END_EXPR?i=!("]"===this._flags.last_token.text&&("--"===e.text||"++"===e.text)):this._flags.last_token.type===l.OPERATOR&&(i=s(e.text,["--","-","++","+"])&&s(this._flags.last_token.text,["--","-","++","+"]),s(e.text,["+","-"])&&s(this._flags.last_token.text,["--","++"])&&(c=!0)),(this._flags.mode!==p||this._flags.inline_frame)&&this._flags.mode!==m||"{"!==this._flags.last_token.text&&";"!==this._flags.last_token.text||this.print_newline()}this._output.space_before_token=this._output.space_before_token||i,this.print_token(e),this._output.space_before_token=c}else this.print_token(e);else this.print_token(e)},L.prototype.handle_block_comment=function(e,t){return this._output.raw?(this._output.add_raw_token(e),void(e.directives&&"end"===e.directives.preserve&&(this._output.raw=this._options.test_output_raw))):e.directives?(this.print_newline(!1,t),this.print_token(e),"start"===e.directives.preserve&&(this._output.raw=!0),void this.print_newline(!1,!0)):n.newline.test(e.text)||e.newlines?void this.print_block_commment(e,t):(this._output.space_before_token=!0,this.print_token(e),void(this._output.space_before_token=!0))},L.prototype.print_block_commment=function(e,t){var r,i=function(e){for(var t=[],r=(e=e.replace(n.allLineBreaks,"\n")).indexOf("\n");-1!==r;)t.push(e.substring(0,r)),r=(e=e.substring(r+1)).indexOf("\n");return e.length&&t.push(e),t}(e.text),a=!1,o=!1,l=e.whitespace_before,s=l.length;if(this.print_newline(!1,t),this.print_token_line_indentation(e),this._output.add_token(i[0]),this.print_newline(!1,t),i.length>1){for(a=function(e,t){for(var n=0;n<e.length;n++)if(e[n].trim().charAt(0)!==t)return!1;return!0}(i=i.slice(1),"*"),o=function(e,t){for(var n,r=0,i=e.length;r<i;r++)if((n=e[r])&&0!==n.indexOf(t))return!1;return!0}(i,l),a&&(this._flags.alignment=1),r=0;r<i.length;r++)a?(this.print_token_line_indentation(e),this._output.add_token(c(i[r]))):o&&i[r]?(this.print_token_line_indentation(e),this._output.add_token(i[r].substring(s))):(this._output.current_line.set_indent(-1),this._output.add_token(i[r])),this.print_newline(!1,t);this._flags.alignment=0}},L.prototype.handle_comment=function(e,t){e.newlines?this.print_newline(!1,t):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(e),this.print_newline(!1,t)},L.prototype.handle_dot=function(e){this.start_of_statement(e)||this.handle_whitespace_and_comments(e,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),u(this._flags.last_token,f)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(e,")"===this._flags.last_token.text&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(e)},L.prototype.handle_unknown=function(e,t){this.print_token(e),"\n"===e.text[e.text.length-1]&&this.print_newline(!1,t)},L.prototype.handle_eof=function(e){for(;this._flags.mode===m;)this.restore_mode();this.handle_whitespace_and_comments(e)},Dx.Beautifier=L,Dx}var bV,MV,LV,HV={exports:{}},xV={},VV={};function kV(){if(bV)return VV;bV=1;var e=Kx().Options;function t(t){e.call(this,t,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var n=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||n;var r=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var i=0;i<r.length;i++)"expand"!==r[i]?this.brace_style="collapse":this.brace_style=r[i]}return t.prototype=new e,VV.Options=t,VV}function SV(){if(LV)return HV.exports;LV=1;var e=function(){if(MV)return xV;MV=1;var e=kV().Options,t=Rx().Output,n=tV().InputScanner,r=new(0,CV().Directives)(/\/\*/,/\*\//),i=/\r\n|[\r\n]/,a=/\r\n|[\r\n]/g,o=/\s/,l=/(?:\s|\n)+/g,s=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,c=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function d(t,n){this._source_text=t||"",this._options=new e(n),this._ch=null,this._input=null,this.NESTED_AT_RULE={page:!0,"font-face":!0,keyframes:!0,media:!0,supports:!0,document:!0},this.CONDITIONAL_GROUP_RULE={media:!0,supports:!0,document:!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}return d.prototype.eatString=function(e){var t="";for(this._ch=this._input.next();this._ch;){if(t+=this._ch,"\\"===this._ch)t+=this._input.next();else if(-1!==e.indexOf(this._ch)||"\n"===this._ch)break;this._ch=this._input.next()}return t},d.prototype.eatWhitespace=function(e){for(var t=o.test(this._input.peek()),n=0;o.test(this._input.peek());)this._ch=this._input.next(),e&&"\n"===this._ch&&(0===n||n<this._options.max_preserve_newlines)&&(n++,this._output.add_new_line(!0));return t},d.prototype.foundNestedPseudoClass=function(){for(var e=0,t=1,n=this._input.peek(t);n;){if("{"===n)return!0;if("("===n)e+=1;else if(")"===n){if(0===e)return!1;e-=1}else if(";"===n||"}"===n)return!1;t++,n=this._input.peek(t)}return!1},d.prototype.print_string=function(e){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(e)},d.prototype.preserveSingleSpace=function(e){e&&(this._output.space_before_token=!0)},d.prototype.indent=function(){this._indentLevel++},d.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},d.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var e=this._source_text,d=this._options.eol;"auto"===d&&(d="\n",e&&i.test(e||"")&&(d=e.match(i)[0]));var u=(e=e.replace(a,"\n")).match(/^[\t ]*/)[0];this._output=new t(this._options,u),this._input=new n(e),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var f,h,C=0,p=!1,m=!1,A=!1,g=!1,v=!1,y=this._ch,w=!1;f=""!==this._input.read(l),h=y,this._ch=this._input.next(),"\\"===this._ch&&this._input.hasNext()&&(this._ch+=this._input.next()),y=this._ch,this._ch;)if("/"===this._ch&&"*"===this._input.peek()){this._output.add_new_line(),this._input.back();var E=this._input.read(s),b=r.get_directives(E);b&&"start"===b.ignore&&(E+=r.readIgnored(this._input)),this.print_string(E),this.eatWhitespace(!0),this._output.add_new_line()}else if("/"===this._ch&&"/"===this._input.peek())this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(c)),this.eatWhitespace(!0);else if("$"===this._ch){this.preserveSingleSpace(f),this.print_string(this._ch);var M=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);M.match(/[ :]$/)&&(M=this.eatString(": ").replace(/\s+$/,""),this.print_string(M),this._output.space_before_token=!0),0===C&&-1!==M.indexOf(":")&&(m=!0,this.indent())}else if("@"===this._ch)if(this.preserveSingleSpace(f),"{"===this._input.peek())this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var L=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);L.match(/[ :]$/)&&(L=this.eatString(": ").replace(/\s+$/,""),this.print_string(L),this._output.space_before_token=!0),0===C&&-1!==L.indexOf(":")?(m=!0,this.indent()):L in this.NESTED_AT_RULE?(this._nestedLevel+=1,L in this.CONDITIONAL_GROUP_RULE&&(A=!0)):0!==C||m||(g=!0)}else if("#"===this._ch&&"{"===this._input.peek())this.preserveSingleSpace(f),this.print_string(this._ch+this.eatString("}"));else if("{"===this._ch)m&&(m=!1,this.outdent()),g=!1,A?(A=!1,p=this._indentLevel>=this._nestedLevel):p=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&p&&this._output.previous_line&&"{"!==this._output.previous_line.item(-1)&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,"expand"===this._options.brace_style?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):("("===h?this._output.space_before_token=!1:","!==h&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if("}"===this._ch)this.outdent(),this._output.add_new_line(),"{"===h&&this._output.trim(!0),m&&(this.outdent(),m=!1),this.print_string(this._ch),p=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&"}"!==this._input.peek()&&this._output.add_new_line(!0),")"===this._input.peek()&&(this._output.trim(!0),"expand"===this._options.brace_style&&this._output.add_new_line(!0));else if(":"===this._ch){for(var H=0;H<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;H++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[H])){w=!0;break}!p&&!A||this._input.lookBack("&")||this.foundNestedPseudoClass()||this._input.lookBack("(")||g||0!==C?(this._input.lookBack(" ")&&(this._output.space_before_token=!0),":"===this._input.peek()?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":")):(this.print_string(":"),m||(m=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent()))}else if('"'===this._ch||"'"===this._ch){var x='"'===h||"'"===h;this.preserveSingleSpace(x||f),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(";"===this._ch)w=!1,0===C?(m&&(this.outdent(),m=!1),g=!1,this.print_string(this._ch),this.eatWhitespace(!0),"/"!==this._input.peek()&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if("("===this._ch)if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),C++,this.indent(),this._ch=this._input.next(),")"===this._ch||'"'===this._ch||"'"===this._ch?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),C&&(C--,this.outdent()));else{var V=!1;this._input.lookBack("with")&&(V=!0),this.preserveSingleSpace(f||V),this.print_string(this._ch),m&&"$"===h&&this._options.selector_separator_newline?(this._output.add_new_line(),v=!0):(this.eatWhitespace(),C++,this.indent())}else if(")"===this._ch)C&&(C--,this.outdent()),v&&";"===this._input.peek()&&this._options.selector_separator_newline&&(v=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(","===this._ch)this.print_string(this._ch),this.eatWhitespace(!0),!this._options.selector_separator_newline||m&&!v||0!==C||g?this._output.space_before_token=!0:this._output.add_new_line();else if(">"!==this._ch&&"+"!==this._ch&&"~"!==this._ch||m||0!==C)if("]"===this._ch)this.print_string(this._ch);else if("["===this._ch)this.preserveSingleSpace(f),this.print_string(this._ch);else if("="===this._ch)this.eatWhitespace(),this.print_string("="),o.test(this._ch)&&(this._ch="");else if("!"!==this._ch||this._input.lookBack("\\")){var k='"'===h||"'"===h;this.preserveSingleSpace(k||f),this.print_string(this._ch),!this._output.just_added_newline()&&"\n"===this._input.peek()&&w&&this._output.add_new_line()}else this._output.space_before_token=!0,this.print_string(this._ch);else this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&o.test(this._ch)&&(this._ch=""));return this._output.get_code(d)},xV.Beautifier=d,xV}().Beautifier,t=kV().Options;return HV.exports=function(t,n){return new e(t,n).beautify()},HV.exports.defaultOptions=function(){return new t},HV.exports}var zV,ZV={exports:{}},OV={},NV={};function TV(){if(zV)return NV;zV=1;var e=Kx().Options;function t(t){e.call(this,t,"html"),1===this.templating.length&&"auto"===this.templating[0]&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_min_attrs=this._get_number("wrap_attributes_min_attrs",2),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.inline_custom_elements=this._get_boolean("inline_custom_elements",!0),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}return t.prototype=new e,NV.Options=t,NV}var IV,DV,FV,RV,PV,jV={};function BV(){if(IV)return jV;IV=1;var e=uV().Tokenizer,t=uV().TOKEN,n=CV().Directives,r=yV().TemplatablePattern,i=dV().Pattern,a={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",CONTROL_FLOW_OPEN:"TK_CONTROL_FLOW_OPEN",CONTROL_FLOW_CLOSE:"TK_CONTROL_FLOW_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:t.START,RAW:t.RAW,EOF:t.EOF},o=new n(/<\!--/,/-->/),l=function(t,n){e.call(this,t,n),this._current_tag_name="";var a=new r(this._input).read_options(this._options),o=new i(this._input);if(this.__patterns={word:a.until(/[\n\r\t <]/),word_control_flow_close_excluded:a.until(/[\n\r\t <}]/),single_quote:a.until_after(/'/),double_quote:a.until_after(/"/),attribute:a.until(/[\n\r\t =>]|\/>/),element_name:a.until(/[\n\r\t >\/]/),angular_control_flow_start:o.matching(/\@[a-zA-Z]+[^({]*[({]/),handlebars_comment:o.starting_with(/{{!--/).until_after(/--}}/),handlebars:o.starting_with(/{{/).until_after(/}}/),handlebars_open:o.until(/[\n\r\t }]/),handlebars_raw_close:o.until(/}}/),comment:o.starting_with(/<!--/).until_after(/-->/),cdata:o.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:o.starting_with(/<!\[/).until_after(/]>/),processing:o.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars"),this.__patterns.word_control_flow_close_excluded=this.__patterns.word_control_flow_close_excluded.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var l=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=o.matching(l).until_after(l)}};return(l.prototype=new e)._is_comment=function(e){return!1},l.prototype._is_opening=function(e){return e.type===a.TAG_OPEN||e.type===a.CONTROL_FLOW_OPEN},l.prototype._is_closing=function(e,t){return e.type===a.TAG_CLOSE&&t&&((">"===e.text||"/>"===e.text)&&"<"===t.text[0]||"}}"===e.text&&"{"===t.text[0]&&"{"===t.text[1])||e.type===a.CONTROL_FLOW_CLOSE&&"}"===e.text&&t.text.endsWith("{")},l.prototype._reset=function(){this._current_tag_name=""},l.prototype._get_next_token=function(e,t){var n=null;this._readWhitespace();var r=this._input.peek();return null===r?this._create_token(a.EOF,""):n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=n||this._read_open_handlebars(r,t))||this._read_attribute(r,e,t))||this._read_close(r,t))||this._read_script_and_style(r,e))||this._read_control_flows(r,t))||this._read_raw_content(r,e,t))||this._read_content_word(r,t))||this._read_comment_or_cdata(r))||this._read_processing(r))||this._read_open(r,t))||this._create_token(a.UNKNOWN,this._input.next())},l.prototype._read_comment_or_cdata=function(e){var t=null,n=null,r=null;"<"===e&&("!"===this._input.peek(1)&&((n=this.__patterns.comment.read())?(r=o.get_directives(n))&&"start"===r.ignore&&(n+=o.readIgnored(this._input)):n=this.__patterns.cdata.read()),n&&((t=this._create_token(a.COMMENT,n)).directives=r));return t},l.prototype._read_processing=function(e){var t=null,n=null;if("<"===e){var r=this._input.peek(1);"!"!==r&&"?"!==r||(n=(n=this.__patterns.conditional_comment.read())||this.__patterns.processing.read()),n&&((t=this._create_token(a.COMMENT,n)).directives=null)}return t},l.prototype._read_open=function(e,t){var n=null,r=null;return t&&t.type!==a.CONTROL_FLOW_OPEN||"<"===e&&(n=this._input.next(),"/"===this._input.peek()&&(n+=this._input.next()),n+=this.__patterns.element_name.read(),r=this._create_token(a.TAG_OPEN,n)),r},l.prototype._read_open_handlebars=function(e,t){var n=null,r=null;return t&&t.type!==a.CONTROL_FLOW_OPEN||(this._options.templating.includes("angular")||this._options.indent_handlebars)&&"{"===e&&"{"===this._input.peek(1)&&(this._options.indent_handlebars&&"!"===this._input.peek(2)?(n=(n=this.__patterns.handlebars_comment.read())||this.__patterns.handlebars.read(),r=this._create_token(a.COMMENT,n)):(n=this.__patterns.handlebars_open.read(),r=this._create_token(a.TAG_OPEN,n))),r},l.prototype._read_control_flows=function(e,t){var n="",r=null;if(!this._options.templating.includes("angular"))return r;if("@"===e){if(""===(n=this.__patterns.angular_control_flow_start.read()))return r;for(var i=n.endsWith("(")?1:0,o=0;!n.endsWith("{")||i!==o;){var l=this._input.next();if(null===l)break;"("===l?i++:")"===l&&o++,n+=l}r=this._create_token(a.CONTROL_FLOW_OPEN,n)}else"}"===e&&t&&t.type===a.CONTROL_FLOW_OPEN&&(n=this._input.next(),r=this._create_token(a.CONTROL_FLOW_CLOSE,n));return r},l.prototype._read_close=function(e,t){var n=null,r=null;return t&&t.type===a.TAG_OPEN&&("<"===t.text[0]&&(">"===e||"/"===e&&">"===this._input.peek(1))?(n=this._input.next(),"/"===e&&(n+=this._input.next()),r=this._create_token(a.TAG_CLOSE,n)):"{"===t.text[0]&&"}"===e&&"}"===this._input.peek(1)&&(this._input.next(),this._input.next(),r=this._create_token(a.TAG_CLOSE,"}}"))),r},l.prototype._read_attribute=function(e,t,n){var r=null,i="";if(n&&"<"===n.text[0])if("="===e)r=this._create_token(a.EQUALS,this._input.next());else if('"'===e||"'"===e){var o=this._input.next();o+='"'===e?this.__patterns.double_quote.read():this.__patterns.single_quote.read(),r=this._create_token(a.VALUE,o)}else(i=this.__patterns.attribute.read())&&(r=t.type===a.EQUALS?this._create_token(a.VALUE,i):this._create_token(a.ATTRIBUTE,i));return r},l.prototype._is_content_unformatted=function(e){return-1===this._options.void_elements.indexOf(e)&&(-1!==this._options.content_unformatted.indexOf(e)||-1!==this._options.unformatted.indexOf(e))},l.prototype._read_raw_content=function(e,t,n){var r="";if(n&&"{"===n.text[0])r=this.__patterns.handlebars_raw_close.read();else if(t.type===a.TAG_CLOSE&&"<"===t.opened.text[0]&&"/"!==t.text[0]){var i=t.opened.text.substr(1).toLowerCase();this._is_content_unformatted(i)&&(r=this._input.readUntil(new RegExp("</"+i+"[\\n\\r\\t ]*?>","ig")))}return r?this._create_token(a.TEXT,r):null},l.prototype._read_script_and_style=function(e,t){if(t.type===a.TAG_CLOSE&&"<"===t.opened.text[0]&&"/"!==t.text[0]){var n=t.opened.text.substr(1).toLowerCase();if("script"===n||"style"===n){var r=this._read_comment_or_cdata(e);if(r)return r.type=a.TEXT,r;var i=this._input.readUntil(new RegExp("</"+n+"[\\n\\r\\t ]*?>","ig"));if(i)return this._create_token(a.TEXT,i)}}return null},l.prototype._read_content_word=function(e,t){var n="";return this._options.unformatted_content_delimiter&&e===this._options.unformatted_content_delimiter[0]&&(n=this.__patterns.unformatted_content_delimiter.read()),n||(n=t&&t.type===a.CONTROL_FLOW_OPEN?this.__patterns.word_control_flow_close_excluded.read():this.__patterns.word.read()),n?this._create_token(a.TEXT,n):null},jV.Tokenizer=l,jV.TOKEN=a,jV}function _V(){if(DV)return OV;DV=1;var e=TV().Options,t=Rx().Output,n=BV().Tokenizer,r=BV().TOKEN,i=/\r\n|[\r\n]/,a=/\r\n|[\r\n]/g,o=function(e,n){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=e.max_preserve_newlines,this.preserve_newlines=e.preserve_newlines,this._output=new t(e,n)};o.prototype.current_line_has_match=function(e){return this._output.current_line.has_match(e)},o.prototype.set_space_before_token=function(e,t){this._output.space_before_token=e,this._output.non_breaking_space=t},o.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},o.prototype.add_raw_token=function(e){this._output.add_raw_token(e)},o.prototype.print_preserved_newlines=function(e){var t=0;e.type!==r.TEXT&&e.previous.type!==r.TEXT&&(t=e.newlines?1:0),this.preserve_newlines&&(t=e.newlines<this.max_preserve_newlines+1?e.newlines:this.max_preserve_newlines+1);for(var n=0;n<t;n++)this.print_newline(n>0);return 0!==t},o.prototype.traverse_whitespace=function(e){return!(!e.whitespace_before&&!e.newlines)&&(this.print_preserved_newlines(e)||(this._output.space_before_token=!0),!0)},o.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},o.prototype.print_newline=function(e){this._output.add_new_line(e)},o.prototype.print_token=function(e){e.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(e.text))},o.prototype.indent=function(){this.indent_level++},o.prototype.deindent=function(){this.indent_level>0&&(this.indent_level--,this._output.set_indent(this.indent_level,this.alignment_size))},o.prototype.get_full_indent=function(e){return(e=this.indent_level+(e||0))<1?"":this._output.get_indent_string(e)};var l=function(e,t){var n=null,i=null;return t.closed?("script"===e?n="text/javascript":"style"===e&&(n="text/css"),n=function(e){for(var t=null,n=e.next;n.type!==r.EOF&&e.closed!==n;){if(n.type===r.ATTRIBUTE&&"type"===n.text){n.next&&n.next.type===r.EQUALS&&n.next.next&&n.next.next.type===r.VALUE&&(t=n.next.next.text);break}n=n.next}return t}(t)||n,n.search("text/css")>-1?i="css":n.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?i="javascript":n.search(/(text|application|dojo)\/(x-)?(html)/)>-1?i="html":n.search(/test\/null/)>-1&&(i="null"),i):null};function s(e,t){return-1!==t.indexOf(e)}function c(e,t,n){this.parent=e||null,this.tag=t?t.tag_name:"",this.indent_level=n||0,this.parser_token=t||null}function d(e){this._printer=e,this._current_frame=null}function u(t,n,r,i){this._source_text=t||"",n=n||{},this._js_beautify=r,this._css_beautify=i,this._tag_stack=null;var a=new e(n,"html");this._options=a,this._is_wrap_attributes_force="force"===this._options.wrap_attributes.substr(0,5),this._is_wrap_attributes_force_expand_multiline="force-expand-multiline"===this._options.wrap_attributes,this._is_wrap_attributes_force_aligned="force-aligned"===this._options.wrap_attributes,this._is_wrap_attributes_aligned_multiple="aligned-multiple"===this._options.wrap_attributes,this._is_wrap_attributes_preserve="preserve"===this._options.wrap_attributes.substr(0,8),this._is_wrap_attributes_preserve_aligned="preserve-aligned"===this._options.wrap_attributes}d.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},d.prototype.record_tag=function(e){var t=new c(this._current_frame,e,this._printer.indent_level);this._current_frame=t},d.prototype._try_pop_frame=function(e){var t=null;return e&&(t=e.parser_token,this._printer.indent_level=e.indent_level,this._current_frame=e.parent),t},d.prototype._get_frame=function(e,t){for(var n=this._current_frame;n&&-1===e.indexOf(n.tag);){if(t&&-1!==t.indexOf(n.tag)){n=null;break}n=n.parent}return n},d.prototype.try_pop=function(e,t){var n=this._get_frame([e],t);return this._try_pop_frame(n)},d.prototype.indent_to_tag=function(e){var t=this._get_frame(e);t&&(this._printer.indent_level=t.indent_level)},u.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var e=this._source_text,t=this._options.eol;"auto"===this._options.eol&&(t="\n",e&&i.test(e)&&(t=e.match(i)[0]));var l=(e=e.replace(a,"\n")).match(/^[\t ]*/)[0],s={text:"",type:""},c=new f(this._options),u=new o(this._options,l),h=new n(e,this._options).tokenize();this._tag_stack=new d(u);for(var C=null,p=h.next();p.type!==r.EOF;)p.type===r.TAG_OPEN||p.type===r.COMMENT?c=C=this._handle_tag_open(u,p,c,s,h):p.type===r.ATTRIBUTE||p.type===r.EQUALS||p.type===r.VALUE||p.type===r.TEXT&&!c.tag_complete?C=this._handle_inside_tag(u,p,c,s):p.type===r.TAG_CLOSE?C=this._handle_tag_close(u,p,c):p.type===r.TEXT?C=this._handle_text(u,p,c):p.type===r.CONTROL_FLOW_OPEN?C=this._handle_control_flow_open(u,p):p.type===r.CONTROL_FLOW_CLOSE?C=this._handle_control_flow_close(u,p):u.add_raw_token(p),s=C,p=h.next();return u._output.get_code(t)},u.prototype._handle_control_flow_open=function(e,t){var n={text:t.text,type:t.type};return e.set_space_before_token(t.newlines||""!==t.whitespace_before,!0),t.newlines?e.print_preserved_newlines(t):e.set_space_before_token(t.newlines||""!==t.whitespace_before,!0),e.print_token(t),e.indent(),n},u.prototype._handle_control_flow_close=function(e,t){var n={text:t.text,type:t.type};return e.deindent(),t.newlines?e.print_preserved_newlines(t):e.set_space_before_token(t.newlines||""!==t.whitespace_before,!0),e.print_token(t),n},u.prototype._handle_tag_close=function(e,t,n){var r={text:t.text,type:t.type};return e.alignment_size=0,n.tag_complete=!0,e.set_space_before_token(t.newlines||""!==t.whitespace_before,!0),n.is_unformatted?e.add_raw_token(t):("<"===n.tag_start_char&&(e.set_space_before_token("/"===t.text[0],!0),this._is_wrap_attributes_force_expand_multiline&&n.has_wrapped_attrs&&e.print_newline(!1)),e.print_token(t)),!n.indent_content||n.is_unformatted||n.is_content_unformatted||(e.indent(),n.indent_content=!1),n.is_inline_element||n.is_unformatted||n.is_content_unformatted||e.set_wrap_point(),r},u.prototype._handle_inside_tag=function(e,t,n,i){var a=n.has_wrapped_attrs,o={text:t.text,type:t.type};return e.set_space_before_token(t.newlines||""!==t.whitespace_before,!0),n.is_unformatted?e.add_raw_token(t):"{"===n.tag_start_char&&t.type===r.TEXT?e.print_preserved_newlines(t)?(t.newlines=0,e.add_raw_token(t)):e.print_token(t):(t.type===r.ATTRIBUTE?e.set_space_before_token(!0):(t.type===r.EQUALS||t.type===r.VALUE&&t.previous.type===r.EQUALS)&&e.set_space_before_token(!1),t.type===r.ATTRIBUTE&&"<"===n.tag_start_char&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(e.traverse_whitespace(t),a=a||0!==t.newlines),this._is_wrap_attributes_force&&n.attr_count>=this._options.wrap_attributes_min_attrs&&(i.type!==r.TAG_OPEN||this._is_wrap_attributes_force_expand_multiline)&&(e.print_newline(!1),a=!0)),e.print_token(t),a=a||e.previous_token_wrapped(),n.has_wrapped_attrs=a),o},u.prototype._handle_text=function(e,t,n){var r={text:t.text,type:"TK_CONTENT"};return n.custom_beautifier_name?this._print_custom_beatifier_text(e,t,n):n.is_unformatted||n.is_content_unformatted?e.add_raw_token(t):(e.traverse_whitespace(t),e.print_token(t)),r},u.prototype._print_custom_beatifier_text=function(e,t,n){var r=this;if(""!==t.text){var i,a=t.text,o=1,l="",s="";"javascript"===n.custom_beautifier_name&&"function"==typeof this._js_beautify?i=this._js_beautify:"css"===n.custom_beautifier_name&&"function"==typeof this._css_beautify?i=this._css_beautify:"html"===n.custom_beautifier_name&&(i=function(e,t){return new u(e,t,r._js_beautify,r._css_beautify).beautify()}),"keep"===this._options.indent_scripts?o=0:"separate"===this._options.indent_scripts&&(o=-e.indent_level);var c=e.get_full_indent(o);if(a=a.replace(/\n[ \t]*$/,""),"html"!==n.custom_beautifier_name&&"<"===a[0]&&a.match(/^(<!--|<!\[CDATA\[)/)){var d=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(a);if(!d)return void e.add_raw_token(t);l=c+d[1]+"\n",a=d[4],d[5]&&(s=c+d[5]),a=a.replace(/\n[ \t]*$/,""),(d[2]||-1!==d[3].indexOf("\n"))&&(d=d[3].match(/[ \t]+$/))&&(t.whitespace_before=d[0])}if(a)if(i){var f=function(){this.eol="\n"};f.prototype=this._options.raw_options,a=i(c+a,new f)}else{var h=t.whitespace_before;h&&(a=a.replace(new RegExp("\n("+h+")?","g"),"\n")),a=c+a.replace(/\n/g,"\n"+c)}l&&(a=a?l+a+"\n"+s:l+s),e.print_newline(!1),a&&(t.text=a,t.whitespace_before="",t.newlines=0,e.add_raw_token(t),e.print_newline(!0))}},u.prototype._handle_tag_open=function(e,t,n,i,a){var o=this._get_tag_open_token(t);if(!n.is_unformatted&&!n.is_content_unformatted||n.is_empty_element||t.type!==r.TAG_OPEN||o.is_start_tag?(e.traverse_whitespace(t),this._set_tag_position(e,t,o,n,i),o.is_inline_element||e.set_wrap_point(),e.print_token(t)):(e.add_raw_token(t),o.start_tag_token=this._tag_stack.try_pop(o.tag_name)),o.is_start_tag&&this._is_wrap_attributes_force){var l,s=0;do{(l=a.peek(s)).type===r.ATTRIBUTE&&(o.attr_count+=1),s+=1}while(l.type!==r.EOF&&l.type!==r.TAG_CLOSE)}return(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(o.alignment_size=t.text.length+1),o.tag_complete||o.is_unformatted||(e.alignment_size=o.alignment_size),o};var f=function(e,t,n){if(this.parent=t||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",n){var i;this.tag_start_char=n.text[0],this.text=n.text,"<"===this.tag_start_char?(i=n.text.match(/^<([^\s>]*)/),this.tag_check=i?i[1]:""):(i=n.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=i?i[1]:"",(n.text.startsWith("{{#>")||n.text.startsWith("{{~#>"))&&">"===this.tag_check[0]&&(">"===this.tag_check&&null!==n.next?this.tag_check=n.next.text.split(" ")[0]:this.tag_check=n.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),n.type===r.COMMENT&&(this.tag_complete=!0),this.is_start_tag="/"!==this.tag_check.charAt(0),this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||n.closed&&"/>"===n.closed.text;var a=2;"{"===this.tag_start_char&&this.text.length>=3&&"~"===this.text.charAt(2)&&(a=3),this.is_end_tag=this.is_end_tag||"{"===this.tag_start_char&&(!e.indent_handlebars||this.text.length<3||/[^#\^]/.test(this.text.charAt(a)))}else this.tag_complete=!0};u.prototype._get_tag_open_token=function(e){var t=new f(this._options,this._tag_stack.get_parser_token(),e);return t.alignment_size=this._options.wrap_attributes_indent_size,t.is_end_tag=t.is_end_tag||s(t.tag_check,this._options.void_elements),t.is_empty_element=t.tag_complete||t.is_start_tag&&t.is_end_tag,t.is_unformatted=!t.tag_complete&&s(t.tag_check,this._options.unformatted),t.is_content_unformatted=!t.is_empty_element&&s(t.tag_check,this._options.content_unformatted),t.is_inline_element=s(t.tag_name,this._options.inline)||this._options.inline_custom_elements&&t.tag_name.includes("-")||"{"===t.tag_start_char,t},u.prototype._set_tag_position=function(e,t,n,i,a){if(n.is_empty_element||(n.is_end_tag?n.start_tag_token=this._tag_stack.try_pop(n.tag_name):(this._do_optional_end_element(n)&&(n.is_inline_element||e.print_newline(!1)),this._tag_stack.record_tag(n),"script"!==n.tag_name&&"style"!==n.tag_name||n.is_unformatted||n.is_content_unformatted||(n.custom_beautifier_name=l(n.tag_check,t)))),s(n.tag_check,this._options.extra_liners)&&(e.print_newline(!1),e._output.just_added_blankline()||e.print_newline(!0)),n.is_empty_element){if("{"===n.tag_start_char&&"else"===n.tag_check)this._tag_stack.indent_to_tag(["if","unless","each"]),n.indent_content=!0,e.current_line_has_match(/{{#if/)||e.print_newline(!1);"!--"===n.tag_name&&a.type===r.TAG_CLOSE&&i.is_end_tag&&-1===n.text.indexOf("\n")||(n.is_inline_element||n.is_unformatted||e.print_newline(!1),this._calcluate_parent_multiline(e,n))}else if(n.is_end_tag){var o=!1;o=(o=n.start_tag_token&&n.start_tag_token.multiline_content)||!n.is_inline_element&&!(i.is_inline_element||i.is_unformatted)&&!(a.type===r.TAG_CLOSE&&n.start_tag_token===i)&&"TK_CONTENT"!==a.type,(n.is_content_unformatted||n.is_unformatted)&&(o=!1),o&&e.print_newline(!1)}else n.indent_content=!n.custom_beautifier_name,"<"===n.tag_start_char&&("html"===n.tag_name?n.indent_content=this._options.indent_inner_html:"head"===n.tag_name?n.indent_content=this._options.indent_head_inner_html:"body"===n.tag_name&&(n.indent_content=this._options.indent_body_inner_html)),n.is_inline_element||n.is_unformatted||"TK_CONTENT"===a.type&&!n.is_content_unformatted||e.print_newline(!1),this._calcluate_parent_multiline(e,n)},u.prototype._calcluate_parent_multiline=function(e,t){!t.parent||!e._output.just_added_newline()||(t.is_inline_element||t.is_unformatted)&&t.parent.is_inline_element||(t.parent.multiline_content=!0)};var h=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","menu","nav","ol","p","pre","section","table","ul"],C=["a","audio","del","ins","map","noscript","video"];return u.prototype._do_optional_end_element=function(e){var t=null;if(!e.is_empty_element&&e.is_start_tag&&e.parent){if("body"===e.tag_name)t=t||this._tag_stack.try_pop("head");else if("li"===e.tag_name)t=t||this._tag_stack.try_pop("li",["ol","ul","menu"]);else if("dd"===e.tag_name||"dt"===e.tag_name)t=(t=t||this._tag_stack.try_pop("dt",["dl"]))||this._tag_stack.try_pop("dd",["dl"]);else if("p"===e.parent.tag_name&&-1!==h.indexOf(e.tag_name)){var n=e.parent.parent;n&&-1!==C.indexOf(n.tag_name)||(t=t||this._tag_stack.try_pop("p"))}else"rp"===e.tag_name||"rt"===e.tag_name?t=(t=t||this._tag_stack.try_pop("rt",["ruby","rtc"]))||this._tag_stack.try_pop("rp",["ruby","rtc"]):"optgroup"===e.tag_name?t=t||this._tag_stack.try_pop("optgroup",["select"]):"option"===e.tag_name?t=t||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):"colgroup"===e.tag_name?t=t||this._tag_stack.try_pop("caption",["table"]):"thead"===e.tag_name?t=(t=t||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]):"tbody"===e.tag_name||"tfoot"===e.tag_name?t=(t=(t=(t=t||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("thead",["table"]))||this._tag_stack.try_pop("tbody",["table"]):"tr"===e.tag_name?t=(t=(t=t||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"]):"th"!==e.tag_name&&"td"!==e.tag_name||(t=(t=t||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]))||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return e.parent=this._tag_stack.get_parser_token(),t}},OV.Beautifier=u,OV}function qV(){if(RV)return Tx;RV=1;var e=function(){if(gV)return Ix.exports;gV=1;var e=EV().Beautifier,t=Yx().Options;return Ix.exports=function(t,n){return new e(t,n).beautify()},Ix.exports.defaultOptions=function(){return new t},Ix.exports}(),t=SV(),n=function(){if(FV)return ZV.exports;FV=1;var e=_V().Beautifier,t=TV().Options;return ZV.exports=function(t,n,r,i){return new e(t,n,r,i).beautify()},ZV.exports.defaultOptions=function(){return new t},ZV.exports}();function r(r,i,a,o){return n(r,i,a=a||e,o=o||t)}return r.defaultOptions=n.defaultOptions,Tx.js=e,Tx.css=t,Tx.html=r,Tx}var UV=(PV||(PV=1,function(e){var t,n,r,i,a=qV();a.js_beautify=a.js,a.css_beautify=a.css,a.html_beautify=a.html,e.exports=(t=a,n=a,r=a,i=function(e,n){return t.js_beautify(e,n)},i.js=t.js_beautify,i.css=n.css_beautify,i.html=r.html_beautify,i.js_beautify=t.js_beautify,i.css_beautify=n.css_beautify,i.html_beautify=r.html_beautify,i)}(Nx)),Nx.exports);const WV=(e,t,n=150)=>{if(!e||!t)return{top:0,left:0};const{top:r,left:i}=e,a=t.getBoundingClientRect();let o=r,l=i;return o-=o+n>t.clientHeight-n+130?Math.floor(n/2)+n-35:10,i>.6*a.width?l-=n+50:i<.5*a.width+n&&(l-=42),{top:o,left:l}},XV=a(({width:t="100%",height:r="100%",VariableDropdownHeight:i="160px",readOnly:a=!1,value:s="",handleChange:d,setValue:u,variableOptionsList:f=[],addForloopPrefix:h=!1,language:C="json",theme:p="light",isRequisiteType:m=!1,onPaste:A,showVariableDropdown:g=!0,defaultValue:v,customOptions:y={},editorVariableZindex:E=99999,showMinimap:b=!0,isFocus:M=!1},L)=>{const H=o(null),V=o([]),k=o(null),S=o(null),[z,Z]=c(0),[O,N]=c(!1),[T,I]=c(!1),[D,F]=c({top:0,left:0}),[R,P]=c([]),j=o(f);l(()=>{j.current=f},[f]);l(()=>{const e=H.current;if(!e)return;const t=e.onDidBlurEditorWidget(()=>{I(!1),k.current=null,S.current=null,V.current=[],Z(0)}),n=t=>{const n=e.getDomNode(),r=n&&n.contains(t.target);if(!r||r&&!t.target.closest(".view-line, .monaco-editor-textarea")){const e=n?.querySelector("textarea");e&&e.blur()}};return document.addEventListener("mousedown",n),()=>{t.dispose(),document.removeEventListener("mousedown",n)}},[T]),l(()=>{const e=H.current;if(!e||!z)return;const t=[],n=[];O?n.push({range:{startLineNumber:z,startColumn:1,endLineNumber:z,endColumn:1},options:{isWholeLine:!1,linesDecorationsClassName:"active-line-number"}}):t.push({range:{startLineNumber:z,startColumn:1,endLineNumber:z,endColumn:1},options:{isWholeLine:!0,className:"current-line-background"}}),V.current=e.deltaDecorations(V.current,[...t,...n])},[z,O]);const B=(e,t)=>{switch(t){case"json":case"javascript":return UV.js(e,{indent_size:4,indent_char:" ",max_preserve_newlines:5,preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!0,brace_style:"collapse",space_before_conditional:!0,unescape_strings:!0,jslint_happy:!0,end_with_newline:!0,wrap_line_length:0,comma_first:!1,e4x:!0,indent_empty_lines:!0});case"html":case"xml":return UV.html(e,{indent_size:4,indent_char:" ",max_preserve_newlines:5,preserve_newlines:!0,end_with_newline:!0,wrap_line_length:0,indent_empty_lines:!0});default:return e}};return w(L,()=>({getEditorInstance:()=>H.current,focus:()=>{H.current?.focus()},beautify:()=>{if(H.current){const e=H.current.getValue(),t=H.current.getModel()?.getLanguageId(),n=B(e,t||"json");H.current.setValue(n)}}})),n("div",{style:{width:t,height:r},className:"ff-editor-container",children:[e(x,{defaultValue:v,height:r,width:t,language:C,value:s,options:{minimap:{enabled:b},lineNumbers:"on",wordWrap:"on",autoClosingBrackets:"always",scrollBeyondLastLine:!1,readOnly:a,guides:{indentation:!1},...y},onMount:(e,t)=>{H.current=e,M&&setTimeout(()=>{e.focus()},0),e.onDidChangeCursorPosition(t=>{Z(t.position.lineNumber);const n=e.getPosition(),r=e.getModel();if(!n||!r)return;const i=r.getLineContent(n.lineNumber),a=n.column-1;if(0===a)return void I(!1);const o=i.lastIndexOf("$",a-1),l=i.lastIndexOf("${",a-1),s=-1!==l?i.indexOf("}",l+2):-1,c=-1!==l&&-1!==s&&a-1>l&&a-1<s,d=!/\}/.test(i.slice(o+1,a));if(-1!==o&&a>o&&!/\s/.test(i.slice(o+1,a))&&!c&&d){k.current=o,S.current=i.slice(o+1,a);const r=(S.current??"").toLowerCase(),l=j.current.filter(e=>("_startforloop"===e.type&&h?`FLV_for:${e.name}`:e.name).toLowerCase().includes(r));P(l);const s=e.getScrolledVisiblePosition(n),c=e.getDomNode();F(WV(s,c,150)),["keyboard","mouse","deleteLeft"].includes(t?.source||"")&&I(!0)}else I(!1),k.current=null,S.current=null}),e.onMouseDown(()=>{setTimeout(()=>{const e=H.current;if(!e)return;const t=e.getPosition(),n=e.getModel();if(!t||!n)return;const r=n.getLineContent(t.lineNumber),i=t.column-2;"$"===r[i]?(k.current=i,S.current=""):(k.current=null,S.current=null)},0)}),e.onDidChangeCursorSelection(()=>{const t=(e.getSelections?.()||[]).some(e=>e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn);N(t)}),e.onDidChangeModelContent(()=>{const t=e.getValue();u(t);const n=e.getPosition(),r=e.getModel();if(!n||!r)return;const i=r.getLineContent(n.lineNumber),a=n.column-2;if("$"===i[k.current??a]){null===k.current&&(k.current=a),S.current=i.slice(k.current+1,a);const t=j.current.filter(e=>("_startforloop"===e.type&&h?`FLV_for:${e.name}`:e.name).toLowerCase().includes(S.current?.toLowerCase()));t.length?P(t):(P([]),k?.current!==a&&" "===i[a]&&(k.current=null,S.current=null,I(!1)));const r=e.getScrolledVisiblePosition(n),o=e.getDomNode();F(WV(r,o,150))}else k.current=null,S.current=null}),e.onDidPaste(()=>{const t=e.getValue();if(t){const n=B(t,C);e.setValue(n),A&&A(n)}}),t.languages.registerCompletionItemProvider(C,{triggerCharacters:["."],provideCompletionItems:(e,n)=>{const r=e.getValueInRange({startLineNumber:n.lineNumber,startColumn:1,endLineNumber:n.lineNumber,endColumn:n.column}),i=e.getWordAtPosition(n),a=i?new t.Range(n.lineNumber,i.startColumn,n.lineNumber,i.endColumn):new t.Range(n.lineNumber,n.column,n.lineNumber,n.column),o=[];return r.endsWith("ff.")&&o.push({label:"getVariable",kind:t.languages.CompletionItemKind.Method,insertText:"getVariable(${1:variableName})",insertTextRules:t.languages.CompletionItemInsertTextRule.InsertAsSnippet,detail:"Get a variable value",range:a},{label:"setVariable",kind:t.languages.CompletionItemKind.Method,insertText:"setVariable(${1:variableName}, ${2:value})",insertTextRules:t.languages.CompletionItemInsertTextRule.InsertAsSnippet,detail:"Set a variable value",range:a},{label:"sendRequest",kind:t.languages.CompletionItemKind.Method,insertText:'sendRequest({\n method: "GET",//add your method\n url: "https://fakestoreapi.com/products",//enter your url\n headers: { },//add your headers,\n params: params,//add your params,\n data: body,//add your request body,\n })',insertTextRules:t.languages.CompletionItemInsertTextRule.InsertAsSnippet,detail:"Make your http requests",range:a}),{suggestions:o}}})},onChange:(e,t)=>d(e,t),theme:p}),T&&D&&g&&e(oL,{position:"absolute",width:"300px",height:i,optionsList:R,onSelectVariable:e=>{if(m&&H.current){const t=H.current,n=t.getPosition();if(n){const r=`'${e.name}'`,i=k?.current??0;t.executeEdits("",[{range:{startLineNumber:n.lineNumber,startColumn:i+1,endLineNumber:n.lineNumber,endColumn:i+(n.column-i)},text:r,forceMoveMarkers:!0}]),S.current=null,k.current=null,I(!1)}}else((e,t)=>{if(H.current){const n=H.current,r=n.getPosition();if(r){const i=`{${t}${"FLV_for:"===t?"":"_"}${e}}`,a=k?.current??0;n.executeEdits("",[{range:{startLineNumber:r.lineNumber,startColumn:a+2,endLineNumber:r.lineNumber,endColumn:a+(r.column-a)},text:i,forceMoveMarkers:!1}]);const o=[];o.push({range:{startLineNumber:z,startColumn:1,endLineNumber:z,endColumn:1},options:{isWholeLine:!1}}),V.current=n.deltaDecorations(V.current,o),S.current=null,k.current=null,I(!1)}}})("DATAPROVIDER"===e?.type?e?.dpName+":"+e?.varname:e?.name,"STEPGROUP"===e.parentVariableType?"SGV":"GLOBAL"===e?.type?"GV":"LOCAL"===e?.type?"LV":(e?._id??e?.id??"").includes("PARAMETER")?"SGP":"_startforloop"===e?.type?"FLV_for:":"DATAPROVIDER"===e?.type?"DPV":"PEV")},dropdownPosition:D,zIndex:E})]})}),QV=e=>e.flatMap(e=>e.runLevelExecutionDataSets.map((t,n)=>{const{runLevelExecutionDataSets:r,...i}=e;return{...i,...t,runCount:n+1}}));var GV,KV={exports:{}};var YV,JV=(GV||(GV=1,"undefined"!=typeof self&&self,KV.exports=(YV=i,function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="lib/",n(n.s=5)}([function(e,t){e.exports=YV},function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ArcherContainerContextProvider=t.ArcherContainerContext=void 0;var i=r(n(0));t.ArcherContainerContext=i.default.createContext(null),t.ArcherContainerContextProvider=t.ArcherContainerContext.Provider},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.encodeId=void 0,t.encodeId=function(e){return encodeURI(e).replace(/%/g,"_")}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.getMarkerId=t.createShapeObj=t.getSourceToTargets=t.getEndShapeFromStyle=void 0;var r=["arrow","circle"];t.getEndShapeFromStyle=function(e){return e.endShape&&Object.keys(e.endShape).filter(function(e){return r.includes(e)})[0]||r[0]},t.getSourceToTargets=function(e){var t=Object.keys(e).map(function(t){return e[t]});return[].concat.apply([],t).sort(function(e,t){return e.order-t.order})},t.createShapeObj=function(e,n){return{arrow:function(){var t;return{arrow:Object.assign(Object.assign({},null==n?void 0:n.arrow),null===(t=e.endShape)||void 0===t?void 0:t.arrow)}},circle:function(){var t;return{circle:Object.assign(Object.assign({},null==n?void 0:n.circle),null===(t=e.endShape)||void 0===t?void 0:t.circle)}}}[(0,t.getEndShapeFromStyle)(e)]()},t.getMarkerId=function(e,t,n){return"".concat(e).concat(t.id).concat(n.id)}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.endShapeDefaultProp=void 0,t.endShapeDefaultProp={arrow:{arrowLength:10,arrowThickness:6},circle:{radius:2,fillColor:"#f00",strokeColor:"#0ff",strokeWidth:1}}},function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ArcherContainer=t.ArcherElement=void 0;var i=n(6);Object.defineProperty(t,"ArcherElement",{enumerable:!0,get:function(){return r(i).default}});var a=n(11);Object.defineProperty(t,"ArcherContainer",{enumerable:!0,get:function(){return r(a).default}})},function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&("get"in i?t.__esModule:!i.writable&&!i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var o=a(n(0)),l=n(7),s=n(1),c=n(2),d=n(8),u=n(10);t.default=function(e){var t=e.id,n=e.relations,r=void 0===n?[]:n,i=e.children,a=(0,o.useMemo)(function(){return(0,c.encodeId)(t)},[t]),f=(0,o.useContext)(s.ArcherContainerContext),h=(0,o.useRef)(),C=(0,o.useCallback)(function(e){var t=(0,u.generateSourceToTarget)(a,e);(0,u.assertContextExists)(f),f.registerTransitions(a,t)},[f,a]),p=(0,o.useCallback)(function(){(0,u.assertContextExists)(f),f.unregisterTransitions(a)},[f,a]),m=(0,o.useCallback)(function(e){e&&((0,u.assertContextExists)(f),f.registerChild(a,e))},[a,f]),A=(0,o.useCallback)(function(){(0,u.assertContextExists)(f),f.unregisterChild(a)},[f,a]);(0,l.useIsomorphicLayoutEffect)(function(){return m(h.current),function(){return A()}},[m,A]),(0,d.useDeepCompareEffect)(function(){return C(r),function(){return p()}},[C,r,p]),o.default.Children.only(i);var g=i;return o.default.cloneElement(g,Object.assign(Object.assign({},g.props),{ref:h}))}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.useIsomorphicLayoutEffect=void 0;var r=n(0);t.useIsomorphicLayoutEffect="undefined"!=typeof window?r.useLayoutEffect:r.useEffect},function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useDeepCompareEffect=void 0;var i=n(0),a=r(n(9));function o(e){var t=(0,i.useRef)();return(0,a.default)(e,t.current)||(t.current=e),t.current}t.useDeepCompareEffect=function(e,t){(0,i.useEffect)(e,t.map(o))}},function(e,t,n){var r=Array.isArray,i=Object.keys,a=Object.prototype.hasOwnProperty,o="undefined"!=typeof Element;e.exports=function(e,t){try{return function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){var l,s,c,d=r(t),u=r(n);if(d&&u){if((s=t.length)!=n.length)return!1;for(l=s;0!=l--;)if(!e(t[l],n[l]))return!1;return!0}if(d!=u)return!1;var f=t instanceof Date,h=n instanceof Date;if(f!=h)return!1;if(f&&h)return t.getTime()==n.getTime();var C=t instanceof RegExp,p=n instanceof RegExp;if(C!=p)return!1;if(C&&p)return t.toString()==n.toString();var m=i(t);if((s=m.length)!==i(n).length)return!1;for(l=s;0!=l--;)if(!a.call(n,m[l]))return!1;if(o&&t instanceof Element&&n instanceof Element)return t===n;for(l=s;0!=l--;)if(!("_owner"===(c=m[l])&&t.$$typeof||e(t[c],n[c])))return!1;return!0}return t!=t&&n!=n}(e,t)}catch(e){if(e.message&&e.message.match(/stack|recursion/i)||-2146828260===e.number)return console.warn("Warning: react-fast-compare does not handle circular references.",e.name,e.message),!1;throw e}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.generateSourceToTarget=t.assertContextExists=void 0;var r=n(2);t.assertContextExists=function(e){if(!e)throw new Error("Could not find ArcherContainerContext in <ArcherElement>. Please wrap the component in a <ArcherContainer>.")},t.generateSourceToTarget=function(e,t){return t.map(function(t){var n=t.targetId,i=t.sourceAnchor,a=t.targetAnchor,o=t.label,l=t.className,s=t.style,c=t.order,d=void 0===c?0:c,u=t.domAttributes,f=t.cursor,h=t.hitSlop;return{source:{id:(0,r.encodeId)(e),anchor:i},target:{id:(0,r.encodeId)(n),anchor:a},className:l,label:o,style:s,order:d,domAttributes:u,cursor:f,hitSlop:h}})}},function(e,t,n){function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);o=!0);}catch(e){l=!0,i=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&("get"in i?t.__esModule:!i.writable&&!i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),l=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return l(t,e),t},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var d=s(n(0)),u=c(n(12)),f=n(1),h=n(14),C=n(4),p=n(19),m=n(20),A={position:"absolute",width:"100%",height:"100%",top:0,left:0,pointerEvents:"none"},g=d.default.forwardRef(function(e,t){var n=e.endShape,a=void 0===n?C.endShapeDefaultProp:n,o=e.strokeColor,l=void 0===o?"#f00":o,s=e.strokeWidth,c=void 0===s?2:s,g=e.svgContainerStyle,v=void 0===g?{}:g,y=e.noCurves,w=e.children,E=e.className,b=e.endMarker,M=e.lineStyle,L=e.offset,H=e.startMarker,x=e.strokeDasharray,V=e.style,k=i((0,d.useState)({}),2),S=k[0],z=k[1],Z=i((0,d.useState)({}),2),O=Z[0],N=Z[1],T=(0,d.useRef)(new u.default(function(){P()})).current,I=(0,d.useRef)(null),D=i(d.default.useState(),2)[1],F=(0,d.useRef)("arrow".concat(Math.random().toString().slice(2))).current;(0,d.useImperativeHandle)(t,function(){return{refreshScreen:P,arrowMarkerUniquePrefix:F}});var R,P=d.default.useCallback(function(){return D({})},[]),j=(0,d.useCallback)(function(e,t){N(function(n){return Object.assign(Object.assign({},n),r({},e,t))})},[]),B=(0,d.useCallback)(function(e){N(function(t){var n=Object.assign({},t);return delete n[e],n})},[]),_=(0,d.useCallback)(function(e,t){z(function(n){return n[e]===t?n:Object.assign(Object.assign({},n),r({},e,t))})},[]),q=(0,d.useCallback)(function(e){z(function(t){var n=Object.assign({},t);return delete n[e],n})},[]),U=(0,d.useMemo)(function(){return Object.assign(Object.assign({},A),v)},[v]);R="function"==typeof w?w(f.ArcherContainerContext):w,(0,m.useResizeListener)(P),(0,m.useObserveElements)(S,T);var W=(0,d.useMemo)(function(){return{registerTransitions:j,unregisterTransitions:B,registerChild:_,unregisterChild:q}},[j,B,_,q]);return d.default.createElement(f.ArcherContainerContextProvider,{value:W},d.default.createElement("div",{style:Object.assign(Object.assign({},V),{position:"relative"}),className:E},d.default.createElement("svg",{style:U},d.default.createElement("defs",null,d.default.createElement(p.ArrowMarkers,{endShape:a,sourceToTargetsMap:O,strokeColor:l,uniqueId:F})),d.default.createElement(h.SvgArrows,{startMarker:H,endMarker:b,endShape:a,strokeColor:l,strokeWidth:c,strokeDasharray:x,noCurves:y,lineStyle:M,offset:L,parentCurrent:I.current,refs:S,uniqueId:F,sourceToTargetsMap:O})),d.default.createElement("div",{style:{height:"100%"},ref:I},R)))});t.default=g},function(e,t,n){n.r(t),function(e){var n=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some(function(e,r){return e[0]===t&&(n=r,!0)}),n}return function(){function t(){this.__entries__=[]}var n={size:{configurable:!0}};return n.size.get=function(){return this.__entries__.length},t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,r=this.__entries__;n<r.length;n+=1){var i=r[n];e.call(t,i[1],i[0])}},Object.defineProperties(t.prototype,n),t}()}(),r="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,i=void 0!==e&&e.Math===Math?e:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),a="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(i):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)},o=2,l=["top","right","bottom","left","width","height","size","weight"],s="undefined"!=typeof MutationObserver,c=function(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(e,t){var n=!1,r=!1,i=0;function l(){n&&(n=!1,e()),r&&c()}function s(){a(l)}function c(){var e=Date.now();if(n){if(e-i<o)return;r=!0}else n=!0,r=!1,setTimeout(s,t);i=e}return c}(this.refresh.bind(this),20)};c.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},c.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},c.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},c.prototype.updateObservers_=function(){var e=this.observers_.filter(function(e){return e.gatherActive(),e.hasActive()});return e.forEach(function(e){return e.broadcastActive()}),e.length>0},c.prototype.connect_=function(){r&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),s?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},c.prototype.disconnect_=function(){r&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},c.prototype.onTransitionEnd_=function(e){var t=e.propertyName;void 0===t&&(t=""),l.some(function(e){return!!~t.indexOf(e)})&&this.refresh()},c.getInstance=function(){return this.instance_||(this.instance_=new c),this.instance_},c.instance_=null;var d=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n+=1){var i=r[n];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0})}return e},u=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||i},f=g(0,0,0,0);function h(e){return parseFloat(e)||0}function C(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];return t.reduce(function(t,n){return t+h(e["border-"+n+"-width"])},0)}function p(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return f;var r=u(e).getComputedStyle(e),i=function(e){for(var t={},n=0,r=["top","right","bottom","left"];n<r.length;n+=1){var i=r[n],a=e["padding-"+i];t[i]=h(a)}return t}(r),a=i.left+i.right,o=i.top+i.bottom,l=h(r.width),s=h(r.height);if("border-box"===r.boxSizing&&(Math.round(l+a)!==t&&(l-=C(r,"left","right")+a),Math.round(s+o)!==n&&(s-=C(r,"top","bottom")+o)),!function(e){return e===u(e).document.documentElement}(e)){var c=Math.round(l+a)-t,d=Math.round(s+o)-n;1!==Math.abs(c)&&(l-=c),1!==Math.abs(d)&&(s-=d)}return g(i.left,i.top,l,s)}var m="undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof u(e).SVGGraphicsElement}:function(e){return e instanceof u(e).SVGElement&&"function"==typeof e.getBBox};function A(e){return r?m(e)?function(e){var t=e.getBBox();return g(0,0,t.width,t.height)}(e):p(e):f}function g(e,t,n,r){return{x:e,y:t,width:n,height:r}}var v=function(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=g(0,0,0,0),this.target=e};v.prototype.isActive=function(){var e=A(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},v.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e};var y=function(e,t){var n=function(e){var t=e.x,n=e.y,r=e.width,i=e.height,a="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,o=Object.create(a.prototype);return d(o,{x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:i+n,left:t}),o}(t);d(this,{target:e,contentRect:n})},w=function(e,t,r){if(this.activeObservations_=[],this.observations_=new n,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=r};w.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof u(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new v(e)),this.controller_.addObserver(this),this.controller_.refresh())}},w.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof u(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},w.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},w.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},w.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(e){return new y(e.target,e.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},w.prototype.clearActive=function(){this.activeObservations_.splice(0)},w.prototype.hasActive=function(){return this.activeObservations_.length>0};var E="undefined"!=typeof WeakMap?new WeakMap:new n,b=function(e){if(!(this instanceof b))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var t=c.getInstance(),n=new w(e,t,this);E.set(this,n)};["observe","unobserve","disconnect"].forEach(function(e){b.prototype[e]=function(){return(t=E.get(this))[e].apply(t,arguments);var t}});var M=void 0!==i.ResizeObserver?i.ResizeObserver:b;t.default=M}.call(this,n(13))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.SvgArrows=void 0;var i=r(n(0)),a=n(15),o=r(n(17)),l=n(3),s=function(e){var t,n,r=e.style||{},s=r.startMarker||e.startMarker,c=null===(n=null!==(t=r.endMarker)&&void 0!==t?t:e.endMarker)||void 0===n||n,d=(0,l.createShapeObj)(r,e.endShape),u=e.domAttributes,f=e.cursor,h=e.hitSlop,C=r.strokeColor||e.strokeColor,p=r.strokeWidth||e.strokeWidth,m=r.strokeDasharray||e.strokeDasharray,A=!(!r.noCurves&&!e.noCurves),g=r.lineStyle||e.lineStyle||(A?"angle":"curve"),v=e.offset||0,y=e.source.anchor,w=(0,a.getPointCoordinatesFromAnchorPosition)(e.source.anchor,e.source.id,e.parentCoordinates,e.refs),E=e.target.anchor,b=(0,a.getPointCoordinatesFromAnchorPosition)(e.target.anchor,e.target.id,e.parentCoordinates,e.refs);return w?b?i.default.createElement(o.default,{className:e.className,startingPoint:w,startingAnchorOrientation:y,endingPoint:b,endingAnchorOrientation:E,strokeColor:C,strokeWidth:p,strokeDasharray:m,arrowLabel:e.label,arrowMarkerId:(0,l.getMarkerId)(e.uniqueId,e.source,e.target),lineStyle:g,offset:v,enableStartMarker:!!s,disableEndMarker:!c,endShape:d,domAttributes:u,hitSlop:h,cursor:f}):(console.warn("[React Archer] Could not find target element! Not drawing the arrow."),null):(console.warn("[React Archer] Could not find starting point of element! Not drawing the arrow."),null)};t.SvgArrows=function(e){var t=(0,a.getPointFromElement)(e.parentCurrent);return t?i.default.createElement(i.default.Fragment,null,(0,l.getSourceToTargets)(e.sourceToTargetsMap).map(function(n){return i.default.createElement(s,{key:JSON.stringify({source:n.source,target:n.target}),source:n.source,target:n.target,className:n.className,label:n.label,style:n.style||{},domAttributes:n.domAttributes,hitSlop:n.hitSlop,cursor:n.cursor,startMarker:e.startMarker,endMarker:e.endMarker,endShape:e.endShape,strokeColor:e.strokeColor,strokeWidth:e.strokeWidth,strokeDasharray:e.strokeDasharray,noCurves:e.noCurves,lineStyle:e.lineStyle,offset:e.offset,parentCoordinates:t,refs:e.refs,uniqueId:e.uniqueId})})):null}},function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getPointCoordinatesFromAnchorPosition=t.getPointFromElement=void 0;var i=r(n(16));function a(e){return new i.default(e.left,e.top)}var o=function(e){return e?e.getBoundingClientRect():null};t.getPointFromElement=function(e){var t=o(e);return t?a(t):null},t.getPointCoordinatesFromAnchorPosition=function(e,t,n,r){var l=o(r[t]);if(!l)return null;var s=function(e,t){switch(e){case"top":return a(t).add(new i.default(t.width/2,0));case"bottom":return a(t).add(new i.default(t.width/2,t.height));case"left":return a(t).add(new i.default(0,t.height/2));case"right":return a(t).add(new i.default(t.width,t.height/2));case"middle":return a(t).add(new i.default(t.width/2,t.height/2));default:return console.error("[React Archer] Invalid anchor position was provided. Not drawing the arrow."),null}}(e,l);return s?s.substract(n):null}},function(e,t,n){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.x=t,this.y=n}return function(e,t){t&&r(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1})}(e,[{key:"add",value:function(t){return new e(this.x+t.x,this.y+t.y)}},{key:"substract",value:function(t){return new e(this.x-t.x,this.y-t.y)}}]),e}();t.default=i},function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.computeLabelDimensions=t.computeEndingAnchorPosition=t.computeStartingAnchorPosition=t.computeArrowPointAccordingToArrowHead=void 0;var i=r(n(0)),a=n(18);function o(e,t,n,r,i,o,l,s){var c=(0,a.computeArrowDirectionVector)(i),d=c.arrowX,u=c.arrowY;if("straight"===o&&void 0!==l&&void 0!==s){var f=Math.atan2(s-t,l-e);d=Math.cos(f),u=Math.sin(f)}return{xPoint:e+d*n*r/2,yPoint:t+u*n*r/2}}function l(e,t,n,r,i){return"top"===i||"bottom"===i?{xAnchor1:e,yAnchor1:t+(r-t)/2}:"left"===i||"right"===i?{xAnchor1:e+(n-e)/2,yAnchor1:t}:{xAnchor1:e,yAnchor1:t}}function s(e,t,n,r,i){return"top"===i||"bottom"===i?{xAnchor2:n,yAnchor2:r-(r-t)/2}:"left"===i||"right"===i?{xAnchor2:n-(n-e)/2,yAnchor2:r}:{xAnchor2:n,yAnchor2:r}}function c(e,t,n,r){return{xLabel:n>e?e:n,yLabel:r>t?t:r,labelWidth:Math.max(Math.abs(n-e),1),labelHeight:Math.max(Math.abs(r-t),1)}}t.computeArrowPointAccordingToArrowHead=o,t.computeStartingAnchorPosition=l,t.computeEndingAnchorPosition=s,t.computeLabelDimensions=c,t.default=function(e){var t=e.className,n=e.startingPoint,r=e.startingAnchorOrientation,a=e.endingPoint,d=e.endingAnchorOrientation,u=e.strokeColor,f=e.strokeWidth,h=e.strokeDasharray,C=e.arrowLabel,p=e.arrowMarkerId,m=e.lineStyle,A=e.offset,g=e.enableStartMarker,v=e.disableEndMarker,y=e.endShape,w=e.domAttributes,E=e.hitSlop,b=void 0===E?10:E,M=e.cursor,L=void 0===M?"pointer":M,H=y.circle?2*y.circle.radius:2*y.arrow.arrowLength,x=o(n.x,n.y,g?H:0,f,r,m,a.x,a.y),V=x.xPoint,k=x.yPoint,S=o(a.x,a.y,v?0:H,f,d,m,n.x,n.y),z=S.xPoint,Z=S.yPoint,O=l(V,k,z,Z,r),N=O.xAnchor1,T=O.yAnchor1,I=s(V,k,z,Z,d),D=function(e){var t=e.xStart,n=e.yStart,r=e.xAnchor1,i=e.yAnchor1,a=e.xAnchor2,o=e.yAnchor2,l=e.xEnd,s=e.yEnd,c=e.lineStyle,d=e.offset;if(d&&0!==d){var u="straight"===c?Math.atan2(s-n,l-t):Math.atan2(i-n,r-t),f=d*Math.cos(u),h=d*Math.sin(u);"straight"!==c&&(t+=f,n+=h),l-=f,s-=h}var C="M".concat(t,",").concat(n," ");return["curve","angle"].includes(c)&&(C+="".concat("curve"===c?"C":"").concat(r,",").concat(i," ").concat(a,",").concat(o," ")),C+"".concat(l,",").concat(s)}({xStart:V,yStart:k,xAnchor1:N,yAnchor1:T,xAnchor2:I.xAnchor2,yAnchor2:I.yAnchor2,xEnd:z,yEnd:Z,lineStyle:m,offset:A}),F=c(V,k,z,Z),R=F.xLabel,P=F.yLabel,j=F.labelWidth,B=F.labelHeight,_="url(#".concat(p,")");return i.default.createElement("g",{className:t},i.default.createElement("path",{d:D,style:{fill:"none",stroke:u,strokeWidth:f,strokeDasharray:h},markerStart:g?_:void 0,markerEnd:v?void 0:_}),w&&i.default.createElement("path",Object.assign({d:D,style:{fill:"none",stroke:"rgba(0, 0, 0, 0)",strokeWidth:b,cursor:w?L:"initial",pointerEvents:"all"}},w)),C&&i.default.createElement("foreignObject",{x:R,y:P,width:j,height:B,style:{overflow:"visible",pointerEvents:"none"}},i.default.createElement("div",{style:{position:"absolute",left:"50%",top:"50%",transform:"translateX(-50%) translateY(-50%)",pointerEvents:"all"}},i.default.createElement("div",null,C))))}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.computeArrowDirectionVector=void 0,t.computeArrowDirectionVector=function(e){switch(e){case"left":return{arrowX:-1,arrowY:0};case"right":return{arrowX:1,arrowY:0};case"top":return{arrowX:0,arrowY:-1};case"bottom":return{arrowX:0,arrowY:1};default:return{arrowX:0,arrowY:0}}}},function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ArrowMarkers=void 0;var i=r(n(0)),a=n(4),o=n(3),l=function(e,t){return function(){var n,r,o,l,s,c,d,u,f,h,C,p,m=(null===(r=null===(n=e.endShape)||void 0===n?void 0:n.circle)||void 0===r?void 0:r.radius)||(null===(o=t.circle)||void 0===o?void 0:o.radius)||a.endShapeDefaultProp.circle.radius,A=(null===(s=null===(l=e.endShape)||void 0===l?void 0:l.circle)||void 0===s?void 0:s.strokeWidth)||(null===(c=t.circle)||void 0===c?void 0:c.strokeWidth)||a.endShapeDefaultProp.circle.strokeWidth,g=(null===(u=null===(d=e.endShape)||void 0===d?void 0:d.circle)||void 0===u?void 0:u.strokeColor)||(null===(f=t.circle)||void 0===f?void 0:f.strokeColor)||a.endShapeDefaultProp.circle.strokeColor,v=(null===(C=null===(h=e.endShape)||void 0===h?void 0:h.circle)||void 0===C?void 0:C.fillColor)||(null===(p=t.circle)||void 0===p?void 0:p.fillColor)||a.endShapeDefaultProp.circle.fillColor;return{markerWidth:4*m,markerHeight:4*m,refX:2*m+A,refY:2*m,path:i.default.createElement("circle",{cx:2*m,cy:2*m,r:m,fill:v,stroke:g,strokeWidth:A})}}},s=function(e,t,n){return function(){var r,o,l,s,c,d,u,f,h=e.strokeColor||n,C=null!==(c=null!==(l=null===(o=null===(r=e.endShape)||void 0===r?void 0:r.arrow)||void 0===o?void 0:o.arrowLength)&&void 0!==l?l:null===(s=null==t?void 0:t.arrow)||void 0===s?void 0:s.arrowLength)&&void 0!==c?c:a.endShapeDefaultProp.arrow.arrowLength,p=(null===(u=null===(d=e.endShape)||void 0===d?void 0:d.arrow)||void 0===u?void 0:u.arrowThickness)||(null===(f=null==t?void 0:t.arrow)||void 0===f?void 0:f.arrowThickness)||a.endShapeDefaultProp.arrow.arrowThickness,m="M0,0 L0,".concat(p," L").concat(C,",").concat(p/2," z");return{markerWidth:C,markerHeight:p,refX:0,refY:p/2,path:i.default.createElement("path",{d:m,fill:h})}}};t.ArrowMarkers=function(e){var t=e.sourceToTargetsMap,n=e.endShape,r=e.strokeColor,a=e.uniqueId;return i.default.createElement(i.default.Fragment,null,(0,o.getSourceToTargets)(t).map(function(e){var t=e.source,c=e.target,d=e.style,u=function(e){var t=e.style,n=e.strokeColor,r=e.endShape,i=(0,o.getEndShapeFromStyle)(t);return{circle:l(t,r),arrow:s(t,r,n)}[i]()}({style:void 0===d?{}:d,endShape:n,strokeColor:r}),f=u.markerHeight,h=u.markerWidth,C=u.path,p=u.refX,m=u.refY;return i.default.createElement("marker",{id:(0,o.getMarkerId)(a,t,c),key:(0,o.getMarkerId)(a,t,c),markerWidth:h,markerHeight:f,refX:p,refY:m,orient:"auto-start-reverse",markerUnits:"strokeWidth"},C)}))}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.useResizeListener=t.useObserveElements=void 0;var r=n(0);t.useObserveElements=function(e,t){(0,r.useEffect)(function(){return Object.keys(e).map(function(n){t.observe(e[n])}),function(){Object.keys(e).map(function(n){t.unobserve(e[n])})}},[e,t])},t.useResizeListener=function(e){(0,r.useEffect)(function(){return window&&window.addEventListener("resize",e),function(){window&&window.removeEventListener("resize",e)}},[e])}}]))),KV.exports);const $V=({getChildNodeComponent:r,parentNodeIndex:i,parentNodeData:a,verticalLineHeight:o,datasetHeight:l,curveHeights:s,itemRefs:c,datasetRef:d,isReadOnlyMode:u,hideNodeAtLast:f})=>e(t,{children:0===a?.machineInstances?.length?e(t,{children:!u&&n(t,{children:[e("div",{className:"ff-selectedMachines-connecting-line",children:n("div",{className:"ff-line",children:[e("div",{className:"ff-left-icon ff-left-icon-aligned"}),e("div",{className:"ff-right-icon"})]})}),e("div",{className:"ff-machine-instance ff-machine-env-button",children:r({isButton:!0,parentNodeData:a,parentNodeIndex:i})})]})}):a?.machineInstances?.map((h,C)=>{const p=0===C;return n("div",{className:"ff-machine-instance-row",children:[n("div",{className:"ff-selectedMachines-connecting-line "+(p?"":"ff-second-line"),children:[n("div",{className:"ff-line",children:[e("div",{className:"ff-left-icon "+(p?"ff-left-icon-aligned":"")}),e("div",{className:"ff-right-icon"})]}),p&&e("div",{className:"ff-vertical-line",style:{height:`${o}px`}})]}),e("div",{className:"ff-machine-instance",children:h?.runLevelExecutionDataSets?.map((o,u)=>e("div",{className:"ff-run-level-execution-dataset",ref:0===u?d:null,children:n("div",{className:"ff-execution-item",ref:e=>c.current[u]=e,children:[e("div",{className:"ff-curved-connector",style:{top:-l+"px"},children:n("div",{className:`ff-curve ff-connector-${u}`,style:{height:`${s[u]}px`},children:[e("div",{className:`ff-curve-right-icon ff-curve-right-icon-${u}`}),Number(h?.runScriptCount)?e("div",{className:"ff-selectedMachines-connecting-line-text",children:e(U,{fontSize:8,fontWeight:"regular",children:`${[0,"0",null].includes(h.runScriptCount)?"":h.runScriptCount} Script${1!==h.runScriptCount?"s":""}`})}):e(t,{})]})}),e("div",{className:"ff-run-data-box",children:r({isButton:!1,childNodeData:h,childNodeIndex:C,runLevelExecutionDataSet:o,runLevelExecutionDataSetIndex:u,parentNodeData:a,parentNodeIndex:i})})]})},o?.runLevelExecutionDataSetId))}),C===a?.machineInstances.length-1&&!f&&e(t,{children:!u&&n(t,{children:[e("div",{className:"ff-selectedMachines-connecting-line ff-second-line",children:n("div",{className:"ff-line",children:[e("div",{className:"ff-left-icon"}),e("div",{className:"ff-right-icon"})]})}),e("div",{className:"ff-machine-instance ff-machine-env-button",children:r({isButton:!0,parentNodeData:a,parentNodeIndex:i,childNodeIndex:C+1})})]})})]},C)})}),ek=({data:t,noOfScripts:r,getChildNodeComponent:a,getParentNodeComponent:s,getParentNodeComponentActionItems:d,childNodeCurveHeight:u=1.28,isReadOnlyMode:f=!1,hideNodeAtLast:h=!0})=>{const C=o(null),[p,m]=c(0),[A,g]=c([]),v=o([]);l(()=>{C.current&&m(C.current.offsetHeight)},[t]);l(()=>{(()=>{const e=v.current.map((e,t)=>0===t?0:p*u);g(e)})()},[p,t]);const y=e=>1+(e.machineInstances?.length+1||0);let w=1;const E=t?.machines?.selectedMachines.reduce((e,t)=>f&&h?e+(e=>!e?.machineInstances||K(e.machineInstances)?1:e.machineInstances.length)(t):e+y(t),0),b=Math.round(E/2);let M=1===b&&f&&2===E||1===b&&!f&&2===E;return e("div",{className:"connecting-branch-container",children:e(JV.ArcherContainer,{strokeColor:"var(--brand-color)",strokeWidth:1,startMarker:!0,endMarker:!1,noCurves:!0,children:n("div",{className:"ff-connecting-branch-grid-container",children:[e(JV.ArcherElement,{id:"rootNode",children:e("div",{className:"ff-grid-item ff-dynamic-item",style:{gridRow:b,top:M?"44px":""},children:e("div",{className:"ff-script-count-container",children:n("div",{className:"ff-script-count-box",children:[e(U,{children:r}),e(U,{children:"Scripts"})]})})})}),t?.machines?.selectedMachines.map((t,r)=>{const o=w,l=y(t);w+=l;const c=((e,t,n)=>1===e.length&&(f||h)?0:e.reduce((t,n,r)=>t+((r!==e.length-1||!f&&!h)&&n.runLevelExecutionDataSets?.length||0),0)*(t+n))(t?.machineInstances,p,16);return e(i.Fragment,{children:n("div",{className:"ff-selectedMachines",style:{gridRow:`${o} / span ${l}`},children:[e("div",{className:"ff-selectedMachines-input",children:n("div",{className:"ff-input-box-container "+(t?.machineInstances.length?"":"ff-input-box-aligned"),children:[e(JV.ArcherElement,{id:`parentnode${r}`,relations:[{targetId:"rootNode",targetAnchor:"left",sourceAnchor:"left"}],children:s({isMultiSelect:!1,parentNodeData:t,parentNodeIndex:r})}),d({parentNodeData:t,parentNodeIndex:r})]})}),e($V,{parentNodeIndex:r,parentNodeData:t,verticalLineHeight:c,datasetHeight:p,curveHeights:A,itemRefs:v,datasetRef:C,getChildNodeComponent:a,isReadOnlyMode:f,hideNodeAtLast:h})]})},r)}),!f&&e("div",{className:"ff-select-machine-input",style:{gridRow:`${w}`},children:e(JV.ArcherElement,{id:"lastNode",relations:[{targetId:"rootNode",targetAnchor:"left",sourceAnchor:"left"}],children:e("div",{children:s({isMultiSelect:!0})})})})]})})})},tk=(e,t)=>{if(!(e&&e instanceof Blob))throw console.error("Invalid Blob object"),new Error("Invalid Blob object");const n=window.navigator;if(n.msSaveOrOpenBlob){const r=n.msSaveOrOpenBlob;r&&r(e,t)}else{const n=document.createElement("a");document.body.appendChild(n);const r=window.URL.createObjectURL(e);n.href=r,n.download=t,n.click(),setTimeout(()=>{window.URL.revokeObjectURL(r),document.body.removeChild(n)},0)}},nk=({hasAtSymbol:t,usersObj:n,optionClicked:r,charsAfterAt:i,mentionUserRef:a})=>{const[s,d]=c(0),u=o([]);if(!t)return null;const f=n.filter(e=>!i||e.name.toLowerCase().startsWith(i.toLowerCase()));l(()=>{d(0)},[i]);const h=C(e=>{if(t&&0!==f.length)switch(e.key){case"ArrowDown":e.preventDefault(),d(e=>(e+1)%f.length);break;case"ArrowUp":e.preventDefault(),d(e=>0===e?f.length-1:e-1);break;case"Enter":e.preventDefault();const t=f[s];t&&r(t.name,t.emailId)}},[f,s,t,r]);return l(()=>{u.current[s]&&u.current[s]?.scrollIntoView({behavior:"smooth",block:"nearest"})},[s]),l(()=>(document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)),[h]),e("div",{className:"select-section",onMouseDown:e=>e.preventDefault(),children:e("div",{className:"select-group",ref:a,children:f.length?f.map((t,n)=>e("div",{ref:e=>u.current[n]=e,className:"mention-option "+(n===s?"hovered":""),onClick:()=>r(t.name,t.emailId),onMouseDown:e=>e.preventDefault(),children:e(U,{children:t.name})},t.id)):e("div",{className:"user-not-found",children:e(U,{children:"No user name found"})})})})},rk=e=>e&&Array.isArray(e)?e.map(({user:e})=>({id:e.id,name:e.name,emailId:e.emailId})):[],ik=(e,t)=>{const n=t.find(t=>`@${t.name.replace(/\s+/g,"")}`===e);return n?n.emailId:null},ak=({handleInsertNode:t,handleEditNode:r,handleDeleteNode:i,comment:a,depth:s=0,isDisable:d,userDetails:u,isEditDeleteActionAllowed:h=!0,createdByID:C,rowBreakCharCount:p=83,isVewMode:m=!1,deleteEnable:A=!0})=>{const[g,v]=c(""),[y,w]=c(!1),[E,b]=c(!1),[M,L]=c(!0),[H,x]=c([]),[V,k]=c(!1),[S,z]=c([]),[Z,O]=c({top:0,left:0}),[N,T]=c(""),I=o(null),D=o(null),F=o(null);l(()=>{y&&a?.description&&v(a?.description)},[y,a.description]),l(()=>{const e=rk(u);x(e)},[u]),l(()=>{const e=(g.match(Gr)||[]).map(e=>ik(e,H)).filter(Boolean);z(e)},[g]),l(()=>{const e=e=>{const t=D.current&&!D.current.contains(e.target)&&I.current&&!I.current.contains(e.target),n=F.current&&!F.current.contains(e.target)&&I.current&&!I.current.contains(e.target);(t||n)&&(k(!1),v(e=>e.replace(/(?:^|\s)(@\w*)$/,"")))};return V&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[V]);const{modifiedByUname:R,createdByUname:P,modifiedOn:j,createdOn:B}=a||{},_=j??B??(new Date).toLocaleString(),W=R??P??"Anonymous",X=s>2,Q=W?W.charAt(0).toUpperCase():"A";l(()=>{y&&a.description&&v(a.description)},[y,a.description]);const G=()=>{0!==g.trim().length&&(y?(r(a.id,g,S),b(!1),v("")):(L(!0),t(a.id,g,S),b(!1),v("")),y&&w(!1))};l(()=>{(()=>{if(!I.current)return;const e=I?.current,t=y?D?.current:F?.current,n=I.current.selectionStart,r=((e,t)=>{const n=document.createElement("div"),r=getComputedStyle(e);n.style.cssText=`\n position: absolute;\n visibility: hidden;\n white-space: pre-wrap;\n word-wrap: break-word;\n overflow: auto;\n width: ${e.offsetWidth}px;\n height: ${e.offsetHeight}px;\n font-family: ${r.fontFamily};\n font-size: ${r.fontSize};\n padding: ${r.padding};\n border: ${r.border};\n box-sizing: ${r.boxSizing};\n line-height: ${r.lineHeight};\n `,n.scrollTop=e.scrollTop,n.scrollLeft=e.scrollLeft,document.body.appendChild(n);const i=e.value.slice(0,t);n.textContent=i||".";const a=document.createElement("span");a.textContent=".",n.appendChild(a);const o=a.getBoundingClientRect();return document.body.removeChild(n),{top:o.top-20,left:o.left}})(e,n),i=t?.getBoundingClientRect().height??0,a=e?.getBoundingClientRect();if(!a)return;const o=window.innerHeight-a.bottom,l=a.top;O({top:o<i&&l>i?n-i-16:n+32,left:r.left+10})})()},[g]);const K=e=>{const t=e.target.value;v(t);const n=(t.match(/@\S+/g)||[]).map(e=>ik(e,H)).filter(e=>null!==e);z(n);const r=e.target.selectionStart,i=t.slice(0,r),a=i.match(ni);T(a?.[1]||"");const o=ti.test(i);k(!!o)},J=e=>{if("@"===e.key)k(!0);else if("Backspace"===e.key&&I.current){const t=I.current.selectionStart,n=g.slice(0,t);n.endsWith("@")&&k(!1);const r=n.match(Jr);if(r){e.preventDefault();const i=r[1],a=n.lastIndexOf(i||""),o=g.slice(0,a)+g.slice(t);v(o),k(!1),z(()=>(o.match(/@\w+/g)||[]).map(e=>e.slice(1)).map(e=>ik(e,H)).filter(Boolean)),setTimeout(()=>{I.current?.setSelectionRange(a,a)},0)}}},$=e=>{if(!I.current)return;const t=I.current.selectionStart,n=g.slice(0,t),r=n.match(Kr);if(r){const i=n.lastIndexOf(r[1]||""),a=g.slice(t),o=`@${e.replace(/\s+/g,"")} `,l=g.slice(0,i)+o+a;v(l),k(!1),setTimeout(()=>{I.current?.focus(),I.current?.setSelectionRange(i+o.length+1,i+o.length+1)},0),z(()=>(l.match(/@\w+/g)||[]).map(e=>e.slice(1)).map(e=>ik(e,H)).filter(Boolean))}};return e("div",{className:"commentsContainer",children:n("div",{className:"comment-wrapper",children:[n("div",{className:"commentContainer",children:[e("div",{className:"commentContainer__avatar",children:a?.profileImage?e("img",{height:30,width:30,src:`data:image/jpeg;base64,${a?.profileImage}`}):Q}),n("div",{className:"ff-message-container",children:[n("div",{className:"ff-message",children:[e("div",{className:"ff-message-name",children:W}),e("div",{className:"ff-message-time",children:_})]}),n("div",{className:"ff-editable-container",children:[!y&&e(U,{className:"typography-text",children:a?.description?.split(ri).map((t,n)=>t.startsWith("@")?e("b",{children:t},`highlight-${n}`):e(f,{children:t},`text-${n}`))}),y&&n("div",{className:"inputContainer",children:[e("textarea",{rows:g.length<p?1:3,className:"inputContainer_input first_input",value:g,autoFocus:!0,placeholder:"Edit comment",ref:I,onChange:e=>K(e),onKeyDown:J}),V&&e("div",{id:"mention-user",style:{position:"absolute",top:`${Z.top}px`,left:`${Z.left}px`},children:e(nk,{hasAtSymbol:V,usersObj:H,optionClicked:$,charsAfterAt:N,mentionUserRef:D})}),n("div",{className:"edit-comment",children:[e("div",{className:"reply",children:e(Y,{title:y?"Update":"Add",children:e(q,{name:"comment_reply",hoverEffect:!0,disabled:y&&g.trim()===(a?.description?.trim()??"")||0===g.trim().length,onClick:()=>{G(),w(!1),b(!1)}})})}),e("div",{className:"reply",onClick:()=>{w(!1),b(!1),v("")},children:e(Y,{title:y?"Cancel":"Close",children:e(q,{name:"close",color:"var(--ff-delete-button-attachment)",hoverEffect:!0})})})]})]}),n("div",{className:"comment-actions",children:[!X&&s<2&&a.comments?.length>0&&e("div",{className:"action-icon",onClick:()=>L(e=>!e),children:e(Y,{title:""+(M?"collapse":"expand"),children:e(q,{name:M?"collapse-arrow":"expand-arrow",disabled:y||E,hoverEffect:!0})})}),!X&&s<2&&0===a.comments?.length&&e("div",{className:"action-icon",children:e(q,{name:"expand-arrow",disabled:!0})}),!m&&n("div",{className:"ff-comment-action-item",children:[s<2&&e("div",{className:"action-icon",children:e(Y,{title:"Reply",children:e(q,{name:"comment_icon",disabled:y||d,hoverEffect:!0,onClick:()=>{b(!0)}})})}),h&&e("div",{className:"action-icon",children:e(Y,{title:"Edit",children:e(q,{name:"edit",disabled:E||d,hoverEffect:!0,onClick:()=>w(!0)})})}),h&&A&&e("div",{className:"action-icon",children:e(Y,{title:"Delete",children:e(q,{name:"delete",color:"var(--ff-delete-button-attachment)",onClick:()=>{E||i(a.id)},disabled:y||E||d,hoverEffect:!0})})})]})]})]})]})]}),e("div",{className:"comment-reply-container",children:E&&n("div",{className:"inputContainer",children:[e("textarea",{rows:g.length<p?1:3,className:"inputContainer_input first_input",value:g,autoFocus:!0,placeholder:"Add reply comments",ref:I,onChange:e=>K(e),onKeyDown:J}),V&&e("div",{id:"mention-user",style:{position:"absolute",top:`${Z.top}px`,left:`${Z.left}px`},children:e(nk,{hasAtSymbol:V,usersObj:H,optionClicked:$,charsAfterAt:N,mentionUserRef:F})}),n("div",{className:"edit-comment",children:[e("div",{className:"reply",onClick:()=>{G(),w(!1),b(!1)},children:e(Y,{title:"Reply",children:e(q,{name:"comment_reply",hoverEffect:!0,disabled:Boolean(!g.length)})})}),e("div",{className:"reply",onClick:()=>{w(!1),b(!1),v("")},children:e(Y,{title:"Cancel",children:e(q,{name:"close",color:"var(--ff-delete-button-attachment)",hoverEffect:!0})})})]})]})}),M&&a.comments?.length>0&&e("div",{className:`child-comments ${0===s?"first-level-child":""} ${1===s?"second-level-child":""}`,children:a.comments.map(n=>e("div",{className:`child-comments child-comments-${s+1}`,children:e(ak,{handleInsertNode:t,handleEditNode:r,handleDeleteNode:i,comment:n,depth:s+1,isDisable:d,userDetails:u,isEditDeleteActionAllowed:a.createdBy===C,createdByID:C,isVewMode:m})},n.id))})]})})},ok=({commentsData:t,handleAddComment:r,handleEditComment:i,handleDeleteComment:a,onCommentsDataChange:s,currentUser:d,isDisable:u=!1,userDetails:f,createdByID:h,rowBreakCharCount:p=83,isVewMode:m=!1,deleteEnable:A=!0,showTextarea:g=!1,autoFocus:v=!1})=>{const[y,w]=c(""),[E,b]=c([]),[M,L]=c(!1),[H,x]=c([]),[V,k]=c({top:0,left:0}),[S,z]=c(""),Z=o(null),O=o(null),[N,T]=c(!1);l(()=>{const e=rk(f);x(e)},[f]);const I=(e,t)=>{for(const n of e){if(n.id===t)return n;const e=I(n.comments,t);if(e)return e}return null};l(()=>{t&&b(t)},[t]),l(()=>{const e=e=>{O.current&&!O.current.contains(e.target)&&(L(!1),w(e=>{const t=e.split(" ");return t.length>0&&t?.[t?.length-1]?.startsWith("@")?t.slice(0,-1).join(" "):e}))};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]);const{insertNode:D,editNode:F,deleteNode:R}=(()=>{const e=(t,n,r)=>t.map(t=>t.id===n?{...t,comments:[...t.comments,{id:pi(),description:r.description,comments:[],createdBy:t.createdBy,modifiedBy:t.modifiedBy,createdByUname:t.createdByUname,modifiedByUname:t.modifiedByUname,createdOn:(new Date).toLocaleString(),modifiedOn:(new Date).toLocaleString(),commentParentId:n}]}:{...t,comments:e(t.comments,n,r)}),t=(e,n,r)=>e.map(e=>({...e,description:e.id===n?r:e.description,comments:t(e.comments,n,r)})),n=(e,t)=>e.filter(e=>e.id!==t).map(e=>({...e,comments:n(e.comments,t)}));return{insertNode:e,editNode:t,deleteNode:n}})(),P=(e,t,n)=>{if(!t.trim())return;const i={id:pi(),description:t,commentParentId:e,emailId:n,comments:[],createdBy:d?.createdBy,modifiedBy:d?.modifiedBy,createdByUname:d?.createdByUname,modifiedByUname:d?.modifiedByUname,createdOn:(new Date).toISOString(),modifiedOn:(new Date).toISOString()};b(t=>D(t,e,i)),r&&r(i,I(E,e))},j=C((e,t,n)=>{const r=F(E,e,t);b(r);const a=I(r,e);i&&i(e,t,a,n)},[E,F,i]),B=C(async e=>{try{if(a){const t=await a(e);if(t?.success){const t=R(E,e);b(t)}}}catch(e){console.error("Error deleting comment:",e)}},[R,a]);l(()=>{s&&s(E)},[E,s]);l(()=>{(()=>{if(!Z.current)return;const e=Z?.current,t=O?.current,n=Z.current.selectionStart,r=((e,t)=>{const n=document.createElement("div"),r=getComputedStyle(e);n.style.cssText=`\n position: absolute;\n visibility: hidden;\n white-space: pre-wrap;\n word-wrap: break-word;\n overflow: auto;\n width: ${e.offsetWidth}px;\n height: ${e.offsetHeight}px;\n font-family: ${r.fontFamily};\n font-size: ${r.fontSize};\n padding: ${r.padding};\n border: ${r.border};\n box-sizing: ${r.boxSizing};\n line-height: ${r.lineHeight};\n `,n.scrollTop=e.scrollTop,n.scrollLeft=e.scrollLeft,document.body.appendChild(n);const i=e.value.slice(0,t);n.textContent=i||".";const a=document.createElement("span");a.textContent=".",n.appendChild(a);const o=a.getBoundingClientRect();return document.body.removeChild(n),{top:o.top,left:o.left}})(e,n),i=t?.getBoundingClientRect().height??0,a=e?.getBoundingClientRect();if(!a)return;const o=window.innerHeight-a.bottom,l=a.top;k({top:o<i&&l>i?n-i-16:n+32,left:r.left+10})})()},[y]);l(()=>{y.includes("\n")||T(!1)},[y]);return n("div",{className:"ff-comments-container-box",children:[!m&&n("div",{className:"ff-first-comment "+(g?"no-border":""),children:[e(U,{fontWeight:"semi-bold",className:"ff-comment-heading",children:"Comments"}),!g&&n("div",{className:"input-wrapper",children:[e("textarea",{className:"inputContainer_input first_input",rows:N?3:y.length<p?1:3,autoFocus:v,value:y,onChange:e=>(e=>{const t=e.target.value;w(t);const n=e.target.selectionStart,r=t.slice(0,n),i=r.match(ni);z(i?.[1]||"");const a=ti.test(r);L(!!a),t||T(!1)})(e),placeholder:"Add a comment",disabled:u,ref:Z,onKeyDown:e=>{if("@"===e.key)L(!0);else if("Backspace"===e.key&&Z.current){const t=Z.current.selectionStart;if(y.slice(0,t).endsWith("@")&&L(!1),M){e.preventDefault();const n=y.slice(0,t-1)+y.slice(t);w(n);const r=t-1,i=n.slice(0,r).match(ni);z(i?.[1]||""),L(!!i),setTimeout(()=>{Z.current?.setSelectionRange(r,r)},0)}}"Enter"===e.key&&T(!0)}}),M&&e("div",{id:"mention-user",style:{position:"absolute",top:`${V.top}px`,left:`${V.left}px`},children:e(nk,{hasAtSymbol:M,usersObj:H,optionClicked:e=>{if(!Z.current)return;const t=Z.current.selectionStart,n=y.slice(0,t),r=n.match(Yr);if(r){const i=n.lastIndexOf(r[1]??""),a=y.slice(t),o=`@${e} `,l=y.slice(0,i)+o+a;w(l),L(!1),setTimeout(()=>{Z.current?.focus();const e=i+o.length+1;Z.current?.setSelectionRange(e,e)},0)}},charsAfterAt:S,mentionUserRef:O})}),e("span",{className:"reply-comment",children:e(Y,{title:"Add",children:e(q,{name:"comment_reply",onClick:()=>{if(!y.trim())return;const e=H.filter(e=>new RegExp(`@${e.name}\\b`,"i").test(y)).map(e=>e.emailId),t={id:pi(),description:y,comments:[],createdBy:d?.createdBy,modifiedBy:d?.modifiedBy,createdByUname:d?.createdByUname,modifiedByUname:d?.modifiedByUname,createdOn:(new Date).toISOString(),modifiedOn:(new Date).toISOString(),commentParentId:"",emailId:e};r&&r(t,null),b(e=>[...e,t]),w("")},hoverEffect:!0,disabled:Boolean(!y.length)})})})]})]}),E.length>0&&E.map(t=>e(ak,{handleInsertNode:P,handleEditNode:j,handleDeleteNode:B,comment:t,depth:0,isDisable:u,userDetails:f,isEditDeleteActionAllowed:t.createdBy===h,createdByID:h,isVewMode:m,deleteEnable:A},t.id))]})},lk=()=>{const e=o(!0);return{canTrigger:()=>e.current,setTriggered:()=>{e.current=!1},resetTrigger:()=>{e.current=!0}}},sk=({isOpen:t,onClose:r,onContinue:i,titleMessage:a="Warning!",subTitleMessage:o="Unsaved Changes.",iconName:l,modalMessage:s="Your web service data will be lost. Are you sure you want to exit?",firstButtonLabel:c="Cancel",secondButtonLabel:d="Continue",buttonVariant:u="warning",border:f="1px solid var(--warning-modal-border-color)",popupWidth:h="420",popupHeight:C="226",colorForTitleMessage:p="var(--status-button-bg-warning)",footerContent:m,firstButtonDisabled:A=!1,secondButtonDisabled:g=!1,zIndex:v=1100,iconSize:y=94})=>e(kp,{overlayClassName:"custom-overlay",isOpen:t,onClose:r,isHeaderDisplayed:!1,zIndex:v,children:n("div",{className:"warning_modal_container",children:[n("div",{className:"warning_modal_content",children:[e(q,{name:l,className:"warning_modal_icon",width:y,height:y}),n("div",{className:"warning_modal_message",children:[n(U,{fontSize:20,fontWeight:"semi-bold",className:"warning_modal_title_wrapper",children:[" ",n(U,{color:`${p}`,fontSize:20,fontWeight:"semi-bold",children:[" ",a," "]})," ",o]}),n("div",{className:"warning_modal_message_wrapper",children:[e(U,{fontSize:16,children:s}),e(U,{as:"div",children:m})]})]})]}),n("div",{className:"warning_modal_footer_button",children:[e(W,{buttonHeight:"24px",variant:"secondary",label:c,onClick:r,disabled:A}),d&&e(W,{buttonHeight:"24px",variant:u||"warning",label:d,onClick:i,disabled:g})]})]}),ariaHideApp:!0,isFooterDisplayed:!1,customWidth:`${h}px`,customHeight:`${C}px`,boxShadow:"0px 1px 4px 0px var(--toaster-boxshadow)",border:f});function ck(e,t=[]){return t.reduce((e,t)=>e.replace(new RegExp(function(e){return e.replace(Fr,"\\$&")}(t),"gi"),""),e).replace(/([A-Z])/g," $1").trim().replace(/^./,e=>e.toUpperCase())}function dk(e,t=[]){return e.toUpperCase()===e&&(e=e.toLowerCase()),e.includes("_")?function(e){return e.toLowerCase().replace(/_/g," ").replace(/^./,e=>e.toUpperCase())}(e):ck(e,t)}const uk=({onSelectVariable:t,dropdownPosition:r,filteredOptions:i=[],position:a="relative",width:s="300px",zIndex:c=1e3,height:d="160px",truncateTextValue:u=34,isTruncateText:f=!1,highlightedIndex:h})=>{const C=o(null);return l(()=>{C.current?.scrollIntoView({block:"nearest"})},[h]),n("div",{className:T("ff-variable-dropdown",a),style:r?{top:r.top+30,left:r.left-30,width:s,zIndex:c}:{width:s,zIndex:c,height:d},children:[i?.map((n,r)=>{const i=f?Hn(n?.name,u,"pixel"):n?.name,a=!!f&&xn(n?.name,u,"pixel");return e("div",{className:T("ff-variable-option",{"ff-variable-option--highlighted":h===r}),onClick:()=>t(n),ref:h===r?C:null,children:f?e(Y,{title:a?n?.name:"",children:e(U,{children:i})}):e(U,{children:i})},n?.id)}),0===i?.length&&e("div",{className:"ff-variable-option .ff-variable-option-no-data ",children:e(U,{as:"span",fontSize:14,children:"No Option"})})]})},fk=a(({label:t="",hashInputValue:r="",setHashInputValue:i,variableList:a=[],handleClearInput:s,addForloopPrefix:d=!1,placeholder:u="Enter text",onChange:f,onCreateVariableClick:C,value:p="",dropdownWidth:m="inherit",isHash:A=!1,dataFiles:g=[],showAddVariableIcon:v=!0,helperText:y="",error:E,autoComplete:b="off",showHidePasswordIcon:M=!0,required:H=!1,formProps:x={},onlyDropdown:V=!1,type:k,onFocus:S,onBlur:z,readOnly:Z=!1,height:O="160px",truncateTextValue:N=34,isTruncateText:T=!1,isClearIconShow:I=!1,optionsDropdownPosition:D="relative",width:F,...R},P)=>{const[j,B]=c(!1),_=o(!1),[W,X]=c(0),[Q,G]=c(!1),[J,$]=c(null),[ee,te]=c(0),[ne,re]=c(!1),[ie,ae]=c(!1),[oe,le]=c([]),[se,ce]=c({top:0,left:0,width:0,fromBottom:0}),de=o(null);w(P,()=>de.current),l(()=>{null!==J&&de.current&&(de.current.setSelectionRange(J,J),de.current.focus())},[J]),l(()=>{const e=p||"";if(A?B(e.startsWith("#")):ae(!e.includes("$")),e.startsWith("#")&&A){const t=e.slice(1).toLowerCase(),n=(Array.isArray(g)?g:[]).filter(e=>{if(!e)return!1;return("string"==typeof e?e:e.name||"").toLowerCase().includes(t)}).map((e,t)=>"string"==typeof e?{id:t+1,name:e}:{id:e.id||e._id||t+1,name:e.name||"",...e});le(n),B(!0)}},[p,g,A]),l(()=>{if(!ne&&V){const e=Array.isArray(g)?g:[],t=p||"",n=e.filter(e=>{if(!e)return!1;return("string"==typeof e?e:e.name||"").toLowerCase().includes(t.toLowerCase())}).map((e,t)=>"string"==typeof e?{id:t+1,name:e}:{id:e.id||e._id||t+1,name:e.name||"",...e});le(n),B(n.length>0)}re(!1)},[p,g,V,ne]);const ue=()=>{de.current&&(te(de.current.selectionStart||0),G(!0))},fe=ue,he=ue;l(()=>{de.current&&te(de.current.selectionStart||0)},[p]);const Ce=e=>{if(de.current){const{selectionStart:t,selectionEnd:n}=de.current,r=`{${"STEPGROUP"===e.parentVariableType?"SGV":"LOCAL"===e.type?"LV":"GLOBAL"===e.type?"GV":"GROUP"===e.type?"SGV":[String(e?._id??""),String(e?.id??"")].some(e=>e.includes("PARAMETER"))?"SGP":"_startforloop"===e.type?"FLV_for:":"DATAPROVIDER"===e.type?"DPV":"PEV"}${"_startforloop"===e?.type?"":"_"}${"DATAPROVIDER"===e?.type?e?.dpName+":"+e?.varname:e.name}}`,a=p||"";let o;if(o=A&&"#"===a[0]||V&&!e?.type?e.name+a.slice(n||1):a.slice(0,function(e,t){const n=e.lastIndexOf("$",t-1),r=e.indexOf("$",t);return-1===n&&-1===r?-1:-1===n?r:-1===r||Math.abs(t-n)<=Math.abs(r-t)?n:r}(a,ee)||0)+"$"+r+a.slice(n||0),f){f({target:{value:o}},e)}de.current.value=o,i?.(e),$((t||0)+r.length),B(!1),G(!1),re(!0),_.current=!0}};const pe=function(e,t,n){let r=!1,i="";const a="}"===e[t-1];if(t<0||t>e.length)return{showDropdown:r,searchString:i};const o=e.lastIndexOf("$",t-1),l=e.indexOf("$",t);if(-1!==o&&(t===o+1?(r=!0,i=""):(i=e.slice(o+1,-1===l?void 0:l),t>o+1&&(i=e.slice(o+1,t)),r=!0),_.current&&a&&(r=!1),(/[{}]/.test(i)||0===t)&&(r=!1,i=""),i)){n.some(e=>("_startforloop"===e.type&&d?`FLV_for:${e.name}`:e.name).toLowerCase().includes(i.toLowerCase()))||(r=!1,i="")}return{showDropdown:r,searchString:i}}(p||"",ee,a),[me,Ae]=c(!1),ge=h(()=>a.filter(e=>("_startforloop"===e.type&&d?`FLV_for:${e.name}`:e.name).toLowerCase().includes(pe?.searchString.toLowerCase())),[a,d,pe?.searchString]),ve=o(null),ye=e=>{e&&e.target&&e.target.closest(".dropdown-container")||(ve.current&&cancelAnimationFrame(ve.current),ve.current=requestAnimationFrame(()=>{if(de.current){const e=de.current.getBoundingClientRect();let t=parseInt(O)||160;const n=j&&(A||V);pe?.showDropdown&&Q?t=ge.length>0?Math.min(32*ge.length,parseInt(O)||160):40:n&&(t=parseInt(O)||160);const r=window.innerHeight-e.bottom,i=e.top;ce({top:"top"===(r<t&&i>r?"top":"bottom")?e.top+window.scrollY-t-30:e.top+window.scrollY,left:e.left+window.scrollX+30,width:e.width,fromBottom:document.documentElement.clientHeight-e.bottom})}}))};l(()=>{if(pe?.showDropdown&&Q||j&&(A||V))return ye(),window.addEventListener("scroll",ye,!0),window.addEventListener("resize",ye),()=>{window.removeEventListener("scroll",ye,!0),window.removeEventListener("resize",ye),ve.current&&cancelAnimationFrame(ve.current)}},[Q,j,p,pe,ge.length,oe.length]);return n("div",{className:"ff-add-variable-container",style:F?{width:F,flex:F.endsWith("%")?"1 1 auto":"0 0 auto"}:void 0,children:[n("div",{className:"ff-add-variable-input",children:[e(Hi,{readOnly:Z,...R,name:"add_variable",ref:de,type:((e,t)=>"password"===e?t?"text":"password":e??"text")(k,me),value:p,onChange:f,variant:"primary",label:t,onKeyDown:e=>{const t=pe?.showDropdown?ge:oe;if(t.length)switch(e.key){case"ArrowDown":e.preventDefault(),e.stopPropagation(),X(e=>e<t.length-1?e+1:e);break;case"ArrowUp":e.preventDefault(),e.stopPropagation(),X(e=>e>0?e-1:0);break;case"Enter":e.preventDefault(),e.stopPropagation(),t[W]&&(Ce(t[W]),X(0));break;case"Escape":e.preventDefault(),e.stopPropagation(),B(!1),X(0)}},placeholder:u,onClick:fe,onKeyUp:he,onFocus:e=>{_.current?_.current=!1:setTimeout(()=>{G(!0),S?.(e)},500)},onBlur:e=>{(e=>{e.relatedTarget&&e.relatedTarget.closest(".dropdown-container")||G(!1)})(e),z?.(e)},autoComplete:b,helperText:y,error:E,iconProps:{isClearIcon:I,onIconClick:s},required:H,...x}),"password"===k&&M&&e(Y,{title:me?"Hide":"Show",children:e(U,{as:"span",className:"ff-password-icon",children:e(q,{onClick:()=>{Ae(e=>!e)},name:me?"hide_access_icon":"view_access_icon",width:16,height:16,hoverEffect:!0})})}),!K(p)&&!A&&ie&&v&&e(Y,{title:"Add Variable",children:e(q,{onClick:C,name:"add_variable",width:24,height:24,hoverEffect:!0})})]}),pe?.showDropdown&&Q&&L(e("div",{onMouseDown:e=>e.preventDefault(),className:"dropdown-container",children:e(oL,{position:"absolute",width:se.width?`${se.width}px`:m,optionsList:ge,onSelectVariable:Ce,height:O,highlightedIndex:W,dropdownPosition:se})}),document.body),j&&(A||V)&&L(e("div",{onMouseDown:e=>e.preventDefault(),className:"dropdown-container",children:e(uk,{position:"absolute",width:se.width?`${se.width}px`:m,filteredOptions:oe,zIndex:2e3,onSelectVariable:Ce,height:O,isTruncateText:T,truncateTextValue:N,highlightedIndex:W,dropdownPosition:se})}),document.body)]})}),hk=(e,t)=>{const n=new Set;for(const r of e){const e=t?r[t]:JSON.stringify(r);if(n.has(e))return!0;n.add(e)}return!1};var Ck,pk;var mk=(pk||(pk=1,Ck=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=9)}([function(e,t){e.exports=i},function(e,t,n){var r;
|
|
44
|
+
*/var vx={};void 0!==vx.asn1&&vx.asn1||(vx.asn1={}),vx.asn1.ASN1Util=new function(){this.integerToByteHex=function(e){var t=e.toString(16);return t.length%2==1&&(t="0"+t),t},this.bigIntToMinTwosComplementsHex=function(e){var t=e.toString(16);if("-"!=t.substring(0,1))t.length%2==1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t);else{var n=t.substring(1).length;n%2==1?n+=1:t.match(/^[0-7]/)||(n+=2);for(var r="",i=0;i<n;i++)r+="f";t=new zH(r,16).xor(e).add(zH.ONE).toString(16).replace(/^-/,"")}return t},this.getPEMStringFromHex=function(e,t){return hextopem(e,t)},this.newObject=function(e){var t=vx.asn1,n=t.DERBoolean,r=t.DERInteger,i=t.DERBitString,a=t.DEROctetString,o=t.DERNull,l=t.DERObjectIdentifier,s=t.DEREnumerated,c=t.DERUTF8String,d=t.DERNumericString,u=t.DERPrintableString,f=t.DERTeletexString,h=t.DERIA5String,C=t.DERUTCTime,p=t.DERGeneralizedTime,m=t.DERSequence,A=t.DERSet,g=t.DERTaggedObject,v=t.ASN1Util.newObject,y=Object.keys(e);if(1!=y.length)throw"key of param shall be only one.";var w=y[0];if(-1==":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+w+":"))throw"undefined key: "+w;if("bool"==w)return new n(e[w]);if("int"==w)return new r(e[w]);if("bitstr"==w)return new i(e[w]);if("octstr"==w)return new a(e[w]);if("null"==w)return new o(e[w]);if("oid"==w)return new l(e[w]);if("enum"==w)return new s(e[w]);if("utf8str"==w)return new c(e[w]);if("numstr"==w)return new d(e[w]);if("prnstr"==w)return new u(e[w]);if("telstr"==w)return new f(e[w]);if("ia5str"==w)return new h(e[w]);if("utctime"==w)return new C(e[w]);if("gentime"==w)return new p(e[w]);if("seq"==w){for(var E=e[w],b=[],M=0;M<E.length;M++){var L=v(E[M]);b.push(L)}return new m({array:b})}if("set"==w){for(E=e[w],b=[],M=0;M<E.length;M++){L=v(E[M]);b.push(L)}return new A({array:b})}if("tag"==w){var H=e[w];if("[object Array]"===Object.prototype.toString.call(H)&&3==H.length){var x=v(H[2]);return new g({tag:H[0],explicit:H[1],obj:x})}var V={};if(void 0!==H.explicit&&(V.explicit=H.explicit),void 0!==H.tag&&(V.tag=H.tag),void 0===H.obj)throw"obj shall be specified for 'tag'.";return V.obj=v(H.obj),new g(V)}},this.jsonToASN1HEX=function(e){return this.newObject(e).getEncodedHex()}},vx.asn1.ASN1Util.oidHexToInt=function(e){for(var t="",n=parseInt(e.substring(0,2),16),r=(t=Math.floor(n/40)+"."+n%40,""),i=2;i<e.length;i+=2){var a=("00000000"+parseInt(e.substring(i,i+2),16).toString(2)).slice(-8);if(r+=a.substring(1,8),"0"==a.substring(0,1))t=t+"."+new zH(r,2).toString(10),r=""}return t},vx.asn1.ASN1Util.oidIntToHex=function(e){var t=function(e){var t=e.toString(16);return 1==t.length&&(t="0"+t),t},n=function(e){var n="",r=new zH(e,10).toString(2),i=7-r.length%7;7==i&&(i=0);for(var a="",o=0;o<i;o++)a+="0";r=a+r;for(o=0;o<r.length-1;o+=7){var l=r.substring(o,o+7);o!=r.length-7&&(l="1"+l),n+=t(parseInt(l,2))}return n};if(!e.match(/^[0-9.]+$/))throw"malformed oid string: "+e;var r="",i=e.split("."),a=40*parseInt(i[0])+parseInt(i[1]);r+=t(a),i.splice(0,2);for(var o=0;o<i.length;o++)r+=n(i[o]);return r},vx.asn1.ASN1Object=function(){this.getLengthHexFromValue=function(){if(void 0===this.hV||null==this.hV)throw"this.hV is null or undefined.";if(this.hV.length%2==1)throw"value hex must be even length: n=0,v="+this.hV;var e=this.hV.length/2,t=e.toString(16);if(t.length%2==1&&(t="0"+t),e<128)return t;var n=t.length/2;if(n>15)throw"ASN.1 length too long to represent by 8x: n = "+e.toString(16);return(128+n).toString(16)+t},this.getEncodedHex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""}},vx.asn1.DERAbstractString=function(e){vx.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=stohex(this.s)},this.setStringHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e?this.setString(e):void 0!==e.str?this.setString(e.str):void 0!==e.hex&&this.setStringHex(e.hex))},gx(vx.asn1.DERAbstractString,vx.asn1.ASN1Object),vx.asn1.DERAbstractTime=function(e){vx.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(e){return utc=e.getTime()+6e4*e.getTimezoneOffset(),new Date(utc)},this.formatDate=function(e,t,n){var r=this.zeroPadding,i=this.localDateToUTC(e),a=String(i.getFullYear());"utc"==t&&(a=a.substring(2,4));var o=a+r(String(i.getMonth()+1),2)+r(String(i.getDate()),2)+r(String(i.getHours()),2)+r(String(i.getMinutes()),2)+r(String(i.getSeconds()),2);if(!0===n){var l=i.getMilliseconds();if(0!=l){var s=r(String(l),3);o=o+"."+(s=s.replace(/[0]+$/,""))}}return o+"Z"},this.zeroPadding=function(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e},this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=stohex(e)},this.setByDateValue=function(e,t,n,r,i,a){var o=new Date(Date.UTC(e,t-1,n,r,i,a,0));this.setByDate(o)},this.getFreshValueHex=function(){return this.hV}},gx(vx.asn1.DERAbstractTime,vx.asn1.ASN1Object),vx.asn1.DERAbstractStructured=function(e){vx.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array=e},this.appendASN1Object=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array.push(e)},this.asn1Array=new Array,void 0!==e&&void 0!==e.array&&(this.asn1Array=e.array)},gx(vx.asn1.DERAbstractStructured,vx.asn1.ASN1Object),vx.asn1.DERBoolean=function(){vx.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},gx(vx.asn1.DERBoolean,vx.asn1.ASN1Object),vx.asn1.DERInteger=function(e){vx.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=vx.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new zH(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.bigint?this.setByBigInteger(e.bigint):void 0!==e.int?this.setByInteger(e.int):"number"==typeof e?this.setByInteger(e):void 0!==e.hex&&this.setValueHex(e.hex))},gx(vx.asn1.DERInteger,vx.asn1.ASN1Object),vx.asn1.DERBitString=function(e){if(void 0!==e&&void 0!==e.obj){var t=vx.asn1.ASN1Util.newObject(e.obj);e.hex="00"+t.getEncodedHex()}vx.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(e){this.hTLV=null,this.isModified=!0,this.hV=e},this.setUnusedBitsAndHexValue=function(e,t){if(e<0||7<e)throw"unused bits shall be from 0 to 7: u = "+e;var n="0"+e;this.hTLV=null,this.isModified=!0,this.hV=n+t},this.setByBinaryString=function(e){var t=8-(e=e.replace(/0+$/,"")).length%8;8==t&&(t=0);for(var n=0;n<=t;n++)e+="0";var r="";for(n=0;n<e.length-1;n+=8){var i=e.substring(n,n+8),a=parseInt(i,2).toString(16);1==a.length&&(a="0"+a),r+=a}this.hTLV=null,this.isModified=!0,this.hV="0"+t+r},this.setByBooleanArray=function(e){for(var t="",n=0;n<e.length;n++)1==e[n]?t+="1":t+="0";this.setByBinaryString(t)},this.newFalseArray=function(e){for(var t=new Array(e),n=0;n<e;n++)t[n]=!1;return t},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e&&e.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(e):void 0!==e.hex?this.setHexValueIncludingUnusedBits(e.hex):void 0!==e.bin?this.setByBinaryString(e.bin):void 0!==e.array&&this.setByBooleanArray(e.array))},gx(vx.asn1.DERBitString,vx.asn1.ASN1Object),vx.asn1.DEROctetString=function(e){if(void 0!==e&&void 0!==e.obj){var t=vx.asn1.ASN1Util.newObject(e.obj);e.hex=t.getEncodedHex()}vx.asn1.DEROctetString.superclass.constructor.call(this,e),this.hT="04"},gx(vx.asn1.DEROctetString,vx.asn1.DERAbstractString),vx.asn1.DERNull=function(){vx.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},gx(vx.asn1.DERNull,vx.asn1.ASN1Object),vx.asn1.DERObjectIdentifier=function(e){var t=function(e){var t=e.toString(16);return 1==t.length&&(t="0"+t),t},n=function(e){var n="",r=new zH(e,10).toString(2),i=7-r.length%7;7==i&&(i=0);for(var a="",o=0;o<i;o++)a+="0";r=a+r;for(o=0;o<r.length-1;o+=7){var l=r.substring(o,o+7);o!=r.length-7&&(l="1"+l),n+=t(parseInt(l,2))}return n};vx.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.setValueOidString=function(e){if(!e.match(/^[0-9.]+$/))throw"malformed oid string: "+e;var r="",i=e.split("."),a=40*parseInt(i[0])+parseInt(i[1]);r+=t(a),i.splice(0,2);for(var o=0;o<i.length;o++)r+=n(i[o]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=r},this.setValueName=function(e){var t=vx.asn1.x509.OID.name2oid(e);if(""===t)throw"DERObjectIdentifier oidName undefined: "+e;this.setValueOidString(t)},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e?e.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(e):this.setValueName(e):void 0!==e.oid?this.setValueOidString(e.oid):void 0!==e.hex?this.setValueHex(e.hex):void 0!==e.name&&this.setValueName(e.name))},gx(vx.asn1.DERObjectIdentifier,vx.asn1.ASN1Object),vx.asn1.DEREnumerated=function(e){vx.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=vx.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new zH(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.int?this.setByInteger(e.int):"number"==typeof e?this.setByInteger(e):void 0!==e.hex&&this.setValueHex(e.hex))},gx(vx.asn1.DEREnumerated,vx.asn1.ASN1Object),vx.asn1.DERUTF8String=function(e){vx.asn1.DERUTF8String.superclass.constructor.call(this,e),this.hT="0c"},gx(vx.asn1.DERUTF8String,vx.asn1.DERAbstractString),vx.asn1.DERNumericString=function(e){vx.asn1.DERNumericString.superclass.constructor.call(this,e),this.hT="12"},gx(vx.asn1.DERNumericString,vx.asn1.DERAbstractString),vx.asn1.DERPrintableString=function(e){vx.asn1.DERPrintableString.superclass.constructor.call(this,e),this.hT="13"},gx(vx.asn1.DERPrintableString,vx.asn1.DERAbstractString),vx.asn1.DERTeletexString=function(e){vx.asn1.DERTeletexString.superclass.constructor.call(this,e),this.hT="14"},gx(vx.asn1.DERTeletexString,vx.asn1.DERAbstractString),vx.asn1.DERIA5String=function(e){vx.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="16"},gx(vx.asn1.DERIA5String,vx.asn1.DERAbstractString),vx.asn1.DERUTCTime=function(e){vx.asn1.DERUTCTime.superclass.constructor.call(this,e),this.hT="17",this.setByDate=function(e){this.hTLV=null,this.isModified=!0,this.date=e,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)),this.hV},void 0!==e&&(void 0!==e.str?this.setString(e.str):"string"==typeof e&&e.match(/^[0-9]{12}Z$/)?this.setString(e):void 0!==e.hex?this.setStringHex(e.hex):void 0!==e.date&&this.setByDate(e.date))},gx(vx.asn1.DERUTCTime,vx.asn1.DERAbstractTime),vx.asn1.DERGeneralizedTime=function(e){vx.asn1.DERGeneralizedTime.superclass.constructor.call(this,e),this.hT="18",this.withMillis=!1,this.setByDate=function(e){this.hTLV=null,this.isModified=!0,this.date=e,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)),this.hV},void 0!==e&&(void 0!==e.str?this.setString(e.str):"string"==typeof e&&e.match(/^[0-9]{14}Z$/)?this.setString(e):void 0!==e.hex?this.setStringHex(e.hex):void 0!==e.date&&this.setByDate(e.date),!0===e.millis&&(this.withMillis=!0))},gx(vx.asn1.DERGeneralizedTime,vx.asn1.DERAbstractTime),vx.asn1.DERSequence=function(e){vx.asn1.DERSequence.superclass.constructor.call(this,e),this.hT="30",this.getFreshValueHex=function(){for(var e="",t=0;t<this.asn1Array.length;t++){e+=this.asn1Array[t].getEncodedHex()}return this.hV=e,this.hV}},gx(vx.asn1.DERSequence,vx.asn1.DERAbstractStructured),vx.asn1.DERSet=function(e){vx.asn1.DERSet.superclass.constructor.call(this,e),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var e=new Array,t=0;t<this.asn1Array.length;t++){var n=this.asn1Array[t];e.push(n.getEncodedHex())}return 1==this.sortFlag&&e.sort(),this.hV=e.join(""),this.hV},void 0!==e&&void 0!==e.sortflag&&0==e.sortflag&&(this.sortFlag=!1)},gx(vx.asn1.DERSet,vx.asn1.DERAbstractStructured),vx.asn1.DERTaggedObject=function(e){vx.asn1.DERTaggedObject.superclass.constructor.call(this),this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(e,t,n){this.hT=t,this.isExplicit=e,this.asn1Object=n,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=n.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,t),this.isModified=!1)},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.tag&&(this.hT=e.tag),void 0!==e.explicit&&(this.isExplicit=e.explicit),void 0!==e.obj&&(this.asn1Object=e.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))},gx(vx.asn1.DERTaggedObject,vx.asn1.ASN1Object);var yx,wx,Ex=window&&window.__extends||(yx=function(e,t){return yx=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},yx(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}yx(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),bx=function(e){function t(n){var r=e.call(this)||this;return n&&("string"==typeof n?r.parseKey(n):(t.hasPrivateKeyProperty(n)||t.hasPublicKeyProperty(n))&&r.parsePropertiesFrom(n)),r}return Ex(t,e),t.prototype.parseKey=function(e){try{var t=0,n=0,r=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/.test(e)?gH(e):vH.unarmor(e),i=xH.decode(r);if(3===i.sub.length&&(i=i.sub[2].sub[0]),9===i.sub.length){t=i.sub[1].getHexStringValue(),this.n=DH(t,16),n=i.sub[2].getHexStringValue(),this.e=parseInt(n,16);var a=i.sub[3].getHexStringValue();this.d=DH(a,16);var o=i.sub[4].getHexStringValue();this.p=DH(o,16);var l=i.sub[5].getHexStringValue();this.q=DH(l,16);var s=i.sub[6].getHexStringValue();this.dmp1=DH(s,16);var c=i.sub[7].getHexStringValue();this.dmq1=DH(c,16);var d=i.sub[8].getHexStringValue();this.coeff=DH(d,16)}else{if(2!==i.sub.length)return!1;if(i.sub[0].sub){var u=i.sub[1].sub[0];t=u.sub[0].getHexStringValue(),this.n=DH(t,16),n=u.sub[1].getHexStringValue(),this.e=parseInt(n,16)}else t=i.sub[0].getHexStringValue(),this.n=DH(t,16),n=i.sub[1].getHexStringValue(),this.e=parseInt(n,16)}return!0}catch(e){return!1}},t.prototype.getPrivateBaseKey=function(){var e={array:[new vx.asn1.DERInteger({int:0}),new vx.asn1.DERInteger({bigint:this.n}),new vx.asn1.DERInteger({int:this.e}),new vx.asn1.DERInteger({bigint:this.d}),new vx.asn1.DERInteger({bigint:this.p}),new vx.asn1.DERInteger({bigint:this.q}),new vx.asn1.DERInteger({bigint:this.dmp1}),new vx.asn1.DERInteger({bigint:this.dmq1}),new vx.asn1.DERInteger({bigint:this.coeff})]};return new vx.asn1.DERSequence(e).getEncodedHex()},t.prototype.getPrivateBaseKeyB64=function(){return pH(this.getPrivateBaseKey())},t.prototype.getPublicBaseKey=function(){var e=new vx.asn1.DERSequence({array:[new vx.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new vx.asn1.DERNull]}),t=new vx.asn1.DERSequence({array:[new vx.asn1.DERInteger({bigint:this.n}),new vx.asn1.DERInteger({int:this.e})]}),n=new vx.asn1.DERBitString({hex:"00"+t.getEncodedHex()});return new vx.asn1.DERSequence({array:[e,n]}).getEncodedHex()},t.prototype.getPublicBaseKeyB64=function(){return pH(this.getPublicBaseKey())},t.wordwrap=function(e,t){if(!e)return e;var n="(.{1,"+(t=t||64)+"})( +|$\n?)|(.{1,"+t+"})";return e.match(RegExp(n,"g")).join("\n")},t.prototype.getPrivateKey=function(){var e="-----BEGIN RSA PRIVATE KEY-----\n";return e+=t.wordwrap(this.getPrivateBaseKeyB64())+"\n",e+="-----END RSA PRIVATE KEY-----"},t.prototype.getPublicKey=function(){var e="-----BEGIN PUBLIC KEY-----\n";return e+=t.wordwrap(this.getPublicBaseKeyB64())+"\n",e+="-----END PUBLIC KEY-----"},t.hasPublicKeyProperty=function(e){return(e=e||{}).hasOwnProperty("n")&&e.hasOwnProperty("e")},t.hasPrivateKeyProperty=function(e){return(e=e||{}).hasOwnProperty("n")&&e.hasOwnProperty("e")&&e.hasOwnProperty("d")&&e.hasOwnProperty("p")&&e.hasOwnProperty("q")&&e.hasOwnProperty("dmp1")&&e.hasOwnProperty("dmq1")&&e.hasOwnProperty("coeff")},t.prototype.parsePropertiesFrom=function(e){this.n=e.n,this.e=e.e,e.hasOwnProperty("d")&&(this.d=e.d,this.p=e.p,this.q=e.q,this.dmp1=e.dmp1,this.dmq1=e.dmq1,this.coeff=e.coeff)},t}(mx),Mx="undefined"!=typeof process?null===(wx=process.env)||void 0===wx?void 0:wx.npm_package_version:void 0,Lx=function(){function e(e){void 0===e&&(e={}),this.default_key_size=e.default_key_size?parseInt(e.default_key_size,10):1024,this.default_public_exponent=e.default_public_exponent||"010001",this.log=e.log||!1,this.key=e.key||null}return e.prototype.setKey=function(e){e?(this.log&&this.key&&console.warn("A key was already set, overriding existing."),this.key=new bx(e)):!this.key&&this.log&&console.error("A key was not set.")},e.prototype.setPrivateKey=function(e){this.setKey(e)},e.prototype.setPublicKey=function(e){this.setKey(e)},e.prototype.decrypt=function(e){try{return this.getKey().decrypt(mH(e))}catch(e){return!1}},e.prototype.encrypt=function(e){try{return pH(this.getKey().encrypt(e))}catch(e){return!1}},e.prototype.encryptOAEP=function(e){try{return pH(this.getKey().encrypt(e,px))}catch(e){return!1}},e.prototype.sign=function(e,t,n){void 0===t&&(t=function(e){return e}),void 0===n&&(n="");try{return pH(this.getKey().sign(e,t,n))}catch(e){return!1}},e.prototype.signSha256=function(e){return this.sign(e,function(e){return nx(tx(e))},"sha256")},e.prototype.verify=function(e,t,n){void 0===n&&(n=function(e){return e});try{return this.getKey().verify(e,mH(t),n)}catch(e){return!1}},e.prototype.verifySha256=function(e,t){return this.verify(e,t,function(e){return nx(tx(e))})},e.prototype.getKey=function(e){if(!this.key){if(this.key=new bx,e&&"[object Function]"==={}.toString.call(e))return void this.key.generateAsync(this.default_key_size,this.default_public_exponent,e);this.key.generate(this.default_key_size,this.default_public_exponent)}return this.key},e.prototype.getPrivateKey=function(){return this.getKey().getPrivateKey()},e.prototype.getPrivateKeyB64=function(){return this.getKey().getPrivateBaseKeyB64()},e.prototype.getPublicKey=function(){return this.getKey().getPublicKey()},e.prototype.getPublicKeyB64=function(){return this.getKey().getPublicBaseKeyB64()},e.version=Mx,e}();async function Hx(e,t,n="https"){if("http"===n){const n=new Lx;n.setPublicKey(t);const r=n.encrypt(e);if(!r)throw new Error("JSEncrypt failed: Encryption returned false (check key or data length).");return r}{const n=Uint8Array.from(atob(t),e=>e.charCodeAt(0)),r=await crypto.subtle.importKey("spki",n,{name:"RSA-OAEP",hash:"SHA-256"},!1,["encrypt"]),i=(new TextEncoder).encode(e),a=await crypto.subtle.encrypt({name:"RSA-OAEP"},r,i);return btoa(String.fromCharCode(...new Uint8Array(a)))}}const xx=e=>{const t=e.toLowerCase().trim(),n=parseFloat(t);switch(t.replace(/[0-9.]/g,"").trim()){case"gb":return 1024*n*1024*1024;case"mb":return 1024*n*1024;case"kb":return 1024*n;default:return n}},Vx=e=>{const t=e.toLowerCase().trim(),n=parseFloat(t);switch(t.replace(/[0-9.]/g,"").trim()){case"gb":default:return n;case"mb":return n/1024;case"kb":return n/1048576;case"b":return n/1073741824}},kx=({data:r,isYaxisSticky:i=!1,barWidth:a,height:s,barGap:d=20,colors:u=[],xAxisLabel:f,isTruncateText:h=!0,yAxisLabel:C,padding:p=20,yAxisDivisions:m=5,barBorderRadius:A=0,legend:g=!0,showXAxisLabels:v=!0,icons:y=[],iconSize:w,legendPosition:E="bottom",legendGap:b=5,extendBarChartRightWidth:M=0,isYAxisValuePercentage:L=!1,selectedBar:H,setSelectedBar:x,onSelectedBar:V,totalLabel:k="Total Execution",customToolTip:S=!1,isOnclick:z=!1,isDashboardVersions:Z,type:O="",isMemory:N,tooltipWidth:T="fit-content"})=>{const I=o(null),[D,F]=c(null),[R,P]=c(!1);l(()=>{const e=()=>{const e=I.current;e&&R&&(e.style.display="none")};return window.addEventListener("scroll",e,!0),()=>window.removeEventListener("scroll",e,!0)},[R]);const j=(e=>{const t=["TB","GB","MB","KB"];for(const n of t){if(e.some(e=>"string"==typeof e.value&&e.value.toLowerCase().includes(n.toLowerCase())))return n}return null})(r),B=r.map(e=>{if("string"==typeof e.value){let t=0;if("memory"===O)t=Vx(e.value);else if(N)switch(j){case"TB":t=(e=>{const t=e.toLowerCase().trim(),n=parseFloat(t);switch(t.replace(/[0-9.]/g,"").trim()){case"tb":default:return n;case"gb":return n/1024;case"mb":return n/1048576;case"kb":return n/1073741824;case"b":return n/1099511627776}})(e.value);break;case"GB":t=Vx(e.value);break;case"MB":t=(e=>{const t=e.toLowerCase().trim(),n=parseFloat(t);switch(t.replace(/[0-9.]/g,"").trim()){case"mb":default:return n;case"gb":return 1024*n;case"tb":return 1024*n*1024;case"kb":return n/1024;case"b":return n/1048576}})(e.value);break;case"KB":t=(e=>{const t=e.toLowerCase().trim(),n=parseFloat(t);switch(t.replace(/[0-9.]/g,"").trim()){case"kb":default:return n;case"mb":return 1024*n;case"gb":return 1024*n*1024;case"tb":return 1024*n*1024*1024;case"b":return n/1024}})(e.value)}else t=parseFloat(e.value);return{...e,normalizedValue:t}}return{...e,normalizedValue:e.value}});let _=0;"memory"===O&&(_=r.reduce((e,t)=>"string"==typeof t.value?e+xx(t.value):e+1024*Number(t.value)*1024*1024,0));const W=_/1048576,X=W<1024?`${Math.round(W)} mb`:`${(W/1024).toFixed(1)} gb`;let Q=Math.max(...B.map(e=>e.normalizedValue));Q="memory"===O?Math.max(Q,1):Math.max(Q,m);const G=40,K=40,Y=B.length*a+(B.length-1)*d+(i?K:90)+M,J=Date.now(),$=t=>t.filter(e=>e.length>1).map((t,n)=>e("defs",{children:e("linearGradient",{id:`gradient-${J}-${O}-${n}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:t.map((r,i)=>e("stop",{offset:i/(t.length-1)*100+"%",stopColor:r},`${n}-${i}`))})},n)),ee=e=>{if(!u.length)return"grey";const t=u[e%u.length];return 1===t?.length?t[0]:`url(#gradient-${J}-${O}-${e%u.length})`},te=(e,t,n,r,i)=>{P(!0);const a=I.current;if(a)if(a.style.display="block",S)a.innerHTML=`<div>\n <div><Typography fontWeight='semi-bold'>${e}</Typography></div>\n <div><Typography>${n||""}</Typography></div>\n <div><Typography>${k} : ${t} ${r?"("+Number(r)+"%)":""}</Typography></div>\n </div>`;else if(Z){const e=i?i.join(", "):"";a.innerHTML=`\n <div>\n <div><Typography>${k} : ${t}</Typography></div>\n ${e?`<div><Typography>Versions : ${e}</Typography></div>`:""}\n </div>`}else a.innerHTML="memory"===O?`<strong>${e}</strong>: ${t} / ${X}`:`<strong>${e}</strong>: ${t} ${L?"%":""}`},ne=e=>{const t=I.current;if(t){const n=t.parentElement,r=n?.getBoundingClientRect();if(!r)return;const i=t.offsetWidth,a=t.offsetHeight,o=e.clientX-r.left,l=e.clientY-r.top,s=10;let c=o+s,d=l-a-s;c+i>r.width&&(c=o-i-s),c<0&&(c=s),d<0&&(d=l+s),d+a>r.height&&(d=r.height-a-s),t.style.left=`${c}px`,t.style.top=`${d}px`}},re=()=>{P(!1);const e=I.current;e&&(e.style.display="none")},ie=(e,t)=>{x&&x(e),z&&V?.(e,t)},ae=e=>{if(h){if(Hn(e,10).endsWith("...")){const t=I.current;t&&(t.style.display="block",t.innerHTML=e)}}},oe=(e,t,n)=>{if(h){Hn(t,10).endsWith("...")&&ne(e)}};return n("div",{className:"ff-bar-chart-container",children:[e("div",{ref:I,className:"ff-bar-chart-tooltip",style:{width:T}}),g&&"top"===E&&e("div",{className:"ff-legend-container",children:e("div",{className:"ff-bar-chart-legend",style:{gap:`${b}px`},children:B.map((t,r)=>n("div",{className:"ff-bar-chart-legend-item",onMouseEnter:()=>F(r),onMouseLeave:()=>F(null),children:[y[r]&&"string"==typeof y[r]?e(q,{name:String(y[r]),width:w,height:w}):e("span",{className:"ff-bar-chart-legend-item-circle",style:{backgroundColor:u[r%u.length]?.[0]||"grey"}}),e(U,{as:"div",fontSize:10,fontWeight:"regular",className:"ff-legend-label",children:t.label})]},t.label))})}),i?n("div",{className:"ff-bar-chart-wrapper",children:[e("div",{className:"ff-y-axis",children:e("svg",{width:60,height:s+G+(f?20:0),children:n(t,{children:[Array.from({length:m+1}).map((t,n)=>{const r=s-n/m*s+G+4,i=n*Q/m,a="memory"===O?i.toFixed(1):L?`${i.toFixed(0).padStart(2,"0")}%`:i.toFixed(0).padStart(2,"0");return e("text",{x:50,y:r,fill:"black",textAnchor:"middle",className:"ff-bar-chart-labels",children:a},n)}),C&&e("text",{x:-(s/2+35),y:i?20:10,transform:"rotate(-90)",fill:"black",textAnchor:"middle",alignmentBaseline:"middle",className:"ff-bar-chart-labels",fontWeight:600,children:C})]})})}),e("div",{className:"ff-chart-scrollable",children:n("svg",{width:Y,height:s+G+5+(v?20:0)+(f?20:0),children:[Array.isArray(u)&&u.length>0&&$(u),B.map((t,r)=>{const i=t.normalizedValue/Q*s,o=t.normalizedValue<1?2:i,l=r*(a+d)+p,c=s-o+G,u=w||20,f=l+a/2-u/2,C=c-u,m=H===t.label,g=D===r;return n("g",{children:[y[r]&&"string"==typeof y[r]&&e("g",{onMouseEnter:()=>te(t.label,"memory"===O?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ne(e),onMouseLeave:re,children:e(q,{name:String(y[r]),x:String(f),y:String(C),width:u,height:u,chartIcon:!0})}),e("rect",{x:l,y:c,width:a,height:o,fill:ee(r),rx:A,ry:A,style:{strokeWidth:m?3:0,opacity:null===D||g?1:.3,cursor:z?"pointer":"default",transition:"opacity 0.5s ease"},onMouseEnter:()=>te(t.label,"memory"===O||N?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ne(e),onMouseLeave:re,onClick:()=>ie(t.label,t)}),m&&z&&e("rect",{x:l,y:c,width:a,height:o,fill:"var(--select-chart-highlight-color)",rx:A,ry:A,onMouseEnter:()=>te(t.label,"memory"===O?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ne(e),onMouseLeave:re}),v&&e("text",{onMouseEnter:()=>ae(t.label),onMouseMove:e=>oe(e,t.label),onMouseLeave:re,x:l+a/2,textAnchor:"middle",y:s+G+15,className:"ff-bar-chart-labels",fill:m?"var(--brand-color)":"black",fontWeight:m?"bold":"normal",children:h?Hn(t.label,10):t.label})]},r)}),e("line",{x1:i?0:p,y1:s+G,x2:Y,y2:s+G,stroke:"#D9D9D9",strokeWidth:"1"}),!i&&f&&e("text",{x:Y/2,y:s+G+(v?40:20),fontSize:"12",fill:"black",textAnchor:"middle",className:"ff-bar-chart-labels",fontWeight:600,children:f})]})}),e("div",{className:"ff-bar-chart-x-axis-label",children:f})]}):e("div",{children:n("svg",{width:Y,height:s+G+5+(v?20:0)+(f?20:0),children:[Array.isArray(u)&&u.length>0&&$(u),Array.from({length:m+1}).map((t,n)=>{const r=s-n/m*s+G+4,i=n*Q/m,a="memory"===O?i.toFixed(1):L?`${i.toFixed(0).padStart(2,"0")}%`:i.toFixed(0).padStart(2,"0");return e("text",{x:K,y:r,fill:"black",textAnchor:"middle",className:"ff-bar-chart-labels",children:a},n)}),B.map((t,r)=>{const i=t.normalizedValue/Q*s,o=t.normalizedValue<1?2:i,l=r*(a+d)+K+p,c=s-o+G,u=w||20,f=l+a/2-u/2,C=c-u,m=H===t.label,g=D===r;return n("g",{children:[y[r]&&"string"==typeof y[r]&&e("g",{onMouseEnter:()=>te(t.label,"memory"===O?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ne(e),onMouseLeave:re,onClick:()=>ie(t.label,t),children:e(q,{name:String(y[r]),x:String(f),y:String(C),width:u,height:u,chartIcon:!0})}),e("rect",{x:l,y:c,width:a,height:o,fill:ee(r),rx:A,ry:A,style:{strokeWidth:m?3:0,opacity:null===D||g?1:.3,cursor:z?"pointer":"default",transition:"opacity 0.5s ease"},onMouseEnter:()=>te(t.label,"memory"===O||N?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ne(e),onMouseLeave:re,onClick:()=>ie(t.label,t)}),m&&z&&e("rect",{x:l,y:c,width:a,height:o,fill:"var(--select-chart-highlight-color)",rx:A,ry:A,onMouseEnter:()=>te(t.label,"memory"===O?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ne(e),onMouseLeave:re}),v&&e("g",{children:e("text",{x:l+a/2,textAnchor:"middle",y:s+G+15,className:"ff-bar-chart-labels",fill:m?"var(--brand-color)":"black",fontWeight:m?"bold":"normal",onMouseEnter:()=>ae(t.label),onMouseMove:e=>oe(e,t.label),onMouseLeave:re,children:h?Hn(t.label,10):t.label})})]},r)}),e("line",{x1:60,y1:s+G,x2:Y,y2:s+G,stroke:"#D9D9D9",strokeWidth:"1"}),f&&e("text",{x:Y/2,y:s+G+(v?40:20),fontSize:"12",fill:"black",textAnchor:"middle",className:"ff-bar-chart-labels",fontWeight:600,children:f}),C&&e("text",{x:-(s/2+35),y:10,transform:"rotate(-90)",fill:"black",textAnchor:"middle",alignmentBaseline:"middle",className:"ff-bar-chart-labels",fontWeight:600,children:C})]})}),g&&"bottom"===E&&e("div",{className:"ff-legend-container",children:e("div",{className:"ff-bar-chart-legend",style:{gap:`${b}px`},children:r.map((t,r)=>n("div",{className:"ff-bar-chart-legend-item",onMouseEnter:()=>F(r),onMouseLeave:()=>F(null),children:[y[r]&&"string"==typeof y[r]?e(q,{name:String(y[r]),width:w,height:w}):e("span",{className:"ff-bar-chart-legend-item-circle",style:{backgroundColor:u[r%u.length]?.[0]||"grey"}}),e("div",{children:e(U,{as:"div",fontSize:10,fontWeight:"regular",className:"ff-legend-label",children:t.label})})]},t.label))})})]})},Sx=({data:t,chartId:r,barWidth:i=24,height:a=250,barGap:o=40,barBorderRadius:l=0,xAxisLabel:s,yAxisLabel:c,yAxisDivisions:d=5,padding:u=20,legend:f=!0,legendPosition:h="bottom",showXAxisLabels:C=!0,isTruncateText:p=!0,isOnclick:m=!1,onSelectedBar:A,onSegmentClick:g})=>{const v=b(),y=r??v,w=40,E=Math.max(...t?.map(e=>e?.segments?.reduce((e,t)=>e+t?.value,0)),d),M=Array.from(new Set(t.flatMap(e=>e?.segments?.map(e=>e?.key)))),L={};t.forEach(e=>e?.segments.forEach(e=>{L[e.key]||(L[e.key]=e.color)}));const H=t.length>0?t.length*i+(t.length-1)*o:0,x=i+o,V=H+u+x,k=a+w+5+(C?20:0)+(s?20:0),S=k+(s?17:0),z=(e,t)=>{m&&A?.(e,t)},Z=(e,t,n)=>{g?.(e,t,n)},O=()=>e("div",{className:"ff-stacked-bar-legend",children:M.map(t=>n("div",{className:"ff-stacked-bar-legend-item",children:[e("span",{className:"ff-stacked-bar-legend-dot",style:{backgroundColor:L[t]}}),p?e(Ws,{className:"ff-stacked-bar-legend-label",placement:"top"===h?"bottom":"top",children:t}):e(U,{as:"span",className:"ff-stacked-bar-legend-label",fontSize:10,fontWeight:"regular",children:t})]},t))});return n("div",{className:"ff-stacked-bar-container",children:[f&&"top"===h&&O(),n("div",{className:"ff-stacked-bar-wrapper",style:{minHeight:S},children:[e("div",{className:"ff-stacked-bar-y-axis",children:n("svg",{width:60,height:k,children:[Array.from({length:d+1}).map((t,n)=>{const r=a-n/d*a+w+4,i=(n*E/d).toFixed(0).padStart(2,"0");return e("text",{x:50,y:r,textAnchor:"middle",className:"ff-stacked-bar-label",children:i},n)}),c&&e("text",{x:-(a/2+35),y:20,transform:"rotate(-90)",textAnchor:"middle",alignmentBaseline:"middle",className:"ff-stacked-bar-label ff-stacked-bar-y-axis-label",children:c})]})}),e("div",{className:"ff-stacked-bar-scrollable",children:n("svg",{width:V,height:k,style:{minWidth:V},children:[t?.map((t,r)=>{const s=t?.segments?.reduce((e,t)=>e+t.value,0),c=r*(i+o)+u;if(1===t?.segments?.length&&0===t?.segments?.[0]?.value){const o=t.segments[0],s=`zero-bar-tooltip-${y}-${o.uniqueId}`;return n("g",{onClick:()=>z(t,r),style:{cursor:m?"pointer":"default"},children:[e("rect",{x:c,y:a+w-2,width:i,height:2,fill:o.color,rx:l,ry:l}),n("foreignObject",{x:c,y:a+w-2,width:i,height:8,style:{overflow:"visible"},children:[e("div",{"data-tooltip-id":s,"data-tooltip-placement":"right",style:{width:i,height:8},onClick:()=>Z(t.label,o,0)}),n("div",{id:s,className:"ff-stacked-bar-tooltip-content",style:{display:"none"},children:[e(U,{as:"div",fontWeight:"semi-bold",children:t.label}),n("div",{className:"ff-stacked-bar-tooltip-row",children:[e(U,{fontWeight:"semi-bold",children:o.key}),n(U,{fontWeight:"semi-bold",children:[": ",o.value]})]})]})]}),C&&e("foreignObject",{x:c+i/2-x/2,y:a+w+5,width:x,height:20,className:"ff-stacked-bar-x-label-wrapper",children:e(Ws,{className:"ff-stacked-bar-x-label",children:t.label})})]},r)}let d=a+w;return n("g",{onClick:()=>z(t,r),style:{cursor:m?"pointer":"default"},children:[t?.segments?.map((r,o)=>{const u=s>0?r.value/E*a:0;d-=u;const f=o===t.segments.length-1,h=d,C=`stacked-bar-tooltip-${y}-${r?.uniqueId}-${o}`;return n("g",{children:[e("rect",{x:c,y:h,width:i,height:u,fill:r.color,rx:f?l:0,ry:f?l:0}),n("foreignObject",{x:c,y:h,width:i,height:u,children:[e("div",{"data-tooltip-id":C,"data-tooltip-placement":"right",style:{width:i,height:u},onClick:()=>Z(t?.label,r,o)}),n("div",{id:C,className:"ff-stacked-bar-tooltip-content",style:{display:"none"},children:[e(U,{as:"div",fontWeight:"semi-bold",children:t?.label}),n("div",{className:"ff-stacked-bar-tooltip-row",children:[e(U,{fontWeight:"semi-bold",children:r.key}),n(U,{fontWeight:"semi-bold",children:[": ",r.value]})]})]})]})]},`${r?.uniqueId}-${o}`)}),C&&e("foreignObject",{x:c+i/2-x/2,y:a+w+5,width:x,height:20,className:"ff-stacked-bar-x-label-wrapper",children:e(Ws,{className:"ff-stacked-bar-x-label",children:t?.label})})]},r)}),e("line",{x1:0,y1:a+w,x2:V,y2:a+w,stroke:"var(--ff-select-scroll-track-bg)",strokeWidth:"1"})]})}),s&&e(U,{as:"div",className:"ff-stacked-bar-label ff-stacked-bar-x-axis-label",fontWeight:"semi-bold",children:s})]}),f&&"bottom"===h&&O()]})},zx=(e,t,n,r,i)=>{const a=e+n*Math.cos(r),o=t+n*Math.sin(r),l=e+n*Math.cos(i),s=t+n*Math.sin(i);return`M ${a} ${o} A ${n} ${n} 0 ${i-r>Math.PI?1:0} 1 ${l} ${s}`},Zx=({radius:r,lineWidth:i,lineCap:a,barValues:o,labelHeading:l,legendType:s="numberLegend",isLegendDetails:d=!0,isPillValueVisible:u=!0,chartToLegendGap:f="16px",legendGap:h="8px",labelFontSize:C=12,subLabelFontSize:p=8,gapBetweenArch:m=10,capsuleStyle:A={padding:"4px"}})=>{const[g,v]=c({visible:!1,x:0,y:0,content:"",isArc:!1}),[y,w]=c(null),E=(e,t)=>Array.isArray(e.arcColor)?`url(#gradient-${t})`:e.arcColor,b=e=>Array.isArray(e.arcColor)?e.arcColor[0]:e.arcColor,M=o.map(e=>{if("string"==typeof e.value){const t=(e=>{if("string"!=typeof e)return e;{const t=e.trim().match(/^([\d.]+)\s*([a-zA-Z%]*)$/);if(!t)return 0;const n=parseFloat(t[1]??"0"),r=t[2]?.toUpperCase()||"";if(isNaN(n))return 0;switch(r){case"TB":return 1024*n*1024;case"GB":return 1024*n;case"MB":default:return n;case"KB":return n/1024}}})(e.value),n=isNaN(t)?0:t;return{...e,normalizedValue:n,labelValue:Number.isInteger(n)?n:n.toFixed(2)}}return{...e,normalizedValue:e.value,labelValue:Number.isInteger(e.value)?e.value:e.value?.toFixed(2)}}),L=M.reduce((e,t)=>e+t.normalizedValue,0),H=r,x=i+m,V=2*(H+x*(M.length-1)+i),k=[...M].reverse(),S=(e=>{const t=e.trim().replace(/\s+/g," "),n=t.match(/^(.*\D)\s+(\d+(?:\.\d+)?\s*[a-zA-Z%]+)$/);return n?[n[1]?.trim()??"",n[2]?.trim()??""].filter(Boolean):t.split(" ")})(l),z=(e,t,n)=>{const{clientX:r,clientY:i}=e;v({visible:!0,x:r,y:i,content:t,isArc:n})},Z=e=>{const{clientX:t,clientY:n}=e;v(e=>({...e,x:t,y:n}))},O=()=>{v({visible:!1,x:0,y:0,content:"",isArc:!1})},N=-18*(S.length-1)/2;return n("div",{className:"ff-multi-radial-chart-container "+("numberLegend"===s?"ff-multi-radial-chart-number":"ff-multi-radial-chart-pill"),style:{gap:f},children:[e("div",{className:"relative",style:{width:V,height:V},children:n("svg",{width:V,height:V,viewBox:`0 0 ${V} ${V}`,className:"absolute top-0 left-0",children:[e("defs",{children:o.map((t,n)=>Array.isArray(t.arcColor)?e("linearGradient",{id:`gradient-${n}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%",gradientTransform:"rotate(90)",children:t.arcColor.map((n,r)=>e("stop",{offset:r/(t.arcColor.length-1)*100+"%",stopColor:n},r))},`gradient-${n}`):null)}),n("g",{transform:`translate(${V/2+1}, ${V/2+1})`,children:[k.map((t,r)=>{const o=M.length-1-r,l=2*(t.normalizedValue/L)*Math.PI;let s=-Math.PI/2,c=s+l;t.normalizedValue===L&&(s=0,c=2*Math.PI);const d=H+x*o,u=zx(0,0,d,0,2*Math.PI),f={opacity:null!==y?t.barLabel===y?1:.2:1,transition:"opacity 0.3s ease"};if(0===t.normalizedValue){const r=d*Math.cos(-Math.PI/2),a=d*Math.sin(-Math.PI/2);return n("g",{children:[e("path",{d:u,fill:"none",stroke:t.arcBackgroundColor,strokeWidth:i,className:"transition-all duration-300",style:f}),e("circle",{cx:r,cy:a,r:i+1,fill:E({...t,label:t.barLabel||"",key:t.labelValue?.toString()||""},o),onMouseEnter:e=>z(e,`${t.barLabel||"Data"}: ${t.value}`,!0),onMouseMove:Z,onMouseLeave:O,style:f})]},o)}const h=zx(0,0,d,s,c);return n("g",{children:[e("path",{d:u,fill:"none",stroke:t.arcBackgroundColor,strokeWidth:i,className:"transition-all duration-300",style:f}),e("path",{d:h,fill:"none",stroke:E({...t,label:t.barLabel||"",key:t.labelValue?.toString()||""},o),strokeWidth:i,strokeLinecap:"square"===a?"butt":"round",onMouseEnter:e=>z(e,`${t.barLabel||"Data"}: ${t.value}`,!0),onMouseMove:Z,onMouseLeave:O,style:{pointerEvents:"stroke",...f}})]},o)}),e("text",{x:"0",y:g.visible?`-${i+m+2}`:N,fill:(()=>{if(!g.visible)return"";const e=g.content.split(":")[0]?.trim();if(void 0===e)return"";const t=M.find(t=>t.barLabel===e);if(!t)return"";const n={...t,label:t.barLabel,key:t.labelValue?.toString()??""};return b(n)})(),textAnchor:"middle",dominantBaseline:"central",children:g.visible?n(t,{children:[e("tspan",{x:"0",dy:"0",className:"ff-center-text-tooltip",children:(T=g.content.split(":")[1]?.trim()||"",I=9,T.length>I?T.slice(0,I)+"...":T)}),g.content.split(":")[0]?.split(" ").map((t,n)=>e("tspan",{x:"0",dy:0===n?`${i+m+5}`:18,className:"ff-center-text-tooltip",children:t},n))]}):e(t,{children:S.map((t,n)=>e("tspan",{x:"0",dy:0===n?0:18,className:0===n?"ff-center-first-text":"ff-center-text",style:{fontSize:`${0===n?C:p}px`},children:t},n))})})]})]})}),g.visible&&e("div",{className:"ff-multi-radial-tooltip",style:{position:"fixed",top:`${g.y+10}px`,left:`${g.x+15}px`,zIndex:1e3,pointerEvents:"none"},children:g.content}),d&&((t,r)=>{switch(r){case"numberLegend":return e("div",{className:"ff-legend-container ff-number-legend",style:{gap:h},children:t.map((t,r)=>n("div",{className:"ff-legend-item",onMouseEnter:e=>{w(t.barLabel||t.label),z(e,`${t.barLabel||"Data"}: ${t.value}`,!1)},onMouseMove:Z,onMouseLeave:()=>{w(null),O()},children:[e(U,{fontSize:20,fontWeight:"semi-bold",className:"ff-legend-value",color:b(t),children:t.key.padStart(2,"0")}),e(U,{fontSize:10,className:"ff-legend-key",color:"var(--text-color)",children:t.label})]},r))});case"pillLegend":return e("div",{className:"ff-legend-container ff-pill-legend",style:{gap:h},children:t.slice().reverse().map((t,r)=>n("div",{className:"ff-legend-item",onMouseEnter:e=>{w(t.barLabel||t.label),z(e,`${t.barLabel||"Data"}: ${t.value}`,!1)},onMouseMove:Z,onMouseLeave:()=>{w(null),O()},children:[e("span",{className:"ff-legend-capsule",style:{backgroundColor:b(t)},children:e(U,{fontSize:10,color:"var(--tooltip-text-color)",style:A,children:u&&t.value})}),e(U,{className:"ff-legend-key",children:t.label})]},r))});default:return null}})(M.map(e=>({...e,label:e?.barLabel,key:e.labelValue?.toString()})),s)]});var T,I};var Ox,Nx={exports:{}},Tx={},Ix={exports:{}},Dx={},Fx={};function Rx(){if(Ox)return Fx;function e(e){this.__parent=e,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}function t(e,t){this.__cache=[""],this.__indent_size=e.indent_size,this.__indent_string=e.indent_char,e.indent_with_tabs||(this.__indent_string=new Array(e.indent_size+1).join(e.indent_char)),t=t||"",e.indent_level>0&&(t=new Array(e.indent_level+1).join(this.__indent_string)),this.__base_string=t,this.__base_string_length=t.length}function n(n,r){this.__indent_cache=new t(n,r),this.raw=!1,this._end_with_newline=n.end_with_newline,this.indent_size=n.indent_size,this.wrap_line_length=n.wrap_line_length,this.indent_empty_lines=n.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new e(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}return Ox=1,e.prototype.clone_empty=function(){var t=new e(this.__parent);return t.set_indent(this.__indent_count,this.__alignment_count),t},e.prototype.item=function(e){return e<0?this.__items[this.__items.length+e]:this.__items[e]},e.prototype.has_match=function(e){for(var t=this.__items.length-1;t>=0;t--)if(this.__items[t].match(e))return!0;return!1},e.prototype.set_indent=function(e,t){this.is_empty()&&(this.__indent_count=e||0,this.__alignment_count=t||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},e.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},e.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},e.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var e=this.__parent.current_line;return e.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),e.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),e.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===e.__items[0]&&(e.__items.splice(0,1),e.__character_count-=1),!0}return!1},e.prototype.is_empty=function(){return 0===this.__items.length},e.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},e.prototype.push=function(e){this.__items.push(e);var t=e.lastIndexOf("\n");-1!==t?this.__character_count=e.length-t:this.__character_count+=e.length},e.prototype.pop=function(){var e=null;return this.is_empty()||(e=this.__items.pop(),this.__character_count-=e.length),e},e.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},e.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},e.prototype.trim=function(){for(;" "===this.last();)this.__items.pop(),this.__character_count-=1},e.prototype.toString=function(){var e="";return this.is_empty()?this.__parent.indent_empty_lines&&(e=this.__parent.get_indent_string(this.__indent_count)):(e=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),e+=this.__items.join("")),e},t.prototype.get_indent_size=function(e,t){var n=this.__base_string_length;return t=t||0,e<0&&(n=0),n+=e*this.__indent_size,n+=t},t.prototype.get_indent_string=function(e,t){var n=this.__base_string;return t=t||0,e<0&&(e=0,n=""),t+=e*this.__indent_size,this.__ensure_cache(t),n+=this.__cache[t]},t.prototype.__ensure_cache=function(e){for(;e>=this.__cache.length;)this.__add_column()},t.prototype.__add_column=function(){var e=this.__cache.length,t=0,n="";this.__indent_size&&e>=this.__indent_size&&(e-=(t=Math.floor(e/this.__indent_size))*this.__indent_size,n=new Array(t+1).join(this.__indent_string)),e&&(n+=new Array(e+1).join(" ")),this.__cache.push(n)},n.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},n.prototype.get_line_number=function(){return this.__lines.length},n.prototype.get_indent_string=function(e,t){return this.__indent_cache.get_indent_string(e,t)},n.prototype.get_indent_size=function(e,t){return this.__indent_cache.get_indent_size(e,t)},n.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},n.prototype.add_new_line=function(e){return!(this.is_empty()||!e&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},n.prototype.get_code=function(e){this.trim(!0);var t=this.current_line.pop();t&&("\n"===t[t.length-1]&&(t=t.replace(/\n+$/g,"")),this.current_line.push(t)),this._end_with_newline&&this.__add_outputline();var n=this.__lines.join("\n");return"\n"!==e&&(n=n.replace(/[\n]/g,e)),n},n.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},n.prototype.set_indent=function(e,t){return e=e||0,t=t||0,this.next_line.set_indent(e,t),this.__lines.length>1?(this.current_line.set_indent(e,t),!0):(this.current_line.set_indent(),!1)},n.prototype.add_raw_token=function(e){for(var t=0;t<e.newlines;t++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(e.whitespace_before),this.current_line.push(e.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},n.prototype.add_token=function(e){this.__add_space_before_token(),this.current_line.push(e),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},n.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},n.prototype.remove_indent=function(e){for(var t=this.__lines.length;e<t;)this.__lines[e]._remove_indent(),e++;this.current_line._remove_wrap_indent()},n.prototype.trim=function(e){for(e=void 0!==e&&e,this.current_line.trim();e&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},n.prototype.just_added_newline=function(){return this.current_line.is_empty()},n.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},n.prototype.ensure_empty_line_above=function(t,n){for(var r=this.__lines.length-2;r>=0;){var i=this.__lines[r];if(i.is_empty())break;if(0!==i.item(0).indexOf(t)&&i.item(-1)!==n){this.__lines.splice(r+1,0,new e(this)),this.previous_line=this.__lines[this.__lines.length-2];break}r--}},Fx.Output=n,Fx}var Px,jx={};function Bx(){if(Px)return jx;return Px=1,jx.Token=function(e,t,n,r){this.type=e,this.text=t,this.comments_before=null,this.newlines=n||0,this.whitespace_before=r||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null},jx}var _x,qx={};function Ux(){return _x||(_x=1,function(e){var t="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",n="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",r="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",i="\\\\u[0-9a-fA-F]{4}|\\\\u\\{[0-9a-fA-F]+\\}",a="(?:"+i+"|[\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a"+n+"])",o="(?:"+i+"|["+t+n+r+"])*";e.identifier=new RegExp(a+o,"g"),e.identifierStart=new RegExp(a),e.identifierMatch=new RegExp("(?:"+i+"|["+t+n+r+"])+"),e.newline=/[\n\r\u2028\u2029]/,e.lineBreak=new RegExp("\r\n|"+e.newline.source),e.allLineBreaks=new RegExp(e.lineBreak.source,"g")}(qx)),qx}var Wx,Xx,Qx={},Gx={};function Kx(){if(Wx)return Gx;function e(e,n){this.raw_options=t(e,n),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs","\t"===this.indent_char),this.indent_with_tabs&&(this.indent_char="\t",1===this.indent_size&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}function t(e,t){var r,i={};for(r in e=n(e))r!==t&&(i[r]=e[r]);if(t&&e[t])for(r in e[t])i[r]=e[t][r];return i}function n(e){var t,n={};for(t in e){n[t.replace(/-/g,"_")]=e[t]}return n}return Wx=1,e.prototype._get_array=function(e,t){var n=this.raw_options[e],r=t||[];return"object"==typeof n?null!==n&&"function"==typeof n.concat&&(r=n.concat()):"string"==typeof n&&(r=n.split(/[^a-zA-Z0-9_\/\-]+/)),r},e.prototype._get_boolean=function(e,t){var n=this.raw_options[e];return void 0===n?!!t:!!n},e.prototype._get_characters=function(e,t){var n=this.raw_options[e],r=t||"";return"string"==typeof n&&(r=n.replace(/\\r/,"\r").replace(/\\n/,"\n").replace(/\\t/,"\t")),r},e.prototype._get_number=function(e,t){var n=this.raw_options[e];t=parseInt(t,10),isNaN(t)&&(t=0);var r=parseInt(n,10);return isNaN(r)&&(r=t),r},e.prototype._get_selection=function(e,t,n){var r=this._get_selection_list(e,t,n);if(1!==r.length)throw new Error("Invalid Option Value: The option '"+e+"' can only be one of the following values:\n"+t+"\nYou passed in: '"+this.raw_options[e]+"'");return r[0]},e.prototype._get_selection_list=function(e,t,n){if(!t||0===t.length)throw new Error("Selection list cannot be empty.");if(n=n||[t[0]],!this._is_valid_selection(n,t))throw new Error("Invalid Default Value!");var r=this._get_array(e,n);if(!this._is_valid_selection(r,t))throw new Error("Invalid Option Value: The option '"+e+"' can contain only the following values:\n"+t+"\nYou passed in: '"+this.raw_options[e]+"'");return r},e.prototype._is_valid_selection=function(e,t){return e.length&&t.length&&!e.some(function(e){return-1===t.indexOf(e)})},Gx.Options=e,Gx.normalizeOpts=n,Gx.mergeOpts=t,Gx}function Yx(){if(Xx)return Qx;Xx=1;var e=Kx().Options,t=["before-newline","after-newline","preserve-newline"];function n(n){e.call(this,n,"js");var r=this.raw_options.brace_style||null;"expand-strict"===r?this.raw_options.brace_style="expand":"collapse-preserve-inline"===r?this.raw_options.brace_style="collapse,preserve-inline":void 0!==this.raw_options.braces_on_own_line&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var i=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var a=0;a<i.length;a++)"preserve-inline"===i[a]?this.brace_preserve_inline=!0:this.brace_style=i[a];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",t),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}return n.prototype=new e,Qx.Options=n,Qx}var Jx,$x={},eV={};function tV(){if(Jx)return eV;Jx=1;var e=RegExp.prototype.hasOwnProperty("sticky");function t(e){this.__input=e||"",this.__input_length=this.__input.length,this.__position=0}return t.prototype.restart=function(){this.__position=0},t.prototype.back=function(){this.__position>0&&(this.__position-=1)},t.prototype.hasNext=function(){return this.__position<this.__input_length},t.prototype.next=function(){var e=null;return this.hasNext()&&(e=this.__input.charAt(this.__position),this.__position+=1),e},t.prototype.peek=function(e){var t=null;return e=e||0,(e+=this.__position)>=0&&e<this.__input_length&&(t=this.__input.charAt(e)),t},t.prototype.__match=function(t,n){t.lastIndex=n;var r=t.exec(this.__input);return!r||e&&t.sticky||r.index!==n&&(r=null),r},t.prototype.test=function(e,t){return t=t||0,(t+=this.__position)>=0&&t<this.__input_length&&!!this.__match(e,t)},t.prototype.testChar=function(e,t){var n=this.peek(t);return e.lastIndex=0,null!==n&&e.test(n)},t.prototype.match=function(e){var t=this.__match(e,this.__position);return t?this.__position+=t[0].length:t=null,t},t.prototype.read=function(e,t,n){var r,i="";return e&&(r=this.match(e))&&(i+=r[0]),!t||!r&&e||(i+=this.readUntil(t,n)),i},t.prototype.readUntil=function(e,t){var n,r=this.__position;e.lastIndex=this.__position;var i=e.exec(this.__input);return i?(r=i.index,t&&(r+=i[0].length)):r=this.__input_length,n=this.__input.substring(this.__position,r),this.__position=r,n},t.prototype.readUntilAfter=function(e){return this.readUntil(e,!0)},t.prototype.get_regexp=function(t,n){var r=null,i="g";return n&&e&&(i="y"),"string"==typeof t&&""!==t?r=new RegExp(t,i):t&&(r=new RegExp(t.source,i)),r},t.prototype.get_literal_regexp=function(e){return RegExp(e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},t.prototype.peekUntilAfter=function(e){var t=this.__position,n=this.readUntilAfter(e);return this.__position=t,n},t.prototype.lookBack=function(e){var t=this.__position-1;return t>=e.length&&this.__input.substring(t-e.length,t).toLowerCase()===e},eV.InputScanner=t,eV}var nV,rV={},iV={};var aV,oV,lV,sV={},cV={};function dV(){if(aV)return cV;function e(e,t){this._input=e,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,t&&(this._starting_pattern=this._input.get_regexp(t._starting_pattern,!0),this._match_pattern=this._input.get_regexp(t._match_pattern,!0),this._until_pattern=this._input.get_regexp(t._until_pattern),this._until_after=t._until_after)}return aV=1,e.prototype.read=function(){var e=this._input.read(this._starting_pattern);return this._starting_pattern&&!e||(e+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),e},e.prototype.read_match=function(){return this._input.match(this._match_pattern)},e.prototype.until_after=function(e){var t=this._create();return t._until_after=!0,t._until_pattern=this._input.get_regexp(e),t._update(),t},e.prototype.until=function(e){var t=this._create();return t._until_after=!1,t._until_pattern=this._input.get_regexp(e),t._update(),t},e.prototype.starting_with=function(e){var t=this._create();return t._starting_pattern=this._input.get_regexp(e,!0),t._update(),t},e.prototype.matching=function(e){var t=this._create();return t._match_pattern=this._input.get_regexp(e,!0),t._update(),t},e.prototype._create=function(){return new e(this._input,this)},e.prototype._update=function(){},cV.Pattern=e,cV}function uV(){if(lV)return rV;lV=1;var e=tV().InputScanner,t=Bx().Token,n=function(){if(nV)return iV;function e(e){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=e}return nV=1,e.prototype.restart=function(){this.__position=0},e.prototype.isEmpty=function(){return 0===this.__tokens_length},e.prototype.hasNext=function(){return this.__position<this.__tokens_length},e.prototype.next=function(){var e=null;return this.hasNext()&&(e=this.__tokens[this.__position],this.__position+=1),e},e.prototype.peek=function(e){var t=null;return e=e||0,(e+=this.__position)>=0&&e<this.__tokens_length&&(t=this.__tokens[e]),t},e.prototype.add=function(e){this.__parent_token&&(e.parent=this.__parent_token),this.__tokens.push(e),this.__tokens_length+=1},iV.TokenStream=e,iV}().TokenStream,r=function(){if(oV)return sV;oV=1;var e=dV().Pattern;function t(t,n){e.call(this,t,n),n?this._line_regexp=this._input.get_regexp(n._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}return t.prototype=new e,t.prototype.__set_whitespace_patterns=function(e,t){e+="\\t ",t+="\\n\\r",this._match_pattern=this._input.get_regexp("["+e+t+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+t+"]")},t.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var e=this._input.read(this._match_pattern);if(" "===e)this.whitespace_before_token=" ";else if(e){var t=this.__split(this._newline_regexp,e);this.newline_count=t.length-1,this.whitespace_before_token=t[this.newline_count]}return e},t.prototype.matching=function(e,t){var n=this._create();return n.__set_whitespace_patterns(e,t),n._update(),n},t.prototype._create=function(){return new t(this._input,this)},t.prototype.__split=function(e,t){e.lastIndex=0;for(var n=0,r=[],i=e.exec(t);i;)r.push(t.substring(n,i.index)),n=i.index+i[0].length,i=e.exec(t);return n<t.length?r.push(t.substring(n,t.length)):r.push(""),r},sV.WhitespacePattern=t,sV}().WhitespacePattern,i={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},a=function(t,n){this._input=new e(t),this._options=n||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new r(this._input)};return a.prototype.tokenize=function(){var e;this._input.restart(),this.__tokens=new n,this._reset();for(var r=new t(i.START,""),a=null,o=[],l=new n;r.type!==i.EOF;){for(e=this._get_next_token(r,a);this._is_comment(e);)l.add(e),e=this._get_next_token(r,a);l.isEmpty()||(e.comments_before=l,l=new n),e.parent=a,this._is_opening(e)?(o.push(a),a=e):a&&this._is_closing(e,a)&&(e.opened=a,a.closed=e,a=o.pop(),e.parent=a),e.previous=r,r.next=e,this.__tokens.add(e),r=e}return this.__tokens},a.prototype._is_first_token=function(){return this.__tokens.isEmpty()},a.prototype._reset=function(){},a.prototype._get_next_token=function(e,t){this._readWhitespace();var n=this._input.read(/.+/g);return n?this._create_token(i.RAW,n):this._create_token(i.EOF,"")},a.prototype._is_comment=function(e){return!1},a.prototype._is_opening=function(e){return!1},a.prototype._is_closing=function(e,t){return!1},a.prototype._create_token=function(e,n){return new t(e,n,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token)},a.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},rV.Tokenizer=a,rV.TOKEN=i,rV}var fV,hV={};function CV(){if(fV)return hV;function e(e,t){e="string"==typeof e?e:e.source,t="string"==typeof t?t:t.source,this.__directives_block_pattern=new RegExp(e+/ beautify( \w+[:]\w+)+ /.source+t,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(e+/\sbeautify\signore:end\s/.source+t,"g")}return fV=1,e.prototype.get_directives=function(e){if(!e.match(this.__directives_block_pattern))return null;var t={};this.__directive_pattern.lastIndex=0;for(var n=this.__directive_pattern.exec(e);n;)t[n[1]]=n[2],n=this.__directive_pattern.exec(e);return t},e.prototype.readIgnored=function(e){return e.readUntilAfter(this.__directives_end_ignore_pattern)},hV.Directives=e,hV}var pV,mV,AV,gV,vV={};function yV(){if(pV)return vV;pV=1;var e=dV().Pattern,t={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1,angular:!1};function n(n,r){e.call(this,n,r),this.__template_pattern=null,this._disabled=Object.assign({},t),this._excluded=Object.assign({},t),r&&(this.__template_pattern=this._input.get_regexp(r.__template_pattern),this._excluded=Object.assign(this._excluded,r._excluded),this._disabled=Object.assign(this._disabled,r._disabled));var i=new e(n);this.__patterns={handlebars_comment:i.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:i.starting_with(/{{{/).until_after(/}}}/),handlebars:i.starting_with(/{{/).until_after(/}}/),php:i.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:i.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:i.starting_with(/{%/).until_after(/%}/),django_value:i.starting_with(/{{/).until_after(/}}/),django_comment:i.starting_with(/{#/).until_after(/#}/),smarty:i.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:i.starting_with(/{\*/).until_after(/\*}/),smarty_literal:i.starting_with(/{literal}/).until_after(/{\/literal}/)}}return n.prototype=new e,n.prototype._create=function(){return new n(this._input,this)},n.prototype._update=function(){this.__set_templated_pattern()},n.prototype.disable=function(e){var t=this._create();return t._disabled[e]=!0,t._update(),t},n.prototype.read_options=function(e){var n=this._create();for(var r in t)n._disabled[r]=-1===e.templating.indexOf(r);return n._update(),n},n.prototype.exclude=function(e){var t=this._create();return t._excluded[e]=!0,t._update(),t},n.prototype.read=function(){var e="";e=this._match_pattern?this._input.read(this._starting_pattern):this._input.read(this._starting_pattern,this.__template_pattern);for(var t=this._read_template();t;)this._match_pattern?t+=this._input.read(this._match_pattern):t+=this._input.readUntil(this.__template_pattern),e+=t,t=this._read_template();return this._until_after&&(e+=this._input.readUntilAfter(this._until_pattern)),e},n.prototype.__set_templated_pattern=function(){var e=[];this._disabled.php||e.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||e.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.angular||e.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||e.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(e.push(this.__patterns.django._starting_pattern.source),e.push(this.__patterns.django_value._starting_pattern.source),e.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||e.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&e.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+e.join("|")+")")},n.prototype._read_template=function(){var e="",t=this._input.peek();if("<"===t){var n=this._input.peek(1);this._disabled.php||this._excluded.php||"?"!==n||(e=e||this.__patterns.php.read()),this._disabled.erb||this._excluded.erb||"%"!==n||(e=e||this.__patterns.erb.read())}else"{"===t&&(this._disabled.handlebars||this._excluded.handlebars||(e=(e=(e=e||this.__patterns.handlebars_comment.read())||this.__patterns.handlebars_unescaped.read())||this.__patterns.handlebars.read()),this._disabled.django||(this._excluded.django||this._excluded.handlebars||(e=e||this.__patterns.django_value.read()),this._excluded.django||(e=(e=e||this.__patterns.django_comment.read())||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(e=(e=(e=e||this.__patterns.smarty_comment.read())||this.__patterns.smarty_literal.read())||this.__patterns.smarty.read()));return e},vV.TemplatablePattern=n,vV}function wV(){if(mV)return $x;mV=1;var e=tV().InputScanner,t=uV().Tokenizer,n=uV().TOKEN,r=CV().Directives,i=Ux(),a=dV().Pattern,o=yV().TemplatablePattern;function l(e,t){return-1!==t.indexOf(e)}var s={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:n.START,RAW:n.RAW,EOF:n.EOF},c=new r(/\/\*/,/\*\//),d=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,u=/[0-9]/,f=/[^\d\.]/,h=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),C=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";C=(C="\\?\\.(?!\\d) "+(C=C.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"))).replace(/ /g,"|");var p,m=new RegExp(C),A="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),g=A.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),v=new RegExp("^(?:"+g.join("|")+")$"),y=function(e,n){t.call(this,e,n),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var r=new a(this._input),l=new o(this._input).read_options(this._options);this.__patterns={template:l,identifier:l.starting_with(i.identifier).matching(i.identifierMatch),number:r.matching(d),punct:r.matching(m),comment:r.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:r.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:r.matching(/<!--/),html_comment_end:r.matching(/-->/),include:r.starting_with(/#include/).until_after(i.lineBreak),shebang:r.starting_with(/#!/).until_after(i.lineBreak),xml:r.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:l.until(/['\\\n\r\u2028\u2029]/),double_quote:l.until(/["\\\n\r\u2028\u2029]/),template_text:l.until(/[`\\$]/),template_expression:l.until(/[`}\\]/)}};return(y.prototype=new t)._is_comment=function(e){return e.type===s.COMMENT||e.type===s.BLOCK_COMMENT||e.type===s.UNKNOWN},y.prototype._is_opening=function(e){return e.type===s.START_BLOCK||e.type===s.START_EXPR},y.prototype._is_closing=function(e,t){return(e.type===s.END_BLOCK||e.type===s.END_EXPR)&&t&&("]"===e.text&&"["===t.text||")"===e.text&&"("===t.text||"}"===e.text&&"{"===t.text)},y.prototype._reset=function(){p=!1},y.prototype._get_next_token=function(e,t){var n=null;this._readWhitespace();var r=this._input.peek();return null===r?this._create_token(s.EOF,""):n=(n=(n=(n=(n=(n=(n=(n=(n=(n=n||this._read_non_javascript(r))||this._read_string(r))||this._read_pair(r,this._input.peek(1)))||this._read_word(e))||this._read_singles(r))||this._read_comment(r))||this._read_regexp(r,e))||this._read_xml(r,e))||this._read_punctuation())||this._create_token(s.UNKNOWN,this._input.next())},y.prototype._read_word=function(e){var t;return""!==(t=this.__patterns.identifier.read())?(t=t.replace(i.allLineBreaks,"\n"),e.type!==s.DOT&&(e.type!==s.RESERVED||"set"!==e.text&&"get"!==e.text)&&v.test(t)?"in"!==t&&"of"!==t||e.type!==s.WORD&&e.type!==s.STRING?this._create_token(s.RESERVED,t):this._create_token(s.OPERATOR,t):this._create_token(s.WORD,t)):""!==(t=this.__patterns.number.read())?this._create_token(s.WORD,t):void 0},y.prototype._read_singles=function(e){var t=null;return"("===e||"["===e?t=this._create_token(s.START_EXPR,e):")"===e||"]"===e?t=this._create_token(s.END_EXPR,e):"{"===e?t=this._create_token(s.START_BLOCK,e):"}"===e?t=this._create_token(s.END_BLOCK,e):";"===e?t=this._create_token(s.SEMICOLON,e):"."===e&&f.test(this._input.peek(1))?t=this._create_token(s.DOT,e):","===e&&(t=this._create_token(s.COMMA,e)),t&&this._input.next(),t},y.prototype._read_pair=function(e,t){var n=null;return"#"===e&&"{"===t&&(n=this._create_token(s.START_BLOCK,e+t)),n&&(this._input.next(),this._input.next()),n},y.prototype._read_punctuation=function(){var e=this.__patterns.punct.read();if(""!==e)return"="===e?this._create_token(s.EQUALS,e):"?."===e?this._create_token(s.DOT,e):this._create_token(s.OPERATOR,e)},y.prototype._read_non_javascript=function(e){var t="";if("#"===e){if(this._is_first_token()&&(t=this.__patterns.shebang.read()))return this._create_token(s.UNKNOWN,t.trim()+"\n");if(t=this.__patterns.include.read())return this._create_token(s.UNKNOWN,t.trim()+"\n");e=this._input.next();var n="#";if(this._input.hasNext()&&this._input.testChar(u)){do{n+=e=this._input.next()}while(this._input.hasNext()&&"#"!==e&&"="!==e);return"#"===e||("["===this._input.peek()&&"]"===this._input.peek(1)?(n+="[]",this._input.next(),this._input.next()):"{"===this._input.peek()&&"}"===this._input.peek(1)&&(n+="{}",this._input.next(),this._input.next())),this._create_token(s.WORD,n)}this._input.back()}else if("<"===e&&this._is_first_token()){if(t=this.__patterns.html_comment_start.read()){for(;this._input.hasNext()&&!this._input.testChar(i.newline);)t+=this._input.next();return p=!0,this._create_token(s.COMMENT,t)}}else if(p&&"-"===e&&(t=this.__patterns.html_comment_end.read()))return p=!1,this._create_token(s.COMMENT,t);return null},y.prototype._read_comment=function(e){var t=null;if("/"===e){var n="";if("*"===this._input.peek(1)){n=this.__patterns.block_comment.read();var r=c.get_directives(n);r&&"start"===r.ignore&&(n+=c.readIgnored(this._input)),n=n.replace(i.allLineBreaks,"\n"),(t=this._create_token(s.BLOCK_COMMENT,n)).directives=r}else"/"===this._input.peek(1)&&(n=this.__patterns.comment.read(),t=this._create_token(s.COMMENT,n))}return t},y.prototype._read_string=function(t){if("`"===t||"'"===t||'"'===t){var n=this._input.next();return this.has_char_escapes=!1,n+="`"===t?this._read_string_recursive("`",!0,"${"):this._read_string_recursive(t),this.has_char_escapes&&this._options.unescape_strings&&(n=function(t){var n="",r=0,i=new e(t),a=null;for(;i.hasNext();)if((a=i.match(/([\s]|[^\\]|\\\\)+/g))&&(n+=a[0]),"\\"===i.peek()){if(i.next(),"x"===i.peek())a=i.match(/x([0-9A-Fa-f]{2})/g);else{if("u"!==i.peek()){n+="\\",i.hasNext()&&(n+=i.next());continue}(a=i.match(/u([0-9A-Fa-f]{4})/g))||(a=i.match(/u\{([0-9A-Fa-f]+)\}/g))}if(!a)return t;if((r=parseInt(a[1],16))>126&&r<=255&&0===a[0].indexOf("x"))return t;n+=r>=0&&r<32||r>1114111?"\\"+a[0]:34===r||39===r||92===r?"\\"+String.fromCharCode(r):String.fromCharCode(r)}return n}(n)),this._input.peek()===t&&(n+=this._input.next()),n=n.replace(i.allLineBreaks,"\n"),this._create_token(s.STRING,n)}return null},y.prototype._allow_regexp_or_xml=function(e){return e.type===s.RESERVED&&l(e.text,["return","case","throw","else","do","typeof","yield"])||e.type===s.END_EXPR&&")"===e.text&&e.opened.previous.type===s.RESERVED&&l(e.opened.previous.text,["if","while","for"])||l(e.type,[s.COMMENT,s.START_EXPR,s.START_BLOCK,s.START,s.END_BLOCK,s.OPERATOR,s.EQUALS,s.EOF,s.SEMICOLON,s.COMMA])},y.prototype._read_regexp=function(e,t){if("/"===e&&this._allow_regexp_or_xml(t)){for(var n=this._input.next(),r=!1,a=!1;this._input.hasNext()&&(r||a||this._input.peek()!==e)&&!this._input.testChar(i.newline);)n+=this._input.peek(),r?r=!1:(r="\\"===this._input.peek(),"["===this._input.peek()?a=!0:"]"===this._input.peek()&&(a=!1)),this._input.next();return this._input.peek()===e&&(n+=this._input.next(),n+=this._input.read(i.identifier)),this._create_token(s.STRING,n)}return null},y.prototype._read_xml=function(e,t){if(this._options.e4x&&"<"===e&&this._allow_regexp_or_xml(t)){var n="",r=this.__patterns.xml.read_match();if(r){for(var a=r[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),o=0===a.indexOf("{"),l=0;r;){var c=!!r[1],d=r[2];if(!(!!r[r.length-1]||"![CDATA["===d.slice(0,8))&&(d===a||o&&d.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(c?--l:++l),n+=r[0],l<=0)break;r=this.__patterns.xml.read_match()}return r||(n+=this._input.match(/[\s\S]*/g)[0]),n=n.replace(i.allLineBreaks,"\n"),this._create_token(s.STRING,n)}}return null},y.prototype._read_string_recursive=function(e,t,n){var r,a;"'"===e?a=this.__patterns.single_quote:'"'===e?a=this.__patterns.double_quote:"`"===e?a=this.__patterns.template_text:"}"===e&&(a=this.__patterns.template_expression);for(var o=a.read(),l="";this._input.hasNext();){if((l=this._input.next())===e||!t&&i.newline.test(l)){this._input.back();break}"\\"===l&&this._input.hasNext()?("x"===(r=this._input.peek())||"u"===r?this.has_char_escapes=!0:"\r"===r&&"\n"===this._input.peek(1)&&this._input.next(),l+=this._input.next()):n&&("${"===n&&"$"===l&&"{"===this._input.peek()&&(l+=this._input.next()),n===l&&(l+="`"===e?this._read_string_recursive("}",t,"`"):this._read_string_recursive("`",t,"${"),this._input.hasNext()&&(l+=this._input.next()))),o+=l+=a.read()}return o},$x.Tokenizer=y,$x.TOKEN=s,$x.positionable_operators=h.slice(),$x.line_starters=A.slice(),$x}function EV(){if(AV)return Dx;AV=1;var e=Rx().Output,t=Bx().Token,n=Ux(),r=Yx().Options,i=wV().Tokenizer,a=wV().line_starters,o=wV().positionable_operators,l=wV().TOKEN;function s(e,t){return-1!==t.indexOf(e)}function c(e){return e.replace(/^\s+/g,"")}function d(e,t){return e&&e.type===l.RESERVED&&e.text===t}function u(e,t){return e&&e.type===l.RESERVED&&s(e.text,t)}var f=["case","return","do","if","throw","else","await","break","continue","async"],h=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].replace(/-/g,"_")]=e[n];return t}(["before-newline","after-newline","preserve-newline"]),C=[h.before_newline,h.preserve_newline],p="BlockStatement",m="Statement",A="ObjectLiteral",g="ArrayLiteral",v="ForInitializer",y="Conditional",w="Expression";function E(e,t){t.multiline_frame||t.mode===v||t.mode===y||e.remove_indent(t.start_line_index)}function b(e){return e===g}function M(e){return s(e,[w,v,y])}function L(e,t){t=t||{},this._source_text=e||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new r(t)}L.prototype.create_flags=function(e,n){var r=0;return e&&(r=e.indentation_level,!this._output.just_added_newline()&&e.line_indent_level>r&&(r=e.line_indent_level)),{mode:n,parent:e,last_token:e?e.last_token:new t(l.START_BLOCK,""),last_word:e?e.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:r,alignment:0,line_indent_level:e?e.line_indent_level:r,start_line_index:this._output.get_line_number(),ternary_depth:0}},L.prototype._reset=function(t){var n=t.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new e(this._options,n),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(p);var r=new i(t,this._options);return this._tokens=r.tokenize(),t},L.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var e=this._reset(this._source_text),t=this._options.eol;"auto"===this._options.eol&&(t="\n",e&&n.lineBreak.test(e||"")&&(t=e.match(n.lineBreak)[0]));for(var r=this._tokens.next();r;)this.handle_token(r),this._last_last_text=this._flags.last_token.text,this._flags.last_token=r,r=this._tokens.next();return this._output.get_code(t)},L.prototype.handle_token=function(e,t){e.type===l.START_EXPR?this.handle_start_expr(e):e.type===l.END_EXPR?this.handle_end_expr(e):e.type===l.START_BLOCK?this.handle_start_block(e):e.type===l.END_BLOCK?this.handle_end_block(e):e.type===l.WORD||e.type===l.RESERVED?this.handle_word(e):e.type===l.SEMICOLON?this.handle_semicolon(e):e.type===l.STRING?this.handle_string(e):e.type===l.EQUALS?this.handle_equals(e):e.type===l.OPERATOR?this.handle_operator(e):e.type===l.COMMA?this.handle_comma(e):e.type===l.BLOCK_COMMENT?this.handle_block_comment(e,t):e.type===l.COMMENT?this.handle_comment(e,t):e.type===l.DOT?this.handle_dot(e):e.type===l.EOF?this.handle_eof(e):(e.type,l.UNKNOWN,this.handle_unknown(e,t))},L.prototype.handle_whitespace_and_comments=function(e,t){var n=e.newlines,r=this._options.keep_array_indentation&&b(this._flags.mode);if(e.comments_before)for(var i=e.comments_before.next();i;)this.handle_whitespace_and_comments(i,t),this.handle_token(i,t),i=e.comments_before.next();if(r)for(var a=0;a<n;a+=1)this.print_newline(a>0,t);else if(this._options.max_preserve_newlines&&n>this._options.max_preserve_newlines&&(n=this._options.max_preserve_newlines),this._options.preserve_newlines&&n>1){this.print_newline(!1,t);for(var o=1;o<n;o+=1)this.print_newline(!0,t)}};var H=["async","break","continue","return","throw","yield"];return L.prototype.allow_wrap_or_preserved_newline=function(e,t){if(t=void 0!==t&&t,!this._output.just_added_newline()){var n=this._options.preserve_newlines&&e.newlines||t;if(s(this._flags.last_token.text,o)||s(e.text,o)){var r=s(this._flags.last_token.text,o)&&s(this._options.operator_position,C)||s(e.text,o);n=n&&r}if(n)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(u(this._flags.last_token,H))return;this._output.set_wrap_point()}}},L.prototype.print_newline=function(e,t){if(!t&&";"!==this._flags.last_token.text&&","!==this._flags.last_token.text&&"="!==this._flags.last_token.text&&(this._flags.last_token.type!==l.OPERATOR||"--"===this._flags.last_token.text||"++"===this._flags.last_token.text))for(var n=this._tokens.peek();!(this._flags.mode!==m||this._flags.if_block&&d(n,"else")||this._flags.do_block);)this.restore_mode();this._output.add_new_line(e)&&(this._flags.multiline_frame=!0)},L.prototype.print_token_line_indentation=function(e){this._output.just_added_newline()&&(this._options.keep_array_indentation&&e.newlines&&("["===e.text||b(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(e.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},L.prototype.print_token=function(e){if(this._output.raw)this._output.add_raw_token(e);else{if(this._options.comma_first&&e.previous&&e.previous.type===l.COMMA&&this._output.just_added_newline()&&","===this._output.previous_line.last()){var t=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(t),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(e),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(e),this._output.non_breaking_space=!0,this._output.add_token(e.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)}},L.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},L.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},L.prototype.set_mode=function(e){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,e),this._flags=this.create_flags(this._previous_flags,e),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},L.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===m&&E(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},L.prototype.start_of_object_property=function(){return this._flags.parent.mode===A&&this._flags.mode===m&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||u(this._flags.last_token,["get","set"]))},L.prototype.start_of_statement=function(e){var t=!1;return!!(t=(t=(t=(t=(t=(t=(t=t||u(this._flags.last_token,["var","let","const"])&&e.type===l.WORD)||d(this._flags.last_token,"do"))||!(this._flags.parent.mode===A&&this._flags.mode===m)&&u(this._flags.last_token,H)&&!e.newlines)||d(this._flags.last_token,"else")&&!(d(e,"if")&&!e.comments_before))||this._flags.last_token.type===l.END_EXPR&&(this._previous_flags.mode===v||this._previous_flags.mode===y))||this._flags.last_token.type===l.WORD&&this._flags.mode===p&&!this._flags.in_case&&!("--"===e.text||"++"===e.text)&&"function"!==this._last_last_text&&e.type!==l.WORD&&e.type!==l.RESERVED)||this._flags.mode===A&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||u(this._flags.last_token,["get","set"])))&&(this.set_mode(m),this.indent(),this.handle_whitespace_and_comments(e,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(e,u(e,["do","for","if","while"])),!0)},L.prototype.handle_start_expr=function(e){this.start_of_statement(e)||this.handle_whitespace_and_comments(e);var t=w;if("["===e.text){if(this._flags.last_token.type===l.WORD||")"===this._flags.last_token.text)return u(this._flags.last_token,a)&&(this._output.space_before_token=!0),this.print_token(e),this.set_mode(t),this.indent(),void(this._options.space_in_paren&&(this._output.space_before_token=!0));t=g,b(this._flags.mode)&&("["!==this._flags.last_token.text&&(","!==this._flags.last_token.text||"]"!==this._last_last_text&&"}"!==this._last_last_text)||this._options.keep_array_indentation||this.print_newline()),s(this._flags.last_token.type,[l.START_EXPR,l.END_EXPR,l.WORD,l.OPERATOR,l.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===l.RESERVED)"for"===this._flags.last_token.text?(this._output.space_before_token=this._options.space_before_conditional,t=v):s(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,t=y):s(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:"import"===this._flags.last_token.text&&""===e.whitespace_before?this._output.space_before_token=!1:(s(this._flags.last_token.text,a)||"catch"===this._flags.last_token.text)&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===l.EQUALS||this._flags.last_token.type===l.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(e);else if(this._flags.last_token.type===l.WORD){this._output.space_before_token=!1;var n=this._tokens.peek(-3);if(this._options.space_after_named_function&&n){var r=this._tokens.peek(-4);u(n,["async","function"])||"*"===n.text&&u(r,["async","function"])?this._output.space_before_token=!0:this._flags.mode===A?"{"!==n.text&&","!==n.text&&("*"!==n.text||"{"!==r.text&&","!==r.text)||(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(e);(this._flags.last_token.type===l.RESERVED&&("function"===this._flags.last_word||"typeof"===this._flags.last_word)||"*"===this._flags.last_token.text&&(s(this._last_last_text,["function","yield"])||this._flags.mode===A&&s(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}";"===this._flags.last_token.text||this._flags.last_token.type===l.START_BLOCK?this.print_newline():this._flags.last_token.type!==l.END_EXPR&&this._flags.last_token.type!==l.START_EXPR&&this._flags.last_token.type!==l.END_BLOCK&&"."!==this._flags.last_token.text&&this._flags.last_token.type!==l.COMMA||this.allow_wrap_or_preserved_newline(e,e.newlines),this.print_token(e),this.set_mode(t),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},L.prototype.handle_end_expr=function(e){for(;this._flags.mode===m;)this.restore_mode();this.handle_whitespace_and_comments(e),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(e,"]"===e.text&&b(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type!==l.START_EXPR||this._options.space_in_empty_paren?this._output.space_before_token=!0:(this._output.trim(),this._output.space_before_token=!1)),this.deindent(),this.print_token(e),this.restore_mode(),E(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===y&&(this._previous_flags.mode=w,this._flags.do_block=!1,this._flags.do_while=!1)},L.prototype.handle_start_block=function(e){this.handle_whitespace_and_comments(e);var t=this._tokens.peek(),n=this._tokens.peek(1);"switch"===this._flags.last_word&&this._flags.last_token.type===l.END_EXPR?(this.set_mode(p),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(p):n&&(s(n.text,[":",","])&&s(t.type,[l.STRING,l.WORD,l.RESERVED])||s(t.text,["get","set","..."])&&s(n.type,[l.WORD,l.RESERVED]))?s(this._last_last_text,["class","interface"])&&!s(n.text,[":",","])?this.set_mode(p):this.set_mode(A):this._flags.last_token.type===l.OPERATOR&&"=>"===this._flags.last_token.text?this.set_mode(p):s(this._flags.last_token.type,[l.EQUALS,l.START_EXPR,l.COMMA,l.OPERATOR])||u(this._flags.last_token,["return","throw","import","default"])?this.set_mode(A):this.set_mode(p),this._flags.last_token&&u(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0);var r=!t.comments_before&&"}"===t.text,i=r&&"function"===this._flags.last_word&&this._flags.last_token.type===l.END_EXPR;if(this._options.brace_preserve_inline){var a=0,o=null;this._flags.inline_frame=!0;do{if(a+=1,(o=this._tokens.peek(a-1)).newlines){this._flags.inline_frame=!1;break}}while(o.type!==l.EOF&&(o.type!==l.END_BLOCK||o.opened!==e))}("expand"===this._options.brace_style||"none"===this._options.brace_style&&e.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==l.OPERATOR&&(i||this._flags.last_token.type===l.EQUALS||u(this._flags.last_token,f)&&"else"!==this._flags.last_token.text)?this._output.space_before_token=!0:this.print_newline(!1,!0):(!b(this._previous_flags.mode)||this._flags.last_token.type!==l.START_EXPR&&this._flags.last_token.type!==l.COMMA||((this._flags.last_token.type===l.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===l.COMMA||this._flags.last_token.type===l.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(e),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==l.OPERATOR&&this._flags.last_token.type!==l.START_EXPR&&(s(this._flags.last_token.type,[l.START_BLOCK,l.SEMICOLON])&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(e),this.indent(),r||this._options.brace_preserve_inline&&this._flags.inline_frame||this.print_newline()},L.prototype.handle_end_block=function(e){for(this.handle_whitespace_and_comments(e);this._flags.mode===m;)this.restore_mode();var t=this._flags.last_token.type===l.START_BLOCK;this._flags.inline_frame&&!t?this._output.space_before_token=!0:"expand"===this._options.brace_style?t||this.print_newline():t||(b(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(e)},L.prototype.handle_word=function(e){if(e.type===l.RESERVED)if(s(e.text,["set","get"])&&this._flags.mode!==A)e.type=l.WORD;else if("import"===e.text&&s(this._tokens.peek().text,["(","."]))e.type=l.WORD;else if(s(e.text,["as","from"])&&!this._flags.import_block)e.type=l.WORD;else if(this._flags.mode===A){":"===this._tokens.peek().text&&(e.type=l.WORD)}if(this.start_of_statement(e)?u(this._flags.last_token,["var","let","const"])&&e.type===l.WORD&&(this._flags.declaration_statement=!0):!e.newlines||M(this._flags.mode)||this._flags.last_token.type===l.OPERATOR&&"--"!==this._flags.last_token.text&&"++"!==this._flags.last_token.text||this._flags.last_token.type===l.EQUALS||!this._options.preserve_newlines&&u(this._flags.last_token,["var","let","const","set","get"])?this.handle_whitespace_and_comments(e):(this.handle_whitespace_and_comments(e),this.print_newline()),this._flags.do_block&&!this._flags.do_while){if(d(e,"while"))return this._output.space_before_token=!0,this.print_token(e),this._output.space_before_token=!0,void(this._flags.do_while=!0);this.print_newline(),this._flags.do_block=!1}if(this._flags.if_block)if(!this._flags.else_block&&d(e,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===m;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&u(e,["case","default"]))return this.print_newline(),this._flags.case_block||!this._flags.case_body&&!this._options.jslint_happy||this.deindent(),this._flags.case_body=!1,this.print_token(e),void(this._flags.in_case=!0);if(this._flags.last_token.type!==l.COMMA&&this._flags.last_token.type!==l.START_EXPR&&this._flags.last_token.type!==l.EQUALS&&this._flags.last_token.type!==l.OPERATOR||this.start_of_object_property()||s(this._flags.last_token.text,["+","-"])&&":"===this._last_last_text&&this._flags.parent.mode===A||this.allow_wrap_or_preserved_newline(e),d(e,"function"))return(s(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!s(this._flags.last_token.text,["(","[","{",":","=",","])&&this._flags.last_token.type!==l.OPERATOR)&&(this._output.just_added_blankline()||e.comments_before||(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===l.RESERVED||this._flags.last_token.type===l.WORD?u(this._flags.last_token,["get","set","new","export"])||u(this._flags.last_token,H)||d(this._flags.last_token,"default")&&"export"===this._last_last_text||"declare"===this._flags.last_token.text?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===l.OPERATOR||"="===this._flags.last_token.text?this._output.space_before_token=!0:(this._flags.multiline_frame||!M(this._flags.mode)&&!b(this._flags.mode))&&this.print_newline(),this.print_token(e),void(this._flags.last_word=e.text);var t="NONE";(this._flags.last_token.type===l.END_BLOCK?this._previous_flags.inline_frame?t="SPACE":u(e,["else","catch","finally","from"])?"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&e.newlines?t="NEWLINE":(t="SPACE",this._output.space_before_token=!0):t="NEWLINE":this._flags.last_token.type===l.SEMICOLON&&this._flags.mode===p?t="NEWLINE":this._flags.last_token.type===l.SEMICOLON&&M(this._flags.mode)?t="SPACE":this._flags.last_token.type===l.STRING?t="NEWLINE":this._flags.last_token.type===l.RESERVED||this._flags.last_token.type===l.WORD||"*"===this._flags.last_token.text&&(s(this._last_last_text,["function","yield"])||this._flags.mode===A&&s(this._last_last_text,["{",","]))?t="SPACE":this._flags.last_token.type===l.START_BLOCK?t=this._flags.inline_frame?"SPACE":"NEWLINE":this._flags.last_token.type===l.END_EXPR&&(this._output.space_before_token=!0,t="NEWLINE"),u(e,a)&&")"!==this._flags.last_token.text&&(t=this._flags.inline_frame||"else"===this._flags.last_token.text||"export"===this._flags.last_token.text?"SPACE":"NEWLINE"),u(e,["else","catch","finally"]))?(this._flags.last_token.type!==l.END_BLOCK||this._previous_flags.mode!==p||"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&e.newlines)&&!this._flags.inline_frame?this.print_newline():(this._output.trim(!0),"}"!==this._output.current_line.last()&&this.print_newline(),this._output.space_before_token=!0):"NEWLINE"===t?u(this._flags.last_token,f)||"declare"===this._flags.last_token.text&&u(e,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==l.END_EXPR?this._flags.last_token.type===l.START_EXPR&&u(e,["var","let","const"])||":"===this._flags.last_token.text||(d(e,"if")&&d(e.previous,"else")?this._output.space_before_token=!0:this.print_newline()):u(e,a)&&")"!==this._flags.last_token.text&&this.print_newline():this._flags.multiline_frame&&b(this._flags.mode)&&","===this._flags.last_token.text&&"}"===this._last_last_text?this.print_newline():"SPACE"===t&&(this._output.space_before_token=!0);!e.previous||e.previous.type!==l.WORD&&e.previous.type!==l.RESERVED||(this._output.space_before_token=!0),this.print_token(e),this._flags.last_word=e.text,e.type===l.RESERVED&&("do"===e.text?this._flags.do_block=!0:"if"===e.text?this._flags.if_block=!0:"import"===e.text?this._flags.import_block=!0:this._flags.import_block&&d(e,"from")&&(this._flags.import_block=!1))},L.prototype.handle_semicolon=function(e){this.start_of_statement(e)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(e);for(var t=this._tokens.peek();!(this._flags.mode!==m||this._flags.if_block&&d(t,"else")||this._flags.do_block);)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(e)},L.prototype.handle_string=function(e){(!e.text.startsWith("`")||0!==e.newlines||""!==e.whitespace_before||")"!==e.previous.text&&this._flags.last_token.type!==l.WORD)&&(this.start_of_statement(e)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(e),this._flags.last_token.type===l.RESERVED||this._flags.last_token.type===l.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===l.COMMA||this._flags.last_token.type===l.START_EXPR||this._flags.last_token.type===l.EQUALS||this._flags.last_token.type===l.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(e):!e.text.startsWith("`")||this._flags.last_token.type!==l.END_EXPR||"]"!==e.previous.text&&")"!==e.previous.text||0!==e.newlines?this.print_newline():this._output.space_before_token=!0)),this.print_token(e)},L.prototype.handle_equals=function(e){this.start_of_statement(e)||this.handle_whitespace_and_comments(e),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(e),this._output.space_before_token=!0},L.prototype.handle_comma=function(e){this.handle_whitespace_and_comments(e,!0),this.print_token(e),this._output.space_before_token=!0,this._flags.declaration_statement?(M(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(e)):this._flags.mode===A||this._flags.mode===m&&this._flags.parent.mode===A?(this._flags.mode===m&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(e)},L.prototype.handle_operator=function(e){var t="*"===e.text&&(u(this._flags.last_token,["function","yield"])||s(this._flags.last_token.type,[l.START_BLOCK,l.COMMA,l.END_BLOCK,l.SEMICOLON])),n=s(e.text,["-","+"])&&(s(this._flags.last_token.type,[l.START_BLOCK,l.START_EXPR,l.EQUALS,l.OPERATOR])||s(this._flags.last_token.text,a)||","===this._flags.last_token.text);if(this.start_of_statement(e));else{var r=!t;this.handle_whitespace_and_comments(e,r)}if("*"!==e.text||this._flags.last_token.type!==l.DOT)if("::"!==e.text)if(s(e.text,["-","+"])&&this.start_of_object_property())this.print_token(e);else{if(this._flags.last_token.type===l.OPERATOR&&s(this._options.operator_position,C)&&this.allow_wrap_or_preserved_newline(e),":"===e.text&&this._flags.in_case)return this.print_token(e),this._flags.in_case=!1,this._flags.case_body=!0,void(this._tokens.peek().type!==l.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0));var i=!0,c=!0,d=!1;if(":"===e.text?0===this._flags.ternary_depth?i=!1:(this._flags.ternary_depth-=1,d=!0):"?"===e.text&&(this._flags.ternary_depth+=1),!n&&!t&&this._options.preserve_newlines&&s(e.text,o)){var A=":"===e.text,g=A&&d,v=A&&!d;switch(this._options.operator_position){case h.before_newline:return this._output.space_before_token=!v,this.print_token(e),A&&!g||this.allow_wrap_or_preserved_newline(e),void(this._output.space_before_token=!0);case h.after_newline:return this._output.space_before_token=!0,!A||g?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(e):this._output.space_before_token=!1,this.print_token(e),void(this._output.space_before_token=!0);case h.preserve_newline:return v||this.allow_wrap_or_preserved_newline(e),i=!(this._output.just_added_newline()||v),this._output.space_before_token=i,this.print_token(e),void(this._output.space_before_token=!0)}}if(t){this.allow_wrap_or_preserved_newline(e),i=!1;var y=this._tokens.peek();c=y&&s(y.type,[l.WORD,l.RESERVED])}else if("..."===e.text)this.allow_wrap_or_preserved_newline(e),i=this._flags.last_token.type===l.START_BLOCK,c=!1;else if(s(e.text,["--","++","!","~"])||n){if(this._flags.last_token.type!==l.COMMA&&this._flags.last_token.type!==l.START_EXPR||this.allow_wrap_or_preserved_newline(e),i=!1,c=!1,e.newlines&&("--"===e.text||"++"===e.text||"~"===e.text)){var w=u(this._flags.last_token,f)&&e.newlines;w&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(w,!0)}";"===this._flags.last_token.text&&M(this._flags.mode)&&(i=!0),this._flags.last_token.type===l.RESERVED?i=!0:this._flags.last_token.type===l.END_EXPR?i=!("]"===this._flags.last_token.text&&("--"===e.text||"++"===e.text)):this._flags.last_token.type===l.OPERATOR&&(i=s(e.text,["--","-","++","+"])&&s(this._flags.last_token.text,["--","-","++","+"]),s(e.text,["+","-"])&&s(this._flags.last_token.text,["--","++"])&&(c=!0)),(this._flags.mode!==p||this._flags.inline_frame)&&this._flags.mode!==m||"{"!==this._flags.last_token.text&&";"!==this._flags.last_token.text||this.print_newline()}this._output.space_before_token=this._output.space_before_token||i,this.print_token(e),this._output.space_before_token=c}else this.print_token(e);else this.print_token(e)},L.prototype.handle_block_comment=function(e,t){return this._output.raw?(this._output.add_raw_token(e),void(e.directives&&"end"===e.directives.preserve&&(this._output.raw=this._options.test_output_raw))):e.directives?(this.print_newline(!1,t),this.print_token(e),"start"===e.directives.preserve&&(this._output.raw=!0),void this.print_newline(!1,!0)):n.newline.test(e.text)||e.newlines?void this.print_block_commment(e,t):(this._output.space_before_token=!0,this.print_token(e),void(this._output.space_before_token=!0))},L.prototype.print_block_commment=function(e,t){var r,i=function(e){for(var t=[],r=(e=e.replace(n.allLineBreaks,"\n")).indexOf("\n");-1!==r;)t.push(e.substring(0,r)),r=(e=e.substring(r+1)).indexOf("\n");return e.length&&t.push(e),t}(e.text),a=!1,o=!1,l=e.whitespace_before,s=l.length;if(this.print_newline(!1,t),this.print_token_line_indentation(e),this._output.add_token(i[0]),this.print_newline(!1,t),i.length>1){for(a=function(e,t){for(var n=0;n<e.length;n++)if(e[n].trim().charAt(0)!==t)return!1;return!0}(i=i.slice(1),"*"),o=function(e,t){for(var n,r=0,i=e.length;r<i;r++)if((n=e[r])&&0!==n.indexOf(t))return!1;return!0}(i,l),a&&(this._flags.alignment=1),r=0;r<i.length;r++)a?(this.print_token_line_indentation(e),this._output.add_token(c(i[r]))):o&&i[r]?(this.print_token_line_indentation(e),this._output.add_token(i[r].substring(s))):(this._output.current_line.set_indent(-1),this._output.add_token(i[r])),this.print_newline(!1,t);this._flags.alignment=0}},L.prototype.handle_comment=function(e,t){e.newlines?this.print_newline(!1,t):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(e),this.print_newline(!1,t)},L.prototype.handle_dot=function(e){this.start_of_statement(e)||this.handle_whitespace_and_comments(e,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),u(this._flags.last_token,f)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(e,")"===this._flags.last_token.text&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(e)},L.prototype.handle_unknown=function(e,t){this.print_token(e),"\n"===e.text[e.text.length-1]&&this.print_newline(!1,t)},L.prototype.handle_eof=function(e){for(;this._flags.mode===m;)this.restore_mode();this.handle_whitespace_and_comments(e)},Dx.Beautifier=L,Dx}var bV,MV,LV,HV={exports:{}},xV={},VV={};function kV(){if(bV)return VV;bV=1;var e=Kx().Options;function t(t){e.call(this,t,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var n=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||n;var r=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var i=0;i<r.length;i++)"expand"!==r[i]?this.brace_style="collapse":this.brace_style=r[i]}return t.prototype=new e,VV.Options=t,VV}function SV(){if(LV)return HV.exports;LV=1;var e=function(){if(MV)return xV;MV=1;var e=kV().Options,t=Rx().Output,n=tV().InputScanner,r=new(0,CV().Directives)(/\/\*/,/\*\//),i=/\r\n|[\r\n]/,a=/\r\n|[\r\n]/g,o=/\s/,l=/(?:\s|\n)+/g,s=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,c=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function d(t,n){this._source_text=t||"",this._options=new e(n),this._ch=null,this._input=null,this.NESTED_AT_RULE={page:!0,"font-face":!0,keyframes:!0,media:!0,supports:!0,document:!0},this.CONDITIONAL_GROUP_RULE={media:!0,supports:!0,document:!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}return d.prototype.eatString=function(e){var t="";for(this._ch=this._input.next();this._ch;){if(t+=this._ch,"\\"===this._ch)t+=this._input.next();else if(-1!==e.indexOf(this._ch)||"\n"===this._ch)break;this._ch=this._input.next()}return t},d.prototype.eatWhitespace=function(e){for(var t=o.test(this._input.peek()),n=0;o.test(this._input.peek());)this._ch=this._input.next(),e&&"\n"===this._ch&&(0===n||n<this._options.max_preserve_newlines)&&(n++,this._output.add_new_line(!0));return t},d.prototype.foundNestedPseudoClass=function(){for(var e=0,t=1,n=this._input.peek(t);n;){if("{"===n)return!0;if("("===n)e+=1;else if(")"===n){if(0===e)return!1;e-=1}else if(";"===n||"}"===n)return!1;t++,n=this._input.peek(t)}return!1},d.prototype.print_string=function(e){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(e)},d.prototype.preserveSingleSpace=function(e){e&&(this._output.space_before_token=!0)},d.prototype.indent=function(){this._indentLevel++},d.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},d.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var e=this._source_text,d=this._options.eol;"auto"===d&&(d="\n",e&&i.test(e||"")&&(d=e.match(i)[0]));var u=(e=e.replace(a,"\n")).match(/^[\t ]*/)[0];this._output=new t(this._options,u),this._input=new n(e),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var f,h,C=0,p=!1,m=!1,A=!1,g=!1,v=!1,y=this._ch,w=!1;f=""!==this._input.read(l),h=y,this._ch=this._input.next(),"\\"===this._ch&&this._input.hasNext()&&(this._ch+=this._input.next()),y=this._ch,this._ch;)if("/"===this._ch&&"*"===this._input.peek()){this._output.add_new_line(),this._input.back();var E=this._input.read(s),b=r.get_directives(E);b&&"start"===b.ignore&&(E+=r.readIgnored(this._input)),this.print_string(E),this.eatWhitespace(!0),this._output.add_new_line()}else if("/"===this._ch&&"/"===this._input.peek())this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(c)),this.eatWhitespace(!0);else if("$"===this._ch){this.preserveSingleSpace(f),this.print_string(this._ch);var M=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);M.match(/[ :]$/)&&(M=this.eatString(": ").replace(/\s+$/,""),this.print_string(M),this._output.space_before_token=!0),0===C&&-1!==M.indexOf(":")&&(m=!0,this.indent())}else if("@"===this._ch)if(this.preserveSingleSpace(f),"{"===this._input.peek())this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var L=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);L.match(/[ :]$/)&&(L=this.eatString(": ").replace(/\s+$/,""),this.print_string(L),this._output.space_before_token=!0),0===C&&-1!==L.indexOf(":")?(m=!0,this.indent()):L in this.NESTED_AT_RULE?(this._nestedLevel+=1,L in this.CONDITIONAL_GROUP_RULE&&(A=!0)):0!==C||m||(g=!0)}else if("#"===this._ch&&"{"===this._input.peek())this.preserveSingleSpace(f),this.print_string(this._ch+this.eatString("}"));else if("{"===this._ch)m&&(m=!1,this.outdent()),g=!1,A?(A=!1,p=this._indentLevel>=this._nestedLevel):p=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&p&&this._output.previous_line&&"{"!==this._output.previous_line.item(-1)&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,"expand"===this._options.brace_style?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):("("===h?this._output.space_before_token=!1:","!==h&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if("}"===this._ch)this.outdent(),this._output.add_new_line(),"{"===h&&this._output.trim(!0),m&&(this.outdent(),m=!1),this.print_string(this._ch),p=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&"}"!==this._input.peek()&&this._output.add_new_line(!0),")"===this._input.peek()&&(this._output.trim(!0),"expand"===this._options.brace_style&&this._output.add_new_line(!0));else if(":"===this._ch){for(var H=0;H<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;H++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[H])){w=!0;break}!p&&!A||this._input.lookBack("&")||this.foundNestedPseudoClass()||this._input.lookBack("(")||g||0!==C?(this._input.lookBack(" ")&&(this._output.space_before_token=!0),":"===this._input.peek()?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":")):(this.print_string(":"),m||(m=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent()))}else if('"'===this._ch||"'"===this._ch){var x='"'===h||"'"===h;this.preserveSingleSpace(x||f),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(";"===this._ch)w=!1,0===C?(m&&(this.outdent(),m=!1),g=!1,this.print_string(this._ch),this.eatWhitespace(!0),"/"!==this._input.peek()&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if("("===this._ch)if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),C++,this.indent(),this._ch=this._input.next(),")"===this._ch||'"'===this._ch||"'"===this._ch?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),C&&(C--,this.outdent()));else{var V=!1;this._input.lookBack("with")&&(V=!0),this.preserveSingleSpace(f||V),this.print_string(this._ch),m&&"$"===h&&this._options.selector_separator_newline?(this._output.add_new_line(),v=!0):(this.eatWhitespace(),C++,this.indent())}else if(")"===this._ch)C&&(C--,this.outdent()),v&&";"===this._input.peek()&&this._options.selector_separator_newline&&(v=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(","===this._ch)this.print_string(this._ch),this.eatWhitespace(!0),!this._options.selector_separator_newline||m&&!v||0!==C||g?this._output.space_before_token=!0:this._output.add_new_line();else if(">"!==this._ch&&"+"!==this._ch&&"~"!==this._ch||m||0!==C)if("]"===this._ch)this.print_string(this._ch);else if("["===this._ch)this.preserveSingleSpace(f),this.print_string(this._ch);else if("="===this._ch)this.eatWhitespace(),this.print_string("="),o.test(this._ch)&&(this._ch="");else if("!"!==this._ch||this._input.lookBack("\\")){var k='"'===h||"'"===h;this.preserveSingleSpace(k||f),this.print_string(this._ch),!this._output.just_added_newline()&&"\n"===this._input.peek()&&w&&this._output.add_new_line()}else this._output.space_before_token=!0,this.print_string(this._ch);else this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&o.test(this._ch)&&(this._ch=""));return this._output.get_code(d)},xV.Beautifier=d,xV}().Beautifier,t=kV().Options;return HV.exports=function(t,n){return new e(t,n).beautify()},HV.exports.defaultOptions=function(){return new t},HV.exports}var zV,ZV={exports:{}},OV={},NV={};function TV(){if(zV)return NV;zV=1;var e=Kx().Options;function t(t){e.call(this,t,"html"),1===this.templating.length&&"auto"===this.templating[0]&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_min_attrs=this._get_number("wrap_attributes_min_attrs",2),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.inline_custom_elements=this._get_boolean("inline_custom_elements",!0),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}return t.prototype=new e,NV.Options=t,NV}var IV,DV,FV,RV,PV,jV={};function BV(){if(IV)return jV;IV=1;var e=uV().Tokenizer,t=uV().TOKEN,n=CV().Directives,r=yV().TemplatablePattern,i=dV().Pattern,a={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",CONTROL_FLOW_OPEN:"TK_CONTROL_FLOW_OPEN",CONTROL_FLOW_CLOSE:"TK_CONTROL_FLOW_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:t.START,RAW:t.RAW,EOF:t.EOF},o=new n(/<\!--/,/-->/),l=function(t,n){e.call(this,t,n),this._current_tag_name="";var a=new r(this._input).read_options(this._options),o=new i(this._input);if(this.__patterns={word:a.until(/[\n\r\t <]/),word_control_flow_close_excluded:a.until(/[\n\r\t <}]/),single_quote:a.until_after(/'/),double_quote:a.until_after(/"/),attribute:a.until(/[\n\r\t =>]|\/>/),element_name:a.until(/[\n\r\t >\/]/),angular_control_flow_start:o.matching(/\@[a-zA-Z]+[^({]*[({]/),handlebars_comment:o.starting_with(/{{!--/).until_after(/--}}/),handlebars:o.starting_with(/{{/).until_after(/}}/),handlebars_open:o.until(/[\n\r\t }]/),handlebars_raw_close:o.until(/}}/),comment:o.starting_with(/<!--/).until_after(/-->/),cdata:o.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:o.starting_with(/<!\[/).until_after(/]>/),processing:o.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars"),this.__patterns.word_control_flow_close_excluded=this.__patterns.word_control_flow_close_excluded.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var l=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=o.matching(l).until_after(l)}};return(l.prototype=new e)._is_comment=function(e){return!1},l.prototype._is_opening=function(e){return e.type===a.TAG_OPEN||e.type===a.CONTROL_FLOW_OPEN},l.prototype._is_closing=function(e,t){return e.type===a.TAG_CLOSE&&t&&((">"===e.text||"/>"===e.text)&&"<"===t.text[0]||"}}"===e.text&&"{"===t.text[0]&&"{"===t.text[1])||e.type===a.CONTROL_FLOW_CLOSE&&"}"===e.text&&t.text.endsWith("{")},l.prototype._reset=function(){this._current_tag_name=""},l.prototype._get_next_token=function(e,t){var n=null;this._readWhitespace();var r=this._input.peek();return null===r?this._create_token(a.EOF,""):n=(n=(n=(n=(n=(n=(n=(n=(n=(n=(n=n||this._read_open_handlebars(r,t))||this._read_attribute(r,e,t))||this._read_close(r,t))||this._read_script_and_style(r,e))||this._read_control_flows(r,t))||this._read_raw_content(r,e,t))||this._read_content_word(r,t))||this._read_comment_or_cdata(r))||this._read_processing(r))||this._read_open(r,t))||this._create_token(a.UNKNOWN,this._input.next())},l.prototype._read_comment_or_cdata=function(e){var t=null,n=null,r=null;"<"===e&&("!"===this._input.peek(1)&&((n=this.__patterns.comment.read())?(r=o.get_directives(n))&&"start"===r.ignore&&(n+=o.readIgnored(this._input)):n=this.__patterns.cdata.read()),n&&((t=this._create_token(a.COMMENT,n)).directives=r));return t},l.prototype._read_processing=function(e){var t=null,n=null;if("<"===e){var r=this._input.peek(1);"!"!==r&&"?"!==r||(n=(n=this.__patterns.conditional_comment.read())||this.__patterns.processing.read()),n&&((t=this._create_token(a.COMMENT,n)).directives=null)}return t},l.prototype._read_open=function(e,t){var n=null,r=null;return t&&t.type!==a.CONTROL_FLOW_OPEN||"<"===e&&(n=this._input.next(),"/"===this._input.peek()&&(n+=this._input.next()),n+=this.__patterns.element_name.read(),r=this._create_token(a.TAG_OPEN,n)),r},l.prototype._read_open_handlebars=function(e,t){var n=null,r=null;return t&&t.type!==a.CONTROL_FLOW_OPEN||(this._options.templating.includes("angular")||this._options.indent_handlebars)&&"{"===e&&"{"===this._input.peek(1)&&(this._options.indent_handlebars&&"!"===this._input.peek(2)?(n=(n=this.__patterns.handlebars_comment.read())||this.__patterns.handlebars.read(),r=this._create_token(a.COMMENT,n)):(n=this.__patterns.handlebars_open.read(),r=this._create_token(a.TAG_OPEN,n))),r},l.prototype._read_control_flows=function(e,t){var n="",r=null;if(!this._options.templating.includes("angular"))return r;if("@"===e){if(""===(n=this.__patterns.angular_control_flow_start.read()))return r;for(var i=n.endsWith("(")?1:0,o=0;!n.endsWith("{")||i!==o;){var l=this._input.next();if(null===l)break;"("===l?i++:")"===l&&o++,n+=l}r=this._create_token(a.CONTROL_FLOW_OPEN,n)}else"}"===e&&t&&t.type===a.CONTROL_FLOW_OPEN&&(n=this._input.next(),r=this._create_token(a.CONTROL_FLOW_CLOSE,n));return r},l.prototype._read_close=function(e,t){var n=null,r=null;return t&&t.type===a.TAG_OPEN&&("<"===t.text[0]&&(">"===e||"/"===e&&">"===this._input.peek(1))?(n=this._input.next(),"/"===e&&(n+=this._input.next()),r=this._create_token(a.TAG_CLOSE,n)):"{"===t.text[0]&&"}"===e&&"}"===this._input.peek(1)&&(this._input.next(),this._input.next(),r=this._create_token(a.TAG_CLOSE,"}}"))),r},l.prototype._read_attribute=function(e,t,n){var r=null,i="";if(n&&"<"===n.text[0])if("="===e)r=this._create_token(a.EQUALS,this._input.next());else if('"'===e||"'"===e){var o=this._input.next();o+='"'===e?this.__patterns.double_quote.read():this.__patterns.single_quote.read(),r=this._create_token(a.VALUE,o)}else(i=this.__patterns.attribute.read())&&(r=t.type===a.EQUALS?this._create_token(a.VALUE,i):this._create_token(a.ATTRIBUTE,i));return r},l.prototype._is_content_unformatted=function(e){return-1===this._options.void_elements.indexOf(e)&&(-1!==this._options.content_unformatted.indexOf(e)||-1!==this._options.unformatted.indexOf(e))},l.prototype._read_raw_content=function(e,t,n){var r="";if(n&&"{"===n.text[0])r=this.__patterns.handlebars_raw_close.read();else if(t.type===a.TAG_CLOSE&&"<"===t.opened.text[0]&&"/"!==t.text[0]){var i=t.opened.text.substr(1).toLowerCase();this._is_content_unformatted(i)&&(r=this._input.readUntil(new RegExp("</"+i+"[\\n\\r\\t ]*?>","ig")))}return r?this._create_token(a.TEXT,r):null},l.prototype._read_script_and_style=function(e,t){if(t.type===a.TAG_CLOSE&&"<"===t.opened.text[0]&&"/"!==t.text[0]){var n=t.opened.text.substr(1).toLowerCase();if("script"===n||"style"===n){var r=this._read_comment_or_cdata(e);if(r)return r.type=a.TEXT,r;var i=this._input.readUntil(new RegExp("</"+n+"[\\n\\r\\t ]*?>","ig"));if(i)return this._create_token(a.TEXT,i)}}return null},l.prototype._read_content_word=function(e,t){var n="";return this._options.unformatted_content_delimiter&&e===this._options.unformatted_content_delimiter[0]&&(n=this.__patterns.unformatted_content_delimiter.read()),n||(n=t&&t.type===a.CONTROL_FLOW_OPEN?this.__patterns.word_control_flow_close_excluded.read():this.__patterns.word.read()),n?this._create_token(a.TEXT,n):null},jV.Tokenizer=l,jV.TOKEN=a,jV}function _V(){if(DV)return OV;DV=1;var e=TV().Options,t=Rx().Output,n=BV().Tokenizer,r=BV().TOKEN,i=/\r\n|[\r\n]/,a=/\r\n|[\r\n]/g,o=function(e,n){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=e.max_preserve_newlines,this.preserve_newlines=e.preserve_newlines,this._output=new t(e,n)};o.prototype.current_line_has_match=function(e){return this._output.current_line.has_match(e)},o.prototype.set_space_before_token=function(e,t){this._output.space_before_token=e,this._output.non_breaking_space=t},o.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},o.prototype.add_raw_token=function(e){this._output.add_raw_token(e)},o.prototype.print_preserved_newlines=function(e){var t=0;e.type!==r.TEXT&&e.previous.type!==r.TEXT&&(t=e.newlines?1:0),this.preserve_newlines&&(t=e.newlines<this.max_preserve_newlines+1?e.newlines:this.max_preserve_newlines+1);for(var n=0;n<t;n++)this.print_newline(n>0);return 0!==t},o.prototype.traverse_whitespace=function(e){return!(!e.whitespace_before&&!e.newlines)&&(this.print_preserved_newlines(e)||(this._output.space_before_token=!0),!0)},o.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},o.prototype.print_newline=function(e){this._output.add_new_line(e)},o.prototype.print_token=function(e){e.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(e.text))},o.prototype.indent=function(){this.indent_level++},o.prototype.deindent=function(){this.indent_level>0&&(this.indent_level--,this._output.set_indent(this.indent_level,this.alignment_size))},o.prototype.get_full_indent=function(e){return(e=this.indent_level+(e||0))<1?"":this._output.get_indent_string(e)};var l=function(e,t){var n=null,i=null;return t.closed?("script"===e?n="text/javascript":"style"===e&&(n="text/css"),n=function(e){for(var t=null,n=e.next;n.type!==r.EOF&&e.closed!==n;){if(n.type===r.ATTRIBUTE&&"type"===n.text){n.next&&n.next.type===r.EQUALS&&n.next.next&&n.next.next.type===r.VALUE&&(t=n.next.next.text);break}n=n.next}return t}(t)||n,n.search("text/css")>-1?i="css":n.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?i="javascript":n.search(/(text|application|dojo)\/(x-)?(html)/)>-1?i="html":n.search(/test\/null/)>-1&&(i="null"),i):null};function s(e,t){return-1!==t.indexOf(e)}function c(e,t,n){this.parent=e||null,this.tag=t?t.tag_name:"",this.indent_level=n||0,this.parser_token=t||null}function d(e){this._printer=e,this._current_frame=null}function u(t,n,r,i){this._source_text=t||"",n=n||{},this._js_beautify=r,this._css_beautify=i,this._tag_stack=null;var a=new e(n,"html");this._options=a,this._is_wrap_attributes_force="force"===this._options.wrap_attributes.substr(0,5),this._is_wrap_attributes_force_expand_multiline="force-expand-multiline"===this._options.wrap_attributes,this._is_wrap_attributes_force_aligned="force-aligned"===this._options.wrap_attributes,this._is_wrap_attributes_aligned_multiple="aligned-multiple"===this._options.wrap_attributes,this._is_wrap_attributes_preserve="preserve"===this._options.wrap_attributes.substr(0,8),this._is_wrap_attributes_preserve_aligned="preserve-aligned"===this._options.wrap_attributes}d.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},d.prototype.record_tag=function(e){var t=new c(this._current_frame,e,this._printer.indent_level);this._current_frame=t},d.prototype._try_pop_frame=function(e){var t=null;return e&&(t=e.parser_token,this._printer.indent_level=e.indent_level,this._current_frame=e.parent),t},d.prototype._get_frame=function(e,t){for(var n=this._current_frame;n&&-1===e.indexOf(n.tag);){if(t&&-1!==t.indexOf(n.tag)){n=null;break}n=n.parent}return n},d.prototype.try_pop=function(e,t){var n=this._get_frame([e],t);return this._try_pop_frame(n)},d.prototype.indent_to_tag=function(e){var t=this._get_frame(e);t&&(this._printer.indent_level=t.indent_level)},u.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var e=this._source_text,t=this._options.eol;"auto"===this._options.eol&&(t="\n",e&&i.test(e)&&(t=e.match(i)[0]));var l=(e=e.replace(a,"\n")).match(/^[\t ]*/)[0],s={text:"",type:""},c=new f(this._options),u=new o(this._options,l),h=new n(e,this._options).tokenize();this._tag_stack=new d(u);for(var C=null,p=h.next();p.type!==r.EOF;)p.type===r.TAG_OPEN||p.type===r.COMMENT?c=C=this._handle_tag_open(u,p,c,s,h):p.type===r.ATTRIBUTE||p.type===r.EQUALS||p.type===r.VALUE||p.type===r.TEXT&&!c.tag_complete?C=this._handle_inside_tag(u,p,c,s):p.type===r.TAG_CLOSE?C=this._handle_tag_close(u,p,c):p.type===r.TEXT?C=this._handle_text(u,p,c):p.type===r.CONTROL_FLOW_OPEN?C=this._handle_control_flow_open(u,p):p.type===r.CONTROL_FLOW_CLOSE?C=this._handle_control_flow_close(u,p):u.add_raw_token(p),s=C,p=h.next();return u._output.get_code(t)},u.prototype._handle_control_flow_open=function(e,t){var n={text:t.text,type:t.type};return e.set_space_before_token(t.newlines||""!==t.whitespace_before,!0),t.newlines?e.print_preserved_newlines(t):e.set_space_before_token(t.newlines||""!==t.whitespace_before,!0),e.print_token(t),e.indent(),n},u.prototype._handle_control_flow_close=function(e,t){var n={text:t.text,type:t.type};return e.deindent(),t.newlines?e.print_preserved_newlines(t):e.set_space_before_token(t.newlines||""!==t.whitespace_before,!0),e.print_token(t),n},u.prototype._handle_tag_close=function(e,t,n){var r={text:t.text,type:t.type};return e.alignment_size=0,n.tag_complete=!0,e.set_space_before_token(t.newlines||""!==t.whitespace_before,!0),n.is_unformatted?e.add_raw_token(t):("<"===n.tag_start_char&&(e.set_space_before_token("/"===t.text[0],!0),this._is_wrap_attributes_force_expand_multiline&&n.has_wrapped_attrs&&e.print_newline(!1)),e.print_token(t)),!n.indent_content||n.is_unformatted||n.is_content_unformatted||(e.indent(),n.indent_content=!1),n.is_inline_element||n.is_unformatted||n.is_content_unformatted||e.set_wrap_point(),r},u.prototype._handle_inside_tag=function(e,t,n,i){var a=n.has_wrapped_attrs,o={text:t.text,type:t.type};return e.set_space_before_token(t.newlines||""!==t.whitespace_before,!0),n.is_unformatted?e.add_raw_token(t):"{"===n.tag_start_char&&t.type===r.TEXT?e.print_preserved_newlines(t)?(t.newlines=0,e.add_raw_token(t)):e.print_token(t):(t.type===r.ATTRIBUTE?e.set_space_before_token(!0):(t.type===r.EQUALS||t.type===r.VALUE&&t.previous.type===r.EQUALS)&&e.set_space_before_token(!1),t.type===r.ATTRIBUTE&&"<"===n.tag_start_char&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(e.traverse_whitespace(t),a=a||0!==t.newlines),this._is_wrap_attributes_force&&n.attr_count>=this._options.wrap_attributes_min_attrs&&(i.type!==r.TAG_OPEN||this._is_wrap_attributes_force_expand_multiline)&&(e.print_newline(!1),a=!0)),e.print_token(t),a=a||e.previous_token_wrapped(),n.has_wrapped_attrs=a),o},u.prototype._handle_text=function(e,t,n){var r={text:t.text,type:"TK_CONTENT"};return n.custom_beautifier_name?this._print_custom_beatifier_text(e,t,n):n.is_unformatted||n.is_content_unformatted?e.add_raw_token(t):(e.traverse_whitespace(t),e.print_token(t)),r},u.prototype._print_custom_beatifier_text=function(e,t,n){var r=this;if(""!==t.text){var i,a=t.text,o=1,l="",s="";"javascript"===n.custom_beautifier_name&&"function"==typeof this._js_beautify?i=this._js_beautify:"css"===n.custom_beautifier_name&&"function"==typeof this._css_beautify?i=this._css_beautify:"html"===n.custom_beautifier_name&&(i=function(e,t){return new u(e,t,r._js_beautify,r._css_beautify).beautify()}),"keep"===this._options.indent_scripts?o=0:"separate"===this._options.indent_scripts&&(o=-e.indent_level);var c=e.get_full_indent(o);if(a=a.replace(/\n[ \t]*$/,""),"html"!==n.custom_beautifier_name&&"<"===a[0]&&a.match(/^(<!--|<!\[CDATA\[)/)){var d=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(a);if(!d)return void e.add_raw_token(t);l=c+d[1]+"\n",a=d[4],d[5]&&(s=c+d[5]),a=a.replace(/\n[ \t]*$/,""),(d[2]||-1!==d[3].indexOf("\n"))&&(d=d[3].match(/[ \t]+$/))&&(t.whitespace_before=d[0])}if(a)if(i){var f=function(){this.eol="\n"};f.prototype=this._options.raw_options,a=i(c+a,new f)}else{var h=t.whitespace_before;h&&(a=a.replace(new RegExp("\n("+h+")?","g"),"\n")),a=c+a.replace(/\n/g,"\n"+c)}l&&(a=a?l+a+"\n"+s:l+s),e.print_newline(!1),a&&(t.text=a,t.whitespace_before="",t.newlines=0,e.add_raw_token(t),e.print_newline(!0))}},u.prototype._handle_tag_open=function(e,t,n,i,a){var o=this._get_tag_open_token(t);if(!n.is_unformatted&&!n.is_content_unformatted||n.is_empty_element||t.type!==r.TAG_OPEN||o.is_start_tag?(e.traverse_whitespace(t),this._set_tag_position(e,t,o,n,i),o.is_inline_element||e.set_wrap_point(),e.print_token(t)):(e.add_raw_token(t),o.start_tag_token=this._tag_stack.try_pop(o.tag_name)),o.is_start_tag&&this._is_wrap_attributes_force){var l,s=0;do{(l=a.peek(s)).type===r.ATTRIBUTE&&(o.attr_count+=1),s+=1}while(l.type!==r.EOF&&l.type!==r.TAG_CLOSE)}return(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(o.alignment_size=t.text.length+1),o.tag_complete||o.is_unformatted||(e.alignment_size=o.alignment_size),o};var f=function(e,t,n){if(this.parent=t||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",n){var i;this.tag_start_char=n.text[0],this.text=n.text,"<"===this.tag_start_char?(i=n.text.match(/^<([^\s>]*)/),this.tag_check=i?i[1]:""):(i=n.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=i?i[1]:"",(n.text.startsWith("{{#>")||n.text.startsWith("{{~#>"))&&">"===this.tag_check[0]&&(">"===this.tag_check&&null!==n.next?this.tag_check=n.next.text.split(" ")[0]:this.tag_check=n.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),n.type===r.COMMENT&&(this.tag_complete=!0),this.is_start_tag="/"!==this.tag_check.charAt(0),this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||n.closed&&"/>"===n.closed.text;var a=2;"{"===this.tag_start_char&&this.text.length>=3&&"~"===this.text.charAt(2)&&(a=3),this.is_end_tag=this.is_end_tag||"{"===this.tag_start_char&&(!e.indent_handlebars||this.text.length<3||/[^#\^]/.test(this.text.charAt(a)))}else this.tag_complete=!0};u.prototype._get_tag_open_token=function(e){var t=new f(this._options,this._tag_stack.get_parser_token(),e);return t.alignment_size=this._options.wrap_attributes_indent_size,t.is_end_tag=t.is_end_tag||s(t.tag_check,this._options.void_elements),t.is_empty_element=t.tag_complete||t.is_start_tag&&t.is_end_tag,t.is_unformatted=!t.tag_complete&&s(t.tag_check,this._options.unformatted),t.is_content_unformatted=!t.is_empty_element&&s(t.tag_check,this._options.content_unformatted),t.is_inline_element=s(t.tag_name,this._options.inline)||this._options.inline_custom_elements&&t.tag_name.includes("-")||"{"===t.tag_start_char,t},u.prototype._set_tag_position=function(e,t,n,i,a){if(n.is_empty_element||(n.is_end_tag?n.start_tag_token=this._tag_stack.try_pop(n.tag_name):(this._do_optional_end_element(n)&&(n.is_inline_element||e.print_newline(!1)),this._tag_stack.record_tag(n),"script"!==n.tag_name&&"style"!==n.tag_name||n.is_unformatted||n.is_content_unformatted||(n.custom_beautifier_name=l(n.tag_check,t)))),s(n.tag_check,this._options.extra_liners)&&(e.print_newline(!1),e._output.just_added_blankline()||e.print_newline(!0)),n.is_empty_element){if("{"===n.tag_start_char&&"else"===n.tag_check)this._tag_stack.indent_to_tag(["if","unless","each"]),n.indent_content=!0,e.current_line_has_match(/{{#if/)||e.print_newline(!1);"!--"===n.tag_name&&a.type===r.TAG_CLOSE&&i.is_end_tag&&-1===n.text.indexOf("\n")||(n.is_inline_element||n.is_unformatted||e.print_newline(!1),this._calcluate_parent_multiline(e,n))}else if(n.is_end_tag){var o=!1;o=(o=n.start_tag_token&&n.start_tag_token.multiline_content)||!n.is_inline_element&&!(i.is_inline_element||i.is_unformatted)&&!(a.type===r.TAG_CLOSE&&n.start_tag_token===i)&&"TK_CONTENT"!==a.type,(n.is_content_unformatted||n.is_unformatted)&&(o=!1),o&&e.print_newline(!1)}else n.indent_content=!n.custom_beautifier_name,"<"===n.tag_start_char&&("html"===n.tag_name?n.indent_content=this._options.indent_inner_html:"head"===n.tag_name?n.indent_content=this._options.indent_head_inner_html:"body"===n.tag_name&&(n.indent_content=this._options.indent_body_inner_html)),n.is_inline_element||n.is_unformatted||"TK_CONTENT"===a.type&&!n.is_content_unformatted||e.print_newline(!1),this._calcluate_parent_multiline(e,n)},u.prototype._calcluate_parent_multiline=function(e,t){!t.parent||!e._output.just_added_newline()||(t.is_inline_element||t.is_unformatted)&&t.parent.is_inline_element||(t.parent.multiline_content=!0)};var h=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","menu","nav","ol","p","pre","section","table","ul"],C=["a","audio","del","ins","map","noscript","video"];return u.prototype._do_optional_end_element=function(e){var t=null;if(!e.is_empty_element&&e.is_start_tag&&e.parent){if("body"===e.tag_name)t=t||this._tag_stack.try_pop("head");else if("li"===e.tag_name)t=t||this._tag_stack.try_pop("li",["ol","ul","menu"]);else if("dd"===e.tag_name||"dt"===e.tag_name)t=(t=t||this._tag_stack.try_pop("dt",["dl"]))||this._tag_stack.try_pop("dd",["dl"]);else if("p"===e.parent.tag_name&&-1!==h.indexOf(e.tag_name)){var n=e.parent.parent;n&&-1!==C.indexOf(n.tag_name)||(t=t||this._tag_stack.try_pop("p"))}else"rp"===e.tag_name||"rt"===e.tag_name?t=(t=t||this._tag_stack.try_pop("rt",["ruby","rtc"]))||this._tag_stack.try_pop("rp",["ruby","rtc"]):"optgroup"===e.tag_name?t=t||this._tag_stack.try_pop("optgroup",["select"]):"option"===e.tag_name?t=t||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):"colgroup"===e.tag_name?t=t||this._tag_stack.try_pop("caption",["table"]):"thead"===e.tag_name?t=(t=t||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]):"tbody"===e.tag_name||"tfoot"===e.tag_name?t=(t=(t=(t=t||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("thead",["table"]))||this._tag_stack.try_pop("tbody",["table"]):"tr"===e.tag_name?t=(t=(t=t||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"]):"th"!==e.tag_name&&"td"!==e.tag_name||(t=(t=t||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]))||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return e.parent=this._tag_stack.get_parser_token(),t}},OV.Beautifier=u,OV}function qV(){if(RV)return Tx;RV=1;var e=function(){if(gV)return Ix.exports;gV=1;var e=EV().Beautifier,t=Yx().Options;return Ix.exports=function(t,n){return new e(t,n).beautify()},Ix.exports.defaultOptions=function(){return new t},Ix.exports}(),t=SV(),n=function(){if(FV)return ZV.exports;FV=1;var e=_V().Beautifier,t=TV().Options;return ZV.exports=function(t,n,r,i){return new e(t,n,r,i).beautify()},ZV.exports.defaultOptions=function(){return new t},ZV.exports}();function r(r,i,a,o){return n(r,i,a=a||e,o=o||t)}return r.defaultOptions=n.defaultOptions,Tx.js=e,Tx.css=t,Tx.html=r,Tx}var UV=(PV||(PV=1,function(e){var t,n,r,i,a=qV();a.js_beautify=a.js,a.css_beautify=a.css,a.html_beautify=a.html,e.exports=(t=a,n=a,r=a,i=function(e,n){return t.js_beautify(e,n)},i.js=t.js_beautify,i.css=n.css_beautify,i.html=r.html_beautify,i.js_beautify=t.js_beautify,i.css_beautify=n.css_beautify,i.html_beautify=r.html_beautify,i)}(Nx)),Nx.exports);const WV=(e,t,n=150)=>{if(!e||!t)return{top:0,left:0};const{top:r,left:i}=e,a=t.getBoundingClientRect();let o=r,l=i;return o-=o+n>t.clientHeight-n+130?Math.floor(n/2)+n-35:10,i>.6*a.width?l-=n+50:i<.5*a.width+n&&(l-=42),{top:o,left:l}},XV=a(({width:t="100%",height:r="100%",VariableDropdownHeight:i="160px",readOnly:a=!1,value:s="",handleChange:d,setValue:u,variableOptionsList:f=[],addForloopPrefix:h=!1,language:C="json",theme:p="light",isRequisiteType:m=!1,onPaste:A,showVariableDropdown:g=!0,defaultValue:v,customOptions:y={},editorVariableZindex:E=99999,showMinimap:b=!0,isFocus:M=!1},L)=>{const H=o(null),V=o([]),k=o(null),S=o(null),[z,Z]=c(0),[O,N]=c(!1),[T,I]=c(!1),[D,F]=c({top:0,left:0}),[R,P]=c([]),j=o(f);l(()=>{j.current=f},[f]);l(()=>{const e=H.current;if(!e)return;const t=e.onDidBlurEditorWidget(()=>{I(!1),k.current=null,S.current=null,V.current=[],Z(0)}),n=t=>{const n=e.getDomNode(),r=n&&n.contains(t.target);if(!r||r&&!t.target.closest(".view-line, .monaco-editor-textarea")){const e=n?.querySelector("textarea");e&&e.blur()}};return document.addEventListener("mousedown",n),()=>{t.dispose(),document.removeEventListener("mousedown",n)}},[T]),l(()=>{const e=H.current;if(!e||!z)return;const t=[],n=[];O?n.push({range:{startLineNumber:z,startColumn:1,endLineNumber:z,endColumn:1},options:{isWholeLine:!1,linesDecorationsClassName:"active-line-number"}}):t.push({range:{startLineNumber:z,startColumn:1,endLineNumber:z,endColumn:1},options:{isWholeLine:!0,className:"current-line-background"}}),V.current=e.deltaDecorations(V.current,[...t,...n])},[z,O]);const B=(e,t)=>{switch(t){case"json":case"javascript":return UV.js(e,{indent_size:4,indent_char:" ",max_preserve_newlines:5,preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!0,brace_style:"collapse",space_before_conditional:!0,unescape_strings:!0,jslint_happy:!0,end_with_newline:!0,wrap_line_length:0,comma_first:!1,e4x:!0,indent_empty_lines:!0});case"html":case"xml":return UV.html(e,{indent_size:4,indent_char:" ",max_preserve_newlines:5,preserve_newlines:!0,end_with_newline:!0,wrap_line_length:0,indent_empty_lines:!0});default:return e}};return w(L,()=>({getEditorInstance:()=>H.current,focus:()=>{H.current?.focus()},beautify:()=>{if(H.current){const e=H.current.getValue(),t=H.current.getModel()?.getLanguageId(),n=B(e,t||"json");H.current.setValue(n)}}})),n("div",{style:{width:t,height:r},className:"ff-editor-container",children:[e(x,{defaultValue:v,height:r,width:t,language:C,value:s,options:{minimap:{enabled:b},lineNumbers:"on",wordWrap:"on",autoClosingBrackets:"always",scrollBeyondLastLine:!1,readOnly:a,guides:{indentation:!1},...y},onMount:(e,t)=>{H.current=e,M&&setTimeout(()=>{e.focus()},0),e.onDidChangeCursorPosition(t=>{Z(t.position.lineNumber);const n=e.getPosition(),r=e.getModel();if(!n||!r)return;const i=r.getLineContent(n.lineNumber),a=n.column-1;if(0===a)return void I(!1);const o=i.lastIndexOf("$",a-1),l=i.lastIndexOf("${",a-1),s=-1!==l?i.indexOf("}",l+2):-1,c=-1!==l&&-1!==s&&a-1>l&&a-1<s,d=!/\}/.test(i.slice(o+1,a));if(-1!==o&&a>o&&!/\s/.test(i.slice(o+1,a))&&!c&&d){k.current=o,S.current=i.slice(o+1,a);const r=(S.current??"").toLowerCase(),l=j.current.filter(e=>("_startforloop"===e.type&&h?`FLV_for:${e.name}`:e.name).toLowerCase().includes(r));P(l);const s=e.getScrolledVisiblePosition(n),c=e.getDomNode();F(WV(s,c,150)),["keyboard","mouse","deleteLeft"].includes(t?.source||"")&&I(!0)}else I(!1),k.current=null,S.current=null}),e.onMouseDown(()=>{setTimeout(()=>{const e=H.current;if(!e)return;const t=e.getPosition(),n=e.getModel();if(!t||!n)return;const r=n.getLineContent(t.lineNumber),i=t.column-2;"$"===r[i]?(k.current=i,S.current=""):(k.current=null,S.current=null)},0)}),e.onDidChangeCursorSelection(()=>{const t=(e.getSelections?.()||[]).some(e=>e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn);N(t)}),e.onDidChangeModelContent(()=>{const t=e.getValue();u(t);const n=e.getPosition(),r=e.getModel();if(!n||!r)return;const i=r.getLineContent(n.lineNumber),a=n.column-2;if("$"===i[k.current??a]){null===k.current&&(k.current=a),S.current=i.slice(k.current+1,a);const t=j.current.filter(e=>("_startforloop"===e.type&&h?`FLV_for:${e.name}`:e.name).toLowerCase().includes(S.current?.toLowerCase()));t.length?P(t):(P([]),k?.current!==a&&" "===i[a]&&(k.current=null,S.current=null,I(!1)));const r=e.getScrolledVisiblePosition(n),o=e.getDomNode();F(WV(r,o,150))}else k.current=null,S.current=null}),e.onDidPaste(()=>{const t=e.getValue();if(t){const n=B(t,C);e.setValue(n),A&&A(n)}}),t.languages.registerCompletionItemProvider(C,{triggerCharacters:["."],provideCompletionItems:(e,n)=>{const r=e.getValueInRange({startLineNumber:n.lineNumber,startColumn:1,endLineNumber:n.lineNumber,endColumn:n.column}),i=e.getWordAtPosition(n),a=i?new t.Range(n.lineNumber,i.startColumn,n.lineNumber,i.endColumn):new t.Range(n.lineNumber,n.column,n.lineNumber,n.column),o=[];return r.endsWith("ff.")&&o.push({label:"getVariable",kind:t.languages.CompletionItemKind.Method,insertText:"getVariable(${1:variableName})",insertTextRules:t.languages.CompletionItemInsertTextRule.InsertAsSnippet,detail:"Get a variable value",range:a},{label:"setVariable",kind:t.languages.CompletionItemKind.Method,insertText:"setVariable(${1:variableName}, ${2:value})",insertTextRules:t.languages.CompletionItemInsertTextRule.InsertAsSnippet,detail:"Set a variable value",range:a},{label:"sendRequest",kind:t.languages.CompletionItemKind.Method,insertText:'sendRequest({\n method: "GET",//add your method\n url: "https://fakestoreapi.com/products",//enter your url\n headers: { },//add your headers,\n params: params,//add your params,\n data: body,//add your request body,\n })',insertTextRules:t.languages.CompletionItemInsertTextRule.InsertAsSnippet,detail:"Make your http requests",range:a}),{suggestions:o}}})},onChange:(e,t)=>d(e,t),theme:p}),T&&D&&g&&e(oL,{position:"absolute",width:"300px",height:i,optionsList:R,onSelectVariable:e=>{if(m&&H.current){const t=H.current,n=t.getPosition();if(n){const r=`'${e.name}'`,i=k?.current??0;t.executeEdits("",[{range:{startLineNumber:n.lineNumber,startColumn:i+1,endLineNumber:n.lineNumber,endColumn:i+(n.column-i)},text:r,forceMoveMarkers:!0}]),S.current=null,k.current=null,I(!1)}}else((e,t)=>{if(H.current){const n=H.current,r=n.getPosition();if(r){const i=`{${t}${"FLV_for:"===t?"":"_"}${e}}`,a=k?.current??0;n.executeEdits("",[{range:{startLineNumber:r.lineNumber,startColumn:a+2,endLineNumber:r.lineNumber,endColumn:a+(r.column-a)},text:i,forceMoveMarkers:!1}]);const o=[];o.push({range:{startLineNumber:z,startColumn:1,endLineNumber:z,endColumn:1},options:{isWholeLine:!1}}),V.current=n.deltaDecorations(V.current,o),S.current=null,k.current=null,I(!1)}}})("DATAPROVIDER"===e?.type?e?.dpName+":"+e?.varname:e?.name,"STEPGROUP"===e.parentVariableType?"SGV":"GLOBAL"===e?.type?"GV":"LOCAL"===e?.type?"LV":(e?._id??e?.id??"").includes("PARAMETER")?"SGP":"_startforloop"===e?.type?"FLV_for:":"DATAPROVIDER"===e?.type?"DPV":"PEV")},dropdownPosition:D,zIndex:E})]})}),QV=e=>e.flatMap(e=>e.runLevelExecutionDataSets.map((t,n)=>{const{runLevelExecutionDataSets:r,...i}=e;return{...i,...t,runCount:n+1}}));var GV,KV={exports:{}};var YV,JV=(GV||(GV=1,"undefined"!=typeof self&&self,KV.exports=(YV=i,function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="lib/",n(n.s=5)}([function(e,t){e.exports=YV},function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ArcherContainerContextProvider=t.ArcherContainerContext=void 0;var i=r(n(0));t.ArcherContainerContext=i.default.createContext(null),t.ArcherContainerContextProvider=t.ArcherContainerContext.Provider},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.encodeId=void 0,t.encodeId=function(e){return encodeURI(e).replace(/%/g,"_")}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.getMarkerId=t.createShapeObj=t.getSourceToTargets=t.getEndShapeFromStyle=void 0;var r=["arrow","circle"];t.getEndShapeFromStyle=function(e){return e.endShape&&Object.keys(e.endShape).filter(function(e){return r.includes(e)})[0]||r[0]},t.getSourceToTargets=function(e){var t=Object.keys(e).map(function(t){return e[t]});return[].concat.apply([],t).sort(function(e,t){return e.order-t.order})},t.createShapeObj=function(e,n){return{arrow:function(){var t;return{arrow:Object.assign(Object.assign({},null==n?void 0:n.arrow),null===(t=e.endShape)||void 0===t?void 0:t.arrow)}},circle:function(){var t;return{circle:Object.assign(Object.assign({},null==n?void 0:n.circle),null===(t=e.endShape)||void 0===t?void 0:t.circle)}}}[(0,t.getEndShapeFromStyle)(e)]()},t.getMarkerId=function(e,t,n){return"".concat(e).concat(t.id).concat(n.id)}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.endShapeDefaultProp=void 0,t.endShapeDefaultProp={arrow:{arrowLength:10,arrowThickness:6},circle:{radius:2,fillColor:"#f00",strokeColor:"#0ff",strokeWidth:1}}},function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ArcherContainer=t.ArcherElement=void 0;var i=n(6);Object.defineProperty(t,"ArcherElement",{enumerable:!0,get:function(){return r(i).default}});var a=n(11);Object.defineProperty(t,"ArcherContainer",{enumerable:!0,get:function(){return r(a).default}})},function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&("get"in i?t.__esModule:!i.writable&&!i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});var o=a(n(0)),l=n(7),s=n(1),c=n(2),d=n(8),u=n(10);t.default=function(e){var t=e.id,n=e.relations,r=void 0===n?[]:n,i=e.children,a=(0,o.useMemo)(function(){return(0,c.encodeId)(t)},[t]),f=(0,o.useContext)(s.ArcherContainerContext),h=(0,o.useRef)(),C=(0,o.useCallback)(function(e){var t=(0,u.generateSourceToTarget)(a,e);(0,u.assertContextExists)(f),f.registerTransitions(a,t)},[f,a]),p=(0,o.useCallback)(function(){(0,u.assertContextExists)(f),f.unregisterTransitions(a)},[f,a]),m=(0,o.useCallback)(function(e){e&&((0,u.assertContextExists)(f),f.registerChild(a,e))},[a,f]),A=(0,o.useCallback)(function(){(0,u.assertContextExists)(f),f.unregisterChild(a)},[f,a]);(0,l.useIsomorphicLayoutEffect)(function(){return m(h.current),function(){return A()}},[m,A]),(0,d.useDeepCompareEffect)(function(){return C(r),function(){return p()}},[C,r,p]),o.default.Children.only(i);var g=i;return o.default.cloneElement(g,Object.assign(Object.assign({},g.props),{ref:h}))}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.useIsomorphicLayoutEffect=void 0;var r=n(0);t.useIsomorphicLayoutEffect="undefined"!=typeof window?r.useLayoutEffect:r.useEffect},function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useDeepCompareEffect=void 0;var i=n(0),a=r(n(9));function o(e){var t=(0,i.useRef)();return(0,a.default)(e,t.current)||(t.current=e),t.current}t.useDeepCompareEffect=function(e,t){(0,i.useEffect)(e,t.map(o))}},function(e,t,n){var r=Array.isArray,i=Object.keys,a=Object.prototype.hasOwnProperty,o="undefined"!=typeof Element;e.exports=function(e,t){try{return function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){var l,s,c,d=r(t),u=r(n);if(d&&u){if((s=t.length)!=n.length)return!1;for(l=s;0!=l--;)if(!e(t[l],n[l]))return!1;return!0}if(d!=u)return!1;var f=t instanceof Date,h=n instanceof Date;if(f!=h)return!1;if(f&&h)return t.getTime()==n.getTime();var C=t instanceof RegExp,p=n instanceof RegExp;if(C!=p)return!1;if(C&&p)return t.toString()==n.toString();var m=i(t);if((s=m.length)!==i(n).length)return!1;for(l=s;0!=l--;)if(!a.call(n,m[l]))return!1;if(o&&t instanceof Element&&n instanceof Element)return t===n;for(l=s;0!=l--;)if(!("_owner"===(c=m[l])&&t.$$typeof||e(t[c],n[c])))return!1;return!0}return t!=t&&n!=n}(e,t)}catch(e){if(e.message&&e.message.match(/stack|recursion/i)||-2146828260===e.number)return console.warn("Warning: react-fast-compare does not handle circular references.",e.name,e.message),!1;throw e}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.generateSourceToTarget=t.assertContextExists=void 0;var r=n(2);t.assertContextExists=function(e){if(!e)throw new Error("Could not find ArcherContainerContext in <ArcherElement>. Please wrap the component in a <ArcherContainer>.")},t.generateSourceToTarget=function(e,t){return t.map(function(t){var n=t.targetId,i=t.sourceAnchor,a=t.targetAnchor,o=t.label,l=t.className,s=t.style,c=t.order,d=void 0===c?0:c,u=t.domAttributes,f=t.cursor,h=t.hitSlop;return{source:{id:(0,r.encodeId)(e),anchor:i},target:{id:(0,r.encodeId)(n),anchor:a},className:l,label:o,style:s,order:d,domAttributes:u,cursor:f,hitSlop:h}})}},function(e,t,n){function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);o=!0);}catch(e){l=!0,i=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&("get"in i?t.__esModule:!i.writable&&!i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),l=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return l(t,e),t},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var d=s(n(0)),u=c(n(12)),f=n(1),h=n(14),C=n(4),p=n(19),m=n(20),A={position:"absolute",width:"100%",height:"100%",top:0,left:0,pointerEvents:"none"},g=d.default.forwardRef(function(e,t){var n=e.endShape,a=void 0===n?C.endShapeDefaultProp:n,o=e.strokeColor,l=void 0===o?"#f00":o,s=e.strokeWidth,c=void 0===s?2:s,g=e.svgContainerStyle,v=void 0===g?{}:g,y=e.noCurves,w=e.children,E=e.className,b=e.endMarker,M=e.lineStyle,L=e.offset,H=e.startMarker,x=e.strokeDasharray,V=e.style,k=i((0,d.useState)({}),2),S=k[0],z=k[1],Z=i((0,d.useState)({}),2),O=Z[0],N=Z[1],T=(0,d.useRef)(new u.default(function(){P()})).current,I=(0,d.useRef)(null),D=i(d.default.useState(),2)[1],F=(0,d.useRef)("arrow".concat(Math.random().toString().slice(2))).current;(0,d.useImperativeHandle)(t,function(){return{refreshScreen:P,arrowMarkerUniquePrefix:F}});var R,P=d.default.useCallback(function(){return D({})},[]),j=(0,d.useCallback)(function(e,t){N(function(n){return Object.assign(Object.assign({},n),r({},e,t))})},[]),B=(0,d.useCallback)(function(e){N(function(t){var n=Object.assign({},t);return delete n[e],n})},[]),_=(0,d.useCallback)(function(e,t){z(function(n){return n[e]===t?n:Object.assign(Object.assign({},n),r({},e,t))})},[]),q=(0,d.useCallback)(function(e){z(function(t){var n=Object.assign({},t);return delete n[e],n})},[]),U=(0,d.useMemo)(function(){return Object.assign(Object.assign({},A),v)},[v]);R="function"==typeof w?w(f.ArcherContainerContext):w,(0,m.useResizeListener)(P),(0,m.useObserveElements)(S,T);var W=(0,d.useMemo)(function(){return{registerTransitions:j,unregisterTransitions:B,registerChild:_,unregisterChild:q}},[j,B,_,q]);return d.default.createElement(f.ArcherContainerContextProvider,{value:W},d.default.createElement("div",{style:Object.assign(Object.assign({},V),{position:"relative"}),className:E},d.default.createElement("svg",{style:U},d.default.createElement("defs",null,d.default.createElement(p.ArrowMarkers,{endShape:a,sourceToTargetsMap:O,strokeColor:l,uniqueId:F})),d.default.createElement(h.SvgArrows,{startMarker:H,endMarker:b,endShape:a,strokeColor:l,strokeWidth:c,strokeDasharray:x,noCurves:y,lineStyle:M,offset:L,parentCurrent:I.current,refs:S,uniqueId:F,sourceToTargetsMap:O})),d.default.createElement("div",{style:{height:"100%"},ref:I},R)))});t.default=g},function(e,t,n){n.r(t),function(e){var n=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some(function(e,r){return e[0]===t&&(n=r,!0)}),n}return function(){function t(){this.__entries__=[]}var n={size:{configurable:!0}};return n.size.get=function(){return this.__entries__.length},t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,r=this.__entries__;n<r.length;n+=1){var i=r[n];e.call(t,i[1],i[0])}},Object.defineProperties(t.prototype,n),t}()}(),r="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,i=void 0!==e&&e.Math===Math?e:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),a="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(i):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)},o=2,l=["top","right","bottom","left","width","height","size","weight"],s="undefined"!=typeof MutationObserver,c=function(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(e,t){var n=!1,r=!1,i=0;function l(){n&&(n=!1,e()),r&&c()}function s(){a(l)}function c(){var e=Date.now();if(n){if(e-i<o)return;r=!0}else n=!0,r=!1,setTimeout(s,t);i=e}return c}(this.refresh.bind(this),20)};c.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},c.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},c.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},c.prototype.updateObservers_=function(){var e=this.observers_.filter(function(e){return e.gatherActive(),e.hasActive()});return e.forEach(function(e){return e.broadcastActive()}),e.length>0},c.prototype.connect_=function(){r&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),s?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},c.prototype.disconnect_=function(){r&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},c.prototype.onTransitionEnd_=function(e){var t=e.propertyName;void 0===t&&(t=""),l.some(function(e){return!!~t.indexOf(e)})&&this.refresh()},c.getInstance=function(){return this.instance_||(this.instance_=new c),this.instance_},c.instance_=null;var d=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n+=1){var i=r[n];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0})}return e},u=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||i},f=g(0,0,0,0);function h(e){return parseFloat(e)||0}function C(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];return t.reduce(function(t,n){return t+h(e["border-"+n+"-width"])},0)}function p(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return f;var r=u(e).getComputedStyle(e),i=function(e){for(var t={},n=0,r=["top","right","bottom","left"];n<r.length;n+=1){var i=r[n],a=e["padding-"+i];t[i]=h(a)}return t}(r),a=i.left+i.right,o=i.top+i.bottom,l=h(r.width),s=h(r.height);if("border-box"===r.boxSizing&&(Math.round(l+a)!==t&&(l-=C(r,"left","right")+a),Math.round(s+o)!==n&&(s-=C(r,"top","bottom")+o)),!function(e){return e===u(e).document.documentElement}(e)){var c=Math.round(l+a)-t,d=Math.round(s+o)-n;1!==Math.abs(c)&&(l-=c),1!==Math.abs(d)&&(s-=d)}return g(i.left,i.top,l,s)}var m="undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof u(e).SVGGraphicsElement}:function(e){return e instanceof u(e).SVGElement&&"function"==typeof e.getBBox};function A(e){return r?m(e)?function(e){var t=e.getBBox();return g(0,0,t.width,t.height)}(e):p(e):f}function g(e,t,n,r){return{x:e,y:t,width:n,height:r}}var v=function(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=g(0,0,0,0),this.target=e};v.prototype.isActive=function(){var e=A(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},v.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e};var y=function(e,t){var n=function(e){var t=e.x,n=e.y,r=e.width,i=e.height,a="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,o=Object.create(a.prototype);return d(o,{x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:i+n,left:t}),o}(t);d(this,{target:e,contentRect:n})},w=function(e,t,r){if(this.activeObservations_=[],this.observations_=new n,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=r};w.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof u(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new v(e)),this.controller_.addObserver(this),this.controller_.refresh())}},w.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof u(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},w.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},w.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},w.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(e){return new y(e.target,e.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},w.prototype.clearActive=function(){this.activeObservations_.splice(0)},w.prototype.hasActive=function(){return this.activeObservations_.length>0};var E="undefined"!=typeof WeakMap?new WeakMap:new n,b=function(e){if(!(this instanceof b))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var t=c.getInstance(),n=new w(e,t,this);E.set(this,n)};["observe","unobserve","disconnect"].forEach(function(e){b.prototype[e]=function(){return(t=E.get(this))[e].apply(t,arguments);var t}});var M=void 0!==i.ResizeObserver?i.ResizeObserver:b;t.default=M}.call(this,n(13))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.SvgArrows=void 0;var i=r(n(0)),a=n(15),o=r(n(17)),l=n(3),s=function(e){var t,n,r=e.style||{},s=r.startMarker||e.startMarker,c=null===(n=null!==(t=r.endMarker)&&void 0!==t?t:e.endMarker)||void 0===n||n,d=(0,l.createShapeObj)(r,e.endShape),u=e.domAttributes,f=e.cursor,h=e.hitSlop,C=r.strokeColor||e.strokeColor,p=r.strokeWidth||e.strokeWidth,m=r.strokeDasharray||e.strokeDasharray,A=!(!r.noCurves&&!e.noCurves),g=r.lineStyle||e.lineStyle||(A?"angle":"curve"),v=e.offset||0,y=e.source.anchor,w=(0,a.getPointCoordinatesFromAnchorPosition)(e.source.anchor,e.source.id,e.parentCoordinates,e.refs),E=e.target.anchor,b=(0,a.getPointCoordinatesFromAnchorPosition)(e.target.anchor,e.target.id,e.parentCoordinates,e.refs);return w?b?i.default.createElement(o.default,{className:e.className,startingPoint:w,startingAnchorOrientation:y,endingPoint:b,endingAnchorOrientation:E,strokeColor:C,strokeWidth:p,strokeDasharray:m,arrowLabel:e.label,arrowMarkerId:(0,l.getMarkerId)(e.uniqueId,e.source,e.target),lineStyle:g,offset:v,enableStartMarker:!!s,disableEndMarker:!c,endShape:d,domAttributes:u,hitSlop:h,cursor:f}):(console.warn("[React Archer] Could not find target element! Not drawing the arrow."),null):(console.warn("[React Archer] Could not find starting point of element! Not drawing the arrow."),null)};t.SvgArrows=function(e){var t=(0,a.getPointFromElement)(e.parentCurrent);return t?i.default.createElement(i.default.Fragment,null,(0,l.getSourceToTargets)(e.sourceToTargetsMap).map(function(n){return i.default.createElement(s,{key:JSON.stringify({source:n.source,target:n.target}),source:n.source,target:n.target,className:n.className,label:n.label,style:n.style||{},domAttributes:n.domAttributes,hitSlop:n.hitSlop,cursor:n.cursor,startMarker:e.startMarker,endMarker:e.endMarker,endShape:e.endShape,strokeColor:e.strokeColor,strokeWidth:e.strokeWidth,strokeDasharray:e.strokeDasharray,noCurves:e.noCurves,lineStyle:e.lineStyle,offset:e.offset,parentCoordinates:t,refs:e.refs,uniqueId:e.uniqueId})})):null}},function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getPointCoordinatesFromAnchorPosition=t.getPointFromElement=void 0;var i=r(n(16));function a(e){return new i.default(e.left,e.top)}var o=function(e){return e?e.getBoundingClientRect():null};t.getPointFromElement=function(e){var t=o(e);return t?a(t):null},t.getPointCoordinatesFromAnchorPosition=function(e,t,n,r){var l=o(r[t]);if(!l)return null;var s=function(e,t){switch(e){case"top":return a(t).add(new i.default(t.width/2,0));case"bottom":return a(t).add(new i.default(t.width/2,t.height));case"left":return a(t).add(new i.default(0,t.height/2));case"right":return a(t).add(new i.default(t.width,t.height/2));case"middle":return a(t).add(new i.default(t.width/2,t.height/2));default:return console.error("[React Archer] Invalid anchor position was provided. Not drawing the arrow."),null}}(e,l);return s?s.substract(n):null}},function(e,t,n){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.x=t,this.y=n}return function(e,t){t&&r(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1})}(e,[{key:"add",value:function(t){return new e(this.x+t.x,this.y+t.y)}},{key:"substract",value:function(t){return new e(this.x-t.x,this.y-t.y)}}]),e}();t.default=i},function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.computeLabelDimensions=t.computeEndingAnchorPosition=t.computeStartingAnchorPosition=t.computeArrowPointAccordingToArrowHead=void 0;var i=r(n(0)),a=n(18);function o(e,t,n,r,i,o,l,s){var c=(0,a.computeArrowDirectionVector)(i),d=c.arrowX,u=c.arrowY;if("straight"===o&&void 0!==l&&void 0!==s){var f=Math.atan2(s-t,l-e);d=Math.cos(f),u=Math.sin(f)}return{xPoint:e+d*n*r/2,yPoint:t+u*n*r/2}}function l(e,t,n,r,i){return"top"===i||"bottom"===i?{xAnchor1:e,yAnchor1:t+(r-t)/2}:"left"===i||"right"===i?{xAnchor1:e+(n-e)/2,yAnchor1:t}:{xAnchor1:e,yAnchor1:t}}function s(e,t,n,r,i){return"top"===i||"bottom"===i?{xAnchor2:n,yAnchor2:r-(r-t)/2}:"left"===i||"right"===i?{xAnchor2:n-(n-e)/2,yAnchor2:r}:{xAnchor2:n,yAnchor2:r}}function c(e,t,n,r){return{xLabel:n>e?e:n,yLabel:r>t?t:r,labelWidth:Math.max(Math.abs(n-e),1),labelHeight:Math.max(Math.abs(r-t),1)}}t.computeArrowPointAccordingToArrowHead=o,t.computeStartingAnchorPosition=l,t.computeEndingAnchorPosition=s,t.computeLabelDimensions=c,t.default=function(e){var t=e.className,n=e.startingPoint,r=e.startingAnchorOrientation,a=e.endingPoint,d=e.endingAnchorOrientation,u=e.strokeColor,f=e.strokeWidth,h=e.strokeDasharray,C=e.arrowLabel,p=e.arrowMarkerId,m=e.lineStyle,A=e.offset,g=e.enableStartMarker,v=e.disableEndMarker,y=e.endShape,w=e.domAttributes,E=e.hitSlop,b=void 0===E?10:E,M=e.cursor,L=void 0===M?"pointer":M,H=y.circle?2*y.circle.radius:2*y.arrow.arrowLength,x=o(n.x,n.y,g?H:0,f,r,m,a.x,a.y),V=x.xPoint,k=x.yPoint,S=o(a.x,a.y,v?0:H,f,d,m,n.x,n.y),z=S.xPoint,Z=S.yPoint,O=l(V,k,z,Z,r),N=O.xAnchor1,T=O.yAnchor1,I=s(V,k,z,Z,d),D=function(e){var t=e.xStart,n=e.yStart,r=e.xAnchor1,i=e.yAnchor1,a=e.xAnchor2,o=e.yAnchor2,l=e.xEnd,s=e.yEnd,c=e.lineStyle,d=e.offset;if(d&&0!==d){var u="straight"===c?Math.atan2(s-n,l-t):Math.atan2(i-n,r-t),f=d*Math.cos(u),h=d*Math.sin(u);"straight"!==c&&(t+=f,n+=h),l-=f,s-=h}var C="M".concat(t,",").concat(n," ");return["curve","angle"].includes(c)&&(C+="".concat("curve"===c?"C":"").concat(r,",").concat(i," ").concat(a,",").concat(o," ")),C+"".concat(l,",").concat(s)}({xStart:V,yStart:k,xAnchor1:N,yAnchor1:T,xAnchor2:I.xAnchor2,yAnchor2:I.yAnchor2,xEnd:z,yEnd:Z,lineStyle:m,offset:A}),F=c(V,k,z,Z),R=F.xLabel,P=F.yLabel,j=F.labelWidth,B=F.labelHeight,_="url(#".concat(p,")");return i.default.createElement("g",{className:t},i.default.createElement("path",{d:D,style:{fill:"none",stroke:u,strokeWidth:f,strokeDasharray:h},markerStart:g?_:void 0,markerEnd:v?void 0:_}),w&&i.default.createElement("path",Object.assign({d:D,style:{fill:"none",stroke:"rgba(0, 0, 0, 0)",strokeWidth:b,cursor:w?L:"initial",pointerEvents:"all"}},w)),C&&i.default.createElement("foreignObject",{x:R,y:P,width:j,height:B,style:{overflow:"visible",pointerEvents:"none"}},i.default.createElement("div",{style:{position:"absolute",left:"50%",top:"50%",transform:"translateX(-50%) translateY(-50%)",pointerEvents:"all"}},i.default.createElement("div",null,C))))}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.computeArrowDirectionVector=void 0,t.computeArrowDirectionVector=function(e){switch(e){case"left":return{arrowX:-1,arrowY:0};case"right":return{arrowX:1,arrowY:0};case"top":return{arrowX:0,arrowY:-1};case"bottom":return{arrowX:0,arrowY:1};default:return{arrowX:0,arrowY:0}}}},function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ArrowMarkers=void 0;var i=r(n(0)),a=n(4),o=n(3),l=function(e,t){return function(){var n,r,o,l,s,c,d,u,f,h,C,p,m=(null===(r=null===(n=e.endShape)||void 0===n?void 0:n.circle)||void 0===r?void 0:r.radius)||(null===(o=t.circle)||void 0===o?void 0:o.radius)||a.endShapeDefaultProp.circle.radius,A=(null===(s=null===(l=e.endShape)||void 0===l?void 0:l.circle)||void 0===s?void 0:s.strokeWidth)||(null===(c=t.circle)||void 0===c?void 0:c.strokeWidth)||a.endShapeDefaultProp.circle.strokeWidth,g=(null===(u=null===(d=e.endShape)||void 0===d?void 0:d.circle)||void 0===u?void 0:u.strokeColor)||(null===(f=t.circle)||void 0===f?void 0:f.strokeColor)||a.endShapeDefaultProp.circle.strokeColor,v=(null===(C=null===(h=e.endShape)||void 0===h?void 0:h.circle)||void 0===C?void 0:C.fillColor)||(null===(p=t.circle)||void 0===p?void 0:p.fillColor)||a.endShapeDefaultProp.circle.fillColor;return{markerWidth:4*m,markerHeight:4*m,refX:2*m+A,refY:2*m,path:i.default.createElement("circle",{cx:2*m,cy:2*m,r:m,fill:v,stroke:g,strokeWidth:A})}}},s=function(e,t,n){return function(){var r,o,l,s,c,d,u,f,h=e.strokeColor||n,C=null!==(c=null!==(l=null===(o=null===(r=e.endShape)||void 0===r?void 0:r.arrow)||void 0===o?void 0:o.arrowLength)&&void 0!==l?l:null===(s=null==t?void 0:t.arrow)||void 0===s?void 0:s.arrowLength)&&void 0!==c?c:a.endShapeDefaultProp.arrow.arrowLength,p=(null===(u=null===(d=e.endShape)||void 0===d?void 0:d.arrow)||void 0===u?void 0:u.arrowThickness)||(null===(f=null==t?void 0:t.arrow)||void 0===f?void 0:f.arrowThickness)||a.endShapeDefaultProp.arrow.arrowThickness,m="M0,0 L0,".concat(p," L").concat(C,",").concat(p/2," z");return{markerWidth:C,markerHeight:p,refX:0,refY:p/2,path:i.default.createElement("path",{d:m,fill:h})}}};t.ArrowMarkers=function(e){var t=e.sourceToTargetsMap,n=e.endShape,r=e.strokeColor,a=e.uniqueId;return i.default.createElement(i.default.Fragment,null,(0,o.getSourceToTargets)(t).map(function(e){var t=e.source,c=e.target,d=e.style,u=function(e){var t=e.style,n=e.strokeColor,r=e.endShape,i=(0,o.getEndShapeFromStyle)(t);return{circle:l(t,r),arrow:s(t,r,n)}[i]()}({style:void 0===d?{}:d,endShape:n,strokeColor:r}),f=u.markerHeight,h=u.markerWidth,C=u.path,p=u.refX,m=u.refY;return i.default.createElement("marker",{id:(0,o.getMarkerId)(a,t,c),key:(0,o.getMarkerId)(a,t,c),markerWidth:h,markerHeight:f,refX:p,refY:m,orient:"auto-start-reverse",markerUnits:"strokeWidth"},C)}))}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.useResizeListener=t.useObserveElements=void 0;var r=n(0);t.useObserveElements=function(e,t){(0,r.useEffect)(function(){return Object.keys(e).map(function(n){t.observe(e[n])}),function(){Object.keys(e).map(function(n){t.unobserve(e[n])})}},[e,t])},t.useResizeListener=function(e){(0,r.useEffect)(function(){return window&&window.addEventListener("resize",e),function(){window&&window.removeEventListener("resize",e)}},[e])}}]))),KV.exports);const $V=({getChildNodeComponent:r,parentNodeIndex:i,parentNodeData:a,verticalLineHeight:o,datasetHeight:l,curveHeights:s,itemRefs:c,datasetRef:d,isReadOnlyMode:u,hideNodeAtLast:f})=>e(t,{children:0===a?.machineInstances?.length?e(t,{children:!u&&n(t,{children:[e("div",{className:"ff-selectedMachines-connecting-line",children:n("div",{className:"ff-line",children:[e("div",{className:"ff-left-icon ff-left-icon-aligned"}),e("div",{className:"ff-right-icon"})]})}),e("div",{className:"ff-machine-instance ff-machine-env-button",children:r({isButton:!0,parentNodeData:a,parentNodeIndex:i})})]})}):a?.machineInstances?.map((h,C)=>{const p=0===C;return n("div",{className:"ff-machine-instance-row",children:[n("div",{className:"ff-selectedMachines-connecting-line "+(p?"":"ff-second-line"),children:[n("div",{className:"ff-line",children:[e("div",{className:"ff-left-icon "+(p?"ff-left-icon-aligned":"")}),e("div",{className:"ff-right-icon"})]}),p&&e("div",{className:"ff-vertical-line",style:{height:`${o}px`}})]}),e("div",{className:"ff-machine-instance",children:h?.runLevelExecutionDataSets?.map((o,u)=>e("div",{className:"ff-run-level-execution-dataset",ref:0===u?d:null,children:n("div",{className:"ff-execution-item",ref:e=>c.current[u]=e,children:[e("div",{className:"ff-curved-connector",style:{top:-l+"px"},children:n("div",{className:`ff-curve ff-connector-${u}`,style:{height:`${s[u]}px`},children:[e("div",{className:`ff-curve-right-icon ff-curve-right-icon-${u}`}),Number(h?.runScriptCount)?e("div",{className:"ff-selectedMachines-connecting-line-text",children:e(U,{fontSize:8,fontWeight:"regular",children:`${[0,"0",null].includes(h.runScriptCount)?"":h.runScriptCount} Script${1!==h.runScriptCount?"s":""}`})}):e(t,{})]})}),e("div",{className:"ff-run-data-box",children:r({isButton:!1,childNodeData:h,childNodeIndex:C,runLevelExecutionDataSet:o,runLevelExecutionDataSetIndex:u,parentNodeData:a,parentNodeIndex:i})})]})},o?.runLevelExecutionDataSetId))}),C===a?.machineInstances.length-1&&!f&&e(t,{children:!u&&n(t,{children:[e("div",{className:"ff-selectedMachines-connecting-line ff-second-line",children:n("div",{className:"ff-line",children:[e("div",{className:"ff-left-icon"}),e("div",{className:"ff-right-icon"})]})}),e("div",{className:"ff-machine-instance ff-machine-env-button",children:r({isButton:!0,parentNodeData:a,parentNodeIndex:i,childNodeIndex:C+1})})]})})]},C)})}),ek=({data:t,noOfScripts:r,getChildNodeComponent:a,getParentNodeComponent:s,getParentNodeComponentActionItems:d,childNodeCurveHeight:u=1.28,isReadOnlyMode:f=!1,hideNodeAtLast:h=!0})=>{const C=o(null),[p,m]=c(0),[A,g]=c([]),v=o([]);l(()=>{C.current&&m(C.current.offsetHeight)},[t]);l(()=>{(()=>{const e=v.current.map((e,t)=>0===t?0:p*u);g(e)})()},[p,t]);const y=e=>1+(e.machineInstances?.length+1||0);let w=1;const E=t?.machines?.selectedMachines.reduce((e,t)=>f&&h?e+(e=>!e?.machineInstances||K(e.machineInstances)?1:e.machineInstances.length)(t):e+y(t),0),b=Math.round(E/2);let M=1===b&&f&&2===E||1===b&&!f&&2===E;return e("div",{className:"connecting-branch-container",children:e(JV.ArcherContainer,{strokeColor:"var(--brand-color)",strokeWidth:1,startMarker:!0,endMarker:!1,noCurves:!0,children:n("div",{className:"ff-connecting-branch-grid-container",children:[e(JV.ArcherElement,{id:"rootNode",children:e("div",{className:"ff-grid-item ff-dynamic-item",style:{gridRow:b,top:M?"44px":""},children:e("div",{className:"ff-script-count-container",children:n("div",{className:"ff-script-count-box",children:[e(U,{children:r}),e(U,{children:"Scripts"})]})})})}),t?.machines?.selectedMachines.map((t,r)=>{const o=w,l=y(t);w+=l;const c=((e,t,n)=>1===e.length&&(f||h)?0:e.reduce((t,n,r)=>t+((r!==e.length-1||!f&&!h)&&n.runLevelExecutionDataSets?.length||0),0)*(t+n))(t?.machineInstances,p,16);return e(i.Fragment,{children:n("div",{className:"ff-selectedMachines",style:{gridRow:`${o} / span ${l}`},children:[e("div",{className:"ff-selectedMachines-input",children:n("div",{className:"ff-input-box-container "+(t?.machineInstances.length?"":"ff-input-box-aligned"),children:[e(JV.ArcherElement,{id:`parentnode${r}`,relations:[{targetId:"rootNode",targetAnchor:"left",sourceAnchor:"left"}],children:s({isMultiSelect:!1,parentNodeData:t,parentNodeIndex:r})}),d({parentNodeData:t,parentNodeIndex:r})]})}),e($V,{parentNodeIndex:r,parentNodeData:t,verticalLineHeight:c,datasetHeight:p,curveHeights:A,itemRefs:v,datasetRef:C,getChildNodeComponent:a,isReadOnlyMode:f,hideNodeAtLast:h})]})},r)}),!f&&e("div",{className:"ff-select-machine-input",style:{gridRow:`${w}`},children:e(JV.ArcherElement,{id:"lastNode",relations:[{targetId:"rootNode",targetAnchor:"left",sourceAnchor:"left"}],children:e("div",{children:s({isMultiSelect:!0})})})})]})})})},tk=(e,t)=>{if(!(e&&e instanceof Blob))throw console.error("Invalid Blob object"),new Error("Invalid Blob object");const n=window.navigator;if(n.msSaveOrOpenBlob){const r=n.msSaveOrOpenBlob;r&&r(e,t)}else{const n=document.createElement("a");document.body.appendChild(n);const r=window.URL.createObjectURL(e);n.href=r,n.download=t,n.click(),setTimeout(()=>{window.URL.revokeObjectURL(r),document.body.removeChild(n)},0)}},nk=({hasAtSymbol:t,usersObj:n,optionClicked:r,charsAfterAt:i,mentionUserRef:a})=>{const[s,d]=c(0),u=o([]);if(!t)return null;const f=n.filter(e=>!i||e.name.toLowerCase().startsWith(i.toLowerCase()));l(()=>{d(0)},[i]);const h=C(e=>{if(t&&0!==f.length)switch(e.key){case"ArrowDown":e.preventDefault(),d(e=>(e+1)%f.length);break;case"ArrowUp":e.preventDefault(),d(e=>0===e?f.length-1:e-1);break;case"Enter":e.preventDefault();const t=f[s];t&&r(t.name,t.emailId)}},[f,s,t,r]);return l(()=>{u.current[s]&&u.current[s]?.scrollIntoView({behavior:"smooth",block:"nearest"})},[s]),l(()=>(document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)),[h]),e("div",{className:"select-section",onMouseDown:e=>e.preventDefault(),children:e("div",{className:"select-group",ref:a,children:f.length?f.map((t,n)=>e("div",{ref:e=>u.current[n]=e,className:"mention-option "+(n===s?"hovered":""),onClick:()=>r(t.name,t.emailId),onMouseDown:e=>e.preventDefault(),children:e(U,{children:t.name})},t.id)):e("div",{className:"user-not-found",children:e(U,{children:"No user name found"})})})})},rk=e=>e&&Array.isArray(e)?e.map(({user:e})=>({id:e.id,name:e.name,emailId:e.emailId})):[],ik=(e,t)=>{const n=t.find(t=>`@${t.name.replace(/\s+/g,"")}`===e);return n?n.emailId:null},ak=({handleInsertNode:t,handleEditNode:r,handleDeleteNode:i,comment:a,depth:s=0,isDisable:d,userDetails:u,isEditDeleteActionAllowed:h=!0,createdByID:C,rowBreakCharCount:p=83,isVewMode:m=!1,deleteEnable:A=!0})=>{const[g,v]=c(""),[y,w]=c(!1),[E,b]=c(!1),[M,L]=c(!0),[H,x]=c([]),[V,k]=c(!1),[S,z]=c([]),[Z,O]=c({top:0,left:0}),[N,T]=c(""),I=o(null),D=o(null),F=o(null);l(()=>{y&&a?.description&&v(a?.description)},[y,a.description]),l(()=>{const e=rk(u);x(e)},[u]),l(()=>{const e=(g.match(Gr)||[]).map(e=>ik(e,H)).filter(Boolean);z(e)},[g]),l(()=>{const e=e=>{const t=D.current&&!D.current.contains(e.target)&&I.current&&!I.current.contains(e.target),n=F.current&&!F.current.contains(e.target)&&I.current&&!I.current.contains(e.target);(t||n)&&(k(!1),v(e=>e.replace(/(?:^|\s)(@\w*)$/,"")))};return V&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[V]);const{modifiedByUname:R,createdByUname:P,modifiedOn:j,createdOn:B}=a||{},_=j??B??(new Date).toLocaleString(),W=R??P??"Anonymous",X=s>2,Q=W?W.charAt(0).toUpperCase():"A";l(()=>{y&&a.description&&v(a.description)},[y,a.description]);const G=()=>{0!==g.trim().length&&(y?(r(a.id,g,S),b(!1),v("")):(L(!0),t(a.id,g,S),b(!1),v("")),y&&w(!1))};l(()=>{(()=>{if(!I.current)return;const e=I?.current,t=y?D?.current:F?.current,n=I.current.selectionStart,r=((e,t)=>{const n=document.createElement("div"),r=getComputedStyle(e);n.style.cssText=`\n position: absolute;\n visibility: hidden;\n white-space: pre-wrap;\n word-wrap: break-word;\n overflow: auto;\n width: ${e.offsetWidth}px;\n height: ${e.offsetHeight}px;\n font-family: ${r.fontFamily};\n font-size: ${r.fontSize};\n padding: ${r.padding};\n border: ${r.border};\n box-sizing: ${r.boxSizing};\n line-height: ${r.lineHeight};\n `,n.scrollTop=e.scrollTop,n.scrollLeft=e.scrollLeft,document.body.appendChild(n);const i=e.value.slice(0,t);n.textContent=i||".";const a=document.createElement("span");a.textContent=".",n.appendChild(a);const o=a.getBoundingClientRect();return document.body.removeChild(n),{top:o.top-20,left:o.left}})(e,n),i=t?.getBoundingClientRect().height??0,a=e?.getBoundingClientRect();if(!a)return;const o=window.innerHeight-a.bottom,l=a.top;O({top:o<i&&l>i?n-i-16:n+32,left:r.left+10})})()},[g]);const K=e=>{const t=e.target.value;v(t);const n=(t.match(/@\S+/g)||[]).map(e=>ik(e,H)).filter(e=>null!==e);z(n);const r=e.target.selectionStart,i=t.slice(0,r),a=i.match(ni);T(a?.[1]||"");const o=ti.test(i);k(!!o)},J=e=>{if("@"===e.key)k(!0);else if("Backspace"===e.key&&I.current){const t=I.current.selectionStart,n=g.slice(0,t);n.endsWith("@")&&k(!1);const r=n.match(Jr);if(r){e.preventDefault();const i=r[1],a=n.lastIndexOf(i||""),o=g.slice(0,a)+g.slice(t);v(o),k(!1),z(()=>(o.match(/@\w+/g)||[]).map(e=>e.slice(1)).map(e=>ik(e,H)).filter(Boolean)),setTimeout(()=>{I.current?.setSelectionRange(a,a)},0)}}},$=e=>{if(!I.current)return;const t=I.current.selectionStart,n=g.slice(0,t),r=n.match(Kr);if(r){const i=n.lastIndexOf(r[1]||""),a=g.slice(t),o=`@${e.replace(/\s+/g,"")} `,l=g.slice(0,i)+o+a;v(l),k(!1),setTimeout(()=>{I.current?.focus(),I.current?.setSelectionRange(i+o.length+1,i+o.length+1)},0),z(()=>(l.match(/@\w+/g)||[]).map(e=>e.slice(1)).map(e=>ik(e,H)).filter(Boolean))}};return e("div",{className:"commentsContainer",children:n("div",{className:"comment-wrapper",children:[n("div",{className:"commentContainer",children:[e("div",{className:"commentContainer__avatar",children:a?.profileImage?e("img",{height:30,width:30,src:`data:image/jpeg;base64,${a?.profileImage}`}):Q}),n("div",{className:"ff-message-container",children:[n("div",{className:"ff-message",children:[e("div",{className:"ff-message-name",children:W}),e("div",{className:"ff-message-time",children:_})]}),n("div",{className:"ff-editable-container",children:[!y&&e(U,{className:"typography-text",children:a?.description?.split(ri).map((t,n)=>t.startsWith("@")?e("b",{children:t},`highlight-${n}`):e(f,{children:t},`text-${n}`))}),y&&n("div",{className:"inputContainer",children:[e("textarea",{rows:g.length<p?1:3,className:"inputContainer_input first_input",value:g,autoFocus:!0,placeholder:"Edit comment",ref:I,onChange:e=>K(e),onKeyDown:J}),V&&e("div",{id:"mention-user",style:{position:"absolute",top:`${Z.top}px`,left:`${Z.left}px`},children:e(nk,{hasAtSymbol:V,usersObj:H,optionClicked:$,charsAfterAt:N,mentionUserRef:D})}),n("div",{className:"edit-comment",children:[e("div",{className:"reply",children:e(Y,{title:y?"Update":"Add",children:e(q,{name:"comment_reply",hoverEffect:!0,disabled:y&&g.trim()===(a?.description?.trim()??"")||0===g.trim().length,onClick:()=>{G(),w(!1),b(!1)}})})}),e("div",{className:"reply",onClick:()=>{w(!1),b(!1),v("")},children:e(Y,{title:y?"Cancel":"Close",children:e(q,{name:"close",color:"var(--ff-delete-button-attachment)",hoverEffect:!0})})})]})]}),n("div",{className:"comment-actions",children:[!X&&s<2&&a.comments?.length>0&&e("div",{className:"action-icon",onClick:()=>L(e=>!e),children:e(Y,{title:""+(M?"collapse":"expand"),children:e(q,{name:M?"collapse-arrow":"expand-arrow",disabled:y||E,hoverEffect:!0})})}),!X&&s<2&&0===a.comments?.length&&e("div",{className:"action-icon",children:e(q,{name:"expand-arrow",disabled:!0})}),!m&&n("div",{className:"ff-comment-action-item",children:[s<2&&e("div",{className:"action-icon",children:e(Y,{title:"Reply",children:e(q,{name:"comment_icon",disabled:y||d,hoverEffect:!0,onClick:()=>{b(!0)}})})}),h&&e("div",{className:"action-icon",children:e(Y,{title:"Edit",children:e(q,{name:"edit",disabled:E||d,hoverEffect:!0,onClick:()=>w(!0)})})}),h&&A&&e("div",{className:"action-icon",children:e(Y,{title:"Delete",children:e(q,{name:"delete",color:"var(--ff-delete-button-attachment)",onClick:()=>{E||i(a.id)},disabled:y||E||d,hoverEffect:!0})})})]})]})]})]})]}),e("div",{className:"comment-reply-container",children:E&&n("div",{className:"inputContainer",children:[e("textarea",{rows:g.length<p?1:3,className:"inputContainer_input first_input",value:g,autoFocus:!0,placeholder:"Add reply comments",ref:I,onChange:e=>K(e),onKeyDown:J}),V&&e("div",{id:"mention-user",style:{position:"absolute",top:`${Z.top}px`,left:`${Z.left}px`},children:e(nk,{hasAtSymbol:V,usersObj:H,optionClicked:$,charsAfterAt:N,mentionUserRef:F})}),n("div",{className:"edit-comment",children:[e("div",{className:"reply",onClick:()=>{G(),w(!1),b(!1)},children:e(Y,{title:"Reply",children:e(q,{name:"comment_reply",hoverEffect:!0,disabled:Boolean(!g.length)})})}),e("div",{className:"reply",onClick:()=>{w(!1),b(!1),v("")},children:e(Y,{title:"Cancel",children:e(q,{name:"close",color:"var(--ff-delete-button-attachment)",hoverEffect:!0})})})]})]})}),M&&a.comments?.length>0&&e("div",{className:`child-comments ${0===s?"first-level-child":""} ${1===s?"second-level-child":""}`,children:a.comments.map(n=>e("div",{className:`child-comments child-comments-${s+1}`,children:e(ak,{handleInsertNode:t,handleEditNode:r,handleDeleteNode:i,comment:n,depth:s+1,isDisable:d,userDetails:u,isEditDeleteActionAllowed:a.createdBy===C,createdByID:C,isVewMode:m})},n.id))})]})})},ok=({commentsData:t,handleAddComment:r,handleEditComment:i,handleDeleteComment:a,onCommentsDataChange:s,currentUser:d,isDisable:u=!1,userDetails:f,createdByID:h,rowBreakCharCount:p=83,isVewMode:m=!1,deleteEnable:A=!0,showTextarea:g=!1,autoFocus:v=!1})=>{const[y,w]=c(""),[E,b]=c([]),[M,L]=c(!1),[H,x]=c([]),[V,k]=c({top:0,left:0}),[S,z]=c(""),Z=o(null),O=o(null),[N,T]=c(!1);l(()=>{const e=rk(f);x(e)},[f]);const I=(e,t)=>{for(const n of e){if(n.id===t)return n;const e=I(n.comments,t);if(e)return e}return null};l(()=>{t&&b(t)},[t]),l(()=>{const e=e=>{O.current&&!O.current.contains(e.target)&&(L(!1),w(e=>{const t=e.split(" ");return t.length>0&&t?.[t?.length-1]?.startsWith("@")?t.slice(0,-1).join(" "):e}))};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]);const{insertNode:D,editNode:F,deleteNode:R}=(()=>{const e=(t,n,r)=>t.map(t=>t.id===n?{...t,comments:[...t.comments,{id:pi(),description:r.description,comments:[],createdBy:t.createdBy,modifiedBy:t.modifiedBy,createdByUname:t.createdByUname,modifiedByUname:t.modifiedByUname,createdOn:(new Date).toLocaleString(),modifiedOn:(new Date).toLocaleString(),commentParentId:n}]}:{...t,comments:e(t.comments,n,r)}),t=(e,n,r)=>e.map(e=>({...e,description:e.id===n?r:e.description,comments:t(e.comments,n,r)})),n=(e,t)=>e.filter(e=>e.id!==t).map(e=>({...e,comments:n(e.comments,t)}));return{insertNode:e,editNode:t,deleteNode:n}})(),P=(e,t,n)=>{if(!t.trim())return;const i={id:pi(),description:t,commentParentId:e,emailId:n,comments:[],createdBy:d?.createdBy,modifiedBy:d?.modifiedBy,createdByUname:d?.createdByUname,modifiedByUname:d?.modifiedByUname,createdOn:(new Date).toISOString(),modifiedOn:(new Date).toISOString()};b(t=>D(t,e,i)),r&&r(i,I(E,e))},j=C((e,t,n)=>{const r=F(E,e,t);b(r);const a=I(r,e);i&&i(e,t,a,n)},[E,F,i]),B=C(async e=>{try{if(a){const t=await a(e);if(t?.success){const t=R(E,e);b(t)}}}catch(e){console.error("Error deleting comment:",e)}},[R,a]);l(()=>{s&&s(E)},[E,s]);l(()=>{(()=>{if(!Z.current)return;const e=Z?.current,t=O?.current,n=Z.current.selectionStart,r=((e,t)=>{const n=document.createElement("div"),r=getComputedStyle(e);n.style.cssText=`\n position: absolute;\n visibility: hidden;\n white-space: pre-wrap;\n word-wrap: break-word;\n overflow: auto;\n width: ${e.offsetWidth}px;\n height: ${e.offsetHeight}px;\n font-family: ${r.fontFamily};\n font-size: ${r.fontSize};\n padding: ${r.padding};\n border: ${r.border};\n box-sizing: ${r.boxSizing};\n line-height: ${r.lineHeight};\n `,n.scrollTop=e.scrollTop,n.scrollLeft=e.scrollLeft,document.body.appendChild(n);const i=e.value.slice(0,t);n.textContent=i||".";const a=document.createElement("span");a.textContent=".",n.appendChild(a);const o=a.getBoundingClientRect();return document.body.removeChild(n),{top:o.top,left:o.left}})(e,n),i=t?.getBoundingClientRect().height??0,a=e?.getBoundingClientRect();if(!a)return;const o=window.innerHeight-a.bottom,l=a.top;k({top:o<i&&l>i?n-i-16:n+32,left:r.left+10})})()},[y]);l(()=>{y.includes("\n")||T(!1)},[y]);return n("div",{className:"ff-comments-container-box",children:[!m&&n("div",{className:"ff-first-comment "+(g?"no-border":""),children:[e(U,{fontWeight:"semi-bold",className:"ff-comment-heading",children:"Comments"}),!g&&n("div",{className:"input-wrapper",children:[e("textarea",{className:"inputContainer_input first_input",rows:N?3:y.length<p?1:3,autoFocus:v,value:y,onChange:e=>(e=>{const t=e.target.value;w(t);const n=e.target.selectionStart,r=t.slice(0,n),i=r.match(ni);z(i?.[1]||"");const a=ti.test(r);L(!!a),t||T(!1)})(e),placeholder:"Add a comment",disabled:u,ref:Z,onKeyDown:e=>{if("@"===e.key)L(!0);else if("Backspace"===e.key&&Z.current){const t=Z.current.selectionStart;if(y.slice(0,t).endsWith("@")&&L(!1),M){e.preventDefault();const n=y.slice(0,t-1)+y.slice(t);w(n);const r=t-1,i=n.slice(0,r).match(ni);z(i?.[1]||""),L(!!i),setTimeout(()=>{Z.current?.setSelectionRange(r,r)},0)}}"Enter"===e.key&&T(!0)}}),M&&e("div",{id:"mention-user",style:{position:"absolute",top:`${V.top}px`,left:`${V.left}px`},children:e(nk,{hasAtSymbol:M,usersObj:H,optionClicked:e=>{if(!Z.current)return;const t=Z.current.selectionStart,n=y.slice(0,t),r=n.match(Yr);if(r){const i=n.lastIndexOf(r[1]??""),a=y.slice(t),o=`@${e} `,l=y.slice(0,i)+o+a;w(l),L(!1),setTimeout(()=>{Z.current?.focus();const e=i+o.length+1;Z.current?.setSelectionRange(e,e)},0)}},charsAfterAt:S,mentionUserRef:O})}),e("span",{className:"reply-comment",children:e(Y,{title:"Add",children:e(q,{name:"comment_reply",onClick:()=>{if(!y.trim())return;const e=H.filter(e=>new RegExp(`@${e.name}\\b`,"i").test(y)).map(e=>e.emailId),t={id:pi(),description:y,comments:[],createdBy:d?.createdBy,modifiedBy:d?.modifiedBy,createdByUname:d?.createdByUname,modifiedByUname:d?.modifiedByUname,createdOn:(new Date).toISOString(),modifiedOn:(new Date).toISOString(),commentParentId:"",emailId:e};r&&r(t,null),b(e=>[...e,t]),w("")},hoverEffect:!0,disabled:Boolean(!y.length)})})})]})]}),E.length>0&&E.map(t=>e(ak,{handleInsertNode:P,handleEditNode:j,handleDeleteNode:B,comment:t,depth:0,isDisable:u,userDetails:f,isEditDeleteActionAllowed:t.createdBy===h,createdByID:h,isVewMode:m,deleteEnable:A},t.id))]})},lk=()=>{const e=o(!0);return{canTrigger:()=>e.current,setTriggered:()=>{e.current=!1},resetTrigger:()=>{e.current=!0}}},sk=({isOpen:t,onClose:r,onContinue:i,titleMessage:a="Warning!",subTitleMessage:o="Unsaved Changes.",iconName:l,modalMessage:s="Your web service data will be lost. Are you sure you want to exit?",firstButtonLabel:c="Cancel",secondButtonLabel:d="Continue",buttonVariant:u="warning",border:f="1px solid var(--warning-modal-border-color)",popupWidth:h="420",popupHeight:C="226",colorForTitleMessage:p="var(--status-button-bg-warning)",footerContent:m,firstButtonDisabled:A=!1,secondButtonDisabled:g=!1,zIndex:v=1100,iconSize:y=94})=>e(kp,{overlayClassName:"custom-overlay",isOpen:t,onClose:r,isHeaderDisplayed:!1,zIndex:v,children:n("div",{className:"warning_modal_container",children:[n("div",{className:"warning_modal_content",children:[e(q,{name:l,className:"warning_modal_icon",width:y,height:y}),n("div",{className:"warning_modal_message",children:[n(U,{fontSize:20,fontWeight:"semi-bold",className:"warning_modal_title_wrapper",children:[" ",n(U,{color:`${p}`,fontSize:20,fontWeight:"semi-bold",children:[" ",a," "]})," ",o]}),n("div",{className:"warning_modal_message_wrapper",children:[e(U,{fontSize:16,children:s}),e(U,{as:"div",children:m})]})]})]}),n("div",{className:"warning_modal_footer_button",children:[e(W,{buttonHeight:"24px",variant:"secondary",label:c,onClick:r,disabled:A}),d&&e(W,{buttonHeight:"24px",variant:u||"warning",label:d,onClick:i,disabled:g})]})]}),ariaHideApp:!0,isFooterDisplayed:!1,customWidth:`${h}px`,customHeight:`${C}px`,boxShadow:"0px 1px 4px 0px var(--toaster-boxshadow)",border:f});function ck(e,t=[]){return t.reduce((e,t)=>e.replace(new RegExp(function(e){return e.replace(Fr,"\\$&")}(t),"gi"),""),e).replace(/([A-Z])/g," $1").trim().replace(/^./,e=>e.toUpperCase())}function dk(e,t=[]){return e.toUpperCase()===e&&(e=e.toLowerCase()),e.includes("_")?function(e){return e.toLowerCase().replace(/_/g," ").replace(/^./,e=>e.toUpperCase())}(e):ck(e,t)}const uk=({onSelectVariable:t,dropdownPosition:r,filteredOptions:i=[],position:a="relative",width:s="300px",zIndex:c=1e3,height:d="160px",truncateTextValue:u=34,isTruncateText:f=!1,highlightedIndex:h})=>{const C=o(null);return l(()=>{C.current?.scrollIntoView({block:"nearest"})},[h]),n("div",{className:T("ff-variable-dropdown",a),style:r?{top:r.top,left:r.left,width:s,maxHeight:d,zIndex:c}:{width:s,zIndex:c,maxHeight:d},children:[i?.map((n,r)=>{const i=f?Hn(n?.name,u,"pixel"):n?.name,a=!!f&&xn(n?.name,u,"pixel");return e("div",{className:T("ff-variable-option",{"ff-variable-option--highlighted":h===r}),onClick:()=>t(n),ref:h===r?C:null,children:f?e(Y,{title:a?n?.name:"",children:e(U,{children:i})}):e(U,{children:i})},n?.id)}),0===i?.length&&e("div",{className:"ff-variable-option .ff-variable-option-no-data ",children:e(U,{as:"span",fontSize:14,children:"No Option"})})]})},fk=a(({label:t="",hashInputValue:r="",setHashInputValue:i,variableList:a=[],handleClearInput:s,addForloopPrefix:d=!1,placeholder:u="Enter text",onChange:f,onCreateVariableClick:C,value:p="",dropdownWidth:m="inherit",isHash:A=!1,dataFiles:g=[],showAddVariableIcon:v=!0,helperText:y="",error:E,autoComplete:b="off",showHidePasswordIcon:M=!0,required:H=!1,formProps:x={},onlyDropdown:V=!1,type:k,onFocus:S,onBlur:z,readOnly:Z=!1,height:O="160px",truncateTextValue:N=34,isTruncateText:T=!1,isClearIconShow:I=!1,optionsDropdownPosition:D="relative",width:F,...R},P)=>{const[j,B]=c(!1),_=o(!1),[W,X]=c(0),[Q,G]=c(!1),[J,$]=c(null),[ee,te]=c(0),[ne,re]=c(!1),[ie,ae]=c(!1),[oe,le]=c([]),[se,ce]=c({top:0,left:0,width:0,height:0,fromBottom:0}),de=o(null);w(P,()=>de.current),l(()=>{null!==J&&de.current&&(de.current.setSelectionRange(J,J),de.current.focus())},[J]),l(()=>{const e=p||"";if(A?B(e.startsWith("#")):ae(!e.includes("$")),e.startsWith("#")&&A){const t=e.slice(1).toLowerCase(),n=(Array.isArray(g)?g:[]).filter(e=>{if(!e)return!1;return("string"==typeof e?e:e.name||"").toLowerCase().includes(t)}).map((e,t)=>"string"==typeof e?{id:t+1,name:e}:{id:e.id||e._id||t+1,name:e.name||"",...e});le(n),B(!0)}},[p,g,A]),l(()=>{if(!ne&&V){const e=Array.isArray(g)?g:[],t=p||"",n=e.filter(e=>{if(!e)return!1;return("string"==typeof e?e:e.name||"").toLowerCase().includes(t.toLowerCase())}).map((e,t)=>"string"==typeof e?{id:t+1,name:e}:{id:e.id||e._id||t+1,name:e.name||"",...e});le(n),B(n.length>0)}re(!1)},[p,g,V,ne]);const ue=()=>{de.current&&(te(de.current.selectionStart||0),G(!0))},fe=ue,he=ue;l(()=>{de.current&&te(de.current.selectionStart||0)},[p]);const Ce=e=>{if(de.current){const{selectionStart:t,selectionEnd:n}=de.current,r=`{${"STEPGROUP"===e.parentVariableType?"SGV":"LOCAL"===e.type?"LV":"GLOBAL"===e.type?"GV":"GROUP"===e.type?"SGV":[String(e?._id??""),String(e?.id??"")].some(e=>e.includes("PARAMETER"))?"SGP":"_startforloop"===e.type?"FLV_for:":"DATAPROVIDER"===e.type?"DPV":"PEV"}${"_startforloop"===e?.type?"":"_"}${"DATAPROVIDER"===e?.type?e?.dpName+":"+e?.varname:e.name}}`,a=p||"";let o;if(o=A&&"#"===a[0]||V&&!e?.type?e.name+a.slice(n||1):a.slice(0,function(e,t){const n=e.lastIndexOf("$",t-1),r=e.indexOf("$",t);return-1===n&&-1===r?-1:-1===n?r:-1===r||Math.abs(t-n)<=Math.abs(r-t)?n:r}(a,ee)||0)+"$"+r+a.slice(n||0),f){f({target:{value:o}},e)}de.current.value=o,i?.(e),$((t||0)+r.length),B(!1),G(!1),re(!0),_.current=!0}};const pe=function(e,t,n){let r=!1,i="";const a="}"===e[t-1];if(t<0||t>e.length)return{showDropdown:r,searchString:i};const o=e.lastIndexOf("$",t-1),l=e.indexOf("$",t);if(-1!==o&&(t===o+1?(r=!0,i=""):(i=e.slice(o+1,-1===l?void 0:l),t>o+1&&(i=e.slice(o+1,t)),r=!0),_.current&&a&&(r=!1),(/[{}]/.test(i)||0===t)&&(r=!1,i=""),i)){n.some(e=>("_startforloop"===e.type&&d?`FLV_for:${e.name}`:e.name).toLowerCase().includes(i.toLowerCase()))||(r=!1,i="")}return{showDropdown:r,searchString:i}}(p||"",ee,a),[me,Ae]=c(!1),ge=h(()=>a.filter(e=>("_startforloop"===e.type&&d?`FLV_for:${e.name}`:e.name).toLowerCase().includes(pe?.searchString.toLowerCase())),[a,d,pe?.searchString]),ve=o(null),ye=e=>{e&&e.target&&e.target.closest(".dropdown-container")||(ve.current&&cancelAnimationFrame(ve.current),ve.current=requestAnimationFrame(()=>{if(de.current){const e=de.current.getBoundingClientRect(),t=(e=>{if(!e)return 160;if(e.startsWith("calc(")){const t=e.match(/(\d+)vh/),n=e.match(/-\s*(\d+)px/);if(t&&n&&t[1]&&n[1]){const e=parseInt(t[1]),r=parseInt(n[1]);return window.innerHeight*e/100-r}}const t=parseInt(e);return isNaN(t)?160:t})(O);let n=t;const r=j&&(A||V);pe?.showDropdown&&Q?n=ge.length>0?Math.min(32*ge.length,t):40:r&&(n=oe.length>0?Math.min(40*oe.length,t):40);const i=window.innerHeight-e.bottom,a=e.top;ce({top:"top"===(i<t&&a>i?"top":"bottom")?e.top+window.scrollY-n-5:e.bottom+window.scrollY+5,left:e.left+window.scrollX,width:e.width,height:n,fromBottom:document.documentElement.clientHeight-e.bottom})}}))};l(()=>{if(pe?.showDropdown&&Q||j&&(A||V))return ye(),window.addEventListener("scroll",ye,!0),window.addEventListener("resize",ye),()=>{window.removeEventListener("scroll",ye,!0),window.removeEventListener("resize",ye),ve.current&&cancelAnimationFrame(ve.current)}},[Q,j,p,pe,ge.length,oe.length]);return n("div",{className:"ff-add-variable-container",style:F?{width:F,flex:F.endsWith("%")?"1 1 auto":"0 0 auto"}:void 0,children:[n("div",{className:"ff-add-variable-input",children:[e(Hi,{readOnly:Z,...R,name:"add_variable",ref:de,type:((e,t)=>"password"===e?t?"text":"password":e??"text")(k,me),value:p,onChange:f,variant:"primary",label:t,onKeyDown:e=>{const t=pe?.showDropdown?ge:oe;if(t.length)switch(e.key){case"ArrowDown":e.preventDefault(),e.stopPropagation(),X(e=>e<t.length-1?e+1:e);break;case"ArrowUp":e.preventDefault(),e.stopPropagation(),X(e=>e>0?e-1:0);break;case"Enter":e.preventDefault(),e.stopPropagation(),t[W]&&(Ce(t[W]),X(0));break;case"Escape":e.preventDefault(),e.stopPropagation(),B(!1),X(0)}},placeholder:u,onClick:fe,onKeyUp:he,onFocus:e=>{_.current?_.current=!1:setTimeout(()=>{G(!0),S?.(e)},500)},onBlur:e=>{(e=>{e.relatedTarget&&e.relatedTarget.closest(".dropdown-container")||G(!1)})(e),z?.(e)},autoComplete:b,helperText:y,error:E,iconProps:{isClearIcon:I,onIconClick:s},required:H,...x}),"password"===k&&M&&e(Y,{title:me?"Hide":"Show",children:e(U,{as:"span",className:"ff-password-icon",children:e(q,{onClick:()=>{Ae(e=>!e)},name:me?"hide_access_icon":"view_access_icon",width:16,height:16,hoverEffect:!0})})}),!K(p)&&!A&&ie&&v&&e(Y,{title:"Add Variable",children:e(q,{onClick:C,name:"add_variable",width:24,height:24,hoverEffect:!0})})]}),pe?.showDropdown&&Q&&L(e("div",{onMouseDown:e=>e.preventDefault(),className:"dropdown-container",style:{position:"absolute",top:0,left:0,zIndex:9999},children:e(oL,{position:"absolute",width:se.width?`${se.width}px`:m,optionsList:ge,onSelectVariable:Ce,height:se.height?`${se.height}px`:O,highlightedIndex:W,dropdownPosition:se})}),document.body),j&&(A||V)&&L(e("div",{onMouseDown:e=>e.preventDefault(),className:"dropdown-container",style:{position:"absolute",top:0,left:0,zIndex:9999},children:e(uk,{position:"absolute",width:se.width?`${se.width}px`:m,filteredOptions:oe,zIndex:2e3,onSelectVariable:Ce,height:se.height?`${se.height}px`:O,isTruncateText:T,truncateTextValue:N,highlightedIndex:W,dropdownPosition:se})}),document.body)]})}),hk=(e,t)=>{const n=new Set;for(const r of e){const e=t?r[t]:JSON.stringify(r);if(n.has(e))return!0;n.add(e)}return!1};var Ck,pk;var mk=(pk||(pk=1,Ck=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=9)}([function(e,t){e.exports=i},function(e,t,n){var r;
|
|
45
45
|
/*!
|
|
46
46
|
Copyright (c) 2017 Jed Watson.
|
|
47
47
|
Licensed under the MIT License (MIT), see
|