@3sc/common-component 0.0.6 → 0.0.10

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.
@@ -0,0 +1,2 @@
1
+ import{useReducer as e,createContext as t,useState as n,useEffect as r,useContext as o,useCallback as i}from"react";import{IconButton as a,Dialog as c,DialogTitle as u,Box as s,Typography as l,DialogActions as f,Button as p,Stack as d,Badge as y,Checkbox as m,Chip as v,TextField as g,DialogContent as b,CircularProgress as S,InputAdornment as w,createTheme as O,ThemeProvider as R}from"@mui/material";import E from"@mui/icons-material/NotificationsOutlined";import j from"@mui/material/Badge";import{styled as A}from"@mui/material/styles";import C from"@mui/icons-material/Refresh";import T from"@mui/icons-material/Close";import{grey as N,blue as x}from"@mui/material/colors";import P from"axios";import I from"@mui/icons-material/Search";import k from"@mui/material/Pagination";import _ from"react-select";var D=function(e){try{return!!e()}catch(e){return!0}},M=!D(function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}),L=Function.prototype,$=L.call,F=M&&L.bind.bind($,$),U=M?F:function(e){return function(){return $.apply(e,arguments)}},B=U({}.toString),V=U("".slice),z=function(e){return V(B(e),8,-1)},G=Object,W=U("".split),K=D(function(){return!G("z").propertyIsEnumerable(0)})?function(e){return"String"===z(e)?W(e,""):G(e)}:G,q=function(e){return null==e},H=TypeError,J=function(e){if(q(e))throw new H("Can't call method on "+e);return e},Y=function(e){return K(J(e))},X="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Q(e){var t={exports:{}};return e(t,t.exports),t.exports}var Z,ee,te=function(e){return e&&e.Math===Math&&e},ne=te("object"==typeof globalThis&&globalThis)||te("object"==typeof window&&window)||te("object"==typeof self&&self)||te("object"==typeof X&&X)||te("object"==typeof X&&X)||function(){return this}()||Function("return this")(),re=Object.defineProperty,oe=function(e,t){try{re(ne,e,{value:t,configurable:!0,writable:!0})}catch(n){ne[e]=t}return t},ie="__core-js_shared__",ae=ne[ie]||oe(ie,{}),ce=Q(function(e){(e.exports=function(e,t){return ae[e]||(ae[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.35.0",mode:"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.35.0/LICENSE",source:"https://github.com/zloirock/core-js"})}),ue=Object,se=function(e){return ue(J(e))},le=U({}.hasOwnProperty),fe=Object.hasOwn||function(e,t){return le(se(e),t)},pe=0,de=Math.random(),he=U(1..toString),ye=function(e){return"Symbol("+(void 0===e?"":e)+")_"+he(++pe+de,36)},me="undefined"!=typeof navigator&&String(navigator.userAgent)||"",ve=ne.process,ge=ne.Deno,be=ve&&ve.versions||ge&&ge.version,Se=be&&be.v8;Se&&(ee=(Z=Se.split("."))[0]>0&&Z[0]<4?1:+(Z[0]+Z[1])),!ee&&me&&(!(Z=me.match(/Edge\/(\d+)/))||Z[1]>=74)&&(Z=me.match(/Chrome\/(\d+)/))&&(ee=+Z[1]);var we,Oe=ee,Re=ne.String,Ee=!!Object.getOwnPropertySymbols&&!D(function(){var e=Symbol("symbol detection");return!Re(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Oe&&Oe<41}),je=Ee&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Ae=ne.Symbol,Ce=ce("wks"),Te=je?Ae.for||Ae:Ae&&Ae.withoutSetter||ye,Ne=function(e){return fe(Ce,e)||(Ce[e]=Ee&&fe(Ae,e)?Ae[e]:Te("Symbol."+e)),Ce[e]},xe="object"==typeof document&&document.all,Pe=void 0===xe&&void 0!==xe?function(e){return"function"==typeof e||e===xe}:function(e){return"function"==typeof e},Ie=function(e){return"object"==typeof e?null!==e:Pe(e)},ke=String,_e=TypeError,De=function(e){if(Ie(e))return e;throw new _e(ke(e)+" is not an object")},Me=!D(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}),Le=Me&&D(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype}),$e=ne.document,Fe=Ie($e)&&Ie($e.createElement),Ue=function(e){return Fe?$e.createElement(e):{}},Be=!Me&&!D(function(){return 7!==Object.defineProperty(Ue("div"),"a",{get:function(){return 7}}).a}),Ve=Function.prototype.call,ze=M?Ve.bind(Ve):function(){return Ve.apply(Ve,arguments)},Ge=function(e,t){return arguments.length<2?Pe(n=ne[e])?n:void 0:ne[e]&&ne[e][t];var n},We=U({}.isPrototypeOf),Ke=Object,qe=je?function(e){return"symbol"==typeof e}:function(e){var t=Ge("Symbol");return Pe(t)&&We(t.prototype,Ke(e))},He=String,Je=function(e){try{return He(e)}catch(e){return"Object"}},Ye=TypeError,Xe=function(e){if(Pe(e))return e;throw new Ye(Je(e)+" is not a function")},Qe=function(e,t){var n=e[t];return q(n)?void 0:Xe(n)},Ze=TypeError,et=TypeError,tt=Ne("toPrimitive"),nt=function(e){var t=function(e,t){if(!Ie(e)||qe(e))return e;var n,r=Qe(e,tt);if(r){if(void 0===t&&(t="default"),n=ze(r,e,t),!Ie(n)||qe(n))return n;throw new et("Can't convert object to primitive value")}return void 0===t&&(t="number"),function(e,t){var n,r;if("string"===t&&Pe(n=e.toString)&&!Ie(r=ze(n,e)))return r;if(Pe(n=e.valueOf)&&!Ie(r=ze(n,e)))return r;if("string"!==t&&Pe(n=e.toString)&&!Ie(r=ze(n,e)))return r;throw new Ze("Can't convert object to primitive value")}(e,t)}(e,"string");return qe(t)?t:t+""},rt=TypeError,ot=Object.defineProperty,it=Object.getOwnPropertyDescriptor,at="enumerable",ct="configurable",ut="writable",st={f:Me?Le?function(e,t,n){if(De(e),t=nt(t),De(n),"function"==typeof e&&"prototype"===t&&"value"in n&&ut in n&&!n[ut]){var r=it(e,t);r&&r[ut]&&(e[t]=n.value,n={configurable:ct in n?n[ct]:r[ct],enumerable:at in n?n[at]:r[at],writable:!1})}return ot(e,t,n)}:ot:function(e,t,n){if(De(e),t=nt(t),De(n),Be)try{return ot(e,t,n)}catch(e){}if("get"in n||"set"in n)throw new rt("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},lt=Math.ceil,ft=Math.floor,pt=Math.trunc||function(e){var t=+e;return(t>0?ft:lt)(t)},dt=function(e){var t=+e;return t!=t||0===t?0:pt(t)},ht=Math.max,yt=Math.min,mt=Math.min,vt=function(e){return(t=e.length)>0?mt(dt(t),9007199254740991):0;var t},gt=function(e){return function(t,n,r){var o,i=Y(t),a=vt(i),c=function(e,t){var n=dt(e);return n<0?ht(n+t,0):yt(n,t)}(r,a);if(e&&n!=n){for(;a>c;)if((o=i[c++])!=o)return!0}else for(;a>c;c++)if((e||c in i)&&i[c]===n)return e||c||0;return!e&&-1}},bt={includes:gt(!0),indexOf:gt(!1)},St={},wt=bt.indexOf,Ot=U([].push),Rt=function(e,t){var n,r=Y(e),o=0,i=[];for(n in r)!fe(St,n)&&fe(r,n)&&Ot(i,n);for(;t.length>o;)fe(r,n=t[o++])&&(~wt(i,n)||Ot(i,n));return i},Et=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],jt=Object.keys||function(e){return Rt(e,Et)},At=Me&&!Le?Object.defineProperties:function(e,t){De(e);for(var n,r=Y(t),o=jt(t),i=o.length,a=0;i>a;)st.f(e,n=o[a++],r[n]);return e},Ct={f:At},Tt=Ge("document","documentElement"),Nt=ce("keys"),xt=function(e){return Nt[e]||(Nt[e]=ye(e))},Pt="prototype",It="script",kt=xt("IE_PROTO"),_t=function(){},Dt=function(e){return"<"+It+">"+e+"</"+It+">"},Mt=function(e){e.write(Dt("")),e.close();var t=e.parentWindow.Object;return e=null,t},Lt=function(){try{we=new ActiveXObject("htmlfile")}catch(e){}var e,t,n;Lt="undefined"!=typeof document?document.domain&&we?Mt(we):(t=Ue("iframe"),n="java"+It+":",t.style.display="none",Tt.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(Dt("document.F=Object")),e.close(),e.F):Mt(we);for(var r=Et.length;r--;)delete Lt[Pt][Et[r]];return Lt()};St[kt]=!0;var $t=Object.create||function(e,t){var n;return null!==e?(_t[Pt]=De(e),n=new _t,_t[Pt]=null,n[kt]=e):n=Lt(),void 0===t?n:Ct.f(n,t)},Ft=st.f,Ut=Ne("unscopables"),Bt=Array.prototype;void 0===Bt[Ut]&&Ft(Bt,Ut,{configurable:!0,value:$t(null)});var Vt,zt,Gt,Wt=function(e){Bt[Ut][e]=!0},Kt={},qt=ne.WeakMap,Ht=Pe(qt)&&/native code/.test(String(qt)),Jt=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},Yt=Me?function(e,t,n){return st.f(e,t,Jt(1,n))}:function(e,t,n){return e[t]=n,e},Xt="Object already initialized",Qt=ne.TypeError;if(Ht||ae.state){var Zt=ae.state||(ae.state=new(0,ne.WeakMap));Zt.get=Zt.get,Zt.has=Zt.has,Zt.set=Zt.set,Vt=function(e,t){if(Zt.has(e))throw new Qt(Xt);return t.facade=e,Zt.set(e,t),t},zt=function(e){return Zt.get(e)||{}},Gt=function(e){return Zt.has(e)}}else{var en=xt("state");St[en]=!0,Vt=function(e,t){if(fe(e,en))throw new Qt(Xt);return t.facade=e,Yt(e,en,t),t},zt=function(e){return fe(e,en)?e[en]:{}},Gt=function(e){return fe(e,en)}}var tn={set:Vt,get:zt,has:Gt,enforce:function(e){return Gt(e)?zt(e):Vt(e,{})},getterFor:function(e){return function(t){var n;if(!Ie(t)||(n=zt(t)).type!==e)throw new Qt("Incompatible receiver, "+e+" required");return n}}},nn={}.propertyIsEnumerable,rn=Object.getOwnPropertyDescriptor,on=rn&&!nn.call({1:2},1)?function(e){var t=rn(this,e);return!!t&&t.enumerable}:nn,an={f:on},cn=Object.getOwnPropertyDescriptor,un={f:Me?cn:function(e,t){if(e=Y(e),t=nt(t),Be)try{return cn(e,t)}catch(e){}if(fe(e,t))return Jt(!ze(an.f,e,t),e[t])}},sn=Function.prototype,ln=Me&&Object.getOwnPropertyDescriptor,fn=fe(sn,"name"),pn={EXISTS:fn,PROPER:fn&&"something"===function(){}.name,CONFIGURABLE:fn&&(!Me||Me&&ln(sn,"name").configurable)},dn=U(Function.toString);Pe(ae.inspectSource)||(ae.inspectSource=function(e){return dn(e)});var hn,yn,mn,vn=ae.inspectSource,gn=Q(function(e){var t=pn.CONFIGURABLE,n=tn.enforce,r=tn.get,o=String,i=Object.defineProperty,a=U("".slice),c=U("".replace),u=U([].join),s=Me&&!D(function(){return 8!==i(function(){},"length",{value:8}).length}),l=String(String).split("String"),f=e.exports=function(e,r,f){"Symbol("===a(o(r),0,7)&&(r="["+c(o(r),/^Symbol\(([^)]*)\)/,"$1")+"]"),f&&f.getter&&(r="get "+r),f&&f.setter&&(r="set "+r),(!fe(e,"name")||t&&e.name!==r)&&(Me?i(e,"name",{value:r,configurable:!0}):e.name=r),s&&f&&fe(f,"arity")&&e.length!==f.arity&&i(e,"length",{value:f.arity});try{f&&fe(f,"constructor")&&f.constructor?Me&&i(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var p=n(e);return fe(p,"source")||(p.source=u(l,"string"==typeof r?r:"")),e};Function.prototype.toString=f(function(){return Pe(this)&&r(this).source||vn(this)},"toString")}),bn=function(e,t,n,r){r||(r={});var o=r.enumerable,i=void 0!==r.name?r.name:t;if(Pe(n)&&gn(n,i,r),r.global)o?e[t]=n:oe(t,n);else{try{r.unsafe?e[t]&&(o=!0):delete e[t]}catch(e){}o?e[t]=n:st.f(e,t,{value:n,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return e},Sn=Et.concat("length","prototype"),wn={f:Object.getOwnPropertyNames||function(e){return Rt(e,Sn)}},On={f:Object.getOwnPropertySymbols},Rn=U([].concat),En=Ge("Reflect","ownKeys")||function(e){var t=wn.f(De(e)),n=On.f;return n?Rn(t,n(e)):t},jn=function(e,t,n){for(var r=En(t),o=st.f,i=un.f,a=0;a<r.length;a++){var c=r[a];fe(e,c)||n&&fe(n,c)||o(e,c,i(t,c))}},An=/#|\.prototype\./,Cn=function(e,t){var n=Nn[Tn(e)];return n===Pn||n!==xn&&(Pe(t)?D(t):!!t)},Tn=Cn.normalize=function(e){return String(e).replace(An,".").toLowerCase()},Nn=Cn.data={},xn=Cn.NATIVE="N",Pn=Cn.POLYFILL="P",In=Cn,kn=un.f,_n=function(e,t){var n,r,o,i,a,c=e.target,u=e.global,s=e.stat;if(n=u?ne:s?ne[c]||oe(c,{}):(ne[c]||{}).prototype)for(r in t){if(i=t[r],o=e.dontCallGetSet?(a=kn(n,r))&&a.value:n[r],!In(u?r:c+(s?".":"#")+r,e.forced)&&void 0!==o){if(typeof i==typeof o)continue;jn(i,o)}(e.sham||o&&o.sham)&&Yt(i,"sham",!0),bn(n,r,i,e)}},Dn=!D(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Mn=xt("IE_PROTO"),Ln=Object,$n=Ln.prototype,Fn=Dn?Ln.getPrototypeOf:function(e){var t=se(e);if(fe(t,Mn))return t[Mn];var n=t.constructor;return Pe(n)&&t instanceof n?n.prototype:t instanceof Ln?$n:null},Un=Ne("iterator"),Bn=!1;[].keys&&("next"in(mn=[].keys())?(yn=Fn(Fn(mn)))!==Object.prototype&&(hn=yn):Bn=!0);var Vn=!Ie(hn)||D(function(){var e={};return hn[Un].call(e)!==e});Vn&&(hn={}),Pe(hn[Un])||bn(hn,Un,function(){return this});var zn={IteratorPrototype:hn,BUGGY_SAFARI_ITERATORS:Bn},Gn=st.f,Wn=Ne("toStringTag"),Kn=function(e,t,n){e&&!n&&(e=e.prototype),e&&!fe(e,Wn)&&Gn(e,Wn,{configurable:!0,value:t})},qn=zn.IteratorPrototype,Hn=function(){return this},Jn=String,Yn=TypeError,Xn=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=function(e,t,n){try{return U(Xe(Object.getOwnPropertyDescriptor(e,"__proto__").set))}catch(e){}}(Object.prototype))(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return De(n),function(e){if(function(e){return Ie(e)||null===e}(e))return e;throw new Yn("Can't set "+Jn(e)+" as a prototype")}(r),t?e(n,r):n.__proto__=r,n}}():void 0),Qn=pn.PROPER,Zn=pn.CONFIGURABLE,er=zn.IteratorPrototype,tr=zn.BUGGY_SAFARI_ITERATORS,nr=Ne("iterator"),rr="keys",or="values",ir="entries",ar=function(){return this},cr=function(e,t){return{value:e,done:t}},ur=st.f,sr="Array Iterator",lr=tn.set,fr=tn.getterFor(sr),pr=function(e,t,n,r,o,i,a){!function(e,t,n,r){var o=t+" Iterator";e.prototype=$t(qn,{next:Jt(1,function(){var e=fr(this),t=e.target,n=e.index++;if(!t||n>=t.length)return e.target=void 0,cr(void 0,!0);switch(e.kind){case"keys":return cr(n,!1);case"values":return cr(t[n],!1)}return cr([n,t[n]],!1)})}),Kn(e,o,!1),Kt[o]=Hn}(n,t);var c,u,s,l=function(e){if(e===o&&y)return y;if(!tr&&e&&e in d)return d[e];switch(e){case rr:case or:case ir:return function(){return new n(this,e)}}return function(){return new n(this)}},f=t+" Iterator",p=!1,d=e.prototype,h=d[nr]||d["@@iterator"]||o&&d[o],y=!tr&&h||l(o),m=d.entries||h;if(m&&(c=Fn(m.call(new e)))!==Object.prototype&&c.next&&(Fn(c)!==er&&(Xn?Xn(c,er):Pe(c[nr])||bn(c,nr,ar)),Kn(c,f,!0)),Qn&&h&&h.name!==or&&(Zn?Yt(d,"name",or):(p=!0,y=function(){return ze(h,this)})),o)if(void(u={values:l(or),keys:l(rr),entries:l(ir)}))for(s in u)(tr||p||!(s in d))&&bn(d,s,u[s]);else _n({target:t,proto:!0,forced:tr||p},u);return d[nr]!==y&&bn(d,nr,y,{name:o}),Kt[t]=y,u}(Array,"Array",function(e,t){lr(this,{type:sr,target:Y(e),index:0,kind:t})},0,"values"),dr=Kt.Arguments=Kt.Array;if(Wt("keys"),Wt("values"),Wt("entries"),Me&&"values"!==dr.name)try{ur(dr,"name",{value:"values"})}catch(e){}var hr={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},yr=Ue("span").classList,mr=yr&&yr.constructor&&yr.constructor.prototype,vr=mr===Object.prototype?void 0:mr,gr=Ne("iterator"),br=pr.values,Sr=function(e,t){if(e){if(e[gr]!==br)try{Yt(e,gr,br)}catch(t){e[gr]=br}if(Kn(e,t,!0),hr[t])for(var n in pr)if(e[n]!==pr[n])try{Yt(e,n,pr[n])}catch(t){e[n]=pr[n]}}};for(var wr in hr)Sr(ne[wr]&&ne[wr].prototype,wr);Sr(vr,"DOMTokenList");var Or="process"===z(ne.process),Rr=Ne("species"),Er=TypeError,jr={};jr[Ne("toStringTag")]="z";var Ar="[object z]"===String(jr),Cr=Ne("toStringTag"),Tr=Object,Nr="Arguments"===z(function(){return arguments}()),xr=Ar?z:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Tr(e),Cr))?n:Nr?z(t):"Object"===(r=z(t))&&Pe(t.callee)?"Arguments":r},Pr=function(){},Ir=[],kr=Ge("Reflect","construct"),_r=/^\s*(?:class|function)\b/,Dr=U(_r.exec),Mr=!_r.test(Pr),Lr=function(e){if(!Pe(e))return!1;try{return kr(Pr,Ir,e),!0}catch(e){return!1}},$r=function(e){if(!Pe(e))return!1;switch(xr(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Mr||!!Dr(_r,vn(e))}catch(e){return!0}};$r.sham=!0;var Fr,Ur,Br,Vr,zr=!kr||D(function(){var e;return Lr(Lr.call)||!Lr(Object)||!Lr(function(){e=!0})||e})?$r:Lr,Gr=TypeError,Wr=Ne("species"),Kr=Function.prototype,qr=Kr.apply,Hr=Kr.call,Jr="object"==typeof Reflect&&Reflect.apply||(M?Hr.bind(qr):function(){return Hr.apply(qr,arguments)}),Yr=function(e){if("Function"===z(e))return U(e)},Xr=Yr(Yr.bind),Qr=function(e,t){return Xe(e),void 0===t?e:M?Xr(e,t):function(){return e.apply(t,arguments)}},Zr=U([].slice),eo=TypeError,to=/(?:ipad|iphone|ipod).*applewebkit/i.test(me),no=ne.setImmediate,ro=ne.clearImmediate,oo=ne.process,io=ne.Dispatch,ao=ne.Function,co=ne.MessageChannel,uo=ne.String,so=0,lo={},fo="onreadystatechange";D(function(){Fr=ne.location});var po=function(e){if(fe(lo,e)){var t=lo[e];delete lo[e],t()}},ho=function(e){return function(){po(e)}},yo=function(e){po(e.data)},mo=function(e){ne.postMessage(uo(e),Fr.protocol+"//"+Fr.host)};no&&ro||(no=function(e){!function(e,t){if(e<1)throw new eo("Not enough arguments")}(arguments.length);var t=Pe(e)?e:ao(e),n=Zr(arguments,1);return lo[++so]=function(){Jr(t,void 0,n)},Ur(so),so},ro=function(e){delete lo[e]},Or?Ur=function(e){oo.nextTick(ho(e))}:io&&io.now?Ur=function(e){io.now(ho(e))}:co&&!to?(Vr=(Br=new co).port2,Br.port1.onmessage=yo,Ur=Qr(Vr.postMessage,Vr)):ne.addEventListener&&Pe(ne.postMessage)&&!ne.importScripts&&Fr&&"file:"!==Fr.protocol&&!D(mo)?(Ur=mo,ne.addEventListener("message",yo,!1)):Ur=fo in Ue("script")?function(e){Tt.appendChild(Ue("script"))[fo]=function(){Tt.removeChild(this),po(e)}}:function(e){setTimeout(ho(e),0)});var vo={set:no,clear:ro},go=Object.getOwnPropertyDescriptor,bo=function(){this.head=null,this.tail=null};bo.prototype={add:function(e){var t={item:e,next:null},n=this.tail;n?n.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return null===(this.head=e.next)&&(this.tail=null),e.item}};var So,wo,Oo,Ro,Eo,jo=bo,Ao=/ipad|iphone|ipod/i.test(me)&&"undefined"!=typeof Pebble,Co=/web0s(?!.*chrome)/i.test(me),To=vo.set,No=ne.MutationObserver||ne.WebKitMutationObserver,xo=ne.document,Po=ne.process,Io=ne.Promise,ko=function(e){if(!Me)return ne[e];var t=go(ne,e);return t&&t.value}("queueMicrotask");if(!ko){var _o=new jo,Do=function(){var e,t;for(Or&&(e=Po.domain)&&e.exit();t=_o.get();)try{t()}catch(e){throw _o.head&&So(),e}e&&e.enter()};to||Or||Co||!No||!xo?!Ao&&Io&&Io.resolve?((Ro=Io.resolve(void 0)).constructor=Io,Eo=Qr(Ro.then,Ro),So=function(){Eo(Do)}):Or?So=function(){Po.nextTick(Do)}:(To=Qr(To,ne),So=function(){To(Do)}):(wo=!0,Oo=xo.createTextNode(""),new No(Do).observe(Oo,{characterData:!0}),So=function(){Oo.data=wo=!wo}),ko=function(e){_o.head||So(),_o.add(e)}}var Mo,Lo,$o,Fo,Uo,Bo,Vo,zo=ko,Go=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},Wo=ne.Promise,Ko="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,qo=!Ko&&!Or&&"object"==typeof window&&"object"==typeof document,Ho=Ne("species"),Jo=!1,Yo=Pe(ne.PromiseRejectionEvent),Xo=In("Promise",function(){var e=vn(Wo),t=e!==String(Wo);if(!t&&66===Oe)return!0;if(!Oe||Oe<51||!/native code/.test(e)){var n=new Wo(function(e){e(1)}),r=function(e){e(function(){},function(){})};if((n.constructor={})[Ho]=r,!(Jo=n.then(function(){})instanceof r))return!0}return!t&&(qo||Ko)&&!Yo}),Qo={CONSTRUCTOR:Xo,REJECTION_EVENT:Yo,SUBCLASSING:Jo},Zo=TypeError,ei=function(e){var t,n;this.promise=new e(function(e,r){if(void 0!==t||void 0!==n)throw new Zo("Bad Promise constructor");t=e,n=r}),this.resolve=Xe(t),this.reject=Xe(n)},ti={f:function(e){return new ei(e)}},ni=vo.set,ri="Promise",oi=Qo.CONSTRUCTOR,ii=Qo.REJECTION_EVENT,ai=Qo.SUBCLASSING,ci=tn.getterFor(ri),ui=tn.set,si=Wo&&Wo.prototype,li=Wo,fi=si,pi=ne.TypeError,di=ne.document,hi=ne.process,yi=ti.f,mi=yi,vi=!!(di&&di.createEvent&&ne.dispatchEvent),gi="unhandledrejection",bi=function(e){var t;return!(!Ie(e)||!Pe(t=e.then))&&t},Si=function(e,t){var n,r,o,i=t.value,a=1===t.state,c=a?e.ok:e.fail,u=e.resolve,s=e.reject,l=e.domain;try{c?(a||(2===t.rejection&&ji(t),t.rejection=1),!0===c?n=i:(l&&l.enter(),n=c(i),l&&(l.exit(),o=!0)),n===e.promise?s(new pi("Promise-chain cycle")):(r=bi(n))?ze(r,n,u,s):u(n)):s(i)}catch(e){l&&!o&&l.exit(),s(e)}},wi=function(e,t){e.notified||(e.notified=!0,zo(function(){for(var n,r=e.reactions;n=r.get();)Si(n,e);e.notified=!1,t&&!e.rejection&&Ri(e)}))},Oi=function(e,t,n){var r,o;vi?((r=di.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),ne.dispatchEvent(r)):r={promise:t,reason:n},!ii&&(o=ne["on"+e])?o(r):e===gi&&function(e,t){try{1===arguments.length?console.error(e):console.error(e,t)}catch(e){}}("Unhandled promise rejection",n)},Ri=function(e){ze(ni,ne,function(){var t,n=e.facade,r=e.value;if(Ei(e)&&(t=Go(function(){Or?hi.emit("unhandledRejection",r,n):Oi(gi,n,r)}),e.rejection=Or||Ei(e)?2:1,t.error))throw t.value})},Ei=function(e){return 1!==e.rejection&&!e.parent},ji=function(e){ze(ni,ne,function(){var t=e.facade;Or?hi.emit("rejectionHandled",t):Oi("rejectionhandled",t,e.value)})},Ai=function(e,t,n){return function(r){e(t,r,n)}},Ci=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,wi(e,!0))},Ti=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw new pi("Promise can't be resolved itself");var r=bi(t);r?zo(function(){var n={done:!1};try{ze(r,t,Ai(Ti,n,e),Ai(Ci,n,e))}catch(t){Ci(n,t,e)}}):(e.value=t,e.state=1,wi(e,!1))}catch(t){Ci({done:!1},t,e)}}};if(oi&&(li=function(e){!function(e,t){if(We(fi,e))return e;throw new Er("Incorrect invocation")}(this),Xe(e),ze(Mo,this);var t=ci(this);try{e(Ai(Ti,t),Ai(Ci,t))}catch(e){Ci(t,e)}},(Mo=function(e){ui(this,{type:ri,done:!1,notified:!1,parent:!1,reactions:new jo,rejection:!1,state:0,value:void 0})}).prototype=bn(fi=li.prototype,"then",function(e,t){var n,r,o,i=ci(this),a=yi((n=li,void 0===(o=De(this).constructor)||q(r=De(o)[Wr])?n:function(e){if(zr(e))return e;throw new Gr(Je(e)+" is not a constructor")}(r)));return i.parent=!0,a.ok=!Pe(e)||e,a.fail=Pe(t)&&t,a.domain=Or?hi.domain:void 0,0===i.state?i.reactions.add(a):zo(function(){Si(a,i)}),a.promise}),Lo=function(){var e=new Mo,t=ci(e);this.promise=e,this.resolve=Ai(Ti,t),this.reject=Ai(Ci,t)},ti.f=yi=function(e){return e===li||void 0===e?new Lo(e):mi(e)},Pe(Wo)&&si!==Object.prototype)){$o=si.then,ai||bn(si,"then",function(e,t){var n=this;return new li(function(e,t){ze($o,n,e,t)}).then(e,t)},{unsafe:!0});try{delete si.constructor}catch(e){}Xn&&Xn(si,fi)}_n({global:!0,constructor:!0,wrap:!0,forced:oi},{Promise:li}),Kn(li,ri,!1),Vo=Ge(ri),Me&&Vo&&!Vo[Rr]&&(Fo=Vo,Uo=Rr,(Bo={configurable:!0,get:function(){return this}}).get&&gn(Bo.get,Uo,{getter:!0}),Bo.set&&gn(Bo.set,Uo,{setter:!0}),st.f(Fo,Uo,Bo));var Ni=Ne("iterator"),xi=Array.prototype,Pi=Ne("iterator"),Ii=function(e){if(!q(e))return Qe(e,Pi)||Qe(e,"@@iterator")||Kt[xr(e)]},ki=TypeError,_i=function(e,t,n){var r,o;De(e);try{if(!(r=Qe(e,"return"))){if("throw"===t)throw n;return n}r=ze(r,e)}catch(e){o=!0,r=e}if("throw"===t)throw n;if(o)throw r;return De(r),n},Di=TypeError,Mi=function(e,t){this.stopped=e,this.result=t},Li=Mi.prototype,$i=function(e,t,n){var r,o,i,a,c,u,s,l,f=!(!n||!n.AS_ENTRIES),p=!(!n||!n.IS_RECORD),d=!(!n||!n.IS_ITERATOR),h=!(!n||!n.INTERRUPTED),y=Qr(t,n&&n.that),m=function(e){return r&&_i(r,"normal",e),new Mi(!0,e)},v=function(e){return f?(De(e),h?y(e[0],e[1],m):y(e[0],e[1])):h?y(e,m):y(e)};if(p)r=e.iterator;else if(d)r=e;else{if(!(o=Ii(e)))throw new Di(Je(e)+" is not iterable");if(void 0!==(l=o)&&(Kt.Array===l||xi[Ni]===l)){for(i=0,a=vt(e);a>i;i++)if((c=v(e[i]))&&We(Li,c))return c;return new Mi(!1)}r=function(e,t){var n=arguments.length<2?Ii(e):t;if(Xe(n))return De(ze(n,e));throw new ki(Je(e)+" is not iterable")}(e,o)}for(u=p?e.next:r.next;!(s=ze(u,r)).done;){try{c=v(s.value)}catch(e){_i(r,"throw",e)}if("object"==typeof c&&c&&We(Li,c))return c}return new Mi(!1)},Fi=Ne("iterator"),Ui=!1;try{var Bi=0,Vi={next:function(){return{done:!!Bi++}},return:function(){Ui=!0}};Vi[Fi]=function(){return this},Array.from(Vi,function(){throw 2})}catch(e){}var zi=Qo.CONSTRUCTOR||!function(e,t){try{if(!Ui)return!1}catch(e){return!1}var n=!1;try{var r={};r[Fi]=function(){return{next:function(){return{done:n=!0}}}},Wo.all(r).then(void 0,function(){})}catch(e){}return n}();_n({target:"Promise",stat:!0,forced:zi},{all:function(e){var t=this,n=ti.f(t),r=n.resolve,o=n.reject,i=Go(function(){var n=Xe(t.resolve),i=[],a=0,c=1;$i(e,function(e){var u=a++,s=!1;c++,ze(n,t,e).then(function(e){s||(s=!0,i[u]=e,--c||r(i))},o)}),--c||r(i)});return i.error&&o(i.value),n.promise}});var Gi=Wo&&Wo.prototype;if(_n({target:"Promise",proto:!0,forced:Qo.CONSTRUCTOR,real:!0},{catch:function(e){return this.then(void 0,e)}}),Pe(Wo)){var Wi=Ge("Promise").prototype.catch;Gi.catch!==Wi&&bn(Gi,"catch",Wi,{unsafe:!0})}_n({target:"Promise",stat:!0,forced:zi},{race:function(e){var t=this,n=ti.f(t),r=n.reject,o=Go(function(){var o=Xe(t.resolve);$i(e,function(e){ze(o,t,e).then(n.resolve,r)})});return o.error&&r(o.value),n.promise}}),_n({target:"Promise",stat:!0,forced:Qo.CONSTRUCTOR},{reject:function(e){var t=ti.f(this);return(0,t.reject)(e),t.promise}}),_n({target:"Promise",stat:!0,forced:Qo.CONSTRUCTOR},{resolve:function(e){return function(e,t){if(De(e),Ie(t)&&t.constructor===e)return t;var n=ti.f(e);return(0,n.resolve)(t),n.promise}(this,e)}});var Ki=bt.includes,qi=D(function(){return!Array(1).includes()});_n({target:"Array",proto:!0,forced:qi},{includes:function(e){return Ki(this,e,arguments.length>1?arguments[1]:void 0)}}),Wt("includes");var Hi=Ne("match"),Ji=TypeError,Yi=String,Xi=function(e){if("Symbol"===xr(e))throw new TypeError("Cannot convert a Symbol value to a string");return Yi(e)},Qi=Ne("match"),Zi=U("".indexOf);_n({target:"String",proto:!0,forced:!function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[Qi]=!1,"/./"[e](t)}catch(e){}}return!1}("includes")},{includes:function(e){return!!~Zi(Xi(J(this)),Xi(function(e){if(function(e){var t;return Ie(e)&&(void 0!==(t=e[Hi])?!!t:"RegExp"===z(e))}(e))throw new Ji("The method doesn't accept regular expressions");return e}(e)),arguments.length>1?arguments[1]:void 0)}});var ea=Object.assign,ta=Object.defineProperty,na=U([].concat),ra=!ea||D(function(){if(Me&&1!==ea({b:1},ea(ta({},"a",{enumerable:!0,get:function(){ta(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol("assign detection"),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach(function(e){t[e]=e}),7!==ea({},e)[n]||jt(ea({},t)).join("")!==r})?function(e,t){for(var n=se(e),r=arguments.length,o=1,i=On.f,a=an.f;r>o;)for(var c,u=K(arguments[o++]),s=i?na(jt(u),i(u)):jt(u),l=s.length,f=0;l>f;)c=s[f++],Me&&!ze(a,u,c)||(n[c]=u[c]);return n}:ea;function oa(){return oa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},oa.apply(this,arguments)}function ia(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(o[n]=e[n]);return o}_n({target:"Object",stat:!0,arity:2,forced:Object.assign!==ra},{assign:ra});const aa=["count","handleClick"],ca=e=>{let{count:t,handleClick:n}=e,r=ia(e,aa);return h(a,{onClick:n},h(j,oa({},r,{badgeContent:t,overlap:"circular",color:"primary",fontSize:"1.5rem"}),h(E,{sx:Object.assign({fontSize:"2.5rem"},t>0?{color:"primary.main"}:{color:"secondary.main"})})))},ua={BEARER:"Bearer",TENANT_ID:"tenant_id",BU_ID:"bu_id",SNOP_ID:"snop_id"},sa="refresh",la="close",fa=[{label:"Show 10 Rows",value:10},{label:"Show 20 Rows",value:20},{label:"Show 30 Rows",value:30}],pa={"SKU Name":"sku_name",Node:"node","Channel Name":"channel_name"},da=Object.values(pa),ha=["message","sub_type"],ya=e=>Object.assign({},e,{borderRadius:2,colors:Object.assign({},e.colors,{primary25:"#F2F2F2",primary:"#E94F1C"})}),ma=["title","subTitle","children","onRefresh","onClose","loading","handleShowAll","handleMarkAllAsRead","isMarkAllAsRead","width","headerIconType","isDialogActionShow","className"],va=A(c)(({theme:e})=>({"& .MuiPaper-root":{borderRadius:8,border:`1px solid ${N[50]}`,boxShadow:e.shadows[5]},"& .MuiDialogContent-root":{padding:e.spacing(1)},"& .MuiDialogActions-root":{padding:`${e.spacing(.2)} ${e.spacing(.5)}}`}})),ga=e=>{let{title:t,subTitle:n,children:r,onRefresh:o,onClose:i,loading:c,handleShowAll:d,handleMarkAllAsRead:y,isMarkAllAsRead:m,headerIconType:v,isDialogActionShow:g,className:b}=e,S=ia(e,ma);return h(va,oa({maxWidth:"md",onClose:i},S,{className:["notification-dialog",b].join(" ")}),h(u,{sx:{p:1,display:"flex"}},h(s,{sx:{gap:1,display:"flex"}},h(s,null,h(l,{variant:"h6",className:"title"},t),n&&h(l,{variant:"h6",className:"title sub-title"},n)),(()=>{switch(v){case sa:return h(a,{disabled:c,"aria-label":"close",sx:{position:"absolute",right:8,top:8,color:"primary.main"},onClick:o},h(C,{fontSize:"medium"}));case la:return h(a,{"aria-label":"close",sx:{position:"absolute",right:8,top:8,color:"primary.main"},onClick:i},h(T,{fontSize:"medium"}));default:return null}})())),r,g&&h(f,{className:"dialog-action"},h(p,{onClick:d,className:"view-all"},"Show all"),m.boo&&h(p,{className:"view-all",onClick:y},"Mark all as read")))},ba={LOADING:"LOADING",SUCCESS:"SUCCESS",ERROR:"ERROR",MARK_ALL_AS_READ:"MARK_ALL_AS_READ"},Sa={SWR:"Something went wrong!",UNHANDLED:"Unhandled action type: ",INVALID:"Invalid action type: ",INVALID_ACTION:"Invalid action type: ",NRF:"Not record found!"},wa=/*#__PURE__*/t(null),Oa=/*#__PURE__*/t(null);function Ra({children:t}){const[n,r]=e(Ea,ja);return h(wa.Provider,{value:n},h(Oa.Provider,{value:r},t))}function Ea(e,t){switch(t.type){case ba.LOADING:return Object.assign({},e,{loading:t.loading});case ba.SUCCESS:return Object.assign({},e,{data:t.data});case ba.MARK_ALL_AS_READ:return Object.assign({},e,{isMarkAllAsRead:t.isMarkAllAsRead});case ba.ERROR:return Object.assign({},e,{error:t.error});default:throw new Error(`${Sa.UNHANDLED}: ${t}`)}}const ja={loading:!1,data:[],error:"",isMarkAllAsRead:{count:0,boo:!1}};var Aa=TypeError,Ca=function(e,t){if(!delete e[t])throw new Aa("Cannot delete property "+Je(t)+" of "+Je(e))},Ta=Math.floor,Na=function(e,t){var n=e.length;if(n<8)for(var r,o,i=1;i<n;){for(o=i,r=e[i];o&&t(e[o-1],r)>0;)e[o]=e[--o];o!==i++&&(e[o]=r)}else for(var a=Ta(n/2),c=Na(Zr(e,0,a),t),u=Na(Zr(e,a),t),s=c.length,l=u.length,f=0,p=0;f<s||p<l;)e[f+p]=f<s&&p<l?t(c[f],u[p])<=0?c[f++]:u[p++]:f<s?c[f++]:u[p++];return e},xa=Na,Pa=me.match(/firefox\/(\d+)/i),Ia=!!Pa&&+Pa[1],ka=/MSIE|Trident/.test(me),_a=me.match(/AppleWebKit\/(\d+)\./),Da=!!_a&&+_a[1],Ma=[],La=U(Ma.sort),$a=U(Ma.push),Fa=D(function(){Ma.sort(void 0)}),Ua=D(function(){Ma.sort(null)}),Ba=function(e,t){var n=[].sort;return!!n&&D(function(){n.call(null,function(){return 1},1)})}(),Va=!D(function(){if(Oe)return Oe<70;if(!(Ia&&Ia>3)){if(ka)return!0;if(Da)return Da<603;var e,t,n,r,o="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:n=3;break;case 68:case 71:n=4;break;default:n=2}for(r=0;r<47;r++)Ma.push({k:t+r,v:n})}for(Ma.sort(function(e,t){return t.v-e.v}),r=0;r<Ma.length;r++)t=Ma[r].k.charAt(0),o.charAt(o.length-1)!==t&&(o+=t);return"DGBEFHACIJK"!==o}});_n({target:"Array",proto:!0,forced:Fa||!Ua||!Ba||!Va},{sort:function(e){void 0!==e&&Xe(e);var t=se(this);if(Va)return void 0===e?La(t):La(t,e);var n,r,o=[],i=vt(t);for(r=0;r<i;r++)r in t&&$a(o,t[r]);for(xa(o,function(e){return function(t,n){return void 0===n?-1:void 0===t?1:void 0!==e?+e(t,n)||0:Xi(t)>Xi(n)?1:-1}}(e)),n=vt(o),r=0;r<n;)t[r]=o[r++];for(;r<i;)Ca(t,r++);return t}});var za,Ga="\t\n\v\f\r                 \u2028\u2029\ufeff",Wa=U("".replace),Ka=RegExp("^["+Ga+"]+"),qa=RegExp("(^|[^"+Ga+"])["+Ga+"]+$"),Ha=function(e){return function(t){var n=Xi(J(t));return 1&e&&(n=Wa(n,Ka,"")),2&e&&(n=Wa(n,qa,"$1")),n}},Ja={start:Ha(1),end:Ha(2),trim:Ha(3)},Ya=pn.PROPER,Xa=Ja.trim;_n({target:"String",proto:!0,forced:(za="trim",D(function(){return!!Ga[za]()||"​…᠎"!=="​…᠎"[za]()||Ya&&Ga[za].name!==za}))},{trim:function(){return Xa(this)}});const Qa=e=>{const t=localStorage.getItem(e);return t?JSON.parse(t):""},Za=e=>new Date(e).toLocaleString("en-US",{year:"numeric",month:"long",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!0}),ec=e=>{const t=e.sort((e,t)=>e.isRead===t.isRead?0:t.isRead?-1:1).slice(0,9);return t},tc=(e,t,n)=>e.filter(e=>t.some(t=>e[t].toLowerCase().includes(n.trim().toLowerCase()))),nc=(e,t,n)=>e.slice((t-1)*n,t*n),rc=Qa("user"),oc=Qa("snop"),ic={TOKEN:Qa("token"),BU_IDS:null==rc?void 0:rc.business_unit_id,TENANT_IDS:null==rc?void 0:rc.tenant_id,SNOP_IDS:null==oc?void 0:oc.snop_id},ac=P.create({baseURL:"https://scai-qa-api.3sc.ai",headers:{"Content-Type":"application/json",Authorization:`${ua.BEARER} ${ic.TOKEN}`}});ac.interceptors.request.use(function(e){return e},function(e){return Promise.reject(e)}),ac.interceptors.response.use(function(e){return e},function(e){return Promise.reject(e)});const cc="/notification",{TENANT_ID:uc,BU_ID:sc,SNOP_ID:lc}=ua,{TENANT_IDS:fc,BU_IDS:pc,SNOP_IDS:dc}=ic,hc=async e=>{try{const t=`${cc}/v1?${uc}=${fc}&${sc}=${pc}&${lc}=${dc}`;return await ac.put(t,e)}catch(e){return e}};var yc="function"==typeof Symbol&&Symbol.for,mc=yc?Symbol.for("react.element"):60103,vc=yc?Symbol.for("react.portal"):60106,gc=yc?Symbol.for("react.fragment"):60107,bc=yc?Symbol.for("react.strict_mode"):60108,Sc=yc?Symbol.for("react.profiler"):60114,wc=yc?Symbol.for("react.provider"):60109,Oc=yc?Symbol.for("react.context"):60110,Rc=yc?Symbol.for("react.async_mode"):60111,Ec=yc?Symbol.for("react.concurrent_mode"):60111,jc=yc?Symbol.for("react.forward_ref"):60112,Ac=yc?Symbol.for("react.suspense"):60113,Cc=yc?Symbol.for("react.suspense_list"):60120,Tc=yc?Symbol.for("react.memo"):60115,Nc=yc?Symbol.for("react.lazy"):60116,xc=yc?Symbol.for("react.block"):60121,Pc=yc?Symbol.for("react.fundamental"):60117,Ic=yc?Symbol.for("react.responder"):60118,kc=yc?Symbol.for("react.scope"):60119;function _c(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case mc:switch(e=e.type){case Rc:case Ec:case gc:case Sc:case bc:case Ac:return e;default:switch(e=e&&e.$$typeof){case Oc:case jc:case Nc:case Tc:case wc:return e;default:return t}}case vc:return t}}}function Dc(e){return _c(e)===Ec}var Mc={AsyncMode:Rc,ConcurrentMode:Ec,ContextConsumer:Oc,ContextProvider:wc,Element:mc,ForwardRef:jc,Fragment:gc,Lazy:Nc,Memo:Tc,Portal:vc,Profiler:Sc,StrictMode:bc,Suspense:Ac,isAsyncMode:function(e){return Dc(e)||_c(e)===Rc},isConcurrentMode:Dc,isContextConsumer:function(e){return _c(e)===Oc},isContextProvider:function(e){return _c(e)===wc},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===mc},isForwardRef:function(e){return _c(e)===jc},isFragment:function(e){return _c(e)===gc},isLazy:function(e){return _c(e)===Nc},isMemo:function(e){return _c(e)===Tc},isPortal:function(e){return _c(e)===vc},isProfiler:function(e){return _c(e)===Sc},isStrictMode:function(e){return _c(e)===bc},isSuspense:function(e){return _c(e)===Ac},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===gc||e===Ec||e===Sc||e===bc||e===Ac||e===Cc||"object"==typeof e&&null!==e&&(e.$$typeof===Nc||e.$$typeof===Tc||e.$$typeof===wc||e.$$typeof===Oc||e.$$typeof===jc||e.$$typeof===Pc||e.$$typeof===Ic||e.$$typeof===kc||e.$$typeof===xc)},typeOf:_c},Lc=Q(function(e,t){"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,n=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,c=e?Symbol.for("react.provider"):60109,u=e?Symbol.for("react.context"):60110,s=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,f=e?Symbol.for("react.forward_ref"):60112,p=e?Symbol.for("react.suspense"):60113,d=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,y=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,v=e?Symbol.for("react.fundamental"):60117,g=e?Symbol.for("react.responder"):60118,b=e?Symbol.for("react.scope"):60119;function S(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:var d=e.type;switch(d){case s:case l:case o:case a:case i:case p:return d;default:var m=d&&d.$$typeof;switch(m){case u:case f:case y:case h:case c:return m;default:return t}}case r:return t}}}var w=l,O=u,R=c,E=n,j=f,A=o,C=y,T=h,N=r,x=a,P=i,I=p,k=!1;function _(e){return S(e)===l}t.AsyncMode=s,t.ConcurrentMode=w,t.ContextConsumer=O,t.ContextProvider=R,t.Element=E,t.ForwardRef=j,t.Fragment=A,t.Lazy=C,t.Memo=T,t.Portal=N,t.Profiler=x,t.StrictMode=P,t.Suspense=I,t.isAsyncMode=function(e){return k||(k=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),_(e)||S(e)===s},t.isConcurrentMode=_,t.isContextConsumer=function(e){return S(e)===u},t.isContextProvider=function(e){return S(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return S(e)===f},t.isFragment=function(e){return S(e)===o},t.isLazy=function(e){return S(e)===y},t.isMemo=function(e){return S(e)===h},t.isPortal=function(e){return S(e)===r},t.isProfiler=function(e){return S(e)===a},t.isStrictMode=function(e){return S(e)===i},t.isSuspense=function(e){return S(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===l||e===a||e===i||e===p||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===h||e.$$typeof===c||e.$$typeof===u||e.$$typeof===f||e.$$typeof===v||e.$$typeof===g||e.$$typeof===b||e.$$typeof===m)},t.typeOf=S}()}),$c=Q(function(e){e.exports="production"===process.env.NODE_ENV?Mc:Lc}),Fc=Object.getOwnPropertySymbols,Uc=Object.prototype.hasOwnProperty,Bc=Object.prototype.propertyIsEnumerable,Vc=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(t).map(function(e){return t[e]});if("0123456789"!==r.join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,r,o=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),i=1;i<arguments.length;i++){for(var a in n=Object(arguments[i]))Uc.call(n,a)&&(o[a]=n[a]);if(Fc){r=Fc(n);for(var c=0;c<r.length;c++)Bc.call(n,r[c])&&(o[r[c]]=n[r[c]])}}return o},zc=Function.call.bind(Object.prototype.hasOwnProperty),Gc="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Wc=zc,Kc=function(){};if("production"!==process.env.NODE_ENV){var qc=Gc,Hc={},Jc=Wc;Kc=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function Yc(e,t,n,r,o){if("production"!==process.env.NODE_ENV)for(var i in e)if(Jc(e,i)){var a;try{if("function"!=typeof e[i]){var c=Error((r||"React class")+": "+n+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw c.name="Invariant Violation",c}a=e[i](t,i,r,n,null,qc)}catch(e){a=e}if(!a||a instanceof Error||Kc((r||"React class")+": type specification of "+n+" `"+i+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof a+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),a instanceof Error&&!(a.message in Hc)){Hc[a.message]=!0;var u=o?o():"";Kc("Failed "+n+" type: "+a.message+(null!=u?u:""))}}}Yc.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(Hc={})};var Xc=Yc,Qc=function(){};function Zc(){return null}function eu(){}function tu(){}"production"!==process.env.NODE_ENV&&(Qc=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),tu.resetWarningCache=eu;var nu=Q(function(e){e.exports="production"!==process.env.NODE_ENV?function(e,t){var n="function"==typeof Symbol&&Symbol.iterator,r="<<anonymous>>",o={array:u("array"),bigint:u("bigint"),bool:u("boolean"),func:u("function"),number:u("number"),object:u("object"),string:u("string"),symbol:u("symbol"),any:c(Zc),arrayOf:function(e){return c(function(t,n,r,o,i){if("function"!=typeof e)return new a("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var c=t[n];if(!Array.isArray(c))return new a("Invalid "+o+" `"+i+"` of type `"+f(c)+"` supplied to `"+r+"`, expected an array.");for(var u=0;u<c.length;u++){var s=e(c,u,r,o,i+"["+u+"]",Gc);if(s instanceof Error)return s}return null})},element:c(function(t,n,r,o,i){var c=t[n];return e(c)?null:new a("Invalid "+o+" `"+i+"` of type `"+f(c)+"` supplied to `"+r+"`, expected a single ReactElement.")}),elementType:c(function(e,t,n,r,o){var i=e[t];return $c.isValidElementType(i)?null:new a("Invalid "+r+" `"+o+"` of type `"+f(i)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(e){return c(function(t,n,o,i,c){return t[n]instanceof e?null:new a("Invalid "+i+" `"+c+"` of type `"+((u=t[n]).constructor&&u.constructor.name?u.constructor.name:r)+"` supplied to `"+o+"`, expected instance of `"+(e.name||r)+"`.");var u})},node:c(function(e,t,n,r,o){return l(e[t])?null:new a("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(e){return c(function(t,n,r,o,i){if("function"!=typeof e)return new a("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var c=t[n],u=f(c);if("object"!==u)return new a("Invalid "+o+" `"+i+"` of type `"+u+"` supplied to `"+r+"`, expected an object.");for(var s in c)if(Wc(c,s)){var l=e(c,s,r,o,i+"."+s,Gc);if(l instanceof Error)return l}return null})},oneOf:function(e){return Array.isArray(e)?c(function(t,n,r,o,c){for(var u=t[n],s=0;s<e.length;s++)if(i(u,e[s]))return null;var l=JSON.stringify(e,function(e,t){return"symbol"===p(t)?String(t):t});return new a("Invalid "+o+" `"+c+"` of value `"+String(u)+"` supplied to `"+r+"`, expected one of "+l+".")}):("production"!==process.env.NODE_ENV&&Qc(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),Zc)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&Qc("Invalid argument supplied to oneOfType, expected an instance of array."),Zc;for(var t=0;t<e.length;t++){var n=e[t];if("function"!=typeof n)return Qc("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+d(n)+" at index "+t+"."),Zc}return c(function(t,n,r,o,i){for(var c=[],u=0;u<e.length;u++){var s=(0,e[u])(t,n,r,o,i,Gc);if(null==s)return null;s.data&&Wc(s.data,"expectedType")&&c.push(s.data.expectedType)}return new a("Invalid "+o+" `"+i+"` supplied to `"+r+"`"+(c.length>0?", expected one of type ["+c.join(", ")+"]":"")+".")})},shape:function(e){return c(function(t,n,r,o,i){var c=t[n],u=f(c);if("object"!==u)return new a("Invalid "+o+" `"+i+"` of type `"+u+"` supplied to `"+r+"`, expected `object`.");for(var l in e){var d=e[l];if("function"!=typeof d)return s(r,o,i,l,p(d));var h=d(c,l,r,o,i+"."+l,Gc);if(h)return h}return null})},exact:function(e){return c(function(t,n,r,o,i){var c=t[n],u=f(c);if("object"!==u)return new a("Invalid "+o+" `"+i+"` of type `"+u+"` supplied to `"+r+"`, expected `object`.");var l=Vc({},t[n],e);for(var d in l){var h=e[d];if(Wc(e,d)&&"function"!=typeof h)return s(r,o,i,d,p(h));if(!h)return new a("Invalid "+o+" `"+i+"` key `"+d+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var y=h(c,d,r,o,i+"."+d,Gc);if(y)return y}return null})}};function i(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function a(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function c(e){if("production"!==process.env.NODE_ENV)var n={},o=0;function i(i,c,u,s,l,f,p){if(s=s||r,f=f||u,p!==Gc){if(t){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var h=s+":"+u;!n[h]&&o<3&&(Qc("You are manually calling a React.PropTypes validation function for the `"+f+"` prop on `"+s+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),n[h]=!0,o++)}}return null==c[u]?i?new a(null===c[u]?"The "+l+" `"+f+"` is marked as required in `"+s+"`, but its value is `null`.":"The "+l+" `"+f+"` is marked as required in `"+s+"`, but its value is `undefined`."):null:e(c,u,s,l,f)}var c=i.bind(null,!1);return c.isRequired=i.bind(null,!0),c}function u(e){return c(function(t,n,r,o,i,c){var u=t[n];return f(u)!==e?new a("Invalid "+o+" `"+i+"` of type `"+p(u)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null})}function s(e,t,n,r,o){return new a((e||"React class")+": "+t+" type `"+n+"."+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function l(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(l);if(null===t||e(t))return!0;var r=function(e){var t=e&&(n&&e[n]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(!r)return!1;var o,i=r.call(t);if(r!==t.entries){for(;!(o=i.next()).done;)if(!l(o.value))return!1}else for(;!(o=i.next()).done;){var a=o.value;if(a&&!l(a[1]))return!1}return!0;default:return!1}}function f(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function p(e){if(null==e)return""+e;var t=f(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function d(e){var t=p(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return a.prototype=Error.prototype,o.checkPropTypes=Xc,o.resetWarningCache=Xc.resetWarningCache,o.PropTypes=o,o}($c.isElement,!0):function(){function e(e,t,n,r,o,i){if(i!==Gc){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:tu,resetWarningCache:eu};return n.PropTypes=n,n}()});const ru=({type:e,title:t,subTitle:n,subType:r,isRead:o,handleShowDetails:i,handleRead:a,isCheckBox:c,isSubType:u,selectedAlert:f,id:p,handleCheckboxChange:g})=>h(s,{className:"cards"},h(d,{display:"flex",flexDirection:"row",alignItems:"start",gap:1},e&&h(y,{color:e,variant:"dot",className:"badge"}),c&&h(m,{checked:!!f.includes(p),onChange:e=>g(e,p),disabled:o}),h(l,{variant:"h6",component:"span",className:["title-card",o&&"read"].join(" ")},t)),h(d,{display:"flex",justifyContent:"space-between",flexDirection:"row",alignItems:"start",gap:1},u&&h(v,{label:r,variant:"filled",size:"small",sx:{fontFamily:"Montserrat, sans-serif",fontWeight:"medium",color:"primary.main",ml:5}}),h(l,{variant:"body2",component:"div",className:["sub-title",o&&"read"].join(" ")},n)),h(d,{display:"flex",flexDirection:"row",justifyContent:"end",gap:1},h(v,{onClick:i,label:"Show Details",component:"button",variant:"filled",clickable:!0,size:"small",sx:{fontFamily:"Montserrat, sans-serif",fontWeight:"medium",color:x[500]}}),!o&&h(v,{onClick:a,label:"Mark as Read",component:"button",variant:"filled",clickable:!0,size:"small",sx:{fontFamily:"Montserrat, sans-serif",fontWeight:"medium",color:"primary.main"}})));ru.propTypes={type:nu.string,title:nu.string,subTitle:nu.string,isRead:nu.bool,handleShowDetails:nu.func,handleRead:nu.func};const ou=({data:e,handleRead:t,handleShowDetails:n})=>h(s,null,e.map((e,r)=>h(ru,{key:r,type:"success",title:e.message,subTitle:Za(e.createdAt),isRead:e.isRead,handleShowDetails:()=>n(e.id),handleRead:()=>t([e.id])})));ou.propTypes={data:nu.array,handleRead:nu.func,handleShowDetails:nu.func};const iu=["adornmentIcon"],au=A(g)(({theme:e})=>({"& .MuiInputBase-root":{height:"3.52rem"},"& .MuiFormLabel-root":{color:`${e.palette.input.border} !important`,fontSize:"1rem",marginTop:"0.4rem"},"& label.Mui-focused":{color:e.palette.input.color},"& .MuiInput-underline:after":{borderBottomColor:e.palette.input.border,borderBottomWidth:"0.1rem"},"& .MuiOutlinedInput-root":{"& fieldset":{borderColor:e.palette.input.border,borderWidth:"0.1rem"},"&:hover fieldset":{borderColor:e.palette.input.border,borderWidth:"0.1rem"},"&.Mui-focused fieldset":{borderColor:e.palette.input.border,borderWidth:"0.1rem"}}})),cu=e=>{let{adornmentIcon:t}=e,n=ia(e,iu);return h(au,oa({},n,{InputProps:Object.assign({},t||{})}))},uu=({start:e,end:t,total:n})=>h(s,{component:"h1",sx:{fontSize:"1.5rem",fontWeight:500}},e," - ",t," of ",n," logs"),su=({page:e,rowPerPage:t,total:n,handleChangePage:r,isLogo:o,isMarkAllRead:i,selectedAlert:a,handleAllRead:c})=>h(Fragment,null,h(k,{count:Math.ceil(n/t),page:e,onChange:(e,t)=>{r(t)},sx:{margin:"1rem 0","& .MuiPaginationItem-root":{fontSize:"1.25rem","& .MuiSvgIcon-root":{fontSize:"2.2rem",color:"primary.main"}}},color:"primary",shape:"rounded",showFirstButton:!0,showLastButton:!0}),o&&h(uu,{start:e*t-t+1,end:e*t>n?n:e*t,total:n}),i&&h(p,{variant:"contained",className:"view-all",disabled:0===a.length,onClick:c},"Mark Read")),lu=["option","value","handleSelectChange"],fu=e=>{let{option:t,value:n,handleSelectChange:r}=e,o=ia(e,lu);return h(_,oa({},o,{options:t,value:n,className:"custom-select-container",onChange:r,theme:ya}))},pu=({loading:e,isEmpty:t,data:o,handleShowDetails:i,handleRead:c,handleRefresh:u})=>{const[p,d]=n(""),[y,m]=n(1),[v,g]=n(10),[O,R]=n(0),[E,j]=n([]),[A,T]=n([]);r(()=>{if(p){const e=tc(o,ha,p);return j(nc(e,y,v)),void R(e.length)}j(nc(o,y,v)),R(o.length)},[p,o,y,v]);const N=(e,t)=>{T(e.target.checked?e=>[...e,t]:e=>e.filter(e=>e!==t))};return h(Fragment,null,h(b,{dividers:!0,sx:{pt:"0 !important"}},h(s,{sx:e||t?{display:"flex",justifyContent:"center",alignItems:"center",minHeight:320}:{}},e?h(S,null):t?h(l,{className:"no-record"},Sa.NRF):h(Fragment,null,h(s,{className:"sticky-input-select"},h(s,{sx:{display:"flex",gap:1}},h(cu,{value:p,onChange:e=>{const t=e.target.value;t&&m(1),d(t)},label:"Search",focused:!0,adornmentIcon:{startAdornment:h(w,{position:"start"},h(I,null))}}),h(fu,{value:{value:v,label:`Show ${v} Rows`},option:fa,handleSelectChange:e=>{m(1),g(e.value)}}),h(a,{color:"primary",onClick:u},h(C,{fontSize:"medium"}))),h(uu,{start:y*v-v+1,end:y*v>O?O:y*v,total:O})),0===E.length&&h(l,{className:"no-record"},Sa.NRF),E.map((e,t)=>h(ru,{key:t,isCheckBox:!0,title:e.message,subTitle:Za(e.createdAt),isRead:e.isRead,handleShowDetails:()=>i(e.id),handleRead:()=>c([e.id]),subType:e.sub_type,isSubType:!0,selectedAlert:A,id:e.id,handleCheckboxChange:N}))))),!(e||t)&&h(f,{sx:{justifyContent:"space-between",gap:1},className:"action-show-all-dialog"},h(su,{page:y,rowPerPage:v,total:O,handleChangePage:e=>{m(e)},isMarkAllRead:!0,selectedAlert:A,handleAllRead:()=>{c(A),T([])}})))},du=({sortKey:e,sortDir:t,column:n})=>h(Fragment,null,e===n?t?h("i",{className:"fa fa-arrow-down","aria-hidden":"true"}):h("i",{className:"fa fa-arrow-up","aria-hidden":"true"}):h(Fragment,null,h("i",{className:"fa fa-sort","aria-hidden":"true"}))),hu=({data:e,handleSort:t,sortDir:n,sortKey:r})=>{var o;return h("table",{className:"table"},h("thead",null,h("tr",null,null==(o=Object.entries(pa))?void 0:o.map(([e,o],i)=>h("th",{key:i},h("span",{onClick:()=>t(o)},e,h(du,{column:o,sortKey:r,sortDir:n})))))),h("tbody",null,e.map((e,t)=>h("tr",{key:t},h("td",null,e.sku_name),h("td",null,e.node),h("td",null,e.channel_name)))))},yu=({loading:e,isEmpty:t,data:o})=>{const[i,a]=n(""),[c,u]=n(1),[p,d]=n(10),[y,m]=n(0),[v,g]=n([]),[O,R]=n(!1),[E,j]=n("");return r(()=>{if(i||E){const e=tc(o,da,i);if(E){const t=((e,t,n)=>{const r=e.sort((e,r)=>"asc"===n?e[t].toLowerCase().localeCompare(r[t].toLowerCase()):r[t].toLowerCase().localeCompare(e[t].toLowerCase()));return r})(e,E,O?"asc":"desc");return g(nc(t,c,p)),void m(t.length)}return g(nc(e,c,p)),void m(e.length)}g(nc(o,c,p)),m(o.length)},[i,o,c,p,O,E]),h(Fragment,null,h(b,{dividers:!0,sx:{pt:"0 !important"}},h(s,{sx:e||t?{display:"flex",justifyContent:"center",alignItems:"center",minHeight:320}:{}},e?h(S,null):t?h(l,{className:"no-record"},Sa.NRF):h(Fragment,null,h(s,{className:"sticky-input-select"},h(s,{sx:{display:"flex",gap:1}},h(cu,{value:i,onChange:e=>{const t=e.target.value;t&&u(1),a(t)},label:"Search",focused:!0,adornmentIcon:{startAdornment:h(w,{position:"start"},h(I,null))}}),h(fu,{value:{value:p,label:`Show ${p} Rows`},option:fa,handleSelectChange:e=>{u(1),d(e.value)}}))),0===v.length?h(l,{className:"no-record"},Sa.NRF):h(hu,{data:v,handleSort:e=>{R(!O),j(e)},sortDir:O,sortKey:E})))),!(e||t)&&h(f,{sx:{justifyContent:"space-between",gap:1},className:"action-show-all-dialog"},h(su,{page:c,rowPerPage:p,total:y,handleChangePage:e=>{u(e)},isLogo:!0})))},mu=()=>{const e=o(Oa),{loading:t,data:a,isMarkAllAsRead:c}=o(wa),[u,f]=n(!1),[p,d]=n(!1),[y,m]=n(!1),[v,g]=n({}),w=0===a.length,O=i(async()=>{e({type:ba.LOADING,loading:!0}),e({type:ba.SUCCESS,data:[]}),e({type:ba.MARK_ALL_AS_READ,isMarkAllAsRead:{count:0,boo:!1}});try{const r=await(async()=>{try{const e=`${cc}/v1?${uc}=${fc}&${sc}=${pc}&${lc}=${dc}`;return await ac.get(e)}catch(e){return e}})();if(200===r.status){var t,n;e({type:ba.SUCCESS,data:(null==(t=r.data)||null==(t=t.responseData)?void 0:t.response)||[]});const o=(e=>{let t=0;for(let n=0;n<e.length;n++)e[n].isRead||t++;return t})((null==(n=r.data)||null==(n=n.responseData)?void 0:n.response)||[]);e({type:ba.MARK_ALL_AS_READ,isMarkAllAsRead:{count:o,boo:o>0}})}}catch(t){e({type:ba.ERROR,error:Sa.SWR})}finally{e({type:ba.LOADING,loading:!1})}},[e]);r(()=>{O();const e=setInterval(()=>{O()},3e5);return()=>clearInterval(e)},[O]);const R=()=>{O()},E=e=>{const t=a.find(t=>t.id===e);g(t),m(!y)},j=async t=>{if(0!==t.length){e({type:ba.LOADING,loading:!0});try{if(200===(await hc(t)).status){let n=0;const r=a.map(e=>(e.isRead||n++,t.includes(e.id)?Object.assign({},e,{isRead:!0}):e));e({type:ba.MARK_ALL_AS_READ,isMarkAllAsRead:{count:n,boo:n>0}}),e({type:ba.SUCCESS,data:r})}}catch(t){e({type:ba.ERROR,error:Sa.SWR})}finally{e({type:ba.LOADING,loading:!1})}}};return h(s,null,h(s,{sx:{display:"flex",justifyContent:"center"}},h(ca,{count:c.count,handleClick:()=>f(!u)})),h(ga,{title:"Alerts",open:u,loading:t,isMarkAllAsRead:c,onClose:()=>f(!u),onRefresh:R,handleShowAll:()=>{d(!p)},handleMarkAllAsRead:async()=>{const t=(e=>{const t=[];return e.forEach(e=>{e.isRead||t.push(e.id)}),t})(a);e({type:ba.LOADING,loading:!0});try{if(200===(await hc(t)).status){const t=a.map(e=>Object.assign({},e,{isRead:!0}));e({type:ba.SUCCESS,data:t}),e({type:ba.MARK_ALL_AS_READ,isMarkAllAsRead:{count:0,boo:!1}})}}catch(t){e({type:ba.ERROR,error:Sa.SWR})}finally{e({type:ba.LOADING,loading:!1})}},headerIconType:sa,isDialogActionShow:!0,className:"alert-dialog-main"},h(b,{dividers:!0},h(s,{sx:t||w?{display:"flex",justifyContent:"center",alignItems:"center",height:320}:{height:320}},t?h(S,null):w?h(l,{className:"no-record"},Sa.NRF):h(ou,{data:ec(a),handleRead:j,handleShowDetails:E})))),h(ga,{title:"Alerts",open:p,loading:t,onClose:()=>d(!p),onRefresh:R,headerIconType:la,className:"alert-dialog"},h(pu,{loading:t,isEmpty:w,data:a,handleRefresh:R,handleShowDetails:E,handleRead:j})),h(ga,{title:null==v?void 0:v.message,subTitle:null==v?void 0:v.remark,open:y,onClose:()=>m(!y),headerIconType:la,className:"alert-dialog"},h(yu,{loading:t,isEmpty:w,data:(null==v?void 0:v.notificationDetails)||[]})))},vu=O({palette:{primary:{main:"#E94F1C"},secondary:{main:"#1D1D1B"},input:{color:"rgba(0, 0, 0, 0.87)",border:"#ACB2BA"}}});function gu({children:e}){return h(R,{theme:vu},e)}const bu=()=>h(gu,null,h(Ra,null,h(mu,null)));export{bu as Notification};
2
+ //# sourceMappingURL=index.modern.mjs.map