@tsiky/components-r19 7.0.3 → 7.0.4
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/chart.cjs.js
CHANGED
|
@@ -960,7 +960,7 @@ object-assign
|
|
|
960
960
|
(c) Sindre Sorhus
|
|
961
961
|
@license MIT
|
|
962
962
|
*/var zi,os;function hc(){if(os)return zi;os=1;var n=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;function i(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}function a(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var r={},o=0;o<10;o++)r["_"+String.fromCharCode(o)]=o;var l=Object.getOwnPropertyNames(r).map(function(h){return r[h]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(h){c[h]=h}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return zi=a()?Object.assign:function(s,r){for(var o,l=i(s),c,h=1;h<arguments.length;h++){o=Object(arguments[h]);for(var d in o)e.call(o,d)&&(l[d]=o[d]);if(n){c=n(o);for(var u=0;u<c.length;u++)t.call(o,c[u])&&(l[c[u]]=o[c[u]])}}return l},zi}var Di,ls;function Aa(){if(ls)return Di;ls=1;var n="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Di=n,Di}var Xi,cs;function Ar(){return cs||(cs=1,Xi=Function.call.bind(Object.prototype.hasOwnProperty)),Xi}var Yi,hs;function dc(){if(hs)return Yi;hs=1;var n=function(){};if(process.env.NODE_ENV!=="production"){var e=Aa(),t={},i=Ar();n=function(s){var r="Warning: "+s;typeof console<"u"&&console.error(r);try{throw new Error(r)}catch{}}}function a(s,r,o,l,c){if(process.env.NODE_ENV!=="production"){for(var h in s)if(i(s,h)){var d;try{if(typeof s[h]!="function"){var u=Error((l||"React class")+": "+o+" type `"+h+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[h]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw u.name="Invariant Violation",u}d=s[h](r,h,l,o,null,e)}catch(p){d=p}if(d&&!(d instanceof Error)&&n((l||"React class")+": type specification of "+o+" `"+h+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in t)){t[d.message]=!0;var g=c?c():"";n("Failed "+o+" type: "+d.message+(g??""))}}}}return a.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(t={})},Yi=a,Yi}var Fi,ds;function uc(){if(ds)return Fi;ds=1;var n=kr(),e=hc(),t=Aa(),i=Ar(),a=dc(),s=function(){};process.env.NODE_ENV!=="production"&&(s=function(o){var l="Warning: "+o;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function r(){return null}return Fi=function(o,l){var c=typeof Symbol=="function"&&Symbol.iterator,h="@@iterator";function d(R){var Y=R&&(c&&R[c]||R[h]);if(typeof Y=="function")return Y}var u="<<anonymous>>",g={array:m("array"),bigint:m("bigint"),bool:m("boolean"),func:m("function"),number:m("number"),object:m("object"),string:m("string"),symbol:m("symbol"),any:v(),arrayOf:w,element:y(),elementType:b(),instanceOf:A,node:L(),objectOf:C,oneOf:k,oneOfType:P,shape:T,exact:E};function p(R,Y){return R===Y?R!==0||1/R===1/Y:R!==R&&Y!==Y}function f(R,Y){this.message=R,this.data=Y&&typeof Y=="object"?Y:{},this.stack=""}f.prototype=Error.prototype;function x(R){if(process.env.NODE_ENV!=="production")var Y={},K=0;function q(U,W,B,ee,te,ae,ce){if(ee=ee||u,ae=ae||B,ce!==t){if(l){var $=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 $.name="Invariant Violation",$}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var he=ee+":"+B;!Y[he]&&K<3&&(s("You are manually calling a React.PropTypes validation function for the `"+ae+"` prop on `"+ee+"`. 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."),Y[he]=!0,K++)}}return W[B]==null?U?W[B]===null?new f("The "+te+" `"+ae+"` is marked as required "+("in `"+ee+"`, but its value is `null`.")):new f("The "+te+" `"+ae+"` is marked as required in "+("`"+ee+"`, but its value is `undefined`.")):null:R(W,B,ee,te,ae)}var _=q.bind(null,!1);return _.isRequired=q.bind(null,!0),_}function m(R){function Y(K,q,_,U,W,B){var ee=K[q],te=F(ee);if(te!==R){var ae=H(ee);return new f("Invalid "+U+" `"+W+"` of type "+("`"+ae+"` supplied to `"+_+"`, expected ")+("`"+R+"`."),{expectedType:R})}return null}return x(Y)}function v(){return x(r)}function w(R){function Y(K,q,_,U,W){if(typeof R!="function")return new f("Property `"+W+"` of component `"+_+"` has invalid PropType notation inside arrayOf.");var B=K[q];if(!Array.isArray(B)){var ee=F(B);return new f("Invalid "+U+" `"+W+"` of type "+("`"+ee+"` supplied to `"+_+"`, expected an array."))}for(var te=0;te<B.length;te++){var ae=R(B,te,_,U,W+"["+te+"]",t);if(ae instanceof Error)return ae}return null}return x(Y)}function y(){function R(Y,K,q,_,U){var W=Y[K];if(!o(W)){var B=F(W);return new f("Invalid "+_+" `"+U+"` of type "+("`"+B+"` supplied to `"+q+"`, expected a single ReactElement."))}return null}return x(R)}function b(){function R(Y,K,q,_,U){var W=Y[K];if(!n.isValidElementType(W)){var B=F(W);return new f("Invalid "+_+" `"+U+"` of type "+("`"+B+"` supplied to `"+q+"`, expected a single ReactElement type."))}return null}return x(R)}function A(R){function Y(K,q,_,U,W){if(!(K[q]instanceof R)){var B=R.name||u,ee=Z(K[q]);return new f("Invalid "+U+" `"+W+"` of type "+("`"+ee+"` supplied to `"+_+"`, expected ")+("instance of `"+B+"`."))}return null}return x(Y)}function k(R){if(!Array.isArray(R))return process.env.NODE_ENV!=="production"&&(arguments.length>1?s("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])."):s("Invalid argument supplied to oneOf, expected an array.")),r;function Y(K,q,_,U,W){for(var B=K[q],ee=0;ee<R.length;ee++)if(p(B,R[ee]))return null;var te=JSON.stringify(R,function(ce,$){var he=H($);return he==="symbol"?String($):$});return new f("Invalid "+U+" `"+W+"` of value `"+String(B)+"` "+("supplied to `"+_+"`, expected one of "+te+"."))}return x(Y)}function C(R){function Y(K,q,_,U,W){if(typeof R!="function")return new f("Property `"+W+"` of component `"+_+"` has invalid PropType notation inside objectOf.");var B=K[q],ee=F(B);if(ee!=="object")return new f("Invalid "+U+" `"+W+"` of type "+("`"+ee+"` supplied to `"+_+"`, expected an object."));for(var te in B)if(i(B,te)){var ae=R(B,te,_,U,W+"."+te,t);if(ae instanceof Error)return ae}return null}return x(Y)}function P(R){if(!Array.isArray(R))return process.env.NODE_ENV!=="production"&&s("Invalid argument supplied to oneOfType, expected an instance of array."),r;for(var Y=0;Y<R.length;Y++){var K=R[Y];if(typeof K!="function")return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+V(K)+" at index "+Y+"."),r}function q(_,U,W,B,ee){for(var te=[],ae=0;ae<R.length;ae++){var ce=R[ae],$=ce(_,U,W,B,ee,t);if($==null)return null;$.data&&i($.data,"expectedType")&&te.push($.data.expectedType)}var he=te.length>0?", expected one of type ["+te.join(", ")+"]":"";return new f("Invalid "+B+" `"+ee+"` supplied to "+("`"+W+"`"+he+"."))}return x(q)}function L(){function R(Y,K,q,_,U){return O(Y[K])?null:new f("Invalid "+_+" `"+U+"` supplied to "+("`"+q+"`, expected a ReactNode."))}return x(R)}function I(R,Y,K,q,_){return new f((R||"React class")+": "+Y+" type `"+K+"."+q+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+_+"`.")}function T(R){function Y(K,q,_,U,W){var B=K[q],ee=F(B);if(ee!=="object")return new f("Invalid "+U+" `"+W+"` of type `"+ee+"` "+("supplied to `"+_+"`, expected `object`."));for(var te in R){var ae=R[te];if(typeof ae!="function")return I(_,U,W,te,H(ae));var ce=ae(B,te,_,U,W+"."+te,t);if(ce)return ce}return null}return x(Y)}function E(R){function Y(K,q,_,U,W){var B=K[q],ee=F(B);if(ee!=="object")return new f("Invalid "+U+" `"+W+"` of type `"+ee+"` "+("supplied to `"+_+"`, expected `object`."));var te=e({},K[q],R);for(var ae in te){var ce=R[ae];if(i(R,ae)&&typeof ce!="function")return I(_,U,W,ae,H(ce));if(!ce)return new f("Invalid "+U+" `"+W+"` key `"+ae+"` supplied to `"+_+"`.\nBad object: "+JSON.stringify(K[q],null," ")+`
|
|
963
|
-
Valid keys: `+JSON.stringify(Object.keys(R),null," "));var $=ce(B,ae,_,U,W+"."+ae,t);if($)return $}return null}return x(Y)}function O(R){switch(typeof R){case"number":case"string":case"undefined":return!0;case"boolean":return!R;case"object":if(Array.isArray(R))return R.every(O);if(R===null||o(R))return!0;var Y=d(R);if(Y){var K=Y.call(R),q;if(Y!==R.entries){for(;!(q=K.next()).done;)if(!O(q.value))return!1}else for(;!(q=K.next()).done;){var _=q.value;if(_&&!O(_[1]))return!1}}else return!1;return!0;default:return!1}}function z(R,Y){return R==="symbol"?!0:Y?Y["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&Y instanceof Symbol:!1}function F(R){var Y=typeof R;return Array.isArray(R)?"array":R instanceof RegExp?"object":z(Y,R)?"symbol":Y}function H(R){if(typeof R>"u"||R===null)return""+R;var Y=F(R);if(Y==="object"){if(R instanceof Date)return"date";if(R instanceof RegExp)return"regexp"}return Y}function V(R){var Y=H(R);switch(Y){case"array":case"object":return"an "+Y;case"boolean":case"date":case"regexp":return"a "+Y;default:return Y}}function Z(R){return!R.constructor||!R.constructor.name?u:R.constructor.name}return g.checkPropTypes=a,g.resetWarningCache=a.resetWarningCache,g.PropTypes=g,g},Fi}var Hi,us;function gc(){if(us)return Hi;us=1;var n=Aa();function e(){}function t(){}return t.resetWarningCache=e,Hi=function(){function i(r,o,l,c,h,d){if(d!==n){var u=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 u.name="Invariant Violation",u}}i.isRequired=i;function a(){return i}var s={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:a,element:i,elementType:i,instanceOf:a,node:i,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:t,resetWarningCache:e};return s.PropTypes=s,s},Hi}var gs;function fc(){if(gs)return jt.exports;if(gs=1,process.env.NODE_ENV!=="production"){var n=kr(),e=!0;jt.exports=uc()(n.isElement,e)}else jt.exports=gc()();return jt.exports}var fs;function pc(){return fs||(fs=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=w;var e=o(ue),t=s(oc),i=s(fc()),a=["type","width","height","series","options","chartRef"];function s(y){return y&&y.__esModule?y:{default:y}}function r(y){var b,A;return typeof WeakMap!="function"?null:(b=new WeakMap,A=new WeakMap,(r=function(k){return k?A:b})(y))}function o(y,b){if(!b&&y&&y.__esModule)return y;if(y===null||d(y)!="object"&&typeof y!="function")return{default:y};if(b=r(b),b&&b.has(y))return b.get(y);var A,k,C={__proto__:null},P=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(A in y)A!=="default"&&{}.hasOwnProperty.call(y,A)&&((k=P?Object.getOwnPropertyDescriptor(y,A):null)&&(k.get||k.set)?Object.defineProperty(C,A,k):C[A]=y[A]);return C.default=y,b&&b.set(y,C),C}function l(){return(l=Object.assign?Object.assign.bind():function(y){for(var b=1;b<arguments.length;b++){var A,k=arguments[b];for(A in k)!{}.hasOwnProperty.call(k,A)||(y[A]=k[A])}return y}).apply(null,arguments)}function c(y,b){if(y==null)return{};var A,k=h(y,b);if(Object.getOwnPropertySymbols)for(var C=Object.getOwnPropertySymbols(y),P=0;P<C.length;P++)A=C[P],b.includes(A)||{}.propertyIsEnumerable.call(y,A)&&(k[A]=y[A]);return k}function h(y,b){if(y==null)return{};var A,k={};for(A in y)if({}.hasOwnProperty.call(y,A)){if(b.includes(A))continue;k[A]=y[A]}return k}function d(y){return(d=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(b){return typeof b}:function(b){return b&&typeof Symbol=="function"&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b})(y)}function u(y,b){var A,k=Object.keys(y);return Object.getOwnPropertySymbols&&(A=Object.getOwnPropertySymbols(y),b&&(A=A.filter(function(C){return Object.getOwnPropertyDescriptor(y,C).enumerable})),k.push.apply(k,A)),k}function g(y){for(var b=1;b<arguments.length;b++){var A=arguments[b]!=null?arguments[b]:{};b%2?u(Object(A),!0).forEach(function(k){p(y,k,A[k])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(A)):u(Object(A)).forEach(function(k){Object.defineProperty(y,k,Object.getOwnPropertyDescriptor(A,k))})}return y}function p(y,b,A){return(b=f(b))in y?Object.defineProperty(y,b,{value:A,enumerable:!0,configurable:!0,writable:!0}):y[b]=A,y}function f(y){return y=x(y,"string"),d(y)=="symbol"?y:y+""}function x(y,b){if(d(y)!="object"||!y)return y;var A=y[Symbol.toPrimitive];if(A===void 0)return(b==="string"?String:Number)(y);if(A=A.call(y,b),d(A)!="object")return A;throw new TypeError("@@toPrimitive must return a primitive value.")}function m(y,b){var A=g({},y);return b.forEach(function(k){delete A[k]}),A}function v(y,b){var A=2<arguments.length&&arguments[2]!==void 0?arguments[2]:new WeakSet;if(y!==b){if(d(y)!=="object"||y===null||d(b)!=="object"||b===null)return!1;if(!A.has(y)&&!A.has(b)){A.add(y),A.add(b);var k=Object.keys(y),C=Object.keys(b);if(k.length!==C.length)return!1;for(var P=0,L=k;P<L.length;P++){var I=L[P];if(!C.includes(I)||!v(y[I],b[I],A))return!1}}}return!0}function w(I){function b(V){return V&&d(V)==="object"&&!Array.isArray(V)}var H=I.type,A=H===void 0?"line":H,H=I.width,k=H===void 0?"100%":H,H=I.height,C=H===void 0?"auto":H,P=I.series,L=I.options,H=I.chartRef,I=c(I,a),T=(0,e.useRef)(null),E=H||(0,e.useRef)(null),O=(0,e.useRef)(),z=((0,e.useEffect)(function(){O.current=L;var V=T.current;return E.current=new t.default(V,z()),E.current.render(),function(){E.current&&typeof E.current.destroy=="function"&&E.current.destroy()}},[]),(0,e.useEffect)(function(){var V=!v(E.current.w.config.series,P),Z=!v(O.current,L)||C!==E.current.opts.chart.height||k!==E.current.opts.chart.width;(V||Z)&&(!V||Z?E.current.updateOptions(z()):E.current.updateSeries(P)),O.current=L},[L,P,C,k]),function(){return F(L,{chart:{type:A,height:C,width:k},series:P})}),F=function(V,Z){var R=g({},V);return b(V)&&b(Z)&&Object.keys(Z).forEach(function(Y){b(Z[Y])&&Y in V?R[Y]=F(V[Y],Z[Y]):Object.assign(R,p({},Y,Z[Y]))}),R},H=m(I,Object.keys(w.propTypes));return e.default.createElement("div",l({ref:T},H))}w.propTypes={type:i.default.string.isRequired,series:i.default.array.isRequired,options:i.default.object.isRequired,width:i.default.oneOfType([i.default.string,i.default.number]),height:i.default.oneOfType([i.default.string,i.default.number]),chartRef:i.default.shape({current:i.default.any})}}(pi)),pi}var xc=pc();const Ca=S.getDefaultExportFromCjs(xc),mc=["#e24b33","#e2b23a","#6feff0","#2f5be8"],vc=({categories:n,series:e,height:t=350,title:i="Admissions",draggable:a=!1})=>{const s=Math.max(...n.map((c,h)=>e.reduce((d,u)=>d+(u.data[h]??0),0))),r=Math.max(100,Math.ceil(s/50)*50),o={chart:{foreColor:"var(--color-text)",type:"area",stacked:!0,stackType:"normal",toolbar:{show:!1},zoom:{enabled:!1},animations:{enabled:!0},fontFamily:"Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial"},title:{text:i,align:"center",style:{fontSize:"36px",fontWeight:700,color:"#555"}},colors:mc,dataLabels:{enabled:!1},stroke:{curve:"smooth",width:1.5},fill:{type:"solid",opacity:.95},markers:{size:0},legend:{show:!0,position:"top",horizontalAlign:"center",itemMargin:{horizontal:8,vertical:0}},xaxis:{categories:n,labels:{rotate:-45,rotateAlways:!0,style:{fontSize:"12px"}},tickPlacement:"on"},yaxis:{min:0,max:r,tickAmount:7,labels:{formatter:c=>String(Math.round(Number(c)))}},grid:{borderColor:"#e9e9e9",strokeDashArray:0},tooltip:{shared:!0,intersect:!1,y:{formatter:c=>String(c)}},responsive:[{breakpoint:768,options:{chart:{height:Math.max(240,Math.round(t*.7))},legend:{position:"top"},xaxis:{labels:{rotate:-45}}}}]},l=e.map(c=>({name:c.name,type:"area",data:c.data}));return X.jsxs("div",{style:{position:"relative",height:t,width:"100%",overflow:"hidden"},children:[X.jsx("div",{style:{opacity:a?0:1,transition:"opacity 0.2s ease-in-out"},children:X.jsx(Ca,{options:o,series:l,type:"area",height:t,width:"100%"})}),a&&X.jsx("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(255, 255, 255, 0.6)",borderRadius:12,backdropFilter:"blur(3px)",pointerEvents:"none",transition:"opacity 0.2s ease-in-out"},children:X.jsx(S.Move,{size:38,strokeWidth:1.5,style:{opacity:.85}})})]})},ps={color:"#4f9db5",sort:"desc",height:520,showGrid:!0,showLegend:!1},bc=({data:n,config:e=ps,draggable:t=!1})=>{const i={...ps,...e},a=n.labels??[],s=n.values??[],r=Math.min(a.length,s.length),o=[];for(let u=0;u<r;u++)o.push({label:a[u],value:s[u]});i.sort==="desc"?o.sort((u,g)=>g.value-u.value):i.sort==="asc"&&o.sort((u,g)=>u.value-g.value);const l=o.map(u=>u.label),h=[{name:"Valeur",data:o.map(u=>u.value)}],d={chart:{foreColor:"var(--color-text)",type:"bar",toolbar:{show:!1},height:i.height},plotOptions:{bar:{horizontal:!0,barHeight:"60%",distributed:!1,borderRadius:6,borderRadiusApplication:"end"}},dataLabels:{enabled:!1,formatter:u=>String(u),style:{fontSize:"12px"},offsetX:0},yaxis:{labels:{style:{fontSize:"12px"}}},grid:{show:!!i.showGrid,borderColor:"#e6e6e6"},tooltip:{shared:!1,y:{formatter:u=>String(u)}},legend:{show:!!i.showLegend},colors:[i.color],xaxis:{min:0,tickAmount:5,categories:l,labels:{formatter:u=>String(u)}},responsive:[]};return X.jsxs("div",{style:{position:"relative",height:i.height,width:"100%",overflow:"hidden"},children:[X.jsx("div",{style:{opacity:t?0:1,transition:"opacity 0.15s ease-in-out"},children:X.jsx(Ca,{options:d,series:h,type:"bar",height:i.height,width:"100%"})}),t&&X.jsx("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(255,255,255,0.5)",borderRadius:12,backdropFilter:"blur(3px)",pointerEvents:"none",transition:"opacity 0.15s ease-in-out"},children:X.jsx(S.Move,{size:36,strokeWidth:1.5,style:{opacity:.85}})})]})},xs={colorUpper:"#2db85bff",colorLower:"#b3761bff",showOutliers:!0,tooltipFormatter:n=>String(n),height:420,responsive:!0,fontSize:"12px",fontWeight:"400",columnWidth:"70%"},yc=({data:n,config:e=xs})=>{const t={...xs,...e},a=[{name:"Distribution",data:(Array.isArray(n?.series)?n.series:[]).map(r=>({x:r.x,y:r.y}))}],s={chart:{foreColor:"var(--color-text)",type:"boxPlot",toolbar:{show:!1},height:t.height},yaxis:{tickAmount:10,labels:{formatter:function(r){return r.toFixed(0)}}},plotOptions:{boxPlot:{columnWidth:t.columnWidth,colors:{upper:t.colorUpper,lower:t.colorLower}}},xaxis:{labels:{rotate:-45,rotateAlways:!0,style:{fontSize:t.fontSize,fontWeight:t.fontWeight}}},stroke:{show:!0,width:1,colors:[t.colorStroke??"var(--color-secondary)"]},markers:{size:0},tooltip:{shared:!1,theme:"dark",custom:function({seriesIndex:r,dataPointIndex:o,w:l}){const c=l.globals.initialSeries[r].data[o].y;return!c||c.length!==5?"":['<div style="padding:10px 14px;font-family:sans-serif;font-size:13px;line-height:1.9;">',`<div>max : <b>${c[4]}</b></div>`,`<div>q1 : <b>${c[3]}</b></div>`,`<div>median : <b>${c[2]}</b></div>`,`<div>q3 : <b>${c[1]}</b></div>`,`<div>min : <b>${c[0]}</b></div>`,"</div>"].join("")}},grid:{borderColor:"#e6e6e6"},dataLabels:{enabled:!1},legend:{show:!1,fontSize:t.fontSize,fontWeight:t.fontWeight},responsive:t.responsive?[]:void 0};return X.jsx(Ca,{options:s,series:a,type:"boxPlot",height:t.height})},wc=({active:n,payload:e,label:t,realColor:i="#D9D9D9",predictionColor:a="#22D3EE",lowerAnomalyColor:s="#C497FF80",upperAnomalyColor:r="#A27DD5",texts:o={max:"Max",min:"Min",predictions:"Prédictions",anomaly:"Anomalie",real:"Réel"}})=>{if(!n||!e||!e.length)return null;const l=e[0].payload;return l?X.jsxs("div",{style:{backgroundColor:"#0B1220",color:"#FFFFFF",padding:"10px 12px",borderRadius:8,fontSize:12,lineHeight:1.4,minWidth:150,boxShadow:"0 4px 12px rgba(0,0,0,0.4)"},children:[X.jsx("div",{style:{fontWeight:600,marginBottom:6},children:t}),l.max!=null&&X.jsxs("div",{children:[o.max," : ",l.max]}),l.min!=null&&X.jsxs("div",{children:[o.min," : ",l.min]}),l.pred!=null&&X.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:6},children:[X.jsx("span",{style:{width:10,height:10,borderRadius:"50%",backgroundColor:a,marginRight:6}}),X.jsxs("span",{children:[o.predictions," : ",l.pred]})]}),l.anomaly&&X.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:4},children:[X.jsx("span",{style:{width:10,height:10,transform:"rotate(45deg)",backgroundColor:l.anomaly==="Haute"?r:s,marginRight:6}}),X.jsx("span",{children:o.anomaly})]}),l.reel!=null&&!l.isPrediction&&X.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:4},children:[X.jsx("span",{style:{width:10,height:10,backgroundColor:i,marginRight:6}}),X.jsxs("span",{children:[o.real," : ",l.reel]})]})]}):null},kc=({onGoingColor:n,realColor:e,upperAnomalyColor:t,lowerAnomalyColor:i,predictionColor:a,textColor:s="#9CA3AF",fontSize:r="12px",fontWeight:o="400",legendTexts:l={onGoing:"En cours",real:"Réel",predictions:"Prédictions Correctes",upperAnomaly:"Anomalie Haute",lowerAnomaly:"Anomalie Basse"},disabledSeries:c,onToggle:h})=>{const d=u=>({display:"flex",alignItems:"center",cursor:"pointer",opacity:c.includes(u)?.3:1,transition:"opacity 0.2s"});return X.jsxs("div",{style:{display:"flex",justifyContent:"center",flexWrap:"wrap",gap:"20px",marginBottom:"15px",color:s,fontSize:r,fontWeight:o},children:[X.jsxs("div",{style:d("onGoing"),onClick:()=>h("onGoing"),children:[X.jsx("span",{style:{width:15,height:10,backgroundColor:n,marginRight:"5px"}}),l.onGoing]}),X.jsxs("div",{style:d("real"),onClick:()=>h("real"),children:[X.jsx("span",{style:{width:15,height:10,backgroundColor:e,marginRight:"5px"}}),l.real]}),X.jsxs("div",{style:d("predictions"),onClick:()=>h("predictions"),children:[X.jsx("span",{style:{width:10,height:10,borderRadius:"50%",backgroundColor:a,marginRight:"5px"}}),l.predictions]}),X.jsxs("div",{style:d("upperAnomaly"),onClick:()=>h("upperAnomaly"),children:[X.jsx("span",{style:{width:10,height:10,transform:"rotate(45deg)",backgroundColor:t,marginRight:"5px"}}),l.upperAnomaly]}),X.jsxs("div",{style:d("lowerAnomaly"),onClick:()=>h("lowerAnomaly"),children:[X.jsx("span",{style:{width:10,height:10,transform:"rotate(45deg)",backgroundColor:i,marginRight:"5px"}}),l.lowerAnomaly]})]})},Ac=({data:n,config:e,height:t=220,useOnGoing:i,draggable:a=!1,tooltipEnabled:s=!0,disableLegendFilter:r=!1,backgroundColor:o="#ffffff",lowerAnomalyColor:l="#D8B4FE",lowerAnomalyScatterColor:c="#C497FF",upperAnomalyColor:h="#A855F7",upperAnomalyScatterColor:d="#7C46C3",realColor:u="#D9D9D9",onGoingColor:g="#727688",predictionColor:p="#22D3EE",predictionBarColor:f="#22D3EE",textColor:x="#9CA3AF",fontSize:m="8px",fontWeight:v="400",lineColor:w="#F4F4F4",predictionWindow:y=0,legendTexts:b,tooltipTexts:A,yAxisWidth:k=20,tickCount:C=7,padding:P})=>{const L=ue.useRef(null),[I,T]=ue.useState(50),[E,O]=ue.useState([]),z=q=>{r||O(_=>_.includes(q)?_.filter(U=>U!==q):[..._,q])};if(ue.useLayoutEffect(()=>{const q=()=>{if(L.current){const _=L.current.getBoundingClientRect().width,U=n.labels?.length||1,te=(_-k-30-U*2)/U;T(Math.max(te,14))}};return q(),window.addEventListener("resize",q),()=>window.removeEventListener("resize",q)},[n.labels,k]),e?.displayCondition&&!e.displayCondition(n))return X.jsx("div",{style:{padding:12},children:"Chart hidden by displayCondition"});const F=n.labels||[];if(!F.length)return X.jsx("div",{style:{padding:12},children:"Pas de labels fournis"});const V=n[e?.histogramKey??"histogram"],Z=F.map((q,_)=>{const U=n.main[_];let W=n.upper[_],B=n.lower[_];(W==null&&B!=null||W!=null&&B==null)&&(W=W??0,B=B??0);const ee=i&&typeof n.onGoingIndex=="number"&&_>n.onGoingIndex&&_<n.onGoingIndex+y,te=ee?U??null:V?.[_]??null,ae=W,ce=B;let $;!ee&&te!=null&&W!=null&&B!=null&&(te>W?$="Haute":te<B&&($="Basse"));let he=null,ke=null;if(y>0&&i&&typeof n.onGoingIndex=="number"&&_===n.onGoingIndex)if(te==null&&U==null)he=null,ke=null;else{const Be=te??0,Nt=U??0;Be<=Nt?(he=Be,ke=Nt-Be):(he=Nt,ke=Be-Nt)}else he=te??null,ke=null;return{time:q,reel:te,pred:U,realPart:he,predPart:ke,range:[B,W],max:ae,min:ce,anomaly:$,isPrediction:ee}});function R(q,_){return i&&n.onGoingIndex===_?E.includes("onGoing")?"transparent":g:i&&typeof n.onGoingIndex=="number"&&_>n.onGoingIndex&&_<n.onGoingIndex+y?E.includes("predictions")?"transparent":f:q.anomaly?q.anomaly==="Haute"&&E.includes("upperAnomaly")||q.anomaly==="Basse"&&E.includes("lowerAnomaly")?"transparent":q.anomaly==="Haute"?h:l:E.includes("real")?"transparent":u}const Y=typeof t=="string",K=X.jsxs(Ms,{data:Z,margin:{top:20,right:30,left:0,bottom:0},barGap:0,children:[X.jsx(S.CartesianGrid,{strokeDasharray:"0",vertical:!1,stroke:w}),X.jsx(S.XAxis,{dataKey:"time",stroke:x,axisLine:!1,tickLine:!1,tick:{fontSize:m,fontWeight:v}}),X.jsx(S.YAxis,{stroke:x,axisLine:!1,tickLine:!1,tickCount:C,tick:{fontSize:m,fontWeight:v},width:k,allowDecimals:!1}),s&&X.jsx(S.Tooltip,{content:X.jsx(wc,{realColor:u,predictionColor:p,upperAnomalyColor:d,lowerAnomalyColor:c,texts:A}),cursor:{fill:"transparent"}}),X.jsx(la,{type:"monotone",dataKey:"range",fill:"rgba(0, 143, 187, 1)",stroke:"none",fillOpacity:"16%",zIndex:999,hide:E.includes("predictions")}),X.jsx(S.Bar,{dataKey:"realPart",stackId:"a",barSize:I,radius:2,children:Z.map((q,_)=>{let U;if(y>0&&i&&typeof n.onGoingIndex=="number"&&_===n.onGoingIndex){const W=q.reel??0,B=q.pred??0;W<=B?U=E.includes("onGoing")?"transparent":g:U=E.includes("predictions")?"transparent":f}else U=R(q,_);return X.jsx(S.Cell,{fill:U},`cell-${_}`)})}),X.jsx(S.Bar,{dataKey:"predPart",stackId:"a",barSize:I,radius:2,children:Z.map((q,_)=>{if(!(y>0&&_===n.onGoingIndex))return X.jsx(S.Cell,{fill:"none"},`cell-pred-${_}`);const U=q.reel??0,W=q.pred??0;let B;return U<=W?B=E.includes("predictions")?"transparent":f:B=E.includes("onGoing")?"transparent":g,X.jsx(S.Cell,{fill:B},`cell-pred-${_}`)})}),X.jsx(S.Line,{type:"monotone",dataKey:"pred",stroke:p,strokeDasharray:"5 5",strokeWidth:2,dot:!1,hide:E.includes("predictions")}),X.jsx(Wi,{dataKey:"reel",shape:q=>{const{cx:_,cy:U,payload:W}=q;if(_===void 0||U===void 0)return X.jsx("g",{});if(W?.reel==null)return X.jsx("g",{});if(i&&typeof n.onGoingIndex=="number"&&W&&n.labels.indexOf(W.time)===n.onGoingIndex)return X.jsx("g",{});const B=!!W?.anomaly,ee=!W?.min||!W?.max?!1:W.reel<=W?.max&&W.reel>=W?.min;let te=!1;return ee&&!E.includes("predictions")?te=!0:B&&(W.anomaly==="Haute"&&!E.includes("upperAnomaly")&&(te=!0),W.anomaly==="Basse"&&!E.includes("lowerAnomaly")&&(te=!0)),te?X.jsx("circle",{cx:_-.5,cy:U,r:4,fill:p,stroke:"#fff",strokeWidth:"2"}):X.jsx("g",{})}}),X.jsx(Wi,{dataKey:"reel",shape:q=>{const{cx:_,cy:U,payload:W}=q;if(i&&typeof n.onGoingIndex=="number"&&W&&n.labels.indexOf(W.time)===n.onGoingIndex)return X.jsx("g",{});if(!W?.anomaly||_===void 0||U===void 0)return X.jsx("g",{});if(W?.reel==null)return X.jsx("g",{});if(W.anomaly==="Haute"&&E.includes("upperAnomaly"))return X.jsx("g",{});if(W.anomaly==="Basse"&&E.includes("lowerAnomaly"))return X.jsx("g",{});const B=W.anomaly==="Haute"?d:c;return X.jsx("svg",{x:_-5.5,y:U-5,width:10,height:10,viewBox:"0 0 100 100",children:X.jsx("path",{d:"M50 0 L100 50 L50 100 L0 50 Z",fill:B,stroke:"#fff",strokeWidth:"9"})})}})]});return X.jsxs("div",{ref:L,style:{width:"100%",padding:P,backgroundColor:o,borderRadius:"12px"},children:[Y?X.jsx("div",{style:{height:t},children:X.jsx(S.ResponsiveContainer,{width:"100%",height:"100%",children:K})}):X.jsx(S.ResponsiveContainer,{width:"100%",height:t,children:K}),!r&&X.jsx(kc,{onGoingColor:g,realColor:u,upperAnomalyColor:d,lowerAnomalyColor:c,predictionColor:p,textColor:x,fontSize:m,fontWeight:v,legendTexts:b,disabledSeries:E,onToggle:z})]})},Cc=n=>{const{x:e,y:t,payload:i,fontSize:a,fontWeight:s}=n,{value:r}=i;if(r&&r.includes(`
|
|
963
|
+
Valid keys: `+JSON.stringify(Object.keys(R),null," "));var $=ce(B,ae,_,U,W+"."+ae,t);if($)return $}return null}return x(Y)}function O(R){switch(typeof R){case"number":case"string":case"undefined":return!0;case"boolean":return!R;case"object":if(Array.isArray(R))return R.every(O);if(R===null||o(R))return!0;var Y=d(R);if(Y){var K=Y.call(R),q;if(Y!==R.entries){for(;!(q=K.next()).done;)if(!O(q.value))return!1}else for(;!(q=K.next()).done;){var _=q.value;if(_&&!O(_[1]))return!1}}else return!1;return!0;default:return!1}}function z(R,Y){return R==="symbol"?!0:Y?Y["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&Y instanceof Symbol:!1}function F(R){var Y=typeof R;return Array.isArray(R)?"array":R instanceof RegExp?"object":z(Y,R)?"symbol":Y}function H(R){if(typeof R>"u"||R===null)return""+R;var Y=F(R);if(Y==="object"){if(R instanceof Date)return"date";if(R instanceof RegExp)return"regexp"}return Y}function V(R){var Y=H(R);switch(Y){case"array":case"object":return"an "+Y;case"boolean":case"date":case"regexp":return"a "+Y;default:return Y}}function Z(R){return!R.constructor||!R.constructor.name?u:R.constructor.name}return g.checkPropTypes=a,g.resetWarningCache=a.resetWarningCache,g.PropTypes=g,g},Fi}var Hi,us;function gc(){if(us)return Hi;us=1;var n=Aa();function e(){}function t(){}return t.resetWarningCache=e,Hi=function(){function i(r,o,l,c,h,d){if(d!==n){var u=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 u.name="Invariant Violation",u}}i.isRequired=i;function a(){return i}var s={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:a,element:i,elementType:i,instanceOf:a,node:i,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:t,resetWarningCache:e};return s.PropTypes=s,s},Hi}var gs;function fc(){if(gs)return jt.exports;if(gs=1,process.env.NODE_ENV!=="production"){var n=kr(),e=!0;jt.exports=uc()(n.isElement,e)}else jt.exports=gc()();return jt.exports}var fs;function pc(){return fs||(fs=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=w;var e=o(ue),t=s(oc),i=s(fc()),a=["type","width","height","series","options","chartRef"];function s(y){return y&&y.__esModule?y:{default:y}}function r(y){var b,A;return typeof WeakMap!="function"?null:(b=new WeakMap,A=new WeakMap,(r=function(k){return k?A:b})(y))}function o(y,b){if(!b&&y&&y.__esModule)return y;if(y===null||d(y)!="object"&&typeof y!="function")return{default:y};if(b=r(b),b&&b.has(y))return b.get(y);var A,k,C={__proto__:null},P=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(A in y)A!=="default"&&{}.hasOwnProperty.call(y,A)&&((k=P?Object.getOwnPropertyDescriptor(y,A):null)&&(k.get||k.set)?Object.defineProperty(C,A,k):C[A]=y[A]);return C.default=y,b&&b.set(y,C),C}function l(){return(l=Object.assign?Object.assign.bind():function(y){for(var b=1;b<arguments.length;b++){var A,k=arguments[b];for(A in k)!{}.hasOwnProperty.call(k,A)||(y[A]=k[A])}return y}).apply(null,arguments)}function c(y,b){if(y==null)return{};var A,k=h(y,b);if(Object.getOwnPropertySymbols)for(var C=Object.getOwnPropertySymbols(y),P=0;P<C.length;P++)A=C[P],b.includes(A)||{}.propertyIsEnumerable.call(y,A)&&(k[A]=y[A]);return k}function h(y,b){if(y==null)return{};var A,k={};for(A in y)if({}.hasOwnProperty.call(y,A)){if(b.includes(A))continue;k[A]=y[A]}return k}function d(y){return(d=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(b){return typeof b}:function(b){return b&&typeof Symbol=="function"&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b})(y)}function u(y,b){var A,k=Object.keys(y);return Object.getOwnPropertySymbols&&(A=Object.getOwnPropertySymbols(y),b&&(A=A.filter(function(C){return Object.getOwnPropertyDescriptor(y,C).enumerable})),k.push.apply(k,A)),k}function g(y){for(var b=1;b<arguments.length;b++){var A=arguments[b]!=null?arguments[b]:{};b%2?u(Object(A),!0).forEach(function(k){p(y,k,A[k])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(A)):u(Object(A)).forEach(function(k){Object.defineProperty(y,k,Object.getOwnPropertyDescriptor(A,k))})}return y}function p(y,b,A){return(b=f(b))in y?Object.defineProperty(y,b,{value:A,enumerable:!0,configurable:!0,writable:!0}):y[b]=A,y}function f(y){return y=x(y,"string"),d(y)=="symbol"?y:y+""}function x(y,b){if(d(y)!="object"||!y)return y;var A=y[Symbol.toPrimitive];if(A===void 0)return(b==="string"?String:Number)(y);if(A=A.call(y,b),d(A)!="object")return A;throw new TypeError("@@toPrimitive must return a primitive value.")}function m(y,b){var A=g({},y);return b.forEach(function(k){delete A[k]}),A}function v(y,b){var A=2<arguments.length&&arguments[2]!==void 0?arguments[2]:new WeakSet;if(y!==b){if(d(y)!=="object"||y===null||d(b)!=="object"||b===null)return!1;if(!A.has(y)&&!A.has(b)){A.add(y),A.add(b);var k=Object.keys(y),C=Object.keys(b);if(k.length!==C.length)return!1;for(var P=0,L=k;P<L.length;P++){var I=L[P];if(!C.includes(I)||!v(y[I],b[I],A))return!1}}}return!0}function w(I){function b(V){return V&&d(V)==="object"&&!Array.isArray(V)}var H=I.type,A=H===void 0?"line":H,H=I.width,k=H===void 0?"100%":H,H=I.height,C=H===void 0?"auto":H,P=I.series,L=I.options,H=I.chartRef,I=c(I,a),T=(0,e.useRef)(null),E=H||(0,e.useRef)(null),O=(0,e.useRef)(),z=((0,e.useEffect)(function(){O.current=L;var V=T.current;return E.current=new t.default(V,z()),E.current.render(),function(){E.current&&typeof E.current.destroy=="function"&&E.current.destroy()}},[]),(0,e.useEffect)(function(){var V=!v(E.current.w.config.series,P),Z=!v(O.current,L)||C!==E.current.opts.chart.height||k!==E.current.opts.chart.width;(V||Z)&&(!V||Z?E.current.updateOptions(z()):E.current.updateSeries(P)),O.current=L},[L,P,C,k]),function(){return F(L,{chart:{type:A,height:C,width:k},series:P})}),F=function(V,Z){var R=g({},V);return b(V)&&b(Z)&&Object.keys(Z).forEach(function(Y){b(Z[Y])&&Y in V?R[Y]=F(V[Y],Z[Y]):Object.assign(R,p({},Y,Z[Y]))}),R},H=m(I,Object.keys(w.propTypes));return e.default.createElement("div",l({ref:T},H))}w.propTypes={type:i.default.string.isRequired,series:i.default.array.isRequired,options:i.default.object.isRequired,width:i.default.oneOfType([i.default.string,i.default.number]),height:i.default.oneOfType([i.default.string,i.default.number]),chartRef:i.default.shape({current:i.default.any})}}(pi)),pi}var xc=pc();const Ca=S.getDefaultExportFromCjs(xc),mc=["#e24b33","#e2b23a","#6feff0","#2f5be8"],vc=({categories:n,series:e,height:t=350,title:i="Admissions",draggable:a=!1})=>{const s=Math.max(...n.map((c,h)=>e.reduce((d,u)=>d+(u.data[h]??0),0))),r=Math.max(100,Math.ceil(s/50)*50),o={chart:{foreColor:"var(--color-text)",type:"area",stacked:!0,stackType:"normal",toolbar:{show:!1},zoom:{enabled:!1},animations:{enabled:!0},fontFamily:"Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial"},title:{text:i,align:"center",style:{fontSize:"36px",fontWeight:700,color:"#555"}},colors:mc,dataLabels:{enabled:!1},stroke:{curve:"smooth",width:1.5},fill:{type:"solid",opacity:.95},markers:{size:0},legend:{show:!0,position:"top",horizontalAlign:"center",itemMargin:{horizontal:8,vertical:0}},xaxis:{categories:n,labels:{rotate:-45,rotateAlways:!0,style:{fontSize:"12px"}},tickPlacement:"on"},yaxis:{min:0,max:r,tickAmount:7,labels:{formatter:c=>String(Math.round(Number(c)))}},grid:{borderColor:"#e9e9e9",strokeDashArray:0},tooltip:{shared:!0,intersect:!1,y:{formatter:c=>String(c)}},responsive:[{breakpoint:768,options:{chart:{height:Math.max(240,Math.round(t*.7))},legend:{position:"top"},xaxis:{labels:{rotate:-45}}}}]},l=e.map(c=>({name:c.name,type:"area",data:c.data}));return X.jsxs("div",{style:{position:"relative",height:t,width:"100%",overflow:"hidden"},children:[X.jsx("div",{style:{opacity:a?0:1,transition:"opacity 0.2s ease-in-out"},children:X.jsx(Ca,{options:o,series:l,type:"area",height:t,width:"100%"})}),a&&X.jsx("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(255, 255, 255, 0.6)",borderRadius:12,backdropFilter:"blur(3px)",pointerEvents:"none",transition:"opacity 0.2s ease-in-out"},children:X.jsx(S.Move,{size:38,strokeWidth:1.5,style:{opacity:.85}})})]})},ps={color:"#4f9db5",sort:"desc",height:520,showGrid:!0,showLegend:!1},bc=({data:n,config:e=ps,draggable:t=!1})=>{const i={...ps,...e},a=n.labels??[],s=n.values??[],r=Math.min(a.length,s.length),o=[];for(let u=0;u<r;u++)o.push({label:a[u],value:s[u]});i.sort==="desc"?o.sort((u,g)=>g.value-u.value):i.sort==="asc"&&o.sort((u,g)=>u.value-g.value);const l=o.map(u=>u.label),h=[{name:"Valeur",data:o.map(u=>u.value)}],d={chart:{foreColor:"var(--color-text)",type:"bar",toolbar:{show:!1},height:i.height},plotOptions:{bar:{horizontal:!0,barHeight:"60%",distributed:!1,borderRadius:6,borderRadiusApplication:"end"}},dataLabels:{enabled:!1,formatter:u=>String(u),style:{fontSize:"12px"},offsetX:0},yaxis:{labels:{style:{fontSize:"12px"}}},grid:{show:!!i.showGrid,borderColor:"#e6e6e6"},tooltip:{shared:!1,y:{formatter:u=>String(u)}},legend:{show:!!i.showLegend},colors:[i.color],xaxis:{min:0,tickAmount:5,categories:l,labels:{formatter:u=>String(u)}},responsive:[]};return X.jsxs("div",{style:{position:"relative",height:i.height,width:"100%",overflow:"hidden"},children:[X.jsx("div",{style:{opacity:t?0:1,transition:"opacity 0.15s ease-in-out"},children:X.jsx(Ca,{options:d,series:h,type:"bar",height:i.height,width:"100%"})}),t&&X.jsx("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(255,255,255,0.5)",borderRadius:12,backdropFilter:"blur(3px)",pointerEvents:"none",transition:"opacity 0.15s ease-in-out"},children:X.jsx(S.Move,{size:36,strokeWidth:1.5,style:{opacity:.85}})})]})},xs={colorUpper:"#2db85bff",colorLower:"#b3761bff",showOutliers:!0,tooltipFormatter:n=>String(n),height:420,responsive:!0,fontSize:"12px",fontWeight:"400",columnWidth:"70%"},yc=({data:n,config:e=xs})=>{const t={...xs,...e},a=[{name:"Distribution",data:(Array.isArray(n?.series)?n.series:[]).map(r=>({x:r.x,y:r.y}))}],s={chart:{foreColor:"var(--color-text)",type:"boxPlot",toolbar:{show:!1},height:t.height},yaxis:{tickAmount:10,labels:{formatter:function(r){return r.toFixed(0)}}},plotOptions:{boxPlot:{columnWidth:t.columnWidth,colors:{upper:t.colorUpper,lower:t.colorLower}}},xaxis:{labels:{rotate:-45,rotateAlways:!0,style:{fontSize:t.fontSize,fontWeight:t.fontWeight}}},stroke:{show:!0,width:1,colors:[t.colorStroke??"var(--color-secondary)"]},markers:{size:0},tooltip:{shared:!1,theme:"dark",custom:function({seriesIndex:r,dataPointIndex:o,w:l}){const c=l.globals.initialSeries[r].data[o].y;return!c||c.length!==5?"":['<div style="padding:10px 14px;font-family:sans-serif;font-size:13px;line-height:1.9;">',`<div>max : <b>${c[4]}</b></div>`,`<div>q3 : <b>${c[3]}</b></div>`,`<div>median : <b>${c[2]}</b></div>`,`<div>q1 : <b>${c[1]}</b></div>`,`<div>min : <b>${c[0]}</b></div>`,"</div>"].join("")}},grid:{borderColor:"#e6e6e6"},dataLabels:{enabled:!1},legend:{show:!1,fontSize:t.fontSize,fontWeight:t.fontWeight},responsive:t.responsive?[]:void 0};return X.jsx(Ca,{options:s,series:a,type:"boxPlot",height:t.height})},wc=({active:n,payload:e,label:t,realColor:i="#D9D9D9",predictionColor:a="#22D3EE",lowerAnomalyColor:s="#C497FF80",upperAnomalyColor:r="#A27DD5",texts:o={max:"Max",min:"Min",predictions:"Prédictions",anomaly:"Anomalie",real:"Réel"}})=>{if(!n||!e||!e.length)return null;const l=e[0].payload;return l?X.jsxs("div",{style:{backgroundColor:"#0B1220",color:"#FFFFFF",padding:"10px 12px",borderRadius:8,fontSize:12,lineHeight:1.4,minWidth:150,boxShadow:"0 4px 12px rgba(0,0,0,0.4)"},children:[X.jsx("div",{style:{fontWeight:600,marginBottom:6},children:t}),l.max!=null&&X.jsxs("div",{children:[o.max," : ",l.max]}),l.min!=null&&X.jsxs("div",{children:[o.min," : ",l.min]}),l.pred!=null&&X.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:6},children:[X.jsx("span",{style:{width:10,height:10,borderRadius:"50%",backgroundColor:a,marginRight:6}}),X.jsxs("span",{children:[o.predictions," : ",l.pred]})]}),l.anomaly&&X.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:4},children:[X.jsx("span",{style:{width:10,height:10,transform:"rotate(45deg)",backgroundColor:l.anomaly==="Haute"?r:s,marginRight:6}}),X.jsx("span",{children:o.anomaly})]}),l.reel!=null&&!l.isPrediction&&X.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:4},children:[X.jsx("span",{style:{width:10,height:10,backgroundColor:i,marginRight:6}}),X.jsxs("span",{children:[o.real," : ",l.reel]})]})]}):null},kc=({onGoingColor:n,realColor:e,upperAnomalyColor:t,lowerAnomalyColor:i,predictionColor:a,textColor:s="#9CA3AF",fontSize:r="12px",fontWeight:o="400",legendTexts:l={onGoing:"En cours",real:"Réel",predictions:"Prédictions Correctes",upperAnomaly:"Anomalie Haute",lowerAnomaly:"Anomalie Basse"},disabledSeries:c,onToggle:h})=>{const d=u=>({display:"flex",alignItems:"center",cursor:"pointer",opacity:c.includes(u)?.3:1,transition:"opacity 0.2s"});return X.jsxs("div",{style:{display:"flex",justifyContent:"center",flexWrap:"wrap",gap:"20px",marginBottom:"15px",color:s,fontSize:r,fontWeight:o},children:[X.jsxs("div",{style:d("onGoing"),onClick:()=>h("onGoing"),children:[X.jsx("span",{style:{width:15,height:10,backgroundColor:n,marginRight:"5px"}}),l.onGoing]}),X.jsxs("div",{style:d("real"),onClick:()=>h("real"),children:[X.jsx("span",{style:{width:15,height:10,backgroundColor:e,marginRight:"5px"}}),l.real]}),X.jsxs("div",{style:d("predictions"),onClick:()=>h("predictions"),children:[X.jsx("span",{style:{width:10,height:10,borderRadius:"50%",backgroundColor:a,marginRight:"5px"}}),l.predictions]}),X.jsxs("div",{style:d("upperAnomaly"),onClick:()=>h("upperAnomaly"),children:[X.jsx("span",{style:{width:10,height:10,transform:"rotate(45deg)",backgroundColor:t,marginRight:"5px"}}),l.upperAnomaly]}),X.jsxs("div",{style:d("lowerAnomaly"),onClick:()=>h("lowerAnomaly"),children:[X.jsx("span",{style:{width:10,height:10,transform:"rotate(45deg)",backgroundColor:i,marginRight:"5px"}}),l.lowerAnomaly]})]})},Ac=({data:n,config:e,height:t=220,useOnGoing:i,draggable:a=!1,tooltipEnabled:s=!0,disableLegendFilter:r=!1,backgroundColor:o="#ffffff",lowerAnomalyColor:l="#D8B4FE",lowerAnomalyScatterColor:c="#C497FF",upperAnomalyColor:h="#A855F7",upperAnomalyScatterColor:d="#7C46C3",realColor:u="#D9D9D9",onGoingColor:g="#727688",predictionColor:p="#22D3EE",predictionBarColor:f="#22D3EE",textColor:x="#9CA3AF",fontSize:m="8px",fontWeight:v="400",lineColor:w="#F4F4F4",predictionWindow:y=0,legendTexts:b,tooltipTexts:A,yAxisWidth:k=20,tickCount:C=7,padding:P})=>{const L=ue.useRef(null),[I,T]=ue.useState(50),[E,O]=ue.useState([]),z=q=>{r||O(_=>_.includes(q)?_.filter(U=>U!==q):[..._,q])};if(ue.useLayoutEffect(()=>{const q=()=>{if(L.current){const _=L.current.getBoundingClientRect().width,U=n.labels?.length||1,te=(_-k-30-U*2)/U;T(Math.max(te,14))}};return q(),window.addEventListener("resize",q),()=>window.removeEventListener("resize",q)},[n.labels,k]),e?.displayCondition&&!e.displayCondition(n))return X.jsx("div",{style:{padding:12},children:"Chart hidden by displayCondition"});const F=n.labels||[];if(!F.length)return X.jsx("div",{style:{padding:12},children:"Pas de labels fournis"});const V=n[e?.histogramKey??"histogram"],Z=F.map((q,_)=>{const U=n.main[_];let W=n.upper[_],B=n.lower[_];(W==null&&B!=null||W!=null&&B==null)&&(W=W??0,B=B??0);const ee=i&&typeof n.onGoingIndex=="number"&&_>n.onGoingIndex&&_<n.onGoingIndex+y,te=ee?U??null:V?.[_]??null,ae=W,ce=B;let $;!ee&&te!=null&&W!=null&&B!=null&&(te>W?$="Haute":te<B&&($="Basse"));let he=null,ke=null;if(y>0&&i&&typeof n.onGoingIndex=="number"&&_===n.onGoingIndex)if(te==null&&U==null)he=null,ke=null;else{const Be=te??0,Nt=U??0;Be<=Nt?(he=Be,ke=Nt-Be):(he=Nt,ke=Be-Nt)}else he=te??null,ke=null;return{time:q,reel:te,pred:U,realPart:he,predPart:ke,range:[B,W],max:ae,min:ce,anomaly:$,isPrediction:ee}});function R(q,_){return i&&n.onGoingIndex===_?E.includes("onGoing")?"transparent":g:i&&typeof n.onGoingIndex=="number"&&_>n.onGoingIndex&&_<n.onGoingIndex+y?E.includes("predictions")?"transparent":f:q.anomaly?q.anomaly==="Haute"&&E.includes("upperAnomaly")||q.anomaly==="Basse"&&E.includes("lowerAnomaly")?"transparent":q.anomaly==="Haute"?h:l:E.includes("real")?"transparent":u}const Y=typeof t=="string",K=X.jsxs(Ms,{data:Z,margin:{top:20,right:30,left:0,bottom:0},barGap:0,children:[X.jsx(S.CartesianGrid,{strokeDasharray:"0",vertical:!1,stroke:w}),X.jsx(S.XAxis,{dataKey:"time",stroke:x,axisLine:!1,tickLine:!1,tick:{fontSize:m,fontWeight:v}}),X.jsx(S.YAxis,{stroke:x,axisLine:!1,tickLine:!1,tickCount:C,tick:{fontSize:m,fontWeight:v},width:k,allowDecimals:!1}),s&&X.jsx(S.Tooltip,{content:X.jsx(wc,{realColor:u,predictionColor:p,upperAnomalyColor:d,lowerAnomalyColor:c,texts:A}),cursor:{fill:"transparent"}}),X.jsx(la,{type:"monotone",dataKey:"range",fill:"rgba(0, 143, 187, 1)",stroke:"none",fillOpacity:"16%",zIndex:999,hide:E.includes("predictions")}),X.jsx(S.Bar,{dataKey:"realPart",stackId:"a",barSize:I,radius:2,children:Z.map((q,_)=>{let U;if(y>0&&i&&typeof n.onGoingIndex=="number"&&_===n.onGoingIndex){const W=q.reel??0,B=q.pred??0;W<=B?U=E.includes("onGoing")?"transparent":g:U=E.includes("predictions")?"transparent":f}else U=R(q,_);return X.jsx(S.Cell,{fill:U},`cell-${_}`)})}),X.jsx(S.Bar,{dataKey:"predPart",stackId:"a",barSize:I,radius:2,children:Z.map((q,_)=>{if(!(y>0&&_===n.onGoingIndex))return X.jsx(S.Cell,{fill:"none"},`cell-pred-${_}`);const U=q.reel??0,W=q.pred??0;let B;return U<=W?B=E.includes("predictions")?"transparent":f:B=E.includes("onGoing")?"transparent":g,X.jsx(S.Cell,{fill:B},`cell-pred-${_}`)})}),X.jsx(S.Line,{type:"monotone",dataKey:"pred",stroke:p,strokeDasharray:"5 5",strokeWidth:2,dot:!1,hide:E.includes("predictions")}),X.jsx(Wi,{dataKey:"reel",shape:q=>{const{cx:_,cy:U,payload:W}=q;if(_===void 0||U===void 0)return X.jsx("g",{});if(W?.reel==null)return X.jsx("g",{});if(i&&typeof n.onGoingIndex=="number"&&W&&n.labels.indexOf(W.time)===n.onGoingIndex)return X.jsx("g",{});const B=!!W?.anomaly,ee=!W?.min||!W?.max?!1:W.reel<=W?.max&&W.reel>=W?.min;let te=!1;return ee&&!E.includes("predictions")?te=!0:B&&(W.anomaly==="Haute"&&!E.includes("upperAnomaly")&&(te=!0),W.anomaly==="Basse"&&!E.includes("lowerAnomaly")&&(te=!0)),te?X.jsx("circle",{cx:_-.5,cy:U,r:4,fill:p,stroke:"#fff",strokeWidth:"2"}):X.jsx("g",{})}}),X.jsx(Wi,{dataKey:"reel",shape:q=>{const{cx:_,cy:U,payload:W}=q;if(i&&typeof n.onGoingIndex=="number"&&W&&n.labels.indexOf(W.time)===n.onGoingIndex)return X.jsx("g",{});if(!W?.anomaly||_===void 0||U===void 0)return X.jsx("g",{});if(W?.reel==null)return X.jsx("g",{});if(W.anomaly==="Haute"&&E.includes("upperAnomaly"))return X.jsx("g",{});if(W.anomaly==="Basse"&&E.includes("lowerAnomaly"))return X.jsx("g",{});const B=W.anomaly==="Haute"?d:c;return X.jsx("svg",{x:_-5.5,y:U-5,width:10,height:10,viewBox:"0 0 100 100",children:X.jsx("path",{d:"M50 0 L100 50 L50 100 L0 50 Z",fill:B,stroke:"#fff",strokeWidth:"9"})})}})]});return X.jsxs("div",{ref:L,style:{width:"100%",padding:P,backgroundColor:o,borderRadius:"12px"},children:[Y?X.jsx("div",{style:{height:t},children:X.jsx(S.ResponsiveContainer,{width:"100%",height:"100%",children:K})}):X.jsx(S.ResponsiveContainer,{width:"100%",height:t,children:K}),!r&&X.jsx(kc,{onGoingColor:g,realColor:u,upperAnomalyColor:d,lowerAnomalyColor:c,predictionColor:p,textColor:x,fontSize:m,fontWeight:v,legendTexts:b,disabledSeries:E,onToggle:z})]})},Cc=n=>{const{x:e,y:t,payload:i,fontSize:a,fontWeight:s}=n,{value:r}=i;if(r&&r.includes(`
|
|
964
964
|
`)){const o=r.split(`
|
|
965
965
|
`);return X.jsx("g",{transform:`translate(${e},${t})`,children:X.jsxs("text",{x:0,y:0,dy:16,textAnchor:"middle",fill:"#6B7281",fontSize:a,fontWeight:s,children:[X.jsx("tspan",{x:0,dy:"0em",children:o[0]}),X.jsx("tspan",{x:0,dy:"1.2em",children:o[1]})]})})}return X.jsx("text",{x:e,y:t,dy:16,textAnchor:"middle",fill:"#6B7281",fontSize:a,fontWeight:s,children:r})},Sc=({data:n,height:e=320,tooltipEnabled:t=!0,legendEnabled:i=!0,backgroundColor:a="#ffffff",stacked:s=!0,fontSize:r="12px",fontWeight:o="400",yDomain:l})=>{const c=n.labels.map((g,p)=>{const f={label:g};return n.series.forEach(x=>{f[x.key]=x.data[p]??0}),f}),h=new Map(n.series.map((g,p)=>[g.key,p])),d=g=>{const p=(g.payload??[]).map(f=>({...f}));return p.sort((f,x)=>{const m=h.get(f.dataKey)??999,v=h.get(x.dataKey)??999;return m-v}),X.jsx("div",{style:{display:"flex",justifyContent:"center",marginTop:8,gap:16,flexWrap:"wrap"},children:p.map(f=>X.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[X.jsx("div",{style:{width:12,height:12,backgroundColor:f.color,borderRadius:2}}),X.jsx("span",{style:{fontSize:r,fontWeight:o,color:"#374151"},children:f.value})]},f.value))})},u=ue.useMemo(()=>{const g=n.labels.length;if(g<=0)return[];if(g<=12)return n.labels;const p=5,f=(g-1)/(p-1),x=[];for(let m=0;m<p;m++)x.push(n.labels[Math.round(m*f)]);return Array.from(new Set(x))},[n.labels]);return X.jsx("div",{style:{width:"100%",height:"100%",backgroundColor:a},children:X.jsx(S.ResponsiveContainer,{width:"100%",height:e,children:X.jsxs(Ms,{data:c,margin:{left:20,right:45,top:10,bottom:20},children:[X.jsx(S.CartesianGrid,{stroke:"#E5E7EB",vertical:!1}),X.jsx(S.XAxis,{fontSize:r,fontWeight:o,dataKey:"label",axisLine:!1,tickLine:!1,tickMargin:10,interval:0,ticks:u,scale:"point",height:45,tick:X.jsx(Cc,{fontSize:r,fontWeight:o})}),X.jsx(S.YAxis,{fontSize:r,fontWeight:o,axisLine:!1,tickLine:!1,width:30,domain:l}),t&&X.jsx(S.Tooltip,{itemSorter:g=>h.get(g.dataKey)??999}),i&&X.jsx(ri,{content:d}),n.series.map(g=>X.jsx(la,{type:"monotone",dataKey:g.key,stackId:s?"1":void 0,fill:g.color,stroke:"none",fillOpacity:1,name:g.label},g.key))]})})})},Pc=n=>{const{x:e,y:t,width:i,height:a,index:s,payload:r,fontSize:o,fontWeight:l}=n;if(isNaN(e)||isNaN(t))return null;const c=e<200,h=140;return X.jsxs(S.Layer,{children:[X.jsx(S.Rectangle,{x:e,y:t,width:i,height:a,fill:r.fill}),X.jsx("foreignObject",{x:c?e-h-8:e+i+8,y:t+a/2-25,width:h,height:50,style:{overflow:"visible"},children:X.jsx("div",{style:{fontSize:o||"11px",fontWeight:l||"400",color:"#94a3b8",lineHeight:"1.2",wordBreak:"break-word",display:"flex",alignItems:"center",justifyContent:c?"flex-end":"flex-start",textAlign:c?"right":"left",height:"100%",pointerEvents:"none"},children:r.name})})]},`node-${s}`)},Lc=n=>{const{sourceX:e,sourceY:t,targetX:i,targetY:a,linkWidth:s,index:r,payload:o,uid:l}=n;if(e==null||t==null||i==null||a==null||s==null)return null;const c=`
|
|
966
966
|
M${e},${t}
|
package/dist/chart.js
CHANGED
|
@@ -14285,9 +14285,9 @@ const ls = /* @__PURE__ */ Ra(Ld), Md = ["#e24b33", "#e2b23a", "#6feff0", "#2f5b
|
|
|
14285
14285
|
return !c || c.length !== 5 ? "" : [
|
|
14286
14286
|
'<div style="padding:10px 14px;font-family:sans-serif;font-size:13px;line-height:1.9;">',
|
|
14287
14287
|
`<div>max : <b>${c[4]}</b></div>`,
|
|
14288
|
-
`<div>
|
|
14288
|
+
`<div>q3 : <b>${c[3]}</b></div>`,
|
|
14289
14289
|
`<div>median : <b>${c[2]}</b></div>`,
|
|
14290
|
-
`<div>
|
|
14290
|
+
`<div>q1 : <b>${c[1]}</b></div>`,
|
|
14291
14291
|
`<div>min : <b>${c[0]}</b></div>`,
|
|
14292
14292
|
"</div>"
|
|
14293
14293
|
].join("");
|