@3sc/common-component 0.0.586 → 0.0.587
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{index-C0_QMaXz.js → index-DtcJG2c_.js} +29 -19
- package/dist/{index-C0_QMaXz.js.map → index-DtcJG2c_.js.map} +1 -1
- package/dist/index.es.js +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/{nl-DJhVGE01.js → nl-CUvDoRuI.js} +2 -2
- package/dist/{nl-DJhVGE01.js.map → nl-CUvDoRuI.js.map} +1 -1
- package/dist/{tr-DAgjGztB.js → tr-CVmDXLZf.js} +2 -2
- package/dist/{tr-DAgjGztB.js.map → tr-CVmDXLZf.js.map} +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as e, n as t, k as i, B as o, C as r, D as d, i as c, l, G as n, H as u, I as T, L as k, N as S, S as m, h as x, j as A, e as L, T as P, f as b, g as f, m as h, t as y, u as B } from "./index-
|
|
1
|
+
import { A as e, n as t, k as i, B as o, C as r, D as d, i as c, l, G as n, H as u, I as T, L as k, N as S, S as m, h as x, j as A, e as L, T as P, f as b, g as f, m as h, t as y, u as B } from "./index-DtcJG2c_.js";
|
|
2
2
|
export {
|
|
3
3
|
e as Accordion,
|
|
4
4
|
t as AnalyticsProvider,
|
package/dist/index.umd.js
CHANGED
|
@@ -253,5 +253,5 @@ To suppress this warning, you need to explicitly provide the \`palette.${t}Chann
|
|
|
253
253
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(o=>r.set(o)),r}static accessor(t){const r=(this[J1]=this[J1]={accessors:{}}).accessors,o=this.prototype;function s(a){const l=la(a);r[l]||(z$(o,a),r[l]=!0)}return K.isArray(t)?t.forEach(s):s(t),this}};mn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),K.reduceDescriptors(mn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),K.freezeMethods(mn);function Kf(e,t){const n=this||aa,r=t||n,o=mn.from(r.headers);let s=r.data;return K.forEach(e,function(l){s=l.call(n,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function Q1(e){return!!(e&&e.__CANCEL__)}function Ms(e,t,n){Xe.call(this,e??"canceled",Xe.ERR_CANCELED,t,n),this.name="CanceledError"}K.inherits(Ms,Xe,{__CANCEL__:!0});function e2(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Xe("Request failed with status code "+n.status,[Xe.ERR_BAD_REQUEST,Xe.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function V$(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function H$(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o=0,s=0,a;return t=t!==void 0?t:1e3,function(c){const d=Date.now(),u=r[s];a||(a=d),n[o]=c,r[o]=d;let f=s,h=0;for(;f!==o;)h+=n[f++],f=f%e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),d-a<t)return;const g=u&&d-u;return g?Math.round(h*1e3/g):void 0}}function U$(e,t){let n=0,r=1e3/t,o,s;const a=(d,u=Date.now())=>{n=u,o=null,s&&(clearTimeout(s),s=null),e(...d)};return[(...d)=>{const u=Date.now(),f=u-n;f>=r?a(d,u):(o=d,s||(s=setTimeout(()=>{s=null,a(o)},r-f)))},()=>o&&a(o)]}const uc=(e,t,n=3)=>{let r=0;const o=H$(50,250);return U$(s=>{const a=s.loaded,l=s.lengthComputable?s.total:void 0,c=a-r,d=o(c),u=a<=l;r=a;const f={loaded:a,total:l,progress:l?a/l:void 0,bytes:c,rate:d||void 0,estimated:d&&l&&u?(l-a)/d:void 0,event:s,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(f)},n)},t2=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},n2=e=>(...t)=>K.asap(()=>e(...t)),Y$=Qt.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Qt.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Qt.origin),Qt.navigator&&/(msie|trident)/i.test(Qt.navigator.userAgent)):()=>!0,q$=Qt.hasStandardBrowserEnv?{write(e,t,n,r,o,s,a){if(typeof document>"u")return;const l=[`${e}=${encodeURIComponent(t)}`];K.isNumber(n)&&l.push(`expires=${new Date(n).toUTCString()}`),K.isString(r)&&l.push(`path=${r}`),K.isString(o)&&l.push(`domain=${o}`),s===!0&&l.push("secure"),K.isString(a)&&l.push(`SameSite=${a}`),document.cookie=l.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function G$(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function K$(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function r2(e,t,n){let r=!G$(t);return e&&(r||n==!1)?K$(e,t):t}const o2=e=>e instanceof mn?{...e}:e;function Eo(e,t){t=t||{};const n={};function r(d,u,f,h){return K.isPlainObject(d)&&K.isPlainObject(u)?K.merge.call({caseless:h},d,u):K.isPlainObject(u)?K.merge({},u):K.isArray(u)?u.slice():u}function o(d,u,f,h){if(K.isUndefined(u)){if(!K.isUndefined(d))return r(void 0,d,f,h)}else return r(d,u,f,h)}function s(d,u){if(!K.isUndefined(u))return r(void 0,u)}function a(d,u){if(K.isUndefined(u)){if(!K.isUndefined(d))return r(void 0,d)}else return r(void 0,u)}function l(d,u,f){if(f in t)return r(d,u);if(f in e)return r(void 0,d)}const c={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:l,headers:(d,u,f)=>o(o2(d),o2(u),f,!0)};return K.forEach(Object.keys({...e,...t}),function(u){const f=c[u]||o,h=f(e[u],t[u],u);K.isUndefined(h)&&f!==l||(n[u]=h)}),n}const s2=e=>{const t=Eo({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:a,auth:l}=t;if(t.headers=a=mn.from(a),t.url=G1(r2(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),K.isFormData(n)){if(Qt.hasStandardBrowserEnv||Qt.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(K.isFunction(n.getHeaders)){const c=n.getHeaders(),d=["content-type","content-length"];Object.entries(c).forEach(([u,f])=>{d.includes(u.toLowerCase())&&a.set(u,f)})}}if(Qt.hasStandardBrowserEnv&&(r&&K.isFunction(r)&&(r=r(t)),r||r!==!1&&Y$(t.url))){const c=o&&s&&q$.read(s);c&&a.set(o,c)}return t},X$=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const o=s2(e);let s=o.data;const a=mn.from(o.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:d}=o,u,f,h,g,m;function y(){g&&g(),m&&m(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let b=new XMLHttpRequest;b.open(o.method.toUpperCase(),o.url,!0),b.timeout=o.timeout;function v(){if(!b)return;const w=mn.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),S={data:!l||l==="text"||l==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:w,config:e,request:b};e2(function(O){n(O),y()},function(O){r(O),y()},S),b=null}"onloadend"in b?b.onloadend=v:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)||setTimeout(v)},b.onabort=function(){b&&(r(new Xe("Request aborted",Xe.ECONNABORTED,e,b)),b=null)},b.onerror=function(C){const S=C&&C.message?C.message:"Network Error",T=new Xe(S,Xe.ERR_NETWORK,e,b);T.event=C||null,r(T),b=null},b.ontimeout=function(){let C=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const S=o.transitional||X1;o.timeoutErrorMessage&&(C=o.timeoutErrorMessage),r(new Xe(C,S.clarifyTimeoutError?Xe.ETIMEDOUT:Xe.ECONNABORTED,e,b)),b=null},s===void 0&&a.setContentType(null),"setRequestHeader"in b&&K.forEach(a.toJSON(),function(C,S){b.setRequestHeader(S,C)}),K.isUndefined(o.withCredentials)||(b.withCredentials=!!o.withCredentials),l&&l!=="json"&&(b.responseType=o.responseType),d&&([h,m]=uc(d,!0),b.addEventListener("progress",h)),c&&b.upload&&([f,g]=uc(c),b.upload.addEventListener("progress",f),b.upload.addEventListener("loadend",g)),(o.cancelToken||o.signal)&&(u=w=>{b&&(r(!w||w.type?new Ms(null,e,b):w),b.abort(),b=null)},o.cancelToken&&o.cancelToken.subscribe(u),o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u)));const k=V$(o.url);if(k&&Qt.protocols.indexOf(k)===-1){r(new Xe("Unsupported protocol "+k+":",Xe.ERR_BAD_REQUEST,e));return}b.send(s||null)})},Z$=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,o;const s=function(d){if(!o){o=!0,l();const u=d instanceof Error?d:this.reason;r.abort(u instanceof Xe?u:new Ms(u instanceof Error?u.message:u))}};let a=t&&setTimeout(()=>{a=null,s(new Xe(`timeout ${t} of ms exceeded`,Xe.ETIMEDOUT))},t);const l=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(s):d.removeEventListener("abort",s)}),e=null)};e.forEach(d=>d.addEventListener("abort",s));const{signal:c}=r;return c.unsubscribe=()=>K.asap(l),c}},J$=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,o;for(;r<n;)o=r+t,yield e.slice(r,o),r=o},Q$=async function*(e,t){for await(const n of e8(e))yield*J$(n,t)},e8=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},i2=(e,t,n,r)=>{const o=Q$(e,t);let s=0,a,l=c=>{a||(a=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:d,value:u}=await o.next();if(d){l(),c.close();return}let f=u.byteLength;if(n){let h=s+=f;n(h)}c.enqueue(new Uint8Array(u))}catch(d){throw l(d),d}},cancel(c){return l(c),o.return()}},{highWaterMark:2})},a2=64*1024,{isFunction:fc}=K,t8=(({Request:e,Response:t})=>({Request:e,Response:t}))(K.global),{ReadableStream:l2,TextEncoder:c2}=K.global,d2=(e,...t)=>{try{return!!e(...t)}catch{return!1}},n8=e=>{e=K.merge.call({skipUndefined:!0},t8,e);const{fetch:t,Request:n,Response:r}=e,o=t?fc(t):typeof fetch=="function",s=fc(n),a=fc(r);if(!o)return!1;const l=o&&fc(l2),c=o&&(typeof c2=="function"?(m=>y=>m.encode(y))(new c2):async m=>new Uint8Array(await new n(m).arrayBuffer())),d=s&&l&&d2(()=>{let m=!1;const y=new n(Qt.origin,{body:new l2,method:"POST",get duplex(){return m=!0,"half"}}).headers.has("Content-Type");return m&&!y}),u=a&&l&&d2(()=>K.isReadableStream(new r("").body)),f={stream:u&&(m=>m.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(m=>{!f[m]&&(f[m]=(y,b)=>{let v=y&&y[m];if(v)return v.call(y);throw new Xe(`Response type '${m}' is not supported`,Xe.ERR_NOT_SUPPORT,b)})});const h=async m=>{if(m==null)return 0;if(K.isBlob(m))return m.size;if(K.isSpecCompliantForm(m))return(await new n(Qt.origin,{method:"POST",body:m}).arrayBuffer()).byteLength;if(K.isArrayBufferView(m)||K.isArrayBuffer(m))return m.byteLength;if(K.isURLSearchParams(m)&&(m=m+""),K.isString(m))return(await c(m)).byteLength},g=async(m,y)=>{const b=K.toFiniteNumber(m.getContentLength());return b??h(y)};return async m=>{let{url:y,method:b,data:v,signal:k,cancelToken:w,timeout:C,onDownloadProgress:S,onUploadProgress:T,responseType:O,headers:M,withCredentials:j="same-origin",fetchOptions:D}=s2(m),L=t||fetch;O=O?(O+"").toLowerCase():"text";let E=Z$([k,w&&w.toAbortSignal()],C),A=null;const P=E&&E.unsubscribe&&(()=>{E.unsubscribe()});let N;try{if(T&&d&&b!=="get"&&b!=="head"&&(N=await g(M,v))!==0){let R=new n(y,{method:"POST",body:v,duplex:"half"}),U;if(K.isFormData(v)&&(U=R.headers.get("content-type"))&&M.setContentType(U),R.body){const[Y,W]=t2(N,uc(n2(T)));v=i2(R.body,a2,Y,W)}}K.isString(j)||(j=j?"include":"omit");const $=s&&"credentials"in n.prototype,V={...D,signal:E,method:b.toUpperCase(),headers:M.normalize().toJSON(),body:v,duplex:"half",credentials:$?j:void 0};A=s&&new n(y,V);let H=await(s?L(A,D):L(y,V));const z=u&&(O==="stream"||O==="response");if(u&&(S||z&&P)){const R={};["status","statusText","headers"].forEach(G=>{R[G]=H[G]});const U=K.toFiniteNumber(H.headers.get("content-length")),[Y,W]=S&&t2(U,uc(n2(S),!0))||[];H=new r(i2(H.body,a2,Y,()=>{W&&W(),P&&P()}),R)}O=O||"text";let _=await f[K.findKey(f,O)||"text"](H,m);return!z&&P&&P(),await new Promise((R,U)=>{e2(R,U,{data:_,headers:mn.from(H.headers),status:H.status,statusText:H.statusText,config:m,request:A})})}catch($){throw P&&P(),$&&$.name==="TypeError"&&/Load failed|fetch/i.test($.message)?Object.assign(new Xe("Network Error",Xe.ERR_NETWORK,m,A),{cause:$.cause||$}):Xe.from($,$&&$.code,m,A)}}},r8=new Map,u2=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:o}=t,s=[r,o,n];let a=s.length,l=a,c,d,u=r8;for(;l--;)c=s[l],d=u.get(c),d===void 0&&u.set(c,d=l?new Map:n8(t)),u=d;return d};u2();const Xf={http:k$,xhr:X$,fetch:{get:u2}};K.forEach(Xf,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const f2=e=>`- ${e}`,o8=e=>K.isFunction(e)||e===null||e===!1;function s8(e,t){e=K.isArray(e)?e:[e];const{length:n}=e;let r,o;const s={};for(let a=0;a<n;a++){r=e[a];let l;if(o=r,!o8(r)&&(o=Xf[(l=String(r)).toLowerCase()],o===void 0))throw new Xe(`Unknown adapter '${l}'`);if(o&&(K.isFunction(o)||(o=o.get(t))))break;s[l||"#"+a]=o}if(!o){const a=Object.entries(s).map(([c,d])=>`adapter ${c} `+(d===!1?"is not supported by the environment":"is not available in the build"));let l=n?a.length>1?`since :
|
|
254
254
|
`+a.map(f2).join(`
|
|
255
255
|
`):" "+f2(a[0]):"as no adapter specified";throw new Xe("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return o}const p2={getAdapter:s8,adapters:Xf};function Zf(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ms(null,e)}function h2(e){return Zf(e),e.headers=mn.from(e.headers),e.data=Kf.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),p2.getAdapter(e.adapter||aa.adapter,e)(e).then(function(r){return Zf(e),r.data=Kf.call(e,e.transformResponse,r),r.headers=mn.from(r.headers),r},function(r){return Q1(r)||(Zf(e),r&&r.response&&(r.response.data=Kf.call(e,e.transformResponse,r.response),r.response.headers=mn.from(r.response.headers))),Promise.reject(r)})}const m2="1.13.2",pc={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{pc[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const g2={};pc.transitional=function(t,n,r){function o(s,a){return"[Axios v"+m2+"] Transitional option '"+s+"'"+a+(r?". "+r:"")}return(s,a,l)=>{if(t===!1)throw new Xe(o(a," has been removed"+(n?" in "+n:"")),Xe.ERR_DEPRECATED);return n&&!g2[a]&&(g2[a]=!0,console.warn(o(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,a,l):!0}},pc.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function i8(e,t,n){if(typeof e!="object")throw new Xe("options must be an object",Xe.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],a=t[s];if(a){const l=e[s],c=l===void 0||a(l,s,e);if(c!==!0)throw new Xe("option "+s+" must be "+c,Xe.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Xe("Unknown option "+s,Xe.ERR_BAD_OPTION)}}const hc={assertOptions:i8,validators:pc},wr=hc.validators;let Oo=class{constructor(t){this.defaults=t||{},this.interceptors={request:new K1,response:new K1}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const s=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
256
|
-
`+s):r.stack=s}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Eo(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:s}=n;r!==void 0&&hc.assertOptions(r,{silentJSONParsing:wr.transitional(wr.boolean),forcedJSONParsing:wr.transitional(wr.boolean),clarifyTimeoutError:wr.transitional(wr.boolean)},!1),o!=null&&(K.isFunction(o)?n.paramsSerializer={serialize:o}:hc.assertOptions(o,{encode:wr.function,serialize:wr.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),hc.assertOptions(n,{baseUrl:wr.spelling("baseURL"),withXsrfToken:wr.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=s&&K.merge(s.common,s[n.method]);s&&K.forEach(["delete","get","head","post","put","patch","common"],m=>{delete s[m]}),n.headers=mn.concat(a,s);const l=[];let c=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(n)===!1||(c=c&&y.synchronous,l.unshift(y.fulfilled,y.rejected))});const d=[];this.interceptors.response.forEach(function(y){d.push(y.fulfilled,y.rejected)});let u,f=0,h;if(!c){const m=[h2.bind(this),void 0];for(m.unshift(...l),m.push(...d),h=m.length,u=Promise.resolve(n);f<h;)u=u.then(m[f++],m[f++]);return u}h=l.length;let g=n;for(;f<h;){const m=l[f++],y=l[f++];try{g=m(g)}catch(b){y.call(this,b);break}}try{u=h2.call(this,g)}catch(m){return Promise.reject(m)}for(f=0,h=d.length;f<h;)u=u.then(d[f++],d[f++]);return u}getUri(t){t=Eo(this.defaults,t);const n=r2(t.baseURL,t.url,t.allowAbsoluteUrls);return G1(n,t.params,t.paramsSerializer)}};K.forEach(["delete","get","head","options"],function(t){Oo.prototype[t]=function(n,r){return this.request(Eo(r||{},{method:t,url:n,data:(r||{}).data}))}}),K.forEach(["post","put","patch"],function(t){function n(r){return function(s,a,l){return this.request(Eo(l||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}Oo.prototype[t]=n(),Oo.prototype[t+"Form"]=n(!0)});let a8=class lx{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(o=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](o);r._listeners=null}),this.promise.then=o=>{let s;const a=new Promise(l=>{r.subscribe(l),s=l}).then(o);return a.cancel=function(){r.unsubscribe(s)},a},t(function(s,a,l){r.reason||(r.reason=new Ms(s,a,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new lx(function(o){t=o}),cancel:t}}};function l8(e){return function(n){return e.apply(null,n)}}function c8(e){return K.isObject(e)&&e.isAxiosError===!0}const Jf={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Jf).forEach(([e,t])=>{Jf[t]=e});function y2(e){const t=new Oo(e),n=A1(Oo.prototype.request,t);return K.extend(n,Oo.prototype,t,{allOwnKeys:!0}),K.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return y2(Eo(e,o))},n}const kt=y2(aa);kt.Axios=Oo,kt.CanceledError=Ms,kt.CancelToken=a8,kt.isCancel=Q1,kt.VERSION=m2,kt.toFormData=cc,kt.AxiosError=Xe,kt.Cancel=kt.CanceledError,kt.all=function(t){return Promise.all(t)},kt.spread=l8,kt.isAxiosError=c8,kt.mergeConfig=Eo,kt.AxiosHeaders=mn,kt.formToJSON=e=>Z1(K.isHTMLForm(e)?new FormData(e):e),kt.getAdapter=p2.getAdapter,kt.HttpStatusCode=Jf,kt.default=kt;const{Axios:HB,AxiosError:UB,CanceledError:YB,isCancel:qB,CancelToken:GB,VERSION:KB,all:XB,Cancel:ZB,isAxiosError:JB,spread:QB,toFormData:e7,AxiosHeaders:t7,HttpStatusCode:n7,formToJSON:r7,getAdapter:o7,mergeConfig:s7}=kt,Qf={BASE_URL:"https://qa.3sc.ai/api",VERSION:"/v1"},ca={headers:{"Content-Type":"application/json"},withCredentials:!0},b2=kt.create({baseURL:Qf.BASE_URL,axiosConfig:ca});b2.interceptors.request.use(function(e){return e},function(e){return Promise.reject(e)}),b2.interceptors.response.use(function(e){return e},function(e){return Promise.reject(e)});const gn={TOKEN:"token",USER:"user",SNOP:"snop",SELECTED_BU:"selected_business_unit",SETTINGS:"settings"},v2={TENANT_ID:"tenant_id",BU_ID:"bu_id"},d8=Object.values({"SKU Name":"sku_name",Node:"node","Channel Name":"channel_name"}),u8=[10,25,50,100],f8={MARK_ALL_READ:"MARK_ALL_READ"},p8=u8.map(e=>({label:e,value:e})),x2={PRIMARY:"PRIMARY",SECONDARY:"SECONDARY"},mc={NOTIFICATION:"/notifications",SETTING:"/configuration/setting"};function gc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var h8={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function ep(e,t){function n(o,s,a){if(!(typeof document>"u")){a=gc({},t,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var l="";for(var c in a)a[c]&&(l+="; "+c,a[c]!==!0&&(l+="="+a[c].split(";")[0]));return document.cookie=o+"="+e.write(s,o)+l}}function r(o){if(!(typeof document>"u"||arguments.length&&!o)){for(var s=document.cookie?document.cookie.split("; "):[],a={},l=0;l<s.length;l++){var c=s[l].split("="),d=c.slice(1).join("=");try{var u=decodeURIComponent(c[0]);if(a[u]=e.read(d,u),o===u)break}catch{}}return o?a[o]:a}}return Object.create({set:n,get:r,remove:function(o,s){n(o,"",gc({},s,{expires:-1}))},withAttributes:function(o){return ep(this.converter,gc({},this.attributes,o))},withConverter:function(o){return ep(gc({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var m8=ep(h8,{path:"/"});const g8=Zl(gn.SNOP),y8=Zl(gn.SELECTED_BU),b8=Zl(gn.USER);Zl(gn.SETTINGS);const w2={BU_IDS:y8?.business_unit_id,TOKEN:JSON.parse(m8.get(gn.TOKEN)||null),TENANT_IDS:b8?.tenant_id,SNOP_IDS:g8?.snop_id},{TENANT_ID:v8,BU_ID:x8}=v2,{TENANT_IDS:w8,BU_IDS:S8}=w2,Ps=async({baseUrl:e,payload:t})=>{try{const n=`${e}${mc.SETTING}/v1?${v8}=${w8}&${x8}=${S8}`;return await kt.post(n,t,ca)}catch(n){return n}},da=JSON.parse(localStorage.getItem("configuration")),tp=localStorage.getItem("i18nextLng"),C8=da?.entities?.locationHierarchy?.[tp]??da?.entities?.locationHierarchy??{},T8=da?.entities?.productHierarchy?.[tp]??da?.entities?.productHierarchy??{},k8=C8?.base??"Node",E8=T8?.base??"SKU",O8=da?.entities?.labelChannel?.[tp]||"Channel";JSON.parse(localStorage.getItem("snop"));const M8=({columns:e,gridPath:t,baseUrl:n,isDefaultConfig:r,pageSize:o=10,childUniqueKey:s,data:a})=>{const l=a?.length;let{definitions:c,defaultUserSettings:d,labels:u}=e;const f=Rr(u),h=t.split("/").filter(Boolean),g=JSON.parse(localStorage.getItem(gn.SETTINGS));let m=h.reduce((w,C)=>w?.[C],g)||null;const y=Rr(m?.columns||[]);if(!r&&t&&l){let w=(d&&np({col:d,childUniqueKey:s,definitions:c}))??np({col:c,childUniqueKey:s});const C=w.filter(T=>!y[T.key]),S=m&&m?.columns?.some(T=>T?.children&&T.children[s]);if(l&&(C.length||s&&S===!1)){if(S==!1&&s.length>0){const T=Rr(w);w=m?.columns?.map(O=>O?.children&&!O.children[s]?{...O,children:{...O.children,[s]:T?.[O?.key]?.children[s]}}:O)}(async()=>{try{const O={...g||{platform:{theme:"light"}}},M=m?.pageSize??o;let j=O;for(let D=0;D<h.length;D++){const L=h[D];D===h.length-1?j[L]={columns:w,pageSize:M}:(j[L]={...j[L]||{}},j=j[L])}localStorage.setItem(gn.SETTINGS,JSON.stringify(O)),await Ps({baseUrl:n,payload:O})}catch(T){console.error(T)}})()}}d=(m?.columns&&P8(y,d,s))??d??np({col:c});const b=[],v=Rr(d);for(const w of c){const C=v[w.key]||{},S=f[w.key]||{},T=y[w.key],O=Rr(C.children||[]),M=Rr(S.children||[]);let j={...w,style:T?.style,...C,...S};w.children?.length&&(j.children=w.children.map(D=>({...D,...O[D.key],...M[D.key]}))),b.push(j)}return b.sort((w,C)=>w.sequenceId-C.sequenceId)},S2=e=>e.sort((t,n)=>t.sequenceId-n.sequenceId),ua=({columns:e,childUniqueKey:t,definitions:n})=>{let r=n||e;return e?.map(o=>{let s=r?.find(a=>a?.key===o?.key);return{id:o.id,key:o.key,sequenceId:o.sequenceId||o.id,isHidden:o.isHidden||!1,style:o.style||s?.style||{},...o?.children&&{children:t?{[t]:ua({columns:o.children,definitions:s?.children})}:ua({columns:o.children,definitions:s?.children})}}})},Rr=e=>Array.isArray(e)&&e?.reduce((t,n)=>(t[n.key]=n,t),{}),np=({col:e,childUniqueKey:t,definitions:n})=>ua({columns:e,childUniqueKey:t,definitions:n}),P8=(e,t,n)=>t.map(o=>{const s=e[o.key],a=o.children?o.children.map(l=>{const d=Rr(Array.isArray(s?.children)?s?.children:s?.children?.[n])?.[l.key];return{...l,sequenceId:d?.sequenceId||l.sequenceId,isHidden:d?.isHidden??l.isHidden}}):void 0;return{...o,sequenceId:s?.sequenceId||o.sequenceId,isHidden:s?.isHidden??o.isHidden,...a?{children:a}:{}}}),j8=({t:e})=>{const t=[{id:1,key:"sku_name",isSortable:!0,isMandatory:!0},{id:2,key:"node",isSortable:!0,isMandatory:!0},{id:3,key:"channel_name",isSortable:!0,isMandatory:!0}],n=[{id:1,key:"sku_name",sequenceId:1,isHidden:!1,style:{width:"20rem",minWidth:"20rem",maxWidth:"20rem"}},{id:2,key:"node",sequenceId:2,isHidden:!1,style:{width:"20rem",minWidth:"20rem",maxWidth:"20rem"}},{id:3,key:"channel_name",sequenceId:3,isHidden:!1,style:{width:"20rem",minWidth:"20rem",maxWidth:"20rem"}}],r=[{id:1,key:"sku_name",label:e(E8),isLocalizable:!1},{id:2,key:"node",label:e(k8),isLocalizable:!1},{id:3,key:"channel_name",label:e(O8),isLocalizable:!1}];return{definitions:t,defaultUserSettings:n,labels:r}},I8=e=>{if(!e)return null;try{const t=JSON.parse(localStorage.getItem(gn.SETTINGS));return e.split("/").filter(Boolean).reduce((n,r)=>n?.[r],t)??null}catch{return null}},C2=(e=[],t)=>{const n=new Map,r=o=>o.forEach(s=>{n.set(s.key,s);const a=Array.isArray(s.children)?s.children:t?s.children?.[t]??[]:[];a.length&&r(a)});return r(e),n},T2=(e,t,n,r)=>e.map(o=>{const s=t.get(o.key),a=n?.get(o.key),l={key:o.key,sequenceId:s?.sequenceId??a?.sequenceId??o.sequenceId,isHidden:s?.isHidden??!1,style:s?.style??o.style??{}};if(o.children?.length){const c=T2(o.children,t,n,r);if(r){const d=s?.children&&!Array.isArray(s.children)?s.children:{};l.children={...d,[r]:c}}else l.children=c}return l}),D8=({definitions:e=[],defaultSetting:t=[],gridPath:n,childUniqueKey:r})=>{const s=I8(n)?.columns??[],a=C2(s,r),l=C2(t,r),c=(()=>{if(!s.length)return!0;const d=u=>u.some(f=>!a.has(f.key)||d(f.children??[]));return d(e)})();return{settings:T2(e,a,l,r),hasNewColumns:c}},yc=async({settings:e,gridPath:t,baseUrl:n})=>{if(t)try{const r=JSON.parse(localStorage.getItem(gn.SETTINGS))??{platform:{theme:"light"}},o=t.split("/").filter(Boolean);let s=r;for(let a=0;a<o.length;a++){const l=o[a];a===o.length-1?s[l]={...s[l]??{},columns:e}:(s[l]={...s[l]??{}},s=s[l])}localStorage.setItem(gn.SETTINGS,JSON.stringify(r)),n&&await Ps({baseUrl:n,payload:r})}catch(r){console.error("saveColumnSettings failed:",r)}},A8=async({groupBy:e,gridPath:t,baseUrl:n})=>{if(!(!t||!Array.isArray(e)))try{const r=JSON.parse(localStorage.getItem(gn.SETTINGS))??{platform:{theme:"light"}},o=t.split("/").filter(Boolean);let s=r;for(let a=0;a<o.length;a++){const l=o[a];if(a===o.length-1){const c=s[l]?.groupBy;if(Array.isArray(c)&&JSON.stringify(c)===JSON.stringify(e)||!c&&e.length===0)return;s[l]={...s[l]??{},groupBy:e}}else s[l]={...s[l]??{}},s=s[l]}localStorage.setItem(gn.SETTINGS,JSON.stringify(r)),n&&await Ps({baseUrl:n,payload:r})}catch(r){console.error("saveGroupBySettings failed:",r)}},R8=e=>{if(!e)return null;const{options:t,...n}=e,r=t?"select":"button",o={button:s=>p.jsx(jr,{...s,styles:{...s.styles,iconPrimary:s?.styles?.variant=="filled"}}),select:s=>p.jsx(oe,{sx:{"& .MuiInputBase-input":{padding:"0rem!important"},width:s.styles?.width},children:p.jsx(vv,{...s,options:t})})};return o[r]?o[r](n):null},N8=({presentSetting:e,gridSetting:t,gridPath:n,childUniqueKey:r})=>{if(!n)return e;const o=n.split("/").filter(Boolean);let s=o.reduce((d,u)=>d?.[u],e)||null,a=ua({columns:t?.grid,childUniqueKey:r});const l=Rr(s?.columns);a=a?.map(d=>{const u=d?.children||{},f=l?.[d?.key]?.children||{};return{...d,...(Object.keys(f)?.length>0||u?.[r])&&{children:{...f,[r]:u?.[r]}}}});let c=e;for(let d=0;d<o.length;d++){const u=o[d];d===o.length-1?c[u]={columns:a,pageSize:t?.pageSize??null}:(c[u]=c[u]||{},c=c[u])}return{settingObject:e,defaultUserSettings:a}},$8=async({baseUrl:e,gridSetting:t,childUniqueKey:n,gridPath:r})=>{try{const o=JSON.parse(localStorage.getItem("settings")),{settingObject:s,defaultUserSettings:a}=N8({presentSetting:o,gridSetting:t,gridPath:r,childUniqueKey:n});return localStorage.setItem("settings",JSON.stringify(s)),await Ps({baseUrl:e,payload:s}),a}catch(o){console.error(o)}},k2=({index:e,visibleGridColumns:t,width:n,columnUpdaterFunction:r})=>{if(!t||!t[e])return null;t[e];let o=`${n/10}rem`;const s=t.map((a,l)=>l===e?{...a,style:{...a.style,width:o,minWidth:o,maxWidth:o}}:a);return r({updatedColumns:s}),s[e]},L8=({definitions:e=[],labels:t=[],settings:n=[],childUniqueKey:r})=>{const o=(f=[],h=!1)=>{const g=[],m=y=>{y?.forEach(b=>{g.push(b);let v=b.children;h&&r&&v&&!Array.isArray(v)&&(v=v[r]??[]),Array.isArray(v)&&v.length&&m(v)})};return m(f),g},s=o(t),a=o(n,!0),l=new Map(s.map(f=>[f.key,f])),c=new Map(a.map(f=>[f.key,f])),d=f=>{if(f){if(typeof f=="number")return f;if(f.includes("rem"))return parseFloat(f)*16;if(f.includes("px"))return parseFloat(f)}},u=f=>{const h=l.get(f.key),g=c.get(f.key),m=f.isMandatory===!0;return{id:f.key,label:h?.label,field:f.key,renderHeader:y=>p.jsx(ss,{title:y.helpText??y.label,placement:"top",componentsProps:{tooltip:{sx:{fontSize:"1rem",padding:"0.6rem 1rem",boxShadow:"0 2px 8px rgba(0,0,0,0.3)"}}},children:y.label??""}),width:d(g?.style?.width??f.style?.width),minWidth:d(f.style?.minWidth),maxWidth:d(f.style?.maxWidth),sortable:f.isSortable??!1,pinned:f.isSticky?"left":void 0,hidden:g?.isHidden??!1,resizable:f?.isResizable??!0,draggable:f?.isDraggable??!m,hideable:!m,align:"center",deferRender:f.deferRender,renderCell:f.cellRenderer?(y,b,v)=>f.cellRenderer(b,v):void 0,meta:{isMandatory:m,...f},children:f.children?.map(u)}};return e.map(u)},bc=({pagination:e,gridPath:t,baseUrl:n,t:r})=>{const{selectedPage:o,rowPerPage:s,totalRecords:a,onPageChange:l,onPageSizeChange:c}=e,d=gt(),u=async(g,m)=>{if(!m)return;const y=m.split("/").filter(Boolean),b="settings",k={...JSON.parse(localStorage.getItem(b))||{}};let w=k;for(let C=0;C<y.length;C++){const S=y[C];C===y.length-1?w[S]={...w[S]||{},pageSize:g}:(w[S]={...w[S]||{}},w=w[S])}localStorage.setItem(b,JSON.stringify(k)),await Ps({baseUrl:n,payload:k})},f=a===0?0:(o-1)*s+1,h=Math.min(o*s,a);return p.jsxs(oe,{sx:{display:"flex",p:"1rem 1.5rem"},children:[p.jsxs(oe,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"0.5rem",width:"100%"},children:[p.jsx(ft,{sx:{fontSize:"1.1rem",color:d.palette.primary.notifyTextColor},children:r("SHOWING_ROWS",{start:f,end:h,current:Math.min(o*s,a),total:a})}),p.jsx(oe,{sx:{"& .MuiInputBase-input":{padding:"0rem 0.8rem!important"},width:"6rem"},children:p.jsx(vs,{options:p8,value:s,onChange:async g=>{c(g),u(g?.value,t)}})})]}),p.jsx(Vg,{count:Math.ceil(a/s),page:o,onChange:async(g,m)=>{l(m)},siblingCount:0,shape:"rounded",sx:{width:"100%","& .MuiPagination-ul":{width:"100%",display:"flex",justifyContent:"flex-end","& li:first-of-type":{border:`0.1rem solid ${d.palette.primary.notifyBorderColor}`,color:d.palette.primary.notifyActiveText,marginRight:"1.5rem",borderRadius:"1rem",width:"3rem",height:"3rem",justifyContent:"center",alignItems:"center",display:"flex"},"& li:last-child":{border:`0.1rem solid ${d.palette.primary.notifyBorderColor}`,color:d.palette.primary.notifyActiveText,marginLeft:"1.5rem",borderRadius:"1rem",width:"3rem",height:"3rem",justifyContent:"center",alignItems:"center",display:"flex"}},"& .MuiPaginationItem-root":{color:"#595959",fontSize:"1.1rem",borderRadius:"1rem",width:"3rem",height:"3rem",justifyContent:"center",alignItems:"center",display:"flex","& .MuiSvgIcon-root":{fontSize:"2.2rem"}},"& .Mui-selected":{color:d.palette.primary.notifyActiveText,backgroundColor:`${d.palette.brandColor.paginationBc} !important`}}})]})};bc.propTypes={pagination:i.object.isRequired};const B8=({customTools:e})=>{const t=e?.filter(r=>r?.type===x2.PRIMARY)?.sort((r,o)=>r.sequenceId-o.sequenceId),n=e?.filter(r=>r?.type===x2.SECONDARY)?.sort((r,o)=>r.sequenceId-o.sequenceId);return{primaryButtons:t,secondaryButtons:n}},E2=({customTools:e,isExpanded:t,setIsExpanded:n})=>{const{primaryButtons:r,secondaryButtons:o}=B8({customTools:e}),[s,a]=x.useState(r),l=o?.length>0,{t:c}=x.useContext(sn),d=f=>{f?a([...r,...o]):setTimeout(()=>{a(r)},100)},u=()=>{const f=!t;n(f),d(f)};return x.useEffect(()=>{d(t)},[e]),p.jsxs(p.Fragment,{children:[t&&p.jsx("div",{style:{position:"fixed",left:0,width:"100vw",height:"4rem",zIndex:998}}),p.jsxs(oe,{sx:{display:"flex",alignItems:"center",gap:"0.8rem",flexWrap:"nowrap",maxWidth:"100%",whiteSpace:"nowrap",zIndex:999},children:[p.jsx(Rj,{mode:"popLayout",children:s.map((f,h)=>p.jsx(Zr.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},layout:!0,children:p.jsx(oe,{sx:{flexShrink:0,minWidth:"fit-content"},children:R8(f)})},`${f.id}_${h}`))}),l&&p.jsx(oe,{sx:{paddingLeft:t?"0.5rem":0},children:p.jsx(jr,{label:t?"":c("LABEL_MORE_ACTIONS"),styles:{iconPrimary:!0,icon:t?Ge.CrossWhite:Ge.More,colorType:t?"danger":""},onClick:u})})]})]})};E2.propTypes={customTools:i.array.isRequired};const rp=({defaultTools:e,isManageable:t,customTools:n,baseUrl:r,gridPath:o,pageSize:s,gridData:a,childUniqueKey:l})=>{const{t:c}=x.useContext(sn),d=x.useContext(bs),u=x.useContext(Xi)||{},{visibleGridColumns:f=[],triggerApi:h=!1}=u,[g,m]=x.useState([]),[y,b]=x.useState(!1),v=n?.filter(T=>T.position==="left").sort((T,O)=>T.sequenceId-O.sequenceId)||[],k=n?.filter(T=>T.position==="right").sort((T,O)=>T.sequenceId-O.sequenceId)||[];x.useEffect(()=>{if(f.length&&t){const T={id:99999,sequenceId:99999,isLocalizable:!1,key:"horizons",label:c("Horizons"),isSortable:!1,isHidden:!0,showChildCheckbox:!0,showCheckbox:!1,isMandatory:!0,showInHierarchy:!0,showHide:!0,children:[]};let O=f.map(j=>(j?.children&&j.children.forEach(D=>{T.children.some(E=>E.key===D.key)||T.children.push({...D,showInHierarchy:!0})}),j)).filter(j=>j?.id!==T?.id);const M=T.children.length>0?[...O,T]:O;m(M)}},[f]);const w=async T=>{try{await $8({baseUrl:r,gridPath:o,childUniqueKey:l,gridSetting:{grid:T,pageSize:s}})}catch(O){console.error(O)}finally{d({type:Fe.HAS_SETTING_CHANGE,payload:{hasChange:!1}}),d({type:Fe.TRIGGER_API,payload:{triggerApi:!1}})}};x.useEffect(()=>{h&&t&&w(f)},[h]);const C=T=>{const O=T?.map(D=>D.id),M=T?.flatMap(D=>D.children||[])?.map(D=>D.id),j=g?.map(D=>{const L=O?.includes(D.id);if(Array.isArray(D.children)&&D.children.length>0){const A=D?.children?.map(N=>{const $=M?.includes?.(N.id);return{...N,isHidden:!$}}),P=A?.filter(N=>g?.some($=>$.children?.some(V=>V.id===N.id)))?.every(N=>N.isHidden);return{...D,...!D.children[0]?.showInHierarchy&&{isHidden:P||!L},children:A}}return{...D,isHidden:!L}});d({type:Fe.SET_GRID_DATA,payload:{visibleGridColumns:j}}),d({type:Fe.HAS_SETTING_CHANGE,payload:{hasChange:!0}})},S=()=>g.map(O=>{const M=Array.isArray(O.children)?O.children.filter(j=>!j.isHidden):void 0;return!O.isHidden||O.isHidden&&O.showInHierarchy?{...O,children:M}:null}).filter(Boolean);return p.jsxs(oe,{sx:{margin:"1rem 0",position:"relative",zIndex:10,display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",gap:"0.6rem",width:"100%"},children:[p.jsxs(oe,{sx:{display:"flex",flexDirection:"row",gap:"0.6rem",alignItems:"center"},children:[e?.search?.isRequired&&p.jsx(mv,{...e?.search,iconUrl:Ge.Search}),e?.refresh?.isRequired&&p.jsx(jr,{...e?.refresh,styles:{variant:"filled",icon:Ge.Refresh,colorType:"empty",width:"3.2rem",height:"3.2rem"}}),e?.groupBy?.isRequired&&p.jsx(oe,{sx:{"& .MuiInputBase-input":{padding:"0rem!important"}},children:p.jsx(vs,{styles:{icon:Ge.Group},...e.groupBy})}),t&&p.jsx(oe,{sx:{"& .MuiInputBase-input":{padding:"0rem!important"}},children:p.jsx(vs,{placeholder:c("LABEL_MANAGE_COLUMN"),options:g,value:S(),isMulti:!0,isDraggable:!0,showSearch:!0,isManageColumn:!0,onChange:C,disabled:!a.length,styles:{icon:Ge.Manage}})}),v?.length>0&&v.map((T,O)=>p.jsx(x.Fragment,{children:T.render()},T.id))]}),p.jsxs(oe,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-end",alignItems:"center",gap:"0.6rem"},children:[k?.length>0&&k.map((T,O)=>p.jsx(x.Fragment,{children:T.render()},T.id)),n&&p.jsx(E2,{customTools:n,setIsExpanded:b,isExpanded:y}),e?.save?.isRequired&&p.jsx(oe,{sx:{px:"0.5rem"},children:p.jsx(jr,{label:y?"":"Save",styles:{icon:Ge.Save,colorType:"empty"},...e?.save})}),e?.upload?.isRequired&&p.jsx(jr,{...e?.upload,styles:{variant:y?"outlined":"filled",icon:y?Ge.UploadDark:Ge.Upload,iconPrimary:!y,colorType:"secondary",isAnimate:!0}}),e?.download?.isRequired&&p.jsx(jr,{...e?.download,styles:{variant:"outlined",icon:Ge.Download,isAnimate:!0}})]})]})};rp.propTypes={defaultTools:i.object.isRequired,customTools:i.array,isManageable:i.bool,baseUrl:i.string,gridPath:i.gridPath},ee(_d)(({theme:e})=>({"& .MuiPaper-root":{borderRadius:8,border:`1px solid ${e.palette.primary.notifyBorderColor}`,boxShadow:e.shadows[4],padding:"1rem 1rem 0rem 1rem",backgroundColor:e.palette.primary.notifyBackground}}));const Nr=ee(ft)(({theme:e})=>({color:e.palette.primary.notifyTextColor,fontSize:"1.1rem"})),_8=ee(Kg)(({theme:e})=>({width:28,height:16,padding:0,display:"flex","&:active":{"& .MuiSwitch-thumb":{width:15},"& .MuiSwitch-switchBase.Mui-checked":{transform:"translateX(9px)"}},"& .MuiSwitch-switchBase":{padding:2,"&.Mui-checked":{transform:"translateX(12px)",color:"#fff","& + .MuiSwitch-track":{opacity:1,backgroundColor:"#1890ff",...e.applyStyles("dark",{backgroundColor:"#177ddc"})}}},"& .MuiSwitch-thumb":{boxShadow:"0 2px 4px 0 rgb(0 35 11 / 20%)",width:12,height:12,borderRadius:6,transition:e.transitions.create(["width"],{duration:200})},"& .MuiSwitch-track":{borderRadius:16/2,opacity:1,backgroundColor:"rgba(0,0,0,.25)",boxSizing:"border-box",...e.applyStyles("dark",{backgroundColor:"rgba(255,255,255,.35)"})}})),F8=ee(os)(({theme:e})=>({color:e.palette.primary.notifyTextColor,padding:"0.6rem 0",fontSize:"0.9rem",fontWeight:500,"&::before, &::after":{borderColor:`${e.palette.primary.notifyBorderColor}!important`}})),W8=ee(Ad)(({theme:e})=>({"& .MuiBadge-badge":{right:3.5,top:1.8,border:`0.1rem solid ${e.palette.primary.notifyBackground}`,padding:"0 1.3px",borderRadius:"50%",backgroundColor:"#D44E40",fontSize:"0.725rem",minWidth:"0.7rem",height:"0.7rem"}}));ee(ru)(({theme:e})=>({"& .MuiInputBase-root":{height:"3.52rem"},"& .MuiFormLabel-root":{color:`${e.palette.primary.notifyBorderColor} !important`,fontSize:"1rem",marginTop:"0.4rem"},"& label.Mui-focused":{color:e.palette.primary.notifyTextColor},"& .MuiInput-underline:after":{borderBottomColor:e.palette.primary.notifyBorderColor,borderBottomWidth:"0.1rem"},"& .MuiOutlinedInput-root":{"& fieldset":{borderColor:e.palette.primary.notifyBorderColor,borderWidth:"0.1rem"},"&:hover fieldset":{borderColor:e.palette.primary.notifyBorderColor,borderWidth:"0.1rem"},"&.Mui-focused fieldset":{borderColor:e.palette.primary.notifyBorderColor,borderWidth:"0.1rem"}}}));const z8=ee(c0)(({theme:e})=>({minHeight:"2rem","& .MuiTabs-indicator":{height:"0.1rem",backgroundColor:e.palette.primary.notifyActiveText}})),op=ee(Xg)(({theme:e})=>({color:e.palette.primary.notifyActiveText,textTransform:"none",fontWeight:"normal",padding:0,fontSize:"1rem",minHeight:"2rem",paddingBottom:"1rem","&.Mui-selected":{fontWeight:"bold",color:e.palette.primary.notifyActiveText}})),vc=ee(Qm)(({theme:e})=>({"&.MuiChip-outlined":{borderColor:e.palette.primary.notifyBorderColor,color:e.palette.primary.notifyActiveText},height:"2rem",fontSize:"0.9rem",fontWeight:"300",borderColor:e.palette.primary.notifyBorderColor,color:e.palette.primary.notifyActiveText,borderRadius:"0.6rem",padding:"0.2rem","&:hover":{backgroundColor:`${e.palette.brandColor.orange} !important`,color:`${e.palette.brandColor.white} !important`}}));function V8(e,t){const n=new Map((t??[]).map(s=>[s.id,s.label])),r=[],o=new Set;for(const s of e)s.label?.trim()&&(s.groupId?(o.has(s.groupId)||(o.add(s.groupId),r.push({isGroup:!0,id:s.groupId,label:n.get(s.groupId)??s.groupId,children:[]})),r.find(a=>a.isGroup&&a.id===s.groupId)?.children.push(s)):r.push({isGroup:!1,...s}));return r}const js=({children:e,indent:t=!1,onClick:n,...r})=>p.jsx(Ye,{direction:"row",alignItems:"center",gap:"0.5rem",onClick:n,sx:{pl:t?"2.2rem":"0.8rem",pr:"0.8rem",py:"0.4rem",cursor:"pointer",minHeight:"2rem",userSelect:"none","&:hover":{background:o=>o.palette.action?.hover??"rgba(0,0,0,0.04)"}},...r,children:e}),Is=({hidden:e,children:t})=>p.jsx(ft,{sx:{fontSize:"1.1rem",fontWeight:300,color:n=>e?n.palette.primary.notifyTextColor:n.palette.primary.notifyActiveText,overflow:"hidden",textOverflow:"ellipsis",minWidth:0},children:t});function H8({item:e,onDragEnd:t,hiddenIds:n,expandedIds:r,toggleExpand:o,handleGroupToggle:s,handleChildToggle:a,groupAllVisible:l,groupSomeVisible:c}){const d=cv(),u=r.has(e.id);return p.jsxs(pv,{value:e,dragListener:!1,dragControls:d,onDragEnd:t,as:"div",whileDrag:{opacity:.75,scale:1.01,zIndex:50},layout:!1,style:{listStyle:"none"},children:[p.jsx(js,{onClick:()=>e.children.length===1&&s(e),children:p.jsxs(Ye,{direction:"row",justifyContent:"space-between",alignItems:"center",width:"100%",gap:"0.5rem",children:[p.jsx(oe,{onPointerDown:f=>f.stopPropagation(),onClick:f=>{f.stopPropagation(),o(e.id)},sx:{cursor:"pointer",flexShrink:0,width:"2rem",height:"0.9rem",opacity:.6,display:"flex",alignItems:"center",justifyContent:"center"},children:p.jsx(Vt,{url:u?Ge.ArrowSelectUp:Ge.ArrowRight})}),p.jsxs(Ye,{direction:"row",gap:"0.5rem",width:"100%",alignItems:"center",children:[p.jsx(oe,{onPointerDown:f=>f.stopPropagation(),children:p.jsx(gr,{sx:{p:0},checked:l(e),indeterminate:c(e),onClick:f=>{f.stopPropagation(),s(e)}})}),p.jsx(Is,{hidden:!l(e)&&!c(e),children:e.label})]})]})}),u&&e.children.map(f=>p.jsx(js,{indent:!0,onClick:()=>a(f),children:p.jsxs(Ye,{direction:"row",gap:"1rem",width:"100%",children:[p.jsx(oe,{sx:{flexShrink:0,width:"1rem",height:"0.9rem"}}),p.jsx(oe,{onPointerDown:h=>h.stopPropagation(),children:p.jsx(gr,{sx:{p:0},checked:!n.has(f.id),onClick:h=>{h.stopPropagation(),a(f)}})}),p.jsx(Is,{hidden:n.has(f.id),children:f.label})]})},f.id))]})}function U8({item:e,onDragEnd:t,hiddenIds:n,handleLeafToggle:r}){const o=cv();return p.jsx(pv,{value:e,dragListener:!1,dragControls:o,onDragEnd:t,as:"div",whileDrag:{opacity:.75,scale:1.01,zIndex:50},layout:!1,style:{listStyle:"none"},children:p.jsx(js,{onClick:()=>r(e),children:p.jsxs(Ye,{direction:"row",justifyContent:"space-between",alignItems:"center",width:"100%",gap:"0.5rem",children:[p.jsx(oe,{sx:{flexShrink:0,width:"2rem",height:"0.9rem"}}),p.jsxs(Ye,{direction:"row",gap:"0.5rem",width:"100%",alignItems:"center",children:[p.jsx(oe,{onPointerDown:s=>s.stopPropagation(),children:p.jsx(gr,{sx:{p:0},checked:!n.has(e.id),onClick:s=>{s.stopPropagation(),r(e)}})}),p.jsx(Is,{hidden:n.has(e.id),children:e.label})]})]})})})}const Y8=({engine:e,onClose:t})=>{const{t:n}=x.useContext(sn),{orderedColumns:r,toggleColumnVisibility:o,showAllColumns:s,resetColumns:a,moveColumnBefore:l,groups:c=[]}=e,d=x.useMemo(()=>r.filter(P=>P.draggable||P.hideable),[r]),[u,f]=x.useState(""),[h,g]=x.useState(new Set),[m,y]=x.useState(()=>V8(d,c)),b=x.useRef(m),[v,k]=x.useState(()=>{const P=new Set;return d.forEach(N=>{N.hidden&&P.add(N.id)}),P}),w=P=>g(N=>{const $=new Set(N);return $.has(P)?$.delete(P):$.add(P),$}),C=x.useMemo(()=>d.filter(P=>P.label?.trim()).map(P=>P.id),[d]);C.length>0&&C.every(P=>!v.has(P));const S=P=>P.children.every(N=>!v.has(N.id)),T=P=>P.children.some(N=>!v.has(N.id))&&!P.children.every(N=>!v.has(N.id)),O=P=>{const N=new Set(v),$=P.children.every(V=>!N.has(V.id));k(V=>{const H=new Set(V);return P.children.forEach(z=>$?H.add(z.id):H.delete(z.id)),H}),setTimeout(()=>{P.children.forEach(V=>{const H=N.has(V.id);$&&!H&&o(V.id),!$&&H&&o(V.id)})},0)},M=P=>{o(P.id),k(N=>{const $=new Set(N);return $.has(P.id)?$.delete(P.id):$.add(P.id),$})},j=P=>{o(P.id),k(N=>{const $=new Set(N);return $.has(P.id)?$.delete(P.id):$.add(P.id),$})},D=P=>{y(P),b.current=P},L=()=>{const N=b.current.flatMap($=>$.isGroup?$.children.map(V=>V.id):[$.id]);setTimeout(()=>{for(let $=N.length-2;$>=0;$--)l(N[$],N[$+1])},0)},E=x.useMemo(()=>{if(!u)return m;const P=u.toLowerCase();return m.reduce((N,$)=>{if($.isGroup){const V=$.label.toLowerCase().includes(P),H=$.children.filter(z=>z.label.toLowerCase().includes(P));V?N.push($):H.length&&N.push({...$,children:H})}else $.label.toLowerCase().includes(P)&&N.push($);return N},[])},[m,u]),A={hiddenIds:v,expandedIds:h,toggleExpand:w,handleGroupToggle:O,handleChildToggle:M,handleLeafToggle:j,groupAllVisible:S,groupSomeVisible:T,onDragEnd:L};return p.jsxs(oe,{sx:{display:"flex",flexDirection:"column",height:"100%",background:P=>P.palette.primary.notifyBackground,border:P=>`0.1rem solid ${P.palette.primary.notifyBorderColor}`,overflow:"hidden",py:"1rem"},children:[p.jsx(oe,{sx:{flexShrink:0,padding:"0rem 1rem",pb:"0.5rem"},children:p.jsx(Ki,{type:"text",placeholder:n("SEARCH"),value:u,variant:"standard",size:"small",InputProps:{disableUnderline:!0},onChange:P=>f(P.target.value),sx:{background:P=>P.palette.primary.appBackground,borderRadius:"0.8rem",border:P=>`0.1rem solid ${P.palette.primary.notifyBorderColor}`,width:"100%","& .MuiInputBase-input":{padding:"0.5rem 0.8rem!important",height:"1.8rem"}}})}),p.jsx(oe,{sx:{flex:1,overflowY:"auto",scrollbarWidth:"thin"},children:(u?E:m).length===0?p.jsx(Ye,{justifyContent:"center",alignItems:"center",sx:{height:"3rem"},children:p.jsx(ft,{sx:{color:P=>P.palette.primary.notifyTextColor,fontSize:"1.1rem"},children:n("NO_OPTIONS")})}):u?p.jsx(oe,{children:E.map(P=>P.isGroup?p.jsxs(oe,{children:[p.jsx(js,{onClick:()=>P.children.length===1&&O(P),children:p.jsxs(Ye,{direction:"row",justifyContent:"space-between",alignItems:"center",width:"100%",gap:"0.5rem",children:[p.jsx(oe,{onClick:N=>{N.stopPropagation(),w(P.id)},sx:{cursor:"pointer",flexShrink:0,width:"2rem",height:"0.9rem",opacity:.6,display:"flex",alignItems:"center",justifyContent:"center"},children:p.jsx(Vt,{url:h.has(P.id)?Ge.ArrowSelectUp:Ge.ArrowRight})}),p.jsxs(Ye,{direction:"row",gap:"0.5rem",width:"100%",alignItems:"center",children:[p.jsx(gr,{sx:{p:0},checked:S(P),indeterminate:T(P),onClick:N=>{N.stopPropagation(),O(P)}}),p.jsx(oe,{sx:{flexShrink:0,width:"2rem",height:"0.9rem",opacity:.25,display:"flex",alignItems:"center",justifyContent:"center"}}),p.jsx(Is,{hidden:!S(P)&&!T(P),children:P.label})]})]})}),P.children.map(N=>p.jsx(js,{indent:!0,onClick:()=>M(N),children:p.jsxs(Ye,{direction:"row",gap:"1rem",width:"100%",children:[p.jsx(oe,{sx:{flexShrink:0,width:"1rem",height:"0.9rem"}}),p.jsx(gr,{sx:{p:0},checked:!v.has(N.id),onClick:$=>{$.stopPropagation(),M(N)}}),p.jsx(Is,{hidden:v.has(N.id),children:N.label})]})},N.id))]},P.id):p.jsx(js,{onClick:()=>j(P),children:p.jsxs(Ye,{direction:"row",justifyContent:"space-between",alignItems:"center",width:"100%",gap:"0.5rem",children:[p.jsx(oe,{sx:{flexShrink:0,width:"2rem",height:"0.9rem"}}),p.jsxs(Ye,{direction:"row",gap:"0.5rem",width:"100%",alignItems:"center",children:[p.jsx(gr,{sx:{p:0},checked:!v.has(P.id),onClick:N=>{N.stopPropagation(),j(P)}}),p.jsx(oe,{sx:{flexShrink:0,width:"2rem",height:"0.5rem",opacity:.25,display:"flex",alignItems:"center",justifyContent:"center"}}),p.jsx(Is,{hidden:v.has(P.id),children:P.label})]})]})},P.id))}):p.jsx(m6,{as:"div",axis:"y",values:m,onReorder:D,style:{padding:0,margin:0},children:m.map(P=>P.isGroup?p.jsx(H8,{item:P,...A},P.id):p.jsx(U8,{item:P,...A},P.id))})})]})};function q8({columns:e,data:t,maxHeight:n=400,freezeColId:r,features:o,rowHeight:s,colMgr:a,sidebarOpen:l,onColumnSave:c,onColumnReorder:d,onColumnResize:u,isManageable:f,...h}){const g=gt(),m=g.mode==="dark"?"dark":"light",y=g.palette.primary.notifyBackground,b=g.palette.primary.appBackground,v=g.palette.primary.notifyTextColor,k=g.palette.primary.notifyActiveText,w=g.palette.primary.notifyBorderColor,C=g.typography?.fontFamily??"Euclid Circular Regular, sans-serif",S={root:{borderRadius:f?"1.4rem 0 0 1.4rem":"1.4rem",border:`0.1rem solid ${w}`,borderRight:l?"none":`0.1rem solid ${w}`,background:y,fontFamily:C,fontSize:"1.1rem",overflow:"hidden"},headerRow:{background:y,color:k,fontWeight:600},groupRow:{background:y,color:k,borderColor:w,borderLeft:`0.1rem solid ${w}`,fontWeight:600,borderBottom:`0.1rem solid ${w}`},groupHeaderCell:{borderColor:w,borderLeft:`0.1rem solid ${w}`,borderRight:`0.1rem solid ${w}`},headerCell:{background:y,color:v,borderColor:w,borderRight:"none",padding:"0 12px",textAlign:"center",fontWeight:"bold",fontSize:"1.1rem",lineHeight:"1.5rem",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},row:{background:y,color:v,borderColor:w,fontSize:"1.1rem"},cell:{background:y,borderBottom:`0.1rem solid ${w}`,borderRight:"none",color:v,borderColor:w,padding:"0",textAlign:"center",fontSize:"1.1rem",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontVariantNumeric:"tabular-nums"},pinnedCell:{background:y,color:v,borderBottom:`0.1rem solid ${w}`,borderRight:"none",padding:"0"},pinnedHeaderCell:{background:y,color:v,borderColor:w,borderRight:"none",padding:"0"},rowSelected:{background:b}},T={sortAsc:p.jsx(Vt,{url:Ge.AscSort}),sortDesc:p.jsx(Vt,{url:Ge.DescSort}),sortNone:p.jsx(Vt,{url:Ge.Unsort})},O={columns:e,data:t,rowHeight:s,maxHeight:n,theme:m,features:o,styles:S,icons:T,slots:{loadingCell:p.jsx(tc,{type:"cell"}),toolbar:M=>{a.captureEngine(M)},rowSelectionIndicator:(M,j)=>p.jsx("div",{style:{position:"absolute",bottom:0,left:0,width:"100%",height:"0.08rem",background:"linear-gradient(to right, #F9B16E, #F68080)",pointerEvents:"none",zIndex:5}})},onColumnStateChange:M=>c?.(M),onColumnReorder:d,onColumnResize:u,...h};return p.jsx(LN,{...O})}function G8(e){const{t}=x.useContext(sn),n=FN(),{tableProps:r,toolbarProps:o}=e,{pagination:s={},data:a=[],childUniqueKey:l=""}=r??{},{gridPath:c="",baseUrl:d=""}=o??{},u=r?.columns?.definitions,[f,h]=x.useState(0),g=u?.definitions??[],m=u?.defaultUserSettings??[],y=x.useMemo(()=>g.filter(H=>H.isVisible!==!1),[u?.definitions]),{settings:b,hasNewColumns:v}=x.useMemo(()=>!c||!g.length?{settings:u?.settings??[],hasNewColumns:!1}:D8({definitions:g,defaultSetting:m,gridPath:c,childUniqueKey:l}),[c,l,f]),k=x.useRef(null),w=x.useRef(null),C=x.useRef(null),S=x.useRef(b),T=o?.defaultTools?.groupBy?.appliedValue;x.useEffect(()=>{if(!c||!Array.isArray(T))return;const H=JSON.stringify(T);H!==C.current&&(C.current=H,A8({groupBy:T,gridPath:c,baseUrl:d}))},[T,c,d]);const O=x.useRef(l);O.current!==l&&(O.current=l,S.current=b,w.current=null);const M=H=>{const z=[];return H.forEach(_=>{z.push(_),(Array.isArray(_.children)?_.children:l?_.children?.[l]??[]:[]).forEach(U=>z.push(U))}),z},j=x.useCallback(H=>{c&&(clearTimeout(k.current),k.current=setTimeout(()=>{const z=new Map(H.map(W=>[W.id,W])),_=new Map(M(S.current).map(W=>[W.key,W])),R=new Map(M(b).map(W=>[W.key,W])),U=g.map(W=>{const G=z.get(W.key),q=_.get(W.key)??R.get(W.key),X={key:W.key,sequenceId:q?.sequenceId??0,isHidden:G?G.hidden:q?.isHidden??!0,style:q?.style??W.style??{}};if(W.children?.length&&l){const ae=q?.children&&!Array.isArray(q.children)?q.children:{},le=W.children.map(F=>{const J=z.get(F.key),B=_.get(F.key)??R.get(F.key);return{key:F.key,sequenceId:B?.sequenceId??0,isHidden:J?J.hidden:B?.isHidden??!1,style:B?.style??F.style??{}}});X.children={...ae,[l]:le}}return X}),Y=JSON.stringify(U);if(w.current===null){w.current=Y,S.current=U,v&&(yc({settings:U,gridPath:c,baseUrl:d}),h(W=>W+1));return}Y!==w.current&&(w.current=Y,S.current=U,yc({settings:U,gridPath:c,baseUrl:d}),h(W=>W+1))},1500))},[c,d,v,g,b,l]),D=x.useCallback(H=>{if(!c)return;const z=new Map(H.map((Y,W)=>[Y,W])),_=new Map(M(S.current).map(Y=>[Y.key,Y])),R=g.map(Y=>{const W=_.get(Y.key),G={key:Y.key,sequenceId:z.get(Y.key)??W?.sequenceId??0,isHidden:W?.isHidden??!1,style:W?.style??Y.style??{}};return Y.children?.length&&l&&W?.children&&(G.children=W.children),G}),U=JSON.stringify(R);U!==w.current&&(w.current=U,S.current=R,yc({settings:R,gridPath:c,baseUrl:d}),h(Y=>Y+1))},[c,d,g,l]),L=x.useCallback((H,z)=>{c&&(clearTimeout(k.current),k.current=setTimeout(()=>{const _=`${z}px`,R=new Map(M(S.current).map(W=>[W.key,W])),U=g.map(W=>{const G=R.get(W.key),X=W.key===H?{width:_}:G?.style??W.style??{},ae={key:W.key,sequenceId:G?.sequenceId??0,isHidden:G?.isHidden??!1,style:X};if(W.children?.length&&l){const le=G?.children??{},J=(Array.isArray(le[l])?le[l]:[]).map(B=>B.key===H?{...B,style:{width:_}}:B);ae.children={...le,[l]:J}}return ae}),Y=JSON.stringify(U);Y!==w.current&&(w.current=Y,S.current=U,yc({settings:U,gridPath:c,baseUrl:d}),h(W=>W+1))},1500))},[c,d,g,l]),E=x.useMemo(()=>{if(!b.length)return y;const H=new Map(b.map(z=>[z.key,z.sequenceId??0]));return[...y].sort((z,_)=>(H.get(z.key)??0)-(H.get(_.key)??0))},[y,b]),A=x.useMemo(()=>u&&{...u,definitions:E,settings:b,childUniqueKey:l},[u,E,b,l]),P=x.useMemo(()=>L8(A),[A]),N=x.useRef(null),$={pageSize:s?.rowPerPage,gridData:a},V=x.useMemo(()=>{const H=o?.defaultTools?.groupBy;if(!H||!Object.prototype.hasOwnProperty.call(H,"appliedValue"))return o;const z={...H};return delete z.appliedValue,{...o,defaultTools:{...o.defaultTools,groupBy:z}}},[o]);return p.jsxs(Yt,{children:[o&&p.jsx(rp,{...V,...$}),a.length?p.jsxs(p.Fragment,{children:[p.jsxs(oe,{sx:{display:"flex",alignItems:"stretch"},children:[p.jsxs(oe,{ref:N,sx:{flex:1,minWidth:0,alignSelf:"flex-start",position:"relative"},children:[p.jsx(q8,{...r,columns:P,colMgr:n,sidebarOpen:!1,isManageable:r?.columns?.isManageable,onColumnSave:j,onColumnReorder:D,onColumnResize:L}),r?.columns?.isManageable&&n.isOpen&&p.jsx(oe,{sx:{position:"absolute",top:0,right:0,width:260,height:"100%",zIndex:10,display:"flex",flexDirection:"column",overflow:"hidden"},children:p.jsx(n.ColumnManagerPanel,{style:{width:"100%",height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},render:({engine:H,close:z})=>p.jsx(Y8,{engine:H,onClose:z})})})]}),r?.columns?.isManageable&&p.jsx(ss,{title:t("LABEL_MANAGE_COLUMN"),placement:"left",children:p.jsxs(oe,{onClick:n.toggle,sx:{width:"2rem",flexShrink:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",gap:"0.5rem",p:"0 1.3rem",borderRadius:(n.isOpen,"0 1.4rem 1.4rem 0"),border:H=>`0.1rem solid ${H.palette.primary.notifyBorderColor}`,borderLeft:"none",background:H=>H.palette.primary.notifyButtonBackground,transition:"background 0.15s","&:hover":{background:H=>H.palette.primary.appBackground}},children:[p.jsx(oe,{component:"img",src:Ge.Manage,sx:{width:"1.6rem",height:"2rem",transform:"rotate(90deg)"}}),p.jsx(ft,{sx:{fontSize:"1rem",letterSpacing:"0.08em",writingMode:"vertical-rl",textOrientation:"mixed",transform:"rotate(360deg)",userSelect:"none",color:H=>H.palette.primary.notifyTextColor},children:a?.length>1?t("LABEL_MANAGE_COLUMN"):t("LABEL_MANAGE_COLUMN")?.slice(0,7)})]})})]}),Object.keys(s).length>0&&p.jsx(bc,{pagination:s,gridPath:c,baseUrl:d,t})]}):p.jsx(Nr,{sx:{textAlign:"center"},children:t(yr.NRF)})]})}const O2=e=>{let{disabled:t=!1,minWidth:n=0,maxWidth:r,className:o="",id:s,resizeStart:a,resizeEnd:l,defaultWidth:c,rowSpan:d=1,colSpan:u=1}=e;const[f,h]=x.useState(!1),[g,m]=x.useState(0),[y,b]=x.useState(0),[v,k]=x.useState(0),[w,C]=x.useState(null),S=x.useRef(null),T=x.useCallback(E=>{if(!t&&(C(s),a&&a(),h(!0),m(E),b(0),S.current)){const A=S.current.previousSibling;A&&b(A.clientWidth)}},[t,s,a]),O=x.useCallback(()=>{t||(f&&l&&w===s&&l(v),h(!1),C(null))},[t,l,w,s,v,f]),M=x.useCallback(E=>{if(t)return;const A=E instanceof TouchEvent?E.touches[0].screenX:E.screenX;if(!f)return;const P=S.current;if(!P||!P.previousSibling)return;const N=P.previousSibling,$=g-A;let V=y-$;n!==void 0&&V<n&&(V=n),r!==void 0&&V>r&&(V=r),N.style.width=V+"px",N.style.minWidth=V+"px",N.style.maxWidth=V+"px",N.style.setProperty("--column_resize_before_width",V+"px"),k(V)},[t,f,g,y,n,r]);x.useEffect(()=>{const E=S.current;if(E&&E.previousSibling){const A=E.previousSibling;c?(A.style.minWidth=c+"px",A.style.width=c+"px",A.style.maxWidth=c+"px",A.style.setProperty("--column_resize_before_width",c+"px")):n&&(A.style.minWidth=n+"px",A.style.width=n+"px",A.style.maxWidth=n+"px",A.style.setProperty("--column_resize_before_width",n+"px"))}},[c,n]),x.useEffect(()=>{const E=S.current;if(t&&E&&E.previousSibling){const A=E.previousSibling;c&&(A.style.minWidth=c+"px",A.style.width=c+"px",A.style.maxWidth=c+"px",A.style.setProperty("--column_resize_before_width",c+"px")),r&&(A.style.maxWidth=r+"px")}},[t,c,r]);const j=x.useCallback(()=>{document.addEventListener("mousemove",M),document.addEventListener("mouseup",O),document.addEventListener("touchmove",M),document.addEventListener("touchend",O)},[M,O]),D=x.useCallback(()=>{document.removeEventListener("mousemove",M),document.removeEventListener("mouseup",O),document.removeEventListener("touchmove",M),document.removeEventListener("touchend",O)},[M,O]);x.useEffect(()=>(t||j(),()=>{D()}),[t,j,D]);const L={userSelect:"none"};return t||(L.cursor="ew-resize"),o===""&&(L.width="6px",L.backgroundColor="rgba(0, 0, 0, 0.1)"),x.createElement("th",{ref:S,style:L,rowSpan:d,colSpan:u,className:"column_resizer_own_class ".concat(t?"disabled_column_resize":""," ").concat(o),onMouseDown:t?void 0:E=>T(E.screenX),onTouchStart:t?void 0:E=>T(E.touches[0].screenX)})};function xc({isRenderCellContent:e,column:t,row:n,parent:r}){const o=n[t.key],s=o?.length>20;return p.jsx(p.Fragment,{children:e?p.jsx(oe,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",textTransform:"none",fontSize:"1.1rem"},children:t?.cellRenderer(n,{column:t,parent:r})}):p.jsx(p.Fragment,{children:s?p.jsx(ss,{title:o,placement:"top",componentsProps:{tooltip:{sx:{fontSize:"1rem",padding:"0.5rem 1rem",boxShadow:"0 2px 8px rgba(0,0,0,0.3)"}}},children:p.jsx(oe,{sx:{maxWidth:"auto",whiteSpace:"normal"},children:p.jsx(ft,{sx:{fontSize:"1.1rem",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",textTransform:"none"},children:o})})}):p.jsx(oe,{sx:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",textTransform:"none",fontSize:"1.1rem",m:0},id:t.key,component:"p",children:o??""})})})}xc.propTypes={isRenderCellContent:i.bool,column:i.object,row:i.object};const K8=ee(is)(({theme:e})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"table-cell",[`&.${Qd.head}`]:{color:e.palette.primary.notifyTextColor,backgroundColor:e.palette.primary.notifyBackground,borderColor:e.palette.primary.notifyBorderColor,padding:"0rem",textAlign:"center",lineHeight:"1.5rem"},[`&.${Qd.body}`]:{color:e.palette.primary.notifyTextColor,borderColor:e.palette.primary.notifyBorderColor,padding:"0rem",textAlign:"center"}}));function Mo({children:e,...t}){return p.jsx(K8,{...t,children:e})}Mo.propTypes={children:i.node};const X8=ee(n0)(()=>({"&:last-child td":{borderBottom:"none"}}));function eo({children:e,...t}){return p.jsx(X8,{...t,children:e})}eo.propTypes={children:i.node};const M2=x.memo(({row:e,isSelected:t,isHigh:n,onRowClick:r,children:o,sxProps:s})=>p.jsx(eo,{sx:a=>({backgroundColor:t||n?a.palette.primary.appBackground:a.palette.primary.notifyBackground,...s}),onClick:()=>r?.(e),children:o},e?.fhi)),P2=x.memo(({nestedData:e,nestedColumn:t,t:n})=>e?.length?p.jsx(p.Fragment,{children:e.map((r,o)=>p.jsx(eo,{children:t.map((s,a)=>p.jsx(Mo,{style:s?.style,children:p.jsx(xc,{isRenderCellContent:!!s?.cellRenderer,column:s,row:r})},a))},`nested-${o}`))}):p.jsx(eo,{children:p.jsx(Mo,{colSpan:t.length,children:p.jsx(Nr,{sx:{textAlign:"center"},children:n(yr.NRF)})})})),j2=(e,t,n,r,o,s)=>{const[a,l]=x.useState({isOpen:!1,column:null}),c=(h,g,m)=>{l({isOpen:h.currentTarget,column:g,isChild:!!m})},d=()=>{l({isOpen:!1,column:null,isChild:!1})},u=async()=>{d();const h=e.map(g=>{if(a?.isChild&&Array.isArray(g.children)){const m=g.children.map(b=>b.key===a.column?.key?{...b,isHidden:!0}:b),y=m.every(b=>b.isHidden);return{...g,isHidden:y?!0:g.isHidden,children:m}}return g.key===a.column?.key?{...g,isHidden:!0}:g});f({updatedColumns:h})},f=async({updatedColumns:h})=>{t({type:Fe.SET_GRID_DATA,payload:{visibleGridColumns:h}});const g=r.split("/").filter(Boolean),m=JSON.parse(localStorage.getItem(gn.SETTINGS));let y=g.reduce((T,O)=>T?.[O],m)||null,b=ua({columns:h,childUniqueKey:s});const v=Rr(y?.columns);b=b?.map(T=>{const O=T?.children||{},M=v?.[T?.key]?.children||{};return{...T,...(Object.keys(M)?.length>0||O?.[s])&&{children:{...M,[s]:O?.[s]}}}});const w={...m||{platform:{theme:"light"}}},C=y?.pageSize??o;let S=w;for(let T=0;T<g.length;T++){const O=g[T];T===g.length-1?S[O]={columns:b,pageSize:C}:(S[O]={...S[O]||{}},S=S[O])}localStorage.setItem(gn.SETTINGS,JSON.stringify(w)),await Ps({baseUrl:n,payload:w})};return{selectedColumn:a,handleMenuClick:c,handleClose:d,handleHideClick:u,columnUpdaterFunction:f}},sp=({menuOpen:e,handleClose:t,onHideClick:n})=>{const r=gt(),{t:o}=x.useContext(sn);return p.jsx(Ei,{open:!!e,anchorEl:e,onClose:t,anchorOrigin:{vertical:"bottom",horizontal:"left"},children:p.jsx(oe,{sx:{backgroundColor:r.palette.primary.notifyBackground,border:`0.1rem solid ${r.palette.primary.notifyBorderColor}`,minHeight:"2.3rem",display:"flex",justifyContent:"center",alignItems:"center"},children:p.jsx(xl,{onClick:n,disableRipple:!0,sx:{textTransform:"none",fontSize:"1.1rem",p:"0.4rem 1rem",minHeight:"unset",fontWeight:500,color:r.palette.primary.notifyTextColor,backgroundColor:"transparent","&:hover":{backgroundColor:"transparent"},"&:active":{backgroundColor:"transparent"},"&:focus":{backgroundColor:"transparent"}},children:o("LABEL_HIDE_COLUMN")})})})};sp.propTypes={menuOpen:i.object,handleClose:i.func,onHideClick:i.func};const I2=({sortKey:e,sortField:t,sortDir:n,handleSortClick:r})=>{const o=s=>p.jsx(sl,{onClick:r,sx:{padding:"0.2rem"},draggable:!1,children:p.jsx(Vt,{url:s})});return p.jsx(p.Fragment,{children:o(t===e?n==="asc"?Ge.AscSort:Ge.DescSort:Ge.Unsort)})};I2.propTypes={sortKey:i.string.isRequired,sortField:i.string,sortDir:i.string,handleSortClick:i.func};function ip({parent:e,column:t,sort:n,handleMenuClick:r,isManageable:o}){const s=o&&(!t?.isMandatory||t?.isMandatory&&t?.showHide===!0),a=t?.label,l=t?.helpText,c=t?.isSortable,d=n?.sortField,u=n?.sortDir,f=n?.onSort;return p.jsxs(oe,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},draggable:!1,children:[p.jsx(oe,{sx:{fontWeight:"bold",fontSize:"1.1rem",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",padding:"0.5rem",textAlign:"center"},children:p.jsx(ss,{title:l??a,placement:"top",componentsProps:{tooltip:{sx:{fontSize:"1rem",padding:"0.6rem 1rem",boxShadow:"0 2px 8px rgba(0,0,0,0.3)"}}},children:a??""})}),p.jsxs(oe,{sx:{display:"flex",alignItems:"center"},draggable:!1,children:[c&&p.jsx(I2,{sortKey:e?`${e?.key}|${t?.key}`:t?.key,sortField:d,sortDir:u,handleSortClick:()=>f({column:t,sortDir:u,sortField:d,parent:e})}),s&&p.jsx(sl,{draggable:!1,onClick:h=>r(h,t,e),sx:{padding:"0.2rem"},children:p.jsx(Vt,{url:Ge.Menu})})]})]})}ip.propTypes={column:i.object.isRequired,sort:i.object.isRequired,handleMenuClick:i.func,isManageable:i.bool};function D2({rows:e,sort:t,data:n,pagination:r,columns:o,nested:s,baseUrl:a,gridPath:l,childUniqueKey:c,isVirtualizedTable:d=!1,t:u}){const f=gt(),{visibleGridColumns:h}=x.useContext(Xi),g=x.useContext(bs),{selectedColumn:m,handleMenuClick:y,handleClose:b,handleHideClick:v,columnUpdaterFunction:k}=j2(h,g,a,l,r?.rowPerPage,c),w=o?.isManageable,C=o?.isResizable,S=n?.length>0,T=x.useRef(null),O=x.useRef(null),M=45,j=10,D=n?.length,[L,E]=x.useState({start:0,end:10}),[A,P]=x.useState(null),[N,$]=x.useState(null),[V,H]=x.useState(null);let z=null;const _=x.useRef(0),R=x.useRef(!1),U=x.useRef(null),Y=S2(s?.column?.definitions||[]),W=s?.isNested,G=s?.data||[],q=s?.hashKey,[X,ae]=x.useState(0);x.useEffect(()=>{if(T.current){const ne=()=>{ae(T.current.offsetHeight)};return ne(),window.addEventListener("resize",ne),()=>window.removeEventListener("resize",ne)}},[n]),x.useEffect(()=>{const ie=T.current?.querySelector("thead");if(!ie)return;const Ee=()=>{H(null)};return ie?.addEventListener("mousedown",Ee),()=>{ie?.removeEventListener("mousedown",Ee)}},[]);const le=(ne,ie)=>{if(R.current){ne.preventDefault();return}P(ie),H(null),ne.dataTransfer.setData("colIndex",ie);const Ee=h[ie],pe=Ee?.label,me=document.createElement("div");me.textContent=pe,Object.assign(me.style,{display:"flex",alignItems:"center",justifyContent:"center",padding:"1.5rem 2.5rem",minWidth:Ee?.style?.minWidth,maxWidth:Ee?.style?.maxWidth,fontSize:"1.2rem",fontWeight:"500",color:f.palette.primary.notifyTextColor,background:f.palette.primary.notifyBackground,border:`0.1rem solid ${f.palette.primary.notifyBorderColor}`,borderRadius:"0rem",pointerEvents:"none",position:"absolute",top:"0",left:"0",zIndex:"-1",textAlign:"center",boxSizing:"border-box",boxShadow:"0 1px 4px rgba(0, 0, 0, 0.2)"}),document.body.appendChild(me);const{offsetWidth:je,offsetHeight:qe}=me;ne.dataTransfer.setDragImage(me,je/2,qe/2),requestAnimationFrame(()=>{document.body.removeChild(me)})},F=(ne,ie)=>{ne.preventDefault(),$(ie),ye(ne)},J=async(ne,ie)=>{if(ne.preventDefault(),clearInterval(z),A===null||A===ie)return;const Ee=[...h],[pe]=Ee.splice(A,1);Ee.splice(ie,0,pe);const me=h[A].sequenceId,je=h[ie].sequenceId,qe=Ee.map(Ze=>Ze.key===h[A].key?{...Ze,sequenceId:je}:Ze.key===h[ie].key?{...Ze,sequenceId:me}:Ze);k({updatedColumns:qe}),P(null),$(null)},B=()=>{P(null),$(null)},fe=(ne,ie,Ee,pe)=>{if(!ne)return null;const me=ne?.isMandatory&&ne?.isSticky,je=parseFloat(ne?.style?.minWidth?.toString().replace("rem",""))||7.5;ie===0&&(_.current=0);const qe=me?ie===0?0:`${_.current}rem`:void 0;me&&(_.current+=je);const Ze=A===ie,Me=N==ie||h?.[N]?.isMandatory,Ct=nt=>{ne.isMandatory?(nt.preventDefault(),nt.dataTransfer.dropEffect="none"):(nt.preventDefault(),nt.dataTransfer.dropEffect="move"),F?.(nt,ie)},Je=nt=>{ne.isMandatory||J?.(nt,ie)};return pe&&`${pe?.key}${ne?.key}${ie}`,p.jsx(Mo,{rowSpan:ne?.children?1:2,colSpan:ne?.children?.filter(nt=>!nt?.isHidden)?.length,style:ne?.style,draggable:Ee&&!ne?.isMandatory,onDragStart:Ee&&!ne?.isMandatory?nt=>le(nt,ie):nt=>{nt.preventDefault()},onDragOver:Ee&&!ne?.isMandatory?Ct:void 0,onDrop:Ee&&!ne?.isMandatory?Je:void 0,onDragEnd:Ee&&!ne?.isMandatory?B:void 0,sx:{...ne?.isSticky&&{boxShadow:"rgba(17, 17, 26, 0.3) 4px 0px 6px -2px"},...ne.isCenterTable&&{borderRight:"0.1rem solid",borderBottom:"0.1rem solid",borderTop:"none",...ne?.key==="volume_value"&&{borderLeft:"1px solid"}},...Ze&&{border:`0.1rem solid ${f.palette.brandColor.lightBlue}!important`},...me&&{position:"sticky",left:qe,zIndex:3},cursor:Me?"not-allowed":Ee&&!ne?.isMandatory?"grab":"default"},children:p.jsx(ip,{parent:pe,column:ne,sort:t,handleMenuClick:y,isManageable:Ee})},ie)},se=x.useCallback((ne,ie,Ee,pe)=>{if(!ne)return null;const me=ne?.isMandatory&&ne?.isSticky,je=parseFloat(ne?.style?.minWidth?.toString().replace("rem",""))||7.5;Ee===0&&(_.current=0);const qe=me?Ee===0?0:`${_.current}rem`:void 0;return me&&(_.current+=je),p.jsxs(Mo,{colSpan:1,style:ne?.style,className:`${ne?.label}`,sx:{position:"relative",...ne.isCenterTable&&{borderRight:"0.1rem solid",borderBottom:"0.1rem solid",borderTop:"none",...ne?.key==="volume_value"&&{borderLeft:"1px solid"}},...ne?.isSticky&&{boxShadow:"rgba(17, 17, 26, 0.3) 4px 0px 6px -2px"},...me&&{position:"sticky",left:qe,zIndex:2,backgroundColor:Ze=>e?.selectedRow&&e?.selectedRow?.fhi===ie?.fhi||ie?.isHigh?Ze.palette.primary.appBackground:Ze.palette.primary.notifyBackground}},children:[(e?.selectedRow&&e?.selectedRow?.fhi===ie?.fhi||ie?.isHigh)&&p.jsx(oe,{sx:{position:"absolute",bottom:0,left:0,width:"100%",height:"0.08rem",background:"linear-gradient(#F9B16E, #F68080)",pointerEvents:"none",zIndex:1}}),p.jsx(xc,{isRenderCellContent:!!ne?.cellRenderer,column:ne,row:ie,parent:pe})]},Ee)},[e?.selectedRow,f]),te=(ne,ie,Ee,pe)=>p.jsx(p.Fragment,{children:ne&&Ee&&!ne?.isMandatory?p.jsx(oe,{resizeStart:()=>{ne?.isMandatory&&!ne?.isResizable||(R.current=!0)},resizeEnd:me=>{ne?.isMandatory&&!ne?.isResizable||me<=20||(R.current=!1,k2({index:ie,visibleGridColumns:h,width:me,columnUpdaterFunction:k}))},component:ne?.children||ne?.isMandatory?is:O2,rowSpan:ne?.children?1:2,colSpan:1,id:ie,sx:{width:"1rem",maxWidth:"1rem",minWidth:"1rem",padding:0,position:"relative",borderBottom:`0.1rem solid ${f.palette.primary.notifyBorderColor}`,cursor:"col-resize","&::after":{content:'""',position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"0.15rem",height:"1.5rem",backgroundColor:f.palette.primary.notifyBorderColor,zIndex:1},...!ne?.isMandatory&&{"&:hover::after":{content:'""',position:"absolute",top:0,left:"50%",transform:"translateX(-50%)",width:"0.2rem",height:`${X}px`,backgroundColor:f.palette.primary.notifyBorderColor,zIndex:1}}}}):null}),Ce=x.useCallback((ne,ie,Ee,pe,me,je,qe)=>p.jsx(p.Fragment,{children:ie&&pe&&!ie?.isMandatory?p.jsx(is,{className:"column_resizer_body",sx:{width:"1rem",maxWidth:"1rem",minWidth:"1rem",padding:0,position:"relative",borderBottom:`0.1rem solid ${f.palette.primary.notifyBorderColor}`},children:(e?.selectedRow&&e?.selectedRow?.fhi===ne?.fhi||ne?.isHigh)&&p.jsx(oe,{sx:{position:"absolute",bottom:0,left:0,width:"100%",height:"0.08rem",background:"linear-gradient(#F9B16E, #F68080)",pointerEvents:"none"}})},`resize-${Ee}_${qe}`):null}),[e?.selectedRow,f]),ye=ne=>{const ie=T.current,{left:Ee,right:pe}=ie.getBoundingClientRect(),me=50,je=ne.clientX>pe-me?1:ne.clientX<Ee+me?-1:0;je!==0?(U.current&&clearInterval(U.current),U.current=setInterval(()=>{ie.scrollLeft+=je*10},50)):U.current&&(clearInterval(U.current),U.current=null)},ke=ne=>ne?.map((ie,Ee)=>{const pe=L.start+Ee,me=ie[q],je=G?.[me],qe=e?.selectedRow&&e?.selectedRow?.fhi===ie?.fhi,Ze=ie?.isHigh;return p.jsxs(x.Fragment,{children:[p.jsx(M2,{row:ie,isSelected:qe,isHigh:Ze,onRowClick:e?.onRowClick,children:h.map((Me,Ct)=>Me?.isHidden||Me?.isVisible===!1?null:Me?.children?Me.children.map((Je,nt)=>Je?.isHidden?null:p.jsxs(x.Fragment,{children:[se(Je,ie,nt,Me),C&&Ce(ie,Je,nt,w,Me,"",pe)]},`col-${Ct}-${nt}`)):p.jsxs(x.Fragment,{children:[se(Me,ie,Ct),C&&Ce(ie,Me,Ct,w,"","",pe)]},`col-${Ct}`))}),W&&je&&p.jsx(P2,{nestedData:je,nestedColumn:Y,t:u})]},`row-${pe}`)}),ve=()=>{const ne=O.current;if(!ne)return;const ie=ne.scrollTop,Ee=ne.clientHeight,pe=Math.floor(ie/M)-j,me=Math.ceil(Ee/M)+2*j,je=Math.max(0,Math.min(D-1,pe)),qe=Math.max(je,Math.min(D,je+me));E(Ze=>Ze.start===je&&Ze.end===qe?Ze:{start:je,end:qe})};x.useEffect(()=>{let ne;const ie=()=>{ne&&cancelAnimationFrame(ne),ne=requestAnimationFrame(()=>{ve()})},Ee=O.current;if(!(!Ee||!d))return ve(),Ee.addEventListener("scroll",ie),()=>{cancelAnimationFrame(ne),Ee.removeEventListener("scroll",ie)}},[D]);const We=L.start*M,Oe=(D-L.end)*M,he=d?n?.slice(L.start,L.end):n;return S?p.jsxs(p.Fragment,{children:[p.jsx(eu,{ref:O,sx:{willChange:"transform",WebkitTransform:"translateZ(0)",maxHeight:"40rem",whiteSpace:"nowrap",overflow:"auto",width:"100%",border:`0.1rem solid ${f.palette.primary.notifyBorderColor}`,borderRadius:"1.4rem",position:"relative"},children:p.jsxs(Zd,{ref:T,stickyHeader:!0,"aria-label":"sticky table",sx:{backgroundColor:ne=>ne.palette.primary.notifyBackground},children:[p.jsxs(tu,{children:[p.jsx(eo,{sx:{position:"sticky",top:0,zIndex:3,backgroundColor:ne=>ne.palette.primary.notifyBackground},children:h.map((ne,ie)=>ne?.isHidden||ne?.isVisible===!1?null:p.jsxs(x.Fragment,{children:[fe(ne,ie,w),te(ne,ie,w)]},ie))}),p.jsx(eo,{draggable:!1,sx:{position:"sticky",top:"2.5rem",backgroundColor:f.palette.primary.notifyBackground,zIndex:2},children:h.flatMap((ne,ie)=>ne?.isHidden||!ne?.children||ne?.isVisible===!1?[]:ne.children.map((Ee,pe)=>Ee?.isHidden?null:p.jsxs(x.Fragment,{children:[fe(Ee,pe,w,ne),C&&te(Ee,pe,w)]},`${ie}-${pe}`)))})]}),p.jsxs(Jd,{children:[d&&p.jsx("tr",{style:{height:We}}),ke(he),d&&p.jsx("tr",{style:{height:Oe}})]})]})}),r&&p.jsx(bc,{pagination:r,gridPath:l,baseUrl:a,t:u}),p.jsx(sp,{menuOpen:m?.isOpen,handleClose:b,onHideClick:v})]}):p.jsx(Nr,{sx:{textAlign:"center"},children:u(yr.NRF)})}D2.propTypes={sort:i.object,data:i.array,pagination:i.object,columns:i.object,nested:i.object};function A2(e){return yv(e?.style?.width??e?.style?.minWidth??e?.style?.maxWidth)||0}const R2=e=>e?.isHidden||e?.isVisible===!1;function Z8(e){const t=x.useMemo(()=>{let o=0;return e.flatMap((s,a)=>{if(R2(s))return[];if(Array.isArray(s.children)&&s.children.length){const d=s.children.filter(u=>!R2(u));return d.length?d.map(u=>{const f=A2(u),h={...u,_parent:s,_originalIndex:a,width:f,start:o,end:o+f,isSticky:!!(u?.isSticky??s?.isSticky)};return o+=f,h}):[]}const l=A2(s);if(l===0)return[];const c={...s,_parent:null,_originalIndex:a,width:l,start:o,end:o+l,isSticky:!!s?.isSticky};return o+=l,c})},[e]),n=x.useMemo(()=>{let o=0;const s={};return t.forEach(a=>{a.isSticky&&(s[a.sequenceId]=o,o+=a.width)}),s},[t]);return{columnsMeta:t,stickyOffsets:n,getStickyLeft:o=>{if(!o?.isMandatory||!o?.isSticky)return;const s=n[o.sequenceId];return s===0?0:`${s}px`}}}function J8({visibleGridColumns:e,columnUpdaterFunction:t,isResizingRef:n,startAutoScroll:r,stopAutoScroll:o}){const s=gt(),[a,l]=x.useState(null),[c,d]=x.useState(null),u=x.useCallback((b,v)=>{if(n.current){b.preventDefault();return}l(v),b.dataTransfer.setData("colIndex",v);const k=e[v],w=document.createElement("div");w.textContent=k?.label,Object.assign(w.style,{display:"flex",alignItems:"center",justifyContent:"center",padding:"1.5rem 2.5rem",minWidth:k?.style?.minWidth,maxWidth:k?.style?.maxWidth,fontSize:"1.2rem",fontWeight:"500",color:s.palette.primary.notifyTextColor,background:s.palette.primary.notifyBackground,border:`0.1rem solid ${s.palette.primary.notifyBorderColor}`,borderRadius:"0rem",pointerEvents:"none",position:"absolute",top:"0",left:"0",zIndex:"-1",textAlign:"center",boxSizing:"border-box",boxShadow:"0 1px 4px rgba(0, 0, 0, 0.2)"}),document.body.appendChild(w);const{offsetWidth:C,offsetHeight:S}=w;b.dataTransfer.setDragImage(w,C/2,S/2),requestAnimationFrame(()=>document.body.removeChild(w))},[n,e,s]),f=x.useCallback((b,v)=>{if(b.preventDefault(),e?.[v]?.isMandatory){b.dataTransfer.dropEffect="none";return}b.dataTransfer.dropEffect="move",d(v),r(b.clientX)},[r,e]),h=x.useCallback(async(b,v)=>{if(b.preventDefault(),o(),a===null||a===v||e?.[v]?.isMandatory)return;const k=[...e],[w]=k.splice(a,1);k.splice(v,0,w);const C=[...e].sort((T,O)=>T.sequenceId-O.sequenceId).map(T=>T.sequenceId),S=k.map((T,O)=>({...T,sequenceId:C[O]??T.sequenceId}));t({updatedColumns:S}),l(null),d(null)},[a,e,t,o]),g=x.useCallback(()=>{o(),l(null),d(null)},[o]),m=b=>!b?.isMandatory,y=x.useCallback(b=>c===null||a===null?!1:!!(e?.[b]?.isMandatory||e?.[c]?.isMandatory),[c,a,e]);return{draggedColIndex:a,dragOverIndex:c,handleDragStart:u,handleDragOver:f,handleDrop:h,handleDragEnd:g,isDraggable:m,isInvalidDrop:y}}const N2=50,Q8=10,eL=50;function tL(e){const t=x.useRef(null),n=x.useCallback(()=>{t.current&&(clearInterval(t.current),t.current=null)},[]);return{startAutoScroll:x.useCallback(o=>{const s=e.current;if(!s)return;const{left:a,right:l}=s.getBoundingClientRect(),c=o>l-N2?1:o<a+N2?-1:0;if(c===0){n();return}t.current||(t.current=setInterval(()=>{s.scrollLeft+=c*Q8},eL))},[e,n]),stopAutoScroll:n}}const ap=x.memo(function({column:t,index:n,isManageable:r,parent:o,stickyLeft:s,colSpanOverride:a,draggedColIndex:l,isInvalidDrop:c,onDragStart:d,onDragOver:u,onDrop:f,onDragEnd:h,sort:g,handleMenuClick:m}){const y=gt(),b=l===n,v=r&&!t?.isMandatory,k=t?.isMandatory&&t?.isSticky,w=o&&o.children?.find(T=>!T?.isHidden&&T?.isVisible!==!1)?.key===t?.key,C=!o&&Array.isArray(t?.children)&&t.children.some(T=>!T?.isHidden&&T?.isVisible!==!1),S=a??t.children?.filter(T=>!T?.isHidden)?.length;return p.jsx(Mo,{rowSpan:t?.children?1:2,colSpan:S,style:t?.style,draggable:v,onDragStart:v?T=>d(T,n):T=>T.preventDefault(),onDragOver:v?T=>u(T,n):void 0,onDrop:v?T=>f(T,n):void 0,onDragEnd:v?h:void 0,sx:{...t?.isSticky&&{boxShadow:"rgba(17, 17, 26, 0.3) 4px 0px 6px -2px"},...t.isCenterTable&&{borderRight:"0.1rem solid",borderBottom:"0.1rem solid",borderTop:"none",...(w||C)&&{borderLeft:"0.1rem solid"}},...b&&{border:`0.1rem solid ${y.palette.brandColor.lightBlue}!important`},...k&&{position:"sticky",left:s,zIndex:3},cursor:c(n)?"not-allowed":v?"grab":"default"},children:p.jsx(ip,{parent:o,column:t,sort:g,handleMenuClick:m,isManageable:r})},n)}),lp=x.memo(function({column:t,index:n,isManageable:r,tableHeight:o,onResizeStart:s,onResizeEnd:a}){const l=gt();return!t||!r||t?.isMandatory?null:p.jsx(oe,{component:t?.children||t?.isMandatory?is:O2,rowSpan:t?.children?1:2,colSpan:1,id:n,resizeStart:s,resizeEnd:a,sx:{width:"1rem",maxWidth:"1rem",minWidth:"1rem",padding:0,position:"relative",borderBottom:`0.1rem solid ${l.palette.primary.notifyBorderColor}`,cursor:"col-resize","&::after":{content:'""',position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"0.15rem",height:"1.5rem",backgroundColor:l.palette.primary.notifyBorderColor,zIndex:1},"&:hover::after":{content:'""',position:"absolute",top:0,left:"50%",transform:"translateX(-50%)",width:"0.2rem",height:`${o}px`,backgroundColor:l.palette.primary.notifyBorderColor,zIndex:1}}})}),nL=x.memo(function({stickyGridColumns:t,virtualisedColumns:n,isManageable:r,isResizable:o,tableHeight:s,sort:a,handleMenuClick:l,getStickyLeft:c,offsetX:d,draggedColIndex:u,isInvalidDrop:f,onDragStart:h,onDragOver:g,onDrop:m,onDragEnd:y,isResizingRef:b,columnUpdaterFunction:v,visibleGridColumns:k}){const w=gt(),C={draggedColIndex:u,isInvalidDrop:f,onDragStart:h,onDragOver:g,onDrop:m,onDragEnd:y},S=(O,M)=>({onResizeStart:()=>{O?.isMandatory&&!O?.isResizable||(b.current=!0)},onResizeEnd:j=>{O?.isMandatory&&!O?.isResizable||j<=20||(b.current=!1,k2({index:M,visibleGridColumns:k,width:j,columnUpdaterFunction:v}))}}),T=x.useMemo(()=>{const O=[];return n.forEach(M=>{const j=M._parent?.key??M.key,D=O[O.length-1];D&&D.key===j?D.colSpan+=1:O.push({key:j,column:M._parent??M,colSpan:1,firstChild:M})}),O},[n]);return p.jsxs(tu,{children:[p.jsxs(eo,{sx:{position:"sticky",top:0,zIndex:3,backgroundColor:w.palette.primary.notifyBackground},children:[t.map((O,M)=>{const j=O._parent??O;return p.jsxs(x.Fragment,{children:[p.jsx(ap,{column:j,index:O._originalIndex,isManageable:r,stickyLeft:c(O),sort:a,handleMenuClick:l,...C}),o&&p.jsx(lp,{column:j,index:O._originalIndex,isManageable:r,tableHeight:s,...S(j,O._originalIndex)})]},`sticky-p-${M}`)}),p.jsx("th",{style:{minWidth:d,width:d,padding:0,border:"none"}}),T.map((O,M)=>p.jsxs(x.Fragment,{children:[p.jsx(ap,{column:O.column,index:O.firstChild._originalIndex,colSpanOverride:O.colSpan,isManageable:r,stickyLeft:c(O.firstChild),sort:a,handleMenuClick:l,...C}),o&&p.jsx(lp,{column:O.column,index:O.firstChild._originalIndex,isManageable:r,tableHeight:s,...S(O.column,O.firstChild._originalIndex)})]},`parent-${O.key}`))]}),p.jsxs(eo,{draggable:!1,sx:{position:"sticky",top:"2.5rem",backgroundColor:w.palette.primary.notifyBackground,zIndex:2},children:[p.jsx("th",{style:{minWidth:d,width:d,padding:0,border:"none"}}),n?.map((O,M)=>O._parent&&p.jsxs(x.Fragment,{children:[p.jsx(ap,{column:O,index:O._originalIndex,isManageable:r,parent:O._parent,stickyLeft:c(O),sort:a,handleMenuClick:l,...C}),o&&p.jsx(lp,{column:O,index:O._originalIndex,isManageable:r,tableHeight:s,...S(O,O._originalIndex)})]},`child-${O?._parent?.key??O.key}-${M}`))]})]})}),rL=()=>p.jsx(oe,{sx:{position:"absolute",bottom:0,left:0,width:"100%",height:"0.08rem",background:"linear-gradient(#F9B16E, #F68080)",pointerEvents:"none",zIndex:1}}),$2=x.memo(function({column:t,row:n,cellKey:r,parent:o,stickyLeft:s,isSelected:a,isHigh:l}){const c=gt(),d=t?.isMandatory&&t?.isSticky,u=a||l,f=o&&o.children?.find(h=>!h?.isHidden&&h?.isVisible!==!1)?.key===t?.key;return p.jsxs(Mo,{colSpan:1,style:t?.style,className:`${t?.label}`,sx:{position:"relative",...t.isCenterTable&&{borderRight:"0.1rem solid",borderBottom:"0.1rem solid",borderTop:"none",...f&&{borderLeft:"0.1rem solid"}},...t?.isSticky&&{boxShadow:"rgba(17, 17, 26, 0.3) 4px 0px 6px -2px"},...d&&{position:"sticky",left:s,zIndex:2,backgroundColor:u?c.palette.primary.appBackground:c.palette.primary.notifyBackground}},children:[u&&p.jsx(rL,{}),p.jsx(xc,{isRenderCellContent:!!t?.cellRenderer,column:t,row:n,parent:o})]},r)});function oL({actualIndex:e,extraHeight:t,measureRow:n,resetRow:r}){return useEffect(()=>(n(e,t),()=>r(e)),[e,t]),null}const sL=x.memo(function({visibleRows:t,stickyGridColumns:n,virtualisedColumns:r,isResizable:o,isManageable:s,topSpacerHeight:a,bottomSpacerHeight:l,selectedRow:c,isNested:d,nestedRow:u,nestedColumn:f,hashKey:h,getStickyLeft:g,offsetX:m,rightSpacerWidth:y,rowStart:b,defaultRowHeight:v,measureRow:k,resetRow:w,t:C}){const S=gt(),T=x.useCallback((O,M,j)=>{if(!O||!s||O?.isMandatory)return null;const D=c&&c?.fhi===M?.fhi||M?.isHigh;return p.jsx(is,{className:"column_resizer_body",sx:{width:"1rem",maxWidth:"1rem",minWidth:"1rem",padding:0,position:"relative",borderBottom:`0.1rem solid ${S.palette.primary.notifyBorderColor}`},children:D&&p.jsx("div",{style:{position:"absolute",bottom:0,left:0,width:"100%",height:"0.08rem",background:"linear-gradient(#F9B16E, #F68080)",pointerEvents:"none"}})},`resize-${j}`)},[s,c,S]);return p.jsxs(Jd,{children:[p.jsx("tr",{style:{height:a}}),t?.map((O,M)=>{const j=b+M,D=c&&c?.fhi===O?.fhi,L=O?.isHigh,E=u?.[O[h]];return p.jsxs(x.Fragment,{children:[p.jsxs(M2,{row:O,isSelected:D,isHigh:L,sxProps:{height:"3.5rem","& td, & th":{height:"3.5rem"}},children:[n.map((A,P)=>p.jsxs(x.Fragment,{children:[p.jsx($2,{column:A,row:O,cellKey:P,parent:A._parent,stickyLeft:g(A),isSelected:D,isHigh:L}),o&&T(A,O,`sticky-${P}-${j}`)]},`sticky-${A.sequenceId??P}`)),p.jsx("td",{style:{minWidth:m,width:m,padding:0,border:"none"}}),r.map((A,P)=>p.jsxs(x.Fragment,{children:[p.jsx($2,{column:A,row:O,cellKey:P,parent:A._parent,stickyLeft:g(A),isSelected:D,isHigh:L}),o&&T(A,O,`${P}-${j}`)]},`col-${A?._parent?.key??A.key}-${P}`))]}),d&&E&&p.jsxs(p.Fragment,{children:[p.jsx(oL,{actualIndex:j,extraHeight:E.length*v,measureRow:k,resetRow:w}),p.jsx(P2,{nestedData:E,nestedColumn:f,t:C})]})]},`row-${j}`)}),p.jsx("tr",{style:{height:l}})]})});function iL({rowCount:e,defaultRowHeight:t,scrollTop:n,containerRef:r,overscan:o=5}){const s=x.useRef(0),[a,l]=x.useState(()=>yv("40rem"));x.useEffect(()=>{const g=r?.current;if(!g)return;const m=g.clientHeight;m&&m!==s.current&&(s.current=m,l(m));const y=new ResizeObserver(b=>{const v=b[0].contentRect;v.height!==s.current&&(s.current=v.height,l(v.height))});return y.observe(g),()=>y.disconnect()},[]);const[c,d]=x.useState({}),u=(g,m)=>{d(y=>y[g]===m?y:{...y,[g]:m})},f=g=>{d(m=>{if(!(g in m))return m;const y={...m};return delete y[g],y})},h=x.useMemo(()=>{const g=new Array(e+1);g[0]=0;for(let m=0;m<e;m++)g[m+1]=g[m]+(c[m]??t);return g},[c,e,t]);return x.useMemo(()=>{const g=h[e],m=n+a;let y=0,b=e-1,v=0;for(;y<=b;){const w=y+b>>1;h[w+1]>n?(v=w,b=w-1):y=w+1}v=Math.max(0,v-o),y=v,b=e-1;let k=e;for(;y<=b;){const w=y+b>>1;h[w]>=m?(k=w,b=w-1):y=w+1}return k=Math.min(e,k+o),{startIndex:v,endIndex:k,topSpacerHeight:h[v],bottomSpacerHeight:g-h[k],totalHeight:g,measureRow:u,resetRow:f}},[h,e,a,n,o])}function aL({columnWidths:e,scrollLeft:t,overscan:n=2}){const r=x.useRef(0),[o,s]=x.useState(0),a=x.useRef(null),l=x.useCallback(f=>{if(a.current?.disconnect(),!f)return;const h=f.clientWidth;h&&(r.current=h,s(h)),a.current=new ResizeObserver(g=>{const m=g[0].contentRect;m.width!==r.current&&(r.current=m.width,s(m.width))}),a.current.observe(f)},[]),c=x.useMemo(()=>e.map(f=>{const h=Number(f);return Number.isFinite(h)&&h>0?h:0}),[e]),d=x.useMemo(()=>{const f=new Array(c.length+1);f[0]=0;for(let h=0;h<c.length;h++)f[h+1]=f[h]+c[h];return f},[c]);return{...x.useMemo(()=>{const f=t+o,h=d[c.length];let g=0,m=c.length-1,y=c.length;for(;g<=m;){const v=g+m>>1;d[v+1]>t?(y=v,m=v-1):g=v+1}y=Math.max(0,y-n),g=y,m=c.length-1;let b=c.length;for(;g<=m;){const v=g+m>>1;d[v]>=f?(b=v,m=v-1):g=v+1}return b=Math.min(c.length,b+n),{startIndex:y,endIndex:b,offsetX:d[y]||0,rightSpacerWidth:h-d[b],viewportWidth:o}},[c,d,o,t,n]),measuredRef:l}}const L2=45;function lL({rows:e,sort:t,data:n,pagination:r,columns:o,nested:s,baseUrl:a,gridPath:l,childUniqueKey:c,isVirtualizedTable:d=!1,t:u}){const f=gt(),{visibleGridColumns:h}=x.useContext(Xi),g=x.useContext(bs),{selectedColumn:m,handleMenuClick:y,handleClose:b,handleHideClick:v,columnUpdaterFunction:k}=j2(h,g,a,l,r?.rowPerPage,c),w=o?.isManageable,C=o?.isResizable,S=x.useRef(null),T=x.useRef(null),O=x.useRef(!1),M=x.useRef(0),j=x.useRef(0),D=x.useRef(!1),L=x.useRef(n),[,E]=x.useState({}),{getStickyLeft:A,columnsMeta:P}=Z8(h),{startAutoScroll:N,stopAutoScroll:$}=tL(S),{draggedColIndex:V,isInvalidDrop:H,handleDragStart:z,handleDragOver:_,handleDrop:R,handleDragEnd:U}=J8({visibleGridColumns:h,columnUpdaterFunction:k,isResizingRef:O,startAutoScroll:N,stopAutoScroll:$});L.current!==n&&(L.current=n,M.current=0,j.current=0,T.current&&(T.current.scrollTop=0,T.current.scrollLeft=0));const Y=pe=>{const me=pe.currentTarget.scrollTop,je=pe.currentTarget.scrollLeft;D.current||(D.current=!0,requestAnimationFrame(()=>{M.current=me,j.current=je,E({}),D.current=!1}))},W=x.useMemo(()=>P.filter(pe=>pe.isSticky&&!pe.isCenterTable),[P]),G=x.useMemo(()=>P.filter(pe=>pe.isSticky&&pe.isCenterTable||!pe.isSticky),[P]),q=x.useMemo(()=>G.map(pe=>pe.width),[G]),{startIndex:X,endIndex:ae,topSpacerHeight:le,bottomSpacerHeight:F,measureRow:J,resetRow:B}=iL({rowCount:n.length,defaultRowHeight:L2,scrollTop:M.current,containerRef:T,overscan:15}),{startIndex:fe,endIndex:se,offsetX:te,measuredRef:Ce}=aL({columnWidths:q,scrollLeft:j.current,overscan:2}),ye=x.useMemo(()=>G.slice(fe,se),[G,fe,se]),ke=n?.slice(X,ae),[ve,We]=x.useState(0);x.useEffect(()=>{const pe=S.current;if(!pe)return;const me=new ResizeObserver(()=>We(pe.offsetHeight));return me.observe(pe),()=>me.disconnect()},[]);const Oe=S2(s?.column?.definitions||[]),he=s?.isNested,ne=s?.data||[],ie=s?.hashKey,Ee=x.useCallback(pe=>{T.current=pe,Ce(pe)},[Ce]);return n?.length?p.jsxs(p.Fragment,{children:[p.jsx(eu,{ref:Ee,onScroll:Y,sx:{willChange:"transform",WebkitTransform:"translateZ(0)",maxHeight:"40rem",whiteSpace:"nowrap",overflow:"auto",width:"100%",border:`0.1rem solid ${f.palette.primary.notifyBorderColor}`,borderRadius:"1.4rem",position:"relative"},children:p.jsxs(Zd,{ref:S,stickyHeader:!0,"aria-label":"sticky table",sx:{backgroundColor:f.palette.primary.notifyBackground},children:[p.jsx(nL,{offsetX:te,stickyGridColumns:W,virtualisedColumns:ye,isManageable:w,isResizable:C,tableHeight:ve,sort:t,handleMenuClick:y,getStickyLeft:A,draggedColIndex:V,isInvalidDrop:H,onDragStart:z,onDragOver:_,onDrop:R,onDragEnd:U,isResizingRef:O,visibleGridColumns:h,columnUpdaterFunction:k}),p.jsx(sL,{offsetX:te,rowStart:X,defaultRowHeight:L2,measureRow:J,resetRow:B,visibleRows:ke,stickyGridColumns:W,virtualisedColumns:ye,isResizable:C,isManageable:w,topSpacerHeight:le,bottomSpacerHeight:F,selectedRow:e?.selectedRow,isNested:he,nestedRow:ne,nestedColumn:Oe,hashKey:ie,getStickyLeft:A,t:u})]})}),r&&p.jsx(bc,{pagination:r,gridPath:l,baseUrl:a,t:u}),p.jsx(sp,{menuOpen:m?.isOpen,handleClose:b,onHideClick:v})]}):p.jsx(Nr,{sx:{textAlign:"center"},children:u(yr.NRF)})}function B2({tableProps:e,isDefaultConfig:t,gridPath:n,baseUrl:r,childUniqueKey:o}){const{columns:s}=e,a=x.useContext(bs),{t:l}=x.useContext(sn),c=!!e?.isVirtualizedTable,d=M8({columns:s,gridPath:n,baseUrl:r,isDefaultConfig:t,childUniqueKey:o,pageSize:e?.pagination?.rowPerPage,data:e?.data});return x.useEffect(()=>{d?.length&&e?.data?.length&&a?.({type:Fe.SET_GRID_DATA,payload:{visibleGridColumns:d}})},[d,e?.data]),p.jsx(p.Fragment,{children:c?p.jsx(lL,{...e,gridPath:n,baseUrl:r,childUniqueKey:o,t:l}):p.jsx(D2,{...e,gridPath:n,baseUrl:r,childUniqueKey:o,t:l})})}B2.propTypes={tableProps:i.object.isRequired,mergedColumns:i.array.isRequired};function cp({tableProps:e,toolbarProps:t,isDefaultConfig:n,isLoading:r}){const o=e.columns?.isManageable;return p.jsx(bv,{children:r?p.jsxs(p.Fragment,{children:[t&&p.jsx(tc,{type:"toolbar"}),e&&p.jsx(tc,{type:"grid"})]}):p.jsxs(oe,{sx:{position:"sticky"},children:[t&&p.jsx(rp,{...t,isManageable:o,pageSize:e?.pagination?.rowPerPage,gridData:e?.data}),p.jsx(B2,{tableProps:e,isDefaultConfig:n,gridPath:t?.gridPath||"",baseUrl:t?.baseUrl||"",childUniqueKey:t?.childUniqueKey||""})]})})}cp.propTypes={tableProps:i.object.isRequired,toolbarProps:i.object,isDefaultConfig:i.bool};const{TENANT_ID:dp,BU_ID:up}=v2,{TENANT_IDS:fp,BU_IDS:pp}=w2,cL=async e=>{try{const t=localStorage.getItem("i18nextLng"),n=`${e}${mc.NOTIFICATION}/v1?${dp}=${fp}&${up}=${pp}&lang=${t}`;return await kt.get(n,ca)}catch(t){return t}},_2=async(e,t,n)=>{try{const r=localStorage.getItem("i18nextLng"),o=`${e}${mc.NOTIFICATION}${Qf.VERSION}?${dp}=${fp}&${up}=${pp}&lang=${r}`;return await kt.put(o,t,ca)}catch(r){return r}},dL=async({baseUrl:e,id:t,snopId:n})=>{try{const r=localStorage.getItem("i18nextLng"),o=`${e}${mc.NOTIFICATION}${Qf.VERSION}?${dp}=${fp}&${up}=${pp}&id=${t}&lang=${r}`;return await kt.get(o,ca)}catch(r){return r}},Ds={OK:200,CREATED:201,NO_CONTENT:204,BAD_REQUEST:400,UNAUTHORIZED:401,NOT_FOUND:404,INTERNAL_SERVER_ERROR:500},F2=({baseUrl:e})=>{const t=x.useContext(g1),[n,r]=x.useState(!1),[o,s]=x.useState(!1),[a,l]=x.useState(!1),[c,d]=x.useState({}),[u,f]=x.useState(null),[h,g]=x.useState(1),m=x.useRef(!1),{loading:y,data:b,isMarkAllAsRead:v,mode:k,activeTab:w}=x.useContext(_f),[C,S]=x.useState([]);x.useEffect(()=>{S(b)},[b]);const T=x.useCallback(async()=>{if(!(m.current||!e))try{t({type:Fe.LOADING,loading:!0}),t({type:Fe.SUCCESS,data:[]});const A=await cL(e);if(A.status===Ds.UNAUTHORIZED){m.current=!0;return}if(A.status===Ds.OK){const P=A.data?.responseData?.response||[],N=Jl(P);t({type:Fe.SET_MODE,mode:!1}),t({type:Fe.SUCCESS,data:Jl(N)}),t({type:Fe.MARK_ALL_AS_READ,isMarkAllAsRead:{count:gv(P),boo:gv(P)>0}}),t({type:Fe.LOADING,loading:!1})}}catch(A){A?.response?.status===Ds.UNAUTHORIZED&&(m.current=!0),t({type:Fe.ERROR,error:yr.SWR}),t({type:Fe.LOADING,loading:!1})}},[e,t]),O=A=>{const P=(b||[]).filter(N=>k?!N.isRead:!0);return{0:P,1:P.filter(N=>N?.type==="INFO"),2:P.filter(N=>N?.type==="ERROR")}};x.useEffect(()=>{T();const A=setInterval(T,3e5);return()=>clearInterval(A)},[T]);const M=async(A,P)=>{if(!(!A||!e)){f(A);try{const N=await dL({baseUrl:e,id:A,snopId:P});if(N.status===Ds.OK){const $=N.data?.responseData?.response||{};d($||{}),l(!0)}else throw new Error}catch{t({type:Fe.ERROR,error:yr.SWR})}finally{f(null)}}},j=async(A,P)=>{if(!(!A.length||!e)){t({type:Fe.LOADING,loading:!0});try{if((await _2(e,A,P)).status===Ds.OK){const $=b.map(H=>A.includes(H.id)?{...H,isRead:!0}:H),V=$.filter(H=>!H.isRead).length;V===0&&t({type:Fe.SET_MODE,mode:!1}),t({type:Fe.SUCCESS,data:Jl($)}),t({type:Fe.MARK_ALL_AS_READ,isMarkAllAsRead:{count:V,boo:V>0}}),setTimeout(()=>{t({type:Fe.LOADING,loading:!1})},200)}}catch{t({type:Fe.ERROR,error:yr.SWR}),t({type:Fe.LOADING,loading:!1})}}},D=async()=>{if(e){t({type:Fe.LOADING,loading:!0});try{const A=M6(b);if((await _2(e,A,f8.MARK_ALL_READ)).status===Ds.OK){const N=b.map($=>({...$,isRead:!0}));t({type:Fe.SET_MODE,mode:!1}),t({type:Fe.SUCCESS,data:Jl(N)}),t({type:Fe.MARK_ALL_AS_READ,isMarkAllAsRead:{count:0,boo:!1}}),setTimeout(()=>{t({type:Fe.LOADING,loading:!1})},200)}}catch{t({type:Fe.ERROR,error:yr.SWR}),t({type:Fe.LOADING,loading:!1})}}},L=(A,P)=>{t({type:Fe.LOADING,loading:!0}),t({type:Fe.SET_ACTIVE_TAB,activeTab:P}),setTimeout(()=>{t({type:Fe.LOADING,loading:!1})},400)},E=()=>{t({type:Fe.LOADING,loading:!0});const A=k?b||[]:(C||[]).filter(P=>!P.isRead);t({type:Fe.SET_MODE,mode:!k}),S(A),g(1),setTimeout(()=>{t({type:Fe.LOADING,loading:!1})},400)};return{fetchNotification:T,showDetailsProps:{open:a,handleClose:()=>l(!1),setOpen:l,data:c,clickId:u},alertDialogProps:{open:n,handleClose:()=>r(!1),onRefresh:T,handleRead:j,handleMarkAllAsRead:D,setOpen:r,handleShowDetails:M,clickId:u,isMainDialog:!0},activeTab:w,loading:y,tabData:O()[w],data:C,mode:k,handleTabChange:L,toggleAlertMode:E,page:h,setPage:g,isMarkAllAsRead:v}};var W2,z2,V2;function hp(){return hp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hp.apply(null,arguments)}var uL=function(t){return I.createElement("svg",hp({xmlns:"http://www.w3.org/2000/svg",width:16,height:17,fill:"none"},t),W2||(W2=I.createElement("path",{stroke:"#909090",strokeLinecap:"round",strokeMiterlimit:10,d:"M8.013 2.19c-2.206 0-4 1.793-4 4v1.927c0 .406-.173 1.026-.38 1.373l-.766 1.273c-.474.787-.147 1.66.72 1.954 2.873.96 5.973.96 8.846 0a1.335 1.335 0 0 0 .72-1.954l-.766-1.273c-.2-.347-.374-.967-.374-1.373V6.19c0-2.2-1.8-4-4-4Z"})),z2||(z2=I.createElement("path",{stroke:"#909090",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10,d:"M9.247 2.383a4.503 4.503 0 0 0-2.467 0 1.324 1.324 0 0 1 2.467 0"})),V2||(V2=I.createElement("path",{stroke:"#909090",strokeMiterlimit:10,d:"M10.013 12.957c0 1.1-.9 2-2 2a2.007 2.007 0 0 1-2-2"})))};const fL=({count:e})=>(gt(),p.jsxs(p.Fragment,{children:[p.jsx(oe,{sx:{gap:"0.5rem",display:"flex",justifyContent:"center",alignItems:"center","& svg":{transform:"scale(1)"}},children:p.jsx(uL,{style:{scale:1.2}})}),p.jsx(W8,{badgeContent:e!=0?"":null,color:"error"})]}));var H2;function mp(){return mp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mp.apply(null,arguments)}var pL=function(t){return I.createElement("svg",mp({xmlns:"http://www.w3.org/2000/svg",width:14,height:9,fill:"none",viewBox:"0 0 13 9"},t),H2||(H2=I.createElement("path",{fill:"#A8A8A8",fillRule:"evenodd",d:"M8.954 1.004a.406.406 0 0 1 0 .575L3.537 6.996a.406.406 0 0 1-.574 0L.796 4.829a.406.406 0 1 1 .575-.575l1.879 1.88 5.13-5.13a.406.406 0 0 1 .574 0m3.25 0a.406.406 0 0 1 0 .575L6.787 6.996a.406.406 0 1 1-.574-.575l5.416-5.417a.406.406 0 0 1 .575 0",clipRule:"evenodd"})))},U2,Y2;function gp(){return gp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gp.apply(null,arguments)}var hL=function(t){return I.createElement("svg",gp({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,fill:"none"},t),U2||(U2=I.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",d:"M7.79 6c0 .99-.8 1.79-1.79 1.79S4.21 6.99 4.21 6 5.01 4.21 6 4.21s1.79.8 1.79 1.79"})),Y2||(Y2=I.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",d:"M6 10.135c1.765 0 3.41-1.04 4.555-2.84.45-.705.45-1.89 0-2.595C9.41 2.9 7.765 1.86 6 1.86S2.59 2.9 1.445 4.7c-.45.705-.45 1.89 0 2.595 1.145 1.8 2.79 2.84 4.555 2.84"})))},q2;function yp(){return yp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yp.apply(null,arguments)}var mL=function(t){return I.createElement("svg",yp({xmlns:"http://www.w3.org/2000/svg",width:9,height:8,fill:"none"},t),q2||(q2=I.createElement("path",{fill:"#fff",fillRule:"evenodd",d:"M8.277 1.004a.406.406 0 0 1 0 .575L2.86 6.996a.406.406 0 0 1-.574 0L.119 4.829a.406.406 0 1 1 .575-.575l1.879 1.88 5.13-5.13a.406.406 0 0 1 .574 0",clipRule:"evenodd"})))};const G2=({type:e,item:t,handleShowDetails:n,handleRead:r,handleCTAClicked:o,clickId:s,t:a})=>{const l=gt(),c=JSON.parse(localStorage.getItem("settings"))?.platform?.theme;return p.jsxs(oe,{className:"cards",sx:{pt:" 0.8rem"},children:[p.jsx(Ye,{display:"flex",flexDirection:"row",alignItems:"start",justifyContent:"space-between",gap:1,children:p.jsx(Ad,{sx:{width:"calc(100% - 2%)","& .MuiBadge-badge":{backgroundColor:"#6041EA",height:"0.5rem",minWidth:"0.5rem"}},variant:"dot",invisible:t?.isRead,children:p.jsx(Nr,{sx:{color:l.palette.primary.notifyActiveText,whiteSpace:"normal",wordBreak:"break-word"},component:"p",className:["title-card",t?.isRead&&"read"].join(" "),children:a(t?.message)})})}),p.jsx(Ye,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",children:p.jsxs(Ye,{display:"flex",flexDirection:"row",justifyContent:"start",gap:1,sx:{p:"0.5rem 0"},children:[t?.isNotificationDetails&&p.jsx(vc,{icon:p.jsx(hL,{className:`${c==="light"?"chip-icon-light":"chip-icon-dark"}`}),disabled:s,onClick:n,label:s===t?.id?p.jsx(Go,{color:"primary",size:13}):a("SHOW_DETAILS"),component:"button",variant:"filled",clickable:!0,size:"small",sx:{backgroundColor:l.palette.brandColor.orange,color:l.palette.brandColor.white}}),!t?.isRead&&p.jsx(vc,{icon:p.jsx(mL,{className:`${c==="light"?"chip-icon-light":"chip-icon-dark"}`}),disabled:s,onClick:r,label:a("ACKNOWLEDGE"),component:"button",variant:"outlined",clickable:!0,size:"small"}),t?.primaryCTAURL&&p.jsx(vc,{disabled:t?.isPrimaryCTAClicked,onClick:()=>o({redirect:t?.isPrimaryCTARedirect,isClicked:t?.isPrimaryCTAClicked,url:t?.primaryCTAURL}),label:a(t?.primaryCTALabel),component:"button",variant:"outlined",clickable:!0,size:"small"}),t?.secondaryCTAURL&&p.jsx(vc,{disabled:t?.isSecondaryCTAClicked,onClick:()=>o({redirect:t?.isSecondaryCTARedirect,isClicked:t?.isSecondaryCTAClicked,url:t?.secondaryCTAURL}),label:a(t?.secondaryCTALabel),component:"button",variant:"outlined",clickable:!0,size:"small"})]})}),p.jsxs(Ye,{display:"flex",flexDirection:"row",alignItems:"center",gap:.35,children:[p.jsx(Nr,{sx:{fontSize:"0.8rem"},children:a(t?.product)}),p.jsx(Nr,{color:l.palette.primary.notifyTextColor,children:"•"}),p.jsx(Nr,{sx:{fontSize:"0.8rem"},children:O6(t?.createdAt,a)})]})]})};G2.propTypes={type:i.string,title:i.string,subTitle:i.string,isRead:i.bool,handleShowDetails:i.func,handleRead:i.func};const wc=60,K2=2,X2=({data:e,handleRead:t,handleShowDetails:n,clickId:r,mode:o,t:s})=>{const{isMarkAllAsRead:a}=x.useContext(_f),l=x.useRef(null),[c,d]=x.useState({start:0,end:4}),u=e?.length,f=new Date,h=new Intl.DateTimeFormat("en-US",{day:"numeric",month:"long",year:"numeric"}).format(f),g=x.useMemo(()=>o?a?.count?e?.filter(C=>!C.isRead):[]:e||[],[e,o,a]),m=g.slice(c.start,c.end),y=c.start*wc,b=(u-c.end)*wc,v=()=>{const C=l.current;if(!C)return;const S=C.scrollTop,T=C.clientHeight,O=Math.floor(S/wc)-K2,M=Math.ceil(T/wc)+2*K2,j=Math.max(0,Math.min(u-1,O)),D=Math.max(j,Math.min(u,j+M));d(L=>L.start===j&&L.end===D?L:{start:j,end:D})},k=({url:C})=>{window.open(C,"_blank")},w=x.useMemo(()=>I6(m),[m]);return x.useEffect(()=>{let C;const S=()=>{C&&cancelAnimationFrame(C),C=requestAnimationFrame(()=>{v()})},T=l.current;if(T)return v(),T.addEventListener("scroll",S),()=>{cancelAnimationFrame(C),T.removeEventListener("scroll",S)}},[u]),g.length||s("CONTAINER_MESSAGE"),p.jsxs(oe,{ref:l,sx:{height:"100%",overflowY:"auto"},children:[p.jsx(oe,{style:{height:y}}),Object.entries(w).map(([C,S])=>{const T=localStorage.getItem("i18nextLng"),O=new Date(C),M=new Intl.DateTimeFormat(T,{month:"long"}).format(O),j=O.getDate(),D=O.getFullYear(),L=`${M} ${j}, ${D}`;return p.jsxs(x.Fragment,{children:[C!==h&&p.jsx(F8,{children:L}),S.map((E,A)=>p.jsx(G2,{item:E,handleCTAClicked:k,handleShowDetails:()=>n(E.id,E.snopId),handleRead:()=>t([E.id],E.snopId),clickId:r,t:s},`${E.id}_${A}`))]},C)}),p.jsx(oe,{style:{height:b}})]})};X2.propTypes={data:i.array,handleRead:i.func,handleShowDetails:i.func};const gL=({onRefresh:e,handleShowDetails:t,clickId:n,handleRead:r,handleMarkAllAsRead:o,t:s})=>{const{loading:a,activeTab:l,data:c,tabData:d,mode:u,page:f,setPage:h,handleTabChange:g,toggleAlertMode:m}=F2({});return p.jsxs(p.Fragment,{children:[p.jsxs(oe,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:2,pt:2},children:[p.jsx(ft,{variant:"h2",sx:{fontSize:"1.2rem",color:y=>y.palette.primary.notifyTextColor},children:s("NOTIFICATION")}),p.jsx(oe,{onClick:e,children:p.jsx(Vt,{url:Ge.Refresh,alt:"refresh",sx:{cursor:"pointer"}})})]}),p.jsx(oe,{sx:{borderBottom:1,m:"1.2rem 1.2rem 0 1.2rem",borderColor:y=>y.palette.primary.notifyBorderColor},children:p.jsxs(z8,{value:l,onChange:g,children:[p.jsx(op,{label:p.jsx(oe,{sx:{display:"flex",alignItems:"center",fontSize:"1rem",fontWeight:"500"},children:p.jsx(ft,{component:"span",sx:{fontWeight:500,fontSize:"1rem"},children:s("ALL",{count:c?.filter(y=>!y?.isRead)?.length||0})})})}),p.jsx(op,{label:p.jsx(oe,{sx:{display:"flex",alignItems:"center",fontSize:"1rem",fontWeight:"500"},children:p.jsx(ft,{component:"span",sx:{fontWeight:500,fontSize:"1rem"},children:s("INFO",{count:c?.filter(y=>y?.type==="INFO"&&!y?.isRead)?.length||0})})}),sx:{color:y=>y.palette.brandColor.blue}}),p.jsx(op,{label:p.jsx(oe,{sx:{display:"flex",alignItems:"center",fontSize:"1rem",fontWeight:"500"},children:s("ERROR",{count:c?.filter(y=>y?.type==="ERROR"&&!y?.isRead)?.length||0})}),sx:{color:y=>y.palette.brandColor.red}})]})}),p.jsx(Wd,{dividers:!0,sx:{p:0,...a&&!d.length&&{alignItems:"center",justifyContent:"center"},flexGrow:1,overflowY:"auto",mx:"1.2rem",borderColor:y=>y.palette.primary.notifyBorderColor},tabIndex:-1,children:a&&!d.length?p.jsx(oe,{sx:{height:300,display:"flex",justifyContent:"center",alignItems:"center"},children:p.jsx(Go,{size:30,sx:{color:y=>y.palette.primary.notifyIconColor}})}):p.jsx(p.Fragment,{children:p.jsx(X2,{data:d,handleShowDetails:t,handleRead:r,clickId:n,page:f,setPage:h,mode:u,t:s})})}),p.jsxs(Fd,{sx:{justifyContent:"space-between",px:"1.2rem"},children:[p.jsxs(Ye,{direction:"row",gap:1,children:[p.jsx(Nr,{sx:{fontSize:"1rem"},children:s("SHOW_UNREAD")}),p.jsx(_8,{disabled:a,checked:u,onChange:m})]}),p.jsx(xl,{variant:"outlined",className:"view-all",onClick:o,startIcon:p.jsx(pL,{}),disabled:!c?.filter(y=>!y?.isRead)?.length,style:{backgroundColor:"transparent"},sx:{fontSize:"1rem",fontWeight:"300",p:0,border:"none",textTransform:"none",color:y=>y.palette.primary.notifyTextColor,"&:hover":{color:y=>y.palette.primary.notifyActiveText,background:"transparent",boxShadow:"none",border:"none"},"&.Mui-disabled":{opacity:.5,color:y=>`${y.palette.primary.notifyActiveText}!important`,background:"transparent",boxShadow:"none",border:"none"}},children:s("READ_ALL")})]})]})},yL=({data:e,handleClose:t,t:n})=>{const[r,o]=x.useState(1),[s,a]=x.useState(10),[l,c]=x.useState(e?.notificationDetails?.length||0),[d,u]=x.useState("sku_name"),[f,h]=x.useState("asc"),[g,m]=x.useState([]),[y,b]=x.useState("");return x.useEffect(()=>{if((y||d)&&e?.notificationDetails?.length){const v=P6(e?.notificationDetails,d8,y);if(d){const k=j6(v,d,f);m(Cf(k,r,s)),c(k?.length||0);return}m(Cf(v,r,s)),c(v?.length||0);return}m(Cf(e?.notificationDetails,r,s)),c(e?.notificationDetails?.length)},[y,e,r,s,f,d]),p.jsxs(p.Fragment,{children:[p.jsxs(Ye,{direction:"row",justifyContent:"space-between",sx:{padding:"1.5rem 2rem",borderBottom:"0.1rem solid",borderColor:v=>v.palette.primary.notifyBorderColor},children:[p.jsx(ft,{component:"h2",sx:{fontSize:"1.4rem",color:v=>v.palette.primary.notifyActiveText},children:n(e?.message)||e?.message}),p.jsx(oe,{onClick:t,sx:{cursor:"pointer"},children:p.jsx(Vt,{url:Ge.CloseCircle})})]}),p.jsx(Wd,{children:p.jsx(cp,{t:n,tableProps:{data:g,columns:{...j8({t:n}),isManageable:!1},sort:{sortField:d,sortDir:f,onSort:v=>{const k=v?.column?.key;h(w=>d===k&&w==="asc"?"desc":"asc"),u(k)}},pagination:{selectedPage:r,rowPerPage:s,totalRecords:l,onPageChange:v=>{o(v)},onPageSizeChange:v=>{a(v?.value),o(1)}}},toolbarProps:{defaultTools:{search:{isRequired:!0,onChange:v=>{const k=v.target.value;k&&o(1),b(k)},placeholder:`${n("SEARCH")}...`}}}})}),p.jsx(Fd,{sx:{padding:"1.5rem 2rem"}})]})},bL=({baseUrl:e,t})=>{const{alertDialogProps:n,showDetailsProps:r,fetchNotification:o,isMarkAllAsRead:s}=F2({baseUrl:e});return p.jsxs(p.Fragment,{children:[p.jsx(oe,{sx:{display:"flex",justifyContent:"center",cursor:"pointer",marginTop:"0.6rem"},onClick:()=>{o(),n?.setOpen?.(!0)},children:p.jsx(fL,{count:s.count})}),p.jsx(Ff,{...n,children:p.jsx(gL,{...n,t})}),p.jsx(Ff,{...r,children:p.jsx(yL,{...r,t})})]})},vL=({baseUrl:e,t})=>p.jsx(Yt,{children:p.jsx(y1,{children:p.jsx(bL,{baseUrl:e,t})})}),Z2=x.createContext(null),xL=Z2.Provider,wL=()=>{const e=x.useContext(Z2);return e||console.warn("useAnalytics used outside AnalyticsProvider"),e};at.Accordion=v1,at.AnalyticsProvider=xL,at.Breadcrumb=nN,at.Button=jr,at.Checkbox=gr,at.DatePicker=F9,at.Dialog=eN,at.Grid=cp,at.GridTable=G8,at.Header=S1,at.InputField=mv,at.Loader=X9,at.Notification=vL,at.Select=vv,at.SkeletonLoader=Z9,at.SliderLayout=x1,at.Switch=wv,at.TextField=Ki,at.TimePicker=W9,at.ToastProvider=G9,at.TranslationContext=sn,at.toast=H9,at.useAnalytics=wL,Object.defineProperty(at,Symbol.toStringTag,{value:"Module"})}));
|
|
256
|
+
`+s):r.stack=s}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Eo(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:s}=n;r!==void 0&&hc.assertOptions(r,{silentJSONParsing:wr.transitional(wr.boolean),forcedJSONParsing:wr.transitional(wr.boolean),clarifyTimeoutError:wr.transitional(wr.boolean)},!1),o!=null&&(K.isFunction(o)?n.paramsSerializer={serialize:o}:hc.assertOptions(o,{encode:wr.function,serialize:wr.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),hc.assertOptions(n,{baseUrl:wr.spelling("baseURL"),withXsrfToken:wr.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=s&&K.merge(s.common,s[n.method]);s&&K.forEach(["delete","get","head","post","put","patch","common"],m=>{delete s[m]}),n.headers=mn.concat(a,s);const l=[];let c=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(n)===!1||(c=c&&y.synchronous,l.unshift(y.fulfilled,y.rejected))});const d=[];this.interceptors.response.forEach(function(y){d.push(y.fulfilled,y.rejected)});let u,f=0,h;if(!c){const m=[h2.bind(this),void 0];for(m.unshift(...l),m.push(...d),h=m.length,u=Promise.resolve(n);f<h;)u=u.then(m[f++],m[f++]);return u}h=l.length;let g=n;for(;f<h;){const m=l[f++],y=l[f++];try{g=m(g)}catch(b){y.call(this,b);break}}try{u=h2.call(this,g)}catch(m){return Promise.reject(m)}for(f=0,h=d.length;f<h;)u=u.then(d[f++],d[f++]);return u}getUri(t){t=Eo(this.defaults,t);const n=r2(t.baseURL,t.url,t.allowAbsoluteUrls);return G1(n,t.params,t.paramsSerializer)}};K.forEach(["delete","get","head","options"],function(t){Oo.prototype[t]=function(n,r){return this.request(Eo(r||{},{method:t,url:n,data:(r||{}).data}))}}),K.forEach(["post","put","patch"],function(t){function n(r){return function(s,a,l){return this.request(Eo(l||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}Oo.prototype[t]=n(),Oo.prototype[t+"Form"]=n(!0)});let a8=class lx{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(o=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](o);r._listeners=null}),this.promise.then=o=>{let s;const a=new Promise(l=>{r.subscribe(l),s=l}).then(o);return a.cancel=function(){r.unsubscribe(s)},a},t(function(s,a,l){r.reason||(r.reason=new Ms(s,a,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new lx(function(o){t=o}),cancel:t}}};function l8(e){return function(n){return e.apply(null,n)}}function c8(e){return K.isObject(e)&&e.isAxiosError===!0}const Jf={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Jf).forEach(([e,t])=>{Jf[t]=e});function y2(e){const t=new Oo(e),n=A1(Oo.prototype.request,t);return K.extend(n,Oo.prototype,t,{allOwnKeys:!0}),K.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return y2(Eo(e,o))},n}const kt=y2(aa);kt.Axios=Oo,kt.CanceledError=Ms,kt.CancelToken=a8,kt.isCancel=Q1,kt.VERSION=m2,kt.toFormData=cc,kt.AxiosError=Xe,kt.Cancel=kt.CanceledError,kt.all=function(t){return Promise.all(t)},kt.spread=l8,kt.isAxiosError=c8,kt.mergeConfig=Eo,kt.AxiosHeaders=mn,kt.formToJSON=e=>Z1(K.isHTMLForm(e)?new FormData(e):e),kt.getAdapter=p2.getAdapter,kt.HttpStatusCode=Jf,kt.default=kt;const{Axios:HB,AxiosError:UB,CanceledError:YB,isCancel:qB,CancelToken:GB,VERSION:KB,all:XB,Cancel:ZB,isAxiosError:JB,spread:QB,toFormData:e7,AxiosHeaders:t7,HttpStatusCode:n7,formToJSON:r7,getAdapter:o7,mergeConfig:s7}=kt,Qf={BASE_URL:"https://qa.3sc.ai/api",VERSION:"/v1"},ca={headers:{"Content-Type":"application/json"},withCredentials:!0},b2=kt.create({baseURL:Qf.BASE_URL,axiosConfig:ca});b2.interceptors.request.use(function(e){return e},function(e){return Promise.reject(e)}),b2.interceptors.response.use(function(e){return e},function(e){return Promise.reject(e)});const gn={TOKEN:"token",USER:"user",SNOP:"snop",SELECTED_BU:"selected_business_unit",SETTINGS:"settings"},v2={TENANT_ID:"tenant_id",BU_ID:"bu_id"},d8=Object.values({"SKU Name":"sku_name",Node:"node","Channel Name":"channel_name"}),u8=[10,25,50,100],f8={MARK_ALL_READ:"MARK_ALL_READ"},p8=u8.map(e=>({label:e,value:e})),x2={PRIMARY:"PRIMARY",SECONDARY:"SECONDARY"},mc={NOTIFICATION:"/notifications",SETTING:"/configuration/setting"};function gc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var h8={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function ep(e,t){function n(o,s,a){if(!(typeof document>"u")){a=gc({},t,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var l="";for(var c in a)a[c]&&(l+="; "+c,a[c]!==!0&&(l+="="+a[c].split(";")[0]));return document.cookie=o+"="+e.write(s,o)+l}}function r(o){if(!(typeof document>"u"||arguments.length&&!o)){for(var s=document.cookie?document.cookie.split("; "):[],a={},l=0;l<s.length;l++){var c=s[l].split("="),d=c.slice(1).join("=");try{var u=decodeURIComponent(c[0]);if(a[u]=e.read(d,u),o===u)break}catch{}}return o?a[o]:a}}return Object.create({set:n,get:r,remove:function(o,s){n(o,"",gc({},s,{expires:-1}))},withAttributes:function(o){return ep(this.converter,gc({},this.attributes,o))},withConverter:function(o){return ep(gc({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var m8=ep(h8,{path:"/"});const g8=Zl(gn.SNOP),y8=Zl(gn.SELECTED_BU),b8=Zl(gn.USER);Zl(gn.SETTINGS);const w2={BU_IDS:y8?.business_unit_id,TOKEN:JSON.parse(m8.get(gn.TOKEN)||null),TENANT_IDS:b8?.tenant_id,SNOP_IDS:g8?.snop_id},{TENANT_ID:v8,BU_ID:x8}=v2,{TENANT_IDS:w8,BU_IDS:S8}=w2,Ps=async({baseUrl:e,payload:t})=>{try{const n=`${e}${mc.SETTING}/v1?${v8}=${w8}&${x8}=${S8}`;return await kt.post(n,t,ca)}catch(n){return n}},da=JSON.parse(localStorage.getItem("configuration")),tp=localStorage.getItem("i18nextLng"),C8=da?.entities?.locationHierarchy?.[tp]??da?.entities?.locationHierarchy??{},T8=da?.entities?.productHierarchy?.[tp]??da?.entities?.productHierarchy??{},k8=C8?.base??"Node",E8=T8?.base??"SKU",O8=da?.entities?.labelChannel?.[tp]||"Channel";JSON.parse(localStorage.getItem("snop"));const M8=({columns:e,gridPath:t,baseUrl:n,isDefaultConfig:r,pageSize:o=10,childUniqueKey:s,data:a})=>{const l=a?.length;let{definitions:c,defaultUserSettings:d,labels:u}=e;const f=Rr(u),h=t.split("/").filter(Boolean),g=JSON.parse(localStorage.getItem(gn.SETTINGS));let m=h.reduce((w,C)=>w?.[C],g)||null;const y=Rr(m?.columns||[]);if(!r&&t&&l){let w=(d&&np({col:d,childUniqueKey:s,definitions:c}))??np({col:c,childUniqueKey:s});const C=w.filter(T=>!y[T.key]),S=m&&m?.columns?.some(T=>T?.children&&T.children[s]);if(l&&(C.length||s&&S===!1)){if(S==!1&&s.length>0){const T=Rr(w);w=m?.columns?.map(O=>O?.children&&!O.children[s]?{...O,children:{...O.children,[s]:T?.[O?.key]?.children[s]}}:O)}(async()=>{try{const O={...g||{platform:{theme:"light"}}},M=m?.pageSize??o;let j=O;for(let D=0;D<h.length;D++){const L=h[D];D===h.length-1?j[L]={columns:w,pageSize:M}:(j[L]={...j[L]||{}},j=j[L])}localStorage.setItem(gn.SETTINGS,JSON.stringify(O)),await Ps({baseUrl:n,payload:O})}catch(T){console.error(T)}})()}}d=(m?.columns&&P8(y,d,s))??d??np({col:c});const b=[],v=Rr(d);for(const w of c){const C=v[w.key]||{},S=f[w.key]||{},T=y[w.key],O=Rr(C.children||[]),M=Rr(S.children||[]);let j={...w,style:T?.style,...C,...S};w.children?.length&&(j.children=w.children.map(D=>({...D,...O[D.key],...M[D.key]}))),b.push(j)}return b.sort((w,C)=>w.sequenceId-C.sequenceId)},S2=e=>e.sort((t,n)=>t.sequenceId-n.sequenceId),ua=({columns:e,childUniqueKey:t,definitions:n})=>{let r=n||e;return e?.map(o=>{let s=r?.find(a=>a?.key===o?.key);return{id:o.id,key:o.key,sequenceId:o.sequenceId||o.id,isHidden:o.isHidden||!1,style:o.style||s?.style||{},...o?.children&&{children:t?{[t]:ua({columns:o.children,definitions:s?.children})}:ua({columns:o.children,definitions:s?.children})}}})},Rr=e=>Array.isArray(e)&&e?.reduce((t,n)=>(t[n.key]=n,t),{}),np=({col:e,childUniqueKey:t,definitions:n})=>ua({columns:e,childUniqueKey:t,definitions:n}),P8=(e,t,n)=>t.map(o=>{const s=e[o.key],a=o.children?o.children.map(l=>{const d=Rr(Array.isArray(s?.children)?s?.children:s?.children?.[n])?.[l.key];return{...l,sequenceId:d?.sequenceId||l.sequenceId,isHidden:d?.isHidden??l.isHidden}}):void 0;return{...o,sequenceId:s?.sequenceId||o.sequenceId,isHidden:s?.isHidden??o.isHidden,...a?{children:a}:{}}}),j8=({t:e})=>{const t=[{id:1,key:"sku_name",isSortable:!0,isMandatory:!0},{id:2,key:"node",isSortable:!0,isMandatory:!0},{id:3,key:"channel_name",isSortable:!0,isMandatory:!0}],n=[{id:1,key:"sku_name",sequenceId:1,isHidden:!1,style:{width:"20rem",minWidth:"20rem",maxWidth:"20rem"}},{id:2,key:"node",sequenceId:2,isHidden:!1,style:{width:"20rem",minWidth:"20rem",maxWidth:"20rem"}},{id:3,key:"channel_name",sequenceId:3,isHidden:!1,style:{width:"20rem",minWidth:"20rem",maxWidth:"20rem"}}],r=[{id:1,key:"sku_name",label:e(E8),isLocalizable:!1},{id:2,key:"node",label:e(k8),isLocalizable:!1},{id:3,key:"channel_name",label:e(O8),isLocalizable:!1}];return{definitions:t,defaultUserSettings:n,labels:r}},I8=e=>{if(!e)return null;try{const t=JSON.parse(localStorage.getItem(gn.SETTINGS));return e.split("/").filter(Boolean).reduce((n,r)=>n?.[r],t)??null}catch{return null}},C2=(e=[],t)=>{const n=new Map,r=o=>o.forEach(s=>{n.set(s.key,s);const a=Array.isArray(s.children)?s.children:t?s.children?.[t]??[]:[];a.length&&r(a)});return r(e),n},T2=(e,t,n,r)=>e.map(o=>{const s=t.get(o.key),a=n?.get(o.key),l={key:o.key,sequenceId:s?.sequenceId??a?.sequenceId??o.sequenceId,isHidden:s?.isHidden??!1,style:s?.style??o.style??{}};if(o.children?.length){const c=T2(o.children,t,n,r);if(r){const d=s?.children&&!Array.isArray(s.children)?s.children:{};l.children={...d,[r]:c}}else l.children=c}return l}),D8=({definitions:e=[],defaultSetting:t=[],gridPath:n,childUniqueKey:r})=>{const s=I8(n)?.columns??[],a=C2(s,r),l=C2(t,r),c=(()=>{if(!s.length)return!0;const d=u=>u.some(f=>!a.has(f.key)||d(f.children??[]));return d(e)})();return{settings:T2(e,a,l,r),hasNewColumns:c}},yc=async({settings:e,gridPath:t,baseUrl:n})=>{if(t)try{const r=JSON.parse(localStorage.getItem(gn.SETTINGS))??{platform:{theme:"light"}},o=t.split("/").filter(Boolean);let s=r;for(let a=0;a<o.length;a++){const l=o[a];a===o.length-1?s[l]={...s[l]??{},columns:e}:(s[l]={...s[l]??{}},s=s[l])}localStorage.setItem(gn.SETTINGS,JSON.stringify(r)),n&&await Ps({baseUrl:n,payload:r})}catch(r){console.error("saveColumnSettings failed:",r)}},A8=async({groupBy:e,gridPath:t,baseUrl:n,childUniqueKey:r})=>{if(!(!t||!Array.isArray(e)))try{const o=JSON.parse(localStorage.getItem(gn.SETTINGS))??{platform:{theme:"light"}},s=t.split("/").filter(Boolean);let a=o;for(let l=0;l<s.length;l++){const c=s[l];if(l===s.length-1){const d=a[c]?.groupBy,u=r?a[c]?.groupByBySnop?.[r]:null;if(r&&Array.isArray(u)&&JSON.stringify(u)===JSON.stringify(e)||!r&&Array.isArray(d)&&JSON.stringify(d)===JSON.stringify(e)||!d&&e.length===0)return;a[c]={...a[c]??{},groupBy:e,...r?{groupByBySnop:{...a[c]?.groupByBySnop||{},[r]:e}}:{}}}else a[c]={...a[c]??{}},a=a[c]}localStorage.setItem(gn.SETTINGS,JSON.stringify(o)),n&&await Ps({baseUrl:n,payload:o})}catch(o){console.error("saveGroupBySettings failed:",o)}},R8=e=>{if(!e)return null;const{options:t,...n}=e,r=t?"select":"button",o={button:s=>p.jsx(jr,{...s,styles:{...s.styles,iconPrimary:s?.styles?.variant=="filled"}}),select:s=>p.jsx(oe,{sx:{"& .MuiInputBase-input":{padding:"0rem!important"},width:s.styles?.width},children:p.jsx(vv,{...s,options:t})})};return o[r]?o[r](n):null},N8=({presentSetting:e,gridSetting:t,gridPath:n,childUniqueKey:r})=>{if(!n)return e;const o=n.split("/").filter(Boolean);let s=o.reduce((d,u)=>d?.[u],e)||null,a=ua({columns:t?.grid,childUniqueKey:r});const l=Rr(s?.columns);a=a?.map(d=>{const u=d?.children||{},f=l?.[d?.key]?.children||{};return{...d,...(Object.keys(f)?.length>0||u?.[r])&&{children:{...f,[r]:u?.[r]}}}});let c=e;for(let d=0;d<o.length;d++){const u=o[d];d===o.length-1?c[u]={columns:a,pageSize:t?.pageSize??null}:(c[u]=c[u]||{},c=c[u])}return{settingObject:e,defaultUserSettings:a}},$8=async({baseUrl:e,gridSetting:t,childUniqueKey:n,gridPath:r})=>{try{const o=JSON.parse(localStorage.getItem("settings")),{settingObject:s,defaultUserSettings:a}=N8({presentSetting:o,gridSetting:t,gridPath:r,childUniqueKey:n});return localStorage.setItem("settings",JSON.stringify(s)),await Ps({baseUrl:e,payload:s}),a}catch(o){console.error(o)}},k2=({index:e,visibleGridColumns:t,width:n,columnUpdaterFunction:r})=>{if(!t||!t[e])return null;t[e];let o=`${n/10}rem`;const s=t.map((a,l)=>l===e?{...a,style:{...a.style,width:o,minWidth:o,maxWidth:o}}:a);return r({updatedColumns:s}),s[e]},L8=({definitions:e=[],labels:t=[],settings:n=[],childUniqueKey:r})=>{const o=(f=[],h=!1)=>{const g=[],m=y=>{y?.forEach(b=>{g.push(b);let v=b.children;h&&r&&v&&!Array.isArray(v)&&(v=v[r]??[]),Array.isArray(v)&&v.length&&m(v)})};return m(f),g},s=o(t),a=o(n,!0),l=new Map(s.map(f=>[f.key,f])),c=new Map(a.map(f=>[f.key,f])),d=f=>{if(f){if(typeof f=="number")return f;if(f.includes("rem"))return parseFloat(f)*16;if(f.includes("px"))return parseFloat(f)}},u=f=>{const h=l.get(f.key),g=c.get(f.key),m=f.isMandatory===!0;return{id:f.key,label:h?.label,field:f.key,renderHeader:y=>p.jsx(ss,{title:y.helpText??y.label,placement:"top",componentsProps:{tooltip:{sx:{fontSize:"1rem",padding:"0.6rem 1rem",boxShadow:"0 2px 8px rgba(0,0,0,0.3)"}}},children:y.label??""}),width:d(g?.style?.width??f.style?.width),minWidth:d(f.style?.minWidth),maxWidth:d(f.style?.maxWidth),sortable:f.isSortable??!1,pinned:f.isSticky?"left":void 0,hidden:g?.isHidden??!1,resizable:f?.isResizable??!0,draggable:f?.isDraggable??!m,hideable:!m,align:"center",deferRender:f.deferRender,renderCell:f.cellRenderer?(y,b,v)=>f.cellRenderer(b,v):void 0,meta:{isMandatory:m,...f},children:f.children?.map(u)}};return e.map(u)},bc=({pagination:e,gridPath:t,baseUrl:n,t:r})=>{const{selectedPage:o,rowPerPage:s,totalRecords:a,onPageChange:l,onPageSizeChange:c}=e,d=gt(),u=async(g,m)=>{if(!m)return;const y=m.split("/").filter(Boolean),b="settings",k={...JSON.parse(localStorage.getItem(b))||{}};let w=k;for(let C=0;C<y.length;C++){const S=y[C];C===y.length-1?w[S]={...w[S]||{},pageSize:g}:(w[S]={...w[S]||{}},w=w[S])}localStorage.setItem(b,JSON.stringify(k)),await Ps({baseUrl:n,payload:k})},f=a===0?0:(o-1)*s+1,h=Math.min(o*s,a);return p.jsxs(oe,{sx:{display:"flex",p:"1rem 1.5rem"},children:[p.jsxs(oe,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"0.5rem",width:"100%"},children:[p.jsx(ft,{sx:{fontSize:"1.1rem",color:d.palette.primary.notifyTextColor},children:r("SHOWING_ROWS",{start:f,end:h,current:Math.min(o*s,a),total:a})}),p.jsx(oe,{sx:{"& .MuiInputBase-input":{padding:"0rem 0.8rem!important"},width:"6rem"},children:p.jsx(vs,{options:p8,value:s,onChange:async g=>{c(g),u(g?.value,t)}})})]}),p.jsx(Vg,{count:Math.ceil(a/s),page:o,onChange:async(g,m)=>{l(m)},siblingCount:0,shape:"rounded",sx:{width:"100%","& .MuiPagination-ul":{width:"100%",display:"flex",justifyContent:"flex-end","& li:first-of-type":{border:`0.1rem solid ${d.palette.primary.notifyBorderColor}`,color:d.palette.primary.notifyActiveText,marginRight:"1.5rem",borderRadius:"1rem",width:"3rem",height:"3rem",justifyContent:"center",alignItems:"center",display:"flex"},"& li:last-child":{border:`0.1rem solid ${d.palette.primary.notifyBorderColor}`,color:d.palette.primary.notifyActiveText,marginLeft:"1.5rem",borderRadius:"1rem",width:"3rem",height:"3rem",justifyContent:"center",alignItems:"center",display:"flex"}},"& .MuiPaginationItem-root":{color:"#595959",fontSize:"1.1rem",borderRadius:"1rem",width:"3rem",height:"3rem",justifyContent:"center",alignItems:"center",display:"flex","& .MuiSvgIcon-root":{fontSize:"2.2rem"}},"& .Mui-selected":{color:d.palette.primary.notifyActiveText,backgroundColor:`${d.palette.brandColor.paginationBc} !important`}}})]})};bc.propTypes={pagination:i.object.isRequired};const B8=({customTools:e})=>{const t=e?.filter(r=>r?.type===x2.PRIMARY)?.sort((r,o)=>r.sequenceId-o.sequenceId),n=e?.filter(r=>r?.type===x2.SECONDARY)?.sort((r,o)=>r.sequenceId-o.sequenceId);return{primaryButtons:t,secondaryButtons:n}},E2=({customTools:e,isExpanded:t,setIsExpanded:n})=>{const{primaryButtons:r,secondaryButtons:o}=B8({customTools:e}),[s,a]=x.useState(r),l=o?.length>0,{t:c}=x.useContext(sn),d=f=>{f?a([...r,...o]):setTimeout(()=>{a(r)},100)},u=()=>{const f=!t;n(f),d(f)};return x.useEffect(()=>{d(t)},[e]),p.jsxs(p.Fragment,{children:[t&&p.jsx("div",{style:{position:"fixed",left:0,width:"100vw",height:"4rem",zIndex:998}}),p.jsxs(oe,{sx:{display:"flex",alignItems:"center",gap:"0.8rem",flexWrap:"nowrap",maxWidth:"100%",whiteSpace:"nowrap",zIndex:999},children:[p.jsx(Rj,{mode:"popLayout",children:s.map((f,h)=>p.jsx(Zr.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},layout:!0,children:p.jsx(oe,{sx:{flexShrink:0,minWidth:"fit-content"},children:R8(f)})},`${f.id}_${h}`))}),l&&p.jsx(oe,{sx:{paddingLeft:t?"0.5rem":0},children:p.jsx(jr,{label:t?"":c("LABEL_MORE_ACTIONS"),styles:{iconPrimary:!0,icon:t?Ge.CrossWhite:Ge.More,colorType:t?"danger":""},onClick:u})})]})]})};E2.propTypes={customTools:i.array.isRequired};const rp=({defaultTools:e,isManageable:t,customTools:n,baseUrl:r,gridPath:o,pageSize:s,gridData:a,childUniqueKey:l})=>{const{t:c}=x.useContext(sn),d=x.useContext(bs),u=x.useContext(Xi)||{},{visibleGridColumns:f=[],triggerApi:h=!1}=u,[g,m]=x.useState([]),[y,b]=x.useState(!1),v=n?.filter(T=>T.position==="left").sort((T,O)=>T.sequenceId-O.sequenceId)||[],k=n?.filter(T=>T.position==="right").sort((T,O)=>T.sequenceId-O.sequenceId)||[];x.useEffect(()=>{if(f.length&&t){const T={id:99999,sequenceId:99999,isLocalizable:!1,key:"horizons",label:c("Horizons"),isSortable:!1,isHidden:!0,showChildCheckbox:!0,showCheckbox:!1,isMandatory:!0,showInHierarchy:!0,showHide:!0,children:[]};let O=f.map(j=>(j?.children&&j.children.forEach(D=>{T.children.some(E=>E.key===D.key)||T.children.push({...D,showInHierarchy:!0})}),j)).filter(j=>j?.id!==T?.id);const M=T.children.length>0?[...O,T]:O;m(M)}},[f]);const w=async T=>{try{await $8({baseUrl:r,gridPath:o,childUniqueKey:l,gridSetting:{grid:T,pageSize:s}})}catch(O){console.error(O)}finally{d({type:Fe.HAS_SETTING_CHANGE,payload:{hasChange:!1}}),d({type:Fe.TRIGGER_API,payload:{triggerApi:!1}})}};x.useEffect(()=>{h&&t&&w(f)},[h]);const C=T=>{const O=T?.map(D=>D.id),M=T?.flatMap(D=>D.children||[])?.map(D=>D.id),j=g?.map(D=>{const L=O?.includes(D.id);if(Array.isArray(D.children)&&D.children.length>0){const A=D?.children?.map(N=>{const $=M?.includes?.(N.id);return{...N,isHidden:!$}}),P=A?.filter(N=>g?.some($=>$.children?.some(V=>V.id===N.id)))?.every(N=>N.isHidden);return{...D,...!D.children[0]?.showInHierarchy&&{isHidden:P||!L},children:A}}return{...D,isHidden:!L}});d({type:Fe.SET_GRID_DATA,payload:{visibleGridColumns:j}}),d({type:Fe.HAS_SETTING_CHANGE,payload:{hasChange:!0}})},S=()=>g.map(O=>{const M=Array.isArray(O.children)?O.children.filter(j=>!j.isHidden):void 0;return!O.isHidden||O.isHidden&&O.showInHierarchy?{...O,children:M}:null}).filter(Boolean);return p.jsxs(oe,{sx:{margin:"1rem 0",position:"relative",zIndex:10,display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",gap:"0.6rem",width:"100%"},children:[p.jsxs(oe,{sx:{display:"flex",flexDirection:"row",gap:"0.6rem",alignItems:"center"},children:[e?.search?.isRequired&&p.jsx(mv,{...e?.search,iconUrl:Ge.Search}),e?.refresh?.isRequired&&p.jsx(jr,{...e?.refresh,styles:{variant:"filled",icon:Ge.Refresh,colorType:"empty",width:"3.2rem",height:"3.2rem"}}),e?.groupBy?.isRequired&&p.jsx(oe,{sx:{"& .MuiInputBase-input":{padding:"0rem!important"}},children:p.jsx(vs,{styles:{icon:Ge.Group},...e.groupBy})}),t&&p.jsx(oe,{sx:{"& .MuiInputBase-input":{padding:"0rem!important"}},children:p.jsx(vs,{placeholder:c("LABEL_MANAGE_COLUMN"),options:g,value:S(),isMulti:!0,isDraggable:!0,showSearch:!0,isManageColumn:!0,onChange:C,disabled:!a.length,styles:{icon:Ge.Manage}})}),v?.length>0&&v.map((T,O)=>p.jsx(x.Fragment,{children:T.render()},T.id))]}),p.jsxs(oe,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-end",alignItems:"center",gap:"0.6rem"},children:[k?.length>0&&k.map((T,O)=>p.jsx(x.Fragment,{children:T.render()},T.id)),n&&p.jsx(E2,{customTools:n,setIsExpanded:b,isExpanded:y}),e?.save?.isRequired&&p.jsx(oe,{sx:{px:"0.5rem"},children:p.jsx(jr,{label:y?"":"Save",styles:{icon:Ge.Save,colorType:"empty"},...e?.save})}),e?.upload?.isRequired&&p.jsx(jr,{...e?.upload,styles:{variant:y?"outlined":"filled",icon:y?Ge.UploadDark:Ge.Upload,iconPrimary:!y,colorType:"secondary",isAnimate:!0}}),e?.download?.isRequired&&p.jsx(jr,{...e?.download,styles:{variant:"outlined",icon:Ge.Download,isAnimate:!0}})]})]})};rp.propTypes={defaultTools:i.object.isRequired,customTools:i.array,isManageable:i.bool,baseUrl:i.string,gridPath:i.gridPath},ee(_d)(({theme:e})=>({"& .MuiPaper-root":{borderRadius:8,border:`1px solid ${e.palette.primary.notifyBorderColor}`,boxShadow:e.shadows[4],padding:"1rem 1rem 0rem 1rem",backgroundColor:e.palette.primary.notifyBackground}}));const Nr=ee(ft)(({theme:e})=>({color:e.palette.primary.notifyTextColor,fontSize:"1.1rem"})),_8=ee(Kg)(({theme:e})=>({width:28,height:16,padding:0,display:"flex","&:active":{"& .MuiSwitch-thumb":{width:15},"& .MuiSwitch-switchBase.Mui-checked":{transform:"translateX(9px)"}},"& .MuiSwitch-switchBase":{padding:2,"&.Mui-checked":{transform:"translateX(12px)",color:"#fff","& + .MuiSwitch-track":{opacity:1,backgroundColor:"#1890ff",...e.applyStyles("dark",{backgroundColor:"#177ddc"})}}},"& .MuiSwitch-thumb":{boxShadow:"0 2px 4px 0 rgb(0 35 11 / 20%)",width:12,height:12,borderRadius:6,transition:e.transitions.create(["width"],{duration:200})},"& .MuiSwitch-track":{borderRadius:16/2,opacity:1,backgroundColor:"rgba(0,0,0,.25)",boxSizing:"border-box",...e.applyStyles("dark",{backgroundColor:"rgba(255,255,255,.35)"})}})),F8=ee(os)(({theme:e})=>({color:e.palette.primary.notifyTextColor,padding:"0.6rem 0",fontSize:"0.9rem",fontWeight:500,"&::before, &::after":{borderColor:`${e.palette.primary.notifyBorderColor}!important`}})),W8=ee(Ad)(({theme:e})=>({"& .MuiBadge-badge":{right:3.5,top:1.8,border:`0.1rem solid ${e.palette.primary.notifyBackground}`,padding:"0 1.3px",borderRadius:"50%",backgroundColor:"#D44E40",fontSize:"0.725rem",minWidth:"0.7rem",height:"0.7rem"}}));ee(ru)(({theme:e})=>({"& .MuiInputBase-root":{height:"3.52rem"},"& .MuiFormLabel-root":{color:`${e.palette.primary.notifyBorderColor} !important`,fontSize:"1rem",marginTop:"0.4rem"},"& label.Mui-focused":{color:e.palette.primary.notifyTextColor},"& .MuiInput-underline:after":{borderBottomColor:e.palette.primary.notifyBorderColor,borderBottomWidth:"0.1rem"},"& .MuiOutlinedInput-root":{"& fieldset":{borderColor:e.palette.primary.notifyBorderColor,borderWidth:"0.1rem"},"&:hover fieldset":{borderColor:e.palette.primary.notifyBorderColor,borderWidth:"0.1rem"},"&.Mui-focused fieldset":{borderColor:e.palette.primary.notifyBorderColor,borderWidth:"0.1rem"}}}));const z8=ee(c0)(({theme:e})=>({minHeight:"2rem","& .MuiTabs-indicator":{height:"0.1rem",backgroundColor:e.palette.primary.notifyActiveText}})),op=ee(Xg)(({theme:e})=>({color:e.palette.primary.notifyActiveText,textTransform:"none",fontWeight:"normal",padding:0,fontSize:"1rem",minHeight:"2rem",paddingBottom:"1rem","&.Mui-selected":{fontWeight:"bold",color:e.palette.primary.notifyActiveText}})),vc=ee(Qm)(({theme:e})=>({"&.MuiChip-outlined":{borderColor:e.palette.primary.notifyBorderColor,color:e.palette.primary.notifyActiveText},height:"2rem",fontSize:"0.9rem",fontWeight:"300",borderColor:e.palette.primary.notifyBorderColor,color:e.palette.primary.notifyActiveText,borderRadius:"0.6rem",padding:"0.2rem","&:hover":{backgroundColor:`${e.palette.brandColor.orange} !important`,color:`${e.palette.brandColor.white} !important`}}));function V8(e,t){const n=new Map((t??[]).map(s=>[s.id,s.label])),r=[],o=new Set;for(const s of e)s.label?.trim()&&(s.groupId?(o.has(s.groupId)||(o.add(s.groupId),r.push({isGroup:!0,id:s.groupId,label:n.get(s.groupId)??s.groupId,children:[]})),r.find(a=>a.isGroup&&a.id===s.groupId)?.children.push(s)):r.push({isGroup:!1,...s}));return r}const js=({children:e,indent:t=!1,onClick:n,...r})=>p.jsx(Ye,{direction:"row",alignItems:"center",gap:"0.5rem",onClick:n,sx:{pl:t?"2.2rem":"0.8rem",pr:"0.8rem",py:"0.4rem",cursor:"pointer",minHeight:"2rem",userSelect:"none","&:hover":{background:o=>o.palette.action?.hover??"rgba(0,0,0,0.04)"}},...r,children:e}),Is=({hidden:e,children:t})=>p.jsx(ft,{sx:{fontSize:"1.1rem",fontWeight:300,color:n=>e?n.palette.primary.notifyTextColor:n.palette.primary.notifyActiveText,overflow:"hidden",textOverflow:"ellipsis",minWidth:0},children:t});function H8({item:e,onDragEnd:t,hiddenIds:n,expandedIds:r,toggleExpand:o,handleGroupToggle:s,handleChildToggle:a,groupAllVisible:l,groupSomeVisible:c}){const d=cv(),u=r.has(e.id);return p.jsxs(pv,{value:e,dragListener:!1,dragControls:d,onDragEnd:t,as:"div",whileDrag:{opacity:.75,scale:1.01,zIndex:50},layout:!1,style:{listStyle:"none"},children:[p.jsx(js,{onClick:()=>e.children.length===1&&s(e),children:p.jsxs(Ye,{direction:"row",justifyContent:"space-between",alignItems:"center",width:"100%",gap:"0.5rem",children:[p.jsx(oe,{onPointerDown:f=>f.stopPropagation(),onClick:f=>{f.stopPropagation(),o(e.id)},sx:{cursor:"pointer",flexShrink:0,width:"2rem",height:"0.9rem",opacity:.6,display:"flex",alignItems:"center",justifyContent:"center"},children:p.jsx(Vt,{url:u?Ge.ArrowSelectUp:Ge.ArrowRight})}),p.jsxs(Ye,{direction:"row",gap:"0.5rem",width:"100%",alignItems:"center",children:[p.jsx(oe,{onPointerDown:f=>f.stopPropagation(),children:p.jsx(gr,{sx:{p:0},checked:l(e),indeterminate:c(e),onClick:f=>{f.stopPropagation(),s(e)}})}),p.jsx(Is,{hidden:!l(e)&&!c(e),children:e.label})]})]})}),u&&e.children.map(f=>p.jsx(js,{indent:!0,onClick:()=>a(f),children:p.jsxs(Ye,{direction:"row",gap:"1rem",width:"100%",children:[p.jsx(oe,{sx:{flexShrink:0,width:"1rem",height:"0.9rem"}}),p.jsx(oe,{onPointerDown:h=>h.stopPropagation(),children:p.jsx(gr,{sx:{p:0},checked:!n.has(f.id),onClick:h=>{h.stopPropagation(),a(f)}})}),p.jsx(Is,{hidden:n.has(f.id),children:f.label})]})},f.id))]})}function U8({item:e,onDragEnd:t,hiddenIds:n,handleLeafToggle:r}){const o=cv();return p.jsx(pv,{value:e,dragListener:!1,dragControls:o,onDragEnd:t,as:"div",whileDrag:{opacity:.75,scale:1.01,zIndex:50},layout:!1,style:{listStyle:"none"},children:p.jsx(js,{onClick:()=>r(e),children:p.jsxs(Ye,{direction:"row",justifyContent:"space-between",alignItems:"center",width:"100%",gap:"0.5rem",children:[p.jsx(oe,{sx:{flexShrink:0,width:"2rem",height:"0.9rem"}}),p.jsxs(Ye,{direction:"row",gap:"0.5rem",width:"100%",alignItems:"center",children:[p.jsx(oe,{onPointerDown:s=>s.stopPropagation(),children:p.jsx(gr,{sx:{p:0},checked:!n.has(e.id),onClick:s=>{s.stopPropagation(),r(e)}})}),p.jsx(Is,{hidden:n.has(e.id),children:e.label})]})]})})})}const Y8=({engine:e,onClose:t})=>{const{t:n}=x.useContext(sn),{orderedColumns:r,toggleColumnVisibility:o,showAllColumns:s,resetColumns:a,moveColumnBefore:l,groups:c=[]}=e,d=x.useMemo(()=>r.filter(P=>P.draggable||P.hideable),[r]),[u,f]=x.useState(""),[h,g]=x.useState(new Set),[m,y]=x.useState(()=>V8(d,c)),b=x.useRef(m),[v,k]=x.useState(()=>{const P=new Set;return d.forEach(N=>{N.hidden&&P.add(N.id)}),P}),w=P=>g(N=>{const $=new Set(N);return $.has(P)?$.delete(P):$.add(P),$}),C=x.useMemo(()=>d.filter(P=>P.label?.trim()).map(P=>P.id),[d]);C.length>0&&C.every(P=>!v.has(P));const S=P=>P.children.every(N=>!v.has(N.id)),T=P=>P.children.some(N=>!v.has(N.id))&&!P.children.every(N=>!v.has(N.id)),O=P=>{const N=new Set(v),$=P.children.every(V=>!N.has(V.id));k(V=>{const H=new Set(V);return P.children.forEach(z=>$?H.add(z.id):H.delete(z.id)),H}),setTimeout(()=>{P.children.forEach(V=>{const H=N.has(V.id);$&&!H&&o(V.id),!$&&H&&o(V.id)})},0)},M=P=>{o(P.id),k(N=>{const $=new Set(N);return $.has(P.id)?$.delete(P.id):$.add(P.id),$})},j=P=>{o(P.id),k(N=>{const $=new Set(N);return $.has(P.id)?$.delete(P.id):$.add(P.id),$})},D=P=>{y(P),b.current=P},L=()=>{const N=b.current.flatMap($=>$.isGroup?$.children.map(V=>V.id):[$.id]);setTimeout(()=>{for(let $=N.length-2;$>=0;$--)l(N[$],N[$+1])},0)},E=x.useMemo(()=>{if(!u)return m;const P=u.toLowerCase();return m.reduce((N,$)=>{if($.isGroup){const V=$.label.toLowerCase().includes(P),H=$.children.filter(z=>z.label.toLowerCase().includes(P));V?N.push($):H.length&&N.push({...$,children:H})}else $.label.toLowerCase().includes(P)&&N.push($);return N},[])},[m,u]),A={hiddenIds:v,expandedIds:h,toggleExpand:w,handleGroupToggle:O,handleChildToggle:M,handleLeafToggle:j,groupAllVisible:S,groupSomeVisible:T,onDragEnd:L};return p.jsxs(oe,{sx:{display:"flex",flexDirection:"column",height:"100%",background:P=>P.palette.primary.notifyBackground,border:P=>`0.1rem solid ${P.palette.primary.notifyBorderColor}`,overflow:"hidden",py:"1rem"},children:[p.jsx(oe,{sx:{flexShrink:0,padding:"0rem 1rem",pb:"0.5rem"},children:p.jsx(Ki,{type:"text",placeholder:n("SEARCH"),value:u,variant:"standard",size:"small",InputProps:{disableUnderline:!0},onChange:P=>f(P.target.value),sx:{background:P=>P.palette.primary.appBackground,borderRadius:"0.8rem",border:P=>`0.1rem solid ${P.palette.primary.notifyBorderColor}`,width:"100%","& .MuiInputBase-input":{padding:"0.5rem 0.8rem!important",height:"1.8rem"}}})}),p.jsx(oe,{sx:{flex:1,overflowY:"auto",scrollbarWidth:"thin"},children:(u?E:m).length===0?p.jsx(Ye,{justifyContent:"center",alignItems:"center",sx:{height:"3rem"},children:p.jsx(ft,{sx:{color:P=>P.palette.primary.notifyTextColor,fontSize:"1.1rem"},children:n("NO_OPTIONS")})}):u?p.jsx(oe,{children:E.map(P=>P.isGroup?p.jsxs(oe,{children:[p.jsx(js,{onClick:()=>P.children.length===1&&O(P),children:p.jsxs(Ye,{direction:"row",justifyContent:"space-between",alignItems:"center",width:"100%",gap:"0.5rem",children:[p.jsx(oe,{onClick:N=>{N.stopPropagation(),w(P.id)},sx:{cursor:"pointer",flexShrink:0,width:"2rem",height:"0.9rem",opacity:.6,display:"flex",alignItems:"center",justifyContent:"center"},children:p.jsx(Vt,{url:h.has(P.id)?Ge.ArrowSelectUp:Ge.ArrowRight})}),p.jsxs(Ye,{direction:"row",gap:"0.5rem",width:"100%",alignItems:"center",children:[p.jsx(gr,{sx:{p:0},checked:S(P),indeterminate:T(P),onClick:N=>{N.stopPropagation(),O(P)}}),p.jsx(oe,{sx:{flexShrink:0,width:"2rem",height:"0.9rem",opacity:.25,display:"flex",alignItems:"center",justifyContent:"center"}}),p.jsx(Is,{hidden:!S(P)&&!T(P),children:P.label})]})]})}),P.children.map(N=>p.jsx(js,{indent:!0,onClick:()=>M(N),children:p.jsxs(Ye,{direction:"row",gap:"1rem",width:"100%",children:[p.jsx(oe,{sx:{flexShrink:0,width:"1rem",height:"0.9rem"}}),p.jsx(gr,{sx:{p:0},checked:!v.has(N.id),onClick:$=>{$.stopPropagation(),M(N)}}),p.jsx(Is,{hidden:v.has(N.id),children:N.label})]})},N.id))]},P.id):p.jsx(js,{onClick:()=>j(P),children:p.jsxs(Ye,{direction:"row",justifyContent:"space-between",alignItems:"center",width:"100%",gap:"0.5rem",children:[p.jsx(oe,{sx:{flexShrink:0,width:"2rem",height:"0.9rem"}}),p.jsxs(Ye,{direction:"row",gap:"0.5rem",width:"100%",alignItems:"center",children:[p.jsx(gr,{sx:{p:0},checked:!v.has(P.id),onClick:N=>{N.stopPropagation(),j(P)}}),p.jsx(oe,{sx:{flexShrink:0,width:"2rem",height:"0.5rem",opacity:.25,display:"flex",alignItems:"center",justifyContent:"center"}}),p.jsx(Is,{hidden:v.has(P.id),children:P.label})]})]})},P.id))}):p.jsx(m6,{as:"div",axis:"y",values:m,onReorder:D,style:{padding:0,margin:0},children:m.map(P=>P.isGroup?p.jsx(H8,{item:P,...A},P.id):p.jsx(U8,{item:P,...A},P.id))})})]})};function q8({columns:e,data:t,maxHeight:n=400,freezeColId:r,features:o,rowHeight:s,colMgr:a,sidebarOpen:l,onColumnSave:c,onColumnReorder:d,onColumnResize:u,isManageable:f,...h}){const g=gt(),m=g.mode==="dark"?"dark":"light",y=g.palette.primary.notifyBackground,b=g.palette.primary.appBackground,v=g.palette.primary.notifyTextColor,k=g.palette.primary.notifyActiveText,w=g.palette.primary.notifyBorderColor,C=g.typography?.fontFamily??"Euclid Circular Regular, sans-serif",S={root:{borderRadius:f?"1.4rem 0 0 1.4rem":"1.4rem",border:`0.1rem solid ${w}`,borderRight:l?"none":`0.1rem solid ${w}`,background:y,fontFamily:C,fontSize:"1.1rem",overflow:"hidden"},headerRow:{background:y,color:k,fontWeight:600},groupRow:{background:y,color:k,borderColor:w,borderLeft:`0.1rem solid ${w}`,fontWeight:600,borderBottom:`0.1rem solid ${w}`},groupHeaderCell:{borderColor:w,borderLeft:`0.1rem solid ${w}`,borderRight:`0.1rem solid ${w}`},headerCell:{background:y,color:v,borderColor:w,borderRight:"none",padding:"0 12px",textAlign:"center",fontWeight:"bold",fontSize:"1.1rem",lineHeight:"1.5rem",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},row:{background:y,color:v,borderColor:w,fontSize:"1.1rem"},cell:{background:y,borderBottom:`0.1rem solid ${w}`,borderRight:"none",color:v,borderColor:w,padding:"0",textAlign:"center",fontSize:"1.1rem",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontVariantNumeric:"tabular-nums"},pinnedCell:{background:y,color:v,borderBottom:`0.1rem solid ${w}`,borderRight:"none",padding:"0"},pinnedHeaderCell:{background:y,color:v,borderColor:w,borderRight:"none",padding:"0"},rowSelected:{background:b}},T={sortAsc:p.jsx(Vt,{url:Ge.AscSort}),sortDesc:p.jsx(Vt,{url:Ge.DescSort}),sortNone:p.jsx(Vt,{url:Ge.Unsort})},O={columns:e,data:t,rowHeight:s,maxHeight:n,theme:m,features:o,styles:S,icons:T,slots:{loadingCell:p.jsx(tc,{type:"cell"}),toolbar:M=>{a.captureEngine(M)},rowSelectionIndicator:(M,j)=>p.jsx("div",{style:{position:"absolute",bottom:0,left:0,width:"100%",height:"0.08rem",background:"linear-gradient(to right, #F9B16E, #F68080)",pointerEvents:"none",zIndex:5}})},onColumnStateChange:M=>c?.(M),onColumnReorder:d,onColumnResize:u,...h};return p.jsx(LN,{...O})}function G8(e){const{t}=x.useContext(sn),n=FN(),{tableProps:r,toolbarProps:o}=e,{pagination:s={},data:a=[],childUniqueKey:l=""}=r??{},{gridPath:c="",baseUrl:d=""}=o??{},u=r?.columns?.definitions,[f,h]=x.useState(0),g=u?.definitions??[],m=u?.defaultUserSettings??[],y=x.useMemo(()=>g.filter(H=>H.isVisible!==!1),[u?.definitions]),{settings:b,hasNewColumns:v}=x.useMemo(()=>!c||!g.length?{settings:u?.settings??[],hasNewColumns:!1}:D8({definitions:g,defaultSetting:m,gridPath:c,childUniqueKey:l}),[c,l,f]),k=x.useRef(null),w=x.useRef(null),C=x.useRef(null),S=x.useRef(b),T=o?.defaultTools?.groupBy?.appliedValue;x.useEffect(()=>{if(!c||!Array.isArray(T))return;const H=JSON.stringify(T);H!==C.current&&(C.current=H,A8({groupBy:T,gridPath:c,baseUrl:d,childUniqueKey:l}))},[T,c,d,l]);const O=x.useRef(l);O.current!==l&&(O.current=l,S.current=b,w.current=null);const M=H=>{const z=[];return H.forEach(_=>{z.push(_),(Array.isArray(_.children)?_.children:l?_.children?.[l]??[]:[]).forEach(U=>z.push(U))}),z},j=x.useCallback(H=>{c&&(clearTimeout(k.current),k.current=setTimeout(()=>{const z=new Map(H.map(W=>[W.id,W])),_=new Map(M(S.current).map(W=>[W.key,W])),R=new Map(M(b).map(W=>[W.key,W])),U=g.map(W=>{const G=z.get(W.key),q=_.get(W.key)??R.get(W.key),X={key:W.key,sequenceId:q?.sequenceId??0,isHidden:G?G.hidden:q?.isHidden??!0,style:q?.style??W.style??{}};if(W.children?.length&&l){const ae=q?.children&&!Array.isArray(q.children)?q.children:{},le=W.children.map(F=>{const J=z.get(F.key),B=_.get(F.key)??R.get(F.key);return{key:F.key,sequenceId:B?.sequenceId??0,isHidden:J?J.hidden:B?.isHidden??!1,style:B?.style??F.style??{}}});X.children={...ae,[l]:le}}return X}),Y=JSON.stringify(U);if(w.current===null){w.current=Y,S.current=U,v&&(yc({settings:U,gridPath:c,baseUrl:d}),h(W=>W+1));return}Y!==w.current&&(w.current=Y,S.current=U,yc({settings:U,gridPath:c,baseUrl:d}),h(W=>W+1))},1500))},[c,d,v,g,b,l]),D=x.useCallback(H=>{if(!c)return;const z=new Map(H.map((Y,W)=>[Y,W])),_=new Map(M(S.current).map(Y=>[Y.key,Y])),R=g.map(Y=>{const W=_.get(Y.key),G={key:Y.key,sequenceId:z.get(Y.key)??W?.sequenceId??0,isHidden:W?.isHidden??!1,style:W?.style??Y.style??{}};return Y.children?.length&&l&&W?.children&&(G.children=W.children),G}),U=JSON.stringify(R);U!==w.current&&(w.current=U,S.current=R,yc({settings:R,gridPath:c,baseUrl:d}),h(Y=>Y+1))},[c,d,g,l]),L=x.useCallback((H,z)=>{c&&(clearTimeout(k.current),k.current=setTimeout(()=>{const _=`${z}px`,R=new Map(M(S.current).map(W=>[W.key,W])),U=g.map(W=>{const G=R.get(W.key),X=W.key===H?{width:_}:G?.style??W.style??{},ae={key:W.key,sequenceId:G?.sequenceId??0,isHidden:G?.isHidden??!1,style:X};if(W.children?.length&&l){const le=G?.children??{},J=(Array.isArray(le[l])?le[l]:[]).map(B=>B.key===H?{...B,style:{width:_}}:B);ae.children={...le,[l]:J}}return ae}),Y=JSON.stringify(U);Y!==w.current&&(w.current=Y,S.current=U,yc({settings:U,gridPath:c,baseUrl:d}),h(W=>W+1))},1500))},[c,d,g,l]),E=x.useMemo(()=>{if(!b.length)return y;const H=new Map(b.map(z=>[z.key,z.sequenceId??0]));return[...y].sort((z,_)=>(H.get(z.key)??0)-(H.get(_.key)??0))},[y,b]),A=x.useMemo(()=>u&&{...u,definitions:E,settings:b,childUniqueKey:l},[u,E,b,l]),P=x.useMemo(()=>L8(A),[A]),N=x.useRef(null),$={pageSize:s?.rowPerPage,gridData:a},V=x.useMemo(()=>{const H=o?.defaultTools?.groupBy;if(!H||!Object.prototype.hasOwnProperty.call(H,"appliedValue"))return o;const z={...H};return delete z.appliedValue,{...o,defaultTools:{...o.defaultTools,groupBy:z}}},[o]);return p.jsxs(Yt,{children:[o&&p.jsx(rp,{...V,...$}),a.length?p.jsxs(p.Fragment,{children:[p.jsxs(oe,{sx:{display:"flex",alignItems:"stretch"},children:[p.jsxs(oe,{ref:N,sx:{flex:1,minWidth:0,alignSelf:"flex-start",position:"relative"},children:[p.jsx(q8,{...r,columns:P,colMgr:n,sidebarOpen:!1,isManageable:r?.columns?.isManageable,onColumnSave:j,onColumnReorder:D,onColumnResize:L}),r?.columns?.isManageable&&n.isOpen&&p.jsx(oe,{sx:{position:"absolute",top:0,right:0,width:260,height:"100%",zIndex:10,display:"flex",flexDirection:"column",overflow:"hidden"},children:p.jsx(n.ColumnManagerPanel,{style:{width:"100%",height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},render:({engine:H,close:z})=>p.jsx(Y8,{engine:H,onClose:z})})})]}),r?.columns?.isManageable&&p.jsx(ss,{title:t("LABEL_MANAGE_COLUMN"),placement:"left",children:p.jsxs(oe,{onClick:n.toggle,sx:{width:"2rem",flexShrink:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",gap:"0.5rem",p:"0 1.3rem",borderRadius:(n.isOpen,"0 1.4rem 1.4rem 0"),border:H=>`0.1rem solid ${H.palette.primary.notifyBorderColor}`,borderLeft:"none",background:H=>H.palette.primary.notifyButtonBackground,transition:"background 0.15s","&:hover":{background:H=>H.palette.primary.appBackground}},children:[p.jsx(oe,{component:"img",src:Ge.Manage,sx:{width:"1.6rem",height:"2rem",transform:"rotate(90deg)"}}),p.jsx(ft,{sx:{fontSize:"1rem",letterSpacing:"0.08em",writingMode:"vertical-rl",textOrientation:"mixed",transform:"rotate(360deg)",userSelect:"none",color:H=>H.palette.primary.notifyTextColor},children:a?.length>1?t("LABEL_MANAGE_COLUMN"):t("LABEL_MANAGE_COLUMN")?.slice(0,7)})]})})]}),Object.keys(s).length>0&&p.jsx(bc,{pagination:s,gridPath:c,baseUrl:d,t})]}):p.jsx(Nr,{sx:{textAlign:"center"},children:t(yr.NRF)})]})}const O2=e=>{let{disabled:t=!1,minWidth:n=0,maxWidth:r,className:o="",id:s,resizeStart:a,resizeEnd:l,defaultWidth:c,rowSpan:d=1,colSpan:u=1}=e;const[f,h]=x.useState(!1),[g,m]=x.useState(0),[y,b]=x.useState(0),[v,k]=x.useState(0),[w,C]=x.useState(null),S=x.useRef(null),T=x.useCallback(E=>{if(!t&&(C(s),a&&a(),h(!0),m(E),b(0),S.current)){const A=S.current.previousSibling;A&&b(A.clientWidth)}},[t,s,a]),O=x.useCallback(()=>{t||(f&&l&&w===s&&l(v),h(!1),C(null))},[t,l,w,s,v,f]),M=x.useCallback(E=>{if(t)return;const A=E instanceof TouchEvent?E.touches[0].screenX:E.screenX;if(!f)return;const P=S.current;if(!P||!P.previousSibling)return;const N=P.previousSibling,$=g-A;let V=y-$;n!==void 0&&V<n&&(V=n),r!==void 0&&V>r&&(V=r),N.style.width=V+"px",N.style.minWidth=V+"px",N.style.maxWidth=V+"px",N.style.setProperty("--column_resize_before_width",V+"px"),k(V)},[t,f,g,y,n,r]);x.useEffect(()=>{const E=S.current;if(E&&E.previousSibling){const A=E.previousSibling;c?(A.style.minWidth=c+"px",A.style.width=c+"px",A.style.maxWidth=c+"px",A.style.setProperty("--column_resize_before_width",c+"px")):n&&(A.style.minWidth=n+"px",A.style.width=n+"px",A.style.maxWidth=n+"px",A.style.setProperty("--column_resize_before_width",n+"px"))}},[c,n]),x.useEffect(()=>{const E=S.current;if(t&&E&&E.previousSibling){const A=E.previousSibling;c&&(A.style.minWidth=c+"px",A.style.width=c+"px",A.style.maxWidth=c+"px",A.style.setProperty("--column_resize_before_width",c+"px")),r&&(A.style.maxWidth=r+"px")}},[t,c,r]);const j=x.useCallback(()=>{document.addEventListener("mousemove",M),document.addEventListener("mouseup",O),document.addEventListener("touchmove",M),document.addEventListener("touchend",O)},[M,O]),D=x.useCallback(()=>{document.removeEventListener("mousemove",M),document.removeEventListener("mouseup",O),document.removeEventListener("touchmove",M),document.removeEventListener("touchend",O)},[M,O]);x.useEffect(()=>(t||j(),()=>{D()}),[t,j,D]);const L={userSelect:"none"};return t||(L.cursor="ew-resize"),o===""&&(L.width="6px",L.backgroundColor="rgba(0, 0, 0, 0.1)"),x.createElement("th",{ref:S,style:L,rowSpan:d,colSpan:u,className:"column_resizer_own_class ".concat(t?"disabled_column_resize":""," ").concat(o),onMouseDown:t?void 0:E=>T(E.screenX),onTouchStart:t?void 0:E=>T(E.touches[0].screenX)})};function xc({isRenderCellContent:e,column:t,row:n,parent:r}){const o=n[t.key],s=o?.length>20;return p.jsx(p.Fragment,{children:e?p.jsx(oe,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",textTransform:"none",fontSize:"1.1rem"},children:t?.cellRenderer(n,{column:t,parent:r})}):p.jsx(p.Fragment,{children:s?p.jsx(ss,{title:o,placement:"top",componentsProps:{tooltip:{sx:{fontSize:"1rem",padding:"0.5rem 1rem",boxShadow:"0 2px 8px rgba(0,0,0,0.3)"}}},children:p.jsx(oe,{sx:{maxWidth:"auto",whiteSpace:"normal"},children:p.jsx(ft,{sx:{fontSize:"1.1rem",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",textTransform:"none"},children:o})})}):p.jsx(oe,{sx:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",textTransform:"none",fontSize:"1.1rem",m:0},id:t.key,component:"p",children:o??""})})})}xc.propTypes={isRenderCellContent:i.bool,column:i.object,row:i.object};const K8=ee(is)(({theme:e})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"table-cell",[`&.${Qd.head}`]:{color:e.palette.primary.notifyTextColor,backgroundColor:e.palette.primary.notifyBackground,borderColor:e.palette.primary.notifyBorderColor,padding:"0rem",textAlign:"center",lineHeight:"1.5rem"},[`&.${Qd.body}`]:{color:e.palette.primary.notifyTextColor,borderColor:e.palette.primary.notifyBorderColor,padding:"0rem",textAlign:"center"}}));function Mo({children:e,...t}){return p.jsx(K8,{...t,children:e})}Mo.propTypes={children:i.node};const X8=ee(n0)(()=>({"&:last-child td":{borderBottom:"none"}}));function eo({children:e,...t}){return p.jsx(X8,{...t,children:e})}eo.propTypes={children:i.node};const M2=x.memo(({row:e,isSelected:t,isHigh:n,onRowClick:r,children:o,sxProps:s})=>p.jsx(eo,{sx:a=>({backgroundColor:t||n?a.palette.primary.appBackground:a.palette.primary.notifyBackground,...s}),onClick:()=>r?.(e),children:o},e?.fhi)),P2=x.memo(({nestedData:e,nestedColumn:t,t:n})=>e?.length?p.jsx(p.Fragment,{children:e.map((r,o)=>p.jsx(eo,{children:t.map((s,a)=>p.jsx(Mo,{style:s?.style,children:p.jsx(xc,{isRenderCellContent:!!s?.cellRenderer,column:s,row:r})},a))},`nested-${o}`))}):p.jsx(eo,{children:p.jsx(Mo,{colSpan:t.length,children:p.jsx(Nr,{sx:{textAlign:"center"},children:n(yr.NRF)})})})),j2=(e,t,n,r,o,s)=>{const[a,l]=x.useState({isOpen:!1,column:null}),c=(h,g,m)=>{l({isOpen:h.currentTarget,column:g,isChild:!!m})},d=()=>{l({isOpen:!1,column:null,isChild:!1})},u=async()=>{d();const h=e.map(g=>{if(a?.isChild&&Array.isArray(g.children)){const m=g.children.map(b=>b.key===a.column?.key?{...b,isHidden:!0}:b),y=m.every(b=>b.isHidden);return{...g,isHidden:y?!0:g.isHidden,children:m}}return g.key===a.column?.key?{...g,isHidden:!0}:g});f({updatedColumns:h})},f=async({updatedColumns:h})=>{t({type:Fe.SET_GRID_DATA,payload:{visibleGridColumns:h}});const g=r.split("/").filter(Boolean),m=JSON.parse(localStorage.getItem(gn.SETTINGS));let y=g.reduce((T,O)=>T?.[O],m)||null,b=ua({columns:h,childUniqueKey:s});const v=Rr(y?.columns);b=b?.map(T=>{const O=T?.children||{},M=v?.[T?.key]?.children||{};return{...T,...(Object.keys(M)?.length>0||O?.[s])&&{children:{...M,[s]:O?.[s]}}}});const w={...m||{platform:{theme:"light"}}},C=y?.pageSize??o;let S=w;for(let T=0;T<g.length;T++){const O=g[T];T===g.length-1?S[O]={columns:b,pageSize:C}:(S[O]={...S[O]||{}},S=S[O])}localStorage.setItem(gn.SETTINGS,JSON.stringify(w)),await Ps({baseUrl:n,payload:w})};return{selectedColumn:a,handleMenuClick:c,handleClose:d,handleHideClick:u,columnUpdaterFunction:f}},sp=({menuOpen:e,handleClose:t,onHideClick:n})=>{const r=gt(),{t:o}=x.useContext(sn);return p.jsx(Ei,{open:!!e,anchorEl:e,onClose:t,anchorOrigin:{vertical:"bottom",horizontal:"left"},children:p.jsx(oe,{sx:{backgroundColor:r.palette.primary.notifyBackground,border:`0.1rem solid ${r.palette.primary.notifyBorderColor}`,minHeight:"2.3rem",display:"flex",justifyContent:"center",alignItems:"center"},children:p.jsx(xl,{onClick:n,disableRipple:!0,sx:{textTransform:"none",fontSize:"1.1rem",p:"0.4rem 1rem",minHeight:"unset",fontWeight:500,color:r.palette.primary.notifyTextColor,backgroundColor:"transparent","&:hover":{backgroundColor:"transparent"},"&:active":{backgroundColor:"transparent"},"&:focus":{backgroundColor:"transparent"}},children:o("LABEL_HIDE_COLUMN")})})})};sp.propTypes={menuOpen:i.object,handleClose:i.func,onHideClick:i.func};const I2=({sortKey:e,sortField:t,sortDir:n,handleSortClick:r})=>{const o=s=>p.jsx(sl,{onClick:r,sx:{padding:"0.2rem"},draggable:!1,children:p.jsx(Vt,{url:s})});return p.jsx(p.Fragment,{children:o(t===e?n==="asc"?Ge.AscSort:Ge.DescSort:Ge.Unsort)})};I2.propTypes={sortKey:i.string.isRequired,sortField:i.string,sortDir:i.string,handleSortClick:i.func};function ip({parent:e,column:t,sort:n,handleMenuClick:r,isManageable:o}){const s=o&&(!t?.isMandatory||t?.isMandatory&&t?.showHide===!0),a=t?.label,l=t?.helpText,c=t?.isSortable,d=n?.sortField,u=n?.sortDir,f=n?.onSort;return p.jsxs(oe,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},draggable:!1,children:[p.jsx(oe,{sx:{fontWeight:"bold",fontSize:"1.1rem",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",padding:"0.5rem",textAlign:"center"},children:p.jsx(ss,{title:l??a,placement:"top",componentsProps:{tooltip:{sx:{fontSize:"1rem",padding:"0.6rem 1rem",boxShadow:"0 2px 8px rgba(0,0,0,0.3)"}}},children:a??""})}),p.jsxs(oe,{sx:{display:"flex",alignItems:"center"},draggable:!1,children:[c&&p.jsx(I2,{sortKey:e?`${e?.key}|${t?.key}`:t?.key,sortField:d,sortDir:u,handleSortClick:()=>f({column:t,sortDir:u,sortField:d,parent:e})}),s&&p.jsx(sl,{draggable:!1,onClick:h=>r(h,t,e),sx:{padding:"0.2rem"},children:p.jsx(Vt,{url:Ge.Menu})})]})]})}ip.propTypes={column:i.object.isRequired,sort:i.object.isRequired,handleMenuClick:i.func,isManageable:i.bool};function D2({rows:e,sort:t,data:n,pagination:r,columns:o,nested:s,baseUrl:a,gridPath:l,childUniqueKey:c,isVirtualizedTable:d=!1,t:u}){const f=gt(),{visibleGridColumns:h}=x.useContext(Xi),g=x.useContext(bs),{selectedColumn:m,handleMenuClick:y,handleClose:b,handleHideClick:v,columnUpdaterFunction:k}=j2(h,g,a,l,r?.rowPerPage,c),w=o?.isManageable,C=o?.isResizable,S=n?.length>0,T=x.useRef(null),O=x.useRef(null),M=45,j=10,D=n?.length,[L,E]=x.useState({start:0,end:10}),[A,P]=x.useState(null),[N,$]=x.useState(null),[V,H]=x.useState(null);let z=null;const _=x.useRef(0),R=x.useRef(!1),U=x.useRef(null),Y=S2(s?.column?.definitions||[]),W=s?.isNested,G=s?.data||[],q=s?.hashKey,[X,ae]=x.useState(0);x.useEffect(()=>{if(T.current){const ne=()=>{ae(T.current.offsetHeight)};return ne(),window.addEventListener("resize",ne),()=>window.removeEventListener("resize",ne)}},[n]),x.useEffect(()=>{const ie=T.current?.querySelector("thead");if(!ie)return;const Ee=()=>{H(null)};return ie?.addEventListener("mousedown",Ee),()=>{ie?.removeEventListener("mousedown",Ee)}},[]);const le=(ne,ie)=>{if(R.current){ne.preventDefault();return}P(ie),H(null),ne.dataTransfer.setData("colIndex",ie);const Ee=h[ie],pe=Ee?.label,me=document.createElement("div");me.textContent=pe,Object.assign(me.style,{display:"flex",alignItems:"center",justifyContent:"center",padding:"1.5rem 2.5rem",minWidth:Ee?.style?.minWidth,maxWidth:Ee?.style?.maxWidth,fontSize:"1.2rem",fontWeight:"500",color:f.palette.primary.notifyTextColor,background:f.palette.primary.notifyBackground,border:`0.1rem solid ${f.palette.primary.notifyBorderColor}`,borderRadius:"0rem",pointerEvents:"none",position:"absolute",top:"0",left:"0",zIndex:"-1",textAlign:"center",boxSizing:"border-box",boxShadow:"0 1px 4px rgba(0, 0, 0, 0.2)"}),document.body.appendChild(me);const{offsetWidth:je,offsetHeight:qe}=me;ne.dataTransfer.setDragImage(me,je/2,qe/2),requestAnimationFrame(()=>{document.body.removeChild(me)})},F=(ne,ie)=>{ne.preventDefault(),$(ie),ye(ne)},J=async(ne,ie)=>{if(ne.preventDefault(),clearInterval(z),A===null||A===ie)return;const Ee=[...h],[pe]=Ee.splice(A,1);Ee.splice(ie,0,pe);const me=h[A].sequenceId,je=h[ie].sequenceId,qe=Ee.map(Ze=>Ze.key===h[A].key?{...Ze,sequenceId:je}:Ze.key===h[ie].key?{...Ze,sequenceId:me}:Ze);k({updatedColumns:qe}),P(null),$(null)},B=()=>{P(null),$(null)},fe=(ne,ie,Ee,pe)=>{if(!ne)return null;const me=ne?.isMandatory&&ne?.isSticky,je=parseFloat(ne?.style?.minWidth?.toString().replace("rem",""))||7.5;ie===0&&(_.current=0);const qe=me?ie===0?0:`${_.current}rem`:void 0;me&&(_.current+=je);const Ze=A===ie,Me=N==ie||h?.[N]?.isMandatory,Ct=nt=>{ne.isMandatory?(nt.preventDefault(),nt.dataTransfer.dropEffect="none"):(nt.preventDefault(),nt.dataTransfer.dropEffect="move"),F?.(nt,ie)},Je=nt=>{ne.isMandatory||J?.(nt,ie)};return pe&&`${pe?.key}${ne?.key}${ie}`,p.jsx(Mo,{rowSpan:ne?.children?1:2,colSpan:ne?.children?.filter(nt=>!nt?.isHidden)?.length,style:ne?.style,draggable:Ee&&!ne?.isMandatory,onDragStart:Ee&&!ne?.isMandatory?nt=>le(nt,ie):nt=>{nt.preventDefault()},onDragOver:Ee&&!ne?.isMandatory?Ct:void 0,onDrop:Ee&&!ne?.isMandatory?Je:void 0,onDragEnd:Ee&&!ne?.isMandatory?B:void 0,sx:{...ne?.isSticky&&{boxShadow:"rgba(17, 17, 26, 0.3) 4px 0px 6px -2px"},...ne.isCenterTable&&{borderRight:"0.1rem solid",borderBottom:"0.1rem solid",borderTop:"none",...ne?.key==="volume_value"&&{borderLeft:"1px solid"}},...Ze&&{border:`0.1rem solid ${f.palette.brandColor.lightBlue}!important`},...me&&{position:"sticky",left:qe,zIndex:3},cursor:Me?"not-allowed":Ee&&!ne?.isMandatory?"grab":"default"},children:p.jsx(ip,{parent:pe,column:ne,sort:t,handleMenuClick:y,isManageable:Ee})},ie)},se=x.useCallback((ne,ie,Ee,pe)=>{if(!ne)return null;const me=ne?.isMandatory&&ne?.isSticky,je=parseFloat(ne?.style?.minWidth?.toString().replace("rem",""))||7.5;Ee===0&&(_.current=0);const qe=me?Ee===0?0:`${_.current}rem`:void 0;return me&&(_.current+=je),p.jsxs(Mo,{colSpan:1,style:ne?.style,className:`${ne?.label}`,sx:{position:"relative",...ne.isCenterTable&&{borderRight:"0.1rem solid",borderBottom:"0.1rem solid",borderTop:"none",...ne?.key==="volume_value"&&{borderLeft:"1px solid"}},...ne?.isSticky&&{boxShadow:"rgba(17, 17, 26, 0.3) 4px 0px 6px -2px"},...me&&{position:"sticky",left:qe,zIndex:2,backgroundColor:Ze=>e?.selectedRow&&e?.selectedRow?.fhi===ie?.fhi||ie?.isHigh?Ze.palette.primary.appBackground:Ze.palette.primary.notifyBackground}},children:[(e?.selectedRow&&e?.selectedRow?.fhi===ie?.fhi||ie?.isHigh)&&p.jsx(oe,{sx:{position:"absolute",bottom:0,left:0,width:"100%",height:"0.08rem",background:"linear-gradient(#F9B16E, #F68080)",pointerEvents:"none",zIndex:1}}),p.jsx(xc,{isRenderCellContent:!!ne?.cellRenderer,column:ne,row:ie,parent:pe})]},Ee)},[e?.selectedRow,f]),te=(ne,ie,Ee,pe)=>p.jsx(p.Fragment,{children:ne&&Ee&&!ne?.isMandatory?p.jsx(oe,{resizeStart:()=>{ne?.isMandatory&&!ne?.isResizable||(R.current=!0)},resizeEnd:me=>{ne?.isMandatory&&!ne?.isResizable||me<=20||(R.current=!1,k2({index:ie,visibleGridColumns:h,width:me,columnUpdaterFunction:k}))},component:ne?.children||ne?.isMandatory?is:O2,rowSpan:ne?.children?1:2,colSpan:1,id:ie,sx:{width:"1rem",maxWidth:"1rem",minWidth:"1rem",padding:0,position:"relative",borderBottom:`0.1rem solid ${f.palette.primary.notifyBorderColor}`,cursor:"col-resize","&::after":{content:'""',position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"0.15rem",height:"1.5rem",backgroundColor:f.palette.primary.notifyBorderColor,zIndex:1},...!ne?.isMandatory&&{"&:hover::after":{content:'""',position:"absolute",top:0,left:"50%",transform:"translateX(-50%)",width:"0.2rem",height:`${X}px`,backgroundColor:f.palette.primary.notifyBorderColor,zIndex:1}}}}):null}),Ce=x.useCallback((ne,ie,Ee,pe,me,je,qe)=>p.jsx(p.Fragment,{children:ie&&pe&&!ie?.isMandatory?p.jsx(is,{className:"column_resizer_body",sx:{width:"1rem",maxWidth:"1rem",minWidth:"1rem",padding:0,position:"relative",borderBottom:`0.1rem solid ${f.palette.primary.notifyBorderColor}`},children:(e?.selectedRow&&e?.selectedRow?.fhi===ne?.fhi||ne?.isHigh)&&p.jsx(oe,{sx:{position:"absolute",bottom:0,left:0,width:"100%",height:"0.08rem",background:"linear-gradient(#F9B16E, #F68080)",pointerEvents:"none"}})},`resize-${Ee}_${qe}`):null}),[e?.selectedRow,f]),ye=ne=>{const ie=T.current,{left:Ee,right:pe}=ie.getBoundingClientRect(),me=50,je=ne.clientX>pe-me?1:ne.clientX<Ee+me?-1:0;je!==0?(U.current&&clearInterval(U.current),U.current=setInterval(()=>{ie.scrollLeft+=je*10},50)):U.current&&(clearInterval(U.current),U.current=null)},ke=ne=>ne?.map((ie,Ee)=>{const pe=L.start+Ee,me=ie[q],je=G?.[me],qe=e?.selectedRow&&e?.selectedRow?.fhi===ie?.fhi,Ze=ie?.isHigh;return p.jsxs(x.Fragment,{children:[p.jsx(M2,{row:ie,isSelected:qe,isHigh:Ze,onRowClick:e?.onRowClick,children:h.map((Me,Ct)=>Me?.isHidden||Me?.isVisible===!1?null:Me?.children?Me.children.map((Je,nt)=>Je?.isHidden?null:p.jsxs(x.Fragment,{children:[se(Je,ie,nt,Me),C&&Ce(ie,Je,nt,w,Me,"",pe)]},`col-${Ct}-${nt}`)):p.jsxs(x.Fragment,{children:[se(Me,ie,Ct),C&&Ce(ie,Me,Ct,w,"","",pe)]},`col-${Ct}`))}),W&&je&&p.jsx(P2,{nestedData:je,nestedColumn:Y,t:u})]},`row-${pe}`)}),ve=()=>{const ne=O.current;if(!ne)return;const ie=ne.scrollTop,Ee=ne.clientHeight,pe=Math.floor(ie/M)-j,me=Math.ceil(Ee/M)+2*j,je=Math.max(0,Math.min(D-1,pe)),qe=Math.max(je,Math.min(D,je+me));E(Ze=>Ze.start===je&&Ze.end===qe?Ze:{start:je,end:qe})};x.useEffect(()=>{let ne;const ie=()=>{ne&&cancelAnimationFrame(ne),ne=requestAnimationFrame(()=>{ve()})},Ee=O.current;if(!(!Ee||!d))return ve(),Ee.addEventListener("scroll",ie),()=>{cancelAnimationFrame(ne),Ee.removeEventListener("scroll",ie)}},[D]);const We=L.start*M,Oe=(D-L.end)*M,he=d?n?.slice(L.start,L.end):n;return S?p.jsxs(p.Fragment,{children:[p.jsx(eu,{ref:O,sx:{willChange:"transform",WebkitTransform:"translateZ(0)",maxHeight:"40rem",whiteSpace:"nowrap",overflow:"auto",width:"100%",border:`0.1rem solid ${f.palette.primary.notifyBorderColor}`,borderRadius:"1.4rem",position:"relative"},children:p.jsxs(Zd,{ref:T,stickyHeader:!0,"aria-label":"sticky table",sx:{backgroundColor:ne=>ne.palette.primary.notifyBackground},children:[p.jsxs(tu,{children:[p.jsx(eo,{sx:{position:"sticky",top:0,zIndex:3,backgroundColor:ne=>ne.palette.primary.notifyBackground},children:h.map((ne,ie)=>ne?.isHidden||ne?.isVisible===!1?null:p.jsxs(x.Fragment,{children:[fe(ne,ie,w),te(ne,ie,w)]},ie))}),p.jsx(eo,{draggable:!1,sx:{position:"sticky",top:"2.5rem",backgroundColor:f.palette.primary.notifyBackground,zIndex:2},children:h.flatMap((ne,ie)=>ne?.isHidden||!ne?.children||ne?.isVisible===!1?[]:ne.children.map((Ee,pe)=>Ee?.isHidden?null:p.jsxs(x.Fragment,{children:[fe(Ee,pe,w,ne),C&&te(Ee,pe,w)]},`${ie}-${pe}`)))})]}),p.jsxs(Jd,{children:[d&&p.jsx("tr",{style:{height:We}}),ke(he),d&&p.jsx("tr",{style:{height:Oe}})]})]})}),r&&p.jsx(bc,{pagination:r,gridPath:l,baseUrl:a,t:u}),p.jsx(sp,{menuOpen:m?.isOpen,handleClose:b,onHideClick:v})]}):p.jsx(Nr,{sx:{textAlign:"center"},children:u(yr.NRF)})}D2.propTypes={sort:i.object,data:i.array,pagination:i.object,columns:i.object,nested:i.object};function A2(e){return yv(e?.style?.width??e?.style?.minWidth??e?.style?.maxWidth)||0}const R2=e=>e?.isHidden||e?.isVisible===!1;function Z8(e){const t=x.useMemo(()=>{let o=0;return e.flatMap((s,a)=>{if(R2(s))return[];if(Array.isArray(s.children)&&s.children.length){const d=s.children.filter(u=>!R2(u));return d.length?d.map(u=>{const f=A2(u),h={...u,_parent:s,_originalIndex:a,width:f,start:o,end:o+f,isSticky:!!(u?.isSticky??s?.isSticky)};return o+=f,h}):[]}const l=A2(s);if(l===0)return[];const c={...s,_parent:null,_originalIndex:a,width:l,start:o,end:o+l,isSticky:!!s?.isSticky};return o+=l,c})},[e]),n=x.useMemo(()=>{let o=0;const s={};return t.forEach(a=>{a.isSticky&&(s[a.sequenceId]=o,o+=a.width)}),s},[t]);return{columnsMeta:t,stickyOffsets:n,getStickyLeft:o=>{if(!o?.isMandatory||!o?.isSticky)return;const s=n[o.sequenceId];return s===0?0:`${s}px`}}}function J8({visibleGridColumns:e,columnUpdaterFunction:t,isResizingRef:n,startAutoScroll:r,stopAutoScroll:o}){const s=gt(),[a,l]=x.useState(null),[c,d]=x.useState(null),u=x.useCallback((b,v)=>{if(n.current){b.preventDefault();return}l(v),b.dataTransfer.setData("colIndex",v);const k=e[v],w=document.createElement("div");w.textContent=k?.label,Object.assign(w.style,{display:"flex",alignItems:"center",justifyContent:"center",padding:"1.5rem 2.5rem",minWidth:k?.style?.minWidth,maxWidth:k?.style?.maxWidth,fontSize:"1.2rem",fontWeight:"500",color:s.palette.primary.notifyTextColor,background:s.palette.primary.notifyBackground,border:`0.1rem solid ${s.palette.primary.notifyBorderColor}`,borderRadius:"0rem",pointerEvents:"none",position:"absolute",top:"0",left:"0",zIndex:"-1",textAlign:"center",boxSizing:"border-box",boxShadow:"0 1px 4px rgba(0, 0, 0, 0.2)"}),document.body.appendChild(w);const{offsetWidth:C,offsetHeight:S}=w;b.dataTransfer.setDragImage(w,C/2,S/2),requestAnimationFrame(()=>document.body.removeChild(w))},[n,e,s]),f=x.useCallback((b,v)=>{if(b.preventDefault(),e?.[v]?.isMandatory){b.dataTransfer.dropEffect="none";return}b.dataTransfer.dropEffect="move",d(v),r(b.clientX)},[r,e]),h=x.useCallback(async(b,v)=>{if(b.preventDefault(),o(),a===null||a===v||e?.[v]?.isMandatory)return;const k=[...e],[w]=k.splice(a,1);k.splice(v,0,w);const C=[...e].sort((T,O)=>T.sequenceId-O.sequenceId).map(T=>T.sequenceId),S=k.map((T,O)=>({...T,sequenceId:C[O]??T.sequenceId}));t({updatedColumns:S}),l(null),d(null)},[a,e,t,o]),g=x.useCallback(()=>{o(),l(null),d(null)},[o]),m=b=>!b?.isMandatory,y=x.useCallback(b=>c===null||a===null?!1:!!(e?.[b]?.isMandatory||e?.[c]?.isMandatory),[c,a,e]);return{draggedColIndex:a,dragOverIndex:c,handleDragStart:u,handleDragOver:f,handleDrop:h,handleDragEnd:g,isDraggable:m,isInvalidDrop:y}}const N2=50,Q8=10,eL=50;function tL(e){const t=x.useRef(null),n=x.useCallback(()=>{t.current&&(clearInterval(t.current),t.current=null)},[]);return{startAutoScroll:x.useCallback(o=>{const s=e.current;if(!s)return;const{left:a,right:l}=s.getBoundingClientRect(),c=o>l-N2?1:o<a+N2?-1:0;if(c===0){n();return}t.current||(t.current=setInterval(()=>{s.scrollLeft+=c*Q8},eL))},[e,n]),stopAutoScroll:n}}const ap=x.memo(function({column:t,index:n,isManageable:r,parent:o,stickyLeft:s,colSpanOverride:a,draggedColIndex:l,isInvalidDrop:c,onDragStart:d,onDragOver:u,onDrop:f,onDragEnd:h,sort:g,handleMenuClick:m}){const y=gt(),b=l===n,v=r&&!t?.isMandatory,k=t?.isMandatory&&t?.isSticky,w=o&&o.children?.find(T=>!T?.isHidden&&T?.isVisible!==!1)?.key===t?.key,C=!o&&Array.isArray(t?.children)&&t.children.some(T=>!T?.isHidden&&T?.isVisible!==!1),S=a??t.children?.filter(T=>!T?.isHidden)?.length;return p.jsx(Mo,{rowSpan:t?.children?1:2,colSpan:S,style:t?.style,draggable:v,onDragStart:v?T=>d(T,n):T=>T.preventDefault(),onDragOver:v?T=>u(T,n):void 0,onDrop:v?T=>f(T,n):void 0,onDragEnd:v?h:void 0,sx:{...t?.isSticky&&{boxShadow:"rgba(17, 17, 26, 0.3) 4px 0px 6px -2px"},...t.isCenterTable&&{borderRight:"0.1rem solid",borderBottom:"0.1rem solid",borderTop:"none",...(w||C)&&{borderLeft:"0.1rem solid"}},...b&&{border:`0.1rem solid ${y.palette.brandColor.lightBlue}!important`},...k&&{position:"sticky",left:s,zIndex:3},cursor:c(n)?"not-allowed":v?"grab":"default"},children:p.jsx(ip,{parent:o,column:t,sort:g,handleMenuClick:m,isManageable:r})},n)}),lp=x.memo(function({column:t,index:n,isManageable:r,tableHeight:o,onResizeStart:s,onResizeEnd:a}){const l=gt();return!t||!r||t?.isMandatory?null:p.jsx(oe,{component:t?.children||t?.isMandatory?is:O2,rowSpan:t?.children?1:2,colSpan:1,id:n,resizeStart:s,resizeEnd:a,sx:{width:"1rem",maxWidth:"1rem",minWidth:"1rem",padding:0,position:"relative",borderBottom:`0.1rem solid ${l.palette.primary.notifyBorderColor}`,cursor:"col-resize","&::after":{content:'""',position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"0.15rem",height:"1.5rem",backgroundColor:l.palette.primary.notifyBorderColor,zIndex:1},"&:hover::after":{content:'""',position:"absolute",top:0,left:"50%",transform:"translateX(-50%)",width:"0.2rem",height:`${o}px`,backgroundColor:l.palette.primary.notifyBorderColor,zIndex:1}}})}),nL=x.memo(function({stickyGridColumns:t,virtualisedColumns:n,isManageable:r,isResizable:o,tableHeight:s,sort:a,handleMenuClick:l,getStickyLeft:c,offsetX:d,draggedColIndex:u,isInvalidDrop:f,onDragStart:h,onDragOver:g,onDrop:m,onDragEnd:y,isResizingRef:b,columnUpdaterFunction:v,visibleGridColumns:k}){const w=gt(),C={draggedColIndex:u,isInvalidDrop:f,onDragStart:h,onDragOver:g,onDrop:m,onDragEnd:y},S=(O,M)=>({onResizeStart:()=>{O?.isMandatory&&!O?.isResizable||(b.current=!0)},onResizeEnd:j=>{O?.isMandatory&&!O?.isResizable||j<=20||(b.current=!1,k2({index:M,visibleGridColumns:k,width:j,columnUpdaterFunction:v}))}}),T=x.useMemo(()=>{const O=[];return n.forEach(M=>{const j=M._parent?.key??M.key,D=O[O.length-1];D&&D.key===j?D.colSpan+=1:O.push({key:j,column:M._parent??M,colSpan:1,firstChild:M})}),O},[n]);return p.jsxs(tu,{children:[p.jsxs(eo,{sx:{position:"sticky",top:0,zIndex:3,backgroundColor:w.palette.primary.notifyBackground},children:[t.map((O,M)=>{const j=O._parent??O;return p.jsxs(x.Fragment,{children:[p.jsx(ap,{column:j,index:O._originalIndex,isManageable:r,stickyLeft:c(O),sort:a,handleMenuClick:l,...C}),o&&p.jsx(lp,{column:j,index:O._originalIndex,isManageable:r,tableHeight:s,...S(j,O._originalIndex)})]},`sticky-p-${M}`)}),p.jsx("th",{style:{minWidth:d,width:d,padding:0,border:"none"}}),T.map((O,M)=>p.jsxs(x.Fragment,{children:[p.jsx(ap,{column:O.column,index:O.firstChild._originalIndex,colSpanOverride:O.colSpan,isManageable:r,stickyLeft:c(O.firstChild),sort:a,handleMenuClick:l,...C}),o&&p.jsx(lp,{column:O.column,index:O.firstChild._originalIndex,isManageable:r,tableHeight:s,...S(O.column,O.firstChild._originalIndex)})]},`parent-${O.key}`))]}),p.jsxs(eo,{draggable:!1,sx:{position:"sticky",top:"2.5rem",backgroundColor:w.palette.primary.notifyBackground,zIndex:2},children:[p.jsx("th",{style:{minWidth:d,width:d,padding:0,border:"none"}}),n?.map((O,M)=>O._parent&&p.jsxs(x.Fragment,{children:[p.jsx(ap,{column:O,index:O._originalIndex,isManageable:r,parent:O._parent,stickyLeft:c(O),sort:a,handleMenuClick:l,...C}),o&&p.jsx(lp,{column:O,index:O._originalIndex,isManageable:r,tableHeight:s,...S(O,O._originalIndex)})]},`child-${O?._parent?.key??O.key}-${M}`))]})]})}),rL=()=>p.jsx(oe,{sx:{position:"absolute",bottom:0,left:0,width:"100%",height:"0.08rem",background:"linear-gradient(#F9B16E, #F68080)",pointerEvents:"none",zIndex:1}}),$2=x.memo(function({column:t,row:n,cellKey:r,parent:o,stickyLeft:s,isSelected:a,isHigh:l}){const c=gt(),d=t?.isMandatory&&t?.isSticky,u=a||l,f=o&&o.children?.find(h=>!h?.isHidden&&h?.isVisible!==!1)?.key===t?.key;return p.jsxs(Mo,{colSpan:1,style:t?.style,className:`${t?.label}`,sx:{position:"relative",...t.isCenterTable&&{borderRight:"0.1rem solid",borderBottom:"0.1rem solid",borderTop:"none",...f&&{borderLeft:"0.1rem solid"}},...t?.isSticky&&{boxShadow:"rgba(17, 17, 26, 0.3) 4px 0px 6px -2px"},...d&&{position:"sticky",left:s,zIndex:2,backgroundColor:u?c.palette.primary.appBackground:c.palette.primary.notifyBackground}},children:[u&&p.jsx(rL,{}),p.jsx(xc,{isRenderCellContent:!!t?.cellRenderer,column:t,row:n,parent:o})]},r)});function oL({actualIndex:e,extraHeight:t,measureRow:n,resetRow:r}){return useEffect(()=>(n(e,t),()=>r(e)),[e,t]),null}const sL=x.memo(function({visibleRows:t,stickyGridColumns:n,virtualisedColumns:r,isResizable:o,isManageable:s,topSpacerHeight:a,bottomSpacerHeight:l,selectedRow:c,isNested:d,nestedRow:u,nestedColumn:f,hashKey:h,getStickyLeft:g,offsetX:m,rightSpacerWidth:y,rowStart:b,defaultRowHeight:v,measureRow:k,resetRow:w,t:C}){const S=gt(),T=x.useCallback((O,M,j)=>{if(!O||!s||O?.isMandatory)return null;const D=c&&c?.fhi===M?.fhi||M?.isHigh;return p.jsx(is,{className:"column_resizer_body",sx:{width:"1rem",maxWidth:"1rem",minWidth:"1rem",padding:0,position:"relative",borderBottom:`0.1rem solid ${S.palette.primary.notifyBorderColor}`},children:D&&p.jsx("div",{style:{position:"absolute",bottom:0,left:0,width:"100%",height:"0.08rem",background:"linear-gradient(#F9B16E, #F68080)",pointerEvents:"none"}})},`resize-${j}`)},[s,c,S]);return p.jsxs(Jd,{children:[p.jsx("tr",{style:{height:a}}),t?.map((O,M)=>{const j=b+M,D=c&&c?.fhi===O?.fhi,L=O?.isHigh,E=u?.[O[h]];return p.jsxs(x.Fragment,{children:[p.jsxs(M2,{row:O,isSelected:D,isHigh:L,sxProps:{height:"3.5rem","& td, & th":{height:"3.5rem"}},children:[n.map((A,P)=>p.jsxs(x.Fragment,{children:[p.jsx($2,{column:A,row:O,cellKey:P,parent:A._parent,stickyLeft:g(A),isSelected:D,isHigh:L}),o&&T(A,O,`sticky-${P}-${j}`)]},`sticky-${A.sequenceId??P}`)),p.jsx("td",{style:{minWidth:m,width:m,padding:0,border:"none"}}),r.map((A,P)=>p.jsxs(x.Fragment,{children:[p.jsx($2,{column:A,row:O,cellKey:P,parent:A._parent,stickyLeft:g(A),isSelected:D,isHigh:L}),o&&T(A,O,`${P}-${j}`)]},`col-${A?._parent?.key??A.key}-${P}`))]}),d&&E&&p.jsxs(p.Fragment,{children:[p.jsx(oL,{actualIndex:j,extraHeight:E.length*v,measureRow:k,resetRow:w}),p.jsx(P2,{nestedData:E,nestedColumn:f,t:C})]})]},`row-${j}`)}),p.jsx("tr",{style:{height:l}})]})});function iL({rowCount:e,defaultRowHeight:t,scrollTop:n,containerRef:r,overscan:o=5}){const s=x.useRef(0),[a,l]=x.useState(()=>yv("40rem"));x.useEffect(()=>{const g=r?.current;if(!g)return;const m=g.clientHeight;m&&m!==s.current&&(s.current=m,l(m));const y=new ResizeObserver(b=>{const v=b[0].contentRect;v.height!==s.current&&(s.current=v.height,l(v.height))});return y.observe(g),()=>y.disconnect()},[]);const[c,d]=x.useState({}),u=(g,m)=>{d(y=>y[g]===m?y:{...y,[g]:m})},f=g=>{d(m=>{if(!(g in m))return m;const y={...m};return delete y[g],y})},h=x.useMemo(()=>{const g=new Array(e+1);g[0]=0;for(let m=0;m<e;m++)g[m+1]=g[m]+(c[m]??t);return g},[c,e,t]);return x.useMemo(()=>{const g=h[e],m=n+a;let y=0,b=e-1,v=0;for(;y<=b;){const w=y+b>>1;h[w+1]>n?(v=w,b=w-1):y=w+1}v=Math.max(0,v-o),y=v,b=e-1;let k=e;for(;y<=b;){const w=y+b>>1;h[w]>=m?(k=w,b=w-1):y=w+1}return k=Math.min(e,k+o),{startIndex:v,endIndex:k,topSpacerHeight:h[v],bottomSpacerHeight:g-h[k],totalHeight:g,measureRow:u,resetRow:f}},[h,e,a,n,o])}function aL({columnWidths:e,scrollLeft:t,overscan:n=2}){const r=x.useRef(0),[o,s]=x.useState(0),a=x.useRef(null),l=x.useCallback(f=>{if(a.current?.disconnect(),!f)return;const h=f.clientWidth;h&&(r.current=h,s(h)),a.current=new ResizeObserver(g=>{const m=g[0].contentRect;m.width!==r.current&&(r.current=m.width,s(m.width))}),a.current.observe(f)},[]),c=x.useMemo(()=>e.map(f=>{const h=Number(f);return Number.isFinite(h)&&h>0?h:0}),[e]),d=x.useMemo(()=>{const f=new Array(c.length+1);f[0]=0;for(let h=0;h<c.length;h++)f[h+1]=f[h]+c[h];return f},[c]);return{...x.useMemo(()=>{const f=t+o,h=d[c.length];let g=0,m=c.length-1,y=c.length;for(;g<=m;){const v=g+m>>1;d[v+1]>t?(y=v,m=v-1):g=v+1}y=Math.max(0,y-n),g=y,m=c.length-1;let b=c.length;for(;g<=m;){const v=g+m>>1;d[v]>=f?(b=v,m=v-1):g=v+1}return b=Math.min(c.length,b+n),{startIndex:y,endIndex:b,offsetX:d[y]||0,rightSpacerWidth:h-d[b],viewportWidth:o}},[c,d,o,t,n]),measuredRef:l}}const L2=45;function lL({rows:e,sort:t,data:n,pagination:r,columns:o,nested:s,baseUrl:a,gridPath:l,childUniqueKey:c,isVirtualizedTable:d=!1,t:u}){const f=gt(),{visibleGridColumns:h}=x.useContext(Xi),g=x.useContext(bs),{selectedColumn:m,handleMenuClick:y,handleClose:b,handleHideClick:v,columnUpdaterFunction:k}=j2(h,g,a,l,r?.rowPerPage,c),w=o?.isManageable,C=o?.isResizable,S=x.useRef(null),T=x.useRef(null),O=x.useRef(!1),M=x.useRef(0),j=x.useRef(0),D=x.useRef(!1),L=x.useRef(n),[,E]=x.useState({}),{getStickyLeft:A,columnsMeta:P}=Z8(h),{startAutoScroll:N,stopAutoScroll:$}=tL(S),{draggedColIndex:V,isInvalidDrop:H,handleDragStart:z,handleDragOver:_,handleDrop:R,handleDragEnd:U}=J8({visibleGridColumns:h,columnUpdaterFunction:k,isResizingRef:O,startAutoScroll:N,stopAutoScroll:$});L.current!==n&&(L.current=n,M.current=0,j.current=0,T.current&&(T.current.scrollTop=0,T.current.scrollLeft=0));const Y=pe=>{const me=pe.currentTarget.scrollTop,je=pe.currentTarget.scrollLeft;D.current||(D.current=!0,requestAnimationFrame(()=>{M.current=me,j.current=je,E({}),D.current=!1}))},W=x.useMemo(()=>P.filter(pe=>pe.isSticky&&!pe.isCenterTable),[P]),G=x.useMemo(()=>P.filter(pe=>pe.isSticky&&pe.isCenterTable||!pe.isSticky),[P]),q=x.useMemo(()=>G.map(pe=>pe.width),[G]),{startIndex:X,endIndex:ae,topSpacerHeight:le,bottomSpacerHeight:F,measureRow:J,resetRow:B}=iL({rowCount:n.length,defaultRowHeight:L2,scrollTop:M.current,containerRef:T,overscan:15}),{startIndex:fe,endIndex:se,offsetX:te,measuredRef:Ce}=aL({columnWidths:q,scrollLeft:j.current,overscan:2}),ye=x.useMemo(()=>G.slice(fe,se),[G,fe,se]),ke=n?.slice(X,ae),[ve,We]=x.useState(0);x.useEffect(()=>{const pe=S.current;if(!pe)return;const me=new ResizeObserver(()=>We(pe.offsetHeight));return me.observe(pe),()=>me.disconnect()},[]);const Oe=S2(s?.column?.definitions||[]),he=s?.isNested,ne=s?.data||[],ie=s?.hashKey,Ee=x.useCallback(pe=>{T.current=pe,Ce(pe)},[Ce]);return n?.length?p.jsxs(p.Fragment,{children:[p.jsx(eu,{ref:Ee,onScroll:Y,sx:{willChange:"transform",WebkitTransform:"translateZ(0)",maxHeight:"40rem",whiteSpace:"nowrap",overflow:"auto",width:"100%",border:`0.1rem solid ${f.palette.primary.notifyBorderColor}`,borderRadius:"1.4rem",position:"relative"},children:p.jsxs(Zd,{ref:S,stickyHeader:!0,"aria-label":"sticky table",sx:{backgroundColor:f.palette.primary.notifyBackground},children:[p.jsx(nL,{offsetX:te,stickyGridColumns:W,virtualisedColumns:ye,isManageable:w,isResizable:C,tableHeight:ve,sort:t,handleMenuClick:y,getStickyLeft:A,draggedColIndex:V,isInvalidDrop:H,onDragStart:z,onDragOver:_,onDrop:R,onDragEnd:U,isResizingRef:O,visibleGridColumns:h,columnUpdaterFunction:k}),p.jsx(sL,{offsetX:te,rowStart:X,defaultRowHeight:L2,measureRow:J,resetRow:B,visibleRows:ke,stickyGridColumns:W,virtualisedColumns:ye,isResizable:C,isManageable:w,topSpacerHeight:le,bottomSpacerHeight:F,selectedRow:e?.selectedRow,isNested:he,nestedRow:ne,nestedColumn:Oe,hashKey:ie,getStickyLeft:A,t:u})]})}),r&&p.jsx(bc,{pagination:r,gridPath:l,baseUrl:a,t:u}),p.jsx(sp,{menuOpen:m?.isOpen,handleClose:b,onHideClick:v})]}):p.jsx(Nr,{sx:{textAlign:"center"},children:u(yr.NRF)})}function B2({tableProps:e,isDefaultConfig:t,gridPath:n,baseUrl:r,childUniqueKey:o}){const{columns:s}=e,a=x.useContext(bs),{t:l}=x.useContext(sn),c=!!e?.isVirtualizedTable,d=M8({columns:s,gridPath:n,baseUrl:r,isDefaultConfig:t,childUniqueKey:o,pageSize:e?.pagination?.rowPerPage,data:e?.data});return x.useEffect(()=>{d?.length&&e?.data?.length&&a?.({type:Fe.SET_GRID_DATA,payload:{visibleGridColumns:d}})},[d,e?.data]),p.jsx(p.Fragment,{children:c?p.jsx(lL,{...e,gridPath:n,baseUrl:r,childUniqueKey:o,t:l}):p.jsx(D2,{...e,gridPath:n,baseUrl:r,childUniqueKey:o,t:l})})}B2.propTypes={tableProps:i.object.isRequired,mergedColumns:i.array.isRequired};function cp({tableProps:e,toolbarProps:t,isDefaultConfig:n,isLoading:r}){const o=e.columns?.isManageable;return p.jsx(bv,{children:r?p.jsxs(p.Fragment,{children:[t&&p.jsx(tc,{type:"toolbar"}),e&&p.jsx(tc,{type:"grid"})]}):p.jsxs(oe,{sx:{position:"sticky"},children:[t&&p.jsx(rp,{...t,isManageable:o,pageSize:e?.pagination?.rowPerPage,gridData:e?.data}),p.jsx(B2,{tableProps:e,isDefaultConfig:n,gridPath:t?.gridPath||"",baseUrl:t?.baseUrl||"",childUniqueKey:t?.childUniqueKey||""})]})})}cp.propTypes={tableProps:i.object.isRequired,toolbarProps:i.object,isDefaultConfig:i.bool};const{TENANT_ID:dp,BU_ID:up}=v2,{TENANT_IDS:fp,BU_IDS:pp}=w2,cL=async e=>{try{const t=localStorage.getItem("i18nextLng"),n=`${e}${mc.NOTIFICATION}/v1?${dp}=${fp}&${up}=${pp}&lang=${t}`;return await kt.get(n,ca)}catch(t){return t}},_2=async(e,t,n)=>{try{const r=localStorage.getItem("i18nextLng"),o=`${e}${mc.NOTIFICATION}${Qf.VERSION}?${dp}=${fp}&${up}=${pp}&lang=${r}`;return await kt.put(o,t,ca)}catch(r){return r}},dL=async({baseUrl:e,id:t,snopId:n})=>{try{const r=localStorage.getItem("i18nextLng"),o=`${e}${mc.NOTIFICATION}${Qf.VERSION}?${dp}=${fp}&${up}=${pp}&id=${t}&lang=${r}`;return await kt.get(o,ca)}catch(r){return r}},Ds={OK:200,CREATED:201,NO_CONTENT:204,BAD_REQUEST:400,UNAUTHORIZED:401,NOT_FOUND:404,INTERNAL_SERVER_ERROR:500},F2=({baseUrl:e})=>{const t=x.useContext(g1),[n,r]=x.useState(!1),[o,s]=x.useState(!1),[a,l]=x.useState(!1),[c,d]=x.useState({}),[u,f]=x.useState(null),[h,g]=x.useState(1),m=x.useRef(!1),{loading:y,data:b,isMarkAllAsRead:v,mode:k,activeTab:w}=x.useContext(_f),[C,S]=x.useState([]);x.useEffect(()=>{S(b)},[b]);const T=x.useCallback(async()=>{if(!(m.current||!e))try{t({type:Fe.LOADING,loading:!0}),t({type:Fe.SUCCESS,data:[]});const A=await cL(e);if(A.status===Ds.UNAUTHORIZED){m.current=!0;return}if(A.status===Ds.OK){const P=A.data?.responseData?.response||[],N=Jl(P);t({type:Fe.SET_MODE,mode:!1}),t({type:Fe.SUCCESS,data:Jl(N)}),t({type:Fe.MARK_ALL_AS_READ,isMarkAllAsRead:{count:gv(P),boo:gv(P)>0}}),t({type:Fe.LOADING,loading:!1})}}catch(A){A?.response?.status===Ds.UNAUTHORIZED&&(m.current=!0),t({type:Fe.ERROR,error:yr.SWR}),t({type:Fe.LOADING,loading:!1})}},[e,t]),O=A=>{const P=(b||[]).filter(N=>k?!N.isRead:!0);return{0:P,1:P.filter(N=>N?.type==="INFO"),2:P.filter(N=>N?.type==="ERROR")}};x.useEffect(()=>{T();const A=setInterval(T,3e5);return()=>clearInterval(A)},[T]);const M=async(A,P)=>{if(!(!A||!e)){f(A);try{const N=await dL({baseUrl:e,id:A,snopId:P});if(N.status===Ds.OK){const $=N.data?.responseData?.response||{};d($||{}),l(!0)}else throw new Error}catch{t({type:Fe.ERROR,error:yr.SWR})}finally{f(null)}}},j=async(A,P)=>{if(!(!A.length||!e)){t({type:Fe.LOADING,loading:!0});try{if((await _2(e,A,P)).status===Ds.OK){const $=b.map(H=>A.includes(H.id)?{...H,isRead:!0}:H),V=$.filter(H=>!H.isRead).length;V===0&&t({type:Fe.SET_MODE,mode:!1}),t({type:Fe.SUCCESS,data:Jl($)}),t({type:Fe.MARK_ALL_AS_READ,isMarkAllAsRead:{count:V,boo:V>0}}),setTimeout(()=>{t({type:Fe.LOADING,loading:!1})},200)}}catch{t({type:Fe.ERROR,error:yr.SWR}),t({type:Fe.LOADING,loading:!1})}}},D=async()=>{if(e){t({type:Fe.LOADING,loading:!0});try{const A=M6(b);if((await _2(e,A,f8.MARK_ALL_READ)).status===Ds.OK){const N=b.map($=>({...$,isRead:!0}));t({type:Fe.SET_MODE,mode:!1}),t({type:Fe.SUCCESS,data:Jl(N)}),t({type:Fe.MARK_ALL_AS_READ,isMarkAllAsRead:{count:0,boo:!1}}),setTimeout(()=>{t({type:Fe.LOADING,loading:!1})},200)}}catch{t({type:Fe.ERROR,error:yr.SWR}),t({type:Fe.LOADING,loading:!1})}}},L=(A,P)=>{t({type:Fe.LOADING,loading:!0}),t({type:Fe.SET_ACTIVE_TAB,activeTab:P}),setTimeout(()=>{t({type:Fe.LOADING,loading:!1})},400)},E=()=>{t({type:Fe.LOADING,loading:!0});const A=k?b||[]:(C||[]).filter(P=>!P.isRead);t({type:Fe.SET_MODE,mode:!k}),S(A),g(1),setTimeout(()=>{t({type:Fe.LOADING,loading:!1})},400)};return{fetchNotification:T,showDetailsProps:{open:a,handleClose:()=>l(!1),setOpen:l,data:c,clickId:u},alertDialogProps:{open:n,handleClose:()=>r(!1),onRefresh:T,handleRead:j,handleMarkAllAsRead:D,setOpen:r,handleShowDetails:M,clickId:u,isMainDialog:!0},activeTab:w,loading:y,tabData:O()[w],data:C,mode:k,handleTabChange:L,toggleAlertMode:E,page:h,setPage:g,isMarkAllAsRead:v}};var W2,z2,V2;function hp(){return hp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hp.apply(null,arguments)}var uL=function(t){return I.createElement("svg",hp({xmlns:"http://www.w3.org/2000/svg",width:16,height:17,fill:"none"},t),W2||(W2=I.createElement("path",{stroke:"#909090",strokeLinecap:"round",strokeMiterlimit:10,d:"M8.013 2.19c-2.206 0-4 1.793-4 4v1.927c0 .406-.173 1.026-.38 1.373l-.766 1.273c-.474.787-.147 1.66.72 1.954 2.873.96 5.973.96 8.846 0a1.335 1.335 0 0 0 .72-1.954l-.766-1.273c-.2-.347-.374-.967-.374-1.373V6.19c0-2.2-1.8-4-4-4Z"})),z2||(z2=I.createElement("path",{stroke:"#909090",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10,d:"M9.247 2.383a4.503 4.503 0 0 0-2.467 0 1.324 1.324 0 0 1 2.467 0"})),V2||(V2=I.createElement("path",{stroke:"#909090",strokeMiterlimit:10,d:"M10.013 12.957c0 1.1-.9 2-2 2a2.007 2.007 0 0 1-2-2"})))};const fL=({count:e})=>(gt(),p.jsxs(p.Fragment,{children:[p.jsx(oe,{sx:{gap:"0.5rem",display:"flex",justifyContent:"center",alignItems:"center","& svg":{transform:"scale(1)"}},children:p.jsx(uL,{style:{scale:1.2}})}),p.jsx(W8,{badgeContent:e!=0?"":null,color:"error"})]}));var H2;function mp(){return mp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mp.apply(null,arguments)}var pL=function(t){return I.createElement("svg",mp({xmlns:"http://www.w3.org/2000/svg",width:14,height:9,fill:"none",viewBox:"0 0 13 9"},t),H2||(H2=I.createElement("path",{fill:"#A8A8A8",fillRule:"evenodd",d:"M8.954 1.004a.406.406 0 0 1 0 .575L3.537 6.996a.406.406 0 0 1-.574 0L.796 4.829a.406.406 0 1 1 .575-.575l1.879 1.88 5.13-5.13a.406.406 0 0 1 .574 0m3.25 0a.406.406 0 0 1 0 .575L6.787 6.996a.406.406 0 1 1-.574-.575l5.416-5.417a.406.406 0 0 1 .575 0",clipRule:"evenodd"})))},U2,Y2;function gp(){return gp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gp.apply(null,arguments)}var hL=function(t){return I.createElement("svg",gp({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,fill:"none"},t),U2||(U2=I.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",d:"M7.79 6c0 .99-.8 1.79-1.79 1.79S4.21 6.99 4.21 6 5.01 4.21 6 4.21s1.79.8 1.79 1.79"})),Y2||(Y2=I.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",d:"M6 10.135c1.765 0 3.41-1.04 4.555-2.84.45-.705.45-1.89 0-2.595C9.41 2.9 7.765 1.86 6 1.86S2.59 2.9 1.445 4.7c-.45.705-.45 1.89 0 2.595 1.145 1.8 2.79 2.84 4.555 2.84"})))},q2;function yp(){return yp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yp.apply(null,arguments)}var mL=function(t){return I.createElement("svg",yp({xmlns:"http://www.w3.org/2000/svg",width:9,height:8,fill:"none"},t),q2||(q2=I.createElement("path",{fill:"#fff",fillRule:"evenodd",d:"M8.277 1.004a.406.406 0 0 1 0 .575L2.86 6.996a.406.406 0 0 1-.574 0L.119 4.829a.406.406 0 1 1 .575-.575l1.879 1.88 5.13-5.13a.406.406 0 0 1 .574 0",clipRule:"evenodd"})))};const G2=({type:e,item:t,handleShowDetails:n,handleRead:r,handleCTAClicked:o,clickId:s,t:a})=>{const l=gt(),c=JSON.parse(localStorage.getItem("settings"))?.platform?.theme;return p.jsxs(oe,{className:"cards",sx:{pt:" 0.8rem"},children:[p.jsx(Ye,{display:"flex",flexDirection:"row",alignItems:"start",justifyContent:"space-between",gap:1,children:p.jsx(Ad,{sx:{width:"calc(100% - 2%)","& .MuiBadge-badge":{backgroundColor:"#6041EA",height:"0.5rem",minWidth:"0.5rem"}},variant:"dot",invisible:t?.isRead,children:p.jsx(Nr,{sx:{color:l.palette.primary.notifyActiveText,whiteSpace:"normal",wordBreak:"break-word"},component:"p",className:["title-card",t?.isRead&&"read"].join(" "),children:a(t?.message)})})}),p.jsx(Ye,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",children:p.jsxs(Ye,{display:"flex",flexDirection:"row",justifyContent:"start",gap:1,sx:{p:"0.5rem 0"},children:[t?.isNotificationDetails&&p.jsx(vc,{icon:p.jsx(hL,{className:`${c==="light"?"chip-icon-light":"chip-icon-dark"}`}),disabled:s,onClick:n,label:s===t?.id?p.jsx(Go,{color:"primary",size:13}):a("SHOW_DETAILS"),component:"button",variant:"filled",clickable:!0,size:"small",sx:{backgroundColor:l.palette.brandColor.orange,color:l.palette.brandColor.white}}),!t?.isRead&&p.jsx(vc,{icon:p.jsx(mL,{className:`${c==="light"?"chip-icon-light":"chip-icon-dark"}`}),disabled:s,onClick:r,label:a("ACKNOWLEDGE"),component:"button",variant:"outlined",clickable:!0,size:"small"}),t?.primaryCTAURL&&p.jsx(vc,{disabled:t?.isPrimaryCTAClicked,onClick:()=>o({redirect:t?.isPrimaryCTARedirect,isClicked:t?.isPrimaryCTAClicked,url:t?.primaryCTAURL}),label:a(t?.primaryCTALabel),component:"button",variant:"outlined",clickable:!0,size:"small"}),t?.secondaryCTAURL&&p.jsx(vc,{disabled:t?.isSecondaryCTAClicked,onClick:()=>o({redirect:t?.isSecondaryCTARedirect,isClicked:t?.isSecondaryCTAClicked,url:t?.secondaryCTAURL}),label:a(t?.secondaryCTALabel),component:"button",variant:"outlined",clickable:!0,size:"small"})]})}),p.jsxs(Ye,{display:"flex",flexDirection:"row",alignItems:"center",gap:.35,children:[p.jsx(Nr,{sx:{fontSize:"0.8rem"},children:a(t?.product)}),p.jsx(Nr,{color:l.palette.primary.notifyTextColor,children:"•"}),p.jsx(Nr,{sx:{fontSize:"0.8rem"},children:O6(t?.createdAt,a)})]})]})};G2.propTypes={type:i.string,title:i.string,subTitle:i.string,isRead:i.bool,handleShowDetails:i.func,handleRead:i.func};const wc=60,K2=2,X2=({data:e,handleRead:t,handleShowDetails:n,clickId:r,mode:o,t:s})=>{const{isMarkAllAsRead:a}=x.useContext(_f),l=x.useRef(null),[c,d]=x.useState({start:0,end:4}),u=e?.length,f=new Date,h=new Intl.DateTimeFormat("en-US",{day:"numeric",month:"long",year:"numeric"}).format(f),g=x.useMemo(()=>o?a?.count?e?.filter(C=>!C.isRead):[]:e||[],[e,o,a]),m=g.slice(c.start,c.end),y=c.start*wc,b=(u-c.end)*wc,v=()=>{const C=l.current;if(!C)return;const S=C.scrollTop,T=C.clientHeight,O=Math.floor(S/wc)-K2,M=Math.ceil(T/wc)+2*K2,j=Math.max(0,Math.min(u-1,O)),D=Math.max(j,Math.min(u,j+M));d(L=>L.start===j&&L.end===D?L:{start:j,end:D})},k=({url:C})=>{window.open(C,"_blank")},w=x.useMemo(()=>I6(m),[m]);return x.useEffect(()=>{let C;const S=()=>{C&&cancelAnimationFrame(C),C=requestAnimationFrame(()=>{v()})},T=l.current;if(T)return v(),T.addEventListener("scroll",S),()=>{cancelAnimationFrame(C),T.removeEventListener("scroll",S)}},[u]),g.length||s("CONTAINER_MESSAGE"),p.jsxs(oe,{ref:l,sx:{height:"100%",overflowY:"auto"},children:[p.jsx(oe,{style:{height:y}}),Object.entries(w).map(([C,S])=>{const T=localStorage.getItem("i18nextLng"),O=new Date(C),M=new Intl.DateTimeFormat(T,{month:"long"}).format(O),j=O.getDate(),D=O.getFullYear(),L=`${M} ${j}, ${D}`;return p.jsxs(x.Fragment,{children:[C!==h&&p.jsx(F8,{children:L}),S.map((E,A)=>p.jsx(G2,{item:E,handleCTAClicked:k,handleShowDetails:()=>n(E.id,E.snopId),handleRead:()=>t([E.id],E.snopId),clickId:r,t:s},`${E.id}_${A}`))]},C)}),p.jsx(oe,{style:{height:b}})]})};X2.propTypes={data:i.array,handleRead:i.func,handleShowDetails:i.func};const gL=({onRefresh:e,handleShowDetails:t,clickId:n,handleRead:r,handleMarkAllAsRead:o,t:s})=>{const{loading:a,activeTab:l,data:c,tabData:d,mode:u,page:f,setPage:h,handleTabChange:g,toggleAlertMode:m}=F2({});return p.jsxs(p.Fragment,{children:[p.jsxs(oe,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:2,pt:2},children:[p.jsx(ft,{variant:"h2",sx:{fontSize:"1.2rem",color:y=>y.palette.primary.notifyTextColor},children:s("NOTIFICATION")}),p.jsx(oe,{onClick:e,children:p.jsx(Vt,{url:Ge.Refresh,alt:"refresh",sx:{cursor:"pointer"}})})]}),p.jsx(oe,{sx:{borderBottom:1,m:"1.2rem 1.2rem 0 1.2rem",borderColor:y=>y.palette.primary.notifyBorderColor},children:p.jsxs(z8,{value:l,onChange:g,children:[p.jsx(op,{label:p.jsx(oe,{sx:{display:"flex",alignItems:"center",fontSize:"1rem",fontWeight:"500"},children:p.jsx(ft,{component:"span",sx:{fontWeight:500,fontSize:"1rem"},children:s("ALL",{count:c?.filter(y=>!y?.isRead)?.length||0})})})}),p.jsx(op,{label:p.jsx(oe,{sx:{display:"flex",alignItems:"center",fontSize:"1rem",fontWeight:"500"},children:p.jsx(ft,{component:"span",sx:{fontWeight:500,fontSize:"1rem"},children:s("INFO",{count:c?.filter(y=>y?.type==="INFO"&&!y?.isRead)?.length||0})})}),sx:{color:y=>y.palette.brandColor.blue}}),p.jsx(op,{label:p.jsx(oe,{sx:{display:"flex",alignItems:"center",fontSize:"1rem",fontWeight:"500"},children:s("ERROR",{count:c?.filter(y=>y?.type==="ERROR"&&!y?.isRead)?.length||0})}),sx:{color:y=>y.palette.brandColor.red}})]})}),p.jsx(Wd,{dividers:!0,sx:{p:0,...a&&!d.length&&{alignItems:"center",justifyContent:"center"},flexGrow:1,overflowY:"auto",mx:"1.2rem",borderColor:y=>y.palette.primary.notifyBorderColor},tabIndex:-1,children:a&&!d.length?p.jsx(oe,{sx:{height:300,display:"flex",justifyContent:"center",alignItems:"center"},children:p.jsx(Go,{size:30,sx:{color:y=>y.palette.primary.notifyIconColor}})}):p.jsx(p.Fragment,{children:p.jsx(X2,{data:d,handleShowDetails:t,handleRead:r,clickId:n,page:f,setPage:h,mode:u,t:s})})}),p.jsxs(Fd,{sx:{justifyContent:"space-between",px:"1.2rem"},children:[p.jsxs(Ye,{direction:"row",gap:1,children:[p.jsx(Nr,{sx:{fontSize:"1rem"},children:s("SHOW_UNREAD")}),p.jsx(_8,{disabled:a,checked:u,onChange:m})]}),p.jsx(xl,{variant:"outlined",className:"view-all",onClick:o,startIcon:p.jsx(pL,{}),disabled:!c?.filter(y=>!y?.isRead)?.length,style:{backgroundColor:"transparent"},sx:{fontSize:"1rem",fontWeight:"300",p:0,border:"none",textTransform:"none",color:y=>y.palette.primary.notifyTextColor,"&:hover":{color:y=>y.palette.primary.notifyActiveText,background:"transparent",boxShadow:"none",border:"none"},"&.Mui-disabled":{opacity:.5,color:y=>`${y.palette.primary.notifyActiveText}!important`,background:"transparent",boxShadow:"none",border:"none"}},children:s("READ_ALL")})]})]})},yL=({data:e,handleClose:t,t:n})=>{const[r,o]=x.useState(1),[s,a]=x.useState(10),[l,c]=x.useState(e?.notificationDetails?.length||0),[d,u]=x.useState("sku_name"),[f,h]=x.useState("asc"),[g,m]=x.useState([]),[y,b]=x.useState("");return x.useEffect(()=>{if((y||d)&&e?.notificationDetails?.length){const v=P6(e?.notificationDetails,d8,y);if(d){const k=j6(v,d,f);m(Cf(k,r,s)),c(k?.length||0);return}m(Cf(v,r,s)),c(v?.length||0);return}m(Cf(e?.notificationDetails,r,s)),c(e?.notificationDetails?.length)},[y,e,r,s,f,d]),p.jsxs(p.Fragment,{children:[p.jsxs(Ye,{direction:"row",justifyContent:"space-between",sx:{padding:"1.5rem 2rem",borderBottom:"0.1rem solid",borderColor:v=>v.palette.primary.notifyBorderColor},children:[p.jsx(ft,{component:"h2",sx:{fontSize:"1.4rem",color:v=>v.palette.primary.notifyActiveText},children:n(e?.message)||e?.message}),p.jsx(oe,{onClick:t,sx:{cursor:"pointer"},children:p.jsx(Vt,{url:Ge.CloseCircle})})]}),p.jsx(Wd,{children:p.jsx(cp,{t:n,tableProps:{data:g,columns:{...j8({t:n}),isManageable:!1},sort:{sortField:d,sortDir:f,onSort:v=>{const k=v?.column?.key;h(w=>d===k&&w==="asc"?"desc":"asc"),u(k)}},pagination:{selectedPage:r,rowPerPage:s,totalRecords:l,onPageChange:v=>{o(v)},onPageSizeChange:v=>{a(v?.value),o(1)}}},toolbarProps:{defaultTools:{search:{isRequired:!0,onChange:v=>{const k=v.target.value;k&&o(1),b(k)},placeholder:`${n("SEARCH")}...`}}}})}),p.jsx(Fd,{sx:{padding:"1.5rem 2rem"}})]})},bL=({baseUrl:e,t})=>{const{alertDialogProps:n,showDetailsProps:r,fetchNotification:o,isMarkAllAsRead:s}=F2({baseUrl:e});return p.jsxs(p.Fragment,{children:[p.jsx(oe,{sx:{display:"flex",justifyContent:"center",cursor:"pointer",marginTop:"0.6rem"},onClick:()=>{o(),n?.setOpen?.(!0)},children:p.jsx(fL,{count:s.count})}),p.jsx(Ff,{...n,children:p.jsx(gL,{...n,t})}),p.jsx(Ff,{...r,children:p.jsx(yL,{...r,t})})]})},vL=({baseUrl:e,t})=>p.jsx(Yt,{children:p.jsx(y1,{children:p.jsx(bL,{baseUrl:e,t})})}),Z2=x.createContext(null),xL=Z2.Provider,wL=()=>{const e=x.useContext(Z2);return e||console.warn("useAnalytics used outside AnalyticsProvider"),e};at.Accordion=v1,at.AnalyticsProvider=xL,at.Breadcrumb=nN,at.Button=jr,at.Checkbox=gr,at.DatePicker=F9,at.Dialog=eN,at.Grid=cp,at.GridTable=G8,at.Header=S1,at.InputField=mv,at.Loader=X9,at.Notification=vL,at.Select=vv,at.SkeletonLoader=Z9,at.SliderLayout=x1,at.Switch=wv,at.TextField=Ki,at.TimePicker=W9,at.ToastProvider=G9,at.TranslationContext=sn,at.toast=H9,at.useAnalytics=wL,Object.defineProperty(at,Symbol.toStringTag,{value:"Module"})}));
|
|
257
257
|
//# sourceMappingURL=index.umd.js.map
|