@3sc/common-component 0.0.293 → 0.0.294

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.umd.js CHANGED
@@ -323,5 +323,5 @@ const theme2 = createTheme({ palette: {
323
323
  `)}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[D1]=this[D1]={accessors:{}}).accessors,o=this.prototype;function i(a){const l=wa(a);r[l]||(_V(o,a),r[l]=!0)}return te.isArray(t)?t.forEach(i):i(t),this}};gn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),te.reduceDescriptors(gn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),te.freezeMethods(gn);function Tp(e,t){const n=this||xa,r=t||n,o=gn.from(r.headers);let i=r.data;return te.forEach(e,function(l){i=l.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function I1(e){return!!(e&&e.__CANCEL__)}function Is(e,t,n){He.call(this,e??"canceled",He.ERR_CANCELED,t,n),this.name="CanceledError"}te.inherits(Is,He,{__CANCEL__:!0});function A1(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new He("Request failed with status code "+n.status,[He.ERR_BAD_REQUEST,He.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function FV(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function BV(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o=0,i=0,a;return t=t!==void 0?t:1e3,function(c){const u=Date.now(),d=r[i];a||(a=u),n[o]=c,r[o]=u;let f=i,p=0;for(;f!==o;)p+=n[f++],f=f%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),u-a<t)return;const h=d&&u-d;return h?Math.round(p*1e3/h):void 0}}function LV(e,t){let n=0,r=1e3/t,o,i;const a=(u,d=Date.now())=>{n=d,o=null,i&&(clearTimeout(i),i=null),e.apply(null,u)};return[(...u)=>{const d=Date.now(),f=d-n;f>=r?a(u,d):(o=u,i||(i=setTimeout(()=>{i=null,a(o)},r-f)))},()=>o&&a(o)]}const Rc=(e,t,n=3)=>{let r=0;const o=BV(50,250);return LV(i=>{const a=i.loaded,l=i.lengthComputable?i.total:void 0,c=a-r,u=o(c),d=a<=l;r=a;const f={loaded:a,total:l,progress:l?a/l:void 0,bytes:c,rate:u||void 0,estimated:u&&l&&d?(l-a)/u:void 0,event:i,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(f)},n)},j1=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},N1=e=>(...t)=>te.asap(()=>e(...t)),VV=en.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,en.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(en.origin),en.navigator&&/(msie|trident)/i.test(en.navigator.userAgent)):()=>!0,WV=en.hasStandardBrowserEnv?{write(e,t,n,r,o,i){const a=[e+"="+encodeURIComponent(t)];te.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),te.isString(r)&&a.push("path="+r),te.isString(o)&&a.push("domain="+o),i===!0&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function zV(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function UV(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function $1(e,t,n){let r=!zV(t);return e&&(r||n==!1)?UV(e,t):t}const _1=e=>e instanceof gn?{...e}:e;function So(e,t){t=t||{};const n={};function r(u,d,f,p){return te.isPlainObject(u)&&te.isPlainObject(d)?te.merge.call({caseless:p},u,d):te.isPlainObject(d)?te.merge({},d):te.isArray(d)?d.slice():d}function o(u,d,f,p){if(te.isUndefined(d)){if(!te.isUndefined(u))return r(void 0,u,f,p)}else return r(u,d,f,p)}function i(u,d){if(!te.isUndefined(d))return r(void 0,d)}function a(u,d){if(te.isUndefined(d)){if(!te.isUndefined(u))return r(void 0,u)}else return r(void 0,d)}function l(u,d,f){if(f in t)return r(u,d);if(f in e)return r(void 0,u)}const c={url:i,method:i,data:i,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:(u,d,f)=>o(_1(u),_1(d),f,!0)};return te.forEach(Object.keys(Object.assign({},e,t)),function(d){const f=c[d]||o,p=f(e[d],t[d],d);te.isUndefined(p)&&f!==l||(n[d]=p)}),n}const F1=e=>{const t=So({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:a,auth:l}=t;t.headers=a=gn.from(a),t.url=E1($1(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let c;if(te.isFormData(n)){if(en.hasStandardBrowserEnv||en.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((c=a.getContentType())!==!1){const[u,...d]=c?c.split(";").map(f=>f.trim()).filter(Boolean):[];a.setContentType([u||"multipart/form-data",...d].join("; "))}}if(en.hasStandardBrowserEnv&&(r&&te.isFunction(r)&&(r=r(t)),r||r!==!1&&VV(t.url))){const u=o&&i&&WV.read(i);u&&a.set(o,u)}return t},HV=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const o=F1(e);let i=o.data;const a=gn.from(o.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:u}=o,d,f,p,h,y;function m(){h&&h(),y&&y(),o.cancelToken&&o.cancelToken.unsubscribe(d),o.signal&&o.signal.removeEventListener("abort",d)}let b=new XMLHttpRequest;b.open(o.method.toUpperCase(),o.url,!0),b.timeout=o.timeout;function x(){if(!b)return;const C=gn.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),v={data:!l||l==="text"||l==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:C,config:e,request:b};A1(function(E){n(E),m()},function(E){r(E),m()},v),b=null}"onloadend"in b?b.onloadend=x:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)||setTimeout(x)},b.onabort=function(){b&&(r(new He("Request aborted",He.ECONNABORTED,e,b)),b=null)},b.onerror=function(){r(new He("Network Error",He.ERR_NETWORK,e,b)),b=null},b.ontimeout=function(){let O=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const v=o.transitional||M1;o.timeoutErrorMessage&&(O=o.timeoutErrorMessage),r(new He(O,v.clarifyTimeoutError?He.ETIMEDOUT:He.ECONNABORTED,e,b)),b=null},i===void 0&&a.setContentType(null),"setRequestHeader"in b&&te.forEach(a.toJSON(),function(O,v){b.setRequestHeader(v,O)}),te.isUndefined(o.withCredentials)||(b.withCredentials=!!o.withCredentials),l&&l!=="json"&&(b.responseType=o.responseType),u&&([p,y]=Rc(u,!0),b.addEventListener("progress",p)),c&&b.upload&&([f,h]=Rc(c),b.upload.addEventListener("progress",f),b.upload.addEventListener("loadend",h)),(o.cancelToken||o.signal)&&(d=C=>{b&&(r(!C||C.type?new Is(null,e,b):C),b.abort(),b=null)},o.cancelToken&&o.cancelToken.subscribe(d),o.signal&&(o.signal.aborted?d():o.signal.addEventListener("abort",d)));const w=FV(o.url);if(w&&en.protocols.indexOf(w)===-1){r(new He("Unsupported protocol "+w+":",He.ERR_BAD_REQUEST,e));return}b.send(i||null)})},qV=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,o;const i=function(u){if(!o){o=!0,l();const d=u instanceof Error?u:this.reason;r.abort(d instanceof He?d:new Is(d instanceof Error?d.message:d))}};let a=t&&setTimeout(()=>{a=null,i(new He(`timeout ${t} of ms exceeded`,He.ETIMEDOUT))},t);const l=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(i):u.removeEventListener("abort",i)}),e=null)};e.forEach(u=>u.addEventListener("abort",i));const{signal:c}=r;return c.unsubscribe=()=>te.asap(l),c}},YV=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},GV=async function*(e,t){for await(const n of KV(e))yield*YV(n,t)},KV=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()}},B1=(e,t,n,r)=>{const o=GV(e,t);let i=0,a,l=c=>{a||(a=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:u,value:d}=await o.next();if(u){l(),c.close();return}let f=d.byteLength;if(n){let p=i+=f;n(p)}c.enqueue(new Uint8Array(d))}catch(u){throw l(u),u}},cancel(c){return l(c),o.return()}},{highWaterMark:2})},Dc=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",L1=Dc&&typeof ReadableStream=="function",XV=Dc&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),V1=(e,...t)=>{try{return!!e(...t)}catch{return!1}},ZV=L1&&V1(()=>{let e=!1;const t=new Request(en.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),W1=64*1024,Op=L1&&V1(()=>te.isReadableStream(new Response("").body)),Ic={stream:Op&&(e=>e.body)};Dc&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Ic[t]&&(Ic[t]=te.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new He(`Response type '${t}' is not supported`,He.ERR_NOT_SUPPORT,r)})})})(new Response);const JV=async e=>{if(e==null)return 0;if(te.isBlob(e))return e.size;if(te.isSpecCompliantForm(e))return(await new Request(en.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(te.isArrayBufferView(e)||te.isArrayBuffer(e))return e.byteLength;if(te.isURLSearchParams(e)&&(e=e+""),te.isString(e))return(await XV(e)).byteLength},QV=async(e,t)=>{const n=te.toFiniteNumber(e.getContentLength());return n??JV(t)},kp={http:xV,xhr:HV,fetch:Dc&&(async e=>{let{url:t,method:n,data:r,signal:o,cancelToken:i,timeout:a,onDownloadProgress:l,onUploadProgress:c,responseType:u,headers:d,withCredentials:f="same-origin",fetchOptions:p}=F1(e);u=u?(u+"").toLowerCase():"text";let h=qV([o,i&&i.toAbortSignal()],a),y;const m=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let b;try{if(c&&ZV&&n!=="get"&&n!=="head"&&(b=await QV(d,r))!==0){let v=new Request(t,{method:"POST",body:r,duplex:"half"}),k;if(te.isFormData(r)&&(k=v.headers.get("content-type"))&&d.setContentType(k),v.body){const[E,M]=j1(b,Rc(N1(c)));r=B1(v.body,W1,E,M)}}te.isString(f)||(f=f?"include":"omit");const x="credentials"in Request.prototype;y=new Request(t,{...p,signal:h,method:n.toUpperCase(),headers:d.normalize().toJSON(),body:r,duplex:"half",credentials:x?f:void 0});let w=await fetch(y);const C=Op&&(u==="stream"||u==="response");if(Op&&(l||C&&m)){const v={};["status","statusText","headers"].forEach(D=>{v[D]=w[D]});const k=te.toFiniteNumber(w.headers.get("content-length")),[E,M]=l&&j1(k,Rc(N1(l),!0))||[];w=new Response(B1(w.body,W1,E,()=>{M&&M(),m&&m()}),v)}u=u||"text";let O=await Ic[te.findKey(Ic,u)||"text"](w,e);return!C&&m&&m(),await new Promise((v,k)=>{A1(v,k,{data:O,headers:gn.from(w.headers),status:w.status,statusText:w.statusText,config:e,request:y})})}catch(x){throw m&&m(),x&&x.name==="TypeError"&&/fetch/i.test(x.message)?Object.assign(new He("Network Error",He.ERR_NETWORK,e,y),{cause:x.cause||x}):He.from(x,x&&x.code,e,y)}})};te.forEach(kp,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const z1=e=>`- ${e}`,e7=e=>te.isFunction(e)||e===null||e===!1,U1={getAdapter:e=>{e=te.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let i=0;i<t;i++){n=e[i];let a;if(r=n,!e7(n)&&(r=kp[(a=String(n)).toLowerCase()],r===void 0))throw new He(`Unknown adapter '${a}'`);if(r)break;o[a||"#"+i]=r}if(!r){const i=Object.entries(o).map(([l,c])=>`adapter ${l} `+(c===!1?"is not supported by the environment":"is not available in the build"));let a=t?i.length>1?`since :
324
324
  `+i.map(z1).join(`
325
325
  `):" "+z1(i[0]):"as no adapter specified";throw new He("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r},adapters:kp};function Ep(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Is(null,e)}function H1(e){return Ep(e),e.headers=gn.from(e.headers),e.data=Tp.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),U1.getAdapter(e.adapter||xa.adapter)(e).then(function(r){return Ep(e),r.data=Tp.call(e,e.transformResponse,r),r.headers=gn.from(r.headers),r},function(r){return I1(r)||(Ep(e),r&&r.response&&(r.response.data=Tp.call(e,e.transformResponse,r.response),r.response.headers=gn.from(r.response.headers))),Promise.reject(r)})}const q1="1.8.4",Ac={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Ac[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Y1={};Ac.transitional=function(t,n,r){function o(i,a){return"[Axios v"+q1+"] Transitional option '"+i+"'"+a+(r?". "+r:"")}return(i,a,l)=>{if(t===!1)throw new He(o(a," has been removed"+(n?" in "+n:"")),He.ERR_DEPRECATED);return n&&!Y1[a]&&(Y1[a]=!0,console.warn(o(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,a,l):!0}},Ac.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function t7(e,t,n){if(typeof e!="object")throw new He("options must be an object",He.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],a=t[i];if(a){const l=e[i],c=l===void 0||a(l,i,e);if(c!==!0)throw new He("option "+i+" must be "+c,He.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new He("Unknown option "+i,He.ERR_BAD_OPTION)}}const jc={assertOptions:t7,validators:Ac},mr=jc.validators;let To=class{constructor(t){this.defaults=t,this.interceptors={request:new P1,response:new P1}}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 i=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
326
- `+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=So(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&jc.assertOptions(r,{silentJSONParsing:mr.transitional(mr.boolean),forcedJSONParsing:mr.transitional(mr.boolean),clarifyTimeoutError:mr.transitional(mr.boolean)},!1),o!=null&&(te.isFunction(o)?n.paramsSerializer={serialize:o}:jc.assertOptions(o,{encode:mr.function,serialize:mr.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),jc.assertOptions(n,{baseUrl:mr.spelling("baseURL"),withXsrfToken:mr.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&te.merge(i.common,i[n.method]);i&&te.forEach(["delete","get","head","post","put","patch","common"],y=>{delete i[y]}),n.headers=gn.concat(a,i);const l=[];let c=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(c=c&&m.synchronous,l.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let d,f=0,p;if(!c){const y=[H1.bind(this),void 0];for(y.unshift.apply(y,l),y.push.apply(y,u),p=y.length,d=Promise.resolve(n);f<p;)d=d.then(y[f++],y[f++]);return d}p=l.length;let h=n;for(f=0;f<p;){const y=l[f++],m=l[f++];try{h=y(h)}catch(b){m.call(this,b);break}}try{d=H1.call(this,h)}catch(y){return Promise.reject(y)}for(f=0,p=u.length;f<p;)d=d.then(u[f++],u[f++]);return d}getUri(t){t=So(this.defaults,t);const n=$1(t.baseURL,t.url,t.allowAbsoluteUrls);return E1(n,t.params,t.paramsSerializer)}};te.forEach(["delete","get","head","options"],function(t){To.prototype[t]=function(n,r){return this.request(So(r||{},{method:t,url:n,data:(r||{}).data}))}}),te.forEach(["post","put","patch"],function(t){function n(r){return function(i,a,l){return this.request(So(l||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))}}To.prototype[t]=n(),To.prototype[t+"Form"]=n(!0)});let n7=class Mw{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(o=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const a=new Promise(l=>{r.subscribe(l),i=l}).then(o);return a.cancel=function(){r.unsubscribe(i)},a},t(function(i,a,l){r.reason||(r.reason=new Is(i,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 Mw(function(o){t=o}),cancel:t}}};function r7(e){return function(n){return e.apply(null,n)}}function o7(e){return te.isObject(e)&&e.isAxiosError===!0}const Pp={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};Object.entries(Pp).forEach(([e,t])=>{Pp[t]=e});function G1(e){const t=new To(e),n=p1(To.prototype.request,t);return te.extend(n,To.prototype,t,{allOwnKeys:!0}),te.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return G1(So(e,o))},n}const St=G1(xa);St.Axios=To,St.CanceledError=Is,St.CancelToken=n7,St.isCancel=I1,St.VERSION=q1,St.toFormData=Pc,St.AxiosError=He,St.Cancel=St.CanceledError,St.all=function(t){return Promise.all(t)},St.spread=r7,St.isAxiosError=o7,St.mergeConfig=So,St.AxiosHeaders=gn,St.formToJSON=e=>R1(te.isHTMLForm(e)?new FormData(e):e),St.getAdapter=U1.getAdapter,St.HttpStatusCode=Pp,St.default=St;const{Axios:KW,AxiosError:XW,CanceledError:ZW,isCancel:JW,CancelToken:QW,VERSION:ez,all:tz,Cancel:nz,isAxiosError:rz,spread:oz,toFormData:sz,AxiosHeaders:iz,HttpStatusCode:az,formToJSON:lz,getAdapter:cz,mergeConfig:uz}=St,Mp={BASE_URL:"https://qa.3sc.ai/api",VERSION:"/v1"};/*! js-cookie v3.0.5 | MIT */function Nc(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 s7={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 Rp(e,t){function n(o,i,a){if(!(typeof document>"u")){a=Nc({},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(i,o)+l}}function r(o){if(!(typeof document>"u"||arguments.length&&!o)){for(var i=document.cookie?document.cookie.split("; "):[],a={},l=0;l<i.length;l++){var c=i[l].split("="),u=c.slice(1).join("=");try{var d=decodeURIComponent(c[0]);if(a[d]=e.read(u,d),o===d)break}catch{}}return o?a[o]:a}}return Object.create({set:n,get:r,remove:function(o,i){n(o,"",Nc({},i,{expires:-1}))},withAttributes:function(o){return Rp(this.converter,Nc({},this.attributes,o))},withConverter:function(o){return Rp(Nc({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var i7=Rp(s7,{path:"/"});const Rr={TOKEN:"token",USER:"user",SNOP:"snop",SELECTED_BU:"selected_business_unit",SETTINGS:"settings"},Dp={BEARER:"Bearer",TENANT_ID:"tenant_id",BU_ID:"bu_id",SNOP_ID:"snop_id"},a7=Object.values({"SKU Name":"sku_name",Node:"node","Channel Name":"channel_name"}),l7=[10,25,50,100],K1={MARK_ALL_READ:"MARK_ALL_READ"},c7=l7.map(e=>({label:e,value:e})),X1={PRIMARY:"PRIMARY",SECONDARY:"SECONDARY"},Ip=wc(Rr.SNOP),Ap=wc(Rr.SELECTED_BU),jp=wc(Rr.USER),u7=wc(Rr.SETTINGS),Ca={BU_IDS:Ap==null?void 0:Ap.business_unit_id,TOKEN:JSON.parse(i7.get(Rr.TOKEN)||null),TENANT_IDS:jp==null?void 0:jp.tenant_id,SNOP_IDS:Ip==null?void 0:Ip.snop_id,GRID_SETTINGS:u7},Sa={headers:{"Content-Type":"application/json",Authorization:`${Dp.BEARER} ${Ca.TOKEN}`}},Z1=St.create({baseURL:Mp.BASE_URL,axiosConfig:Sa});Z1.interceptors.request.use(function(e){return e},function(e){return Promise.reject(e)}),Z1.interceptors.response.use(function(e){return e},function(e){return Promise.reject(e)});const $c={NOTIFICATION:"/notifications",SETTING:"/configuration/setting"},{TENANT_ID:d7,BU_ID:f7}=Dp,{TENANT_IDS:p7,BU_IDS:h7}=Ca,_c=async({baseUrl:e,payload:t})=>{try{const n=`${e}${$c.SETTING}/v1?${d7}=${p7}&${f7}=${h7}`;return await St.post(n,t,Sa)}catch(n){return n}},m7=({columns:e,gridPath:t,baseUrl:n,isDefaultConfig:r,pageSize:o})=>{var m,b;let{definitions:i,defaultUserSettings:a,labels:l}=e;const c=t.split("/").filter(Boolean),u=JSON.parse(localStorage.getItem(Rr.SETTINGS));let d=c.reduce((x,w)=>x==null?void 0:x[w],u)||null;if(!r&&t){a=J1({definitions:i});const x=new Set((m=d==null?void 0:d.column)==null?void 0:m.map(C=>C.id)),w=a.filter(C=>!x.has(C.id));(!d||(w==null?void 0:w.length)>0)&&(console.log({_localSetting:u,grid_settings:d,missing:w,defaultUserSettings:a}),(async()=>{try{const O={...Ca.GRID_SETTINGS||{platform:{theme:"light"}}},v=(d==null?void 0:d.pageSize)??o;let k=O;for(let E=0;E<c.length;E++){const M=c[E];E===c.length-1?k[M]={columns:a,pageSize:v}:(k[M]={...k[M]||{}},k=k[M])}localStorage.setItem(Rr.SETTINGS,JSON.stringify(O)),await _c({baseUrl:n,payload:O})}catch(C){console.error(C)}})())}a=(d==null?void 0:d.columns)??a??J1({definitions:i});const f=a.reduce((x,w)=>(x[w.id]=w,x),{}),p=l.reduce((x,w)=>(x[w.id]=w,x),{}),h=[];for(const x of i){const w=f[x.id]||{},C=p[x.id]||{};let O={...x,...w,...C};if((b=x.children)!=null&&b.length){const v=w.children||[],k=C.children||[];O.children=x.children.map((E,M)=>({...E,...v[M],...k[M]}))}h.push(O)}return h.sort((x,w)=>x.sequenceId-w.sequenceId)},g7=e=>e.sort((t,n)=>t.sequenceId-n.sequenceId),J1=({definitions:e})=>e.map((t,n)=>({id:t.id,key:t.key,sequenceId:t.id,isHidden:!1,style:t.style||{}})),y7=()=>({definitions:[{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}],defaultUserSettings:[{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"}}],labels:[{id:1,key:"sku_name",label:"SKU",isLocalizable:!1},{id:2,key:"node",label:"Node",isLocalizable:!1},{id:3,key:"channel_name",label:"Channel",isLocalizable:!1}]});class Np extends R.Component{constructor(t){super(t),this.startDrag=this.startDrag.bind(this),this.endDrag=this.endDrag.bind(this),this.onMouseMove=this.onMouseMove.bind(this),this.dragging=!1,this.mouseX=0,this.startPos=0,this.startWidthPrev=0,this.lastDraggedWidth=0,this.draggedCol=null,this.resizeRef=R.createRef()}startDrag(){if(!this.props.disabled&&(this.draggedCol=this.props.id,this.props.resizeStart&&this.draggedCol===this.props.id&&this.props.resizeStart(),this.dragging=!0,this.startPos=this.mouseX,this.startWidthPrev=0,this.resizeRef.current)){let t=this.resizeRef.current.previousSibling;t&&(this.startWidthPrev=t.clientWidth)}}endDrag(){this.props.disabled||(this.dragging=!1,this.props.resizeEnd&&this.draggedCol===this.props.id&&this.props.resizeEnd(this.lastDraggedWidth),this.draggedCol=null)}onMouseMove(t){if(this.props.disabled||(this.mouseX=t.touches?t.touches[0].screenX:t.screenX,!this.dragging))return;const n=this.resizeRef.current,r=this.startPos-this.mouseX;let o=this.startWidthPrev-r;(!this.props.minWidth||o>=this.props.minWidth)&&(!this.props.maxWidth||o<=this.props.maxWidth)&&(n.previousSibling.style.width=o+"px",n.previousSibling.style.minWidth=o+"px",n.previousSibling.style.maxWidth=o+"px",n.previousSibling.style.setProperty("--column_resize_before_width",o+"px"),this.lastDraggedWidth=o)}componentDidMount(){const t=this.resizeRef.current;if(t&&(this.props.defaultWidth?(t.previousSibling.style.minWidth=this.props.defaultWidth+"px",t.previousSibling.style.width=this.props.defaultWidth+"px",t.previousSibling.style.maxWidth=this.props.defaultWidth+"px",t.previousSibling.style.setProperty("--column_resize_before_width",this.props.defaultWidth+"px")):this.props.minWidth&&(t.previousSibling.style.minWidth=this.props.minWidth+"px",t.previousSibling.style.width=this.props.minWidth+"px",t.previousSibling.style.maxWidth=this.props.minWidth+"px",t.previousSibling.style.setProperty("--column_resize_before_width",this.props.minWidth+"px"))),this.props.disabled){this.props.defaultWidth&&t&&(t.previousSibling.style.minWidth=this.props.defaultWidth+"px",t.previousSibling.style.width=this.props.defaultWidth+"px",t.previousSibling.style.maxWidth=this.props.defaultWidth+"px",t.previousSibling.style.setProperty("--column_resize_before_width",this.props.defaultWidth+"px")),this.props.maxWidth&&t&&(t.previousSibling.style.maxWidth=this.props.maxWidth+"px");return}this.addEventListenersToDocument()}componentWillUnmount(){this.props.disabled||this.removeEventListenersFromDocument()}componentDidUpdate(t,n){t.disabled&&!this.props.disabled&&this.addEventListenersToDocument(),!t.disabled&&this.props.disabled&&this.removeEventListenersFromDocument()}addEventListenersToDocument(){document.addEventListener("mousemove",this.onMouseMove),document.addEventListener("mouseup",this.endDrag),document.addEventListener("touchmove",this.onMouseMove),document.addEventListener("touchend",this.endDrag)}removeEventListenersFromDocument(){document.removeEventListener("mousemove",this.onMouseMove),document.removeEventListener("mouseup",this.endDrag),document.removeEventListener("touchmove",this.onMouseMove),document.removeEventListener("touchend",this.endDrag)}render(){var t={userSelect:"none"};return this.props.disabled||(t.cursor="ew-resize"),this.props.className===""&&(t.width="6px",t.backgroundColor="rgba(0, 0, 0, 0.1)"),R.createElement("th",{ref:this.resizeRef,style:t,disabled:this.props.disabled,rowSpan:this.props.rowSpan?this.props.rowSpan:1,colSpan:this.props.colSpan?this.props.colSpan:1,className:`column_resizer_own_class ${this.props.disabled?"disabled_column_resize":""} ${this.props.className}`,onMouseDown:this.props.disabled?null:this.startDrag,onTouchStart:this.props.disabled?null:this.startDrag})}}Np.defaultProps={disabled:!1,minWidth:0,className:""},Np.propTypes={disabled:"boolean",minWidth:"number",className:"string"};var Q1,ew;function $p(){return $p=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},$p.apply(null,arguments)}var b7=function(t){return S.createElement("svg",$p({xmlns:"http://www.w3.org/2000/svg",width:17,height:7,fill:"none"},t),Q1||(Q1=S.createElement("path",{fill:"#0582CA",d:"M4.652.5.676 3.493l3.976 2.981V4.051h8.354V2.859H4.652z"})),ew||(ew=S.createElement("path",{fill:"#0582CA",d:"M12.36.5v2.384H4.008v1.193h8.352v2.396l.956-.716 3.022-2.265z"})))};const v7=(e,t,n,r,o)=>{const[i,a]=R.useState({isOpen:!1,column:null}),l=(f,p,h)=>{a({isOpen:f.currentTarget,column:p,isChild:!!h})},c=()=>{a({isOpen:!1,column:null,isChild:!1})},u=async()=>{c();const f=e.map(p=>{var h,y;if(i!=null&&i.isChild&&Array.isArray(p.children)){const m=p.children.map(x=>{var w;return x.id===i.column.id&&x.key===((w=i.column)==null?void 0:w.key)?{...x,isHidden:!0}:x}),b=m.every(x=>x.isHidden);return{...p,isHidden:b?!0:p.isHidden,children:m}}return p.id===((h=i==null?void 0:i.column)==null?void 0:h.id)&&p.key===((y=i.column)==null?void 0:y.key)?{...p,isHidden:!0}:p});d({updatedColumns:f})},d=async({updatedColumns:f})=>{t({type:qe.SET_GRID_DATA,payload:{visibleGridColumns:f}});const p=r.split("/").filter(Boolean),m={...JSON.parse(localStorage.getItem(Rr.SETTINGS))||{platform:{theme:"light"}}},b=p.reduce((C,O)=>C==null?void 0:C[O],Ca.GRID_SETTINGS)||null,x=(b==null?void 0:b.pageSize)??o;let w=m;for(let C=0;C<p.length;C++){const O=p[C];C===p.length-1?w[O]={columns:f,pageSize:x}:(w[O]={...w[O]||{}},w=w[O])}localStorage.setItem(Rr.SETTINGS,JSON.stringify(m)),await _c({baseUrl:n,payload:m})};return{selectedColumn:i,handleMenuClick:l,handleClose:c,handleHideClick:u,columnUpdaterFunction:d}},tw=({pagination:e,gridPath:t,baseUrl:n})=>{const{selectedPage:r,rowPerPage:o,totalRecords:i,onPageChange:a,onPageSizeChange:l}=e,c=It(),u=async(d,f)=>{if(!f)return;const p=f.split("/").filter(Boolean),h="settings",m={...JSON.parse(localStorage.getItem(h))||{}};let b=m;for(let x=0;x<p.length;x++){const w=p[x];x===p.length-1?b[w]={...b[w]||{},pageSize:d}:(b[w]={...b[w]||{}},b=b[w])}localStorage.setItem(h,JSON.stringify(m)),await _c({baseUrl:n,payload:m})};return g.jsxs(ye,{sx:{display:"flex",p:"1rem 1.5rem"},children:[g.jsxs(ye,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"0.5rem",width:"100%"},children:[g.jsx(st,{sx:{fontSize:"1.1rem",color:c.palette.primary.notifyTextColor},children:`Showing ${Math.min(r*o,i)} of ${i} rows`}),g.jsx(ye,{sx:{"& .MuiInputBase-input":{padding:"0rem 0.8rem!important"},width:"6rem"},children:g.jsx(Sc,{options:c7,value:o,onChange:async d=>{l(d),u(d==null?void 0:d.value,t)}})})]}),g.jsx(Tg,{count:Math.ceil(i/o),page:r,onChange:async(d,f)=>{a(f)},siblingCount:0,shape:"rounded",sx:{width:"100%","& .MuiPagination-ul":{width:"100%",display:"flex",justifyContent:"flex-end","& li:first-of-type":{border:`0.1rem solid ${c.palette.primary.notifyBorderColor}`,color:c.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 ${c.palette.primary.notifyBorderColor}`,color:c.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:c.palette.primary.notifyActiveText,backgroundColor:`${c.palette.brandColor.paginationBc} !important`}}})]})};tw.propTypes={pagination:s.object.isRequired};function _p({isRenderCellContent:e,column:t,row:n,parent:r}){const o=n[t.key];return g.jsx(g.Fragment,{children:e?g.jsx(ye,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",textTransform:"none",fontSize:"1.1rem"},children:t==null?void 0:t.cellRenderer(n,{column:t,parent:r})}):g.jsx(Ag,{title:(o==null?void 0:o.length)>20?o:"",arrow:!0,children:g.jsx(ye,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",textTransform:"none",fontSize:"1.1rem"},id:t.key,component:"label",children:m8(o)})})})}_p.propTypes={isRenderCellContent:s.bool,column:s.object,row:s.object};const nw=({menuOpen:e,handleClose:t,onHideClick:n})=>{const r=It();return g.jsx(Si,{open:!!e,anchorEl:e,onClose:t,anchorOrigin:{vertical:"bottom",horizontal:"left"},children:g.jsx(ye,{sx:{backgroundColor:r.palette.primary.notifyBackground,border:`0.1rem solid ${r.palette.primary.notifyBorderColor}`,minHeight:"2.3rem",display:"flex",justifyContent:"center",alignItems:"center"},children:g.jsx(Hn,{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:"Hide Column"})})})};nw.propTypes={menuOpen:s.object,handleClose:s.func,onHideClick:s.func},G(kl)(({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 Oo=G(st)(({theme:e})=>({color:e.palette.primary.notifyTextColor,fontSize:"1.1rem"})),x7=G(jg)(({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)"})}})),w7=G(yi)(({theme:e})=>({color:e.palette.primary.notifyTextColor,padding:"0.6rem 0",fontSize:"0.9rem",fontWeight:500,"&::before, &::after":{borderColor:`${e.palette.primary.notifyBorderColor}!important`}})),C7=G(nd)(({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"}}));G(Fl)(({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 S7=G(Jg)(({theme:e})=>({minHeight:"2rem","& .MuiTabs-indicator":{height:"0.1rem",backgroundColor:e.palette.primary.notifyActiveText}})),Fp=G(Ng)(({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}})),Fc=G(Qu)(({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`}})),rw=({sortKey:e,sortField:t,sortDir:n,handleSortClick:r})=>{const o=i=>g.jsx(Ir,{onClick:r,sx:{padding:"0.5rem"},children:g.jsx(hn,{url:i})});return g.jsx(g.Fragment,{children:o(t===e?n==="asc"?Ke.AscSort:Ke.DescSort:Ke.Unsort)})};rw.propTypes={sortKey:s.string.isRequired,sortField:s.string,sortDir:s.string,handleSortClick:s.func};function ow({parent:e,column:t,sort:n,handleMenuClick:r,isManageable:o}){const i=t==null?void 0:t.isMandatory,a=t==null?void 0:t.label,l=t==null?void 0:t.isSortable,c=n==null?void 0:n.sortField,u=n==null?void 0:n.sortDir,d=n==null?void 0:n.onSort;return g.jsxs(ye,{sx:{display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.1rem",textAlign:"center",whiteSpace:"normal"},children:[a,g.jsxs(ye,{sx:{display:"flex",alignItems:"center"},children:[l&&g.jsx(rw,{sortKey:e?`${e==null?void 0:e.key}|${t==null?void 0:t.key}`:t==null?void 0:t.key,sortField:c,sortDir:u,handleSortClick:()=>d({column:t,sortDir:u,sortField:c,parent:e})}),o&&!i&&!e&&g.jsx(Ir,{onClick:f=>r(f,t,e),sx:{padding:"0.5rem 0.2rem"},children:g.jsx(hn,{url:Ke.Menu})})]})]})}ow.propTypes={column:s.object.isRequired,sort:s.object.isRequired,handleMenuClick:s.func,isManageable:s.bool};const T7=G($l)(({theme:e})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"table-cell",[`&.${vd.head}`]:{color:e.palette.primary.notifyTextColor,backgroundColor:e.palette.primary.notifyBackground,borderColor:e.palette.primary.notifyBorderColor,padding:"0.3rem 0.5rem",textAlign:"center"},[`&.${vd.body}`]:{color:e.palette.primary.notifyTextColor,borderColor:e.palette.primary.notifyBorderColor,padding:"0.3rem 0.5rem",textAlign:"center"}}));function Ta({children:e,...t}){return g.jsx(T7,{...t,children:e})}Ta.propTypes={children:s.node};const O7=G(Hg)(()=>({"&:last-child td":{borderBottom:0}}));function As({children:e,...t}){return g.jsx(O7,{...t,children:e})}As.propTypes={children:s.node};function sw({rows:e,sort:t,data:n,pagination:r,columns:o,nested:i,baseUrl:a,gridPath:l}){var ue;const c=It(),{visibleGridColumns:u}=R.useContext(ga),d=R.useContext(ya),{selectedColumn:f,handleMenuClick:p,handleClose:h,handleHideClick:y,columnUpdaterFunction:m}=v7(u,d,a,l,r==null?void 0:r.rowPerPage),b=o==null?void 0:o.isManageable,x=o==null?void 0:o.isResizable,w=(n==null?void 0:n.length)>0,C=R.useRef(null),[O,v]=R.useState(null),[k,E]=R.useState(null),[M,D]=R.useState(null);let A=null;const $=R.useRef(0),I=R.useRef(!1),V=R.useRef(null),F=g7(((ue=i==null?void 0:i.column)==null?void 0:ue.definitions)||[]),N=i==null?void 0:i.isNested,P=(i==null?void 0:i.data)||[],j=i==null?void 0:i.hashKey;if(R.useEffect(()=>{const _=C.current,q=_==null?void 0:_.querySelector("thead");if(!q)return;const X=()=>{D(null)};return q==null||q.addEventListener("mousedown",X),()=>{q==null||q.removeEventListener("mousedown",X)}},[]),!w)return g.jsx(Oo,{sx:{textAlign:"center"},children:Gr.NRF});const W=(_,q)=>{var oe,ce;if(I.current){_.preventDefault();return}v(q),D(null),_.dataTransfer.setData("colIndex",q);const X=u[q],Y=X==null?void 0:X.label,L=document.createElement("div");L.textContent=Y,Object.assign(L.style,{display:"flex",alignItems:"center",justifyContent:"center",padding:"1.5rem 2.5rem",minWidth:(oe=X==null?void 0:X.style)==null?void 0:oe.minWidth,maxWidth:(ce=X==null?void 0:X.style)==null?void 0:ce.maxWidth,fontSize:"1.2rem",fontWeight:"500",color:c.palette.primary.notifyTextColor,background:c.palette.primary.notifyBackground,border:`0.1rem solid ${c.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(L);const{offsetWidth:K,offsetHeight:ee}=L;_.dataTransfer.setDragImage(L,K/2,ee/2),requestAnimationFrame(()=>{document.body.removeChild(L)})},U=(_,q)=>{_.preventDefault(),E(q),Q(_)},B=async(_,q)=>{if(_.preventDefault(),clearInterval(A),O===null||O===q)return;const X=[...u],[Y]=X.splice(O,1);X.splice(q,0,Y);const L=u.slice().sort((ee,oe)=>ee.sequenceId-oe.sequenceId).map(ee=>ee.sequenceId),K=X.map((ee,oe)=>({...ee,sequenceId:L[oe]??ee.sequenceId}));m({updatedColumns:K}),v(null),E(null)},z=()=>{v(null),E(null)},Z=(_,q,X,Y)=>{var me,ge,$e,Ae,Me,ze,Xe;if(!_)return null;const L=(_==null?void 0:_.isMandatory)&&(_==null?void 0:_.isSticky),K=parseFloat((ge=(me=_==null?void 0:_.style)==null?void 0:me.minWidth)==null?void 0:ge.toString().replace("rem",""))||7.5;q===0&&($.current=0);const ee=L?q===0?0:`${$.current}rem`:void 0;L&&($.current+=K);const oe=O===q,ce=k==q||(($e=u==null?void 0:u[k])==null?void 0:$e.isMandatory),Ce=Fe=>{_.isMandatory?(Fe.preventDefault(),Fe.dataTransfer.dropEffect="none"):(Fe.preventDefault(),Fe.dataTransfer.dropEffect="move"),U==null||U(Fe,q)},ae=Fe=>{_.isMandatory||B==null||B(Fe,q)},we=Y?`${Y==null?void 0:Y.key}_${_==null?void 0:_.key}_${q}`:q;return g.jsx(Ta,{rowSpan:_!=null&&_.children?1:2,colSpan:x?((Me=(Ae=_==null?void 0:_.children)==null?void 0:Ae.filter(Fe=>!(Fe!=null&&Fe.isHidden)))==null?void 0:Me.length)*2-1:(Xe=(ze=_==null?void 0:_.children)==null?void 0:ze.filter(Fe=>!(Fe!=null&&Fe.isHidden)))==null?void 0:Xe.length,style:_==null?void 0:_.style,onMouseEnter:()=>{M!==we&&D(we)},draggable:X&&!Y&&!(_!=null&&_.isMandatory),onDragStart:X?Fe=>W(Fe,q):void 0,onDragOver:X?Ce:void 0,onDrop:X?ae:void 0,onDragEnd:X?z:void 0,sx:{...oe&&{border:`0.1rem solid ${c.palette.brandColor.lightBlue}!important`},...L&&{borderRadius:"0rem!important",position:"sticky",left:ee,zIndex:3},..._!=null&&_.children?{}:{borderLeft:Fe=>(_==null?void 0:_.key)==="volume_value"&&`0.1rem solid ${Fe.palette.primary.notifyBorderColor}`,borderRight:Fe=>(_==null?void 0:_.key)==="volume_value"&&`0.1rem solid ${Fe.palette.primary.notifyBorderColor}`},cursor:ce?"not-allowed":X&&!(_!=null&&_.isMandatory)?"grab":"default"},children:g.jsx(ow,{parent:Y,column:_,sort:t,handleMenuClick:p,isManageable:X})},q)},re=(_,q,X,Y)=>{var oe,ce,Ce;if(!_)return null;const L=(_==null?void 0:_.isMandatory)&&(_==null?void 0:_.isSticky),K=parseFloat((ce=(oe=_==null?void 0:_.style)==null?void 0:oe.minWidth)==null?void 0:ce.toString().replace("rem",""))||7.5;X===0&&($.current=0);const ee=L?X===0?0:`${$.current}rem`:void 0;return L&&($.current+=K),g.jsxs(Ta,{colSpan:1,style:_==null?void 0:_.style,className:`${_==null?void 0:_.label}`,sx:{position:"relative",...L&&{position:"sticky",left:ee,zIndex:2,backgroundColor:ae=>{var we;return e!=null&&e.selectedRow&&((we=e==null?void 0:e.selectedRow)==null?void 0:we.fhi)===(q==null?void 0:q.fhi)||q!=null&&q.isHigh?ae.palette.primary.appBackground:ae.palette.primary.notifyBackground}},...Y?{p:"0rem!important"}:{px:"0rem!important",borderLeft:ae=>(_==null?void 0:_.key)==="volume_value"&&`0.1rem solid ${ae.palette.primary.notifyBorderColor}`,borderRight:ae=>(_==null?void 0:_.key)==="volume_value"&&`0.1rem solid ${ae.palette.primary.notifyBorderColor}`}},children:[((e==null?void 0:e.selectedRow)&&((Ce=e==null?void 0:e.selectedRow)==null?void 0:Ce.fhi)===(q==null?void 0:q.fhi)||(q==null?void 0:q.isHigh))&&g.jsx(ye,{sx:{position:"absolute",bottom:0,left:0,width:"100%",height:"0.08rem",background:"linear-gradient(#F9B16E, #F68080)",pointerEvents:"none"}}),g.jsx(_p,{isRenderCellContent:!!(_!=null&&_.cellRenderer),column:_,row:q,parent:Y})]},X)},J=(_,q,X,Y)=>{var K;const L=Y?`${Y==null?void 0:Y.key}_${_==null?void 0:_.key}_${q}`:q;return(K=[...u].map((ee,oe)=>({col:ee,index:oe})).reverse().find(({col:ee})=>Array.isArray(ee.children)&&ee.children.length>0))==null||K.index,g.jsx(g.Fragment,{children:_&&!(_!=null&&_.isMandatory)&&X?g.jsx(ye,{resizeStart:()=>{I.current=!0},resizeEnd:()=>{I.current=!1},component:_!=null&&_.children?$l:Np,rowSpan:_!=null&&_.children?1:2,colSpan:1,id:q,sx:{width:"2rem",maxWidth:"2rem",minWidth:"2rem",padding:0,position:"relative",background:c.palette.primary.notifyBackground,borderBottom:`0.1rem solid ${c.palette.primary.notifyBorderColor}`,"&::after":{content:'""',position:"absolute",left:"50%",top:0,transform:"translateX(-50%)",width:"0.15rem",height:"calc(100% + 0.1rem)",backgroundColor:M===L&&!(_!=null&&_.children)?c.palette.brandColor.lightBlue:Y||_!=null&&_.children?c.palette.primary.notifyBorderColor:"transparent",transition:"background-color 0.2s ease",zIndex:1}},disabled:!X}):null})},ie=(_,q,X,Y,L,K)=>{var oe;const ee=K?`${K==null?void 0:K.key}_${q==null?void 0:q.key}_${X}`:X;return g.jsx(g.Fragment,{children:q&&!(q!=null&&q.isMandatory)&&Y?g.jsxs($l,{className:"column_resizer_body",sx:{padding:0,position:"relative",borderBottom:`0.1rem solid ${c.palette.primary.notifyBorderColor}`,"&::after":{content:'""',position:"absolute",left:"50%",top:0,transform:"translateX(-50%)",width:"0.15rem",height:"calc(100% + 0.1rem)",backgroundColor:M===ee?c.palette.brandColor.lightBlue:K||q!=null&&q.children?c.palette.primary.notifyBorderColor:"transparent",transition:"background-color 0.2s ease",zIndex:1}},children:[L===0&&M===ee&&g.jsx(ye,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:1,pointerEvents:"none"},children:g.jsx(b7,{})}),((e==null?void 0:e.selectedRow)&&((oe=e==null?void 0:e.selectedRow)==null?void 0:oe.fhi)===(_==null?void 0:_.fhi)||(_==null?void 0:_.isHigh))&&g.jsx(ye,{sx:{position:"absolute",bottom:0,left:0,width:"100%",height:"0.08rem",background:"linear-gradient(#F9B16E, #F68080)",pointerEvents:"none"}})]},`resize-${X}`):null})},Q=_=>{const q=C.current,{left:X,right:Y}=q.getBoundingClientRect(),L=50,K=_.clientX>Y-L?1:_.clientX<X+L?-1:0;K!==0?(V.current&&clearInterval(V.current),V.current=setInterval(()=>{q.scrollLeft+=K*10},50)):V.current&&(clearInterval(V.current),V.current=null)};return g.jsxs(g.Fragment,{children:[g.jsx(Lg,{sx:{maxHeight:"100%",whiteSpace:"nowrap",overflow:"auto",width:"100%",border:`0.1rem solid ${c.palette.primary.notifyBorderColor}`,borderRadius:"1.4rem"},children:g.jsxs(_g,{ref:C,"aria-label":"sticky table",sx:{backgroundColor:_=>_.palette.primary.notifyBackground},children:[g.jsxs(Wg,{children:[g.jsx(As,{children:u.map((_,q)=>_!=null&&_.isHidden?null:g.jsxs(R.Fragment,{children:[Z(_,q,b),x&&J(_,q,b)]},q))}),g.jsx(As,{children:u.flatMap((_,q)=>_!=null&&_.isHidden||!(_!=null&&_.children)?[]:_.children.map((X,Y)=>X!=null&&X.isHidden?null:g.jsxs(R.Fragment,{children:[Z(X,Y,b,_),x&&J(X,Y,b,_)]},`${q}-${Y}`)))})]}),g.jsx(Bg,{children:n.map((_,q)=>{const X=_[j],Y=P==null?void 0:P[X],L=(Y==null?void 0:Y.length)>0;return g.jsxs(R.Fragment,{children:[g.jsx(As,{sx:{backgroundColor:K=>{var ee;return e&&((ee=e==null?void 0:e.selectedRow)==null?void 0:ee.fhi)===(_==null?void 0:_.fhi)||_!=null&&_.isHigh?K.palette.primary.appBackground:K.palette.primary.notifyBackground}},onClick:()=>e==null?void 0:e.onRowClick(_),children:u.map((K,ee)=>K!=null&&K.isHidden?null:K!=null&&K.children?K.children.map((oe,ce)=>oe!=null&&oe.isHidden?null:g.jsxs(R.Fragment,{children:[re(oe,_,ce,K),x&&ie(_,oe,ce,b,q,K)]},`${ee}-${ce}`)):g.jsxs(R.Fragment,{children:[re(K,_,ee),x&&ie(_,K,ee,b,q)]},ee))}),N&&Y&&g.jsx(g.Fragment,{children:L?Y.map((K,ee)=>g.jsx(As,{children:F.map((oe,ce)=>g.jsx(Ta,{style:oe==null?void 0:oe.style,children:g.jsx(_p,{isRenderCellContent:!!(oe!=null&&oe.cellRenderer),column:oe,row:K})},ce))},`nested-${ee}`)):g.jsx(As,{children:g.jsx(Ta,{colSpan:F.length,children:g.jsx(Oo,{sx:{textAlign:"center"},children:Gr.NRF})})})})]},q)})})]})}),r&&g.jsx(tw,{pagination:r,gridPath:l,baseUrl:a}),g.jsx(nw,{menuOpen:f==null?void 0:f.isOpen,handleClose:h,onHideClick:y})]})}sw.propTypes={sort:s.object,data:s.array,pagination:s.object,columns:s.object,nested:s.object};function iw({tableProps:e,isDefaultConfig:t,gridPath:n,baseUrl:r}){var u;const{columns:o}=e,{visibleGridColumns:i=[]}=R.useContext(ga)??{},a=R.useContext(ya),l=R.useMemo(()=>{var d;return m7({columns:o,gridPath:n,baseUrl:r,isDefaultConfig:t,pageSize:(d=e==null?void 0:e.pagination)==null?void 0:d.rowPerPage})},[o,n,r,t,(u=e==null?void 0:e.pagination)==null?void 0:u.rowPerPage]),c=R.useMemo(()=>{const d=new Map(i.map(f=>[f.key,f]));return l.map(f=>{const p=d.get(f.key);return{...f,...p&&{isHidden:p.isHidden,sequenceId:p.sequenceId}}}).sort((f,p)=>f.sequenceId-p.sequenceId)},[l,i]);return R.useEffect(()=>{a({type:qe.SET_GRID_DATA,payload:{visibleGridColumns:i.length?c:l}})},[l]),g.jsx(sw,{...e,gridPath:n,baseUrl:r})}iw.propTypes={tableProps:s.object.isRequired,mergedColumns:s.array.isRequired};const aw=({type:e})=>{const t=It(),r=(t==null?void 0:t.mode)==="dark"?{bgcolor:"grey.800"}:{};return{grid:g.jsxs(ye,{sx:{borderRadius:2,overflow:"hidden"},children:[g.jsx(Tr,{variant:"text",width:"100%",height:60,sx:r}),Array.from({length:10}).map((i,a)=>g.jsx(ye,{sx:{display:"flex",alignItems:"center",padding:"0.5rem",gap:"3rem"},children:Array.from({length:5}).map((l,c)=>g.jsx(ye,{sx:{flex:1},children:g.jsx(Tr,{variant:"text",height:45,sx:r})},c))},a))]}),toolbar:g.jsx(g.Fragment,{children:g.jsxs(ft,{direction:"row",justifyContent:"space-between",sx:{display:"flex",gap:"1rem"},children:[g.jsxs(ft,{direction:"row",gap:"1rem",children:[g.jsx(Tr,{variant:"text",width:"10.2rem",height:"5rem",sx:r}),g.jsx(Tr,{variant:"text",width:"3.5rem",height:"5rem",sx:r}),g.jsx(Tr,{variant:"text",width:"15.2rem",height:"5rem",sx:r})]}),g.jsxs(ft,{direction:"row",gap:"1rem",children:[g.jsx(Tr,{variant:"text",width:"10.2rem",height:"5rem",sx:r}),g.jsx(Tr,{variant:"text",width:"3.5rem",height:"5rem",sx:r}),g.jsx(Tr,{variant:"text",width:"3.5rem",height:"5rem",sx:r})]})]})})}[e]},k7=e=>{if(!e)return null;const{options:t,...n}=e,r=t?"select":"button",o={button:i=>{var a;return g.jsx(mo,{...i,styles:{...i.styles,iconPrimary:((a=i==null?void 0:i.styles)==null?void 0:a.variant)=="filled"}})},select:i=>{var a;return g.jsx(ye,{sx:{"& .MuiInputBase-input":{padding:"0rem!important"},width:(a=i.styles)==null?void 0:a.width},children:g.jsx(l1,{...i,options:t})})}};return o[r]?o[r](n):null},E7=({presentSetting:e,gridSetting:t,gridPath:n})=>{var a;if(!n)return e;const r=n.split("/").filter(Boolean),o=(a=t==null?void 0:t.grid)==null?void 0:a.map(({id:l,isHidden:c,isSortable:u,key:d,sequenceId:f})=>({id:l,isHidden:c,isSortable:u,key:d,sequenceId:f}));let i=e;for(let l=0;l<r.length;l++){const c=r[l];l===r.length-1?i[c]={columns:o,pageSize:(t==null?void 0:t.pageSize)??null}:(i[c]=i[c]||{},i=i[c])}return{settingObject:e,defaultUserSettings:o}},P7=async({baseUrl:e,gridSetting:t,gridPath:n})=>{try{const r=JSON.parse(localStorage.getItem("settings")),{settingObject:o,defaultUserSettings:i}=E7({presentSetting:r,gridSetting:t,gridPath:n});return localStorage.setItem("settings",JSON.stringify(o)),await _c({baseUrl:e,payload:o}),i}catch(r){console.error(r)}},M7=({customTools:e})=>{var r,o;const t=(r=e==null?void 0:e.filter(i=>(i==null?void 0:i.type)===X1.PRIMARY))==null?void 0:r.sort((i,a)=>i.sequenceId-a.sequenceId),n=(o=e==null?void 0:e.filter(i=>(i==null?void 0:i.type)===X1.SECONDARY))==null?void 0:o.sort((i,a)=>i.sequenceId-a.sequenceId);return{primaryButtons:t,secondaryButtons:n}},lw=({customTools:e,isExpanded:t,setIsExpanded:n})=>{const{primaryButtons:r,secondaryButtons:o}=M7({customTools:e}),[i,a]=R.useState(r),l=(o==null?void 0:o.length)>0,c=d=>{d?a([...r,...o]):setTimeout(()=>{a(r)},100)},u=()=>{const d=!t;n(d),c(d)};return R.useEffect(()=>{c(t)},[e]),g.jsxs(g.Fragment,{children:[t&&g.jsx("div",{style:{position:"fixed",left:0,width:"100vw",height:"4rem",zIndex:998}}),g.jsxs(ye,{sx:{display:"flex",alignItems:"center",gap:"0.8rem",flexWrap:"nowrap",maxWidth:"100%",whiteSpace:"nowrap",zIndex:999},children:[g.jsx(Q5,{mode:"popLayout",children:i.map((d,f)=>g.jsx(Gi.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},layout:!0,children:g.jsx(ye,{sx:{flexShrink:0,minWidth:"fit-content"},children:k7(d)})},`${d.id}_${f}`))}),l&&g.jsx(ye,{sx:{paddingLeft:t?"0.5rem":0},children:g.jsx(mo,{label:t?"":"More Actions",styles:{iconPrimary:!0,icon:t?Ke.CrossWhite:Ke.More,colorType:t?"danger":""},onClick:u})})]})]})};lw.propTypes={customTools:s.array.isRequired};const cw=({defaultTools:e,isManageable:t,customTools:n,baseUrl:r,gridPath:o,managableColumns:i=[],pageSize:a})=>{var x,w,C,O,v,k;const l=R.useContext(ya),{visibleGridColumns:c,triggerApi:u}=R.useContext(ga),[d,f]=R.useState([]),[p,h]=R.useState(!1);R.useEffect(()=>{if(i.length){const E=i.length?c.filter(M=>i.includes(M.id)).map(({children:M,...D})=>D):c;f(E)}},[i,c]);const y=async E=>{try{await P7({baseUrl:r,gridPath:o,gridSetting:{grid:E,pageSize:a}})}catch(M){console.error(M)}finally{l({type:qe.HAS_SETTING_CHANGE,payload:{hasChange:!1}}),l({type:qe.TRIGGER_API,payload:{triggerApi:!1}})}};R.useEffect(()=>{u&&y(c)},[u]);const m=E=>{const M=E.map(A=>A.id),D=c.map(A=>{if(!d.some(V=>V.id===A.id))return A;const I=M.includes(A.id);if(Array.isArray(A.children)&&A.children.length>0){const V=A.children.map(N=>{const P=E.flatMap(U=>U.children||[]).map(U=>U.id);if(!d.some(U=>(U.children||[]).some(B=>B.id===N.id&&B.key===N.key)))return N;const W=P.includes(N.id);return{...N,isHidden:!W}}),F=V.filter(N=>d.some(P=>(P.children||[]).some(j=>j.id===N.id))).every(N=>N.isHidden);return{...A,isHidden:I?!1:F||!I,children:V}}else return{...A,isHidden:!M.includes(A.id)}});l({type:qe.SET_GRID_DATA,payload:{visibleGridColumns:D}}),l({type:qe.HAS_SETTING_CHANGE,payload:{hasChange:!0}})},b=()=>d.map(E=>{const M=Array.isArray(E.children)?E.children.filter(D=>!D.isHidden):void 0;return!E.isHidden||M&&M.length?{...E,children:M}:null}).filter(Boolean);return g.jsxs(ye,{sx:{margin:"1rem 0",position:"relative",zIndex:10,display:"flex",flexDirection:"row",justifyContent:"space-between",gap:"0.6rem",width:"100%"},children:[g.jsxs(ye,{sx:{display:"flex",flexDirection:"row",gap:"0.6rem"},children:[((x=e==null?void 0:e.search)==null?void 0:x.isRequired)&&g.jsx(s1,{...e==null?void 0:e.search,iconUrl:Ke.Search}),((w=e==null?void 0:e.groupBy)==null?void 0:w.isRequired)&&g.jsx(ye,{sx:{"& .MuiInputBase-input":{padding:"0rem!important"}},children:g.jsx(Sc,{styles:{icon:Ke.Group},...e.groupBy})}),((C=e==null?void 0:e.refresh)==null?void 0:C.isRequired)&&g.jsx(mo,{...e==null?void 0:e.refresh,styles:{variant:"filled",icon:Ke.Refresh,colorType:"empty",width:"3.2rem",height:"3.2rem"}}),t&&g.jsx(ye,{sx:{"& .MuiInputBase-input":{padding:"0rem!important"}},children:g.jsx(Sc,{placeholder:"Manage Columns",options:d,value:b(),isMulti:!0,isDraggable:!0,showSearch:!0,onChange:m,styles:{icon:Ke.Manage}})})]}),g.jsxs(ye,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-end",gap:"0.6rem"},children:[n&&g.jsx(lw,{customTools:n,setIsExpanded:h,isExpanded:p}),((O=e==null?void 0:e.save)==null?void 0:O.isRequired)&&g.jsx(ye,{sx:{px:"0.5rem"},children:g.jsx(mo,{label:p?"":"Save",styles:{icon:Ke.Save,colorType:"empty"},...e==null?void 0:e.save})}),((v=e==null?void 0:e.upload)==null?void 0:v.isRequired)&&g.jsx(mo,{...e==null?void 0:e.upload,styles:{variant:p?"outlined":"filled",icon:p?Ke.UploadDark:Ke.Upload,iconPrimary:!p,colorType:"secondary",isAnimate:!0}}),((k=e==null?void 0:e.download)==null?void 0:k.isRequired)&&g.jsx(mo,{...e==null?void 0:e.download,styles:{variant:"outlined",icon:Ke.Download,isAnimate:!0}})]})]})};cw.propTypes={defaultTools:s.object.isRequired,customTools:s.array,isManageable:s.bool,baseUrl:s.string,gridPath:s.gridPath};function Bp({tableProps:e,toolbarProps:t,isDefaultConfig:n,isLoading:r}){var i,a;const o=(i=e.columns)==null?void 0:i.isManageable;return g.jsx(a1,{children:r?g.jsxs(g.Fragment,{children:[g.jsx(aw,{type:"toolbar"}),g.jsx(aw,{type:"grid"})]}):g.jsxs(ye,{sx:{position:"sticky"},children:[t&&g.jsx(cw,{...t,isManageable:o,pageSize:(a=e==null?void 0:e.pagination)==null?void 0:a.rowPerPage}),g.jsx(iw,{tableProps:e,isDefaultConfig:n,gridPath:(t==null?void 0:t.gridPath)||"",baseUrl:(t==null?void 0:t.baseUrl)||""})]})})}Bp.propTypes={tableProps:s.object.isRequired,toolbarProps:s.object,isDefaultConfig:s.bool};const uw=({list:e,handleLinkClick:t})=>{const n=It(),r=({list:o})=>{var i;return(i=o==null?void 0:o.sort((a,l)=>a.order-l.order))==null?void 0:i.map((a,l)=>a!=null&&a.link?g.jsx(Fr,{component:"h3",sx:{fontSize:"1rem",cursor:"pointer",color:l===(o==null?void 0:o.length)-1?n.palette.brandColor.orange:n.palette.primary.notifyTextColor},href:a==null?void 0:a.link,underline:"hover",onClick:()=>t(a),children:a==null?void 0:a.title},l):g.jsx(st,{component:"h3",sx:{fontSize:"1rem",color:l===(o==null?void 0:o.length)-1?n.palette.brandColor.orange:n.palette.primary.notifyTextColor},children:a==null?void 0:a.title},l))};return g.jsx(L0,{separator:g.jsx(hn,{url:Ke.ArrowRight}),children:r({list:e})})};uw.propTypes={list:s.array.isRequired,handleLinkClick:s.func};const dw=({breadcrumbProps:e,switchProps:t,filterComponentProps:n})=>{var o,i,a,l,c,u;const r=It();return g.jsxs(g.Fragment,{children:[g.jsxs(ft,{sx:{background:r.palette.primary.notifyBackground,borderBottom:`0.1rem solid ${r.palette.primary.notifyBorderColor}`,height:"3rem",p:"0px 1.5rem 0 1.5rem",zIndex:4,position:"relative"},direction:"row",justifyContent:"space-between",alignItems:"center",children:[g.jsx(uw,{...e}),g.jsxs(ft,{direction:"row",gap:"1rem",alignItems:"center",children:[t&&g.jsx(f1,{...t}),(n==null?void 0:n.filterBtnProps)&&g.jsxs(ft,{direction:"row",children:[g.jsx(yi,{orientation:"vertical",flexItem:!0,sx:{mx:"1rem",height:"2rem!important",opacity:"1!important",borderColor:r.palette.primary.notifyBorderColor}}),g.jsxs(ft,{direction:"row",alignItems:"center",gap:"0.5rem",onClick:(o=n==null?void 0:n.filterBtnProps)==null?void 0:o.onFilterClick,sx:{cursor:"pointer"},children:[g.jsx(hn,{url:Ke.Filter}),g.jsx(st,{sx:{fontSize:"1.1rem",color:r.palette.primary.notifyActiveText},children:(i=n==null?void 0:n.filterBtnProps)==null?void 0:i.label})]})]})]})]}),g.jsx(Gi.div,{layout:!0,initial:{height:"0rem"},animate:{height:(a=n==null?void 0:n.filterBtnProps)!=null&&a.filterContainerVisible?"5rem":"0rem",opacity:(l=n==null?void 0:n.filterBtnProps)!=null&&l.filterContainerVisible?1:0},transition:{duration:.5,ease:"easeInOut"},style:{background:r.palette.primary.notifyBackground,borderBottom:`0.1rem solid ${r.palette.primary.notifyBorderColor}`,padding:"0px 5.5rem 0 1.5rem",position:"relative",alignItems:"center",display:"flex",overflow:"hidden"},children:g.jsxs(ft,{sx:{background:r.palette.primary.appBackground,height:"3.8rem",p:"0 2rem",width:"100%",borderRadius:"0.7rem",overflow:"visible"},direction:"row",alignItems:"center",children:[g.jsx(st,{sx:{fontSize:"1.2rem",fontWeight:"500",color:r.palette.primary.notifyActiveText},children:"Filters:"}),g.jsx(ye,{sx:{overflowX:"auto",overflowY:"visible",whiteSpace:"nowrap",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"},margin:"0 1rem",padding:"0.5rem 0",flexGrow:1},children:g.jsx(ft,{direction:"row",gap:"1.2rem",sx:{overflow:"visible"},children:(c=n==null?void 0:n.filterItems)==null?void 0:c.map((d,f)=>g.jsx(g.Fragment,{children:g.jsxs(ye,{sx:{position:"relative",overflow:"visible",border:`0.1rem solid ${r.palette.primary.notifyBorderColor}`,background:r.palette.primary.notifyBackground,borderRadius:"0.6rem",padding:"0.3rem 1.1rem",display:"inline-block"},children:[g.jsx(ye,{component:"img",src:Ke.FilterClose,sx:{position:"absolute",top:"-0.4rem",right:"-0.6rem",cursor:"pointer"},onClick:()=>n==null?void 0:n.onFilterChipClose(d)}),g.jsx(st,{sx:{fontSize:"1rem",color:r.palette.primary.notifyTextColor},children:d==null?void 0:d.filterLabel})]},f)}))})}),g.jsx(ye,{component:st,sx:{fontSize:"1.1rem",fontWeight:"500",textDecoration:"underline",color:r.palette.brandColor.red,cursor:"pointer"},onClick:(u=n==null?void 0:n.filterContainerProps)==null?void 0:u.onClearClick,children:"Clear"})]})})]})};dw.propTypes={breadcrumbProps:s.object.isRequired,switchProps:s.object};function fw({headerProps:e}){return g.jsx(Fn,{children:g.jsx(dw,{...e})})}fw.propTypes={headerProps:s.object.isRequired};const Lp=R.createContext(null),pw=R.createContext(null);function R7({children:e}){const[t,n]=R.useReducer(D7,I7);return g.jsx(Lp.Provider,{value:t,children:g.jsx(pw.Provider,{value:n,children:e})})}function D7(e,t){var n;switch(t.type){case qe.LOADING:return{...e,loading:t.loading};case qe.SUCCESS:return{...e,data:(n=t.data)==null?void 0:n.sort((r,o)=>new Date(o.createdAt)-new Date(r.createdAt))};case qe.MARK_ALL_AS_READ:return{...e,isMarkAllAsRead:t.isMarkAllAsRead};case qe.ERROR:return{...e,error:t.error};default:throw new Error(`${Gr.UNHANDLED}: ${t}`)}}const I7={loading:!1,data:[],error:"",isMarkAllAsRead:{count:0,boo:!1}},{TENANT_ID:Vp,BU_ID:Wp,SNOP_ID:hw}=Dp,{TENANT_IDS:zp,BU_IDS:Up}=Ca,A7=async e=>{try{const t=`${e}${$c.NOTIFICATION}/v1?${Vp}=${zp}&${Wp}=${Up}`;return await St.get(t,Sa)}catch(t){return t}},mw=async(e,t,n)=>{try{const r=n===K1.MARK_ALL_READ?"":`&${hw}=${n}&`,o=`${e}${$c.NOTIFICATION}${Mp.VERSION}?${Vp}=${zp}&${Wp}=${Up}${r}`;return await St.put(o,t,Sa)}catch(r){return r}},j7=async({baseUrl:e,id:t,snopId:n})=>{try{const r=`${e}${$c.NOTIFICATION}${Mp.VERSION}?${Vp}=${zp}&${Wp}=${Up}&${hw}=${n}&id=${t}`;return await St.get(r,Sa)}catch(r){return r}},Bc={OK:200,CREATED:201,NO_CONTENT:204,BAD_REQUEST:400,UNAUTHORIZED:401,NOT_FOUND:404,INTERNAL_SERVER_ERROR:500},gw=({baseUrl:e})=>{const t=R.useContext(pw),[n,r]=R.useState(!1),[o,i]=R.useState(!1),[a,l]=R.useState(!1),[c,u]=R.useState({}),[d,f]=R.useState(null),[p,h]=R.useState(1),[y,m]=R.useState(!1),[b,x]=R.useState(0),{loading:w,data:C,isMarkAllAsRead:O}=R.useContext(Lp),[v,k]=R.useState([]);R.useEffect(()=>{k(C)},[C]);const E=R.useCallback(async()=>{var F,N;try{t({type:qe.LOADING,loading:!0}),t({type:qe.SUCCESS,data:[]});const P=await A7(e);if(P.status===Bc.OK){const j=((N=(F=P.data)==null?void 0:F.responseData)==null?void 0:N.response)||[],W=Cc(j);t({type:qe.SUCCESS,data:Cc(W)}),t({type:qe.MARK_ALL_AS_READ,isMarkAllAsRead:{count:i1(j),boo:i1(j)>0}})}}catch{t({type:qe.ERROR,error:Gr.SWR})}finally{t({type:qe.LOADING,loading:!1})}},[e,t]);R.useEffect(()=>{E();const F=setInterval(E,3e5);return()=>clearInterval(F)},[E]);const M=async(F,N)=>{var P,j,W;if(F){f(F);try{const U=await j7({baseUrl:e,id:F,snopId:N});if(U.status===Bc.OK){const B=((W=(j=(P=U.data)==null?void 0:P.responseData)==null?void 0:j.response)==null?void 0:W[0])||{};u(B||{}),l(!0)}else throw new Error}catch{t({type:qe.ERROR,error:Gr.SWR})}finally{f(null)}}},D=async(F,N)=>{if(F.length){t({type:qe.LOADING,loading:!0});try{if((await mw(e,F,N)).status===Bc.OK){const j=C.map(U=>F.includes(U.id)?{...U,isRead:!0}:U),W=j.filter(U=>!U.isRead).length;t({type:qe.SUCCESS,data:Cc(j)}),t({type:qe.MARK_ALL_AS_READ,isMarkAllAsRead:{count:W,boo:W>0}}),setTimeout(()=>{t({type:qe.LOADING,loading:!1})},200)}}catch{t({type:qe.ERROR,error:Gr.SWR}),t({type:qe.LOADING,loading:!1})}}},A=async()=>{t({type:qe.LOADING,loading:!0});try{const F=d8(C);if((await mw(e,F,K1.MARK_ALL_READ)).status===Bc.OK){const P=C.map(j=>({...j,isRead:!0}));t({type:qe.SUCCESS,data:Cc(P)}),t({type:qe.MARK_ALL_AS_READ,isMarkAllAsRead:{count:0,boo:!1}}),setTimeout(()=>{t({type:qe.LOADING,loading:!1})},200)}}catch{t({type:qe.ERROR,error:Gr.SWR}),t({type:qe.LOADING,loading:!1})}},$=(F,N)=>{t({type:qe.LOADING,loading:!0}),x(N),setTimeout(()=>{t({type:qe.LOADING,loading:!1})},400)},I=F=>{const N=F||C||[];return{0:N,1:N.filter(P=>(P==null?void 0:P.type)==="INFO"),2:N.filter(P=>(P==null?void 0:P.type)==="ERROR")}},V=()=>{t({type:qe.LOADING,loading:!0});const F=!y,N=F?(v||[]).filter(P=>!P.isRead):C||[];m(F),k(N),h(1),setTimeout(()=>{t({type:qe.LOADING,loading:!1})},400)};return{fetchNotification:E,showDetailsProps:{open:a,handleClose:()=>l(!1),setOpen:l,data:c,clickId:d},alertDialogProps:{open:n,handleClose:()=>r(!1),onRefresh:E,handleRead:D,handleMarkAllAsRead:A,setOpen:r,handleShowDetails:M,clickId:d,isMainDialog:!0},activeTab:b,loading:w,tabData:I(v)[b],data:v,mode:y,handleTabChange:$,toggleAlertMode:V,page:p,setPage:h,isMarkAllAsRead:O}};var yw,bw,vw;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 N7=function(t){return S.createElement("svg",Hp({xmlns:"http://www.w3.org/2000/svg",width:16,height:17,fill:"none"},t),yw||(yw=S.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"})),bw||(bw=S.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"})),vw||(vw=S.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 $7=({count:e})=>(It(),g.jsxs(g.Fragment,{children:[g.jsx(ye,{sx:{gap:"0.5rem",display:"flex",justifyContent:"center",alignItems:"center","& svg":{transform:"scale(1)"}},children:g.jsx(N7,{style:{scale:2}})}),g.jsx(C7,{badgeContent:e!=0?"":null,color:"error"})]}));function xw({children:e,handleClose:t,open:n,isMainDialog:r}){return g.jsx(kl,{open:n,onClose:t,...r?{scroll:"paper",PaperProps:{sx:{position:"fixed",top:30,right:30,m:0,width:400,height:450,display:"flex",flexDirection:"column",borderRadius:2,boxShadow:6,backgroundColor:o=>o.palette.primary.notifyBackground}}}:{fullWidth:!0,maxWidth:"md",sx:{"& .MuiPaper-root":{minHeight:250,maxHeight:500,borderRadius:"1.5rem",boxShadow:6,backgroundColor:o=>o.palette.primary.appBackground}}},children:e})}var ww;function qp(){return qp=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},qp.apply(null,arguments)}var _7=function(t){return S.createElement("svg",qp({xmlns:"http://www.w3.org/2000/svg",width:14,height:9,fill:"none",viewBox:"0 0 13 9"},t),ww||(ww=S.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"})))},Cw,Sw;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 F7=function(t){return S.createElement("svg",Yp({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,fill:"none"},t),Cw||(Cw=S.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"})),Sw||(Sw=S.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"})))},Tw;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 B7=function(t){return S.createElement("svg",Gp({xmlns:"http://www.w3.org/2000/svg",width:9,height:8,fill:"none"},t),Tw||(Tw=S.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 Ow=({type:e,item:t,handleShowDetails:n,handleRead:r,handleCTAClicked:o,clickId:i})=>{var c,u;const a=It(),l=(u=(c=JSON.parse(localStorage.getItem("settings")))==null?void 0:c.platform)==null?void 0:u.theme;return g.jsxs(ye,{className:"cards",sx:{pt:" 0.8rem"},children:[g.jsx(ft,{display:"flex",flexDirection:"row",alignItems:"start",justifyContent:"space-between",gap:1,children:g.jsx(nd,{sx:{width:"calc(100% - 2%)","& .MuiBadge-badge":{backgroundColor:"#6041EA",height:"0.5rem",minWidth:"0.5rem"}},variant:"dot",invisible:t==null?void 0:t.isRead,children:g.jsx(Oo,{sx:{color:a.palette.primary.notifyActiveText,whiteSpace:"normal",wordBreak:"break-word"},component:"p",className:["title-card",(t==null?void 0:t.isRead)&&"read"].join(" "),children:t==null?void 0:t.message})})}),g.jsx(ft,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",children:g.jsxs(ft,{display:"flex",flexDirection:"row",justifyContent:"start",gap:1,sx:{p:"0.5rem 0"},children:[(t==null?void 0:t.isNotificationDetails)&&g.jsx(Fc,{icon:g.jsx(F7,{className:`${l==="light"?"chip-icon-light":"chip-icon-dark"}`}),disabled:i,onClick:n,label:i===(t==null?void 0:t.id)?g.jsx(Ol,{color:"primary",size:13}):"Show Details",component:"button",variant:"filled",clickable:!0,size:"small",sx:{backgroundColor:a.palette.brandColor.orange,color:a.palette.brandColor.white}}),!(t!=null&&t.isRead)&&g.jsx(Fc,{icon:g.jsx(B7,{className:`${l==="light"?"chip-icon-light":"chip-icon-dark"}`}),disabled:i,onClick:r,label:"Acknowledge",component:"button",variant:"outlined",clickable:!0,size:"small"}),(t==null?void 0:t.primaryCTAURL)&&g.jsx(Fc,{disabled:t==null?void 0:t.isPrimaryCTAClicked,onClick:()=>o({redirect:t==null?void 0:t.isPrimaryCTARedirect,isClicked:t==null?void 0:t.isPrimaryCTAClicked,url:t==null?void 0:t.primaryCTAURL}),label:t==null?void 0:t.primaryCTALabel,component:"button",variant:"outlined",clickable:!0,size:"small"}),(t==null?void 0:t.secondaryCTAURL)&&g.jsx(Fc,{disabled:t==null?void 0:t.isSecondaryCTAClicked,onClick:()=>o({redirect:t==null?void 0:t.isSecondaryCTARedirect,isClicked:t==null?void 0:t.isSecondaryCTAClicked,url:t==null?void 0:t.secondaryCTAURL}),label:t==null?void 0:t.secondaryCTALabel,component:"button",variant:"outlined",clickable:!0,size:"small"})]})}),g.jsxs(ft,{display:"flex",flexDirection:"row",alignItems:"center",gap:.35,children:[g.jsx(Oo,{sx:{fontSize:"0.8rem"},children:t==null?void 0:t.product}),g.jsx(Oo,{color:a.palette.primary.notifyTextColor,children:"•"}),g.jsx(Oo,{sx:{fontSize:"0.8rem"},children:u8(t==null?void 0:t.createdAt)})]})]})};Ow.propTypes={type:s.string,title:s.string,subTitle:s.string,isRead:s.bool,handleShowDetails:s.func,handleRead:s.func};const kw=({data:e,handleRead:t,handleShowDetails:n,clickId:r,mode:o,page:i,setPage:a})=>{const{isMarkAllAsRead:l}=R.useContext(Lp),c=new Date,u=new Intl.DateTimeFormat("en-US",{day:"numeric",month:"long",year:"numeric"}).format(c),[d,f]=R.useState([]),[p,h]=R.useState(!1),[y,m]=R.useState(!0),b=R.useRef(null),x=async C=>{h(!0);const O=e.slice((C-1)*10,C*10);await new Promise(v=>setTimeout(v,1e3)),f(v=>{const k=O.filter(E=>!v.some(M=>M.id===E.id));return[...v,...k]}),h(!1),(d==null?void 0:d.length)>=(e==null?void 0:e.length)&&m(!1)};R.useEffect(()=>{var O;let C=[];o?l!=null&&l.count?C=(O=e==null?void 0:e.filter(v=>!v.isRead))==null?void 0:O.slice(0,10):C=[]:C=e.slice(0,10),(C==null?void 0:C.length)<10&&m(!1),f(C)},[e,o,l]),R.useEffect(()=>{y&&i!==1&&x(i)},[i,e]),R.useEffect(()=>{f([...e])},[e]),R.useEffect(()=>{const C=new IntersectionObserver(O=>{O[0].isIntersecting&&!p&&y&&a(v=>v+1)},{threshold:1});return b.current&&C.observe(b.current),()=>{b.current&&C.unobserve(b.current)}},[p,y]);const w=({redirect:C,isClicked:O,url:v})=>{window.open(v,"_blank")};return g.jsxs(ye,{sx:{width:"100%"},children:[Object.entries(h8(d)).map(([C,O])=>g.jsxs(R.Fragment,{children:[C!==u&&g.jsx(w7,{children:C}),O.map((v,k)=>g.jsx(R.Fragment,{children:g.jsx(Ow,{item:v,handleCTAClicked:w,handleShowDetails:()=>n(v.id,v.snopId),handleRead:()=>t([v.id],v.snopId),clickId:r})},`${k}_${v.id}`))]},C)),p&&i>1&&!!(d!=null&&d.length)&&g.jsx(ye,{sx:{display:"flex",justifyContent:"center",alignItems:"center",pl:"0.5rem",py:"0.3rem"},children:g.jsx(Ol,{size:20,sx:{color:C=>C.palette.primary.notifyIconColor}})}),!(d!=null&&d.length)&&g.jsx(st,{sx:{fontSize:"1.1rem",color:C=>C.palette.primary.notifyTextColor,textAlign:"center",px:"0.8rem"},children:"You don't have any unread notification here. Use the toggle to switch between read and unread notification."}),g.jsx(ye,{ref:b,style:{height:"0.1rem",backgroundColor:"transparent"}})]})};kw.propTypes={data:s.array,handleRead:s.func,handleShowDetails:s.func};const L7=({onRefresh:e,handleShowDetails:t,clickId:n,handleRead:r,handleMarkAllAsRead:o})=>{var y,m,b,x;const{loading:i,activeTab:a,data:l,tabData:c,mode:u,page:d,setPage:f,handleTabChange:p,toggleAlertMode:h}=gw({});return g.jsxs(g.Fragment,{children:[g.jsxs(ye,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:2,pt:2},children:[g.jsx(st,{variant:"h2",sx:{fontSize:"1.2rem",color:w=>w.palette.primary.notifyTextColor},children:"Notifications"}),g.jsx(ye,{onClick:e,children:g.jsx(hn,{url:Ke.Refresh,alt:"refresh",sx:{cursor:"pointer"}})})]}),g.jsx(ye,{sx:{borderBottom:1,m:"1.2rem 1.2rem 0 1.2rem",borderColor:w=>w.palette.primary.notifyBorderColor},children:g.jsxs(S7,{value:a,onChange:p,children:[g.jsx(Fp,{label:g.jsxs(ye,{sx:{display:"flex",alignItems:"center",fontSize:"1rem",fontWeight:"500"},children:["All (",g.jsx(st,{component:"span",sx:{fontWeight:"500",fontSize:"1rem"},children:((y=l==null?void 0:l.filter(w=>!(w!=null&&w.isRead)))==null?void 0:y.length)||0}),")"]})}),g.jsx(Fp,{label:g.jsxs(ye,{sx:{display:"flex",alignItems:"center",fontSize:"1rem",fontWeight:"500"},children:["Info (",g.jsx(st,{component:"span",sx:{fontWeight:"500",fontSize:"1rem"},children:((m=l==null?void 0:l.filter(w=>(w==null?void 0:w.type)==="INFO"&&!(w!=null&&w.isRead)))==null?void 0:m.length)||0}),")"]}),sx:{color:w=>w.palette.brandColor.blue}}),g.jsx(Fp,{label:g.jsxs(ye,{sx:{display:"flex",alignItems:"center",fontSize:"1rem",fontWeight:"500"},children:["Error (",g.jsx(st,{component:"span",sx:{fontWeight:"500",fontSize:"1rem"},children:((b=l==null?void 0:l.filter(w=>(w==null?void 0:w.type)==="ERROR"&&!(w!=null&&w.isRead)))==null?void 0:b.length)||0}),")"]}),sx:{color:w=>w.palette.brandColor.red}})]})}),g.jsx(Pl,{dividers:!0,sx:{p:0,...i&&!c.length&&{alignItems:"center",justifyContent:"center"},flexGrow:1,overflowY:"auto",mx:"1.2rem",borderColor:w=>w.palette.primary.notifyBorderColor},tabIndex:-1,children:i?g.jsx(Ol,{size:30,sx:{color:w=>w.palette.primary.notifyIconColor}}):g.jsx(g.Fragment,{children:g.jsx(kw,{data:c,handleShowDetails:t,handleRead:r,clickId:n,page:d,setPage:f,mode:u})})}),g.jsxs(El,{sx:{justifyContent:"space-between",px:"1.2rem"},children:[g.jsxs(ft,{direction:"row",gap:1,children:[g.jsx(Oo,{sx:{fontSize:"1rem"},children:"Only show unread"}),g.jsx(x7,{disabled:i,checked:u,onChange:h})]}),g.jsx(Hn,{variant:"outlined",className:"view-all",onClick:o,startIcon:g.jsx(_7,{}),disabled:!((x=l==null?void 0:l.filter(w=>!(w!=null&&w.isRead)))!=null&&x.length),style:{backgroundColor:"transparent"},sx:{fontSize:"1rem",fontWeight:"300",p:0,border:"none",textTransform:"none",color:w=>w.palette.primary.notifyTextColor,"&:hover":{color:w=>w.palette.primary.notifyActiveText,background:"transparent",boxShadow:"none",border:"none"},"&.Mui-disabled":{opacity:.5,color:w=>`${w.palette.primary.notifyActiveText}!important`,background:"transparent",boxShadow:"none",border:"none"}},children:"Mark all as read"})]})]})},V7=({data:e,handleClose:t})=>{var b;const[n,r]=R.useState(1),[o,i]=R.useState(10),[a,l]=R.useState(((b=e==null?void 0:e.notificationDetails)==null?void 0:b.length)||0),[c,u]=R.useState("sku_name"),[d,f]=R.useState("asc"),[p,h]=R.useState([]),[y,m]=R.useState("");return R.useEffect(()=>{var x;if(y||c){const w=f8(e==null?void 0:e.notificationDetails,a7,y);if(c){const C=p8(w,c,d?"asc":"desc");h(pp(C,n,o)),l(C.length);return}h(pp(w,n,o)),l(w.length);return}h(pp(e==null?void 0:e.notificationDetails,n,o)),l((x=e==null?void 0:e.notificationDetails)==null?void 0:x.length)},[y,e==null?void 0:e.notificationDetails,n,o,d,c]),g.jsxs(g.Fragment,{children:[g.jsxs(ft,{direction:"row",justifyContent:"space-between",sx:{padding:"1.5rem 2rem",borderBottom:"0.1rem solid",borderColor:x=>x.palette.primary.notifyBorderColor},children:[g.jsx(st,{component:"h2",sx:{fontSize:"1.4rem",color:x=>x.palette.primary.notifyActiveText},children:(e==null?void 0:e.message)||""}),g.jsx(ye,{onClick:t,sx:{cursor:"pointer"},children:g.jsx(hn,{url:Ke.CloseCircle})})]}),g.jsx(Pl,{children:g.jsx(Bp,{tableProps:{data:p,columns:{...y7(),isManageable:!1},sort:{sortField:c,sortDir:d,onSort:x=>{var C;const w=(C=x==null?void 0:x.column)==null?void 0:C.key;f(O=>c===w&&O==="asc"?"desc":"asc"),u(w)}},pagination:{selectedPage:n,rowPerPage:o,totalRecords:a,onPageChange:x=>{r(x)},onPageSizeChange:x=>{i(x==null?void 0:x.value),r(1)}}},toolbarProps:{defaultTools:{search:{isRequired:!0,onChange:x=>{const w=x.target.value;w&&r(1),m(w)},placeholder:"Search..."}}}})}),g.jsx(El,{sx:{padding:"1.5rem 2rem"}})]})},W7=({baseUrl:e})=>{const{alertDialogProps:t,showDetailsProps:n,fetchNotification:r,isMarkAllAsRead:o}=gw({baseUrl:e});return g.jsxs(g.Fragment,{children:[g.jsx(ye,{sx:{display:"flex",justifyContent:"center",cursor:"pointer",marginTop:"0.6rem"},onClick:()=>{var i;r(),(i=t==null?void 0:t.setOpen)==null||i.call(t,!0)},children:g.jsx($7,{count:o.count})}),g.jsx(xw,{...t,children:g.jsx(L7,{...t})}),g.jsx(xw,{...n,children:g.jsx(V7,{...n})})]})},z7=({baseUrl:e})=>g.jsx(Fn,{children:g.jsx(R7,{children:g.jsx(W7,{baseUrl:e})})}),U7=({rightChild:e,leftChild:t,isDrawerMerged:n,isDrawerOpen:r,drawerTitle:o,showExpand:i,onCloseClick:a,onMergeClick:l,onExpandClick:c,isDrawerExpanded:u,styles:d,showMerge:f})=>{const p=It();return g.jsx(ye,{sx:{position:"relative",overflow:"hidden"},children:g.jsxs(ao,{container:!0,sx:{height:"100%"},children:[g.jsx(ao,{item:!0,sx:{width:n?d!=null&&d.drawerWidth?`calc(${"100%"-(d==null?void 0:d.drawerWidth)})`:"75%":"100%",position:"relative",zIndex:3,height:"calc(100vh - 7rem)",p:"0rem 1.5rem",overflow:"auto"},children:t}),r&&!n&&g.jsxs(g.Fragment,{children:[g.jsx(ye,{onClick:a,sx:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"#07080B80",backdropFilter:"blur(3px)",zIndex:3,transition:"opacity 0.3s ease-in-out"}}),g.jsx(ye,{onClick:a,sx:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"transparent",zIndex:4}})]}),e&&g.jsxs(ao,{item:!0,sx:{width:u?"90%":(d==null?void 0:d.drawerWidth)||"25%",position:n?"relative":"absolute",top:0,right:0,height:"calc(100vh - 7rem)",backgroundColor:p.palette.primary.notifyBackground,transform:r?"translateX(0)":"translateX(100%)",transition:"transform 0.4s ease-in-out , width 0.4s ease-in-out",zIndex:4,borderLeft:`0.1rem solid ${p.palette.primary.notifyBorderColor}`,display:"flex",flexDirection:"column"},children:[g.jsxs(ft,{direction:"row",alignItems:"center",sx:{width:"100%",flexShrink:0,paddingBottom:"0.8rem",px:2,pt:"0.8rem",borderBottom:h=>`0.1rem solid ${h.palette.primary.notifyBorderColor}`},children:[!u&&f&&g.jsxs(g.Fragment,{children:[g.jsx(ye,{component:"img",src:Ke.Merge,sx:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer"},onClick:l}),g.jsx(yi,{orientation:"vertical",flexItem:!0,sx:{mx:"1rem",height:"auto!important",borderColor:p.palette.primary.notifyBorderColor}})]}),g.jsxs(ft,{direction:"row",justifyContent:"space-between",alignItems:"center",flexGrow:1,children:[g.jsxs(ft,{direction:"row",gap:"0.5rem",alignItems:"center",onClick:a,sx:{cursor:"pointer"},children:[g.jsx(hn,{url:Ke.CrossLight}),g.jsx(st,{sx:{fontSize:"1.2rem",color:p.palette.primary.notifyTextColor},children:o})]}),g.jsx(ft,{direction:"row",gap:"0.5rem",alignItems:"center",children:i&&g.jsx(ye,{onClick:c,sx:{cursor:"pointer"},children:g.jsx(ye,{component:"img",src:u?Ke.Collapse:Ke.Expand})})})]})]}),g.jsx(ye,{sx:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"},overflow:"auto",px:2},children:e})]})]})})},Ew=({layoutChildren:e,layoutProps:t})=>g.jsx(Fn,{children:g.jsx(U7,{...e,...t})});Ew.propTypes={layoutChildren:s.object.isRequired,layoutProps:s.object.isRequired},vt.Button=mo,vt.Checkbox=sc,vt.DatePicker=l8,vt.Grid=Bp,vt.Header=fw,vt.InputField=s1,vt.Loader=N8,vt.Notification=z7,vt.Select=l1,vt.SliderLayout=Ew,vt.Switch=f1,vt.TextField=xc,vt.ToastProvider=R8,vt.toast=k8,Object.defineProperty(vt,Symbol.toStringTag,{value:"Module"})});
326
+ `+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=So(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&jc.assertOptions(r,{silentJSONParsing:mr.transitional(mr.boolean),forcedJSONParsing:mr.transitional(mr.boolean),clarifyTimeoutError:mr.transitional(mr.boolean)},!1),o!=null&&(te.isFunction(o)?n.paramsSerializer={serialize:o}:jc.assertOptions(o,{encode:mr.function,serialize:mr.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),jc.assertOptions(n,{baseUrl:mr.spelling("baseURL"),withXsrfToken:mr.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&te.merge(i.common,i[n.method]);i&&te.forEach(["delete","get","head","post","put","patch","common"],y=>{delete i[y]}),n.headers=gn.concat(a,i);const l=[];let c=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(c=c&&m.synchronous,l.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let d,f=0,p;if(!c){const y=[H1.bind(this),void 0];for(y.unshift.apply(y,l),y.push.apply(y,u),p=y.length,d=Promise.resolve(n);f<p;)d=d.then(y[f++],y[f++]);return d}p=l.length;let h=n;for(f=0;f<p;){const y=l[f++],m=l[f++];try{h=y(h)}catch(b){m.call(this,b);break}}try{d=H1.call(this,h)}catch(y){return Promise.reject(y)}for(f=0,p=u.length;f<p;)d=d.then(u[f++],u[f++]);return d}getUri(t){t=So(this.defaults,t);const n=$1(t.baseURL,t.url,t.allowAbsoluteUrls);return E1(n,t.params,t.paramsSerializer)}};te.forEach(["delete","get","head","options"],function(t){To.prototype[t]=function(n,r){return this.request(So(r||{},{method:t,url:n,data:(r||{}).data}))}}),te.forEach(["post","put","patch"],function(t){function n(r){return function(i,a,l){return this.request(So(l||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))}}To.prototype[t]=n(),To.prototype[t+"Form"]=n(!0)});let n7=class Mw{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(o=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const a=new Promise(l=>{r.subscribe(l),i=l}).then(o);return a.cancel=function(){r.unsubscribe(i)},a},t(function(i,a,l){r.reason||(r.reason=new Is(i,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 Mw(function(o){t=o}),cancel:t}}};function r7(e){return function(n){return e.apply(null,n)}}function o7(e){return te.isObject(e)&&e.isAxiosError===!0}const Pp={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};Object.entries(Pp).forEach(([e,t])=>{Pp[t]=e});function G1(e){const t=new To(e),n=p1(To.prototype.request,t);return te.extend(n,To.prototype,t,{allOwnKeys:!0}),te.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return G1(So(e,o))},n}const St=G1(xa);St.Axios=To,St.CanceledError=Is,St.CancelToken=n7,St.isCancel=I1,St.VERSION=q1,St.toFormData=Pc,St.AxiosError=He,St.Cancel=St.CanceledError,St.all=function(t){return Promise.all(t)},St.spread=r7,St.isAxiosError=o7,St.mergeConfig=So,St.AxiosHeaders=gn,St.formToJSON=e=>R1(te.isHTMLForm(e)?new FormData(e):e),St.getAdapter=U1.getAdapter,St.HttpStatusCode=Pp,St.default=St;const{Axios:KW,AxiosError:XW,CanceledError:ZW,isCancel:JW,CancelToken:QW,VERSION:ez,all:tz,Cancel:nz,isAxiosError:rz,spread:oz,toFormData:sz,AxiosHeaders:iz,HttpStatusCode:az,formToJSON:lz,getAdapter:cz,mergeConfig:uz}=St,Mp={BASE_URL:"https://qa.3sc.ai/api",VERSION:"/v1"};/*! js-cookie v3.0.5 | MIT */function Nc(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 s7={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 Rp(e,t){function n(o,i,a){if(!(typeof document>"u")){a=Nc({},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(i,o)+l}}function r(o){if(!(typeof document>"u"||arguments.length&&!o)){for(var i=document.cookie?document.cookie.split("; "):[],a={},l=0;l<i.length;l++){var c=i[l].split("="),u=c.slice(1).join("=");try{var d=decodeURIComponent(c[0]);if(a[d]=e.read(u,d),o===d)break}catch{}}return o?a[o]:a}}return Object.create({set:n,get:r,remove:function(o,i){n(o,"",Nc({},i,{expires:-1}))},withAttributes:function(o){return Rp(this.converter,Nc({},this.attributes,o))},withConverter:function(o){return Rp(Nc({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var i7=Rp(s7,{path:"/"});const Rr={TOKEN:"token",USER:"user",SNOP:"snop",SELECTED_BU:"selected_business_unit",SETTINGS:"settings"},Dp={BEARER:"Bearer",TENANT_ID:"tenant_id",BU_ID:"bu_id",SNOP_ID:"snop_id"},a7=Object.values({"SKU Name":"sku_name",Node:"node","Channel Name":"channel_name"}),l7=[10,25,50,100],K1={MARK_ALL_READ:"MARK_ALL_READ"},c7=l7.map(e=>({label:e,value:e})),X1={PRIMARY:"PRIMARY",SECONDARY:"SECONDARY"},Ip=wc(Rr.SNOP),Ap=wc(Rr.SELECTED_BU),jp=wc(Rr.USER),u7=wc(Rr.SETTINGS),Ca={BU_IDS:Ap==null?void 0:Ap.business_unit_id,TOKEN:JSON.parse(i7.get(Rr.TOKEN)||null),TENANT_IDS:jp==null?void 0:jp.tenant_id,SNOP_IDS:Ip==null?void 0:Ip.snop_id,GRID_SETTINGS:u7},Sa={headers:{"Content-Type":"application/json",Authorization:`${Dp.BEARER} ${Ca.TOKEN}`}},Z1=St.create({baseURL:Mp.BASE_URL,axiosConfig:Sa});Z1.interceptors.request.use(function(e){return e},function(e){return Promise.reject(e)}),Z1.interceptors.response.use(function(e){return e},function(e){return Promise.reject(e)});const $c={NOTIFICATION:"/notifications",SETTING:"/configuration/setting"},{TENANT_ID:d7,BU_ID:f7}=Dp,{TENANT_IDS:p7,BU_IDS:h7}=Ca,_c=async({baseUrl:e,payload:t})=>{try{const n=`${e}${$c.SETTING}/v1?${d7}=${p7}&${f7}=${h7}`;return await St.post(n,t,Sa)}catch(n){return n}},m7=({columns:e,gridPath:t,baseUrl:n,isDefaultConfig:r,pageSize:o})=>{var m,b;let{definitions:i,defaultUserSettings:a,labels:l}=e;const c=t.split("/").filter(Boolean),u=JSON.parse(localStorage.getItem(Rr.SETTINGS));let d=c.reduce((x,w)=>x==null?void 0:x[w],u)||null;if(!r&&t){a=J1({definitions:i});const x=new Set((m=d==null?void 0:d.columns)==null?void 0:m.map(C=>C.id)),w=a.filter(C=>!x.has(C.id));(!d||(w==null?void 0:w.length)>0)&&(console.log({_localSetting:u,grid_settings:d,missing:w,defaultUserSettings:a}),(async()=>{try{const O={...Ca.GRID_SETTINGS||{platform:{theme:"light"}}},v=(d==null?void 0:d.pageSize)??o;let k=O;for(let E=0;E<c.length;E++){const M=c[E];E===c.length-1?k[M]={columns:a,pageSize:v}:(k[M]={...k[M]||{}},k=k[M])}localStorage.setItem(Rr.SETTINGS,JSON.stringify(O)),await _c({baseUrl:n,payload:O})}catch(C){console.error(C)}})())}a=(d==null?void 0:d.columns)??a??J1({definitions:i});const f=a.reduce((x,w)=>(x[w.id]=w,x),{}),p=l.reduce((x,w)=>(x[w.id]=w,x),{}),h=[];for(const x of i){const w=f[x.id]||{},C=p[x.id]||{};let O={...x,...w,...C};if((b=x.children)!=null&&b.length){const v=w.children||[],k=C.children||[];O.children=x.children.map((E,M)=>({...E,...v[M],...k[M]}))}h.push(O)}return h.sort((x,w)=>x.sequenceId-w.sequenceId)},g7=e=>e.sort((t,n)=>t.sequenceId-n.sequenceId),J1=({definitions:e})=>e.map((t,n)=>({id:t.id,key:t.key,sequenceId:t.id,isHidden:!1,style:t.style||{}})),y7=()=>({definitions:[{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}],defaultUserSettings:[{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"}}],labels:[{id:1,key:"sku_name",label:"SKU",isLocalizable:!1},{id:2,key:"node",label:"Node",isLocalizable:!1},{id:3,key:"channel_name",label:"Channel",isLocalizable:!1}]});class Np extends R.Component{constructor(t){super(t),this.startDrag=this.startDrag.bind(this),this.endDrag=this.endDrag.bind(this),this.onMouseMove=this.onMouseMove.bind(this),this.dragging=!1,this.mouseX=0,this.startPos=0,this.startWidthPrev=0,this.lastDraggedWidth=0,this.draggedCol=null,this.resizeRef=R.createRef()}startDrag(){if(!this.props.disabled&&(this.draggedCol=this.props.id,this.props.resizeStart&&this.draggedCol===this.props.id&&this.props.resizeStart(),this.dragging=!0,this.startPos=this.mouseX,this.startWidthPrev=0,this.resizeRef.current)){let t=this.resizeRef.current.previousSibling;t&&(this.startWidthPrev=t.clientWidth)}}endDrag(){this.props.disabled||(this.dragging=!1,this.props.resizeEnd&&this.draggedCol===this.props.id&&this.props.resizeEnd(this.lastDraggedWidth),this.draggedCol=null)}onMouseMove(t){if(this.props.disabled||(this.mouseX=t.touches?t.touches[0].screenX:t.screenX,!this.dragging))return;const n=this.resizeRef.current,r=this.startPos-this.mouseX;let o=this.startWidthPrev-r;(!this.props.minWidth||o>=this.props.minWidth)&&(!this.props.maxWidth||o<=this.props.maxWidth)&&(n.previousSibling.style.width=o+"px",n.previousSibling.style.minWidth=o+"px",n.previousSibling.style.maxWidth=o+"px",n.previousSibling.style.setProperty("--column_resize_before_width",o+"px"),this.lastDraggedWidth=o)}componentDidMount(){const t=this.resizeRef.current;if(t&&(this.props.defaultWidth?(t.previousSibling.style.minWidth=this.props.defaultWidth+"px",t.previousSibling.style.width=this.props.defaultWidth+"px",t.previousSibling.style.maxWidth=this.props.defaultWidth+"px",t.previousSibling.style.setProperty("--column_resize_before_width",this.props.defaultWidth+"px")):this.props.minWidth&&(t.previousSibling.style.minWidth=this.props.minWidth+"px",t.previousSibling.style.width=this.props.minWidth+"px",t.previousSibling.style.maxWidth=this.props.minWidth+"px",t.previousSibling.style.setProperty("--column_resize_before_width",this.props.minWidth+"px"))),this.props.disabled){this.props.defaultWidth&&t&&(t.previousSibling.style.minWidth=this.props.defaultWidth+"px",t.previousSibling.style.width=this.props.defaultWidth+"px",t.previousSibling.style.maxWidth=this.props.defaultWidth+"px",t.previousSibling.style.setProperty("--column_resize_before_width",this.props.defaultWidth+"px")),this.props.maxWidth&&t&&(t.previousSibling.style.maxWidth=this.props.maxWidth+"px");return}this.addEventListenersToDocument()}componentWillUnmount(){this.props.disabled||this.removeEventListenersFromDocument()}componentDidUpdate(t,n){t.disabled&&!this.props.disabled&&this.addEventListenersToDocument(),!t.disabled&&this.props.disabled&&this.removeEventListenersFromDocument()}addEventListenersToDocument(){document.addEventListener("mousemove",this.onMouseMove),document.addEventListener("mouseup",this.endDrag),document.addEventListener("touchmove",this.onMouseMove),document.addEventListener("touchend",this.endDrag)}removeEventListenersFromDocument(){document.removeEventListener("mousemove",this.onMouseMove),document.removeEventListener("mouseup",this.endDrag),document.removeEventListener("touchmove",this.onMouseMove),document.removeEventListener("touchend",this.endDrag)}render(){var t={userSelect:"none"};return this.props.disabled||(t.cursor="ew-resize"),this.props.className===""&&(t.width="6px",t.backgroundColor="rgba(0, 0, 0, 0.1)"),R.createElement("th",{ref:this.resizeRef,style:t,disabled:this.props.disabled,rowSpan:this.props.rowSpan?this.props.rowSpan:1,colSpan:this.props.colSpan?this.props.colSpan:1,className:`column_resizer_own_class ${this.props.disabled?"disabled_column_resize":""} ${this.props.className}`,onMouseDown:this.props.disabled?null:this.startDrag,onTouchStart:this.props.disabled?null:this.startDrag})}}Np.defaultProps={disabled:!1,minWidth:0,className:""},Np.propTypes={disabled:"boolean",minWidth:"number",className:"string"};var Q1,ew;function $p(){return $p=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},$p.apply(null,arguments)}var b7=function(t){return S.createElement("svg",$p({xmlns:"http://www.w3.org/2000/svg",width:17,height:7,fill:"none"},t),Q1||(Q1=S.createElement("path",{fill:"#0582CA",d:"M4.652.5.676 3.493l3.976 2.981V4.051h8.354V2.859H4.652z"})),ew||(ew=S.createElement("path",{fill:"#0582CA",d:"M12.36.5v2.384H4.008v1.193h8.352v2.396l.956-.716 3.022-2.265z"})))};const v7=(e,t,n,r,o)=>{const[i,a]=R.useState({isOpen:!1,column:null}),l=(f,p,h)=>{a({isOpen:f.currentTarget,column:p,isChild:!!h})},c=()=>{a({isOpen:!1,column:null,isChild:!1})},u=async()=>{c();const f=e.map(p=>{var h,y;if(i!=null&&i.isChild&&Array.isArray(p.children)){const m=p.children.map(x=>{var w;return x.id===i.column.id&&x.key===((w=i.column)==null?void 0:w.key)?{...x,isHidden:!0}:x}),b=m.every(x=>x.isHidden);return{...p,isHidden:b?!0:p.isHidden,children:m}}return p.id===((h=i==null?void 0:i.column)==null?void 0:h.id)&&p.key===((y=i.column)==null?void 0:y.key)?{...p,isHidden:!0}:p});d({updatedColumns:f})},d=async({updatedColumns:f})=>{t({type:qe.SET_GRID_DATA,payload:{visibleGridColumns:f}});const p=r.split("/").filter(Boolean),m={...JSON.parse(localStorage.getItem(Rr.SETTINGS))||{platform:{theme:"light"}}},b=p.reduce((C,O)=>C==null?void 0:C[O],Ca.GRID_SETTINGS)||null,x=(b==null?void 0:b.pageSize)??o;let w=m;for(let C=0;C<p.length;C++){const O=p[C];C===p.length-1?w[O]={columns:f,pageSize:x}:(w[O]={...w[O]||{}},w=w[O])}localStorage.setItem(Rr.SETTINGS,JSON.stringify(m)),await _c({baseUrl:n,payload:m})};return{selectedColumn:i,handleMenuClick:l,handleClose:c,handleHideClick:u,columnUpdaterFunction:d}},tw=({pagination:e,gridPath:t,baseUrl:n})=>{const{selectedPage:r,rowPerPage:o,totalRecords:i,onPageChange:a,onPageSizeChange:l}=e,c=It(),u=async(d,f)=>{if(!f)return;const p=f.split("/").filter(Boolean),h="settings",m={...JSON.parse(localStorage.getItem(h))||{}};let b=m;for(let x=0;x<p.length;x++){const w=p[x];x===p.length-1?b[w]={...b[w]||{},pageSize:d}:(b[w]={...b[w]||{}},b=b[w])}localStorage.setItem(h,JSON.stringify(m)),await _c({baseUrl:n,payload:m})};return g.jsxs(ye,{sx:{display:"flex",p:"1rem 1.5rem"},children:[g.jsxs(ye,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"0.5rem",width:"100%"},children:[g.jsx(st,{sx:{fontSize:"1.1rem",color:c.palette.primary.notifyTextColor},children:`Showing ${Math.min(r*o,i)} of ${i} rows`}),g.jsx(ye,{sx:{"& .MuiInputBase-input":{padding:"0rem 0.8rem!important"},width:"6rem"},children:g.jsx(Sc,{options:c7,value:o,onChange:async d=>{l(d),u(d==null?void 0:d.value,t)}})})]}),g.jsx(Tg,{count:Math.ceil(i/o),page:r,onChange:async(d,f)=>{a(f)},siblingCount:0,shape:"rounded",sx:{width:"100%","& .MuiPagination-ul":{width:"100%",display:"flex",justifyContent:"flex-end","& li:first-of-type":{border:`0.1rem solid ${c.palette.primary.notifyBorderColor}`,color:c.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 ${c.palette.primary.notifyBorderColor}`,color:c.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:c.palette.primary.notifyActiveText,backgroundColor:`${c.palette.brandColor.paginationBc} !important`}}})]})};tw.propTypes={pagination:s.object.isRequired};function _p({isRenderCellContent:e,column:t,row:n,parent:r}){const o=n[t.key];return g.jsx(g.Fragment,{children:e?g.jsx(ye,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",textTransform:"none",fontSize:"1.1rem"},children:t==null?void 0:t.cellRenderer(n,{column:t,parent:r})}):g.jsx(Ag,{title:(o==null?void 0:o.length)>20?o:"",arrow:!0,children:g.jsx(ye,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",textTransform:"none",fontSize:"1.1rem"},id:t.key,component:"label",children:m8(o)})})})}_p.propTypes={isRenderCellContent:s.bool,column:s.object,row:s.object};const nw=({menuOpen:e,handleClose:t,onHideClick:n})=>{const r=It();return g.jsx(Si,{open:!!e,anchorEl:e,onClose:t,anchorOrigin:{vertical:"bottom",horizontal:"left"},children:g.jsx(ye,{sx:{backgroundColor:r.palette.primary.notifyBackground,border:`0.1rem solid ${r.palette.primary.notifyBorderColor}`,minHeight:"2.3rem",display:"flex",justifyContent:"center",alignItems:"center"},children:g.jsx(Hn,{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:"Hide Column"})})})};nw.propTypes={menuOpen:s.object,handleClose:s.func,onHideClick:s.func},G(kl)(({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 Oo=G(st)(({theme:e})=>({color:e.palette.primary.notifyTextColor,fontSize:"1.1rem"})),x7=G(jg)(({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)"})}})),w7=G(yi)(({theme:e})=>({color:e.palette.primary.notifyTextColor,padding:"0.6rem 0",fontSize:"0.9rem",fontWeight:500,"&::before, &::after":{borderColor:`${e.palette.primary.notifyBorderColor}!important`}})),C7=G(nd)(({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"}}));G(Fl)(({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 S7=G(Jg)(({theme:e})=>({minHeight:"2rem","& .MuiTabs-indicator":{height:"0.1rem",backgroundColor:e.palette.primary.notifyActiveText}})),Fp=G(Ng)(({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}})),Fc=G(Qu)(({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`}})),rw=({sortKey:e,sortField:t,sortDir:n,handleSortClick:r})=>{const o=i=>g.jsx(Ir,{onClick:r,sx:{padding:"0.5rem"},children:g.jsx(hn,{url:i})});return g.jsx(g.Fragment,{children:o(t===e?n==="asc"?Ke.AscSort:Ke.DescSort:Ke.Unsort)})};rw.propTypes={sortKey:s.string.isRequired,sortField:s.string,sortDir:s.string,handleSortClick:s.func};function ow({parent:e,column:t,sort:n,handleMenuClick:r,isManageable:o}){const i=t==null?void 0:t.isMandatory,a=t==null?void 0:t.label,l=t==null?void 0:t.isSortable,c=n==null?void 0:n.sortField,u=n==null?void 0:n.sortDir,d=n==null?void 0:n.onSort;return g.jsxs(ye,{sx:{display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.1rem",textAlign:"center",whiteSpace:"normal"},children:[a,g.jsxs(ye,{sx:{display:"flex",alignItems:"center"},children:[l&&g.jsx(rw,{sortKey:e?`${e==null?void 0:e.key}|${t==null?void 0:t.key}`:t==null?void 0:t.key,sortField:c,sortDir:u,handleSortClick:()=>d({column:t,sortDir:u,sortField:c,parent:e})}),o&&!i&&!e&&g.jsx(Ir,{onClick:f=>r(f,t,e),sx:{padding:"0.5rem 0.2rem"},children:g.jsx(hn,{url:Ke.Menu})})]})]})}ow.propTypes={column:s.object.isRequired,sort:s.object.isRequired,handleMenuClick:s.func,isManageable:s.bool};const T7=G($l)(({theme:e})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"table-cell",[`&.${vd.head}`]:{color:e.palette.primary.notifyTextColor,backgroundColor:e.palette.primary.notifyBackground,borderColor:e.palette.primary.notifyBorderColor,padding:"0.3rem 0.5rem",textAlign:"center"},[`&.${vd.body}`]:{color:e.palette.primary.notifyTextColor,borderColor:e.palette.primary.notifyBorderColor,padding:"0.3rem 0.5rem",textAlign:"center"}}));function Ta({children:e,...t}){return g.jsx(T7,{...t,children:e})}Ta.propTypes={children:s.node};const O7=G(Hg)(()=>({"&:last-child td":{borderBottom:0}}));function As({children:e,...t}){return g.jsx(O7,{...t,children:e})}As.propTypes={children:s.node};function sw({rows:e,sort:t,data:n,pagination:r,columns:o,nested:i,baseUrl:a,gridPath:l}){var ue;const c=It(),{visibleGridColumns:u}=R.useContext(ga),d=R.useContext(ya),{selectedColumn:f,handleMenuClick:p,handleClose:h,handleHideClick:y,columnUpdaterFunction:m}=v7(u,d,a,l,r==null?void 0:r.rowPerPage),b=o==null?void 0:o.isManageable,x=o==null?void 0:o.isResizable,w=(n==null?void 0:n.length)>0,C=R.useRef(null),[O,v]=R.useState(null),[k,E]=R.useState(null),[M,D]=R.useState(null);let A=null;const $=R.useRef(0),I=R.useRef(!1),V=R.useRef(null),F=g7(((ue=i==null?void 0:i.column)==null?void 0:ue.definitions)||[]),N=i==null?void 0:i.isNested,P=(i==null?void 0:i.data)||[],j=i==null?void 0:i.hashKey;if(R.useEffect(()=>{const _=C.current,q=_==null?void 0:_.querySelector("thead");if(!q)return;const X=()=>{D(null)};return q==null||q.addEventListener("mousedown",X),()=>{q==null||q.removeEventListener("mousedown",X)}},[]),!w)return g.jsx(Oo,{sx:{textAlign:"center"},children:Gr.NRF});const W=(_,q)=>{var oe,ce;if(I.current){_.preventDefault();return}v(q),D(null),_.dataTransfer.setData("colIndex",q);const X=u[q],Y=X==null?void 0:X.label,L=document.createElement("div");L.textContent=Y,Object.assign(L.style,{display:"flex",alignItems:"center",justifyContent:"center",padding:"1.5rem 2.5rem",minWidth:(oe=X==null?void 0:X.style)==null?void 0:oe.minWidth,maxWidth:(ce=X==null?void 0:X.style)==null?void 0:ce.maxWidth,fontSize:"1.2rem",fontWeight:"500",color:c.palette.primary.notifyTextColor,background:c.palette.primary.notifyBackground,border:`0.1rem solid ${c.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(L);const{offsetWidth:K,offsetHeight:ee}=L;_.dataTransfer.setDragImage(L,K/2,ee/2),requestAnimationFrame(()=>{document.body.removeChild(L)})},U=(_,q)=>{_.preventDefault(),E(q),Q(_)},B=async(_,q)=>{if(_.preventDefault(),clearInterval(A),O===null||O===q)return;const X=[...u],[Y]=X.splice(O,1);X.splice(q,0,Y);const L=u.slice().sort((ee,oe)=>ee.sequenceId-oe.sequenceId).map(ee=>ee.sequenceId),K=X.map((ee,oe)=>({...ee,sequenceId:L[oe]??ee.sequenceId}));m({updatedColumns:K}),v(null),E(null)},z=()=>{v(null),E(null)},Z=(_,q,X,Y)=>{var me,ge,$e,Ae,Me,ze,Xe;if(!_)return null;const L=(_==null?void 0:_.isMandatory)&&(_==null?void 0:_.isSticky),K=parseFloat((ge=(me=_==null?void 0:_.style)==null?void 0:me.minWidth)==null?void 0:ge.toString().replace("rem",""))||7.5;q===0&&($.current=0);const ee=L?q===0?0:`${$.current}rem`:void 0;L&&($.current+=K);const oe=O===q,ce=k==q||(($e=u==null?void 0:u[k])==null?void 0:$e.isMandatory),Ce=Fe=>{_.isMandatory?(Fe.preventDefault(),Fe.dataTransfer.dropEffect="none"):(Fe.preventDefault(),Fe.dataTransfer.dropEffect="move"),U==null||U(Fe,q)},ae=Fe=>{_.isMandatory||B==null||B(Fe,q)},we=Y?`${Y==null?void 0:Y.key}_${_==null?void 0:_.key}_${q}`:q;return g.jsx(Ta,{rowSpan:_!=null&&_.children?1:2,colSpan:x?((Me=(Ae=_==null?void 0:_.children)==null?void 0:Ae.filter(Fe=>!(Fe!=null&&Fe.isHidden)))==null?void 0:Me.length)*2-1:(Xe=(ze=_==null?void 0:_.children)==null?void 0:ze.filter(Fe=>!(Fe!=null&&Fe.isHidden)))==null?void 0:Xe.length,style:_==null?void 0:_.style,onMouseEnter:()=>{M!==we&&D(we)},draggable:X&&!Y&&!(_!=null&&_.isMandatory),onDragStart:X?Fe=>W(Fe,q):void 0,onDragOver:X?Ce:void 0,onDrop:X?ae:void 0,onDragEnd:X?z:void 0,sx:{...oe&&{border:`0.1rem solid ${c.palette.brandColor.lightBlue}!important`},...L&&{borderRadius:"0rem!important",position:"sticky",left:ee,zIndex:3},..._!=null&&_.children?{}:{borderLeft:Fe=>(_==null?void 0:_.key)==="volume_value"&&`0.1rem solid ${Fe.palette.primary.notifyBorderColor}`,borderRight:Fe=>(_==null?void 0:_.key)==="volume_value"&&`0.1rem solid ${Fe.palette.primary.notifyBorderColor}`},cursor:ce?"not-allowed":X&&!(_!=null&&_.isMandatory)?"grab":"default"},children:g.jsx(ow,{parent:Y,column:_,sort:t,handleMenuClick:p,isManageable:X})},q)},re=(_,q,X,Y)=>{var oe,ce,Ce;if(!_)return null;const L=(_==null?void 0:_.isMandatory)&&(_==null?void 0:_.isSticky),K=parseFloat((ce=(oe=_==null?void 0:_.style)==null?void 0:oe.minWidth)==null?void 0:ce.toString().replace("rem",""))||7.5;X===0&&($.current=0);const ee=L?X===0?0:`${$.current}rem`:void 0;return L&&($.current+=K),g.jsxs(Ta,{colSpan:1,style:_==null?void 0:_.style,className:`${_==null?void 0:_.label}`,sx:{position:"relative",...L&&{position:"sticky",left:ee,zIndex:2,backgroundColor:ae=>{var we;return e!=null&&e.selectedRow&&((we=e==null?void 0:e.selectedRow)==null?void 0:we.fhi)===(q==null?void 0:q.fhi)||q!=null&&q.isHigh?ae.palette.primary.appBackground:ae.palette.primary.notifyBackground}},...Y?{p:"0rem!important"}:{px:"0rem!important",borderLeft:ae=>(_==null?void 0:_.key)==="volume_value"&&`0.1rem solid ${ae.palette.primary.notifyBorderColor}`,borderRight:ae=>(_==null?void 0:_.key)==="volume_value"&&`0.1rem solid ${ae.palette.primary.notifyBorderColor}`}},children:[((e==null?void 0:e.selectedRow)&&((Ce=e==null?void 0:e.selectedRow)==null?void 0:Ce.fhi)===(q==null?void 0:q.fhi)||(q==null?void 0:q.isHigh))&&g.jsx(ye,{sx:{position:"absolute",bottom:0,left:0,width:"100%",height:"0.08rem",background:"linear-gradient(#F9B16E, #F68080)",pointerEvents:"none"}}),g.jsx(_p,{isRenderCellContent:!!(_!=null&&_.cellRenderer),column:_,row:q,parent:Y})]},X)},J=(_,q,X,Y)=>{var K;const L=Y?`${Y==null?void 0:Y.key}_${_==null?void 0:_.key}_${q}`:q;return(K=[...u].map((ee,oe)=>({col:ee,index:oe})).reverse().find(({col:ee})=>Array.isArray(ee.children)&&ee.children.length>0))==null||K.index,g.jsx(g.Fragment,{children:_&&!(_!=null&&_.isMandatory)&&X?g.jsx(ye,{resizeStart:()=>{I.current=!0},resizeEnd:()=>{I.current=!1},component:_!=null&&_.children?$l:Np,rowSpan:_!=null&&_.children?1:2,colSpan:1,id:q,sx:{width:"2rem",maxWidth:"2rem",minWidth:"2rem",padding:0,position:"relative",background:c.palette.primary.notifyBackground,borderBottom:`0.1rem solid ${c.palette.primary.notifyBorderColor}`,"&::after":{content:'""',position:"absolute",left:"50%",top:0,transform:"translateX(-50%)",width:"0.15rem",height:"calc(100% + 0.1rem)",backgroundColor:M===L&&!(_!=null&&_.children)?c.palette.brandColor.lightBlue:Y||_!=null&&_.children?c.palette.primary.notifyBorderColor:"transparent",transition:"background-color 0.2s ease",zIndex:1}},disabled:!X}):null})},ie=(_,q,X,Y,L,K)=>{var oe;const ee=K?`${K==null?void 0:K.key}_${q==null?void 0:q.key}_${X}`:X;return g.jsx(g.Fragment,{children:q&&!(q!=null&&q.isMandatory)&&Y?g.jsxs($l,{className:"column_resizer_body",sx:{padding:0,position:"relative",borderBottom:`0.1rem solid ${c.palette.primary.notifyBorderColor}`,"&::after":{content:'""',position:"absolute",left:"50%",top:0,transform:"translateX(-50%)",width:"0.15rem",height:"calc(100% + 0.1rem)",backgroundColor:M===ee?c.palette.brandColor.lightBlue:K||q!=null&&q.children?c.palette.primary.notifyBorderColor:"transparent",transition:"background-color 0.2s ease",zIndex:1}},children:[L===0&&M===ee&&g.jsx(ye,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:1,pointerEvents:"none"},children:g.jsx(b7,{})}),((e==null?void 0:e.selectedRow)&&((oe=e==null?void 0:e.selectedRow)==null?void 0:oe.fhi)===(_==null?void 0:_.fhi)||(_==null?void 0:_.isHigh))&&g.jsx(ye,{sx:{position:"absolute",bottom:0,left:0,width:"100%",height:"0.08rem",background:"linear-gradient(#F9B16E, #F68080)",pointerEvents:"none"}})]},`resize-${X}`):null})},Q=_=>{const q=C.current,{left:X,right:Y}=q.getBoundingClientRect(),L=50,K=_.clientX>Y-L?1:_.clientX<X+L?-1:0;K!==0?(V.current&&clearInterval(V.current),V.current=setInterval(()=>{q.scrollLeft+=K*10},50)):V.current&&(clearInterval(V.current),V.current=null)};return g.jsxs(g.Fragment,{children:[g.jsx(Lg,{sx:{maxHeight:"100%",whiteSpace:"nowrap",overflow:"auto",width:"100%",border:`0.1rem solid ${c.palette.primary.notifyBorderColor}`,borderRadius:"1.4rem"},children:g.jsxs(_g,{ref:C,"aria-label":"sticky table",sx:{backgroundColor:_=>_.palette.primary.notifyBackground},children:[g.jsxs(Wg,{children:[g.jsx(As,{children:u.map((_,q)=>_!=null&&_.isHidden?null:g.jsxs(R.Fragment,{children:[Z(_,q,b),x&&J(_,q,b)]},q))}),g.jsx(As,{children:u.flatMap((_,q)=>_!=null&&_.isHidden||!(_!=null&&_.children)?[]:_.children.map((X,Y)=>X!=null&&X.isHidden?null:g.jsxs(R.Fragment,{children:[Z(X,Y,b,_),x&&J(X,Y,b,_)]},`${q}-${Y}`)))})]}),g.jsx(Bg,{children:n.map((_,q)=>{const X=_[j],Y=P==null?void 0:P[X],L=(Y==null?void 0:Y.length)>0;return g.jsxs(R.Fragment,{children:[g.jsx(As,{sx:{backgroundColor:K=>{var ee;return e&&((ee=e==null?void 0:e.selectedRow)==null?void 0:ee.fhi)===(_==null?void 0:_.fhi)||_!=null&&_.isHigh?K.palette.primary.appBackground:K.palette.primary.notifyBackground}},onClick:()=>e==null?void 0:e.onRowClick(_),children:u.map((K,ee)=>K!=null&&K.isHidden?null:K!=null&&K.children?K.children.map((oe,ce)=>oe!=null&&oe.isHidden?null:g.jsxs(R.Fragment,{children:[re(oe,_,ce,K),x&&ie(_,oe,ce,b,q,K)]},`${ee}-${ce}`)):g.jsxs(R.Fragment,{children:[re(K,_,ee),x&&ie(_,K,ee,b,q)]},ee))}),N&&Y&&g.jsx(g.Fragment,{children:L?Y.map((K,ee)=>g.jsx(As,{children:F.map((oe,ce)=>g.jsx(Ta,{style:oe==null?void 0:oe.style,children:g.jsx(_p,{isRenderCellContent:!!(oe!=null&&oe.cellRenderer),column:oe,row:K})},ce))},`nested-${ee}`)):g.jsx(As,{children:g.jsx(Ta,{colSpan:F.length,children:g.jsx(Oo,{sx:{textAlign:"center"},children:Gr.NRF})})})})]},q)})})]})}),r&&g.jsx(tw,{pagination:r,gridPath:l,baseUrl:a}),g.jsx(nw,{menuOpen:f==null?void 0:f.isOpen,handleClose:h,onHideClick:y})]})}sw.propTypes={sort:s.object,data:s.array,pagination:s.object,columns:s.object,nested:s.object};function iw({tableProps:e,isDefaultConfig:t,gridPath:n,baseUrl:r}){var u;const{columns:o}=e,{visibleGridColumns:i=[]}=R.useContext(ga)??{},a=R.useContext(ya),l=R.useMemo(()=>{var d;return m7({columns:o,gridPath:n,baseUrl:r,isDefaultConfig:t,pageSize:(d=e==null?void 0:e.pagination)==null?void 0:d.rowPerPage})},[o,n,r,t,(u=e==null?void 0:e.pagination)==null?void 0:u.rowPerPage]),c=R.useMemo(()=>{const d=new Map(i.map(f=>[f.key,f]));return l.map(f=>{const p=d.get(f.key);return{...f,...p&&{isHidden:p.isHidden,sequenceId:p.sequenceId}}}).sort((f,p)=>f.sequenceId-p.sequenceId)},[l,i]);return R.useEffect(()=>{a({type:qe.SET_GRID_DATA,payload:{visibleGridColumns:i.length?c:l}})},[l]),g.jsx(sw,{...e,gridPath:n,baseUrl:r})}iw.propTypes={tableProps:s.object.isRequired,mergedColumns:s.array.isRequired};const aw=({type:e})=>{const t=It(),r=(t==null?void 0:t.mode)==="dark"?{bgcolor:"grey.800"}:{};return{grid:g.jsxs(ye,{sx:{borderRadius:2,overflow:"hidden"},children:[g.jsx(Tr,{variant:"text",width:"100%",height:60,sx:r}),Array.from({length:10}).map((i,a)=>g.jsx(ye,{sx:{display:"flex",alignItems:"center",padding:"0.5rem",gap:"3rem"},children:Array.from({length:5}).map((l,c)=>g.jsx(ye,{sx:{flex:1},children:g.jsx(Tr,{variant:"text",height:45,sx:r})},c))},a))]}),toolbar:g.jsx(g.Fragment,{children:g.jsxs(ft,{direction:"row",justifyContent:"space-between",sx:{display:"flex",gap:"1rem"},children:[g.jsxs(ft,{direction:"row",gap:"1rem",children:[g.jsx(Tr,{variant:"text",width:"10.2rem",height:"5rem",sx:r}),g.jsx(Tr,{variant:"text",width:"3.5rem",height:"5rem",sx:r}),g.jsx(Tr,{variant:"text",width:"15.2rem",height:"5rem",sx:r})]}),g.jsxs(ft,{direction:"row",gap:"1rem",children:[g.jsx(Tr,{variant:"text",width:"10.2rem",height:"5rem",sx:r}),g.jsx(Tr,{variant:"text",width:"3.5rem",height:"5rem",sx:r}),g.jsx(Tr,{variant:"text",width:"3.5rem",height:"5rem",sx:r})]})]})})}[e]},k7=e=>{if(!e)return null;const{options:t,...n}=e,r=t?"select":"button",o={button:i=>{var a;return g.jsx(mo,{...i,styles:{...i.styles,iconPrimary:((a=i==null?void 0:i.styles)==null?void 0:a.variant)=="filled"}})},select:i=>{var a;return g.jsx(ye,{sx:{"& .MuiInputBase-input":{padding:"0rem!important"},width:(a=i.styles)==null?void 0:a.width},children:g.jsx(l1,{...i,options:t})})}};return o[r]?o[r](n):null},E7=({presentSetting:e,gridSetting:t,gridPath:n})=>{var a;if(!n)return e;const r=n.split("/").filter(Boolean),o=(a=t==null?void 0:t.grid)==null?void 0:a.map(({id:l,isHidden:c,isSortable:u,key:d,sequenceId:f})=>({id:l,isHidden:c,isSortable:u,key:d,sequenceId:f}));let i=e;for(let l=0;l<r.length;l++){const c=r[l];l===r.length-1?i[c]={columns:o,pageSize:(t==null?void 0:t.pageSize)??null}:(i[c]=i[c]||{},i=i[c])}return{settingObject:e,defaultUserSettings:o}},P7=async({baseUrl:e,gridSetting:t,gridPath:n})=>{try{const r=JSON.parse(localStorage.getItem("settings")),{settingObject:o,defaultUserSettings:i}=E7({presentSetting:r,gridSetting:t,gridPath:n});return localStorage.setItem("settings",JSON.stringify(o)),await _c({baseUrl:e,payload:o}),i}catch(r){console.error(r)}},M7=({customTools:e})=>{var r,o;const t=(r=e==null?void 0:e.filter(i=>(i==null?void 0:i.type)===X1.PRIMARY))==null?void 0:r.sort((i,a)=>i.sequenceId-a.sequenceId),n=(o=e==null?void 0:e.filter(i=>(i==null?void 0:i.type)===X1.SECONDARY))==null?void 0:o.sort((i,a)=>i.sequenceId-a.sequenceId);return{primaryButtons:t,secondaryButtons:n}},lw=({customTools:e,isExpanded:t,setIsExpanded:n})=>{const{primaryButtons:r,secondaryButtons:o}=M7({customTools:e}),[i,a]=R.useState(r),l=(o==null?void 0:o.length)>0,c=d=>{d?a([...r,...o]):setTimeout(()=>{a(r)},100)},u=()=>{const d=!t;n(d),c(d)};return R.useEffect(()=>{c(t)},[e]),g.jsxs(g.Fragment,{children:[t&&g.jsx("div",{style:{position:"fixed",left:0,width:"100vw",height:"4rem",zIndex:998}}),g.jsxs(ye,{sx:{display:"flex",alignItems:"center",gap:"0.8rem",flexWrap:"nowrap",maxWidth:"100%",whiteSpace:"nowrap",zIndex:999},children:[g.jsx(Q5,{mode:"popLayout",children:i.map((d,f)=>g.jsx(Gi.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},layout:!0,children:g.jsx(ye,{sx:{flexShrink:0,minWidth:"fit-content"},children:k7(d)})},`${d.id}_${f}`))}),l&&g.jsx(ye,{sx:{paddingLeft:t?"0.5rem":0},children:g.jsx(mo,{label:t?"":"More Actions",styles:{iconPrimary:!0,icon:t?Ke.CrossWhite:Ke.More,colorType:t?"danger":""},onClick:u})})]})]})};lw.propTypes={customTools:s.array.isRequired};const cw=({defaultTools:e,isManageable:t,customTools:n,baseUrl:r,gridPath:o,managableColumns:i=[],pageSize:a})=>{var x,w,C,O,v,k;const l=R.useContext(ya),{visibleGridColumns:c,triggerApi:u}=R.useContext(ga),[d,f]=R.useState([]),[p,h]=R.useState(!1);R.useEffect(()=>{if(i.length){const E=i.length?c.filter(M=>i.includes(M.id)).map(({children:M,...D})=>D):c;f(E)}},[i,c]);const y=async E=>{try{await P7({baseUrl:r,gridPath:o,gridSetting:{grid:E,pageSize:a}})}catch(M){console.error(M)}finally{l({type:qe.HAS_SETTING_CHANGE,payload:{hasChange:!1}}),l({type:qe.TRIGGER_API,payload:{triggerApi:!1}})}};R.useEffect(()=>{u&&y(c)},[u]);const m=E=>{const M=E.map(A=>A.id),D=c.map(A=>{if(!d.some(V=>V.id===A.id))return A;const I=M.includes(A.id);if(Array.isArray(A.children)&&A.children.length>0){const V=A.children.map(N=>{const P=E.flatMap(U=>U.children||[]).map(U=>U.id);if(!d.some(U=>(U.children||[]).some(B=>B.id===N.id&&B.key===N.key)))return N;const W=P.includes(N.id);return{...N,isHidden:!W}}),F=V.filter(N=>d.some(P=>(P.children||[]).some(j=>j.id===N.id))).every(N=>N.isHidden);return{...A,isHidden:I?!1:F||!I,children:V}}else return{...A,isHidden:!M.includes(A.id)}});l({type:qe.SET_GRID_DATA,payload:{visibleGridColumns:D}}),l({type:qe.HAS_SETTING_CHANGE,payload:{hasChange:!0}})},b=()=>d.map(E=>{const M=Array.isArray(E.children)?E.children.filter(D=>!D.isHidden):void 0;return!E.isHidden||M&&M.length?{...E,children:M}:null}).filter(Boolean);return g.jsxs(ye,{sx:{margin:"1rem 0",position:"relative",zIndex:10,display:"flex",flexDirection:"row",justifyContent:"space-between",gap:"0.6rem",width:"100%"},children:[g.jsxs(ye,{sx:{display:"flex",flexDirection:"row",gap:"0.6rem"},children:[((x=e==null?void 0:e.search)==null?void 0:x.isRequired)&&g.jsx(s1,{...e==null?void 0:e.search,iconUrl:Ke.Search}),((w=e==null?void 0:e.groupBy)==null?void 0:w.isRequired)&&g.jsx(ye,{sx:{"& .MuiInputBase-input":{padding:"0rem!important"}},children:g.jsx(Sc,{styles:{icon:Ke.Group},...e.groupBy})}),((C=e==null?void 0:e.refresh)==null?void 0:C.isRequired)&&g.jsx(mo,{...e==null?void 0:e.refresh,styles:{variant:"filled",icon:Ke.Refresh,colorType:"empty",width:"3.2rem",height:"3.2rem"}}),t&&g.jsx(ye,{sx:{"& .MuiInputBase-input":{padding:"0rem!important"}},children:g.jsx(Sc,{placeholder:"Manage Columns",options:d,value:b(),isMulti:!0,isDraggable:!0,showSearch:!0,onChange:m,styles:{icon:Ke.Manage}})})]}),g.jsxs(ye,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-end",gap:"0.6rem"},children:[n&&g.jsx(lw,{customTools:n,setIsExpanded:h,isExpanded:p}),((O=e==null?void 0:e.save)==null?void 0:O.isRequired)&&g.jsx(ye,{sx:{px:"0.5rem"},children:g.jsx(mo,{label:p?"":"Save",styles:{icon:Ke.Save,colorType:"empty"},...e==null?void 0:e.save})}),((v=e==null?void 0:e.upload)==null?void 0:v.isRequired)&&g.jsx(mo,{...e==null?void 0:e.upload,styles:{variant:p?"outlined":"filled",icon:p?Ke.UploadDark:Ke.Upload,iconPrimary:!p,colorType:"secondary",isAnimate:!0}}),((k=e==null?void 0:e.download)==null?void 0:k.isRequired)&&g.jsx(mo,{...e==null?void 0:e.download,styles:{variant:"outlined",icon:Ke.Download,isAnimate:!0}})]})]})};cw.propTypes={defaultTools:s.object.isRequired,customTools:s.array,isManageable:s.bool,baseUrl:s.string,gridPath:s.gridPath};function Bp({tableProps:e,toolbarProps:t,isDefaultConfig:n,isLoading:r}){var i,a;const o=(i=e.columns)==null?void 0:i.isManageable;return g.jsx(a1,{children:r?g.jsxs(g.Fragment,{children:[g.jsx(aw,{type:"toolbar"}),g.jsx(aw,{type:"grid"})]}):g.jsxs(ye,{sx:{position:"sticky"},children:[t&&g.jsx(cw,{...t,isManageable:o,pageSize:(a=e==null?void 0:e.pagination)==null?void 0:a.rowPerPage}),g.jsx(iw,{tableProps:e,isDefaultConfig:n,gridPath:(t==null?void 0:t.gridPath)||"",baseUrl:(t==null?void 0:t.baseUrl)||""})]})})}Bp.propTypes={tableProps:s.object.isRequired,toolbarProps:s.object,isDefaultConfig:s.bool};const uw=({list:e,handleLinkClick:t})=>{const n=It(),r=({list:o})=>{var i;return(i=o==null?void 0:o.sort((a,l)=>a.order-l.order))==null?void 0:i.map((a,l)=>a!=null&&a.link?g.jsx(Fr,{component:"h3",sx:{fontSize:"1rem",cursor:"pointer",color:l===(o==null?void 0:o.length)-1?n.palette.brandColor.orange:n.palette.primary.notifyTextColor},href:a==null?void 0:a.link,underline:"hover",onClick:()=>t(a),children:a==null?void 0:a.title},l):g.jsx(st,{component:"h3",sx:{fontSize:"1rem",color:l===(o==null?void 0:o.length)-1?n.palette.brandColor.orange:n.palette.primary.notifyTextColor},children:a==null?void 0:a.title},l))};return g.jsx(L0,{separator:g.jsx(hn,{url:Ke.ArrowRight}),children:r({list:e})})};uw.propTypes={list:s.array.isRequired,handleLinkClick:s.func};const dw=({breadcrumbProps:e,switchProps:t,filterComponentProps:n})=>{var o,i,a,l,c,u;const r=It();return g.jsxs(g.Fragment,{children:[g.jsxs(ft,{sx:{background:r.palette.primary.notifyBackground,borderBottom:`0.1rem solid ${r.palette.primary.notifyBorderColor}`,height:"3rem",p:"0px 1.5rem 0 1.5rem",zIndex:4,position:"relative"},direction:"row",justifyContent:"space-between",alignItems:"center",children:[g.jsx(uw,{...e}),g.jsxs(ft,{direction:"row",gap:"1rem",alignItems:"center",children:[t&&g.jsx(f1,{...t}),(n==null?void 0:n.filterBtnProps)&&g.jsxs(ft,{direction:"row",children:[g.jsx(yi,{orientation:"vertical",flexItem:!0,sx:{mx:"1rem",height:"2rem!important",opacity:"1!important",borderColor:r.palette.primary.notifyBorderColor}}),g.jsxs(ft,{direction:"row",alignItems:"center",gap:"0.5rem",onClick:(o=n==null?void 0:n.filterBtnProps)==null?void 0:o.onFilterClick,sx:{cursor:"pointer"},children:[g.jsx(hn,{url:Ke.Filter}),g.jsx(st,{sx:{fontSize:"1.1rem",color:r.palette.primary.notifyActiveText},children:(i=n==null?void 0:n.filterBtnProps)==null?void 0:i.label})]})]})]})]}),g.jsx(Gi.div,{layout:!0,initial:{height:"0rem"},animate:{height:(a=n==null?void 0:n.filterBtnProps)!=null&&a.filterContainerVisible?"5rem":"0rem",opacity:(l=n==null?void 0:n.filterBtnProps)!=null&&l.filterContainerVisible?1:0},transition:{duration:.5,ease:"easeInOut"},style:{background:r.palette.primary.notifyBackground,borderBottom:`0.1rem solid ${r.palette.primary.notifyBorderColor}`,padding:"0px 5.5rem 0 1.5rem",position:"relative",alignItems:"center",display:"flex",overflow:"hidden"},children:g.jsxs(ft,{sx:{background:r.palette.primary.appBackground,height:"3.8rem",p:"0 2rem",width:"100%",borderRadius:"0.7rem",overflow:"visible"},direction:"row",alignItems:"center",children:[g.jsx(st,{sx:{fontSize:"1.2rem",fontWeight:"500",color:r.palette.primary.notifyActiveText},children:"Filters:"}),g.jsx(ye,{sx:{overflowX:"auto",overflowY:"visible",whiteSpace:"nowrap",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"},margin:"0 1rem",padding:"0.5rem 0",flexGrow:1},children:g.jsx(ft,{direction:"row",gap:"1.2rem",sx:{overflow:"visible"},children:(c=n==null?void 0:n.filterItems)==null?void 0:c.map((d,f)=>g.jsx(g.Fragment,{children:g.jsxs(ye,{sx:{position:"relative",overflow:"visible",border:`0.1rem solid ${r.palette.primary.notifyBorderColor}`,background:r.palette.primary.notifyBackground,borderRadius:"0.6rem",padding:"0.3rem 1.1rem",display:"inline-block"},children:[g.jsx(ye,{component:"img",src:Ke.FilterClose,sx:{position:"absolute",top:"-0.4rem",right:"-0.6rem",cursor:"pointer"},onClick:()=>n==null?void 0:n.onFilterChipClose(d)}),g.jsx(st,{sx:{fontSize:"1rem",color:r.palette.primary.notifyTextColor},children:d==null?void 0:d.filterLabel})]},f)}))})}),g.jsx(ye,{component:st,sx:{fontSize:"1.1rem",fontWeight:"500",textDecoration:"underline",color:r.palette.brandColor.red,cursor:"pointer"},onClick:(u=n==null?void 0:n.filterContainerProps)==null?void 0:u.onClearClick,children:"Clear"})]})})]})};dw.propTypes={breadcrumbProps:s.object.isRequired,switchProps:s.object};function fw({headerProps:e}){return g.jsx(Fn,{children:g.jsx(dw,{...e})})}fw.propTypes={headerProps:s.object.isRequired};const Lp=R.createContext(null),pw=R.createContext(null);function R7({children:e}){const[t,n]=R.useReducer(D7,I7);return g.jsx(Lp.Provider,{value:t,children:g.jsx(pw.Provider,{value:n,children:e})})}function D7(e,t){var n;switch(t.type){case qe.LOADING:return{...e,loading:t.loading};case qe.SUCCESS:return{...e,data:(n=t.data)==null?void 0:n.sort((r,o)=>new Date(o.createdAt)-new Date(r.createdAt))};case qe.MARK_ALL_AS_READ:return{...e,isMarkAllAsRead:t.isMarkAllAsRead};case qe.ERROR:return{...e,error:t.error};default:throw new Error(`${Gr.UNHANDLED}: ${t}`)}}const I7={loading:!1,data:[],error:"",isMarkAllAsRead:{count:0,boo:!1}},{TENANT_ID:Vp,BU_ID:Wp,SNOP_ID:hw}=Dp,{TENANT_IDS:zp,BU_IDS:Up}=Ca,A7=async e=>{try{const t=`${e}${$c.NOTIFICATION}/v1?${Vp}=${zp}&${Wp}=${Up}`;return await St.get(t,Sa)}catch(t){return t}},mw=async(e,t,n)=>{try{const r=n===K1.MARK_ALL_READ?"":`&${hw}=${n}&`,o=`${e}${$c.NOTIFICATION}${Mp.VERSION}?${Vp}=${zp}&${Wp}=${Up}${r}`;return await St.put(o,t,Sa)}catch(r){return r}},j7=async({baseUrl:e,id:t,snopId:n})=>{try{const r=`${e}${$c.NOTIFICATION}${Mp.VERSION}?${Vp}=${zp}&${Wp}=${Up}&${hw}=${n}&id=${t}`;return await St.get(r,Sa)}catch(r){return r}},Bc={OK:200,CREATED:201,NO_CONTENT:204,BAD_REQUEST:400,UNAUTHORIZED:401,NOT_FOUND:404,INTERNAL_SERVER_ERROR:500},gw=({baseUrl:e})=>{const t=R.useContext(pw),[n,r]=R.useState(!1),[o,i]=R.useState(!1),[a,l]=R.useState(!1),[c,u]=R.useState({}),[d,f]=R.useState(null),[p,h]=R.useState(1),[y,m]=R.useState(!1),[b,x]=R.useState(0),{loading:w,data:C,isMarkAllAsRead:O}=R.useContext(Lp),[v,k]=R.useState([]);R.useEffect(()=>{k(C)},[C]);const E=R.useCallback(async()=>{var F,N;try{t({type:qe.LOADING,loading:!0}),t({type:qe.SUCCESS,data:[]});const P=await A7(e);if(P.status===Bc.OK){const j=((N=(F=P.data)==null?void 0:F.responseData)==null?void 0:N.response)||[],W=Cc(j);t({type:qe.SUCCESS,data:Cc(W)}),t({type:qe.MARK_ALL_AS_READ,isMarkAllAsRead:{count:i1(j),boo:i1(j)>0}})}}catch{t({type:qe.ERROR,error:Gr.SWR})}finally{t({type:qe.LOADING,loading:!1})}},[e,t]);R.useEffect(()=>{E();const F=setInterval(E,3e5);return()=>clearInterval(F)},[E]);const M=async(F,N)=>{var P,j,W;if(F){f(F);try{const U=await j7({baseUrl:e,id:F,snopId:N});if(U.status===Bc.OK){const B=((W=(j=(P=U.data)==null?void 0:P.responseData)==null?void 0:j.response)==null?void 0:W[0])||{};u(B||{}),l(!0)}else throw new Error}catch{t({type:qe.ERROR,error:Gr.SWR})}finally{f(null)}}},D=async(F,N)=>{if(F.length){t({type:qe.LOADING,loading:!0});try{if((await mw(e,F,N)).status===Bc.OK){const j=C.map(U=>F.includes(U.id)?{...U,isRead:!0}:U),W=j.filter(U=>!U.isRead).length;t({type:qe.SUCCESS,data:Cc(j)}),t({type:qe.MARK_ALL_AS_READ,isMarkAllAsRead:{count:W,boo:W>0}}),setTimeout(()=>{t({type:qe.LOADING,loading:!1})},200)}}catch{t({type:qe.ERROR,error:Gr.SWR}),t({type:qe.LOADING,loading:!1})}}},A=async()=>{t({type:qe.LOADING,loading:!0});try{const F=d8(C);if((await mw(e,F,K1.MARK_ALL_READ)).status===Bc.OK){const P=C.map(j=>({...j,isRead:!0}));t({type:qe.SUCCESS,data:Cc(P)}),t({type:qe.MARK_ALL_AS_READ,isMarkAllAsRead:{count:0,boo:!1}}),setTimeout(()=>{t({type:qe.LOADING,loading:!1})},200)}}catch{t({type:qe.ERROR,error:Gr.SWR}),t({type:qe.LOADING,loading:!1})}},$=(F,N)=>{t({type:qe.LOADING,loading:!0}),x(N),setTimeout(()=>{t({type:qe.LOADING,loading:!1})},400)},I=F=>{const N=F||C||[];return{0:N,1:N.filter(P=>(P==null?void 0:P.type)==="INFO"),2:N.filter(P=>(P==null?void 0:P.type)==="ERROR")}},V=()=>{t({type:qe.LOADING,loading:!0});const F=!y,N=F?(v||[]).filter(P=>!P.isRead):C||[];m(F),k(N),h(1),setTimeout(()=>{t({type:qe.LOADING,loading:!1})},400)};return{fetchNotification:E,showDetailsProps:{open:a,handleClose:()=>l(!1),setOpen:l,data:c,clickId:d},alertDialogProps:{open:n,handleClose:()=>r(!1),onRefresh:E,handleRead:D,handleMarkAllAsRead:A,setOpen:r,handleShowDetails:M,clickId:d,isMainDialog:!0},activeTab:b,loading:w,tabData:I(v)[b],data:v,mode:y,handleTabChange:$,toggleAlertMode:V,page:p,setPage:h,isMarkAllAsRead:O}};var yw,bw,vw;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 N7=function(t){return S.createElement("svg",Hp({xmlns:"http://www.w3.org/2000/svg",width:16,height:17,fill:"none"},t),yw||(yw=S.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"})),bw||(bw=S.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"})),vw||(vw=S.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 $7=({count:e})=>(It(),g.jsxs(g.Fragment,{children:[g.jsx(ye,{sx:{gap:"0.5rem",display:"flex",justifyContent:"center",alignItems:"center","& svg":{transform:"scale(1)"}},children:g.jsx(N7,{style:{scale:2}})}),g.jsx(C7,{badgeContent:e!=0?"":null,color:"error"})]}));function xw({children:e,handleClose:t,open:n,isMainDialog:r}){return g.jsx(kl,{open:n,onClose:t,...r?{scroll:"paper",PaperProps:{sx:{position:"fixed",top:30,right:30,m:0,width:400,height:450,display:"flex",flexDirection:"column",borderRadius:2,boxShadow:6,backgroundColor:o=>o.palette.primary.notifyBackground}}}:{fullWidth:!0,maxWidth:"md",sx:{"& .MuiPaper-root":{minHeight:250,maxHeight:500,borderRadius:"1.5rem",boxShadow:6,backgroundColor:o=>o.palette.primary.appBackground}}},children:e})}var ww;function qp(){return qp=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},qp.apply(null,arguments)}var _7=function(t){return S.createElement("svg",qp({xmlns:"http://www.w3.org/2000/svg",width:14,height:9,fill:"none",viewBox:"0 0 13 9"},t),ww||(ww=S.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"})))},Cw,Sw;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 F7=function(t){return S.createElement("svg",Yp({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,fill:"none"},t),Cw||(Cw=S.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"})),Sw||(Sw=S.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"})))},Tw;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 B7=function(t){return S.createElement("svg",Gp({xmlns:"http://www.w3.org/2000/svg",width:9,height:8,fill:"none"},t),Tw||(Tw=S.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 Ow=({type:e,item:t,handleShowDetails:n,handleRead:r,handleCTAClicked:o,clickId:i})=>{var c,u;const a=It(),l=(u=(c=JSON.parse(localStorage.getItem("settings")))==null?void 0:c.platform)==null?void 0:u.theme;return g.jsxs(ye,{className:"cards",sx:{pt:" 0.8rem"},children:[g.jsx(ft,{display:"flex",flexDirection:"row",alignItems:"start",justifyContent:"space-between",gap:1,children:g.jsx(nd,{sx:{width:"calc(100% - 2%)","& .MuiBadge-badge":{backgroundColor:"#6041EA",height:"0.5rem",minWidth:"0.5rem"}},variant:"dot",invisible:t==null?void 0:t.isRead,children:g.jsx(Oo,{sx:{color:a.palette.primary.notifyActiveText,whiteSpace:"normal",wordBreak:"break-word"},component:"p",className:["title-card",(t==null?void 0:t.isRead)&&"read"].join(" "),children:t==null?void 0:t.message})})}),g.jsx(ft,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",children:g.jsxs(ft,{display:"flex",flexDirection:"row",justifyContent:"start",gap:1,sx:{p:"0.5rem 0"},children:[(t==null?void 0:t.isNotificationDetails)&&g.jsx(Fc,{icon:g.jsx(F7,{className:`${l==="light"?"chip-icon-light":"chip-icon-dark"}`}),disabled:i,onClick:n,label:i===(t==null?void 0:t.id)?g.jsx(Ol,{color:"primary",size:13}):"Show Details",component:"button",variant:"filled",clickable:!0,size:"small",sx:{backgroundColor:a.palette.brandColor.orange,color:a.palette.brandColor.white}}),!(t!=null&&t.isRead)&&g.jsx(Fc,{icon:g.jsx(B7,{className:`${l==="light"?"chip-icon-light":"chip-icon-dark"}`}),disabled:i,onClick:r,label:"Acknowledge",component:"button",variant:"outlined",clickable:!0,size:"small"}),(t==null?void 0:t.primaryCTAURL)&&g.jsx(Fc,{disabled:t==null?void 0:t.isPrimaryCTAClicked,onClick:()=>o({redirect:t==null?void 0:t.isPrimaryCTARedirect,isClicked:t==null?void 0:t.isPrimaryCTAClicked,url:t==null?void 0:t.primaryCTAURL}),label:t==null?void 0:t.primaryCTALabel,component:"button",variant:"outlined",clickable:!0,size:"small"}),(t==null?void 0:t.secondaryCTAURL)&&g.jsx(Fc,{disabled:t==null?void 0:t.isSecondaryCTAClicked,onClick:()=>o({redirect:t==null?void 0:t.isSecondaryCTARedirect,isClicked:t==null?void 0:t.isSecondaryCTAClicked,url:t==null?void 0:t.secondaryCTAURL}),label:t==null?void 0:t.secondaryCTALabel,component:"button",variant:"outlined",clickable:!0,size:"small"})]})}),g.jsxs(ft,{display:"flex",flexDirection:"row",alignItems:"center",gap:.35,children:[g.jsx(Oo,{sx:{fontSize:"0.8rem"},children:t==null?void 0:t.product}),g.jsx(Oo,{color:a.palette.primary.notifyTextColor,children:"•"}),g.jsx(Oo,{sx:{fontSize:"0.8rem"},children:u8(t==null?void 0:t.createdAt)})]})]})};Ow.propTypes={type:s.string,title:s.string,subTitle:s.string,isRead:s.bool,handleShowDetails:s.func,handleRead:s.func};const kw=({data:e,handleRead:t,handleShowDetails:n,clickId:r,mode:o,page:i,setPage:a})=>{const{isMarkAllAsRead:l}=R.useContext(Lp),c=new Date,u=new Intl.DateTimeFormat("en-US",{day:"numeric",month:"long",year:"numeric"}).format(c),[d,f]=R.useState([]),[p,h]=R.useState(!1),[y,m]=R.useState(!0),b=R.useRef(null),x=async C=>{h(!0);const O=e.slice((C-1)*10,C*10);await new Promise(v=>setTimeout(v,1e3)),f(v=>{const k=O.filter(E=>!v.some(M=>M.id===E.id));return[...v,...k]}),h(!1),(d==null?void 0:d.length)>=(e==null?void 0:e.length)&&m(!1)};R.useEffect(()=>{var O;let C=[];o?l!=null&&l.count?C=(O=e==null?void 0:e.filter(v=>!v.isRead))==null?void 0:O.slice(0,10):C=[]:C=e.slice(0,10),(C==null?void 0:C.length)<10&&m(!1),f(C)},[e,o,l]),R.useEffect(()=>{y&&i!==1&&x(i)},[i,e]),R.useEffect(()=>{f([...e])},[e]),R.useEffect(()=>{const C=new IntersectionObserver(O=>{O[0].isIntersecting&&!p&&y&&a(v=>v+1)},{threshold:1});return b.current&&C.observe(b.current),()=>{b.current&&C.unobserve(b.current)}},[p,y]);const w=({redirect:C,isClicked:O,url:v})=>{window.open(v,"_blank")};return g.jsxs(ye,{sx:{width:"100%"},children:[Object.entries(h8(d)).map(([C,O])=>g.jsxs(R.Fragment,{children:[C!==u&&g.jsx(w7,{children:C}),O.map((v,k)=>g.jsx(R.Fragment,{children:g.jsx(Ow,{item:v,handleCTAClicked:w,handleShowDetails:()=>n(v.id,v.snopId),handleRead:()=>t([v.id],v.snopId),clickId:r})},`${k}_${v.id}`))]},C)),p&&i>1&&!!(d!=null&&d.length)&&g.jsx(ye,{sx:{display:"flex",justifyContent:"center",alignItems:"center",pl:"0.5rem",py:"0.3rem"},children:g.jsx(Ol,{size:20,sx:{color:C=>C.palette.primary.notifyIconColor}})}),!(d!=null&&d.length)&&g.jsx(st,{sx:{fontSize:"1.1rem",color:C=>C.palette.primary.notifyTextColor,textAlign:"center",px:"0.8rem"},children:"You don't have any unread notification here. Use the toggle to switch between read and unread notification."}),g.jsx(ye,{ref:b,style:{height:"0.1rem",backgroundColor:"transparent"}})]})};kw.propTypes={data:s.array,handleRead:s.func,handleShowDetails:s.func};const L7=({onRefresh:e,handleShowDetails:t,clickId:n,handleRead:r,handleMarkAllAsRead:o})=>{var y,m,b,x;const{loading:i,activeTab:a,data:l,tabData:c,mode:u,page:d,setPage:f,handleTabChange:p,toggleAlertMode:h}=gw({});return g.jsxs(g.Fragment,{children:[g.jsxs(ye,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:2,pt:2},children:[g.jsx(st,{variant:"h2",sx:{fontSize:"1.2rem",color:w=>w.palette.primary.notifyTextColor},children:"Notifications"}),g.jsx(ye,{onClick:e,children:g.jsx(hn,{url:Ke.Refresh,alt:"refresh",sx:{cursor:"pointer"}})})]}),g.jsx(ye,{sx:{borderBottom:1,m:"1.2rem 1.2rem 0 1.2rem",borderColor:w=>w.palette.primary.notifyBorderColor},children:g.jsxs(S7,{value:a,onChange:p,children:[g.jsx(Fp,{label:g.jsxs(ye,{sx:{display:"flex",alignItems:"center",fontSize:"1rem",fontWeight:"500"},children:["All (",g.jsx(st,{component:"span",sx:{fontWeight:"500",fontSize:"1rem"},children:((y=l==null?void 0:l.filter(w=>!(w!=null&&w.isRead)))==null?void 0:y.length)||0}),")"]})}),g.jsx(Fp,{label:g.jsxs(ye,{sx:{display:"flex",alignItems:"center",fontSize:"1rem",fontWeight:"500"},children:["Info (",g.jsx(st,{component:"span",sx:{fontWeight:"500",fontSize:"1rem"},children:((m=l==null?void 0:l.filter(w=>(w==null?void 0:w.type)==="INFO"&&!(w!=null&&w.isRead)))==null?void 0:m.length)||0}),")"]}),sx:{color:w=>w.palette.brandColor.blue}}),g.jsx(Fp,{label:g.jsxs(ye,{sx:{display:"flex",alignItems:"center",fontSize:"1rem",fontWeight:"500"},children:["Error (",g.jsx(st,{component:"span",sx:{fontWeight:"500",fontSize:"1rem"},children:((b=l==null?void 0:l.filter(w=>(w==null?void 0:w.type)==="ERROR"&&!(w!=null&&w.isRead)))==null?void 0:b.length)||0}),")"]}),sx:{color:w=>w.palette.brandColor.red}})]})}),g.jsx(Pl,{dividers:!0,sx:{p:0,...i&&!c.length&&{alignItems:"center",justifyContent:"center"},flexGrow:1,overflowY:"auto",mx:"1.2rem",borderColor:w=>w.palette.primary.notifyBorderColor},tabIndex:-1,children:i?g.jsx(Ol,{size:30,sx:{color:w=>w.palette.primary.notifyIconColor}}):g.jsx(g.Fragment,{children:g.jsx(kw,{data:c,handleShowDetails:t,handleRead:r,clickId:n,page:d,setPage:f,mode:u})})}),g.jsxs(El,{sx:{justifyContent:"space-between",px:"1.2rem"},children:[g.jsxs(ft,{direction:"row",gap:1,children:[g.jsx(Oo,{sx:{fontSize:"1rem"},children:"Only show unread"}),g.jsx(x7,{disabled:i,checked:u,onChange:h})]}),g.jsx(Hn,{variant:"outlined",className:"view-all",onClick:o,startIcon:g.jsx(_7,{}),disabled:!((x=l==null?void 0:l.filter(w=>!(w!=null&&w.isRead)))!=null&&x.length),style:{backgroundColor:"transparent"},sx:{fontSize:"1rem",fontWeight:"300",p:0,border:"none",textTransform:"none",color:w=>w.palette.primary.notifyTextColor,"&:hover":{color:w=>w.palette.primary.notifyActiveText,background:"transparent",boxShadow:"none",border:"none"},"&.Mui-disabled":{opacity:.5,color:w=>`${w.palette.primary.notifyActiveText}!important`,background:"transparent",boxShadow:"none",border:"none"}},children:"Mark all as read"})]})]})},V7=({data:e,handleClose:t})=>{var b;const[n,r]=R.useState(1),[o,i]=R.useState(10),[a,l]=R.useState(((b=e==null?void 0:e.notificationDetails)==null?void 0:b.length)||0),[c,u]=R.useState("sku_name"),[d,f]=R.useState("asc"),[p,h]=R.useState([]),[y,m]=R.useState("");return R.useEffect(()=>{var x;if(y||c){const w=f8(e==null?void 0:e.notificationDetails,a7,y);if(c){const C=p8(w,c,d?"asc":"desc");h(pp(C,n,o)),l(C.length);return}h(pp(w,n,o)),l(w.length);return}h(pp(e==null?void 0:e.notificationDetails,n,o)),l((x=e==null?void 0:e.notificationDetails)==null?void 0:x.length)},[y,e==null?void 0:e.notificationDetails,n,o,d,c]),g.jsxs(g.Fragment,{children:[g.jsxs(ft,{direction:"row",justifyContent:"space-between",sx:{padding:"1.5rem 2rem",borderBottom:"0.1rem solid",borderColor:x=>x.palette.primary.notifyBorderColor},children:[g.jsx(st,{component:"h2",sx:{fontSize:"1.4rem",color:x=>x.palette.primary.notifyActiveText},children:(e==null?void 0:e.message)||""}),g.jsx(ye,{onClick:t,sx:{cursor:"pointer"},children:g.jsx(hn,{url:Ke.CloseCircle})})]}),g.jsx(Pl,{children:g.jsx(Bp,{tableProps:{data:p,columns:{...y7(),isManageable:!1},sort:{sortField:c,sortDir:d,onSort:x=>{var C;const w=(C=x==null?void 0:x.column)==null?void 0:C.key;f(O=>c===w&&O==="asc"?"desc":"asc"),u(w)}},pagination:{selectedPage:n,rowPerPage:o,totalRecords:a,onPageChange:x=>{r(x)},onPageSizeChange:x=>{i(x==null?void 0:x.value),r(1)}}},toolbarProps:{defaultTools:{search:{isRequired:!0,onChange:x=>{const w=x.target.value;w&&r(1),m(w)},placeholder:"Search..."}}}})}),g.jsx(El,{sx:{padding:"1.5rem 2rem"}})]})},W7=({baseUrl:e})=>{const{alertDialogProps:t,showDetailsProps:n,fetchNotification:r,isMarkAllAsRead:o}=gw({baseUrl:e});return g.jsxs(g.Fragment,{children:[g.jsx(ye,{sx:{display:"flex",justifyContent:"center",cursor:"pointer",marginTop:"0.6rem"},onClick:()=>{var i;r(),(i=t==null?void 0:t.setOpen)==null||i.call(t,!0)},children:g.jsx($7,{count:o.count})}),g.jsx(xw,{...t,children:g.jsx(L7,{...t})}),g.jsx(xw,{...n,children:g.jsx(V7,{...n})})]})},z7=({baseUrl:e})=>g.jsx(Fn,{children:g.jsx(R7,{children:g.jsx(W7,{baseUrl:e})})}),U7=({rightChild:e,leftChild:t,isDrawerMerged:n,isDrawerOpen:r,drawerTitle:o,showExpand:i,onCloseClick:a,onMergeClick:l,onExpandClick:c,isDrawerExpanded:u,styles:d,showMerge:f})=>{const p=It();return g.jsx(ye,{sx:{position:"relative",overflow:"hidden"},children:g.jsxs(ao,{container:!0,sx:{height:"100%"},children:[g.jsx(ao,{item:!0,sx:{width:n?d!=null&&d.drawerWidth?`calc(${"100%"-(d==null?void 0:d.drawerWidth)})`:"75%":"100%",position:"relative",zIndex:3,height:"calc(100vh - 7rem)",p:"0rem 1.5rem",overflow:"auto"},children:t}),r&&!n&&g.jsxs(g.Fragment,{children:[g.jsx(ye,{onClick:a,sx:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"#07080B80",backdropFilter:"blur(3px)",zIndex:3,transition:"opacity 0.3s ease-in-out"}}),g.jsx(ye,{onClick:a,sx:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"transparent",zIndex:4}})]}),e&&g.jsxs(ao,{item:!0,sx:{width:u?"90%":(d==null?void 0:d.drawerWidth)||"25%",position:n?"relative":"absolute",top:0,right:0,height:"calc(100vh - 7rem)",backgroundColor:p.palette.primary.notifyBackground,transform:r?"translateX(0)":"translateX(100%)",transition:"transform 0.4s ease-in-out , width 0.4s ease-in-out",zIndex:4,borderLeft:`0.1rem solid ${p.palette.primary.notifyBorderColor}`,display:"flex",flexDirection:"column"},children:[g.jsxs(ft,{direction:"row",alignItems:"center",sx:{width:"100%",flexShrink:0,paddingBottom:"0.8rem",px:2,pt:"0.8rem",borderBottom:h=>`0.1rem solid ${h.palette.primary.notifyBorderColor}`},children:[!u&&f&&g.jsxs(g.Fragment,{children:[g.jsx(ye,{component:"img",src:Ke.Merge,sx:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer"},onClick:l}),g.jsx(yi,{orientation:"vertical",flexItem:!0,sx:{mx:"1rem",height:"auto!important",borderColor:p.palette.primary.notifyBorderColor}})]}),g.jsxs(ft,{direction:"row",justifyContent:"space-between",alignItems:"center",flexGrow:1,children:[g.jsxs(ft,{direction:"row",gap:"0.5rem",alignItems:"center",onClick:a,sx:{cursor:"pointer"},children:[g.jsx(hn,{url:Ke.CrossLight}),g.jsx(st,{sx:{fontSize:"1.2rem",color:p.palette.primary.notifyTextColor},children:o})]}),g.jsx(ft,{direction:"row",gap:"0.5rem",alignItems:"center",children:i&&g.jsx(ye,{onClick:c,sx:{cursor:"pointer"},children:g.jsx(ye,{component:"img",src:u?Ke.Collapse:Ke.Expand})})})]})]}),g.jsx(ye,{sx:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"},overflow:"auto",px:2},children:e})]})]})})},Ew=({layoutChildren:e,layoutProps:t})=>g.jsx(Fn,{children:g.jsx(U7,{...e,...t})});Ew.propTypes={layoutChildren:s.object.isRequired,layoutProps:s.object.isRequired},vt.Button=mo,vt.Checkbox=sc,vt.DatePicker=l8,vt.Grid=Bp,vt.Header=fw,vt.InputField=s1,vt.Loader=N8,vt.Notification=z7,vt.Select=l1,vt.SliderLayout=Ew,vt.Switch=f1,vt.TextField=xc,vt.ToastProvider=R8,vt.toast=k8,Object.defineProperty(vt,Symbol.toStringTag,{value:"Module"})});
327
327
  //# sourceMappingURL=index.umd.js.map