@3sc/common-component 0.0.331 → 0.0.332
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.es.js +3 -3
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
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[R1]=this[R1]={accessors:{}}).accessors,o=this.prototype;function i(a){const l=wa(a);r[l]||(N8(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 As(e,t,n){Ue.call(this,e??"canceled",Ue.ERR_CANCELED,t,n),this.name="CanceledError"}te.inherits(As,Ue,{__CANCEL__:!0});function A1(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Ue("Request failed with status code "+n.status,[Ue.ERR_BAD_REQUEST,Ue.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function $8(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function _8(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 F8(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 Dc=(e,t,n=3)=>{let r=0;const o=_8(50,250);return F8(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)),B8=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,L8=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 V8(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function W8(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function $1(e,t,n){let r=!V8(t);return e&&(r||n==!1)?W8(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&&B8(t.url))){const u=o&&i&&L8.read(i);u&&a.set(o,u)}return t},z8=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,g;function m(){h&&h(),g&&g(),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 Ue("Request aborted",Ue.ECONNABORTED,e,b)),b=null)},b.onerror=function(){r(new Ue("Network Error",Ue.ERR_NETWORK,e,b)),b=null},b.ontimeout=function(){let k=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const v=o.transitional||M1;o.timeoutErrorMessage&&(k=o.timeoutErrorMessage),r(new Ue(k,v.clarifyTimeoutError?Ue.ETIMEDOUT:Ue.ECONNABORTED,e,b)),b=null},i===void 0&&a.setContentType(null),"setRequestHeader"in b&&te.forEach(a.toJSON(),function(k,v){b.setRequestHeader(v,k)}),te.isUndefined(o.withCredentials)||(b.withCredentials=!!o.withCredentials),l&&l!=="json"&&(b.responseType=o.responseType),u&&([p,g]=Dc(u,!0),b.addEventListener("progress",p)),c&&b.upload&&([f,h]=Dc(c),b.upload.addEventListener("progress",f),b.upload.addEventListener("loadend",h)),(o.cancelToken||o.signal)&&(d=C=>{b&&(r(!C||C.type?new As(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=$8(o.url);if(w&&en.protocols.indexOf(w)===-1){r(new Ue("Unsupported protocol "+w+":",Ue.ERR_BAD_REQUEST,e));return}b.send(i||null)})},U8=(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 Ue?d:new As(d instanceof Error?d.message:d))}};let a=t&&setTimeout(()=>{a=null,i(new Ue(`timeout ${t} of ms exceeded`,Ue.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}},H8=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},q8=async function*(e,t){for await(const n of Y8(e))yield*H8(n,t)},Y8=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=q8(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})},Rc=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",L1=Rc&&typeof ReadableStream=="function",G8=Rc&&(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}},K8=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,kp=L1&&V1(()=>te.isReadableStream(new Response("").body)),Ic={stream:kp&&(e=>e.body)};Rc&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Ic[t]&&(Ic[t]=te.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new Ue(`Response type '${t}' is not supported`,Ue.ERR_NOT_SUPPORT,r)})})})(new Response);const X8=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 G8(e)).byteLength},Z8=async(e,t)=>{const n=te.toFiniteNumber(e.getContentLength());return n??X8(t)},Op={http:b8,xhr:z8,fetch:Rc&&(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=U8([o,i&&i.toAbortSignal()],a),g;const m=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let b;try{if(c&&K8&&n!=="get"&&n!=="head"&&(b=await Z8(d,r))!==0){let v=new Request(t,{method:"POST",body:r,duplex:"half"}),O;if(te.isFormData(r)&&(O=v.headers.get("content-type"))&&d.setContentType(O),v.body){const[E,D]=j1(b,Dc(N1(c)));r=B1(v.body,W1,E,D)}}te.isString(f)||(f=f?"include":"omit");const x="credentials"in Request.prototype;g=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(g);const C=kp&&(u==="stream"||u==="response");if(kp&&(l||C&&m)){const v={};["status","statusText","headers"].forEach(A=>{v[A]=w[A]});const O=te.toFiniteNumber(w.headers.get("content-length")),[E,D]=l&&j1(O,Dc(N1(l),!0))||[];w=new Response(B1(w.body,W1,E,()=>{D&&D(),m&&m()}),v)}u=u||"text";let k=await Ic[te.findKey(Ic,u)||"text"](w,e);return!C&&m&&m(),await new Promise((v,O)=>{A1(v,O,{data:k,headers:gn.from(w.headers),status:w.status,statusText:w.statusText,config:e,request:g})})}catch(x){throw m&&m(),x&&x.name==="TypeError"&&/fetch/i.test(x.message)?Object.assign(new Ue("Network Error",Ue.ERR_NETWORK,e,g),{cause:x.cause||x}):Ue.from(x,x&&x.code,e,g)}})};te.forEach(Op,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const z1=e=>`- ${e}`,J8=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,!J8(n)&&(r=Op[(a=String(n)).toLowerCase()],r===void 0))throw new Ue(`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 Ue("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r},adapters:Op};function Ep(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new As(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 Ue(o(a," has been removed"+(n?" in "+n:"")),Ue.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 Q8(e,t,n){if(typeof e!="object")throw new Ue("options must be an object",Ue.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 Ue("option "+i+" must be "+c,Ue.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Ue("Unknown option "+i,Ue.ERR_BAD_OPTION)}}const jc={assertOptions:Q8,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"],g=>{delete i[g]}),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 g=[H1.bind(this),void 0];for(g.unshift.apply(g,l),g.push.apply(g,u),p=g.length,d=Promise.resolve(n);f<p;)d=d.then(g[f++],g[f++]);return d}p=l.length;let h=n;for(f=0;f<p;){const g=l[f++],m=l[f++];try{h=g(h)}catch(b){m.call(this,b);break}}try{d=H1.call(this,h)}catch(g){return Promise.reject(g)}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 e7=class Ew{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 As(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 Ew(function(o){t=o}),cancel:t}}};function t7(e){return function(n){return e.apply(null,n)}}function n7(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=As,St.CancelToken=e7,St.isCancel=I1,St.VERSION=q1,St.toFormData=Pc,St.AxiosError=Ue,St.Cancel=St.CanceledError,St.all=function(t){return Promise.all(t)},St.spread=t7,St.isAxiosError=n7,St.mergeConfig=So,St.AxiosHeaders=gn,St.formToJSON=e=>D1(te.isHTMLForm(e)?new FormData(e):e),St.getAdapter=U1.getAdapter,St.HttpStatusCode=Pp,St.default=St;const{Axios:qW,AxiosError:YW,CanceledError:GW,isCancel:KW,CancelToken:XW,VERSION:ZW,all:JW,Cancel:QW,isAxiosError:ez,spread:tz,toFormData:nz,AxiosHeaders:rz,HttpStatusCode:oz,formToJSON:sz,getAdapter:iz,mergeConfig:az}=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 r7={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 Dp(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 Dp(this.converter,Nc({},this.attributes,o))},withConverter:function(o){return Dp(Nc({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var o7=Dp(r7,{path:"/"});const Dr={TOKEN:"token",USER:"user",SNOP:"snop",SELECTED_BU:"selected_business_unit",SETTINGS:"settings"},Rp={BEARER:"Bearer",TENANT_ID:"tenant_id",BU_ID:"bu_id",SNOP_ID:"snop_id"},s7=Object.values({"SKU Name":"sku_name",Node:"node","Channel Name":"channel_name"}),i7=[10,25,50,100],K1={MARK_ALL_READ:"MARK_ALL_READ"},a7=i7.map(e=>({label:e,value:e})),X1={PRIMARY:"PRIMARY",SECONDARY:"SECONDARY"},Ip=wc(Dr.SNOP),Ap=wc(Dr.SELECTED_BU),jp=wc(Dr.USER),l7=wc(Dr.SETTINGS),Ca={BU_IDS:Ap==null?void 0:Ap.business_unit_id,TOKEN:JSON.parse(o7.get(Dr.TOKEN)||null),TENANT_IDS:jp==null?void 0:jp.tenant_id,SNOP_IDS:Ip==null?void 0:Ip.snop_id,GRID_SETTINGS:l7},Sa={headers:{"Content-Type":"application/json",Authorization:`${Rp.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:c7,BU_ID:u7}=Rp,{TENANT_IDS:d7,BU_IDS:f7}=Ca,_c=async({baseUrl:e,payload:t})=>{try{const n=`${e}${$c.SETTING}/v1?${c7}=${d7}&${u7}=${f7}`;return await St.post(n,t,Sa)}catch(n){return n}},p7=({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(Dr.SETTINGS));let d=c.reduce((x,w)=>x==null?void 0:x[w],u)||null;if(!r&&t){a=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 k={...Ca.GRID_SETTINGS||{platform:{theme:"light"}}},v=(d==null?void 0:d.pageSize)??o;let O=k;for(let E=0;E<c.length;E++){const D=c[E];E===c.length-1?O[D]={columns:a,pageSize:v}:(O[D]={...O[D]||{}},O=O[D])}localStorage.setItem(Dr.SETTINGS,JSON.stringify(k)),await _c({baseUrl:n,payload:k})}catch(C){console.error(C)}})())}a=(d==null?void 0:d.columns)??a??J1({definitions:i});const f=a.reduce((x,w)=>(x[w.key]=w,x),{}),p=l.reduce((x,w)=>(x[w.key]=w,x),{}),h=[];for(const x of i){const w=f[x.key]||{},C=p[x.key]||{};let k={...x,...w,...C};if((b=x.children)!=null&&b.length){const v=(w.children||[]).reduce((E,D)=>(D!=null&&D.key&&(E[D.key]=D),E),{}),O=(C.children||[]).reduce((E,D)=>(D!=null&&D.key&&(E[D.key]=D),E),{});k.children=x.children.map(E=>({...E,...v[E.key],...O[E.key]}))}h.push(k)}const g=h.sort((x,w)=>x.sequenceId-w.sequenceId);return console.log({colSort:g}),g},h7=e=>e.sort((t,n)=>t.sequenceId-n.sequenceId),Np=e=>e.map(t=>({id:t.id,key:t.key,sequenceId:t.id,isHidden:t.isHidden||!1,style:t.style||{},...(t==null?void 0:t.children)&&{children:Np(t.children)}})),J1=({definitions:e})=>Np(e),m7=()=>({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 $p 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})}}$p.defaultProps={disabled:!1,minWidth:0,className:""},$p.propTypes={disabled:"boolean",minWidth:"number",className:"string"};const g7=(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;if(i!=null&&i.isChild&&Array.isArray(p.children)){const g=p.children.map(b=>{var x;return b.key===((x=i.column)==null?void 0:x.key)?{...b,isHidden:!0}:b}),m=g.every(b=>b.isHidden);return{...p,isHidden:m?!0:p.isHidden,children:g}}return p.key===((h=i.column)==null?void 0:h.key)?{...p,isHidden:!0}:p});d({updatedColumns:f})},d=async({updatedColumns:f})=>{t({type:He.SET_GRID_DATA,payload:{visibleGridColumns:f}});const p=r.split("/").filter(Boolean),m={...JSON.parse(localStorage.getItem(Dr.SETTINGS))||{platform:{theme:"light"}}},b=p.reduce((C,k)=>C==null?void 0:C[k],Ca.GRID_SETTINGS)||null,x=(b==null?void 0:b.pageSize)??o;let w=m;for(let C=0;C<p.length;C++){const k=p[C];C===p.length-1?w[k]={columns:f,pageSize:x}:(w[k]={...w[k]||{}},w=w[k])}localStorage.setItem(Dr.SETTINGS,JSON.stringify(m)),await _c({baseUrl:n,payload:m})};return{selectedColumn:i,handleMenuClick:l,handleClose:c,handleHideClick:u,columnUpdaterFunction:d}},Q1=({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 y.jsxs(we,{sx:{display:"flex",p:"1rem 1.5rem"},children:[y.jsxs(we,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"0.5rem",width:"100%"},children:[y.jsx(ot,{sx:{fontSize:"1.1rem",color:c.palette.primary.notifyTextColor},children:`Showing ${Math.min(r*o,i)} of ${i} rows`}),y.jsx(we,{sx:{"& .MuiInputBase-input":{padding:"0rem 0.8rem!important"},width:"6rem"},children:y.jsx(Sc,{options:a7,value:o,onChange:async d=>{l(d),u(d==null?void 0:d.value,t)}})})]}),y.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`}}})]})};Q1.propTypes={pagination:s.object.isRequired};function _p({isRenderCellContent:e,column:t,row:n,parent:r}){const o=n[t.key];return y.jsx(y.Fragment,{children:e?y.jsx(we,{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})}):y.jsx(Ag,{title:(o==null?void 0:o.length)>20?o:"",arrow:!0,children:y.jsx(we,{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:pV(o)})})})}_p.propTypes={isRenderCellContent:s.bool,column:s.object,row:s.object};const ew=({menuOpen:e,handleClose:t,onHideClick:n})=>{const r=It();return y.jsx(Ti,{open:!!e,anchorEl:e,onClose:t,anchorOrigin:{vertical:"bottom",horizontal:"left"},children:y.jsx(we,{sx:{backgroundColor:r.palette.primary.notifyBackground,border:`0.1rem solid ${r.palette.primary.notifyBorderColor}`,minHeight:"2.3rem",display:"flex",justifyContent:"center",alignItems:"center"},children:y.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"})})})};ew.propTypes={menuOpen:s.object,handleClose:s.func,onHideClick:s.func},Y(Ol)(({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 ko=Y(ot)(({theme:e})=>({color:e.palette.primary.notifyTextColor,fontSize:"1.1rem"})),y7=Y(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)"})}})),b7=Y(bi)(({theme:e})=>({color:e.palette.primary.notifyTextColor,padding:"0.6rem 0",fontSize:"0.9rem",fontWeight:500,"&::before, &::after":{borderColor:`${e.palette.primary.notifyBorderColor}!important`}})),v7=Y(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"}}));Y(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 x7=Y(Jg)(({theme:e})=>({minHeight:"2rem","& .MuiTabs-indicator":{height:"0.1rem",backgroundColor:e.palette.primary.notifyActiveText}})),Fp=Y(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=Y(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`}})),tw=({sortKey:e,sortField:t,sortDir:n,handleSortClick:r})=>{const o=i=>y.jsx(Ir,{onClick:r,sx:{padding:"0.5rem"},draggable:!1,children:y.jsx(hn,{url:i})});return y.jsx(y.Fragment,{children:o(t===e?n==="asc"?Ge.AscSort:Ge.DescSort:Ge.Unsort)})};tw.propTypes={sortKey:s.string.isRequired,sortField:s.string,sortDir:s.string,handleSortClick:s.func};function nw({parent:e,column:t,sort:n,handleMenuClick:r,isManageable:o}){const i=o&&(!(t!=null&&t.isMandatory)||(t==null?void 0:t.isMandatory)&&(t==null?void 0:t.showHide)===!0),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 y.jsxs(we,{sx:{display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.1rem",textAlign:"center",whiteSpace:"normal"},draggable:!1,children:[a,y.jsxs(we,{sx:{display:"flex",alignItems:"center"},draggable:!1,children:[l&&y.jsx(tw,{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})}),i&&y.jsx(Ir,{draggable:!1,onClick:f=>r(f,t,e),sx:{padding:"0.5rem 0.2rem"},children:y.jsx(hn,{url:Ge.Menu})})]})]})}nw.propTypes={column:s.object.isRequired,sort:s.object.isRequired,handleMenuClick:s.func,isManageable:s.bool};const w7=Y($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 y.jsx(w7,{...t,children:e})}Ta.propTypes={children:s.node};const C7=Y(Hg)(()=>({"&:last-child td":{borderBottom:0}}));function js({children:e,...t}){return y.jsx(C7,{...t,children:e})}js.propTypes={children:s.node};function rw({rows:e,sort:t,data:n,pagination:r,columns:o,nested:i,baseUrl:a,gridPath:l}){var K;const c=It(),{visibleGridColumns:u}=R.useContext(ga),d=R.useContext(ya),{selectedColumn:f,handleMenuClick:p,handleClose:h,handleHideClick:g,columnUpdaterFunction:m}=g7(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),[k,v]=R.useState(null),[O,E]=R.useState(null),[D,A]=R.useState(null);let j=null;const $=R.useRef(0),I=R.useRef(!1),V=R.useRef(null),F=h7(((K=i==null?void 0:i.column)==null?void 0:K.definitions)||[]),B=i==null?void 0:i.isNested,_=(i==null?void 0:i.data)||[],L=i==null?void 0:i.hashKey,[W,M]=R.useState(0),[N,z]=R.useState(null);if(R.useEffect(()=>{if(C.current){const P=()=>{M(C.current.offsetHeight)};return P(),window.addEventListener("resize",P),()=>window.removeEventListener("resize",P)}},[n]),R.useEffect(()=>{const P=C.current,q=P==null?void 0:P.querySelector("thead");if(!q)return;const X=()=>{A(null)};return q==null||q.addEventListener("mousedown",X),()=>{q==null||q.removeEventListener("mousedown",X)}},[]),!w)return y.jsx(ko,{sx:{textAlign:"center"},children:Gr.NRF});const J=(P,q)=>{var ye,pe;if(I.current){P.preventDefault();return}v(q),A(null),P.dataTransfer.setData("colIndex",q);const X=u[q],re=X==null?void 0:X.label,se=document.createElement("div");se.textContent=re,Object.assign(se.style,{display:"flex",alignItems:"center",justifyContent:"center",padding:"1.5rem 2.5rem",minWidth:(ye=X==null?void 0:X.style)==null?void 0:ye.minWidth,maxWidth:(pe=X==null?void 0:X.style)==null?void 0:pe.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(se);const{offsetWidth:fe,offsetHeight:Z}=se;P.dataTransfer.setDragImage(se,fe/2,Z/2),requestAnimationFrame(()=>{document.body.removeChild(se)})},ee=(P,q)=>{P.preventDefault(),E(q),ce(P)},H=async(P,q)=>{if(P.preventDefault(),clearInterval(j),k===null||k===q)return;const X=[...u],[re]=X.splice(k,1);X.splice(q,0,re);const se=u.slice().sort((Z,ye)=>Z.sequenceId-ye.sequenceId).map(Z=>Z.sequenceId),fe=X.map((Z,ye)=>({...Z,sequenceId:se[ye]??Z.sequenceId}));m({updatedColumns:fe}),v(null),E(null)},Q=()=>{v(null),E(null)},G=(P,q,X,re)=>{var Me,We,Ke,st,$e;if(!P)return null;const se=(P==null?void 0:P.isMandatory)&&(P==null?void 0:P.isSticky),fe=parseFloat((We=(Me=P==null?void 0:P.style)==null?void 0:Me.minWidth)==null?void 0:We.toString().replace("rem",""))||7.5;q===0&&($.current=0);const Z=se?q===0?0:`${$.current}rem`:void 0;se&&($.current+=fe);const ye=k===q,pe=O==q||((Ke=u==null?void 0:u[O])==null?void 0:Ke.isMandatory),be=ue=>{P.isMandatory?(ue.preventDefault(),ue.dataTransfer.dropEffect="none"):(ue.preventDefault(),ue.dataTransfer.dropEffect="move"),ee==null||ee(ue,q)},je=ue=>{P.isMandatory||H==null||H(ue,q)},Re=re?`${re==null?void 0:re.key}_${P==null?void 0:P.key}_${q}`:q;return y.jsx(Ta,{rowSpan:P!=null&&P.children?1:2,colSpan:($e=(st=P==null?void 0:P.children)==null?void 0:st.filter(ue=>!(ue!=null&&ue.isHidden)))==null?void 0:$e.length,style:P==null?void 0:P.style,onMouseEnter:()=>{D!==Re&&A(Re)},draggable:X&&!(P!=null&&P.isMandatory),onDragStart:X&&!(P!=null&&P.isMandatory)?ue=>J(ue,q):ue=>{ue.preventDefault()},onDragOver:X&&!(P!=null&&P.isMandatory)?be:void 0,onDrop:X&&!(P!=null&&P.isMandatory)?je:void 0,onDragEnd:X&&!(P!=null&&P.isMandatory)?Q:void 0,sx:{...P.isCenterTable&&{border:"0.1rem solid",borderTop:"none"},...ye&&{border:`0.1rem solid ${c.palette.brandColor.lightBlue}!important`},...se&&{position:"sticky",left:Z,zIndex:3},cursor:pe?"not-allowed":X&&!(P!=null&&P.isMandatory)?"grab":"default"},children:y.jsx(nw,{parent:re,column:P,sort:t,handleMenuClick:p,isManageable:X})},q)},le=(P,q,X,re)=>{var ye,pe,be;if(!P)return null;const se=(P==null?void 0:P.isMandatory)&&(P==null?void 0:P.isSticky),fe=parseFloat((pe=(ye=P==null?void 0:P.style)==null?void 0:ye.minWidth)==null?void 0:pe.toString().replace("rem",""))||7.5;X===0&&($.current=0);const Z=se?X===0?0:`${$.current}rem`:void 0;return se&&($.current+=fe),y.jsxs(Ta,{colSpan:1,style:P==null?void 0:P.style,className:`${P==null?void 0:P.label}`,sx:{...P.isCenterTable&&{border:"0.1rem solid",borderTop:"none"},position:"relative",...se&&{position:"sticky",left:Z,zIndex:2,backgroundColor:je=>{var Re;return e!=null&&e.selectedRow&&((Re=e==null?void 0:e.selectedRow)==null?void 0:Re.fhi)===(q==null?void 0:q.fhi)||q!=null&&q.isHigh?je.palette.primary.appBackground:je.palette.primary.notifyBackground}}},children:[((e==null?void 0:e.selectedRow)&&((be=e==null?void 0:e.selectedRow)==null?void 0:be.fhi)===(q==null?void 0:q.fhi)||(q==null?void 0:q.isHigh))&&y.jsx(we,{sx:{position:"absolute",bottom:0,left:0,width:"100%",height:"0.08rem",background:"linear-gradient(#F9B16E, #F68080)",pointerEvents:"none"}}),y.jsx(_p,{isRenderCellContent:!!(P!=null&&P.cellRenderer),column:P,row:q,parent:re})]},X)},ie=(P,q,X,re)=>{var fe;re&&`${re==null?void 0:re.key}${P==null?void 0:P.key}${q}`,(fe=[...u].map((Z,ye)=>({col:Z,index:ye})).reverse()[0])==null||fe.index;const se=N===q;return y.jsx(y.Fragment,{children:P&&!(P!=null&&P.isMandatory)&&X?y.jsx(we,{resizeStart:()=>{I.current=!0,z(q)},resizeEnd:()=>{I.current=!1,z(null)},component:P!=null&&P.children?$l:$p,rowSpan:P!=null&&P.children?1:2,colSpan:1,id:q,sx:{width:"1rem",maxWidth:"1rem",minWidth:"1rem",padding:0,position:"relative",borderBottom:`0.1rem solid ${c.palette.primary.notifyBorderColor}`,"&::after":se?{content:'""',position:"absolute",top:0,right:0,width:"0.2rem",height:`${W}px`,backgroundColor:c.palette.brandColor.lightBlue,zIndex:1}:void 0,"&:hover::after":{content:'""',position:"absolute",top:0,right:0,width:"0.2rem",height:`${W}px`,backgroundColor:c.palette.brandColor.lightBlue,zIndex:1}},disabled:!X}):null})},oe=(P,q,X,re,se,fe)=>{var Z;return fe&&`${fe==null?void 0:fe.key}${q==null?void 0:q.key}${X}`,y.jsx(y.Fragment,{children:q&&!(q!=null&&q.isMandatory)&&re?y.jsx($l,{className:"column_resizer_body",sx:{width:"1rem",maxWidth:"1rem",minWidth:"1rem",padding:0,position:"relative",borderBottom:`0.1rem solid ${c.palette.primary.notifyBorderColor}`},children:((e==null?void 0:e.selectedRow)&&((Z=e==null?void 0:e.selectedRow)==null?void 0:Z.fhi)===(P==null?void 0:P.fhi)||(P==null?void 0:P.isHigh))&&y.jsx(we,{sx:{position:"absolute",bottom:0,left:0,width:"100%",height:"0.08rem",background:"linear-gradient(#F9B16E, #F68080)",pointerEvents:"none"}})},`resize-${X}`):null})},ce=P=>{const q=C.current,{left:X,right:re}=q.getBoundingClientRect(),se=50,fe=P.clientX>re-se?1:P.clientX<X+se?-1:0;fe!==0?(V.current&&clearInterval(V.current),V.current=setInterval(()=>{q.scrollLeft+=fe*10},50)):V.current&&(clearInterval(V.current),V.current=null)};return y.jsxs(y.Fragment,{children:[y.jsx(Lg,{sx:{maxHeight:"100%",whiteSpace:"nowrap",overflow:"auto",width:"100%",border:`0.1rem solid ${c.palette.primary.notifyBorderColor}`,borderRadius:"1.4rem"},children:y.jsxs(_g,{ref:C,"aria-label":"sticky table",sx:{backgroundColor:P=>P.palette.primary.notifyBackground},children:[y.jsxs(Wg,{children:[y.jsx(js,{children:u.map((P,q)=>P!=null&&P.isHidden||!(P!=null&&P.isVisible)?null:y.jsxs(R.Fragment,{children:[G(P,q,b),x&&ie(P,q,b)]},q))}),y.jsx(js,{draggable:!1,children:u.flatMap((P,q)=>P!=null&&P.isHidden||!(P!=null&&P.children)||P.isVisible?[]:P.children.map((X,re)=>X!=null&&X.isHidden?null:y.jsxs(R.Fragment,{children:[G(X,re,b,P),x&&ie(X,re,b,P)]},`${q}-${re}`)))})]}),y.jsx(Bg,{children:n.map((P,q)=>{const X=P[L],re=_==null?void 0:_[X],se=(re==null?void 0:re.length)>0;return y.jsxs(R.Fragment,{children:[y.jsx(js,{sx:{backgroundColor:fe=>{var Z;return e&&((Z=e==null?void 0:e.selectedRow)==null?void 0:Z.fhi)===(P==null?void 0:P.fhi)||P!=null&&P.isHigh?fe.palette.primary.appBackground:fe.palette.primary.notifyBackground}},onClick:()=>e==null?void 0:e.onRowClick(P),children:u.map((fe,Z)=>fe!=null&&fe.isHidden||!(fe!=null&&fe.isVisible)?null:fe!=null&&fe.children?fe.children.map((ye,pe)=>ye!=null&&ye.isHidden?null:y.jsxs(R.Fragment,{children:[le(ye,P,pe,fe),x&&oe(P,ye,pe,b,q,fe)]},`${Z}-${pe}`)):y.jsxs(R.Fragment,{children:[le(fe,P,Z),x&&oe(P,fe,Z,b)]},Z))}),B&&re&&y.jsx(y.Fragment,{children:se?re.map((fe,Z)=>y.jsx(js,{children:F.map((ye,pe)=>y.jsx(Ta,{style:ye==null?void 0:ye.style,children:y.jsx(_p,{isRenderCellContent:!!(ye!=null&&ye.cellRenderer),column:ye,row:fe})},pe))},`nested-${Z}`)):y.jsx(js,{children:y.jsx(Ta,{colSpan:F.length,children:y.jsx(ko,{sx:{textAlign:"center"},children:Gr.NRF})})})})]},q)})})]})}),r&&y.jsx(Q1,{pagination:r,gridPath:l,baseUrl:a}),y.jsx(ew,{menuOpen:f==null?void 0:f.isOpen,handleClose:h,onHideClick:g})]})}rw.propTypes={sort:s.object,data:s.array,pagination:s.object,columns:s.object,nested:s.object};function ow({tableProps:e,isDefaultConfig:t,gridPath:n,baseUrl:r}){var d;const{columns:o}=e,{visibleGridColumns:i=[],prevGridColumns:a}=R.useContext(ga)??{},l=R.useContext(ya),c=R.useMemo(()=>{var f;return p7({columns:o,gridPath:n,baseUrl:r,isDefaultConfig:t,pageSize:(f=e==null?void 0:e.pagination)==null?void 0:f.rowPerPage})},[o,n,r,t,(d=e==null?void 0:e.pagination)==null?void 0:d.rowPerPage]),u=R.useMemo(()=>{const f=new Map(i.map(h=>[h.key,h])),p=new Map;if(a.size>0)for(const[h,g]of a==null?void 0:a.entries()){const m=f.get(h);m&&g.isHidden!==m.isHidden&&p.set(h,!0)}return c.map(h=>{const g=f.get(h.key),m=p.has(h.key);return{...h,...g&&{...m&&{isHidden:g.isHidden}}}}).sort((h,g)=>h.sequenceId-g.sequenceId)},[a,i]);return console.log({mergedColumns:c,visibleGridColumns:i,columns:o,finalColumns:u,prevGridColumns:a}),R.useEffect(()=>{if(c!=null&&c.length){const f=new Map(c.map(p=>[p.key,p]));l({type:He.PREV_GRID_DEF,payload:{prevGridColumns:f}}),l({type:He.SET_GRID_DATA,payload:{visibleGridColumns:u}})}},[c]),y.jsx(rw,{...e,gridPath:n,baseUrl:r})}ow.propTypes={tableProps:s.object.isRequired,mergedColumns:s.array.isRequired};const sw=({type:e})=>{const t=It(),r=(t==null?void 0:t.mode)==="dark"?{bgcolor:"grey.800"}:{};return{grid:y.jsxs(we,{sx:{borderRadius:2,overflow:"hidden"},children:[y.jsx(Tr,{variant:"text",width:"100%",height:60,sx:r}),Array.from({length:10}).map((i,a)=>y.jsx(we,{sx:{display:"flex",alignItems:"center",padding:"0.5rem",gap:"3rem"},children:Array.from({length:5}).map((l,c)=>y.jsx(we,{sx:{flex:1},children:y.jsx(Tr,{variant:"text",height:45,sx:r})},c))},a))]}),toolbar:y.jsx(y.Fragment,{children:y.jsxs(ft,{direction:"row",justifyContent:"space-between",sx:{display:"flex",gap:"1rem"},children:[y.jsxs(ft,{direction:"row",gap:"1rem",children:[y.jsx(Tr,{variant:"text",width:"10.2rem",height:"5rem",sx:r}),y.jsx(Tr,{variant:"text",width:"3.5rem",height:"5rem",sx:r}),y.jsx(Tr,{variant:"text",width:"15.2rem",height:"5rem",sx:r})]}),y.jsxs(ft,{direction:"row",gap:"1rem",children:[y.jsx(Tr,{variant:"text",width:"10.2rem",height:"5rem",sx:r}),y.jsx(Tr,{variant:"text",width:"3.5rem",height:"5rem",sx:r}),y.jsx(Tr,{variant:"text",width:"3.5rem",height:"5rem",sx:r})]})]})})}[e]},S7=e=>{if(!e)return null;const{options:t,...n}=e,r=t?"select":"button",o={button:i=>{var a;return y.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 y.jsx(we,{sx:{"& .MuiInputBase-input":{padding:"0rem!important"},width:(a=i.styles)==null?void 0:a.width},children:y.jsx(l1,{...i,options:t})})}};return o[r]?o[r](n):null},T7=({presentSetting:e,gridSetting:t,gridPath:n})=>{if(!n)return e;const r=n.split("/").filter(Boolean),o=Np(t==null?void 0:t.grid);let i=e;for(let a=0;a<r.length;a++){const l=r[a];a===r.length-1?i[l]={columns:o,pageSize:(t==null?void 0:t.pageSize)??null}:(i[l]=i[l]||{},i=i[l])}return{settingObject:e,defaultUserSettings:o}},k7=async({baseUrl:e,gridSetting:t,gridPath:n})=>{try{const r=JSON.parse(localStorage.getItem("settings")),{settingObject:o,defaultUserSettings:i}=T7({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)}},O7=({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}},iw=({customTools:e,isExpanded:t,setIsExpanded:n})=>{const{primaryButtons:r,secondaryButtons:o}=O7({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]),y.jsxs(y.Fragment,{children:[t&&y.jsx("div",{style:{position:"fixed",left:0,width:"100vw",height:"4rem",zIndex:998}}),y.jsxs(we,{sx:{display:"flex",alignItems:"center",gap:"0.8rem",flexWrap:"nowrap",maxWidth:"100%",whiteSpace:"nowrap",zIndex:999},children:[y.jsx(Z5,{mode:"popLayout",children:i.map((d,f)=>y.jsx(Ki.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},layout:!0,children:y.jsx(we,{sx:{flexShrink:0,minWidth:"fit-content"},children:S7(d)})},`${d.id}_${f}`))}),l&&y.jsx(we,{sx:{paddingLeft:t?"0.5rem":0},children:y.jsx(mo,{label:t?"":"More Actions",styles:{iconPrimary:!0,icon:t?Ge.CrossWhite:Ge.More,colorType:t?"danger":""},onClick:u})})]})]})};iw.propTypes={customTools:s.array.isRequired};const aw=({defaultTools:e,isManageable:t,customTools:n,baseUrl:r,gridPath:o,managableColumns:i=[],pageSize:a,gridData:l})=>{var w,C,k,v,O,E;const c=R.useContext(ya),{visibleGridColumns:u,triggerApi:d}=R.useContext(ga),[f,p]=R.useState([]),[h,g]=R.useState(!1);R.useEffect(()=>{if(u.length){const D={id:99999,sequenceId:99999,isLocalizable:!1,key:"horizons",label:"Horizons",isSortable:!1,isHidden:!0,showChildCheckbox:!0,showCheckbox:!1,isMandatory:!0,showInHierarchy:!0,showHide:!0,children:[]};let A=u.map($=>($!=null&&$.children&&$.children.forEach(I=>{D.children.some(F=>F.key===I.key)||D.children.push({...I,showInHierarchy:!0})}),$)).filter($=>($==null?void 0:$.id)!==(D==null?void 0:D.id));const j=D.children.length>0?[...A,D]:A;p(j)}},[u]);const m=async D=>{try{await k7({baseUrl:r,gridPath:o,gridSetting:{grid:D,pageSize:a}})}catch(A){console.error(A)}finally{c({type:He.HAS_SETTING_CHANGE,payload:{hasChange:!1}}),c({type:He.TRIGGER_API,payload:{triggerApi:!1}})}};R.useEffect(()=>{d&&m(u)},[d]);const b=D=>{const A=D.map(I=>I.id),j=D.flatMap(I=>I.children||[]).map(I=>I.id),$=f.map(I=>{var B;const V=A.includes(I.id);if(Array.isArray(I.children)&&I.children.length>0){const _=I.children.map(W=>{const M=j.includes(W.id);return{...W,isHidden:!M}}),L=_.filter(W=>f.some(M=>{var N;return(N=M.children)==null?void 0:N.some(z=>z.id===W.id)})).every(W=>W.isHidden);return{...I,...!((B=I.children[0])!=null&&B.showInHierarchy)&&{isHidden:L||!V},children:_}}return{...I,isHidden:!V}});c({type:He.SET_GRID_DATA,payload:{visibleGridColumns:$}}),c({type:He.HAS_SETTING_CHANGE,payload:{hasChange:!0}})},x=()=>f.map(A=>{const j=Array.isArray(A.children)?A.children.filter($=>!$.isHidden):void 0;return!A.isHidden||A.isHidden&&A.showInHierarchy?{...A,children:j}:null}).filter(Boolean);return y.jsxs(we,{sx:{margin:"1rem 0",position:"relative",zIndex:10,display:"flex",flexDirection:"row",justifyContent:"space-between",gap:"0.6rem",width:"100%"},children:[y.jsxs(we,{sx:{display:"flex",flexDirection:"row",gap:"0.6rem"},children:[((w=e==null?void 0:e.search)==null?void 0:w.isRequired)&&y.jsx(s1,{...e==null?void 0:e.search,iconUrl:Ge.Search}),((C=e==null?void 0:e.groupBy)==null?void 0:C.isRequired)&&y.jsx(we,{sx:{"& .MuiInputBase-input":{padding:"0rem!important"}},children:y.jsx(Sc,{styles:{icon:Ge.Group},...e.groupBy})}),((k=e==null?void 0:e.refresh)==null?void 0:k.isRequired)&&y.jsx(mo,{...e==null?void 0:e.refresh,styles:{variant:"filled",icon:Ge.Refresh,colorType:"empty",width:"3.2rem",height:"3.2rem"}}),t&&y.jsx(we,{sx:{"& .MuiInputBase-input":{padding:"0rem!important"}},children:y.jsx(Sc,{placeholder:"Manage Columns",options:f,value:x(),isMulti:!0,isDraggable:!0,showSearch:!0,isManageColumn:!0,onChange:b,disabled:!l.length,styles:{icon:Ge.Manage}})})]}),y.jsxs(we,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-end",gap:"0.6rem"},children:[n&&y.jsx(iw,{customTools:n,setIsExpanded:g,isExpanded:h}),((v=e==null?void 0:e.save)==null?void 0:v.isRequired)&&y.jsx(we,{sx:{px:"0.5rem"},children:y.jsx(mo,{label:h?"":"Save",styles:{icon:Ge.Save,colorType:"empty"},...e==null?void 0:e.save})}),((O=e==null?void 0:e.upload)==null?void 0:O.isRequired)&&y.jsx(mo,{...e==null?void 0:e.upload,styles:{variant:h?"outlined":"filled",icon:h?Ge.UploadDark:Ge.Upload,iconPrimary:!h,colorType:"secondary",isAnimate:!0}}),((E=e==null?void 0:e.download)==null?void 0:E.isRequired)&&y.jsx(mo,{...e==null?void 0:e.download,styles:{variant:"outlined",icon:Ge.Download,isAnimate:!0}})]})]})};aw.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 y.jsx(a1,{children:r?y.jsxs(y.Fragment,{children:[y.jsx(sw,{type:"toolbar"}),y.jsx(sw,{type:"grid"})]}):y.jsxs(we,{sx:{position:"sticky"},children:[t&&y.jsx(aw,{...t,isManageable:o,pageSize:(a=e==null?void 0:e.pagination)==null?void 0:a.rowPerPage,gridData:e==null?void 0:e.data}),y.jsx(ow,{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 lw=({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?y.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):y.jsx(ot,{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 y.jsx(L0,{separator:y.jsx(hn,{url:Ge.ArrowRight}),children:r({list:e})})};lw.propTypes={list:s.array.isRequired,handleLinkClick:s.func};const cw=({breadcrumbProps:e,switchProps:t,filterComponentProps:n})=>{var o,i,a,l,c,u;const r=It();return y.jsxs(y.Fragment,{children:[y.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:[y.jsx(lw,{...e}),y.jsxs(ft,{direction:"row",gap:"1rem",alignItems:"center",children:[t&&y.jsx(f1,{...t}),(n==null?void 0:n.filterBtnProps)&&y.jsxs(ft,{direction:"row",children:[y.jsx(bi,{orientation:"vertical",flexItem:!0,sx:{mx:"1rem",height:"2rem!important",opacity:"1!important",borderColor:r.palette.primary.notifyBorderColor}}),y.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:[y.jsx(hn,{url:Ge.Filter}),y.jsx(ot,{sx:{fontSize:"1.1rem",color:r.palette.primary.notifyActiveText},children:(i=n==null?void 0:n.filterBtnProps)==null?void 0:i.label})]})]})]})]}),y.jsx(Ki.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:y.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:[y.jsx(ot,{sx:{fontSize:"1.2rem",fontWeight:"500",color:r.palette.primary.notifyActiveText},children:"Filters:"}),y.jsx(we,{sx:{overflowX:"auto",overflowY:"visible",whiteSpace:"nowrap",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"},margin:"0 1rem",padding:"0.5rem 0",flexGrow:1},children:y.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)=>y.jsx(y.Fragment,{children:y.jsxs(we,{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:[y.jsx(we,{component:"img",src:Ge.FilterClose,sx:{position:"absolute",top:"-0.4rem",right:"-0.6rem",cursor:"pointer"},onClick:()=>n==null?void 0:n.onFilterChipClose(d)}),y.jsx(ot,{sx:{fontSize:"1rem",color:r.palette.primary.notifyTextColor},children:d==null?void 0:d.filterLabel})]},f)}))})}),y.jsx(we,{component:ot,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"})]})})]})};cw.propTypes={breadcrumbProps:s.object.isRequired,switchProps:s.object};function uw({headerProps:e}){return y.jsx(Fn,{children:y.jsx(cw,{...e})})}uw.propTypes={headerProps:s.object.isRequired};const Lp=R.createContext(null),dw=R.createContext(null);function E7({children:e}){const[t,n]=R.useReducer(P7,M7);return y.jsx(Lp.Provider,{value:t,children:y.jsx(dw.Provider,{value:n,children:e})})}function P7(e,t){var n;switch(t.type){case He.LOADING:return{...e,loading:t.loading};case He.SUCCESS:return{...e,data:(n=t.data)==null?void 0:n.sort((r,o)=>new Date(o.createdAt)-new Date(r.createdAt))};case He.MARK_ALL_AS_READ:return{...e,isMarkAllAsRead:t.isMarkAllAsRead};case He.ERROR:return{...e,error:t.error};default:throw new Error(`${Gr.UNHANDLED}: ${t}`)}}const M7={loading:!1,data:[],error:"",isMarkAllAsRead:{count:0,boo:!1}},{TENANT_ID:Vp,BU_ID:Wp,SNOP_ID:fw}=Rp,{TENANT_IDS:zp,BU_IDS:Up}=Ca,D7=async e=>{try{const t=`${e}${$c.NOTIFICATION}/v1?${Vp}=${zp}&${Wp}=${Up}`;return await St.get(t,Sa)}catch(t){return t}},pw=async(e,t,n)=>{try{const r=n===K1.MARK_ALL_READ?"":`&${fw}=${n}&`,o=`${e}${$c.NOTIFICATION}${Mp.VERSION}?${Vp}=${zp}&${Wp}=${Up}${r}`;return await St.put(o,t,Sa)}catch(r){return r}},R7=async({baseUrl:e,id:t,snopId:n})=>{try{const r=`${e}${$c.NOTIFICATION}${Mp.VERSION}?${Vp}=${zp}&${Wp}=${Up}&${fw}=${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},hw=({baseUrl:e})=>{const t=R.useContext(dw),[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),[g,m]=R.useState(!1),[b,x]=R.useState(0),{loading:w,data:C,isMarkAllAsRead:k}=R.useContext(Lp),[v,O]=R.useState([]);R.useEffect(()=>{O(C)},[C]);const E=R.useCallback(async()=>{var F,B;try{t({type:He.LOADING,loading:!0}),t({type:He.SUCCESS,data:[]});const _=await D7(e);if(_.status===Bc.OK){const L=((B=(F=_.data)==null?void 0:F.responseData)==null?void 0:B.response)||[],W=Cc(L);t({type:He.SUCCESS,data:Cc(W)}),t({type:He.MARK_ALL_AS_READ,isMarkAllAsRead:{count:i1(L),boo:i1(L)>0}})}}catch{t({type:He.ERROR,error:Gr.SWR})}finally{t({type:He.LOADING,loading:!1})}},[e,t]);R.useEffect(()=>{E();const F=setInterval(E,3e5);return()=>clearInterval(F)},[E]);const D=async(F,B)=>{var _,L,W;if(F){f(F);try{const M=await R7({baseUrl:e,id:F,snopId:B});if(M.status===Bc.OK){const N=((W=(L=(_=M.data)==null?void 0:_.responseData)==null?void 0:L.response)==null?void 0:W[0])||{};u(N||{}),l(!0)}else throw new Error}catch{t({type:He.ERROR,error:Gr.SWR})}finally{f(null)}}},A=async(F,B)=>{if(F.length){t({type:He.LOADING,loading:!0});try{if((await pw(e,F,B)).status===Bc.OK){const L=C.map(M=>F.includes(M.id)?{...M,isRead:!0}:M),W=L.filter(M=>!M.isRead).length;t({type:He.SUCCESS,data:Cc(L)}),t({type:He.MARK_ALL_AS_READ,isMarkAllAsRead:{count:W,boo:W>0}}),setTimeout(()=>{t({type:He.LOADING,loading:!1})},200)}}catch{t({type:He.ERROR,error:Gr.SWR}),t({type:He.LOADING,loading:!1})}}},j=async()=>{t({type:He.LOADING,loading:!0});try{const F=cV(C);if((await pw(e,F,K1.MARK_ALL_READ)).status===Bc.OK){const _=C.map(L=>({...L,isRead:!0}));t({type:He.SUCCESS,data:Cc(_)}),t({type:He.MARK_ALL_AS_READ,isMarkAllAsRead:{count:0,boo:!1}}),setTimeout(()=>{t({type:He.LOADING,loading:!1})},200)}}catch{t({type:He.ERROR,error:Gr.SWR}),t({type:He.LOADING,loading:!1})}},$=(F,B)=>{t({type:He.LOADING,loading:!0}),x(B),setTimeout(()=>{t({type:He.LOADING,loading:!1})},400)},I=F=>{const B=F||C||[];return{0:B,1:B.filter(_=>(_==null?void 0:_.type)==="INFO"),2:B.filter(_=>(_==null?void 0:_.type)==="ERROR")}},V=()=>{t({type:He.LOADING,loading:!0});const F=!g,B=F?(v||[]).filter(_=>!_.isRead):C||[];m(F),O(B),h(1),setTimeout(()=>{t({type:He.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:A,handleMarkAllAsRead:j,setOpen:r,handleShowDetails:D,clickId:d,isMainDialog:!0},activeTab:b,loading:w,tabData:I(v)[b],data:v,mode:g,handleTabChange:$,toggleAlertMode:V,page:p,setPage:h,isMarkAllAsRead:k}};var mw,gw,yw;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 I7=function(t){return S.createElement("svg",Hp({xmlns:"http://www.w3.org/2000/svg",width:16,height:17,fill:"none"},t),mw||(mw=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"})),gw||(gw=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"})),yw||(yw=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 A7=({count:e})=>(It(),y.jsxs(y.Fragment,{children:[y.jsx(we,{sx:{gap:"0.5rem",display:"flex",justifyContent:"center",alignItems:"center","& svg":{transform:"scale(1)"}},children:y.jsx(I7,{style:{scale:2}})}),y.jsx(v7,{badgeContent:e!=0?"":null,color:"error"})]}));function bw({children:e,handleClose:t,open:n,isMainDialog:r}){return y.jsx(Ol,{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 vw;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 j7=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),vw||(vw=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"})))},xw,ww;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 N7=function(t){return S.createElement("svg",Yp({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,fill:"none"},t),xw||(xw=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"})),ww||(ww=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"})))},Cw;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 $7=function(t){return S.createElement("svg",Gp({xmlns:"http://www.w3.org/2000/svg",width:9,height:8,fill:"none"},t),Cw||(Cw=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 Sw=({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 y.jsxs(we,{className:"cards",sx:{pt:" 0.8rem"},children:[y.jsx(ft,{display:"flex",flexDirection:"row",alignItems:"start",justifyContent:"space-between",gap:1,children:y.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:y.jsx(ko,{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})})}),y.jsx(ft,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",children:y.jsxs(ft,{display:"flex",flexDirection:"row",justifyContent:"start",gap:1,sx:{p:"0.5rem 0"},children:[(t==null?void 0:t.isNotificationDetails)&&y.jsx(Fc,{icon:y.jsx(N7,{className:`${l==="light"?"chip-icon-light":"chip-icon-dark"}`}),disabled:i,onClick:n,label:i===(t==null?void 0:t.id)?y.jsx(kl,{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)&&y.jsx(Fc,{icon:y.jsx($7,{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)&&y.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)&&y.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"})]})}),y.jsxs(ft,{display:"flex",flexDirection:"row",alignItems:"center",gap:.35,children:[y.jsx(ko,{sx:{fontSize:"0.8rem"},children:t==null?void 0:t.product}),y.jsx(ko,{color:a.palette.primary.notifyTextColor,children:"•"}),y.jsx(ko,{sx:{fontSize:"0.8rem"},children:lV(t==null?void 0:t.createdAt)})]})]})};Sw.propTypes={type:s.string,title:s.string,subTitle:s.string,isRead:s.bool,handleShowDetails:s.func,handleRead:s.func};const Tw=({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),[g,m]=R.useState(!0),b=R.useRef(null),x=async C=>{h(!0);const k=e.slice((C-1)*10,C*10);await new Promise(v=>setTimeout(v,1e3)),f(v=>{const O=k.filter(E=>!v.some(D=>D.id===E.id));return[...v,...O]}),h(!1),(d==null?void 0:d.length)>=(e==null?void 0:e.length)&&m(!1)};R.useEffect(()=>{var k;let C=[];o?l!=null&&l.count?C=(k=e==null?void 0:e.filter(v=>!v.isRead))==null?void 0:k.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(()=>{g&&i!==1&&x(i)},[i,e]),R.useEffect(()=>{f([...e])},[e]),R.useEffect(()=>{const C=new IntersectionObserver(k=>{k[0].isIntersecting&&!p&&g&&a(v=>v+1)},{threshold:1});return b.current&&C.observe(b.current),()=>{b.current&&C.unobserve(b.current)}},[p,g]);const w=({redirect:C,isClicked:k,url:v})=>{window.open(v,"_blank")};return y.jsxs(we,{sx:{width:"100%"},children:[Object.entries(fV(d)).map(([C,k])=>y.jsxs(R.Fragment,{children:[C!==u&&y.jsx(b7,{children:C}),k.map((v,O)=>y.jsx(R.Fragment,{children:y.jsx(Sw,{item:v,handleCTAClicked:w,handleShowDetails:()=>n(v.id,v.snopId),handleRead:()=>t([v.id],v.snopId),clickId:r})},`${O}_${v.id}`))]},C)),p&&i>1&&!!(d!=null&&d.length)&&y.jsx(we,{sx:{display:"flex",justifyContent:"center",alignItems:"center",pl:"0.5rem",py:"0.3rem"},children:y.jsx(kl,{size:20,sx:{color:C=>C.palette.primary.notifyIconColor}})}),!(d!=null&&d.length)&&y.jsx(ot,{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."}),y.jsx(we,{ref:b,style:{height:"0.1rem",backgroundColor:"transparent"}})]})};Tw.propTypes={data:s.array,handleRead:s.func,handleShowDetails:s.func};const _7=({onRefresh:e,handleShowDetails:t,clickId:n,handleRead:r,handleMarkAllAsRead:o})=>{var g,m,b,x;const{loading:i,activeTab:a,data:l,tabData:c,mode:u,page:d,setPage:f,handleTabChange:p,toggleAlertMode:h}=hw({});return y.jsxs(y.Fragment,{children:[y.jsxs(we,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:2,pt:2},children:[y.jsx(ot,{variant:"h2",sx:{fontSize:"1.2rem",color:w=>w.palette.primary.notifyTextColor},children:"Notifications"}),y.jsx(we,{onClick:e,children:y.jsx(hn,{url:Ge.Refresh,alt:"refresh",sx:{cursor:"pointer"}})})]}),y.jsx(we,{sx:{borderBottom:1,m:"1.2rem 1.2rem 0 1.2rem",borderColor:w=>w.palette.primary.notifyBorderColor},children:y.jsxs(x7,{value:a,onChange:p,children:[y.jsx(Fp,{label:y.jsxs(we,{sx:{display:"flex",alignItems:"center",fontSize:"1rem",fontWeight:"500"},children:["All (",y.jsx(ot,{component:"span",sx:{fontWeight:"500",fontSize:"1rem"},children:((g=l==null?void 0:l.filter(w=>!(w!=null&&w.isRead)))==null?void 0:g.length)||0}),")"]})}),y.jsx(Fp,{label:y.jsxs(we,{sx:{display:"flex",alignItems:"center",fontSize:"1rem",fontWeight:"500"},children:["Info (",y.jsx(ot,{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}}),y.jsx(Fp,{label:y.jsxs(we,{sx:{display:"flex",alignItems:"center",fontSize:"1rem",fontWeight:"500"},children:["Error (",y.jsx(ot,{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}})]})}),y.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?y.jsx(kl,{size:30,sx:{color:w=>w.palette.primary.notifyIconColor}}):y.jsx(y.Fragment,{children:y.jsx(Tw,{data:c,handleShowDetails:t,handleRead:r,clickId:n,page:d,setPage:f,mode:u})})}),y.jsxs(El,{sx:{justifyContent:"space-between",px:"1.2rem"},children:[y.jsxs(ft,{direction:"row",gap:1,children:[y.jsx(ko,{sx:{fontSize:"1rem"},children:"Only show unread"}),y.jsx(y7,{disabled:i,checked:u,onChange:h})]}),y.jsx(Hn,{variant:"outlined",className:"view-all",onClick:o,startIcon:y.jsx(j7,{}),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"})]})]})},F7=({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([]),[g,m]=R.useState("");return R.useEffect(()=>{var x;if(g||c){const w=uV(e==null?void 0:e.notificationDetails,s7,g);if(c){const C=dV(w,c,d);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)},[g,e==null?void 0:e.notificationDetails,n,o,d,c]),y.jsxs(y.Fragment,{children:[y.jsxs(ft,{direction:"row",justifyContent:"space-between",sx:{padding:"1.5rem 2rem",borderBottom:"0.1rem solid",borderColor:x=>x.palette.primary.notifyBorderColor},children:[y.jsx(ot,{component:"h2",sx:{fontSize:"1.4rem",color:x=>x.palette.primary.notifyActiveText},children:(e==null?void 0:e.message)||""}),y.jsx(we,{onClick:t,sx:{cursor:"pointer"},children:y.jsx(hn,{url:Ge.CloseCircle})})]}),y.jsx(Pl,{children:y.jsx(Bp,{tableProps:{data:p,columns:{...m7(),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(k=>c===w&&k==="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..."}}}})}),y.jsx(El,{sx:{padding:"1.5rem 2rem"}})]})},B7=({baseUrl:e})=>{const{alertDialogProps:t,showDetailsProps:n,fetchNotification:r,isMarkAllAsRead:o}=hw({baseUrl:e});return y.jsxs(y.Fragment,{children:[y.jsx(we,{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:y.jsx(A7,{count:o.count})}),y.jsx(bw,{...t,children:y.jsx(_7,{...t})}),y.jsx(bw,{...n,children:y.jsx(F7,{...n})})]})},L7=({baseUrl:e})=>y.jsx(Fn,{children:y.jsx(E7,{children:y.jsx(B7,{baseUrl:e})})}),V7=({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 y.jsx(we,{sx:{position:"relative",overflow:"hidden"},children:y.jsxs(ao,{container:!0,sx:{height:"100%"},children:[y.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&&y.jsxs(y.Fragment,{children:[y.jsx(we,{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"}}),y.jsx(we,{onClick:a,sx:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"transparent",zIndex:4}})]}),e&&y.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:[y.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&&y.jsxs(y.Fragment,{children:[y.jsx(we,{component:"img",src:Ge.Merge,sx:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer"},onClick:l}),y.jsx(bi,{orientation:"vertical",flexItem:!0,sx:{mx:"1rem",height:"auto!important",borderColor:p.palette.primary.notifyBorderColor}})]}),y.jsxs(ft,{direction:"row",justifyContent:"space-between",alignItems:"center",flexGrow:1,children:[y.jsxs(ft,{direction:"row",gap:"0.5rem",alignItems:"center",onClick:a,sx:{cursor:"pointer"},children:[y.jsx(hn,{url:Ge.CrossLight}),y.jsx(ot,{sx:{fontSize:"1.2rem",color:p.palette.primary.notifyTextColor},children:o})]}),y.jsx(ft,{direction:"row",gap:"0.5rem",alignItems:"center",children:i&&y.jsx(we,{onClick:c,sx:{cursor:"pointer"},children:y.jsx(we,{component:"img",src:u?Ge.Collapse:Ge.Expand})})})]})]}),y.jsx(we,{sx:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"},overflow:"auto",px:2},children:e})]})]})})},kw=({layoutChildren:e,layoutProps:t})=>y.jsx(Fn,{children:y.jsx(V7,{...e,...t})});kw.propTypes={layoutChildren:s.object.isRequired,layoutProps:s.object.isRequired},vt.Button=mo,vt.Checkbox=sc,vt.DatePicker=iV,vt.Grid=Bp,vt.Header=uw,vt.InputField=s1,vt.Loader=AV,vt.Notification=L7,vt.Select=l1,vt.SliderLayout=kw,vt.Switch=f1,vt.TextField=xc,vt.ToastProvider=PV,vt.toast=TV,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"],g=>{delete i[g]}),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 g=[H1.bind(this),void 0];for(g.unshift.apply(g,l),g.push.apply(g,u),p=g.length,d=Promise.resolve(n);f<p;)d=d.then(g[f++],g[f++]);return d}p=l.length;let h=n;for(f=0;f<p;){const g=l[f++],m=l[f++];try{h=g(h)}catch(b){m.call(this,b);break}}try{d=H1.call(this,h)}catch(g){return Promise.reject(g)}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 e7=class Ew{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 As(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 Ew(function(o){t=o}),cancel:t}}};function t7(e){return function(n){return e.apply(null,n)}}function n7(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=As,St.CancelToken=e7,St.isCancel=I1,St.VERSION=q1,St.toFormData=Pc,St.AxiosError=Ue,St.Cancel=St.CanceledError,St.all=function(t){return Promise.all(t)},St.spread=t7,St.isAxiosError=n7,St.mergeConfig=So,St.AxiosHeaders=gn,St.formToJSON=e=>D1(te.isHTMLForm(e)?new FormData(e):e),St.getAdapter=U1.getAdapter,St.HttpStatusCode=Pp,St.default=St;const{Axios:qW,AxiosError:YW,CanceledError:GW,isCancel:KW,CancelToken:XW,VERSION:ZW,all:JW,Cancel:QW,isAxiosError:ez,spread:tz,toFormData:nz,AxiosHeaders:rz,HttpStatusCode:oz,formToJSON:sz,getAdapter:iz,mergeConfig:az}=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 r7={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 Dp(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 Dp(this.converter,Nc({},this.attributes,o))},withConverter:function(o){return Dp(Nc({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var o7=Dp(r7,{path:"/"});const Dr={TOKEN:"token",USER:"user",SNOP:"snop",SELECTED_BU:"selected_business_unit",SETTINGS:"settings"},Rp={BEARER:"Bearer",TENANT_ID:"tenant_id",BU_ID:"bu_id",SNOP_ID:"snop_id"},s7=Object.values({"SKU Name":"sku_name",Node:"node","Channel Name":"channel_name"}),i7=[10,25,50,100],K1={MARK_ALL_READ:"MARK_ALL_READ"},a7=i7.map(e=>({label:e,value:e})),X1={PRIMARY:"PRIMARY",SECONDARY:"SECONDARY"},Ip=wc(Dr.SNOP),Ap=wc(Dr.SELECTED_BU),jp=wc(Dr.USER),l7=wc(Dr.SETTINGS),Ca={BU_IDS:Ap==null?void 0:Ap.business_unit_id,TOKEN:JSON.parse(o7.get(Dr.TOKEN)||null),TENANT_IDS:jp==null?void 0:jp.tenant_id,SNOP_IDS:Ip==null?void 0:Ip.snop_id,GRID_SETTINGS:l7},Sa={headers:{"Content-Type":"application/json",Authorization:`${Rp.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:c7,BU_ID:u7}=Rp,{TENANT_IDS:d7,BU_IDS:f7}=Ca,_c=async({baseUrl:e,payload:t})=>{try{const n=`${e}${$c.SETTING}/v1?${c7}=${d7}&${u7}=${f7}`;return await St.post(n,t,Sa)}catch(n){return n}},p7=({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(Dr.SETTINGS));let d=c.reduce((x,w)=>x==null?void 0:x[w],u)||null;if(!r&&t){a=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 k={...Ca.GRID_SETTINGS||{platform:{theme:"light"}}},v=(d==null?void 0:d.pageSize)??o;let O=k;for(let E=0;E<c.length;E++){const D=c[E];E===c.length-1?O[D]={columns:a,pageSize:v}:(O[D]={...O[D]||{}},O=O[D])}localStorage.setItem(Dr.SETTINGS,JSON.stringify(k)),await _c({baseUrl:n,payload:k})}catch(C){console.error(C)}})())}a=(d==null?void 0:d.columns)??a??J1({definitions:i});const f=a.reduce((x,w)=>(x[w.key]=w,x),{}),p=l.reduce((x,w)=>(x[w.key]=w,x),{}),h=[];for(const x of i){const w=f[x.key]||{},C=p[x.key]||{};let k={...x,...w,...C};if((b=x.children)!=null&&b.length){const v=(w.children||[]).reduce((E,D)=>(D!=null&&D.key&&(E[D.key]=D),E),{}),O=(C.children||[]).reduce((E,D)=>(D!=null&&D.key&&(E[D.key]=D),E),{});k.children=x.children.map(E=>({...E,...v[E.key],...O[E.key]}))}h.push(k)}const g=h.sort((x,w)=>x.sequenceId-w.sequenceId);return console.log({colSort:g}),g},h7=e=>e.sort((t,n)=>t.sequenceId-n.sequenceId),Np=e=>e.map(t=>({id:t.id,key:t.key,sequenceId:t.id,isHidden:t.isHidden||!1,style:t.style||{},...(t==null?void 0:t.children)&&{children:Np(t.children)}})),J1=({definitions:e})=>Np(e),m7=()=>({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 $p 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})}}$p.defaultProps={disabled:!1,minWidth:0,className:""},$p.propTypes={disabled:"boolean",minWidth:"number",className:"string"};const g7=(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;if(i!=null&&i.isChild&&Array.isArray(p.children)){const g=p.children.map(b=>{var x;return b.key===((x=i.column)==null?void 0:x.key)?{...b,isHidden:!0}:b}),m=g.every(b=>b.isHidden);return{...p,isHidden:m?!0:p.isHidden,children:g}}return p.key===((h=i.column)==null?void 0:h.key)?{...p,isHidden:!0}:p});d({updatedColumns:f})},d=async({updatedColumns:f})=>{t({type:He.SET_GRID_DATA,payload:{visibleGridColumns:f}});const p=r.split("/").filter(Boolean),m={...JSON.parse(localStorage.getItem(Dr.SETTINGS))||{platform:{theme:"light"}}},b=p.reduce((C,k)=>C==null?void 0:C[k],Ca.GRID_SETTINGS)||null,x=(b==null?void 0:b.pageSize)??o;let w=m;for(let C=0;C<p.length;C++){const k=p[C];C===p.length-1?w[k]={columns:f,pageSize:x}:(w[k]={...w[k]||{}},w=w[k])}localStorage.setItem(Dr.SETTINGS,JSON.stringify(m)),await _c({baseUrl:n,payload:m})};return{selectedColumn:i,handleMenuClick:l,handleClose:c,handleHideClick:u,columnUpdaterFunction:d}},Q1=({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 y.jsxs(we,{sx:{display:"flex",p:"1rem 1.5rem"},children:[y.jsxs(we,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"0.5rem",width:"100%"},children:[y.jsx(ot,{sx:{fontSize:"1.1rem",color:c.palette.primary.notifyTextColor},children:`Showing ${Math.min(r*o,i)} of ${i} rows`}),y.jsx(we,{sx:{"& .MuiInputBase-input":{padding:"0rem 0.8rem!important"},width:"6rem"},children:y.jsx(Sc,{options:a7,value:o,onChange:async d=>{l(d),u(d==null?void 0:d.value,t)}})})]}),y.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`}}})]})};Q1.propTypes={pagination:s.object.isRequired};function _p({isRenderCellContent:e,column:t,row:n,parent:r}){const o=n[t.key];return y.jsx(y.Fragment,{children:e?y.jsx(we,{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})}):y.jsx(Ag,{title:(o==null?void 0:o.length)>20?o:"",arrow:!0,children:y.jsx(we,{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:pV(o)})})})}_p.propTypes={isRenderCellContent:s.bool,column:s.object,row:s.object};const ew=({menuOpen:e,handleClose:t,onHideClick:n})=>{const r=It();return y.jsx(Ti,{open:!!e,anchorEl:e,onClose:t,anchorOrigin:{vertical:"bottom",horizontal:"left"},children:y.jsx(we,{sx:{backgroundColor:r.palette.primary.notifyBackground,border:`0.1rem solid ${r.palette.primary.notifyBorderColor}`,minHeight:"2.3rem",display:"flex",justifyContent:"center",alignItems:"center"},children:y.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"})})})};ew.propTypes={menuOpen:s.object,handleClose:s.func,onHideClick:s.func},Y(Ol)(({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 ko=Y(ot)(({theme:e})=>({color:e.palette.primary.notifyTextColor,fontSize:"1.1rem"})),y7=Y(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)"})}})),b7=Y(bi)(({theme:e})=>({color:e.palette.primary.notifyTextColor,padding:"0.6rem 0",fontSize:"0.9rem",fontWeight:500,"&::before, &::after":{borderColor:`${e.palette.primary.notifyBorderColor}!important`}})),v7=Y(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"}}));Y(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 x7=Y(Jg)(({theme:e})=>({minHeight:"2rem","& .MuiTabs-indicator":{height:"0.1rem",backgroundColor:e.palette.primary.notifyActiveText}})),Fp=Y(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=Y(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`}})),tw=({sortKey:e,sortField:t,sortDir:n,handleSortClick:r})=>{const o=i=>y.jsx(Ir,{onClick:r,sx:{padding:"0.5rem"},draggable:!1,children:y.jsx(hn,{url:i})});return y.jsx(y.Fragment,{children:o(t===e?n==="asc"?Ge.AscSort:Ge.DescSort:Ge.Unsort)})};tw.propTypes={sortKey:s.string.isRequired,sortField:s.string,sortDir:s.string,handleSortClick:s.func};function nw({parent:e,column:t,sort:n,handleMenuClick:r,isManageable:o}){const i=o&&(!(t!=null&&t.isMandatory)||(t==null?void 0:t.isMandatory)&&(t==null?void 0:t.showHide)===!0),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 y.jsxs(we,{sx:{display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.1rem",textAlign:"center",whiteSpace:"normal"},draggable:!1,children:[a,y.jsxs(we,{sx:{display:"flex",alignItems:"center"},draggable:!1,children:[l&&y.jsx(tw,{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})}),i&&y.jsx(Ir,{draggable:!1,onClick:f=>r(f,t,e),sx:{padding:"0.5rem 0.2rem"},children:y.jsx(hn,{url:Ge.Menu})})]})]})}nw.propTypes={column:s.object.isRequired,sort:s.object.isRequired,handleMenuClick:s.func,isManageable:s.bool};const w7=Y($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 y.jsx(w7,{...t,children:e})}Ta.propTypes={children:s.node};const C7=Y(Hg)(()=>({"&:last-child td":{borderBottom:0}}));function js({children:e,...t}){return y.jsx(C7,{...t,children:e})}js.propTypes={children:s.node};function rw({rows:e,sort:t,data:n,pagination:r,columns:o,nested:i,baseUrl:a,gridPath:l}){var K;const c=It(),{visibleGridColumns:u}=R.useContext(ga),d=R.useContext(ya),{selectedColumn:f,handleMenuClick:p,handleClose:h,handleHideClick:g,columnUpdaterFunction:m}=g7(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),[k,v]=R.useState(null),[O,E]=R.useState(null),[D,A]=R.useState(null);let j=null;const $=R.useRef(0),I=R.useRef(!1),V=R.useRef(null),F=h7(((K=i==null?void 0:i.column)==null?void 0:K.definitions)||[]),B=i==null?void 0:i.isNested,_=(i==null?void 0:i.data)||[],L=i==null?void 0:i.hashKey,[W,M]=R.useState(0),[N,z]=R.useState(null);if(R.useEffect(()=>{if(C.current){const P=()=>{M(C.current.offsetHeight)};return P(),window.addEventListener("resize",P),()=>window.removeEventListener("resize",P)}},[n]),R.useEffect(()=>{const P=C.current,q=P==null?void 0:P.querySelector("thead");if(!q)return;const X=()=>{A(null)};return q==null||q.addEventListener("mousedown",X),()=>{q==null||q.removeEventListener("mousedown",X)}},[]),!w)return y.jsx(ko,{sx:{textAlign:"center"},children:Gr.NRF});const J=(P,q)=>{var ye,pe;if(I.current){P.preventDefault();return}v(q),A(null),P.dataTransfer.setData("colIndex",q);const X=u[q],re=X==null?void 0:X.label,se=document.createElement("div");se.textContent=re,Object.assign(se.style,{display:"flex",alignItems:"center",justifyContent:"center",padding:"1.5rem 2.5rem",minWidth:(ye=X==null?void 0:X.style)==null?void 0:ye.minWidth,maxWidth:(pe=X==null?void 0:X.style)==null?void 0:pe.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(se);const{offsetWidth:fe,offsetHeight:Z}=se;P.dataTransfer.setDragImage(se,fe/2,Z/2),requestAnimationFrame(()=>{document.body.removeChild(se)})},ee=(P,q)=>{P.preventDefault(),E(q),ce(P)},H=async(P,q)=>{if(P.preventDefault(),clearInterval(j),k===null||k===q)return;const X=[...u],[re]=X.splice(k,1);X.splice(q,0,re);const se=u.slice().sort((Z,ye)=>Z.sequenceId-ye.sequenceId).map(Z=>Z.sequenceId),fe=X.map((Z,ye)=>({...Z,sequenceId:se[ye]??Z.sequenceId}));m({updatedColumns:fe}),v(null),E(null)},Q=()=>{v(null),E(null)},G=(P,q,X,re)=>{var Me,We,Ke,st,$e;if(!P)return null;const se=(P==null?void 0:P.isMandatory)&&(P==null?void 0:P.isSticky),fe=parseFloat((We=(Me=P==null?void 0:P.style)==null?void 0:Me.minWidth)==null?void 0:We.toString().replace("rem",""))||7.5;q===0&&($.current=0);const Z=se?q===0?0:`${$.current}rem`:void 0;se&&($.current+=fe);const ye=k===q,pe=O==q||((Ke=u==null?void 0:u[O])==null?void 0:Ke.isMandatory),be=ue=>{P.isMandatory?(ue.preventDefault(),ue.dataTransfer.dropEffect="none"):(ue.preventDefault(),ue.dataTransfer.dropEffect="move"),ee==null||ee(ue,q)},je=ue=>{P.isMandatory||H==null||H(ue,q)},Re=re?`${re==null?void 0:re.key}_${P==null?void 0:P.key}_${q}`:q;return y.jsx(Ta,{rowSpan:P!=null&&P.children?1:2,colSpan:($e=(st=P==null?void 0:P.children)==null?void 0:st.filter(ue=>!(ue!=null&&ue.isHidden)))==null?void 0:$e.length,style:P==null?void 0:P.style,onMouseEnter:()=>{D!==Re&&A(Re)},draggable:X&&!(P!=null&&P.isMandatory),onDragStart:X&&!(P!=null&&P.isMandatory)?ue=>J(ue,q):ue=>{ue.preventDefault()},onDragOver:X&&!(P!=null&&P.isMandatory)?be:void 0,onDrop:X&&!(P!=null&&P.isMandatory)?je:void 0,onDragEnd:X&&!(P!=null&&P.isMandatory)?Q:void 0,sx:{...P.isCenterTable&&{border:"0.1rem solid",borderTop:"none"},...ye&&{border:`0.1rem solid ${c.palette.brandColor.lightBlue}!important`},...se&&{position:"sticky",left:Z,zIndex:3},cursor:pe?"not-allowed":X&&!(P!=null&&P.isMandatory)?"grab":"default"},children:y.jsx(nw,{parent:re,column:P,sort:t,handleMenuClick:p,isManageable:X})},q)},le=(P,q,X,re)=>{var ye,pe,be;if(!P)return null;const se=(P==null?void 0:P.isMandatory)&&(P==null?void 0:P.isSticky),fe=parseFloat((pe=(ye=P==null?void 0:P.style)==null?void 0:ye.minWidth)==null?void 0:pe.toString().replace("rem",""))||7.5;X===0&&($.current=0);const Z=se?X===0?0:`${$.current}rem`:void 0;return se&&($.current+=fe),y.jsxs(Ta,{colSpan:1,style:P==null?void 0:P.style,className:`${P==null?void 0:P.label}`,sx:{...P.isCenterTable&&{border:"0.1rem solid",borderTop:"none"},position:"relative",...se&&{position:"sticky",left:Z,zIndex:2,backgroundColor:je=>{var Re;return e!=null&&e.selectedRow&&((Re=e==null?void 0:e.selectedRow)==null?void 0:Re.fhi)===(q==null?void 0:q.fhi)||q!=null&&q.isHigh?je.palette.primary.appBackground:je.palette.primary.notifyBackground}}},children:[((e==null?void 0:e.selectedRow)&&((be=e==null?void 0:e.selectedRow)==null?void 0:be.fhi)===(q==null?void 0:q.fhi)||(q==null?void 0:q.isHigh))&&y.jsx(we,{sx:{position:"absolute",bottom:0,left:0,width:"100%",height:"0.08rem",background:"linear-gradient(#F9B16E, #F68080)",pointerEvents:"none"}}),y.jsx(_p,{isRenderCellContent:!!(P!=null&&P.cellRenderer),column:P,row:q,parent:re})]},X)},ie=(P,q,X,re)=>{var fe;re&&`${re==null?void 0:re.key}${P==null?void 0:P.key}${q}`,(fe=[...u].map((Z,ye)=>({col:Z,index:ye})).reverse()[0])==null||fe.index;const se=N===q;return y.jsx(y.Fragment,{children:P&&!(P!=null&&P.isMandatory)&&X?y.jsx(we,{resizeStart:()=>{I.current=!0,z(q)},resizeEnd:()=>{I.current=!1,z(null)},component:P!=null&&P.children?$l:$p,rowSpan:P!=null&&P.children?1:2,colSpan:1,id:q,sx:{width:"1rem",maxWidth:"1rem",minWidth:"1rem",padding:0,position:"relative",borderBottom:`0.1rem solid ${c.palette.primary.notifyBorderColor}`,"&::after":se?{content:'""',position:"absolute",top:0,right:0,width:"0.2rem",height:`${W}px`,backgroundColor:c.palette.brandColor.lightBlue,zIndex:1}:void 0,"&:hover::after":{content:'""',position:"absolute",top:0,right:0,width:"0.2rem",height:`${W}px`,backgroundColor:c.palette.brandColor.lightBlue,zIndex:1}},disabled:!X}):null})},oe=(P,q,X,re,se,fe)=>{var Z;return fe&&`${fe==null?void 0:fe.key}${q==null?void 0:q.key}${X}`,y.jsx(y.Fragment,{children:q&&!(q!=null&&q.isMandatory)&&re?y.jsx($l,{className:"column_resizer_body",sx:{width:"1rem",maxWidth:"1rem",minWidth:"1rem",padding:0,position:"relative",borderBottom:`0.1rem solid ${c.palette.primary.notifyBorderColor}`},children:((e==null?void 0:e.selectedRow)&&((Z=e==null?void 0:e.selectedRow)==null?void 0:Z.fhi)===(P==null?void 0:P.fhi)||(P==null?void 0:P.isHigh))&&y.jsx(we,{sx:{position:"absolute",bottom:0,left:0,width:"100%",height:"0.08rem",background:"linear-gradient(#F9B16E, #F68080)",pointerEvents:"none"}})},`resize-${X}`):null})},ce=P=>{const q=C.current,{left:X,right:re}=q.getBoundingClientRect(),se=50,fe=P.clientX>re-se?1:P.clientX<X+se?-1:0;fe!==0?(V.current&&clearInterval(V.current),V.current=setInterval(()=>{q.scrollLeft+=fe*10},50)):V.current&&(clearInterval(V.current),V.current=null)};return y.jsxs(y.Fragment,{children:[y.jsx(Lg,{sx:{maxHeight:"100%",whiteSpace:"nowrap",overflow:"auto",width:"100%",border:`0.1rem solid ${c.palette.primary.notifyBorderColor}`,borderRadius:"1.4rem"},children:y.jsxs(_g,{ref:C,"aria-label":"sticky table",sx:{backgroundColor:P=>P.palette.primary.notifyBackground},children:[y.jsxs(Wg,{children:[y.jsx(js,{children:u.map((P,q)=>P!=null&&P.isHidden||(P==null?void 0:P.isVisible)===!1?null:y.jsxs(R.Fragment,{children:[G(P,q,b),x&&ie(P,q,b)]},q))}),y.jsx(js,{draggable:!1,children:u.flatMap((P,q)=>P!=null&&P.isHidden||!(P!=null&&P.children)||(P==null?void 0:P.isVisible)===!1?[]:P.children.map((X,re)=>X!=null&&X.isHidden?null:y.jsxs(R.Fragment,{children:[G(X,re,b,P),x&&ie(X,re,b,P)]},`${q}-${re}`)))})]}),y.jsx(Bg,{children:n.map((P,q)=>{const X=P[L],re=_==null?void 0:_[X],se=(re==null?void 0:re.length)>0;return y.jsxs(R.Fragment,{children:[y.jsx(js,{sx:{backgroundColor:fe=>{var Z;return e&&((Z=e==null?void 0:e.selectedRow)==null?void 0:Z.fhi)===(P==null?void 0:P.fhi)||P!=null&&P.isHigh?fe.palette.primary.appBackground:fe.palette.primary.notifyBackground}},onClick:()=>e==null?void 0:e.onRowClick(P),children:u.map((fe,Z)=>fe!=null&&fe.isHidden||(fe==null?void 0:fe.isVisible)===!1?null:fe!=null&&fe.children?fe.children.map((ye,pe)=>ye!=null&&ye.isHidden?null:y.jsxs(R.Fragment,{children:[le(ye,P,pe,fe),x&&oe(P,ye,pe,b,q,fe)]},`${Z}-${pe}`)):y.jsxs(R.Fragment,{children:[le(fe,P,Z),x&&oe(P,fe,Z,b)]},Z))}),B&&re&&y.jsx(y.Fragment,{children:se?re.map((fe,Z)=>y.jsx(js,{children:F.map((ye,pe)=>y.jsx(Ta,{style:ye==null?void 0:ye.style,children:y.jsx(_p,{isRenderCellContent:!!(ye!=null&&ye.cellRenderer),column:ye,row:fe})},pe))},`nested-${Z}`)):y.jsx(js,{children:y.jsx(Ta,{colSpan:F.length,children:y.jsx(ko,{sx:{textAlign:"center"},children:Gr.NRF})})})})]},q)})})]})}),r&&y.jsx(Q1,{pagination:r,gridPath:l,baseUrl:a}),y.jsx(ew,{menuOpen:f==null?void 0:f.isOpen,handleClose:h,onHideClick:g})]})}rw.propTypes={sort:s.object,data:s.array,pagination:s.object,columns:s.object,nested:s.object};function ow({tableProps:e,isDefaultConfig:t,gridPath:n,baseUrl:r}){var d;const{columns:o}=e,{visibleGridColumns:i=[],prevGridColumns:a}=R.useContext(ga)??{},l=R.useContext(ya),c=R.useMemo(()=>{var f;return p7({columns:o,gridPath:n,baseUrl:r,isDefaultConfig:t,pageSize:(f=e==null?void 0:e.pagination)==null?void 0:f.rowPerPage})},[o,n,r,t,(d=e==null?void 0:e.pagination)==null?void 0:d.rowPerPage]),u=R.useMemo(()=>{const f=new Map(i.map(h=>[h.key,h])),p=new Map;if(a.size>0)for(const[h,g]of a==null?void 0:a.entries()){const m=f.get(h);m&&g.isHidden!==m.isHidden&&p.set(h,!0)}return c.map(h=>{const g=f.get(h.key),m=p.has(h.key);return{...h,...g&&{...m&&{isHidden:g.isHidden}}}}).sort((h,g)=>h.sequenceId-g.sequenceId)},[a,i]);return console.log({mergedColumns:c,visibleGridColumns:i,columns:o,finalColumns:u,prevGridColumns:a}),R.useEffect(()=>{if(c!=null&&c.length){const f=new Map(c.map(p=>[p.key,p]));l({type:He.PREV_GRID_DEF,payload:{prevGridColumns:f}}),l({type:He.SET_GRID_DATA,payload:{visibleGridColumns:u}})}},[c]),y.jsx(rw,{...e,gridPath:n,baseUrl:r})}ow.propTypes={tableProps:s.object.isRequired,mergedColumns:s.array.isRequired};const sw=({type:e})=>{const t=It(),r=(t==null?void 0:t.mode)==="dark"?{bgcolor:"grey.800"}:{};return{grid:y.jsxs(we,{sx:{borderRadius:2,overflow:"hidden"},children:[y.jsx(Tr,{variant:"text",width:"100%",height:60,sx:r}),Array.from({length:10}).map((i,a)=>y.jsx(we,{sx:{display:"flex",alignItems:"center",padding:"0.5rem",gap:"3rem"},children:Array.from({length:5}).map((l,c)=>y.jsx(we,{sx:{flex:1},children:y.jsx(Tr,{variant:"text",height:45,sx:r})},c))},a))]}),toolbar:y.jsx(y.Fragment,{children:y.jsxs(ft,{direction:"row",justifyContent:"space-between",sx:{display:"flex",gap:"1rem"},children:[y.jsxs(ft,{direction:"row",gap:"1rem",children:[y.jsx(Tr,{variant:"text",width:"10.2rem",height:"5rem",sx:r}),y.jsx(Tr,{variant:"text",width:"3.5rem",height:"5rem",sx:r}),y.jsx(Tr,{variant:"text",width:"15.2rem",height:"5rem",sx:r})]}),y.jsxs(ft,{direction:"row",gap:"1rem",children:[y.jsx(Tr,{variant:"text",width:"10.2rem",height:"5rem",sx:r}),y.jsx(Tr,{variant:"text",width:"3.5rem",height:"5rem",sx:r}),y.jsx(Tr,{variant:"text",width:"3.5rem",height:"5rem",sx:r})]})]})})}[e]},S7=e=>{if(!e)return null;const{options:t,...n}=e,r=t?"select":"button",o={button:i=>{var a;return y.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 y.jsx(we,{sx:{"& .MuiInputBase-input":{padding:"0rem!important"},width:(a=i.styles)==null?void 0:a.width},children:y.jsx(l1,{...i,options:t})})}};return o[r]?o[r](n):null},T7=({presentSetting:e,gridSetting:t,gridPath:n})=>{if(!n)return e;const r=n.split("/").filter(Boolean),o=Np(t==null?void 0:t.grid);let i=e;for(let a=0;a<r.length;a++){const l=r[a];a===r.length-1?i[l]={columns:o,pageSize:(t==null?void 0:t.pageSize)??null}:(i[l]=i[l]||{},i=i[l])}return{settingObject:e,defaultUserSettings:o}},k7=async({baseUrl:e,gridSetting:t,gridPath:n})=>{try{const r=JSON.parse(localStorage.getItem("settings")),{settingObject:o,defaultUserSettings:i}=T7({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)}},O7=({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}},iw=({customTools:e,isExpanded:t,setIsExpanded:n})=>{const{primaryButtons:r,secondaryButtons:o}=O7({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]),y.jsxs(y.Fragment,{children:[t&&y.jsx("div",{style:{position:"fixed",left:0,width:"100vw",height:"4rem",zIndex:998}}),y.jsxs(we,{sx:{display:"flex",alignItems:"center",gap:"0.8rem",flexWrap:"nowrap",maxWidth:"100%",whiteSpace:"nowrap",zIndex:999},children:[y.jsx(Z5,{mode:"popLayout",children:i.map((d,f)=>y.jsx(Ki.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},layout:!0,children:y.jsx(we,{sx:{flexShrink:0,minWidth:"fit-content"},children:S7(d)})},`${d.id}_${f}`))}),l&&y.jsx(we,{sx:{paddingLeft:t?"0.5rem":0},children:y.jsx(mo,{label:t?"":"More Actions",styles:{iconPrimary:!0,icon:t?Ge.CrossWhite:Ge.More,colorType:t?"danger":""},onClick:u})})]})]})};iw.propTypes={customTools:s.array.isRequired};const aw=({defaultTools:e,isManageable:t,customTools:n,baseUrl:r,gridPath:o,managableColumns:i=[],pageSize:a,gridData:l})=>{var w,C,k,v,O,E;const c=R.useContext(ya),{visibleGridColumns:u,triggerApi:d}=R.useContext(ga),[f,p]=R.useState([]),[h,g]=R.useState(!1);R.useEffect(()=>{if(u.length){const D={id:99999,sequenceId:99999,isLocalizable:!1,key:"horizons",label:"Horizons",isSortable:!1,isHidden:!0,showChildCheckbox:!0,showCheckbox:!1,isMandatory:!0,showInHierarchy:!0,showHide:!0,children:[]};let A=u.map($=>($!=null&&$.children&&$.children.forEach(I=>{D.children.some(F=>F.key===I.key)||D.children.push({...I,showInHierarchy:!0})}),$)).filter($=>($==null?void 0:$.id)!==(D==null?void 0:D.id));const j=D.children.length>0?[...A,D]:A;p(j)}},[u]);const m=async D=>{try{await k7({baseUrl:r,gridPath:o,gridSetting:{grid:D,pageSize:a}})}catch(A){console.error(A)}finally{c({type:He.HAS_SETTING_CHANGE,payload:{hasChange:!1}}),c({type:He.TRIGGER_API,payload:{triggerApi:!1}})}};R.useEffect(()=>{d&&m(u)},[d]);const b=D=>{const A=D.map(I=>I.id),j=D.flatMap(I=>I.children||[]).map(I=>I.id),$=f.map(I=>{var B;const V=A.includes(I.id);if(Array.isArray(I.children)&&I.children.length>0){const _=I.children.map(W=>{const M=j.includes(W.id);return{...W,isHidden:!M}}),L=_.filter(W=>f.some(M=>{var N;return(N=M.children)==null?void 0:N.some(z=>z.id===W.id)})).every(W=>W.isHidden);return{...I,...!((B=I.children[0])!=null&&B.showInHierarchy)&&{isHidden:L||!V},children:_}}return{...I,isHidden:!V}});c({type:He.SET_GRID_DATA,payload:{visibleGridColumns:$}}),c({type:He.HAS_SETTING_CHANGE,payload:{hasChange:!0}})},x=()=>f.map(A=>{const j=Array.isArray(A.children)?A.children.filter($=>!$.isHidden):void 0;return!A.isHidden||A.isHidden&&A.showInHierarchy?{...A,children:j}:null}).filter(Boolean);return y.jsxs(we,{sx:{margin:"1rem 0",position:"relative",zIndex:10,display:"flex",flexDirection:"row",justifyContent:"space-between",gap:"0.6rem",width:"100%"},children:[y.jsxs(we,{sx:{display:"flex",flexDirection:"row",gap:"0.6rem"},children:[((w=e==null?void 0:e.search)==null?void 0:w.isRequired)&&y.jsx(s1,{...e==null?void 0:e.search,iconUrl:Ge.Search}),((C=e==null?void 0:e.groupBy)==null?void 0:C.isRequired)&&y.jsx(we,{sx:{"& .MuiInputBase-input":{padding:"0rem!important"}},children:y.jsx(Sc,{styles:{icon:Ge.Group},...e.groupBy})}),((k=e==null?void 0:e.refresh)==null?void 0:k.isRequired)&&y.jsx(mo,{...e==null?void 0:e.refresh,styles:{variant:"filled",icon:Ge.Refresh,colorType:"empty",width:"3.2rem",height:"3.2rem"}}),t&&y.jsx(we,{sx:{"& .MuiInputBase-input":{padding:"0rem!important"}},children:y.jsx(Sc,{placeholder:"Manage Columns",options:f,value:x(),isMulti:!0,isDraggable:!0,showSearch:!0,isManageColumn:!0,onChange:b,disabled:!l.length,styles:{icon:Ge.Manage}})})]}),y.jsxs(we,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-end",gap:"0.6rem"},children:[n&&y.jsx(iw,{customTools:n,setIsExpanded:g,isExpanded:h}),((v=e==null?void 0:e.save)==null?void 0:v.isRequired)&&y.jsx(we,{sx:{px:"0.5rem"},children:y.jsx(mo,{label:h?"":"Save",styles:{icon:Ge.Save,colorType:"empty"},...e==null?void 0:e.save})}),((O=e==null?void 0:e.upload)==null?void 0:O.isRequired)&&y.jsx(mo,{...e==null?void 0:e.upload,styles:{variant:h?"outlined":"filled",icon:h?Ge.UploadDark:Ge.Upload,iconPrimary:!h,colorType:"secondary",isAnimate:!0}}),((E=e==null?void 0:e.download)==null?void 0:E.isRequired)&&y.jsx(mo,{...e==null?void 0:e.download,styles:{variant:"outlined",icon:Ge.Download,isAnimate:!0}})]})]})};aw.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 y.jsx(a1,{children:r?y.jsxs(y.Fragment,{children:[y.jsx(sw,{type:"toolbar"}),y.jsx(sw,{type:"grid"})]}):y.jsxs(we,{sx:{position:"sticky"},children:[t&&y.jsx(aw,{...t,isManageable:o,pageSize:(a=e==null?void 0:e.pagination)==null?void 0:a.rowPerPage,gridData:e==null?void 0:e.data}),y.jsx(ow,{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 lw=({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?y.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):y.jsx(ot,{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 y.jsx(L0,{separator:y.jsx(hn,{url:Ge.ArrowRight}),children:r({list:e})})};lw.propTypes={list:s.array.isRequired,handleLinkClick:s.func};const cw=({breadcrumbProps:e,switchProps:t,filterComponentProps:n})=>{var o,i,a,l,c,u;const r=It();return y.jsxs(y.Fragment,{children:[y.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:[y.jsx(lw,{...e}),y.jsxs(ft,{direction:"row",gap:"1rem",alignItems:"center",children:[t&&y.jsx(f1,{...t}),(n==null?void 0:n.filterBtnProps)&&y.jsxs(ft,{direction:"row",children:[y.jsx(bi,{orientation:"vertical",flexItem:!0,sx:{mx:"1rem",height:"2rem!important",opacity:"1!important",borderColor:r.palette.primary.notifyBorderColor}}),y.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:[y.jsx(hn,{url:Ge.Filter}),y.jsx(ot,{sx:{fontSize:"1.1rem",color:r.palette.primary.notifyActiveText},children:(i=n==null?void 0:n.filterBtnProps)==null?void 0:i.label})]})]})]})]}),y.jsx(Ki.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:y.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:[y.jsx(ot,{sx:{fontSize:"1.2rem",fontWeight:"500",color:r.palette.primary.notifyActiveText},children:"Filters:"}),y.jsx(we,{sx:{overflowX:"auto",overflowY:"visible",whiteSpace:"nowrap",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"},margin:"0 1rem",padding:"0.5rem 0",flexGrow:1},children:y.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)=>y.jsx(y.Fragment,{children:y.jsxs(we,{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:[y.jsx(we,{component:"img",src:Ge.FilterClose,sx:{position:"absolute",top:"-0.4rem",right:"-0.6rem",cursor:"pointer"},onClick:()=>n==null?void 0:n.onFilterChipClose(d)}),y.jsx(ot,{sx:{fontSize:"1rem",color:r.palette.primary.notifyTextColor},children:d==null?void 0:d.filterLabel})]},f)}))})}),y.jsx(we,{component:ot,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"})]})})]})};cw.propTypes={breadcrumbProps:s.object.isRequired,switchProps:s.object};function uw({headerProps:e}){return y.jsx(Fn,{children:y.jsx(cw,{...e})})}uw.propTypes={headerProps:s.object.isRequired};const Lp=R.createContext(null),dw=R.createContext(null);function E7({children:e}){const[t,n]=R.useReducer(P7,M7);return y.jsx(Lp.Provider,{value:t,children:y.jsx(dw.Provider,{value:n,children:e})})}function P7(e,t){var n;switch(t.type){case He.LOADING:return{...e,loading:t.loading};case He.SUCCESS:return{...e,data:(n=t.data)==null?void 0:n.sort((r,o)=>new Date(o.createdAt)-new Date(r.createdAt))};case He.MARK_ALL_AS_READ:return{...e,isMarkAllAsRead:t.isMarkAllAsRead};case He.ERROR:return{...e,error:t.error};default:throw new Error(`${Gr.UNHANDLED}: ${t}`)}}const M7={loading:!1,data:[],error:"",isMarkAllAsRead:{count:0,boo:!1}},{TENANT_ID:Vp,BU_ID:Wp,SNOP_ID:fw}=Rp,{TENANT_IDS:zp,BU_IDS:Up}=Ca,D7=async e=>{try{const t=`${e}${$c.NOTIFICATION}/v1?${Vp}=${zp}&${Wp}=${Up}`;return await St.get(t,Sa)}catch(t){return t}},pw=async(e,t,n)=>{try{const r=n===K1.MARK_ALL_READ?"":`&${fw}=${n}&`,o=`${e}${$c.NOTIFICATION}${Mp.VERSION}?${Vp}=${zp}&${Wp}=${Up}${r}`;return await St.put(o,t,Sa)}catch(r){return r}},R7=async({baseUrl:e,id:t,snopId:n})=>{try{const r=`${e}${$c.NOTIFICATION}${Mp.VERSION}?${Vp}=${zp}&${Wp}=${Up}&${fw}=${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},hw=({baseUrl:e})=>{const t=R.useContext(dw),[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),[g,m]=R.useState(!1),[b,x]=R.useState(0),{loading:w,data:C,isMarkAllAsRead:k}=R.useContext(Lp),[v,O]=R.useState([]);R.useEffect(()=>{O(C)},[C]);const E=R.useCallback(async()=>{var F,B;try{t({type:He.LOADING,loading:!0}),t({type:He.SUCCESS,data:[]});const _=await D7(e);if(_.status===Bc.OK){const L=((B=(F=_.data)==null?void 0:F.responseData)==null?void 0:B.response)||[],W=Cc(L);t({type:He.SUCCESS,data:Cc(W)}),t({type:He.MARK_ALL_AS_READ,isMarkAllAsRead:{count:i1(L),boo:i1(L)>0}})}}catch{t({type:He.ERROR,error:Gr.SWR})}finally{t({type:He.LOADING,loading:!1})}},[e,t]);R.useEffect(()=>{E();const F=setInterval(E,3e5);return()=>clearInterval(F)},[E]);const D=async(F,B)=>{var _,L,W;if(F){f(F);try{const M=await R7({baseUrl:e,id:F,snopId:B});if(M.status===Bc.OK){const N=((W=(L=(_=M.data)==null?void 0:_.responseData)==null?void 0:L.response)==null?void 0:W[0])||{};u(N||{}),l(!0)}else throw new Error}catch{t({type:He.ERROR,error:Gr.SWR})}finally{f(null)}}},A=async(F,B)=>{if(F.length){t({type:He.LOADING,loading:!0});try{if((await pw(e,F,B)).status===Bc.OK){const L=C.map(M=>F.includes(M.id)?{...M,isRead:!0}:M),W=L.filter(M=>!M.isRead).length;t({type:He.SUCCESS,data:Cc(L)}),t({type:He.MARK_ALL_AS_READ,isMarkAllAsRead:{count:W,boo:W>0}}),setTimeout(()=>{t({type:He.LOADING,loading:!1})},200)}}catch{t({type:He.ERROR,error:Gr.SWR}),t({type:He.LOADING,loading:!1})}}},j=async()=>{t({type:He.LOADING,loading:!0});try{const F=cV(C);if((await pw(e,F,K1.MARK_ALL_READ)).status===Bc.OK){const _=C.map(L=>({...L,isRead:!0}));t({type:He.SUCCESS,data:Cc(_)}),t({type:He.MARK_ALL_AS_READ,isMarkAllAsRead:{count:0,boo:!1}}),setTimeout(()=>{t({type:He.LOADING,loading:!1})},200)}}catch{t({type:He.ERROR,error:Gr.SWR}),t({type:He.LOADING,loading:!1})}},$=(F,B)=>{t({type:He.LOADING,loading:!0}),x(B),setTimeout(()=>{t({type:He.LOADING,loading:!1})},400)},I=F=>{const B=F||C||[];return{0:B,1:B.filter(_=>(_==null?void 0:_.type)==="INFO"),2:B.filter(_=>(_==null?void 0:_.type)==="ERROR")}},V=()=>{t({type:He.LOADING,loading:!0});const F=!g,B=F?(v||[]).filter(_=>!_.isRead):C||[];m(F),O(B),h(1),setTimeout(()=>{t({type:He.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:A,handleMarkAllAsRead:j,setOpen:r,handleShowDetails:D,clickId:d,isMainDialog:!0},activeTab:b,loading:w,tabData:I(v)[b],data:v,mode:g,handleTabChange:$,toggleAlertMode:V,page:p,setPage:h,isMarkAllAsRead:k}};var mw,gw,yw;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 I7=function(t){return S.createElement("svg",Hp({xmlns:"http://www.w3.org/2000/svg",width:16,height:17,fill:"none"},t),mw||(mw=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"})),gw||(gw=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"})),yw||(yw=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 A7=({count:e})=>(It(),y.jsxs(y.Fragment,{children:[y.jsx(we,{sx:{gap:"0.5rem",display:"flex",justifyContent:"center",alignItems:"center","& svg":{transform:"scale(1)"}},children:y.jsx(I7,{style:{scale:2}})}),y.jsx(v7,{badgeContent:e!=0?"":null,color:"error"})]}));function bw({children:e,handleClose:t,open:n,isMainDialog:r}){return y.jsx(Ol,{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 vw;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 j7=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),vw||(vw=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"})))},xw,ww;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 N7=function(t){return S.createElement("svg",Yp({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,fill:"none"},t),xw||(xw=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"})),ww||(ww=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"})))},Cw;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 $7=function(t){return S.createElement("svg",Gp({xmlns:"http://www.w3.org/2000/svg",width:9,height:8,fill:"none"},t),Cw||(Cw=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 Sw=({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 y.jsxs(we,{className:"cards",sx:{pt:" 0.8rem"},children:[y.jsx(ft,{display:"flex",flexDirection:"row",alignItems:"start",justifyContent:"space-between",gap:1,children:y.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:y.jsx(ko,{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})})}),y.jsx(ft,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",children:y.jsxs(ft,{display:"flex",flexDirection:"row",justifyContent:"start",gap:1,sx:{p:"0.5rem 0"},children:[(t==null?void 0:t.isNotificationDetails)&&y.jsx(Fc,{icon:y.jsx(N7,{className:`${l==="light"?"chip-icon-light":"chip-icon-dark"}`}),disabled:i,onClick:n,label:i===(t==null?void 0:t.id)?y.jsx(kl,{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)&&y.jsx(Fc,{icon:y.jsx($7,{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)&&y.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)&&y.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"})]})}),y.jsxs(ft,{display:"flex",flexDirection:"row",alignItems:"center",gap:.35,children:[y.jsx(ko,{sx:{fontSize:"0.8rem"},children:t==null?void 0:t.product}),y.jsx(ko,{color:a.palette.primary.notifyTextColor,children:"•"}),y.jsx(ko,{sx:{fontSize:"0.8rem"},children:lV(t==null?void 0:t.createdAt)})]})]})};Sw.propTypes={type:s.string,title:s.string,subTitle:s.string,isRead:s.bool,handleShowDetails:s.func,handleRead:s.func};const Tw=({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),[g,m]=R.useState(!0),b=R.useRef(null),x=async C=>{h(!0);const k=e.slice((C-1)*10,C*10);await new Promise(v=>setTimeout(v,1e3)),f(v=>{const O=k.filter(E=>!v.some(D=>D.id===E.id));return[...v,...O]}),h(!1),(d==null?void 0:d.length)>=(e==null?void 0:e.length)&&m(!1)};R.useEffect(()=>{var k;let C=[];o?l!=null&&l.count?C=(k=e==null?void 0:e.filter(v=>!v.isRead))==null?void 0:k.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(()=>{g&&i!==1&&x(i)},[i,e]),R.useEffect(()=>{f([...e])},[e]),R.useEffect(()=>{const C=new IntersectionObserver(k=>{k[0].isIntersecting&&!p&&g&&a(v=>v+1)},{threshold:1});return b.current&&C.observe(b.current),()=>{b.current&&C.unobserve(b.current)}},[p,g]);const w=({redirect:C,isClicked:k,url:v})=>{window.open(v,"_blank")};return y.jsxs(we,{sx:{width:"100%"},children:[Object.entries(fV(d)).map(([C,k])=>y.jsxs(R.Fragment,{children:[C!==u&&y.jsx(b7,{children:C}),k.map((v,O)=>y.jsx(R.Fragment,{children:y.jsx(Sw,{item:v,handleCTAClicked:w,handleShowDetails:()=>n(v.id,v.snopId),handleRead:()=>t([v.id],v.snopId),clickId:r})},`${O}_${v.id}`))]},C)),p&&i>1&&!!(d!=null&&d.length)&&y.jsx(we,{sx:{display:"flex",justifyContent:"center",alignItems:"center",pl:"0.5rem",py:"0.3rem"},children:y.jsx(kl,{size:20,sx:{color:C=>C.palette.primary.notifyIconColor}})}),!(d!=null&&d.length)&&y.jsx(ot,{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."}),y.jsx(we,{ref:b,style:{height:"0.1rem",backgroundColor:"transparent"}})]})};Tw.propTypes={data:s.array,handleRead:s.func,handleShowDetails:s.func};const _7=({onRefresh:e,handleShowDetails:t,clickId:n,handleRead:r,handleMarkAllAsRead:o})=>{var g,m,b,x;const{loading:i,activeTab:a,data:l,tabData:c,mode:u,page:d,setPage:f,handleTabChange:p,toggleAlertMode:h}=hw({});return y.jsxs(y.Fragment,{children:[y.jsxs(we,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:2,pt:2},children:[y.jsx(ot,{variant:"h2",sx:{fontSize:"1.2rem",color:w=>w.palette.primary.notifyTextColor},children:"Notifications"}),y.jsx(we,{onClick:e,children:y.jsx(hn,{url:Ge.Refresh,alt:"refresh",sx:{cursor:"pointer"}})})]}),y.jsx(we,{sx:{borderBottom:1,m:"1.2rem 1.2rem 0 1.2rem",borderColor:w=>w.palette.primary.notifyBorderColor},children:y.jsxs(x7,{value:a,onChange:p,children:[y.jsx(Fp,{label:y.jsxs(we,{sx:{display:"flex",alignItems:"center",fontSize:"1rem",fontWeight:"500"},children:["All (",y.jsx(ot,{component:"span",sx:{fontWeight:"500",fontSize:"1rem"},children:((g=l==null?void 0:l.filter(w=>!(w!=null&&w.isRead)))==null?void 0:g.length)||0}),")"]})}),y.jsx(Fp,{label:y.jsxs(we,{sx:{display:"flex",alignItems:"center",fontSize:"1rem",fontWeight:"500"},children:["Info (",y.jsx(ot,{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}}),y.jsx(Fp,{label:y.jsxs(we,{sx:{display:"flex",alignItems:"center",fontSize:"1rem",fontWeight:"500"},children:["Error (",y.jsx(ot,{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}})]})}),y.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?y.jsx(kl,{size:30,sx:{color:w=>w.palette.primary.notifyIconColor}}):y.jsx(y.Fragment,{children:y.jsx(Tw,{data:c,handleShowDetails:t,handleRead:r,clickId:n,page:d,setPage:f,mode:u})})}),y.jsxs(El,{sx:{justifyContent:"space-between",px:"1.2rem"},children:[y.jsxs(ft,{direction:"row",gap:1,children:[y.jsx(ko,{sx:{fontSize:"1rem"},children:"Only show unread"}),y.jsx(y7,{disabled:i,checked:u,onChange:h})]}),y.jsx(Hn,{variant:"outlined",className:"view-all",onClick:o,startIcon:y.jsx(j7,{}),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"})]})]})},F7=({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([]),[g,m]=R.useState("");return R.useEffect(()=>{var x;if(g||c){const w=uV(e==null?void 0:e.notificationDetails,s7,g);if(c){const C=dV(w,c,d);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)},[g,e==null?void 0:e.notificationDetails,n,o,d,c]),y.jsxs(y.Fragment,{children:[y.jsxs(ft,{direction:"row",justifyContent:"space-between",sx:{padding:"1.5rem 2rem",borderBottom:"0.1rem solid",borderColor:x=>x.palette.primary.notifyBorderColor},children:[y.jsx(ot,{component:"h2",sx:{fontSize:"1.4rem",color:x=>x.palette.primary.notifyActiveText},children:(e==null?void 0:e.message)||""}),y.jsx(we,{onClick:t,sx:{cursor:"pointer"},children:y.jsx(hn,{url:Ge.CloseCircle})})]}),y.jsx(Pl,{children:y.jsx(Bp,{tableProps:{data:p,columns:{...m7(),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(k=>c===w&&k==="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..."}}}})}),y.jsx(El,{sx:{padding:"1.5rem 2rem"}})]})},B7=({baseUrl:e})=>{const{alertDialogProps:t,showDetailsProps:n,fetchNotification:r,isMarkAllAsRead:o}=hw({baseUrl:e});return y.jsxs(y.Fragment,{children:[y.jsx(we,{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:y.jsx(A7,{count:o.count})}),y.jsx(bw,{...t,children:y.jsx(_7,{...t})}),y.jsx(bw,{...n,children:y.jsx(F7,{...n})})]})},L7=({baseUrl:e})=>y.jsx(Fn,{children:y.jsx(E7,{children:y.jsx(B7,{baseUrl:e})})}),V7=({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 y.jsx(we,{sx:{position:"relative",overflow:"hidden"},children:y.jsxs(ao,{container:!0,sx:{height:"100%"},children:[y.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&&y.jsxs(y.Fragment,{children:[y.jsx(we,{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"}}),y.jsx(we,{onClick:a,sx:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"transparent",zIndex:4}})]}),e&&y.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:[y.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&&y.jsxs(y.Fragment,{children:[y.jsx(we,{component:"img",src:Ge.Merge,sx:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer"},onClick:l}),y.jsx(bi,{orientation:"vertical",flexItem:!0,sx:{mx:"1rem",height:"auto!important",borderColor:p.palette.primary.notifyBorderColor}})]}),y.jsxs(ft,{direction:"row",justifyContent:"space-between",alignItems:"center",flexGrow:1,children:[y.jsxs(ft,{direction:"row",gap:"0.5rem",alignItems:"center",onClick:a,sx:{cursor:"pointer"},children:[y.jsx(hn,{url:Ge.CrossLight}),y.jsx(ot,{sx:{fontSize:"1.2rem",color:p.palette.primary.notifyTextColor},children:o})]}),y.jsx(ft,{direction:"row",gap:"0.5rem",alignItems:"center",children:i&&y.jsx(we,{onClick:c,sx:{cursor:"pointer"},children:y.jsx(we,{component:"img",src:u?Ge.Collapse:Ge.Expand})})})]})]}),y.jsx(we,{sx:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"},overflow:"auto",px:2},children:e})]})]})})},kw=({layoutChildren:e,layoutProps:t})=>y.jsx(Fn,{children:y.jsx(V7,{...e,...t})});kw.propTypes={layoutChildren:s.object.isRequired,layoutProps:s.object.isRequired},vt.Button=mo,vt.Checkbox=sc,vt.DatePicker=iV,vt.Grid=Bp,vt.Header=uw,vt.InputField=s1,vt.Loader=AV,vt.Notification=L7,vt.Select=l1,vt.SliderLayout=kw,vt.Switch=f1,vt.TextField=xc,vt.ToastProvider=PV,vt.toast=TV,Object.defineProperty(vt,Symbol.toStringTag,{value:"Module"})});
|
|
327
327
|
//# sourceMappingURL=index.umd.js.map
|