"use strict";(self.webpackChunkcentreon=self.webpackChunkcentreon||[]).push([["6790"],{64958:function(e,t,o){o.d(t,{Pg:function(){return R},XS:function(){return O},oJ:function(){return z},pB:function(){return E}});var r=o(83192),n=o(59869),i=o(1975),l=o(54461),a=o(46436),s=o(15140),u=o(60172),p=o(44445),c=o(99045),f=o(28635),h=o(18253),d=o(87282),v=o(61471),m=o(85185),P=o(80417),Z=o(45749),g=o(66397),b=o(52676);let y=["onEntering"],w=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","slots","slotProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps","disableScrollLock"],x=["slotProps"];function z(e,t){let o=0;return"number"==typeof t?o=t:"center"===t?o=e.height/2:"bottom"===t&&(o=e.height),o}function E(e,t){let o=0;return"number"==typeof t?o=t:"center"===t?o=e.width/2:"right"===t&&(o=e.width),o}function k(e){return[e.horizontal,e.vertical].map(e=>"number"==typeof e?`${e}px`:e).join(" ")}function C(e){return"function"==typeof e?e():e}let T=e=>{let{classes:t}=e;return(0,a.Z)({root:["root"],paper:["paper"]},g.s,t)},R=(0,p.ZP)(P.Z,{name:"MuiPopover",slot:"Root",overridesResolver:(e,t)=>t.root})({}),O=(0,p.ZP)(Z.Z,{name:"MuiPopover",slot:"Paper",overridesResolver:(e,t)=>t.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),S=i.forwardRef(function(e,t){var o,a,p;let P=(0,c.i)({props:e,name:"MuiPopover"}),{action:Z,anchorEl:g,anchorOrigin:S={vertical:"top",horizontal:"left"},anchorPosition:H,anchorReference:L="anchorEl",children:M,className:j,container:N,elevation:W=8,marginThreshold:D=16,open:$,PaperProps:B={},slots:X,slotProps:A,transformOrigin:F={vertical:"top",horizontal:"left"},TransitionComponent:I=m.Z,transitionDuration:J="auto",TransitionProps:{onEntering:Y}={},disableScrollLock:q=!1}=P,G=(0,n.Z)(P.TransitionProps,y),K=(0,n.Z)(P,w),Q=null!=(o=null==A?void 0:A.paper)?o:B,U=i.useRef(),V=(0,v.Z)(U,Q.ref),_=(0,r.Z)({},P,{anchorOrigin:S,anchorReference:L,elevation:W,marginThreshold:D,externalPaperSlotProps:Q,transformOrigin:F,TransitionComponent:I,transitionDuration:J,TransitionProps:G}),ee=T(_),et=i.useCallback(()=>{if("anchorPosition"===L)return H;let e=C(g),t=(e&&1===e.nodeType?e:(0,h.Z)(U.current).body).getBoundingClientRect();return{top:t.top+z(t,S.vertical),left:t.left+E(t,S.horizontal)}},[g,S.horizontal,S.vertical,H,L]),eo=i.useCallback(e=>({vertical:z(e,F.vertical),horizontal:E(e,F.horizontal)}),[F.horizontal,F.vertical]),er=i.useCallback(e=>{let t={width:e.offsetWidth,height:e.offsetHeight},o=eo(t);if("none"===L)return{top:null,left:null,transformOrigin:k(o)};let r=et(),n=r.top-o.vertical,i=r.left-o.horizontal,l=n+t.height,a=i+t.width,s=(0,d.Z)(C(g)),u=s.innerHeight-D,p=s.innerWidth-D;if(null!==D&&n<D){let e=n-D;n-=e,o.vertical+=e}else if(null!==D&&l>u){let e=l-u;n-=e,o.vertical+=e}if(null!==D&&i<D){let e=i-D;i-=e,o.horizontal+=e}else if(a>p){let e=a-p;i-=e,o.horizontal+=e}return{top:`${Math.round(n)}px`,left:`${Math.round(i)}px`,transformOrigin:k(o)}},[g,L,et,eo,D]),[en,ei]=i.useState($),el=i.useCallback(()=>{let e=U.current;if(!e)return;let t=er(e);null!==t.top&&(e.style.top=t.top),null!==t.left&&(e.style.left=t.left),e.style.transformOrigin=t.transformOrigin,ei(!0)},[er]);i.useEffect(()=>(q&&window.addEventListener("scroll",el),()=>window.removeEventListener("scroll",el)),[g,q,el]);i.useEffect(()=>{$&&el()}),i.useImperativeHandle(Z,()=>$?{updatePosition:()=>{el()}}:null,[$,el]),i.useEffect(()=>{if(!$)return;let e=(0,f.Z)(()=>{el()}),t=(0,d.Z)(g);return t.addEventListener("resize",e),()=>{e.clear(),t.removeEventListener("resize",e)}},[g,$,el]);let ea=J;"auto"===J&&!I.muiSupportAuto&&(ea=void 0);let es=N||(g?(0,h.Z)(C(g)).body:void 0),eu=null!=(a=null==X?void 0:X.root)?a:R,ep=null!=(p=null==X?void 0:X.paper)?p:O,ec=(0,s.Z)({elementType:ep,externalSlotProps:(0,r.Z)({},Q,{style:en?Q.style:(0,r.Z)({},Q.style,{opacity:0})}),additionalProps:{elevation:W,ref:V},ownerState:_,className:(0,l.Z)(ee.paper,null==Q?void 0:Q.className)}),ef=(0,s.Z)({elementType:eu,externalSlotProps:(null==A?void 0:A.root)||{},externalForwardedProps:K,additionalProps:{ref:t,slotProps:{backdrop:{invisible:!0}},container:es,open:$},ownerState:_,className:(0,l.Z)(ee.root,j)}),{slotProps:eh}=ef,ed=(0,n.Z)(ef,x);return(0,b.jsx)(eu,(0,r.Z)({},ed,!(0,u.Z)(eu)&&{slotProps:eh,disableScrollLock:q},{children:(0,b.jsx)(I,(0,r.Z)({appear:!0,in:$,onEntering:(e,t)=>{Y&&Y(e,t),el()},onExited:()=>{ei(!1)},timeout:ea},G,{children:(0,b.jsx)(ep,(0,r.Z)({},ec,{children:M}))}))}))});t.ZP=S}}]);
//# sourceMappingURL=6790.5d85b29b727aff9a76d2.b6aa120747d30b42afa1.6f0d4805c7bd876f6031.js.map