pixel-react 1.17.4 → 1.17.6
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 +2 -1
- package/lib/components/ConditionalDropdown/ConditionalDropdown.js.map +1 -1
- package/lib/components/Editor/constants.js +55 -40
- package/lib/components/Editor/constants.js.map +1 -1
- package/lib/components/TableTreeFn/TableTreeFn.js +1 -6
- package/lib/components/TableTreeFn/TableTreeFn.js.map +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -25,7 +25,7 @@ object-assign
|
|
|
25
25
|
*
|
|
26
26
|
* This source code is licensed under the MIT license found in the
|
|
27
27
|
* LICENSE file in the root directory of this source tree.
|
|
28
|
-
*/function Ig(){return Og||(Og=1,e=Ng,"production"!==process.env.NODE_ENV&&function(){function t(e,t){var n=e.length;e.push(t),function(e,t,n){for(var r=n;r>0;){var o=r-1>>>1,a=e[o];if(!(i(a,t)>0))return;e[o]=t,e[r]=a,r=o}}(e,t,n)}function n(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();return n!==t&&(e[0]=n,function(e,t,n){for(var r=n,o=e.length,a=o>>>1;r<a;){var l=2*(r+1)-1,s=e[l],c=l+1,d=e[c];if(i(s,t)<0)c<o&&i(d,s)<0?(e[r]=d,e[c]=t,r=c):(e[r]=s,e[l]=t,r=l);else{if(!(c<o&&i(d,t)<0))return;e[r]=d,e[c]=t,r=c}}}(e,n,0)),t}function i(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error),"object"==typeof performance&&"function"==typeof performance.now){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var s=[],c=[],d=1,u=null,f=3,h=!1,p=!1,C=!1,m="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))return;r(c),i.sortIndex=i.expirationTime,t(s,i)}i=n(c)}}function w(e){if(C=!1,y(e),!p)if(null!==n(s))p=!0,O(b);else{var t=n(c);null!==t&&z(w,t.startTime-e)}}function b(t,i){p=!1,C&&(C=!1,N()),h=!0;var o=f;try{return function(t,i){var o=i;for(y(o),u=n(s);null!==u&&(!(u.expirationTime>o)||t&&!k());){var a=u.callback;if("function"==typeof a){u.callback=null,f=u.priorityLevel;var l=a(u.expirationTime<=o);o=e.unstable_now(),"function"==typeof l?u.callback=l:u===n(s)&&r(s),y(o)}else r(s);u=n(s)}if(null!==u)return!0;var d=n(c);return null!==d&&z(w,d.startTime-o),!1}(t,i)}finally{u=null,f=o,h=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var E=!1,M=null,A=-1,x=5,L=-1;function k(){return!(e.unstable_now()-L<x)}var H,S=function(){if(null!==M){var t=e.unstable_now();L=t;var n=!0;try{n=M(!0,t)}finally{n?H():(E=!1,M=null)}}else E=!1};if("function"==typeof v)H=function(){v(S)};else if("undefined"!=typeof MessageChannel){var _=new MessageChannel,V=_.port2;_.port1.onmessage=S,H=function(){V.postMessage(null)}}else H=function(){m(S,0)};function O(e){M=e,E||(E=!0,H())}function z(t,n){A=m(function(){t(e.unstable_now())},n)}function N(){g(A),A=-1}var I=function(){};e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){p||h||(p=!0,O(b))},e.unstable_forceFrameRate=function(e){e<0||e>125?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):x=e>0?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(s)},e.unstable_next=function(e){var t;switch(f){case 1:case 2:case 3:t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=I,e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,o){var a,l,u=e.unstable_now();if("object"==typeof o&&null!==o){var f=o.delay;a="number"==typeof f&&f>0?u+f:u}else a=u;switch(r){case 1:l=-1;break;case 2:l=250;break;case 5:l=1073741823;break;case 4:l=1e4;break;default:l=5e3}var m=a+l,g={id:d++,callback:i,priorityLevel:r,startTime:a,expirationTime:m,sortIndex:-1};return a>u?(g.sortIndex=a,t(c,g),null===n(s)&&g===n(c)&&(C?N():C=!0,z(w,a-u))):(g.sortIndex=m,t(s,g),p||h||(p=!0,O(b))),g},e.unstable_shouldYield=k,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Ng;var e}var Tg=(zg||(zg=1,"production"===process.env.NODE_ENV?_g.exports=(Sg||(Sg=1,function(e){function t(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,o=e[r];if(!(0<i(o,t)))break e;e[r]=t,e[n]=o,n=r}}function n(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length,a=o>>>1;r<a;){var l=2*(r+1)-1,s=e[l],c=l+1,d=e[c];if(0>i(s,n))c<o&&0>i(d,s)?(e[r]=d,e[c]=n,r=c):(e[r]=s,e[l]=n,r=l);else{if(!(c<o&&0>i(d,n)))break e;e[r]=d,e[c]=n,r=c}}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var s=[],c=[],d=1,u=null,f=3,h=!1,p=!1,C=!1,m="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(C=!1,y(e),!p)if(null!==n(s))p=!0,O(b);else{var t=n(c);null!==t&&z(w,t.startTime-e)}}function b(t,i){p=!1,C&&(C=!1,g(x),x=-1),h=!0;var o=f;try{for(y(i),u=n(s);null!==u&&(!(u.expirationTime>i)||t&&!H());){var a=u.callback;if("function"==typeof a){u.callback=null,f=u.priorityLevel;var l=a(u.expirationTime<=i);i=e.unstable_now(),"function"==typeof l?u.callback=l:u===n(s)&&r(s),y(i)}else r(s);u=n(s)}if(null!==u)var d=!0;else{var m=n(c);null!==m&&z(w,m.startTime-i),d=!1}return d}finally{u=null,f=o,h=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var E,M=!1,A=null,x=-1,L=5,k=-1;function H(){return!(e.unstable_now()-k<L)}function S(){if(null!==A){var t=e.unstable_now();k=t;var n=!0;try{n=A(!0,t)}finally{n?E():(M=!1,A=null)}}else M=!1}if("function"==typeof v)E=function(){v(S)};else if("undefined"!=typeof MessageChannel){var _=new MessageChannel,V=_.port2;_.port1.onmessage=S,E=function(){V.postMessage(null)}}else E=function(){m(S,0)};function O(e){A=e,M||(M=!0,E())}function z(t,n){x=m(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){p||h||(p=!0,O(b))},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(s)},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,o){var a=e.unstable_now();switch(o="object"==typeof o&&null!==o&&"number"==typeof(o=o.delay)&&0<o?a+o:a,r){case 1:var l=-1;break;case 2:l=250;break;case 5:l=1073741823;break;case 4:l=1e4;break;default:l=5e3}return r={id:d++,callback:i,priorityLevel:r,startTime:o,expirationTime:l=o+l,sortIndex:-1},o>a?(r.sortIndex=o,t(c,r),null===n(s)&&r===n(c)&&(C?(g(x),x=-1):C=!0,z(w,o-a))):(r.sortIndex=l,t(s,r),p||h||(p=!0,O(b))),r},e.unstable_shouldYield=H,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}}(Vg)),Vg):_g.exports=Ig()),_g.exports);const Dg=Symbol(),Zg=Symbol(),jg="undefined"==typeof window||/ServerSideRendering/.test(window.navigator&&window.navigator.userAgent)?l:u,Rg=Tg.unstable_runWithPriority?e=>{try{Tg.unstable_runWithPriority(Tg.unstable_NormalPriority,e)}catch(t){if("Not implemented."!==t.message)throw t;e()}}:e=>e();function Bg(e,t){const n=d(e)[Dg];if("object"==typeof process&&"production"!==process.env.NODE_ENV&&!n)throw new Error("useContextSelector requires special context");const{v:{current:r},n:{current:i},l:o}=n,a=t(r),[l,s]=v((e,n)=>{if(!n)return[r,a];if("p"in n)throw n.p;if(n.n===i)return Object.is(e[1],a)?e:[r,a];try{if("v"in n){if(Object.is(e[0],n.v))return e;const r=t(n.v);return Object.is(e[1],r)?e:[n.v,r]}}catch(e){}return[...e]},[r,a]);return Object.is(l[1],a)||s(),jg(()=>(o.add(s),()=>{o.delete(s)}),[o]),l[1]}const Pg=function(e){const t=s({[Dg]:{v:{current:e},n:{current:-1},l:new Set,u:e=>e()}});var n;return t[Zg]=t.Provider,t.Provider=(n=t.Provider,({value:e,children:t})=>{const r=a(e),i=a(0),[o,l]=c(null);o&&(o(e),l(null));const s=a();if(!s.current){const e=new Set,t=(t,n)=>{i.current+=1;const r={n:i.current};(null==n?void 0:n.suspense)&&(r.n*=-1,r.p=new Promise(e=>{l(()=>t=>{r.v=t,delete r.p,e(t)})})),e.forEach(e=>e(r)),t()};s.current={[Dg]:{v:r,n:i,l:e,u:t}}}return jg(()=>{r.current=e,i.current+=1,Rg(()=>{s.current[Dg].l.forEach(t=>{t({n:i.current,v:e})})})},[e]),C(n,{value:s.current},t)}),delete t.Consumer,t}([kg,()=>{}]),Fg=({children:t,useTableRef:n,totalWidth:r})=>{const i=a(null);return l(()=>{n&&i.current&&n(i)},[n]),e("table",{className:"ff-spreadsheet-table",ref:i,style:{minWidth:`${60+r}px`,tableLayout:"fixed"},children:t})},Ug=t=>e("tr",{...t}),qg=t=>e("tr",{className:"ff-spreadsheet-row-header",...t});function Wg(){return Bg(Pg,([,e])=>e)}function Qg(e){return Bg(Pg,([t])=>e(t))}const Gg=({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:z("corner-header",{"ff-spreadsheet-header--selected":t}),children:e(P,{variant:t?"dark":"light",color:t?"var(--hover-color)":"var(--text-color)",name:"excel_corner_menu"})})})},Kg=t=>function(n){const i=Wg(),o=r.useCallback(()=>i({type:Dp}),[i]),a=Qg(e=>e.selected instanceof wm);return e(t,{...n,selected:a,onSelect:o})},Yg=t=>function(n){const i=Wg(),o=r.useCallback((e,t)=>i(function(e,t){return{type:Tp,payload:{column:e,extend:t}}}(e,t)),[i]),a=Qg(e=>e.selected.hasEntireColumn(n.column)),l=Qg(e=>e.selectedColumn??void 0),s=Qg(e=>e.active?nm(e.active,e.model.data):void 0);return e(t,{...n,cell:s,selected:a,selectedColumn:l,onSelect:o,scrollToColumn:n.scrollToColumn})},Xg=Yg(({column:t,label:i,selected:o,onSelect:a,setContextMenu:l,deleteColumn:s,addColumnLeft:c,addColumnRight:d,columnContextEnable:u,cell:f,selectedColumn:p,minimumColumnWidth:C,maxColLimit:m,disableDeleteOption:g,contextMenu:v,onAddColumn:y,onDeleteColumn:w,setVisibleRange:b,scrollToColumn:E})=>{const M=Wg(),A=Qg(e=>e.model.data),x=C,L=Qg(e=>e.columnDimensions[t]?.width||x),k=Qg(e=>e.model.data),{columnCount:H}=Km(k),S=e=>{b(t=>{const n={...t,end:"increment"===e?t.end+1:t.end-1};return p&&E(p),n})},_=h(()=>[{label:"Add Column Left",value:"Add Column Left",iconName:"plus_icon",action:()=>{S("increment"),c(x),y?.(p??t,!0)},disableTooltip:"Column limit reached",visible:f?.contextDisable?.["Add Column Left"]??!1,disable:H>=m},{label:"Add Column Right",value:"Add Column Right",iconName:"plus_icon",action:()=>{S("increment"),d(x),y?.(p??t,!1)},disableTooltip:"Column limit reached",visible:f?.contextDisable?.["Add Column Right"]??!1,disable:H>=m},...g?[]:[{label:"Delete Column",value:"Delete Column",iconName:"delete",action:()=>{S("decrement"),s(),w?.(p??t)},disableTooltip:"",visible:f?.contextDisable?.["Delete Column"]??!1,disable:!1}]],[p,t,A]),V=r.useCallback((e,n)=>{const r=n?t-1:t,i=Math.max(r,0);a(i,e.shiftKey);const o=e.clientX,l=L,s=e=>{const t=Math.max(x,l+(e.clientX-o));M(xC(i,t))},c=()=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",c),M(JC())};document.addEventListener("mousemove",s),document.addEventListener("mouseup",c),M(XC())},[t,L]),O=r.useCallback(e=>M(WC(e)),[M]),N=r.useCallback(e=>{a(t,e.shiftKey)},[a,t]),I=r.useCallback(e=>{e.preventDefault(),a(t,e.shiftKey),l({open:u,contextType:"column",options:_})},[t,p,u,_]);return r.useEffect(()=>{void 0!==p&&"column"===v?.contextType&&l(e=>({open:e.open,contextType:"column",options:_}))},[t,p,u,_,"column"===v?.contextType]),n("th",{className:z("ff-spreadsheet-header",{"ff-spreadsheet-header--selected":o}),style:{minWidth:`${L}px`},onClick:N,onContextMenu:I,tabIndex:0,children:[e(F,{fontWeight:"medium",children:i??Jg(t)}),e("div",{className:"drag-column-selector drag-column-left",onMouseDown:e=>V(e,!1),onDoubleClick:()=>M(xC(t,x)),onClick:()=>O({row:-1,column:t})}),e("div",{className:"drag-column-selector drag-column-right",onMouseDown:e=>V(e,!0),onDoubleClick:()=>M(xC(t,x)),onClick:()=>O({row:-1,column:t})})]},t)});function Jg(e){let t="",n=e;for(;n>=0;)t=String.fromCharCode(65+n%26)+t,n=Math.floor(n/26)-1;return t}const $g=({row:t,label:i,selected:o,onSelect:a,setContextMenu:l,addRowTop:s,addRowBottom:c,deleteRow:d,rowContextEnable:u,selectedRow:f,cell:h,maxRowLimit:p,disableDeleteOption:C,contextMenu:m,setVisibleRange:g,scrollToRow:v})=>{const y=Wg(),w=Qg(e=>e.rowDimensions[t]?.height||32),b=Qg(e=>e.model.data),{rowCount:E}=Km(b),M=e=>{g(t=>{const n={...t,end:"increment"===e?t.end+1:t.end-1};return f&&v(f),n})},A=r.useMemo(()=>[{label:"Add Row Top",value:"Add Row Top",iconName:"plus_icon",action:()=>{M("increment"),s()},disableTooltip:"Row limit reached",visible:h?.contextDisable?.["Add Row Top"]??!1,disable:E>=p},{label:"Add Row Bottom",value:"Add Row Bottom",iconName:"plus_icon",action:()=>{M("increment"),c()},disableTooltip:"Row limit reached",visible:h?.contextDisable?.["Add Row Bottom"]??!1,disable:E>=p},...C?[]:[{label:"Delete Row",value:"Delete Row",iconName:"delete",action:()=>{M("decrement"),d()},disableTooltip:"",visible:h?.contextDisable?.["Delete Row"]??!1,disable:!1}]],[f,t]),x=r.useCallback((e,n)=>{const r=n?t:t-1,i=Math.max(r,0);a(i,e.shiftKey);const o=e.clientY,l=w,s=e=>{const t=Math.max(32,l+(e.clientY-o));y(AC(i,t))},c=()=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",c),y(JC())};document.addEventListener("mousemove",s),document.addEventListener("mouseup",c),y(JC())},[w,t]),L=r.useCallback(e=>y(WC(e)),[y]),k=r.useCallback(e=>{a(t,e.shiftKey)},[t]),H=r.useCallback(e=>{e.preventDefault(),a(t,e.shiftKey),l({open:u,contextType:"row",options:A})},[t,u,A,f]);return r.useEffect(()=>{void 0!==f&&"row"===m?.contextType&&l(e=>({open:e.open,contextType:"row",options:A}))},[t,u,A,f,"row"===m?.contextType]),n("th",{className:z("ff-spreadsheet-header",{"ff-spreadsheet-header--selected":o}),style:{height:`${w}px`,minWidth:"60px"},onClick:k,onContextMenu:H,tabIndex:0,children:[e(F,{fontWeight:"medium",children:void 0!==i?i:t+1}),e("div",{className:"drag-row-selector drag-row-down",onMouseDown:e=>x(e,!0),onDoubleClick:()=>y(AC(t,32)),onClick:()=>L({row:t,column:-1})}),e("div",{className:"drag-row-selector drag-row-up",onMouseDown:e=>x(e,!1),onDoubleClick:()=>y(AC(t,32)),onClick:()=>L({row:t,column:-1})})]})},ev=t=>function(n){const i=Wg(),o=Qg(e=>e.selected.hasEntireRow(n.row)),a=Qg(e=>e.active?nm(e.active,e.model.data):void 0),l=Qg(e=>e.selectedRow??void 0),s=r.useCallback((e,t)=>i(function(e,t){return{type:Ip,payload:{row:e,extend:t}}}(e,t)),[i]);return e(t,{...n,selected:o,cell:a,selectedRow:l,onSelect:s,scrollToRow:n.scrollToRow})},tv=({row:t,column:n,DataViewer:i,active:o,dragging:a,mode:l,data:s,evaluatedData:c,select:d,activate:u,setCellDimensions:f,setCellData:h})=>{const p=r.useRef(null),C=r.useMemo(()=>({row:t,column:n}),[t,n]),m=r.useCallback(e=>{e.preventDefault(),window.getSelection()?.removeAllRanges(),"view"===l&&(f(C,_m(e.currentTarget)),e.shiftKey?d(C):u(C))},[l,f,C,d,u]),g=r.useCallback(e=>{a&&(f(C,_m(e.currentTarget)),d(C))},[f,d,a,C]);return r.useEffect(()=>{const e=p.current;if(!e)return;const t=()=>{f(C,_m(e))};t();const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[f,C]),s&&s.DataViewer&&(i=s.DataViewer),e("td",{ref:p,style:{...s?.style,..."dropDown"===s?.inputType?.type&&{fontSize:"12px"},textDecoration:"underline"===s?.style?.textDecoration?s?.style?.textDecoration:"none"},className:z("ff-spreadsheet-cell",s?.className,{"ff-spreadsheet-active-cell":o||a}),onMouseEnter:g,onMouseDown:m,tabIndex:0,children:e(i,{row:t,column:n,cell:s,active:o,evaluatedCell:c,setCellData:h,inputValue:()=>null})})},nv=t=>function(n){const{row:i,column:o}=n,a=Wg(),l=r.useMemo(()=>({row:i,column:o}),[i,o]),s=r.useCallback(e=>a(QC(l,e)),[a,l]),c=r.useCallback(e=>a(function(e){return{type:jp,payload:{point:e}}}(e)),[a]),d=r.useCallback(e=>a(WC(e)),[a]),u=r.useCallback((e,t)=>a(GC(e,t)),[a]),f=Qg(e=>Sm(e.active,l)),h=Qg(e=>f?e.mode:"view"),p=Qg(e=>nm(l,e.model.data)),C=Qg(e=>nm(l,e.model.evaluatedData)),m=Qg(e=>e.dragging),g=Qg(e=>e.copied?.has(l)||!1);return e(t,{...n,active:f,copied:g,dragging:m,mode:h,evaluatedData:C,data:p,select:c,activate:d,setCellDimensions:u,setCellData:s})},rv=({cell:r,evaluatedCell:i,active:o})=>{const a=function(e,t){const n=t?.value??e?.value;if(n&&"object"==typeof n)return n.toString();return n}(r,i);return e("span","boolean"==typeof a?{className:"ff-spreadsheet-data-viewer ff-spreadsheet-data-viewer--boolean",children:iv(a)}:{className:z("ff-spreadsheet-data-viewer",{"ff-spreadsheet-data-viewer--preserve-breaks":Pm(a)}),children:o||"dropDown"!==r?.inputType?.type?o||"file"!==r?.inputType?.type?!o&&a:e(t,{children:G(r?.value)?n("div",{className:"ff-spreadsheet-data-viewer--without-fileType",children:[e(P,{name:"attachment_icon"})," Attachment"]}):(n=>{if(G(n))return e(t,{});return JSON.parse(n).map(t=>e("div",{className:"ff-spreadsheet-data-viewer--fileType",children:e(sn,{width:r?.style?.width??100,title:t?.name?.split("*")?.[0]??""})},t.name))})(a)}):n("div",{className:"ff-spreadsheet-data-viewer--dropdownType",children:[a,e(P,{name:"arrow_down",height:8,className:"dropdownType-icon"})]})})};function iv(e){return e?"TRUE":"FALSE"}const ov=i.forwardRef(({initialValue:t="",onChange:n,className:r="",style:o={}},s)=>{const c=a(null);i.useImperativeHandle(s,()=>c.current),l(()=>{c.current&&t!==c.current.innerText&&(c.current.innerText=t)},[t]);const d=()=>{if(c.current){const e=c.current.innerText;n?.(e)}};return e("div",{style:o,children:e("div",{ref:c,className:`editable-cell ${r}`,contentEditable:!0,suppressContentEditableWarning:!0,onKeyDown:e=>{if("Enter"===e.key){if(e.altKey||e.shiftKey)return e.preventDefault(),document.execCommand("insertLineBreak"),void d();c.current?.blur()}"Delete"!==e.key&&"Backspace"!==e.key||e.stopPropagation()},onInput:d,onPaste:e=>{e.preventDefault();const t=e.clipboardData.getData("text/plain"),n=window.getSelection();if(!n||!n.rangeCount)return;const r=n.getRangeAt(0);r.deleteContents();const i=document.createTextNode(t);r.insertNode(i),r.setStartAfter(i),r.collapse(!0),n.removeAllRanges(),n.addRange(r),d()},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"}})})}),av=({onChange:t,cell:n})=>{const i=r.useRef(null),o=r.useCallback(e=>{const{contextDisable:r,...i}=n;t({...i,value:e,inputType:i.inputType??{type:"text"}})},[t,n]);r.useEffect(()=>{i.current&&function(e){if(e)if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)e.selectionStart=e.selectionEnd=e.value.length;else if(e.isContentEditable){const t=document.createRange(),n=window.getSelection();t.selectNodeContents(e),t.collapse(!1),n?.removeAllRanges(),n?.addRange(t)}}(i.current)},[]);return e("div",{className:"ff-spreadsheet-data-editor",children:e(ov,{ref:i,initialValue:n?.value??"",onChange:o,className:"ff-spreadsheet-cell-textarea",style:{...n?.style,borderTop:"",borderBottom:"",borderLeft:"",borderRight:""}})})},lv=t=>{const i=r.useRef(null),o=r.useRef(null),a=Wg(),l=r.useCallback((e,t)=>a(QC(e,t)),[a]),s=r.useCallback(e=>a(WC(e)),[a]),c=r.useCallback(()=>a({type:Wp}),[a]),d=r.useCallback(e=>a({type:vC,payload:{autofill:e}}),[a]),u=r.useCallback(e=>a(function(e){return{type:$p,payload:{changes:e}}}(e)),[a]),f=r.useCallback(()=>{a({type:Qp})},[a]),h=Qg(e=>e.rowDimensions),p=Qg(e=>e.active),C=Qg(e=>e.mode),m=Qg(e=>e.active?nm(e.active,e.model.data):void 0),g=Qg(e=>e.selected),v=Qg(e=>g&&Zm(e.rowDimensions,e.columnDimensions,e.model.data,e.selected)),y=Qg(e=>{let t=p?Tm(p,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}),w=r.useMemo(()=>!p||!y||p.row<t.visibleRowRange.start||p.row>=t.visibleRowRange.end||p.column<t.visibleColRange.start||p.column>=t.visibleColRange.end,[p,y,t.visibleRowRange,t.visibleColRange]),b=r.useRef(void 0),E=r.useRef(null),M=r.useRef(void 0),A=r.useCallback(e=>{p&&l(p,e)},[l,p]),[x,L]=r.useState({value:"",name:""}),[k,H]=r.useState(!1),[S,_]=r.useState(),[V,O]=r.useState([]);r.useEffect(()=>{m&&p&&t.getActiveCell({value:m.value,active:p});const n=i.current;if(!w&&n){if(n.focus({preventScroll:!0}),"file"===m?.inputType?.type&&m?.value)try{const e=JSON.parse(m.value).map(e=>new File([new Blob],e.name.split("*")[0]??"default"));O(e)}catch(e){console.error("Error parsing cell value for files:",e),O([])}else O([]);if("dropDown"===m?.inputType?.type){L({value:m?.value,name:m?.value}),H(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}));_(t)}}},[i,w,p]),r.useEffect(()=>{const e=E.current,t=M.current;if(E.current=p,M.current=m,!e||!t)return;const n=p?.row!==e.row||p?.column!==e.column;if(n||"edit"!==C){const e=b.current;t!==e?u([{prevCell:e||null,nextCell:t}]):n||m===t||u([{prevCell:t,nextCell:m||null}]),b.current=m}});const N=m&&m.DataEditor||t.DataEditor,I=m&&m.readOnly,T=r.useCallback(e=>{if(!p)return;const t=e.currentTarget.closest(".ff-excel-spreadsheet");if(!t)return void e.preventDefault();e.stopPropagation();const n=document.body.style.userSelect,r=document.body.style.overflow;document.body.style.userSelect="none",document.body.style.overflow="hidden";let i=null;const o=()=>{i&&(cancelAnimationFrame(i),i=null)},a=e=>{const n=t.getBoundingClientRect();let r=0,a=0;e.clientY<n.top+50?a=-12:e.clientY>n.bottom-50&&(a=12),e.clientX<n.left+50?r=-12:e.clientX>n.right-50&&(r=12),0!==r||0!==a?(e=>{o();const n=()=>{const{x:r,y:o}=e;0!==r&&(t.scrollLeft+=r),0!==o&&(t.scrollTop+=o),i=requestAnimationFrame(n)};i=requestAnimationFrame(n)})({x:r,y:a}):o()},l=()=>{o(),document.body.style.userSelect=n,document.body.style.overflow=r,document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",l)};document.addEventListener("mousemove",a),document.addEventListener("mouseup",l),d(!0)},[s,d,p]),D=r.useCallback(e=>{e.preventDefault(),t.setContextMenu({open:t.contextOption?.open??!1,contextType:t.contextOption?.contextType??null,options:t.contextOption?.options||[]})},[t]),Z=v?.height!==y?.height||v?.width!==y?.width,j=r.useCallback(e=>{p&&Z&&(GC(p,_m(e.currentTarget)),s(p))},[p,Z]),R=t.isAtRight?t.maxWidth-(y?.left-t.scrollPos.left)+100:t.maxWidth,B=t.isAtBottom?t.maxHeight-(y?.top-t.scrollPos.top)+64:t.maxHeight,P=["file","dropDown"].includes(m?.inputType?.type||"");return n("div",{ref:i,className:z("ff-spreadsheet-active-cell",`ff-spreadsheet-active-cell--${C}`,{"ff-spreadsheet-active-cell--hidden":w,"ff-spreadsheet-active-cell--dragging":Z&&"text"!==m?.inputType?.type}),onMouseDown:j,style:{...y,backgroundColor:m?.style?.backgroundColor,...P?{display:"flex",alignItems:m?.style?.alignContent,justifyContent:m?.style?.textAlign}:{},..."edit"===C&&p?{minWidth:Math.min(y?.width,t.maxWidth),minHeight:Math.min(y?.height,t.maxHeight),height:"auto",maxWidth:`${R}px`,maxHeight:`${B}px`,overflow:"auto",..."dropDown"===m?.inputType?.type?{}:{padding:"2px 4px 0px 4px",width:"max-content"}}:{}},onContextMenu:D,onClick:"view"!==C||I?void 0:c,tabIndex:0,children:[e("div",{className:P?"":"active-cell-main",children:"dropDown"===m?.inputType?.type?e(ar,{...m?.inputType?.inputProps,dropDownRef:o,showOptions:{open:!("edit"!==C||!p),toggle:k},selectedOption:x,optionsList:S||[],height:26,showLabel:!1,disabled:!t.editable,showBorder:!1,optionZIndex:5e3,onChange:e=>{L({value:e.value,name:e.label}),A({...m,value:e.value,style:m?.style,inputType:m?.inputType})}}):"file"===m?.inputType?.type?e(xp,{...m?.inputType?.inputProps,label:"",onFileListClick:e=>{const n=e.target.closest(".ff-attachment-files"),r=e.target.closest(".ff-icon-container, .ff-icon-click, .ff-icon-danger");if(n&&!r&&m?.value&&t.attachmentAction?.viewAttachment)try{const e=JSON.parse(m.value),r=n.parentElement?.querySelectorAll(".ff-attachment-files")||[],i=Array.from(r).indexOf(n);if(-1===i||!e[i])return void console.error("File index not found or invalid");const o=e[i];t.attachmentAction.viewAttachment(o.id,o.name?.split("*")[0]??"default")}catch(e){console.error("Error parsing cell value:",e)}else console.warn("Missing file element, icon click, cell value, or viewAttachment action")},selectedFiles:V,onFilesChange:async(e,n,r)=>{try{if("ADD"===r&&"file"===m?.inputType?.type){let n=[];try{m?.value&&(n=JSON.parse(m.value))}catch(e){console.error("Error parsing cell.value:",e)}let r=0;const i=e.filter((e,t,i)=>{const o=e.name.split("*")[0],a=i.findIndex(e=>e.name.split("*")[0]===o)!==t,l=n.some(e=>e.name.split("*")[0]===o);return!a&&!l||(r++,!1)});if(n.length+i.length>5)return void Ta.info("Cannot upload more than 5 files.");if(t.attachmentAction?.addAttachment&&i.length>0)try{let e=0,r=0,o=0;const l=V?.length+i?.length,s=l>0?25*l:1,c=[...n],d=i?.map(async e=>{try{if(e.name.includes("*"))return{file:e,status:"existing",data:{name:e.name}};const n=await(t?.attachmentAction?.addAttachment(e));if(!n||"string"==typeof n&&0===n.trim().length)return{file:e,status:"failed",reason:"no response"};if("string"==typeof n)try{const t=JSON.parse(n);return 507===t.responseCode?{file:e,status:"memory_full",reason:"no memory"}:400===t.responseCode?{file:e,status:"failed",reason:"invalid file"}:t?.id&&t?.name?{file:e,status:"success",data:t}:(console.error(`Invalid response structure for ${e.name}:`,t),{file:e,status:"failed",reason:"invalid response"})}catch(t){return console.error(`Parse error for ${e.name}:`,t),{file:e,status:"failed",reason:"parse error"}}if("object"==typeof n&&null!==n){const t=n;return t?.id&&t?.name?{file:e,status:"success",data:t}:(console.error(`Invalid response structure for ${e.name}:`,n),{file:e,status:"failed",reason:"invalid response"})}return console.error(`Unknown response for ${e.name}:`,n),{file:e,status:"failed",reason:"unknown"}}catch(t){return console.error(`Upload failed for ${e.name}:`,t),{file:e,status:"failed",reason:"upload error"}}});if((await Promise.allSettled(d)).forEach(t=>{if("fulfilled"===t.status&&t.value){const{status:n,data:i}=t.value;"success"===n&&i?.id&&i?.name?(c.push(i),e++):"existing"===n&&i?.name?c.push(i):"memory_full"===n?o++:r++}else r++}),e>0||c.length>n.length){const e=c.length>0?JSON.stringify(c):"";A({...m,value:e,style:m?.style,inputType:m?.inputType}),a(AC(p?.row||0,Math.max(s,h?.[p.row]?.height||s))),O(c.map(e=>new File([new Blob],e.name?.split("*")[0]??"default")))}o>0&&Ta.info("No memory available to add the file"),e>0&&Ta.success(`${e} file${e>1?"s":""} uploaded successfully`),r>0&&Ta.info(`${r} unsupported ${r>1?"files":"file"}. Please check the file formats.`)}catch(e){console.error("Upload operation failed:",e),Ta.error("Operation failed")}}else if("DELETE"===r&&"file"===m?.inputType?.type)try{let e=[...m&&JSON.parse(m.value)],r=0;for(const i of n||[]){const n=e.findIndex(e=>e.name.split("*")[0]===i.name.split("*")[0]),o=e[n]?.id;if(-1!==n&&o&&t.attachmentAction?.deleteAttachment)try{const a=await t.attachmentAction.deleteAttachment(o);"SUCCESS"===a||"object"==typeof a&&null!==a&&("status"in a&&"SUCCESS"===a.status||"responseCode"in a&&200===a.responseCode)?(e.splice(n,1),r++):console.error(`Delete failed for ${i.name}: Invalid response`,a)}catch(e){console.error(`Delete error for ${i.name}:`,e),Ta.error("Error deleting file")}else console.error(`Cannot delete ${i.name}: Invalid fileId or no match`,{index:n,fileId:o,hasDeleteAttachment:!!t.attachmentAction?.deleteAttachment}),Ta.error("Failed to delete file: Invalid file data")}if(r>0){const t=e.length>0?JSON.stringify(e):"";A({...m,value:t,style:m?.style,inputType:m?.inputType}),O(e?.map(e=>new File([new Blob],e.name.split("*")[0]))),Ta.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):"";A({...m,value:e,style:m?.style,inputType:m?.inputType}),O(t.map(e=>new File([new Blob],e.name.split("*")[0]))),Ta.error("Failed to delete file(s). Invalid file data detected.")}else Ta.error("Failed to delete file(s). No valid files removed.")}}catch(e){console.error("Delete operation failed:",e),Ta.error("Delete operation failed")}}catch(e){console.error("handleFilesChange error:",e),Ta.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:(y?.width??0)-60}):"edit"===C&&p&&t.editable?e(N,{row:p.row,column:p.column,cell:m,onChange:A,exitEditMode:f}):e(ov,{initialValue:m?.value,onChange:()=>{},className:"ff-spreadsheet-cell-textarea",style:{...m?.style,textDecoration:"underline"===m?.style?.textDecoration?"underline":"none",backgroundColor:Z?"#1e161f00":m?.style?.backgroundColor,pointerEvents:"none",borderTop:"",borderBottom:"",borderLeft:"",borderRight:""}})}),!["file"].includes(m?.inputType?.type??"")&&("edit"===C||p&&e("div",{onMouseDown:T,className:"select_dot"}))]},`${p?.row}-${p?.column}`)},sv=({dimensions:t,dragging:n,hidden:r,variant:i})=>{const o=Qg(e=>e.active),a=Qg(e=>e.autoFill),l=Qg(e=>o?Tm(o,e.rowDimensions,e.columnDimensions):void 0),{width:s,height:c,top:d,left:u}=t||{};let f=l?.height??0,h=l?.width??0,p=s,C=c;return a.open&&s&&c&&l&&(s-h>c-f?(p=s,C=l.height):(C=c,p=l.width)),e("div",{className:z("ff-spreadsheet-floating-rect",{[`ff-spreadsheet-floating-rect--${i}`]:i,"ff-spreadsheet-floating-rect--dragging":n,"ff-spreadsheet-floating-rect--hidden":r}),style:{width:(p??0)+1,height:(C??0)+1,top:d,left:u}})},cv=({scrollPos:t={top:0,left:0}})=>{const n=Qg(e=>e.selected),i=Qg(e=>e.dragging),o=Qg(e=>e.selected.size(e.model.data)<2),a=Qg(e=>n&&Zm(e.rowDimensions,e.columnDimensions,e.model.data,e.selected)),l=r.useMemo(()=>{if(a)return{...a,top:a.top-1,left:a.left-1,height:a.height-1,width:a.width-1}},[a,t]);return e(sv,{variant:"selected",dimensions:l,dragging:i,hidden:o||!a})},dv=({scrollPos:t={top:0,left:0}})=>{const n=Qg(e=>e.copied),i=null===n,o=Qg(e=>n&&Dm(e.rowDimensions,e.columnDimensions,n)),a=r.useMemo(()=>{if(o)return{...o,top:o.top-1,left:o.left-1,height:o.height-1,width:o.width-1}},[o,t]);return e(sv,{variant:"copied",dimensions:a,hidden:i||!o,dragging:!1})},uv=({getColorValue:t,disabled:n,initialColor:r})=>{const i=a(null),[o,l]=c(r);return e("div",{className:z("ff-excel-color-selector",{"color-selector-disabled":n}),style:{backgroundColor:o},onClick:()=>{i.current&&!n&&i.current.click()},children:e("input",{type:"color",disabled:n,className:z("ff-excel-color-selector-picker",{"color-selector-disabled":n}),ref:i,onChange:e=>{l(e.target.value),t(e.target.value.replace("#",""))}})})},fv=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"}},hv=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"}},pv=e=>Qm.reduce((t,n)=>Math.abs(n-parseFloat(e))<Math.abs(t-parseFloat(e))?n:t);function Cv(e){const{border:t}=e;let n="",r="",i="",o="";return"THIN"!==t.top&&(n="MEDIUM"===t.top?"2px solid var(--input-hover-border-color)":"1px solid var(--excel-header-border)"),"THIN"!==t.right&&(r="MEDIUM"===t.right?"2px solid var(--input-hover-border-color)":"1px solid var(--excel-header-border)"),"THIN"!==t.bottom&&(i="MEDIUM"===t.bottom?"2px solid var(--input-hover-border-color)":"1px solid var(--excel-header-border)"),"THIN"!==t.left&&(o="MEDIUM"===t.left?"2px solid var(--input-hover-border-color)":"1px solid var(--excel-header-border)"),{fontSize:Fm(pv(String(e.size))),fontFamily:(a=e.name,Wm.some(e=>e.label===a)?a:"Poppins"),color:`#${e.color}`,backgroundColor:`#${e.backgroundColor}`,fontWeight:e.bold?"bold":"normal",fontStyle:e.italic?"italic":"normal",textDecoration:e.underline?"underline":"normal",borderTop:n,borderRight:r,borderBottom:i,borderLeft:o,textAlign:fv(e.alignment.horizontal),alignContent:fv(e.alignment.vertical)};var a}const mv=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"},gv=e=>({name:e.fontFamily||"Arial",size:Um(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:mv(e.borderTop?e.borderTop.toString():void 0),right:mv(e.borderRight?e.borderRight.toString():void 0),bottom:mv(e.borderBottom?e.borderBottom.toString():void 0),left:mv(e.borderLeft?e.borderLeft.toString():void 0)},alignment:{horizontal:hv(e.textAlign),vertical:hv(e.alignContent),wrapText:!1}}),vv=({toolbar:t="show",editable:r,onBold:i,onItalic:o,setUnderlineType:s,setColor:d,setFontSize:u,setFontFamily:f,setTextAlign:h,setBackgroundColor:p,setBorderType:C,setFormatePainter:m})=>{const g=Qg(e=>e.selected instanceof wm),[v,y]=c("disable"===t||!r),w=Qg(e=>e.active?nm(e.active,e.model.data):null),b=Qg(e=>e.model.data),E=Qg(e=>e.formattedStyle.open),M={...qm.style,color:"#1e161f",backgroundColor:"#ffffff",borderColor:"#1e161f"},[A,x]=c(w?.style||M),L=a(null);l(()=>{w?.style&&JSON.stringify(w.style)!==JSON.stringify(A)&&x(w?.style||M),g?y(!r):w&&"boolean"==typeof w.readOnly&&y(w.readOnly||"disable"===t||!r||"dropDown"===w?.inputType?.type)},[w,r]);const k=gv(A),[H,S]=c("border-none"),[_,V]=c({label:"",value:""}),[O,z]=c({label:"",value:""}),[N,I]=c({color:M.color,backgroundColor:M.backgroundColor,borderColor:M.borderColor}),T=[{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=Qm.map(e=>({label:e,value:e}));l(()=>{let e=setTimeout(()=>{d(b,N.color)},0);return()=>{clearTimeout(e)}},[N.color]),l(()=>{let e=setTimeout(()=>{p(b,N.backgroundColor)},0);return()=>{clearTimeout(e)}},[N.backgroundColor]);return l(()=>{const e=A.fontFamily,t=`${Um(A.fontSize)}`;V({label:e??"Times New Roman",value:e??"Times New Roman"}),z({label:t??"11",value:t??"11"})},[A]),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(ar,{disabled:v,height:24,tooltip:!0,showToolTip:!0,showLabel:!1,optionZIndex:2e3,onChange:e=>{V({label:e.label,value:e.label}),f(b,e.value)},required:!1,optionsList:Wm,selectedOption:_})}),e("div",{className:"ff-excel-toolbar-font-size",children:e(ar,{disabled:v,height:24,showLabel:!1,optionZIndex:2e3,required:!1,onChange:e=>{z({label:e.label,value:e.value}),u(b,e.value)},optionsList:D,selectedOption:O})})]}),e("div",{className:"ff-excel-toolbar-divider"}),n("div",{className:"ff-excel-toolbar-icon",children:[e(K,{placement:"top",title:"Text Left",children:e(P,{disabled:v,variant:"left"===A.textAlign?"dark":"light",hoverEffect:"left"!==A.textAlign,onClick:()=>h(b,"left"),name:"text_align_left"})}),e(K,{placement:"top",title:"Text Center",children:e(P,{disabled:v,variant:"center"===A.textAlign?"dark":"light",hoverEffect:"center"!==A.textAlign,onClick:()=>h(b,"center"),name:"text_align_center"})}),e(K,{placement:"top",title:"Text Right",children:e(P,{disabled:v,variant:"right"===A.textAlign?"dark":"light",hoverEffect:"right"!==A.textAlign,onClick:()=>h(b,"right"),name:"text_align_right"})})]}),e("div",{className:"ff-excel-toolbar-divider"}),n("div",{className:"ff-excel-toolbar-text",children:[e(K,{placement:"top",title:"Bold",children:e(P,{disabled:v,variant:k.bold?"dark":"light",hoverEffect:!k.bold,onClick:()=>i(b),name:"bold"})}),e(K,{placement:"top",title:"Italic",children:e(P,{disabled:v,variant:k.italic?"dark":"light",hoverEffect:!k.italic,onClick:()=>o(b),name:"italic"})}),e(K,{placement:"top",title:"Underline",children:e("div",{className:"ff-excel-toolbar-icon-underline",children:e(P,{disabled:v,variant:"underline"===A.textDecoration?"dark":"light",hoverEffect:"underline"!==A.textDecoration,onClick:()=>s(b),name:"underline"})})})]}),e("div",{className:"ff-excel-toolbar-divider"}),n("div",{className:"ff-excel-toolbar-icon",children:[e(K,{placement:"top",title:"Format Painter",children:e(P,{disabled:v,variant:E?"dark":"light",hoverEffect:!E,onClick:()=>{m(b)},name:"formate_painter"})}),e(K,{placement:"top",title:"Text Color",children:n("div",{className:"ff-excel-toolbar-icon-color",children:[e(P,{disabled:v,hoverEffect:!0,width:12,height:12,onClick:()=>{d(b,N.color)},name:"text_color"}),e(uv,{disabled:v,getColorValue:e=>{I(t=>({...t,color:e}))},initialColor:N.color})]})}),e(K,{placement:"top",title:"Background Color",children:n("div",{className:"ff-excel-toolbar-icon-color",children:[e(P,{disabled:v,hoverEffect:!0,width:12,height:12,onClick:()=>p(b,N.backgroundColor),name:"fill_color"}),e(uv,{disabled:v,getColorValue:e=>{I(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(K,{placement:"top",title:"Border Type",children:e(P,{hoverEffect:!0,disabled:v,onClick:()=>C(b,H,"var(--input-hover-border-color)"),name:(()=>{const e=T.find(e=>e.value===H);return e?e.icon:""})()})}),e("span",{ref:L,children:e(fr,{disabled:v,iconName:"arrow_down",targetRef:L,iconSize:12,zIndex:2e3,options:T,tooltipTitle:"Border Type",tooltipPlacement:"top",onOptionClick:e=>{let t=e.value;C(b,t,"var(--input-hover-border-color)"),S(t)}})})]})})]})},yv=(e,t)=>{let n,r=null;const i=function(...i){const o=this;null===r||Date.now()-r>=t?(e.apply(o,i),r=Date.now()):(n&&clearTimeout(n),n=setTimeout(()=>{e.apply(o,i),r=Date.now()},t-(Date.now()-r)))};return i.cancel=()=>{n&&clearTimeout(n),n=null,r=null},i},wv=r.forwardRef(function(t,i){const{className:o,columnLabels:a=[],rowLabels:l=[],toolbar:s,editable:c,onKeyDown:d,Table:u=Fg,Row:f=Ug,sheetHeight:h,HeaderRow:p=qg,DataEditor:C=av,DataViewer:m=rv,onSelect:g=()=>{},onActivate:v=()=>{},onEvaluatedDataChange:y=()=>{},contextOption:w,attachmentAction:b,workRef:E,minimumColumnWidth:M,setContextMenu:A,maxRowLimit:x,maxColLimit:L,disableDeleteOption:k,contextMenu:H,getActiveCell:S,onAddColumn:_,onDeleteColumn:V}=t,O=M||100,N=r.useRef(!1),I=Qg(e=>e.model.data),[T,D]=r.useState(!1),[Z,j]=r.useState(0),[R,B]=r.useState(0),[P,F]=r.useState({top:0,left:0}),[U,q]=r.useState(!1),[W,Q]=r.useState(!1),G=r.useMemo(()=>{const e=t.createFormulaParser||Xm,n=new ng(e,t.data);return D(e=>!e),{...kg,model:n,selected:t.selected||kg.selected}},[t.createFormulaParser,t.data,t.selected]),K=r.useReducer(Hg,G),[Y,X]=K,J=r.useMemo(()=>function(e,t,n){const{columns:r,rows:i}=dm(e);return{rows:t?Math.max(i,t.length):i,columns:n?Math.max(r,n.length):r}}(Y.model.data,l,a),[Y.model.data,l,a]),[$,ee]=r.useState({start:0,end:Math.min(20,J.rows)}),[te,ne]=r.useState({start:0,end:Math.min(15,J.columns)}),re=r.useCallback(e=>{let t=0;for(let n=0;n<e;n++)t+=Y.rowDimensions[n]?.height||32;return t},[Y.rowDimensions,32]),ie=r.useCallback(e=>{let t=0;for(let n=0;n<e;n++)t+=Y.columnDimensions[n]?.width||O;return t},[Y.columnDimensions,O]);r.useEffect(()=>{X(function(e){return{type:yC,payload:{minimumColumnWidth:e}}}(M))},[M]);const oe=re(J.rows),ae=ie(J.columns),le=re($.start),se=oe-re($.end),ce=ie(te.start),de=ae-ie(te.end),ue=Y.mode,fe=r.useRef(null),he=e=>r.useCallback((...t)=>X(e(...t)),[e]),pe=he(MC),Ce=he(em),me=he($C),ge=he(tm),ve=he(KC),ye=he(YC),we=he(PC),be=he(XC),Ee=he(JC),Me=he(FC),Ae=he(UC),xe=he(qC),Le=he(LC),ke=he(kC),He=he(SC),Se=he(OC),_e=he(_C),Ve=he(VC),Oe=he(HC),ze=he(zC),Ne=he(NC),Ie=he(IC),Te=he(EC),De=he(TC),Ze=he(DC),je=he(ZC),Re=he(jC),Be=he(RC),Pe=he(BC);r.useImperativeHandle(i,()=>({removeSelect:ge}));const Fe=r.useRef(Y.active);r.useEffect(()=>{if(Y.active!==Fe.current)if(Y.active)v(Y.active);else{const e=E.current;e&&Bm(e)&&document.activeElement&&document.activeElement.blur()}Fe.current=Y.active},[v,Y.active]);const Ue=r.useRef(Y.model.evaluatedData);r.useEffect(()=>{Y?.model?.evaluatedData!==Ue?.current&&y(Y?.model?.evaluatedData),Ue.current=Y.model.evaluatedData},[Y?.model?.evaluatedData,y]);const qe=r.useRef(Y.selected);r.useEffect(()=>{Y.selected.equals(qe.current)||t.selected&&Y.selected.equals(t.selected)||g(Y.selected),qe.current=Y.selected},[Y.selected,g,t.selected]);const We=r.useRef(t.selected);r.useEffect(()=>{t.selected&&We.current&&!t.selected.equals(We.current)&&xe(t.selected),We.current=t.selected},[t.selected,xe]);let Qe=r.useRef(t.data);r.useEffect(()=>{pe(c),t.data!==Qe.current&&Me(t.data),Qe.current=t.data},[t.data,Me,c]);const Ge=r.useRef(t.createFormulaParser);r.useEffect(()=>{t.createFormulaParser!==Ge.current&&t.createFormulaParser&&Ae(t.createFormulaParser),Ge.current=t.createFormulaParser},[t.createFormulaParser,Ae]);const Ke=r.useCallback(e=>{const{model:t,selected:n}=Y,{data:r}=t,i=n.toRange(r);if(i){!function(e,t){e.clipboardData?.setData(km,t)}(e,jm(function(e,t,n){const r=[],i=t.column-e.column;for(let o=e.row;o<=t.row;o++){const a=o-e.row;r[a]=r[a]||Array(i);for(let i=e.column;i<=t.column;i++)r[a][i-e.column]=nm({row:o,column:i},n)}return r}(i.start,i.end,r)))}},[Y]),Ye=r.useCallback(e=>{Rm(fe.current,ue)&&(e.preventDefault(),e.stopPropagation(),Ke(e),Ce())},[ue,Ke,Ce]),Xe=r.useCallback(e=>{Rm(fe.current,ue)&&(e.preventDefault(),e.stopPropagation(),Ke(e),me())},[ue,Ke,me]),Je=r.useCallback(e=>{if(Rm(fe.current,ue)&&(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(km):""}(e);ve(t)}},[ue,ve]),$e=r.useCallback(e=>{e.persist();const t=e.ctrlKey||e.metaKey,n=e.key.toLowerCase();t&&"b"===n?(e.preventDefault(),Le(I)):t&&"i"===n?(e.preventDefault(),ke(I)):t&&"u"===n&&(e.preventDefault(),He(I)),d&&d(e),e.defaultPrevented||(function(e,t){return void 0!==Eg(e,t)}(Y,e)&&e.nativeEvent.preventDefault(),ye(e))},[Y,d,ye]),et=r.useCallback(()=>{Y.formattedStyle.open&&Y.active&&Te(Y.active)},[Y]),tt=r.useCallback(()=>{Ee(),document.removeEventListener("mouseup",tt)},[Ee]),nt=r.useCallback(e=>{Y.dragging||1!==e.buttons||"view"!==ue||(be(),document.addEventListener("mouseup",tt))},[Y,be,tt,ue]),rt=r.useMemo(()=>nv(t.Cell||tv),[t.Cell,T,c]),it=r.useMemo(()=>Kg(t.CornerIndicator||Gg),[t.CornerIndicator,T]),ot=r.useMemo(()=>ev(t.RowIndicator||$g),[t.RowIndicator,T]),at=r.useMemo(()=>Yg(t.ColumnIndicator||Xg),[t.ColumnIndicator,T]);r.useEffect(()=>(document.addEventListener("cut",Ye),document.addEventListener("copy",Xe),document.addEventListener("paste",Je),()=>{document.removeEventListener("cut",Ye),document.removeEventListener("copy",Xe),document.removeEventListener("paste",Je)}),[Ye,Xe,Je]);const lt=e=>{const t=new ResizeObserver(e=>{const t=e[0];if(t&&fe.current){const e=t.target;if(e){const{clientWidth:t,clientHeight:n}=e;B(Math.min(fe.current.clientHeight,n)),j(Math.min(fe.current.clientWidth,t))}}}),n=e.current;n&&t.observe(n)},st=r.useCallback(e=>{const t=e.target,{scrollTop:n,clientHeight:r,scrollLeft:i,clientWidth:o}=t;F({top:n,left:i});let a=0;for(;a<J.rows&&re(a)<n;)a++;let l=a;for(;l<J.rows&&re(l)<n+r;)l++;a=Math.max(0,a-10),l=Math.min(J.rows,l+10),ee({start:a,end:l});const s=l===J.rows;q(s);let c=0;for(;c<J.columns&&ie(c)<i;)c++;let d=c;for(;d<J.columns&&ie(d)<i+o;)d++;c=Math.max(0,c-10),d=Math.min(J.columns,d+10),ne({start:c,end:d});const u=d===J.columns;Q(u),H.open&&A({open:!1,contextType:null,options:[{label:"",value:"",iconName:"",action:()=>{},disableTooltip:"",visible:!1,disable:!1}]})},[J.rows,J.columns,re,ie]),ct=r.useMemo(()=>yv(st,16),[st]),dt=e=>{N.current=!0,requestAnimationFrame(()=>{let t=0;for(let n=0;n<=e;n++)t+=Y.rowDimensions?.[n]?.height||32;requestAnimationFrame(()=>{fe.current&&e>=J.rows-1&&fe?.current?.scrollTo({top:t+32,behavior:"smooth"})})})},ut=e=>{N.current=!0,requestAnimationFrame(()=>{let t=0;for(let n=0;n<=e;n++)t+=Y.columnDimensions?.[n]?.width||O;requestAnimationFrame(()=>{fe.current&&e>=J.columns-1&&fe.current.scrollTo({left:t+60,behavior:"smooth"})})})};r.useEffect(()=>{N.current||(ee({start:0,end:Math.min(20,J.rows)}),ne({start:0,end:Math.min(15,J.columns)}))},[J.rows,J.columns,N.current]);const ft=Hm($.end,$.start),ht=Hm(te.end,te.start),pt=n("colgroup",{children:[e("col",{style:{width:"60px"}},"row-indicator")," ",e("col",{style:{width:`${ce}px`}},"left-spacer")," ",ht.map(t=>e("col",{style:{width:`${Y.columnDimensions[t]?.width||O}px`}},t)),e("col",{style:{width:`${de}px`}},"right-spacer")," "]}),Ct=r.useMemo(()=>n(u,{useTableRef:lt,totalWidth:ae,children:[pt,n("tbody",{children:[n(p,{children:[e(it,{}),e("div",{className:"spacer left"}),ht.map(n=>e(at,{column:n,minimumColumnWidth:M,setContextMenu:t.setContextMenu,label:n in a?a[n]:void 0,deleteColumn:Pe,addColumnLeft:je,addColumnRight:Re,columnContextEnable:t.columnContextEnable,maxColLimit:L,disableDeleteOption:k,contextMenu:H,onAddColumn:_,onDeleteColumn:V,setVisibleRange:ne,scrollToColumn:ut},n)),e("div",{className:"spacer right"})]}),e("tr",{style:{height:`${le}px`}}),ft.map(r=>n(f,{row:r,children:[e(ot,{label:r in l?l?.[r]:void 0,row:r,addRowTop:De,addRowBottom:Ze,deleteRow:Be,setContextMenu:t.setContextMenu,rowContextEnable:t.rowContextEnable,maxRowLimit:x,disableDeleteOption:k,contextMenu:H,setVisibleRange:ee,scrollToRow:dt},r),e("div",{className:"spacer left"}),ht.map(t=>e(rt,{row:r,column:t,DataViewer:m},t)),e("div",{className:"spacer right"})]},r)),e("tr",{style:{height:`${se}px`}})]})]}),[u,J.rows,J.columns,f,p,it,a,at,l,ot,rt,m,$,te,le,se,ce,de,Y.rowDimensions,Y.columnDimensions]),mt=r.useMemo(()=>e(lv,{attachmentAction:b,contextOption:w,getActiveCell:S,setContextMenu:t.setContextMenu,DataEditor:C,visibleRowRange:$,visibleColRange:te,maxHeight:R-64,maxWidth:Z-M,totalHeight:oe,totalWidth:ae,isAtBottom:U,isAtRight:W,scrollPos:P,editable:c},Y.active?`${Y.active.row}-${Y.active.column}`:"no-active"),[C,$,te,Y.active,R,Z,oe,ae,U,W,c]),gt=r.useMemo(()=>n("div",{className:"ff-excel-spreadsheet-container",children:[e("div",{style:{width:`${Z}px`},className:z("ff-excel-header-column-hider",{"ff-excel-header-extend":["show","disable"].includes(s||""),"ff-excel-header-hider":"hide"===s})}),e("div",{style:{height:`${R}px`},className:z("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(vv,{editable:c,toolbar:s,onBold:Le,onItalic:ke,setUnderlineType:He,setColor:ze,setBorderType:Oe,setFontSize:_e,setFontFamily:Ve,setTextAlign:Se,setBackgroundColor:Ne,setFormatePainter:Ie})}),n("div",{ref:fe,style:{height:h},className:z("ff-excel-spreadsheet",o),onKeyPress:we,onKeyDown:$e,onClick:et,onMouseMove:nt,onScroll:e=>ct(e),children:[Ct,mt,e(cv,{scrollPos:P}),e(dv,{scrollPos:P})]})]}),[o,we,$e,nt,Ct,mt,Z]);return e(Pg.Provider,{value:K,children:gt})}),bv=({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(K,{title:i?t.disableTooltip:"",children:n("div",{className:"ff-excel-menu-options "+(i?"disabled":""),onClick:()=>{i||t.action()},children:[t.iconName&&e(P,{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(F,{as:"label",children:t.label})]})},t.label)}var r;return null})})},Ev=({excelData:r,contextOption:o,toolbar:s="show",sheetBar:d="show",rowCount:u=26,colCount:f=26,sheetHeight:h="100%",editable:p=!0,contextHeightPositioning:C=0,contextWidthPositioning:m=0,onSave:g=()=>Promise.resolve(),onSaveInfoChange:v,attachmentAction:y={addAttachment:()=>Promise.resolve(""),deleteAttachment:()=>Promise.resolve(""),viewAttachment:()=>Promise.resolve()},onSaveDelay:w=3e3,scroller:b=!1,columnContextEnable:E=!0,rowContextEnable:M=!0,sheetBarContextEnable:A=!0,minimumColumnWidth:x=100,disableDeleteOption:L=!1,maxRowLimit:k=1/0,maxColLimit:H=1/0,maxSheetLimit:S=1/0,getActiveCell:_=()=>{}})=>{const V=a(null),[O,N]=c([]),[I,T]=c(""),[D,Z]=i.useState({open:!1,contextType:null,options:[{label:"",value:"",iconName:"",action:()=>{},disableTooltip:"",disable:!1,visible:!1}]}),[j,R]=c({name:"defaultSheet",index:0}),[B,U]=c({defaultSheet:[[qm]]}),[q,W]=c([[qm]]),[Q,Y]=c((g.length,{})),[X,J]=c({x:0,y:0}),$=a(""),ee=a(null),te=a(null),ne=a(null);l(()=>{const e=r;if(e){const t=e.map(e=>e.sheetName);N(t),G(t.length)||($.current=t[0]||"",R({name:t[0]||"",index:0}));const n={},r={};e.forEach(e=>{const t=e.sheetName,i=e.data,o=Math.max(u,i.length),a=Math.max(f,Math.max(...i.map(e=>e.length)));let l=Array.from({length:o},()=>Array(a).fill({value:"",style:qm.style,readOnly:!1,inputType:void 0}));i.forEach((e,t)=>{e.forEach((e,n)=>{var r;t<o&&n<a&&(l[t]||(l[t]=[]),l[t][n]={value:(r=e.value,null==r?null:r),style:G(e?.style)?qm.style:Cv(e?.style),readOnly:!!e?.readOnly&&e?.readOnly,inputType:e?.inputType??void 0,contextDisable:e.contextDisable})})});const s=new Set([...e?.rows?.readOnly?e.rows.readOnly.map(e=>`r${e}`):[],...e?.columns?.readOnly?e.columns.readOnly.map(e=>`c${e}`):[],...e?.cells?.readOnly?e.cells.readOnly.map(([e,t])=>`${e},${t}`):[]]);if(l.forEach((t,n)=>{t.forEach((t,r)=>{l[n]||(l[n]=[]);const i=s.has(`r${n+1}`)||s.has(`c${r+1}`)||s.has(`${n+1},${r+1}`),o=((t,n,r)=>r?.inputType?r.inputType:e?.rows?.inputType?.[t+1]||e?.columns?.inputType?.[n+1]||e?.cells?.inputType?.[`${t+1},${n+1}`]||{type:"text"})(n,r,t||qm);l[n][r]={...t,value:t?.value??"",readOnly:t?.readOnly?t.readOnly:i,inputType:o,contextDisable:t?.contextDisable}})}),n[t]=l,g.length>1){const e=i[0]||[];r[t]=Array.from({length:a},(t,n)=>({newData:"",oldData:e[n]?.value||""}))}}),U(n),g.length>1&&Y(r);const i=Object.keys(n)[0];i&&void 0!==n[i]&&W(n[i])}},[r]),l(()=>{v&&v(I),"File saved"===I&&setTimeout(()=>{T("")},2e3)},[I]),l(()=>{T("Saving..."),re(le())},[B,$.current]);const re=i.useCallback(xa(e=>{if(g.length>1){const t={...Q};O.forEach((n,r)=>{const i=(e[r].data[0]||[]).map(e=>e?.value||"");t[n]=(t[n]||[]).map((e,t)=>({...e,newData:i[t]||""}))}),Y(t);const n=O.map(e=>({sheetName:e,headers:t[e]||[]}));g(e,n)}else g(e);T("File saved")},w),[g,Q,O]),ae=i.useCallback(e=>{e.ctrlKey&&"s"===e.key&&(e.preventDefault(),e.stopPropagation(),re(le()))},[g]);i.useEffect(()=>(document.addEventListener("keydown",ae),()=>{document.removeEventListener("keydown",ae)}),[ae]);const le=()=>O.map(e=>{const t=B[e]?.map(e=>{const t=e.reduce((e,t,n)=>""!==String(t?.value??"").trim()?n:e,-1),n=e.map((e,n)=>e&&e.style&&n<=t?{value:e.value,style:gv(e.style),readOnly:e.readOnly,inputType:e.inputType,contextDisable:e.contextDisable}:null).filter(e=>null!==e);return n.length>0?n:[]})||[],n=t.filter((e,n)=>{const r=t.slice(n+1).some(e=>e.length>0);return e.length>0||r});return{sheetName:e,data:G(n.length)?[[]]:n}}),[se,ce]=c(null),de=()=>O.length>=S,ue=()=>{if(de())return;const e=((e,t)=>{const n=t.map(e=>e.toLowerCase());let r=`${e}1`,i=2;for(;n.includes(r.toLowerCase());)r=`${e}${i}`,i++;return r})("Sheet",O),t=Array.from({length:u},()=>Array.from({length:f},()=>qm));N(t=>[...t,e]),R({index:O?.length,name:e}),U({...B,[e]:t}),W(t),g.length>1&&Y(t=>({...t,[e]:Array.from({length:f},()=>({newData:"",oldData:""}))})),$.current=e},fe=(e=[[qm]])=>{W(e)},he=(e,t,n)=>{const r=e.target;if(!r||r?.textContent?.trim()===n?.trim())return void ce(null);const i=(r.textContent||"").trim();if(!i)return Ta.warning("Sheet name cannot be empty."),r.textContent=j.name,void ce(null);if(i.length>50)return Ta.warning("The sheet name cannot be greater than 50 characters"),r.textContent=j.name,void ce(null);if(O.map(e=>e.toLowerCase()).includes(i.toLowerCase())&&n.trim()?.toLowerCase()!==i?.toLowerCase())return Ta.warning("Sheet name already exists"),r.textContent=j.name,void ce(null);let o=O;fe(B?.[n]),o.splice(t,1,i);const a=function(e,t,n){if(!(t in e))throw new Error(`Key "${t}" not found in object`);const{[t]:r,...i}=e;return{...i,[n]:r??[]}}(B,n,i);$.current=i,R(e=>({...e,name:i})),U(a),g.length>1&&Y(e=>{const t={...e},r=t[n];return delete t[n],t[i]=r??[],t}),ce(null)};const pe=(e,t)=>{e!==j.name&&t!==j.index&&(R({index:t,name:e}),N(n=>{const r=[...n];return r[t]=e,r}),fe(B[e]),$.current=e)},Ce=i.useCallback((e,t=!1)=>{const n=e.target;(!n.closest(".ff-excel-tab-list")&&!n.closest(".ff-excel-sheet")||t)&&D.open&&(Z({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",Ce),document.addEventListener("click",e=>Ce(e,!0)),()=>{document.removeEventListener("contextmenu",Ce),document.removeEventListener("click",e=>Ce(e,!0))}),[Ce]);const me=(e,t,n)=>{e.preventDefault();const r=[{label:"Add Sheet",value:"Add Sheet",iconName:"plus_icon",action:()=>ue(),disableTooltip:"Sheet limit reached",visible:!1,disable:de()},...L?[]:[{label:"Delete Sheet",value:"Delete Sheet",iconName:"delete",action:()=>((e,t)=>{if(O.length>1){let n=O.slice();n.splice(t,1);const r={...B};delete r[e];const i=Math.min(t,n.length-1);N(n),U(r),g.length>1&&Y(t=>{const n={...t};return delete n[e],n});const o=n[i]?n[i]:"";R({index:i,name:o}),fe(r?.[o]),$.current=o}else Ta.warning("Cannot delete the last sheet.")})(t,n),disableTooltip:"",visible:!1,disable:!1}]];Z(e=>({...e,open:!0,contextType:"sheet",options:r}))};l(()=>{ne.current?.removeSelect()},[j.name]);return e(t,{children:O.length>0&&n("div",{ref:ee,className:"ff-excel",onContextMenu:e=>{e.preventDefault();const t=te.current?.parentElement?.getBoundingClientRect(),n=window.scrollX,r=window.scrollY;let i=e.clientX-(t?.left||0)+n,o=e.clientY-(t?.top||0)+r;const a=300,l=window.innerWidth,s=window.innerHeight,c=l-e.clientX,d=e.clientX,u=s-e.clientY,f=e.clientY;c<a&&d>=a?i=e.clientX-(t?.left||0)+n-150:i+=2,u<200&&f>=200?o=e.clientY-(t?.top||0)+r-20:o+=2,e.target.classList.contains("ff-excel-tab-list")?J({x:i,y:o-(L?32:65)}):(i+a>l&&(i=l-a-2),i<0&&(i=2),J({x:i+m,y:o+C}))},onClick:e=>{e.stopPropagation(),D.open&&Z({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(wv,{ref:ne,editable:p,attachmentAction:y,toolbar:s,sheetHeight:h,setContextMenu:Z,contextOption:o,data:q,columnContextEnable:E,rowContextEnable:M,minimumColumnWidth:x,onEvaluatedDataChange:e=>{U(t=>({...t,[$.current]:e}))},workRef:ee,scroller:b,maxRowLimit:k,maxColLimit:H,disableDeleteOption:L,contextMenu:D,getActiveCell:_,onAddColumn:(e,t)=>{g.length>1&&Y(n=>{const r=j.name,i=[...n[r]||[]],o=t?e:e+1;return i.splice(o,0,{newData:"",oldData:""}),{...n,[r]:i}})},onDeleteColumn:e=>{g.length>1&&Y(t=>{const n=j.name,r=[...t[n]||[]];return r.splice(e,1),{...t,[n]:r}})}},j.name)}),"hide"!==d&&n("div",{className:"ff-excel-sheet-bar",children:["show"===d&&n("div",{className:"ff-excel-add-sheet-set",children:[e(K,{title:de()?"Sheet limit reached":"Add Sheet",placement:"top",children:e(P,{disabled:!p||de(),className:"ff-excel-add-sheet-icon",hoverEffect:!0,onClick:ue,name:"plus_icon",height:20,width:20})}),e(fr,{options:(t=>t.map((t,r)=>({label:n("div",{style:{display:"flex",gap:"8px"},children:[j?.name===t?e(P,{height:16,width:16,name:"tick"}):e("div",{style:{height:"16px",width:"24px"}}),e(K,{title:oe(t,20,"count")?t:"",children:e(F,{children:ie(t,20,"count")})})]}),name:r,value:t})))(O),targetRef:V,onOptionClick:e=>{const{value:t,name:n=""}=e;pe(t,parseInt(n))},dropdownPlacement:"top",iconName:"show_script",tooltipTitle:"All Sheets",tooltipPlacement:"top",dropdownHeight:215,selectedValue:j.name})]}),e("div",{className:"ff-excel-tab-container",children:O.map((t,n)=>e(F,{lineHeight:"16px",children:e("div",{onContextMenu:e=>{pe(t,n),A&&me(e,t,n)},className:z("ff-excel-tab-list",{active:t===j.name}),onClick:()=>{pe(t,n)},suppressContentEditableWarning:se===n,onDoubleClick:e=>{"show"===d&&(ce(n),null===se&&setTimeout(()=>(e=>{const t=document.createRange(),n=window.getSelection();t.selectNodeContents(e),t.collapse(!1),n?.removeAllRanges(),n?.addRange(t)})(e.target),0))},contentEditable:p&&se===n,onBlur:e=>{he(e,n,t)},onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),he(e,n,t))},children:t})},t))})]}),D.open&&e(bv,{contextMenu:D,position:X,editable:p}),e(Ia,{})]})})},Mv=({label:t="",isActive:n=!0,onClick:r=()=>{},isFilterChip:i=!1})=>{const o=i?"filter":"module";return e("div",{className:z("ff-module-chip",{"ff-filter-chip":i,[`ff-${o}-chip--active`]:n,[`ff-${o}-chip--hover`]:!n}),onClick:r,children:e(F,{lineHeight:"18px",className:"module-typography",children:t})})},Av=({x:e,y:t,radius:n,startAngle:r,endAngle:i})=>{const o=e+n*Math.cos(r),a=t+n*Math.sin(r),l=e+n*Math.cos(i),s=t+n*Math.sin(i),c=i-r>Math.PI?1:0;return i-r>=2*Math.PI?`\n M ${e+n} ${t}\n A ${n} ${n} 0 1 1 ${e-n} ${t} \n A ${n} ${n} 0 1 1 ${e+n} ${t}\n `:`M ${o} ${a} A ${n} ${n} 0 ${c} 1 ${l} ${s}`},xv=({radius:t=15,lineWidth:r=5,label:i,percentageValue:o,icon:l,fontSize:s=10,labelColor:d="",arcColor:u="var(--brand-color)",backgroundArcColor:f="var(--ff-select-scroll-thumb-color)",isSelectedArch:h=!1,onSelect:p})=>{const[C,m]=c({x:0,y:0}),[g,v]=c(!1),y=a(null);let w=-Math.PI/2;const b=2*(t+r),{backgroundArcPath:E,foregroundArcPath:M}=((e,t,n)=>{const r=t,i=r+Math.max(0,Math.min(e,100))/100*2*Math.PI;return{backgroundArcPath:Av({x:0,y:0,radius:n,startAngle:0,endAngle:2*Math.PI}),foregroundArcPath:Av({x:0,y:0,radius:n,startAngle:r,endAngle:i})}})(o,w,t),A=()=>{v(!0)},x=()=>{m({x:0,y:0}),v(!1)},L=e=>{if(y.current){const t=y.current.getBoundingClientRect();m({x:e.clientX-t.left,y:e.clientY-t.top})}};return n("div",{ref:y,className:"ff-icon-radial-chart-container",style:{"--fontSize":`${s}px`},onClick:p,children:[e("svg",{width:b,height:b,viewBox:`0 0 ${b} ${b}`,role:"img",children:n("g",{transform:`translate(${t+r}, ${t+r})`,children:[e("path",{d:E,fill:"none",stroke:f,strokeWidth:r,onMouseEnter:A,onMouseLeave:x,onMouseMove:L}),e("path",{d:M,fill:"none",stroke:u,strokeWidth:r,onMouseEnter:A,onMouseLeave:x,onMouseMove:L}),h&&e("path",{d:M,fill:"none",stroke:"var(--dotted-border-color)",strokeOpacity:"0.4",strokeWidth:r,onMouseEnter:A,onMouseLeave:x,onMouseMove:L}),l?e("foreignObject",{x:"-10",y:"-10",width:"20",height:"20",children:e(P,{className:"ff-radial-chart-icon-padding",name:l,height:20,width:20})}):e("text",{x:"0",y:"0",fill:d||u,textAnchor:"middle",dominantBaseline:"central",children:`${Math.round(o)}%`})]})}),g&&n("div",{className:"ff-icon-radial-chart-tooltip",style:{position:"absolute",left:`${C.x+15}px`,top:C.y-5+"px"},children:[e(F,{children:`${i} : `}),n(F,{children:[o,"%"]})]})]})},Lv=({mediaSrc:t,fileId:r,onExpandClick:i,onDeleteClick:o,onDownloadClick:a,height:l="75px",width:s="79px",fileName:c,thumbnailMediaSrc:d,isDelete:u})=>e("div",{className:"ff-attach-media-container",style:{height:l,width:s},children:n("div",{className:"ff-media-wrapper",style:{height:l,width:s},children:[e("img",{src:d||t,alt:"Attached"}),n("div",{className:"ff-hover-icons",children:[n("div",{className:"ff-top-icons",children:[e("div",{className:"ff-icon-container",children:e(K,{title:"Download File",placement:"bottom",children:e(P,{name:"download_file_icon",height:10,width:10,onClick:a,color:"var(--icons-default-color)"})})}),u&&e("div",{className:"ff-icon-container",children:e(K,{title:"Delete",placement:"bottom",children:e(P,{name:"delete",height:10,width:10,color:"var(--ff-delete-button-attachment)",onClick:()=>{o&&o(r)}})})})]}),e("div",{className:"ff-expand-icon-container",children:e(K,{title:"Maximize",placement:"bottom",children:e(P,{name:"expand_icon",height:16,width:16,onClick:i})})})]}),e(F,{color:"var(--text-area-default-color)",fontWeight:"medium",className:"ff-media-text",children:c})]})}),kv=({icon:r,status:i,count:o,text:a,style:s={width:"196.4px"},resetToggle:d,onSelectedStatus:u=e=>{}})=>{const[f,h]=c(!1),p=["total defects","defect density","open defects","closed defects","quality score"],C=p.includes(i.toLowerCase()),m=p.includes(i.toLowerCase());l(()=>{h(!d)},[d]);return n("div",{className:`ff-card-container ${i.toLowerCase()} ${f?"toggled":""}`,style:s,onClick:()=>(e=>{p.includes(e.toLowerCase())||(h(!0),u(e))})(i),children:[n("div",{className:"ff-status-bar",children:[e("div",{children:e(P,{name:r,height:20,width:20,hoverEffect:!1})}),!p.includes(i.toLowerCase())&&e(F,{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,C?{children:[e(F,{fontWeight:"semi-bold",fontSize:"10px",className:"ff-text",lineHeight:"15px",color:"var(--ff-chip-text-color)",children:a}),e(F,{fontWeight:"semi-bold",fontSize:"24px",className:"ff-number",lineHeight:"36px",children:"defect density"===i.toLowerCase()?n(t,{children:[o.toString().padStart(2,"0"),e(F,{fontSize:"15px",fontWeight:"semi-bold",children:"/ Modules"})]}):"quality score"===i.toLowerCase()?`${parseFloat(o.toString()).toFixed(2)}%`:o.toString().padStart(2,"0")})]}:{children:[e(F,{fontWeight:"semi-bold",fontSize:"24px",className:"ff-number",lineHeight:"24px",color:f?"var(--base-bg-color)":"",children:o.toString().padStart(2,"0")}),e(F,{className:"ff-text",lineHeight:"18px",color:f?"var(--base-bg-color)":"var(--ff-chip-text-color)",children:a})]})})]})},Hv=({option:t})=>{const r=a(null),[i,o]=c(!1);l(()=>{const e=r.current;if(!e)return;const t=()=>{o(e.scrollWidth>e.clientWidth)},n=requestAnimationFrame(t);return window.addEventListener("resize",t),()=>{cancelAnimationFrame(n),window.removeEventListener("resize",t)}},[t]);const s={LOCAL:"local_variable_icon",GLOBAL:"global_variable_icon",PROJECT_ENVIRONMENT:"project_env_variable_icon"},d=e=>"_startforloop"===e?.type?`FLV_for:${e?.name}`:"DATAPROVIDER"===e?.type?`${e?.dpName}:${e?.varname}`:e?.name;return n("div",{style:{width:"-webkit-fill-available"},className:"ff-variable-option ff-variable-data",children:[e(K,{title:i?d(t):"",style:{width:"calc(100% - 32px)"},children:e("span",{ref:r,className:"ff-truncated_text",children:d(t)})}),e(P,{name:(e=>{if(!e)return"";const t=e._id||e.id;return t?.startsWith("PARAMETER")?"step_group_parameter":"LOCAL"===e.type&&"STEPGROUP"===e?.parentVariableType?"step_group_variable":"_startforloop"===e.type?"for_loop_variable":"DATAPROVIDER"===e.type?"data_provider_variable":s[e.type||""]||""})(t),height:24,width:24,hoverEffect:!0})]})};function Sv(e){return()=>e}function _v(e){e()}function Vv(e,t){return n=>e(t(n))}function Ov(e,t){return()=>e(t)}function zv(e){return void 0!==e}function Nv(){}function Iv(e,t){return t(e),e}function Tv(e,t){return t(e)}function Dv(...e){return e}function Zv(e,t){return e(1,t)}function jv(e,t){e(0,t)}function Rv(e){e(2)}function Bv(e){return e(4)}function Pv(e,t){return Zv(e,function(e,t){return n=>e(t,n)}(t,0))}function Fv(e,t){const n=e(1,e=>{n(),t(e)});return n}function Uv(e){let t,n;return r=>i=>{t=i,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function qv(e,t){return e===t}function Wv(e=qv){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function Qv(e){return t=>n=>{e(n)&&t(n)}}function Gv(e){return t=>Vv(t,e)}function Kv(e){return t=>()=>{t(e)}}function Yv(e,...t){const n=function(...e){return t=>e.reduceRight(Tv,t)}(...t);return(t,r)=>{switch(t){case 2:return void Rv(e);case 1:return Zv(e,n(r))}}}function Xv(e,t){return n=>r=>{n(t=e(t,r))}}function Jv(e){return t=>n=>{e>0?e--:t(n)}}function $v(e){let t,n=null;return r=>i=>{n=i,!t&&(t=setTimeout(()=>{t=void 0,r(n)},e))}}function ey(...e){const t=new Array(e.length);let n=0,r=null;const i=Math.pow(2,e.length)-1;return e.forEach((e,o)=>{const a=Math.pow(2,o);Zv(e,e=>{const l=n;n|=a,t[o]=e,l!==i&&n===i&&r&&(r(),r=null)})}),e=>o=>{const a=()=>{e([o].concat(t))};n===i?a():r=a}}function ty(e){let t=e;const n=ry();return(e,r)=>{switch(e){case 0:t=r;break;case 1:r(t);break;case 4:return t}return n(e,r)}}function ny(e,t){return Iv(ty(t),t=>Pv(e,t))}function ry(){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 iy(e){return Iv(ry(),t=>Pv(e,t))}function oy(e,t=[],{singleton:n}={singleton:!0}){return{constructor:e,dependencies:t,id:ay(),singleton:n}}const ay=()=>Symbol();function ly(...e){const t=ry(),n=new Array(e.length);let r=0;const i=Math.pow(2,e.length)-1;return e.forEach((e,o)=>{const a=Math.pow(2,o);Zv(e,e=>{n[o]=e,r|=a,r===i&&jv(t,n)})}),function(e,o){switch(e){case 2:return void Rv(t);case 1:return r===i&&o(n),Zv(t,o)}}}function sy(e,t=qv){return Yv(e,Wv(t))}function cy(...e){return function(t,n){switch(t){case 2:return;case 1:return function(...e){return()=>{e.map(_v)}}(...e.map(e=>Zv(e,n)))}}}var dy=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(dy||{});const uy={0:"debug",3:"error",1:"log",2:"warn"},fy=oy(()=>{const e=ty(3);return{log:ty((t,n,r=1)=>{var i;r>=(null!=(i=(typeof globalThis>"u"?window:globalThis).VIRTUOSO_LOG_LEVEL)?i:Bv(e))&&console[uy[r]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,n)}),logLevel:e}},[],{singleton:!0});function hy(e,t,n){return py(e,t,n).callbackRef}function py(e,t,n){const r=i.useRef(null);let o=e=>{};const a=i.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(t=>{const r=()=>{const n=t[0].target;null!==n.offsetParent&&e(n)};n?r():requestAnimationFrame(r)}):null,[e,n]);return o=e=>{e&&t?(null==a||a.observe(e),r.current=e):(r.current&&(null==a||a.unobserve(r.current)),r.current=null)},{callbackRef:o,ref:r}}function Cy(e,t,n,r,o,a,l,s,c){const d=i.useCallback(n=>{const i=function(e,t,n,r){const i=e.length;if(0===i)return null;const o=[];for(let a=0;a<i;a++){const i=e.item(a);if(void 0===i.dataset.index)continue;const l=parseInt(i.dataset.index),s=parseFloat(i.dataset.knownSize),c=t(i,n);if(0===c&&r("Zero-sized element, this should not happen",{child:i},dy.ERROR),c===s)continue;const d=o[o.length-1];0===o.length||d.size!==c||d.endIndex!==l-1?o.push({endIndex:l,size:c,startIndex:l}):o[o.length-1].endIndex++}return o}(n.children,t,s?"offsetWidth":"offsetHeight",o);let c=n.parentElement;for(;!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,p=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:p}),null==a||a(s?my("column-gap",getComputedStyle(n).columnGap,o):my("row-gap",getComputedStyle(n).rowGap,o)),null!==i&&e(i)},[e,t,o,a,l,r,s]);return py(d,n,c)}function my(e,t,n){return"normal"!==t&&!(null!=t&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,dy.WARN),"normal"===t?0:parseInt(null!=t?t:"0",10)}function gy(e,t,n){const r=i.useRef(null),o=i.useCallback(n=>{if(null==n||!n.offsetParent)return;const i=n.getBoundingClientRect(),o=i.width;let a,s;if(t){const e=t.getBoundingClientRect(),n=i.top-e.top;s=e.height-Math.max(0,n),a=n+t.scrollTop}else{const e=l.current.ownerDocument.defaultView;s=e.innerHeight-Math.max(0,i.top),a=i.top+e.scrollY}r.current={offsetTop:a,visibleHeight:s,visibleWidth:o},e(r.current)},[e,t]),{callbackRef:a,ref:l}=py(o,!0,n),s=i.useCallback(()=>{o(l.current)},[o,l]);return i.useEffect(()=>{var e;if(t){t.addEventListener("scroll",s);const e=new ResizeObserver(()=>{requestAnimationFrame(s)});return e.observe(t),()=>{t.removeEventListener("scroll",s),e.unobserve(t)}}{const t=null==(e=l.current)?void 0:e.ownerDocument.defaultView;return null==t||t.addEventListener("scroll",s),null==t||t.addEventListener("resize",s),()=>{null==t||t.removeEventListener("scroll",s),null==t||t.removeEventListener("resize",s)}}},[s,t,l]),a}const vy=oy(()=>{const e=ry(),t=ry(),n=ty(0),r=ry(),i=ty(0),o=ry(),a=ry(),l=ty(0),s=ty(0),c=ty(0),d=ty(0),u=ry(),f=ry(),h=ty(!1),p=ty(!1),C=ty(!1);return Pv(Yv(e,Gv(({scrollTop:e})=>e)),t),Pv(Yv(e,Gv(({scrollHeight:e})=>e)),a),Pv(t,i),{deviation:n,fixedFooterHeight:c,fixedHeaderHeight:s,footerHeight:d,headerHeight:l,horizontalDirection:p,scrollBy:f,scrollContainerState:e,scrollHeight:a,scrollingInProgress:h,scrollTo:u,scrollTop:t,skipAnimationFrameInResizeObserver:C,smoothScrollTargetReached:r,statefulScrollTop:i,viewportHeight:o}},[],{singleton:!0}),yy={lvl:0};function wy(e,t){const n=e.length;if(0===n)return[];let{index:r,value:i}=t(e[0]);const o=[];for(let a=1;a<n;a++){const{index:n,value:l}=t(e[a]);o.push({end:n-1,start:r,value:i}),r=n,i=l}return o.push({end:1/0,start:r,value:i}),o}function by(e){return e===yy}function Ey(e,t){if(!by(e))return t===e.k?e.v:t<e.k?Ey(e.l,t):Ey(e.r,t)}function My(e,t,n="k"){if(by(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){const r=My(e.r,t,n);return r[0]===-1/0?[e.k,e.v]:r}return My(e.l,t,n)}function Ay(e,t,n){return by(e)?Iy(t,n,1):t===e.k?Vy(e,{k:t,v:n}):t<e.k?Ty(Vy(e,{l:Ay(e.l,t,n)})):Ty(Vy(e,{r:Ay(e.r,t,n)}))}function xy(){return yy}function Ly(e,t,n){if(by(e))return[];return function(e){return wy(e,({k:e,v:t})=>({index:e,value:t}))}(Sy(e,My(e,t)[0],n))}function ky(e,t){if(by(e))return yy;const{k:n,l:r,r:i}=e;if(t===n){if(by(r))return i;if(by(i))return r;{const[t,n]=Ny(r);return _y(Vy(e,{k:t,l:Oy(r),v:n}))}}return _y(Vy(e,t<n?{l:ky(r,t)}:{r:ky(i,t)}))}function Hy(e){return by(e)?[]:[...Hy(e.l),{k:e.k,v:e.v},...Hy(e.r)]}function Sy(e,t,n){if(by(e))return[];const{k:r,l:i,r:o,v:a}=e;let l=[];return r>t&&(l=l.concat(Sy(i,t,n))),r>=t&&r<=n&&l.push({k:r,v:a}),r<=n&&(l=l.concat(Sy(o,t,n))),l}function _y(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(zy(t))return Dy(Vy(e,{lvl:n-1}));if(!by(t)&&!by(t.r))return Vy(t.r,{l:Vy(t,{r:t.r.l}),lvl:n,r:Vy(e,{l:t.r.r,lvl:n-1})});throw new Error("Unexpected empty nodes")}if(zy(e))return Zy(Vy(e,{lvl:n-1}));if(by(r)||by(r.l))throw new Error("Unexpected empty nodes");{const t=r.l,i=zy(t)?r.lvl-1:r.lvl;return Vy(t,{l:Vy(e,{lvl:n-1,r:t.l}),lvl:t.lvl+1,r:Zy(Vy(r,{l:t.r,lvl:i}))})}}function Vy(e,t){return Iy(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 Oy(e){return by(e.r)?e.l:_y(Vy(e,{r:Oy(e.r)}))}function zy(e){return by(e)||e.lvl>e.r.lvl}function Ny(e){return by(e.r)?[e.k,e.v]:Ny(e.r)}function Iy(e,t,n,r=yy,i=yy){return{k:e,l:r,lvl:n,r:i,v:t}}function Ty(e){return Zy(Dy(e))}function Dy(e){const{l:t}=e;return by(t)||t.lvl!==e.lvl?e:Vy(t,{r:Vy(e,{l:t.r})})}function Zy(e){const{lvl:t,r:n}=e;return by(n)||by(n.r)||n.lvl!==t||n.r.lvl!==t?e:Vy(n,{l:Vy(e,{r:n.l}),lvl:t+1})}function jy(e,t){return!(!e||e.startIndex!==t.startIndex||e.endIndex!==t.endIndex)}function Ry(e,t){return!(!e||e[0]!==t[0]||e[1]!==t[1])}const By=oy(()=>({recalcInProgress:ty(!1)}),[],{singleton:!0});function Py(e,t,n){return e[Fy(e,t,n)]}function Fy(e,t,n,r=0){let i=e.length-1;for(;r<=i;){const o=Math.floor((r+i)/2),a=n(e[o],t);if(0===a)return o;if(-1===a){if(i-r<2)return o-1;i=o-1}else{if(i===r)return o;r=o+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function Uy(e,t){return Math.round(e.getBoundingClientRect()[t])}function qy(e){return!by(e.groupOffsetTree)}function Wy({index:e},t){return t===e?0:t<e?-1:1}function Qy({offset:e},t){return t===e?0:t<e?-1:1}function Gy(e,t,n){if(0===t.length)return 0;const{index:r,offset:i,size:o}=Py(t,e,Wy),a=e-r,l=o*a+(a-1)*n+i;return l>0?l+n:l}function Ky(e,t){if(!qy(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function Yy(e,t,n){if(function(e){return typeof e.groupIndex<"u"}(e))return t.groupIndices[e.groupIndex]+1;{let r=Ky("LAST"===e.index?n:e.index,t);return r=Math.max(0,r,Math.min(n,r)),r}}function Xy(e,t,n,r=0){return r>0&&(t=Math.max(t,Py(e,r,Wy).offset)),wy(function(e,t,n,r){const i=Fy(e,t,r),o=Fy(e,n,r,i);return e.slice(i,o+1)}(e,t,n,Qy),tw)}function Jy(e,[t,n,r,i]){t.length>0&&r("received item sizes",t,dy.DEBUG);const o=e.sizeTree;let a=o,l=0;if(n.length>0&&by(o)&&2===t.length){const e=t[0].size,r=t[1].size;a=n.reduce((t,n)=>Ay(Ay(t,n,e),n+1,r),a)}else[a,l]=function(e,t){let n=by(e)?0:1/0;for(const r of t){const{endIndex:t,size:i,startIndex:o}=r;if(n=Math.min(n,o),by(e)){e=Ay(e,0,i);continue}const a=Ly(e,o-1,t+1);if(a.some(nw(r)))continue;let l=!1,s=!1;for(const{end:n,start:r,value:o}of a)l?(t>=r||i===o)&&(e=ky(e,r)):(s=o!==i,l=!0),n>t&&t>=r&&o!==i&&(e=Ay(e,t+1,o));s&&(e=Ay(e,o,i))}return[e,n]}(a,t);if(a===o)return e;const{lastIndex:s,lastOffset:c,lastSize:d,offsetTree:u}=ew(e.offsetTree,l,a,i);return{groupIndices:n,groupOffsetTree:n.reduce((e,t)=>Ay(e,t,Gy(t,u,i)),xy()),lastIndex:s,lastOffset:c,lastSize:d,offsetTree:u,sizeTree:a}}function $y(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 ew(e,t,n,r){let i=e,o=0,a=0,l=0,s=0;if(0!==t){s=Fy(i,t-1,Wy),l=i[s].offset;const e=My(n,t-1);o=e[0],a=e[1],i.length&&i[s].size===My(n,t)[1]&&(s-=1),i=i.slice(0,s+1)}else i=[];for(const{start:e,value:s}of Ly(n,t,1/0)){const t=e-o,n=t*a+l+t*r;i.push({index:e,offset:n,size:s}),o=e,l=n,a=s}return{lastIndex:o,lastOffset:l,lastSize:a,offsetTree:i}}function tw(e){return{index:e.index,value:e}}function nw(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 rw={offsetHeight:"height",offsetWidth:"width"},iw=oy(([{log:e},{recalcInProgress:t}])=>{const n=ry(),r=ry(),i=ny(r,0),o=ry(),a=ry(),l=ty(0),s=ty([]),c=ty(void 0),d=ty(void 0),u=ty(void 0),f=ty(void 0),h=ty((e,t)=>Uy(e,rw[t])),p=ty(void 0),C=ty(0),m={groupIndices:[],groupOffsetTree:xy(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:xy()},g=ny(Yv(n,ey(s,e,C),Xv(Jy,m),Wv()),m),v=ny(Yv(s,Wv(),Xv((e,t)=>({current:t,prev:e.current}),{current:[],prev:[]}),Gv(({prev:e})=>e)),[]);Pv(Yv(s,Qv(e=>e.length>0),ey(g,C),Gv(([e,t,n])=>{const r=e.reduce((e,r,i)=>Ay(e,r,Gy(r,t.offsetTree,n)||i),xy());return{...t,groupIndices:e,groupOffsetTree:r}})),g),Pv(Yv(r,ey(g),Qv(([e,{lastIndex:t}])=>e<t),Gv(([e,{lastIndex:t,lastSize:n}])=>[{endIndex:t,size:n,startIndex:e}])),n),Pv(c,d);const y=ny(Yv(c,Gv(e=>void 0===e)),!0);Pv(Yv(d,Qv(e=>void 0!==e&&by(Bv(g).sizeTree)),Gv(e=>{const t=Bv(u),n=Bv(s).length>0;return t?n?[{endIndex:0,size:t,startIndex:0},{endIndex:1,size:e,startIndex:1}]:[]:[{endIndex:0,size:e,startIndex:0}]})),n),Pv(Yv(f,Qv(e=>void 0!==e&&e.length>0&&by(Bv(g).sizeTree)),Gv(e=>{const t=[];let n=e[0],r=0;for(let i=1;i<e.length;i++){const o=e[i];o!==n&&(t.push({endIndex:i-1,size:n,startIndex:r}),n=o,r=i)}return t.push({endIndex:e.length-1,size:n,startIndex:r}),t})),n),Pv(Yv(s,ey(u,d),Qv(([,e,t])=>void 0!==e&&void 0!==t),Gv(([e,t,n])=>{const r=[];for(let i=0;i<e.length;i++){const o=e[i],a=e[i+1];r.push({startIndex:o,endIndex:o,size:t}),void 0!==a&&r.push({startIndex:o+1,endIndex:a-1,size:n})}return r})),n);const w=iy(Yv(n,ey(g),Xv(({sizes:e},[t,n])=>({changed:n!==e,sizes:n}),{changed:!1,sizes:m}),Gv(e=>e.changed)));Zv(Yv(l,Xv((e,t)=>({diff:e.prev-t,prev:t}),{diff:0,prev:0}),Gv(e=>e.diff)),e=>{const{groupIndices:n}=Bv(g);if(e>0)jv(t,!0),jv(o,e+$y(e,n));else if(e<0){const t=Bv(v);t.length>0&&(e-=$y(-e,t)),jv(a,e)}}),Zv(Yv(l,ey(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},dy.ERROR)});const b=iy(o);Pv(Yv(o,ey(g),Gv(([e,t])=>{const n=t.groupIndices.length>0,r=[],i=t.lastSize;if(n){const n=Ey(t.sizeTree,0);let o=0,a=0;for(;o<e;){const e=t.groupIndices[a],l=t.groupIndices.length===a+1?1/0:t.groupIndices[a+1]-e-1;r.push({endIndex:e,size:n,startIndex:e}),r.push({endIndex:e+1+l-1,size:i,startIndex:e+1}),a++,o+=l+1}const l=Hy(t.sizeTree);return o!==e&&l.shift(),l.reduce((t,{k:n,v:r})=>{let i=t.ranges;return 0!==t.prevSize&&(i=[...t.ranges,{endIndex:n+e-1,size:t.prevSize,startIndex:t.prevIndex}]),{prevIndex:n+e,prevSize:r,ranges:i}},{prevIndex:e,prevSize:0,ranges:r}).ranges}return Hy(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=iy(Yv(a,ey(g,C),Gv(([e,{offsetTree:t},n])=>Gy(-e,t,n))));return Pv(Yv(a,ey(g,C),Gv(([e,t,n])=>{if(t.groupIndices.length>0){if(by(t.sizeTree))return t;let r=xy();const i=Bv(v);let o=0,a=0,l=0;for(;o<-e;){l=i[a];const e=i[a+1]-l-1;a++,o+=e+1}if(r=Hy(t.sizeTree).reduce((t,{k:n,v:r})=>Ay(t,Math.max(0,n+e),r),r),o!==-e){r=Ay(r,0,Ey(t.sizeTree,l));r=Ay(r,1,My(t.sizeTree,1-e)[1])}return{...t,sizeTree:r,...ew(t.offsetTree,0,r,n)}}{const r=Hy(t.sizeTree).reduce((t,{k:n,v:r})=>Ay(t,Math.max(0,n+e),r),xy());return{...t,sizeTree:r,...ew(t.offsetTree,0,r,n)}}})),g),{beforeUnshiftWith:b,data:p,defaultItemSize:d,firstItemIndex:l,fixedItemSize:c,fixedGroupSize:u,gap:C,groupIndices:s,heightEstimates:f,itemSize:h,listRefresh:w,shiftWith:a,shiftWithOffset:E,sizeRanges:n,sizes:g,statefulTotalCount:i,totalCount:r,trackItemSizes:y,unshiftWith:o}},Dv(fy,By),{singleton:!0});function ow(e){return e.reduce((e,t)=>(e.groupIndices.push(e.totalCount),e.totalCount+=t+1,e),{groupIndices:[],totalCount:0})}const aw=oy(([{groupIndices:e,sizes:t,totalCount:n},{headerHeight:r,scrollTop:i}])=>{const o=ry(),a=ry(),l=iy(Yv(o,Gv(ow)));return Pv(Yv(l,Gv(e=>e.totalCount)),n),Pv(Yv(l,Gv(e=>e.groupIndices)),e),Pv(Yv(ly(i,t,r),Qv(([e,t])=>qy(t)),Gv(([e,t,n])=>My(t.groupOffsetTree,Math.max(e-n,0),"v")[0]),Wv(),Gv(e=>[e])),a),{groupCounts:o,topItemsIndexes:a}},Dv(iw,vy)),lw=oy(([{log:e}])=>{const t=ty(!1),n=iy(Yv(t,Qv(e=>e),Wv()));return Zv(t,t=>{t&&Bv(e)("props updated",{},dy.DEBUG)}),{didMount:n,propsReady:t}},Dv(fy),{singleton:!0}),sw=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function cw(e){const t="number"==typeof e?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!sw)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const dw=oy(([{gap:e,listRefresh:t,sizes:n,totalCount:r},{fixedFooterHeight:i,fixedHeaderHeight:o,footerHeight:a,headerHeight:l,scrollingInProgress:s,scrollTo:c,smoothScrollTargetReached:d,viewportHeight:u},{log:f}])=>{const h=ry(),p=ry(),C=ty(0);let m=null,g=null,v=null;function y(){m&&(m(),m=null),v&&(v(),v=null),g&&(clearTimeout(g),g=null),jv(s,!1)}return Pv(Yv(h,ey(n,u,r,C,l,a,f),ey(e,o,i),Gv(([[e,n,r,i,o,a,l,c],u,f,C])=>{const w=cw(e),{align:b,behavior:E,offset:M}=w,A=i-1,x=Yy(w,n,A);let L=Gy(x,n.offsetTree,u)+a;"end"===b?(L+=f+My(n.sizeTree,x)[1]-r+C,x===A&&(L+=l)):"center"===b?L+=(f+My(n.sizeTree,x)[1]-r+C)/2:L-=o,M&&(L+=M);const k=t=>{y(),t?(c("retrying to scroll to",{location:e},dy.DEBUG),jv(h,e)):(jv(p,!0),c("list did not change, scroll successful",{},dy.DEBUG))};if(y(),"smooth"===E){let e=!1;v=Zv(t,t=>{e=e||t}),m=Fv(d,()=>{k(e)})}else m=Fv(Yv(t,function(e){return t=>{const n=setTimeout(()=>{t(!1)},e);return e=>{e&&(t(!0),clearTimeout(n))}}}(150)),k);return g=setTimeout(()=>{y()},1200),jv(s,!0),c("scrolling from index to",{behavior:E,index:x,top:L},dy.DEBUG),{behavior:E,top:L}})),c),{scrollTargetReached:p,scrollToIndex:h,topListHeight:C}},Dv(iw,vy,fy),{singleton:!0});function uw(e,t){0==e?t():requestAnimationFrame(()=>{uw(e-1,t)})}function fw(e,t){const n=t-1;return"number"==typeof e?e:"LAST"===e.index?n:e.index}const hw=oy(([{defaultItemSize:e,listRefresh:t,sizes:n},{scrollTop:r},{scrollTargetReached:i,scrollToIndex:o},{didMount:a}])=>{const l=ty(!0),s=ty(0),c=ty(!0);return Pv(Yv(a,ey(s),Qv(([e,t])=>!!t),Kv(!1)),l),Pv(Yv(a,ey(s),Qv(([e,t])=>!!t),Kv(!1)),c),Zv(Yv(ly(t,a),ey(l,n,e,c),Qv(([[,e],t,{sizeTree:n},r,i])=>e&&(!by(n)||zv(r))&&!t&&!i),ey(s)),([,e])=>{Fv(i,()=>{jv(c,!0)}),uw(4,()=>{Fv(r,()=>{jv(l,!0)}),jv(o,e)})}),{initialItemFinalLocationReached:c,initialTopMostItemIndex:s,scrolledToInitialItem:l}},Dv(iw,vy,dw,lw),{singleton:!0});function pw(e,t){return Math.abs(e-t)<1.01}const Cw="up",mw="down",gw={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},vw=oy(([{footerHeight:e,headerHeight:t,scrollBy:n,scrollContainerState:r,scrollTop:i,viewportHeight:o}])=>{const a=ty(!1),l=ty(!0),s=ry(),c=ry(),d=ty(4),u=ty(0),f=ny(Yv(cy(Yv(sy(i),Jv(1),Kv(!0)),Yv(sy(i),Jv(1),Kv(!1),Uv(100))),Wv()),!1),h=ny(Yv(cy(Yv(n,Kv(!0)),Yv(n,Kv(!1),Uv(200))),Wv()),!1);Pv(Yv(ly(sy(i),sy(u)),Gv(([e,t])=>e<=t),Wv()),l),Pv(Yv(l,$v(50)),c);const p=iy(Yv(ly(r,sy(o),sy(t),sy(e),sy(d)),Xv((e,[{scrollHeight:t,scrollTop:n},r,i,o,a])=>{const l={scrollHeight:t,scrollTop:n,viewportHeight:r};if(n+r-t>-a){let t,r;return n>e.state.scrollTop?(t="SCROLLED_DOWN",r=e.state.scrollTop-n):(t="SIZE_DECREASED",r=e.state.scrollTop-n||e.scrollTopDelta),{atBottom:!0,atBottomBecause:t,scrollTopDelta:r,state:l}}let s;return s=l.scrollHeight>e.state.scrollHeight?"SIZE_INCREASED":r<e.state.viewportHeight?"VIEWPORT_HEIGHT_DECREASING":n<e.state.scrollTop?"SCROLLING_UPWARDS":"NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:s,state:l}},gw),Wv((e,t)=>e&&e.atBottom===t.atBottom))),C=ny(Yv(r,Xv((e,{scrollHeight:t,scrollTop:n,viewportHeight:r})=>{if(pw(e.scrollHeight,t))return{changed:!1,jump:0,scrollHeight:t,scrollTop:n};{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}}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),Qv(e=>e.changed),Gv(e=>e.jump)),0);Pv(Yv(p,Gv(e=>e.atBottom)),a),Pv(Yv(a,$v(50)),s);const m=ty(mw);Pv(Yv(r,Gv(({scrollTop:e})=>e),Wv(),Xv((e,t)=>Bv(h)?{direction:e.direction,prevScrollTop:t}:{direction:t<e.prevScrollTop?Cw:mw,prevScrollTop:t},{direction:mw,prevScrollTop:0}),Gv(e=>e.direction)),m),Pv(Yv(r,$v(50),Kv("none")),m);const g=ty(0);return Pv(Yv(f,Qv(e=>!e),Kv(0)),g),Pv(Yv(i,$v(100),ey(f),Qv(([e,t])=>t),Xv(([e,t],[n])=>[t,n],[0,0]),Gv(([e,t])=>t-e)),g),{atBottomState:p,atBottomStateChange:s,atBottomThreshold:d,atTopStateChange:c,atTopThreshold:u,isAtBottom:a,isAtTop:l,isScrolling:f,lastJumpDueToItemResize:C,scrollDirection:m,scrollVelocity:g}},Dv(vy)),yw="top",ww="bottom",bw="none";function Ew(e,t,n){return"number"==typeof e?n===Cw&&t===yw||n===mw&&t===ww?e:0:n===Cw?t===yw?e.main:e.reverse:t===ww?e.main:e.reverse}function Mw(e,t){var n;return"number"==typeof e?e:null!=(n=e[t])?n:0}const Aw=oy(([{deviation:e,fixedHeaderHeight:t,headerHeight:n,scrollTop:r,viewportHeight:i}])=>{const o=ry(),a=ty(0),l=ty(0),s=ty(0),c=ny(Yv(ly(sy(r),sy(i),sy(n),sy(o,Ry),sy(s),sy(a),sy(t),sy(e),sy(l)),Gv(([e,t,n,[r,i],o,a,l,s,c])=>{const d=e-s,u=a+l,f=Math.max(n-d,0);let h=bw;const p=Mw(c,yw),C=Mw(c,ww);return r-=s,i+=n+l,(r+=n+l)>e+u-p&&(h=Cw),(i-=s)<e-f+t+C&&(h=mw),h!==bw?[Math.max(d-n-Ew(o,yw,h)-p,0),d-f-l+t+Ew(o,ww,h)+C]:null}),Qv(e=>null!=e),Wv(Ry)),[0,0]);return{increaseViewportBy:l,listBoundary:o,overscan:s,topListHeight:a,visibleRange:c}},Dv(vy),{singleton:!0});const xw={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function Lw(e,t,n,r,i,o){const{lastIndex:a,lastOffset:l,lastSize:s}=i;let c=0,d=0;if(e.length>0){c=e[0].offset;const t=e[e.length-1];d=t.offset+t.size}const u=n-a,f=c,h=l+u*s+(u-1)*r-d;return{bottom:d,firstItemIndex:o,items:Hw(e,i,o),offsetBottom:h,offsetTop:c,top:f,topItems:Hw(t,i,o),topListHeight:t.reduce((e,t)=>t.size+e,0),totalCount:n}}function kw(e,t,n,r,i,o){let a=0;if(n.groupIndices.length>0)for(const t of n.groupIndices){if(t-a>=e)break;a++}const l=e+a,s=fw(t,l);return Lw(Array.from({length:l}).map((e,t)=>({data:o[t+s],index:t+s,offset:0,size:0})),[],l,i,n,r)}function Hw(e,t,n){if(0===e.length)return[];if(!qy(t))return e.map(e=>({...e,index:e.index+n,originalIndex:e.index}));const r=e[0].index,i=e[e.length-1].index,o=[],a=Ly(t.groupOffsetTree,r,i);let l,s=0;for(const r of e){let e;(!l||l.end<r.index)&&(l=a.shift(),s=t.groupIndices.indexOf(l.start)),e=r.index===l.start?{index:s,type:"group"}:{groupIndex:s,index:r.index-(s+1)+n},o.push({...e,data:r.data,offset:r.offset,originalIndex:r.index,size:r.size})}return o}function Sw(e,t){var n;return void 0===e?0:"number"==typeof e?e:null!=(n=e[t])?n:0}const _w=oy(([{data:e,firstItemIndex:t,gap:n,sizes:r,totalCount:i},o,{listBoundary:a,topListHeight:l,visibleRange:s},{initialTopMostItemIndex:c,scrolledToInitialItem:d},{topListHeight:u},f,{didMount:h},{recalcInProgress:p}])=>{const C=ty([]),m=ty(0),g=ry(),v=ty(0);Pv(o.topItemsIndexes,C);const y=ny(Yv(ly(h,p,sy(s,Ry),sy(i),sy(r),sy(c),d,sy(C),sy(t),sy(n),sy(v),e),Qv(([e,t,,n,,,,,,,,r])=>{const i=r&&r.length!==n;return e&&!t&&!i}),Gv(([,,[e,t],n,r,i,o,a,l,s,c,d])=>{var u,f,h,p;const C=r,{offsetTree:g,sizeTree:v}=C,y=Bv(m);if(0===n)return{...xw,totalCount:n};if(0===e&&0===t)return 0===y?{...xw,totalCount:n}:kw(y,i,r,l,s,d||[]);if(by(v))return y>0?null:Lw(function(e,t,n){if(qy(t)){const r=Ky(e,t);return[{index:My(t.groupOffsetTree,r)[0],offset:0,size:0},{data:null==n?void 0:n[0],index:r,offset:0,size:0}]}return[{data:null==n?void 0:n[0],index:e,offset:0,size:0}]}(fw(i,n),C,d),[],n,s,C,l);const w=[];if(a.length>0){const e=a[0],t=a[a.length-1];let n=0;for(const r of Ly(v,e,t)){const i=r.value,o=Math.max(r.start,e),a=Math.min(r.end,t);for(let e=o;e<=a;e++)w.push({data:null==d?void 0:d[e],index:e,offset:n,size:i}),n+=i}}if(!o)return Lw([],w,n,s,C,l);const b=a.length>0?a[a.length-1]+1:0,E=Xy(g,e,t,b);if(0===E.length)return null;const M=n-1,A=Iv([],n=>{for(const r of E){const i=r.value;let o=i.offset,a=r.start;const l=i.size;if(i.offset<e){a+=Math.floor((e-i.offset+s)/(l+s));const t=a-r.start;o+=t*l+t*s}a<b&&(o+=(b-a)*l,a=b);const c=Math.min(r.end,M);for(let e=a;e<=c&&!(o>=t);e++)n.push({data:null==d?void 0:d[e],index:e,offset:o,size:l}),o+=l+s}}),x=Sw(c,yw),L=Sw(c,ww);if(A.length>0&&(x>0||L>0)){const e=A[0],t=A[A.length-1];if(x>0&&e.index>b){const t=Math.min(x,e.index-b),n=[];let r=e.offset;for(let i=e.index-1;i>=e.index-t;i--){const t=null!=(f=null==(u=Ly(v,i,i)[0])?void 0:u.value)?f:e.size;r-=t+s,n.unshift({data:null==d?void 0:d[i],index:i,offset:r,size:t})}A.unshift(...n)}if(L>0&&t.index<M){const e=Math.min(L,M-t.index);let n=t.offset+t.size+s;for(let r=t.index+1;r<=t.index+e;r++){const e=null!=(p=null==(h=Ly(v,r,r)[0])?void 0:h.value)?p:t.size;A.push({data:null==d?void 0:d[r],index:r,offset:n,size:e}),n+=e+s}}}return Lw(A,w,n,s,C,l)}),Qv(e=>null!==e),Wv()),xw);Pv(Yv(e,Qv(zv),Gv(e=>null==e?void 0:e.length)),i),Pv(Yv(y,Gv(e=>e.topListHeight)),u),Pv(u,l),Pv(Yv(y,Gv(e=>[e.top,e.bottom])),a),Pv(Yv(y,Gv(e=>e.items)),g);const w=iy(Yv(y,Qv(({items:e})=>e.length>0),ey(i,e),Qv(([{items:e},t])=>e[e.length-1].originalIndex===t-1),Gv(([,e,t])=>[e-1,t]),Wv(Ry),Gv(([e])=>e))),b=iy(Yv(y,$v(200),Qv(({items:e,topItems:t})=>e.length>0&&e[0].originalIndex===t.length),Gv(({items:e})=>e[0].index),Wv())),E=iy(Yv(y,Qv(({items:e})=>e.length>0),Gv(({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}}),Wv(jy)));return{endReached:w,initialItemCount:m,itemsRendered:g,listState:y,minOverscanItemCount:v,rangeChanged:E,startReached:b,topItemsIndexes:C,...f}},Dv(iw,aw,Aw,hw,dw,vw,lw,By),{singleton:!0}),Vw=oy(([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:n,headerHeight:r},{listState:i}])=>{const o=ry(),a=ny(Yv(ly(n,e,r,t,i),Gv(([e,t,n,r,i])=>e+t+n+r+i.offsetBottom+i.bottom)),0);return Pv(sy(a),o),{totalListHeight:a,totalListHeightChanged:o}},Dv(vy,_w),{singleton:!0}),Ow=oy(([{viewportHeight:e},{totalListHeight:t}])=>{const n=ty(!1);return{alignToBottom:n,paddingTopAddition:ny(Yv(ly(n,e,t),Qv(([e])=>e),Gv(([,e,t])=>Math.max(0,e-t)),$v(0),Wv()),0)}},Dv(vy,Vw),{singleton:!0}),zw=oy(()=>({context:ty(null)})),Nw=({itemBottom:e,itemTop:t,locationParams:{align:n,behavior:r,...i},viewportBottom:o,viewportTop:a})=>t<a?{...i,align:null!=n?n:"start",behavior:r}:e>o?{...i,align:null!=n?n:"end",behavior:r}:null,Iw=oy(([{gap:e,sizes:t,totalCount:n},{fixedFooterHeight:r,fixedHeaderHeight:i,headerHeight:o,scrollingInProgress:a,scrollTop:l,viewportHeight:s},{scrollToIndex:c}])=>{const d=ry();return Pv(Yv(d,ey(t,s,n,o,i,r,l),ey(e),Gv(([[e,t,n,r,i,o,l,s],c])=>{const{align:d,behavior:u,calculateViewLocation:f=Nw,done:h,...p}=e,C=Yy(e,t,r-1),m=Gy(C,t.offsetTree,c)+i+o,g=f({itemBottom:m+My(t.sizeTree,C)[1],itemTop:m,locationParams:{align:d,behavior:u,...p},viewportBottom:s+n-l,viewportTop:s+o});return g?h&&Fv(Yv(a,Qv(e=>!e),Jv(Bv(a)?1:2)),h):null==h||h(),g}),Qv(e=>null!==e)),c),{scrollIntoView:d}},Dv(iw,vy,dw,_w,fy),{singleton:!0});function Tw(e){return!!e&&("smooth"===e?"smooth":"auto")}const Dw=oy(([{listRefresh:e,totalCount:t,fixedItemSize:n,data:r},{atBottomState:i,isAtBottom:o},{scrollToIndex:a},{scrolledToInitialItem:l},{didMount:s,propsReady:c},{log:d},{scrollingInProgress:u},{context:f},{scrollIntoView:h}])=>{const p=ty(!1),C=ry();let m=null;function g(e){jv(a,{align:"end",behavior:e,index:"LAST"})}function v(e){const t=Fv(i,t=>{e&&!t.atBottom&&"SIZE_INCREASED"===t.notAtBottomBecause&&!m&&(Bv(d)("scrolling to bottom due to increased size",{},dy.DEBUG),g("auto"))});setTimeout(t,100)}Zv(Yv(ly(Yv(sy(t),Jv(1)),s),ey(sy(p),o,l,u),Gv(([[e,t],n,r,i,o])=>{let a=t&&i,l="auto";return a&&(l=((e,t)=>"function"==typeof e?Tw(e(t)):t&&Tw(e))(n,r||o),a=a&&!!l),{followOutputBehavior:l,shouldFollow:a,totalCount:e}}),Qv(({shouldFollow:e})=>e)),({followOutputBehavior:t,totalCount:r})=>{m&&(m(),m=null),Bv(n)?requestAnimationFrame(()=>{Bv(d)("following output to ",{totalCount:r},dy.DEBUG),g(t)}):m=Fv(e,()=>{Bv(d)("following output to ",{totalCount:r},dy.DEBUG),g(t),m=null})}),Zv(Yv(ly(sy(p),t,c),Qv(([e,,t])=>e&&t),Xv(({value:e},[,t])=>({refreshed:e===t,value:t}),{refreshed:!1,value:0}),Qv(({refreshed:e})=>e),ey(p,t)),([,e])=>{Bv(l)&&v(!1!==e)}),Zv(C,()=>{v(!1!==Bv(p))}),Zv(ly(sy(p),i),([e,t])=>{e&&!t.atBottom&&"VIEWPORT_HEIGHT_DECREASING"===t.notAtBottomBecause&&g("auto")});const y=ty(null),w=ry();return Pv(cy(Yv(sy(r),Gv(e=>{var t;return null!=(t=null==e?void 0:e.length)?t:0})),Yv(sy(t))),w),Zv(Yv(ly(Yv(w,Jv(1)),s),ey(sy(y),l,u,f),Gv(([[e,t],n,r,i,o])=>t&&r&&(null==n?void 0:n({context:o,totalCount:e,scrollingInProgress:i}))),Qv(e=>!!e),$v(0)),t=>{m&&(m(),m=null),Bv(n)?requestAnimationFrame(()=>{Bv(d)("scrolling into view",{}),jv(h,t)}):m=Fv(e,()=>{Bv(d)("scrolling into view",{}),jv(h,t),m=null})}),{autoscrollToBottom:C,followOutput:p,scrollIntoViewOnChange:y}},Dv(iw,vw,dw,hw,lw,fy,vy,zw,Iw)),Zw=oy(([{data:e,firstItemIndex:t,gap:n,sizes:r},{initialTopMostItemIndex:i},{initialItemCount:o,listState:a},{didMount:l}])=>(Pv(Yv(l,ey(o),Qv(([,e])=>0!==e),ey(i,r,t,n,e),Gv(([[,e],t,n,r,i,o=[]])=>kw(e,t,n,r,i,o))),a),{}),Dv(iw,hw,_w,lw),{singleton:!0}),jw=oy(([{didMount:e},{scrollTo:t},{listState:n}])=>{const r=ty(0);return Zv(Yv(e,ey(r),Qv(([,e])=>0!==e),Gv(([,e])=>({top:e}))),e=>{Fv(Yv(n,Jv(1),Qv(e=>e.items.length>1)),()=>{requestAnimationFrame(()=>{jv(t,e)})})}),{initialScrollTop:r}},Dv(lw,vy,_w),{singleton:!0}),Rw=oy(([{scrollVelocity:e}])=>{const t=ty(!1),n=ry(),r=ty(!1);return Pv(Yv(e,ey(r,t,n),Qv(([e,t])=>!!t),Gv(([e,t,n,r])=>{const{enter:i,exit:o}=t;if(n){if(o(e,r))return!1}else if(i(e,r))return!0;return n}),Wv()),t),Zv(Yv(ly(t,e,n),ey(r)),([[e,t,n],r])=>{e&&r&&r.change&&r.change(t,n)}),{isSeeking:t,scrollSeekConfiguration:r,scrollSeekRangeChanged:n,scrollVelocity:e}},Dv(vw),{singleton:!0}),Bw=oy(([{scrollContainerState:e,scrollTo:t}])=>{const n=ry(),r=ry(),i=ry(),o=ty(!1),a=ty(void 0);return Pv(Yv(ly(n,r),Gv(([{scrollHeight:e,scrollTop:t,viewportHeight:n},{offsetTop:r}])=>({scrollHeight:e,scrollTop:Math.max(0,t-r),viewportHeight:n}))),e),Pv(Yv(t,ey(r),Gv(([e,{offsetTop:t}])=>({...e,top:e.top+t}))),i),{customScrollParent:a,useWindowScroll:o,windowScrollContainerState:n,windowScrollTo:i,windowViewportRect:r}},Dv(vy)),Pw=oy(([{sizeRanges:e,sizes:t},{headerHeight:n,scrollTop:r},{initialTopMostItemIndex:i},{didMount:o},{useWindowScroll:a,windowScrollContainerState:l,windowViewportRect:s}])=>{const c=ry(),d=ty(void 0),u=ty(null),f=ty(null);return Pv(l,u),Pv(s,f),Zv(Yv(c,ey(t,r,a,u,f,n)),([e,t,n,r,i,o,a])=>{const l=function(e){return Hy(e).map(({k:e,v:t},n,r)=>{const i=r[n+1];return{endIndex:i?i.k-1:1/0,size:t,startIndex:e}})}(t.sizeTree);r&&null!==i&&null!==o&&(n=i.scrollTop-o.offsetTop),e({ranges:l,scrollTop:n-=a})}),Pv(Yv(d,Qv(zv),Gv(Fw)),i),Pv(Yv(o,ey(d),Qv(([,e])=>void 0!==e),Wv(),Gv(([,e])=>e.ranges)),e),{getState:c,restoreStateFrom:d}},Dv(iw,vy,hw,lw,Bw));function Fw(e){return{align:"start",index:0,offset:e.scrollTop}}const Uw=oy(([{topItemsIndexes:e}])=>{const t=ty(0);return Pv(Yv(t,Qv(e=>e>=0),Gv(e=>Array.from({length:e}).map((e,t)=>t))),e),{topItemCount:t}},Dv(_w));function qw(e){let t,n=!1;return()=>(n||(n=!0,t=e()),t)}const Ww=qw(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),Qw=oy(([{deviation:e,scrollBy:t,scrollingInProgress:n,scrollTop:r},{isAtBottom:i,isScrolling:o,lastJumpDueToItemResize:a,scrollDirection:l},{listState:s},{beforeUnshiftWith:c,gap:d,shiftWithOffset:u,sizes:f},{log:h},{recalcInProgress:p}])=>{const C=iy(Yv(s,ey(a),Xv(([,e,t,n],[{bottom:r,items:i,offsetBottom:o,totalCount:a},l])=>{const s=r+o;let c=0;return t===a&&e.length>0&&i.length>0&&(0===i[0].originalIndex&&0===e[0].originalIndex||(c=s-n,0!==c&&(c+=l))),[c,i,a,s]},[0,[],0,0]),Qv(([e])=>0!==e),ey(r,l,n,i,h,p),Qv(([,e,t,n,,,r])=>!r&&!n&&0!==e&&t===Cw),Gv(([[e],,,,,t])=>(t("Upward scrolling compensation",{amount:e},dy.DEBUG),e))));function m(n){n>0?(jv(t,{behavior:"auto",top:-n}),jv(e,0)):(jv(e,0),jv(t,{behavior:"auto",top:-n}))}return Zv(Yv(C,ey(e,o)),([t,n,r])=>{r&&Ww()?jv(e,n-t):m(-t)}),Zv(Yv(ly(ny(o,!1),e,p),Qv(([e,t,n])=>!e&&!n&&0!==t),Gv(([e,t])=>t),$v(1)),m),Pv(Yv(u,Gv(e=>({top:-e}))),t),Zv(Yv(c,ey(f,d),Gv(([e,{groupIndices:t,lastSize:n,sizeTree:r},i])=>{function o(e){return e*(n+i)}if(0===t.length)return o(e);{let n=0;const i=Ey(r,0);let a=0,l=0;for(;a<e;){a++,n+=i;let r=t.length===l+1?1/0:t[l+1]-t[l]-1;a+r>e&&(n-=i,r=e-a+1),a+=r,n+=o(r),l++}return n}})),n=>{jv(e,n),requestAnimationFrame(()=>{jv(t,{top:n}),requestAnimationFrame(()=>{jv(e,0),jv(p,!1)})})}),{deviation:e}},Dv(vy,vw,_w,iw,fy,By)),Gw=oy(([e,t,n,r,i,o,a,l,s,c,d])=>({...e,...t,...n,...r,...i,...o,...a,...l,...s,...c,...d}),Dv(Aw,Zw,lw,Rw,Vw,jw,Ow,Bw,Iw,fy,zw)),Kw=oy(([{data:e,defaultItemSize:t,firstItemIndex:n,fixedItemSize:r,fixedGroupSize:i,gap:o,groupIndices:a,heightEstimates:l,itemSize:s,sizeRanges:c,sizes:d,statefulTotalCount:u,totalCount:f,trackItemSizes:h},{initialItemFinalLocationReached:p,initialTopMostItemIndex:C,scrolledToInitialItem:m},g,v,y,w,{scrollToIndex:b},E,{topItemCount:M},{groupCounts:A},x])=>{const{listState:L,minOverscanItemCount:k,topItemsIndexes:H,rangeChanged:S,..._}=w;return Pv(S,x.scrollSeekRangeChanged),Pv(Yv(x.windowViewportRect,Gv(e=>e.visibleHeight)),g.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:n,fixedItemHeight:r,fixedGroupHeight:i,gap:o,groupCounts:A,heightEstimates:l,initialItemFinalLocationReached:p,initialTopMostItemIndex:C,scrolledToInitialItem:m,sizeRanges:c,topItemCount:M,topItemsIndexes:H,totalCount:f,...y,groupIndices:a,itemSize:s,listState:L,minOverscanItemCount:k,scrollToIndex:b,statefulTotalCount:u,trackItemSizes:h,rangeChanged:S,..._,...x,...g,sizes:d,...v}},Dv(iw,hw,vy,Pw,Dw,_w,dw,Qw,Uw,aw,Gw));function Yw(e,t){const n={},r={};let i=0;const o=e.length;for(;i<o;)r[e[i]]=1,i+=1;for(const e in t)Object.hasOwn(r,e)||(n[e]=t[e]);return n}const Xw=typeof document<"u"?i.useLayoutEffect:i.useEffect;function Jw(t,n,r){const o=Object.keys(n.required||{}),a=Object.keys(n.optional||{}),l=Object.keys(n.methods||{}),s=Object.keys(n.events||{}),c=i.createContext({});function d(e,t){e.propsReady&&jv(e.propsReady,!1);for(const r of o){jv(e[n.required[r]],t[r])}for(const r of a)if(r in t){jv(e[n.optional[r]],t[r])}e.propsReady&&jv(e.propsReady,!0)}function u(e){return s.reduce((t,r)=>(t[r]=function(e){let t,n;const r=()=>null==t?void 0:t();return function(i,o){switch(i){case 1:return o?n===o?void 0:(r(),n=o,t=Zv(e,o),t):(r(),Nv);case 2:return r(),void(n=null)}}}(e[n.events[r]]),t),{})}const f=i.forwardRef((f,h)=>{const{children:p,...C}=f,[m]=i.useState(()=>Iv(function(e){const t=new Map,n=({constructor:e,dependencies:r,id:i,singleton:o})=>{if(o&&t.has(i))return t.get(i);const a=e(r.map(e=>n(e)));return o&&t.set(i,a),a};return n(e)}(t),e=>{d(e,C)})),[g]=i.useState(Ov(u,m));Xw(()=>{for(const e of s)e in C&&Zv(g[e],C[e]);return()=>{Object.values(g).map(Rv)}},[C,g,m]),Xw(()=>{d(m,C)}),i.useImperativeHandle(h,Sv(function(e){return l.reduce((t,r)=>(t[r]=t=>{jv(e[n.methods[r]],t)},t),{})}(m)));const v=r;return e(c.Provider,{value:m,children:r?e(v,{...Yw([...o,...a,...s],C),children:p}):p})}),h=i.version.startsWith("18")?e=>{const t=i.useContext(c)[e],n=i.useCallback(e=>Zv(t,e),[t]);return i.useSyncExternalStore(n,()=>Bv(t),()=>Bv(t))}:e=>{const t=i.useContext(c)[e],[n,r]=i.useState(Ov(Bv,t));return Xw(()=>Zv(t,e=>{e!==n&&r(Sv(e))}),[t,n]),n};return{Component:f,useEmitter:(e,t)=>{const n=i.useContext(c)[e];Xw(()=>Zv(n,t),[t,n])},useEmitterValue:h,usePublisher:e=>{const t=i.useContext(c);return i.useCallback(n=>{jv(t[e],n)},[t,e])}}}const $w=i.createContext(void 0),eb=i.createContext(void 0),tb=typeof document<"u"?i.useLayoutEffect:i.useEffect;function nb(e){return"self"in e}function rb(e,t,n,r=Nv,o,a){const l=i.useRef(null),s=i.useRef(null),c=i.useRef(null),d=i.useCallback(n=>{let r,i,o;const l=n.target;if(function(e){return"body"in e}(l)||nb(l)){const e=nb(l)?l:l.defaultView;o=a?e.scrollX:e.scrollY,r=a?e.document.documentElement.scrollWidth:e.document.documentElement.scrollHeight,i=a?e.innerWidth:e.innerHeight}else o=a?l.scrollLeft:l.scrollTop,r=a?l.scrollWidth:l.scrollHeight,i=a?l.offsetWidth:l.offsetHeight;const d=()=>{e({scrollHeight:r,scrollTop:Math.max(o,0),viewportHeight:i})};n.suppressFlushSync?d():M.flushSync(d),null!==s.current&&(o===s.current||o<=0||o===r-i)&&(s.current=null,t(!0),c.current&&(clearTimeout(c.current),c.current=null))},[e,t,a]);return i.useEffect(()=>{const e=o||l.current;return r(o||l.current),d({suppressFlushSync:!0,target:e}),e.addEventListener("scroll",d,{passive:!0}),()=>{r(null),e.removeEventListener("scroll",d)}},[l,d,n,r,o]),{scrollByCallback:function(e){a&&(e={behavior:e.behavior,left:e.top}),l.current.scrollBy(e)},scrollerRef:l,scrollToCallback:function(n){const r=l.current;if(!r||(a?"offsetWidth"in r&&0===r.offsetWidth:"offsetHeight"in r&&0===r.offsetHeight))return;const i="smooth"===n.behavior;let o,d,u;nb(r)?(d=Math.max(Uy(r.document.documentElement,a?"width":"height"),a?r.document.documentElement.scrollWidth:r.document.documentElement.scrollHeight),o=a?r.innerWidth:r.innerHeight,u=a?window.scrollX:window.scrollY):(d=r[a?"scrollWidth":"scrollHeight"],o=Uy(r,a?"width":"height"),u=r[a?"scrollLeft":"scrollTop"]);const f=d-o;if(n.top=Math.ceil(Math.max(Math.min(f,n.top),0)),pw(o,d)||n.top===u)return e({scrollHeight:d,scrollTop:u,viewportHeight:o}),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,a&&(n={behavior:n.behavior,left:n.top}),r.scrollTo(n)}}}const ib="-webkit-sticky",ob="sticky",ab=qw(()=>{if(typeof document>"u")return ob;const e=document.createElement("div");return e.style.position=ib,e.style.position===ib?ib:ob});function lb(e){return e}const sb=oy(()=>{const e=ty(e=>`Item ${e}`),t=ty(e=>`Group ${e}`),n=ty({}),r=ty(lb),i=ty("div"),o=ty(Nv),a=(e,t=null)=>ny(Yv(n,Gv(t=>t[e]),Wv()),t);return{components:n,computeItemKey:r,EmptyPlaceholder:a("EmptyPlaceholder"),FooterComponent:a("Footer"),GroupComponent:a("Group","div"),groupContent:t,HeaderComponent:a("Header"),HeaderFooterTag:i,ItemComponent:a("Item","div"),itemContent:e,ListComponent:a("List","div"),ScrollerComponent:a("Scroller","div"),scrollerRef:o,ScrollSeekPlaceholder:a("ScrollSeekPlaceholder"),TopItemListComponent:a("TopItemList")}}),cb=oy(([e,t])=>({...e,...t}),Dv(Kw,sb)),db=({height:t})=>e("div",{style:{height:t}}),ub={overflowAnchor:"none",position:ab(),zIndex:1},fb={overflowAnchor:"none"},hb={...fb,display:"inline-block",height:"100%"},pb=i.memo(function({showTopList:t=!1}){const n=Vb("listState"),r=Ob("sizeRanges"),o=Vb("useWindowScroll"),a=Vb("customScrollParent"),l=Ob("windowScrollContainerState"),s=Ob("scrollContainerState"),c=a||o?l:s,d=Vb("itemContent"),u=Vb("context"),f=Vb("groupContent"),h=Vb("trackItemSizes"),p=Vb("itemSize"),m=Vb("log"),g=Ob("gap"),v=Vb("horizontalDirection"),{callbackRef:y}=Cy(r,p,h,t?Nv:c,m,g,a,v,Vb("skipAnimationFrameInResizeObserver")),[w,b]=i.useState(0);_b("deviation",e=>{w!==e&&b(e)});const E=Vb("EmptyPlaceholder"),M=Vb("ScrollSeekPlaceholder")||db,A=Vb("ListComponent"),x=Vb("ItemComponent"),L=Vb("GroupComponent"),k=Vb("computeItemKey"),H=Vb("isSeeking"),S=Vb("groupIndices").length>0,_=Vb("alignToBottom"),V=Vb("initialItemFinalLocationReached"),O=t?{}:{boxSizing:"border-box",...v?{display:"inline-block",height:"100%",marginLeft:0!==w?w:_?"auto":0,paddingLeft:n.offsetTop,paddingRight:n.offsetBottom,whiteSpace:"nowrap"}:{marginTop:0!==w?w:_?"auto":0,paddingBottom:n.offsetBottom,paddingTop:n.offsetTop},...V?{}:{visibility:"hidden"}};return!t&&0===n.totalCount&&E?e(E,{...yb(E,u)}):e(A,{...yb(A,u),"data-testid":t?"virtuoso-top-item-list":"virtuoso-item-list",ref:y,style:O,children:(t?n.topItems:n.items).map(e=>{const t=e.originalIndex,r=k(t+n.firstItemIndex,e.data,u);return H?C(M,{...yb(M,u),height:e.size,index:e.index,key:r,type:e.type||"item",..."group"===e.type?{}:{groupIndex:e.groupIndex}}):"group"===e.type?C(L,{...yb(L,u),"data-index":t,"data-item-index":e.index,"data-known-size":e.size,key:r,style:ub},f(e.index,u)):C(x,{...yb(x,u),...wb(x,e.data),"data-index":t,"data-item-group-index":e.groupIndex,"data-item-index":e.index,"data-known-size":e.size,key:r,style:v?hb:fb},S?d(e.index,e.groupIndex,e.data,u):d(e.index,e.data,u))})})}),Cb={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},mb={outline:"none",overflowX:"auto",position:"relative"},gb=e=>({height:"100%",position:"absolute",top:0,width:"100%",...e?{display:"flex",flexDirection:"column"}:{}}),vb={position:ab(),top:0,width:"100%",zIndex:1};function yb(e,t){if("string"!=typeof e)return{context:t}}function wb(e,t){return{item:"string"==typeof e?void 0:t}}const bb=i.memo(function(){const t=Vb("HeaderComponent"),n=Ob("headerHeight"),r=Vb("HeaderFooterTag"),o=hy(i.useMemo(()=>e=>{n(Uy(e,"height"))},[n]),!0,Vb("skipAnimationFrameInResizeObserver")),a=Vb("context");return t?e(r,{ref:o,children:e(t,{...yb(t,a)})}):null}),Eb=i.memo(function(){const t=Vb("FooterComponent"),n=Ob("footerHeight"),r=Vb("HeaderFooterTag"),o=hy(i.useMemo(()=>e=>{n(Uy(e,"height"))},[n]),!0,Vb("skipAnimationFrameInResizeObserver")),a=Vb("context");return t?e(r,{ref:o,children:e(t,{...yb(t,a)})}):null});function Mb({useEmitter:t,useEmitterValue:n,usePublisher:r}){return i.memo(function({children:i,style:o,context:a,...l}){const s=r("scrollContainerState"),c=n("ScrollerComponent"),d=r("smoothScrollTargetReached"),u=n("scrollerRef"),f=n("horizontalDirection")||!1,{scrollByCallback:h,scrollerRef:p,scrollToCallback:C}=rb(s,d,c,u,void 0,f);return t("scrollTo",C),t("scrollBy",h),e(c,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:p,style:{...f?mb:Cb,...o},tabIndex:0,...l,...yb(c,a),children:i})})}function Ab({useEmitter:t,useEmitterValue:n,usePublisher:r}){return i.memo(function({children:o,style:a,context:l,...s}){const c=r("windowScrollContainerState"),d=n("ScrollerComponent"),u=r("smoothScrollTargetReached"),f=n("totalListHeight"),h=n("deviation"),p=n("customScrollParent"),C=i.useRef(null),m=n("scrollerRef"),{scrollByCallback:g,scrollerRef:v,scrollToCallback:y}=rb(c,u,d,m,p);return tb(()=>{var e;return v.current=p||(null==(e=C.current)?void 0:e.ownerDocument.defaultView),()=>{v.current=null}},[v,p]),t("windowScrollTo",y),t("scrollBy",g),e(d,{ref:C,"data-virtuoso-scroller":!0,style:{position:"relative",...a,...0!==f?{height:f+h}:{}},...s,...yb(d,l),children:o})})}const xb=({children:t})=>{const n=i.useContext($w),r=Ob("viewportHeight"),o=Ob("fixedItemHeight"),a=Vb("alignToBottom"),l=Vb("horizontalDirection"),s=hy(i.useMemo(()=>Vv(r,e=>Uy(e,l?"width":"height")),[r,l]),!0,Vb("skipAnimationFrameInResizeObserver"));return i.useEffect(()=>{n&&(r(n.viewportHeight),o(n.itemHeight))},[n,r,o]),e("div",{"data-viewport-type":"element",ref:s,style:gb(a),children:t})},Lb=({children:t})=>{const n=i.useContext($w),r=Ob("windowViewportRect"),o=Ob("fixedItemHeight"),a=Vb("customScrollParent"),l=gy(r,a,Vb("skipAnimationFrameInResizeObserver")),s=Vb("alignToBottom");return i.useEffect(()=>{n&&(o(n.itemHeight),r({offsetTop:0,visibleHeight:n.viewportHeight,visibleWidth:100}))},[n,r,o]),e("div",{"data-viewport-type":"window",ref:l,style:gb(s),children:t})},kb=({children:t})=>{const n=Vb("TopItemListComponent")||"div",r=Vb("headerHeight"),i={...vb,marginTop:`${r}px`},o=Vb("context");return e(n,{style:i,...yb(n,o),children:t})},Hb=i.memo(function(t){const r=Vb("useWindowScroll"),i=Vb("topItemsIndexes").length>0,o=Vb("customScrollParent"),a=Vb("context");return n(o||r?Nb:zb,{...t,context:a,children:[i&&e(kb,{children:e(pb,{showTopList:!0})}),n(o||r?Lb:xb,{children:[e(bb,{}),e(pb,{}),e(Eb,{})]})]})}),{Component:Sb,useEmitter:_b,useEmitterValue:Vb,usePublisher:Ob}=Jw(cb,{required:{},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"}},Hb),zb=Mb({useEmitter:_b,useEmitterValue:Vb,usePublisher:Ob}),Nb=Ab({useEmitter:_b,useEmitterValue:Vb,usePublisher:Ob}),Ib=Sb,Tb=oy(()=>{const e=ty(e=>n("td",{children:["Item $",e]})),t=ty(null),r=ty(e=>n("td",{colSpan:1e3,children:["Group ",e]})),i=ty(null),o=ty(null),a=ty({}),l=ty(lb),s=ty(Nv),c=(e,t=null)=>ny(Yv(a,Gv(t=>t[e]),Wv()),t);return{components:a,computeItemKey:l,context:t,EmptyPlaceholder:c("EmptyPlaceholder"),FillerRow:c("FillerRow"),fixedFooterContent:o,fixedHeaderContent:i,itemContent:e,groupContent:r,ScrollerComponent:c("Scroller","div"),scrollerRef:s,ScrollSeekPlaceholder:c("ScrollSeekPlaceholder"),TableBodyComponent:c("TableBody","tbody"),TableComponent:c("Table","table"),TableFooterComponent:c("TableFoot","tfoot"),TableHeadComponent:c("TableHead","thead"),TableRowComponent:c("TableRow","tr"),GroupComponent:c("Group","tr")}});Dv(Kw,Tb),ab();const Db={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},Zb={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:jb,floor:Rb,max:Bb,min:Pb,round:Fb}=Math;function Ub(e,t,n){return Array.from({length:t-e+1}).map((t,r)=>({data:null===n?null:n[r+e],index:r+e}))}function qb(e,t){return e&&e.width===t.width&&e.height===t.height}function Wb(e,t){return e&&e.column===t.column&&e.row===t.row}const Qb=oy(([{increaseViewportBy:e,listBoundary:t,overscan:n,visibleRange:r},{footerHeight:i,headerHeight:o,scrollBy:a,scrollContainerState:l,scrollTo:s,scrollTop:c,smoothScrollTargetReached:d,viewportHeight:u},f,h,{didMount:p,propsReady:C},{customScrollParent:m,useWindowScroll:g,windowScrollContainerState:v,windowScrollTo:y,windowViewportRect:w},b])=>{const E=ty(0),M=ty(0),A=ty(Db),x=ty({height:0,width:0}),L=ty({height:0,width:0}),k=ry(),H=ry(),S=ty(0),_=ty(null),V=ty({column:0,row:0}),O=ry(),z=ry(),N=ty(!1),I=ty(0),T=ty(!0),D=ty(!1),Z=ty(!1);Zv(Yv(p,ey(I),Qv(([e,t])=>!!t)),()=>{jv(T,!1)}),Zv(Yv(ly(p,T,L,x,I,D),Qv(([e,t,n,r,,i])=>e&&!t&&0!==n.height&&0!==r.height&&!i)),([,,,,e])=>{jv(D,!0),uw(1,()=>{jv(k,e)}),Fv(Yv(c),()=>{jv(t,[0,0]),jv(T,!0)})}),Pv(Yv(z,Qv(e=>null!=e&&e.scrollTop>0),Kv(0)),M),Zv(Yv(p,ey(z),Qv(([,e])=>null!=e)),([,e])=>{e&&(jv(x,e.viewport),jv(L,e.item),jv(V,e.gap),e.scrollTop>0&&(jv(N,!0),Fv(Yv(c,Jv(1)),e=>{jv(N,!1)}),jv(s,{top:e.scrollTop})))}),Pv(Yv(x,Gv(({height:e})=>e)),u),Pv(Yv(ly(sy(x,qb),sy(L,qb),sy(V,(e,t)=>e&&e.column===t.column&&e.row===t.row),sy(c)),Gv(([e,t,n,r])=>({gap:n,item:t,scrollTop:r,viewport:e}))),O),Pv(Yv(ly(sy(E),r,sy(V,Wb),sy(L,qb),sy(x,qb),sy(_),sy(M),sy(N),sy(T),sy(I)),Qv(([,,,,,,,e])=>!e),Gv(([e,[t,n],r,i,o,a,l,,s,c])=>{const{column:d,row:u}=r,{height:f,width:h}=i,{width:p}=o;if(0===l&&(0===e||0===p))return Db;if(0===h){const t=fw(c,e);return function(e){return{...Zb,items:e}}(Ub(t,t+Math.max(l-1,0),a))}const C=Gb(p,h,d);let m,g;s?0===t&&0===n&&l>0?(m=0,g=l-1):(m=C*Rb((t+u)/(f+u)),g=C*jb((n+u)/(f+u))-1,g=Pb(e-1,Bb(g,C-1)),m=Pb(g,Bb(0,m))):(m=0,g=-1);const v=Ub(m,g,a),{bottom:y,top:w}=Kb(o,r,i,v),b=jb(e/C);return{bottom:y,itemHeight:f,items:v,itemWidth:h,offsetBottom:b*f+(b-1)*u-y,offsetTop:w,top:w}})),A),Pv(Yv(_,Qv(e=>null!==e),Gv(e=>e.length)),E),Pv(Yv(ly(x,L,A,V),Qv(([e,t,{items:n}])=>n.length>0&&0!==t.height&&0!==e.height),Gv(([e,t,{items:n},r])=>{const{bottom:i,top:o}=Kb(e,r,t,n);return[o,i]}),Wv(Ry)),t);const j=ty(!1);Pv(Yv(c,ey(j),Gv(([e,t])=>t||0!==e)),j);const R=iy(Yv(ly(A,E),Qv(([{items:e}])=>e.length>0),ey(j),Qv(([[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}),Gv(([[,e]])=>e-1),Wv())),B=iy(Yv(sy(A),Qv(({items:e})=>e.length>0&&0===e[0].index),Kv(0),Wv())),P=iy(Yv(sy(A),ey(N),Qv(([{items:e},t])=>e.length>0&&!t),Gv(([{items:e}])=>({endIndex:e[e.length-1].index,startIndex:e[0].index})),Wv(jy),$v(0)));Pv(P,h.scrollSeekRangeChanged),Pv(Yv(k,ey(x,L,E,V),Gv(([e,t,n,r,i])=>{const o=cw(e),{align:a,behavior:l,offset:s}=o;let c=o.index;"LAST"===c&&(c=r-1),c=Bb(0,c,Pb(r-1,c));let d=Yb(t,i,n,c);return"end"===a?d=Fb(d-t.height+n.height):"center"===a&&(d=Fb(d-t.height/2+n.height/2)),s&&(d+=s),{behavior:l,top:d}})),s);const F=ny(Yv(A,Gv(e=>e.offsetBottom+e.bottom)),0);return Pv(Yv(w,Gv(e=>({height:e.visibleHeight,width:e.visibleWidth}))),x),{customScrollParent:m,data:_,deviation:S,footerHeight:i,gap:V,headerHeight:o,increaseViewportBy:e,initialItemCount:M,itemDimensions:L,overscan:n,restoreStateFrom:z,scrollBy:a,scrollContainerState:l,scrollHeight:H,scrollTo:s,scrollToIndex:k,scrollTop:c,smoothScrollTargetReached:d,totalCount:E,useWindowScroll:g,viewportDimensions:x,windowScrollContainerState:v,windowScrollTo:y,windowViewportRect:w,...h,gridState:A,horizontalDirection:Z,initialTopMostItemIndex:I,totalListHeight:F,...f,endReached:R,propsReady:C,rangeChanged:P,startReached:B,stateChanged:O,stateRestoreInProgress:N,...b}},Dv(Aw,vy,vw,Rw,lw,Bw,fy));function Gb(e,t,n){return Bb(1,Rb((e+n)/(Rb(t)+n)))}function Kb(e,t,n,r){const{height:i}=n;if(void 0===i||0===r.length)return{bottom:0,top:0};const o=Yb(e,t,n,r[0].index);return{bottom:Yb(e,t,n,r[r.length-1].index)+i,top:o}}function Yb(e,t,n,r){const i=Gb(e.width,n.width,t.column),o=Rb(r/i),a=o*n.height+Bb(0,o-1)*t.row;return a>0?a+t.row:a}const Xb=oy(()=>{const e=ty(e=>`Item ${e}`),t=ty({}),n=ty(null),r=ty("virtuoso-grid-item"),i=ty("virtuoso-grid-list"),o=ty(lb),a=ty("div"),l=ty(Nv),s=(e,n=null)=>ny(Yv(t,Gv(t=>t[e]),Wv()),n),c=ty(!1),d=ty(!1);return Pv(sy(d),c),{components:t,computeItemKey:o,context:n,FooterComponent:s("Footer"),HeaderComponent:s("Header"),headerFooterTag:a,itemClassName:r,ItemComponent:s("Item","div"),itemContent:e,listClassName:i,ListComponent:s("List","div"),readyStateChanged:c,reportReadyState:d,ScrollerComponent:s("Scroller","div"),scrollerRef:l,ScrollSeekPlaceholder:s("ScrollSeekPlaceholder","div")}}),Jb=oy(([e,t])=>({...e,...t}),Dv(Qb,Xb)),$b=i.memo(function(){const t=aE("gridState"),n=aE("listClassName"),r=aE("itemClassName"),o=aE("itemContent"),a=aE("computeItemKey"),l=aE("isSeeking"),s=lE("scrollHeight"),c=aE("ItemComponent"),d=aE("ListComponent"),u=aE("ScrollSeekPlaceholder"),f=aE("context"),h=lE("itemDimensions"),p=lE("gap"),m=aE("log"),g=aE("stateRestoreInProgress"),v=lE("reportReadyState"),y=hy(i.useMemo(()=>e=>{const t=e.parentElement.parentElement.scrollHeight;s(t);const n=e.firstChild;if(n){const{height:e,width:t}=n.getBoundingClientRect();h({height:e,width:t})}p({column:dE("column-gap",getComputedStyle(e).columnGap,m),row:dE("row-gap",getComputedStyle(e).rowGap,m)})},[s,h,p,m]),!0,!1);return tb(()=>{t.itemHeight>0&&t.itemWidth>0&&v(!0)},[t]),g?null:e(d,{className:n,ref:y,...yb(d,f),"data-testid":"virtuoso-item-list",style:{paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},children:t.items.map(n=>{const i=a(n.index,n.data,f);return l?e(u,{...yb(u,f),height:t.itemHeight,index:n.index,width:t.itemWidth},i):C(c,{...yb(c,f),className:r,"data-index":n.index,key:i},o(n.index,n.data,f))})})}),eE=i.memo(function(){const t=aE("HeaderComponent"),n=lE("headerHeight"),r=aE("headerFooterTag"),o=hy(i.useMemo(()=>e=>{n(Uy(e,"height"))},[n]),!0,!1),a=aE("context");return t?e(r,{ref:o,children:e(t,{...yb(t,a)})}):null}),tE=i.memo(function(){const t=aE("FooterComponent"),n=lE("footerHeight"),r=aE("headerFooterTag"),o=hy(i.useMemo(()=>e=>{n(Uy(e,"height"))},[n]),!0,!1),a=aE("context");return t?e(r,{ref:o,children:e(t,{...yb(t,a)})}):null}),nE=({children:t})=>{const n=i.useContext(eb),r=lE("itemDimensions"),o=lE("viewportDimensions"),a=hy(i.useMemo(()=>e=>{o(e.getBoundingClientRect())},[o]),!0,!1);return i.useEffect(()=>{n&&(o({height:n.viewportHeight,width:n.viewportWidth}),r({height:n.itemHeight,width:n.itemWidth}))},[n,o,r]),e("div",{ref:a,style:gb(!1),children:t})},rE=({children:t})=>{const n=i.useContext(eb),r=lE("windowViewportRect"),o=lE("itemDimensions"),a=aE("customScrollParent"),l=gy(r,a,!1);return i.useEffect(()=>{n&&(o({height:n.itemHeight,width:n.itemWidth}),r({offsetTop:0,visibleHeight:n.viewportHeight,visibleWidth:n.viewportWidth}))},[n,r,o]),e("div",{ref:l,style:gb(!1),children:t})},iE=i.memo(function({...t}){const r=aE("useWindowScroll"),i=aE("customScrollParent"),o=i||r?cE:sE,a=i||r?rE:nE,l=aE("context");return e(o,{...t,...yb(o,l),children:n(a,{children:[e(eE,{}),e($b,{}),e(tE,{})]})})}),{useEmitter:oE,useEmitterValue:aE,usePublisher:lE}=Jw(Jb,{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"}},iE),sE=Mb({useEmitter:oE,useEmitterValue:aE,usePublisher:lE}),cE=Ab({useEmitter:oE,useEmitterValue:aE,usePublisher:lE});function dE(e,t,n){return"normal"!==t&&!(null!=t&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,dy.WARN),"normal"===t?0:parseInt(null!=t?t:"0",10)}const uE=({optionsList:r=[],onSelectVariable:i,dropdownPosition:o,position:a="relative",width:l,height:s="160px",zIndex:c=9999})=>{const d={LOCAL:"local_variable_icon",GLOBAL:"global_variable_icon",PROJECT_ENVIRONMENT:"project_env_variable_icon"},u=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":d[e.type||""]||"":"step_group_variable"},f=e=>"_startforloop"===e?.type?`FLV_for:${e?.name}`:"DATAPROVIDER"===e?.type?`${e?.dpName}:${e?.varname}`:e?.name;function h(e){if(e.endsWith("px")){const t=parseInt(e.slice(0,-2),10);return isNaN(t)?212:t-66}return 212}return e("div",{className:z("ff-variable-dropdown",a),style:o?{top:o.top+30,left:o.left-30,width:l,height:s,zIndex:c}:{width:l,height:s,zIndex:c},children:G(r)?e("div",{className:"ff-variable-option ff-variable-option-no-data",children:e(F,{as:"span",fontSize:12,children:"No Option"})}):e(Ib,{totalCount:r.length,itemContent:o=>{const a=r[o];return a?e("div",{className:"ff-variable-data",onMouseDown:()=>i(a),children:l.endsWith("px")?n(t,{children:[e(K,{title:oe(f(a),h(l),"pixel")?f(a):"",style:{width:`${h(l)}px`},children:e(F,{as:"span",fontSize:12,className:"ff-truncated_text",children:f(a)})}),e(P,{name:u(a),height:24,width:24,hoverEffect:!0})]}):e(Hv,{option:a})},`${a.id}-${o}`):null},style:{height:s,fontSize:"12px"},overscan:10,fixedItemHeight:32})})},fE=({data:r=[],width:i,height:o,lineChartWidth:a,yAxisLabel:s,xAxisLabel:d,yAxisValueColor:u,xAxisColor:f,yAxisColor:h,yAxisLabelColor:p,textSize:C,fontWeight:m,numberSize:g,chartName:v,shouldCenterSinglePoint:y,xAxisLabelGap:w=16,isLeftOverflow:b=!1})=>{const E=40,M=i-80,A=o-80,[x,L]=c(!1),[k,H]=c({cursorX:null,hoverValues:{},dotPositions:{},tooltip:{visible:!1,left:0,top:0},currentXValue:null});l(()=>{const e=()=>{L(!1),H(e=>({...e,tooltip:{...e.tooltip,visible:!1}}))};return window.addEventListener("scroll",e,!0),()=>window.removeEventListener("scroll",e,!0)},[]);if(!(r&&r.length>0&&r?.some(e=>Array.isArray(e?.data)&&e?.data?.length>0))){const t=[];for(let e=6;e>=0;e--){const n=new Date;n.setDate(n.getDate()-e);const r=n?.toLocaleDateString("en-US",{day:"numeric",month:"short"});t.push(r)}const r=1024,a=6,l=7;return n("div",{className:"ff-line-chart-text",style:{width:i+20+w,gap:w},children:[e("div",{className:"ff-line-chart-yAxisLabel-warpper",style:{height:o},children:e(F,{className:"ff-line-chart-yAxisLabel",fontSize:C,fontWeight:"semi-bold",children:s})}),e("div",{className:"ff-line-chart-svg",children:e("svg",{height:o,width:i,className:"ff-line-chart-svg",children:n("g",{transform:"translate(40, 40)",children:[e("line",{x1:0,y1:A,x2:M,y2:A,stroke:f,strokeWidth:1}),e("text",{x:M/2.1,y:A+E/1.2,textAnchor:"middle",fill:p,className:"ff-line-chart-x-axis-label",style:{fontSize:C,fontWeight:m},children:d}),t.map((t,n)=>e("text",{x:n*(M/(l-1)),y:A+15,textAnchor:0===n?"start":n===l-1?"end":"middle",fill:h,className:"ff--line-chart-x-line-data",style:{fontSize:g},children:t},t)),Array.from({length:a}).map((t,n)=>{const i=n*r/(a-1),o=i/1024;return e("text",{x:-10,y:A-i*A/r,textAnchor:"end",fill:u,className:"ff-line-chart-y-axis-text",style:{fontSize:g},children:o?.toFixed(1)},`y-${n}`)})]})})})]})}function S(e){if(!isNaN(e))return parseFloat(e);const t=at,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 _=r?.[0]?.data?.[0]?.hasOwnProperty("date")&&r?.[0]?.data?.[0]?.hasOwnProperty("totalMemory"),V="date",O=_?"totalMemory":"value",z=e=>{const t=r?.[0]?.data?.length;if(1===t)return y?M/2:M;const n=r[0].data.findIndex(t=>t[V]===e);return-1===n?0:n/(t-1)*M},N=Math.max(...r?.flatMap(e=>e?.data?.map(e=>S(e[O]))),5),I=e=>{if("memory"===v){const t=Math.max(...r?.flatMap(e=>e?.data?.map(e=>S(e[O]))));return A-e*A/(t>1024?t:1024)}return A-e*A/(0===N?1024:N)},T=e=>{if(1===e?.length){const t=e?.[0],n=z(t[V]),r=I(S(t[O]));return`M 0 ${I(0)} L ${n} ${r}`}return e?.reduce((t,n,r)=>{const i=z(n[V]),o=I(S(n[O]));if(0===r)return`M ${i} ${o}`;const a=e[r-1],l=a?z(a[V]):0;return`${t} C ${l+(i-l)/2} ${a?I(S(a[O])):0}, ${i-(i-l)/2} ${o}, ${i} ${o}`},"")},D=r[0].data;return n("div",{className:"ff-line-chart-text",style:{width:i+20+w,gap:w},children:[e("div",{className:"ff-line-chart-yAxisLabel-warpper",style:{height:o},children:e(F,{className:"ff-line-chart-yAxisLabel",fontSize:C,fontWeight:"semi-bold",children:s})}),n("div",{className:"ff-line-chart-svg",children:[e("svg",{height:o,width:i,onMouseMove:e=>{const t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left-E;if(e.clientY-t.top-E>A)return L(!1),void H({cursorX:null,hoverValues:{},dotPositions:{},tooltip:{visible:!1,left:0,top:0},currentXValue:null});let i={hoverValues:{},dotPositions:{}},o=null;r.forEach((e,t)=>{const r=e.data.reduce((e,t)=>{const r=Math.abs(n-z(t[V]));return r<e.distance?{point:t,distance:r}:e},{point:null,distance:1/0}).point;r&&(o=r[V],i.hoverValues[t]=((e,t=2)=>{let n="";if("string"==typeof e){const t=e.match(rt),r=e.match(it);t&&(e=parseFloat(t[0])),r&&(n=r[0])}const r=Math.pow(10,t);return`${Math.ceil(e*r)/r} ${n}`.trim()})(r[O]),i.dotPositions[t]={x:z(r[V]),y:I(S(r[O]))})}),L(!0),H({cursorX:n,hoverValues:i.hoverValues,dotPositions:i.dotPositions,currentXValue:o,tooltip:o?{visible:!0,left:e.clientX+10,top:e.clientY-20}:{visible:!1,left:0,top:0}})},onMouseLeave:()=>H({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:A,strokeWidth:2}),e("line",{x1:0,y1:A,x2:M,y2:A,stroke:f,strokeWidth:1}),e("text",{x:M/2.1,y:A+E/1.2,textAnchor:"middle",fill:p,className:"ff-line-chart-x-axis-label",style:{fontSize:C,fontWeight:m},children:d}),r.map((r,i)=>{return!1!==r.show?n("g",{children:[e("path",{d:T(r.data),fill:"none",stroke:r.color,strokeWidth:a,opacity:(o=r.data,o.every(e=>0===S(e[O]))?.5:1)}),k.dotPositions[i]&&n(t,{children:[e("line",{x1:k.dotPositions[i].x,y1:0,x2:k.dotPositions[i].x,y2:A,stroke:"gray",strokeWidth:.5,strokeDasharray:"4"}),e("circle",{cx:k.dotPositions[i].x,cy:k.dotPositions[i].y,r:5,fill:"white",stroke:r.color,strokeWidth:a,style:{transition:"cx 0.1s, cy 0.1s"}}),e("line",{x1:0,y1:k.dotPositions[i].y,x2:M,y2:k.dotPositions[i].y,stroke:"gray",strokeWidth:.5,strokeDasharray:"4"})]})]},i):null;var o}),(()=>{if(1===D.length){const t=D?.[0];return e("text",{x:y?M/2:M,y:A+15,textAnchor:y?"middle":"end",fill:h,className:"ff--line-chart-x-line-data",style:{fontSize:g},children:null!=t[V]?String(t[V]):""},String(t[V]))}if(D.length<7)return D.map(t=>e("text",{x:z(t[V]),y:A+15,textAnchor:"middle",fill:h,className:"ff--line-chart-x-line-data",style:{fontSize:g},children:null!=t[V]?String(t[V]):""},String(t[V])));{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),o=D[i];return e("text",{x:r*t,y:A+15,fill:h,className:"ff--line-chart-x-line-data",style:{fontSize:g},children:null!=o?.[V]?String(o?.[V]):""},String(o?.[V]))})}})(),(()=>{if("memory"===v){const t=Math.max(N,1024);return Array.from({length:6}).map((n,r)=>{const i=r*t/5,o=i/1024;return e("text",{x:-10,y:I(i),textAnchor:"end",fill:u,className:"ff-line-chart-y-axis-text",style:{fontSize:g},children:o.toFixed(1)},`y-${r}`)})}return Array.from({length:6}).map((t,n)=>{const r=n*N/5;return e("text",{x:-10,y:I(r),textAnchor:"end",fill:u,className:"ff-line-chart-y-axis-text",style:{fontSize:g},children:r.toFixed(0)},`y-${n}`)})})()]})}),x&&k.tooltip.visible&&n("div",{className:"ff-line-chart-tooltip",style:{left:b&&k.tooltip.left/2>i/1.75?k.tooltip.left-180:k.tooltip.left,top:k.tooltip.top},children:[e("div",{className:"ff-line-chart-date",children:k.currentXValue}),Object.entries(k.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))]})]})]})},hE=({onClose:t,top:r="100px",left:i="0px",className:o,description:a="Download and Install the fireflink client to run the script",onClick:s=()=>{},optionZIndex:c=10000001})=>{l(()=>{const e=e=>{"Escape"===e.key&&t?.()};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[t]);return n("div",{className:`ff-download-client-wrapper ${o}`,style:{top:r,left:i,zIndex:c},children:[n("div",{className:"ff-download-client-header-wrapper",children:[e("div",{className:"ff-download-client-hollow-triangle"}),e(F,{fontWeight:"semi-bold",lineHeight:"32px",className:"ff-download-client-header-text",children:"Download client"}),e(P,{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(F,{as:"div",color:"var(--download-client-content-text-color)",fontWeight:"semi-bold",textAlign:"center",lineHeight:"26px",children:a}),e(F,{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(P,{name:t,height:36,width:36})},t))})]})]})},pE=({legendName:t,height:r,width:i,children:o})=>e("div",{className:"ff_fieldSet_container",children:n("fieldset",{className:"ff_fieldSet",style:{height:r,width:i},children:[e("legend",{className:"ff_legend_container",children:e(F,{color:"var(--license_header_text_color)",fontSize:8,lineHeight:"12px",children:t})}),e("div",{className:"ff_children_container",children:o})]})}),CE=({onSelectVariable:t,dropdownPosition:n,filteredOptions:r=[],position:i="relative",width:o="100%",zIndex:a,truncateTextValue:l=34})=>e("div",{className:z(`ff-variable-dropdown-container ${i}`),style:n?{top:n.top+30,left:n.left-30,width:o,zIndex:a}:{width:o,zIndex:a},children:G(r)?e("div",{className:"ff-variable-option no-data",children:e(F,{as:"div",children:"No Option",fontSize:14})}):r?.map(n=>e("div",{className:"ff-variable-option",onMouseDown:()=>t(n),children:e(K,{title:oe(n?.name,l,"pixel")?n?.name:"",children:e(F,{children:ie(n?.name,l,"pixel")})})},n?.id))}),mE=o(({label:t="",hashInputValue:r="",setHashInputValue:i,variableList:o=[],placeholder:s="Enter text",onChange:d,onPaste:u,onCreateVariableClick:f,handleClearInput:h,value:p="",dropdownWidth:C="100%",dropdownHeight:m="160px",isHash:g=!1,isOnlyHash:v=!1,dataFiles:y=[],showAddVariableIcon:w=!0,helperText:E="",error:M,autoComplete:A="off",required:x=!1,zIndex:L=9999,truncateTextValue:k=34,formProps:H={},getSelectedVariable:S=()=>{},symbol:_="$",type:V="text",clearIcon:O=!0,inputTitle:N="",onBlur:I,helperTextWidth:T,iconProps:D={isShowIcon:!1,iconName:"",iconToolTipTitle:"",isIconDisable:!1,iconColor:"",onIconClick:()=>{}},...Z},j)=>{const[R,B]=c(!1),[U,q]=c(!1),[W,Q]=c(!1),[Y,X]=c(null),[J,$]=c(0),[ee,te]=c(!1),[ne,re]=c([]),ie=a(null),oe=a(null),[ae,le]=c("auto"),se=D?.isShowIcon;l(()=>{const e=oe.current?.querySelector(".ff-input-container");if(!e)return;const t=new ResizeObserver(e=>{for(let t of e){const e=`${t.contentRect.width}px`;le(e)}});return t.observe(e),()=>{t.disconnect()}},[]),b(j,()=>ie.current),l(()=>{null!==Y&&ie.current&&(ie.current.setSelectionRange(Y,Y),ie.current.focus())},[Y]),l(()=>{g&&B(p.startsWith("#"));const e=y?.find(e=>e.name===p),t=o?.find(e=>e?.name===p);if(p.startsWith("#")&&g){const e=p.slice(1).toLowerCase(),t=y.filter(t=>t.name.toLowerCase().includes(e));re(t),B(!0)}const n=null!==e&&p.startsWith("#"),r=null!==t&&p.startsWith("$"),i=p.length>(t?.name.length||0),a=p.length>0&&!r||p.startsWith("#");v?te(!1):r||n||p.includes("$")||p.includes("#")?(te(!1),a&&te(!0)):i&&!p.includes("$")&&te(!0)},[p]);const ce=()=>{ie.current&&$(ie.current.selectionStart||0)},de=ce,ue=ce;l(()=>{ie.current&&$(ie.current.selectionStart||0)},[p]);const fe=e=>{if(ie.current){const{selectionStart:t,selectionEnd:n}=ie.current,r=`${e.name}`;let o;if(o=g&&"#"===p[0]?e.name+p.slice(n||1):e.name,d){d({target:{value:o}},e),S(e.name)}ie.current.value=o,i?.(e),X((t||0)+r.length),B(!1),q(!0)}};const he=function(e,t,n){let r=!1,i="";const o="}"===p[t-1];if(t<0||t>e.length)return{showDropdown:r,searchString:i};const a=e.lastIndexOf(_,t-1),l=e.indexOf(_,t);if(-1!==a&&(v&&"$"===e[a]?r=!1:t===a+1?(r=!0,i=""):(i=e.slice(a+1,-1===l?void 0:l),t>a+1&&(i=e.slice(a+1,t)),r=!0),U&&o&&(r=!1),(/[{}]/.test(i)||0===t)&&(r=!1,i=""),i)){n.some(e=>e.name.toLowerCase().includes(i.toLowerCase()))||(n=[])}return{showDropdown:r,searchString:i}}(p,J,o),pe=()=>o?.filter(e=>e?.name?.toLowerCase()?.includes(he?.searchString?.toLowerCase()));return n("div",{className:"ff-add-variable-container",children:[n("div",{className:"ff-add-variable-input",ref:oe,children:[e(K,{title:N,style:{width:"100%"},children:e(nn,{...Z,name:"add_variable",ref:ie,type:V,className:z("ff-variable-input-container",{"ff-variable-input-container--show-icon":se}),value:p,onChange:d,onPaste:()=>{te(!0)},variant:"primary",label:t,placeholder:s,onClick:de,onKeyUp:ue,onFocus:()=>Q(!0),onBlur:e=>{(e=>{e.relatedTarget&&e.relatedTarget.closest(".dropdown-container")||Q(!1)})(e),I?.(e)},autoComplete:A,helperText:E,error:M,required:x,helperTextWidth:T,...H})}),!G(p)&&ee&&w&&e("div",{className:"ff-create-variable-container",onClick:f,children:e(F,{fontWeight:"regular",fontSize:"10px",color:"var(--brand-color)",cursor:"pointer",children:"Create Variable"})}),!G(p)&&!v&&e("div",{className:z("ff-cancel-icon-container",{"ff-cancel-icon-container--show-icon":se}),children:O&&e(K,{title:"Cancel",style:{zIndex:99999},children:e(P,{onClick:h,name:"close",height:16,width:16,hoverEffect:!0})})}),se&&e("div",{className:"ff-info-icon-container",children:e(K,{title:se&&!D?.isIconDisable?D?.iconToolTipTitle:"",children:e(P,{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"})})})]}),he?.showDropdown&&W&&e(uE,{position:"absolute",zIndex:L,truncateTextValue:k,width:ae,height:G(pe())?"auto":m,optionsList:pe(),onSelectVariable:fe}),R&&g&&W&&e(CE,{position:"relative",zIndex:L,truncateTextValue:k,width:ae,filteredOptions:ne,onSelectVariable:fe})]})}),gE=({isOpen:t,variableTypesList:r=[],onClose:i,onNameChange:o,onValueChange:a,variableName:s,variableValue:d,onVariableTypeChange:u,selectedVariableType:f,hideValue:h=!1,onHideChange:p,handleSubmit:C,mode:m="create",disabled:g,dataFiles:v=[],truncateTextValue:y=34,isEnterKeySubmit:w=!1})=>{const[b,E]=c(!1),[M,A]=c(""),[x,L]=c(),[k,H]=c(!1),[S,_]=c(!1),[V,O]=c({name:"",value:"",isChecked:!1});l(()=>{t&&"edit"===m&&O({name:s,value:d,isChecked:h})},[]);const z=e=>e&&0!==e.length?" "===e[0]||" "===e[e.length-1]?"Space is not allowed at starting and at the end":Ee.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 N(e){const t=!!e,n=Ee.test(e),r=Vt.test(e),i=e.length>=3&&e.length<=25;return t&&n&&r&&i}l(()=>{const e=z(s);E(!!e),A(e)},[s]),l(()=>{if("edit"!==m)return;const{name:e,value:t,isChecked:n}=V;_(s!==e||d!==t||h!==n)},[m,s,d,h,V]);const I=()=>{!k&&N(s)&&(H(!0),C())};l(()=>{if(!w)return;const e=e=>{if("Enter"===e.key){e.preventDefault();!N(s)||k||"edit"===m&&!S||I()}};return window.addEventListener("keydown",e),()=>{window.removeEventListener("keydown",e)}},[w,s,d,h,k,m,S,f]);return e(X,{zIndex:1350,onClose:i,isOpen:t,title:"create"===m?"Create Variable":"Edit Variable",width:"284px",height:"280px",top:"30%",right:8,isFooterRequired:!0,overlay:!0,footerContent:e(()=>n("div",{className:"ff-create-slider-footer",children:[e(U,{onClick:i,label:"Cancel",variant:"tertiary"}),e(U,{variant:"primary",label:"create"===m?"Create":"Update",type:"submit",onClick:I,disabled:!N(s)||k||"edit"===m&&!S})]}),{}),children:n("div",{className:"ff-create-variable-slider",children:[e("div",{className:"ff-create-variable-slider-input",children:e(nn,{label:"Variable Name",required:!0,type:"text",name:"variableName",value:s||"",onChange:e=>{H(!1),o(e.target.value)},error:b,helperText:M,onBlur:e=>{const t=e.target.value,n=z(t);E(!!n),A(n)}})}),e(ar,{label:"Variable Type",required:!0,onChange:e=>{u(e),H(!1)},selectedOption:f,optionsList:r,optionZIndex:99999,valueAccessor:"label",disabled:"edit"===m}),e(mE,{label:"Variable Value",placeholder:"Enter Variable value or select path using #",isHash:!0,isOnlyHash:!0,zIndex:99999,truncateTextValue:y,dataFiles:v,dropdownWidth:"100%",setHashInputValue:L,hashInputValue:x||{},value:d||"",type:h?"password":"text",onChange:(e,t)=>{const n=e.target.value;a(n,t)},showAddVariableIcon:!1}),n("div",{className:"ff-hide-value-content",children:[e(te,{onChange:e=>p(e.target.checked),name:"hideValue",label:"Hide Value",checked:h,disabled:g}),e(K,{title:"Once the value is hidden, it cannot be undone",children:e(P,{name:"info",width:12,height:12})})]})]})})},vE=({highlightText:t="",tableMeta:r=[],tableData:i=[],accordionType:o="row",noDataContent:a,height:l="100%",withFixedHeader:s=!1,headerType:d,TableAccordionStateIconWidth:u=4,TableAccordionStateIconHeight:f=8})=>{const[h,p]=c(-1),C=(e,t)=>{let n=e[t.accessor];return t.cell?t.cell({value:n,row:e,column:t.accessor}):t.accessor||n&&"object"!=typeof n?n:"--"},m=t=>{const n=t.map((t,n)=>e("table",{className:"ff-accordion-table",cellSpacing:0,children:e("tbody",{className:"ff-table-body",children:e("tr",{className:"ff-table-row",children:r.map((n,r)=>e("td",{className:"ff-table-cell",style:{width:n.width},children:"column"===o&&0===r?"":e(F,{children:C(t,n)})},n.accessor+r))},t.id||n)})},`accordion-table-${n}`));return n};return n("div",{style:{height:l},className:z("ff-accordion-table-container",{"ff-accordion-fixed-header-table":s}),children:[e("table",{cellSpacing:0,className:z("ff-accordion-table",{"ff-accordion-fixed-header":s}),children:e("thead",{children:e("tr",{className:"ff-table-row",children:r.map(t=>e("th",{style:{width:t.width},className:z("ff-table-header",d&&`ff-accordion-table--${d}-bg`),children:e("div",{children:e(F,{fontWeight:"semi-bold",fontSize:12,children:t.header})})},`header-${t.header}`))})})}),"row"===o&&i.map((n,r)=>e($,{highlightText:t,headerTitle:n.title,color:"var(--text-color)",accordionContent:m(n.data),disable:n.disable,disableInfoMessage:n.disableInfoMessage,accordionStateIconName:"arrows_down_icon",AccordionStateIconWidth:u,AccordionStateIconHeight:f},`accordion-row-${r}`)),"column"===o&&i.map((i,o)=>n("div",{className:"column-table-accordion",children:[e("div",{className:"ff-display-flex",children:e(K,{title:i.disable?i?.disableInfoMessage:"string"==typeof i.title&&oe(i.title,r[0]?.width,"pixel")?i.title:"",placement:"bottom-start",children:n("div",{className:`accordion-header ${i.disable&&"accordion-header--disabled"}`,children:[e("div",{className:"header-title",children:e("span",{children:e(F,{children:e(J,{text:ie(i.title,r[0]?.width,"pixel"),highlight:t})})})}),e("div",{className:"accordion-arrow",onClick:()=>{!i.disable&&(e=>{p(e===h?-1:e)})(o)},children:e(P,{name:h===o?"arrows_down_icon":"arrows_right_icon",color:"var(--table-with-accordion-icon-color)",width:u,height:f,hoverEffect:!1})})]})})}),h===o&&e("div",{children:m(i.data)})]},`column-accordion-${o}`)),i.length<=0&&e("div",{className:"no-data-content",style:{height:`calc(${l} - 50px)`},children:a})]})},yE=({progressPercentage:t,totalMemory:r,usedMemory:i,color:o="var(--brand-color)",trackColor:a="#f0f0f0",height:l=10,label:s,labelFontSize:c=12,labelTextColor:d="var(--ff-card-status-text-color)",showPercentage:u=!1,percentageFontSize:f=10,percentageTextColor:h="var(--tooltip-text-color)",progressBarWidth:p="200px"})=>{const C=e=>{const t=e.trim().toLowerCase();if("0"===t)return 0;const n=t.match(/^(\d+(?:\.\d+)?)\s*(kb|mb|gb)$/);if(!n||!n[1])return 0;const r=parseFloat(n[1]),i=n[2];return"gb"===i?1024*r:"kb"===i?r/1024:r};let m=0,g=s;if(void 0!==r&&void 0!==i){const e=C(i),t=C(r);t>0?(m=e/t*100,g=s||i):(m=0,g="0MB")}else m=t||0;const v=Math.max(0,Math.min(m,100));return n("div",{className:"ff-progress-bar-container "+(g?"ff-has-label":""),style:{width:p},children:[e("div",{className:"ff-progress-bar-track",style:{backgroundColor:a,height:`${l}px`},children:e("div",{className:"ff-progress-bar",style:{width:`${v}%`,backgroundColor:o,height:`${l}px`},children:u&&e(F,{className:"ff-progress-bar-percentage",fontSize:f,color:h,children:`${Math.round(v)}%`})})}),g&&e("div",{className:"ff-progress-bar-label",children:e(F,{fontSize:c,color:d,children:e(K,{title:oe(g,10,"count")?g:"",children:ie(g,10,"count")})})})]})},wE=({variant:t="primary",size:n="small",onClick:r,label:i="Choose File",disabled:o=!1,type:l="button",className:s="",style:d={},iconName:f,isChooseFile:h=!1,buttonWidth:p="auto",buttonHeight:C="auto",selectedFile:m={},handleCloseIcon:g,isMandatory:v=!1})=>{const y=a(null),[w,b]=c(0);u(()=>{y.current&&b(y.current.getBoundingClientRect().width-10)},[p]);const E=m?.name||i,M=w?ie(E,w,"pixel"):E,A=!!w&&oe(E,w,"pixel");return e("div",{ref:y,style:{width:p},children:e(K,{title:A?E:"",children:e(U,{variant:t,label:M,type:l,onClick:r,buttonWidth:p,buttonHeight:C,isChooseFile:h,size:n,disabled:o,className:s,iconName:f,style:d,iconPosition:"right",selectedFile:m,handleCloseIcon:g,isMandatory:v})})})},bE=({selected:t="text",handleClick:r,tabList:i})=>{const o=i?.includes("Automation"),a=i?.includes("Manual");return n("div",{className:"ff-script-switch-container",children:[e(K,{title:o?"Automation":"Add Automation",zIndex:1e3,children:e("div",{className:"ff-script-switch-button "+("Automation"===t?"active":""),onClick:()=>r(o?"Automation":"Add Automation"),children:e(P,{name:o?"automation_testcase":"add_testcase",color:"Automation"===t?"var(--primary-button-text-color)":"var(--description-text)"})})}),e(K,{title:a?"Manual":"Add Manual",zIndex:1e3,children:e("div",{className:"ff-script-switch-button "+("Manual"===t?"active":""),onClick:()=>r(a?"Manual":"Add Manual"),children:e(P,{name:a?"manual_testcase":"add_testcase",color:"Manual"===t?"var(--primary-button-text-color)":"var(--description-text)"})})})]})},EE=({selected:t,handleClick:n,tabList:r})=>e("div",{className:"ff-switch-container",children:r.map(r=>e(K,{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(P,{name:r.icon,color:t===r.name?"var(--primary-button-text-color)":"var(--description-text)"})})},r.name))}),ME=({onModalClose:t,MediaSrc:r,fileName:o,onDeleteClick:a,mediaType:s,fileId:d,thumbnailMediaSrc:u,isDelete:f=!0,onExpandClick:h,onDownloadClick:p,isMediaIcon:C=!1,previewOnly:m=!1,iconName:g="video_preview",isDisabled:v=!1})=>{const[y,w]=c(!1),b=i.useRef(null),E=()=>{w(!0),h&&h(d)},M=()=>{t?.(),w(!1)},A=()=>{p&&p(d)};return l(()=>{m&&w(!0)},[m]),n("div",{children:[!m&&(C?e(P,{name:g,hoverEffect:!0,onClick:E,disabled:v}):e(Lv,{mediaSrc:r,mediaType:s,onDownloadClick:A,onDeleteClick:()=>a?.(r),onExpandClick:E,fileName:o,fileId:d,thumbnailMediaSrc:u,isDelete:f})),y&&e($f,{isOpen:y,onClose:M,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(K,{title:"Download File",children:e(P,{name:"download_file_icon",onClick:A,color:"var(--icons-default-color)",className:"header-icons"})}),e(K,{title:"Expand",children:e(P,{name:"expand",onClick:E,color:"var(--icons-default-color)",className:"header-icons"})}),e(K,{title:"close",children:e(P,{name:"close",onClick:M,color:"var(--icons-default-color)",className:"header-icons"})})]}),"image"===s&&e("img",{src:r,alt:"fileName",height:"auto",width:"auto"}),"video"===s&&e("video",{src:r,controls:!0,controlsList:"nodownload",className:"ff-video-preview",ref:b,onCanPlay:()=>{if(b.current){const e=b.current.play();void 0!==e&&e.catch(e=>{console.error("Autoplay failed:",e)})}}})]})})]})},AE=({children:t,orientation:r="",navBarIcons:o=[],mobileHeight:a=448,mobileWidth:l=220,UtilityBar:s,tooltip:c={},background:d,navBarPosition:u="bottom"})=>{const f="portrait"===r,h=f?a:l,p=f?l:a,C=s&&"top"===u,m=s&&"bottom"===u,g=s&&"left"===u;return n("div",{className:["ff-mobileskin-wrapper",f?"portrait":"landscape",g?"ff-side-nav-left":"",C?"navbar-top":"",m?"navbar-bottom":""].filter(Boolean).join(" "),children:[C&&e("div",{className:"ff-nav-bar top-nav-bar",children:o.map(({title:t,name:n,className:r,...i},a)=>{const l=c?.[n]??a;return e(K,{title:c?.[n]||"",placement:"top",children:e("div",{className:`ff-nav-bar-icon ${r||""} ${a===o.length-1?"last-icon":""} ${C?"navbar-top":""}`,children:e(P,{name:n,...i})})},l)})}),e("div",{className:"ff-mobileskin-container",style:{height:h+16,width:p+16},children:e("div",{className:"ff-mobile-container",style:{width:p,height:h,background:d||"transparent"},children:e("div",{className:"ff-mobile-image-container",children:i.isValidElement(t)?t:e("img",{src:t,alt:"Mobile content",style:{width:f?"100%":2.1*l+"px",height:f?"100%":.5*a+"px"}})})})}),s&&m&&e("div",{className:"ff-nav-bar",children:o?.map((t,n)=>{const{title:r,...i}=t;return e("div",{className:`ff-nav-bar-icon ${t?.className||""} ${n===o.length-1?"last-icon":""}`,children:e(K,{title:r,children:e(P,{...i})})},n)})}),s&&g&&e("div",{className:"ff-side-nav-bar",children:o?.map((t,n)=>{const{title:r,...i}=t;return e("div",{className:`ff-sidebar ${t?.className||""} ${n===o.length-1?"last-icon":""}`,children:e(K,{title:r,placement:"bottom",children:e(P,{...i})})},n)})})]})},xE=o(({width:t=300,height:r=40,iconHeight:i=16,iconWidth:o=16,placeholder:l="Enter text",iconName:s="right_arrow_filled_icon",iconPosition:c="left",borderRadius:d=4,autoFocus:u=!1,value:f="",iconColor:h="var(--brand-color)",tooltipTitle:p="send",submitPrompt:C,onPromptChange:m,onBlur:g,onFocus:v,disableInput:y,isAdditionalIcon:w=!1,additionalIconName:b,additionIconToolTip:E,onAdditionalIconClick:M},A)=>{const x=a(null);ce([{key:"Enter",action:()=>L()}],x);const L=e=>{f&&C?.(f.trim())};return n("div",{className:z("ff-prompt-container",{"icon-left":"left"===c,"icon-right":"left"!==c}),style:{width:`${t}px`,height:`${r}px`,borderRadius:d},ref:x,children:[e(K,{placement:"top",title:p,children:e(P,{name:s,className:"ff-prompt-icon",height:i,width:o,onClick:C,color:h,disabled:G(f)})}),e("input",{ref:A,className:"ff-prompt-input",type:"text",placeholder:l,autoFocus:u,onChange:m,onFocus:v,onBlur:g,value:f,readOnly:y}),w&&b&&e(K,{placement:"top",title:E,children:e(P,{name:b,className:"ff-prompt-icon additional-icon",height:i,width:o,onClick:M})})]})}),LE=({content:t,isVisible:n,maxWidth:r=300,onClick:i,isClickable:o=!0,arrowPosition:a="left"})=>e("div",{onClick:i,style:{width:`${r}px`,"--triangle-position":r-4+"px"},className:z("ff-chat-msg-box",{visible:n,hidden:!n,pointer:o,default:!o,"chat-arrow-left":"left"===a,"chat-arrow-right":"left"!==a}),children:e("div",{className:z("content",`arrow-${a}`),children:e(F,{children:t})})}),kE=({iconName:r,iconPosition:{top:i,left:o,bottom:a,right:l},hoverIconPosition:{top:s,left:d,bottom:u,right:f},modalPosition:{top:h,left:p,bottom:C,right:m},modalWidth:g,modalHeight:v,headerContent:y="Header Content",footerContent:w="Footer Content",iconWidth:b,iconHeight:E,modalHeading:M="Ask Fia",children:x,onClearChat:L})=>{const[k,H]=c(!1),[S,_]=c(!1);return n(t,{children:[n("div",{style:{top:void 0!==i?`${i}px`:void 0,left:void 0!==o?`${o}px`:void 0,bottom:void 0!==a?`${a}px`:void 0,right:void 0!==l?`${l}px`:void 0},className:"ff-dynamic-icon-container",children:[e(P,{className:"ff-dynamic-icon",name:r,onClick:()=>{_(e=>!e),setTimeout(()=>H(e=>!e),10)},height:E,width:b}),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(P,{name:"ask_fia_icon",height:32,width:82})})]}),S&&A(e("div",{className:z("ff-dynamic-modal",{open:k}),style:{top:void 0!==h?`${h}px`:void 0,left:void 0!==p?`${p}px`:void 0,bottom:void 0!==C?`${C}px`:void 0,right:void 0!==m?`${m}px`:void 0,position:"fixed",height:v,width:g},children:n("div",{className:"ff-dynamic-modal-content",children:[y&&e("div",{className:"ff-dynamic-modal-header",children:n("div",{className:"header-container",children:[n("div",{className:"header-left",children:[e(P,{height:16,width:16,name:"fia_icon"}),e(F,{fontWeight:"medium",children:M})]}),n("div",{className:"header-right",children:[e("span",{className:"action",children:e(K,{title:"Clear chat",placement:"bottom",children:e(P,{height:16,width:16,name:"delete",color:"var(--tooltip-text-color)",onClick:L})})}),e("span",{className:"action",children:e(K,{title:"Close",placement:"bottom",children:e(P,{height:16,width:16,name:"close",color:"var(--tooltip-text-color)",onClick:()=>(H(!1),void setTimeout(()=>_(!1),300))})})})]})]})}),e("div",{className:"ff-dynamic-modal-body",children:x}),w&&e("div",{className:"ff-dynamic-modal-footer",children:w})]})}),document.body)]})},HE=o(({iconName:r,hoverTitle:i,iconPosition:{top:o,left:s,bottom:d,right:u},hoverIconPosition:{top:f,left:h,bottom:p,right:C},modalPosition:{top:m,left:g,bottom:v,right:y},modalWidth:w,modalHeight:E,headerContent:M="Header Content",footerContent:x="Footer Content",iconWidth:L,iconHeight:k,children:H,onVisibilityChange:S},_)=>{const[V,O]=c(!1),[N,I]=c(!1),T=a(null),D=()=>{T.current&&clearTimeout(T.current),O(!1),T.current=setTimeout(()=>{I(!1),S?.(!1)},300)};return b(_,()=>({closeModal:D})),l(()=>()=>{T.current&&clearTimeout(T.current)},[]),n(t,{children:[n("div",{style:{top:void 0!==o?`${o}px`:void 0,left:void 0!==s?`${s}px`:void 0,bottom:void 0!==d?`${d}px`:void 0,right:void 0!==u?`${u}px`:void 0},className:"ff-ai-dynamic-icon-container",children:[e(P,{className:"ff-ai-dynamic-icon",name:r,onClick:()=>{T.current&&clearTimeout(T.current),I(e=>!e),S?.(!N),T.current=setTimeout(()=>O(e=>!e),10)},height:k,width:L}),e("div",{style:{top:void 0!==f?`${f}px`:void 0,left:void 0!==h?`${h}px`:void 0,bottom:void 0!==p?`${p}px`:void 0,right:void 0!==C?`${C}px`:void 0},className:"ff-ai-chat-icon-hover",children:e("div",{className:"ai-hover-leaf",children:e(F,{fontWeight:"bold",fontSize:14,color:"var(--chatbot-leaf-text)",children:i})})})]}),N&&A(e("div",{className:z("ff-ai-dynamic-modal",{open:V}),style:{top:void 0!==m?`${m}px`:void 0,left:void 0!==g?`${g}px`:void 0,bottom:void 0!==v?`${v}px`:void 0,right:void 0!==y?`${y}px`:void 0,position:"fixed",height:E,width:w},children:n("div",{className:"ff-ai-dynamic-modal-content",children:[M&&e("div",{className:"ff-ai-dynamic-modal-header",children:M}),e("div",{className:"ff-ai-dynamic-modal-body",children:H}),x&&e("div",{className:"ff-ai-dynamic-modal-footer",children:x})]})}),document.body)]})}),SE=({variant:t,title:r,tabTitle:i,comment:o,profileShortName:a})=>n("div",{className:"ff-history-card",children:[e("div",{className:z("header",`header--${t}`),children:e(F,{fontWeight:"semi-bold",children:i})}),n("div",{className:"body",children:[e("div",{className:"title",children:n("div",{className:"profile",children:[e(F,{className:z("avatar",`avatar--${t}`),children:a}),e(F,{children:r})]})}),n("div",{className:"comment-container",children:[e(F,{fontWeight:"semi-bold",className:"heading",children:"Comments:"}),e(F,{color:"var(--details-page-value-color)",className:"comment",children:o})]})]})]}),_E=({onChange:t,disabled:r,checked:i=!1,id:o="toggle",path:a})=>n("div",{className:"ff--ai-switch-container",children:[e("input",{className:"ff--ai-switch-checkbox",id:`ff-toggle-${o}`,type:"checkbox",disabled:!!r,onChange:e=>{t&&t(e)},checked:i}),e("label",{className:z("ff--ai-switch-label",{"ff--ai-switch-label--disabled":r}),htmlFor:`ff-toggle-${o}`,children:e("span",{className:"ff--ai-switch-content",children:n("span",{className:"ff--ai-switch-content",children:[e(F,{className:z("ff--ai-switch-typography",{left:i,right:!i}),as:"div",fontWeight:"bold",fontSize:18,color:i?"var(--base-bg-color)":"var(--ff-ai-toggle-text-color)",children:"AI"}),e("img",{className:"ff--ai-switch-image",src:a,alt:"AI image"})]})})})]}),VE=o(({name:t,height:n=30,width:r=30,path:i="",onClick:o,color:s="var(--brand-color)",hoverEffect:c=!1,className:d="",disabled:u=!1,variant:f="light",isSelected:h=!1,x:p,y:C,tabIndex:m=-1,...g},v)=>{if(!B[t])return null;const y=a(null);l(()=>{y.current&&(void 0!==p&&y.current.setAttribute("x",String(p)),void 0!==C&&y.current.setAttribute("y",String(C)))},[p,C]);const w={ref:v,onClick:u?void 0:o,style:{height:`${n}px`,width:`${r}px`,cursor:u?"not-allowed":"pointer",opacity:u?.3:1},tabIndex:m,...g};return e("span",{...w,children:e("img",{height:n,width:r,src:i,alt:""})})}),OE=({id:r=0,serialNumber:i,activeId:o,setActiveId:s,children:d,onIconClick:u,numberChildren:f,onContainerClick:h,onNextClick:p,onPreviousClick:C,disabled:m,isEditAccess:g,versionsLength:v,count:y,hiddenActions:w=[]})=>{const[b,E]=c(!1),[M,A]=c(!1),x=a(null),L=Array.isArray(w)?w:w?[w]:[],k=(e,t)=>{e.stopPropagation(),t()};l(()=>{x.current&&(()=>{if(x.current){const e=getComputedStyle(x.current),t=1.2*parseFloat(e.fontSize)*6;x.current.scrollHeight>t&&A(!0)}})()},[]);const H=e=>{e.stopPropagation(),E(!b)};return n("div",{className:`ff-prompt-container-Block ${o===r?"active":"inactive"} `,onClick:()=>{s(r),h()},children:[e(F,{fontSize:8,className:"ff-prompt-number-bg-color",as:"span",children:`Test cases ${i}`}),n(t,{children:[n("div",{className:"ff-prompt-content "+(b?"expanded":""),ref:x,children:[d,b&&n(t,{children:[e("span",{role:"button","aria-label":"toggleExpand",onClick:H,className:"read-less-btn",children:e(F,{color:"var(--brand-color)",fontWeight:"semi-bold",className:"read-more-btn-text",children:"Read Less"})})," "]})]}),M&&!b&&e("div",{role:"button","aria-label":"toggleExpand",onClick:H,className:"read-more-btn",children:e(F,{color:"var(--brand-color)",fontWeight:"semi-bold",className:"read-more-btn-text",children:"Read More"})})]}),n("div",{className:"ff-prompt-icons",children:[e("div",{className:"ff-prompt-icons-leftside",children:[{action:"delete",title:"Delete",color:"var(--ff-delete-button-attachment)"},{action:"edit",title:"Edit",color:"var(--label-edit-text-label-color)"},{action:"regenerate",title:"Regenerate",color:"var(--label-edit-text-label-color)"}].filter(e=>!L.includes(e.action)).map((t,n)=>{const r=g&&"delete"===t?.action||"regenerate"===t?.action&&(v??0)>=3||m;return e(K,{title:t.title,placement:"bottom",children:e(P,{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(P,{disabled:1===y,className:"ff-prompt-icons-style",name:"arrow_left_accordian",color:"var(--table-column-text-color)",width:18,height:18,onClick:e=>k(e,C),cursorType:"pointer"}),f,e(P,{disabled:y===v,className:"ff-prompt-icons-style",name:"arrow_right_icon",color:"var(--table-column-text-color)",width:18,height:18,onClick:e=>k(e,p),cursorType:"pointer"})]})]})]})},zE=o(({type:t="text",variant:r="primary",name:i="",label:o,disabled:a=!1,disableLinkIcon:l=!1,required:s=!1,placeholder:c="Attach Link",value:d,error:u,helperText:f,noBorder:h,className:p="",onChange:C,onBlur:m,onFocus:g,autoComplete:v="off",autoFocus:y=!1,minValue:w=-1/0,maxValue:b=1/0,transparentBackground:E=!1,size:M="small",isLabelRequired:A=!0,onClick:x,onKeyUp:L,isViewMode:k=!1,...H},S)=>{const _=!G(d);return n("fieldset",{className:z("ff-link-input-fieldset",{"ff-link-input-fieldset--disabled":a}),children:[n("div",{className:z("ff-link-input-container",{"ff-link-input-container--float":_,"ff-link-input-container--disabled":!!a}),children:[A&&n("label",{className:z(`ff-link-input-label-container ff-link-input-label-container--${M}`,{"ff-link-input-label-container--danger":!!u}),htmlFor:i,children:[s&&e("span",{className:"required-asterisk",children:"*"}),e("span",{className:z(`ff-link-input-label ff-link-input-label--${r}`,{"ff-link-input-label--no-hover":!!d,"ff-link-input-label--disabled":!!a,"ff-link-input-label--danger":!!u}),children:o})]}),e("input",{ref:S,name:i,value:d,type:t,spellCheck:!1,id:i,className:z(`ff-link-input ff-link-input-${r} default-input ff-link-input--${M}`,{"ff-link-input--transparentBackground":!!E,"ff-link-input--no-hover":!!d,"ff-link-input--disabled":!!a,"ff-link-input--danger":!!u,"ff-link-input--no-border":!!h,"ff-link-input--placeholder":!A},`${p}`),placeholder:c,disabled:k||a,onChange:C,onFocus:g,onBlur:m,autoComplete:v,autoFocus:y,min:w,max:b,onClick:x,onKeyUp:L,...H}),e("div",{className:"input-link-icon",children:l||u||!_?e(P,{name:"link",disabled:!0}):e(K,{title:"Click here to navigate",children:e("span",{children:e(P,{name:"link",disabled:!1,onClick:()=>{d&&!u&&window.open(d,"_blank")}})})})})]}),f&&u&&e("span",{className:z("ff-link-input-message",{"ff-link-input-message--danger":!!u}),children:f})]})}),NE=({labelsList:r=[],height:i=""})=>{const o=e("div",{className:"ff-chip-tooltip",children:r.filter((e,t)=>t>0).map((t,n)=>e(F,{as:"div",className:"ff-chip-tooltip-label",children:t},`label-${n}-${t}`))});return e(t,{children:!G(r)&&n("div",{className:"ff-chip-with-count-container",children:[e(K,{title:r[0],children:e(F,{as:"div",children:ie(r[0]||"",10),className:"ff-chip-label",fontWeight:"medium",style:i?{height:i}:void 0})}),r.length>1&&e(K,{title:e(F,{as:"div",children:o}),children:e(F,{as:"div",children:"+"+(r.length-1),className:"ff-chip-count",fontWeight:"medium"})})]})})};class IE 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 TE=({iconName:t="",onButtonClick:r,buttonLabel:i="Label",buttonText:o="To Add Group",disableButton:a=!1,stepCount:l=1,iconWidth:s=120,iconHeight:c=120,addContentLabel:d="step"})=>n("div",{className:"add-content-button "+(a?"disabled":""),children:[!G(t)&&e("div",{className:"icon-container",children:e(P,{name:t,width:s,height:c})}),n("div",{className:"typography-label-button",children:[n(F,{fontSize:"12px",fontWeight:"regular",lineHeight:"18px",children:[d+l," :"]}),e(F,{fontSize:"12px",fontWeight:"semi-bold",lineHeight:"18px",children:"Click"}),e(Jf,{label:i,onClick:r,iconName:"plus_user_icon",isDisable:a}),e(F,{fontSize:"12px",fontWeight:"semi-bold",lineHeight:"18px",children:o})]})]}),DE=({variant:t="default",tabsData:r,activeTabId:i,onTabClick:o,noBorder:a=!1,noPadding:l=!1,titleSize:s="12px"})=>{const[d,u]=c(0);return n("div",{className:"ff-tabs-slider-container",children:[n("div",{className:z(`ff-tab-row--${t} ff-tab-row-section`,{"ff-tab-row--no-border":a,"ff-tab-row--no-padding":l,"ff-tab-row--position":r.length>4}),children:[r.length>4&&e(P,{className:"ff-tab-icon ff-tab-icon--previous",name:""+(d?"arrow_left_accordian":""),onClick:()=>{d>0&&u(e=>e-1)},hoverEffect:!0}),e("div",{className:"ff-tab-row-carousel",children:e("div",{className:"carousel_inner",style:{transform:`translateX(-${100*d}%)`},children:r.map(r=>n("button",{onClick:()=>!r.disabled&&o(r.id),disabled:r.disabled,className:z(`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(K,{title:r.label.length>9?r.label:"",children:e(F,{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:z("ff-tab-label",{"ff-tab-label--active":i===r.id})})}),"default"===t&&r.count&&e("span",{className:z("tab-count",{"tab-count--active":i===r.id}),children:r.count})]}),e("div",{className:z("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(P,{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})]})},ZE=o(({label:t="Status",iconName:r="update_icon",onClick:i,isDisable:o=!1,variant:a="default",backgroundColor:l=!1,border:s=!1},c)=>{const d={default:"var(--ff-avatar-background-color)",success:"var(--status-success-text-color)",danger:"var(--ff-delete-button-attachment)"};return e("button",{disabled:o,onClick:i,className:`\n ff-status-indicator\n ff-status-indicator--${a}\n ${l?`ff-status-indicator--with-bg ff-status-indicator--${a}-bg`:""}\n ${s?`ff-status-indicator--with-border ff-status-indicator--${a}-border`:""}\n `,ref:c,children:n("div",{className:"ff-status-indicator__content",children:[e(P,{name:"danger"===a?"close":r,color:d[a]||d.default,className:`ff-status-indicator__icon ff-status-indicator__icon--${a}`}),e(F,{as:"div",fontSize:12,className:`ff-status-indicator__label ff-status-indicator__label--${a}`,fontWeight:"medium",lineHeight:"20px",children:t})]})})}),jE=({rootLabel:t,childrenLabels:r,align:i="center",direction:o="horizontal"})=>{const a=r.length;return n("div","vertical"===o?{className:"ff-os-tree-vertical",style:{"--child-count":a},children:[n("div",{className:`ff-os-tree-vertical__row ff-os-tree-vertical__row--${i}`,children:[e("div",{className:"ff-os-tree-vertical__root-label",children:t}),e("div",{className:"ff-os-tree-vertical__horizontal-line"})]}),n("div",{className:"ff-os-tree-vertical__vertical-line-wrapper",children:[e("div",{className:"ff-os-tree-vertical__vertical-line"}),r.map((t,r)=>n("div",{className:"ff-os-tree-vertical__child",children:[e("div",{className:"ff-os-tree-vertical__child-connector"}),e("div",{className:"ff-os-tree-vertical__child-label",children:t})]},r))]})]}:{className:`ff-os-tree ff-os-tree--${i}`,style:{"--child-count":a},children:[n("div",{className:"ff-os-tree__root-wrapper",children:[e("div",{className:"ff-os-tree__root-label",children:t}),e("div",{className:"ff-os-tree__vertical-root"})]}),e("div",{className:"ff-os-tree__horizontal-connector",children:r.map((t,n)=>e("div",{className:"ff-os-tree__vertical-child"},n))}),e("div",{className:"ff-os-tree__children",children:r.map((t,n)=>e("div",{className:"ff-os-tree__child-container",children:e("div",{className:"ff-os-tree__child-label",children:t})},n))})]})},RE=({handleClose:t,handleResend:r,handleOtp:i,resendTimeout:o=30})=>{const[s,d]=c(Array(6).fill("")),[u,f]=c(o),[h,p]=c(!0),C=a(Array(6).fill(null));l(()=>{h||C.current[0]?.focus()},[h]),l(()=>{let e;return u>0&&(e=window.setInterval(()=>f(e=>e-1),1e3)),0===u&&p(!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);C.current[r]?.focus()};return e($f,{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(F,{fontSize:24,lineHeight:"36px",fontWeight:"semi-bold",children:"OTP Verification"}),e(P,{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&&C.current[t+1]?.focus()}else if("Backspace"===n){e.preventDefault();const n=[...s];n[t]="",d(n),t>0&&C.current[t-1]?.focus()}})(e,n),onPaste:m,ref:e=>C.current[n]=e,readOnly:!0},n))}),e(U,{variant:"primary",label:"Submit",onClick:()=>i(s.join("")),disabled:s.includes(""),className:"ff-submit-btn"}),n("div",{className:"ff-resend "+(h?"disabled":""),onClick:h?void 0:()=>{f(o),p(!0),d(Array(6).fill("")),r()},children:["Re-send OTP",u>0?` (${u}s)`:""]})]})})},BE=({isOpen:t,onClose:r,isPlaying:i,onTogglePlay:o,mediaType:s,src:d,headerTitle:u,onDownload:f,onExpand:h,showHeader:C=!0,showDownload:m=!0,showExpand:g=!0,width:v="800px",height:y="432px",showControls:w=!0,customStyle:b,overlay:E=!0,children:M,showControlDownload:A=!1,showControlExpand:x=!1,isFullscreen:L=!1})=>{const k=a(null),H=a(null),[S,_]=c(0),[V,O]=c(0),[z,N]=c(!1),[I,T]=c(0);l(()=>{"video"===s&&k.current&&!M&&(i?k.current.play():k.current.pause())},[i,s,M]);const D=p(()=>{if(k.current&&!z){const e=k.current.currentTime/k.current.duration*100;T(e||0),_(k.current.currentTime)}},[z]),Z=p(()=>{k.current&&O(k.current.duration)},[]),j=p(()=>{_(0),T(0),o?.()},[o]),R=p(e=>`${Math.floor(e/60)}:${Math.floor(e%60).toString().padStart(2,"0")}`,[]),B=p(e=>{if(k.current){const t=e/100*k.current.duration;k.current.currentTime=t,T(e),_(t)}},[]),U=p(e=>{if(z||!H.current)return;const t=H.current.getBoundingClientRect(),n=e.clientX-t.left,r=t.width,i=Math.max(0,Math.min(100,n/r*100));B(i)},[B,z]),q=p(e=>{if(!H.current)return;N(!0);const t=H.current.getBoundingClientRect(),n=e.clientX-t.left,r=t.width,i=Math.max(0,Math.min(100,n/r*100));B(i)},[B]),W=p(e=>{if(!z||!H.current||!k.current)return;const t=H.current.getBoundingClientRect(),n=e.clientX-t.left,r=t.width,i=Math.max(0,Math.min(100,n/r*100));B(i)},[z,B]),Q=p(()=>{N(!1)},[]);return l(()=>{if(z)return document.addEventListener("mousemove",W),document.addEventListener("mouseup",Q),()=>{document.removeEventListener("mousemove",W),document.removeEventListener("mouseup",Q)}},[z,W,Q]),t?e(Vs,{isOpen:t,onClose:r,isMaximized:!1,showHeader:C,overlay:E,downloadHandler:()=>{},customStyle:b,header:n("div",{className:"ff-header-content",children:[e(P,{width:23,height:23,name:"automatic_locator"}),e(F,{children:e("span",{className:"ff-header-title",children:u})})]}),icons:e(K,{title:"Close",children:e(P,{name:"close",onClick:r})}),width:v,height:y,zIndex:999,children:n("div",{className:"ff-video-wrapper",children:[M||("video"===s?e("video",{ref:k,src:d,className:"ff-media-video",onTimeUpdate:D,onLoadedMetadata:Z,onEnded:j}):e("img",{src:d,alt:"Preview",className:"ff-media-image"})),n("div",{className:"ff-top-right-icons",children:[m&&e(K,{title:"Download",children:e(P,{name:"download_file",color:"white",onClick:f})}),g&&e(K,{title:L?"Minimize":"Maximize",children:e(P,{name:L?"collapse_icon":"expand_icon",color:"white",onClick:h})})]}),"video"===s&&w&&!M&&n("div",{className:"ff-media-controls",children:[e("button",{onClick:o,className:"ff-play-pause-btn",children:e(K,{title:i?"Pause":"Play",children:e(P,{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:R(S)}),e("input",{type:"range",className:"ff-seek-bar",min:0,max:100,value:I,onChange:e=>B(parseFloat(e.target.value)),onClick:U,onMouseDown:q,ref:H}),e("span",{className:"ff-total-time",children:R(V)})]}),n("div",{className:"ff-control-icons",children:[A&&e(K,{title:"Download",children:e(P,{name:"download_file",color:"white",onClick:f,cursorType:"pointer"})}),x&&e(K,{title:L?"Minimize":"Maximize",children:e(P,{name:L?"collapse_icon":"expand_icon",color:"white",onClick:h,cursorType:"pointer"})})]})]})]})}):null},PE=({header:r,secondaryHeader:i,primaryCount:o,secondaryCount:a,primaryItems:l,secondaryItems:s,width:c,activeTab:d="primary",activeTabId:u,onPrimaryTabClick:f,onSecondaryTabClick:h,onTabClick:p,actions:C,tabsData:m,notchPosition:g="top-left"})=>{const v=i&&"secondary"===d?s:l,y=a&&parseInt(a)>0,w=o&&parseInt(o)>0,b=i&&(w||y),{tooltip:E="Download",iconName:M="download_file",disabled:A=!1,onClick:x,className:L=""}=C?.download||{},{tooltip:k="Delete",iconName:H="delete_icon",disabled:S=!1,onClick:_,className:V=""}=C?.delete||{},O=()=>n("div",{className:"ff-dropdown-header-icons",children:[C?.download&&e(K,{title:E,children:e(P,{name:M||"",className:`ff-dropdown-icon ff-download-icon ${L}`,onClick:x,width:18,height:20,disabled:A,hoverEffect:!0})}),C?.delete&&e(K,{title:k,children:e(P,{name:H||"",className:`ff-dropdown-icon ff-delete-icon ${V}`,onClick:_,width:25,height:25,disabled:S,hoverEffect:!0})})]});return n("div",{className:"ff-resolution-dropdown",style:c?{minWidth:c}:{},children:[e("div",{className:"ff-dropdown-notch "+("bottom-center"===g?"bottom-center":"top-left")}),e("div",{className:"ff-dropdown-header",children:e("div",{className:"ff-dropdown-header-content",children:i&&m&&u?n(t,{children:[e(Fs,{tabsData:m,activeTabId:u,onTabClick:e=>{p&&p(e),"tab-1"===e&&f?f():"tab-2"===e&&h&&h()}}),b&&O()]}):i&&b?n("div",{className:"ff-dropdown-header-dual",children:[n("div",{className:"ff-dropdown-header-item "+("primary"===d?"active":""),onClick:f,children:[e(F,{fontWeight:"semi-bold",className:"ff-dropdown-text",children:r}),o&&e("span",{className:"ff-dropdown-count",children:o})]}),n("div",{className:"ff-dropdown-header-item "+("secondary"===d?"active":""),onClick:h,children:[e(F,{fontWeight:"semi-bold",className:"ff-dropdown-text",children:i}),a&&e("span",{className:"ff-dropdown-count",children:a})]}),O()]}):i?n("div",{className:"ff-dropdown-header-dual",children:[n("div",{className:"ff-dropdown-header-item "+("primary"===d?"active":""),onClick:f,children:[e(F,{fontWeight:"semi-bold",className:"ff-dropdown-text",children:r}),o&&e("span",{className:"ff-dropdown-count",children:o})]}),n("div",{className:"ff-dropdown-header-item "+("secondary"===d?"active":""),onClick:h,children:[e(F,{fontWeight:"semi-bold",className:"ff-dropdown-text",children:i}),a&&e("span",{className:"ff-dropdown-count",children:a})]})]}):e(F,{fontSize:16,fontWeight:"semi-bold",children:r})})}),e("ul",{className:"ff-dropdown-list",children:v?.map((t,n)=>e("li",{className:"ff-dropdown-item",children:t},n))})]})},FE=(e,t)=>"string"==typeof e?ie(e,t):i.isValidElement(e)?i.cloneElement(e,{},FE(e.props.children,t)):Array.isArray(e)?e.map(e=>FE(e,t)):e,UE=(e,t,n,r)=>{const i=e[t.accessor];if(t.cell){const o=e._id||e.id;return t.cell({value:i,row:e,column:t.accessor,index:n,tableType:r,...o&&{refId:o}})}return t.accessor||i&&"object"!=typeof i?i:"--"},qE=(t,n=[],r,i,o)=>{let a=n;const l=void 0!==i?!i:r;return G(n)&&(isNaN(t)||(a=Array(t).fill(!0))),e("div",{className:"tree-table-fn-space-container",children:a?.map((n,r)=>e("span",{className:`tree-table-fn-space-block tree-table-fn-space-block-${r} ${n?"":"no-lines"} ${l&&r===t-1?"last-node":""} ${o?"folder":""}`},r))})},WE=i.memo(({treeRowRef:r,col:i,colIndex:o,columnMeta:a,node:l,selected:s,select:c,onCheckBoxChange:d,onToggleExpand:u,onAddConfirm:f,onAddCancel:h,handleEditFieldError:p,isExpanding:C,columnTextColor:m,hideOnDisable:g,scriptLengthTruncate:v,addModuleInputWidth:y,addModuleSelectWidth:w,disableEditLabelConfirmIcon:b,isEditable:E,setIsEditable:M})=>{const A={color:`${m||"var(--ff-primary-text-color)"}`,width:a?.width??i?.width,position:a?.sticky?"sticky":void 0,left:a?.sticky?a.left:void 0,zIndex:a?.sticky?a.zIndex:void 0};return n("div",{className:`ff-table-tree-fn-td ${i.isTree&&l.container?"folder":""} ${a?.sticky?"sticky-tree-column":""}`,"data-col-index":o,style:A,children:[i.isTree&&qE(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(C?Ds:N,{})]})}),n("span",{className:"tree-table-fn-td-content "+(i.isTree&&l.container?"folder":""),children:[!l?.isNewNode&&n(t,{children:[i.isTree&&"checkbox"===c&&!(g&&l.unselectable)&&e("span",{className:"tree-table-fn-td-content-select",children:"none"===l.selectedStatus?e(K,{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(te,{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(te,{checked:"completely"===l.selectedStatus,partial:"partially"===l.selectedStatus,onChange:e=>d(e,l),disabled:l.unselectable||"REVIEW"===l.state||!0===l?.isDisable})}),i.isTree&&"radio"===c&&!(g&&l.unselectable)&&e("span",{className:"tree-table-fn-td-content-select",children:e(Za,{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})})]}),l.isNewNode&&i.isTree?e(Ts,{onCancel:h,onConfirm:f,value:l.value,label:l?.label,optionsList:l.options,selectedOption:l.selectedOption,withDropdown:"inputWithDropdown"===l.type,handleCustomError:p,inputFieldWidth:y,selectFieldWidth:w,confirmIconTooltip:l.confirmIconTooltip,cancelIconTooltip:l.cancelIconTooltip,isEditable:E,setIsEditable:M,isOnBlurTrue:!1,isDisable:{confirm:b}}):e("span",{className:"tree-table-fn-td-content-text",children:FE(UE(l,i),v)})]})]}),i.actions&&!l?.isNewNode&&e("div",{className:"table-tree-fn-row-action",children:i.actions(l,r)})]})});WE.displayName="TableCell";const QE=i.memo(({node:t,columnsData:n,columnMeta:r,selected:i,select:o,onRowClick:l,onToggleExpand:s,onCheckBoxChange:c,onAddConfirm:d,onAddCancel:u,handleEditFieldError:f,isExpanding:h,index:p,selectedNode:C,hideOnDisable:m,scriptLengthTruncate:g,addModuleInputWidth:v,addModuleSelectWidth:y,disableEditLabelConfirmIcon:w,isEditable:b,setIsEditable:E,style:M})=>{const A=a(null);return e("div",{"data-level":t.hierarchy,ref:A,className:"ff-table-tree-fn-row show-tree "+(C&&C===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===p?"table-fn-first-row":t.key,style:M,children:n.map((n,a)=>e(WE,{treeRowRef:A,col:n,colIndex:a,node:t,selected:i,select:o,onCheckBoxChange:c,onToggleExpand:s,onAddConfirm:d,onAddCancel:u,handleEditFieldError:f,isExpanding:h,hideOnDisable:m,scriptLengthTruncate:g,addModuleInputWidth:v,addModuleSelectWidth:y,disableEditLabelConfirmIcon:w,isEditable:b,setIsEditable:E,columnMeta:r?.[a]},n.name))})});QE.displayName="TableRow";const GE=({flattenedTreeData:t,columnsData:n,columnMeta:r,rowHeight:i=32,startIndex:o=0,totalHeight:a=0,selected:l,select:s,onRowClick:c,onToggleExpand:d,onCheckBoxChange:u,onAddConfirm:f,onAddCancel:h,handleEditFieldError:p,expanding:C,selectedNode:m,hideOnDisable:g,scriptLengthTruncate:v,addModuleInputWidth:y,addModuleSelectWidth:w,disableEditLabelConfirmIcon:b,isEditable:E,setIsEditable:M})=>e("div",{className:"ff-table-tree-fn-body",style:{height:`${a}px`,position:"relative"},children:t?.map((t,a)=>e(QE,{node:t,columnsData:n,columnMeta:r,selected:l,select:s,onRowClick:c,onToggleExpand:d,onCheckBoxChange:u,onAddConfirm:f,onAddCancel:h,handleEditFieldError:p,isExpanding:t.key===C,index:o+a,selectedNode:m,hideOnDisable:g,scriptLengthTruncate:v,addModuleInputWidth:y,addModuleSelectWidth:w,disableEditLabelConfirmIcon:b,isEditable:E,setIsEditable:M,style:{transform:`translateY(${(o+a)*i}px)`,height:`${i}px`,position:"absolute",top:0,left:0,right:0}},t.key))}),KE=i.memo(({columnsData:t,columnMeta:r,totalWidth:i,rootNode:o,selected:s,onCheckBoxChange:d,selectedNode:u,tableHeaderBgColor:f,hideOnDisable:h,transparentHeader:p,scriptLengthTruncate:C=25,showHeader:m=!0})=>{const g=a(null),[v,y]=c(!1),[w,b]=c(!1);l(()=>{y(!0)},[]);const E=(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:[m&&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:{...E(i,n),backgroundColor:p?"transparent":f,pointerEvents:p?"none":"auto"},children:t},t))}),o&&e("div",{className:"ff-table-tree-fn-row show-tree "+(u&&u===o?.node?.key?"hover":""),ref:g,onMouseEnter:e=>{e.stopPropagation(),b(!0)},onMouseLeave:e=>{e.stopPropagation(),b(!1)},children:t.map((t,i)=>e("div",{className:"ff-table-tree-fn-td "+(r?.[i]?.sticky?"sticky-tree-column":""),"data-col-index":i,style:E(i,t.width),children:n("span",{className:"tree-table-fn-default-content",children:[0===i&&"checkbox"===o.select&&!(h&&o.node.isDisabled)&&e(te,{checked:"partially"!==o?.node?.selectedStatus&&("completely"===o?.node?.selectedStatus||!1),partial:"partially"===o.node.selectedStatus,onChange:e=>d(e,o.node),disabled:o.node.isDisabled}),0===i&&"radio"===o.select&&!(h&&o.node.isDisabled)&&e(Za,{name:o.node.key,checked:s.includes(o.node.key),value:o.node.key,onChange:e=>d(e,o.node),disabled:o.node.isDisabled}),n("span",{className:"tree-table-fn-td-content-text",children:["name"===t.accessor?e("span",{children:o.node[t.accessor]}):e("span",{children:FE(UE(o.node,t),C)}),o.cell&&0===i&&e("span",{className:"table-tree--fn-root-cell",children:o.cell(o.node)})]}),w&&o.actions&&0===i&&v&&g.current&&e("div",{className:"table-tree-fn-row-action",children:o.actions(o.node,g)})]})},i))})]})});KE.displayName="TableHead";const YE=32,XE="__root__",JE=(e,t)=>{if(!e?.length)return[];const n=new Map,r=new Map,i=new Map,o=new Map;t&&t.key&&n.set(t.key,t),e.forEach(e=>{n.set(e.key,e);const t=e.parentId??XE;r.has(t)||(r.set(t,[]),o.set(t,{container:0,resource:0})),r.get(t)?.push(e);const i=o.get(t);i&&(e.container?i.container++:i.resource++)}),r.forEach(e=>{e.forEach((e,t)=>{i.set(e.key,t)})});const a=e=>{const t=e.parentId??XE,a=r.get(t);if(!a||0===a.length)return!1;if((i.get(e.key)??0)<a.length-1)return!0;const l=n.get(t),s=o.get(t);if(l&&s){const t=a.filter(e=>e.container).reduce((e,t)=>e+(t.totalResourceCount??0),0),n=a.filter(e=>!e.container).length,r=Math.max(0,(l.totalResourceCount??0)-(t+n));if(e.container){return s.container<(l.subContainerCount??0)||r>0}return s.resource<r}return!1},l=e=>{if(void 0!==e.selectedStatus)return e.selectedStatus;let r=e;for(;r?.parentId;){const e=n.get(r.parentId);if(!e)break;if("completely"===e.selectedStatus)return"completely";if("none"===e.selectedStatus)return"none";r=e}return"completely"===t?.selectedStatus?"completely":"none"===t?.selectedStatus?"none":e.selectedStatus};return e.map(e=>{const t=e,r=t.parentSiblings&&t.parentSiblings.length>0?t.parentSiblings:(e=>{const t=e.hierarchy??0;if(t<=0)return[];const r=[];let i=e;for(;i&&(r.unshift(i),i.parentId);){const e=n.get(i.parentId);if(!e)break;i=e}const o=r.map(e=>a(e));return o.length===t?o:o.length>t?o.slice(o.length-t):new Array(t-o.length).fill(!1).concat(o)})(e);return{...e,lastChild:!a(e),parentSiblings:r,selectedStatus:l(e)}})},$E=o(({treeData:t,columnsData:r,selected:i=[],select:o=null,onChange:s=()=>{},onClick:d=()=>{},onExpand:f=()=>{},loadMore:C=()=>{},tableBorder:m,height:g="calc(100vh - 134px)",newNode:v,onAddConfirm:y=()=>{},onAddCancel:w=()=>{},handleEditFieldError:b,loading:E=!1,rootNode:M,pagination:A=!0,selectedNode:x,tableHeaderBgColor:L="var(--border-color)",hideOnDisable:k=!1,freezeColumns:H,scriptLengthTruncate:S=25,addModuleInputWidth:_=150,addModuleSelectWidth:V,onScroll:O,onScrollEnd:z,disableEditLabelConfirmIcon:N=!1,transparentHeader:I=!1,navigateTreeNode:T=null,handleRemoveNavigateTreeNode:D=()=>{},scrollThreshold:Z=128,showHeader:j=!0},R)=>{const[B,P]=c(null),[F,U]=c(null),[q,W]=c({start:0,end:20}),[Q,K]=c(!1),Y=a(null),X=a(null),J=a(0),$=a(E),ee=a(null),te=a({lastScrollTop:0}),ne=a(null),re=a(0),ie=a(null),oe=a(null),ae=a(null),le=a({key:null,attempts:0}),se=a(null),ce=(e,t)=>{const n=String(e??t);return n.endsWith("%")?{value:parseFloat(n),unit:"%"}:{value:parseFloat(n)||0,unit:"px"}},de=h(()=>{let e=0,t=0;return r.map((n,r)=>{const{value:i,unit:o}=ce(n.width,400),a=!!H&&r<H,l="%"===o?`${i}%`:`${i}px`,s=`calc(${e}px + ${t}%)`;return a&&("%"===o?t+=i:e+=i),{width:l,sticky:a,left:s,zIndex:a?100+(H??0)-r:1}})},[r,H]),ue=h(()=>{let e=0,t=0;return r.forEach(n=>{const{value:r,unit:i}=ce(n.width,400);"%"===i?t+=r:e+=r}),`calc(${e}px + ${t}%)`},[r]),fe=h(()=>{if(!H)return"0px";let e=0,t=0;return de.slice(0,H).forEach(n=>{const r=parseFloat(n.width)||0;n.width.endsWith("%")?t+=r:e+=r}),`calc(${e}px + ${t}%)`},[de,H]),he=h(()=>((e,t,n)=>{if(!t?.sourceId||!t.action)return e;const{sourceId:r,action:i,value:o="",error:a="",label:l,type:s,options:c,selectedOption:d,confirmIconTooltip:u,cancelIconTooltip:f,payloadSourceId:h}=t,p=t?.parentId,C=t?.hierarchy,m=c?.map(e=>({label:e,value:e})),g=d?{label:d,value:d}:void 0,v=new Map;e.forEach(e=>v.set(e.key,e)),n&&v.set(n.key,n);const y=v.get(r);let w;h&&(w=v.get(h));let b=y??("addInside"===i?w:void 0);!b&&"addInside"===i&&p&&(b=v.get(p));const E="addInside"===i&&!b&&e.length>=0;if(!b&&!E)return e;const M=[...e],A=b?e.findIndex(e=>e.key===b.key):-1;let x=null,L=0,k=A+1;switch(i){case"addAbove":{const t=b;if(!t)return e;x=t.parentId,L=t.hierarchy;break}case"addBelow":{const t=b;if(!t)return e;x=w?.parentId??t.parentId,L=w?.hierarchy??t.hierarchy;break}case"addInside":{if(E){x=p??h??r??null,L=C??1,k=M.length;break}const t=w??b;if(!t)return e;x=t.key,L=(t.hierarchy??0)+1;const n=M.findIndex(e=>e.key===t.key);if(-1!==n)for(k=n+1;k<M.length&&(M[k]?.hierarchy??0)>(t.hierarchy??0);)k++;break}}const H={hierarchy:L,parentId:x,sourceId:b?.key??r??h??"new-node",isNewNode:!0,key:"new-node",value:o,error:a,label:l,type:s,options:m,selectedOption:g,confirmIconTooltip:u,cancelIconTooltip:f};switch(i){case"addAbove":M.splice(A,0,H);break;case"addBelow":M.splice(A+1,0,H);break;case"addInside":M.splice(Math.max(0,k),0,H)}return M})(t,v,M?.node),[t,v,M]),pe=h(()=>JE(he,M?.node),[he,M?.node]),Ce=h(()=>pe.filter(e=>!e.hide),[pe]),me=h(()=>{const e=new Map;return pe.forEach(t=>e.set(t.key,t)),e},[pe]),ge=h(()=>{const e=new Map;return Ce.forEach((t,n)=>e.set(t.key,n)),e},[Ce]),ve=p(e=>{P(t=>t?e&&t!==e?t:null:t),e&&oe.current?.key!==e||(oe.current=null),ae.current&&(clearTimeout(ae.current),ae.current=null)},[]);l(()=>{$.current=E},[E]);const ye=p(()=>{const e=Y.current;if(!e)return;const t=J.current||0,n=Math.max(0,e.scrollTop-t),r=e.clientHeight-t;let i=Math.floor(n/YE)-6,o=Math.ceil((n+r)/YE)+6;i=Math.max(0,i),o=Math.min(Ce.length,o),W(e=>e.start===i&&e.end===o?e:{start:i,end:o})},[Ce.length]),we=p(()=>{null===ee.current&&(ee.current=requestAnimationFrame(()=>{ee.current=null,ye()}))},[ye]);u(()=>{const e=Y.current;if(!e)return;const t=Ce.length*YE,n=Math.max(0,t-(e.clientHeight-J.current));te.current.lastScrollTop>n&&Ce.length>0&&(e.scrollTop=0,te.current.lastScrollTop=0),ye()},[Ce.length,ye]);const be=p(()=>{const e=Y.current;if(!e)return;const n=e.scrollTop,r=n>te.current.lastScrollTop?"down":"up";if(te.current.lastScrollTop=n,we(),O?.(),ie.current?.(),!A||E||F||G(t))return;const i=e.scrollHeight-(n+e.clientHeight)<Z,o=n<Z+J.current;"down"===r&&i&&!t[t.length-1]?.lastResource&&(U("below"),C("below")),"up"===r&&o&&!t[0]?.lastResource&&(U("above"),ne.current=t[0]?.key??null,C("above"))},[t,A,E,F,Z,we,O,C]);l(()=>{if(E||!A||G(t))return;const e=t[0],n=!e?.lastResource,{totalSubContainerCount:r=0,totalResourceCount:i=0}=M?.node||{},o=r+i,a=Ce.length<10&&Ce.length<o;n&&a&&(ne.current=e?.key??null,U("above"),C("above"))},[E,A,t,Ce.length,M,C]),u(()=>{if(E||"above"!==F)E||"below"!==F||U(null);else{const e=Y.current,t=ne.current;if(e&&t){const n=ge.get(t);void 0!==n&&n>0&&(e.scrollTop+=n*YE)}ne.current=null,U(null)}},[E,F,ge]),l(()=>{const e=Y.current;if(e)return ie.current=z?xa(()=>{z?.()},150):null,e.addEventListener("scroll",be,{passive:!0}),()=>{e.removeEventListener("scroll",be),ie.current?.cancel()}},[be,z]),l(()=>{const e=Y.current;if(!e)return;const t=e=>{Date.now()<re.current&&e.stopImmediatePropagation()};return e.addEventListener("scroll",t,{passive:!0,capture:!0}),()=>{e.removeEventListener("scroll",t,!0)}},[]),l(()=>{const e=X.current;if(!e)return;const t=new ResizeObserver(()=>{J.current=e.getBoundingClientRect().height,ye()});return t.observe(e),()=>t.disconnect()},[ye]),u(()=>{if(!v||!Y.current)return;const e=Y.current,t=ge.get("new-node");if(void 0===t)return;const n=J.current||0,r=e.clientHeight-n;if(r<=0)return;const i=t*YE,o=i+YE,a=Math.max(0,e.scrollTop-n);let l=a;i<a?l=i:o>a+r&&(l=Math.max(0,o-r)),l!==a&&(re.current=Date.now()+300,e.scrollTop=l+n,ye());const s=requestAnimationFrame(()=>{K(!0)});return()=>cancelAnimationFrame(s)},[v,ge,ye]),l(()=>{v||K(!1)},[v]),u(()=>{if(!B||E)return;const e=oe.current;if(!e||e.key!==B){const e=requestAnimationFrame(()=>{ve(B)});return()=>cancelAnimationFrame(e)}const t=me.get(e.key);if(!t){const t=requestAnimationFrame(()=>{ve(e.key)});return()=>cancelAnimationFrame(t)}if(Boolean(t.expanded)!==e.expanded)return;const n=requestAnimationFrame(()=>{ve(e.key)});return()=>cancelAnimationFrame(n)},[me,B,E,ve]),l(()=>{le.current.key!==T&&(le.current={key:T,attempts:0}),!T&&se.current&&(clearTimeout(se.current),se.current=null)},[T]),u(()=>{if(!T||v)return;const e=Y.current;if(!e)return;const n=ge.get(T);if(void 0!==n){le.current={key:T,attempts:0};const t=J.current||0,r=Math.max(YE,e.clientHeight-t),i=n*YE+16,o=Math.max(0,i-r/2)+t;return re.current=Date.now()+400,e.scrollTo({top:o,behavior:"smooth"}),we(),se.current&&clearTimeout(se.current),void(se.current=setTimeout(()=>{D?.()},350))}if(E||F)return;const r=le.current;if(r.key!==T&&(r.key=T,r.attempts=0),r.attempts+=1,!(r.attempts>30))return A&&!0!==t[0]?.lastResource?(ne.current=null,U("above"),void C("above")):void(r.attempts>2&&D?.());D?.()},[T,v,ge,E,F,A,t,C,we,D]);const Ee=p(e=>{if(B)return;const t=!e?.expanded;P(e.key),oe.current={key:e.key,expanded:t},ae.current&&clearTimeout(ae.current);const n=Date.now(),r=()=>{if(oe.current?.key!==e.key)return;const t=$.current,i=Date.now()-n>=2e3;!t||i?ve(e.key):ae.current=setTimeout(r,1e3)};ae.current=setTimeout(r,1e3),f?.(e)},[B,f,ve]),Me=p((e,t)=>{B||s?.(e,t)},[s,B]),Ae=p((e,t)=>{B||d?.(e,t)},[d,B]);l(()=>()=>{null!==ee.current&&(cancelAnimationFrame(ee.current),ee.current=null),ae.current&&clearTimeout(ae.current),se.current&&clearTimeout(se.current)},[]);const xe=Ce.length*YE,Le=Ce.slice(q.start,q.end);return e("div",{className:"tree-table-wrapper-container table-tree-fn",children:e("div",{className:"tree-table-fn-wrap",ref:R,children:e("div",{className:"table-fn-scrollable "+(Ce.length?"":"table-fn-empty"),ref:Y,style:{"--table-height":Ce.length?g:"auto","--frozen-column-width":fe,border:m},children:n("div",{className:"tree-table-fn",style:{width:ue},children:[e("div",{ref:X,style:{position:"sticky",top:0,zIndex:98},children:e(KE,{columnsData:r,columnMeta:de,totalWidth:ue,rootNode:M,onCheckBoxChange:Me,selected:i,selectedNode:x,tableHeaderBgColor:L,hideOnDisable:k,transparentHeader:I,scriptLengthTruncate:S,showHeader:j})}),e(GE,{flattenedTreeData:Le,columnsData:r,columnMeta:de,totalWidth:ue,rowHeight:YE,startIndex:q.start,totalHeight:xe,selected:i,select:o,onRowClick:Ae,onToggleExpand:Ee,onCheckBoxChange:Me,onAddConfirm:y,onAddCancel:w,handleEditFieldError:b,expanding:B,selectedNode:x,hideOnDisable:k,scriptLengthTruncate:S,addModuleInputWidth:_,addModuleSelectWidth:V,disableEditLabelConfirmIcon:N,isEditable:v?Q:void 0,setIsEditable:v?e=>{K(Boolean(e))}:void 0})]})})})})});function eM(e,t,n,r,i,o="children"){return function e(a){for(let l=0;l<a.length;l++){const s=a[l];if(s&&s[t]===n){const e=[...a];return"replace"===i?e[l]=r:e.splice("above"===i?l:l+1,0,r),{updatedArray:e}}if(s&&s[o]&&Array.isArray(s[o])){const t=e(s[o]);if(t)return{updatedArray:a.map((e,n)=>n===l?{...e,[o]:t.updatedArray}:e)}}}return null}(e)}$E.displayName="TableTreeFn";const tM=(e,t)=>{if(e===t)return!0;if(null==e||null==t||"object"!=typeof e||"object"!=typeof t)return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const n=Array.isArray(e),r=Array.isArray(t);if(n!==r)return!1;const i=n?e:Object.keys(e),o=r?t:Object.keys(t);if(i.length!==o.length)return!1;if(n)return i.every((e,t)=>tM(e,o[t]));{const n=new Set(o);return i.every(r=>n.has(r)&&tM(e[r],t[r]))}},nM=(e,t)=>!(!Array.isArray(e)||!Array.isArray(t))&&(e.length===t.length&&e.every((e,n)=>{const r=t[n];return tM(e,r)}));function rM(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function iM(e,t){return e&t}function oM(e,t){return e|t}function aM(e,t){return e^t}function lM(e,t){return e&~t}function sM(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 cM(e){for(var t=0;0!=e;)e&=e-1,++t;return t}var dM,uM="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function fM(e){var t,n,r="";for(t=0;t+3<=e.length;t+=3)n=parseInt(e.substring(t,t+3),16),r+=uM.charAt(n>>6)+uM.charAt(63&n);for(t+1==e.length?(n=parseInt(e.substring(t,t+1),16),r+=uM.charAt(n<<2)):t+2==e.length&&(n=parseInt(e.substring(t,t+2),16),r+=uM.charAt(n>>2)+uM.charAt((3&n)<<4));(3&r.length)>0;)r+="=";return r}function hM(e){var t,n="",r=0,i=0;for(t=0;t<e.length&&"="!=e.charAt(t);++t){var o=uM.indexOf(e.charAt(t));o<0||(0==r?(n+=rM(o>>2),i=3&o,r=1):1==r?(n+=rM(i<<2|o>>4),i=15&o,r=2):2==r?(n+=rM(i),n+=rM(o>>2),i=3&o,r=3):(n+=rM(i<<2|o>>4),n+=rM(15&o),r=0))}return 1==r&&(n+=rM(i<<2)),n}var pM,CM=function(e){var t;if(void 0===dM){var n="0123456789ABCDEF",r=" \f\n\r\t \u2028\u2029";for(dM={},t=0;t<16;++t)dM[n.charAt(t)]=t;for(n=n.toLowerCase(),t=10;t<16;++t)dM[n.charAt(t)]=t;for(t=0;t<8;++t)dM[r.charAt(t)]=-1}var i=[],o=0,a=0;for(t=0;t<e.length;++t){var l=e.charAt(t);if("="==l)break;if(-1!=(l=dM[l])){if(void 0===l)throw new Error("Illegal character at offset "+t);o|=l,++a>=2?(i[i.length]=o,o=0,a=0):o<<=4}}if(a)throw new Error("Hex encoding incomplete: 4 bits missing");return i},mM={decode:function(e){var t;if(void 0===pM){var n="= \f\n\r\t \u2028\u2029";for(pM=Object.create(null),t=0;t<64;++t)pM["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t)]=t;for(pM["-"]=62,pM._=63,t=0;t<9;++t)pM[n.charAt(t)]=-1}var r=[],i=0,o=0;for(t=0;t<e.length;++t){var a=e.charAt(t);if("="==a)break;if(-1!=(a=pM[a])){if(void 0===a)throw new Error("Illegal character at offset "+t);i|=a,++o>=4?(r[r.length]=i>>16,r[r.length]=i>>8&255,r[r.length]=255&i,i=0,o=0):i<<=6}}switch(o){case 1:throw new Error("Base64 encoding incomplete: at least 2 bits missing");case 2:r[r.length]=i>>10;break;case 3:r[r.length]=i>>16,r[r.length]=i>>8&255}return r},re:/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,unarmor:function(e){var t=mM.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 mM.decode(e)}},gM=1e13,vM=function(){function e(e){this.buf=[+e||0]}return e.prototype.mulAdd=function(e,t){var n,r,i=this.buf,o=i.length;for(n=0;n<o;++n)(r=i[n]*e+t)<gM?t=0:r-=(t=0|r/gM)*gM,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+=gM,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+=(gM+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*gM+e[n];return t},e.prototype.simplify=function(){var e=this.buf;return 1==e.length?e[0]:this},e}(),yM=/^(\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)?)?$/,wM=/^(\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 bM(e,t){return e.length>t&&(e=e.substring(0,t)+"…"),e}var EM,MM=function(){function e(t,n){this.hexDigits="0123456789ABCDEF",t instanceof e?(this.enc=t.enc,this.pos=t.pos):(this.enc=t,this.pos=n)}return e.prototype.get=function(e){if(void 0===e&&(e=this.pos++),e>=this.enc.length)throw new Error("Requesting byte offset ".concat(e," on a stream of length ").concat(this.enc.length));return"string"==typeof this.enc?this.enc.charCodeAt(e):this.enc[e]},e.prototype.hexByte=function(e){return this.hexDigits.charAt(e>>4&15)+this.hexDigits.charAt(15&e)},e.prototype.hexDump=function(e,t,n){for(var r="",i=e;i<t;++i)if(r+=this.hexByte(this.get(i)),!0!==n)switch(15&i){case 7:r+=" ";break;case 15:r+="\n";break;default:r+=" "}return r},e.prototype.isASCII=function(e,t){for(var n=e;n<t;++n){var r=this.get(n);if(r<32||r>176)return!1}return!0},e.prototype.parseStringISO=function(e,t){for(var n="",r=e;r<t;++r)n+=String.fromCharCode(this.get(r));return n},e.prototype.parseStringUTF=function(e,t){for(var n="",r=e;r<t;){var i=this.get(r++);n+=i<128?String.fromCharCode(i):i>191&&i<224?String.fromCharCode((31&i)<<6|63&this.get(r++)):String.fromCharCode((15&i)<<12|(63&this.get(r++))<<6|63&this.get(r++))}return n},e.prototype.parseStringBMP=function(e,t){for(var n,r,i="",o=e;o<t;)n=this.get(o++),r=this.get(o++),i+=String.fromCharCode(n<<8|r);return i},e.prototype.parseTime=function(e,t,n){var r=this.parseStringISO(e,t),i=(n?yM:wM).exec(r);return i?(n&&(i[1]=+i[1],i[1]+=+i[1]<70?2e3:1900),r=i[1]+"-"+i[2]+"-"+i[3]+" "+i[4],i[5]&&(r+=":"+i[5],i[6]&&(r+=":"+i[6],i[7]&&(r+="."+i[7]))),i[8]&&(r+=" UTC","Z"!=i[8]&&(r+=i[8],i[9]&&(r+=":"+i[9]))),r):"Unrecognized time: "+r},e.prototype.parseInteger=function(e,t){for(var n,r=this.get(e),i=r>127,o=i?255:0,a="";r==o&&++e<t;)r=this.get(e);if(0===(n=t-e))return i?-1:0;if(n>4){for(a=r,n<<=3;!(128&(+a^o));)a=+a<<1,--n;a="("+n+" bit)\n"}i&&(r-=256);for(var l=new vM(r),s=e+1;s<t;++s)l.mulAdd(256,this.get(s));return a+l.toString()},e.prototype.parseBitString=function(e,t,n){for(var r=this.get(e),i="("+((t-e-1<<3)-r)+" bit)\n",o="",a=e+1;a<t;++a){for(var l=this.get(a),s=a==t-1?r:0,c=7;c>=s;--c)o+=l>>c&1?"1":"0";if(o.length>n)return i+bM(o,n)}return i+o},e.prototype.parseOctetString=function(e,t,n){if(this.isASCII(e,t))return bM(this.parseStringISO(e,t),n);var r=t-e,i="("+r+" byte)\n";r>(n/=2)&&(t=e+n);for(var o=e;o<t;++o)i+=this.hexByte(this.get(o));return r>n&&(i+="…"),i},e.prototype.parseOID=function(e,t,n){for(var r="",i=new vM,o=0,a=e;a<t;++a){var l=this.get(a);if(i.mulAdd(128,127&l),o+=7,!(128&l)){if(""===r)if((i=i.simplify())instanceof vM)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 bM(r,n);i=new vM,o=0}}return o>0&&(r+=".incomplete"),r},e}(),AM=function(){function e(e,t,n,r,i){if(!(r instanceof xM))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 bM(this.stream.parseStringUTF(t,t+n),e);case 18:case 19:case 20:case 21:case 22:case 26:return bM(this.stream.parseStringISO(t,t+n),e);case 30:return bM(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 MM?t:new MM(t,0);var r=new MM(n),i=new xM(n),o=e.decodeLength(n),a=n.pos,l=a-r.pos,s=null,c=function(){var t=[];if(null!==o){for(var r=a+o;n.pos<r;)t[t.length]=e.decode(n);if(n.pos!=r)throw new Error("Content size is not correct for container starting at offset "+a)}else try{for(;;){var i=e.decode(n);if(i.tag.isEOC())break;t[t.length]=i}o=a-n.pos}catch(e){throw new Error("Exception while decoding undefined length content: "+e)}return t};if(i.tagConstructed)s=c();else if(i.isUniversal()&&(3==i.tagNumber||4==i.tagNumber))try{if(3==i.tagNumber&&0!=n.get())throw new Error("BIT STRINGs with unused bits cannot encapsulate.");s=c();for(var d=0;d<s.length;++d)if(s[d].tag.isEOC())throw new Error("EOC is not supposed to be actual content.")}catch(e){s=null}if(null===s){if(null===o)throw new Error("We can't skip over an invalid tag with undefined length at offset "+a);n.pos=a+Math.abs(o)}return new e(r,l,o,i,s)},e}(),xM=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 vM;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}(),LM=[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],kM=(1<<26)/LM[LM.length-1],HM=function(){function e(e,t,n){null!=e&&("number"==typeof e?this.fromNumber(e,t,n):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}return e.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var n,r=(1<<t)-1,i=!1,o="",a=this.t,l=this.DB-a*this.DB%t;if(a-- >0)for(l<this.DB&&(n=this[a]>>l)>0&&(i=!0,o=rM(n));a>=0;)l<t?(n=(this[a]&(1<<l)-1)<<t-l,n|=this[--a]>>(l+=this.DB-t)):(n=this[a]>>(l-=t)&r,l<=0&&(l+=this.DB,--a)),n>0&&(i=!0),i&&(o+=rM(n));return i?o:"0"},e.prototype.negate=function(){var t=zM();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)+BM(this[this.t-1]^this.s&this.DM)},e.prototype.mod=function(t){var n=zM();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 _M(t):new VM(t),this.exp(e,n)},e.prototype.clone=function(){var e=zM();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=zM();return this.bitwiseTo(e,iM,t),t},e.prototype.or=function(e){var t=zM();return this.bitwiseTo(e,oM,t),t},e.prototype.xor=function(e){var t=zM();return this.bitwiseTo(e,aM,t),t},e.prototype.andNot=function(e){var t=zM();return this.bitwiseTo(e,lM,t),t},e.prototype.not=function(){for(var e=zM(),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=zM();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},e.prototype.shiftRight=function(e){var t=zM();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+sM(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+=cM(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,oM)},e.prototype.clearBit=function(e){return this.changeBit(e,lM)},e.prototype.flipBit=function(e){return this.changeBit(e,aM)},e.prototype.add=function(e){var t=zM();return this.addTo(e,t),t},e.prototype.subtract=function(e){var t=zM();return this.subTo(e,t),t},e.prototype.multiply=function(e){var t=zM();return this.multiplyTo(e,t),t},e.prototype.divide=function(e){var t=zM();return this.divRemTo(e,t,null),t},e.prototype.remainder=function(e){var t=zM();return this.divRemTo(e,null,t),t},e.prototype.divideAndRemainder=function(e){var t=zM(),n=zM();return this.divRemTo(e,t,n),[t,n]},e.prototype.modPow=function(e,t){var n,r,i=e.bitLength(),o=RM(1);if(i<=0)return o;n=i<18?1:i<48?3:i<144?4:i<768?5:6,r=i<8?new _M(t):t.isEven()?new OM(t):new VM(t);var a=[],l=3,s=n-1,c=(1<<n)-1;if(a[1]=r.convert(this),n>1){var d=zM();for(r.sqrTo(a[1],d);l<=c;)a[l]=zM(),r.mulTo(d,a[l-2],a[l]),l+=2}var u,f,h=e.t-1,p=!0,C=zM();for(i=BM(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),p)a[u].copyTo(o),p=!1;else{for(;l>1;)r.sqrTo(o,C),r.sqrTo(C,o),l-=2;l>0?r.sqrTo(o,C):(f=o,o=C,C=f),r.mulTo(C,a[u],o)}for(;h>=0&&!(e[h]&1<<i);)r.sqrTo(o,C),f=o,o=C,C=f,--i<0&&(i=this.DB-1,--h)}return r.revert(o)},e.prototype.modInverse=function(t){var n=t.isEven();if(this.isEven()&&n||0==t.signum())return e.ZERO;for(var r=t.clone(),i=this.clone(),o=RM(1),a=RM(0),l=RM(0),s=RM(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),n?(o.isEven()&&a.isEven()||(o.addTo(this,o),a.subTo(t,a)),o.rShiftTo(1,o)):a.isEven()||a.subTo(t,a),a.rShiftTo(1,a);for(;i.isEven();)i.rShiftTo(1,i),n?(l.isEven()&&s.isEven()||(l.addTo(this,l),s.subTo(t,s)),l.rShiftTo(1,l)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);r.compareTo(i)>=0?(r.subTo(i,r),n&&o.subTo(l,o),a.subTo(s,a)):(i.subTo(r,i),n&&l.subTo(o,l),s.subTo(a,s))}return 0!=i.compareTo(e.ONE)?e.ZERO:s.compareTo(t)>=0?s.subtract(t):s.signum()<0?(s.addTo(t,s),s.signum()<0?s.add(t):s):s},e.prototype.pow=function(e){return this.exp(e,new SM)},e.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),n=e.s<0?e.negate():e.clone();if(t.compareTo(n)<0){var r=t;t=n,n=r}var i=t.getLowestSetBit(),o=n.getLowestSetBit();if(o<0)return t;for(i<o&&(o=i),o>0&&(t.rShiftTo(o,t),n.rShiftTo(o,n));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=n.getLowestSetBit())>0&&n.rShiftTo(i,n),t.compareTo(n)>=0?(t.subTo(n,t),t.rShiftTo(1,t)):(n.subTo(t,n),n.rShiftTo(1,n));return o>0&&n.lShiftTo(o,n),n},e.prototype.isProbablePrime=function(e){var t,n=this.abs();if(1==n.t&&n[0]<=LM[LM.length-1]){for(t=0;t<LM.length;++t)if(n[0]==LM[t])return!0;return!1}if(n.isEven())return!1;for(t=1;t<LM.length;){for(var r=LM[t],i=t+1;i<LM.length&&r<kM;)r*=LM[i++];for(r=n.modInt(r);t<i;)if(r%LM[t++]==0)return!1}return n.millerRabin(e)},e.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},e.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},e.prototype.fromString=function(t,n){var r;if(16==n)r=4;else if(8==n)r=3;else if(256==n)r=8;else if(2==n)r=1;else if(32==n)r=5;else{if(4!=n)return void this.fromRadix(t,n);r=2}this.t=0,this.s=0;for(var i=t.length,o=!1,a=0;--i>=0;){var l=8==r?255&+t[i]:jM(t,i);l<0?"-"==t.charAt(i)&&(o=!0):(o=!1,0==a?this[this.t++]=l:a+r>this.DB?(this[this.t-1]|=(l&(1<<this.DB-a)-1)<<a,this[this.t++]=l>>this.DB-a):this[this.t-1]|=l<<a,(a+=r)>=this.DB&&(a-=this.DB))}8==r&&128&+t[0]&&(this.s=-1,a>0&&(this[this.t-1]|=(1<<this.DB-a)-1<<a)),this.clamp(),o&&e.ZERO.subTo(this,this)},e.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t},e.prototype.dlShiftTo=function(e,t){var n;for(n=this.t-1;n>=0;--n)t[n+e]=this[n];for(n=e-1;n>=0;--n)t[n]=0;t.t=this.t+e,t.s=this.s},e.prototype.drShiftTo=function(e,t){for(var n=e;n<this.t;++n)t[n-e]=this[n];t.t=Math.max(this.t-e,0),t.s=this.s},e.prototype.lShiftTo=function(e,t){for(var n=e%this.DB,r=this.DB-n,i=(1<<r)-1,o=Math.floor(e/this.DB),a=this.s<<n&this.DM,l=this.t-1;l>=0;--l)t[l+o+1]=this[l]>>r|a,a=(this[l]&i)<<n;for(l=o-1;l>=0;--l)t[l]=0;t[o]=a,t.t=this.t+o+1,t.s=this.s,t.clamp()},e.prototype.rShiftTo=function(e,t){t.s=this.s;var n=Math.floor(e/this.DB);if(n>=this.t)t.t=0;else{var r=e%this.DB,i=this.DB-r,o=(1<<r)-1;t[0]=this[n]>>r;for(var a=n+1;a<this.t;++a)t[a-n-1]|=(this[a]&o)<<i,t[a-n]=this[a]>>r;r>0&&(t[this.t-n-1]|=(this.s&o)<<i),t.t=this.t-n,t.clamp()}},e.prototype.subTo=function(e,t){for(var n=0,r=0,i=Math.min(e.t,this.t);n<i;)r+=this[n]-e[n],t[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r-=e.s;n<this.t;)r+=this[n],t[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<e.t;)r-=e[n],t[n++]=r&this.DM,r>>=this.DB;r-=e.s}t.s=r<0?-1:0,r<-1?t[n++]=this.DV+r:r>0&&(t[n++]=r),t.t=n,t.clamp()},e.prototype.multiplyTo=function(t,n){var r=this.abs(),i=t.abs(),o=r.t;for(n.t=o+i.t;--o>=0;)n[o]=0;for(o=0;o<i.t;++o)n[o+r.t]=r.am(0,i[o],n,o,0,r.t);n.s=0,n.clamp(),this.s!=t.s&&e.ZERO.subTo(n,n)},e.prototype.squareTo=function(e){for(var t=this.abs(),n=e.t=2*t.t;--n>=0;)e[n]=0;for(n=0;n<t.t-1;++n){var r=t.am(n,t[n],e,2*n,0,1);(e[n+t.t]+=t.am(n+1,2*t[n],e,2*n+1,r,t.t-n-1))>=t.DV&&(e[n+t.t]-=t.DV,e[n+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(n,t[n],e,2*n,0,1)),e.s=0,e.clamp()},e.prototype.divRemTo=function(t,n,r){var i=t.abs();if(!(i.t<=0)){var o=this.abs();if(o.t<i.t)return null!=n&&n.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=zM());var a=zM(),l=this.s,s=t.s,c=this.DB-BM(i[i.t-1]);c>0?(i.lShiftTo(c,a),o.lShiftTo(c,r)):(i.copyTo(a),o.copyTo(r));var d=a.t,u=a[d-1];if(0!=u){var f=u*(1<<this.F1)+(d>1?a[d-2]>>this.F2:0),h=this.FV/f,p=(1<<this.F1)/f,C=1<<this.F2,m=r.t,g=m-d,v=null==n?zM():n;for(a.dlShiftTo(g,v),r.compareTo(v)>=0&&(r[r.t++]=1,r.subTo(v,r)),e.ONE.dlShiftTo(d,v),v.subTo(a,a);a.t<d;)a[a.t++]=0;for(;--g>=0;){var y=r[--m]==u?this.DM:Math.floor(r[m]*h+(r[m-1]+C)*p);if((r[m]+=a.am(0,y,r,g,0,d))<y)for(a.dlShiftTo(g,v),r.subTo(v,r);r[m]<--y;)r.subTo(v,r)}null!=n&&(r.drShiftTo(d,n),l!=s&&e.ZERO.subTo(n,n)),r.t=d,r.clamp(),c>0&&r.rShiftTo(c,r),l<0&&e.ZERO.subTo(r,r)}}},e.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(!(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},e.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},e.prototype.exp=function(t,n){if(t>4294967295||t<1)return e.ONE;var r=zM(),i=zM(),o=n.convert(this),a=BM(t)-1;for(o.copyTo(r);--a>=0;)if(n.sqrTo(r,i),(t&1<<a)>0)n.mulTo(i,o,r);else{var l=r;r=i,i=l}return n.revert(r)},e.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},e.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),n=Math.pow(e,t),r=RM(n),i=zM(),o=zM(),a="";for(this.divRemTo(r,i,o);i.signum()>0;)a=(n+o.intValue()).toString(e).substring(1)+a,i.divRemTo(r,i,o);return o.intValue().toString(e)+a},e.prototype.fromRadix=function(t,n){this.fromInt(0),null==n&&(n=10);for(var r=this.chunkSize(n),i=Math.pow(n,r),o=!1,a=0,l=0,s=0;s<t.length;++s){var c=jM(t,s);c<0?"-"==t.charAt(s)&&0==this.signum()&&(o=!0):(l=n*l+c,++a>=r&&(this.dMultiply(i),this.dAddOffset(l,0),a=0,l=0))}a>0&&(this.dMultiply(Math.pow(n,a)),this.dAddOffset(l,0)),o&&e.ZERO.subTo(this,this)},e.prototype.fromNumber=function(t,n,r){if("number"==typeof n)if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(e.ONE.shiftLeft(t-1),oM,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(n);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(e.ONE.shiftLeft(t-1),this);else{var i=[],o=7&t;i.length=1+(t>>3),n.nextBytes(i),o>0?i[0]&=(1<<o)-1:i[0]=0,this.fromString(i,256)}},e.prototype.bitwiseTo=function(e,t,n){var r,i,o=Math.min(e.t,this.t);for(r=0;r<o;++r)n[r]=t(this[r],e[r]);if(e.t<this.t){for(i=e.s&this.DM,r=o;r<this.t;++r)n[r]=t(this[r],i);n.t=this.t}else{for(i=this.s&this.DM,r=o;r<e.t;++r)n[r]=t(i,e[r]);n.t=e.t}n.s=t(this.s,e.s),n.clamp()},e.prototype.changeBit=function(t,n){var r=e.ONE.shiftLeft(t);return this.bitwiseTo(r,n,r),r},e.prototype.addTo=function(e,t){for(var n=0,r=0,i=Math.min(e.t,this.t);n<i;)r+=this[n]+e[n],t[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r+=e.s;n<this.t;)r+=this[n],t[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<e.t;)r+=e[n],t[n++]=r&this.DM,r>>=this.DB;r+=e.s}t.s=r<0?-1:0,r>0?t[n++]=r:r<-1&&(t[n++]=this.DV+r),t.t=n,t.clamp()},e.prototype.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},e.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},e.prototype.multiplyLowerTo=function(e,t,n){var r=Math.min(this.t+e.t,t);for(n.s=0,n.t=r;r>0;)n[--r]=0;for(var i=n.t-this.t;r<i;++r)n[r+this.t]=this.am(0,e[r],n,r,0,this.t);for(i=Math.min(e.t,t);r<i;++r)this.am(0,e[r],n,r,0,t-r);n.clamp()},e.prototype.multiplyUpperTo=function(e,t,n){--t;var r=n.t=this.t+e.t-t;for(n.s=0;--r>=0;)n[r]=0;for(r=Math.max(t-this.t,0);r<e.t;++r)n[this.t+r-t]=this.am(t-r,e[r],n,0,0,this.t+r-t);n.clamp(),n.drShiftTo(1,n)},e.prototype.modInt=function(e){if(e<=0)return 0;var t=this.DV%e,n=this.s<0?e-1:0;if(this.t>0)if(0==t)n=this[0]%e;else for(var r=this.t-1;r>=0;--r)n=(t*n+this[r])%e;return n},e.prototype.millerRabin=function(t){var n=this.subtract(e.ONE),r=n.getLowestSetBit();if(r<=0)return!1;var i=n.shiftRight(r);(t=t+1>>1)>LM.length&&(t=LM.length);for(var o=zM(),a=0;a<t;++a){o.fromInt(LM[Math.floor(Math.random()*LM.length)]);var l=o.modPow(i,this);if(0!=l.compareTo(e.ONE)&&0!=l.compareTo(n)){for(var s=1;s++<r&&0!=l.compareTo(n);)if(0==(l=l.modPowInt(2,this)).compareTo(e.ONE))return!1;if(0!=l.compareTo(n))return!1}}return!0},e.prototype.square=function(){var e=zM();return this.squareTo(e),e},e.prototype.gcda=function(e,t){var n=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(n.compareTo(r)<0){var i=n;n=r,r=i}var o=n.getLowestSetBit(),a=r.getLowestSetBit();if(a<0)t(n);else{o<a&&(a=o),a>0&&(n.rShiftTo(a,n),r.rShiftTo(a,r));var l=function(){(o=n.getLowestSetBit())>0&&n.rShiftTo(o,n),(o=r.getLowestSetBit())>0&&r.rShiftTo(o,r),n.compareTo(r)>=0?(n.subTo(r,n),n.rShiftTo(1,n)):(r.subTo(n,r),r.rShiftTo(1,r)),n.signum()>0?setTimeout(l,0):(a>0&&r.lShiftTo(a,r),setTimeout(function(){t(r)},0))};setTimeout(l,10)}},e.prototype.fromNumberAsync=function(t,n,r,i){if("number"==typeof n)if(t<2)this.fromInt(1);else{this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(e.ONE.shiftLeft(t-1),oM,this),this.isEven()&&this.dAddOffset(1,0);var o=this,a=function(){o.dAddOffset(2,0),o.bitLength()>t&&o.subTo(e.ONE.shiftLeft(t-1),o),o.isProbablePrime(n)?setTimeout(function(){i()},0):setTimeout(a,0)};setTimeout(a,0)}else{var l=[],s=7&t;l.length=1+(t>>3),n.nextBytes(l),s>0?l[0]&=(1<<s)-1:l[0]=0,this.fromString(l,256)}},e}(),SM=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}(),_M=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}(),VM=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=zM();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(HM.ZERO)>0&&this.m.subTo(t,t),t},e.prototype.revert=function(e){var t=zM();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}(),OM=function(){function e(e){this.m=e,this.r2=zM(),this.q3=zM(),HM.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=zM();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 zM(){return new HM(null)}function NM(e,t){return new HM(e,t)}var IM="undefined"!=typeof navigator;IM&&"Microsoft Internet Explorer"==navigator.appName?(HM.prototype.am=function(e,t,n,r,i,o){for(var a=32767&t,l=t>>15;--o>=0;){var s=32767&this[e],c=this[e++]>>15,d=l*s+c*a;i=((s=a*s+((32767&d)<<15)+n[r]+(1073741823&i))>>>30)+(d>>>15)+l*c+(i>>>30),n[r++]=1073741823&s}return i},EM=30):IM&&"Netscape"!=navigator.appName?(HM.prototype.am=function(e,t,n,r,i,o){for(;--o>=0;){var a=t*this[e++]+n[r]+i;i=Math.floor(a/67108864),n[r++]=67108863&a}return i},EM=26):(HM.prototype.am=function(e,t,n,r,i,o){for(var a=16383&t,l=t>>14;--o>=0;){var s=16383&this[e],c=this[e++]>>14,d=l*s+c*a;i=((s=a*s+((16383&d)<<14)+n[r]+i)>>28)+(d>>14)+l*c,n[r++]=268435455&s}return i},EM=28),HM.prototype.DB=EM,HM.prototype.DM=(1<<EM)-1,HM.prototype.DV=1<<EM;HM.prototype.FV=Math.pow(2,52),HM.prototype.F1=52-EM,HM.prototype.F2=2*EM-52;var TM,DM,ZM=[];for(TM="0".charCodeAt(0),DM=0;DM<=9;++DM)ZM[TM++]=DM;for(TM="a".charCodeAt(0),DM=10;DM<36;++DM)ZM[TM++]=DM;for(TM="A".charCodeAt(0),DM=10;DM<36;++DM)ZM[TM++]=DM;function jM(e,t){var n=ZM[e.charCodeAt(t)];return null==n?-1:n}function RM(e){var t=zM();return t.fromInt(e),t}function BM(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}HM.ZERO=RM(0),HM.ONE=RM(1);var PM=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 FM,UM,qM=null;if(null==qM){qM=[],UM=0;var WM=void 0;if("undefined"!=typeof window&&self.crypto&&self.crypto.getRandomValues){var QM=new Uint32Array(256);for(self.crypto.getRandomValues(QM),WM=0;WM<QM.length;++WM)qM[UM++]=255&QM[WM]}var GM=0,KM=function(e){if((GM=GM||0)>=256||UM>=256)self.removeEventListener?self.removeEventListener("mousemove",KM,!1):self.detachEvent&&self.detachEvent("onmousemove",KM);else try{var t=e.x+e.y;qM[UM++]=255&t,GM+=1}catch(e){}};"undefined"!=typeof window&&(self.addEventListener?self.addEventListener("mousemove",KM,!1):self.attachEvent&&self.attachEvent("onmousemove",KM))}function YM(){if(null==FM){for(FM=new PM;UM<256;){var e=Math.floor(65536*Math.random());qM[UM++]=255&e}for(FM.init(qM),UM=0;UM<qM.length;++UM)qM[UM]=0;UM=0}return FM.next()}var XM=function(){function e(){}return e.prototype.nextBytes=function(e){for(var t=0;t<e.length;++t)e[t]=YM()},e}();function JM(e){return function(e){for(var t="",n=0;n<32*e.length;n+=8)t+=String.fromCharCode(e[n>>5]>>>24-n%32&255);return t}(function(e,t){var n,r,i,o,a,l,s,c,d,u,f,h,p=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),C=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=p[0],r=p[1],i=p[2],o=p[3],a=p[4],l=p[5],s=p[6],c=p[7],u=0;u<64;u++)C[u]=u<16?e[u+d]:cA(cA(cA(lA(C[u-2]),C[u-7]),aA(C[u-15])),C[u-16]),f=cA(cA(cA(cA(c,oA(a)),nA(a,l,s)),sA[u]),C[u]),h=cA(iA(n),rA(n,r,i)),c=s,s=l,l=a,a=cA(o,f),o=i,i=r,r=n,n=cA(f,h);p[0]=cA(n,p[0]),p[1]=cA(r,p[1]),p[2]=cA(i,p[2]),p[3]=cA(o,p[3]),p[4]=cA(a,p[4]),p[5]=cA(l,p[5]),p[6]=cA(s,p[6]),p[7]=cA(c,p[7])}return p}(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 $M(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 eA(e,t){return e>>>t|e<<32-t}function tA(e,t){return e>>>t}function nA(e,t,n){return e&t^~e&n}function rA(e,t,n){return e&t^e&n^t&n}function iA(e){return eA(e,2)^eA(e,13)^eA(e,22)}function oA(e){return eA(e,6)^eA(e,11)^eA(e,25)}function aA(e){return eA(e,7)^eA(e,18)^tA(e,3)}function lA(e){return eA(e,17)^eA(e,19)^tA(e,10)}var sA=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 cA(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function dA(e,t){if(t<e.length+11)return console.error("Message too long for RSA"),null;for(var n=[],r=e.length-1;r>=0&&t>0;){var i=e.charCodeAt(r--);i<128?n[--t]=i:i>127&&i<2048?(n[--t]=63&i|128,n[--t]=i>>6|192):(n[--t]=63&i|128,n[--t]=i>>6&63|128,n[--t]=i>>12|224)}n[--t]=0;for(var o=new XM,a=[];t>2;){for(a[0]=0;0==a[0];)o.nextBytes(a);n[--t]=a[0]}return n[--t]=2,n[--t]=0,new HM(n)}function uA(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 fA(e,t){var n=JM;if(e.length+64+2>t)throw"Message too long for RSA";var r,i="";for(r=0;r<t-e.length-64-2;r+=1)i+="\0";var o=n("")+i+""+e,a=new Array(32);(new XM).nextBytes(a);var l=uA(a,o.length,n),s=[];for(r=0;r<o.length;r+=1)s[r]=o.charCodeAt(r)^l.charCodeAt(r);var c=uA(s,a.length,n),d=[0];for(r=0;r<a.length;r+=1)d[r+1]=a[r]^c.charCodeAt(r);return new HM(d.concat(s))}var hA=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=NM(e,16),this.e=parseInt(t,16)):console.error("Invalid RSA public key")},e.prototype.encrypt=function(e,t){void 0===t&&(t=dA);var n=this.n.bitLength()+7>>3,r=t(e,n);if(null==r)return null;var i=this.doPublic(r);if(null==i)return null;for(var o=i.toString(16),a=o.length,l=0;l<2*n-a;l++)o="0"+o;return o},e.prototype.setPrivate=function(e,t,n){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=NM(e,16),this.e=parseInt(t,16),this.d=NM(n,16)):console.error("Invalid RSA private key")},e.prototype.setPrivateEx=function(e,t,n,r,i,o,a,l){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=NM(e,16),this.e=parseInt(t,16),this.d=NM(n,16),this.p=NM(r,16),this.q=NM(i,16),this.dmp1=NM(o,16),this.dmq1=NM(a,16),this.coeff=NM(l,16)):console.error("Invalid RSA private key")},e.prototype.generate=function(e,t){var n=new XM,r=e>>1;this.e=parseInt(t,16);for(var i=new HM(t,16);;){for(;this.p=new HM(e-r,1,n),0!=this.p.subtract(HM.ONE).gcd(i).compareTo(HM.ONE)||!this.p.isProbablePrime(10););for(;this.q=new HM(r,1,n),0!=this.q.subtract(HM.ONE).gcd(i).compareTo(HM.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var o=this.p;this.p=this.q,this.q=o}var a=this.p.subtract(HM.ONE),l=this.q.subtract(HM.ONE),s=a.multiply(l);if(0==s.gcd(i).compareTo(HM.ONE)){this.n=this.p.multiply(this.q),this.d=i.modInverse(s),this.dmp1=this.d.mod(a),this.dmq1=this.d.mod(l),this.coeff=this.q.modInverse(this.p);break}}},e.prototype.decrypt=function(e){var t=NM(e,16),n=this.doPrivate(t);return null==n?null:function(e,t){var n=e.toByteArray(),r=0;for(;r<n.length&&0==n[r];)++r;if(n.length-r!=t-1||2!=n[r])return null;++r;for(;0!=n[r];)if(++r>=n.length)return null;var i="";for(;++r<n.length;){var o=255&n[r];o<128?i+=String.fromCharCode(o):o>191&&o<224?(i+=String.fromCharCode((31&o)<<6|63&n[r+1]),++r):(i+=String.fromCharCode((15&o)<<12|(63&n[r+1])<<6|63&n[r+2]),r+=2)}return i}(n,this.n.bitLength()+7>>3)},e.prototype.generateAsync=function(e,t,n){var r=new XM,i=e>>1;this.e=parseInt(t,16);var o=new HM(t,16),a=this,l=function(){var t=function(){if(a.p.compareTo(a.q)<=0){var e=a.p;a.p=a.q,a.q=e}var t=a.p.subtract(HM.ONE),r=a.q.subtract(HM.ONE),i=t.multiply(r);0==i.gcd(o).compareTo(HM.ONE)?(a.n=a.p.multiply(a.q),a.d=o.modInverse(i),a.dmp1=a.d.mod(t),a.dmq1=a.d.mod(r),a.coeff=a.q.modInverse(a.p),setTimeout(function(){n()},0)):setTimeout(l,0)},s=function(){a.q=zM(),a.q.fromNumberAsync(i,1,r,function(){a.q.subtract(HM.ONE).gcda(o,function(e){0==e.compareTo(HM.ONE)&&a.q.isProbablePrime(10)?setTimeout(t,0):setTimeout(s,0)})})},c=function(){a.p=zM(),a.p.fromNumberAsync(e-i,1,r,function(){a.p.subtract(HM.ONE).gcda(o,function(e){0==e.compareTo(HM.ONE)&&a.p.isProbablePrime(10)?setTimeout(s,0):setTimeout(c,0)})})};setTimeout(c,0)};setTimeout(l,0)},e.prototype.sign=function(e,t,n){var r=(pA[n]||"")+t(e).toString(),i=this.n.bitLength()/4,o=function(e,t){if(t<e.length+22)return console.error("Message too long for RSA"),null;for(var n=t-e.length-6,r="",i=0;i<n;i+=2)r+="ff";return NM("0001"+r+"00"+e,16)}(r,i);if(null==o)return null;var a=this.doPrivate(o);if(null==a)return null;for(var l=a.toString(16),s=l.length,c=0;c<i-s;c++)l="0"+l;return l},e.prototype.verify=function(e,t,n){var r=NM(t,16),i=this.doPublic(r);return null==i?null:function(e){for(var t in pA)if(pA.hasOwnProperty(t)){var n=pA[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 pA={md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",ripemd160:"3021300906052b2403020105000414"};function CA(e,t,n){if(!t||!e)throw new Error("extend failed, please check that all dependencies are included.");var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e,e.superclass=t.prototype,t.prototype.constructor==Object.prototype.constructor&&(t.prototype.constructor=t)}
|
|
28
|
+
*/function Ig(){return Og||(Og=1,e=Ng,"production"!==process.env.NODE_ENV&&function(){function t(e,t){var n=e.length;e.push(t),function(e,t,n){for(var r=n;r>0;){var o=r-1>>>1,a=e[o];if(!(i(a,t)>0))return;e[o]=t,e[r]=a,r=o}}(e,t,n)}function n(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();return n!==t&&(e[0]=n,function(e,t,n){for(var r=n,o=e.length,a=o>>>1;r<a;){var l=2*(r+1)-1,s=e[l],c=l+1,d=e[c];if(i(s,t)<0)c<o&&i(d,s)<0?(e[r]=d,e[c]=t,r=c):(e[r]=s,e[l]=t,r=l);else{if(!(c<o&&i(d,t)<0))return;e[r]=d,e[c]=t,r=c}}}(e,n,0)),t}function i(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error),"object"==typeof performance&&"function"==typeof performance.now){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var s=[],c=[],d=1,u=null,f=3,h=!1,p=!1,C=!1,m="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))return;r(c),i.sortIndex=i.expirationTime,t(s,i)}i=n(c)}}function w(e){if(C=!1,y(e),!p)if(null!==n(s))p=!0,O(b);else{var t=n(c);null!==t&&z(w,t.startTime-e)}}function b(t,i){p=!1,C&&(C=!1,N()),h=!0;var o=f;try{return function(t,i){var o=i;for(y(o),u=n(s);null!==u&&(!(u.expirationTime>o)||t&&!k());){var a=u.callback;if("function"==typeof a){u.callback=null,f=u.priorityLevel;var l=a(u.expirationTime<=o);o=e.unstable_now(),"function"==typeof l?u.callback=l:u===n(s)&&r(s),y(o)}else r(s);u=n(s)}if(null!==u)return!0;var d=n(c);return null!==d&&z(w,d.startTime-o),!1}(t,i)}finally{u=null,f=o,h=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var E=!1,M=null,A=-1,x=5,L=-1;function k(){return!(e.unstable_now()-L<x)}var H,S=function(){if(null!==M){var t=e.unstable_now();L=t;var n=!0;try{n=M(!0,t)}finally{n?H():(E=!1,M=null)}}else E=!1};if("function"==typeof v)H=function(){v(S)};else if("undefined"!=typeof MessageChannel){var _=new MessageChannel,V=_.port2;_.port1.onmessage=S,H=function(){V.postMessage(null)}}else H=function(){m(S,0)};function O(e){M=e,E||(E=!0,H())}function z(t,n){A=m(function(){t(e.unstable_now())},n)}function N(){g(A),A=-1}var I=function(){};e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){p||h||(p=!0,O(b))},e.unstable_forceFrameRate=function(e){e<0||e>125?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):x=e>0?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(s)},e.unstable_next=function(e){var t;switch(f){case 1:case 2:case 3:t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=I,e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,o){var a,l,u=e.unstable_now();if("object"==typeof o&&null!==o){var f=o.delay;a="number"==typeof f&&f>0?u+f:u}else a=u;switch(r){case 1:l=-1;break;case 2:l=250;break;case 5:l=1073741823;break;case 4:l=1e4;break;default:l=5e3}var m=a+l,g={id:d++,callback:i,priorityLevel:r,startTime:a,expirationTime:m,sortIndex:-1};return a>u?(g.sortIndex=a,t(c,g),null===n(s)&&g===n(c)&&(C?N():C=!0,z(w,a-u))):(g.sortIndex=m,t(s,g),p||h||(p=!0,O(b))),g},e.unstable_shouldYield=k,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Ng;var e}var Tg=(zg||(zg=1,"production"===process.env.NODE_ENV?_g.exports=(Sg||(Sg=1,function(e){function t(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,o=e[r];if(!(0<i(o,t)))break e;e[r]=t,e[n]=o,n=r}}function n(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length,a=o>>>1;r<a;){var l=2*(r+1)-1,s=e[l],c=l+1,d=e[c];if(0>i(s,n))c<o&&0>i(d,s)?(e[r]=d,e[c]=n,r=c):(e[r]=s,e[l]=n,r=l);else{if(!(c<o&&0>i(d,n)))break e;e[r]=d,e[c]=n,r=c}}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var s=[],c=[],d=1,u=null,f=3,h=!1,p=!1,C=!1,m="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(C=!1,y(e),!p)if(null!==n(s))p=!0,O(b);else{var t=n(c);null!==t&&z(w,t.startTime-e)}}function b(t,i){p=!1,C&&(C=!1,g(x),x=-1),h=!0;var o=f;try{for(y(i),u=n(s);null!==u&&(!(u.expirationTime>i)||t&&!H());){var a=u.callback;if("function"==typeof a){u.callback=null,f=u.priorityLevel;var l=a(u.expirationTime<=i);i=e.unstable_now(),"function"==typeof l?u.callback=l:u===n(s)&&r(s),y(i)}else r(s);u=n(s)}if(null!==u)var d=!0;else{var m=n(c);null!==m&&z(w,m.startTime-i),d=!1}return d}finally{u=null,f=o,h=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var E,M=!1,A=null,x=-1,L=5,k=-1;function H(){return!(e.unstable_now()-k<L)}function S(){if(null!==A){var t=e.unstable_now();k=t;var n=!0;try{n=A(!0,t)}finally{n?E():(M=!1,A=null)}}else M=!1}if("function"==typeof v)E=function(){v(S)};else if("undefined"!=typeof MessageChannel){var _=new MessageChannel,V=_.port2;_.port1.onmessage=S,E=function(){V.postMessage(null)}}else E=function(){m(S,0)};function O(e){A=e,M||(M=!0,E())}function z(t,n){x=m(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){p||h||(p=!0,O(b))},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(s)},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,o){var a=e.unstable_now();switch(o="object"==typeof o&&null!==o&&"number"==typeof(o=o.delay)&&0<o?a+o:a,r){case 1:var l=-1;break;case 2:l=250;break;case 5:l=1073741823;break;case 4:l=1e4;break;default:l=5e3}return r={id:d++,callback:i,priorityLevel:r,startTime:o,expirationTime:l=o+l,sortIndex:-1},o>a?(r.sortIndex=o,t(c,r),null===n(s)&&r===n(c)&&(C?(g(x),x=-1):C=!0,z(w,o-a))):(r.sortIndex=l,t(s,r),p||h||(p=!0,O(b))),r},e.unstable_shouldYield=H,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}}(Vg)),Vg):_g.exports=Ig()),_g.exports);const Dg=Symbol(),Zg=Symbol(),jg="undefined"==typeof window||/ServerSideRendering/.test(window.navigator&&window.navigator.userAgent)?l:u,Rg=Tg.unstable_runWithPriority?e=>{try{Tg.unstable_runWithPriority(Tg.unstable_NormalPriority,e)}catch(t){if("Not implemented."!==t.message)throw t;e()}}:e=>e();function Bg(e,t){const n=d(e)[Dg];if("object"==typeof process&&"production"!==process.env.NODE_ENV&&!n)throw new Error("useContextSelector requires special context");const{v:{current:r},n:{current:i},l:o}=n,a=t(r),[l,s]=v((e,n)=>{if(!n)return[r,a];if("p"in n)throw n.p;if(n.n===i)return Object.is(e[1],a)?e:[r,a];try{if("v"in n){if(Object.is(e[0],n.v))return e;const r=t(n.v);return Object.is(e[1],r)?e:[n.v,r]}}catch(e){}return[...e]},[r,a]);return Object.is(l[1],a)||s(),jg(()=>(o.add(s),()=>{o.delete(s)}),[o]),l[1]}const Pg=function(e){const t=s({[Dg]:{v:{current:e},n:{current:-1},l:new Set,u:e=>e()}});var n;return t[Zg]=t.Provider,t.Provider=(n=t.Provider,({value:e,children:t})=>{const r=a(e),i=a(0),[o,l]=c(null);o&&(o(e),l(null));const s=a();if(!s.current){const e=new Set,t=(t,n)=>{i.current+=1;const r={n:i.current};(null==n?void 0:n.suspense)&&(r.n*=-1,r.p=new Promise(e=>{l(()=>t=>{r.v=t,delete r.p,e(t)})})),e.forEach(e=>e(r)),t()};s.current={[Dg]:{v:r,n:i,l:e,u:t}}}return jg(()=>{r.current=e,i.current+=1,Rg(()=>{s.current[Dg].l.forEach(t=>{t({n:i.current,v:e})})})},[e]),C(n,{value:s.current},t)}),delete t.Consumer,t}([kg,()=>{}]),Fg=({children:t,useTableRef:n,totalWidth:r})=>{const i=a(null);return l(()=>{n&&i.current&&n(i)},[n]),e("table",{className:"ff-spreadsheet-table",ref:i,style:{minWidth:`${60+r}px`,tableLayout:"fixed"},children:t})},Ug=t=>e("tr",{...t}),qg=t=>e("tr",{className:"ff-spreadsheet-row-header",...t});function Wg(){return Bg(Pg,([,e])=>e)}function Qg(e){return Bg(Pg,([t])=>e(t))}const Gg=({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:z("corner-header",{"ff-spreadsheet-header--selected":t}),children:e(P,{variant:t?"dark":"light",color:t?"var(--hover-color)":"var(--text-color)",name:"excel_corner_menu"})})})},Kg=t=>function(n){const i=Wg(),o=r.useCallback(()=>i({type:Dp}),[i]),a=Qg(e=>e.selected instanceof wm);return e(t,{...n,selected:a,onSelect:o})},Yg=t=>function(n){const i=Wg(),o=r.useCallback((e,t)=>i(function(e,t){return{type:Tp,payload:{column:e,extend:t}}}(e,t)),[i]),a=Qg(e=>e.selected.hasEntireColumn(n.column)),l=Qg(e=>e.selectedColumn??void 0),s=Qg(e=>e.active?nm(e.active,e.model.data):void 0);return e(t,{...n,cell:s,selected:a,selectedColumn:l,onSelect:o,scrollToColumn:n.scrollToColumn})},Xg=Yg(({column:t,label:i,selected:o,onSelect:a,setContextMenu:l,deleteColumn:s,addColumnLeft:c,addColumnRight:d,columnContextEnable:u,cell:f,selectedColumn:p,minimumColumnWidth:C,maxColLimit:m,disableDeleteOption:g,contextMenu:v,onAddColumn:y,onDeleteColumn:w,setVisibleRange:b,scrollToColumn:E})=>{const M=Wg(),A=Qg(e=>e.model.data),x=C,L=Qg(e=>e.columnDimensions[t]?.width||x),k=Qg(e=>e.model.data),{columnCount:H}=Km(k),S=e=>{b(t=>{const n={...t,end:"increment"===e?t.end+1:t.end-1};return p&&E(p),n})},_=h(()=>[{label:"Add Column Left",value:"Add Column Left",iconName:"plus_icon",action:()=>{S("increment"),c(x),y?.(p??t,!0)},disableTooltip:"Column limit reached",visible:f?.contextDisable?.["Add Column Left"]??!1,disable:H>=m},{label:"Add Column Right",value:"Add Column Right",iconName:"plus_icon",action:()=>{S("increment"),d(x),y?.(p??t,!1)},disableTooltip:"Column limit reached",visible:f?.contextDisable?.["Add Column Right"]??!1,disable:H>=m},...g?[]:[{label:"Delete Column",value:"Delete Column",iconName:"delete",action:()=>{S("decrement"),s(),w?.(p??t)},disableTooltip:"",visible:f?.contextDisable?.["Delete Column"]??!1,disable:!1}]],[p,t,A]),V=r.useCallback((e,n)=>{const r=n?t-1:t,i=Math.max(r,0);a(i,e.shiftKey);const o=e.clientX,l=L,s=e=>{const t=Math.max(x,l+(e.clientX-o));M(xC(i,t))},c=()=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",c),M(JC())};document.addEventListener("mousemove",s),document.addEventListener("mouseup",c),M(XC())},[t,L]),O=r.useCallback(e=>M(WC(e)),[M]),N=r.useCallback(e=>{a(t,e.shiftKey)},[a,t]),I=r.useCallback(e=>{e.preventDefault(),a(t,e.shiftKey),l({open:u,contextType:"column",options:_})},[t,p,u,_]);return r.useEffect(()=>{void 0!==p&&"column"===v?.contextType&&l(e=>({open:e.open,contextType:"column",options:_}))},[t,p,u,_,"column"===v?.contextType]),n("th",{className:z("ff-spreadsheet-header",{"ff-spreadsheet-header--selected":o}),style:{minWidth:`${L}px`},onClick:N,onContextMenu:I,tabIndex:0,children:[e(F,{fontWeight:"medium",children:i??Jg(t)}),e("div",{className:"drag-column-selector drag-column-left",onMouseDown:e=>V(e,!1),onDoubleClick:()=>M(xC(t,x)),onClick:()=>O({row:-1,column:t})}),e("div",{className:"drag-column-selector drag-column-right",onMouseDown:e=>V(e,!0),onDoubleClick:()=>M(xC(t,x)),onClick:()=>O({row:-1,column:t})})]},t)});function Jg(e){let t="",n=e;for(;n>=0;)t=String.fromCharCode(65+n%26)+t,n=Math.floor(n/26)-1;return t}const $g=({row:t,label:i,selected:o,onSelect:a,setContextMenu:l,addRowTop:s,addRowBottom:c,deleteRow:d,rowContextEnable:u,selectedRow:f,cell:h,maxRowLimit:p,disableDeleteOption:C,contextMenu:m,setVisibleRange:g,scrollToRow:v})=>{const y=Wg(),w=Qg(e=>e.rowDimensions[t]?.height||32),b=Qg(e=>e.model.data),{rowCount:E}=Km(b),M=e=>{g(t=>{const n={...t,end:"increment"===e?t.end+1:t.end-1};return f&&v(f),n})},A=r.useMemo(()=>[{label:"Add Row Top",value:"Add Row Top",iconName:"plus_icon",action:()=>{M("increment"),s()},disableTooltip:"Row limit reached",visible:h?.contextDisable?.["Add Row Top"]??!1,disable:E>=p},{label:"Add Row Bottom",value:"Add Row Bottom",iconName:"plus_icon",action:()=>{M("increment"),c()},disableTooltip:"Row limit reached",visible:h?.contextDisable?.["Add Row Bottom"]??!1,disable:E>=p},...C?[]:[{label:"Delete Row",value:"Delete Row",iconName:"delete",action:()=>{M("decrement"),d()},disableTooltip:"",visible:h?.contextDisable?.["Delete Row"]??!1,disable:!1}]],[f,t]),x=r.useCallback((e,n)=>{const r=n?t:t-1,i=Math.max(r,0);a(i,e.shiftKey);const o=e.clientY,l=w,s=e=>{const t=Math.max(32,l+(e.clientY-o));y(AC(i,t))},c=()=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",c),y(JC())};document.addEventListener("mousemove",s),document.addEventListener("mouseup",c),y(JC())},[w,t]),L=r.useCallback(e=>y(WC(e)),[y]),k=r.useCallback(e=>{a(t,e.shiftKey)},[t]),H=r.useCallback(e=>{e.preventDefault(),a(t,e.shiftKey),l({open:u,contextType:"row",options:A})},[t,u,A,f]);return r.useEffect(()=>{void 0!==f&&"row"===m?.contextType&&l(e=>({open:e.open,contextType:"row",options:A}))},[t,u,A,f,"row"===m?.contextType]),n("th",{className:z("ff-spreadsheet-header",{"ff-spreadsheet-header--selected":o}),style:{height:`${w}px`,minWidth:"60px"},onClick:k,onContextMenu:H,tabIndex:0,children:[e(F,{fontWeight:"medium",children:void 0!==i?i:t+1}),e("div",{className:"drag-row-selector drag-row-down",onMouseDown:e=>x(e,!0),onDoubleClick:()=>y(AC(t,32)),onClick:()=>L({row:t,column:-1})}),e("div",{className:"drag-row-selector drag-row-up",onMouseDown:e=>x(e,!1),onDoubleClick:()=>y(AC(t,32)),onClick:()=>L({row:t,column:-1})})]})},ev=t=>function(n){const i=Wg(),o=Qg(e=>e.selected.hasEntireRow(n.row)),a=Qg(e=>e.active?nm(e.active,e.model.data):void 0),l=Qg(e=>e.selectedRow??void 0),s=r.useCallback((e,t)=>i(function(e,t){return{type:Ip,payload:{row:e,extend:t}}}(e,t)),[i]);return e(t,{...n,selected:o,cell:a,selectedRow:l,onSelect:s,scrollToRow:n.scrollToRow})},tv=({row:t,column:n,DataViewer:i,active:o,dragging:a,mode:l,data:s,evaluatedData:c,select:d,activate:u,setCellDimensions:f,setCellData:h})=>{const p=r.useRef(null),C=r.useMemo(()=>({row:t,column:n}),[t,n]),m=r.useCallback(e=>{e.preventDefault(),window.getSelection()?.removeAllRanges(),"view"===l&&(f(C,_m(e.currentTarget)),e.shiftKey?d(C):u(C))},[l,f,C,d,u]),g=r.useCallback(e=>{a&&(f(C,_m(e.currentTarget)),d(C))},[f,d,a,C]);return r.useEffect(()=>{const e=p.current;if(!e)return;const t=()=>{f(C,_m(e))};t();const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[f,C]),s&&s.DataViewer&&(i=s.DataViewer),e("td",{ref:p,style:{...s?.style,..."dropDown"===s?.inputType?.type&&{fontSize:"12px"},textDecoration:"underline"===s?.style?.textDecoration?s?.style?.textDecoration:"none"},className:z("ff-spreadsheet-cell",s?.className,{"ff-spreadsheet-active-cell":o||a}),onMouseEnter:g,onMouseDown:m,tabIndex:0,children:e(i,{row:t,column:n,cell:s,active:o,evaluatedCell:c,setCellData:h,inputValue:()=>null})})},nv=t=>function(n){const{row:i,column:o}=n,a=Wg(),l=r.useMemo(()=>({row:i,column:o}),[i,o]),s=r.useCallback(e=>a(QC(l,e)),[a,l]),c=r.useCallback(e=>a(function(e){return{type:jp,payload:{point:e}}}(e)),[a]),d=r.useCallback(e=>a(WC(e)),[a]),u=r.useCallback((e,t)=>a(GC(e,t)),[a]),f=Qg(e=>Sm(e.active,l)),h=Qg(e=>f?e.mode:"view"),p=Qg(e=>nm(l,e.model.data)),C=Qg(e=>nm(l,e.model.evaluatedData)),m=Qg(e=>e.dragging),g=Qg(e=>e.copied?.has(l)||!1);return e(t,{...n,active:f,copied:g,dragging:m,mode:h,evaluatedData:C,data:p,select:c,activate:d,setCellDimensions:u,setCellData:s})},rv=({cell:r,evaluatedCell:i,active:o})=>{const a=function(e,t){const n=t?.value??e?.value;if(n&&"object"==typeof n)return n.toString();return n}(r,i);return e("span","boolean"==typeof a?{className:"ff-spreadsheet-data-viewer ff-spreadsheet-data-viewer--boolean",children:iv(a)}:{className:z("ff-spreadsheet-data-viewer",{"ff-spreadsheet-data-viewer--preserve-breaks":Pm(a)}),children:o||"dropDown"!==r?.inputType?.type?o||"file"!==r?.inputType?.type?!o&&a:e(t,{children:G(r?.value)?n("div",{className:"ff-spreadsheet-data-viewer--without-fileType",children:[e(P,{name:"attachment_icon"})," Attachment"]}):(n=>{if(G(n))return e(t,{});return JSON.parse(n).map(t=>e("div",{className:"ff-spreadsheet-data-viewer--fileType",children:e(sn,{width:r?.style?.width??100,title:t?.name?.split("*")?.[0]??""})},t.name))})(a)}):n("div",{className:"ff-spreadsheet-data-viewer--dropdownType",children:[a,e(P,{name:"arrow_down",height:8,className:"dropdownType-icon"})]})})};function iv(e){return e?"TRUE":"FALSE"}const ov=i.forwardRef(({initialValue:t="",onChange:n,className:r="",style:o={}},s)=>{const c=a(null);i.useImperativeHandle(s,()=>c.current),l(()=>{c.current&&t!==c.current.innerText&&(c.current.innerText=t)},[t]);const d=()=>{if(c.current){const e=c.current.innerText;n?.(e)}};return e("div",{style:o,children:e("div",{ref:c,className:`editable-cell ${r}`,contentEditable:!0,suppressContentEditableWarning:!0,onKeyDown:e=>{if("Enter"===e.key){if(e.altKey||e.shiftKey)return e.preventDefault(),document.execCommand("insertLineBreak"),void d();c.current?.blur()}"Delete"!==e.key&&"Backspace"!==e.key||e.stopPropagation()},onInput:d,onPaste:e=>{e.preventDefault();const t=e.clipboardData.getData("text/plain"),n=window.getSelection();if(!n||!n.rangeCount)return;const r=n.getRangeAt(0);r.deleteContents();const i=document.createTextNode(t);r.insertNode(i),r.setStartAfter(i),r.collapse(!0),n.removeAllRanges(),n.addRange(r),d()},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"}})})}),av=({onChange:t,cell:n})=>{const i=r.useRef(null),o=r.useCallback(e=>{const{contextDisable:r,...i}=n;t({...i,value:e,inputType:i.inputType??{type:"text"}})},[t,n]);r.useEffect(()=>{i.current&&function(e){if(e)if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)e.selectionStart=e.selectionEnd=e.value.length;else if(e.isContentEditable){const t=document.createRange(),n=window.getSelection();t.selectNodeContents(e),t.collapse(!1),n?.removeAllRanges(),n?.addRange(t)}}(i.current)},[]);return e("div",{className:"ff-spreadsheet-data-editor",children:e(ov,{ref:i,initialValue:n?.value??"",onChange:o,className:"ff-spreadsheet-cell-textarea",style:{...n?.style,borderTop:"",borderBottom:"",borderLeft:"",borderRight:""}})})},lv=t=>{const i=r.useRef(null),o=r.useRef(null),a=Wg(),l=r.useCallback((e,t)=>a(QC(e,t)),[a]),s=r.useCallback(e=>a(WC(e)),[a]),c=r.useCallback(()=>a({type:Wp}),[a]),d=r.useCallback(e=>a({type:vC,payload:{autofill:e}}),[a]),u=r.useCallback(e=>a(function(e){return{type:$p,payload:{changes:e}}}(e)),[a]),f=r.useCallback(()=>{a({type:Qp})},[a]),h=Qg(e=>e.rowDimensions),p=Qg(e=>e.active),C=Qg(e=>e.mode),m=Qg(e=>e.active?nm(e.active,e.model.data):void 0),g=Qg(e=>e.selected),v=Qg(e=>g&&Zm(e.rowDimensions,e.columnDimensions,e.model.data,e.selected)),y=Qg(e=>{let t=p?Tm(p,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}),w=r.useMemo(()=>!p||!y||p.row<t.visibleRowRange.start||p.row>=t.visibleRowRange.end||p.column<t.visibleColRange.start||p.column>=t.visibleColRange.end,[p,y,t.visibleRowRange,t.visibleColRange]),b=r.useRef(void 0),E=r.useRef(null),M=r.useRef(void 0),A=r.useCallback(e=>{p&&l(p,e)},[l,p]),[x,L]=r.useState({value:"",name:""}),[k,H]=r.useState(!1),[S,_]=r.useState(),[V,O]=r.useState([]);r.useEffect(()=>{m&&p&&t.getActiveCell({value:m.value,active:p});const n=i.current;if(!w&&n){if(n.focus({preventScroll:!0}),"file"===m?.inputType?.type&&m?.value)try{const e=JSON.parse(m.value).map(e=>new File([new Blob],e.name.split("*")[0]??"default"));O(e)}catch(e){console.error("Error parsing cell value for files:",e),O([])}else O([]);if("dropDown"===m?.inputType?.type){L({value:m?.value,name:m?.value}),H(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}));_(t)}}},[i,w,p]),r.useEffect(()=>{const e=E.current,t=M.current;if(E.current=p,M.current=m,!e||!t)return;const n=p?.row!==e.row||p?.column!==e.column;if(n||"edit"!==C){const e=b.current;t!==e?u([{prevCell:e||null,nextCell:t}]):n||m===t||u([{prevCell:t,nextCell:m||null}]),b.current=m}});const N=m&&m.DataEditor||t.DataEditor,I=m&&m.readOnly,T=r.useCallback(e=>{if(!p)return;const t=e.currentTarget.closest(".ff-excel-spreadsheet");if(!t)return void e.preventDefault();e.stopPropagation();const n=document.body.style.userSelect,r=document.body.style.overflow;document.body.style.userSelect="none",document.body.style.overflow="hidden";let i=null;const o=()=>{i&&(cancelAnimationFrame(i),i=null)},a=e=>{const n=t.getBoundingClientRect();let r=0,a=0;e.clientY<n.top+50?a=-12:e.clientY>n.bottom-50&&(a=12),e.clientX<n.left+50?r=-12:e.clientX>n.right-50&&(r=12),0!==r||0!==a?(e=>{o();const n=()=>{const{x:r,y:o}=e;0!==r&&(t.scrollLeft+=r),0!==o&&(t.scrollTop+=o),i=requestAnimationFrame(n)};i=requestAnimationFrame(n)})({x:r,y:a}):o()},l=()=>{o(),document.body.style.userSelect=n,document.body.style.overflow=r,document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",l)};document.addEventListener("mousemove",a),document.addEventListener("mouseup",l),d(!0)},[s,d,p]),D=r.useCallback(e=>{e.preventDefault(),t.setContextMenu({open:t.contextOption?.open??!1,contextType:t.contextOption?.contextType??null,options:t.contextOption?.options||[]})},[t]),Z=v?.height!==y?.height||v?.width!==y?.width,j=r.useCallback(e=>{p&&Z&&(GC(p,_m(e.currentTarget)),s(p))},[p,Z]),R=t.isAtRight?t.maxWidth-(y?.left-t.scrollPos.left)+100:t.maxWidth,B=t.isAtBottom?t.maxHeight-(y?.top-t.scrollPos.top)+64:t.maxHeight,P=["file","dropDown"].includes(m?.inputType?.type||"");return n("div",{ref:i,className:z("ff-spreadsheet-active-cell",`ff-spreadsheet-active-cell--${C}`,{"ff-spreadsheet-active-cell--hidden":w,"ff-spreadsheet-active-cell--dragging":Z&&"text"!==m?.inputType?.type}),onMouseDown:j,style:{...y,backgroundColor:m?.style?.backgroundColor,...P?{display:"flex",alignItems:m?.style?.alignContent,justifyContent:m?.style?.textAlign}:{},..."edit"===C&&p?{minWidth:Math.min(y?.width,t.maxWidth),minHeight:Math.min(y?.height,t.maxHeight),height:"auto",maxWidth:`${R}px`,maxHeight:`${B}px`,overflow:"auto",..."dropDown"===m?.inputType?.type?{}:{padding:"2px 4px 0px 4px",width:"max-content"}}:{}},onContextMenu:D,onClick:"view"!==C||I?void 0:c,tabIndex:0,children:[e("div",{className:P?"":"active-cell-main",children:"dropDown"===m?.inputType?.type?e(ar,{...m?.inputType?.inputProps,dropDownRef:o,showOptions:{open:!("edit"!==C||!p),toggle:k},selectedOption:x,optionsList:S||[],height:26,showLabel:!1,disabled:!t.editable,showBorder:!1,optionZIndex:5e3,onChange:e=>{L({value:e.value,name:e.label}),A({...m,value:e.value,style:m?.style,inputType:m?.inputType})}}):"file"===m?.inputType?.type?e(xp,{...m?.inputType?.inputProps,label:"",onFileListClick:e=>{const n=e.target.closest(".ff-attachment-files"),r=e.target.closest(".ff-icon-container, .ff-icon-click, .ff-icon-danger");if(n&&!r&&m?.value&&t.attachmentAction?.viewAttachment)try{const e=JSON.parse(m.value),r=n.parentElement?.querySelectorAll(".ff-attachment-files")||[],i=Array.from(r).indexOf(n);if(-1===i||!e[i])return void console.error("File index not found or invalid");const o=e[i];t.attachmentAction.viewAttachment(o.id,o.name?.split("*")[0]??"default")}catch(e){console.error("Error parsing cell value:",e)}else console.warn("Missing file element, icon click, cell value, or viewAttachment action")},selectedFiles:V,onFilesChange:async(e,n,r)=>{try{if("ADD"===r&&"file"===m?.inputType?.type){let n=[];try{m?.value&&(n=JSON.parse(m.value))}catch(e){console.error("Error parsing cell.value:",e)}let r=0;const i=e.filter((e,t,i)=>{const o=e.name.split("*")[0],a=i.findIndex(e=>e.name.split("*")[0]===o)!==t,l=n.some(e=>e.name.split("*")[0]===o);return!a&&!l||(r++,!1)});if(n.length+i.length>5)return void Ta.info("Cannot upload more than 5 files.");if(t.attachmentAction?.addAttachment&&i.length>0)try{let e=0,r=0,o=0;const l=V?.length+i?.length,s=l>0?25*l:1,c=[...n],d=i?.map(async e=>{try{if(e.name.includes("*"))return{file:e,status:"existing",data:{name:e.name}};const n=await(t?.attachmentAction?.addAttachment(e));if(!n||"string"==typeof n&&0===n.trim().length)return{file:e,status:"failed",reason:"no response"};if("string"==typeof n)try{const t=JSON.parse(n);return 507===t.responseCode?{file:e,status:"memory_full",reason:"no memory"}:400===t.responseCode?{file:e,status:"failed",reason:"invalid file"}:t?.id&&t?.name?{file:e,status:"success",data:t}:(console.error(`Invalid response structure for ${e.name}:`,t),{file:e,status:"failed",reason:"invalid response"})}catch(t){return console.error(`Parse error for ${e.name}:`,t),{file:e,status:"failed",reason:"parse error"}}if("object"==typeof n&&null!==n){const t=n;return t?.id&&t?.name?{file:e,status:"success",data:t}:(console.error(`Invalid response structure for ${e.name}:`,n),{file:e,status:"failed",reason:"invalid response"})}return console.error(`Unknown response for ${e.name}:`,n),{file:e,status:"failed",reason:"unknown"}}catch(t){return console.error(`Upload failed for ${e.name}:`,t),{file:e,status:"failed",reason:"upload error"}}});if((await Promise.allSettled(d)).forEach(t=>{if("fulfilled"===t.status&&t.value){const{status:n,data:i}=t.value;"success"===n&&i?.id&&i?.name?(c.push(i),e++):"existing"===n&&i?.name?c.push(i):"memory_full"===n?o++:r++}else r++}),e>0||c.length>n.length){const e=c.length>0?JSON.stringify(c):"";A({...m,value:e,style:m?.style,inputType:m?.inputType}),a(AC(p?.row||0,Math.max(s,h?.[p.row]?.height||s))),O(c.map(e=>new File([new Blob],e.name?.split("*")[0]??"default")))}o>0&&Ta.info("No memory available to add the file"),e>0&&Ta.success(`${e} file${e>1?"s":""} uploaded successfully`),r>0&&Ta.info(`${r} unsupported ${r>1?"files":"file"}. Please check the file formats.`)}catch(e){console.error("Upload operation failed:",e),Ta.error("Operation failed")}}else if("DELETE"===r&&"file"===m?.inputType?.type)try{let e=[...m&&JSON.parse(m.value)],r=0;for(const i of n||[]){const n=e.findIndex(e=>e.name.split("*")[0]===i.name.split("*")[0]),o=e[n]?.id;if(-1!==n&&o&&t.attachmentAction?.deleteAttachment)try{const a=await t.attachmentAction.deleteAttachment(o);"SUCCESS"===a||"object"==typeof a&&null!==a&&("status"in a&&"SUCCESS"===a.status||"responseCode"in a&&200===a.responseCode)?(e.splice(n,1),r++):console.error(`Delete failed for ${i.name}: Invalid response`,a)}catch(e){console.error(`Delete error for ${i.name}:`,e),Ta.error("Error deleting file")}else console.error(`Cannot delete ${i.name}: Invalid fileId or no match`,{index:n,fileId:o,hasDeleteAttachment:!!t.attachmentAction?.deleteAttachment}),Ta.error("Failed to delete file: Invalid file data")}if(r>0){const t=e.length>0?JSON.stringify(e):"";A({...m,value:t,style:m?.style,inputType:m?.inputType}),O(e?.map(e=>new File([new Blob],e.name.split("*")[0]))),Ta.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):"";A({...m,value:e,style:m?.style,inputType:m?.inputType}),O(t.map(e=>new File([new Blob],e.name.split("*")[0]))),Ta.error("Failed to delete file(s). Invalid file data detected.")}else Ta.error("Failed to delete file(s). No valid files removed.")}}catch(e){console.error("Delete operation failed:",e),Ta.error("Delete operation failed")}}catch(e){console.error("handleFilesChange error:",e),Ta.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:(y?.width??0)-60}):"edit"===C&&p&&t.editable?e(N,{row:p.row,column:p.column,cell:m,onChange:A,exitEditMode:f}):e(ov,{initialValue:m?.value,onChange:()=>{},className:"ff-spreadsheet-cell-textarea",style:{...m?.style,textDecoration:"underline"===m?.style?.textDecoration?"underline":"none",backgroundColor:Z?"#1e161f00":m?.style?.backgroundColor,pointerEvents:"none",borderTop:"",borderBottom:"",borderLeft:"",borderRight:""}})}),!["file"].includes(m?.inputType?.type??"")&&("edit"===C||p&&e("div",{onMouseDown:T,className:"select_dot"}))]},`${p?.row}-${p?.column}`)},sv=({dimensions:t,dragging:n,hidden:r,variant:i})=>{const o=Qg(e=>e.active),a=Qg(e=>e.autoFill),l=Qg(e=>o?Tm(o,e.rowDimensions,e.columnDimensions):void 0),{width:s,height:c,top:d,left:u}=t||{};let f=l?.height??0,h=l?.width??0,p=s,C=c;return a.open&&s&&c&&l&&(s-h>c-f?(p=s,C=l.height):(C=c,p=l.width)),e("div",{className:z("ff-spreadsheet-floating-rect",{[`ff-spreadsheet-floating-rect--${i}`]:i,"ff-spreadsheet-floating-rect--dragging":n,"ff-spreadsheet-floating-rect--hidden":r}),style:{width:(p??0)+1,height:(C??0)+1,top:d,left:u}})},cv=({scrollPos:t={top:0,left:0}})=>{const n=Qg(e=>e.selected),i=Qg(e=>e.dragging),o=Qg(e=>e.selected.size(e.model.data)<2),a=Qg(e=>n&&Zm(e.rowDimensions,e.columnDimensions,e.model.data,e.selected)),l=r.useMemo(()=>{if(a)return{...a,top:a.top-1,left:a.left-1,height:a.height-1,width:a.width-1}},[a,t]);return e(sv,{variant:"selected",dimensions:l,dragging:i,hidden:o||!a})},dv=({scrollPos:t={top:0,left:0}})=>{const n=Qg(e=>e.copied),i=null===n,o=Qg(e=>n&&Dm(e.rowDimensions,e.columnDimensions,n)),a=r.useMemo(()=>{if(o)return{...o,top:o.top-1,left:o.left-1,height:o.height-1,width:o.width-1}},[o,t]);return e(sv,{variant:"copied",dimensions:a,hidden:i||!o,dragging:!1})},uv=({getColorValue:t,disabled:n,initialColor:r})=>{const i=a(null),[o,l]=c(r);return e("div",{className:z("ff-excel-color-selector",{"color-selector-disabled":n}),style:{backgroundColor:o},onClick:()=>{i.current&&!n&&i.current.click()},children:e("input",{type:"color",disabled:n,className:z("ff-excel-color-selector-picker",{"color-selector-disabled":n}),ref:i,onChange:e=>{l(e.target.value),t(e.target.value.replace("#",""))}})})},fv=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"}},hv=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"}},pv=e=>Qm.reduce((t,n)=>Math.abs(n-parseFloat(e))<Math.abs(t-parseFloat(e))?n:t);function Cv(e){const{border:t}=e;let n="",r="",i="",o="";return"THIN"!==t.top&&(n="MEDIUM"===t.top?"2px solid var(--input-hover-border-color)":"1px solid var(--excel-header-border)"),"THIN"!==t.right&&(r="MEDIUM"===t.right?"2px solid var(--input-hover-border-color)":"1px solid var(--excel-header-border)"),"THIN"!==t.bottom&&(i="MEDIUM"===t.bottom?"2px solid var(--input-hover-border-color)":"1px solid var(--excel-header-border)"),"THIN"!==t.left&&(o="MEDIUM"===t.left?"2px solid var(--input-hover-border-color)":"1px solid var(--excel-header-border)"),{fontSize:Fm(pv(String(e.size))),fontFamily:(a=e.name,Wm.some(e=>e.label===a)?a:"Poppins"),color:`#${e.color}`,backgroundColor:`#${e.backgroundColor}`,fontWeight:e.bold?"bold":"normal",fontStyle:e.italic?"italic":"normal",textDecoration:e.underline?"underline":"normal",borderTop:n,borderRight:r,borderBottom:i,borderLeft:o,textAlign:fv(e.alignment.horizontal),alignContent:fv(e.alignment.vertical)};var a}const mv=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"},gv=e=>({name:e.fontFamily||"Arial",size:Um(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:mv(e.borderTop?e.borderTop.toString():void 0),right:mv(e.borderRight?e.borderRight.toString():void 0),bottom:mv(e.borderBottom?e.borderBottom.toString():void 0),left:mv(e.borderLeft?e.borderLeft.toString():void 0)},alignment:{horizontal:hv(e.textAlign),vertical:hv(e.alignContent),wrapText:!1}}),vv=({toolbar:t="show",editable:r,onBold:i,onItalic:o,setUnderlineType:s,setColor:d,setFontSize:u,setFontFamily:f,setTextAlign:h,setBackgroundColor:p,setBorderType:C,setFormatePainter:m})=>{const g=Qg(e=>e.selected instanceof wm),[v,y]=c("disable"===t||!r),w=Qg(e=>e.active?nm(e.active,e.model.data):null),b=Qg(e=>e.model.data),E=Qg(e=>e.formattedStyle.open),M={...qm.style,color:"#1e161f",backgroundColor:"#ffffff",borderColor:"#1e161f"},[A,x]=c(w?.style||M),L=a(null);l(()=>{w?.style&&JSON.stringify(w.style)!==JSON.stringify(A)&&x(w?.style||M),g?y(!r):w&&"boolean"==typeof w.readOnly&&y(w.readOnly||"disable"===t||!r||"dropDown"===w?.inputType?.type)},[w,r]);const k=gv(A),[H,S]=c("border-none"),[_,V]=c({label:"",value:""}),[O,z]=c({label:"",value:""}),[N,I]=c({color:M.color,backgroundColor:M.backgroundColor,borderColor:M.borderColor}),T=[{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=Qm.map(e=>({label:e,value:e}));l(()=>{let e=setTimeout(()=>{d(b,N.color)},0);return()=>{clearTimeout(e)}},[N.color]),l(()=>{let e=setTimeout(()=>{p(b,N.backgroundColor)},0);return()=>{clearTimeout(e)}},[N.backgroundColor]);return l(()=>{const e=A.fontFamily,t=`${Um(A.fontSize)}`;V({label:e??"Times New Roman",value:e??"Times New Roman"}),z({label:t??"11",value:t??"11"})},[A]),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(ar,{disabled:v,height:24,tooltip:!0,showToolTip:!0,showLabel:!1,optionZIndex:2e3,onChange:e=>{V({label:e.label,value:e.label}),f(b,e.value)},required:!1,optionsList:Wm,selectedOption:_})}),e("div",{className:"ff-excel-toolbar-font-size",children:e(ar,{disabled:v,height:24,showLabel:!1,optionZIndex:2e3,required:!1,onChange:e=>{z({label:e.label,value:e.value}),u(b,e.value)},optionsList:D,selectedOption:O})})]}),e("div",{className:"ff-excel-toolbar-divider"}),n("div",{className:"ff-excel-toolbar-icon",children:[e(K,{placement:"top",title:"Text Left",children:e(P,{disabled:v,variant:"left"===A.textAlign?"dark":"light",hoverEffect:"left"!==A.textAlign,onClick:()=>h(b,"left"),name:"text_align_left"})}),e(K,{placement:"top",title:"Text Center",children:e(P,{disabled:v,variant:"center"===A.textAlign?"dark":"light",hoverEffect:"center"!==A.textAlign,onClick:()=>h(b,"center"),name:"text_align_center"})}),e(K,{placement:"top",title:"Text Right",children:e(P,{disabled:v,variant:"right"===A.textAlign?"dark":"light",hoverEffect:"right"!==A.textAlign,onClick:()=>h(b,"right"),name:"text_align_right"})})]}),e("div",{className:"ff-excel-toolbar-divider"}),n("div",{className:"ff-excel-toolbar-text",children:[e(K,{placement:"top",title:"Bold",children:e(P,{disabled:v,variant:k.bold?"dark":"light",hoverEffect:!k.bold,onClick:()=>i(b),name:"bold"})}),e(K,{placement:"top",title:"Italic",children:e(P,{disabled:v,variant:k.italic?"dark":"light",hoverEffect:!k.italic,onClick:()=>o(b),name:"italic"})}),e(K,{placement:"top",title:"Underline",children:e("div",{className:"ff-excel-toolbar-icon-underline",children:e(P,{disabled:v,variant:"underline"===A.textDecoration?"dark":"light",hoverEffect:"underline"!==A.textDecoration,onClick:()=>s(b),name:"underline"})})})]}),e("div",{className:"ff-excel-toolbar-divider"}),n("div",{className:"ff-excel-toolbar-icon",children:[e(K,{placement:"top",title:"Format Painter",children:e(P,{disabled:v,variant:E?"dark":"light",hoverEffect:!E,onClick:()=>{m(b)},name:"formate_painter"})}),e(K,{placement:"top",title:"Text Color",children:n("div",{className:"ff-excel-toolbar-icon-color",children:[e(P,{disabled:v,hoverEffect:!0,width:12,height:12,onClick:()=>{d(b,N.color)},name:"text_color"}),e(uv,{disabled:v,getColorValue:e=>{I(t=>({...t,color:e}))},initialColor:N.color})]})}),e(K,{placement:"top",title:"Background Color",children:n("div",{className:"ff-excel-toolbar-icon-color",children:[e(P,{disabled:v,hoverEffect:!0,width:12,height:12,onClick:()=>p(b,N.backgroundColor),name:"fill_color"}),e(uv,{disabled:v,getColorValue:e=>{I(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(K,{placement:"top",title:"Border Type",children:e(P,{hoverEffect:!0,disabled:v,onClick:()=>C(b,H,"var(--input-hover-border-color)"),name:(()=>{const e=T.find(e=>e.value===H);return e?e.icon:""})()})}),e("span",{ref:L,children:e(fr,{disabled:v,iconName:"arrow_down",targetRef:L,iconSize:12,zIndex:2e3,options:T,tooltipTitle:"Border Type",tooltipPlacement:"top",onOptionClick:e=>{let t=e.value;C(b,t,"var(--input-hover-border-color)"),S(t)}})})]})})]})},yv=(e,t)=>{let n,r=null;const i=function(...i){const o=this;null===r||Date.now()-r>=t?(e.apply(o,i),r=Date.now()):(n&&clearTimeout(n),n=setTimeout(()=>{e.apply(o,i),r=Date.now()},t-(Date.now()-r)))};return i.cancel=()=>{n&&clearTimeout(n),n=null,r=null},i},wv=r.forwardRef(function(t,i){const{className:o,columnLabels:a=[],rowLabels:l=[],toolbar:s,editable:c,onKeyDown:d,Table:u=Fg,Row:f=Ug,sheetHeight:h,HeaderRow:p=qg,DataEditor:C=av,DataViewer:m=rv,onSelect:g=()=>{},onActivate:v=()=>{},onEvaluatedDataChange:y=()=>{},contextOption:w,attachmentAction:b,workRef:E,minimumColumnWidth:M,setContextMenu:A,maxRowLimit:x,maxColLimit:L,disableDeleteOption:k,contextMenu:H,getActiveCell:S,onAddColumn:_,onDeleteColumn:V}=t,O=M||100,N=r.useRef(!1),I=Qg(e=>e.model.data),[T,D]=r.useState(!1),[Z,j]=r.useState(0),[R,B]=r.useState(0),[P,F]=r.useState({top:0,left:0}),[U,q]=r.useState(!1),[W,Q]=r.useState(!1),G=r.useMemo(()=>{const e=t.createFormulaParser||Xm,n=new ng(e,t.data);return D(e=>!e),{...kg,model:n,selected:t.selected||kg.selected}},[t.createFormulaParser,t.data,t.selected]),K=r.useReducer(Hg,G),[Y,X]=K,J=r.useMemo(()=>function(e,t,n){const{columns:r,rows:i}=dm(e);return{rows:t?Math.max(i,t.length):i,columns:n?Math.max(r,n.length):r}}(Y.model.data,l,a),[Y.model.data,l,a]),[$,ee]=r.useState({start:0,end:Math.min(20,J.rows)}),[te,ne]=r.useState({start:0,end:Math.min(15,J.columns)}),re=r.useCallback(e=>{let t=0;for(let n=0;n<e;n++)t+=Y.rowDimensions[n]?.height||32;return t},[Y.rowDimensions,32]),ie=r.useCallback(e=>{let t=0;for(let n=0;n<e;n++)t+=Y.columnDimensions[n]?.width||O;return t},[Y.columnDimensions,O]);r.useEffect(()=>{X(function(e){return{type:yC,payload:{minimumColumnWidth:e}}}(M))},[M]);const oe=re(J.rows),ae=ie(J.columns),le=re($.start),se=oe-re($.end),ce=ie(te.start),de=ae-ie(te.end),ue=Y.mode,fe=r.useRef(null),he=e=>r.useCallback((...t)=>X(e(...t)),[e]),pe=he(MC),Ce=he(em),me=he($C),ge=he(tm),ve=he(KC),ye=he(YC),we=he(PC),be=he(XC),Ee=he(JC),Me=he(FC),Ae=he(UC),xe=he(qC),Le=he(LC),ke=he(kC),He=he(SC),Se=he(OC),_e=he(_C),Ve=he(VC),Oe=he(HC),ze=he(zC),Ne=he(NC),Ie=he(IC),Te=he(EC),De=he(TC),Ze=he(DC),je=he(ZC),Re=he(jC),Be=he(RC),Pe=he(BC);r.useImperativeHandle(i,()=>({removeSelect:ge}));const Fe=r.useRef(Y.active);r.useEffect(()=>{if(Y.active!==Fe.current)if(Y.active)v(Y.active);else{const e=E.current;e&&Bm(e)&&document.activeElement&&document.activeElement.blur()}Fe.current=Y.active},[v,Y.active]);const Ue=r.useRef(Y.model.evaluatedData);r.useEffect(()=>{Y?.model?.evaluatedData!==Ue?.current&&y(Y?.model?.evaluatedData),Ue.current=Y.model.evaluatedData},[Y?.model?.evaluatedData,y]);const qe=r.useRef(Y.selected);r.useEffect(()=>{Y.selected.equals(qe.current)||t.selected&&Y.selected.equals(t.selected)||g(Y.selected),qe.current=Y.selected},[Y.selected,g,t.selected]);const We=r.useRef(t.selected);r.useEffect(()=>{t.selected&&We.current&&!t.selected.equals(We.current)&&xe(t.selected),We.current=t.selected},[t.selected,xe]);let Qe=r.useRef(t.data);r.useEffect(()=>{pe(c),t.data!==Qe.current&&Me(t.data),Qe.current=t.data},[t.data,Me,c]);const Ge=r.useRef(t.createFormulaParser);r.useEffect(()=>{t.createFormulaParser!==Ge.current&&t.createFormulaParser&&Ae(t.createFormulaParser),Ge.current=t.createFormulaParser},[t.createFormulaParser,Ae]);const Ke=r.useCallback(e=>{const{model:t,selected:n}=Y,{data:r}=t,i=n.toRange(r);if(i){!function(e,t){e.clipboardData?.setData(km,t)}(e,jm(function(e,t,n){const r=[],i=t.column-e.column;for(let o=e.row;o<=t.row;o++){const a=o-e.row;r[a]=r[a]||Array(i);for(let i=e.column;i<=t.column;i++)r[a][i-e.column]=nm({row:o,column:i},n)}return r}(i.start,i.end,r)))}},[Y]),Ye=r.useCallback(e=>{Rm(fe.current,ue)&&(e.preventDefault(),e.stopPropagation(),Ke(e),Ce())},[ue,Ke,Ce]),Xe=r.useCallback(e=>{Rm(fe.current,ue)&&(e.preventDefault(),e.stopPropagation(),Ke(e),me())},[ue,Ke,me]),Je=r.useCallback(e=>{if(Rm(fe.current,ue)&&(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(km):""}(e);ve(t)}},[ue,ve]),$e=r.useCallback(e=>{e.persist();const t=e.ctrlKey||e.metaKey,n=e.key.toLowerCase();t&&"b"===n?(e.preventDefault(),Le(I)):t&&"i"===n?(e.preventDefault(),ke(I)):t&&"u"===n&&(e.preventDefault(),He(I)),d&&d(e),e.defaultPrevented||(function(e,t){return void 0!==Eg(e,t)}(Y,e)&&e.nativeEvent.preventDefault(),ye(e))},[Y,d,ye]),et=r.useCallback(()=>{Y.formattedStyle.open&&Y.active&&Te(Y.active)},[Y]),tt=r.useCallback(()=>{Ee(),document.removeEventListener("mouseup",tt)},[Ee]),nt=r.useCallback(e=>{Y.dragging||1!==e.buttons||"view"!==ue||(be(),document.addEventListener("mouseup",tt))},[Y,be,tt,ue]),rt=r.useMemo(()=>nv(t.Cell||tv),[t.Cell,T,c]),it=r.useMemo(()=>Kg(t.CornerIndicator||Gg),[t.CornerIndicator,T]),ot=r.useMemo(()=>ev(t.RowIndicator||$g),[t.RowIndicator,T]),at=r.useMemo(()=>Yg(t.ColumnIndicator||Xg),[t.ColumnIndicator,T]);r.useEffect(()=>(document.addEventListener("cut",Ye),document.addEventListener("copy",Xe),document.addEventListener("paste",Je),()=>{document.removeEventListener("cut",Ye),document.removeEventListener("copy",Xe),document.removeEventListener("paste",Je)}),[Ye,Xe,Je]);const lt=e=>{const t=new ResizeObserver(e=>{const t=e[0];if(t&&fe.current){const e=t.target;if(e){const{clientWidth:t,clientHeight:n}=e;B(Math.min(fe.current.clientHeight,n)),j(Math.min(fe.current.clientWidth,t))}}}),n=e.current;n&&t.observe(n)},st=r.useCallback(e=>{const t=e.target,{scrollTop:n,clientHeight:r,scrollLeft:i,clientWidth:o}=t;F({top:n,left:i});let a=0;for(;a<J.rows&&re(a)<n;)a++;let l=a;for(;l<J.rows&&re(l)<n+r;)l++;a=Math.max(0,a-10),l=Math.min(J.rows,l+10),ee({start:a,end:l});const s=l===J.rows;q(s);let c=0;for(;c<J.columns&&ie(c)<i;)c++;let d=c;for(;d<J.columns&&ie(d)<i+o;)d++;c=Math.max(0,c-10),d=Math.min(J.columns,d+10),ne({start:c,end:d});const u=d===J.columns;Q(u),H.open&&A({open:!1,contextType:null,options:[{label:"",value:"",iconName:"",action:()=>{},disableTooltip:"",visible:!1,disable:!1}]})},[J.rows,J.columns,re,ie]),ct=r.useMemo(()=>yv(st,16),[st]),dt=e=>{N.current=!0,requestAnimationFrame(()=>{let t=0;for(let n=0;n<=e;n++)t+=Y.rowDimensions?.[n]?.height||32;requestAnimationFrame(()=>{fe.current&&e>=J.rows-1&&fe?.current?.scrollTo({top:t+32,behavior:"smooth"})})})},ut=e=>{N.current=!0,requestAnimationFrame(()=>{let t=0;for(let n=0;n<=e;n++)t+=Y.columnDimensions?.[n]?.width||O;requestAnimationFrame(()=>{fe.current&&e>=J.columns-1&&fe.current.scrollTo({left:t+60,behavior:"smooth"})})})};r.useEffect(()=>{N.current||(ee({start:0,end:Math.min(20,J.rows)}),ne({start:0,end:Math.min(15,J.columns)}))},[J.rows,J.columns,N.current]);const ft=Hm($.end,$.start),ht=Hm(te.end,te.start),pt=n("colgroup",{children:[e("col",{style:{width:"60px"}},"row-indicator")," ",e("col",{style:{width:`${ce}px`}},"left-spacer")," ",ht.map(t=>e("col",{style:{width:`${Y.columnDimensions[t]?.width||O}px`}},t)),e("col",{style:{width:`${de}px`}},"right-spacer")," "]}),Ct=r.useMemo(()=>n(u,{useTableRef:lt,totalWidth:ae,children:[pt,n("tbody",{children:[n(p,{children:[e(it,{}),e("div",{className:"spacer left"}),ht.map(n=>e(at,{column:n,minimumColumnWidth:M,setContextMenu:t.setContextMenu,label:n in a?a[n]:void 0,deleteColumn:Pe,addColumnLeft:je,addColumnRight:Re,columnContextEnable:t.columnContextEnable,maxColLimit:L,disableDeleteOption:k,contextMenu:H,onAddColumn:_,onDeleteColumn:V,setVisibleRange:ne,scrollToColumn:ut},n)),e("div",{className:"spacer right"})]}),e("tr",{style:{height:`${le}px`}}),ft.map(r=>n(f,{row:r,children:[e(ot,{label:r in l?l?.[r]:void 0,row:r,addRowTop:De,addRowBottom:Ze,deleteRow:Be,setContextMenu:t.setContextMenu,rowContextEnable:t.rowContextEnable,maxRowLimit:x,disableDeleteOption:k,contextMenu:H,setVisibleRange:ee,scrollToRow:dt},r),e("div",{className:"spacer left"}),ht.map(t=>e(rt,{row:r,column:t,DataViewer:m},t)),e("div",{className:"spacer right"})]},r)),e("tr",{style:{height:`${se}px`}})]})]}),[u,J.rows,J.columns,f,p,it,a,at,l,ot,rt,m,$,te,le,se,ce,de,Y.rowDimensions,Y.columnDimensions]),mt=r.useMemo(()=>e(lv,{attachmentAction:b,contextOption:w,getActiveCell:S,setContextMenu:t.setContextMenu,DataEditor:C,visibleRowRange:$,visibleColRange:te,maxHeight:R-64,maxWidth:Z-M,totalHeight:oe,totalWidth:ae,isAtBottom:U,isAtRight:W,scrollPos:P,editable:c},Y.active?`${Y.active.row}-${Y.active.column}`:"no-active"),[C,$,te,Y.active,R,Z,oe,ae,U,W,c]),gt=r.useMemo(()=>n("div",{className:"ff-excel-spreadsheet-container",children:[e("div",{style:{width:`${Z}px`},className:z("ff-excel-header-column-hider",{"ff-excel-header-extend":["show","disable"].includes(s||""),"ff-excel-header-hider":"hide"===s})}),e("div",{style:{height:`${R}px`},className:z("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(vv,{editable:c,toolbar:s,onBold:Le,onItalic:ke,setUnderlineType:He,setColor:ze,setBorderType:Oe,setFontSize:_e,setFontFamily:Ve,setTextAlign:Se,setBackgroundColor:Ne,setFormatePainter:Ie})}),n("div",{ref:fe,style:{height:h},className:z("ff-excel-spreadsheet",o),onKeyPress:we,onKeyDown:$e,onClick:et,onMouseMove:nt,onScroll:e=>ct(e),children:[Ct,mt,e(cv,{scrollPos:P}),e(dv,{scrollPos:P})]})]}),[o,we,$e,nt,Ct,mt,Z]);return e(Pg.Provider,{value:K,children:gt})}),bv=({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(K,{title:i?t.disableTooltip:"",children:n("div",{className:"ff-excel-menu-options "+(i?"disabled":""),onClick:()=>{i||t.action()},children:[t.iconName&&e(P,{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(F,{as:"label",children:t.label})]})},t.label)}var r;return null})})},Ev=({excelData:r,contextOption:o,toolbar:s="show",sheetBar:d="show",rowCount:u=26,colCount:f=26,sheetHeight:h="100%",editable:p=!0,contextHeightPositioning:C=0,contextWidthPositioning:m=0,onSave:g=()=>Promise.resolve(),onSaveInfoChange:v,attachmentAction:y={addAttachment:()=>Promise.resolve(""),deleteAttachment:()=>Promise.resolve(""),viewAttachment:()=>Promise.resolve()},onSaveDelay:w=3e3,scroller:b=!1,columnContextEnable:E=!0,rowContextEnable:M=!0,sheetBarContextEnable:A=!0,minimumColumnWidth:x=100,disableDeleteOption:L=!1,maxRowLimit:k=1/0,maxColLimit:H=1/0,maxSheetLimit:S=1/0,getActiveCell:_=()=>{}})=>{const V=a(null),[O,N]=c([]),[I,T]=c(""),[D,Z]=i.useState({open:!1,contextType:null,options:[{label:"",value:"",iconName:"",action:()=>{},disableTooltip:"",disable:!1,visible:!1}]}),[j,R]=c({name:"defaultSheet",index:0}),[B,U]=c({defaultSheet:[[qm]]}),[q,W]=c([[qm]]),[Q,Y]=c((g.length,{})),[X,J]=c({x:0,y:0}),$=a(""),ee=a(null),te=a(null),ne=a(null);l(()=>{const e=r;if(e){const t=e.map(e=>e.sheetName);N(t),G(t.length)||($.current=t[0]||"",R({name:t[0]||"",index:0}));const n={},r={};e.forEach(e=>{const t=e.sheetName,i=e.data,o=Math.max(u,i.length),a=Math.max(f,Math.max(...i.map(e=>e.length)));let l=Array.from({length:o},()=>Array(a).fill({value:"",style:qm.style,readOnly:!1,inputType:void 0}));i.forEach((e,t)=>{e.forEach((e,n)=>{var r;t<o&&n<a&&(l[t]||(l[t]=[]),l[t][n]={value:(r=e.value,null==r?null:r),style:G(e?.style)?qm.style:Cv(e?.style),readOnly:!!e?.readOnly&&e?.readOnly,inputType:e?.inputType??void 0,contextDisable:e.contextDisable})})});const s=new Set([...e?.rows?.readOnly?e.rows.readOnly.map(e=>`r${e}`):[],...e?.columns?.readOnly?e.columns.readOnly.map(e=>`c${e}`):[],...e?.cells?.readOnly?e.cells.readOnly.map(([e,t])=>`${e},${t}`):[]]);if(l.forEach((t,n)=>{t.forEach((t,r)=>{l[n]||(l[n]=[]);const i=s.has(`r${n+1}`)||s.has(`c${r+1}`)||s.has(`${n+1},${r+1}`),o=((t,n,r)=>r?.inputType?r.inputType:e?.rows?.inputType?.[t+1]||e?.columns?.inputType?.[n+1]||e?.cells?.inputType?.[`${t+1},${n+1}`]||{type:"text"})(n,r,t||qm);l[n][r]={...t,value:t?.value??"",readOnly:t?.readOnly?t.readOnly:i,inputType:o,contextDisable:t?.contextDisable}})}),n[t]=l,g.length>1){const e=i[0]||[];r[t]=Array.from({length:a},(t,n)=>({newData:"",oldData:e[n]?.value||""}))}}),U(n),g.length>1&&Y(r);const i=Object.keys(n)[0];i&&void 0!==n[i]&&W(n[i])}},[r]),l(()=>{v&&v(I),"File saved"===I&&setTimeout(()=>{T("")},2e3)},[I]),l(()=>{T("Saving..."),re(le())},[B,$.current]);const re=i.useCallback(xa(e=>{if(g.length>1){const t={...Q};O.forEach((n,r)=>{const i=(e[r].data[0]||[]).map(e=>e?.value||"");t[n]=(t[n]||[]).map((e,t)=>({...e,newData:i[t]||""}))}),Y(t);const n=O.map(e=>({sheetName:e,headers:t[e]||[]}));g(e,n)}else g(e);T("File saved")},w),[g,Q,O]),ae=i.useCallback(e=>{e.ctrlKey&&"s"===e.key&&(e.preventDefault(),e.stopPropagation(),re(le()))},[g]);i.useEffect(()=>(document.addEventListener("keydown",ae),()=>{document.removeEventListener("keydown",ae)}),[ae]);const le=()=>O.map(e=>{const t=B[e]?.map(e=>{const t=e.reduce((e,t,n)=>""!==String(t?.value??"").trim()?n:e,-1),n=e.map((e,n)=>e&&e.style&&n<=t?{value:e.value,style:gv(e.style),readOnly:e.readOnly,inputType:e.inputType,contextDisable:e.contextDisable}:null).filter(e=>null!==e);return n.length>0?n:[]})||[],n=t.filter((e,n)=>{const r=t.slice(n+1).some(e=>e.length>0);return e.length>0||r});return{sheetName:e,data:G(n.length)?[[]]:n}}),[se,ce]=c(null),de=()=>O.length>=S,ue=()=>{if(de())return;const e=((e,t)=>{const n=t.map(e=>e.toLowerCase());let r=`${e}1`,i=2;for(;n.includes(r.toLowerCase());)r=`${e}${i}`,i++;return r})("Sheet",O),t=Array.from({length:u},()=>Array.from({length:f},()=>qm));N(t=>[...t,e]),R({index:O?.length,name:e}),U({...B,[e]:t}),W(t),g.length>1&&Y(t=>({...t,[e]:Array.from({length:f},()=>({newData:"",oldData:""}))})),$.current=e},fe=(e=[[qm]])=>{W(e)},he=(e,t,n)=>{const r=e.target;if(!r||r?.textContent?.trim()===n?.trim())return void ce(null);const i=(r.textContent||"").trim();if(!i)return Ta.warning("Sheet name cannot be empty."),r.textContent=j.name,void ce(null);if(i.length>50)return Ta.warning("The sheet name cannot be greater than 50 characters"),r.textContent=j.name,void ce(null);if(O.map(e=>e.toLowerCase()).includes(i.toLowerCase())&&n.trim()?.toLowerCase()!==i?.toLowerCase())return Ta.warning("Sheet name already exists"),r.textContent=j.name,void ce(null);let o=O;fe(B?.[n]),o.splice(t,1,i);const a=function(e,t,n){if(!(t in e))throw new Error(`Key "${t}" not found in object`);const{[t]:r,...i}=e;return{...i,[n]:r??[]}}(B,n,i);$.current=i,R(e=>({...e,name:i})),U(a),g.length>1&&Y(e=>{const t={...e},r=t[n];return delete t[n],t[i]=r??[],t}),ce(null)};const pe=(e,t)=>{e!==j.name&&t!==j.index&&(R({index:t,name:e}),N(n=>{const r=[...n];return r[t]=e,r}),fe(B[e]),$.current=e)},Ce=i.useCallback((e,t=!1)=>{const n=e.target;(!n.closest(".ff-excel-tab-list")&&!n.closest(".ff-excel-sheet")||t)&&D.open&&(Z({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",Ce),document.addEventListener("click",e=>Ce(e,!0)),()=>{document.removeEventListener("contextmenu",Ce),document.removeEventListener("click",e=>Ce(e,!0))}),[Ce]);const me=(e,t,n)=>{e.preventDefault();const r=[{label:"Add Sheet",value:"Add Sheet",iconName:"plus_icon",action:()=>ue(),disableTooltip:"Sheet limit reached",visible:!1,disable:de()},...L?[]:[{label:"Delete Sheet",value:"Delete Sheet",iconName:"delete",action:()=>((e,t)=>{if(O.length>1){let n=O.slice();n.splice(t,1);const r={...B};delete r[e];const i=Math.min(t,n.length-1);N(n),U(r),g.length>1&&Y(t=>{const n={...t};return delete n[e],n});const o=n[i]?n[i]:"";R({index:i,name:o}),fe(r?.[o]),$.current=o}else Ta.warning("Cannot delete the last sheet.")})(t,n),disableTooltip:"",visible:!1,disable:!1}]];Z(e=>({...e,open:!0,contextType:"sheet",options:r}))};l(()=>{ne.current?.removeSelect()},[j.name]);return e(t,{children:O.length>0&&n("div",{ref:ee,className:"ff-excel",onContextMenu:e=>{e.preventDefault();const t=te.current?.parentElement?.getBoundingClientRect(),n=window.scrollX,r=window.scrollY;let i=e.clientX-(t?.left||0)+n,o=e.clientY-(t?.top||0)+r;const a=300,l=window.innerWidth,s=window.innerHeight,c=l-e.clientX,d=e.clientX,u=s-e.clientY,f=e.clientY;c<a&&d>=a?i=e.clientX-(t?.left||0)+n-150:i+=2,u<200&&f>=200?o=e.clientY-(t?.top||0)+r-20:o+=2,e.target.classList.contains("ff-excel-tab-list")?J({x:i,y:o-(L?32:65)}):(i+a>l&&(i=l-a-2),i<0&&(i=2),J({x:i+m,y:o+C}))},onClick:e=>{e.stopPropagation(),D.open&&Z({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(wv,{ref:ne,editable:p,attachmentAction:y,toolbar:s,sheetHeight:h,setContextMenu:Z,contextOption:o,data:q,columnContextEnable:E,rowContextEnable:M,minimumColumnWidth:x,onEvaluatedDataChange:e=>{U(t=>({...t,[$.current]:e}))},workRef:ee,scroller:b,maxRowLimit:k,maxColLimit:H,disableDeleteOption:L,contextMenu:D,getActiveCell:_,onAddColumn:(e,t)=>{g.length>1&&Y(n=>{const r=j.name,i=[...n[r]||[]],o=t?e:e+1;return i.splice(o,0,{newData:"",oldData:""}),{...n,[r]:i}})},onDeleteColumn:e=>{g.length>1&&Y(t=>{const n=j.name,r=[...t[n]||[]];return r.splice(e,1),{...t,[n]:r}})}},j.name)}),"hide"!==d&&n("div",{className:"ff-excel-sheet-bar",children:["show"===d&&n("div",{className:"ff-excel-add-sheet-set",children:[e(K,{title:de()?"Sheet limit reached":"Add Sheet",placement:"top",children:e(P,{disabled:!p||de(),className:"ff-excel-add-sheet-icon",hoverEffect:!0,onClick:ue,name:"plus_icon",height:20,width:20})}),e(fr,{options:(t=>t.map((t,r)=>({label:n("div",{style:{display:"flex",gap:"8px"},children:[j?.name===t?e(P,{height:16,width:16,name:"tick"}):e("div",{style:{height:"16px",width:"24px"}}),e(K,{title:oe(t,20,"count")?t:"",children:e(F,{children:ie(t,20,"count")})})]}),name:r,value:t})))(O),targetRef:V,onOptionClick:e=>{const{value:t,name:n=""}=e;pe(t,parseInt(n))},dropdownPlacement:"top",iconName:"show_script",tooltipTitle:"All Sheets",tooltipPlacement:"top",dropdownHeight:215,selectedValue:j.name})]}),e("div",{className:"ff-excel-tab-container",children:O.map((t,n)=>e(F,{lineHeight:"16px",children:e("div",{onContextMenu:e=>{pe(t,n),A&&me(e,t,n)},className:z("ff-excel-tab-list",{active:t===j.name}),onClick:()=>{pe(t,n)},suppressContentEditableWarning:se===n,onDoubleClick:e=>{"show"===d&&(ce(n),null===se&&setTimeout(()=>(e=>{const t=document.createRange(),n=window.getSelection();t.selectNodeContents(e),t.collapse(!1),n?.removeAllRanges(),n?.addRange(t)})(e.target),0))},contentEditable:p&&se===n,onBlur:e=>{he(e,n,t)},onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),he(e,n,t))},children:t})},t))})]}),D.open&&e(bv,{contextMenu:D,position:X,editable:p}),e(Ia,{})]})})},Mv=({label:t="",isActive:n=!0,onClick:r=()=>{},isFilterChip:i=!1})=>{const o=i?"filter":"module";return e("div",{className:z("ff-module-chip",{"ff-filter-chip":i,[`ff-${o}-chip--active`]:n,[`ff-${o}-chip--hover`]:!n}),onClick:r,children:e(F,{lineHeight:"18px",className:"module-typography",children:t})})},Av=({x:e,y:t,radius:n,startAngle:r,endAngle:i})=>{const o=e+n*Math.cos(r),a=t+n*Math.sin(r),l=e+n*Math.cos(i),s=t+n*Math.sin(i),c=i-r>Math.PI?1:0;return i-r>=2*Math.PI?`\n M ${e+n} ${t}\n A ${n} ${n} 0 1 1 ${e-n} ${t} \n A ${n} ${n} 0 1 1 ${e+n} ${t}\n `:`M ${o} ${a} A ${n} ${n} 0 ${c} 1 ${l} ${s}`},xv=({radius:t=15,lineWidth:r=5,label:i,percentageValue:o,icon:l,fontSize:s=10,labelColor:d="",arcColor:u="var(--brand-color)",backgroundArcColor:f="var(--ff-select-scroll-thumb-color)",isSelectedArch:h=!1,onSelect:p})=>{const[C,m]=c({x:0,y:0}),[g,v]=c(!1),y=a(null);let w=-Math.PI/2;const b=2*(t+r),{backgroundArcPath:E,foregroundArcPath:M}=((e,t,n)=>{const r=t,i=r+Math.max(0,Math.min(e,100))/100*2*Math.PI;return{backgroundArcPath:Av({x:0,y:0,radius:n,startAngle:0,endAngle:2*Math.PI}),foregroundArcPath:Av({x:0,y:0,radius:n,startAngle:r,endAngle:i})}})(o,w,t),A=()=>{v(!0)},x=()=>{m({x:0,y:0}),v(!1)},L=e=>{if(y.current){const t=y.current.getBoundingClientRect();m({x:e.clientX-t.left,y:e.clientY-t.top})}};return n("div",{ref:y,className:"ff-icon-radial-chart-container",style:{"--fontSize":`${s}px`},onClick:p,children:[e("svg",{width:b,height:b,viewBox:`0 0 ${b} ${b}`,role:"img",children:n("g",{transform:`translate(${t+r}, ${t+r})`,children:[e("path",{d:E,fill:"none",stroke:f,strokeWidth:r,onMouseEnter:A,onMouseLeave:x,onMouseMove:L}),e("path",{d:M,fill:"none",stroke:u,strokeWidth:r,onMouseEnter:A,onMouseLeave:x,onMouseMove:L}),h&&e("path",{d:M,fill:"none",stroke:"var(--dotted-border-color)",strokeOpacity:"0.4",strokeWidth:r,onMouseEnter:A,onMouseLeave:x,onMouseMove:L}),l?e("foreignObject",{x:"-10",y:"-10",width:"20",height:"20",children:e(P,{className:"ff-radial-chart-icon-padding",name:l,height:20,width:20})}):e("text",{x:"0",y:"0",fill:d||u,textAnchor:"middle",dominantBaseline:"central",children:`${Math.round(o)}%`})]})}),g&&n("div",{className:"ff-icon-radial-chart-tooltip",style:{position:"absolute",left:`${C.x+15}px`,top:C.y-5+"px"},children:[e(F,{children:`${i} : `}),n(F,{children:[o,"%"]})]})]})},Lv=({mediaSrc:t,fileId:r,onExpandClick:i,onDeleteClick:o,onDownloadClick:a,height:l="75px",width:s="79px",fileName:c,thumbnailMediaSrc:d,isDelete:u})=>e("div",{className:"ff-attach-media-container",style:{height:l,width:s},children:n("div",{className:"ff-media-wrapper",style:{height:l,width:s},children:[e("img",{src:d||t,alt:"Attached"}),n("div",{className:"ff-hover-icons",children:[n("div",{className:"ff-top-icons",children:[e("div",{className:"ff-icon-container",children:e(K,{title:"Download File",placement:"bottom",children:e(P,{name:"download_file_icon",height:10,width:10,onClick:a,color:"var(--icons-default-color)"})})}),u&&e("div",{className:"ff-icon-container",children:e(K,{title:"Delete",placement:"bottom",children:e(P,{name:"delete",height:10,width:10,color:"var(--ff-delete-button-attachment)",onClick:()=>{o&&o(r)}})})})]}),e("div",{className:"ff-expand-icon-container",children:e(K,{title:"Maximize",placement:"bottom",children:e(P,{name:"expand_icon",height:16,width:16,onClick:i})})})]}),e(F,{color:"var(--text-area-default-color)",fontWeight:"medium",className:"ff-media-text",children:c})]})}),kv=({icon:r,status:i,count:o,text:a,style:s={width:"196.4px"},resetToggle:d,onSelectedStatus:u=e=>{}})=>{const[f,h]=c(!1),p=["total defects","defect density","open defects","closed defects","quality score"],C=p.includes(i.toLowerCase()),m=p.includes(i.toLowerCase());l(()=>{h(!d)},[d]);return n("div",{className:`ff-card-container ${i.toLowerCase()} ${f?"toggled":""}`,style:s,onClick:()=>(e=>{p.includes(e.toLowerCase())||(h(!0),u(e))})(i),children:[n("div",{className:"ff-status-bar",children:[e("div",{children:e(P,{name:r,height:20,width:20,hoverEffect:!1})}),!p.includes(i.toLowerCase())&&e(F,{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,C?{children:[e(F,{fontWeight:"semi-bold",fontSize:"10px",className:"ff-text",lineHeight:"15px",color:"var(--ff-chip-text-color)",children:a}),e(F,{fontWeight:"semi-bold",fontSize:"24px",className:"ff-number",lineHeight:"36px",children:"defect density"===i.toLowerCase()?n(t,{children:[o.toString().padStart(2,"0"),e(F,{fontSize:"15px",fontWeight:"semi-bold",children:"/ Modules"})]}):"quality score"===i.toLowerCase()?`${parseFloat(o.toString()).toFixed(2)}%`:o.toString().padStart(2,"0")})]}:{children:[e(F,{fontWeight:"semi-bold",fontSize:"24px",className:"ff-number",lineHeight:"24px",color:f?"var(--base-bg-color)":"",children:o.toString().padStart(2,"0")}),e(F,{className:"ff-text",lineHeight:"18px",color:f?"var(--base-bg-color)":"var(--ff-chip-text-color)",children:a})]})})]})},Hv=({option:t})=>{const r=a(null),[i,o]=c(!1);l(()=>{const e=r.current;if(!e)return;const t=()=>{o(e.scrollWidth>e.clientWidth)},n=requestAnimationFrame(t);return window.addEventListener("resize",t),()=>{cancelAnimationFrame(n),window.removeEventListener("resize",t)}},[t]);const s={LOCAL:"local_variable_icon",GLOBAL:"global_variable_icon",PROJECT_ENVIRONMENT:"project_env_variable_icon"},d=e=>"_startforloop"===e?.type?`FLV_for:${e?.name}`:"DATAPROVIDER"===e?.type?`${e?.dpName}:${e?.varname}`:e?.name;return n("div",{style:{width:"-webkit-fill-available"},className:"ff-variable-option ff-variable-data",children:[e(K,{title:i?d(t):"",style:{width:"calc(100% - 32px)"},children:e("span",{ref:r,className:"ff-truncated_text",children:d(t)})}),e(P,{name:(e=>{if(!e)return"";const t=e._id||e.id;return t?.startsWith("PARAMETER")?"step_group_parameter":"LOCAL"===e.type&&"STEPGROUP"===e?.parentVariableType?"step_group_variable":"_startforloop"===e.type?"for_loop_variable":"DATAPROVIDER"===e.type?"data_provider_variable":s[e.type||""]||""})(t),height:24,width:24,hoverEffect:!0})]})};function Sv(e){return()=>e}function _v(e){e()}function Vv(e,t){return n=>e(t(n))}function Ov(e,t){return()=>e(t)}function zv(e){return void 0!==e}function Nv(){}function Iv(e,t){return t(e),e}function Tv(e,t){return t(e)}function Dv(...e){return e}function Zv(e,t){return e(1,t)}function jv(e,t){e(0,t)}function Rv(e){e(2)}function Bv(e){return e(4)}function Pv(e,t){return Zv(e,function(e,t){return n=>e(t,n)}(t,0))}function Fv(e,t){const n=e(1,e=>{n(),t(e)});return n}function Uv(e){let t,n;return r=>i=>{t=i,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function qv(e,t){return e===t}function Wv(e=qv){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function Qv(e){return t=>n=>{e(n)&&t(n)}}function Gv(e){return t=>Vv(t,e)}function Kv(e){return t=>()=>{t(e)}}function Yv(e,...t){const n=function(...e){return t=>e.reduceRight(Tv,t)}(...t);return(t,r)=>{switch(t){case 2:return void Rv(e);case 1:return Zv(e,n(r))}}}function Xv(e,t){return n=>r=>{n(t=e(t,r))}}function Jv(e){return t=>n=>{e>0?e--:t(n)}}function $v(e){let t,n=null;return r=>i=>{n=i,!t&&(t=setTimeout(()=>{t=void 0,r(n)},e))}}function ey(...e){const t=new Array(e.length);let n=0,r=null;const i=Math.pow(2,e.length)-1;return e.forEach((e,o)=>{const a=Math.pow(2,o);Zv(e,e=>{const l=n;n|=a,t[o]=e,l!==i&&n===i&&r&&(r(),r=null)})}),e=>o=>{const a=()=>{e([o].concat(t))};n===i?a():r=a}}function ty(e){let t=e;const n=ry();return(e,r)=>{switch(e){case 0:t=r;break;case 1:r(t);break;case 4:return t}return n(e,r)}}function ny(e,t){return Iv(ty(t),t=>Pv(e,t))}function ry(){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 iy(e){return Iv(ry(),t=>Pv(e,t))}function oy(e,t=[],{singleton:n}={singleton:!0}){return{constructor:e,dependencies:t,id:ay(),singleton:n}}const ay=()=>Symbol();function ly(...e){const t=ry(),n=new Array(e.length);let r=0;const i=Math.pow(2,e.length)-1;return e.forEach((e,o)=>{const a=Math.pow(2,o);Zv(e,e=>{n[o]=e,r|=a,r===i&&jv(t,n)})}),function(e,o){switch(e){case 2:return void Rv(t);case 1:return r===i&&o(n),Zv(t,o)}}}function sy(e,t=qv){return Yv(e,Wv(t))}function cy(...e){return function(t,n){switch(t){case 2:return;case 1:return function(...e){return()=>{e.map(_v)}}(...e.map(e=>Zv(e,n)))}}}var dy=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(dy||{});const uy={0:"debug",3:"error",1:"log",2:"warn"},fy=oy(()=>{const e=ty(3);return{log:ty((t,n,r=1)=>{var i;r>=(null!=(i=(typeof globalThis>"u"?window:globalThis).VIRTUOSO_LOG_LEVEL)?i:Bv(e))&&console[uy[r]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,n)}),logLevel:e}},[],{singleton:!0});function hy(e,t,n){return py(e,t,n).callbackRef}function py(e,t,n){const r=i.useRef(null);let o=e=>{};const a=i.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(t=>{const r=()=>{const n=t[0].target;null!==n.offsetParent&&e(n)};n?r():requestAnimationFrame(r)}):null,[e,n]);return o=e=>{e&&t?(null==a||a.observe(e),r.current=e):(r.current&&(null==a||a.unobserve(r.current)),r.current=null)},{callbackRef:o,ref:r}}function Cy(e,t,n,r,o,a,l,s,c){const d=i.useCallback(n=>{const i=function(e,t,n,r){const i=e.length;if(0===i)return null;const o=[];for(let a=0;a<i;a++){const i=e.item(a);if(void 0===i.dataset.index)continue;const l=parseInt(i.dataset.index),s=parseFloat(i.dataset.knownSize),c=t(i,n);if(0===c&&r("Zero-sized element, this should not happen",{child:i},dy.ERROR),c===s)continue;const d=o[o.length-1];0===o.length||d.size!==c||d.endIndex!==l-1?o.push({endIndex:l,size:c,startIndex:l}):o[o.length-1].endIndex++}return o}(n.children,t,s?"offsetWidth":"offsetHeight",o);let c=n.parentElement;for(;!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,p=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:p}),null==a||a(s?my("column-gap",getComputedStyle(n).columnGap,o):my("row-gap",getComputedStyle(n).rowGap,o)),null!==i&&e(i)},[e,t,o,a,l,r,s]);return py(d,n,c)}function my(e,t,n){return"normal"!==t&&!(null!=t&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,dy.WARN),"normal"===t?0:parseInt(null!=t?t:"0",10)}function gy(e,t,n){const r=i.useRef(null),o=i.useCallback(n=>{if(null==n||!n.offsetParent)return;const i=n.getBoundingClientRect(),o=i.width;let a,s;if(t){const e=t.getBoundingClientRect(),n=i.top-e.top;s=e.height-Math.max(0,n),a=n+t.scrollTop}else{const e=l.current.ownerDocument.defaultView;s=e.innerHeight-Math.max(0,i.top),a=i.top+e.scrollY}r.current={offsetTop:a,visibleHeight:s,visibleWidth:o},e(r.current)},[e,t]),{callbackRef:a,ref:l}=py(o,!0,n),s=i.useCallback(()=>{o(l.current)},[o,l]);return i.useEffect(()=>{var e;if(t){t.addEventListener("scroll",s);const e=new ResizeObserver(()=>{requestAnimationFrame(s)});return e.observe(t),()=>{t.removeEventListener("scroll",s),e.unobserve(t)}}{const t=null==(e=l.current)?void 0:e.ownerDocument.defaultView;return null==t||t.addEventListener("scroll",s),null==t||t.addEventListener("resize",s),()=>{null==t||t.removeEventListener("scroll",s),null==t||t.removeEventListener("resize",s)}}},[s,t,l]),a}const vy=oy(()=>{const e=ry(),t=ry(),n=ty(0),r=ry(),i=ty(0),o=ry(),a=ry(),l=ty(0),s=ty(0),c=ty(0),d=ty(0),u=ry(),f=ry(),h=ty(!1),p=ty(!1),C=ty(!1);return Pv(Yv(e,Gv(({scrollTop:e})=>e)),t),Pv(Yv(e,Gv(({scrollHeight:e})=>e)),a),Pv(t,i),{deviation:n,fixedFooterHeight:c,fixedHeaderHeight:s,footerHeight:d,headerHeight:l,horizontalDirection:p,scrollBy:f,scrollContainerState:e,scrollHeight:a,scrollingInProgress:h,scrollTo:u,scrollTop:t,skipAnimationFrameInResizeObserver:C,smoothScrollTargetReached:r,statefulScrollTop:i,viewportHeight:o}},[],{singleton:!0}),yy={lvl:0};function wy(e,t){const n=e.length;if(0===n)return[];let{index:r,value:i}=t(e[0]);const o=[];for(let a=1;a<n;a++){const{index:n,value:l}=t(e[a]);o.push({end:n-1,start:r,value:i}),r=n,i=l}return o.push({end:1/0,start:r,value:i}),o}function by(e){return e===yy}function Ey(e,t){if(!by(e))return t===e.k?e.v:t<e.k?Ey(e.l,t):Ey(e.r,t)}function My(e,t,n="k"){if(by(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){const r=My(e.r,t,n);return r[0]===-1/0?[e.k,e.v]:r}return My(e.l,t,n)}function Ay(e,t,n){return by(e)?Iy(t,n,1):t===e.k?Vy(e,{k:t,v:n}):t<e.k?Ty(Vy(e,{l:Ay(e.l,t,n)})):Ty(Vy(e,{r:Ay(e.r,t,n)}))}function xy(){return yy}function Ly(e,t,n){if(by(e))return[];return function(e){return wy(e,({k:e,v:t})=>({index:e,value:t}))}(Sy(e,My(e,t)[0],n))}function ky(e,t){if(by(e))return yy;const{k:n,l:r,r:i}=e;if(t===n){if(by(r))return i;if(by(i))return r;{const[t,n]=Ny(r);return _y(Vy(e,{k:t,l:Oy(r),v:n}))}}return _y(Vy(e,t<n?{l:ky(r,t)}:{r:ky(i,t)}))}function Hy(e){return by(e)?[]:[...Hy(e.l),{k:e.k,v:e.v},...Hy(e.r)]}function Sy(e,t,n){if(by(e))return[];const{k:r,l:i,r:o,v:a}=e;let l=[];return r>t&&(l=l.concat(Sy(i,t,n))),r>=t&&r<=n&&l.push({k:r,v:a}),r<=n&&(l=l.concat(Sy(o,t,n))),l}function _y(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(zy(t))return Dy(Vy(e,{lvl:n-1}));if(!by(t)&&!by(t.r))return Vy(t.r,{l:Vy(t,{r:t.r.l}),lvl:n,r:Vy(e,{l:t.r.r,lvl:n-1})});throw new Error("Unexpected empty nodes")}if(zy(e))return Zy(Vy(e,{lvl:n-1}));if(by(r)||by(r.l))throw new Error("Unexpected empty nodes");{const t=r.l,i=zy(t)?r.lvl-1:r.lvl;return Vy(t,{l:Vy(e,{lvl:n-1,r:t.l}),lvl:t.lvl+1,r:Zy(Vy(r,{l:t.r,lvl:i}))})}}function Vy(e,t){return Iy(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 Oy(e){return by(e.r)?e.l:_y(Vy(e,{r:Oy(e.r)}))}function zy(e){return by(e)||e.lvl>e.r.lvl}function Ny(e){return by(e.r)?[e.k,e.v]:Ny(e.r)}function Iy(e,t,n,r=yy,i=yy){return{k:e,l:r,lvl:n,r:i,v:t}}function Ty(e){return Zy(Dy(e))}function Dy(e){const{l:t}=e;return by(t)||t.lvl!==e.lvl?e:Vy(t,{r:Vy(e,{l:t.r})})}function Zy(e){const{lvl:t,r:n}=e;return by(n)||by(n.r)||n.lvl!==t||n.r.lvl!==t?e:Vy(n,{l:Vy(e,{r:n.l}),lvl:t+1})}function jy(e,t){return!(!e||e.startIndex!==t.startIndex||e.endIndex!==t.endIndex)}function Ry(e,t){return!(!e||e[0]!==t[0]||e[1]!==t[1])}const By=oy(()=>({recalcInProgress:ty(!1)}),[],{singleton:!0});function Py(e,t,n){return e[Fy(e,t,n)]}function Fy(e,t,n,r=0){let i=e.length-1;for(;r<=i;){const o=Math.floor((r+i)/2),a=n(e[o],t);if(0===a)return o;if(-1===a){if(i-r<2)return o-1;i=o-1}else{if(i===r)return o;r=o+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function Uy(e,t){return Math.round(e.getBoundingClientRect()[t])}function qy(e){return!by(e.groupOffsetTree)}function Wy({index:e},t){return t===e?0:t<e?-1:1}function Qy({offset:e},t){return t===e?0:t<e?-1:1}function Gy(e,t,n){if(0===t.length)return 0;const{index:r,offset:i,size:o}=Py(t,e,Wy),a=e-r,l=o*a+(a-1)*n+i;return l>0?l+n:l}function Ky(e,t){if(!qy(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function Yy(e,t,n){if(function(e){return typeof e.groupIndex<"u"}(e))return t.groupIndices[e.groupIndex]+1;{let r=Ky("LAST"===e.index?n:e.index,t);return r=Math.max(0,r,Math.min(n,r)),r}}function Xy(e,t,n,r=0){return r>0&&(t=Math.max(t,Py(e,r,Wy).offset)),wy(function(e,t,n,r){const i=Fy(e,t,r),o=Fy(e,n,r,i);return e.slice(i,o+1)}(e,t,n,Qy),tw)}function Jy(e,[t,n,r,i]){t.length>0&&r("received item sizes",t,dy.DEBUG);const o=e.sizeTree;let a=o,l=0;if(n.length>0&&by(o)&&2===t.length){const e=t[0].size,r=t[1].size;a=n.reduce((t,n)=>Ay(Ay(t,n,e),n+1,r),a)}else[a,l]=function(e,t){let n=by(e)?0:1/0;for(const r of t){const{endIndex:t,size:i,startIndex:o}=r;if(n=Math.min(n,o),by(e)){e=Ay(e,0,i);continue}const a=Ly(e,o-1,t+1);if(a.some(nw(r)))continue;let l=!1,s=!1;for(const{end:n,start:r,value:o}of a)l?(t>=r||i===o)&&(e=ky(e,r)):(s=o!==i,l=!0),n>t&&t>=r&&o!==i&&(e=Ay(e,t+1,o));s&&(e=Ay(e,o,i))}return[e,n]}(a,t);if(a===o)return e;const{lastIndex:s,lastOffset:c,lastSize:d,offsetTree:u}=ew(e.offsetTree,l,a,i);return{groupIndices:n,groupOffsetTree:n.reduce((e,t)=>Ay(e,t,Gy(t,u,i)),xy()),lastIndex:s,lastOffset:c,lastSize:d,offsetTree:u,sizeTree:a}}function $y(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 ew(e,t,n,r){let i=e,o=0,a=0,l=0,s=0;if(0!==t){s=Fy(i,t-1,Wy),l=i[s].offset;const e=My(n,t-1);o=e[0],a=e[1],i.length&&i[s].size===My(n,t)[1]&&(s-=1),i=i.slice(0,s+1)}else i=[];for(const{start:e,value:s}of Ly(n,t,1/0)){const t=e-o,n=t*a+l+t*r;i.push({index:e,offset:n,size:s}),o=e,l=n,a=s}return{lastIndex:o,lastOffset:l,lastSize:a,offsetTree:i}}function tw(e){return{index:e.index,value:e}}function nw(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 rw={offsetHeight:"height",offsetWidth:"width"},iw=oy(([{log:e},{recalcInProgress:t}])=>{const n=ry(),r=ry(),i=ny(r,0),o=ry(),a=ry(),l=ty(0),s=ty([]),c=ty(void 0),d=ty(void 0),u=ty(void 0),f=ty(void 0),h=ty((e,t)=>Uy(e,rw[t])),p=ty(void 0),C=ty(0),m={groupIndices:[],groupOffsetTree:xy(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:xy()},g=ny(Yv(n,ey(s,e,C),Xv(Jy,m),Wv()),m),v=ny(Yv(s,Wv(),Xv((e,t)=>({current:t,prev:e.current}),{current:[],prev:[]}),Gv(({prev:e})=>e)),[]);Pv(Yv(s,Qv(e=>e.length>0),ey(g,C),Gv(([e,t,n])=>{const r=e.reduce((e,r,i)=>Ay(e,r,Gy(r,t.offsetTree,n)||i),xy());return{...t,groupIndices:e,groupOffsetTree:r}})),g),Pv(Yv(r,ey(g),Qv(([e,{lastIndex:t}])=>e<t),Gv(([e,{lastIndex:t,lastSize:n}])=>[{endIndex:t,size:n,startIndex:e}])),n),Pv(c,d);const y=ny(Yv(c,Gv(e=>void 0===e)),!0);Pv(Yv(d,Qv(e=>void 0!==e&&by(Bv(g).sizeTree)),Gv(e=>{const t=Bv(u),n=Bv(s).length>0;return t?n?[{endIndex:0,size:t,startIndex:0},{endIndex:1,size:e,startIndex:1}]:[]:[{endIndex:0,size:e,startIndex:0}]})),n),Pv(Yv(f,Qv(e=>void 0!==e&&e.length>0&&by(Bv(g).sizeTree)),Gv(e=>{const t=[];let n=e[0],r=0;for(let i=1;i<e.length;i++){const o=e[i];o!==n&&(t.push({endIndex:i-1,size:n,startIndex:r}),n=o,r=i)}return t.push({endIndex:e.length-1,size:n,startIndex:r}),t})),n),Pv(Yv(s,ey(u,d),Qv(([,e,t])=>void 0!==e&&void 0!==t),Gv(([e,t,n])=>{const r=[];for(let i=0;i<e.length;i++){const o=e[i],a=e[i+1];r.push({startIndex:o,endIndex:o,size:t}),void 0!==a&&r.push({startIndex:o+1,endIndex:a-1,size:n})}return r})),n);const w=iy(Yv(n,ey(g),Xv(({sizes:e},[t,n])=>({changed:n!==e,sizes:n}),{changed:!1,sizes:m}),Gv(e=>e.changed)));Zv(Yv(l,Xv((e,t)=>({diff:e.prev-t,prev:t}),{diff:0,prev:0}),Gv(e=>e.diff)),e=>{const{groupIndices:n}=Bv(g);if(e>0)jv(t,!0),jv(o,e+$y(e,n));else if(e<0){const t=Bv(v);t.length>0&&(e-=$y(-e,t)),jv(a,e)}}),Zv(Yv(l,ey(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},dy.ERROR)});const b=iy(o);Pv(Yv(o,ey(g),Gv(([e,t])=>{const n=t.groupIndices.length>0,r=[],i=t.lastSize;if(n){const n=Ey(t.sizeTree,0);let o=0,a=0;for(;o<e;){const e=t.groupIndices[a],l=t.groupIndices.length===a+1?1/0:t.groupIndices[a+1]-e-1;r.push({endIndex:e,size:n,startIndex:e}),r.push({endIndex:e+1+l-1,size:i,startIndex:e+1}),a++,o+=l+1}const l=Hy(t.sizeTree);return o!==e&&l.shift(),l.reduce((t,{k:n,v:r})=>{let i=t.ranges;return 0!==t.prevSize&&(i=[...t.ranges,{endIndex:n+e-1,size:t.prevSize,startIndex:t.prevIndex}]),{prevIndex:n+e,prevSize:r,ranges:i}},{prevIndex:e,prevSize:0,ranges:r}).ranges}return Hy(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=iy(Yv(a,ey(g,C),Gv(([e,{offsetTree:t},n])=>Gy(-e,t,n))));return Pv(Yv(a,ey(g,C),Gv(([e,t,n])=>{if(t.groupIndices.length>0){if(by(t.sizeTree))return t;let r=xy();const i=Bv(v);let o=0,a=0,l=0;for(;o<-e;){l=i[a];const e=i[a+1]-l-1;a++,o+=e+1}if(r=Hy(t.sizeTree).reduce((t,{k:n,v:r})=>Ay(t,Math.max(0,n+e),r),r),o!==-e){r=Ay(r,0,Ey(t.sizeTree,l));r=Ay(r,1,My(t.sizeTree,1-e)[1])}return{...t,sizeTree:r,...ew(t.offsetTree,0,r,n)}}{const r=Hy(t.sizeTree).reduce((t,{k:n,v:r})=>Ay(t,Math.max(0,n+e),r),xy());return{...t,sizeTree:r,...ew(t.offsetTree,0,r,n)}}})),g),{beforeUnshiftWith:b,data:p,defaultItemSize:d,firstItemIndex:l,fixedItemSize:c,fixedGroupSize:u,gap:C,groupIndices:s,heightEstimates:f,itemSize:h,listRefresh:w,shiftWith:a,shiftWithOffset:E,sizeRanges:n,sizes:g,statefulTotalCount:i,totalCount:r,trackItemSizes:y,unshiftWith:o}},Dv(fy,By),{singleton:!0});function ow(e){return e.reduce((e,t)=>(e.groupIndices.push(e.totalCount),e.totalCount+=t+1,e),{groupIndices:[],totalCount:0})}const aw=oy(([{groupIndices:e,sizes:t,totalCount:n},{headerHeight:r,scrollTop:i}])=>{const o=ry(),a=ry(),l=iy(Yv(o,Gv(ow)));return Pv(Yv(l,Gv(e=>e.totalCount)),n),Pv(Yv(l,Gv(e=>e.groupIndices)),e),Pv(Yv(ly(i,t,r),Qv(([e,t])=>qy(t)),Gv(([e,t,n])=>My(t.groupOffsetTree,Math.max(e-n,0),"v")[0]),Wv(),Gv(e=>[e])),a),{groupCounts:o,topItemsIndexes:a}},Dv(iw,vy)),lw=oy(([{log:e}])=>{const t=ty(!1),n=iy(Yv(t,Qv(e=>e),Wv()));return Zv(t,t=>{t&&Bv(e)("props updated",{},dy.DEBUG)}),{didMount:n,propsReady:t}},Dv(fy),{singleton:!0}),sw=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function cw(e){const t="number"==typeof e?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!sw)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const dw=oy(([{gap:e,listRefresh:t,sizes:n,totalCount:r},{fixedFooterHeight:i,fixedHeaderHeight:o,footerHeight:a,headerHeight:l,scrollingInProgress:s,scrollTo:c,smoothScrollTargetReached:d,viewportHeight:u},{log:f}])=>{const h=ry(),p=ry(),C=ty(0);let m=null,g=null,v=null;function y(){m&&(m(),m=null),v&&(v(),v=null),g&&(clearTimeout(g),g=null),jv(s,!1)}return Pv(Yv(h,ey(n,u,r,C,l,a,f),ey(e,o,i),Gv(([[e,n,r,i,o,a,l,c],u,f,C])=>{const w=cw(e),{align:b,behavior:E,offset:M}=w,A=i-1,x=Yy(w,n,A);let L=Gy(x,n.offsetTree,u)+a;"end"===b?(L+=f+My(n.sizeTree,x)[1]-r+C,x===A&&(L+=l)):"center"===b?L+=(f+My(n.sizeTree,x)[1]-r+C)/2:L-=o,M&&(L+=M);const k=t=>{y(),t?(c("retrying to scroll to",{location:e},dy.DEBUG),jv(h,e)):(jv(p,!0),c("list did not change, scroll successful",{},dy.DEBUG))};if(y(),"smooth"===E){let e=!1;v=Zv(t,t=>{e=e||t}),m=Fv(d,()=>{k(e)})}else m=Fv(Yv(t,function(e){return t=>{const n=setTimeout(()=>{t(!1)},e);return e=>{e&&(t(!0),clearTimeout(n))}}}(150)),k);return g=setTimeout(()=>{y()},1200),jv(s,!0),c("scrolling from index to",{behavior:E,index:x,top:L},dy.DEBUG),{behavior:E,top:L}})),c),{scrollTargetReached:p,scrollToIndex:h,topListHeight:C}},Dv(iw,vy,fy),{singleton:!0});function uw(e,t){0==e?t():requestAnimationFrame(()=>{uw(e-1,t)})}function fw(e,t){const n=t-1;return"number"==typeof e?e:"LAST"===e.index?n:e.index}const hw=oy(([{defaultItemSize:e,listRefresh:t,sizes:n},{scrollTop:r},{scrollTargetReached:i,scrollToIndex:o},{didMount:a}])=>{const l=ty(!0),s=ty(0),c=ty(!0);return Pv(Yv(a,ey(s),Qv(([e,t])=>!!t),Kv(!1)),l),Pv(Yv(a,ey(s),Qv(([e,t])=>!!t),Kv(!1)),c),Zv(Yv(ly(t,a),ey(l,n,e,c),Qv(([[,e],t,{sizeTree:n},r,i])=>e&&(!by(n)||zv(r))&&!t&&!i),ey(s)),([,e])=>{Fv(i,()=>{jv(c,!0)}),uw(4,()=>{Fv(r,()=>{jv(l,!0)}),jv(o,e)})}),{initialItemFinalLocationReached:c,initialTopMostItemIndex:s,scrolledToInitialItem:l}},Dv(iw,vy,dw,lw),{singleton:!0});function pw(e,t){return Math.abs(e-t)<1.01}const Cw="up",mw="down",gw={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},vw=oy(([{footerHeight:e,headerHeight:t,scrollBy:n,scrollContainerState:r,scrollTop:i,viewportHeight:o}])=>{const a=ty(!1),l=ty(!0),s=ry(),c=ry(),d=ty(4),u=ty(0),f=ny(Yv(cy(Yv(sy(i),Jv(1),Kv(!0)),Yv(sy(i),Jv(1),Kv(!1),Uv(100))),Wv()),!1),h=ny(Yv(cy(Yv(n,Kv(!0)),Yv(n,Kv(!1),Uv(200))),Wv()),!1);Pv(Yv(ly(sy(i),sy(u)),Gv(([e,t])=>e<=t),Wv()),l),Pv(Yv(l,$v(50)),c);const p=iy(Yv(ly(r,sy(o),sy(t),sy(e),sy(d)),Xv((e,[{scrollHeight:t,scrollTop:n},r,i,o,a])=>{const l={scrollHeight:t,scrollTop:n,viewportHeight:r};if(n+r-t>-a){let t,r;return n>e.state.scrollTop?(t="SCROLLED_DOWN",r=e.state.scrollTop-n):(t="SIZE_DECREASED",r=e.state.scrollTop-n||e.scrollTopDelta),{atBottom:!0,atBottomBecause:t,scrollTopDelta:r,state:l}}let s;return s=l.scrollHeight>e.state.scrollHeight?"SIZE_INCREASED":r<e.state.viewportHeight?"VIEWPORT_HEIGHT_DECREASING":n<e.state.scrollTop?"SCROLLING_UPWARDS":"NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:s,state:l}},gw),Wv((e,t)=>e&&e.atBottom===t.atBottom))),C=ny(Yv(r,Xv((e,{scrollHeight:t,scrollTop:n,viewportHeight:r})=>{if(pw(e.scrollHeight,t))return{changed:!1,jump:0,scrollHeight:t,scrollTop:n};{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}}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),Qv(e=>e.changed),Gv(e=>e.jump)),0);Pv(Yv(p,Gv(e=>e.atBottom)),a),Pv(Yv(a,$v(50)),s);const m=ty(mw);Pv(Yv(r,Gv(({scrollTop:e})=>e),Wv(),Xv((e,t)=>Bv(h)?{direction:e.direction,prevScrollTop:t}:{direction:t<e.prevScrollTop?Cw:mw,prevScrollTop:t},{direction:mw,prevScrollTop:0}),Gv(e=>e.direction)),m),Pv(Yv(r,$v(50),Kv("none")),m);const g=ty(0);return Pv(Yv(f,Qv(e=>!e),Kv(0)),g),Pv(Yv(i,$v(100),ey(f),Qv(([e,t])=>t),Xv(([e,t],[n])=>[t,n],[0,0]),Gv(([e,t])=>t-e)),g),{atBottomState:p,atBottomStateChange:s,atBottomThreshold:d,atTopStateChange:c,atTopThreshold:u,isAtBottom:a,isAtTop:l,isScrolling:f,lastJumpDueToItemResize:C,scrollDirection:m,scrollVelocity:g}},Dv(vy)),yw="top",ww="bottom",bw="none";function Ew(e,t,n){return"number"==typeof e?n===Cw&&t===yw||n===mw&&t===ww?e:0:n===Cw?t===yw?e.main:e.reverse:t===ww?e.main:e.reverse}function Mw(e,t){var n;return"number"==typeof e?e:null!=(n=e[t])?n:0}const Aw=oy(([{deviation:e,fixedHeaderHeight:t,headerHeight:n,scrollTop:r,viewportHeight:i}])=>{const o=ry(),a=ty(0),l=ty(0),s=ty(0),c=ny(Yv(ly(sy(r),sy(i),sy(n),sy(o,Ry),sy(s),sy(a),sy(t),sy(e),sy(l)),Gv(([e,t,n,[r,i],o,a,l,s,c])=>{const d=e-s,u=a+l,f=Math.max(n-d,0);let h=bw;const p=Mw(c,yw),C=Mw(c,ww);return r-=s,i+=n+l,(r+=n+l)>e+u-p&&(h=Cw),(i-=s)<e-f+t+C&&(h=mw),h!==bw?[Math.max(d-n-Ew(o,yw,h)-p,0),d-f-l+t+Ew(o,ww,h)+C]:null}),Qv(e=>null!=e),Wv(Ry)),[0,0]);return{increaseViewportBy:l,listBoundary:o,overscan:s,topListHeight:a,visibleRange:c}},Dv(vy),{singleton:!0});const xw={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function Lw(e,t,n,r,i,o){const{lastIndex:a,lastOffset:l,lastSize:s}=i;let c=0,d=0;if(e.length>0){c=e[0].offset;const t=e[e.length-1];d=t.offset+t.size}const u=n-a,f=c,h=l+u*s+(u-1)*r-d;return{bottom:d,firstItemIndex:o,items:Hw(e,i,o),offsetBottom:h,offsetTop:c,top:f,topItems:Hw(t,i,o),topListHeight:t.reduce((e,t)=>t.size+e,0),totalCount:n}}function kw(e,t,n,r,i,o){let a=0;if(n.groupIndices.length>0)for(const t of n.groupIndices){if(t-a>=e)break;a++}const l=e+a,s=fw(t,l);return Lw(Array.from({length:l}).map((e,t)=>({data:o[t+s],index:t+s,offset:0,size:0})),[],l,i,n,r)}function Hw(e,t,n){if(0===e.length)return[];if(!qy(t))return e.map(e=>({...e,index:e.index+n,originalIndex:e.index}));const r=e[0].index,i=e[e.length-1].index,o=[],a=Ly(t.groupOffsetTree,r,i);let l,s=0;for(const r of e){let e;(!l||l.end<r.index)&&(l=a.shift(),s=t.groupIndices.indexOf(l.start)),e=r.index===l.start?{index:s,type:"group"}:{groupIndex:s,index:r.index-(s+1)+n},o.push({...e,data:r.data,offset:r.offset,originalIndex:r.index,size:r.size})}return o}function Sw(e,t){var n;return void 0===e?0:"number"==typeof e?e:null!=(n=e[t])?n:0}const _w=oy(([{data:e,firstItemIndex:t,gap:n,sizes:r,totalCount:i},o,{listBoundary:a,topListHeight:l,visibleRange:s},{initialTopMostItemIndex:c,scrolledToInitialItem:d},{topListHeight:u},f,{didMount:h},{recalcInProgress:p}])=>{const C=ty([]),m=ty(0),g=ry(),v=ty(0);Pv(o.topItemsIndexes,C);const y=ny(Yv(ly(h,p,sy(s,Ry),sy(i),sy(r),sy(c),d,sy(C),sy(t),sy(n),sy(v),e),Qv(([e,t,,n,,,,,,,,r])=>{const i=r&&r.length!==n;return e&&!t&&!i}),Gv(([,,[e,t],n,r,i,o,a,l,s,c,d])=>{var u,f,h,p;const C=r,{offsetTree:g,sizeTree:v}=C,y=Bv(m);if(0===n)return{...xw,totalCount:n};if(0===e&&0===t)return 0===y?{...xw,totalCount:n}:kw(y,i,r,l,s,d||[]);if(by(v))return y>0?null:Lw(function(e,t,n){if(qy(t)){const r=Ky(e,t);return[{index:My(t.groupOffsetTree,r)[0],offset:0,size:0},{data:null==n?void 0:n[0],index:r,offset:0,size:0}]}return[{data:null==n?void 0:n[0],index:e,offset:0,size:0}]}(fw(i,n),C,d),[],n,s,C,l);const w=[];if(a.length>0){const e=a[0],t=a[a.length-1];let n=0;for(const r of Ly(v,e,t)){const i=r.value,o=Math.max(r.start,e),a=Math.min(r.end,t);for(let e=o;e<=a;e++)w.push({data:null==d?void 0:d[e],index:e,offset:n,size:i}),n+=i}}if(!o)return Lw([],w,n,s,C,l);const b=a.length>0?a[a.length-1]+1:0,E=Xy(g,e,t,b);if(0===E.length)return null;const M=n-1,A=Iv([],n=>{for(const r of E){const i=r.value;let o=i.offset,a=r.start;const l=i.size;if(i.offset<e){a+=Math.floor((e-i.offset+s)/(l+s));const t=a-r.start;o+=t*l+t*s}a<b&&(o+=(b-a)*l,a=b);const c=Math.min(r.end,M);for(let e=a;e<=c&&!(o>=t);e++)n.push({data:null==d?void 0:d[e],index:e,offset:o,size:l}),o+=l+s}}),x=Sw(c,yw),L=Sw(c,ww);if(A.length>0&&(x>0||L>0)){const e=A[0],t=A[A.length-1];if(x>0&&e.index>b){const t=Math.min(x,e.index-b),n=[];let r=e.offset;for(let i=e.index-1;i>=e.index-t;i--){const t=null!=(f=null==(u=Ly(v,i,i)[0])?void 0:u.value)?f:e.size;r-=t+s,n.unshift({data:null==d?void 0:d[i],index:i,offset:r,size:t})}A.unshift(...n)}if(L>0&&t.index<M){const e=Math.min(L,M-t.index);let n=t.offset+t.size+s;for(let r=t.index+1;r<=t.index+e;r++){const e=null!=(p=null==(h=Ly(v,r,r)[0])?void 0:h.value)?p:t.size;A.push({data:null==d?void 0:d[r],index:r,offset:n,size:e}),n+=e+s}}}return Lw(A,w,n,s,C,l)}),Qv(e=>null!==e),Wv()),xw);Pv(Yv(e,Qv(zv),Gv(e=>null==e?void 0:e.length)),i),Pv(Yv(y,Gv(e=>e.topListHeight)),u),Pv(u,l),Pv(Yv(y,Gv(e=>[e.top,e.bottom])),a),Pv(Yv(y,Gv(e=>e.items)),g);const w=iy(Yv(y,Qv(({items:e})=>e.length>0),ey(i,e),Qv(([{items:e},t])=>e[e.length-1].originalIndex===t-1),Gv(([,e,t])=>[e-1,t]),Wv(Ry),Gv(([e])=>e))),b=iy(Yv(y,$v(200),Qv(({items:e,topItems:t})=>e.length>0&&e[0].originalIndex===t.length),Gv(({items:e})=>e[0].index),Wv())),E=iy(Yv(y,Qv(({items:e})=>e.length>0),Gv(({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}}),Wv(jy)));return{endReached:w,initialItemCount:m,itemsRendered:g,listState:y,minOverscanItemCount:v,rangeChanged:E,startReached:b,topItemsIndexes:C,...f}},Dv(iw,aw,Aw,hw,dw,vw,lw,By),{singleton:!0}),Vw=oy(([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:n,headerHeight:r},{listState:i}])=>{const o=ry(),a=ny(Yv(ly(n,e,r,t,i),Gv(([e,t,n,r,i])=>e+t+n+r+i.offsetBottom+i.bottom)),0);return Pv(sy(a),o),{totalListHeight:a,totalListHeightChanged:o}},Dv(vy,_w),{singleton:!0}),Ow=oy(([{viewportHeight:e},{totalListHeight:t}])=>{const n=ty(!1);return{alignToBottom:n,paddingTopAddition:ny(Yv(ly(n,e,t),Qv(([e])=>e),Gv(([,e,t])=>Math.max(0,e-t)),$v(0),Wv()),0)}},Dv(vy,Vw),{singleton:!0}),zw=oy(()=>({context:ty(null)})),Nw=({itemBottom:e,itemTop:t,locationParams:{align:n,behavior:r,...i},viewportBottom:o,viewportTop:a})=>t<a?{...i,align:null!=n?n:"start",behavior:r}:e>o?{...i,align:null!=n?n:"end",behavior:r}:null,Iw=oy(([{gap:e,sizes:t,totalCount:n},{fixedFooterHeight:r,fixedHeaderHeight:i,headerHeight:o,scrollingInProgress:a,scrollTop:l,viewportHeight:s},{scrollToIndex:c}])=>{const d=ry();return Pv(Yv(d,ey(t,s,n,o,i,r,l),ey(e),Gv(([[e,t,n,r,i,o,l,s],c])=>{const{align:d,behavior:u,calculateViewLocation:f=Nw,done:h,...p}=e,C=Yy(e,t,r-1),m=Gy(C,t.offsetTree,c)+i+o,g=f({itemBottom:m+My(t.sizeTree,C)[1],itemTop:m,locationParams:{align:d,behavior:u,...p},viewportBottom:s+n-l,viewportTop:s+o});return g?h&&Fv(Yv(a,Qv(e=>!e),Jv(Bv(a)?1:2)),h):null==h||h(),g}),Qv(e=>null!==e)),c),{scrollIntoView:d}},Dv(iw,vy,dw,_w,fy),{singleton:!0});function Tw(e){return!!e&&("smooth"===e?"smooth":"auto")}const Dw=oy(([{listRefresh:e,totalCount:t,fixedItemSize:n,data:r},{atBottomState:i,isAtBottom:o},{scrollToIndex:a},{scrolledToInitialItem:l},{didMount:s,propsReady:c},{log:d},{scrollingInProgress:u},{context:f},{scrollIntoView:h}])=>{const p=ty(!1),C=ry();let m=null;function g(e){jv(a,{align:"end",behavior:e,index:"LAST"})}function v(e){const t=Fv(i,t=>{e&&!t.atBottom&&"SIZE_INCREASED"===t.notAtBottomBecause&&!m&&(Bv(d)("scrolling to bottom due to increased size",{},dy.DEBUG),g("auto"))});setTimeout(t,100)}Zv(Yv(ly(Yv(sy(t),Jv(1)),s),ey(sy(p),o,l,u),Gv(([[e,t],n,r,i,o])=>{let a=t&&i,l="auto";return a&&(l=((e,t)=>"function"==typeof e?Tw(e(t)):t&&Tw(e))(n,r||o),a=a&&!!l),{followOutputBehavior:l,shouldFollow:a,totalCount:e}}),Qv(({shouldFollow:e})=>e)),({followOutputBehavior:t,totalCount:r})=>{m&&(m(),m=null),Bv(n)?requestAnimationFrame(()=>{Bv(d)("following output to ",{totalCount:r},dy.DEBUG),g(t)}):m=Fv(e,()=>{Bv(d)("following output to ",{totalCount:r},dy.DEBUG),g(t),m=null})}),Zv(Yv(ly(sy(p),t,c),Qv(([e,,t])=>e&&t),Xv(({value:e},[,t])=>({refreshed:e===t,value:t}),{refreshed:!1,value:0}),Qv(({refreshed:e})=>e),ey(p,t)),([,e])=>{Bv(l)&&v(!1!==e)}),Zv(C,()=>{v(!1!==Bv(p))}),Zv(ly(sy(p),i),([e,t])=>{e&&!t.atBottom&&"VIEWPORT_HEIGHT_DECREASING"===t.notAtBottomBecause&&g("auto")});const y=ty(null),w=ry();return Pv(cy(Yv(sy(r),Gv(e=>{var t;return null!=(t=null==e?void 0:e.length)?t:0})),Yv(sy(t))),w),Zv(Yv(ly(Yv(w,Jv(1)),s),ey(sy(y),l,u,f),Gv(([[e,t],n,r,i,o])=>t&&r&&(null==n?void 0:n({context:o,totalCount:e,scrollingInProgress:i}))),Qv(e=>!!e),$v(0)),t=>{m&&(m(),m=null),Bv(n)?requestAnimationFrame(()=>{Bv(d)("scrolling into view",{}),jv(h,t)}):m=Fv(e,()=>{Bv(d)("scrolling into view",{}),jv(h,t),m=null})}),{autoscrollToBottom:C,followOutput:p,scrollIntoViewOnChange:y}},Dv(iw,vw,dw,hw,lw,fy,vy,zw,Iw)),Zw=oy(([{data:e,firstItemIndex:t,gap:n,sizes:r},{initialTopMostItemIndex:i},{initialItemCount:o,listState:a},{didMount:l}])=>(Pv(Yv(l,ey(o),Qv(([,e])=>0!==e),ey(i,r,t,n,e),Gv(([[,e],t,n,r,i,o=[]])=>kw(e,t,n,r,i,o))),a),{}),Dv(iw,hw,_w,lw),{singleton:!0}),jw=oy(([{didMount:e},{scrollTo:t},{listState:n}])=>{const r=ty(0);return Zv(Yv(e,ey(r),Qv(([,e])=>0!==e),Gv(([,e])=>({top:e}))),e=>{Fv(Yv(n,Jv(1),Qv(e=>e.items.length>1)),()=>{requestAnimationFrame(()=>{jv(t,e)})})}),{initialScrollTop:r}},Dv(lw,vy,_w),{singleton:!0}),Rw=oy(([{scrollVelocity:e}])=>{const t=ty(!1),n=ry(),r=ty(!1);return Pv(Yv(e,ey(r,t,n),Qv(([e,t])=>!!t),Gv(([e,t,n,r])=>{const{enter:i,exit:o}=t;if(n){if(o(e,r))return!1}else if(i(e,r))return!0;return n}),Wv()),t),Zv(Yv(ly(t,e,n),ey(r)),([[e,t,n],r])=>{e&&r&&r.change&&r.change(t,n)}),{isSeeking:t,scrollSeekConfiguration:r,scrollSeekRangeChanged:n,scrollVelocity:e}},Dv(vw),{singleton:!0}),Bw=oy(([{scrollContainerState:e,scrollTo:t}])=>{const n=ry(),r=ry(),i=ry(),o=ty(!1),a=ty(void 0);return Pv(Yv(ly(n,r),Gv(([{scrollHeight:e,scrollTop:t,viewportHeight:n},{offsetTop:r}])=>({scrollHeight:e,scrollTop:Math.max(0,t-r),viewportHeight:n}))),e),Pv(Yv(t,ey(r),Gv(([e,{offsetTop:t}])=>({...e,top:e.top+t}))),i),{customScrollParent:a,useWindowScroll:o,windowScrollContainerState:n,windowScrollTo:i,windowViewportRect:r}},Dv(vy)),Pw=oy(([{sizeRanges:e,sizes:t},{headerHeight:n,scrollTop:r},{initialTopMostItemIndex:i},{didMount:o},{useWindowScroll:a,windowScrollContainerState:l,windowViewportRect:s}])=>{const c=ry(),d=ty(void 0),u=ty(null),f=ty(null);return Pv(l,u),Pv(s,f),Zv(Yv(c,ey(t,r,a,u,f,n)),([e,t,n,r,i,o,a])=>{const l=function(e){return Hy(e).map(({k:e,v:t},n,r)=>{const i=r[n+1];return{endIndex:i?i.k-1:1/0,size:t,startIndex:e}})}(t.sizeTree);r&&null!==i&&null!==o&&(n=i.scrollTop-o.offsetTop),e({ranges:l,scrollTop:n-=a})}),Pv(Yv(d,Qv(zv),Gv(Fw)),i),Pv(Yv(o,ey(d),Qv(([,e])=>void 0!==e),Wv(),Gv(([,e])=>e.ranges)),e),{getState:c,restoreStateFrom:d}},Dv(iw,vy,hw,lw,Bw));function Fw(e){return{align:"start",index:0,offset:e.scrollTop}}const Uw=oy(([{topItemsIndexes:e}])=>{const t=ty(0);return Pv(Yv(t,Qv(e=>e>=0),Gv(e=>Array.from({length:e}).map((e,t)=>t))),e),{topItemCount:t}},Dv(_w));function qw(e){let t,n=!1;return()=>(n||(n=!0,t=e()),t)}const Ww=qw(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),Qw=oy(([{deviation:e,scrollBy:t,scrollingInProgress:n,scrollTop:r},{isAtBottom:i,isScrolling:o,lastJumpDueToItemResize:a,scrollDirection:l},{listState:s},{beforeUnshiftWith:c,gap:d,shiftWithOffset:u,sizes:f},{log:h},{recalcInProgress:p}])=>{const C=iy(Yv(s,ey(a),Xv(([,e,t,n],[{bottom:r,items:i,offsetBottom:o,totalCount:a},l])=>{const s=r+o;let c=0;return t===a&&e.length>0&&i.length>0&&(0===i[0].originalIndex&&0===e[0].originalIndex||(c=s-n,0!==c&&(c+=l))),[c,i,a,s]},[0,[],0,0]),Qv(([e])=>0!==e),ey(r,l,n,i,h,p),Qv(([,e,t,n,,,r])=>!r&&!n&&0!==e&&t===Cw),Gv(([[e],,,,,t])=>(t("Upward scrolling compensation",{amount:e},dy.DEBUG),e))));function m(n){n>0?(jv(t,{behavior:"auto",top:-n}),jv(e,0)):(jv(e,0),jv(t,{behavior:"auto",top:-n}))}return Zv(Yv(C,ey(e,o)),([t,n,r])=>{r&&Ww()?jv(e,n-t):m(-t)}),Zv(Yv(ly(ny(o,!1),e,p),Qv(([e,t,n])=>!e&&!n&&0!==t),Gv(([e,t])=>t),$v(1)),m),Pv(Yv(u,Gv(e=>({top:-e}))),t),Zv(Yv(c,ey(f,d),Gv(([e,{groupIndices:t,lastSize:n,sizeTree:r},i])=>{function o(e){return e*(n+i)}if(0===t.length)return o(e);{let n=0;const i=Ey(r,0);let a=0,l=0;for(;a<e;){a++,n+=i;let r=t.length===l+1?1/0:t[l+1]-t[l]-1;a+r>e&&(n-=i,r=e-a+1),a+=r,n+=o(r),l++}return n}})),n=>{jv(e,n),requestAnimationFrame(()=>{jv(t,{top:n}),requestAnimationFrame(()=>{jv(e,0),jv(p,!1)})})}),{deviation:e}},Dv(vy,vw,_w,iw,fy,By)),Gw=oy(([e,t,n,r,i,o,a,l,s,c,d])=>({...e,...t,...n,...r,...i,...o,...a,...l,...s,...c,...d}),Dv(Aw,Zw,lw,Rw,Vw,jw,Ow,Bw,Iw,fy,zw)),Kw=oy(([{data:e,defaultItemSize:t,firstItemIndex:n,fixedItemSize:r,fixedGroupSize:i,gap:o,groupIndices:a,heightEstimates:l,itemSize:s,sizeRanges:c,sizes:d,statefulTotalCount:u,totalCount:f,trackItemSizes:h},{initialItemFinalLocationReached:p,initialTopMostItemIndex:C,scrolledToInitialItem:m},g,v,y,w,{scrollToIndex:b},E,{topItemCount:M},{groupCounts:A},x])=>{const{listState:L,minOverscanItemCount:k,topItemsIndexes:H,rangeChanged:S,..._}=w;return Pv(S,x.scrollSeekRangeChanged),Pv(Yv(x.windowViewportRect,Gv(e=>e.visibleHeight)),g.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:n,fixedItemHeight:r,fixedGroupHeight:i,gap:o,groupCounts:A,heightEstimates:l,initialItemFinalLocationReached:p,initialTopMostItemIndex:C,scrolledToInitialItem:m,sizeRanges:c,topItemCount:M,topItemsIndexes:H,totalCount:f,...y,groupIndices:a,itemSize:s,listState:L,minOverscanItemCount:k,scrollToIndex:b,statefulTotalCount:u,trackItemSizes:h,rangeChanged:S,..._,...x,...g,sizes:d,...v}},Dv(iw,hw,vy,Pw,Dw,_w,dw,Qw,Uw,aw,Gw));function Yw(e,t){const n={},r={};let i=0;const o=e.length;for(;i<o;)r[e[i]]=1,i+=1;for(const e in t)Object.hasOwn(r,e)||(n[e]=t[e]);return n}const Xw=typeof document<"u"?i.useLayoutEffect:i.useEffect;function Jw(t,n,r){const o=Object.keys(n.required||{}),a=Object.keys(n.optional||{}),l=Object.keys(n.methods||{}),s=Object.keys(n.events||{}),c=i.createContext({});function d(e,t){e.propsReady&&jv(e.propsReady,!1);for(const r of o){jv(e[n.required[r]],t[r])}for(const r of a)if(r in t){jv(e[n.optional[r]],t[r])}e.propsReady&&jv(e.propsReady,!0)}function u(e){return s.reduce((t,r)=>(t[r]=function(e){let t,n;const r=()=>null==t?void 0:t();return function(i,o){switch(i){case 1:return o?n===o?void 0:(r(),n=o,t=Zv(e,o),t):(r(),Nv);case 2:return r(),void(n=null)}}}(e[n.events[r]]),t),{})}const f=i.forwardRef((f,h)=>{const{children:p,...C}=f,[m]=i.useState(()=>Iv(function(e){const t=new Map,n=({constructor:e,dependencies:r,id:i,singleton:o})=>{if(o&&t.has(i))return t.get(i);const a=e(r.map(e=>n(e)));return o&&t.set(i,a),a};return n(e)}(t),e=>{d(e,C)})),[g]=i.useState(Ov(u,m));Xw(()=>{for(const e of s)e in C&&Zv(g[e],C[e]);return()=>{Object.values(g).map(Rv)}},[C,g,m]),Xw(()=>{d(m,C)}),i.useImperativeHandle(h,Sv(function(e){return l.reduce((t,r)=>(t[r]=t=>{jv(e[n.methods[r]],t)},t),{})}(m)));const v=r;return e(c.Provider,{value:m,children:r?e(v,{...Yw([...o,...a,...s],C),children:p}):p})}),h=i.version.startsWith("18")?e=>{const t=i.useContext(c)[e],n=i.useCallback(e=>Zv(t,e),[t]);return i.useSyncExternalStore(n,()=>Bv(t),()=>Bv(t))}:e=>{const t=i.useContext(c)[e],[n,r]=i.useState(Ov(Bv,t));return Xw(()=>Zv(t,e=>{e!==n&&r(Sv(e))}),[t,n]),n};return{Component:f,useEmitter:(e,t)=>{const n=i.useContext(c)[e];Xw(()=>Zv(n,t),[t,n])},useEmitterValue:h,usePublisher:e=>{const t=i.useContext(c);return i.useCallback(n=>{jv(t[e],n)},[t,e])}}}const $w=i.createContext(void 0),eb=i.createContext(void 0),tb=typeof document<"u"?i.useLayoutEffect:i.useEffect;function nb(e){return"self"in e}function rb(e,t,n,r=Nv,o,a){const l=i.useRef(null),s=i.useRef(null),c=i.useRef(null),d=i.useCallback(n=>{let r,i,o;const l=n.target;if(function(e){return"body"in e}(l)||nb(l)){const e=nb(l)?l:l.defaultView;o=a?e.scrollX:e.scrollY,r=a?e.document.documentElement.scrollWidth:e.document.documentElement.scrollHeight,i=a?e.innerWidth:e.innerHeight}else o=a?l.scrollLeft:l.scrollTop,r=a?l.scrollWidth:l.scrollHeight,i=a?l.offsetWidth:l.offsetHeight;const d=()=>{e({scrollHeight:r,scrollTop:Math.max(o,0),viewportHeight:i})};n.suppressFlushSync?d():M.flushSync(d),null!==s.current&&(o===s.current||o<=0||o===r-i)&&(s.current=null,t(!0),c.current&&(clearTimeout(c.current),c.current=null))},[e,t,a]);return i.useEffect(()=>{const e=o||l.current;return r(o||l.current),d({suppressFlushSync:!0,target:e}),e.addEventListener("scroll",d,{passive:!0}),()=>{r(null),e.removeEventListener("scroll",d)}},[l,d,n,r,o]),{scrollByCallback:function(e){a&&(e={behavior:e.behavior,left:e.top}),l.current.scrollBy(e)},scrollerRef:l,scrollToCallback:function(n){const r=l.current;if(!r||(a?"offsetWidth"in r&&0===r.offsetWidth:"offsetHeight"in r&&0===r.offsetHeight))return;const i="smooth"===n.behavior;let o,d,u;nb(r)?(d=Math.max(Uy(r.document.documentElement,a?"width":"height"),a?r.document.documentElement.scrollWidth:r.document.documentElement.scrollHeight),o=a?r.innerWidth:r.innerHeight,u=a?window.scrollX:window.scrollY):(d=r[a?"scrollWidth":"scrollHeight"],o=Uy(r,a?"width":"height"),u=r[a?"scrollLeft":"scrollTop"]);const f=d-o;if(n.top=Math.ceil(Math.max(Math.min(f,n.top),0)),pw(o,d)||n.top===u)return e({scrollHeight:d,scrollTop:u,viewportHeight:o}),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,a&&(n={behavior:n.behavior,left:n.top}),r.scrollTo(n)}}}const ib="-webkit-sticky",ob="sticky",ab=qw(()=>{if(typeof document>"u")return ob;const e=document.createElement("div");return e.style.position=ib,e.style.position===ib?ib:ob});function lb(e){return e}const sb=oy(()=>{const e=ty(e=>`Item ${e}`),t=ty(e=>`Group ${e}`),n=ty({}),r=ty(lb),i=ty("div"),o=ty(Nv),a=(e,t=null)=>ny(Yv(n,Gv(t=>t[e]),Wv()),t);return{components:n,computeItemKey:r,EmptyPlaceholder:a("EmptyPlaceholder"),FooterComponent:a("Footer"),GroupComponent:a("Group","div"),groupContent:t,HeaderComponent:a("Header"),HeaderFooterTag:i,ItemComponent:a("Item","div"),itemContent:e,ListComponent:a("List","div"),ScrollerComponent:a("Scroller","div"),scrollerRef:o,ScrollSeekPlaceholder:a("ScrollSeekPlaceholder"),TopItemListComponent:a("TopItemList")}}),cb=oy(([e,t])=>({...e,...t}),Dv(Kw,sb)),db=({height:t})=>e("div",{style:{height:t}}),ub={overflowAnchor:"none",position:ab(),zIndex:1},fb={overflowAnchor:"none"},hb={...fb,display:"inline-block",height:"100%"},pb=i.memo(function({showTopList:t=!1}){const n=Vb("listState"),r=Ob("sizeRanges"),o=Vb("useWindowScroll"),a=Vb("customScrollParent"),l=Ob("windowScrollContainerState"),s=Ob("scrollContainerState"),c=a||o?l:s,d=Vb("itemContent"),u=Vb("context"),f=Vb("groupContent"),h=Vb("trackItemSizes"),p=Vb("itemSize"),m=Vb("log"),g=Ob("gap"),v=Vb("horizontalDirection"),{callbackRef:y}=Cy(r,p,h,t?Nv:c,m,g,a,v,Vb("skipAnimationFrameInResizeObserver")),[w,b]=i.useState(0);_b("deviation",e=>{w!==e&&b(e)});const E=Vb("EmptyPlaceholder"),M=Vb("ScrollSeekPlaceholder")||db,A=Vb("ListComponent"),x=Vb("ItemComponent"),L=Vb("GroupComponent"),k=Vb("computeItemKey"),H=Vb("isSeeking"),S=Vb("groupIndices").length>0,_=Vb("alignToBottom"),V=Vb("initialItemFinalLocationReached"),O=t?{}:{boxSizing:"border-box",...v?{display:"inline-block",height:"100%",marginLeft:0!==w?w:_?"auto":0,paddingLeft:n.offsetTop,paddingRight:n.offsetBottom,whiteSpace:"nowrap"}:{marginTop:0!==w?w:_?"auto":0,paddingBottom:n.offsetBottom,paddingTop:n.offsetTop},...V?{}:{visibility:"hidden"}};return!t&&0===n.totalCount&&E?e(E,{...yb(E,u)}):e(A,{...yb(A,u),"data-testid":t?"virtuoso-top-item-list":"virtuoso-item-list",ref:y,style:O,children:(t?n.topItems:n.items).map(e=>{const t=e.originalIndex,r=k(t+n.firstItemIndex,e.data,u);return H?C(M,{...yb(M,u),height:e.size,index:e.index,key:r,type:e.type||"item",..."group"===e.type?{}:{groupIndex:e.groupIndex}}):"group"===e.type?C(L,{...yb(L,u),"data-index":t,"data-item-index":e.index,"data-known-size":e.size,key:r,style:ub},f(e.index,u)):C(x,{...yb(x,u),...wb(x,e.data),"data-index":t,"data-item-group-index":e.groupIndex,"data-item-index":e.index,"data-known-size":e.size,key:r,style:v?hb:fb},S?d(e.index,e.groupIndex,e.data,u):d(e.index,e.data,u))})})}),Cb={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},mb={outline:"none",overflowX:"auto",position:"relative"},gb=e=>({height:"100%",position:"absolute",top:0,width:"100%",...e?{display:"flex",flexDirection:"column"}:{}}),vb={position:ab(),top:0,width:"100%",zIndex:1};function yb(e,t){if("string"!=typeof e)return{context:t}}function wb(e,t){return{item:"string"==typeof e?void 0:t}}const bb=i.memo(function(){const t=Vb("HeaderComponent"),n=Ob("headerHeight"),r=Vb("HeaderFooterTag"),o=hy(i.useMemo(()=>e=>{n(Uy(e,"height"))},[n]),!0,Vb("skipAnimationFrameInResizeObserver")),a=Vb("context");return t?e(r,{ref:o,children:e(t,{...yb(t,a)})}):null}),Eb=i.memo(function(){const t=Vb("FooterComponent"),n=Ob("footerHeight"),r=Vb("HeaderFooterTag"),o=hy(i.useMemo(()=>e=>{n(Uy(e,"height"))},[n]),!0,Vb("skipAnimationFrameInResizeObserver")),a=Vb("context");return t?e(r,{ref:o,children:e(t,{...yb(t,a)})}):null});function Mb({useEmitter:t,useEmitterValue:n,usePublisher:r}){return i.memo(function({children:i,style:o,context:a,...l}){const s=r("scrollContainerState"),c=n("ScrollerComponent"),d=r("smoothScrollTargetReached"),u=n("scrollerRef"),f=n("horizontalDirection")||!1,{scrollByCallback:h,scrollerRef:p,scrollToCallback:C}=rb(s,d,c,u,void 0,f);return t("scrollTo",C),t("scrollBy",h),e(c,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:p,style:{...f?mb:Cb,...o},tabIndex:0,...l,...yb(c,a),children:i})})}function Ab({useEmitter:t,useEmitterValue:n,usePublisher:r}){return i.memo(function({children:o,style:a,context:l,...s}){const c=r("windowScrollContainerState"),d=n("ScrollerComponent"),u=r("smoothScrollTargetReached"),f=n("totalListHeight"),h=n("deviation"),p=n("customScrollParent"),C=i.useRef(null),m=n("scrollerRef"),{scrollByCallback:g,scrollerRef:v,scrollToCallback:y}=rb(c,u,d,m,p);return tb(()=>{var e;return v.current=p||(null==(e=C.current)?void 0:e.ownerDocument.defaultView),()=>{v.current=null}},[v,p]),t("windowScrollTo",y),t("scrollBy",g),e(d,{ref:C,"data-virtuoso-scroller":!0,style:{position:"relative",...a,...0!==f?{height:f+h}:{}},...s,...yb(d,l),children:o})})}const xb=({children:t})=>{const n=i.useContext($w),r=Ob("viewportHeight"),o=Ob("fixedItemHeight"),a=Vb("alignToBottom"),l=Vb("horizontalDirection"),s=hy(i.useMemo(()=>Vv(r,e=>Uy(e,l?"width":"height")),[r,l]),!0,Vb("skipAnimationFrameInResizeObserver"));return i.useEffect(()=>{n&&(r(n.viewportHeight),o(n.itemHeight))},[n,r,o]),e("div",{"data-viewport-type":"element",ref:s,style:gb(a),children:t})},Lb=({children:t})=>{const n=i.useContext($w),r=Ob("windowViewportRect"),o=Ob("fixedItemHeight"),a=Vb("customScrollParent"),l=gy(r,a,Vb("skipAnimationFrameInResizeObserver")),s=Vb("alignToBottom");return i.useEffect(()=>{n&&(o(n.itemHeight),r({offsetTop:0,visibleHeight:n.viewportHeight,visibleWidth:100}))},[n,r,o]),e("div",{"data-viewport-type":"window",ref:l,style:gb(s),children:t})},kb=({children:t})=>{const n=Vb("TopItemListComponent")||"div",r=Vb("headerHeight"),i={...vb,marginTop:`${r}px`},o=Vb("context");return e(n,{style:i,...yb(n,o),children:t})},Hb=i.memo(function(t){const r=Vb("useWindowScroll"),i=Vb("topItemsIndexes").length>0,o=Vb("customScrollParent"),a=Vb("context");return n(o||r?Nb:zb,{...t,context:a,children:[i&&e(kb,{children:e(pb,{showTopList:!0})}),n(o||r?Lb:xb,{children:[e(bb,{}),e(pb,{}),e(Eb,{})]})]})}),{Component:Sb,useEmitter:_b,useEmitterValue:Vb,usePublisher:Ob}=Jw(cb,{required:{},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"}},Hb),zb=Mb({useEmitter:_b,useEmitterValue:Vb,usePublisher:Ob}),Nb=Ab({useEmitter:_b,useEmitterValue:Vb,usePublisher:Ob}),Ib=Sb,Tb=oy(()=>{const e=ty(e=>n("td",{children:["Item $",e]})),t=ty(null),r=ty(e=>n("td",{colSpan:1e3,children:["Group ",e]})),i=ty(null),o=ty(null),a=ty({}),l=ty(lb),s=ty(Nv),c=(e,t=null)=>ny(Yv(a,Gv(t=>t[e]),Wv()),t);return{components:a,computeItemKey:l,context:t,EmptyPlaceholder:c("EmptyPlaceholder"),FillerRow:c("FillerRow"),fixedFooterContent:o,fixedHeaderContent:i,itemContent:e,groupContent:r,ScrollerComponent:c("Scroller","div"),scrollerRef:s,ScrollSeekPlaceholder:c("ScrollSeekPlaceholder"),TableBodyComponent:c("TableBody","tbody"),TableComponent:c("Table","table"),TableFooterComponent:c("TableFoot","tfoot"),TableHeadComponent:c("TableHead","thead"),TableRowComponent:c("TableRow","tr"),GroupComponent:c("Group","tr")}});Dv(Kw,Tb),ab();const Db={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},Zb={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:jb,floor:Rb,max:Bb,min:Pb,round:Fb}=Math;function Ub(e,t,n){return Array.from({length:t-e+1}).map((t,r)=>({data:null===n?null:n[r+e],index:r+e}))}function qb(e,t){return e&&e.width===t.width&&e.height===t.height}function Wb(e,t){return e&&e.column===t.column&&e.row===t.row}const Qb=oy(([{increaseViewportBy:e,listBoundary:t,overscan:n,visibleRange:r},{footerHeight:i,headerHeight:o,scrollBy:a,scrollContainerState:l,scrollTo:s,scrollTop:c,smoothScrollTargetReached:d,viewportHeight:u},f,h,{didMount:p,propsReady:C},{customScrollParent:m,useWindowScroll:g,windowScrollContainerState:v,windowScrollTo:y,windowViewportRect:w},b])=>{const E=ty(0),M=ty(0),A=ty(Db),x=ty({height:0,width:0}),L=ty({height:0,width:0}),k=ry(),H=ry(),S=ty(0),_=ty(null),V=ty({column:0,row:0}),O=ry(),z=ry(),N=ty(!1),I=ty(0),T=ty(!0),D=ty(!1),Z=ty(!1);Zv(Yv(p,ey(I),Qv(([e,t])=>!!t)),()=>{jv(T,!1)}),Zv(Yv(ly(p,T,L,x,I,D),Qv(([e,t,n,r,,i])=>e&&!t&&0!==n.height&&0!==r.height&&!i)),([,,,,e])=>{jv(D,!0),uw(1,()=>{jv(k,e)}),Fv(Yv(c),()=>{jv(t,[0,0]),jv(T,!0)})}),Pv(Yv(z,Qv(e=>null!=e&&e.scrollTop>0),Kv(0)),M),Zv(Yv(p,ey(z),Qv(([,e])=>null!=e)),([,e])=>{e&&(jv(x,e.viewport),jv(L,e.item),jv(V,e.gap),e.scrollTop>0&&(jv(N,!0),Fv(Yv(c,Jv(1)),e=>{jv(N,!1)}),jv(s,{top:e.scrollTop})))}),Pv(Yv(x,Gv(({height:e})=>e)),u),Pv(Yv(ly(sy(x,qb),sy(L,qb),sy(V,(e,t)=>e&&e.column===t.column&&e.row===t.row),sy(c)),Gv(([e,t,n,r])=>({gap:n,item:t,scrollTop:r,viewport:e}))),O),Pv(Yv(ly(sy(E),r,sy(V,Wb),sy(L,qb),sy(x,qb),sy(_),sy(M),sy(N),sy(T),sy(I)),Qv(([,,,,,,,e])=>!e),Gv(([e,[t,n],r,i,o,a,l,,s,c])=>{const{column:d,row:u}=r,{height:f,width:h}=i,{width:p}=o;if(0===l&&(0===e||0===p))return Db;if(0===h){const t=fw(c,e);return function(e){return{...Zb,items:e}}(Ub(t,t+Math.max(l-1,0),a))}const C=Gb(p,h,d);let m,g;s?0===t&&0===n&&l>0?(m=0,g=l-1):(m=C*Rb((t+u)/(f+u)),g=C*jb((n+u)/(f+u))-1,g=Pb(e-1,Bb(g,C-1)),m=Pb(g,Bb(0,m))):(m=0,g=-1);const v=Ub(m,g,a),{bottom:y,top:w}=Kb(o,r,i,v),b=jb(e/C);return{bottom:y,itemHeight:f,items:v,itemWidth:h,offsetBottom:b*f+(b-1)*u-y,offsetTop:w,top:w}})),A),Pv(Yv(_,Qv(e=>null!==e),Gv(e=>e.length)),E),Pv(Yv(ly(x,L,A,V),Qv(([e,t,{items:n}])=>n.length>0&&0!==t.height&&0!==e.height),Gv(([e,t,{items:n},r])=>{const{bottom:i,top:o}=Kb(e,r,t,n);return[o,i]}),Wv(Ry)),t);const j=ty(!1);Pv(Yv(c,ey(j),Gv(([e,t])=>t||0!==e)),j);const R=iy(Yv(ly(A,E),Qv(([{items:e}])=>e.length>0),ey(j),Qv(([[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}),Gv(([[,e]])=>e-1),Wv())),B=iy(Yv(sy(A),Qv(({items:e})=>e.length>0&&0===e[0].index),Kv(0),Wv())),P=iy(Yv(sy(A),ey(N),Qv(([{items:e},t])=>e.length>0&&!t),Gv(([{items:e}])=>({endIndex:e[e.length-1].index,startIndex:e[0].index})),Wv(jy),$v(0)));Pv(P,h.scrollSeekRangeChanged),Pv(Yv(k,ey(x,L,E,V),Gv(([e,t,n,r,i])=>{const o=cw(e),{align:a,behavior:l,offset:s}=o;let c=o.index;"LAST"===c&&(c=r-1),c=Bb(0,c,Pb(r-1,c));let d=Yb(t,i,n,c);return"end"===a?d=Fb(d-t.height+n.height):"center"===a&&(d=Fb(d-t.height/2+n.height/2)),s&&(d+=s),{behavior:l,top:d}})),s);const F=ny(Yv(A,Gv(e=>e.offsetBottom+e.bottom)),0);return Pv(Yv(w,Gv(e=>({height:e.visibleHeight,width:e.visibleWidth}))),x),{customScrollParent:m,data:_,deviation:S,footerHeight:i,gap:V,headerHeight:o,increaseViewportBy:e,initialItemCount:M,itemDimensions:L,overscan:n,restoreStateFrom:z,scrollBy:a,scrollContainerState:l,scrollHeight:H,scrollTo:s,scrollToIndex:k,scrollTop:c,smoothScrollTargetReached:d,totalCount:E,useWindowScroll:g,viewportDimensions:x,windowScrollContainerState:v,windowScrollTo:y,windowViewportRect:w,...h,gridState:A,horizontalDirection:Z,initialTopMostItemIndex:I,totalListHeight:F,...f,endReached:R,propsReady:C,rangeChanged:P,startReached:B,stateChanged:O,stateRestoreInProgress:N,...b}},Dv(Aw,vy,vw,Rw,lw,Bw,fy));function Gb(e,t,n){return Bb(1,Rb((e+n)/(Rb(t)+n)))}function Kb(e,t,n,r){const{height:i}=n;if(void 0===i||0===r.length)return{bottom:0,top:0};const o=Yb(e,t,n,r[0].index);return{bottom:Yb(e,t,n,r[r.length-1].index)+i,top:o}}function Yb(e,t,n,r){const i=Gb(e.width,n.width,t.column),o=Rb(r/i),a=o*n.height+Bb(0,o-1)*t.row;return a>0?a+t.row:a}const Xb=oy(()=>{const e=ty(e=>`Item ${e}`),t=ty({}),n=ty(null),r=ty("virtuoso-grid-item"),i=ty("virtuoso-grid-list"),o=ty(lb),a=ty("div"),l=ty(Nv),s=(e,n=null)=>ny(Yv(t,Gv(t=>t[e]),Wv()),n),c=ty(!1),d=ty(!1);return Pv(sy(d),c),{components:t,computeItemKey:o,context:n,FooterComponent:s("Footer"),HeaderComponent:s("Header"),headerFooterTag:a,itemClassName:r,ItemComponent:s("Item","div"),itemContent:e,listClassName:i,ListComponent:s("List","div"),readyStateChanged:c,reportReadyState:d,ScrollerComponent:s("Scroller","div"),scrollerRef:l,ScrollSeekPlaceholder:s("ScrollSeekPlaceholder","div")}}),Jb=oy(([e,t])=>({...e,...t}),Dv(Qb,Xb)),$b=i.memo(function(){const t=aE("gridState"),n=aE("listClassName"),r=aE("itemClassName"),o=aE("itemContent"),a=aE("computeItemKey"),l=aE("isSeeking"),s=lE("scrollHeight"),c=aE("ItemComponent"),d=aE("ListComponent"),u=aE("ScrollSeekPlaceholder"),f=aE("context"),h=lE("itemDimensions"),p=lE("gap"),m=aE("log"),g=aE("stateRestoreInProgress"),v=lE("reportReadyState"),y=hy(i.useMemo(()=>e=>{const t=e.parentElement.parentElement.scrollHeight;s(t);const n=e.firstChild;if(n){const{height:e,width:t}=n.getBoundingClientRect();h({height:e,width:t})}p({column:dE("column-gap",getComputedStyle(e).columnGap,m),row:dE("row-gap",getComputedStyle(e).rowGap,m)})},[s,h,p,m]),!0,!1);return tb(()=>{t.itemHeight>0&&t.itemWidth>0&&v(!0)},[t]),g?null:e(d,{className:n,ref:y,...yb(d,f),"data-testid":"virtuoso-item-list",style:{paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},children:t.items.map(n=>{const i=a(n.index,n.data,f);return l?e(u,{...yb(u,f),height:t.itemHeight,index:n.index,width:t.itemWidth},i):C(c,{...yb(c,f),className:r,"data-index":n.index,key:i},o(n.index,n.data,f))})})}),eE=i.memo(function(){const t=aE("HeaderComponent"),n=lE("headerHeight"),r=aE("headerFooterTag"),o=hy(i.useMemo(()=>e=>{n(Uy(e,"height"))},[n]),!0,!1),a=aE("context");return t?e(r,{ref:o,children:e(t,{...yb(t,a)})}):null}),tE=i.memo(function(){const t=aE("FooterComponent"),n=lE("footerHeight"),r=aE("headerFooterTag"),o=hy(i.useMemo(()=>e=>{n(Uy(e,"height"))},[n]),!0,!1),a=aE("context");return t?e(r,{ref:o,children:e(t,{...yb(t,a)})}):null}),nE=({children:t})=>{const n=i.useContext(eb),r=lE("itemDimensions"),o=lE("viewportDimensions"),a=hy(i.useMemo(()=>e=>{o(e.getBoundingClientRect())},[o]),!0,!1);return i.useEffect(()=>{n&&(o({height:n.viewportHeight,width:n.viewportWidth}),r({height:n.itemHeight,width:n.itemWidth}))},[n,o,r]),e("div",{ref:a,style:gb(!1),children:t})},rE=({children:t})=>{const n=i.useContext(eb),r=lE("windowViewportRect"),o=lE("itemDimensions"),a=aE("customScrollParent"),l=gy(r,a,!1);return i.useEffect(()=>{n&&(o({height:n.itemHeight,width:n.itemWidth}),r({offsetTop:0,visibleHeight:n.viewportHeight,visibleWidth:n.viewportWidth}))},[n,r,o]),e("div",{ref:l,style:gb(!1),children:t})},iE=i.memo(function({...t}){const r=aE("useWindowScroll"),i=aE("customScrollParent"),o=i||r?cE:sE,a=i||r?rE:nE,l=aE("context");return e(o,{...t,...yb(o,l),children:n(a,{children:[e(eE,{}),e($b,{}),e(tE,{})]})})}),{useEmitter:oE,useEmitterValue:aE,usePublisher:lE}=Jw(Jb,{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"}},iE),sE=Mb({useEmitter:oE,useEmitterValue:aE,usePublisher:lE}),cE=Ab({useEmitter:oE,useEmitterValue:aE,usePublisher:lE});function dE(e,t,n){return"normal"!==t&&!(null!=t&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,dy.WARN),"normal"===t?0:parseInt(null!=t?t:"0",10)}const uE=({optionsList:r=[],onSelectVariable:i,dropdownPosition:o,position:a="relative",width:l,height:s="160px",zIndex:c=9999})=>{const d={LOCAL:"local_variable_icon",GLOBAL:"global_variable_icon",PROJECT_ENVIRONMENT:"project_env_variable_icon"},u=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":d[e.type||""]||"":"step_group_variable"},f=e=>"_startforloop"===e?.type?`FLV_for:${e?.name}`:"DATAPROVIDER"===e?.type?`${e?.dpName}:${e?.varname}`:e?.name;function h(e){if(e.endsWith("px")){const t=parseInt(e.slice(0,-2),10);return isNaN(t)?212:t-66}return 212}return e("div",{className:z("ff-variable-dropdown",a),style:o?{top:o.top+30,left:o.left-30,width:l,height:s,zIndex:c}:{width:l,height:s,zIndex:c},children:G(r)?e("div",{className:"ff-variable-option ff-variable-option-no-data",children:e(F,{as:"span",fontSize:12,children:"No Option"})}):e(Ib,{totalCount:r.length,itemContent:o=>{const a=r[o];return a?e("div",{className:"ff-variable-data",onMouseDown:()=>i(a),children:l.endsWith("px")?n(t,{children:[e(K,{title:oe(f(a),h(l),"pixel")?f(a):"",style:{width:`${h(l)}px`},children:e(F,{as:"span",fontSize:12,className:"ff-truncated_text",children:f(a)})}),e(P,{name:u(a),height:24,width:24,hoverEffect:!0})]}):e(Hv,{option:a})},`${a.id}-${o}`):null},style:{height:s,fontSize:"12px"},overscan:10,fixedItemHeight:32})})},fE=({data:r=[],width:i,height:o,lineChartWidth:a,yAxisLabel:s,xAxisLabel:d,yAxisValueColor:u,xAxisColor:f,yAxisColor:h,yAxisLabelColor:p,textSize:C,fontWeight:m,numberSize:g,chartName:v,shouldCenterSinglePoint:y,xAxisLabelGap:w=16,isLeftOverflow:b=!1})=>{const E=40,M=i-80,A=o-80,[x,L]=c(!1),[k,H]=c({cursorX:null,hoverValues:{},dotPositions:{},tooltip:{visible:!1,left:0,top:0},currentXValue:null});l(()=>{const e=()=>{L(!1),H(e=>({...e,tooltip:{...e.tooltip,visible:!1}}))};return window.addEventListener("scroll",e,!0),()=>window.removeEventListener("scroll",e,!0)},[]);if(!(r&&r.length>0&&r?.some(e=>Array.isArray(e?.data)&&e?.data?.length>0))){const t=[];for(let e=6;e>=0;e--){const n=new Date;n.setDate(n.getDate()-e);const r=n?.toLocaleDateString("en-US",{day:"numeric",month:"short"});t.push(r)}const r=1024,a=6,l=7;return n("div",{className:"ff-line-chart-text",style:{width:i+20+w,gap:w},children:[e("div",{className:"ff-line-chart-yAxisLabel-warpper",style:{height:o},children:e(F,{className:"ff-line-chart-yAxisLabel",fontSize:C,fontWeight:"semi-bold",children:s})}),e("div",{className:"ff-line-chart-svg",children:e("svg",{height:o,width:i,className:"ff-line-chart-svg",children:n("g",{transform:"translate(40, 40)",children:[e("line",{x1:0,y1:A,x2:M,y2:A,stroke:f,strokeWidth:1}),e("text",{x:M/2.1,y:A+E/1.2,textAnchor:"middle",fill:p,className:"ff-line-chart-x-axis-label",style:{fontSize:C,fontWeight:m},children:d}),t.map((t,n)=>e("text",{x:n*(M/(l-1)),y:A+15,textAnchor:0===n?"start":n===l-1?"end":"middle",fill:h,className:"ff--line-chart-x-line-data",style:{fontSize:g},children:t},t)),Array.from({length:a}).map((t,n)=>{const i=n*r/(a-1),o=i/1024;return e("text",{x:-10,y:A-i*A/r,textAnchor:"end",fill:u,className:"ff-line-chart-y-axis-text",style:{fontSize:g},children:o?.toFixed(1)},`y-${n}`)})]})})})]})}function S(e){if(!isNaN(e))return parseFloat(e);const t=at,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 _=r?.[0]?.data?.[0]?.hasOwnProperty("date")&&r?.[0]?.data?.[0]?.hasOwnProperty("totalMemory"),V="date",O=_?"totalMemory":"value",z=e=>{const t=r?.[0]?.data?.length;if(1===t)return y?M/2:M;const n=r[0].data.findIndex(t=>t[V]===e);return-1===n?0:n/(t-1)*M},N=Math.max(...r?.flatMap(e=>e?.data?.map(e=>S(e[O]))),5),I=e=>{if("memory"===v){const t=Math.max(...r?.flatMap(e=>e?.data?.map(e=>S(e[O]))));return A-e*A/(t>1024?t:1024)}return A-e*A/(0===N?1024:N)},T=e=>{if(1===e?.length){const t=e?.[0],n=z(t[V]),r=I(S(t[O]));return`M 0 ${I(0)} L ${n} ${r}`}return e?.reduce((t,n,r)=>{const i=z(n[V]),o=I(S(n[O]));if(0===r)return`M ${i} ${o}`;const a=e[r-1],l=a?z(a[V]):0;return`${t} C ${l+(i-l)/2} ${a?I(S(a[O])):0}, ${i-(i-l)/2} ${o}, ${i} ${o}`},"")},D=r[0].data;return n("div",{className:"ff-line-chart-text",style:{width:i+20+w,gap:w},children:[e("div",{className:"ff-line-chart-yAxisLabel-warpper",style:{height:o},children:e(F,{className:"ff-line-chart-yAxisLabel",fontSize:C,fontWeight:"semi-bold",children:s})}),n("div",{className:"ff-line-chart-svg",children:[e("svg",{height:o,width:i,onMouseMove:e=>{const t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left-E;if(e.clientY-t.top-E>A)return L(!1),void H({cursorX:null,hoverValues:{},dotPositions:{},tooltip:{visible:!1,left:0,top:0},currentXValue:null});let i={hoverValues:{},dotPositions:{}},o=null;r.forEach((e,t)=>{const r=e.data.reduce((e,t)=>{const r=Math.abs(n-z(t[V]));return r<e.distance?{point:t,distance:r}:e},{point:null,distance:1/0}).point;r&&(o=r[V],i.hoverValues[t]=((e,t=2)=>{let n="";if("string"==typeof e){const t=e.match(rt),r=e.match(it);t&&(e=parseFloat(t[0])),r&&(n=r[0])}const r=Math.pow(10,t);return`${Math.ceil(e*r)/r} ${n}`.trim()})(r[O]),i.dotPositions[t]={x:z(r[V]),y:I(S(r[O]))})}),L(!0),H({cursorX:n,hoverValues:i.hoverValues,dotPositions:i.dotPositions,currentXValue:o,tooltip:o?{visible:!0,left:e.clientX+10,top:e.clientY-20}:{visible:!1,left:0,top:0}})},onMouseLeave:()=>H({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:A,strokeWidth:2}),e("line",{x1:0,y1:A,x2:M,y2:A,stroke:f,strokeWidth:1}),e("text",{x:M/2.1,y:A+E/1.2,textAnchor:"middle",fill:p,className:"ff-line-chart-x-axis-label",style:{fontSize:C,fontWeight:m},children:d}),r.map((r,i)=>{return!1!==r.show?n("g",{children:[e("path",{d:T(r.data),fill:"none",stroke:r.color,strokeWidth:a,opacity:(o=r.data,o.every(e=>0===S(e[O]))?.5:1)}),k.dotPositions[i]&&n(t,{children:[e("line",{x1:k.dotPositions[i].x,y1:0,x2:k.dotPositions[i].x,y2:A,stroke:"gray",strokeWidth:.5,strokeDasharray:"4"}),e("circle",{cx:k.dotPositions[i].x,cy:k.dotPositions[i].y,r:5,fill:"white",stroke:r.color,strokeWidth:a,style:{transition:"cx 0.1s, cy 0.1s"}}),e("line",{x1:0,y1:k.dotPositions[i].y,x2:M,y2:k.dotPositions[i].y,stroke:"gray",strokeWidth:.5,strokeDasharray:"4"})]})]},i):null;var o}),(()=>{if(1===D.length){const t=D?.[0];return e("text",{x:y?M/2:M,y:A+15,textAnchor:y?"middle":"end",fill:h,className:"ff--line-chart-x-line-data",style:{fontSize:g},children:null!=t[V]?String(t[V]):""},String(t[V]))}if(D.length<7)return D.map(t=>e("text",{x:z(t[V]),y:A+15,textAnchor:"middle",fill:h,className:"ff--line-chart-x-line-data",style:{fontSize:g},children:null!=t[V]?String(t[V]):""},String(t[V])));{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),o=D[i];return e("text",{x:r*t,y:A+15,fill:h,className:"ff--line-chart-x-line-data",style:{fontSize:g},children:null!=o?.[V]?String(o?.[V]):""},String(o?.[V]))})}})(),(()=>{if("memory"===v){const t=Math.max(N,1024);return Array.from({length:6}).map((n,r)=>{const i=r*t/5,o=i/1024;return e("text",{x:-10,y:I(i),textAnchor:"end",fill:u,className:"ff-line-chart-y-axis-text",style:{fontSize:g},children:o.toFixed(1)},`y-${r}`)})}return Array.from({length:6}).map((t,n)=>{const r=n*N/5;return e("text",{x:-10,y:I(r),textAnchor:"end",fill:u,className:"ff-line-chart-y-axis-text",style:{fontSize:g},children:r.toFixed(0)},`y-${n}`)})})()]})}),x&&k.tooltip.visible&&n("div",{className:"ff-line-chart-tooltip",style:{left:b&&k.tooltip.left/2>i/1.75?k.tooltip.left-180:k.tooltip.left,top:k.tooltip.top},children:[e("div",{className:"ff-line-chart-date",children:k.currentXValue}),Object.entries(k.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))]})]})]})},hE=({onClose:t,top:r="100px",left:i="0px",className:o,description:a="Download and Install the fireflink client to run the script",onClick:s=()=>{},optionZIndex:c=10000001})=>{l(()=>{const e=e=>{"Escape"===e.key&&t?.()};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[t]);return n("div",{className:`ff-download-client-wrapper ${o}`,style:{top:r,left:i,zIndex:c},children:[n("div",{className:"ff-download-client-header-wrapper",children:[e("div",{className:"ff-download-client-hollow-triangle"}),e(F,{fontWeight:"semi-bold",lineHeight:"32px",className:"ff-download-client-header-text",children:"Download client"}),e(P,{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(F,{as:"div",color:"var(--download-client-content-text-color)",fontWeight:"semi-bold",textAlign:"center",lineHeight:"26px",children:a}),e(F,{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(P,{name:t,height:36,width:36})},t))})]})]})},pE=({legendName:t,height:r,width:i,children:o})=>e("div",{className:"ff_fieldSet_container",children:n("fieldset",{className:"ff_fieldSet",style:{height:r,width:i},children:[e("legend",{className:"ff_legend_container",children:e(F,{color:"var(--license_header_text_color)",fontSize:8,lineHeight:"12px",children:t})}),e("div",{className:"ff_children_container",children:o})]})}),CE=({onSelectVariable:t,dropdownPosition:n,filteredOptions:r=[],position:i="relative",width:o="100%",zIndex:a,truncateTextValue:l=34})=>e("div",{className:z(`ff-variable-dropdown-container ${i}`),style:n?{top:n.top+30,left:n.left-30,width:o,zIndex:a}:{width:o,zIndex:a},children:G(r)?e("div",{className:"ff-variable-option no-data",children:e(F,{as:"div",children:"No Option",fontSize:14})}):r?.map(n=>e("div",{className:"ff-variable-option",onMouseDown:()=>t(n),children:e(K,{title:oe(n?.name,l,"pixel")?n?.name:"",children:e(F,{children:ie(n?.name,l,"pixel")})})},n?.id))}),mE=o(({label:t="",hashInputValue:r="",setHashInputValue:i,variableList:o=[],placeholder:s="Enter text",onChange:d,onPaste:u,onCreateVariableClick:f,handleClearInput:h,value:p="",dropdownWidth:C="100%",dropdownHeight:m="160px",isHash:g=!1,isOnlyHash:v=!1,dataFiles:y=[],showAddVariableIcon:w=!0,helperText:E="",error:M,autoComplete:A="off",required:x=!1,zIndex:L=9999,truncateTextValue:k=34,formProps:H={},getSelectedVariable:S=()=>{},symbol:_="$",type:V="text",clearIcon:O=!0,inputTitle:N="",onBlur:I,helperTextWidth:T,iconProps:D={isShowIcon:!1,iconName:"",iconToolTipTitle:"",isIconDisable:!1,iconColor:"",onIconClick:()=>{}},...Z},j)=>{const[R,B]=c(!1),[U,q]=c(!1),[W,Q]=c(!1),[Y,X]=c(null),[J,$]=c(0),[ee,te]=c(!1),[ne,re]=c([]),ie=a(null),oe=a(null),[ae,le]=c("auto"),se=D?.isShowIcon;l(()=>{const e=oe.current?.querySelector(".ff-input-container");if(!e)return;const t=new ResizeObserver(e=>{for(let t of e){const e=`${t.contentRect.width}px`;le(e)}});return t.observe(e),()=>{t.disconnect()}},[]),b(j,()=>ie.current),l(()=>{null!==Y&&ie.current&&(ie.current.setSelectionRange(Y,Y),ie.current.focus())},[Y]),l(()=>{g&&B(p.startsWith("#"));const e=y?.find(e=>e.name===p),t=o?.find(e=>e?.name===p);if(p.startsWith("#")&&g){const e=p.slice(1).toLowerCase(),t=y.filter(t=>t.name.toLowerCase().includes(e));re(t),B(!0)}const n=null!==e&&p.startsWith("#"),r=null!==t&&p.startsWith("$"),i=p.length>(t?.name.length||0),a=p.length>0&&!r||p.startsWith("#");v?te(!1):r||n||p.includes("$")||p.includes("#")?(te(!1),a&&te(!0)):i&&!p.includes("$")&&te(!0)},[p]);const ce=()=>{ie.current&&$(ie.current.selectionStart||0)},de=ce,ue=ce;l(()=>{ie.current&&$(ie.current.selectionStart||0)},[p]);const fe=e=>{if(ie.current){const{selectionStart:t,selectionEnd:n}=ie.current,r=`${e.name}`;let o;if(o=g&&"#"===p[0]?e.name+p.slice(n||1):e.name,d){d({target:{value:o}},e),S(e.name)}ie.current.value=o,i?.(e),X((t||0)+r.length),B(!1),q(!0)}};const he=function(e,t,n){let r=!1,i="";const o="}"===p[t-1];if(t<0||t>e.length)return{showDropdown:r,searchString:i};const a=e.lastIndexOf(_,t-1),l=e.indexOf(_,t);if(-1!==a&&(v&&"$"===e[a]?r=!1:t===a+1?(r=!0,i=""):(i=e.slice(a+1,-1===l?void 0:l),t>a+1&&(i=e.slice(a+1,t)),r=!0),U&&o&&(r=!1),(/[{}]/.test(i)||0===t)&&(r=!1,i=""),i)){n.some(e=>e.name.toLowerCase().includes(i.toLowerCase()))||(n=[])}return{showDropdown:r,searchString:i}}(p,J,o),pe=()=>o?.filter(e=>e?.name?.toLowerCase()?.includes(he?.searchString?.toLowerCase()));return n("div",{className:"ff-add-variable-container",children:[n("div",{className:"ff-add-variable-input",ref:oe,children:[e(K,{title:N,style:{width:"100%"},children:e(nn,{...Z,name:"add_variable",ref:ie,type:V,className:z("ff-variable-input-container",{"ff-variable-input-container--show-icon":se}),value:p,onChange:d,onPaste:()=>{te(!0)},variant:"primary",label:t,placeholder:s,onClick:de,onKeyUp:ue,onFocus:()=>Q(!0),onBlur:e=>{(e=>{e.relatedTarget&&e.relatedTarget.closest(".dropdown-container")||Q(!1)})(e),I?.(e)},autoComplete:A,helperText:E,error:M,required:x,helperTextWidth:T,...H})}),!G(p)&&ee&&w&&e("div",{className:"ff-create-variable-container",onClick:f,children:e(F,{fontWeight:"regular",fontSize:"10px",color:"var(--brand-color)",cursor:"pointer",children:"Create Variable"})}),!G(p)&&!v&&e("div",{className:z("ff-cancel-icon-container",{"ff-cancel-icon-container--show-icon":se}),children:O&&e(K,{title:"Cancel",style:{zIndex:99999},children:e(P,{onClick:h,name:"close",height:16,width:16,hoverEffect:!0})})}),se&&e("div",{className:"ff-info-icon-container",children:e(K,{title:se&&!D?.isIconDisable?D?.iconToolTipTitle:"",children:e(P,{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"})})})]}),he?.showDropdown&&W&&e(uE,{position:"absolute",zIndex:L,truncateTextValue:k,width:ae,height:G(pe())?"auto":m,optionsList:pe(),onSelectVariable:fe}),R&&g&&W&&e(CE,{position:"relative",zIndex:L,truncateTextValue:k,width:ae,filteredOptions:ne,onSelectVariable:fe})]})}),gE=({isOpen:t,variableTypesList:r=[],onClose:i,onNameChange:o,onValueChange:a,variableName:s,variableValue:d,onVariableTypeChange:u,selectedVariableType:f,hideValue:h=!1,onHideChange:p,handleSubmit:C,mode:m="create",disabled:g,dataFiles:v=[],truncateTextValue:y=34,isEnterKeySubmit:w=!1})=>{const[b,E]=c(!1),[M,A]=c(""),[x,L]=c(),[k,H]=c(!1),[S,_]=c(!1),[V,O]=c({name:"",value:"",isChecked:!1});l(()=>{t&&"edit"===m&&O({name:s,value:d,isChecked:h})},[]);const z=e=>e&&0!==e.length?" "===e[0]||" "===e[e.length-1]?"Space is not allowed at starting and at the end":Ee.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 N(e){const t=!!e,n=Ee.test(e),r=Vt.test(e),i=e.length>=3&&e.length<=25;return t&&n&&r&&i}l(()=>{const e=z(s);E(!!e),A(e)},[s]),l(()=>{if("edit"!==m)return;const{name:e,value:t,isChecked:n}=V;_(s!==e||d!==t||h!==n)},[m,s,d,h,V]);const I=()=>{!k&&N(s)&&(H(!0),C())};l(()=>{if(!w)return;const e=e=>{if("Enter"===e.key){e.preventDefault();!N(s)||k||"edit"===m&&!S||I()}};return window.addEventListener("keydown",e),()=>{window.removeEventListener("keydown",e)}},[w,s,d,h,k,m,S,f]);return e(X,{zIndex:1350,onClose:i,isOpen:t,title:"create"===m?"Create Variable":"Edit Variable",width:"284px",height:"280px",top:"30%",right:8,isFooterRequired:!0,overlay:!0,footerContent:e(()=>n("div",{className:"ff-create-slider-footer",children:[e(U,{onClick:i,label:"Cancel",variant:"tertiary"}),e(U,{variant:"primary",label:"create"===m?"Create":"Update",type:"submit",onClick:I,disabled:!N(s)||k||"edit"===m&&!S})]}),{}),children:n("div",{className:"ff-create-variable-slider",children:[e("div",{className:"ff-create-variable-slider-input",children:e(nn,{label:"Variable Name",required:!0,type:"text",name:"variableName",value:s||"",onChange:e=>{H(!1),o(e.target.value)},error:b,helperText:M,onBlur:e=>{const t=e.target.value,n=z(t);E(!!n),A(n)}})}),e(ar,{label:"Variable Type",required:!0,onChange:e=>{u(e),H(!1)},selectedOption:f,optionsList:r,optionZIndex:99999,valueAccessor:"label",disabled:"edit"===m}),e(mE,{label:"Variable Value",placeholder:"Enter Variable value or select path using #",isHash:!0,isOnlyHash:!0,zIndex:99999,truncateTextValue:y,dataFiles:v,dropdownWidth:"100%",setHashInputValue:L,hashInputValue:x||{},value:d||"",type:h?"password":"text",onChange:(e,t)=>{const n=e.target.value;a(n,t)},showAddVariableIcon:!1}),n("div",{className:"ff-hide-value-content",children:[e(te,{onChange:e=>p(e.target.checked),name:"hideValue",label:"Hide Value",checked:h,disabled:g}),e(K,{title:"Once the value is hidden, it cannot be undone",children:e(P,{name:"info",width:12,height:12})})]})]})})},vE=({highlightText:t="",tableMeta:r=[],tableData:i=[],accordionType:o="row",noDataContent:a,height:l="100%",withFixedHeader:s=!1,headerType:d,TableAccordionStateIconWidth:u=4,TableAccordionStateIconHeight:f=8})=>{const[h,p]=c(-1),C=(e,t)=>{let n=e[t.accessor];return t.cell?t.cell({value:n,row:e,column:t.accessor}):t.accessor||n&&"object"!=typeof n?n:"--"},m=t=>{const n=t.map((t,n)=>e("table",{className:"ff-accordion-table",cellSpacing:0,children:e("tbody",{className:"ff-table-body",children:e("tr",{className:"ff-table-row",children:r.map((n,r)=>e("td",{className:"ff-table-cell",style:{width:n.width},children:"column"===o&&0===r?"":e(F,{children:C(t,n)})},n.accessor+r))},t.id||n)})},`accordion-table-${n}`));return n};return n("div",{style:{height:l},className:z("ff-accordion-table-container",{"ff-accordion-fixed-header-table":s}),children:[e("table",{cellSpacing:0,className:z("ff-accordion-table",{"ff-accordion-fixed-header":s}),children:e("thead",{children:e("tr",{className:"ff-table-row",children:r.map(t=>e("th",{style:{width:t.width},className:z("ff-table-header",d&&`ff-accordion-table--${d}-bg`),children:e("div",{children:e(F,{fontWeight:"semi-bold",fontSize:12,children:t.header})})},`header-${t.header}`))})})}),"row"===o&&i.map((n,r)=>e($,{highlightText:t,headerTitle:n.title,color:"var(--text-color)",accordionContent:m(n.data),disable:n.disable,disableInfoMessage:n.disableInfoMessage,accordionStateIconName:"arrows_down_icon",AccordionStateIconWidth:u,AccordionStateIconHeight:f},`accordion-row-${r}`)),"column"===o&&i.map((i,o)=>n("div",{className:"column-table-accordion",children:[e("div",{className:"ff-display-flex",children:e(K,{title:i.disable?i?.disableInfoMessage:"string"==typeof i.title&&oe(i.title,r[0]?.width,"pixel")?i.title:"",placement:"bottom-start",children:n("div",{className:`accordion-header ${i.disable&&"accordion-header--disabled"}`,children:[e("div",{className:"header-title",children:e("span",{children:e(F,{children:e(J,{text:ie(i.title,r[0]?.width,"pixel"),highlight:t})})})}),e("div",{className:"accordion-arrow",onClick:()=>{!i.disable&&(e=>{p(e===h?-1:e)})(o)},children:e(P,{name:h===o?"arrows_down_icon":"arrows_right_icon",color:"var(--table-with-accordion-icon-color)",width:u,height:f,hoverEffect:!1})})]})})}),h===o&&e("div",{children:m(i.data)})]},`column-accordion-${o}`)),i.length<=0&&e("div",{className:"no-data-content",style:{height:`calc(${l} - 50px)`},children:a})]})},yE=({progressPercentage:t,totalMemory:r,usedMemory:i,color:o="var(--brand-color)",trackColor:a="#f0f0f0",height:l=10,label:s,labelFontSize:c=12,labelTextColor:d="var(--ff-card-status-text-color)",showPercentage:u=!1,percentageFontSize:f=10,percentageTextColor:h="var(--tooltip-text-color)",progressBarWidth:p="200px"})=>{const C=e=>{const t=e.trim().toLowerCase();if("0"===t)return 0;const n=t.match(/^(\d+(?:\.\d+)?)\s*(kb|mb|gb)$/);if(!n||!n[1])return 0;const r=parseFloat(n[1]),i=n[2];return"gb"===i?1024*r:"kb"===i?r/1024:r};let m=0,g=s;if(void 0!==r&&void 0!==i){const e=C(i),t=C(r);t>0?(m=e/t*100,g=s||i):(m=0,g="0MB")}else m=t||0;const v=Math.max(0,Math.min(m,100));return n("div",{className:"ff-progress-bar-container "+(g?"ff-has-label":""),style:{width:p},children:[e("div",{className:"ff-progress-bar-track",style:{backgroundColor:a,height:`${l}px`},children:e("div",{className:"ff-progress-bar",style:{width:`${v}%`,backgroundColor:o,height:`${l}px`},children:u&&e(F,{className:"ff-progress-bar-percentage",fontSize:f,color:h,children:`${Math.round(v)}%`})})}),g&&e("div",{className:"ff-progress-bar-label",children:e(F,{fontSize:c,color:d,children:e(K,{title:oe(g,10,"count")?g:"",children:ie(g,10,"count")})})})]})},wE=({variant:t="primary",size:n="small",onClick:r,label:i="Choose File",disabled:o=!1,type:l="button",className:s="",style:d={},iconName:f,isChooseFile:h=!1,buttonWidth:p="auto",buttonHeight:C="auto",selectedFile:m={},handleCloseIcon:g,isMandatory:v=!1})=>{const y=a(null),[w,b]=c(0);u(()=>{y.current&&b(y.current.getBoundingClientRect().width-10)},[p]);const E=m?.name||i,M=w?ie(E,w,"pixel"):E,A=!!w&&oe(E,w,"pixel");return e("div",{ref:y,style:{width:p},children:e(K,{title:A?E:"",children:e(U,{variant:t,label:M,type:l,onClick:r,buttonWidth:p,buttonHeight:C,isChooseFile:h,size:n,disabled:o,className:s,iconName:f,style:d,iconPosition:"right",selectedFile:m,handleCloseIcon:g,isMandatory:v})})})},bE=({selected:t="text",handleClick:r,tabList:i})=>{const o=i?.includes("Automation"),a=i?.includes("Manual");return n("div",{className:"ff-script-switch-container",children:[e(K,{title:o?"Automation":"Add Automation",zIndex:1e3,children:e("div",{className:"ff-script-switch-button "+("Automation"===t?"active":""),onClick:()=>r(o?"Automation":"Add Automation"),children:e(P,{name:o?"automation_testcase":"add_testcase",color:"Automation"===t?"var(--primary-button-text-color)":"var(--description-text)"})})}),e(K,{title:a?"Manual":"Add Manual",zIndex:1e3,children:e("div",{className:"ff-script-switch-button "+("Manual"===t?"active":""),onClick:()=>r(a?"Manual":"Add Manual"),children:e(P,{name:a?"manual_testcase":"add_testcase",color:"Manual"===t?"var(--primary-button-text-color)":"var(--description-text)"})})})]})},EE=({selected:t,handleClick:n,tabList:r})=>e("div",{className:"ff-switch-container",children:r.map(r=>e(K,{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(P,{name:r.icon,color:t===r.name?"var(--primary-button-text-color)":"var(--description-text)"})})},r.name))}),ME=({onModalClose:t,MediaSrc:r,fileName:o,onDeleteClick:a,mediaType:s,fileId:d,thumbnailMediaSrc:u,isDelete:f=!0,onExpandClick:h,onDownloadClick:p,isMediaIcon:C=!1,previewOnly:m=!1,iconName:g="video_preview",isDisabled:v=!1})=>{const[y,w]=c(!1),b=i.useRef(null),E=()=>{w(!0),h&&h(d)},M=()=>{t?.(),w(!1)},A=()=>{p&&p(d)};return l(()=>{m&&w(!0)},[m]),n("div",{children:[!m&&(C?e(P,{name:g,hoverEffect:!0,onClick:E,disabled:v}):e(Lv,{mediaSrc:r,mediaType:s,onDownloadClick:A,onDeleteClick:()=>a?.(r),onExpandClick:E,fileName:o,fileId:d,thumbnailMediaSrc:u,isDelete:f})),y&&e($f,{isOpen:y,onClose:M,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(K,{title:"Download File",children:e(P,{name:"download_file_icon",onClick:A,color:"var(--icons-default-color)",className:"header-icons"})}),e(K,{title:"Expand",children:e(P,{name:"expand",onClick:E,color:"var(--icons-default-color)",className:"header-icons"})}),e(K,{title:"close",children:e(P,{name:"close",onClick:M,color:"var(--icons-default-color)",className:"header-icons"})})]}),"image"===s&&e("img",{src:r,alt:"fileName",height:"auto",width:"auto"}),"video"===s&&e("video",{src:r,controls:!0,controlsList:"nodownload",className:"ff-video-preview",ref:b,onCanPlay:()=>{if(b.current){const e=b.current.play();void 0!==e&&e.catch(e=>{console.error("Autoplay failed:",e)})}}})]})})]})},AE=({children:t,orientation:r="",navBarIcons:o=[],mobileHeight:a=448,mobileWidth:l=220,UtilityBar:s,tooltip:c={},background:d,navBarPosition:u="bottom"})=>{const f="portrait"===r,h=f?a:l,p=f?l:a,C=s&&"top"===u,m=s&&"bottom"===u,g=s&&"left"===u;return n("div",{className:["ff-mobileskin-wrapper",f?"portrait":"landscape",g?"ff-side-nav-left":"",C?"navbar-top":"",m?"navbar-bottom":""].filter(Boolean).join(" "),children:[C&&e("div",{className:"ff-nav-bar top-nav-bar",children:o.map(({title:t,name:n,className:r,...i},a)=>{const l=c?.[n]??a;return e(K,{title:c?.[n]||"",placement:"top",children:e("div",{className:`ff-nav-bar-icon ${r||""} ${a===o.length-1?"last-icon":""} ${C?"navbar-top":""}`,children:e(P,{name:n,...i})})},l)})}),e("div",{className:"ff-mobileskin-container",style:{height:h+16,width:p+16},children:e("div",{className:"ff-mobile-container",style:{width:p,height:h,background:d||"transparent"},children:e("div",{className:"ff-mobile-image-container",children:i.isValidElement(t)?t:e("img",{src:t,alt:"Mobile content",style:{width:f?"100%":2.1*l+"px",height:f?"100%":.5*a+"px"}})})})}),s&&m&&e("div",{className:"ff-nav-bar",children:o?.map((t,n)=>{const{title:r,...i}=t;return e("div",{className:`ff-nav-bar-icon ${t?.className||""} ${n===o.length-1?"last-icon":""}`,children:e(K,{title:r,children:e(P,{...i})})},n)})}),s&&g&&e("div",{className:"ff-side-nav-bar",children:o?.map((t,n)=>{const{title:r,...i}=t;return e("div",{className:`ff-sidebar ${t?.className||""} ${n===o.length-1?"last-icon":""}`,children:e(K,{title:r,placement:"bottom",children:e(P,{...i})})},n)})})]})},xE=o(({width:t=300,height:r=40,iconHeight:i=16,iconWidth:o=16,placeholder:l="Enter text",iconName:s="right_arrow_filled_icon",iconPosition:c="left",borderRadius:d=4,autoFocus:u=!1,value:f="",iconColor:h="var(--brand-color)",tooltipTitle:p="send",submitPrompt:C,onPromptChange:m,onBlur:g,onFocus:v,disableInput:y,isAdditionalIcon:w=!1,additionalIconName:b,additionIconToolTip:E,onAdditionalIconClick:M},A)=>{const x=a(null);ce([{key:"Enter",action:()=>L()}],x);const L=e=>{f&&C?.(f.trim())};return n("div",{className:z("ff-prompt-container",{"icon-left":"left"===c,"icon-right":"left"!==c}),style:{width:`${t}px`,height:`${r}px`,borderRadius:d},ref:x,children:[e(K,{placement:"top",title:p,children:e(P,{name:s,className:"ff-prompt-icon",height:i,width:o,onClick:C,color:h,disabled:G(f)})}),e("input",{ref:A,className:"ff-prompt-input",type:"text",placeholder:l,autoFocus:u,onChange:m,onFocus:v,onBlur:g,value:f,readOnly:y}),w&&b&&e(K,{placement:"top",title:E,children:e(P,{name:b,className:"ff-prompt-icon additional-icon",height:i,width:o,onClick:M})})]})}),LE=({content:t,isVisible:n,maxWidth:r=300,onClick:i,isClickable:o=!0,arrowPosition:a="left"})=>e("div",{onClick:i,style:{width:`${r}px`,"--triangle-position":r-4+"px"},className:z("ff-chat-msg-box",{visible:n,hidden:!n,pointer:o,default:!o,"chat-arrow-left":"left"===a,"chat-arrow-right":"left"!==a}),children:e("div",{className:z("content",`arrow-${a}`),children:e(F,{children:t})})}),kE=({iconName:r,iconPosition:{top:i,left:o,bottom:a,right:l},hoverIconPosition:{top:s,left:d,bottom:u,right:f},modalPosition:{top:h,left:p,bottom:C,right:m},modalWidth:g,modalHeight:v,headerContent:y="Header Content",footerContent:w="Footer Content",iconWidth:b,iconHeight:E,modalHeading:M="Ask Fia",children:x,onClearChat:L})=>{const[k,H]=c(!1),[S,_]=c(!1);return n(t,{children:[n("div",{style:{top:void 0!==i?`${i}px`:void 0,left:void 0!==o?`${o}px`:void 0,bottom:void 0!==a?`${a}px`:void 0,right:void 0!==l?`${l}px`:void 0},className:"ff-dynamic-icon-container",children:[e(P,{className:"ff-dynamic-icon",name:r,onClick:()=>{_(e=>!e),setTimeout(()=>H(e=>!e),10)},height:E,width:b}),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(P,{name:"ask_fia_icon",height:32,width:82})})]}),S&&A(e("div",{className:z("ff-dynamic-modal",{open:k}),style:{top:void 0!==h?`${h}px`:void 0,left:void 0!==p?`${p}px`:void 0,bottom:void 0!==C?`${C}px`:void 0,right:void 0!==m?`${m}px`:void 0,position:"fixed",height:v,width:g},children:n("div",{className:"ff-dynamic-modal-content",children:[y&&e("div",{className:"ff-dynamic-modal-header",children:n("div",{className:"header-container",children:[n("div",{className:"header-left",children:[e(P,{height:16,width:16,name:"fia_icon"}),e(F,{fontWeight:"medium",children:M})]}),n("div",{className:"header-right",children:[e("span",{className:"action",children:e(K,{title:"Clear chat",placement:"bottom",children:e(P,{height:16,width:16,name:"delete",color:"var(--tooltip-text-color)",onClick:L})})}),e("span",{className:"action",children:e(K,{title:"Close",placement:"bottom",children:e(P,{height:16,width:16,name:"close",color:"var(--tooltip-text-color)",onClick:()=>(H(!1),void setTimeout(()=>_(!1),300))})})})]})]})}),e("div",{className:"ff-dynamic-modal-body",children:x}),w&&e("div",{className:"ff-dynamic-modal-footer",children:w})]})}),document.body)]})},HE=o(({iconName:r,hoverTitle:i,iconPosition:{top:o,left:s,bottom:d,right:u},hoverIconPosition:{top:f,left:h,bottom:p,right:C},modalPosition:{top:m,left:g,bottom:v,right:y},modalWidth:w,modalHeight:E,headerContent:M="Header Content",footerContent:x="Footer Content",iconWidth:L,iconHeight:k,children:H,onVisibilityChange:S},_)=>{const[V,O]=c(!1),[N,I]=c(!1),T=a(null),D=()=>{T.current&&clearTimeout(T.current),O(!1),T.current=setTimeout(()=>{I(!1),S?.(!1)},300)};return b(_,()=>({closeModal:D})),l(()=>()=>{T.current&&clearTimeout(T.current)},[]),n(t,{children:[n("div",{style:{top:void 0!==o?`${o}px`:void 0,left:void 0!==s?`${s}px`:void 0,bottom:void 0!==d?`${d}px`:void 0,right:void 0!==u?`${u}px`:void 0},className:"ff-ai-dynamic-icon-container",children:[e(P,{className:"ff-ai-dynamic-icon",name:r,onClick:()=>{T.current&&clearTimeout(T.current),I(e=>!e),S?.(!N),T.current=setTimeout(()=>O(e=>!e),10)},height:k,width:L}),e("div",{style:{top:void 0!==f?`${f}px`:void 0,left:void 0!==h?`${h}px`:void 0,bottom:void 0!==p?`${p}px`:void 0,right:void 0!==C?`${C}px`:void 0},className:"ff-ai-chat-icon-hover",children:e("div",{className:"ai-hover-leaf",children:e(F,{fontWeight:"bold",fontSize:14,color:"var(--chatbot-leaf-text)",children:i})})})]}),N&&A(e("div",{className:z("ff-ai-dynamic-modal",{open:V}),style:{top:void 0!==m?`${m}px`:void 0,left:void 0!==g?`${g}px`:void 0,bottom:void 0!==v?`${v}px`:void 0,right:void 0!==y?`${y}px`:void 0,position:"fixed",height:E,width:w},children:n("div",{className:"ff-ai-dynamic-modal-content",children:[M&&e("div",{className:"ff-ai-dynamic-modal-header",children:M}),e("div",{className:"ff-ai-dynamic-modal-body",children:H}),x&&e("div",{className:"ff-ai-dynamic-modal-footer",children:x})]})}),document.body)]})}),SE=({variant:t,title:r,tabTitle:i,comment:o,profileShortName:a})=>n("div",{className:"ff-history-card",children:[e("div",{className:z("header",`header--${t}`),children:e(F,{fontWeight:"semi-bold",children:i})}),n("div",{className:"body",children:[e("div",{className:"title",children:n("div",{className:"profile",children:[e(F,{className:z("avatar",`avatar--${t}`),children:a}),e(F,{children:r})]})}),n("div",{className:"comment-container",children:[e(F,{fontWeight:"semi-bold",className:"heading",children:"Comments:"}),e(F,{color:"var(--details-page-value-color)",className:"comment",children:o})]})]})]}),_E=({onChange:t,disabled:r,checked:i=!1,id:o="toggle",path:a})=>n("div",{className:"ff--ai-switch-container",children:[e("input",{className:"ff--ai-switch-checkbox",id:`ff-toggle-${o}`,type:"checkbox",disabled:!!r,onChange:e=>{t&&t(e)},checked:i}),e("label",{className:z("ff--ai-switch-label",{"ff--ai-switch-label--disabled":r}),htmlFor:`ff-toggle-${o}`,children:e("span",{className:"ff--ai-switch-content",children:n("span",{className:"ff--ai-switch-content",children:[e(F,{className:z("ff--ai-switch-typography",{left:i,right:!i}),as:"div",fontWeight:"bold",fontSize:18,color:i?"var(--base-bg-color)":"var(--ff-ai-toggle-text-color)",children:"AI"}),e("img",{className:"ff--ai-switch-image",src:a,alt:"AI image"})]})})})]}),VE=o(({name:t,height:n=30,width:r=30,path:i="",onClick:o,color:s="var(--brand-color)",hoverEffect:c=!1,className:d="",disabled:u=!1,variant:f="light",isSelected:h=!1,x:p,y:C,tabIndex:m=-1,...g},v)=>{if(!B[t])return null;const y=a(null);l(()=>{y.current&&(void 0!==p&&y.current.setAttribute("x",String(p)),void 0!==C&&y.current.setAttribute("y",String(C)))},[p,C]);const w={ref:v,onClick:u?void 0:o,style:{height:`${n}px`,width:`${r}px`,cursor:u?"not-allowed":"pointer",opacity:u?.3:1},tabIndex:m,...g};return e("span",{...w,children:e("img",{height:n,width:r,src:i,alt:""})})}),OE=({id:r=0,serialNumber:i,activeId:o,setActiveId:s,children:d,onIconClick:u,numberChildren:f,onContainerClick:h,onNextClick:p,onPreviousClick:C,disabled:m,isEditAccess:g,versionsLength:v,count:y,hiddenActions:w=[]})=>{const[b,E]=c(!1),[M,A]=c(!1),x=a(null),L=Array.isArray(w)?w:w?[w]:[],k=(e,t)=>{e.stopPropagation(),t()};l(()=>{x.current&&(()=>{if(x.current){const e=getComputedStyle(x.current),t=1.2*parseFloat(e.fontSize)*6;x.current.scrollHeight>t&&A(!0)}})()},[]);const H=e=>{e.stopPropagation(),E(!b)};return n("div",{className:`ff-prompt-container-Block ${o===r?"active":"inactive"} `,onClick:()=>{s(r),h()},children:[e(F,{fontSize:8,className:"ff-prompt-number-bg-color",as:"span",children:`Test cases ${i}`}),n(t,{children:[n("div",{className:"ff-prompt-content "+(b?"expanded":""),ref:x,children:[d,b&&n(t,{children:[e("span",{role:"button","aria-label":"toggleExpand",onClick:H,className:"read-less-btn",children:e(F,{color:"var(--brand-color)",fontWeight:"semi-bold",className:"read-more-btn-text",children:"Read Less"})})," "]})]}),M&&!b&&e("div",{role:"button","aria-label":"toggleExpand",onClick:H,className:"read-more-btn",children:e(F,{color:"var(--brand-color)",fontWeight:"semi-bold",className:"read-more-btn-text",children:"Read More"})})]}),n("div",{className:"ff-prompt-icons",children:[e("div",{className:"ff-prompt-icons-leftside",children:[{action:"delete",title:"Delete",color:"var(--ff-delete-button-attachment)"},{action:"edit",title:"Edit",color:"var(--label-edit-text-label-color)"},{action:"regenerate",title:"Regenerate",color:"var(--label-edit-text-label-color)"}].filter(e=>!L.includes(e.action)).map((t,n)=>{const r=g&&"delete"===t?.action||"regenerate"===t?.action&&(v??0)>=3||m;return e(K,{title:t.title,placement:"bottom",children:e(P,{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(P,{disabled:1===y,className:"ff-prompt-icons-style",name:"arrow_left_accordian",color:"var(--table-column-text-color)",width:18,height:18,onClick:e=>k(e,C),cursorType:"pointer"}),f,e(P,{disabled:y===v,className:"ff-prompt-icons-style",name:"arrow_right_icon",color:"var(--table-column-text-color)",width:18,height:18,onClick:e=>k(e,p),cursorType:"pointer"})]})]})]})},zE=o(({type:t="text",variant:r="primary",name:i="",label:o,disabled:a=!1,disableLinkIcon:l=!1,required:s=!1,placeholder:c="Attach Link",value:d,error:u,helperText:f,noBorder:h,className:p="",onChange:C,onBlur:m,onFocus:g,autoComplete:v="off",autoFocus:y=!1,minValue:w=-1/0,maxValue:b=1/0,transparentBackground:E=!1,size:M="small",isLabelRequired:A=!0,onClick:x,onKeyUp:L,isViewMode:k=!1,...H},S)=>{const _=!G(d);return n("fieldset",{className:z("ff-link-input-fieldset",{"ff-link-input-fieldset--disabled":a}),children:[n("div",{className:z("ff-link-input-container",{"ff-link-input-container--float":_,"ff-link-input-container--disabled":!!a}),children:[A&&n("label",{className:z(`ff-link-input-label-container ff-link-input-label-container--${M}`,{"ff-link-input-label-container--danger":!!u}),htmlFor:i,children:[s&&e("span",{className:"required-asterisk",children:"*"}),e("span",{className:z(`ff-link-input-label ff-link-input-label--${r}`,{"ff-link-input-label--no-hover":!!d,"ff-link-input-label--disabled":!!a,"ff-link-input-label--danger":!!u}),children:o})]}),e("input",{ref:S,name:i,value:d,type:t,spellCheck:!1,id:i,className:z(`ff-link-input ff-link-input-${r} default-input ff-link-input--${M}`,{"ff-link-input--transparentBackground":!!E,"ff-link-input--no-hover":!!d,"ff-link-input--disabled":!!a,"ff-link-input--danger":!!u,"ff-link-input--no-border":!!h,"ff-link-input--placeholder":!A},`${p}`),placeholder:c,disabled:k||a,onChange:C,onFocus:g,onBlur:m,autoComplete:v,autoFocus:y,min:w,max:b,onClick:x,onKeyUp:L,...H}),e("div",{className:"input-link-icon",children:l||u||!_?e(P,{name:"link",disabled:!0}):e(K,{title:"Click here to navigate",children:e("span",{children:e(P,{name:"link",disabled:!1,onClick:()=>{d&&!u&&window.open(d,"_blank")}})})})})]}),f&&u&&e("span",{className:z("ff-link-input-message",{"ff-link-input-message--danger":!!u}),children:f})]})}),NE=({labelsList:r=[],height:i=""})=>{const o=e("div",{className:"ff-chip-tooltip",children:r.filter((e,t)=>t>0).map((t,n)=>e(F,{as:"div",className:"ff-chip-tooltip-label",children:t},`label-${n}-${t}`))});return e(t,{children:!G(r)&&n("div",{className:"ff-chip-with-count-container",children:[e(K,{title:r[0],children:e(F,{as:"div",children:ie(r[0]||"",10),className:"ff-chip-label",fontWeight:"medium",style:i?{height:i}:void 0})}),r.length>1&&e(K,{title:e(F,{as:"div",children:o}),children:e(F,{as:"div",children:"+"+(r.length-1),className:"ff-chip-count",fontWeight:"medium"})})]})})};class IE 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 TE=({iconName:t="",onButtonClick:r,buttonLabel:i="Label",buttonText:o="To Add Group",disableButton:a=!1,stepCount:l=1,iconWidth:s=120,iconHeight:c=120,addContentLabel:d="step"})=>n("div",{className:"add-content-button "+(a?"disabled":""),children:[!G(t)&&e("div",{className:"icon-container",children:e(P,{name:t,width:s,height:c})}),n("div",{className:"typography-label-button",children:[n(F,{fontSize:"12px",fontWeight:"regular",lineHeight:"18px",children:[d+l," :"]}),e(F,{fontSize:"12px",fontWeight:"semi-bold",lineHeight:"18px",children:"Click"}),e(Jf,{label:i,onClick:r,iconName:"plus_user_icon",isDisable:a}),e(F,{fontSize:"12px",fontWeight:"semi-bold",lineHeight:"18px",children:o})]})]}),DE=({variant:t="default",tabsData:r,activeTabId:i,onTabClick:o,noBorder:a=!1,noPadding:l=!1,titleSize:s="12px"})=>{const[d,u]=c(0);return n("div",{className:"ff-tabs-slider-container",children:[n("div",{className:z(`ff-tab-row--${t} ff-tab-row-section`,{"ff-tab-row--no-border":a,"ff-tab-row--no-padding":l,"ff-tab-row--position":r.length>4}),children:[r.length>4&&e(P,{className:"ff-tab-icon ff-tab-icon--previous",name:""+(d?"arrow_left_accordian":""),onClick:()=>{d>0&&u(e=>e-1)},hoverEffect:!0}),e("div",{className:"ff-tab-row-carousel",children:e("div",{className:"carousel_inner",style:{transform:`translateX(-${100*d}%)`},children:r.map(r=>n("button",{onClick:()=>!r.disabled&&o(r.id),disabled:r.disabled,className:z(`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(K,{title:r.label.length>9?r.label:"",children:e(F,{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:z("ff-tab-label",{"ff-tab-label--active":i===r.id})})}),"default"===t&&r.count&&e("span",{className:z("tab-count",{"tab-count--active":i===r.id}),children:r.count})]}),e("div",{className:z("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(P,{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})]})},ZE=o(({label:t="Status",iconName:r="update_icon",onClick:i,isDisable:o=!1,variant:a="default",backgroundColor:l=!1,border:s=!1},c)=>{const d={default:"var(--ff-avatar-background-color)",success:"var(--status-success-text-color)",danger:"var(--ff-delete-button-attachment)"};return e("button",{disabled:o,onClick:i,className:`\n ff-status-indicator\n ff-status-indicator--${a}\n ${l?`ff-status-indicator--with-bg ff-status-indicator--${a}-bg`:""}\n ${s?`ff-status-indicator--with-border ff-status-indicator--${a}-border`:""}\n `,ref:c,children:n("div",{className:"ff-status-indicator__content",children:[e(P,{name:"danger"===a?"close":r,color:d[a]||d.default,className:`ff-status-indicator__icon ff-status-indicator__icon--${a}`}),e(F,{as:"div",fontSize:12,className:`ff-status-indicator__label ff-status-indicator__label--${a}`,fontWeight:"medium",lineHeight:"20px",children:t})]})})}),jE=({rootLabel:t,childrenLabels:r,align:i="center",direction:o="horizontal"})=>{const a=r.length;return n("div","vertical"===o?{className:"ff-os-tree-vertical",style:{"--child-count":a},children:[n("div",{className:`ff-os-tree-vertical__row ff-os-tree-vertical__row--${i}`,children:[e("div",{className:"ff-os-tree-vertical__root-label",children:t}),e("div",{className:"ff-os-tree-vertical__horizontal-line"})]}),n("div",{className:"ff-os-tree-vertical__vertical-line-wrapper",children:[e("div",{className:"ff-os-tree-vertical__vertical-line"}),r.map((t,r)=>n("div",{className:"ff-os-tree-vertical__child",children:[e("div",{className:"ff-os-tree-vertical__child-connector"}),e("div",{className:"ff-os-tree-vertical__child-label",children:t})]},r))]})]}:{className:`ff-os-tree ff-os-tree--${i}`,style:{"--child-count":a},children:[n("div",{className:"ff-os-tree__root-wrapper",children:[e("div",{className:"ff-os-tree__root-label",children:t}),e("div",{className:"ff-os-tree__vertical-root"})]}),e("div",{className:"ff-os-tree__horizontal-connector",children:r.map((t,n)=>e("div",{className:"ff-os-tree__vertical-child"},n))}),e("div",{className:"ff-os-tree__children",children:r.map((t,n)=>e("div",{className:"ff-os-tree__child-container",children:e("div",{className:"ff-os-tree__child-label",children:t})},n))})]})},RE=({handleClose:t,handleResend:r,handleOtp:i,resendTimeout:o=30})=>{const[s,d]=c(Array(6).fill("")),[u,f]=c(o),[h,p]=c(!0),C=a(Array(6).fill(null));l(()=>{h||C.current[0]?.focus()},[h]),l(()=>{let e;return u>0&&(e=window.setInterval(()=>f(e=>e-1),1e3)),0===u&&p(!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);C.current[r]?.focus()};return e($f,{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(F,{fontSize:24,lineHeight:"36px",fontWeight:"semi-bold",children:"OTP Verification"}),e(P,{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&&C.current[t+1]?.focus()}else if("Backspace"===n){e.preventDefault();const n=[...s];n[t]="",d(n),t>0&&C.current[t-1]?.focus()}})(e,n),onPaste:m,ref:e=>C.current[n]=e,readOnly:!0},n))}),e(U,{variant:"primary",label:"Submit",onClick:()=>i(s.join("")),disabled:s.includes(""),className:"ff-submit-btn"}),n("div",{className:"ff-resend "+(h?"disabled":""),onClick:h?void 0:()=>{f(o),p(!0),d(Array(6).fill("")),r()},children:["Re-send OTP",u>0?` (${u}s)`:""]})]})})},BE=({isOpen:t,onClose:r,isPlaying:i,onTogglePlay:o,mediaType:s,src:d,headerTitle:u,onDownload:f,onExpand:h,showHeader:C=!0,showDownload:m=!0,showExpand:g=!0,width:v="800px",height:y="432px",showControls:w=!0,customStyle:b,overlay:E=!0,children:M,showControlDownload:A=!1,showControlExpand:x=!1,isFullscreen:L=!1})=>{const k=a(null),H=a(null),[S,_]=c(0),[V,O]=c(0),[z,N]=c(!1),[I,T]=c(0);l(()=>{"video"===s&&k.current&&!M&&(i?k.current.play():k.current.pause())},[i,s,M]);const D=p(()=>{if(k.current&&!z){const e=k.current.currentTime/k.current.duration*100;T(e||0),_(k.current.currentTime)}},[z]),Z=p(()=>{k.current&&O(k.current.duration)},[]),j=p(()=>{_(0),T(0),o?.()},[o]),R=p(e=>`${Math.floor(e/60)}:${Math.floor(e%60).toString().padStart(2,"0")}`,[]),B=p(e=>{if(k.current){const t=e/100*k.current.duration;k.current.currentTime=t,T(e),_(t)}},[]),U=p(e=>{if(z||!H.current)return;const t=H.current.getBoundingClientRect(),n=e.clientX-t.left,r=t.width,i=Math.max(0,Math.min(100,n/r*100));B(i)},[B,z]),q=p(e=>{if(!H.current)return;N(!0);const t=H.current.getBoundingClientRect(),n=e.clientX-t.left,r=t.width,i=Math.max(0,Math.min(100,n/r*100));B(i)},[B]),W=p(e=>{if(!z||!H.current||!k.current)return;const t=H.current.getBoundingClientRect(),n=e.clientX-t.left,r=t.width,i=Math.max(0,Math.min(100,n/r*100));B(i)},[z,B]),Q=p(()=>{N(!1)},[]);return l(()=>{if(z)return document.addEventListener("mousemove",W),document.addEventListener("mouseup",Q),()=>{document.removeEventListener("mousemove",W),document.removeEventListener("mouseup",Q)}},[z,W,Q]),t?e(Vs,{isOpen:t,onClose:r,isMaximized:!1,showHeader:C,overlay:E,downloadHandler:()=>{},customStyle:b,header:n("div",{className:"ff-header-content",children:[e(P,{width:23,height:23,name:"automatic_locator"}),e(F,{children:e("span",{className:"ff-header-title",children:u})})]}),icons:e(K,{title:"Close",children:e(P,{name:"close",onClick:r})}),width:v,height:y,zIndex:999,children:n("div",{className:"ff-video-wrapper",children:[M||("video"===s?e("video",{ref:k,src:d,className:"ff-media-video",onTimeUpdate:D,onLoadedMetadata:Z,onEnded:j}):e("img",{src:d,alt:"Preview",className:"ff-media-image"})),n("div",{className:"ff-top-right-icons",children:[m&&e(K,{title:"Download",children:e(P,{name:"download_file",color:"white",onClick:f})}),g&&e(K,{title:L?"Minimize":"Maximize",children:e(P,{name:L?"collapse_icon":"expand_icon",color:"white",onClick:h})})]}),"video"===s&&w&&!M&&n("div",{className:"ff-media-controls",children:[e("button",{onClick:o,className:"ff-play-pause-btn",children:e(K,{title:i?"Pause":"Play",children:e(P,{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:R(S)}),e("input",{type:"range",className:"ff-seek-bar",min:0,max:100,value:I,onChange:e=>B(parseFloat(e.target.value)),onClick:U,onMouseDown:q,ref:H}),e("span",{className:"ff-total-time",children:R(V)})]}),n("div",{className:"ff-control-icons",children:[A&&e(K,{title:"Download",children:e(P,{name:"download_file",color:"white",onClick:f,cursorType:"pointer"})}),x&&e(K,{title:L?"Minimize":"Maximize",children:e(P,{name:L?"collapse_icon":"expand_icon",color:"white",onClick:h,cursorType:"pointer"})})]})]})]})}):null},PE=({header:r,secondaryHeader:i,primaryCount:o,secondaryCount:a,primaryItems:l,secondaryItems:s,width:c,activeTab:d="primary",activeTabId:u,onPrimaryTabClick:f,onSecondaryTabClick:h,onTabClick:p,actions:C,tabsData:m,notchPosition:g="top-left"})=>{const v=i&&"secondary"===d?s:l,y=a&&parseInt(a)>0,w=o&&parseInt(o)>0,b=i&&(w||y),{tooltip:E="Download",iconName:M="download_file",disabled:A=!1,onClick:x,className:L=""}=C?.download||{},{tooltip:k="Delete",iconName:H="delete_icon",disabled:S=!1,onClick:_,className:V=""}=C?.delete||{},O=()=>n("div",{className:"ff-dropdown-header-icons",children:[C?.download&&e(K,{title:E,children:e(P,{name:M||"",className:`ff-dropdown-icon ff-download-icon ${L}`,onClick:x,width:18,height:20,disabled:A,hoverEffect:!0})}),C?.delete&&e(K,{title:k,children:e(P,{name:H||"",className:`ff-dropdown-icon ff-delete-icon ${V}`,onClick:_,width:25,height:25,disabled:S,hoverEffect:!0})})]});return n("div",{className:"ff-resolution-dropdown",style:c?{minWidth:c}:{},children:[e("div",{className:"ff-dropdown-notch "+("bottom-center"===g?"bottom-center":"top-left")}),e("div",{className:"ff-dropdown-header",children:e("div",{className:"ff-dropdown-header-content",children:i&&m&&u?n(t,{children:[e(Fs,{tabsData:m,activeTabId:u,onTabClick:e=>{p&&p(e),"tab-1"===e&&f?f():"tab-2"===e&&h&&h()}}),b&&O()]}):i&&b?n("div",{className:"ff-dropdown-header-dual",children:[n("div",{className:"ff-dropdown-header-item "+("primary"===d?"active":""),onClick:f,children:[e(F,{fontWeight:"semi-bold",className:"ff-dropdown-text",children:r}),o&&e("span",{className:"ff-dropdown-count",children:o})]}),n("div",{className:"ff-dropdown-header-item "+("secondary"===d?"active":""),onClick:h,children:[e(F,{fontWeight:"semi-bold",className:"ff-dropdown-text",children:i}),a&&e("span",{className:"ff-dropdown-count",children:a})]}),O()]}):i?n("div",{className:"ff-dropdown-header-dual",children:[n("div",{className:"ff-dropdown-header-item "+("primary"===d?"active":""),onClick:f,children:[e(F,{fontWeight:"semi-bold",className:"ff-dropdown-text",children:r}),o&&e("span",{className:"ff-dropdown-count",children:o})]}),n("div",{className:"ff-dropdown-header-item "+("secondary"===d?"active":""),onClick:h,children:[e(F,{fontWeight:"semi-bold",className:"ff-dropdown-text",children:i}),a&&e("span",{className:"ff-dropdown-count",children:a})]})]}):e(F,{fontSize:16,fontWeight:"semi-bold",children:r})})}),e("ul",{className:"ff-dropdown-list",children:v?.map((t,n)=>e("li",{className:"ff-dropdown-item",children:t},n))})]})},FE=(e,t)=>"string"==typeof e?ie(e,t):i.isValidElement(e)?i.cloneElement(e,{},FE(e.props.children,t)):Array.isArray(e)?e.map(e=>FE(e,t)):e,UE=(e,t,n,r)=>{const i=e[t.accessor];if(t.cell){const o=e._id||e.id;return t.cell({value:i,row:e,column:t.accessor,index:n,tableType:r,...o&&{refId:o}})}return t.accessor||i&&"object"!=typeof i?i:"--"},qE=(t,n=[],r,i,o)=>{let a=n;const l=void 0!==i?!i:r;return G(n)&&(isNaN(t)||(a=Array(t).fill(!0))),e("div",{className:"tree-table-fn-space-container",children:a?.map((n,r)=>e("span",{className:`tree-table-fn-space-block tree-table-fn-space-block-${r} ${n?"":"no-lines"} ${l&&r===t-1?"last-node":""} ${o?"folder":""}`},r))})},WE=i.memo(({treeRowRef:r,col:i,colIndex:o,columnMeta:a,node:l,selected:s,select:c,onCheckBoxChange:d,onToggleExpand:u,onAddConfirm:f,onAddCancel:h,handleEditFieldError:p,isExpanding:C,columnTextColor:m,hideOnDisable:g,scriptLengthTruncate:v,addModuleInputWidth:y,addModuleSelectWidth:w,disableEditLabelConfirmIcon:b,isEditable:E,setIsEditable:M})=>{const A={color:`${m||"var(--ff-primary-text-color)"}`,width:a?.width??i?.width,position:a?.sticky?"sticky":void 0,left:a?.sticky?a.left:void 0,zIndex:a?.sticky?a.zIndex:void 0};return n("div",{className:`ff-table-tree-fn-td ${i.isTree&&l.container?"folder":""} ${a?.sticky?"sticky-tree-column":""}`,"data-col-index":o,style:A,children:[i.isTree&&qE(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(C?Ds:N,{})]})}),n("span",{className:"tree-table-fn-td-content "+(i.isTree&&l.container?"folder":""),children:[!l?.isNewNode&&n(t,{children:[i.isTree&&"checkbox"===c&&!(g&&l.unselectable)&&e("span",{className:"tree-table-fn-td-content-select",children:"none"===l.selectedStatus?e(K,{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(te,{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(te,{checked:"completely"===l.selectedStatus,partial:"partially"===l.selectedStatus,onChange:e=>d(e,l),disabled:l.unselectable||"REVIEW"===l.state||!0===l?.isDisable})}),i.isTree&&"radio"===c&&!(g&&l.unselectable)&&e("span",{className:"tree-table-fn-td-content-select",children:e(Za,{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})})]}),l.isNewNode&&i.isTree?e(Ts,{onCancel:h,onConfirm:f,value:l.value,label:l?.label,optionsList:l.options,selectedOption:l.selectedOption,withDropdown:"inputWithDropdown"===l.type,handleCustomError:p,inputFieldWidth:y,selectFieldWidth:w,confirmIconTooltip:l.confirmIconTooltip,cancelIconTooltip:l.cancelIconTooltip,isEditable:E,setIsEditable:M,isOnBlurTrue:!1,isDisable:{confirm:b}}):e("span",{className:"tree-table-fn-td-content-text",children:FE(UE(l,i),v)})]})]}),i.actions&&!l?.isNewNode&&e("div",{className:"table-tree-fn-row-action",children:i.actions(l,r)})]})});WE.displayName="TableCell";const QE=i.memo(({node:t,columnsData:n,columnMeta:r,selected:i,select:o,onRowClick:l,onToggleExpand:s,onCheckBoxChange:c,onAddConfirm:d,onAddCancel:u,handleEditFieldError:f,isExpanding:h,index:p,selectedNode:C,hideOnDisable:m,scriptLengthTruncate:g,addModuleInputWidth:v,addModuleSelectWidth:y,disableEditLabelConfirmIcon:w,isEditable:b,setIsEditable:E,style:M})=>{const A=a(null);return e("div",{"data-level":t.hierarchy,ref:A,className:"ff-table-tree-fn-row show-tree "+(C&&C===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===p?"table-fn-first-row":t.key,style:M,children:n.map((n,a)=>e(WE,{treeRowRef:A,col:n,colIndex:a,node:t,selected:i,select:o,onCheckBoxChange:c,onToggleExpand:s,onAddConfirm:d,onAddCancel:u,handleEditFieldError:f,isExpanding:h,hideOnDisable:m,scriptLengthTruncate:g,addModuleInputWidth:v,addModuleSelectWidth:y,disableEditLabelConfirmIcon:w,isEditable:b,setIsEditable:E,columnMeta:r?.[a]},n.name))})});QE.displayName="TableRow";const GE=({flattenedTreeData:t,columnsData:n,columnMeta:r,rowHeight:i=32,startIndex:o=0,totalHeight:a=0,selected:l,select:s,onRowClick:c,onToggleExpand:d,onCheckBoxChange:u,onAddConfirm:f,onAddCancel:h,handleEditFieldError:p,expanding:C,selectedNode:m,hideOnDisable:g,scriptLengthTruncate:v,addModuleInputWidth:y,addModuleSelectWidth:w,disableEditLabelConfirmIcon:b,isEditable:E,setIsEditable:M})=>e("div",{className:"ff-table-tree-fn-body",style:{height:`${a}px`,position:"relative"},children:t?.map((t,a)=>e(QE,{node:t,columnsData:n,columnMeta:r,selected:l,select:s,onRowClick:c,onToggleExpand:d,onCheckBoxChange:u,onAddConfirm:f,onAddCancel:h,handleEditFieldError:p,isExpanding:t.key===C,index:o+a,selectedNode:m,hideOnDisable:g,scriptLengthTruncate:v,addModuleInputWidth:y,addModuleSelectWidth:w,disableEditLabelConfirmIcon:b,isEditable:E,setIsEditable:M,style:{transform:`translateY(${(o+a)*i}px)`,height:`${i}px`,position:"absolute",top:0,left:0,right:0}},t.key))}),KE=i.memo(({columnsData:t,columnMeta:r,totalWidth:i,rootNode:o,selected:s,onCheckBoxChange:d,selectedNode:u,tableHeaderBgColor:f,hideOnDisable:h,transparentHeader:p,scriptLengthTruncate:C=25,showHeader:m=!0})=>{const g=a(null),[v,y]=c(!1),[w,b]=c(!1);l(()=>{y(!0)},[]);const E=(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:[m&&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:{...E(i,n),backgroundColor:p?"transparent":f,pointerEvents:p?"none":"auto"},children:t},t))}),o&&e("div",{className:"ff-table-tree-fn-row show-tree "+(u&&u===o?.node?.key?"hover":""),ref:g,onMouseEnter:e=>{e.stopPropagation(),b(!0)},onMouseLeave:e=>{e.stopPropagation(),b(!1)},children:t.map((t,i)=>e("div",{className:"ff-table-tree-fn-td "+(r?.[i]?.sticky?"sticky-tree-column":""),"data-col-index":i,style:E(i,t.width),children:n("span",{className:"tree-table-fn-default-content",children:[0===i&&"checkbox"===o.select&&!(h&&o.node.isDisabled)&&e(te,{checked:"partially"!==o?.node?.selectedStatus&&("completely"===o?.node?.selectedStatus||!1),partial:"partially"===o.node.selectedStatus,onChange:e=>d(e,o.node),disabled:o.node.isDisabled}),0===i&&"radio"===o.select&&!(h&&o.node.isDisabled)&&e(Za,{name:o.node.key,checked:s.includes(o.node.key),value:o.node.key,onChange:e=>d(e,o.node),disabled:o.node.isDisabled}),n("span",{className:"tree-table-fn-td-content-text",children:["name"===t.accessor?e("span",{children:o.node[t.accessor]}):e("span",{children:FE(UE(o.node,t),C)}),o.cell&&0===i&&e("span",{className:"table-tree--fn-root-cell",children:o.cell(o.node)})]}),w&&o.actions&&0===i&&v&&g.current&&e("div",{className:"table-tree-fn-row-action",children:o.actions(o.node,g)})]})},i))})]})});KE.displayName="TableHead";const YE=32,XE="__root__",JE=(e,t)=>{if(!e?.length)return[];const n=new Map,r=new Map,i=new Map,o=new Map;t&&t.key&&n.set(t.key,t),e.forEach(e=>{n.set(e.key,e);const t=e.parentId??XE;r.has(t)||(r.set(t,[]),o.set(t,{container:0,resource:0})),r.get(t)?.push(e);const i=o.get(t);i&&(e.container?i.container++:i.resource++)}),r.forEach(e=>{e.forEach((e,t)=>{i.set(e.key,t)})});const a=e=>{const t=e.parentId??XE,a=r.get(t);if(!a||0===a.length)return!1;if((i.get(e.key)??0)<a.length-1)return!0;const l=n.get(t),s=o.get(t);if(l&&s){const t=a.filter(e=>e.container).reduce((e,t)=>e+(t.totalResourceCount??0),0),n=a.filter(e=>!e.container).length,r=Math.max(0,(l.totalResourceCount??0)-(t+n));if(e.container){return s.container<(l.subContainerCount??0)||r>0}return s.resource<r}return!1},l=e=>{if(void 0!==e.selectedStatus)return e.selectedStatus;let r=e;for(;r?.parentId;){const e=n.get(r.parentId);if(!e)break;if("completely"===e.selectedStatus)return"completely";if("none"===e.selectedStatus)return"none";r=e}return"completely"===t?.selectedStatus?"completely":"none"===t?.selectedStatus?"none":e.selectedStatus};return e.map(e=>{const t=e,r=t.parentSiblings&&t.parentSiblings.length>0?t.parentSiblings:(e=>{const t=e.hierarchy??0;if(t<=0)return[];const r=[];let i=e;for(;i&&(r.unshift(i),i.parentId);){const e=n.get(i.parentId);if(!e)break;i=e}const o=r.map(e=>a(e));return o.length===t?o:o.length>t?o.slice(o.length-t):new Array(t-o.length).fill(!1).concat(o)})(e);return{...e,lastChild:!a(e),parentSiblings:r,selectedStatus:l(e)}})},$E=o(({treeData:t,columnsData:r,selected:i=[],select:o=null,onChange:s=()=>{},onClick:d=()=>{},onExpand:f=()=>{},loadMore:C=()=>{},tableBorder:m,height:g="calc(100vh - 134px)",newNode:v,onAddConfirm:y=()=>{},onAddCancel:w=()=>{},handleEditFieldError:b,loading:E=!1,rootNode:M,pagination:A=!0,selectedNode:x,tableHeaderBgColor:L="var(--border-color)",hideOnDisable:k=!1,freezeColumns:H,scriptLengthTruncate:S=25,addModuleInputWidth:_=150,addModuleSelectWidth:V,onScroll:O,onScrollEnd:z,disableEditLabelConfirmIcon:N=!1,transparentHeader:I=!1,navigateTreeNode:T=null,handleRemoveNavigateTreeNode:D=()=>{},scrollThreshold:Z=128,showHeader:j=!0},R)=>{const[B,P]=c(null),[F,U]=c(null),[q,W]=c({start:0,end:20}),[Q,K]=c(!1),Y=a(null),X=a(null),J=a(0),$=a(E),ee=a(null),te=a({lastScrollTop:0}),ne=a(null),re=a(0),ie=a(null),oe=a(null),ae=a(null),le=a({key:null,attempts:0}),se=a(null),ce=(e,t)=>{const n=String(e??t);return n.endsWith("%")?{value:parseFloat(n),unit:"%"}:{value:parseFloat(n)||0,unit:"px"}},de=h(()=>{let e=0,t=0;return r.map((n,r)=>{const{value:i,unit:o}=ce(n.width,400),a=!!H&&r<H,l="%"===o?`${i}%`:`${i}px`,s=`calc(${e}px + ${t}%)`;return a&&("%"===o?t+=i:e+=i),{width:l,sticky:a,left:s,zIndex:a?100+(H??0)-r:1}})},[r,H]),ue=h(()=>{let e=0,t=0;return r.forEach(n=>{const{value:r,unit:i}=ce(n.width,400);"%"===i?t+=r:e+=r}),`calc(${e}px + ${t}%)`},[r]),fe=h(()=>{if(!H)return"0px";let e=0,t=0;return de.slice(0,H).forEach(n=>{const r=parseFloat(n.width)||0;n.width.endsWith("%")?t+=r:e+=r}),`calc(${e}px + ${t}%)`},[de,H]),he=h(()=>((e,t,n)=>{if(!t?.sourceId||!t.action)return e;const{sourceId:r,action:i,value:o="",error:a="",label:l,type:s,options:c,selectedOption:d,confirmIconTooltip:u,cancelIconTooltip:f,payloadSourceId:h}=t,p=t?.parentId,C=t?.hierarchy,m=c?.map(e=>({label:e,value:e})),g=d?{label:d,value:d}:void 0,v=new Map;e.forEach(e=>v.set(e.key,e)),n&&v.set(n.key,n);const y=v.get(r);let w;h&&(w=v.get(h));let b=y??("addInside"===i?w:void 0);!b&&"addInside"===i&&p&&(b=v.get(p));const E="addInside"===i&&!b&&e.length>=0;if(!b&&!E)return e;const M=[...e],A=b?e.findIndex(e=>e.key===b.key):-1;let x=null,L=0,k=A+1;switch(i){case"addAbove":{const t=b;if(!t)return e;x=t.parentId,L=t.hierarchy;break}case"addBelow":{const t=b;if(!t)return e;x=w?.parentId??t.parentId,L=w?.hierarchy??t.hierarchy;break}case"addInside":{if(E){x=p??h??r??null,L=C??1,k=M.length;break}const t=w??b;if(!t)return e;x=t.key,L=(t.hierarchy??0)+1;const n=M.findIndex(e=>e.key===r);-1!==n&&(k=n+1);break}}const H={hierarchy:L,parentId:x,sourceId:b?.key??r??h??"new-node",isNewNode:!0,key:"new-node",value:o,error:a,label:l,type:s,options:m,selectedOption:g,confirmIconTooltip:u,cancelIconTooltip:f};switch(i){case"addAbove":M.splice(A,0,H);break;case"addBelow":M.splice(A+1,0,H);break;case"addInside":M.splice(Math.max(0,k),0,H)}return M})(t,v,M?.node),[t,v,M]),pe=h(()=>JE(he,M?.node),[he,M?.node]),Ce=h(()=>pe.filter(e=>!e.hide),[pe]),me=h(()=>{const e=new Map;return pe.forEach(t=>e.set(t.key,t)),e},[pe]),ge=h(()=>{const e=new Map;return Ce.forEach((t,n)=>e.set(t.key,n)),e},[Ce]),ve=p(e=>{P(t=>t?e&&t!==e?t:null:t),e&&oe.current?.key!==e||(oe.current=null),ae.current&&(clearTimeout(ae.current),ae.current=null)},[]);l(()=>{$.current=E},[E]);const ye=p(()=>{const e=Y.current;if(!e)return;const t=J.current||0,n=Math.max(0,e.scrollTop-t),r=e.clientHeight-t;let i=Math.floor(n/YE)-6,o=Math.ceil((n+r)/YE)+6;i=Math.max(0,i),o=Math.min(Ce.length,o),W(e=>e.start===i&&e.end===o?e:{start:i,end:o})},[Ce.length]),we=p(()=>{null===ee.current&&(ee.current=requestAnimationFrame(()=>{ee.current=null,ye()}))},[ye]);u(()=>{const e=Y.current;if(!e)return;const t=Ce.length*YE,n=Math.max(0,t-(e.clientHeight-J.current));te.current.lastScrollTop>n&&Ce.length>0&&(e.scrollTop=0,te.current.lastScrollTop=0),ye()},[Ce.length,ye]);const be=p(()=>{const e=Y.current;if(!e)return;const n=e.scrollTop,r=n>te.current.lastScrollTop?"down":"up";if(te.current.lastScrollTop=n,we(),O?.(),ie.current?.(),!A||E||F||G(t))return;const i=e.scrollHeight-(n+e.clientHeight)<Z,o=n<Z+J.current;"down"===r&&i&&!t[t.length-1]?.lastResource&&(U("below"),C("below")),"up"===r&&o&&!t[0]?.lastResource&&(U("above"),ne.current=t[0]?.key??null,C("above"))},[t,A,E,F,Z,we,O,C]);l(()=>{if(E||!A||G(t))return;const e=t[0],n=!e?.lastResource,{totalSubContainerCount:r=0,totalResourceCount:i=0}=M?.node||{},o=r+i,a=Ce.length<10&&Ce.length<o;n&&a&&(ne.current=e?.key??null,U("above"),C("above"))},[E,A,t,Ce.length,M,C]),u(()=>{if(E||"above"!==F)E||"below"!==F||U(null);else{const e=Y.current,t=ne.current;if(e&&t){const n=ge.get(t);void 0!==n&&n>0&&(e.scrollTop+=n*YE)}ne.current=null,U(null)}},[E,F,ge]),l(()=>{const e=Y.current;if(e)return ie.current=z?xa(()=>{z?.()},150):null,e.addEventListener("scroll",be,{passive:!0}),()=>{e.removeEventListener("scroll",be),ie.current?.cancel()}},[be,z]),l(()=>{const e=Y.current;if(!e)return;const t=e=>{Date.now()<re.current&&e.stopImmediatePropagation()};return e.addEventListener("scroll",t,{passive:!0,capture:!0}),()=>{e.removeEventListener("scroll",t,!0)}},[]),l(()=>{const e=X.current;if(!e)return;const t=new ResizeObserver(()=>{J.current=e.getBoundingClientRect().height,ye()});return t.observe(e),()=>t.disconnect()},[ye]),u(()=>{if(!v||!Y.current)return;const e=Y.current,t=ge.get("new-node");if(void 0===t)return;const n=J.current||0,r=e.clientHeight-n;if(r<=0)return;const i=t*YE,o=i+YE,a=Math.max(0,e.scrollTop-n);let l=a;i<a?l=i:o>a+r&&(l=Math.max(0,o-r)),l!==a&&(re.current=Date.now()+300,e.scrollTop=l+n,ye());const s=requestAnimationFrame(()=>{K(!0)});return()=>cancelAnimationFrame(s)},[v,ge,ye]),l(()=>{v||K(!1)},[v]),u(()=>{if(!B||E)return;const e=oe.current;if(!e||e.key!==B){const e=requestAnimationFrame(()=>{ve(B)});return()=>cancelAnimationFrame(e)}const t=me.get(e.key);if(!t){const t=requestAnimationFrame(()=>{ve(e.key)});return()=>cancelAnimationFrame(t)}if(Boolean(t.expanded)!==e.expanded)return;const n=requestAnimationFrame(()=>{ve(e.key)});return()=>cancelAnimationFrame(n)},[me,B,E,ve]),l(()=>{le.current.key!==T&&(le.current={key:T,attempts:0}),!T&&se.current&&(clearTimeout(se.current),se.current=null)},[T]),u(()=>{if(!T||v)return;const e=Y.current;if(!e)return;const n=ge.get(T);if(void 0!==n){le.current={key:T,attempts:0};const t=J.current||0,r=Math.max(YE,e.clientHeight-t),i=n*YE+16,o=Math.max(0,i-r/2)+t;return re.current=Date.now()+400,e.scrollTo({top:o,behavior:"smooth"}),we(),se.current&&clearTimeout(se.current),void(se.current=setTimeout(()=>{D?.()},350))}if(E||F)return;const r=le.current;if(r.key!==T&&(r.key=T,r.attempts=0),r.attempts+=1,!(r.attempts>30))return A&&!0!==t[0]?.lastResource?(ne.current=null,U("above"),void C("above")):void(r.attempts>2&&D?.());D?.()},[T,v,ge,E,F,A,t,C,we,D]);const Ee=p(e=>{if(B)return;const t=!e?.expanded;P(e.key),oe.current={key:e.key,expanded:t},ae.current&&clearTimeout(ae.current);const n=Date.now(),r=()=>{if(oe.current?.key!==e.key)return;const t=$.current,i=Date.now()-n>=2e3;!t||i?ve(e.key):ae.current=setTimeout(r,1e3)};ae.current=setTimeout(r,1e3),f?.(e)},[B,f,ve]),Me=p((e,t)=>{B||s?.(e,t)},[s,B]),Ae=p((e,t)=>{B||d?.(e,t)},[d,B]);l(()=>()=>{null!==ee.current&&(cancelAnimationFrame(ee.current),ee.current=null),ae.current&&clearTimeout(ae.current),se.current&&clearTimeout(se.current)},[]);const xe=Ce.length*YE,Le=Ce.slice(q.start,q.end);return e("div",{className:"tree-table-wrapper-container table-tree-fn",children:e("div",{className:"tree-table-fn-wrap",ref:R,children:e("div",{className:"table-fn-scrollable "+(Ce.length?"":"table-fn-empty"),ref:Y,style:{"--table-height":Ce.length?g:"auto","--frozen-column-width":fe,border:m},children:n("div",{className:"tree-table-fn",style:{width:ue},children:[e("div",{ref:X,style:{position:"sticky",top:0,zIndex:98},children:e(KE,{columnsData:r,columnMeta:de,totalWidth:ue,rootNode:M,onCheckBoxChange:Me,selected:i,selectedNode:x,tableHeaderBgColor:L,hideOnDisable:k,transparentHeader:I,scriptLengthTruncate:S,showHeader:j})}),e(GE,{flattenedTreeData:Le,columnsData:r,columnMeta:de,totalWidth:ue,rowHeight:YE,startIndex:q.start,totalHeight:xe,selected:i,select:o,onRowClick:Ae,onToggleExpand:Ee,onCheckBoxChange:Me,onAddConfirm:y,onAddCancel:w,handleEditFieldError:b,expanding:B,selectedNode:x,hideOnDisable:k,scriptLengthTruncate:S,addModuleInputWidth:_,addModuleSelectWidth:V,disableEditLabelConfirmIcon:N,isEditable:v?Q:void 0,setIsEditable:v?e=>{K(Boolean(e))}:void 0})]})})})})});function eM(e,t,n,r,i,o="children"){return function e(a){for(let l=0;l<a.length;l++){const s=a[l];if(s&&s[t]===n){const e=[...a];return"replace"===i?e[l]=r:e.splice("above"===i?l:l+1,0,r),{updatedArray:e}}if(s&&s[o]&&Array.isArray(s[o])){const t=e(s[o]);if(t)return{updatedArray:a.map((e,n)=>n===l?{...e,[o]:t.updatedArray}:e)}}}return null}(e)}$E.displayName="TableTreeFn";const tM=(e,t)=>{if(e===t)return!0;if(null==e||null==t||"object"!=typeof e||"object"!=typeof t)return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const n=Array.isArray(e),r=Array.isArray(t);if(n!==r)return!1;const i=n?e:Object.keys(e),o=r?t:Object.keys(t);if(i.length!==o.length)return!1;if(n)return i.every((e,t)=>tM(e,o[t]));{const n=new Set(o);return i.every(r=>n.has(r)&&tM(e[r],t[r]))}},nM=(e,t)=>!(!Array.isArray(e)||!Array.isArray(t))&&(e.length===t.length&&e.every((e,n)=>{const r=t[n];return tM(e,r)}));function rM(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function iM(e,t){return e&t}function oM(e,t){return e|t}function aM(e,t){return e^t}function lM(e,t){return e&~t}function sM(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 cM(e){for(var t=0;0!=e;)e&=e-1,++t;return t}var dM,uM="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function fM(e){var t,n,r="";for(t=0;t+3<=e.length;t+=3)n=parseInt(e.substring(t,t+3),16),r+=uM.charAt(n>>6)+uM.charAt(63&n);for(t+1==e.length?(n=parseInt(e.substring(t,t+1),16),r+=uM.charAt(n<<2)):t+2==e.length&&(n=parseInt(e.substring(t,t+2),16),r+=uM.charAt(n>>2)+uM.charAt((3&n)<<4));(3&r.length)>0;)r+="=";return r}function hM(e){var t,n="",r=0,i=0;for(t=0;t<e.length&&"="!=e.charAt(t);++t){var o=uM.indexOf(e.charAt(t));o<0||(0==r?(n+=rM(o>>2),i=3&o,r=1):1==r?(n+=rM(i<<2|o>>4),i=15&o,r=2):2==r?(n+=rM(i),n+=rM(o>>2),i=3&o,r=3):(n+=rM(i<<2|o>>4),n+=rM(15&o),r=0))}return 1==r&&(n+=rM(i<<2)),n}var pM,CM=function(e){var t;if(void 0===dM){var n="0123456789ABCDEF",r=" \f\n\r\t \u2028\u2029";for(dM={},t=0;t<16;++t)dM[n.charAt(t)]=t;for(n=n.toLowerCase(),t=10;t<16;++t)dM[n.charAt(t)]=t;for(t=0;t<8;++t)dM[r.charAt(t)]=-1}var i=[],o=0,a=0;for(t=0;t<e.length;++t){var l=e.charAt(t);if("="==l)break;if(-1!=(l=dM[l])){if(void 0===l)throw new Error("Illegal character at offset "+t);o|=l,++a>=2?(i[i.length]=o,o=0,a=0):o<<=4}}if(a)throw new Error("Hex encoding incomplete: 4 bits missing");return i},mM={decode:function(e){var t;if(void 0===pM){var n="= \f\n\r\t \u2028\u2029";for(pM=Object.create(null),t=0;t<64;++t)pM["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t)]=t;for(pM["-"]=62,pM._=63,t=0;t<9;++t)pM[n.charAt(t)]=-1}var r=[],i=0,o=0;for(t=0;t<e.length;++t){var a=e.charAt(t);if("="==a)break;if(-1!=(a=pM[a])){if(void 0===a)throw new Error("Illegal character at offset "+t);i|=a,++o>=4?(r[r.length]=i>>16,r[r.length]=i>>8&255,r[r.length]=255&i,i=0,o=0):i<<=6}}switch(o){case 1:throw new Error("Base64 encoding incomplete: at least 2 bits missing");case 2:r[r.length]=i>>10;break;case 3:r[r.length]=i>>16,r[r.length]=i>>8&255}return r},re:/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,unarmor:function(e){var t=mM.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 mM.decode(e)}},gM=1e13,vM=function(){function e(e){this.buf=[+e||0]}return e.prototype.mulAdd=function(e,t){var n,r,i=this.buf,o=i.length;for(n=0;n<o;++n)(r=i[n]*e+t)<gM?t=0:r-=(t=0|r/gM)*gM,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+=gM,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+=(gM+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*gM+e[n];return t},e.prototype.simplify=function(){var e=this.buf;return 1==e.length?e[0]:this},e}(),yM=/^(\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)?)?$/,wM=/^(\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 bM(e,t){return e.length>t&&(e=e.substring(0,t)+"…"),e}var EM,MM=function(){function e(t,n){this.hexDigits="0123456789ABCDEF",t instanceof e?(this.enc=t.enc,this.pos=t.pos):(this.enc=t,this.pos=n)}return e.prototype.get=function(e){if(void 0===e&&(e=this.pos++),e>=this.enc.length)throw new Error("Requesting byte offset ".concat(e," on a stream of length ").concat(this.enc.length));return"string"==typeof this.enc?this.enc.charCodeAt(e):this.enc[e]},e.prototype.hexByte=function(e){return this.hexDigits.charAt(e>>4&15)+this.hexDigits.charAt(15&e)},e.prototype.hexDump=function(e,t,n){for(var r="",i=e;i<t;++i)if(r+=this.hexByte(this.get(i)),!0!==n)switch(15&i){case 7:r+=" ";break;case 15:r+="\n";break;default:r+=" "}return r},e.prototype.isASCII=function(e,t){for(var n=e;n<t;++n){var r=this.get(n);if(r<32||r>176)return!1}return!0},e.prototype.parseStringISO=function(e,t){for(var n="",r=e;r<t;++r)n+=String.fromCharCode(this.get(r));return n},e.prototype.parseStringUTF=function(e,t){for(var n="",r=e;r<t;){var i=this.get(r++);n+=i<128?String.fromCharCode(i):i>191&&i<224?String.fromCharCode((31&i)<<6|63&this.get(r++)):String.fromCharCode((15&i)<<12|(63&this.get(r++))<<6|63&this.get(r++))}return n},e.prototype.parseStringBMP=function(e,t){for(var n,r,i="",o=e;o<t;)n=this.get(o++),r=this.get(o++),i+=String.fromCharCode(n<<8|r);return i},e.prototype.parseTime=function(e,t,n){var r=this.parseStringISO(e,t),i=(n?yM:wM).exec(r);return i?(n&&(i[1]=+i[1],i[1]+=+i[1]<70?2e3:1900),r=i[1]+"-"+i[2]+"-"+i[3]+" "+i[4],i[5]&&(r+=":"+i[5],i[6]&&(r+=":"+i[6],i[7]&&(r+="."+i[7]))),i[8]&&(r+=" UTC","Z"!=i[8]&&(r+=i[8],i[9]&&(r+=":"+i[9]))),r):"Unrecognized time: "+r},e.prototype.parseInteger=function(e,t){for(var n,r=this.get(e),i=r>127,o=i?255:0,a="";r==o&&++e<t;)r=this.get(e);if(0===(n=t-e))return i?-1:0;if(n>4){for(a=r,n<<=3;!(128&(+a^o));)a=+a<<1,--n;a="("+n+" bit)\n"}i&&(r-=256);for(var l=new vM(r),s=e+1;s<t;++s)l.mulAdd(256,this.get(s));return a+l.toString()},e.prototype.parseBitString=function(e,t,n){for(var r=this.get(e),i="("+((t-e-1<<3)-r)+" bit)\n",o="",a=e+1;a<t;++a){for(var l=this.get(a),s=a==t-1?r:0,c=7;c>=s;--c)o+=l>>c&1?"1":"0";if(o.length>n)return i+bM(o,n)}return i+o},e.prototype.parseOctetString=function(e,t,n){if(this.isASCII(e,t))return bM(this.parseStringISO(e,t),n);var r=t-e,i="("+r+" byte)\n";r>(n/=2)&&(t=e+n);for(var o=e;o<t;++o)i+=this.hexByte(this.get(o));return r>n&&(i+="…"),i},e.prototype.parseOID=function(e,t,n){for(var r="",i=new vM,o=0,a=e;a<t;++a){var l=this.get(a);if(i.mulAdd(128,127&l),o+=7,!(128&l)){if(""===r)if((i=i.simplify())instanceof vM)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 bM(r,n);i=new vM,o=0}}return o>0&&(r+=".incomplete"),r},e}(),AM=function(){function e(e,t,n,r,i){if(!(r instanceof xM))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 bM(this.stream.parseStringUTF(t,t+n),e);case 18:case 19:case 20:case 21:case 22:case 26:return bM(this.stream.parseStringISO(t,t+n),e);case 30:return bM(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 MM?t:new MM(t,0);var r=new MM(n),i=new xM(n),o=e.decodeLength(n),a=n.pos,l=a-r.pos,s=null,c=function(){var t=[];if(null!==o){for(var r=a+o;n.pos<r;)t[t.length]=e.decode(n);if(n.pos!=r)throw new Error("Content size is not correct for container starting at offset "+a)}else try{for(;;){var i=e.decode(n);if(i.tag.isEOC())break;t[t.length]=i}o=a-n.pos}catch(e){throw new Error("Exception while decoding undefined length content: "+e)}return t};if(i.tagConstructed)s=c();else if(i.isUniversal()&&(3==i.tagNumber||4==i.tagNumber))try{if(3==i.tagNumber&&0!=n.get())throw new Error("BIT STRINGs with unused bits cannot encapsulate.");s=c();for(var d=0;d<s.length;++d)if(s[d].tag.isEOC())throw new Error("EOC is not supposed to be actual content.")}catch(e){s=null}if(null===s){if(null===o)throw new Error("We can't skip over an invalid tag with undefined length at offset "+a);n.pos=a+Math.abs(o)}return new e(r,l,o,i,s)},e}(),xM=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 vM;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}(),LM=[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],kM=(1<<26)/LM[LM.length-1],HM=function(){function e(e,t,n){null!=e&&("number"==typeof e?this.fromNumber(e,t,n):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}return e.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var n,r=(1<<t)-1,i=!1,o="",a=this.t,l=this.DB-a*this.DB%t;if(a-- >0)for(l<this.DB&&(n=this[a]>>l)>0&&(i=!0,o=rM(n));a>=0;)l<t?(n=(this[a]&(1<<l)-1)<<t-l,n|=this[--a]>>(l+=this.DB-t)):(n=this[a]>>(l-=t)&r,l<=0&&(l+=this.DB,--a)),n>0&&(i=!0),i&&(o+=rM(n));return i?o:"0"},e.prototype.negate=function(){var t=zM();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)+BM(this[this.t-1]^this.s&this.DM)},e.prototype.mod=function(t){var n=zM();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 _M(t):new VM(t),this.exp(e,n)},e.prototype.clone=function(){var e=zM();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=zM();return this.bitwiseTo(e,iM,t),t},e.prototype.or=function(e){var t=zM();return this.bitwiseTo(e,oM,t),t},e.prototype.xor=function(e){var t=zM();return this.bitwiseTo(e,aM,t),t},e.prototype.andNot=function(e){var t=zM();return this.bitwiseTo(e,lM,t),t},e.prototype.not=function(){for(var e=zM(),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=zM();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},e.prototype.shiftRight=function(e){var t=zM();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+sM(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+=cM(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,oM)},e.prototype.clearBit=function(e){return this.changeBit(e,lM)},e.prototype.flipBit=function(e){return this.changeBit(e,aM)},e.prototype.add=function(e){var t=zM();return this.addTo(e,t),t},e.prototype.subtract=function(e){var t=zM();return this.subTo(e,t),t},e.prototype.multiply=function(e){var t=zM();return this.multiplyTo(e,t),t},e.prototype.divide=function(e){var t=zM();return this.divRemTo(e,t,null),t},e.prototype.remainder=function(e){var t=zM();return this.divRemTo(e,null,t),t},e.prototype.divideAndRemainder=function(e){var t=zM(),n=zM();return this.divRemTo(e,t,n),[t,n]},e.prototype.modPow=function(e,t){var n,r,i=e.bitLength(),o=RM(1);if(i<=0)return o;n=i<18?1:i<48?3:i<144?4:i<768?5:6,r=i<8?new _M(t):t.isEven()?new OM(t):new VM(t);var a=[],l=3,s=n-1,c=(1<<n)-1;if(a[1]=r.convert(this),n>1){var d=zM();for(r.sqrTo(a[1],d);l<=c;)a[l]=zM(),r.mulTo(d,a[l-2],a[l]),l+=2}var u,f,h=e.t-1,p=!0,C=zM();for(i=BM(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),p)a[u].copyTo(o),p=!1;else{for(;l>1;)r.sqrTo(o,C),r.sqrTo(C,o),l-=2;l>0?r.sqrTo(o,C):(f=o,o=C,C=f),r.mulTo(C,a[u],o)}for(;h>=0&&!(e[h]&1<<i);)r.sqrTo(o,C),f=o,o=C,C=f,--i<0&&(i=this.DB-1,--h)}return r.revert(o)},e.prototype.modInverse=function(t){var n=t.isEven();if(this.isEven()&&n||0==t.signum())return e.ZERO;for(var r=t.clone(),i=this.clone(),o=RM(1),a=RM(0),l=RM(0),s=RM(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),n?(o.isEven()&&a.isEven()||(o.addTo(this,o),a.subTo(t,a)),o.rShiftTo(1,o)):a.isEven()||a.subTo(t,a),a.rShiftTo(1,a);for(;i.isEven();)i.rShiftTo(1,i),n?(l.isEven()&&s.isEven()||(l.addTo(this,l),s.subTo(t,s)),l.rShiftTo(1,l)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);r.compareTo(i)>=0?(r.subTo(i,r),n&&o.subTo(l,o),a.subTo(s,a)):(i.subTo(r,i),n&&l.subTo(o,l),s.subTo(a,s))}return 0!=i.compareTo(e.ONE)?e.ZERO:s.compareTo(t)>=0?s.subtract(t):s.signum()<0?(s.addTo(t,s),s.signum()<0?s.add(t):s):s},e.prototype.pow=function(e){return this.exp(e,new SM)},e.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),n=e.s<0?e.negate():e.clone();if(t.compareTo(n)<0){var r=t;t=n,n=r}var i=t.getLowestSetBit(),o=n.getLowestSetBit();if(o<0)return t;for(i<o&&(o=i),o>0&&(t.rShiftTo(o,t),n.rShiftTo(o,n));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=n.getLowestSetBit())>0&&n.rShiftTo(i,n),t.compareTo(n)>=0?(t.subTo(n,t),t.rShiftTo(1,t)):(n.subTo(t,n),n.rShiftTo(1,n));return o>0&&n.lShiftTo(o,n),n},e.prototype.isProbablePrime=function(e){var t,n=this.abs();if(1==n.t&&n[0]<=LM[LM.length-1]){for(t=0;t<LM.length;++t)if(n[0]==LM[t])return!0;return!1}if(n.isEven())return!1;for(t=1;t<LM.length;){for(var r=LM[t],i=t+1;i<LM.length&&r<kM;)r*=LM[i++];for(r=n.modInt(r);t<i;)if(r%LM[t++]==0)return!1}return n.millerRabin(e)},e.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},e.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},e.prototype.fromString=function(t,n){var r;if(16==n)r=4;else if(8==n)r=3;else if(256==n)r=8;else if(2==n)r=1;else if(32==n)r=5;else{if(4!=n)return void this.fromRadix(t,n);r=2}this.t=0,this.s=0;for(var i=t.length,o=!1,a=0;--i>=0;){var l=8==r?255&+t[i]:jM(t,i);l<0?"-"==t.charAt(i)&&(o=!0):(o=!1,0==a?this[this.t++]=l:a+r>this.DB?(this[this.t-1]|=(l&(1<<this.DB-a)-1)<<a,this[this.t++]=l>>this.DB-a):this[this.t-1]|=l<<a,(a+=r)>=this.DB&&(a-=this.DB))}8==r&&128&+t[0]&&(this.s=-1,a>0&&(this[this.t-1]|=(1<<this.DB-a)-1<<a)),this.clamp(),o&&e.ZERO.subTo(this,this)},e.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t},e.prototype.dlShiftTo=function(e,t){var n;for(n=this.t-1;n>=0;--n)t[n+e]=this[n];for(n=e-1;n>=0;--n)t[n]=0;t.t=this.t+e,t.s=this.s},e.prototype.drShiftTo=function(e,t){for(var n=e;n<this.t;++n)t[n-e]=this[n];t.t=Math.max(this.t-e,0),t.s=this.s},e.prototype.lShiftTo=function(e,t){for(var n=e%this.DB,r=this.DB-n,i=(1<<r)-1,o=Math.floor(e/this.DB),a=this.s<<n&this.DM,l=this.t-1;l>=0;--l)t[l+o+1]=this[l]>>r|a,a=(this[l]&i)<<n;for(l=o-1;l>=0;--l)t[l]=0;t[o]=a,t.t=this.t+o+1,t.s=this.s,t.clamp()},e.prototype.rShiftTo=function(e,t){t.s=this.s;var n=Math.floor(e/this.DB);if(n>=this.t)t.t=0;else{var r=e%this.DB,i=this.DB-r,o=(1<<r)-1;t[0]=this[n]>>r;for(var a=n+1;a<this.t;++a)t[a-n-1]|=(this[a]&o)<<i,t[a-n]=this[a]>>r;r>0&&(t[this.t-n-1]|=(this.s&o)<<i),t.t=this.t-n,t.clamp()}},e.prototype.subTo=function(e,t){for(var n=0,r=0,i=Math.min(e.t,this.t);n<i;)r+=this[n]-e[n],t[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r-=e.s;n<this.t;)r+=this[n],t[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<e.t;)r-=e[n],t[n++]=r&this.DM,r>>=this.DB;r-=e.s}t.s=r<0?-1:0,r<-1?t[n++]=this.DV+r:r>0&&(t[n++]=r),t.t=n,t.clamp()},e.prototype.multiplyTo=function(t,n){var r=this.abs(),i=t.abs(),o=r.t;for(n.t=o+i.t;--o>=0;)n[o]=0;for(o=0;o<i.t;++o)n[o+r.t]=r.am(0,i[o],n,o,0,r.t);n.s=0,n.clamp(),this.s!=t.s&&e.ZERO.subTo(n,n)},e.prototype.squareTo=function(e){for(var t=this.abs(),n=e.t=2*t.t;--n>=0;)e[n]=0;for(n=0;n<t.t-1;++n){var r=t.am(n,t[n],e,2*n,0,1);(e[n+t.t]+=t.am(n+1,2*t[n],e,2*n+1,r,t.t-n-1))>=t.DV&&(e[n+t.t]-=t.DV,e[n+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(n,t[n],e,2*n,0,1)),e.s=0,e.clamp()},e.prototype.divRemTo=function(t,n,r){var i=t.abs();if(!(i.t<=0)){var o=this.abs();if(o.t<i.t)return null!=n&&n.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=zM());var a=zM(),l=this.s,s=t.s,c=this.DB-BM(i[i.t-1]);c>0?(i.lShiftTo(c,a),o.lShiftTo(c,r)):(i.copyTo(a),o.copyTo(r));var d=a.t,u=a[d-1];if(0!=u){var f=u*(1<<this.F1)+(d>1?a[d-2]>>this.F2:0),h=this.FV/f,p=(1<<this.F1)/f,C=1<<this.F2,m=r.t,g=m-d,v=null==n?zM():n;for(a.dlShiftTo(g,v),r.compareTo(v)>=0&&(r[r.t++]=1,r.subTo(v,r)),e.ONE.dlShiftTo(d,v),v.subTo(a,a);a.t<d;)a[a.t++]=0;for(;--g>=0;){var y=r[--m]==u?this.DM:Math.floor(r[m]*h+(r[m-1]+C)*p);if((r[m]+=a.am(0,y,r,g,0,d))<y)for(a.dlShiftTo(g,v),r.subTo(v,r);r[m]<--y;)r.subTo(v,r)}null!=n&&(r.drShiftTo(d,n),l!=s&&e.ZERO.subTo(n,n)),r.t=d,r.clamp(),c>0&&r.rShiftTo(c,r),l<0&&e.ZERO.subTo(r,r)}}},e.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(!(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},e.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},e.prototype.exp=function(t,n){if(t>4294967295||t<1)return e.ONE;var r=zM(),i=zM(),o=n.convert(this),a=BM(t)-1;for(o.copyTo(r);--a>=0;)if(n.sqrTo(r,i),(t&1<<a)>0)n.mulTo(i,o,r);else{var l=r;r=i,i=l}return n.revert(r)},e.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},e.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),n=Math.pow(e,t),r=RM(n),i=zM(),o=zM(),a="";for(this.divRemTo(r,i,o);i.signum()>0;)a=(n+o.intValue()).toString(e).substring(1)+a,i.divRemTo(r,i,o);return o.intValue().toString(e)+a},e.prototype.fromRadix=function(t,n){this.fromInt(0),null==n&&(n=10);for(var r=this.chunkSize(n),i=Math.pow(n,r),o=!1,a=0,l=0,s=0;s<t.length;++s){var c=jM(t,s);c<0?"-"==t.charAt(s)&&0==this.signum()&&(o=!0):(l=n*l+c,++a>=r&&(this.dMultiply(i),this.dAddOffset(l,0),a=0,l=0))}a>0&&(this.dMultiply(Math.pow(n,a)),this.dAddOffset(l,0)),o&&e.ZERO.subTo(this,this)},e.prototype.fromNumber=function(t,n,r){if("number"==typeof n)if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(e.ONE.shiftLeft(t-1),oM,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(n);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(e.ONE.shiftLeft(t-1),this);else{var i=[],o=7&t;i.length=1+(t>>3),n.nextBytes(i),o>0?i[0]&=(1<<o)-1:i[0]=0,this.fromString(i,256)}},e.prototype.bitwiseTo=function(e,t,n){var r,i,o=Math.min(e.t,this.t);for(r=0;r<o;++r)n[r]=t(this[r],e[r]);if(e.t<this.t){for(i=e.s&this.DM,r=o;r<this.t;++r)n[r]=t(this[r],i);n.t=this.t}else{for(i=this.s&this.DM,r=o;r<e.t;++r)n[r]=t(i,e[r]);n.t=e.t}n.s=t(this.s,e.s),n.clamp()},e.prototype.changeBit=function(t,n){var r=e.ONE.shiftLeft(t);return this.bitwiseTo(r,n,r),r},e.prototype.addTo=function(e,t){for(var n=0,r=0,i=Math.min(e.t,this.t);n<i;)r+=this[n]+e[n],t[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r+=e.s;n<this.t;)r+=this[n],t[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<e.t;)r+=e[n],t[n++]=r&this.DM,r>>=this.DB;r+=e.s}t.s=r<0?-1:0,r>0?t[n++]=r:r<-1&&(t[n++]=this.DV+r),t.t=n,t.clamp()},e.prototype.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},e.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},e.prototype.multiplyLowerTo=function(e,t,n){var r=Math.min(this.t+e.t,t);for(n.s=0,n.t=r;r>0;)n[--r]=0;for(var i=n.t-this.t;r<i;++r)n[r+this.t]=this.am(0,e[r],n,r,0,this.t);for(i=Math.min(e.t,t);r<i;++r)this.am(0,e[r],n,r,0,t-r);n.clamp()},e.prototype.multiplyUpperTo=function(e,t,n){--t;var r=n.t=this.t+e.t-t;for(n.s=0;--r>=0;)n[r]=0;for(r=Math.max(t-this.t,0);r<e.t;++r)n[this.t+r-t]=this.am(t-r,e[r],n,0,0,this.t+r-t);n.clamp(),n.drShiftTo(1,n)},e.prototype.modInt=function(e){if(e<=0)return 0;var t=this.DV%e,n=this.s<0?e-1:0;if(this.t>0)if(0==t)n=this[0]%e;else for(var r=this.t-1;r>=0;--r)n=(t*n+this[r])%e;return n},e.prototype.millerRabin=function(t){var n=this.subtract(e.ONE),r=n.getLowestSetBit();if(r<=0)return!1;var i=n.shiftRight(r);(t=t+1>>1)>LM.length&&(t=LM.length);for(var o=zM(),a=0;a<t;++a){o.fromInt(LM[Math.floor(Math.random()*LM.length)]);var l=o.modPow(i,this);if(0!=l.compareTo(e.ONE)&&0!=l.compareTo(n)){for(var s=1;s++<r&&0!=l.compareTo(n);)if(0==(l=l.modPowInt(2,this)).compareTo(e.ONE))return!1;if(0!=l.compareTo(n))return!1}}return!0},e.prototype.square=function(){var e=zM();return this.squareTo(e),e},e.prototype.gcda=function(e,t){var n=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(n.compareTo(r)<0){var i=n;n=r,r=i}var o=n.getLowestSetBit(),a=r.getLowestSetBit();if(a<0)t(n);else{o<a&&(a=o),a>0&&(n.rShiftTo(a,n),r.rShiftTo(a,r));var l=function(){(o=n.getLowestSetBit())>0&&n.rShiftTo(o,n),(o=r.getLowestSetBit())>0&&r.rShiftTo(o,r),n.compareTo(r)>=0?(n.subTo(r,n),n.rShiftTo(1,n)):(r.subTo(n,r),r.rShiftTo(1,r)),n.signum()>0?setTimeout(l,0):(a>0&&r.lShiftTo(a,r),setTimeout(function(){t(r)},0))};setTimeout(l,10)}},e.prototype.fromNumberAsync=function(t,n,r,i){if("number"==typeof n)if(t<2)this.fromInt(1);else{this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(e.ONE.shiftLeft(t-1),oM,this),this.isEven()&&this.dAddOffset(1,0);var o=this,a=function(){o.dAddOffset(2,0),o.bitLength()>t&&o.subTo(e.ONE.shiftLeft(t-1),o),o.isProbablePrime(n)?setTimeout(function(){i()},0):setTimeout(a,0)};setTimeout(a,0)}else{var l=[],s=7&t;l.length=1+(t>>3),n.nextBytes(l),s>0?l[0]&=(1<<s)-1:l[0]=0,this.fromString(l,256)}},e}(),SM=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}(),_M=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}(),VM=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=zM();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(HM.ZERO)>0&&this.m.subTo(t,t),t},e.prototype.revert=function(e){var t=zM();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}(),OM=function(){function e(e){this.m=e,this.r2=zM(),this.q3=zM(),HM.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=zM();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 zM(){return new HM(null)}function NM(e,t){return new HM(e,t)}var IM="undefined"!=typeof navigator;IM&&"Microsoft Internet Explorer"==navigator.appName?(HM.prototype.am=function(e,t,n,r,i,o){for(var a=32767&t,l=t>>15;--o>=0;){var s=32767&this[e],c=this[e++]>>15,d=l*s+c*a;i=((s=a*s+((32767&d)<<15)+n[r]+(1073741823&i))>>>30)+(d>>>15)+l*c+(i>>>30),n[r++]=1073741823&s}return i},EM=30):IM&&"Netscape"!=navigator.appName?(HM.prototype.am=function(e,t,n,r,i,o){for(;--o>=0;){var a=t*this[e++]+n[r]+i;i=Math.floor(a/67108864),n[r++]=67108863&a}return i},EM=26):(HM.prototype.am=function(e,t,n,r,i,o){for(var a=16383&t,l=t>>14;--o>=0;){var s=16383&this[e],c=this[e++]>>14,d=l*s+c*a;i=((s=a*s+((16383&d)<<14)+n[r]+i)>>28)+(d>>14)+l*c,n[r++]=268435455&s}return i},EM=28),HM.prototype.DB=EM,HM.prototype.DM=(1<<EM)-1,HM.prototype.DV=1<<EM;HM.prototype.FV=Math.pow(2,52),HM.prototype.F1=52-EM,HM.prototype.F2=2*EM-52;var TM,DM,ZM=[];for(TM="0".charCodeAt(0),DM=0;DM<=9;++DM)ZM[TM++]=DM;for(TM="a".charCodeAt(0),DM=10;DM<36;++DM)ZM[TM++]=DM;for(TM="A".charCodeAt(0),DM=10;DM<36;++DM)ZM[TM++]=DM;function jM(e,t){var n=ZM[e.charCodeAt(t)];return null==n?-1:n}function RM(e){var t=zM();return t.fromInt(e),t}function BM(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}HM.ZERO=RM(0),HM.ONE=RM(1);var PM=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 FM,UM,qM=null;if(null==qM){qM=[],UM=0;var WM=void 0;if("undefined"!=typeof window&&self.crypto&&self.crypto.getRandomValues){var QM=new Uint32Array(256);for(self.crypto.getRandomValues(QM),WM=0;WM<QM.length;++WM)qM[UM++]=255&QM[WM]}var GM=0,KM=function(e){if((GM=GM||0)>=256||UM>=256)self.removeEventListener?self.removeEventListener("mousemove",KM,!1):self.detachEvent&&self.detachEvent("onmousemove",KM);else try{var t=e.x+e.y;qM[UM++]=255&t,GM+=1}catch(e){}};"undefined"!=typeof window&&(self.addEventListener?self.addEventListener("mousemove",KM,!1):self.attachEvent&&self.attachEvent("onmousemove",KM))}function YM(){if(null==FM){for(FM=new PM;UM<256;){var e=Math.floor(65536*Math.random());qM[UM++]=255&e}for(FM.init(qM),UM=0;UM<qM.length;++UM)qM[UM]=0;UM=0}return FM.next()}var XM=function(){function e(){}return e.prototype.nextBytes=function(e){for(var t=0;t<e.length;++t)e[t]=YM()},e}();function JM(e){return function(e){for(var t="",n=0;n<32*e.length;n+=8)t+=String.fromCharCode(e[n>>5]>>>24-n%32&255);return t}(function(e,t){var n,r,i,o,a,l,s,c,d,u,f,h,p=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),C=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=p[0],r=p[1],i=p[2],o=p[3],a=p[4],l=p[5],s=p[6],c=p[7],u=0;u<64;u++)C[u]=u<16?e[u+d]:cA(cA(cA(lA(C[u-2]),C[u-7]),aA(C[u-15])),C[u-16]),f=cA(cA(cA(cA(c,oA(a)),nA(a,l,s)),sA[u]),C[u]),h=cA(iA(n),rA(n,r,i)),c=s,s=l,l=a,a=cA(o,f),o=i,i=r,r=n,n=cA(f,h);p[0]=cA(n,p[0]),p[1]=cA(r,p[1]),p[2]=cA(i,p[2]),p[3]=cA(o,p[3]),p[4]=cA(a,p[4]),p[5]=cA(l,p[5]),p[6]=cA(s,p[6]),p[7]=cA(c,p[7])}return p}(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 $M(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 eA(e,t){return e>>>t|e<<32-t}function tA(e,t){return e>>>t}function nA(e,t,n){return e&t^~e&n}function rA(e,t,n){return e&t^e&n^t&n}function iA(e){return eA(e,2)^eA(e,13)^eA(e,22)}function oA(e){return eA(e,6)^eA(e,11)^eA(e,25)}function aA(e){return eA(e,7)^eA(e,18)^tA(e,3)}function lA(e){return eA(e,17)^eA(e,19)^tA(e,10)}var sA=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 cA(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function dA(e,t){if(t<e.length+11)return console.error("Message too long for RSA"),null;for(var n=[],r=e.length-1;r>=0&&t>0;){var i=e.charCodeAt(r--);i<128?n[--t]=i:i>127&&i<2048?(n[--t]=63&i|128,n[--t]=i>>6|192):(n[--t]=63&i|128,n[--t]=i>>6&63|128,n[--t]=i>>12|224)}n[--t]=0;for(var o=new XM,a=[];t>2;){for(a[0]=0;0==a[0];)o.nextBytes(a);n[--t]=a[0]}return n[--t]=2,n[--t]=0,new HM(n)}function uA(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 fA(e,t){var n=JM;if(e.length+64+2>t)throw"Message too long for RSA";var r,i="";for(r=0;r<t-e.length-64-2;r+=1)i+="\0";var o=n("")+i+""+e,a=new Array(32);(new XM).nextBytes(a);var l=uA(a,o.length,n),s=[];for(r=0;r<o.length;r+=1)s[r]=o.charCodeAt(r)^l.charCodeAt(r);var c=uA(s,a.length,n),d=[0];for(r=0;r<a.length;r+=1)d[r+1]=a[r]^c.charCodeAt(r);return new HM(d.concat(s))}var hA=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=NM(e,16),this.e=parseInt(t,16)):console.error("Invalid RSA public key")},e.prototype.encrypt=function(e,t){void 0===t&&(t=dA);var n=this.n.bitLength()+7>>3,r=t(e,n);if(null==r)return null;var i=this.doPublic(r);if(null==i)return null;for(var o=i.toString(16),a=o.length,l=0;l<2*n-a;l++)o="0"+o;return o},e.prototype.setPrivate=function(e,t,n){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=NM(e,16),this.e=parseInt(t,16),this.d=NM(n,16)):console.error("Invalid RSA private key")},e.prototype.setPrivateEx=function(e,t,n,r,i,o,a,l){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=NM(e,16),this.e=parseInt(t,16),this.d=NM(n,16),this.p=NM(r,16),this.q=NM(i,16),this.dmp1=NM(o,16),this.dmq1=NM(a,16),this.coeff=NM(l,16)):console.error("Invalid RSA private key")},e.prototype.generate=function(e,t){var n=new XM,r=e>>1;this.e=parseInt(t,16);for(var i=new HM(t,16);;){for(;this.p=new HM(e-r,1,n),0!=this.p.subtract(HM.ONE).gcd(i).compareTo(HM.ONE)||!this.p.isProbablePrime(10););for(;this.q=new HM(r,1,n),0!=this.q.subtract(HM.ONE).gcd(i).compareTo(HM.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var o=this.p;this.p=this.q,this.q=o}var a=this.p.subtract(HM.ONE),l=this.q.subtract(HM.ONE),s=a.multiply(l);if(0==s.gcd(i).compareTo(HM.ONE)){this.n=this.p.multiply(this.q),this.d=i.modInverse(s),this.dmp1=this.d.mod(a),this.dmq1=this.d.mod(l),this.coeff=this.q.modInverse(this.p);break}}},e.prototype.decrypt=function(e){var t=NM(e,16),n=this.doPrivate(t);return null==n?null:function(e,t){var n=e.toByteArray(),r=0;for(;r<n.length&&0==n[r];)++r;if(n.length-r!=t-1||2!=n[r])return null;++r;for(;0!=n[r];)if(++r>=n.length)return null;var i="";for(;++r<n.length;){var o=255&n[r];o<128?i+=String.fromCharCode(o):o>191&&o<224?(i+=String.fromCharCode((31&o)<<6|63&n[r+1]),++r):(i+=String.fromCharCode((15&o)<<12|(63&n[r+1])<<6|63&n[r+2]),r+=2)}return i}(n,this.n.bitLength()+7>>3)},e.prototype.generateAsync=function(e,t,n){var r=new XM,i=e>>1;this.e=parseInt(t,16);var o=new HM(t,16),a=this,l=function(){var t=function(){if(a.p.compareTo(a.q)<=0){var e=a.p;a.p=a.q,a.q=e}var t=a.p.subtract(HM.ONE),r=a.q.subtract(HM.ONE),i=t.multiply(r);0==i.gcd(o).compareTo(HM.ONE)?(a.n=a.p.multiply(a.q),a.d=o.modInverse(i),a.dmp1=a.d.mod(t),a.dmq1=a.d.mod(r),a.coeff=a.q.modInverse(a.p),setTimeout(function(){n()},0)):setTimeout(l,0)},s=function(){a.q=zM(),a.q.fromNumberAsync(i,1,r,function(){a.q.subtract(HM.ONE).gcda(o,function(e){0==e.compareTo(HM.ONE)&&a.q.isProbablePrime(10)?setTimeout(t,0):setTimeout(s,0)})})},c=function(){a.p=zM(),a.p.fromNumberAsync(e-i,1,r,function(){a.p.subtract(HM.ONE).gcda(o,function(e){0==e.compareTo(HM.ONE)&&a.p.isProbablePrime(10)?setTimeout(s,0):setTimeout(c,0)})})};setTimeout(c,0)};setTimeout(l,0)},e.prototype.sign=function(e,t,n){var r=(pA[n]||"")+t(e).toString(),i=this.n.bitLength()/4,o=function(e,t){if(t<e.length+22)return console.error("Message too long for RSA"),null;for(var n=t-e.length-6,r="",i=0;i<n;i+=2)r+="ff";return NM("0001"+r+"00"+e,16)}(r,i);if(null==o)return null;var a=this.doPrivate(o);if(null==a)return null;for(var l=a.toString(16),s=l.length,c=0;c<i-s;c++)l="0"+l;return l},e.prototype.verify=function(e,t,n){var r=NM(t,16),i=this.doPublic(r);return null==i?null:function(e){for(var t in pA)if(pA.hasOwnProperty(t)){var n=pA[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 pA={md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",ripemd160:"3021300906052b2403020105000414"};function CA(e,t,n){if(!t||!e)throw new Error("extend failed, please check that all dependencies are included.");var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e,e.superclass=t.prototype,t.prototype.constructor==Object.prototype.constructor&&(t.prototype.constructor=t)}
|
|
29
29
|
/**
|
|
30
30
|
* @fileOverview
|
|
31
31
|
* @name asn1-1.0.js
|
|
@@ -33,7 +33,7 @@ object-assign
|
|
|
33
33
|
* @version asn1 1.0.13 (2017-Jun-02)
|
|
34
34
|
* @since jsrsasign 2.1
|
|
35
35
|
* @license <a href="https://kjur.github.io/jsrsasign/license/">MIT License</a>
|
|
36
|
-
*/var mA={};void 0!==mA.asn1&&mA.asn1||(mA.asn1={}),mA.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 HM(r,16).xor(e).add(HM.ONE).toString(16).replace(/^-/,"")}return t},this.getPEMStringFromHex=function(e,t){return hextopem(e,t)},this.newObject=function(e){var t=mA.asn1,n=t.DERBoolean,r=t.DERInteger,i=t.DERBitString,o=t.DEROctetString,a=t.DERNull,l=t.DERObjectIdentifier,s=t.DEREnumerated,c=t.DERUTF8String,d=t.DERNumericString,u=t.DERPrintableString,f=t.DERTeletexString,h=t.DERIA5String,p=t.DERUTCTime,C=t.DERGeneralizedTime,m=t.DERSequence,g=t.DERSet,v=t.DERTaggedObject,y=t.ASN1Util.newObject,w=Object.keys(e);if(1!=w.length)throw"key of param shall be only one.";var b=w[0];if(-1==":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+b+":"))throw"undefined key: "+b;if("bool"==b)return new n(e[b]);if("int"==b)return new r(e[b]);if("bitstr"==b)return new i(e[b]);if("octstr"==b)return new o(e[b]);if("null"==b)return new a(e[b]);if("oid"==b)return new l(e[b]);if("enum"==b)return new s(e[b]);if("utf8str"==b)return new c(e[b]);if("numstr"==b)return new d(e[b]);if("prnstr"==b)return new u(e[b]);if("telstr"==b)return new f(e[b]);if("ia5str"==b)return new h(e[b]);if("utctime"==b)return new p(e[b]);if("gentime"==b)return new C(e[b]);if("seq"==b){for(var E=e[b],M=[],A=0;A<E.length;A++){var x=y(E[A]);M.push(x)}return new m({array:M})}if("set"==b){for(E=e[b],M=[],A=0;A<E.length;A++){x=y(E[A]);M.push(x)}return new g({array:M})}if("tag"==b){var L=e[b];if("[object Array]"===Object.prototype.toString.call(L)&&3==L.length){var k=y(L[2]);return new v({tag:L[0],explicit:L[1],obj:k})}var H={};if(void 0!==L.explicit&&(H.explicit=L.explicit),void 0!==L.tag&&(H.tag=L.tag),void 0===L.obj)throw"obj shall be specified for 'tag'.";return H.obj=y(L.obj),new v(H)}},this.jsonToASN1HEX=function(e){return this.newObject(e).getEncodedHex()}},mA.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 o=("00000000"+parseInt(e.substring(i,i+2),16).toString(2)).slice(-8);if(r+=o.substring(1,8),"0"==o.substring(0,1))t=t+"."+new HM(r,2).toString(10),r=""}return t},mA.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 HM(e,10).toString(2),i=7-r.length%7;7==i&&(i=0);for(var o="",a=0;a<i;a++)o+="0";r=o+r;for(a=0;a<r.length-1;a+=7){var l=r.substring(a,a+7);a!=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("."),o=40*parseInt(i[0])+parseInt(i[1]);r+=t(o),i.splice(0,2);for(var a=0;a<i.length;a++)r+=n(i[a]);return r},mA.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""}},mA.asn1.DERAbstractString=function(e){mA.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))},CA(mA.asn1.DERAbstractString,mA.asn1.ASN1Object),mA.asn1.DERAbstractTime=function(e){mA.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),o=String(i.getFullYear());"utc"==t&&(o=o.substring(2,4));var a=o+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);a=a+"."+(s=s.replace(/[0]+$/,""))}}return a+"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,o){var a=new Date(Date.UTC(e,t-1,n,r,i,o,0));this.setByDate(a)},this.getFreshValueHex=function(){return this.hV}},CA(mA.asn1.DERAbstractTime,mA.asn1.ASN1Object),mA.asn1.DERAbstractStructured=function(e){mA.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)},CA(mA.asn1.DERAbstractStructured,mA.asn1.ASN1Object),mA.asn1.DERBoolean=function(){mA.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},CA(mA.asn1.DERBoolean,mA.asn1.ASN1Object),mA.asn1.DERInteger=function(e){mA.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=mA.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new HM(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))},CA(mA.asn1.DERInteger,mA.asn1.ASN1Object),mA.asn1.DERBitString=function(e){if(void 0!==e&&void 0!==e.obj){var t=mA.asn1.ASN1Util.newObject(e.obj);e.hex="00"+t.getEncodedHex()}mA.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),o=parseInt(i,2).toString(16);1==o.length&&(o="0"+o),r+=o}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))},CA(mA.asn1.DERBitString,mA.asn1.ASN1Object),mA.asn1.DEROctetString=function(e){if(void 0!==e&&void 0!==e.obj){var t=mA.asn1.ASN1Util.newObject(e.obj);e.hex=t.getEncodedHex()}mA.asn1.DEROctetString.superclass.constructor.call(this,e),this.hT="04"},CA(mA.asn1.DEROctetString,mA.asn1.DERAbstractString),mA.asn1.DERNull=function(){mA.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},CA(mA.asn1.DERNull,mA.asn1.ASN1Object),mA.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 HM(e,10).toString(2),i=7-r.length%7;7==i&&(i=0);for(var o="",a=0;a<i;a++)o+="0";r=o+r;for(a=0;a<r.length-1;a+=7){var l=r.substring(a,a+7);a!=r.length-7&&(l="1"+l),n+=t(parseInt(l,2))}return n};mA.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("."),o=40*parseInt(i[0])+parseInt(i[1]);r+=t(o),i.splice(0,2);for(var a=0;a<i.length;a++)r+=n(i[a]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=r},this.setValueName=function(e){var t=mA.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))},CA(mA.asn1.DERObjectIdentifier,mA.asn1.ASN1Object),mA.asn1.DEREnumerated=function(e){mA.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=mA.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new HM(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))},CA(mA.asn1.DEREnumerated,mA.asn1.ASN1Object),mA.asn1.DERUTF8String=function(e){mA.asn1.DERUTF8String.superclass.constructor.call(this,e),this.hT="0c"},CA(mA.asn1.DERUTF8String,mA.asn1.DERAbstractString),mA.asn1.DERNumericString=function(e){mA.asn1.DERNumericString.superclass.constructor.call(this,e),this.hT="12"},CA(mA.asn1.DERNumericString,mA.asn1.DERAbstractString),mA.asn1.DERPrintableString=function(e){mA.asn1.DERPrintableString.superclass.constructor.call(this,e),this.hT="13"},CA(mA.asn1.DERPrintableString,mA.asn1.DERAbstractString),mA.asn1.DERTeletexString=function(e){mA.asn1.DERTeletexString.superclass.constructor.call(this,e),this.hT="14"},CA(mA.asn1.DERTeletexString,mA.asn1.DERAbstractString),mA.asn1.DERIA5String=function(e){mA.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="16"},CA(mA.asn1.DERIA5String,mA.asn1.DERAbstractString),mA.asn1.DERUTCTime=function(e){mA.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))},CA(mA.asn1.DERUTCTime,mA.asn1.DERAbstractTime),mA.asn1.DERGeneralizedTime=function(e){mA.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))},CA(mA.asn1.DERGeneralizedTime,mA.asn1.DERAbstractTime),mA.asn1.DERSequence=function(e){mA.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}},CA(mA.asn1.DERSequence,mA.asn1.DERAbstractStructured),mA.asn1.DERSet=function(e){mA.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)},CA(mA.asn1.DERSet,mA.asn1.DERAbstractStructured),mA.asn1.DERTaggedObject=function(e){mA.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)))},CA(mA.asn1.DERTaggedObject,mA.asn1.ASN1Object);var gA,vA,yA=window&&window.__extends||(gA=function(e,t){return gA=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])},gA(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}gA(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),wA=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 yA(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)?CM(e):mM.unarmor(e),i=AM.decode(r);if(3===i.sub.length&&(i=i.sub[2].sub[0]),9===i.sub.length){t=i.sub[1].getHexStringValue(),this.n=NM(t,16),n=i.sub[2].getHexStringValue(),this.e=parseInt(n,16);var o=i.sub[3].getHexStringValue();this.d=NM(o,16);var a=i.sub[4].getHexStringValue();this.p=NM(a,16);var l=i.sub[5].getHexStringValue();this.q=NM(l,16);var s=i.sub[6].getHexStringValue();this.dmp1=NM(s,16);var c=i.sub[7].getHexStringValue();this.dmq1=NM(c,16);var d=i.sub[8].getHexStringValue();this.coeff=NM(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=NM(t,16),n=u.sub[1].getHexStringValue(),this.e=parseInt(n,16)}else t=i.sub[0].getHexStringValue(),this.n=NM(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 mA.asn1.DERInteger({int:0}),new mA.asn1.DERInteger({bigint:this.n}),new mA.asn1.DERInteger({int:this.e}),new mA.asn1.DERInteger({bigint:this.d}),new mA.asn1.DERInteger({bigint:this.p}),new mA.asn1.DERInteger({bigint:this.q}),new mA.asn1.DERInteger({bigint:this.dmp1}),new mA.asn1.DERInteger({bigint:this.dmq1}),new mA.asn1.DERInteger({bigint:this.coeff})]};return new mA.asn1.DERSequence(e).getEncodedHex()},t.prototype.getPrivateBaseKeyB64=function(){return fM(this.getPrivateBaseKey())},t.prototype.getPublicBaseKey=function(){var e=new mA.asn1.DERSequence({array:[new mA.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new mA.asn1.DERNull]}),t=new mA.asn1.DERSequence({array:[new mA.asn1.DERInteger({bigint:this.n}),new mA.asn1.DERInteger({int:this.e})]}),n=new mA.asn1.DERBitString({hex:"00"+t.getEncodedHex()});return new mA.asn1.DERSequence({array:[e,n]}).getEncodedHex()},t.prototype.getPublicBaseKeyB64=function(){return fM(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}(hA),bA="undefined"!=typeof process?null===(vA=process.env)||void 0===vA?void 0:vA.npm_package_version:void 0,EA=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 wA(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(hM(e))}catch(e){return!1}},e.prototype.encrypt=function(e){try{return fM(this.getKey().encrypt(e))}catch(e){return!1}},e.prototype.encryptOAEP=function(e){try{return fM(this.getKey().encrypt(e,fA))}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 fM(this.getKey().sign(e,t,n))}catch(e){return!1}},e.prototype.signSha256=function(e){return this.sign(e,function(e){return $M(JM(e))},"sha256")},e.prototype.verify=function(e,t,n){void 0===n&&(n=function(e){return e});try{return this.getKey().verify(e,hM(t),n)}catch(e){return!1}},e.prototype.verifySha256=function(e,t){return this.verify(e,t,function(e){return $M(JM(e))})},e.prototype.getKey=function(e){if(!this.key){if(this.key=new wA,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=bA,e}();async function MA(e,t,n="https"){if("http"===n){const n=new EA;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),o=await crypto.subtle.encrypt({name:"RSA-OAEP"},r,i);return btoa(String.fromCharCode(...new Uint8Array(o)))}}const AA=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}},xA=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}},LA=({data:r,isYaxisSticky:i=!1,barWidth:o,height:s,barGap:d=20,colors:u=[],xAxisLabel:f,isTruncateText:h=!0,yAxisLabel:p,padding:C=20,yAxisDivisions:m=5,barBorderRadius:g=0,legend:v=!0,showXAxisLabels:y=!0,icons:w=[],iconSize:b,legendPosition:E="bottom",legendGap:M=5,extendBarChartRightWidth:A=0,isYAxisValuePercentage:x=!1,selectedBar:L,setSelectedBar:k,onSelectedBar:H=e=>{},totalLabel:S="Total Execution",customToolTip:_=!1,isOnclick:V=!1,isDashboardVersions:O,type:z="",isMemory:N,tooltipWidth:I="fit-content"})=>{const T=a(null),[D,Z]=c(null),[j,R]=c(!1);l(()=>{const e=()=>{const e=T.current;e&&j&&(e.style.display="none")};return window.addEventListener("scroll",e,!0),()=>window.removeEventListener("scroll",e,!0)},[j]);const B=(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),U=r.map(e=>{if("string"==typeof e.value){let t=0;if("memory"===z)t=xA(e.value);else if(N)switch(B){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=xA(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 q=0;"memory"===z&&(q=r.reduce((e,t)=>"string"==typeof t.value?e+AA(t.value):e+1024*Number(t.value)*1024*1024,0));const W=q/1048576,Q=W<1024?`${Math.round(W)} mb`:`${(W/1024).toFixed(1)} gb`;let G=Math.max(...U.map(e=>e.normalizedValue));G="memory"===z?Math.max(G,1):Math.max(G,m);const K=40,Y=40,X=U.length*o+(U.length-1)*d+(i?Y:90)+A,J=Date.now(),$=t=>t.filter(e=>e.length>1).map((t,n)=>e("defs",{children:e("linearGradient",{id:`gradient-${J}-${z}-${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}-${z}-${e%u.length})`},te=(e,t,n,r,i)=>{R(!0);const o=T.current;if(o)if(o.style.display="block",_)o.innerHTML=`<div>\n <div><Typography fontWeight='semi-bold'>${e}</Typography></div>\n <div><Typography>${n||""}</Typography></div>\n <div><Typography>${S} : ${t} ${r?"("+r+"%)":""}</Typography></div>\n </div>`;else if(O){const e=i?i.join(", "):"";o.innerHTML=`\n <div>\n <div><Typography>${S} : ${t}</Typography></div>\n ${e?`<div><Typography>Versions : ${e}</Typography></div>`:""}\n </div>`}else o.innerHTML="memory"===z?`<strong>${e}</strong>: ${t} / ${Q}`:`<strong>${e}</strong>: ${t} ${x?"%":""}`},ne=(e,t=!1)=>{const n=T.current;if(n){const r=n.parentElement?.getBoundingClientRect(),i=window.scrollX,o=window.scrollY,a=1===U?.length||!t?e.clientX-(r?.left||0)+i+10:e.clientX-(r?.left||0)+i-n?.offsetWidth-10,l=e.clientY-(r?.top||0)+o-20;n.style.left=`${a}px`,n.style.top=`${l}px`}},re=()=>{R(!1);const e=T.current;e&&(e.style.display="none")},oe=e=>{k&&(k(e),V&&H(e))},ae=e=>{if(h){if(ie(e,10).endsWith("...")){const t=T.current;t&&(t.style.display="block",t.innerHTML=e)}}},le=(e,t,n)=>{if(h){ie(t,10).endsWith("...")&&ne(e,n===U.length-1)}};return n("div",{className:"ff-bar-chart-container",children:[e("div",{ref:T,className:"ff-bar-chart-tooltip",style:{width:I}}),v&&"top"===E&&e("div",{className:"ff-legend-container",children:e("div",{className:"ff-bar-chart-legend",style:{gap:`${M}px`},children:U.map((t,r)=>n("div",{className:"ff-bar-chart-legend-item",onMouseEnter:()=>Z(r),onMouseLeave:()=>Z(null),children:[w[r]&&"string"==typeof w[r]?e(P,{name:String(w[r]),width:b,height:b}):e("span",{className:"ff-bar-chart-legend-item-circle",style:{backgroundColor:u[r%u.length]?.[0]||"grey"}}),e(F,{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+K+(f?20:0),children:n(t,{children:[Array.from({length:m+1}).map((t,n)=>{const r=s-n/m*s+K+4,i=n*G/m,o="memory"===z?i.toFixed(1):x?`${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:o},n)}),p&&e("text",{x:-(s/2+35),y:i?20:10,transform:"rotate(-90)",fill:"black",textAnchor:"middle",alignmentBaseline:"middle",className:"ff-bar-chart-labels",children:p})]})})}),e("div",{className:"ff-chart-scrollable",children:n("svg",{width:X,height:s+K+5+(y?20:0)+(f?20:0),children:[Array.isArray(u)&&u.length>0&&$(u),U.map((t,r)=>{const i=t.normalizedValue/G*s,a=t.normalizedValue<1?2:i,l=r*(o+d)+C,c=s-a+K,u=b||20,f=l+o/2-u/2,p=c-u,m=L===t.label,v=D===r;return n("g",{children:[w[r]&&"string"==typeof w[r]&&e("g",{onMouseEnter:()=>te(t.label,"memory"===z?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ne(e,r===U.length-1),onMouseLeave:re,children:e(P,{name:String(w[r]),x:String(f),y:String(p),width:u,height:u,chartIcon:!0})}),e("rect",{x:l,y:c,width:o,height:a,fill:ee(r),rx:g,ry:g,style:{strokeWidth:m?3:0,opacity:null===D||v?1:.3,cursor:V?"pointer":"default",transition:"opacity 0.5s ease"},onMouseEnter:()=>te(t.label,"memory"===z||N?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ne(e,r===U.length-1),onMouseLeave:re,onClick:()=>oe(t.label)}),m&&V&&e("rect",{x:l,y:c,width:o,height:a,fill:"var(--select-chart-highlight-color)",rx:g,ry:g,onMouseEnter:()=>te(t.label,"memory"===z?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ne(e,r===U.length-1),onMouseLeave:re}),y&&e("text",{onMouseEnter:()=>ae(t.label),onMouseMove:e=>le(e,t.label,r),onMouseLeave:re,x:0===r?l:r===U.length-1?l+o:l+o/2,y:s+K+15,className:"ff-bar-chart-labels",fill:m?"var(--brand-color)":"black",fontWeight:m?"bold":"normal",textAnchor:0===r?"start":"middle",children:h?ie(t.label,10):t.label})]},r)}),e("line",{x1:i?0:C,y1:s+K,x2:X,y2:s+K,stroke:"#D9D9D9",strokeWidth:"1"}),!i&&f&&e("text",{x:X/2,y:s+K+(y?40:20),fontSize:"12",fill:"black",textAnchor:"middle",className:"ff-bar-chart-labels",children:f})]})}),e("div",{className:"ff-bar-chart-x-axis-label",children:f})]}):e("div",{children:n("svg",{width:X,height:s+K+5+(y?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+K+4,i=n*G/m,o="memory"===z?i.toFixed(1):x?`${i.toFixed(0).padStart(2,"0")}%`:i.toFixed(0).padStart(2,"0");return e("text",{x:Y,y:r,fill:"black",textAnchor:"middle",className:"ff-bar-chart-labels",children:o},n)}),U.map((t,r)=>{const i=t.normalizedValue/G*s,a=t.normalizedValue<1?2:i,l=r*(o+d)+Y+C,c=s-a+K,u=b||20,f=l+o/2-u/2,p=c-u,m=L===t.label,v=D===r;return n("g",{children:[w[r]&&"string"==typeof w[r]&&e("g",{onMouseEnter:()=>te(t.label,"memory"===z?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ne(e,r===U.length-1),onMouseLeave:re,children:e(P,{name:String(w[r]),x:String(f),y:String(p),width:u,height:u,chartIcon:!0})}),e("rect",{x:l,y:c,width:o,height:a,fill:ee(r),rx:g,ry:g,style:{strokeWidth:m?3:0,opacity:null===D||v?1:.3,cursor:V?"pointer":"default",transition:"opacity 0.5s ease"},onMouseEnter:()=>te(t.label,"memory"===z||N?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ne(e,r===U.length-1),onMouseLeave:re,onClick:()=>oe(t.label)}),m&&V&&e("rect",{x:l,y:c,width:o,height:a,fill:"var(--select-chart-highlight-color)",rx:g,ry:g,onMouseEnter:()=>te(t.label,"memory"===z?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ne(e,r===U.length-1),onMouseLeave:re}),y&&e("g",{children:e("text",{x:0===r?l:r===U.length-1?l+o:l+o/2,y:s+K+15,className:"ff-bar-chart-labels",fill:m?"var(--brand-color)":"black",fontWeight:m?"bold":"normal",textAnchor:0===r?"start":"middle",onMouseEnter:()=>ae(t.label),onMouseMove:e=>le(e,t.label,r),onMouseLeave:re,children:h?ie(t.label,10):t.label})})]},r)}),e("line",{x1:60,y1:s+K,x2:X,y2:s+K,stroke:"#D9D9D9",strokeWidth:"1"}),f&&e("text",{x:X/2,y:s+K+(y?40:20),fontSize:"12",fill:"black",textAnchor:"middle",className:"ff-bar-chart-labels",children:f}),p&&e("text",{x:-(s/2+35),y:10,transform:"rotate(-90)",fill:"black",textAnchor:"middle",alignmentBaseline:"middle",className:"ff-bar-chart-labels",children:p})]})}),v&&"bottom"===E&&e("div",{className:"ff-legend-container",children:e("div",{className:"ff-bar-chart-legend",style:{gap:`${M}px`},children:r.map((t,r)=>n("div",{className:"ff-bar-chart-legend-item",onMouseEnter:()=>Z(r),onMouseLeave:()=>Z(null),children:[w[r]&&"string"==typeof w[r]?e(P,{name:String(w[r]),width:b,height:b}):e("span",{className:"ff-bar-chart-legend-item-circle",style:{backgroundColor:u[r%u.length]?.[0]||"grey"}}),e("div",{children:e(F,{as:"div",fontSize:10,fontWeight:"regular",className:"ff-legend-label",children:t.label})})]},t.label))})})]})},kA=(e,t,n,r,i)=>{const o=e+n*Math.cos(r),a=t+n*Math.sin(r),l=e+n*Math.cos(i),s=t+n*Math.sin(i);return`M ${o} ${a} A ${n} ${n} 0 ${i-r>Math.PI?1:0} 1 ${l} ${s}`},HA=({radius:r,lineWidth:i,lineCap:o,barValues:a,labelHeading:l,legendType:s="numberLegend",isLegendDetails:d=!0,isPillValueVisible:u=!0,chartToLegendGap:f="16px",legendGap:h="8px",labelFontSize:p=12,subLabelFontSize:C=8,gapBetweenArch:m=10,capsuleStyle:g={padding:"4px"}})=>{const[v,y]=c({visible:!1,x:0,y:0,content:"",isArc:!1}),[w,b]=c(null),E=(e,t)=>Array.isArray(e.arcColor)?`url(#gradient-${t})`:e.arcColor,M=e=>Array.isArray(e.arcColor)?e.arcColor[0]:e.arcColor,A=a.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)}}),x=A.reduce((e,t)=>e+t.normalizedValue,0),L=r,k=i+m,H=2*(L+k*(A.length-1)+i),S=[...A].reverse(),_=l.trim().split(" "),V=(e,t,n)=>{const{clientX:r,clientY:i}=e;y({visible:!0,x:r,y:i,content:t,isArc:n})},O=e=>{const{clientX:t,clientY:n}=e;y(e=>({...e,x:t,y:n}))},z=()=>{y({visible:!1,x:0,y:0,content:"",isArc:!1})};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:H,height:H},children:n("svg",{width:H,height:H,viewBox:`0 0 ${H} ${H}`,className:"absolute top-0 left-0",children:[e("defs",{children:a.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(${H/2+1}, ${H/2+1})`,children:[S.map((t,r)=>{const a=A.length-1-r,l=2*(t.normalizedValue/x)*Math.PI;let s=-Math.PI/2,c=s+l;t.normalizedValue===x&&(s=0,c=2*Math.PI);const d=L+k*a,u=kA(0,0,d,0,2*Math.PI),f={opacity:null!==w?t.barLabel===w?1:.2:1,transition:"opacity 0.3s ease"};if(0===t.normalizedValue){const r=d*Math.cos(-Math.PI/2),o=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:o,r:i+1,fill:E({...t,label:t.barLabel||"",key:t.labelValue?.toString()||""},a),onMouseEnter:e=>V(e,`${t.barLabel||"Data"}: ${t.value}`,!0),onMouseMove:O,onMouseLeave:z,style:f})]},a)}const h=kA(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()||""},a),strokeWidth:i,strokeLinecap:"square"===o?"butt":"round",onMouseEnter:e=>V(e,`${t.barLabel||"Data"}: ${t.value}`,!0),onMouseMove:O,onMouseLeave:z,style:{pointerEvents:"stroke",...f}})]},a)}),e("text",{x:"0",y:`-${i+m+2}`,fill:(()=>{if(!v.visible)return"";const e=v.content.split(":")[0]?.trim();if(void 0===e)return"";const t=A.find(t=>t.barLabel===e);if(!t)return"";const n={...t,label:t.barLabel,key:t.labelValue?.toString()??""};return M(n)})(),textAnchor:"middle",dominantBaseline:"central",children:v.visible?n(t,{children:[e("tspan",{x:"0",dy:"0",className:"ff-center-text-tooltip",children:(N=v.content.split(":")[1]?.trim()||"",I=9,N.length>I?N.slice(0,I)+"...":N)}),v.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:_.map((t,r)=>{if(0===r){const[i,...o]=t.split(" ");return n("tspan",{children:[e("tspan",{x:"0",dy:"0",style:{fontSize:`${p}px`},className:"ff-center-first-text",children:i}),e("tspan",{x:"0",dy:18,style:{fontSize:`${C}px`},className:"ff-center-text",children:o.join(" ")})]},r)}return e("tspan",{x:"0",dy:0===r?0:18,className:"ff-center-text",style:{fontSize:`${C}px`},children:t},r)})})})]})]})}),v.visible&&e("div",{className:"ff-multi-radial-tooltip",style:{position:"fixed",top:`${v.y+10}px`,left:`${v.x+15}px`,zIndex:1e3,pointerEvents:"none"},children:v.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=>{b(t.barLabel||t.label),V(e,`${t.barLabel||"Data"}: ${t.value}`,!1)},onMouseMove:O,onMouseLeave:()=>{b(null),z()},children:[e(F,{fontSize:20,fontWeight:"semi-bold",className:"ff-legend-value",color:M(t),children:t.key.padStart(2,"0")}),e(F,{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=>{b(t.barLabel||t.label),V(e,`${t.barLabel||"Data"}: ${t.value}`,!1)},onMouseMove:O,onMouseLeave:()=>{b(null),z()},children:[e("span",{className:"ff-legend-capsule",style:{backgroundColor:M(t)},children:e(F,{fontSize:10,color:"var(--tooltip-text-color)",style:g,children:u&&t.value})}),e(F,{className:"ff-legend-key",children:t.label})]},r))});default:return null}})(A.map(e=>({...e,label:e?.barLabel,key:e.labelValue?.toString()})),s)]});var N,I};function SA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function _A(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function OA(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?VA(Object(n),!0).forEach(function(t){_A(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VA(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function zA(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function IA(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?NA(Object(n),!0).forEach(function(t){zA(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NA(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function TA(e){return function t(){for(var n=this,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return i.length>=e.length?e.apply(this,i):function(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];return t.apply(n,[].concat(i,r))}}}function DA(e){return{}.toString.call(e).includes("Object")}function ZA(e){return"function"==typeof e}var jA=TA(function(e,t){throw new Error(e[t]||e.default)})({initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"}),RA={changes:function(e,t){return DA(t)||jA("changeType"),Object.keys(t).some(function(t){return n=e,r=t,!Object.prototype.hasOwnProperty.call(n,r);var n,r})&&jA("changeField"),t},selector:function(e){ZA(e)||jA("selectorType")},handler:function(e){ZA(e)||DA(e)||jA("handlerType"),DA(e)&&Object.values(e).some(function(e){return!ZA(e)})&&jA("handlersType")},initial:function(e){var t;e||jA("initialIsRequired"),DA(e)||jA("initialType"),t=e,Object.keys(t).length||jA("initialContent")}};function BA(e,t){return ZA(t)?t(e.current):t}function PA(e,t){return e.current=IA(IA({},e.current),t),t}function FA(e,t,n){return ZA(t)?t(e.current):Object.keys(n).forEach(function(n){var r;return null===(r=t[n])||void 0===r?void 0:r.call(t,e.current[n])}),n}var UA={create:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};RA.initial(e),RA.handler(t);var n={current:e},r=TA(FA)(n,t),i=TA(PA)(n),o=TA(RA.changes)(e),a=TA(BA)(n);return[function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(e){return e};return RA.selector(e),e(n.current)},function(e){!function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}}(r,i,o,a)(e)}]}};var qA={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:"Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n "},WA=function(e){return function t(){for(var n=this,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return i.length>=e.length?e.apply(this,i):function(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];return t.apply(n,[].concat(i,r))}}}(function(e,t){throw new Error(e[t]||e.default)})(qA),QA={config:function(e){var t;return e||WA("configIsRequired"),t=e,{}.toString.call(t).includes("Object")||WA("configType"),e.urls?(console.warn(qA.deprecation),{paths:{vs:e.urls.monacoBase}}):e}};function GA(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],GA(e[n],t[n]))}),OA(OA({},e),t)}var KA={type:"cancelation",msg:"operation is manually canceled"};function YA(e){var t=!1,n=new Promise(function(n,r){e.then(function(e){return t?r(KA):n(e)}),e.catch(r)});return n.cancel=function(){return t=!0},n}var XA,JA,$A=["monaco"],ex=UA.create({config:{paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}},isInitialized:!1,resolve:null,reject:null,monaco:null}),tx=(JA=2,function(e){if(Array.isArray(e))return e}(XA=ex)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,l=[],s=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t);else for(;!(s=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,i=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return l}}(XA,JA)||function(e,t){if(e){if("string"==typeof e)return SA(e,t);var n={}.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)?SA(e,t):void 0}}(XA,JA)||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.")}()),nx=tx[0],rx=tx[1];function ix(e){return document.body.appendChild(e)}function ox(e){var t=nx(function(e){return{config:e.config,reject:e.reject}}),n=function(e){var t=document.createElement("script");return e&&(t.src=e),t}("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function ax(){var e=nx(function(e){return{config:e.config,resolve:e.resolve,reject:e.reject}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(t){var n=t.m||t;lx(n),e.resolve(n)},function(t){e.reject(t)})}function lx(e){nx().monaco||rx({monaco:e})}var sx=new Promise(function(e,t){return rx({resolve:e,reject:t})}),cx={config:function(e){var t=QA.config(e),n=t.monaco,r=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(t,$A);rx(function(e){return{config:GA(e.config,r),monaco:n}})},init:function(){var e=nx(function(e){return{monaco:e.monaco,isInitialized:e.isInitialized,resolve:e.resolve}});if(!e.isInitialized){if(rx({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),YA(sx);if(window.monaco&&window.monaco.editor)return lx(window.monaco),e.resolve(window.monaco),YA(sx);!function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}}(ix,ox)(ax)}return YA(sx)},__getMonacoInstance:function(){return nx(function(e){return e.monaco})}},dx={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},ux={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}};var fx=function({children:e}){return i.createElement("div",{style:ux.container},e)},hx=fx;var px=function({width:e,height:t,isEditorReady:n,loading:r,_ref:o,className:a,wrapperProps:l}){return i.createElement("section",{style:{...dx.wrapper,width:e,height:t},...l},!n&&i.createElement(hx,null,r),i.createElement("div",{ref:o,style:{...dx.fullWidth,...!n&&dx.hide},className:a}))},Cx=g(px);var mx=function(e){l(e,[])};var gx=function(e,t,n=!0){let r=a(!0);l(r.current||!n?()=>{r.current=!1}:e,t)};function vx(){}function yx(e,t,n,r){return function(e,t){return e.editor.getModel(wx(e,t))}(e,r)||function(e,t,n,r){return e.editor.createModel(t,n,r?wx(e,r):void 0)}(e,t,n,r)}function wx(e,t){return e.Uri.parse(t)}var bx=function({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:o,originalModelPath:s,modifiedModelPath:d,keepCurrentOriginalModel:u=!1,keepCurrentModifiedModel:f=!1,theme:h="light",loading:C="Loading...",options:m={},height:g="100%",width:v="100%",className:y,wrapperProps:w={},beforeMount:b=vx,onMount:E=vx}){let[M,A]=c(!1),[x,L]=c(!0),k=a(null),H=a(null),S=a(null),_=a(E),V=a(b),O=a(!1);mx(()=>{let e=cx.init();return e.then(e=>(H.current=e)&&L(!1)).catch(e=>"cancelation"!==e?.type&&console.error("Monaco initialization: error:",e)),()=>k.current?function(){let e=k.current?.getModel();u||e?.original?.dispose(),f||e?.modified?.dispose(),k.current?.dispose()}():e.cancel()}),gx(()=>{if(k.current&&H.current){let t=k.current.getOriginalEditor(),i=yx(H.current,e||"",r||n||"text",s||"");i!==t.getModel()&&t.setModel(i)}},[s],M),gx(()=>{if(k.current&&H.current){let e=k.current.getModifiedEditor(),r=yx(H.current,t||"",o||n||"text",d||"");r!==e.getModel()&&e.setModel(r)}},[d],M),gx(()=>{let e=k.current.getModifiedEditor();e.getOption(H.current.editor.EditorOption.readOnly)?e.setValue(t||""):t!==e.getValue()&&(e.executeEdits("",[{range:e.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),e.pushUndoStop())},[t],M),gx(()=>{k.current?.getModel()?.original.setValue(e||"")},[e],M),gx(()=>{let{original:e,modified:t}=k.current.getModel();H.current.editor.setModelLanguage(e,r||n||"text"),H.current.editor.setModelLanguage(t,o||n||"text")},[n,r,o],M),gx(()=>{H.current?.editor.setTheme(h)},[h],M),gx(()=>{k.current?.updateOptions(m)},[m],M);let z=p(()=>{if(!H.current)return;V.current(H.current);let i=yx(H.current,e||"",r||n||"text",s||""),a=yx(H.current,t||"",o||n||"text",d||"");k.current?.setModel({original:i,modified:a})},[n,t,o,e,r,s,d]),N=p(()=>{!O.current&&S.current&&(k.current=H.current.editor.createDiffEditor(S.current,{automaticLayout:!0,...m}),z(),H.current?.editor.setTheme(h),A(!0),O.current=!0)},[m,h,z]);return l(()=>{M&&_.current(k.current,H.current)},[M]),l(()=>{!x&&!M&&N()},[x,M,N]),i.createElement(Cx,{width:v,height:g,isEditorReady:M,loading:C,_ref:S,className:y,wrapperProps:w})};g(bx);var Ex=function(e){let t=a();return l(()=>{t.current=e},[e]),t.current},Mx=new Map;var Ax,xx=function({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:o,path:s,theme:d="light",line:u,loading:f="Loading...",options:h={},overrideServices:C={},saveViewState:m=!0,keepCurrentModel:g=!1,width:v="100%",height:y="100%",className:w,wrapperProps:b={},beforeMount:E=vx,onMount:M=vx,onChange:A,onValidate:x=vx}){let[L,k]=c(!1),[H,S]=c(!0),_=a(null),V=a(null),O=a(null),z=a(M),N=a(E),I=a(),T=a(r),D=Ex(s),Z=a(!1),j=a(!1);mx(()=>{let e=cx.init();return e.then(e=>(_.current=e)&&S(!1)).catch(e=>"cancelation"!==e?.type&&console.error("Monaco initialization: error:",e)),()=>V.current?(I.current?.dispose(),g?m&&Mx.set(s,V.current.saveViewState()):V.current.getModel()?.dispose(),void V.current.dispose()):e.cancel()}),gx(()=>{let i=yx(_.current,e||r||"",t||o||"",s||n||"");i!==V.current?.getModel()&&(m&&Mx.set(D,V.current?.saveViewState()),V.current?.setModel(i),m&&V.current?.restoreViewState(Mx.get(s)))},[s],L),gx(()=>{V.current?.updateOptions(h)},[h],L),gx(()=>{!V.current||void 0===r||(V.current.getOption(_.current.editor.EditorOption.readOnly)?V.current.setValue(r):r!==V.current.getValue()&&(j.current=!0,V.current.executeEdits("",[{range:V.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),V.current.pushUndoStop(),j.current=!1))},[r],L),gx(()=>{let e=V.current?.getModel();e&&o&&_.current?.editor.setModelLanguage(e,o)},[o],L),gx(()=>{void 0!==u&&V.current?.revealLine(u)},[u],L),gx(()=>{_.current?.editor.setTheme(d)},[d],L);let R=p(()=>{if(O.current&&_.current&&!Z.current){N.current(_.current);let i=s||n,a=yx(_.current,r||e||"",t||o||"",i||"");V.current=_.current?.editor.create(O.current,{model:a,automaticLayout:!0,...h},C),m&&V.current.restoreViewState(Mx.get(i)),_.current.editor.setTheme(d),void 0!==u&&V.current.revealLine(u),k(!0),Z.current=!0}},[e,t,n,r,o,s,h,C,m,d,u]);return l(()=>{L&&z.current(V.current,_.current)},[L]),l(()=>{!H&&!L&&R()},[H,L,R]),T.current=r,l(()=>{L&&A&&(I.current?.dispose(),I.current=V.current?.onDidChangeModelContent(e=>{j.current||A(V.current.getValue(),e)}))},[L,A]),l(()=>{if(L){let e=_.current.editor.onDidChangeMarkers(e=>{let t=V.current.getModel()?.uri;if(t&&e.find(e=>e.path===t.path)){let e=_.current.editor.getModelMarkers({resource:t});x?.(e)}});return()=>{e?.dispose()}}return()=>{}},[L,x]),i.createElement(Cx,{width:v,height:y,isEditorReady:L,loading:f,_ref:O,className:w,wrapperProps:b})},Lx=g(xx),kx={exports:{}},Hx={},Sx={exports:{}},_x={},Vx={};function Ox(){if(Ax)return Vx;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 Ax=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--}},Vx.Output=n,Vx}var zx,Nx={};function Ix(){if(zx)return Nx;return zx=1,Nx.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},Nx}var Tx,Dx={};function Zx(){return Tx||(Tx=1,o="(?:"+(i="\\\\u[0-9a-fA-F]{4}|\\\\u\\{[0-9a-fA-F]+\\}")+"|[\\x23\\x24\\x40\\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")+"])",a="(?:"+i+"|["+(t="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a")+n+(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")+"])*",(e=Dx).identifier=new RegExp(o+a,"g"),e.identifierStart=new RegExp(o),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")),Dx;var e,t,n,r,i,o,a}var jx,Rx,Bx={},Px={};function Fx(){if(jx)return Px;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 jx=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)})},Px.Options=e,Px.normalizeOpts=n,Px.mergeOpts=t,Px}function Ux(){if(Rx)return Bx;Rx=1;var e=Fx().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 o=0;o<i.length;o++)"preserve-inline"===i[o]?this.brace_preserve_inline=!0:this.brace_style=i[o];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,Bx.Options=n,Bx}var qx,Wx={},Qx={};function Gx(){if(qx)return Qx;qx=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},Qx.InputScanner=t,Qx}var Kx,Yx={},Xx={};var Jx,$x,eL,tL={},nL={};function rL(){if(Jx)return nL;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 Jx=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(){},nL.Pattern=e,nL}function iL(){if(eL)return Yx;eL=1;var e=Gx().InputScanner,t=Ix().Token,n=function(){if(Kx)return Xx;function e(e){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=e}return Kx=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},Xx.TokenStream=e,Xx}().TokenStream,r=function(){if($x)return tL;$x=1;var e=rL().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},tL.WhitespacePattern=t,tL}().WhitespacePattern,i={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},o=function(t,n){this._input=new e(t),this._options=n||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new r(this._input)};return o.prototype.tokenize=function(){var e;this._input.restart(),this.__tokens=new n,this._reset();for(var r=new t(i.START,""),o=null,a=[],l=new n;r.type!==i.EOF;){for(e=this._get_next_token(r,o);this._is_comment(e);)l.add(e),e=this._get_next_token(r,o);l.isEmpty()||(e.comments_before=l,l=new n),e.parent=o,this._is_opening(e)?(a.push(o),o=e):o&&this._is_closing(e,o)&&(e.opened=o,o.closed=e,o=a.pop(),e.parent=o),e.previous=r,r.next=e,this.__tokens.add(e),r=e}return this.__tokens},o.prototype._is_first_token=function(){return this.__tokens.isEmpty()},o.prototype._reset=function(){},o.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,"")},o.prototype._is_comment=function(e){return!1},o.prototype._is_opening=function(e){return!1},o.prototype._is_closing=function(e,t){return!1},o.prototype._create_token=function(e,n){return new t(e,n,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token)},o.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},Yx.Tokenizer=o,Yx.TOKEN=i,Yx}var oL,aL={};function lL(){if(oL)return aL;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 oL=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)},aL.Directives=e,aL}var sL,cL,dL,uL,fL={};function hL(){if(sL)return fL;sL=1;var e=rL().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},fL.TemplatablePattern=n,fL}function pL(){if(cL)return Wx;cL=1;var e=Gx().InputScanner,t=iL().Tokenizer,n=iL().TOKEN,r=lL().Directives,i=Zx(),o=rL().Pattern,a=hL().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(" "),p=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";p=(p="\\?\\.(?!\\d) "+(p=p.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"))).replace(/ /g,"|");var C,m=new RegExp(p),g="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),v=g.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),y=new RegExp("^(?:"+v.join("|")+")$"),w=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 o(this._input),l=new a(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(w.prototype=new t)._is_comment=function(e){return e.type===s.COMMENT||e.type===s.BLOCK_COMMENT||e.type===s.UNKNOWN},w.prototype._is_opening=function(e){return e.type===s.START_BLOCK||e.type===s.START_EXPR},w.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)},w.prototype._reset=function(){C=!1},w.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())},w.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)&&y.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},w.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},w.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},w.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)},w.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 C=!0,this._create_token(s.COMMENT,t)}}else if(C&&"-"===e&&(t=this.__patterns.html_comment_end.read()))return C=!1,this._create_token(s.COMMENT,t);return null},w.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},w.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),o=null;for(;i.hasNext();)if((o=i.match(/([\s]|[^\\]|\\\\)+/g))&&(n+=o[0]),"\\"===i.peek()){if(i.next(),"x"===i.peek())o=i.match(/x([0-9A-Fa-f]{2})/g);else{if("u"!==i.peek()){n+="\\",i.hasNext()&&(n+=i.next());continue}(o=i.match(/u([0-9A-Fa-f]{4})/g))||(o=i.match(/u\{([0-9A-Fa-f]+)\}/g))}if(!o)return t;if((r=parseInt(o[1],16))>126&&r<=255&&0===o[0].indexOf("x"))return t;n+=r>=0&&r<32||r>1114111?"\\"+o[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},w.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])},w.prototype._read_regexp=function(e,t){if("/"===e&&this._allow_regexp_or_xml(t)){for(var n=this._input.next(),r=!1,o=!1;this._input.hasNext()&&(r||o||this._input.peek()!==e)&&!this._input.testChar(i.newline);)n+=this._input.peek(),r?r=!1:(r="\\"===this._input.peek(),"["===this._input.peek()?o=!0:"]"===this._input.peek()&&(o=!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},w.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 o=r[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),a=0===o.indexOf("{"),l=0;r;){var c=!!r[1],d=r[2];if(!(!!r[r.length-1]||"![CDATA["===d.slice(0,8))&&(d===o||a&&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},w.prototype._read_string_recursive=function(e,t,n){var r,o;"'"===e?o=this.__patterns.single_quote:'"'===e?o=this.__patterns.double_quote:"`"===e?o=this.__patterns.template_text:"}"===e&&(o=this.__patterns.template_expression);for(var a=o.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()))),a+=l+=o.read()}return a},Wx.Tokenizer=w,Wx.TOKEN=s,Wx.positionable_operators=h.slice(),Wx.line_starters=g.slice(),Wx}function CL(){if(dL)return _x;dL=1;var e=Ox().Output,t=Ix().Token,n=Zx(),r=Ux().Options,i=pL().Tokenizer,o=pL().line_starters,a=pL().positionable_operators,l=pL().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"]),p=[h.before_newline,h.preserve_newline],C="BlockStatement",m="Statement",g="ObjectLiteral",v="ArrayLiteral",y="ForInitializer",w="Conditional",b="Expression";function E(e,t){t.multiline_frame||t.mode===y||t.mode===w||e.remove_indent(t.start_line_index)}function M(e){return e===v}function A(e){return s(e,[b,y,w])}function x(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)}x.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}},x.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(C);var r=new i(t,this._options);return this._tokens=r.tokenize(),t},x.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)},x.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))},x.prototype.handle_whitespace_and_comments=function(e,t){var n=e.newlines,r=this._options.keep_array_indentation&&M(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 o=0;o<n;o+=1)this.print_newline(o>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 a=1;a<n;a+=1)this.print_newline(!0,t)}};var L=["async","break","continue","return","throw","yield"];return x.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,a)||s(e.text,a)){var r=s(this._flags.last_token.text,a)&&s(this._options.operator_position,p)||s(e.text,a);n=n&&r}if(n)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(u(this._flags.last_token,L))return;this._output.set_wrap_point()}}},x.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)},x.prototype.print_token_line_indentation=function(e){this._output.just_added_newline()&&(this._options.keep_array_indentation&&e.newlines&&("["===e.text||M(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))},x.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)}},x.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},x.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))},x.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)},x.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))},x.prototype.start_of_object_property=function(){return this._flags.parent.mode===g&&this._flags.mode===m&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||u(this._flags.last_token,["get","set"]))},x.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===g&&this._flags.mode===m)&&u(this._flags.last_token,L)&&!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===y||this._previous_flags.mode===w))||this._flags.last_token.type===l.WORD&&this._flags.mode===C&&!this._flags.in_case&&!("--"===e.text||"++"===e.text)&&"function"!==this._last_last_text&&e.type!==l.WORD&&e.type!==l.RESERVED)||this._flags.mode===g&&(":"===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)},x.prototype.handle_start_expr=function(e){this.start_of_statement(e)||this.handle_whitespace_and_comments(e);var t=b;if("["===e.text){if(this._flags.last_token.type===l.WORD||")"===this._flags.last_token.text)return u(this._flags.last_token,o)&&(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=v,M(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=y):s(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,t=w):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,o)||"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===g?"{"!==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===g&&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()},x.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&&M(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===w&&(this._previous_flags.mode=b,this._flags.do_block=!1,this._flags.do_while=!1)},x.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(C),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(C):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(C):this.set_mode(g):this._flags.last_token.type===l.OPERATOR&&"=>"===this._flags.last_token.text?this.set_mode(C):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(g):this.set_mode(C),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 o=0,a=null;this._flags.inline_frame=!0;do{if(o+=1,(a=this._tokens.peek(o-1)).newlines){this._flags.inline_frame=!1;break}}while(a.type!==l.EOF&&(a.type!==l.END_BLOCK||a.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):(!M(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()},x.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||(M(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)},x.prototype.handle_word=function(e){if(e.type===l.RESERVED)if(s(e.text,["set","get"])&&this._flags.mode!==g)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===g){":"===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||A(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===g||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,L)||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||!A(this._flags.mode)&&!M(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===C?t="NEWLINE":this._flags.last_token.type===l.SEMICOLON&&A(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===g&&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,o)&&")"!==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!==C||"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,o)&&")"!==this._flags.last_token.text&&this.print_newline():this._flags.multiline_frame&&M(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))},x.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)},x.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)},x.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},x.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?(A(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===g||this._flags.mode===m&&this._flags.parent.mode===g?(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)},x.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,o)||","===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,p)&&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,a)){var g=":"===e.text,v=g&&d,y=g&&!d;switch(this._options.operator_position){case h.before_newline:return this._output.space_before_token=!y,this.print_token(e),g&&!v||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,!g||v?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 y||this.allow_wrap_or_preserved_newline(e),i=!(this._output.just_added_newline()||y),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 w=this._tokens.peek();c=w&&s(w.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 b=u(this._flags.last_token,f)&&e.newlines;b&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(b,!0)}";"===this._flags.last_token.text&&A(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!==C||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)},x.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))},x.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),o=!1,a=!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(o=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),"*"),a=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),o&&(this._flags.alignment=1),r=0;r<i.length;r++)o?(this.print_token_line_indentation(e),this._output.add_token(c(i[r]))):a&&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}},x.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)},x.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)},x.prototype.handle_unknown=function(e,t){this.print_token(e),"\n"===e.text[e.text.length-1]&&this.print_newline(!1,t)},x.prototype.handle_eof=function(e){for(;this._flags.mode===m;)this.restore_mode();this.handle_whitespace_and_comments(e)},_x.Beautifier=x,_x}var mL,gL,vL,yL={exports:{}},wL={},bL={};function EL(){if(mL)return bL;mL=1;var e=Fx().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,bL.Options=t,bL}function ML(){if(vL)return yL.exports;vL=1;var e=function(){if(gL)return wL;gL=1;var e=EL().Options,t=Ox().Output,n=Gx().InputScanner,r=new(0,lL().Directives)(/\/\*/,/\*\//),i=/\r\n|[\r\n]/,o=/\r\n|[\r\n]/g,a=/\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=a.test(this._input.peek()),n=0;a.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(o,"\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,p=0,C=!1,m=!1,g=!1,v=!1,y=!1,w=this._ch,b=!1;f=""!==this._input.read(l),h=w,this._ch=this._input.next(),"\\"===this._ch&&this._input.hasNext()&&(this._ch+=this._input.next()),w=this._ch,this._ch;)if("/"===this._ch&&"*"===this._input.peek()){this._output.add_new_line(),this._input.back();var E=this._input.read(s),M=r.get_directives(E);M&&"start"===M.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 A=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);A.match(/[ :]$/)&&(A=this.eatString(": ").replace(/\s+$/,""),this.print_string(A),this._output.space_before_token=!0),0===p&&-1!==A.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 x=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);x.match(/[ :]$/)&&(x=this.eatString(": ").replace(/\s+$/,""),this.print_string(x),this._output.space_before_token=!0),0===p&&-1!==x.indexOf(":")?(m=!0,this.indent()):x in this.NESTED_AT_RULE?(this._nestedLevel+=1,x in this.CONDITIONAL_GROUP_RULE&&(g=!0)):0!==p||m||(v=!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()),v=!1,g?(g=!1,C=this._indentLevel>=this._nestedLevel):C=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&C&&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),C=!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 L=0;L<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;L++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[L])){b=!0;break}!C&&!g||this._input.lookBack("&")||this.foundNestedPseudoClass()||this._input.lookBack("(")||v||0!==p?(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 k='"'===h||"'"===h;this.preserveSingleSpace(k||f),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(";"===this._ch)b=!1,0===p?(m&&(this.outdent(),m=!1),v=!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(),p++,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(")")),p&&(p--,this.outdent()));else{var H=!1;this._input.lookBack("with")&&(H=!0),this.preserveSingleSpace(f||H),this.print_string(this._ch),m&&"$"===h&&this._options.selector_separator_newline?(this._output.add_new_line(),y=!0):(this.eatWhitespace(),p++,this.indent())}else if(")"===this._ch)p&&(p--,this.outdent()),y&&";"===this._input.peek()&&this._options.selector_separator_newline&&(y=!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&&!y||0!==p||v?this._output.space_before_token=!0:this._output.add_new_line();else if(">"!==this._ch&&"+"!==this._ch&&"~"!==this._ch||m||0!==p)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("="),a.test(this._ch)&&(this._ch="");else if("!"!==this._ch||this._input.lookBack("\\")){var S='"'===h||"'"===h;this.preserveSingleSpace(S||f),this.print_string(this._ch),!this._output.just_added_newline()&&"\n"===this._input.peek()&&b&&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&&a.test(this._ch)&&(this._ch=""));return this._output.get_code(d)},wL.Beautifier=d,wL}().Beautifier,t=EL().Options;return yL.exports=function(t,n){return new e(t,n).beautify()},yL.exports.defaultOptions=function(){return new t},yL.exports}var AL,xL={exports:{}},LL={},kL={};function HL(){if(AL)return kL;AL=1;var e=Fx().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,kL.Options=t,kL}var SL,_L,VL,OL,zL,NL={};function IL(){if(SL)return NL;SL=1;var e=iL().Tokenizer,t=iL().TOKEN,n=lL().Directives,r=hL().TemplatablePattern,i=rL().Pattern,o={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},a=new n(/<\!--/,/-->/),l=function(t,n){e.call(this,t,n),this._current_tag_name="";var o=new r(this._input).read_options(this._options),a=new i(this._input);if(this.__patterns={word:o.until(/[\n\r\t <]/),word_control_flow_close_excluded:o.until(/[\n\r\t <}]/),single_quote:o.until_after(/'/),double_quote:o.until_after(/"/),attribute:o.until(/[\n\r\t =>]|\/>/),element_name:o.until(/[\n\r\t >\/]/),angular_control_flow_start:a.matching(/\@[a-zA-Z]+[^({]*[({]/),handlebars_comment:a.starting_with(/{{!--/).until_after(/--}}/),handlebars:a.starting_with(/{{/).until_after(/}}/),handlebars_open:a.until(/[\n\r\t }]/),handlebars_raw_close:a.until(/}}/),comment:a.starting_with(/<!--/).until_after(/-->/),cdata:a.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:a.starting_with(/<!\[/).until_after(/]>/),processing:a.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=a.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===o.TAG_OPEN||e.type===o.CONTROL_FLOW_OPEN},l.prototype._is_closing=function(e,t){return e.type===o.TAG_CLOSE&&t&&((">"===e.text||"/>"===e.text)&&"<"===t.text[0]||"}}"===e.text&&"{"===t.text[0]&&"{"===t.text[1])||e.type===o.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(o.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(o.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=a.get_directives(n))&&"start"===r.ignore&&(n+=a.readIgnored(this._input)):n=this.__patterns.cdata.read()),n&&((t=this._create_token(o.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(o.COMMENT,n)).directives=null)}return t},l.prototype._read_open=function(e,t){var n=null,r=null;return t&&t.type!==o.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(o.TAG_OPEN,n)),r},l.prototype._read_open_handlebars=function(e,t){var n=null,r=null;return t&&t.type!==o.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(o.COMMENT,n)):(n=this.__patterns.handlebars_open.read(),r=this._create_token(o.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,a=0;!n.endsWith("{")||i!==a;){var l=this._input.next();if(null===l)break;"("===l?i++:")"===l&&a++,n+=l}r=this._create_token(o.CONTROL_FLOW_OPEN,n)}else"}"===e&&t&&t.type===o.CONTROL_FLOW_OPEN&&(n=this._input.next(),r=this._create_token(o.CONTROL_FLOW_CLOSE,n));return r},l.prototype._read_close=function(e,t){var n=null,r=null;return t&&t.type===o.TAG_OPEN&&("<"===t.text[0]&&(">"===e||"/"===e&&">"===this._input.peek(1))?(n=this._input.next(),"/"===e&&(n+=this._input.next()),r=this._create_token(o.TAG_CLOSE,n)):"{"===t.text[0]&&"}"===e&&"}"===this._input.peek(1)&&(this._input.next(),this._input.next(),r=this._create_token(o.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(o.EQUALS,this._input.next());else if('"'===e||"'"===e){var a=this._input.next();a+='"'===e?this.__patterns.double_quote.read():this.__patterns.single_quote.read(),r=this._create_token(o.VALUE,a)}else(i=this.__patterns.attribute.read())&&(r=t.type===o.EQUALS?this._create_token(o.VALUE,i):this._create_token(o.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===o.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(o.TEXT,r):null},l.prototype._read_script_and_style=function(e,t){if(t.type===o.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=o.TEXT,r;var i=this._input.readUntil(new RegExp("</"+n+"[\\n\\r\\t ]*?>","ig"));if(i)return this._create_token(o.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===o.CONTROL_FLOW_OPEN?this.__patterns.word_control_flow_close_excluded.read():this.__patterns.word.read()),n?this._create_token(o.TEXT,n):null},NL.Tokenizer=l,NL.TOKEN=o,NL}function TL(){if(_L)return LL;_L=1;var e=HL().Options,t=Ox().Output,n=IL().Tokenizer,r=IL().TOKEN,i=/\r\n|[\r\n]/,o=/\r\n|[\r\n]/g,a=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)};a.prototype.current_line_has_match=function(e){return this._output.current_line.has_match(e)},a.prototype.set_space_before_token=function(e,t){this._output.space_before_token=e,this._output.non_breaking_space=t},a.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},a.prototype.add_raw_token=function(e){this._output.add_raw_token(e)},a.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},a.prototype.traverse_whitespace=function(e){return!(!e.whitespace_before&&!e.newlines)&&(this.print_preserved_newlines(e)||(this._output.space_before_token=!0),!0)},a.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},a.prototype.print_newline=function(e){this._output.add_new_line(e)},a.prototype.print_token=function(e){e.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(e.text))},a.prototype.indent=function(){this.indent_level++},a.prototype.deindent=function(){this.indent_level>0&&(this.indent_level--,this._output.set_indent(this.indent_level,this.alignment_size))},a.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 o=new e(n,"html");this._options=o,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(o,"\n")).match(/^[\t ]*/)[0],s={text:"",type:""},c=new f(this._options),u=new a(this._options,l),h=new n(e,this._options).tokenize();this._tag_stack=new d(u);for(var p=null,C=h.next();C.type!==r.EOF;)C.type===r.TAG_OPEN||C.type===r.COMMENT?c=p=this._handle_tag_open(u,C,c,s,h):C.type===r.ATTRIBUTE||C.type===r.EQUALS||C.type===r.VALUE||C.type===r.TEXT&&!c.tag_complete?p=this._handle_inside_tag(u,C,c,s):C.type===r.TAG_CLOSE?p=this._handle_tag_close(u,C,c):C.type===r.TEXT?p=this._handle_text(u,C,c):C.type===r.CONTROL_FLOW_OPEN?p=this._handle_control_flow_open(u,C):C.type===r.CONTROL_FLOW_CLOSE?p=this._handle_control_flow_close(u,C):u.add_raw_token(C),s=p,C=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 o=n.has_wrapped_attrs,a={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),o=o||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),o=!0)),e.print_token(t),o=o||e.previous_token_wrapped(),n.has_wrapped_attrs=o),a},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,o=t.text,a=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?a=0:"separate"===this._options.indent_scripts&&(a=-e.indent_level);var c=e.get_full_indent(a);if(o=o.replace(/\n[ \t]*$/,""),"html"!==n.custom_beautifier_name&&"<"===o[0]&&o.match(/^(<!--|<!\[CDATA\[)/)){var d=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(o);if(!d)return void e.add_raw_token(t);l=c+d[1]+"\n",o=d[4],d[5]&&(s=c+d[5]),o=o.replace(/\n[ \t]*$/,""),(d[2]||-1!==d[3].indexOf("\n"))&&(d=d[3].match(/[ \t]+$/))&&(t.whitespace_before=d[0])}if(o)if(i){var f=function(){this.eol="\n"};f.prototype=this._options.raw_options,o=i(c+o,new f)}else{var h=t.whitespace_before;h&&(o=o.replace(new RegExp("\n("+h+")?","g"),"\n")),o=c+o.replace(/\n/g,"\n"+c)}l&&(o=o?l+o+"\n"+s:l+s),e.print_newline(!1),o&&(t.text=o,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,o){var a=this._get_tag_open_token(t);if(!n.is_unformatted&&!n.is_content_unformatted||n.is_empty_element||t.type!==r.TAG_OPEN||a.is_start_tag?(e.traverse_whitespace(t),this._set_tag_position(e,t,a,n,i),a.is_inline_element||e.set_wrap_point(),e.print_token(t)):(e.add_raw_token(t),a.start_tag_token=this._tag_stack.try_pop(a.tag_name)),a.is_start_tag&&this._is_wrap_attributes_force){var l,s=0;do{(l=o.peek(s)).type===r.ATTRIBUTE&&(a.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)&&(a.alignment_size=t.text.length+1),a.tag_complete||a.is_unformatted||(e.alignment_size=a.alignment_size),a};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 o=2;"{"===this.tag_start_char&&this.text.length>=3&&"~"===this.text.charAt(2)&&(o=3),this.is_end_tag=this.is_end_tag||"{"===this.tag_start_char&&(!e.indent_handlebars||this.text.length<3||/[^#\^]/.test(this.text.charAt(o)))}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,o){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&&o.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 a=!1;a=(a=n.start_tag_token&&n.start_tag_token.multiline_content)||!n.is_inline_element&&!(i.is_inline_element||i.is_unformatted)&&!(o.type===r.TAG_CLOSE&&n.start_tag_token===i)&&"TK_CONTENT"!==o.type,(n.is_content_unformatted||n.is_unformatted)&&(a=!1),a&&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"===o.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"],p=["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!==p.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}},LL.Beautifier=u,LL}function DL(){if(OL)return Hx;OL=1;var e=function(){if(uL)return Sx.exports;uL=1;var e=CL().Beautifier,t=Ux().Options;return Sx.exports=function(t,n){return new e(t,n).beautify()},Sx.exports.defaultOptions=function(){return new t},Sx.exports}(),t=ML(),n=function(){if(VL)return xL.exports;VL=1;var e=TL().Beautifier,t=HL().Options;return xL.exports=function(t,n,r,i){return new e(t,n,r,i).beautify()},xL.exports.defaultOptions=function(){return new t},xL.exports}();function r(r,i,o,a){return n(r,i,o=o||e,a=a||t)}return r.defaultOptions=n.defaultOptions,Hx.js=e,Hx.css=t,Hx.html=r,Hx}var ZL=(zL||(zL=1,function(e){var t,n,r,i,o=DL();o.js_beautify=o.js,o.css_beautify=o.css,o.html_beautify=o.html,e.exports=(t=o,n=o,r=o,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)}(kx)),kx.exports);const jL=(e,t,n=150)=>{if(!e||!t)return{top:0,left:0};const{top:r,left:i}=e,o=t.getBoundingClientRect();let a=r,l=i;return a-=a+n>t.clientHeight-n+130?Math.floor(n/2)+n-35:10,i>.6*o.width?l-=n+50:i<.5*o.width+n&&(l-=42),{top:a,left:l}},RL=o(({width:t="100%",height:r="100%",VariableDropdownHeight:i="160px",readOnly:o=!1,value:s="",handleChange:d,setValue:u,variableOptionsList:f=[],addForloopPrefix:h=!1,language:p="json",theme:C="light",isRequisiteType:m=!1,onPaste:g,showVariableDropdown:v=!0,defaultValue:y,customOptions:w={},editorVariableZindex:E=99999,showMinimap:M=!0,isFocus:A=!1},x)=>{const L=a(null),k=a([]),H=a(null),S=a(null),[_,V]=c(0),[O,z]=c(!1),[N,I]=c(!1),[T,D]=c({top:0,left:0}),[Z,j]=c([]),R=a(f);l(()=>{R.current=f},[f]);l(()=>{const e=L.current;if(!e)return;const t=e.onDidBlurEditorWidget(()=>{I(!1),H.current=null,S.current=null,k.current=[],V(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)}},[N]),l(()=>{const e=L.current;if(!e||!_)return;const t=[],n=[];O?n.push({range:{startLineNumber:_,startColumn:1,endLineNumber:_,endColumn:1},options:{isWholeLine:!1,linesDecorationsClassName:"active-line-number"}}):t.push({range:{startLineNumber:_,startColumn:1,endLineNumber:_,endColumn:1},options:{isWholeLine:!0,className:"current-line-background"}}),k.current=e.deltaDecorations(k.current,[...t,...n])},[_,O]);const B=(e,t)=>{switch(t){case"json":case"javascript":return ZL.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 ZL.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 b(x,()=>({getEditorInstance:()=>L.current,focus:()=>{L.current?.focus()},beautify:()=>{if(L.current){const e=L.current.getValue(),t=L.current.getModel()?.getLanguageId(),n=B(e,t||"json");L.current.setValue(n)}}})),n("div",{style:{width:t,height:r},className:"ff-editor-container",children:[e(Lx,{defaultValue:y,height:r,width:t,language:p,value:s,options:{minimap:{enabled:M},lineNumbers:"on",wordWrap:"on",autoClosingBrackets:"always",scrollBeyondLastLine:!1,readOnly:o,guides:{indentation:!1},...w},onMount:(e,t)=>{L.current=e,A&&setTimeout(()=>{e.focus()},0),e.onDidChangeCursorPosition(t=>{V(t.position.lineNumber);const n=e.getPosition(),r=e.getModel();if(!n||!r)return;const i=r.getLineContent(n.lineNumber),o=n.column-1;if(0===o)return void I(!1);const a=i.lastIndexOf("$",o-1),l=i.lastIndexOf("${",o-1),s=-1!==l?i.indexOf("}",l+2):-1,c=-1!==l&&-1!==s&&o-1>l&&o-1<s,d=!/\}/.test(i.slice(a+1,o));if(-1!==a&&o>a&&!/\s/.test(i.slice(a+1,o))&&!c&&d){H.current=a,S.current=i.slice(a+1,o);const r=(S.current??"").toLowerCase(),l=R.current.filter(e=>("_startforloop"===e.type&&h?`FLV_for:${e.name}`:e.name).toLowerCase().includes(r));j(l);const s=e.getScrolledVisiblePosition(n),c=e.getDomNode();D(jL(s,c,150)),["keyboard","mouse","deleteLeft"].includes(t?.source||"")&&I(!0)}else I(!1),H.current=null,S.current=null}),e.onMouseDown(()=>{setTimeout(()=>{const e=L.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]?(H.current=i,S.current=""):(H.current=null,S.current=null)},0)}),e.onDidChangeCursorSelection(()=>{const t=(e.getSelections?.()||[]).some(e=>e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn);z(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),o=n.column-2;if("$"===i[H.current??o]){null===H.current&&(H.current=o),S.current=i.slice(H.current+1,o);const t=R.current.filter(e=>("_startforloop"===e.type&&h?`FLV_for:${e.name}`:e.name).toLowerCase().includes(S.current?.toLowerCase()));t.length?j(t):(j([]),H?.current!==o&&" "===i[o]&&(H.current=null,S.current=null,I(!1)));const r=e.getScrolledVisiblePosition(n),a=e.getDomNode();D(jL(r,a,150))}else H.current=null,S.current=null}),e.onDidPaste(()=>{const t=e.getValue();if(t){const n=B(t,p);e.setValue(n),g&&g(n)}}),t.languages.registerCompletionItemProvider(p,{triggerCharacters:["."],provideCompletionItems:(e,n)=>{const r=e.getValueInRange({startLineNumber:n.lineNumber,startColumn:1,endLineNumber:n.lineNumber,endColumn:n.column}),i=e.getWordAtPosition(n),o=i?new t.Range(n.lineNumber,i.startColumn,n.lineNumber,i.endColumn):new t.Range(n.lineNumber,n.column,n.lineNumber,n.column),a=[];return r.endsWith("ff.")&&a.push({label:"getVariable",kind:t.languages.CompletionItemKind.Method,insertText:"getVariable(${1:variableName})",insertTextRules:t.languages.CompletionItemInsertTextRule.InsertAsSnippet,detail:"Get a variable value",range:o},{label:"setVariable",kind:t.languages.CompletionItemKind.Method,insertText:"setVariable(${1:variableName}, ${2:value})",insertTextRules:t.languages.CompletionItemInsertTextRule.InsertAsSnippet,detail:"Set a variable value",range:o},{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:o}),{suggestions:a}}})},onChange:(e,t)=>d(e,t),theme:C}),N&&T&&v&&e(uE,{position:"absolute",width:"300px",height:i,optionsList:Z,onSelectVariable:e=>{if(m&&L.current){const t=L.current,n=t.getPosition();if(n){const r=`'${e.name}'`,i=H?.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,H.current=null,I(!1)}}else((e,t)=>{if(L.current){const n=L.current,r=n.getPosition();if(r){const i=`{${t}${"FLV_for:"===t?"":"_"}${e}}`,o=H?.current??0;n.executeEdits("",[{range:{startLineNumber:r.lineNumber,startColumn:o+2,endLineNumber:r.lineNumber,endColumn:o+(r.column-o)},text:i,forceMoveMarkers:!1}]);const a=[];a.push({range:{startLineNumber:_,startColumn:1,endLineNumber:_,endColumn:1},options:{isWholeLine:!1}}),k.current=n.deltaDecorations(k.current,a),S.current=null,H.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?.includes("PARAMETER")?"SGP":"_startforloop"===e?.type?"FLV_for:":"DATAPROVIDER"===e?.type?"DPV":"PEV")},dropdownPosition:T,zIndex:E})]})}),BL=e=>e.flatMap(e=>e.runLevelExecutionDataSets.map((t,n)=>{const{runLevelExecutionDataSets:r,...i}=e;return{...i,...t,runCount:n+1}}));var PL,FL={exports:{}};var UL=(PL||(PL=1,"undefined"!=typeof self&&self,FL.exports=function(e){return 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(t,n){t.exports=e},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 o=n(11);Object.defineProperty(t,"ArcherContainer",{enumerable:!0,get:function(){return r(o).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}),o=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 a=o(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,o=(0,a.useMemo)(function(){return(0,c.encodeId)(t)},[t]),f=(0,a.useContext)(s.ArcherContainerContext),h=(0,a.useRef)(),p=(0,a.useCallback)(function(e){var t=(0,u.generateSourceToTarget)(o,e);(0,u.assertContextExists)(f),f.registerTransitions(o,t)},[f,o]),C=(0,a.useCallback)(function(){(0,u.assertContextExists)(f),f.unregisterTransitions(o)},[f,o]),m=(0,a.useCallback)(function(e){e&&((0,u.assertContextExists)(f),f.registerChild(o,e))},[o,f]),g=(0,a.useCallback)(function(){(0,u.assertContextExists)(f),f.unregisterChild(o)},[f,o]);(0,l.useIsomorphicLayoutEffect)(function(){return m(h.current),function(){return g()}},[m,g]),(0,d.useDeepCompareEffect)(function(){return p(r),function(){return C()}},[p,r,C]),a.default.Children.only(i);var v=i;return a.default.cloneElement(v,Object.assign(Object.assign({},v.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),o=r(n(9));function a(e){var t=(0,i.useRef)();return(0,o.default)(e,t.current)||(t.current=e),t.current}t.useDeepCompareEffect=function(e,t){(0,i.useEffect)(e,t.map(a))}},function(e,t,n){var r=Array.isArray,i=Object.keys,o=Object.prototype.hasOwnProperty,a="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 p=t instanceof RegExp,C=n instanceof RegExp;if(p!=C)return!1;if(p&&C)return t.toString()==n.toString();var m=i(t);if((s=m.length)!==i(n).length)return!1;for(l=s;0!=l--;)if(!o.call(n,m[l]))return!1;if(a&&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,o=t.targetAnchor,a=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:o},className:l,label:a,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,o=[],a=!0,l=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){l=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(l)throw i}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return o(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)?o(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 o(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 a=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)&&a(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),p=n(4),C=n(19),m=n(20),g={position:"absolute",width:"100%",height:"100%",top:0,left:0,pointerEvents:"none"},v=d.default.forwardRef(function(e,t){var n=e.endShape,o=void 0===n?p.endShapeDefaultProp:n,a=e.strokeColor,l=void 0===a?"#f00":a,s=e.strokeWidth,c=void 0===s?2:s,v=e.svgContainerStyle,y=void 0===v?{}:v,w=e.noCurves,b=e.children,E=e.className,M=e.endMarker,A=e.lineStyle,x=e.offset,L=e.startMarker,k=e.strokeDasharray,H=e.style,S=i((0,d.useState)({}),2),_=S[0],V=S[1],O=i((0,d.useState)({}),2),z=O[0],N=O[1],I=(0,d.useRef)(new u.default(function(){R()})).current,T=(0,d.useRef)(null),D=i(d.default.useState(),2)[1],Z=(0,d.useRef)("arrow".concat(Math.random().toString().slice(2))).current;(0,d.useImperativeHandle)(t,function(){return{refreshScreen:R,arrowMarkerUniquePrefix:Z}});var j,R=d.default.useCallback(function(){return D({})},[]),B=(0,d.useCallback)(function(e,t){N(function(n){return Object.assign(Object.assign({},n),r({},e,t))})},[]),P=(0,d.useCallback)(function(e){N(function(t){var n=Object.assign({},t);return delete n[e],n})},[]),F=(0,d.useCallback)(function(e,t){V(function(n){return n[e]===t?n:Object.assign(Object.assign({},n),r({},e,t))})},[]),U=(0,d.useCallback)(function(e){V(function(t){var n=Object.assign({},t);return delete n[e],n})},[]),q=(0,d.useMemo)(function(){return Object.assign(Object.assign({},g),y)},[y]);j="function"==typeof b?b(f.ArcherContainerContext):b,(0,m.useResizeListener)(R),(0,m.useObserveElements)(_,I);var W=(0,d.useMemo)(function(){return{registerTransitions:B,unregisterTransitions:P,registerChild:F,unregisterChild:U}},[B,P,F,U]);return d.default.createElement(f.ArcherContainerContextProvider,{value:W},d.default.createElement("div",{style:Object.assign(Object.assign({},H),{position:"relative"}),className:E},d.default.createElement("svg",{style:q},d.default.createElement("defs",null,d.default.createElement(C.ArrowMarkers,{endShape:o,sourceToTargetsMap:z,strokeColor:l,uniqueId:Z})),d.default.createElement(h.SvgArrows,{startMarker:L,endMarker:M,endShape:o,strokeColor:l,strokeWidth:c,strokeDasharray:k,noCurves:w,lineStyle:A,offset:x,parentCurrent:T.current,refs:_,uniqueId:Z,sourceToTargetsMap:z})),d.default.createElement("div",{style:{height:"100%"},ref:T},j)))});t.default=v},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")(),o="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(i):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)},a=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(){o(l)}function c(){var e=Date.now();if(n){if(e-i<a)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=v(0,0,0,0);function h(e){return parseFloat(e)||0}function p(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 C(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],o=e["padding-"+i];t[i]=h(o)}return t}(r),o=i.left+i.right,a=i.top+i.bottom,l=h(r.width),s=h(r.height);if("border-box"===r.boxSizing&&(Math.round(l+o)!==t&&(l-=p(r,"left","right")+o),Math.round(s+a)!==n&&(s-=p(r,"top","bottom")+a)),!function(e){return e===u(e).document.documentElement}(e)){var c=Math.round(l+o)-t,d=Math.round(s+a)-n;1!==Math.abs(c)&&(l-=c),1!==Math.abs(d)&&(s-=d)}return v(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 g(e){return r?m(e)?function(e){var t=e.getBBox();return v(0,0,t.width,t.height)}(e):C(e):f}function v(e,t,n,r){return{x:e,y:t,width:n,height:r}}var y=function(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=v(0,0,0,0),this.target=e};y.prototype.isActive=function(){var e=g(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},y.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e};var w=function(e,t){var n=function(e){var t=e.x,n=e.y,r=e.width,i=e.height,o="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,a=Object.create(o.prototype);return d(a,{x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:i+n,left:t}),a}(t);d(this,{target:e,contentRect:n})},b=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};b.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 y(e)),this.controller_.addObserver(this),this.controller_.refresh())}},b.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))}},b.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},b.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},b.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(e){return new w(e.target,e.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},b.prototype.clearActive=function(){this.activeObservations_.splice(0)},b.prototype.hasActive=function(){return this.activeObservations_.length>0};var E="undefined"!=typeof WeakMap?new WeakMap:new n,M=function(e){if(!(this instanceof M))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 b(e,t,this);E.set(this,n)};["observe","unobserve","disconnect"].forEach(function(e){M.prototype[e]=function(){return(t=E.get(this))[e].apply(t,arguments);var t}});var A=void 0!==i.ResizeObserver?i.ResizeObserver:M;t.default=A}.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)),o=n(15),a=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,p=r.strokeColor||e.strokeColor,C=r.strokeWidth||e.strokeWidth,m=r.strokeDasharray||e.strokeDasharray,g=!(!r.noCurves&&!e.noCurves),v=r.lineStyle||e.lineStyle||(g?"angle":"curve"),y=e.offset||0,w=e.source.anchor,b=(0,o.getPointCoordinatesFromAnchorPosition)(e.source.anchor,e.source.id,e.parentCoordinates,e.refs),E=e.target.anchor,M=(0,o.getPointCoordinatesFromAnchorPosition)(e.target.anchor,e.target.id,e.parentCoordinates,e.refs);return b?M?i.default.createElement(a.default,{className:e.className,startingPoint:b,startingAnchorOrientation:w,endingPoint:M,endingAnchorOrientation:E,strokeColor:p,strokeWidth:C,strokeDasharray:m,arrowLabel:e.label,arrowMarkerId:(0,l.getMarkerId)(e.uniqueId,e.source,e.target),lineStyle:v,offset:y,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,o.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 o(e){return new i.default(e.left,e.top)}var a=function(e){return e?e.getBoundingClientRect():null};t.getPointFromElement=function(e){var t=a(e);return t?o(t):null},t.getPointCoordinatesFromAnchorPosition=function(e,t,n,r){var l=a(r[t]);if(!l)return null;var s=function(e,t){switch(e){case"top":return o(t).add(new i.default(t.width/2,0));case"bottom":return o(t).add(new i.default(t.width/2,t.height));case"left":return o(t).add(new i.default(0,t.height/2));case"right":return o(t).add(new i.default(t.width,t.height/2));case"middle":return o(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)),o=n(18);function a(e,t,n,r,i,a,l,s){var c=(0,o.computeArrowDirectionVector)(i),d=c.arrowX,u=c.arrowY;if("straight"===a&&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=a,t.computeStartingAnchorPosition=l,t.computeEndingAnchorPosition=s,t.computeLabelDimensions=c,t.default=function(e){var t=e.className,n=e.startingPoint,r=e.startingAnchorOrientation,o=e.endingPoint,d=e.endingAnchorOrientation,u=e.strokeColor,f=e.strokeWidth,h=e.strokeDasharray,p=e.arrowLabel,C=e.arrowMarkerId,m=e.lineStyle,g=e.offset,v=e.enableStartMarker,y=e.disableEndMarker,w=e.endShape,b=e.domAttributes,E=e.hitSlop,M=void 0===E?10:E,A=e.cursor,x=void 0===A?"pointer":A,L=w.circle?2*w.circle.radius:2*w.arrow.arrowLength,k=a(n.x,n.y,v?L:0,f,r,m,o.x,o.y),H=k.xPoint,S=k.yPoint,_=a(o.x,o.y,y?0:L,f,d,m,n.x,n.y),V=_.xPoint,O=_.yPoint,z=l(H,S,V,O,r),N=z.xAnchor1,I=z.yAnchor1,T=s(H,S,V,O,d),D=function(e){var t=e.xStart,n=e.yStart,r=e.xAnchor1,i=e.yAnchor1,o=e.xAnchor2,a=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 p="M".concat(t,",").concat(n," ");return["curve","angle"].includes(c)&&(p+="".concat("curve"===c?"C":"").concat(r,",").concat(i," ").concat(o,",").concat(a," ")),p+"".concat(l,",").concat(s)}({xStart:H,yStart:S,xAnchor1:N,yAnchor1:I,xAnchor2:T.xAnchor2,yAnchor2:T.yAnchor2,xEnd:V,yEnd:O,lineStyle:m,offset:g}),Z=c(H,S,V,O),j=Z.xLabel,R=Z.yLabel,B=Z.labelWidth,P=Z.labelHeight,F="url(#".concat(C,")");return i.default.createElement("g",{className:t},i.default.createElement("path",{d:D,style:{fill:"none",stroke:u,strokeWidth:f,strokeDasharray:h},markerStart:v?F:void 0,markerEnd:y?void 0:F}),b&&i.default.createElement("path",Object.assign({d:D,style:{fill:"none",stroke:"rgba(0, 0, 0, 0)",strokeWidth:M,cursor:b?x:"initial",pointerEvents:"all"}},b)),p&&i.default.createElement("foreignObject",{x:j,y:R,width:B,height:P,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,p))))}},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)),o=n(4),a=n(3),l=function(e,t){return function(){var n,r,a,l,s,c,d,u,f,h,p,C,m=(null===(r=null===(n=e.endShape)||void 0===n?void 0:n.circle)||void 0===r?void 0:r.radius)||(null===(a=t.circle)||void 0===a?void 0:a.radius)||o.endShapeDefaultProp.circle.radius,g=(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)||o.endShapeDefaultProp.circle.strokeWidth,v=(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)||o.endShapeDefaultProp.circle.strokeColor,y=(null===(p=null===(h=e.endShape)||void 0===h?void 0:h.circle)||void 0===p?void 0:p.fillColor)||(null===(C=t.circle)||void 0===C?void 0:C.fillColor)||o.endShapeDefaultProp.circle.fillColor;return{markerWidth:4*m,markerHeight:4*m,refX:2*m+g,refY:2*m,path:i.default.createElement("circle",{cx:2*m,cy:2*m,r:m,fill:y,stroke:v,strokeWidth:g})}}},s=function(e,t,n){return function(){var r,a,l,s,c,d,u,f,h=e.strokeColor||n,p=null!==(c=null!==(l=null===(a=null===(r=e.endShape)||void 0===r?void 0:r.arrow)||void 0===a?void 0:a.arrowLength)&&void 0!==l?l:null===(s=null==t?void 0:t.arrow)||void 0===s?void 0:s.arrowLength)&&void 0!==c?c:o.endShapeDefaultProp.arrow.arrowLength,C=(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)||o.endShapeDefaultProp.arrow.arrowThickness,m="M0,0 L0,".concat(C," L").concat(p,",").concat(C/2," z");return{markerWidth:p,markerHeight:C,refX:0,refY:C/2,path:i.default.createElement("path",{d:m,fill:h})}}};t.ArrowMarkers=function(e){var t=e.sourceToTargetsMap,n=e.endShape,r=e.strokeColor,o=e.uniqueId;return i.default.createElement(i.default.Fragment,null,(0,a.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,a.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,p=u.path,C=u.refX,m=u.refY;return i.default.createElement("marker",{id:(0,a.getMarkerId)(o,t,c),key:(0,a.getMarkerId)(o,t,c),markerWidth:h,markerHeight:f,refX:C,refY:m,orient:"auto-start-reverse",markerUnits:"strokeWidth"},p)}))}},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])}}])}(i)),FL.exports);const qL=({getChildNodeComponent:r,parentNodeIndex:i,parentNodeData:o,verticalLineHeight:a,datasetHeight:l,curveHeights:s,itemRefs:c,datasetRef:d,isReadOnlyMode:u})=>e(t,{children:0===o?.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:o,parentNodeIndex:i})})]})}):o?.machineInstances?.map((f,h)=>{const p=0===h;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:`${a}px`}})]}),e("div",{className:"ff-machine-instance",children:f?.runLevelExecutionDataSets?.map((a,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(f?.runScriptCount)?e("div",{className:"ff-selectedMachines-connecting-line-text",children:e(F,{fontSize:8,fontWeight:"regular",children:`${[0,"0",null].includes(f.runScriptCount)?"":f.runScriptCount} Script${1!==f.runScriptCount?"s":""}`})}):e(t,{})]})}),e("div",{className:"ff-run-data-box",children:r({isButton:!1,childNodeData:f,childNodeIndex:h,runLevelExecutionDataSet:a,runLevelExecutionDataSetIndex:u,parentNodeData:o,parentNodeIndex:i})})]})},a?.runLevelExecutionDataSetId))}),h===o?.machineInstances.length-1&&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:o,parentNodeIndex:i,childNodeIndex:h+1})})]})})]},h)})}),WL=({data:t,noOfScripts:r,getChildNodeComponent:o,getParentNodeComponent:s,getParentNodeComponentActionItems:d,childNodeCurveHeight:u=1.28,isReadOnlyMode:f=!1})=>{const h=a(null),[p,C]=c(0),[m,g]=c([]),v=a([]);l(()=>{h.current&&C(h.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 b=t?.machines?.selectedMachines.reduce((e,t)=>f?e+(e=>!e?.machineInstances||G(e.machineInstances)?1:e.machineInstances.length)(t):e+y(t),0),E=Math.round(b/2);let M=1===E&&f&&2===b||1===E&&!f&&2===b;return e("div",{className:"connecting-branch-container",children:e(UL.ArcherContainer,{strokeColor:"var(--brand-color)",strokeWidth:1,startMarker:!0,endMarker:!1,noCurves:!0,children:n("div",{className:"ff-connecting-branch-grid-container",children:[e(UL.ArcherElement,{id:"rootNode",children:e("div",{className:"ff-grid-item ff-dynamic-item",style:{gridRow:E,top:M?"44px":""},children:e("div",{className:"ff-script-count-container",children:n("div",{className:"ff-script-count-box",children:[e(F,{children:r}),e(F,{children:"Scripts"})]})})})}),t?.machines?.selectedMachines.map((t,r)=>{const a=w,l=y(t);w+=l;const c=((e,t,n)=>{if(1===e.length&&f)return 0;const r=e.reduce((t,n,r)=>t+(r===e.length-1&&f?0:n.runLevelExecutionDataSets?.length||0),0);return r*(t+n)})(t?.machineInstances,p,16);return e(i.Fragment,{children:n("div",{className:"ff-selectedMachines",style:{gridRow:`${a} / 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(UL.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(qL,{parentNodeIndex:r,parentNodeData:t,verticalLineHeight:c,datasetHeight:p,curveHeights:m,itemRefs:v,datasetRef:h,getChildNodeComponent:o,isReadOnlyMode:f})]})},r)}),!f&&e("div",{className:"ff-select-machine-input",style:{gridRow:`${w}`},children:e(UL.ArcherElement,{id:"lastNode",relations:[{targetId:"rootNode",targetAnchor:"left",sourceAnchor:"left"}],children:e("div",{children:s({isMultiSelect:!0})})})})]})})})},QL=(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)}},GL=({hasAtSymbol:t,usersObj:n,optionClicked:r,charsAfterAt:i,mentionUserRef:o})=>{const[s,d]=c(0),u=a([]);if(!t)return null;const f=n.filter(e=>!i||e.name.toLowerCase().startsWith(i.toLowerCase()));l(()=>{d(0)},[i]);const h=p(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:o,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(F,{children:t.name})},t.id)):e("div",{className:"user-not-found",children:e(F,{children:"No user name found"})})})})},KL=e=>e&&Array.isArray(e)?e.map(({user:e})=>({id:e.id,name:e.name,emailId:e.emailId})):[],YL=(e,t)=>{const n=t.find(t=>`@${t.name.replace(/\s+/g,"")}`===e);return n?n.emailId:null},XL=({handleInsertNode:t,handleEditNode:r,handleDeleteNode:i,comment:o,depth:s=0,isDisable:d,userDetails:u,isEditDeleteActionAllowed:h=!0,createdByID:p,rowBreakCharCount:C=83,isVewMode:m=!1,deleteEnable:g=!0})=>{const[v,y]=c(""),[w,b]=c(!1),[E,M]=c(!1),[A,x]=c(!0),[L,k]=c([]),[H,S]=c(!1),[_,V]=c([]),[O,z]=c({top:0,left:0}),[N,I]=c(""),T=a(null),D=a(null),Z=a(null);l(()=>{w&&o?.description&&y(o?.description)},[w,o.description]),l(()=>{const e=KL(u);k(e)},[u]),l(()=>{const e=(v.match(kt)||[]).map(e=>YL(e,L)).filter(Boolean);V(e)},[v]),l(()=>{const e=e=>{const t=D.current&&!D.current.contains(e.target)&&T.current&&!T.current.contains(e.target),n=Z.current&&!Z.current.contains(e.target)&&T.current&&!T.current.contains(e.target);(t||n)&&(S(!1),y(e=>e.replace(/(?:^|\s)(@\w*)$/,"")))};return H&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[H]);const{modifiedByUname:j,createdByUname:R,modifiedOn:B,createdOn:U}=o||{},q=B??U??(new Date).toLocaleString(),W=j??R??"Anonymous",Q=s>2,G=W?W.charAt(0).toUpperCase():"A";l(()=>{w&&o.description&&y(o.description)},[w,o.description]);const Y=()=>{0!==v.trim().length&&(w?(r(o.id,v,_),M(!1),y("")):(x(!0),t(o.id,v,_),M(!1),y("")),w&&b(!1))};l(()=>{(()=>{if(!T.current)return;const e=T?.current,t=w?D?.current:Z?.current,n=T.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 o=document.createElement("span");o.textContent=".",n.appendChild(o);const a=o.getBoundingClientRect();return document.body.removeChild(n),{top:a.top-20,left:a.left}})(e,n),i=t?.getBoundingClientRect().height??0,o=e?.getBoundingClientRect();if(!o)return;const a=window.innerHeight-o.bottom,l=o.top;z({top:a<i&&l>i?n-i-16:n+32,left:r.left+10})})()},[v]);const X=e=>{const t=e.target.value;y(t);const n=(t.match(/@\S+/g)||[]).map(e=>YL(e,L)).filter(e=>null!==e);V(n);const r=e.target.selectionStart,i=t.slice(0,r),o=i.match(Nt);I(o?.[1]||"");const a=zt.test(i);S(!!a)},J=e=>{if("@"===e.key)S(!0);else if("Backspace"===e.key&&T.current){const t=T.current.selectionStart,n=v.slice(0,t);n.endsWith("@")&&S(!1);const r=n.match(_t);if(r){e.preventDefault();const i=r[1],o=n.lastIndexOf(i||""),a=v.slice(0,o)+v.slice(t);y(a),S(!1),V(()=>(a.match(/@\w+/g)||[]).map(e=>e.slice(1)).map(e=>YL(e,L)).filter(Boolean)),setTimeout(()=>{T.current?.setSelectionRange(o,o)},0)}}},$=e=>{if(!T.current)return;const t=T.current.selectionStart,n=v.slice(0,t),r=n.match(Ht);if(r){const i=n.lastIndexOf(r[1]||""),o=v.slice(t),a=`@${e.replace(/\s+/g,"")} `,l=v.slice(0,i)+a+o;y(l),S(!1),setTimeout(()=>{T.current?.focus(),T.current?.setSelectionRange(i+a.length+1,i+a.length+1)},0),V(()=>(l.match(/@\w+/g)||[]).map(e=>e.slice(1)).map(e=>YL(e,L)).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:o?.profileImage?e("img",{height:30,width:30,src:`data:image/jpeg;base64,${o?.profileImage}`}):G}),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:q})]}),n("div",{className:"ff-editable-container",children:[!w&&e(F,{className:"typography-text",children:o?.description?.split(It).map((t,n)=>t.startsWith("@")?e("b",{children:t},`highlight-${n}`):e(f,{children:t},`text-${n}`))}),w&&n("div",{className:"inputContainer",children:[e("textarea",{rows:v.length<C?1:3,className:"inputContainer_input first_input",value:v,autoFocus:!0,placeholder:"Edit comment",ref:T,onChange:e=>X(e),onKeyDown:J}),H&&e("div",{id:"mention-user",style:{position:"absolute",top:`${O.top}px`,left:`${O.left}px`},children:e(GL,{hasAtSymbol:H,usersObj:L,optionClicked:$,charsAfterAt:N,mentionUserRef:D})}),n("div",{className:"edit-comment",children:[e("div",{className:"reply",children:e(K,{title:w?"Update":"Add",children:e(P,{name:"comment_reply",hoverEffect:!0,disabled:w&&v.trim()===(o?.description?.trim()??"")||0===v.trim().length,onClick:()=>{Y(),b(!1),M(!1)}})})}),e("div",{className:"reply",onClick:()=>{b(!1),M(!1),y("")},children:e(K,{title:w?"Cancel":"Close",children:e(P,{name:"close",color:"var(--ff-delete-button-attachment)",hoverEffect:!0})})})]})]}),n("div",{className:"comment-actions",children:[!Q&&s<2&&o.comments?.length>0&&e("div",{className:"action-icon",onClick:()=>x(e=>!e),children:e(K,{title:""+(A?"collapse":"expand"),children:e(P,{name:A?"collapse-arrow":"expand-arrow",disabled:w||E,hoverEffect:!0})})}),!Q&&s<2&&0===o.comments?.length&&e("div",{className:"action-icon",children:e(P,{name:"expand-arrow",disabled:!0})}),!m&&n("div",{className:"ff-comment-action-item",children:[s<2&&e("div",{className:"action-icon",children:e(K,{title:"Reply",children:e(P,{name:"comment_icon",disabled:w||d,hoverEffect:!0,onClick:()=>{M(!0)}})})}),h&&e("div",{className:"action-icon",children:e(K,{title:"Edit",children:e(P,{name:"edit",disabled:E||d,hoverEffect:!0,onClick:()=>b(!0)})})}),h&&g&&e("div",{className:"action-icon",children:e(K,{title:"Delete",children:e(P,{name:"delete",color:"var(--ff-delete-button-attachment)",onClick:()=>{E||i(o.id)},disabled:w||E||d,hoverEffect:!0})})})]})]})]})]})]}),e("div",{className:"comment-reply-container",children:E&&n("div",{className:"inputContainer",children:[e("textarea",{rows:v.length<C?1:3,className:"inputContainer_input first_input",value:v,autoFocus:!0,placeholder:"Add reply comments",ref:T,onChange:e=>X(e),onKeyDown:J}),H&&e("div",{id:"mention-user",style:{position:"absolute",top:`${O.top}px`,left:`${O.left}px`},children:e(GL,{hasAtSymbol:H,usersObj:L,optionClicked:$,charsAfterAt:N,mentionUserRef:Z})}),n("div",{className:"edit-comment",children:[e("div",{className:"reply",onClick:()=>{Y(),b(!1),M(!1)},children:e(K,{title:"Reply",children:e(P,{name:"comment_reply",hoverEffect:!0,disabled:Boolean(!v.length)})})}),e("div",{className:"reply",onClick:()=>{b(!1),M(!1),y("")},children:e(K,{title:"Cancel",children:e(P,{name:"close",color:"var(--ff-delete-button-attachment)",hoverEffect:!0})})})]})]})}),A&&o.comments?.length>0&&e("div",{className:`child-comments ${0===s?"first-level-child":""} ${1===s?"second-level-child":""}`,children:o.comments.map(n=>e("div",{className:`child-comments child-comments-${s+1}`,children:e(XL,{handleInsertNode:t,handleEditNode:r,handleDeleteNode:i,comment:n,depth:s+1,isDisable:d,userDetails:u,isEditDeleteActionAllowed:o.createdBy===p,createdByID:p,isVewMode:m})},n.id))})]})})},JL=({commentsData:t,handleAddComment:r,handleEditComment:i,handleDeleteComment:o,onCommentsDataChange:s,currentUser:d,isDisable:u=!1,userDetails:f,createdByID:h,rowBreakCharCount:C=83,isVewMode:m=!1,deleteEnable:g=!0,showTextarea:v=!1,autoFocus:y=!1})=>{const[w,b]=c(""),[E,M]=c([]),[A,x]=c(!1),[L,k]=c([]),[H,S]=c({top:0,left:0}),[_,V]=c(""),O=a(null),z=a(null),[N,I]=c(!1);l(()=>{const e=KL(f);k(e)},[f]);const T=(e,t)=>{for(const n of e){if(n.id===t)return n;const e=T(n.comments,t);if(e)return e}return null};l(()=>{t&&M(t)},[t]),l(()=>{const e=e=>{z.current&&!z.current.contains(e.target)&&(x(!1),b(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:Z,deleteNode:j}=(()=>{const e=(t,n,r)=>t.map(t=>t.id===n?{...t,comments:[...t.comments,{id:vp(),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}})(),R=(e,t,n)=>{if(!t.trim())return;const i={id:vp(),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()};M(t=>D(t,e,i)),r&&r(i,T(E,e))},B=p((e,t,n)=>{const r=Z(E,e,t);M(r);const o=T(r,e);i&&i(e,t,o,n)},[E,Z,i]),U=p(async e=>{try{if(o){const t=await o(e);if(t?.success){const t=j(E,e);M(t)}}}catch(e){console.error("Error deleting comment:",e)}},[j,o]);l(()=>{s&&s(E)},[E,s]);l(()=>{(()=>{if(!O.current)return;const e=O?.current,t=z?.current,n=O.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 o=document.createElement("span");o.textContent=".",n.appendChild(o);const a=o.getBoundingClientRect();return document.body.removeChild(n),{top:a.top,left:a.left}})(e,n),i=t?.getBoundingClientRect().height??0,o=e?.getBoundingClientRect();if(!o)return;const a=window.innerHeight-o.bottom,l=o.top;S({top:a<i&&l>i?n-i-16:n+32,left:r.left+10})})()},[w]);l(()=>{w.includes("\n")||I(!1)},[w]);return n("div",{className:"ff-comments-container-box",children:[!m&&n("div",{className:"ff-first-comment "+(v?"no-border":""),children:[e(F,{fontWeight:"semi-bold",className:"ff-comment-heading",children:"Comments"}),!v&&n("div",{className:"input-wrapper",children:[e("textarea",{className:"inputContainer_input first_input",rows:N?3:w.length<C?1:3,autoFocus:y,value:w,onChange:e=>(e=>{const t=e.target.value;b(t);const n=e.target.selectionStart,r=t.slice(0,n),i=r.match(Nt);V(i?.[1]||"");const o=zt.test(r);x(!!o),t||I(!1)})(e),placeholder:"Add a comment",disabled:u,ref:O,onKeyDown:e=>{if("@"===e.key)x(!0);else if("Backspace"===e.key&&O.current){const t=O.current.selectionStart;if(w.slice(0,t).endsWith("@")&&x(!1),A){e.preventDefault();const n=w.slice(0,t-1)+w.slice(t);b(n);const r=t-1,i=n.slice(0,r).match(Nt);V(i?.[1]||""),x(!!i),setTimeout(()=>{O.current?.setSelectionRange(r,r)},0)}}"Enter"===e.key&&I(!0)}}),A&&e("div",{id:"mention-user",style:{position:"absolute",top:`${H.top}px`,left:`${H.left}px`},children:e(GL,{hasAtSymbol:A,usersObj:L,optionClicked:e=>{if(!O.current)return;const t=O.current.selectionStart,n=w.slice(0,t),r=n.match(St);if(r){const i=n.lastIndexOf(r[1]??""),o=w.slice(t),a=`@${e} `,l=w.slice(0,i)+a+o;b(l),x(!1),setTimeout(()=>{O.current?.focus();const e=i+a.length+1;O.current?.setSelectionRange(e,e)},0)}},charsAfterAt:_,mentionUserRef:z})}),e("span",{className:"reply-comment",children:e(K,{title:"Add",children:e(P,{name:"comment_reply",onClick:()=>{if(!w.trim())return;const e=L.filter(e=>new RegExp(`@${e.name}\\b`,"i").test(w)).map(e=>e.emailId),t={id:vp(),description:w,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),M(e=>[...e,t]),b("")},hoverEffect:!0,disabled:Boolean(!w.length)})})})]})]}),E.length>0&&E.map(t=>e(XL,{handleInsertNode:R,handleEditNode:B,handleDeleteNode:U,comment:t,depth:0,isDisable:u,userDetails:f,isEditDeleteActionAllowed:t.createdBy===h,createdByID:h,isVewMode:m,deleteEnable:g},t.id))]})},$L=()=>{const e=a(!0);return{canTrigger:()=>e.current,setTriggered:()=>{e.current=!1},resetTrigger:()=>{e.current=!0}}},ek=({isOpen:t,onClose:r,onContinue:i,titleMessage:o="Warning!",subTitleMessage:a="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:p="226",colorForTitleMessage:C="var(--status-button-bg-warning)",footerContent:m,firstButtonDisabled:g=!1,secondButtonDisabled:v=!1,zIndex:y=1100,iconSize:w=94})=>e($f,{overlayClassName:"custom-overlay",isOpen:t,onClose:r,isHeaderDisplayed:!1,zIndex:y,children:n("div",{className:"warning_modal_container",children:[n("div",{className:"warning_modal_content",children:[e(P,{name:l,className:"warning_modal_icon",width:w,height:w}),n("div",{className:"warning_modal_message",children:[n(F,{fontSize:20,fontWeight:"semi-bold",className:"warning_modal_title_wrapper",children:[" ",n(F,{color:`${C}`,fontSize:20,fontWeight:"semi-bold",children:[" ",o," "]})," ",a]}),n("div",{className:"warning_modal_message_wrapper",children:[e(F,{fontSize:16,children:s}),e(F,{as:"div",children:m})]})]})]}),n("div",{className:"warning_modal_footer_button",children:[e(U,{buttonHeight:"24px",variant:"secondary",label:c,onClick:r,disabled:g}),d&&e(U,{buttonHeight:"24px",variant:u||"warning",label:d,onClick:i,disabled:v})]})]}),ariaHideApp:!0,isFooterDisplayed:!1,customWidth:`${h}px`,customHeight:`${p}px`,boxShadow:"0px 1px 4px 0px var(--toaster-boxshadow)",border:f});function tk(e,t=[]){return t.reduce((e,t)=>e.replace(new RegExp(function(e){return e.replace(mt,"\\$&")}(t),"gi"),""),e).replace(/([A-Z])/g," $1").trim().replace(/^./,e=>e.toUpperCase())}function nk(e,t=[]){return e.toUpperCase()===e&&(e=e.toLowerCase()),e.includes("_")?function(e){return e.toLowerCase().replace(/_/g," ").replace(/^./,e=>e.toUpperCase())}(e):tk(e,t)}const rk=({onSelectVariable:t,dropdownPosition:r,filteredOptions:i=[],position:o="relative",width:a="300px",zIndex:l=1e3,height:s="160px",truncateTextValue:c=34,isTruncateText:d=!1})=>n("div",{className:z("ff-variable-dropdown",o),style:r?{top:r.top+30,left:r.left-30,width:a,zIndex:l}:{width:a,zIndex:l,height:s},children:[i?.map(n=>{const r=d?ie(n?.name,c,"pixel"):n?.name,i=!!d&&oe(n?.name,c,"pixel");return e("div",{className:"ff-variable-option",onClick:()=>t(n),children:d?e(K,{title:i?n?.name:"",children:e(F,{children:r})}):e(F,{children:r})},n?.id)}),0===i?.length&&e("div",{className:"ff-variable-option .ff-variable-option-no-data ",children:e(F,{as:"span",fontSize:14,children:"No Option"})})]}),ik=o(({label:t="",hashInputValue:r="",setHashInputValue:i,variableList:o=[],addForloopPrefix:s=!1,placeholder:d="Enter text",onChange:u,onCreateVariableClick:f,value:h="",dropdownWidth:p="inherit",isHash:C=!1,dataFiles:m=[],showAddVariableIcon:g=!0,helperText:v="",error:y,autoComplete:w="off",showHidePasswordIcon:E=!0,required:M=!1,formProps:A={},onlyDropdown:x=!1,type:L,onFocus:k,onBlur:H,readOnly:S=!1,height:_="160px",truncateTextValue:V=34,isTruncateText:O=!1,...z},N)=>{const[I,T]=c(!1),[D,Z]=c(!1),[j,R]=c(!1),[B,U]=c(null),[q,W]=c(0),[Q,Y]=c(!1),[X,J]=c(!1),[$,ee]=c([]),te=a(null);b(N,()=>te.current),l(()=>{null!==B&&te.current&&(te.current.setSelectionRange(B,B),te.current.focus())},[B]),l(()=>{if(C?T(h.startsWith("#")):J(!h?.includes("$")),h.startsWith("#")&&C){const e=h.slice(1).toLowerCase(),t=m.filter(t=>t.name.toLowerCase().includes(e));ee(t),T(!0)}},[h]),l(()=>{if(!Q&&x){const e=m.filter(e=>e.toLowerCase().includes(h.toLowerCase())).map((e,t)=>({id:t+1,name:e}));ee(e),T(e.length>0)}Y(!1)},[h]);const ne=()=>{te.current&&W(te.current.selectionStart||0)},re=ne,ie=ne;l(()=>{te.current&&W(te.current.selectionStart||0)},[h]);const oe=e=>{if(te.current){const{selectionStart:t,selectionEnd:n}=te.current,r=`{${"STEPGROUP"===e.parentVariableType?"SGV":"LOCAL"===e.type?"LV":"GLOBAL"===e.type?"GV":"GROUP"===e.type?"SGV":e?._id?.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}}`;let o;if(o=C&&"#"===h[0]||x?e.name+h.slice(n||1):h.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}(h,q)||0)+"$"+r+h.slice(n||0),u){u({target:{value:o}},e)}te.current.value=o,i?.(e),U((t||0)+r.length),T(!1),Y(!0),Z(!0)}};const ae=function(e,t,n){let r=!1,i="";const o="}"===h[t-1];if(t<0||t>e.length)return{showDropdown:r,searchString:i};const a=e.lastIndexOf("$",t-1),l=e.indexOf("$",t);if(-1!==a&&(t===a+1?(r=!0,i=""):(i=e.slice(a+1,-1===l?void 0:l),t>a+1&&(i=e.slice(a+1,t)),r=!0),D&&o&&(r=!1),(/[{}]/.test(i)||0===t)&&(r=!1,i=""),i)){n.some(e=>("_startforloop"===e.type&&s?`FLV_for:${e.name}`:e.name).toLowerCase().includes(i.toLowerCase()))||(r=!1,i="")}return{showDropdown:r,searchString:i}}(h,q,o),[le,se]=c(!1);return n("div",{className:"ff-add-variable-container",children:[n("div",{className:"ff-add-variable-input",children:[e(nn,{readOnly:S,...z,name:"add_variable",ref:te,type:((e,t)=>"password"===e?t?"text":"password":e??"text")(L,le),value:h,onChange:u,variant:"primary",label:t,placeholder:d,onClick:re,onKeyUp:ie,onFocus:e=>{setTimeout(()=>{R(!0),k?.(e)},500)},onBlur:e=>{(e=>{e.relatedTarget&&e.relatedTarget.closest(".dropdown-container")||R(!1)})(e),H?.(e)},autoComplete:w,helperText:v,error:y,required:M,...A}),"password"===L&&E&&e(K,{title:le?"Hide":"Show",children:e(F,{as:"span",className:"ff-password-icon",children:e(P,{onClick:()=>{se(e=>!e)},name:le?"hide_access_icon":"view_access_icon",width:16,height:16,hoverEffect:!0})})}),!G(h)&&!C&&X&&g&&e(K,{title:"Add Variable",children:e(P,{onClick:f,name:"add_variable",width:24,height:24,hoverEffect:!0})})]}),ae?.showDropdown&&j&&e(uE,{position:"absolute",width:p,optionsList:o.filter(e=>("_startforloop"===e.type&&s?`FLV_for:${e.name}`:e.name).toLowerCase().includes(ae?.searchString.toLowerCase())),onSelectVariable:oe,height:_}),I&&(C||x)&&e(rk,{position:"relative",width:p,filteredOptions:$,zIndex:2e3,onSelectVariable:oe,height:_,isTruncateText:O,truncateTextValue:V})]})}),ok=(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 ak,lk;var sk=(lk||(lk=1,ak=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;
|
|
36
|
+
*/var mA={};void 0!==mA.asn1&&mA.asn1||(mA.asn1={}),mA.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 HM(r,16).xor(e).add(HM.ONE).toString(16).replace(/^-/,"")}return t},this.getPEMStringFromHex=function(e,t){return hextopem(e,t)},this.newObject=function(e){var t=mA.asn1,n=t.DERBoolean,r=t.DERInteger,i=t.DERBitString,o=t.DEROctetString,a=t.DERNull,l=t.DERObjectIdentifier,s=t.DEREnumerated,c=t.DERUTF8String,d=t.DERNumericString,u=t.DERPrintableString,f=t.DERTeletexString,h=t.DERIA5String,p=t.DERUTCTime,C=t.DERGeneralizedTime,m=t.DERSequence,g=t.DERSet,v=t.DERTaggedObject,y=t.ASN1Util.newObject,w=Object.keys(e);if(1!=w.length)throw"key of param shall be only one.";var b=w[0];if(-1==":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+b+":"))throw"undefined key: "+b;if("bool"==b)return new n(e[b]);if("int"==b)return new r(e[b]);if("bitstr"==b)return new i(e[b]);if("octstr"==b)return new o(e[b]);if("null"==b)return new a(e[b]);if("oid"==b)return new l(e[b]);if("enum"==b)return new s(e[b]);if("utf8str"==b)return new c(e[b]);if("numstr"==b)return new d(e[b]);if("prnstr"==b)return new u(e[b]);if("telstr"==b)return new f(e[b]);if("ia5str"==b)return new h(e[b]);if("utctime"==b)return new p(e[b]);if("gentime"==b)return new C(e[b]);if("seq"==b){for(var E=e[b],M=[],A=0;A<E.length;A++){var x=y(E[A]);M.push(x)}return new m({array:M})}if("set"==b){for(E=e[b],M=[],A=0;A<E.length;A++){x=y(E[A]);M.push(x)}return new g({array:M})}if("tag"==b){var L=e[b];if("[object Array]"===Object.prototype.toString.call(L)&&3==L.length){var k=y(L[2]);return new v({tag:L[0],explicit:L[1],obj:k})}var H={};if(void 0!==L.explicit&&(H.explicit=L.explicit),void 0!==L.tag&&(H.tag=L.tag),void 0===L.obj)throw"obj shall be specified for 'tag'.";return H.obj=y(L.obj),new v(H)}},this.jsonToASN1HEX=function(e){return this.newObject(e).getEncodedHex()}},mA.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 o=("00000000"+parseInt(e.substring(i,i+2),16).toString(2)).slice(-8);if(r+=o.substring(1,8),"0"==o.substring(0,1))t=t+"."+new HM(r,2).toString(10),r=""}return t},mA.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 HM(e,10).toString(2),i=7-r.length%7;7==i&&(i=0);for(var o="",a=0;a<i;a++)o+="0";r=o+r;for(a=0;a<r.length-1;a+=7){var l=r.substring(a,a+7);a!=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("."),o=40*parseInt(i[0])+parseInt(i[1]);r+=t(o),i.splice(0,2);for(var a=0;a<i.length;a++)r+=n(i[a]);return r},mA.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""}},mA.asn1.DERAbstractString=function(e){mA.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))},CA(mA.asn1.DERAbstractString,mA.asn1.ASN1Object),mA.asn1.DERAbstractTime=function(e){mA.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),o=String(i.getFullYear());"utc"==t&&(o=o.substring(2,4));var a=o+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);a=a+"."+(s=s.replace(/[0]+$/,""))}}return a+"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,o){var a=new Date(Date.UTC(e,t-1,n,r,i,o,0));this.setByDate(a)},this.getFreshValueHex=function(){return this.hV}},CA(mA.asn1.DERAbstractTime,mA.asn1.ASN1Object),mA.asn1.DERAbstractStructured=function(e){mA.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)},CA(mA.asn1.DERAbstractStructured,mA.asn1.ASN1Object),mA.asn1.DERBoolean=function(){mA.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},CA(mA.asn1.DERBoolean,mA.asn1.ASN1Object),mA.asn1.DERInteger=function(e){mA.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=mA.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new HM(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))},CA(mA.asn1.DERInteger,mA.asn1.ASN1Object),mA.asn1.DERBitString=function(e){if(void 0!==e&&void 0!==e.obj){var t=mA.asn1.ASN1Util.newObject(e.obj);e.hex="00"+t.getEncodedHex()}mA.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),o=parseInt(i,2).toString(16);1==o.length&&(o="0"+o),r+=o}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))},CA(mA.asn1.DERBitString,mA.asn1.ASN1Object),mA.asn1.DEROctetString=function(e){if(void 0!==e&&void 0!==e.obj){var t=mA.asn1.ASN1Util.newObject(e.obj);e.hex=t.getEncodedHex()}mA.asn1.DEROctetString.superclass.constructor.call(this,e),this.hT="04"},CA(mA.asn1.DEROctetString,mA.asn1.DERAbstractString),mA.asn1.DERNull=function(){mA.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},CA(mA.asn1.DERNull,mA.asn1.ASN1Object),mA.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 HM(e,10).toString(2),i=7-r.length%7;7==i&&(i=0);for(var o="",a=0;a<i;a++)o+="0";r=o+r;for(a=0;a<r.length-1;a+=7){var l=r.substring(a,a+7);a!=r.length-7&&(l="1"+l),n+=t(parseInt(l,2))}return n};mA.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("."),o=40*parseInt(i[0])+parseInt(i[1]);r+=t(o),i.splice(0,2);for(var a=0;a<i.length;a++)r+=n(i[a]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=r},this.setValueName=function(e){var t=mA.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))},CA(mA.asn1.DERObjectIdentifier,mA.asn1.ASN1Object),mA.asn1.DEREnumerated=function(e){mA.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=mA.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new HM(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))},CA(mA.asn1.DEREnumerated,mA.asn1.ASN1Object),mA.asn1.DERUTF8String=function(e){mA.asn1.DERUTF8String.superclass.constructor.call(this,e),this.hT="0c"},CA(mA.asn1.DERUTF8String,mA.asn1.DERAbstractString),mA.asn1.DERNumericString=function(e){mA.asn1.DERNumericString.superclass.constructor.call(this,e),this.hT="12"},CA(mA.asn1.DERNumericString,mA.asn1.DERAbstractString),mA.asn1.DERPrintableString=function(e){mA.asn1.DERPrintableString.superclass.constructor.call(this,e),this.hT="13"},CA(mA.asn1.DERPrintableString,mA.asn1.DERAbstractString),mA.asn1.DERTeletexString=function(e){mA.asn1.DERTeletexString.superclass.constructor.call(this,e),this.hT="14"},CA(mA.asn1.DERTeletexString,mA.asn1.DERAbstractString),mA.asn1.DERIA5String=function(e){mA.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="16"},CA(mA.asn1.DERIA5String,mA.asn1.DERAbstractString),mA.asn1.DERUTCTime=function(e){mA.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))},CA(mA.asn1.DERUTCTime,mA.asn1.DERAbstractTime),mA.asn1.DERGeneralizedTime=function(e){mA.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))},CA(mA.asn1.DERGeneralizedTime,mA.asn1.DERAbstractTime),mA.asn1.DERSequence=function(e){mA.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}},CA(mA.asn1.DERSequence,mA.asn1.DERAbstractStructured),mA.asn1.DERSet=function(e){mA.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)},CA(mA.asn1.DERSet,mA.asn1.DERAbstractStructured),mA.asn1.DERTaggedObject=function(e){mA.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)))},CA(mA.asn1.DERTaggedObject,mA.asn1.ASN1Object);var gA,vA,yA=window&&window.__extends||(gA=function(e,t){return gA=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])},gA(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}gA(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),wA=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 yA(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)?CM(e):mM.unarmor(e),i=AM.decode(r);if(3===i.sub.length&&(i=i.sub[2].sub[0]),9===i.sub.length){t=i.sub[1].getHexStringValue(),this.n=NM(t,16),n=i.sub[2].getHexStringValue(),this.e=parseInt(n,16);var o=i.sub[3].getHexStringValue();this.d=NM(o,16);var a=i.sub[4].getHexStringValue();this.p=NM(a,16);var l=i.sub[5].getHexStringValue();this.q=NM(l,16);var s=i.sub[6].getHexStringValue();this.dmp1=NM(s,16);var c=i.sub[7].getHexStringValue();this.dmq1=NM(c,16);var d=i.sub[8].getHexStringValue();this.coeff=NM(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=NM(t,16),n=u.sub[1].getHexStringValue(),this.e=parseInt(n,16)}else t=i.sub[0].getHexStringValue(),this.n=NM(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 mA.asn1.DERInteger({int:0}),new mA.asn1.DERInteger({bigint:this.n}),new mA.asn1.DERInteger({int:this.e}),new mA.asn1.DERInteger({bigint:this.d}),new mA.asn1.DERInteger({bigint:this.p}),new mA.asn1.DERInteger({bigint:this.q}),new mA.asn1.DERInteger({bigint:this.dmp1}),new mA.asn1.DERInteger({bigint:this.dmq1}),new mA.asn1.DERInteger({bigint:this.coeff})]};return new mA.asn1.DERSequence(e).getEncodedHex()},t.prototype.getPrivateBaseKeyB64=function(){return fM(this.getPrivateBaseKey())},t.prototype.getPublicBaseKey=function(){var e=new mA.asn1.DERSequence({array:[new mA.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new mA.asn1.DERNull]}),t=new mA.asn1.DERSequence({array:[new mA.asn1.DERInteger({bigint:this.n}),new mA.asn1.DERInteger({int:this.e})]}),n=new mA.asn1.DERBitString({hex:"00"+t.getEncodedHex()});return new mA.asn1.DERSequence({array:[e,n]}).getEncodedHex()},t.prototype.getPublicBaseKeyB64=function(){return fM(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}(hA),bA="undefined"!=typeof process?null===(vA=process.env)||void 0===vA?void 0:vA.npm_package_version:void 0,EA=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 wA(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(hM(e))}catch(e){return!1}},e.prototype.encrypt=function(e){try{return fM(this.getKey().encrypt(e))}catch(e){return!1}},e.prototype.encryptOAEP=function(e){try{return fM(this.getKey().encrypt(e,fA))}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 fM(this.getKey().sign(e,t,n))}catch(e){return!1}},e.prototype.signSha256=function(e){return this.sign(e,function(e){return $M(JM(e))},"sha256")},e.prototype.verify=function(e,t,n){void 0===n&&(n=function(e){return e});try{return this.getKey().verify(e,hM(t),n)}catch(e){return!1}},e.prototype.verifySha256=function(e,t){return this.verify(e,t,function(e){return $M(JM(e))})},e.prototype.getKey=function(e){if(!this.key){if(this.key=new wA,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=bA,e}();async function MA(e,t,n="https"){if("http"===n){const n=new EA;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),o=await crypto.subtle.encrypt({name:"RSA-OAEP"},r,i);return btoa(String.fromCharCode(...new Uint8Array(o)))}}const AA=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}},xA=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}},LA=({data:r,isYaxisSticky:i=!1,barWidth:o,height:s,barGap:d=20,colors:u=[],xAxisLabel:f,isTruncateText:h=!0,yAxisLabel:p,padding:C=20,yAxisDivisions:m=5,barBorderRadius:g=0,legend:v=!0,showXAxisLabels:y=!0,icons:w=[],iconSize:b,legendPosition:E="bottom",legendGap:M=5,extendBarChartRightWidth:A=0,isYAxisValuePercentage:x=!1,selectedBar:L,setSelectedBar:k,onSelectedBar:H=e=>{},totalLabel:S="Total Execution",customToolTip:_=!1,isOnclick:V=!1,isDashboardVersions:O,type:z="",isMemory:N,tooltipWidth:I="fit-content"})=>{const T=a(null),[D,Z]=c(null),[j,R]=c(!1);l(()=>{const e=()=>{const e=T.current;e&&j&&(e.style.display="none")};return window.addEventListener("scroll",e,!0),()=>window.removeEventListener("scroll",e,!0)},[j]);const B=(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),U=r.map(e=>{if("string"==typeof e.value){let t=0;if("memory"===z)t=xA(e.value);else if(N)switch(B){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=xA(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 q=0;"memory"===z&&(q=r.reduce((e,t)=>"string"==typeof t.value?e+AA(t.value):e+1024*Number(t.value)*1024*1024,0));const W=q/1048576,Q=W<1024?`${Math.round(W)} mb`:`${(W/1024).toFixed(1)} gb`;let G=Math.max(...U.map(e=>e.normalizedValue));G="memory"===z?Math.max(G,1):Math.max(G,m);const K=40,Y=40,X=U.length*o+(U.length-1)*d+(i?Y:90)+A,J=Date.now(),$=t=>t.filter(e=>e.length>1).map((t,n)=>e("defs",{children:e("linearGradient",{id:`gradient-${J}-${z}-${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}-${z}-${e%u.length})`},te=(e,t,n,r,i)=>{R(!0);const o=T.current;if(o)if(o.style.display="block",_)o.innerHTML=`<div>\n <div><Typography fontWeight='semi-bold'>${e}</Typography></div>\n <div><Typography>${n||""}</Typography></div>\n <div><Typography>${S} : ${t} ${r?"("+r+"%)":""}</Typography></div>\n </div>`;else if(O){const e=i?i.join(", "):"";o.innerHTML=`\n <div>\n <div><Typography>${S} : ${t}</Typography></div>\n ${e?`<div><Typography>Versions : ${e}</Typography></div>`:""}\n </div>`}else o.innerHTML="memory"===z?`<strong>${e}</strong>: ${t} / ${Q}`:`<strong>${e}</strong>: ${t} ${x?"%":""}`},ne=(e,t=!1)=>{const n=T.current;if(n){const r=n.parentElement?.getBoundingClientRect(),i=window.scrollX,o=window.scrollY,a=1===U?.length||!t?e.clientX-(r?.left||0)+i+10:e.clientX-(r?.left||0)+i-n?.offsetWidth-10,l=e.clientY-(r?.top||0)+o-20;n.style.left=`${a}px`,n.style.top=`${l}px`}},re=()=>{R(!1);const e=T.current;e&&(e.style.display="none")},oe=e=>{k&&(k(e),V&&H(e))},ae=e=>{if(h){if(ie(e,10).endsWith("...")){const t=T.current;t&&(t.style.display="block",t.innerHTML=e)}}},le=(e,t,n)=>{if(h){ie(t,10).endsWith("...")&&ne(e,n===U.length-1)}};return n("div",{className:"ff-bar-chart-container",children:[e("div",{ref:T,className:"ff-bar-chart-tooltip",style:{width:I}}),v&&"top"===E&&e("div",{className:"ff-legend-container",children:e("div",{className:"ff-bar-chart-legend",style:{gap:`${M}px`},children:U.map((t,r)=>n("div",{className:"ff-bar-chart-legend-item",onMouseEnter:()=>Z(r),onMouseLeave:()=>Z(null),children:[w[r]&&"string"==typeof w[r]?e(P,{name:String(w[r]),width:b,height:b}):e("span",{className:"ff-bar-chart-legend-item-circle",style:{backgroundColor:u[r%u.length]?.[0]||"grey"}}),e(F,{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+K+(f?20:0),children:n(t,{children:[Array.from({length:m+1}).map((t,n)=>{const r=s-n/m*s+K+4,i=n*G/m,o="memory"===z?i.toFixed(1):x?`${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:o},n)}),p&&e("text",{x:-(s/2+35),y:i?20:10,transform:"rotate(-90)",fill:"black",textAnchor:"middle",alignmentBaseline:"middle",className:"ff-bar-chart-labels",children:p})]})})}),e("div",{className:"ff-chart-scrollable",children:n("svg",{width:X,height:s+K+5+(y?20:0)+(f?20:0),children:[Array.isArray(u)&&u.length>0&&$(u),U.map((t,r)=>{const i=t.normalizedValue/G*s,a=t.normalizedValue<1?2:i,l=r*(o+d)+C,c=s-a+K,u=b||20,f=l+o/2-u/2,p=c-u,m=L===t.label,v=D===r;return n("g",{children:[w[r]&&"string"==typeof w[r]&&e("g",{onMouseEnter:()=>te(t.label,"memory"===z?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ne(e,r===U.length-1),onMouseLeave:re,children:e(P,{name:String(w[r]),x:String(f),y:String(p),width:u,height:u,chartIcon:!0})}),e("rect",{x:l,y:c,width:o,height:a,fill:ee(r),rx:g,ry:g,style:{strokeWidth:m?3:0,opacity:null===D||v?1:.3,cursor:V?"pointer":"default",transition:"opacity 0.5s ease"},onMouseEnter:()=>te(t.label,"memory"===z||N?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ne(e,r===U.length-1),onMouseLeave:re,onClick:()=>oe(t.label)}),m&&V&&e("rect",{x:l,y:c,width:o,height:a,fill:"var(--select-chart-highlight-color)",rx:g,ry:g,onMouseEnter:()=>te(t.label,"memory"===z?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ne(e,r===U.length-1),onMouseLeave:re}),y&&e("text",{onMouseEnter:()=>ae(t.label),onMouseMove:e=>le(e,t.label,r),onMouseLeave:re,x:0===r?l:r===U.length-1?l+o:l+o/2,y:s+K+15,className:"ff-bar-chart-labels",fill:m?"var(--brand-color)":"black",fontWeight:m?"bold":"normal",textAnchor:0===r?"start":"middle",children:h?ie(t.label,10):t.label})]},r)}),e("line",{x1:i?0:C,y1:s+K,x2:X,y2:s+K,stroke:"#D9D9D9",strokeWidth:"1"}),!i&&f&&e("text",{x:X/2,y:s+K+(y?40:20),fontSize:"12",fill:"black",textAnchor:"middle",className:"ff-bar-chart-labels",children:f})]})}),e("div",{className:"ff-bar-chart-x-axis-label",children:f})]}):e("div",{children:n("svg",{width:X,height:s+K+5+(y?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+K+4,i=n*G/m,o="memory"===z?i.toFixed(1):x?`${i.toFixed(0).padStart(2,"0")}%`:i.toFixed(0).padStart(2,"0");return e("text",{x:Y,y:r,fill:"black",textAnchor:"middle",className:"ff-bar-chart-labels",children:o},n)}),U.map((t,r)=>{const i=t.normalizedValue/G*s,a=t.normalizedValue<1?2:i,l=r*(o+d)+Y+C,c=s-a+K,u=b||20,f=l+o/2-u/2,p=c-u,m=L===t.label,v=D===r;return n("g",{children:[w[r]&&"string"==typeof w[r]&&e("g",{onMouseEnter:()=>te(t.label,"memory"===z?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ne(e,r===U.length-1),onMouseLeave:re,children:e(P,{name:String(w[r]),x:String(f),y:String(p),width:u,height:u,chartIcon:!0})}),e("rect",{x:l,y:c,width:o,height:a,fill:ee(r),rx:g,ry:g,style:{strokeWidth:m?3:0,opacity:null===D||v?1:.3,cursor:V?"pointer":"default",transition:"opacity 0.5s ease"},onMouseEnter:()=>te(t.label,"memory"===z||N?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ne(e,r===U.length-1),onMouseLeave:re,onClick:()=>oe(t.label)}),m&&V&&e("rect",{x:l,y:c,width:o,height:a,fill:"var(--select-chart-highlight-color)",rx:g,ry:g,onMouseEnter:()=>te(t.label,"memory"===z?t.value:t.normalizedValue,t.id,t.percent,t.versions),onMouseMove:e=>ne(e,r===U.length-1),onMouseLeave:re}),y&&e("g",{children:e("text",{x:0===r?l:r===U.length-1?l+o:l+o/2,y:s+K+15,className:"ff-bar-chart-labels",fill:m?"var(--brand-color)":"black",fontWeight:m?"bold":"normal",textAnchor:0===r?"start":"middle",onMouseEnter:()=>ae(t.label),onMouseMove:e=>le(e,t.label,r),onMouseLeave:re,children:h?ie(t.label,10):t.label})})]},r)}),e("line",{x1:60,y1:s+K,x2:X,y2:s+K,stroke:"#D9D9D9",strokeWidth:"1"}),f&&e("text",{x:X/2,y:s+K+(y?40:20),fontSize:"12",fill:"black",textAnchor:"middle",className:"ff-bar-chart-labels",children:f}),p&&e("text",{x:-(s/2+35),y:10,transform:"rotate(-90)",fill:"black",textAnchor:"middle",alignmentBaseline:"middle",className:"ff-bar-chart-labels",children:p})]})}),v&&"bottom"===E&&e("div",{className:"ff-legend-container",children:e("div",{className:"ff-bar-chart-legend",style:{gap:`${M}px`},children:r.map((t,r)=>n("div",{className:"ff-bar-chart-legend-item",onMouseEnter:()=>Z(r),onMouseLeave:()=>Z(null),children:[w[r]&&"string"==typeof w[r]?e(P,{name:String(w[r]),width:b,height:b}):e("span",{className:"ff-bar-chart-legend-item-circle",style:{backgroundColor:u[r%u.length]?.[0]||"grey"}}),e("div",{children:e(F,{as:"div",fontSize:10,fontWeight:"regular",className:"ff-legend-label",children:t.label})})]},t.label))})})]})},kA=(e,t,n,r,i)=>{const o=e+n*Math.cos(r),a=t+n*Math.sin(r),l=e+n*Math.cos(i),s=t+n*Math.sin(i);return`M ${o} ${a} A ${n} ${n} 0 ${i-r>Math.PI?1:0} 1 ${l} ${s}`},HA=({radius:r,lineWidth:i,lineCap:o,barValues:a,labelHeading:l,legendType:s="numberLegend",isLegendDetails:d=!0,isPillValueVisible:u=!0,chartToLegendGap:f="16px",legendGap:h="8px",labelFontSize:p=12,subLabelFontSize:C=8,gapBetweenArch:m=10,capsuleStyle:g={padding:"4px"}})=>{const[v,y]=c({visible:!1,x:0,y:0,content:"",isArc:!1}),[w,b]=c(null),E=(e,t)=>Array.isArray(e.arcColor)?`url(#gradient-${t})`:e.arcColor,M=e=>Array.isArray(e.arcColor)?e.arcColor[0]:e.arcColor,A=a.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)}}),x=A.reduce((e,t)=>e+t.normalizedValue,0),L=r,k=i+m,H=2*(L+k*(A.length-1)+i),S=[...A].reverse(),_=l.trim().split(" "),V=(e,t,n)=>{const{clientX:r,clientY:i}=e;y({visible:!0,x:r,y:i,content:t,isArc:n})},O=e=>{const{clientX:t,clientY:n}=e;y(e=>({...e,x:t,y:n}))},z=()=>{y({visible:!1,x:0,y:0,content:"",isArc:!1})};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:H,height:H},children:n("svg",{width:H,height:H,viewBox:`0 0 ${H} ${H}`,className:"absolute top-0 left-0",children:[e("defs",{children:a.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(${H/2+1}, ${H/2+1})`,children:[S.map((t,r)=>{const a=A.length-1-r,l=2*(t.normalizedValue/x)*Math.PI;let s=-Math.PI/2,c=s+l;t.normalizedValue===x&&(s=0,c=2*Math.PI);const d=L+k*a,u=kA(0,0,d,0,2*Math.PI),f={opacity:null!==w?t.barLabel===w?1:.2:1,transition:"opacity 0.3s ease"};if(0===t.normalizedValue){const r=d*Math.cos(-Math.PI/2),o=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:o,r:i+1,fill:E({...t,label:t.barLabel||"",key:t.labelValue?.toString()||""},a),onMouseEnter:e=>V(e,`${t.barLabel||"Data"}: ${t.value}`,!0),onMouseMove:O,onMouseLeave:z,style:f})]},a)}const h=kA(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()||""},a),strokeWidth:i,strokeLinecap:"square"===o?"butt":"round",onMouseEnter:e=>V(e,`${t.barLabel||"Data"}: ${t.value}`,!0),onMouseMove:O,onMouseLeave:z,style:{pointerEvents:"stroke",...f}})]},a)}),e("text",{x:"0",y:`-${i+m+2}`,fill:(()=>{if(!v.visible)return"";const e=v.content.split(":")[0]?.trim();if(void 0===e)return"";const t=A.find(t=>t.barLabel===e);if(!t)return"";const n={...t,label:t.barLabel,key:t.labelValue?.toString()??""};return M(n)})(),textAnchor:"middle",dominantBaseline:"central",children:v.visible?n(t,{children:[e("tspan",{x:"0",dy:"0",className:"ff-center-text-tooltip",children:(N=v.content.split(":")[1]?.trim()||"",I=9,N.length>I?N.slice(0,I)+"...":N)}),v.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:_.map((t,r)=>{if(0===r){const[i,...o]=t.split(" ");return n("tspan",{children:[e("tspan",{x:"0",dy:"0",style:{fontSize:`${p}px`},className:"ff-center-first-text",children:i}),e("tspan",{x:"0",dy:18,style:{fontSize:`${C}px`},className:"ff-center-text",children:o.join(" ")})]},r)}return e("tspan",{x:"0",dy:0===r?0:18,className:"ff-center-text",style:{fontSize:`${C}px`},children:t},r)})})})]})]})}),v.visible&&e("div",{className:"ff-multi-radial-tooltip",style:{position:"fixed",top:`${v.y+10}px`,left:`${v.x+15}px`,zIndex:1e3,pointerEvents:"none"},children:v.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=>{b(t.barLabel||t.label),V(e,`${t.barLabel||"Data"}: ${t.value}`,!1)},onMouseMove:O,onMouseLeave:()=>{b(null),z()},children:[e(F,{fontSize:20,fontWeight:"semi-bold",className:"ff-legend-value",color:M(t),children:t.key.padStart(2,"0")}),e(F,{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=>{b(t.barLabel||t.label),V(e,`${t.barLabel||"Data"}: ${t.value}`,!1)},onMouseMove:O,onMouseLeave:()=>{b(null),z()},children:[e("span",{className:"ff-legend-capsule",style:{backgroundColor:M(t)},children:e(F,{fontSize:10,color:"var(--tooltip-text-color)",style:g,children:u&&t.value})}),e(F,{className:"ff-legend-key",children:t.label})]},r))});default:return null}})(A.map(e=>({...e,label:e?.barLabel,key:e.labelValue?.toString()})),s)]});var N,I};function SA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function _A(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function OA(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?VA(Object(n),!0).forEach(function(t){_A(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VA(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function zA(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function IA(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?NA(Object(n),!0).forEach(function(t){zA(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NA(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function TA(e){return function t(){for(var n=this,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return i.length>=e.length?e.apply(this,i):function(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];return t.apply(n,[].concat(i,r))}}}function DA(e){return{}.toString.call(e).includes("Object")}function ZA(e){return"function"==typeof e}var jA=TA(function(e,t){throw new Error(e[t]||e.default)})({initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"}),RA={changes:function(e,t){return DA(t)||jA("changeType"),Object.keys(t).some(function(t){return n=e,r=t,!Object.prototype.hasOwnProperty.call(n,r);var n,r})&&jA("changeField"),t},selector:function(e){ZA(e)||jA("selectorType")},handler:function(e){ZA(e)||DA(e)||jA("handlerType"),DA(e)&&Object.values(e).some(function(e){return!ZA(e)})&&jA("handlersType")},initial:function(e){var t;e||jA("initialIsRequired"),DA(e)||jA("initialType"),t=e,Object.keys(t).length||jA("initialContent")}};function BA(e,t){return ZA(t)?t(e.current):t}function PA(e,t){return e.current=IA(IA({},e.current),t),t}function FA(e,t,n){return ZA(t)?t(e.current):Object.keys(n).forEach(function(n){var r;return null===(r=t[n])||void 0===r?void 0:r.call(t,e.current[n])}),n}var UA={create:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};RA.initial(e),RA.handler(t);var n={current:e},r=TA(FA)(n,t),i=TA(PA)(n),o=TA(RA.changes)(e),a=TA(BA)(n);return[function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(e){return e};return RA.selector(e),e(n.current)},function(e){!function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}}(r,i,o,a)(e)}]}};var qA={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:"Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n "},WA=function(e){return function t(){for(var n=this,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return i.length>=e.length?e.apply(this,i):function(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];return t.apply(n,[].concat(i,r))}}}(function(e,t){throw new Error(e[t]||e.default)})(qA),QA={config:function(e){var t;return e||WA("configIsRequired"),t=e,{}.toString.call(t).includes("Object")||WA("configType"),e.urls?(console.warn(qA.deprecation),{paths:{vs:e.urls.monacoBase}}):e}};function GA(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],GA(e[n],t[n]))}),OA(OA({},e),t)}var KA={type:"cancelation",msg:"operation is manually canceled"};function YA(e){var t=!1,n=new Promise(function(n,r){e.then(function(e){return t?r(KA):n(e)}),e.catch(r)});return n.cancel=function(){return t=!0},n}var XA,JA,$A=["monaco"],ex=UA.create({config:{paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}},isInitialized:!1,resolve:null,reject:null,monaco:null}),tx=(JA=2,function(e){if(Array.isArray(e))return e}(XA=ex)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,l=[],s=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t);else for(;!(s=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,i=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return l}}(XA,JA)||function(e,t){if(e){if("string"==typeof e)return SA(e,t);var n={}.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)?SA(e,t):void 0}}(XA,JA)||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.")}()),nx=tx[0],rx=tx[1];function ix(e){return document.body.appendChild(e)}function ox(e){var t=nx(function(e){return{config:e.config,reject:e.reject}}),n=function(e){var t=document.createElement("script");return e&&(t.src=e),t}("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function ax(){var e=nx(function(e){return{config:e.config,resolve:e.resolve,reject:e.reject}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(t){var n=t.m||t;lx(n),e.resolve(n)},function(t){e.reject(t)})}function lx(e){nx().monaco||rx({monaco:e})}var sx=new Promise(function(e,t){return rx({resolve:e,reject:t})}),cx={config:function(e){var t=QA.config(e),n=t.monaco,r=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(t,$A);rx(function(e){return{config:GA(e.config,r),monaco:n}})},init:function(){var e=nx(function(e){return{monaco:e.monaco,isInitialized:e.isInitialized,resolve:e.resolve}});if(!e.isInitialized){if(rx({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),YA(sx);if(window.monaco&&window.monaco.editor)return lx(window.monaco),e.resolve(window.monaco),YA(sx);!function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}}(ix,ox)(ax)}return YA(sx)},__getMonacoInstance:function(){return nx(function(e){return e.monaco})}},dx={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},ux={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}};var fx=function({children:e}){return i.createElement("div",{style:ux.container},e)},hx=fx;var px=function({width:e,height:t,isEditorReady:n,loading:r,_ref:o,className:a,wrapperProps:l}){return i.createElement("section",{style:{...dx.wrapper,width:e,height:t},...l},!n&&i.createElement(hx,null,r),i.createElement("div",{ref:o,style:{...dx.fullWidth,...!n&&dx.hide},className:a}))},Cx=g(px);var mx=function(e){l(e,[])};var gx=function(e,t,n=!0){let r=a(!0);l(r.current||!n?()=>{r.current=!1}:e,t)};function vx(){}function yx(e,t,n,r){return function(e,t){return e.editor.getModel(wx(e,t))}(e,r)||function(e,t,n,r){return e.editor.createModel(t,n,r?wx(e,r):void 0)}(e,t,n,r)}function wx(e,t){return e.Uri.parse(t)}var bx=function({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:o,originalModelPath:s,modifiedModelPath:d,keepCurrentOriginalModel:u=!1,keepCurrentModifiedModel:f=!1,theme:h="light",loading:C="Loading...",options:m={},height:g="100%",width:v="100%",className:y,wrapperProps:w={},beforeMount:b=vx,onMount:E=vx}){let[M,A]=c(!1),[x,L]=c(!0),k=a(null),H=a(null),S=a(null),_=a(E),V=a(b),O=a(!1);mx(()=>{let e=cx.init();return e.then(e=>(H.current=e)&&L(!1)).catch(e=>"cancelation"!==e?.type&&console.error("Monaco initialization: error:",e)),()=>k.current?function(){let e=k.current?.getModel();u||e?.original?.dispose(),f||e?.modified?.dispose(),k.current?.dispose()}():e.cancel()}),gx(()=>{if(k.current&&H.current){let t=k.current.getOriginalEditor(),i=yx(H.current,e||"",r||n||"text",s||"");i!==t.getModel()&&t.setModel(i)}},[s],M),gx(()=>{if(k.current&&H.current){let e=k.current.getModifiedEditor(),r=yx(H.current,t||"",o||n||"text",d||"");r!==e.getModel()&&e.setModel(r)}},[d],M),gx(()=>{let e=k.current.getModifiedEditor();e.getOption(H.current.editor.EditorOption.readOnly)?e.setValue(t||""):t!==e.getValue()&&(e.executeEdits("",[{range:e.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),e.pushUndoStop())},[t],M),gx(()=>{k.current?.getModel()?.original.setValue(e||"")},[e],M),gx(()=>{let{original:e,modified:t}=k.current.getModel();H.current.editor.setModelLanguage(e,r||n||"text"),H.current.editor.setModelLanguage(t,o||n||"text")},[n,r,o],M),gx(()=>{H.current?.editor.setTheme(h)},[h],M),gx(()=>{k.current?.updateOptions(m)},[m],M);let z=p(()=>{if(!H.current)return;V.current(H.current);let i=yx(H.current,e||"",r||n||"text",s||""),a=yx(H.current,t||"",o||n||"text",d||"");k.current?.setModel({original:i,modified:a})},[n,t,o,e,r,s,d]),N=p(()=>{!O.current&&S.current&&(k.current=H.current.editor.createDiffEditor(S.current,{automaticLayout:!0,...m}),z(),H.current?.editor.setTheme(h),A(!0),O.current=!0)},[m,h,z]);return l(()=>{M&&_.current(k.current,H.current)},[M]),l(()=>{!x&&!M&&N()},[x,M,N]),i.createElement(Cx,{width:v,height:g,isEditorReady:M,loading:C,_ref:S,className:y,wrapperProps:w})};g(bx);var Ex=function(e){let t=a();return l(()=>{t.current=e},[e]),t.current},Mx=new Map;var Ax,xx=function({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:o,path:s,theme:d="light",line:u,loading:f="Loading...",options:h={},overrideServices:C={},saveViewState:m=!0,keepCurrentModel:g=!1,width:v="100%",height:y="100%",className:w,wrapperProps:b={},beforeMount:E=vx,onMount:M=vx,onChange:A,onValidate:x=vx}){let[L,k]=c(!1),[H,S]=c(!0),_=a(null),V=a(null),O=a(null),z=a(M),N=a(E),I=a(),T=a(r),D=Ex(s),Z=a(!1),j=a(!1);mx(()=>{let e=cx.init();return e.then(e=>(_.current=e)&&S(!1)).catch(e=>"cancelation"!==e?.type&&console.error("Monaco initialization: error:",e)),()=>V.current?(I.current?.dispose(),g?m&&Mx.set(s,V.current.saveViewState()):V.current.getModel()?.dispose(),void V.current.dispose()):e.cancel()}),gx(()=>{let i=yx(_.current,e||r||"",t||o||"",s||n||"");i!==V.current?.getModel()&&(m&&Mx.set(D,V.current?.saveViewState()),V.current?.setModel(i),m&&V.current?.restoreViewState(Mx.get(s)))},[s],L),gx(()=>{V.current?.updateOptions(h)},[h],L),gx(()=>{!V.current||void 0===r||(V.current.getOption(_.current.editor.EditorOption.readOnly)?V.current.setValue(r):r!==V.current.getValue()&&(j.current=!0,V.current.executeEdits("",[{range:V.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),V.current.pushUndoStop(),j.current=!1))},[r],L),gx(()=>{let e=V.current?.getModel();e&&o&&_.current?.editor.setModelLanguage(e,o)},[o],L),gx(()=>{void 0!==u&&V.current?.revealLine(u)},[u],L),gx(()=>{_.current?.editor.setTheme(d)},[d],L);let R=p(()=>{if(O.current&&_.current&&!Z.current){N.current(_.current);let i=s||n,a=yx(_.current,r||e||"",t||o||"",i||"");V.current=_.current?.editor.create(O.current,{model:a,automaticLayout:!0,...h},C),m&&V.current.restoreViewState(Mx.get(i)),_.current.editor.setTheme(d),void 0!==u&&V.current.revealLine(u),k(!0),Z.current=!0}},[e,t,n,r,o,s,h,C,m,d,u]);return l(()=>{L&&z.current(V.current,_.current)},[L]),l(()=>{!H&&!L&&R()},[H,L,R]),T.current=r,l(()=>{L&&A&&(I.current?.dispose(),I.current=V.current?.onDidChangeModelContent(e=>{j.current||A(V.current.getValue(),e)}))},[L,A]),l(()=>{if(L){let e=_.current.editor.onDidChangeMarkers(e=>{let t=V.current.getModel()?.uri;if(t&&e.find(e=>e.path===t.path)){let e=_.current.editor.getModelMarkers({resource:t});x?.(e)}});return()=>{e?.dispose()}}return()=>{}},[L,x]),i.createElement(Cx,{width:v,height:y,isEditorReady:L,loading:f,_ref:O,className:w,wrapperProps:b})},Lx=g(xx),kx={exports:{}},Hx={},Sx={exports:{}},_x={},Vx={};function Ox(){if(Ax)return Vx;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 Ax=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--}},Vx.Output=n,Vx}var zx,Nx={};function Ix(){if(zx)return Nx;return zx=1,Nx.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},Nx}var Tx,Dx={};function Zx(){return Tx||(Tx=1,o="(?:"+(i="\\\\u[0-9a-fA-F]{4}|\\\\u\\{[0-9a-fA-F]+\\}")+"|[\\x23\\x24\\x40\\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")+"])",a="(?:"+i+"|["+(t="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a")+n+(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")+"])*",(e=Dx).identifier=new RegExp(o+a,"g"),e.identifierStart=new RegExp(o),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")),Dx;var e,t,n,r,i,o,a}var jx,Rx,Bx={},Px={};function Fx(){if(jx)return Px;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 jx=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)})},Px.Options=e,Px.normalizeOpts=n,Px.mergeOpts=t,Px}function Ux(){if(Rx)return Bx;Rx=1;var e=Fx().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 o=0;o<i.length;o++)"preserve-inline"===i[o]?this.brace_preserve_inline=!0:this.brace_style=i[o];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,Bx.Options=n,Bx}var qx,Wx={},Qx={};function Gx(){if(qx)return Qx;qx=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},Qx.InputScanner=t,Qx}var Kx,Yx={},Xx={};var Jx,$x,eL,tL={},nL={};function rL(){if(Jx)return nL;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 Jx=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(){},nL.Pattern=e,nL}function iL(){if(eL)return Yx;eL=1;var e=Gx().InputScanner,t=Ix().Token,n=function(){if(Kx)return Xx;function e(e){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=e}return Kx=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},Xx.TokenStream=e,Xx}().TokenStream,r=function(){if($x)return tL;$x=1;var e=rL().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},tL.WhitespacePattern=t,tL}().WhitespacePattern,i={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},o=function(t,n){this._input=new e(t),this._options=n||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new r(this._input)};return o.prototype.tokenize=function(){var e;this._input.restart(),this.__tokens=new n,this._reset();for(var r=new t(i.START,""),o=null,a=[],l=new n;r.type!==i.EOF;){for(e=this._get_next_token(r,o);this._is_comment(e);)l.add(e),e=this._get_next_token(r,o);l.isEmpty()||(e.comments_before=l,l=new n),e.parent=o,this._is_opening(e)?(a.push(o),o=e):o&&this._is_closing(e,o)&&(e.opened=o,o.closed=e,o=a.pop(),e.parent=o),e.previous=r,r.next=e,this.__tokens.add(e),r=e}return this.__tokens},o.prototype._is_first_token=function(){return this.__tokens.isEmpty()},o.prototype._reset=function(){},o.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,"")},o.prototype._is_comment=function(e){return!1},o.prototype._is_opening=function(e){return!1},o.prototype._is_closing=function(e,t){return!1},o.prototype._create_token=function(e,n){return new t(e,n,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token)},o.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},Yx.Tokenizer=o,Yx.TOKEN=i,Yx}var oL,aL={};function lL(){if(oL)return aL;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 oL=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)},aL.Directives=e,aL}var sL,cL,dL,uL,fL={};function hL(){if(sL)return fL;sL=1;var e=rL().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},fL.TemplatablePattern=n,fL}function pL(){if(cL)return Wx;cL=1;var e=Gx().InputScanner,t=iL().Tokenizer,n=iL().TOKEN,r=lL().Directives,i=Zx(),o=rL().Pattern,a=hL().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(" "),p=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";p=(p="\\?\\.(?!\\d) "+(p=p.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"))).replace(/ /g,"|");var C,m=new RegExp(p),g="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),v=g.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),y=new RegExp("^(?:"+v.join("|")+")$"),w=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 o(this._input),l=new a(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(w.prototype=new t)._is_comment=function(e){return e.type===s.COMMENT||e.type===s.BLOCK_COMMENT||e.type===s.UNKNOWN},w.prototype._is_opening=function(e){return e.type===s.START_BLOCK||e.type===s.START_EXPR},w.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)},w.prototype._reset=function(){C=!1},w.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())},w.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)&&y.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},w.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},w.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},w.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)},w.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 C=!0,this._create_token(s.COMMENT,t)}}else if(C&&"-"===e&&(t=this.__patterns.html_comment_end.read()))return C=!1,this._create_token(s.COMMENT,t);return null},w.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},w.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),o=null;for(;i.hasNext();)if((o=i.match(/([\s]|[^\\]|\\\\)+/g))&&(n+=o[0]),"\\"===i.peek()){if(i.next(),"x"===i.peek())o=i.match(/x([0-9A-Fa-f]{2})/g);else{if("u"!==i.peek()){n+="\\",i.hasNext()&&(n+=i.next());continue}(o=i.match(/u([0-9A-Fa-f]{4})/g))||(o=i.match(/u\{([0-9A-Fa-f]+)\}/g))}if(!o)return t;if((r=parseInt(o[1],16))>126&&r<=255&&0===o[0].indexOf("x"))return t;n+=r>=0&&r<32||r>1114111?"\\"+o[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},w.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])},w.prototype._read_regexp=function(e,t){if("/"===e&&this._allow_regexp_or_xml(t)){for(var n=this._input.next(),r=!1,o=!1;this._input.hasNext()&&(r||o||this._input.peek()!==e)&&!this._input.testChar(i.newline);)n+=this._input.peek(),r?r=!1:(r="\\"===this._input.peek(),"["===this._input.peek()?o=!0:"]"===this._input.peek()&&(o=!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},w.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 o=r[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),a=0===o.indexOf("{"),l=0;r;){var c=!!r[1],d=r[2];if(!(!!r[r.length-1]||"![CDATA["===d.slice(0,8))&&(d===o||a&&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},w.prototype._read_string_recursive=function(e,t,n){var r,o;"'"===e?o=this.__patterns.single_quote:'"'===e?o=this.__patterns.double_quote:"`"===e?o=this.__patterns.template_text:"}"===e&&(o=this.__patterns.template_expression);for(var a=o.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()))),a+=l+=o.read()}return a},Wx.Tokenizer=w,Wx.TOKEN=s,Wx.positionable_operators=h.slice(),Wx.line_starters=g.slice(),Wx}function CL(){if(dL)return _x;dL=1;var e=Ox().Output,t=Ix().Token,n=Zx(),r=Ux().Options,i=pL().Tokenizer,o=pL().line_starters,a=pL().positionable_operators,l=pL().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"]),p=[h.before_newline,h.preserve_newline],C="BlockStatement",m="Statement",g="ObjectLiteral",v="ArrayLiteral",y="ForInitializer",w="Conditional",b="Expression";function E(e,t){t.multiline_frame||t.mode===y||t.mode===w||e.remove_indent(t.start_line_index)}function M(e){return e===v}function A(e){return s(e,[b,y,w])}function x(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)}x.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}},x.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(C);var r=new i(t,this._options);return this._tokens=r.tokenize(),t},x.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)},x.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))},x.prototype.handle_whitespace_and_comments=function(e,t){var n=e.newlines,r=this._options.keep_array_indentation&&M(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 o=0;o<n;o+=1)this.print_newline(o>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 a=1;a<n;a+=1)this.print_newline(!0,t)}};var L=["async","break","continue","return","throw","yield"];return x.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,a)||s(e.text,a)){var r=s(this._flags.last_token.text,a)&&s(this._options.operator_position,p)||s(e.text,a);n=n&&r}if(n)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(u(this._flags.last_token,L))return;this._output.set_wrap_point()}}},x.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)},x.prototype.print_token_line_indentation=function(e){this._output.just_added_newline()&&(this._options.keep_array_indentation&&e.newlines&&("["===e.text||M(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))},x.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)}},x.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},x.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))},x.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)},x.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))},x.prototype.start_of_object_property=function(){return this._flags.parent.mode===g&&this._flags.mode===m&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||u(this._flags.last_token,["get","set"]))},x.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===g&&this._flags.mode===m)&&u(this._flags.last_token,L)&&!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===y||this._previous_flags.mode===w))||this._flags.last_token.type===l.WORD&&this._flags.mode===C&&!this._flags.in_case&&!("--"===e.text||"++"===e.text)&&"function"!==this._last_last_text&&e.type!==l.WORD&&e.type!==l.RESERVED)||this._flags.mode===g&&(":"===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)},x.prototype.handle_start_expr=function(e){this.start_of_statement(e)||this.handle_whitespace_and_comments(e);var t=b;if("["===e.text){if(this._flags.last_token.type===l.WORD||")"===this._flags.last_token.text)return u(this._flags.last_token,o)&&(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=v,M(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=y):s(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,t=w):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,o)||"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===g?"{"!==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===g&&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()},x.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&&M(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===w&&(this._previous_flags.mode=b,this._flags.do_block=!1,this._flags.do_while=!1)},x.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(C),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(C):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(C):this.set_mode(g):this._flags.last_token.type===l.OPERATOR&&"=>"===this._flags.last_token.text?this.set_mode(C):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(g):this.set_mode(C),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 o=0,a=null;this._flags.inline_frame=!0;do{if(o+=1,(a=this._tokens.peek(o-1)).newlines){this._flags.inline_frame=!1;break}}while(a.type!==l.EOF&&(a.type!==l.END_BLOCK||a.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):(!M(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()},x.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||(M(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)},x.prototype.handle_word=function(e){if(e.type===l.RESERVED)if(s(e.text,["set","get"])&&this._flags.mode!==g)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===g){":"===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||A(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===g||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,L)||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||!A(this._flags.mode)&&!M(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===C?t="NEWLINE":this._flags.last_token.type===l.SEMICOLON&&A(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===g&&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,o)&&")"!==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!==C||"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,o)&&")"!==this._flags.last_token.text&&this.print_newline():this._flags.multiline_frame&&M(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))},x.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)},x.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)},x.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},x.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?(A(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===g||this._flags.mode===m&&this._flags.parent.mode===g?(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)},x.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,o)||","===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,p)&&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,a)){var g=":"===e.text,v=g&&d,y=g&&!d;switch(this._options.operator_position){case h.before_newline:return this._output.space_before_token=!y,this.print_token(e),g&&!v||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,!g||v?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 y||this.allow_wrap_or_preserved_newline(e),i=!(this._output.just_added_newline()||y),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 w=this._tokens.peek();c=w&&s(w.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 b=u(this._flags.last_token,f)&&e.newlines;b&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(b,!0)}";"===this._flags.last_token.text&&A(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!==C||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)},x.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))},x.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),o=!1,a=!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(o=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),"*"),a=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),o&&(this._flags.alignment=1),r=0;r<i.length;r++)o?(this.print_token_line_indentation(e),this._output.add_token(c(i[r]))):a&&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}},x.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)},x.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)},x.prototype.handle_unknown=function(e,t){this.print_token(e),"\n"===e.text[e.text.length-1]&&this.print_newline(!1,t)},x.prototype.handle_eof=function(e){for(;this._flags.mode===m;)this.restore_mode();this.handle_whitespace_and_comments(e)},_x.Beautifier=x,_x}var mL,gL,vL,yL={exports:{}},wL={},bL={};function EL(){if(mL)return bL;mL=1;var e=Fx().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,bL.Options=t,bL}function ML(){if(vL)return yL.exports;vL=1;var e=function(){if(gL)return wL;gL=1;var e=EL().Options,t=Ox().Output,n=Gx().InputScanner,r=new(0,lL().Directives)(/\/\*/,/\*\//),i=/\r\n|[\r\n]/,o=/\r\n|[\r\n]/g,a=/\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=a.test(this._input.peek()),n=0;a.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(o,"\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,p=0,C=!1,m=!1,g=!1,v=!1,y=!1,w=this._ch,b=!1;f=""!==this._input.read(l),h=w,this._ch=this._input.next(),"\\"===this._ch&&this._input.hasNext()&&(this._ch+=this._input.next()),w=this._ch,this._ch;)if("/"===this._ch&&"*"===this._input.peek()){this._output.add_new_line(),this._input.back();var E=this._input.read(s),M=r.get_directives(E);M&&"start"===M.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 A=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);A.match(/[ :]$/)&&(A=this.eatString(": ").replace(/\s+$/,""),this.print_string(A),this._output.space_before_token=!0),0===p&&-1!==A.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 x=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);x.match(/[ :]$/)&&(x=this.eatString(": ").replace(/\s+$/,""),this.print_string(x),this._output.space_before_token=!0),0===p&&-1!==x.indexOf(":")?(m=!0,this.indent()):x in this.NESTED_AT_RULE?(this._nestedLevel+=1,x in this.CONDITIONAL_GROUP_RULE&&(g=!0)):0!==p||m||(v=!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()),v=!1,g?(g=!1,C=this._indentLevel>=this._nestedLevel):C=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&C&&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),C=!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 L=0;L<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;L++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[L])){b=!0;break}!C&&!g||this._input.lookBack("&")||this.foundNestedPseudoClass()||this._input.lookBack("(")||v||0!==p?(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 k='"'===h||"'"===h;this.preserveSingleSpace(k||f),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(";"===this._ch)b=!1,0===p?(m&&(this.outdent(),m=!1),v=!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(),p++,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(")")),p&&(p--,this.outdent()));else{var H=!1;this._input.lookBack("with")&&(H=!0),this.preserveSingleSpace(f||H),this.print_string(this._ch),m&&"$"===h&&this._options.selector_separator_newline?(this._output.add_new_line(),y=!0):(this.eatWhitespace(),p++,this.indent())}else if(")"===this._ch)p&&(p--,this.outdent()),y&&";"===this._input.peek()&&this._options.selector_separator_newline&&(y=!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&&!y||0!==p||v?this._output.space_before_token=!0:this._output.add_new_line();else if(">"!==this._ch&&"+"!==this._ch&&"~"!==this._ch||m||0!==p)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("="),a.test(this._ch)&&(this._ch="");else if("!"!==this._ch||this._input.lookBack("\\")){var S='"'===h||"'"===h;this.preserveSingleSpace(S||f),this.print_string(this._ch),!this._output.just_added_newline()&&"\n"===this._input.peek()&&b&&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&&a.test(this._ch)&&(this._ch=""));return this._output.get_code(d)},wL.Beautifier=d,wL}().Beautifier,t=EL().Options;return yL.exports=function(t,n){return new e(t,n).beautify()},yL.exports.defaultOptions=function(){return new t},yL.exports}var AL,xL={exports:{}},LL={},kL={};function HL(){if(AL)return kL;AL=1;var e=Fx().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,kL.Options=t,kL}var SL,_L,VL,OL,zL,NL={};function IL(){if(SL)return NL;SL=1;var e=iL().Tokenizer,t=iL().TOKEN,n=lL().Directives,r=hL().TemplatablePattern,i=rL().Pattern,o={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},a=new n(/<\!--/,/-->/),l=function(t,n){e.call(this,t,n),this._current_tag_name="";var o=new r(this._input).read_options(this._options),a=new i(this._input);if(this.__patterns={word:o.until(/[\n\r\t <]/),word_control_flow_close_excluded:o.until(/[\n\r\t <}]/),single_quote:o.until_after(/'/),double_quote:o.until_after(/"/),attribute:o.until(/[\n\r\t =>]|\/>/),element_name:o.until(/[\n\r\t >\/]/),angular_control_flow_start:a.matching(/\@[a-zA-Z]+[^({]*[({]/),handlebars_comment:a.starting_with(/{{!--/).until_after(/--}}/),handlebars:a.starting_with(/{{/).until_after(/}}/),handlebars_open:a.until(/[\n\r\t }]/),handlebars_raw_close:a.until(/}}/),comment:a.starting_with(/<!--/).until_after(/-->/),cdata:a.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:a.starting_with(/<!\[/).until_after(/]>/),processing:a.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=a.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===o.TAG_OPEN||e.type===o.CONTROL_FLOW_OPEN},l.prototype._is_closing=function(e,t){return e.type===o.TAG_CLOSE&&t&&((">"===e.text||"/>"===e.text)&&"<"===t.text[0]||"}}"===e.text&&"{"===t.text[0]&&"{"===t.text[1])||e.type===o.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(o.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(o.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=a.get_directives(n))&&"start"===r.ignore&&(n+=a.readIgnored(this._input)):n=this.__patterns.cdata.read()),n&&((t=this._create_token(o.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(o.COMMENT,n)).directives=null)}return t},l.prototype._read_open=function(e,t){var n=null,r=null;return t&&t.type!==o.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(o.TAG_OPEN,n)),r},l.prototype._read_open_handlebars=function(e,t){var n=null,r=null;return t&&t.type!==o.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(o.COMMENT,n)):(n=this.__patterns.handlebars_open.read(),r=this._create_token(o.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,a=0;!n.endsWith("{")||i!==a;){var l=this._input.next();if(null===l)break;"("===l?i++:")"===l&&a++,n+=l}r=this._create_token(o.CONTROL_FLOW_OPEN,n)}else"}"===e&&t&&t.type===o.CONTROL_FLOW_OPEN&&(n=this._input.next(),r=this._create_token(o.CONTROL_FLOW_CLOSE,n));return r},l.prototype._read_close=function(e,t){var n=null,r=null;return t&&t.type===o.TAG_OPEN&&("<"===t.text[0]&&(">"===e||"/"===e&&">"===this._input.peek(1))?(n=this._input.next(),"/"===e&&(n+=this._input.next()),r=this._create_token(o.TAG_CLOSE,n)):"{"===t.text[0]&&"}"===e&&"}"===this._input.peek(1)&&(this._input.next(),this._input.next(),r=this._create_token(o.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(o.EQUALS,this._input.next());else if('"'===e||"'"===e){var a=this._input.next();a+='"'===e?this.__patterns.double_quote.read():this.__patterns.single_quote.read(),r=this._create_token(o.VALUE,a)}else(i=this.__patterns.attribute.read())&&(r=t.type===o.EQUALS?this._create_token(o.VALUE,i):this._create_token(o.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===o.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(o.TEXT,r):null},l.prototype._read_script_and_style=function(e,t){if(t.type===o.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=o.TEXT,r;var i=this._input.readUntil(new RegExp("</"+n+"[\\n\\r\\t ]*?>","ig"));if(i)return this._create_token(o.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===o.CONTROL_FLOW_OPEN?this.__patterns.word_control_flow_close_excluded.read():this.__patterns.word.read()),n?this._create_token(o.TEXT,n):null},NL.Tokenizer=l,NL.TOKEN=o,NL}function TL(){if(_L)return LL;_L=1;var e=HL().Options,t=Ox().Output,n=IL().Tokenizer,r=IL().TOKEN,i=/\r\n|[\r\n]/,o=/\r\n|[\r\n]/g,a=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)};a.prototype.current_line_has_match=function(e){return this._output.current_line.has_match(e)},a.prototype.set_space_before_token=function(e,t){this._output.space_before_token=e,this._output.non_breaking_space=t},a.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},a.prototype.add_raw_token=function(e){this._output.add_raw_token(e)},a.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},a.prototype.traverse_whitespace=function(e){return!(!e.whitespace_before&&!e.newlines)&&(this.print_preserved_newlines(e)||(this._output.space_before_token=!0),!0)},a.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},a.prototype.print_newline=function(e){this._output.add_new_line(e)},a.prototype.print_token=function(e){e.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(e.text))},a.prototype.indent=function(){this.indent_level++},a.prototype.deindent=function(){this.indent_level>0&&(this.indent_level--,this._output.set_indent(this.indent_level,this.alignment_size))},a.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 o=new e(n,"html");this._options=o,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(o,"\n")).match(/^[\t ]*/)[0],s={text:"",type:""},c=new f(this._options),u=new a(this._options,l),h=new n(e,this._options).tokenize();this._tag_stack=new d(u);for(var p=null,C=h.next();C.type!==r.EOF;)C.type===r.TAG_OPEN||C.type===r.COMMENT?c=p=this._handle_tag_open(u,C,c,s,h):C.type===r.ATTRIBUTE||C.type===r.EQUALS||C.type===r.VALUE||C.type===r.TEXT&&!c.tag_complete?p=this._handle_inside_tag(u,C,c,s):C.type===r.TAG_CLOSE?p=this._handle_tag_close(u,C,c):C.type===r.TEXT?p=this._handle_text(u,C,c):C.type===r.CONTROL_FLOW_OPEN?p=this._handle_control_flow_open(u,C):C.type===r.CONTROL_FLOW_CLOSE?p=this._handle_control_flow_close(u,C):u.add_raw_token(C),s=p,C=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 o=n.has_wrapped_attrs,a={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),o=o||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),o=!0)),e.print_token(t),o=o||e.previous_token_wrapped(),n.has_wrapped_attrs=o),a},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,o=t.text,a=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?a=0:"separate"===this._options.indent_scripts&&(a=-e.indent_level);var c=e.get_full_indent(a);if(o=o.replace(/\n[ \t]*$/,""),"html"!==n.custom_beautifier_name&&"<"===o[0]&&o.match(/^(<!--|<!\[CDATA\[)/)){var d=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(o);if(!d)return void e.add_raw_token(t);l=c+d[1]+"\n",o=d[4],d[5]&&(s=c+d[5]),o=o.replace(/\n[ \t]*$/,""),(d[2]||-1!==d[3].indexOf("\n"))&&(d=d[3].match(/[ \t]+$/))&&(t.whitespace_before=d[0])}if(o)if(i){var f=function(){this.eol="\n"};f.prototype=this._options.raw_options,o=i(c+o,new f)}else{var h=t.whitespace_before;h&&(o=o.replace(new RegExp("\n("+h+")?","g"),"\n")),o=c+o.replace(/\n/g,"\n"+c)}l&&(o=o?l+o+"\n"+s:l+s),e.print_newline(!1),o&&(t.text=o,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,o){var a=this._get_tag_open_token(t);if(!n.is_unformatted&&!n.is_content_unformatted||n.is_empty_element||t.type!==r.TAG_OPEN||a.is_start_tag?(e.traverse_whitespace(t),this._set_tag_position(e,t,a,n,i),a.is_inline_element||e.set_wrap_point(),e.print_token(t)):(e.add_raw_token(t),a.start_tag_token=this._tag_stack.try_pop(a.tag_name)),a.is_start_tag&&this._is_wrap_attributes_force){var l,s=0;do{(l=o.peek(s)).type===r.ATTRIBUTE&&(a.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)&&(a.alignment_size=t.text.length+1),a.tag_complete||a.is_unformatted||(e.alignment_size=a.alignment_size),a};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 o=2;"{"===this.tag_start_char&&this.text.length>=3&&"~"===this.text.charAt(2)&&(o=3),this.is_end_tag=this.is_end_tag||"{"===this.tag_start_char&&(!e.indent_handlebars||this.text.length<3||/[^#\^]/.test(this.text.charAt(o)))}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,o){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&&o.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 a=!1;a=(a=n.start_tag_token&&n.start_tag_token.multiline_content)||!n.is_inline_element&&!(i.is_inline_element||i.is_unformatted)&&!(o.type===r.TAG_CLOSE&&n.start_tag_token===i)&&"TK_CONTENT"!==o.type,(n.is_content_unformatted||n.is_unformatted)&&(a=!1),a&&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"===o.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"],p=["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!==p.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}},LL.Beautifier=u,LL}function DL(){if(OL)return Hx;OL=1;var e=function(){if(uL)return Sx.exports;uL=1;var e=CL().Beautifier,t=Ux().Options;return Sx.exports=function(t,n){return new e(t,n).beautify()},Sx.exports.defaultOptions=function(){return new t},Sx.exports}(),t=ML(),n=function(){if(VL)return xL.exports;VL=1;var e=TL().Beautifier,t=HL().Options;return xL.exports=function(t,n,r,i){return new e(t,n,r,i).beautify()},xL.exports.defaultOptions=function(){return new t},xL.exports}();function r(r,i,o,a){return n(r,i,o=o||e,a=a||t)}return r.defaultOptions=n.defaultOptions,Hx.js=e,Hx.css=t,Hx.html=r,Hx}var ZL=(zL||(zL=1,function(e){var t,n,r,i,o=DL();o.js_beautify=o.js,o.css_beautify=o.css,o.html_beautify=o.html,e.exports=(t=o,n=o,r=o,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)}(kx)),kx.exports);const jL=(e,t,n=150)=>{if(!e||!t)return{top:0,left:0};const{top:r,left:i}=e,o=t.getBoundingClientRect();let a=r,l=i;return a-=a+n>t.clientHeight-n+130?Math.floor(n/2)+n-35:10,i>.6*o.width?l-=n+50:i<.5*o.width+n&&(l-=42),{top:a,left:l}},RL=o(({width:t="100%",height:r="100%",VariableDropdownHeight:i="160px",readOnly:o=!1,value:s="",handleChange:d,setValue:u,variableOptionsList:f=[],addForloopPrefix:h=!1,language:p="json",theme:C="light",isRequisiteType:m=!1,onPaste:g,showVariableDropdown:v=!0,defaultValue:y,customOptions:w={},editorVariableZindex:E=99999,showMinimap:M=!0,isFocus:A=!1},x)=>{const L=a(null),k=a([]),H=a(null),S=a(null),[_,V]=c(0),[O,z]=c(!1),[N,I]=c(!1),[T,D]=c({top:0,left:0}),[Z,j]=c([]),R=a(f);l(()=>{R.current=f},[f]);l(()=>{const e=L.current;if(!e)return;const t=e.onDidBlurEditorWidget(()=>{I(!1),H.current=null,S.current=null,k.current=[],V(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)}},[N]),l(()=>{const e=L.current;if(!e||!_)return;const t=[],n=[];O?n.push({range:{startLineNumber:_,startColumn:1,endLineNumber:_,endColumn:1},options:{isWholeLine:!1,linesDecorationsClassName:"active-line-number"}}):t.push({range:{startLineNumber:_,startColumn:1,endLineNumber:_,endColumn:1},options:{isWholeLine:!0,className:"current-line-background"}}),k.current=e.deltaDecorations(k.current,[...t,...n])},[_,O]);const B=(e,t)=>{switch(t){case"json":case"javascript":return ZL.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 ZL.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 b(x,()=>({getEditorInstance:()=>L.current,focus:()=>{L.current?.focus()},beautify:()=>{if(L.current){const e=L.current.getValue(),t=L.current.getModel()?.getLanguageId(),n=B(e,t||"json");L.current.setValue(n)}}})),n("div",{style:{width:t,height:r},className:"ff-editor-container",children:[e(Lx,{defaultValue:y,height:r,width:t,language:p,value:s,options:{minimap:{enabled:M},lineNumbers:"on",wordWrap:"on",autoClosingBrackets:"always",scrollBeyondLastLine:!1,readOnly:o,guides:{indentation:!1},...w},onMount:(e,t)=>{L.current=e,A&&setTimeout(()=>{e.focus()},0),e.onDidChangeCursorPosition(t=>{V(t.position.lineNumber);const n=e.getPosition(),r=e.getModel();if(!n||!r)return;const i=r.getLineContent(n.lineNumber),o=n.column-1;if(0===o)return void I(!1);const a=i.lastIndexOf("$",o-1),l=i.lastIndexOf("${",o-1),s=-1!==l?i.indexOf("}",l+2):-1,c=-1!==l&&-1!==s&&o-1>l&&o-1<s,d=!/\}/.test(i.slice(a+1,o));if(-1!==a&&o>a&&!/\s/.test(i.slice(a+1,o))&&!c&&d){H.current=a,S.current=i.slice(a+1,o);const r=(S.current??"").toLowerCase(),l=R.current.filter(e=>("_startforloop"===e.type&&h?`FLV_for:${e.name}`:e.name).toLowerCase().includes(r));j(l);const s=e.getScrolledVisiblePosition(n),c=e.getDomNode();D(jL(s,c,150)),["keyboard","mouse","deleteLeft"].includes(t?.source||"")&&I(!0)}else I(!1),H.current=null,S.current=null}),e.onMouseDown(()=>{setTimeout(()=>{const e=L.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]?(H.current=i,S.current=""):(H.current=null,S.current=null)},0)}),e.onDidChangeCursorSelection(()=>{const t=(e.getSelections?.()||[]).some(e=>e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn);z(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),o=n.column-2;if("$"===i[H.current??o]){null===H.current&&(H.current=o),S.current=i.slice(H.current+1,o);const t=R.current.filter(e=>("_startforloop"===e.type&&h?`FLV_for:${e.name}`:e.name).toLowerCase().includes(S.current?.toLowerCase()));t.length?j(t):(j([]),H?.current!==o&&" "===i[o]&&(H.current=null,S.current=null,I(!1)));const r=e.getScrolledVisiblePosition(n),a=e.getDomNode();D(jL(r,a,150))}else H.current=null,S.current=null}),e.onDidPaste(()=>{const t=e.getValue();if(t){const n=B(t,p);e.setValue(n),g&&g(n)}}),t.languages.registerCompletionItemProvider(p,{triggerCharacters:["."],provideCompletionItems:(e,n)=>{const r=e.getValueInRange({startLineNumber:n.lineNumber,startColumn:1,endLineNumber:n.lineNumber,endColumn:n.column}),i=e.getWordAtPosition(n),o=i?new t.Range(n.lineNumber,i.startColumn,n.lineNumber,i.endColumn):new t.Range(n.lineNumber,n.column,n.lineNumber,n.column),a=[];return r.endsWith("ff.")&&a.push({label:"getVariable",kind:t.languages.CompletionItemKind.Method,insertText:"getVariable(${1:variableName})",insertTextRules:t.languages.CompletionItemInsertTextRule.InsertAsSnippet,detail:"Get a variable value",range:o},{label:"setVariable",kind:t.languages.CompletionItemKind.Method,insertText:"setVariable(${1:variableName}, ${2:value})",insertTextRules:t.languages.CompletionItemInsertTextRule.InsertAsSnippet,detail:"Set a variable value",range:o},{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:o}),{suggestions:a}}})},onChange:(e,t)=>d(e,t),theme:C}),N&&T&&v&&e(uE,{position:"absolute",width:"300px",height:i,optionsList:Z,onSelectVariable:e=>{if(m&&L.current){const t=L.current,n=t.getPosition();if(n){const r=`'${e.name}'`,i=H?.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,H.current=null,I(!1)}}else((e,t)=>{if(L.current){const n=L.current,r=n.getPosition();if(r){const i=`{${t}${"FLV_for:"===t?"":"_"}${e}}`,o=H?.current??0;n.executeEdits("",[{range:{startLineNumber:r.lineNumber,startColumn:o+2,endLineNumber:r.lineNumber,endColumn:o+(r.column-o)},text:i,forceMoveMarkers:!1}]);const a=[];a.push({range:{startLineNumber:_,startColumn:1,endLineNumber:_,endColumn:1},options:{isWholeLine:!1}}),k.current=n.deltaDecorations(k.current,a),S.current=null,H.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?.includes("PARAMETER")?"SGP":"_startforloop"===e?.type?"FLV_for:":"DATAPROVIDER"===e?.type?"DPV":"PEV")},dropdownPosition:T,zIndex:E})]})}),BL=e=>e.flatMap(e=>e.runLevelExecutionDataSets.map((t,n)=>{const{runLevelExecutionDataSets:r,...i}=e;return{...i,...t,runCount:n+1}}));var PL,FL={exports:{}};var UL=(PL||(PL=1,"undefined"!=typeof self&&self,FL.exports=function(e){return 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(t,n){t.exports=e},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 o=n(11);Object.defineProperty(t,"ArcherContainer",{enumerable:!0,get:function(){return r(o).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}),o=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 a=o(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,o=(0,a.useMemo)(function(){return(0,c.encodeId)(t)},[t]),f=(0,a.useContext)(s.ArcherContainerContext),h=(0,a.useRef)(),p=(0,a.useCallback)(function(e){var t=(0,u.generateSourceToTarget)(o,e);(0,u.assertContextExists)(f),f.registerTransitions(o,t)},[f,o]),C=(0,a.useCallback)(function(){(0,u.assertContextExists)(f),f.unregisterTransitions(o)},[f,o]),m=(0,a.useCallback)(function(e){e&&((0,u.assertContextExists)(f),f.registerChild(o,e))},[o,f]),g=(0,a.useCallback)(function(){(0,u.assertContextExists)(f),f.unregisterChild(o)},[f,o]);(0,l.useIsomorphicLayoutEffect)(function(){return m(h.current),function(){return g()}},[m,g]),(0,d.useDeepCompareEffect)(function(){return p(r),function(){return C()}},[p,r,C]),a.default.Children.only(i);var v=i;return a.default.cloneElement(v,Object.assign(Object.assign({},v.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),o=r(n(9));function a(e){var t=(0,i.useRef)();return(0,o.default)(e,t.current)||(t.current=e),t.current}t.useDeepCompareEffect=function(e,t){(0,i.useEffect)(e,t.map(a))}},function(e,t,n){var r=Array.isArray,i=Object.keys,o=Object.prototype.hasOwnProperty,a="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 p=t instanceof RegExp,C=n instanceof RegExp;if(p!=C)return!1;if(p&&C)return t.toString()==n.toString();var m=i(t);if((s=m.length)!==i(n).length)return!1;for(l=s;0!=l--;)if(!o.call(n,m[l]))return!1;if(a&&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,o=t.targetAnchor,a=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:o},className:l,label:a,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,o=[],a=!0,l=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){l=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(l)throw i}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return o(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)?o(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 o(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 a=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)&&a(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),p=n(4),C=n(19),m=n(20),g={position:"absolute",width:"100%",height:"100%",top:0,left:0,pointerEvents:"none"},v=d.default.forwardRef(function(e,t){var n=e.endShape,o=void 0===n?p.endShapeDefaultProp:n,a=e.strokeColor,l=void 0===a?"#f00":a,s=e.strokeWidth,c=void 0===s?2:s,v=e.svgContainerStyle,y=void 0===v?{}:v,w=e.noCurves,b=e.children,E=e.className,M=e.endMarker,A=e.lineStyle,x=e.offset,L=e.startMarker,k=e.strokeDasharray,H=e.style,S=i((0,d.useState)({}),2),_=S[0],V=S[1],O=i((0,d.useState)({}),2),z=O[0],N=O[1],I=(0,d.useRef)(new u.default(function(){R()})).current,T=(0,d.useRef)(null),D=i(d.default.useState(),2)[1],Z=(0,d.useRef)("arrow".concat(Math.random().toString().slice(2))).current;(0,d.useImperativeHandle)(t,function(){return{refreshScreen:R,arrowMarkerUniquePrefix:Z}});var j,R=d.default.useCallback(function(){return D({})},[]),B=(0,d.useCallback)(function(e,t){N(function(n){return Object.assign(Object.assign({},n),r({},e,t))})},[]),P=(0,d.useCallback)(function(e){N(function(t){var n=Object.assign({},t);return delete n[e],n})},[]),F=(0,d.useCallback)(function(e,t){V(function(n){return n[e]===t?n:Object.assign(Object.assign({},n),r({},e,t))})},[]),U=(0,d.useCallback)(function(e){V(function(t){var n=Object.assign({},t);return delete n[e],n})},[]),q=(0,d.useMemo)(function(){return Object.assign(Object.assign({},g),y)},[y]);j="function"==typeof b?b(f.ArcherContainerContext):b,(0,m.useResizeListener)(R),(0,m.useObserveElements)(_,I);var W=(0,d.useMemo)(function(){return{registerTransitions:B,unregisterTransitions:P,registerChild:F,unregisterChild:U}},[B,P,F,U]);return d.default.createElement(f.ArcherContainerContextProvider,{value:W},d.default.createElement("div",{style:Object.assign(Object.assign({},H),{position:"relative"}),className:E},d.default.createElement("svg",{style:q},d.default.createElement("defs",null,d.default.createElement(C.ArrowMarkers,{endShape:o,sourceToTargetsMap:z,strokeColor:l,uniqueId:Z})),d.default.createElement(h.SvgArrows,{startMarker:L,endMarker:M,endShape:o,strokeColor:l,strokeWidth:c,strokeDasharray:k,noCurves:w,lineStyle:A,offset:x,parentCurrent:T.current,refs:_,uniqueId:Z,sourceToTargetsMap:z})),d.default.createElement("div",{style:{height:"100%"},ref:T},j)))});t.default=v},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")(),o="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(i):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)},a=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(){o(l)}function c(){var e=Date.now();if(n){if(e-i<a)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=v(0,0,0,0);function h(e){return parseFloat(e)||0}function p(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 C(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],o=e["padding-"+i];t[i]=h(o)}return t}(r),o=i.left+i.right,a=i.top+i.bottom,l=h(r.width),s=h(r.height);if("border-box"===r.boxSizing&&(Math.round(l+o)!==t&&(l-=p(r,"left","right")+o),Math.round(s+a)!==n&&(s-=p(r,"top","bottom")+a)),!function(e){return e===u(e).document.documentElement}(e)){var c=Math.round(l+o)-t,d=Math.round(s+a)-n;1!==Math.abs(c)&&(l-=c),1!==Math.abs(d)&&(s-=d)}return v(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 g(e){return r?m(e)?function(e){var t=e.getBBox();return v(0,0,t.width,t.height)}(e):C(e):f}function v(e,t,n,r){return{x:e,y:t,width:n,height:r}}var y=function(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=v(0,0,0,0),this.target=e};y.prototype.isActive=function(){var e=g(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},y.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e};var w=function(e,t){var n=function(e){var t=e.x,n=e.y,r=e.width,i=e.height,o="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,a=Object.create(o.prototype);return d(a,{x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:i+n,left:t}),a}(t);d(this,{target:e,contentRect:n})},b=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};b.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 y(e)),this.controller_.addObserver(this),this.controller_.refresh())}},b.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))}},b.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},b.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},b.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(e){return new w(e.target,e.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},b.prototype.clearActive=function(){this.activeObservations_.splice(0)},b.prototype.hasActive=function(){return this.activeObservations_.length>0};var E="undefined"!=typeof WeakMap?new WeakMap:new n,M=function(e){if(!(this instanceof M))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 b(e,t,this);E.set(this,n)};["observe","unobserve","disconnect"].forEach(function(e){M.prototype[e]=function(){return(t=E.get(this))[e].apply(t,arguments);var t}});var A=void 0!==i.ResizeObserver?i.ResizeObserver:M;t.default=A}.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)),o=n(15),a=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,p=r.strokeColor||e.strokeColor,C=r.strokeWidth||e.strokeWidth,m=r.strokeDasharray||e.strokeDasharray,g=!(!r.noCurves&&!e.noCurves),v=r.lineStyle||e.lineStyle||(g?"angle":"curve"),y=e.offset||0,w=e.source.anchor,b=(0,o.getPointCoordinatesFromAnchorPosition)(e.source.anchor,e.source.id,e.parentCoordinates,e.refs),E=e.target.anchor,M=(0,o.getPointCoordinatesFromAnchorPosition)(e.target.anchor,e.target.id,e.parentCoordinates,e.refs);return b?M?i.default.createElement(a.default,{className:e.className,startingPoint:b,startingAnchorOrientation:w,endingPoint:M,endingAnchorOrientation:E,strokeColor:p,strokeWidth:C,strokeDasharray:m,arrowLabel:e.label,arrowMarkerId:(0,l.getMarkerId)(e.uniqueId,e.source,e.target),lineStyle:v,offset:y,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,o.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 o(e){return new i.default(e.left,e.top)}var a=function(e){return e?e.getBoundingClientRect():null};t.getPointFromElement=function(e){var t=a(e);return t?o(t):null},t.getPointCoordinatesFromAnchorPosition=function(e,t,n,r){var l=a(r[t]);if(!l)return null;var s=function(e,t){switch(e){case"top":return o(t).add(new i.default(t.width/2,0));case"bottom":return o(t).add(new i.default(t.width/2,t.height));case"left":return o(t).add(new i.default(0,t.height/2));case"right":return o(t).add(new i.default(t.width,t.height/2));case"middle":return o(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)),o=n(18);function a(e,t,n,r,i,a,l,s){var c=(0,o.computeArrowDirectionVector)(i),d=c.arrowX,u=c.arrowY;if("straight"===a&&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=a,t.computeStartingAnchorPosition=l,t.computeEndingAnchorPosition=s,t.computeLabelDimensions=c,t.default=function(e){var t=e.className,n=e.startingPoint,r=e.startingAnchorOrientation,o=e.endingPoint,d=e.endingAnchorOrientation,u=e.strokeColor,f=e.strokeWidth,h=e.strokeDasharray,p=e.arrowLabel,C=e.arrowMarkerId,m=e.lineStyle,g=e.offset,v=e.enableStartMarker,y=e.disableEndMarker,w=e.endShape,b=e.domAttributes,E=e.hitSlop,M=void 0===E?10:E,A=e.cursor,x=void 0===A?"pointer":A,L=w.circle?2*w.circle.radius:2*w.arrow.arrowLength,k=a(n.x,n.y,v?L:0,f,r,m,o.x,o.y),H=k.xPoint,S=k.yPoint,_=a(o.x,o.y,y?0:L,f,d,m,n.x,n.y),V=_.xPoint,O=_.yPoint,z=l(H,S,V,O,r),N=z.xAnchor1,I=z.yAnchor1,T=s(H,S,V,O,d),D=function(e){var t=e.xStart,n=e.yStart,r=e.xAnchor1,i=e.yAnchor1,o=e.xAnchor2,a=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 p="M".concat(t,",").concat(n," ");return["curve","angle"].includes(c)&&(p+="".concat("curve"===c?"C":"").concat(r,",").concat(i," ").concat(o,",").concat(a," ")),p+"".concat(l,",").concat(s)}({xStart:H,yStart:S,xAnchor1:N,yAnchor1:I,xAnchor2:T.xAnchor2,yAnchor2:T.yAnchor2,xEnd:V,yEnd:O,lineStyle:m,offset:g}),Z=c(H,S,V,O),j=Z.xLabel,R=Z.yLabel,B=Z.labelWidth,P=Z.labelHeight,F="url(#".concat(C,")");return i.default.createElement("g",{className:t},i.default.createElement("path",{d:D,style:{fill:"none",stroke:u,strokeWidth:f,strokeDasharray:h},markerStart:v?F:void 0,markerEnd:y?void 0:F}),b&&i.default.createElement("path",Object.assign({d:D,style:{fill:"none",stroke:"rgba(0, 0, 0, 0)",strokeWidth:M,cursor:b?x:"initial",pointerEvents:"all"}},b)),p&&i.default.createElement("foreignObject",{x:j,y:R,width:B,height:P,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,p))))}},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)),o=n(4),a=n(3),l=function(e,t){return function(){var n,r,a,l,s,c,d,u,f,h,p,C,m=(null===(r=null===(n=e.endShape)||void 0===n?void 0:n.circle)||void 0===r?void 0:r.radius)||(null===(a=t.circle)||void 0===a?void 0:a.radius)||o.endShapeDefaultProp.circle.radius,g=(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)||o.endShapeDefaultProp.circle.strokeWidth,v=(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)||o.endShapeDefaultProp.circle.strokeColor,y=(null===(p=null===(h=e.endShape)||void 0===h?void 0:h.circle)||void 0===p?void 0:p.fillColor)||(null===(C=t.circle)||void 0===C?void 0:C.fillColor)||o.endShapeDefaultProp.circle.fillColor;return{markerWidth:4*m,markerHeight:4*m,refX:2*m+g,refY:2*m,path:i.default.createElement("circle",{cx:2*m,cy:2*m,r:m,fill:y,stroke:v,strokeWidth:g})}}},s=function(e,t,n){return function(){var r,a,l,s,c,d,u,f,h=e.strokeColor||n,p=null!==(c=null!==(l=null===(a=null===(r=e.endShape)||void 0===r?void 0:r.arrow)||void 0===a?void 0:a.arrowLength)&&void 0!==l?l:null===(s=null==t?void 0:t.arrow)||void 0===s?void 0:s.arrowLength)&&void 0!==c?c:o.endShapeDefaultProp.arrow.arrowLength,C=(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)||o.endShapeDefaultProp.arrow.arrowThickness,m="M0,0 L0,".concat(C," L").concat(p,",").concat(C/2," z");return{markerWidth:p,markerHeight:C,refX:0,refY:C/2,path:i.default.createElement("path",{d:m,fill:h})}}};t.ArrowMarkers=function(e){var t=e.sourceToTargetsMap,n=e.endShape,r=e.strokeColor,o=e.uniqueId;return i.default.createElement(i.default.Fragment,null,(0,a.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,a.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,p=u.path,C=u.refX,m=u.refY;return i.default.createElement("marker",{id:(0,a.getMarkerId)(o,t,c),key:(0,a.getMarkerId)(o,t,c),markerWidth:h,markerHeight:f,refX:C,refY:m,orient:"auto-start-reverse",markerUnits:"strokeWidth"},p)}))}},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])}}])}(i)),FL.exports);const qL=({getChildNodeComponent:r,parentNodeIndex:i,parentNodeData:o,verticalLineHeight:a,datasetHeight:l,curveHeights:s,itemRefs:c,datasetRef:d,isReadOnlyMode:u})=>e(t,{children:0===o?.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:o,parentNodeIndex:i})})]})}):o?.machineInstances?.map((f,h)=>{const p=0===h;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:`${a}px`}})]}),e("div",{className:"ff-machine-instance",children:f?.runLevelExecutionDataSets?.map((a,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(f?.runScriptCount)?e("div",{className:"ff-selectedMachines-connecting-line-text",children:e(F,{fontSize:8,fontWeight:"regular",children:`${[0,"0",null].includes(f.runScriptCount)?"":f.runScriptCount} Script${1!==f.runScriptCount?"s":""}`})}):e(t,{})]})}),e("div",{className:"ff-run-data-box",children:r({isButton:!1,childNodeData:f,childNodeIndex:h,runLevelExecutionDataSet:a,runLevelExecutionDataSetIndex:u,parentNodeData:o,parentNodeIndex:i})})]})},a?.runLevelExecutionDataSetId))}),h===o?.machineInstances.length-1&&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:o,parentNodeIndex:i,childNodeIndex:h+1})})]})})]},h)})}),WL=({data:t,noOfScripts:r,getChildNodeComponent:o,getParentNodeComponent:s,getParentNodeComponentActionItems:d,childNodeCurveHeight:u=1.28,isReadOnlyMode:f=!1})=>{const h=a(null),[p,C]=c(0),[m,g]=c([]),v=a([]);l(()=>{h.current&&C(h.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 b=t?.machines?.selectedMachines.reduce((e,t)=>f?e+(e=>!e?.machineInstances||G(e.machineInstances)?1:e.machineInstances.length)(t):e+y(t),0),E=Math.round(b/2);let M=1===E&&f&&2===b||1===E&&!f&&2===b;return e("div",{className:"connecting-branch-container",children:e(UL.ArcherContainer,{strokeColor:"var(--brand-color)",strokeWidth:1,startMarker:!0,endMarker:!1,noCurves:!0,children:n("div",{className:"ff-connecting-branch-grid-container",children:[e(UL.ArcherElement,{id:"rootNode",children:e("div",{className:"ff-grid-item ff-dynamic-item",style:{gridRow:E,top:M?"44px":""},children:e("div",{className:"ff-script-count-container",children:n("div",{className:"ff-script-count-box",children:[e(F,{children:r}),e(F,{children:"Scripts"})]})})})}),t?.machines?.selectedMachines.map((t,r)=>{const a=w,l=y(t);w+=l;const c=((e,t,n)=>{if(1===e.length&&f)return 0;const r=e.reduce((t,n,r)=>t+(r===e.length-1&&f?0:n.runLevelExecutionDataSets?.length||0),0);return r*(t+n)})(t?.machineInstances,p,16);return e(i.Fragment,{children:n("div",{className:"ff-selectedMachines",style:{gridRow:`${a} / 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(UL.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(qL,{parentNodeIndex:r,parentNodeData:t,verticalLineHeight:c,datasetHeight:p,curveHeights:m,itemRefs:v,datasetRef:h,getChildNodeComponent:o,isReadOnlyMode:f})]})},r)}),!f&&e("div",{className:"ff-select-machine-input",style:{gridRow:`${w}`},children:e(UL.ArcherElement,{id:"lastNode",relations:[{targetId:"rootNode",targetAnchor:"left",sourceAnchor:"left"}],children:e("div",{children:s({isMultiSelect:!0})})})})]})})})},QL=(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)}},GL=({hasAtSymbol:t,usersObj:n,optionClicked:r,charsAfterAt:i,mentionUserRef:o})=>{const[s,d]=c(0),u=a([]);if(!t)return null;const f=n.filter(e=>!i||e.name.toLowerCase().startsWith(i.toLowerCase()));l(()=>{d(0)},[i]);const h=p(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:o,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(F,{children:t.name})},t.id)):e("div",{className:"user-not-found",children:e(F,{children:"No user name found"})})})})},KL=e=>e&&Array.isArray(e)?e.map(({user:e})=>({id:e.id,name:e.name,emailId:e.emailId})):[],YL=(e,t)=>{const n=t.find(t=>`@${t.name.replace(/\s+/g,"")}`===e);return n?n.emailId:null},XL=({handleInsertNode:t,handleEditNode:r,handleDeleteNode:i,comment:o,depth:s=0,isDisable:d,userDetails:u,isEditDeleteActionAllowed:h=!0,createdByID:p,rowBreakCharCount:C=83,isVewMode:m=!1,deleteEnable:g=!0})=>{const[v,y]=c(""),[w,b]=c(!1),[E,M]=c(!1),[A,x]=c(!0),[L,k]=c([]),[H,S]=c(!1),[_,V]=c([]),[O,z]=c({top:0,left:0}),[N,I]=c(""),T=a(null),D=a(null),Z=a(null);l(()=>{w&&o?.description&&y(o?.description)},[w,o.description]),l(()=>{const e=KL(u);k(e)},[u]),l(()=>{const e=(v.match(kt)||[]).map(e=>YL(e,L)).filter(Boolean);V(e)},[v]),l(()=>{const e=e=>{const t=D.current&&!D.current.contains(e.target)&&T.current&&!T.current.contains(e.target),n=Z.current&&!Z.current.contains(e.target)&&T.current&&!T.current.contains(e.target);(t||n)&&(S(!1),y(e=>e.replace(/(?:^|\s)(@\w*)$/,"")))};return H&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[H]);const{modifiedByUname:j,createdByUname:R,modifiedOn:B,createdOn:U}=o||{},q=B??U??(new Date).toLocaleString(),W=j??R??"Anonymous",Q=s>2,G=W?W.charAt(0).toUpperCase():"A";l(()=>{w&&o.description&&y(o.description)},[w,o.description]);const Y=()=>{0!==v.trim().length&&(w?(r(o.id,v,_),M(!1),y("")):(x(!0),t(o.id,v,_),M(!1),y("")),w&&b(!1))};l(()=>{(()=>{if(!T.current)return;const e=T?.current,t=w?D?.current:Z?.current,n=T.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 o=document.createElement("span");o.textContent=".",n.appendChild(o);const a=o.getBoundingClientRect();return document.body.removeChild(n),{top:a.top-20,left:a.left}})(e,n),i=t?.getBoundingClientRect().height??0,o=e?.getBoundingClientRect();if(!o)return;const a=window.innerHeight-o.bottom,l=o.top;z({top:a<i&&l>i?n-i-16:n+32,left:r.left+10})})()},[v]);const X=e=>{const t=e.target.value;y(t);const n=(t.match(/@\S+/g)||[]).map(e=>YL(e,L)).filter(e=>null!==e);V(n);const r=e.target.selectionStart,i=t.slice(0,r),o=i.match(Nt);I(o?.[1]||"");const a=zt.test(i);S(!!a)},J=e=>{if("@"===e.key)S(!0);else if("Backspace"===e.key&&T.current){const t=T.current.selectionStart,n=v.slice(0,t);n.endsWith("@")&&S(!1);const r=n.match(_t);if(r){e.preventDefault();const i=r[1],o=n.lastIndexOf(i||""),a=v.slice(0,o)+v.slice(t);y(a),S(!1),V(()=>(a.match(/@\w+/g)||[]).map(e=>e.slice(1)).map(e=>YL(e,L)).filter(Boolean)),setTimeout(()=>{T.current?.setSelectionRange(o,o)},0)}}},$=e=>{if(!T.current)return;const t=T.current.selectionStart,n=v.slice(0,t),r=n.match(Ht);if(r){const i=n.lastIndexOf(r[1]||""),o=v.slice(t),a=`@${e.replace(/\s+/g,"")} `,l=v.slice(0,i)+a+o;y(l),S(!1),setTimeout(()=>{T.current?.focus(),T.current?.setSelectionRange(i+a.length+1,i+a.length+1)},0),V(()=>(l.match(/@\w+/g)||[]).map(e=>e.slice(1)).map(e=>YL(e,L)).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:o?.profileImage?e("img",{height:30,width:30,src:`data:image/jpeg;base64,${o?.profileImage}`}):G}),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:q})]}),n("div",{className:"ff-editable-container",children:[!w&&e(F,{className:"typography-text",children:o?.description?.split(It).map((t,n)=>t.startsWith("@")?e("b",{children:t},`highlight-${n}`):e(f,{children:t},`text-${n}`))}),w&&n("div",{className:"inputContainer",children:[e("textarea",{rows:v.length<C?1:3,className:"inputContainer_input first_input",value:v,autoFocus:!0,placeholder:"Edit comment",ref:T,onChange:e=>X(e),onKeyDown:J}),H&&e("div",{id:"mention-user",style:{position:"absolute",top:`${O.top}px`,left:`${O.left}px`},children:e(GL,{hasAtSymbol:H,usersObj:L,optionClicked:$,charsAfterAt:N,mentionUserRef:D})}),n("div",{className:"edit-comment",children:[e("div",{className:"reply",children:e(K,{title:w?"Update":"Add",children:e(P,{name:"comment_reply",hoverEffect:!0,disabled:w&&v.trim()===(o?.description?.trim()??"")||0===v.trim().length,onClick:()=>{Y(),b(!1),M(!1)}})})}),e("div",{className:"reply",onClick:()=>{b(!1),M(!1),y("")},children:e(K,{title:w?"Cancel":"Close",children:e(P,{name:"close",color:"var(--ff-delete-button-attachment)",hoverEffect:!0})})})]})]}),n("div",{className:"comment-actions",children:[!Q&&s<2&&o.comments?.length>0&&e("div",{className:"action-icon",onClick:()=>x(e=>!e),children:e(K,{title:""+(A?"collapse":"expand"),children:e(P,{name:A?"collapse-arrow":"expand-arrow",disabled:w||E,hoverEffect:!0})})}),!Q&&s<2&&0===o.comments?.length&&e("div",{className:"action-icon",children:e(P,{name:"expand-arrow",disabled:!0})}),!m&&n("div",{className:"ff-comment-action-item",children:[s<2&&e("div",{className:"action-icon",children:e(K,{title:"Reply",children:e(P,{name:"comment_icon",disabled:w||d,hoverEffect:!0,onClick:()=>{M(!0)}})})}),h&&e("div",{className:"action-icon",children:e(K,{title:"Edit",children:e(P,{name:"edit",disabled:E||d,hoverEffect:!0,onClick:()=>b(!0)})})}),h&&g&&e("div",{className:"action-icon",children:e(K,{title:"Delete",children:e(P,{name:"delete",color:"var(--ff-delete-button-attachment)",onClick:()=>{E||i(o.id)},disabled:w||E||d,hoverEffect:!0})})})]})]})]})]})]}),e("div",{className:"comment-reply-container",children:E&&n("div",{className:"inputContainer",children:[e("textarea",{rows:v.length<C?1:3,className:"inputContainer_input first_input",value:v,autoFocus:!0,placeholder:"Add reply comments",ref:T,onChange:e=>X(e),onKeyDown:J}),H&&e("div",{id:"mention-user",style:{position:"absolute",top:`${O.top}px`,left:`${O.left}px`},children:e(GL,{hasAtSymbol:H,usersObj:L,optionClicked:$,charsAfterAt:N,mentionUserRef:Z})}),n("div",{className:"edit-comment",children:[e("div",{className:"reply",onClick:()=>{Y(),b(!1),M(!1)},children:e(K,{title:"Reply",children:e(P,{name:"comment_reply",hoverEffect:!0,disabled:Boolean(!v.length)})})}),e("div",{className:"reply",onClick:()=>{b(!1),M(!1),y("")},children:e(K,{title:"Cancel",children:e(P,{name:"close",color:"var(--ff-delete-button-attachment)",hoverEffect:!0})})})]})]})}),A&&o.comments?.length>0&&e("div",{className:`child-comments ${0===s?"first-level-child":""} ${1===s?"second-level-child":""}`,children:o.comments.map(n=>e("div",{className:`child-comments child-comments-${s+1}`,children:e(XL,{handleInsertNode:t,handleEditNode:r,handleDeleteNode:i,comment:n,depth:s+1,isDisable:d,userDetails:u,isEditDeleteActionAllowed:o.createdBy===p,createdByID:p,isVewMode:m})},n.id))})]})})},JL=({commentsData:t,handleAddComment:r,handleEditComment:i,handleDeleteComment:o,onCommentsDataChange:s,currentUser:d,isDisable:u=!1,userDetails:f,createdByID:h,rowBreakCharCount:C=83,isVewMode:m=!1,deleteEnable:g=!0,showTextarea:v=!1,autoFocus:y=!1})=>{const[w,b]=c(""),[E,M]=c([]),[A,x]=c(!1),[L,k]=c([]),[H,S]=c({top:0,left:0}),[_,V]=c(""),O=a(null),z=a(null),[N,I]=c(!1);l(()=>{const e=KL(f);k(e)},[f]);const T=(e,t)=>{for(const n of e){if(n.id===t)return n;const e=T(n.comments,t);if(e)return e}return null};l(()=>{t&&M(t)},[t]),l(()=>{const e=e=>{z.current&&!z.current.contains(e.target)&&(x(!1),b(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:Z,deleteNode:j}=(()=>{const e=(t,n,r)=>t.map(t=>t.id===n?{...t,comments:[...t.comments,{id:vp(),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}})(),R=(e,t,n)=>{if(!t.trim())return;const i={id:vp(),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()};M(t=>D(t,e,i)),r&&r(i,T(E,e))},B=p((e,t,n)=>{const r=Z(E,e,t);M(r);const o=T(r,e);i&&i(e,t,o,n)},[E,Z,i]),U=p(async e=>{try{if(o){const t=await o(e);if(t?.success){const t=j(E,e);M(t)}}}catch(e){console.error("Error deleting comment:",e)}},[j,o]);l(()=>{s&&s(E)},[E,s]);l(()=>{(()=>{if(!O.current)return;const e=O?.current,t=z?.current,n=O.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 o=document.createElement("span");o.textContent=".",n.appendChild(o);const a=o.getBoundingClientRect();return document.body.removeChild(n),{top:a.top,left:a.left}})(e,n),i=t?.getBoundingClientRect().height??0,o=e?.getBoundingClientRect();if(!o)return;const a=window.innerHeight-o.bottom,l=o.top;S({top:a<i&&l>i?n-i-16:n+32,left:r.left+10})})()},[w]);l(()=>{w.includes("\n")||I(!1)},[w]);return n("div",{className:"ff-comments-container-box",children:[!m&&n("div",{className:"ff-first-comment "+(v?"no-border":""),children:[e(F,{fontWeight:"semi-bold",className:"ff-comment-heading",children:"Comments"}),!v&&n("div",{className:"input-wrapper",children:[e("textarea",{className:"inputContainer_input first_input",rows:N?3:w.length<C?1:3,autoFocus:y,value:w,onChange:e=>(e=>{const t=e.target.value;b(t);const n=e.target.selectionStart,r=t.slice(0,n),i=r.match(Nt);V(i?.[1]||"");const o=zt.test(r);x(!!o),t||I(!1)})(e),placeholder:"Add a comment",disabled:u,ref:O,onKeyDown:e=>{if("@"===e.key)x(!0);else if("Backspace"===e.key&&O.current){const t=O.current.selectionStart;if(w.slice(0,t).endsWith("@")&&x(!1),A){e.preventDefault();const n=w.slice(0,t-1)+w.slice(t);b(n);const r=t-1,i=n.slice(0,r).match(Nt);V(i?.[1]||""),x(!!i),setTimeout(()=>{O.current?.setSelectionRange(r,r)},0)}}"Enter"===e.key&&I(!0)}}),A&&e("div",{id:"mention-user",style:{position:"absolute",top:`${H.top}px`,left:`${H.left}px`},children:e(GL,{hasAtSymbol:A,usersObj:L,optionClicked:e=>{if(!O.current)return;const t=O.current.selectionStart,n=w.slice(0,t),r=n.match(St);if(r){const i=n.lastIndexOf(r[1]??""),o=w.slice(t),a=`@${e} `,l=w.slice(0,i)+a+o;b(l),x(!1),setTimeout(()=>{O.current?.focus();const e=i+a.length+1;O.current?.setSelectionRange(e,e)},0)}},charsAfterAt:_,mentionUserRef:z})}),e("span",{className:"reply-comment",children:e(K,{title:"Add",children:e(P,{name:"comment_reply",onClick:()=>{if(!w.trim())return;const e=L.filter(e=>new RegExp(`@${e.name}\\b`,"i").test(w)).map(e=>e.emailId),t={id:vp(),description:w,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),M(e=>[...e,t]),b("")},hoverEffect:!0,disabled:Boolean(!w.length)})})})]})]}),E.length>0&&E.map(t=>e(XL,{handleInsertNode:R,handleEditNode:B,handleDeleteNode:U,comment:t,depth:0,isDisable:u,userDetails:f,isEditDeleteActionAllowed:t.createdBy===h,createdByID:h,isVewMode:m,deleteEnable:g},t.id))]})},$L=()=>{const e=a(!0);return{canTrigger:()=>e.current,setTriggered:()=>{e.current=!1},resetTrigger:()=>{e.current=!0}}},ek=({isOpen:t,onClose:r,onContinue:i,titleMessage:o="Warning!",subTitleMessage:a="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:p="226",colorForTitleMessage:C="var(--status-button-bg-warning)",footerContent:m,firstButtonDisabled:g=!1,secondButtonDisabled:v=!1,zIndex:y=1100,iconSize:w=94})=>e($f,{overlayClassName:"custom-overlay",isOpen:t,onClose:r,isHeaderDisplayed:!1,zIndex:y,children:n("div",{className:"warning_modal_container",children:[n("div",{className:"warning_modal_content",children:[e(P,{name:l,className:"warning_modal_icon",width:w,height:w}),n("div",{className:"warning_modal_message",children:[n(F,{fontSize:20,fontWeight:"semi-bold",className:"warning_modal_title_wrapper",children:[" ",n(F,{color:`${C}`,fontSize:20,fontWeight:"semi-bold",children:[" ",o," "]})," ",a]}),n("div",{className:"warning_modal_message_wrapper",children:[e(F,{fontSize:16,children:s}),e(F,{as:"div",children:m})]})]})]}),n("div",{className:"warning_modal_footer_button",children:[e(U,{buttonHeight:"24px",variant:"secondary",label:c,onClick:r,disabled:g}),d&&e(U,{buttonHeight:"24px",variant:u||"warning",label:d,onClick:i,disabled:v})]})]}),ariaHideApp:!0,isFooterDisplayed:!1,customWidth:`${h}px`,customHeight:`${p}px`,boxShadow:"0px 1px 4px 0px var(--toaster-boxshadow)",border:f});function tk(e,t=[]){return t.reduce((e,t)=>e.replace(new RegExp(function(e){return e.replace(mt,"\\$&")}(t),"gi"),""),e).replace(/([A-Z])/g," $1").trim().replace(/^./,e=>e.toUpperCase())}function nk(e,t=[]){return e.toUpperCase()===e&&(e=e.toLowerCase()),e.includes("_")?function(e){return e.toLowerCase().replace(/_/g," ").replace(/^./,e=>e.toUpperCase())}(e):tk(e,t)}const rk=({onSelectVariable:t,dropdownPosition:r,filteredOptions:i=[],position:o="relative",width:a="300px",zIndex:l=1e3,height:s="160px",truncateTextValue:c=34,isTruncateText:d=!1})=>n("div",{className:z("ff-variable-dropdown",o),style:r?{top:r.top+30,left:r.left-30,width:a,zIndex:l}:{width:a,zIndex:l,height:s},children:[i?.map(n=>{const r=d?ie(n?.name,c,"pixel"):n?.name,i=!!d&&oe(n?.name,c,"pixel");return e("div",{className:"ff-variable-option",onClick:()=>t(n),children:d?e(K,{title:i?n?.name:"",children:e(F,{children:r})}):e(F,{children:r})},n?.id)}),0===i?.length&&e("div",{className:"ff-variable-option .ff-variable-option-no-data ",children:e(F,{as:"span",fontSize:14,children:"No Option"})})]}),ik=o(({label:t="",hashInputValue:r="",setHashInputValue:i,variableList:o=[],addForloopPrefix:s=!1,placeholder:d="Enter text",onChange:u,onCreateVariableClick:f,value:h="",dropdownWidth:p="inherit",isHash:C=!1,dataFiles:m=[],showAddVariableIcon:g=!0,helperText:v="",error:y,autoComplete:w="off",showHidePasswordIcon:E=!0,required:M=!1,formProps:A={},onlyDropdown:x=!1,type:L,onFocus:k,onBlur:H,readOnly:S=!1,height:_="160px",truncateTextValue:V=34,isTruncateText:O=!1,...z},N)=>{const[I,T]=c(!1),[D,Z]=c(!1),[j,R]=c(!1),[B,U]=c(null),[q,W]=c(0),[Q,Y]=c(!1),[X,J]=c(!1),[$,ee]=c([]),te=a(null);b(N,()=>te.current),l(()=>{null!==B&&te.current&&(te.current.setSelectionRange(B,B),te.current.focus())},[B]),l(()=>{if(C?T(h.startsWith("#")):J(!h?.includes("$")),h.startsWith("#")&&C){const e=h.slice(1).toLowerCase(),t=m.filter(t=>t.name.toLowerCase().includes(e));ee(t),T(!0)}},[h]),l(()=>{if(!Q&&x){const e=m.filter(e=>e.toLowerCase().includes(h.toLowerCase())).map((e,t)=>({id:t+1,name:e}));ee(e),T(e.length>0)}Y(!1)},[h]);const ne=()=>{te.current&&W(te.current.selectionStart||0)},re=ne,ie=ne;l(()=>{te.current&&W(te.current.selectionStart||0)},[h]);const oe=e=>{if(te.current){const{selectionStart:t,selectionEnd:n}=te.current,r=`{${"STEPGROUP"===e.parentVariableType?"SGV":"LOCAL"===e.type?"LV":"GLOBAL"===e.type?"GV":"GROUP"===e.type?"SGV":e?._id?.includes("PARAMETER")||e?.id?.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}}`;let o;if(o=C&&"#"===h[0]||x?e.name+h.slice(n||1):h.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}(h,q)||0)+"$"+r+h.slice(n||0),u){u({target:{value:o}},e)}te.current.value=o,i?.(e),U((t||0)+r.length),T(!1),Y(!0),Z(!0)}};const ae=function(e,t,n){let r=!1,i="";const o="}"===h[t-1];if(t<0||t>e.length)return{showDropdown:r,searchString:i};const a=e.lastIndexOf("$",t-1),l=e.indexOf("$",t);if(-1!==a&&(t===a+1?(r=!0,i=""):(i=e.slice(a+1,-1===l?void 0:l),t>a+1&&(i=e.slice(a+1,t)),r=!0),D&&o&&(r=!1),(/[{}]/.test(i)||0===t)&&(r=!1,i=""),i)){n.some(e=>("_startforloop"===e.type&&s?`FLV_for:${e.name}`:e.name).toLowerCase().includes(i.toLowerCase()))||(r=!1,i="")}return{showDropdown:r,searchString:i}}(h,q,o),[le,se]=c(!1);return n("div",{className:"ff-add-variable-container",children:[n("div",{className:"ff-add-variable-input",children:[e(nn,{readOnly:S,...z,name:"add_variable",ref:te,type:((e,t)=>"password"===e?t?"text":"password":e??"text")(L,le),value:h,onChange:u,variant:"primary",label:t,placeholder:d,onClick:re,onKeyUp:ie,onFocus:e=>{setTimeout(()=>{R(!0),k?.(e)},500)},onBlur:e=>{(e=>{e.relatedTarget&&e.relatedTarget.closest(".dropdown-container")||R(!1)})(e),H?.(e)},autoComplete:w,helperText:v,error:y,required:M,...A}),"password"===L&&E&&e(K,{title:le?"Hide":"Show",children:e(F,{as:"span",className:"ff-password-icon",children:e(P,{onClick:()=>{se(e=>!e)},name:le?"hide_access_icon":"view_access_icon",width:16,height:16,hoverEffect:!0})})}),!G(h)&&!C&&X&&g&&e(K,{title:"Add Variable",children:e(P,{onClick:f,name:"add_variable",width:24,height:24,hoverEffect:!0})})]}),ae?.showDropdown&&j&&e(uE,{position:"absolute",width:p,optionsList:o.filter(e=>("_startforloop"===e.type&&s?`FLV_for:${e.name}`:e.name).toLowerCase().includes(ae?.searchString.toLowerCase())),onSelectVariable:oe,height:_}),I&&(C||x)&&e(rk,{position:"relative",width:p,filteredOptions:$,zIndex:2e3,onSelectVariable:oe,height:_,isTruncateText:O,truncateTextValue:V})]})}),ok=(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 ak,lk;var sk=(lk||(lk=1,ak=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;
|
|
37
37
|
/*!
|
|
38
38
|
Copyright (c) 2017 Jed Watson.
|
|
39
39
|
Licensed under the MIT License (MIT), see
|