@foodpilot/foods 0.3.94 → 0.3.95

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/main.js CHANGED
@@ -44673,7 +44673,7 @@ const T8e = (e) => {
44673
44673
  spacing: 4,
44674
44674
  children: [
44675
44675
  /* @__PURE__ */ f.jsx(zr, { item: !0, xs: 1, children: /* @__PURE__ */ f.jsx(i9, { ...o, isFirst: !0 }) }),
44676
- /* @__PURE__ */ f.jsx(zr, { item: !0, xs: 1, children: /* @__PURE__ */ f.jsx(rf, { gap: 3, display: "flex", flexDirection: "column", children: r.map((i, s) => /* @__PURE__ */ f.jsx(rf, { children: /* @__PURE__ */ f.jsx(i9, { ...i }) }, `article-${s}`)) }) })
44676
+ /* @__PURE__ */ f.jsx(zr, { item: !0, xs: 1, children: /* @__PURE__ */ f.jsx(rf, { gap: 3, display: "flex", flexDirection: "column", justifyContent: "space-between", height: "100%", children: r.map((i, s) => /* @__PURE__ */ f.jsx(rf, { height: "100%", children: /* @__PURE__ */ f.jsx(i9, { ...i }) }, `article-${s}`)) }) })
44677
44677
  ]
44678
44678
  }
44679
44679
  );
package/dist/main.umd.cjs CHANGED
@@ -371,7 +371,7 @@ const theme2 = createTheme({ palette: {
371
371
  * (c) 2017-2022 chartjs-plugin-datalabels contributors
372
372
  * Released under the MIT license
373
373
  */var sx=function(){if(typeof window<"u"){if(window.devicePixelRatio)return window.devicePixelRatio;var e=window.screen;if(e)return(e.deviceXDPI||1)/(e.logicalXDPI||1)}return 1}(),y2={toTextLines:function(e){var t=[],n;for(e=[].concat(e);e.length;)n=e.pop(),typeof n=="string"?t.unshift.apply(t,n.split(`
374
- `)):Array.isArray(n)?e.push.apply(e,n):Pt(e)||t.unshift(""+n);return t},textSize:function(e,t,n){var o=[].concat(t),r=o.length,i=e.font,s=0,a;for(e.font=n.string,a=0;a<r;++a)s=Math.max(e.measureText(o[a]).width,s);return e.font=i,{height:r*n.lineHeight,width:s}},bound:function(e,t,n){return Math.max(e,Math.min(t,n))},arrayDiff:function(e,t){var n=e.slice(),o=[],r,i,s,a;for(r=0,s=t.length;r<s;++r)a=t[r],i=n.indexOf(a),i===-1?o.push([a,1]):n.splice(i,1);for(r=0,s=n.length;r<s;++r)o.push([n[r],-1]);return o},rasterize:function(e){return Math.round(e*sx)/sx}};function mh(e,t){var n=t.x,o=t.y;if(n===null)return{x:0,y:-1};if(o===null)return{x:1,y:0};var r=e.x-n,i=e.y-o,s=Math.sqrt(r*r+i*i);return{x:s?r/s:0,y:s?i/s:-1}}function BX(e,t,n,o,r){switch(r){case"center":n=o=0;break;case"bottom":n=0,o=1;break;case"right":n=1,o=0;break;case"left":n=-1,o=0;break;case"top":n=0,o=-1;break;case"start":n=-n,o=-o;break;case"end":break;default:r*=Math.PI/180,n=Math.cos(r),o=Math.sin(r);break}return{x:e,y:t,vx:n,vy:o}}var zX=0,ax=1,lx=2,cx=4,dx=8;function O0(e,t,n){var o=zX;return e<n.left?o|=ax:e>n.right&&(o|=lx),t<n.top?o|=dx:t>n.bottom&&(o|=cx),o}function WX(e,t){for(var n=e.x0,o=e.y0,r=e.x1,i=e.y1,s=O0(n,o,t),a=O0(r,i,t),c,d,u;!(!(s|a)||s&a);)c=s||a,c&dx?(d=n+(r-n)*(t.top-o)/(i-o),u=t.top):c&cx?(d=n+(r-n)*(t.bottom-o)/(i-o),u=t.bottom):c&lx?(u=o+(i-o)*(t.right-n)/(r-n),d=t.right):c&ax&&(u=o+(i-o)*(t.left-n)/(r-n),d=t.left),c===s?(n=d,o=u,s=O0(n,o,t)):(r=d,i=u,a=O0(r,i,t));return{x0:n,x1:r,y0:o,y1:i}}function P0(e,t){var n=t.anchor,o=e,r,i;return t.clamp&&(o=WX(o,t.area)),n==="start"?(r=o.x0,i=o.y0):n==="end"?(r=o.x1,i=o.y1):(r=(o.x0+o.x1)/2,i=(o.y0+o.y1)/2),BX(r,i,e.vx,e.vy,t.align)}var E0={arc:function(e,t){var n=(e.startAngle+e.endAngle)/2,o=Math.cos(n),r=Math.sin(n),i=e.innerRadius,s=e.outerRadius;return P0({x0:e.x+o*i,y0:e.y+r*i,x1:e.x+o*s,y1:e.y+r*s,vx:o,vy:r},t)},point:function(e,t){var n=mh(e,t.origin),o=n.x*e.options.radius,r=n.y*e.options.radius;return P0({x0:e.x-o,y0:e.y-r,x1:e.x+o,y1:e.y+r,vx:n.x,vy:n.y},t)},bar:function(e,t){var n=mh(e,t.origin),o=e.x,r=e.y,i=0,s=0;return e.horizontal?(o=Math.min(e.x,e.base),i=Math.abs(e.base-e.x)):(r=Math.min(e.y,e.base),s=Math.abs(e.base-e.y)),P0({x0:o,y0:r+s,x1:o+i,y1:r,vx:n.x,vy:n.y},t)},fallback:function(e,t){var n=mh(e,t.origin);return P0({x0:e.x,y0:e.y,x1:e.x+(e.width||0),y1:e.y+(e.height||0),vx:n.x,vy:n.y},t)}},bi=y2.rasterize;function ZX(e){var t=e.borderWidth||0,n=e.padding,o=e.size.height,r=e.size.width,i=-r/2,s=-o/2;return{frame:{x:i-n.left-t,y:s-n.top-t,w:r+n.width+t*2,h:o+n.height+t*2},text:{x:i,y:s,w:r,h:o}}}function UX(e,t){var n=t.chart.getDatasetMeta(t.datasetIndex).vScale;if(!n)return null;if(n.xCenter!==void 0&&n.yCenter!==void 0)return{x:n.xCenter,y:n.yCenter};var o=n.getBasePixel();return e.horizontal?{x:o,y:null}:{x:null,y:o}}function qX(e){return e instanceof Bs?E0.arc:e instanceof f2?E0.point:e instanceof h2?E0.bar:E0.fallback}function GX(e,t,n,o,r,i){var s=Math.PI/2;if(i){var a=Math.min(i,r/2,o/2),c=t+a,d=n+a,u=t+o-a,p=n+r-a;e.moveTo(t,d),c<u&&d<p?(e.arc(c,d,a,-Math.PI,-s),e.arc(u,d,a,-s,0),e.arc(u,p,a,0,s),e.arc(c,p,a,s,Math.PI)):c<u?(e.moveTo(c,n),e.arc(u,d,a,-s,s),e.arc(c,d,a,s,Math.PI+s)):d<p?(e.arc(c,d,a,-Math.PI,0),e.arc(c,p,a,0,Math.PI)):e.arc(c,d,a,-Math.PI,Math.PI),e.closePath(),e.moveTo(t,n)}else e.rect(t,n,o,r)}function KX(e,t,n){var o=n.backgroundColor,r=n.borderColor,i=n.borderWidth;!o&&(!r||!i)||(e.beginPath(),GX(e,bi(t.x)+i/2,bi(t.y)+i/2,bi(t.w)-i,bi(t.h)-i,n.borderRadius),e.closePath(),o&&(e.fillStyle=o,e.fill()),r&&i&&(e.strokeStyle=r,e.lineWidth=i,e.lineJoin="miter",e.stroke()))}function YX(e,t,n){var o=n.lineHeight,r=e.w,i=e.x,s=e.y+o/2;return t==="center"?i+=r/2:(t==="end"||t==="right")&&(i+=r),{h:o,w:r,x:i,y:s}}function XX(e,t,n){var o=e.shadowBlur,r=n.stroked,i=bi(n.x),s=bi(n.y),a=bi(n.w);r&&e.strokeText(t,i,s,a),n.filled&&(o&&r&&(e.shadowBlur=0),e.fillText(t,i,s,a),o&&r&&(e.shadowBlur=o))}function JX(e,t,n,o){var r=o.textAlign,i=o.color,s=!!i,a=o.font,c=t.length,d=o.textStrokeColor,u=o.textStrokeWidth,p=d&&u,h;if(!(!c||!s&&!p))for(n=YX(n,r,a),e.font=a.string,e.textAlign=r,e.textBaseline="middle",e.shadowBlur=o.textShadowBlur,e.shadowColor=o.textShadowColor,s&&(e.fillStyle=i),p&&(e.lineJoin="round",e.lineWidth=u,e.strokeStyle=d),h=0,c=t.length;h<c;++h)XX(e,t[h],{stroked:p,filled:s,w:n.w,x:n.x,y:n.y+n.h*h})}var ux=function(e,t,n,o){var r=this;r._config=e,r._index=o,r._model=null,r._rects=null,r._ctx=t,r._el=n};Hr(ux.prototype,{_modelize:function(e,t,n,o){var r=this,i=r._index,s=Mn(an([n.font,{}],o,i)),a=an([n.color,un.color],o,i);return{align:an([n.align,"center"],o,i),anchor:an([n.anchor,"center"],o,i),area:o.chart.chartArea,backgroundColor:an([n.backgroundColor,null],o,i),borderColor:an([n.borderColor,null],o,i),borderRadius:an([n.borderRadius,0],o,i),borderWidth:an([n.borderWidth,0],o,i),clamp:an([n.clamp,!1],o,i),clip:an([n.clip,!1],o,i),color:a,display:e,font:s,lines:t,offset:an([n.offset,4],o,i),opacity:an([n.opacity,1],o,i),origin:UX(r._el,o),padding:Wn(an([n.padding,4],o,i)),positioner:qX(r._el),rotation:an([n.rotation,0],o,i)*(Math.PI/180),size:y2.textSize(r._ctx,t,s),textAlign:an([n.textAlign,"start"],o,i),textShadowBlur:an([n.textShadowBlur,0],o,i),textShadowColor:an([n.textShadowColor,a],o,i),textStrokeColor:an([n.textStrokeColor,a],o,i),textStrokeWidth:an([n.textStrokeWidth,0],o,i)}},update:function(e){var t=this,n=null,o=null,r=t._index,i=t._config,s,a,c,d=an([i.display,!0],e,r);d&&(s=e.dataset.data[r],a=mt(Jt(i.formatter,[s,e]),s),c=Pt(a)?[]:y2.toTextLines(a),c.length&&(n=t._modelize(d,c,i,e),o=ZX(n))),t._model=n,t._rects=o},geometry:function(){return this._rects?this._rects.frame:{}},rotation:function(){return this._model?this._model.rotation:0},visible:function(){return this._model&&this._model.opacity},model:function(){return this._model},draw:function(e,t){var n=this,o=e.ctx,r=n._model,i=n._rects,s;this.visible()&&(o.save(),r.clip&&(s=r.area,o.beginPath(),o.rect(s.left,s.top,s.right-s.left,s.bottom-s.top),o.clip()),o.globalAlpha=y2.bound(0,r.opacity,1),o.translate(bi(t.x),bi(t.y)),o.rotate(r.rotation),KX(o,i.frame,r),JX(o,r.lines,i.text,r),o.restore())}});var QX=Number.MIN_SAFE_INTEGER||-9007199254740991,eJ=Number.MAX_SAFE_INTEGER||9007199254740991;function w2(e,t,n){var o=Math.cos(n),r=Math.sin(n),i=t.x,s=t.y;return{x:i+o*(e.x-i)-r*(e.y-s),y:s+r*(e.x-i)+o*(e.y-s)}}function px(e,t){var n=eJ,o=QX,r=t.origin,i,s,a,c,d;for(i=0;i<e.length;++i)s=e[i],a=s.x-r.x,c=s.y-r.y,d=t.vx*a+t.vy*c,n=Math.min(n,d),o=Math.max(o,d);return{min:n,max:o}}function _0(e,t){var n=t.x-e.x,o=t.y-e.y,r=Math.sqrt(n*n+o*o);return{vx:(t.x-e.x)/r,vy:(t.y-e.y)/r,origin:e,ln:r}}var fx=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};Hr(fx.prototype,{center:function(){var e=this._rect;return{x:e.x+e.w/2,y:e.y+e.h/2}},update:function(e,t,n){this._rotation=n,this._rect={x:t.x+e.x,y:t.y+e.y,w:t.w,h:t.h}},contains:function(e){var t=this,n=1,o=t._rect;return e=w2(e,t.center(),-t._rotation),!(e.x<o.x-n||e.y<o.y-n||e.x>o.x+o.w+n*2||e.y>o.y+o.h+n*2)},intersects:function(e){var t=this._points(),n=e._points(),o=[_0(t[0],t[1]),_0(t[0],t[3])],r,i,s;for(this._rotation!==e._rotation&&o.push(_0(n[0],n[1]),_0(n[0],n[3])),r=0;r<o.length;++r)if(i=px(t,o[r]),s=px(n,o[r]),i.max<s.min||s.max<i.min)return!1;return!0},_points:function(){var e=this,t=e._rect,n=e._rotation,o=e.center();return[w2({x:t.x,y:t.y},o,n),w2({x:t.x+t.w,y:t.y},o,n),w2({x:t.x+t.w,y:t.y+t.h},o,n),w2({x:t.x,y:t.y+t.h},o,n)]}});function hx(e,t,n){var o=t.positioner(e,t),r=o.vx,i=o.vy;if(!r&&!i)return{x:o.x,y:o.y};var s=n.w,a=n.h,c=t.rotation,d=Math.abs(s/2*Math.cos(c))+Math.abs(a/2*Math.sin(c)),u=Math.abs(s/2*Math.sin(c))+Math.abs(a/2*Math.cos(c)),p=1/Math.max(Math.abs(r),Math.abs(i));return d*=r*p,u*=i*p,d+=t.offset*r,u+=t.offset*i,{x:o.x+d,y:o.y+u}}function tJ(e,t){var n,o,r,i;for(n=e.length-1;n>=0;--n)for(r=e[n].$layout,o=n-1;o>=0&&r._visible;--o)i=e[o].$layout,i._visible&&r._box.intersects(i._box)&&t(r,i);return e}function nJ(e){var t,n,o,r,i,s,a;for(t=0,n=e.length;t<n;++t)o=e[t],r=o.$layout,r._visible&&(a=new Proxy(o._el,{get:(c,d)=>c.getProps([d],!0)[d]}),i=o.geometry(),s=hx(a,o.model(),i),r._box.update(s,i,o.rotation()));return tJ(e,function(c,d){var u=c._hidable,p=d._hidable;u&&p||p?d._visible=!1:u&&(c._visible=!1)})}var S2={prepare:function(e){var t=[],n,o,r,i,s;for(n=0,r=e.length;n<r;++n)for(o=0,i=e[n].length;o<i;++o)s=e[n][o],t.push(s),s.$layout={_box:new fx,_hidable:!1,_visible:!0,_set:n,_idx:s._index};return t.sort(function(a,c){var d=a.$layout,u=c.$layout;return d._idx===u._idx?u._set-d._set:u._idx-d._idx}),this.update(t),t},update:function(e){var t=!1,n,o,r,i,s;for(n=0,o=e.length;n<o;++n)r=e[n],i=r.model(),s=r.$layout,s._hidable=i&&i.display==="auto",s._visible=r.visible(),t|=s._hidable;t&&nJ(e)},lookup:function(e,t){var n,o;for(n=e.length-1;n>=0;--n)if(o=e[n].$layout,o&&o._visible&&o._box.contains(t))return e[n];return null},draw:function(e,t){var n,o,r,i,s,a;for(n=0,o=t.length;n<o;++n)r=t[n],i=r.$layout,i._visible&&(s=r.geometry(),a=hx(r._el,r.model(),s),i._box.update(a,s,r.rotation()),r.draw(e,a))}},oJ=function(e){if(Pt(e))return null;var t=e,n,o,r;if(Rt(e))if(!Pt(e.label))t=e.label;else if(!Pt(e.r))t=e.r;else for(t="",n=Object.keys(e),r=0,o=n.length;r<o;++r)t+=(r!==0?", ":"")+n[r]+": "+e[n[r]];return""+t},rJ={align:"center",anchor:"center",backgroundColor:null,borderColor:null,borderRadius:0,borderWidth:0,clamp:!1,clip:!1,color:void 0,display:!0,font:{family:void 0,lineHeight:1.2,size:void 0,style:void 0,weight:null},formatter:oJ,labels:void 0,listeners:{},offset:4,opacity:1,padding:{top:4,right:4,bottom:4,left:4},rotation:0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,textShadowBlur:0,textShadowColor:void 0},To="$datalabels",gx="$default";function iJ(e,t){var n=e.datalabels,o={},r=[],i,s;return n===!1?null:(n===!0&&(n={}),t=Hr({},[t,n]),i=t.labels||{},s=Object.keys(i),delete t.labels,s.length?s.forEach(function(a){i[a]&&r.push(Hr({},[t,i[a],{_key:a}]))}):r.push(t),o=r.reduce(function(a,c){return Ut(c.listeners||{},function(d,u){a[u]=a[u]||{},a[u][c._key||gx]=d}),delete c.listeners,a},{}),{labels:r,listeners:o})}function bh(e,t,n,o){if(t){var r=n.$context,i=n.$groups,s;t[i._set]&&(s=t[i._set][i._key],s&&Jt(s,[r,o])===!0&&(e[To]._dirty=!0,n.update(r)))}}function sJ(e,t,n,o,r){var i,s;!n&&!o||(n?o?n!==o&&(s=i=!0):s=!0:i=!0,s&&bh(e,t.leave,n,r),i&&bh(e,t.enter,o,r))}function aJ(e,t){var n=e[To],o=n._listeners,r,i;if(!(!o.enter&&!o.leave)){if(t.type==="mousemove")i=S2.lookup(n._labels,t);else if(t.type!=="mouseout")return;r=n._hovered,n._hovered=i,sJ(e,o,r,i,t)}}function lJ(e,t){var n=e[To],o=n._listeners.click,r=o&&S2.lookup(n._labels,t);r&&bh(e,o,r,t)}var cJ={id:"datalabels",defaults:rJ,beforeInit:function(e){e[To]={_actives:[]}},beforeUpdate:function(e){var t=e[To];t._listened=!1,t._listeners={},t._datasets=[],t._labels=[]},afterDatasetUpdate:function(e,t,n){var o=t.index,r=e[To],i=r._datasets[o]=[],s=e.isDatasetVisible(o),a=e.data.datasets[o],c=iJ(a,n),d=t.meta.data||[],u=e.ctx,p,h,g,m,b,v,C,y;for(u.save(),p=0,g=d.length;p<g;++p)if(C=d[p],C[To]=[],s&&C&&e.getDataVisibility(p)&&!C.skip)for(h=0,m=c.labels.length;h<m;++h)b=c.labels[h],v=b._key,y=new ux(b,u,C,p),y.$groups={_set:o,_key:v||gx},y.$context={active:!1,chart:e,dataIndex:p,dataset:a,datasetIndex:o},y.update(y.$context),C[To].push(y),i.push(y);u.restore(),Hr(r._listeners,c.listeners,{merger:function(S,T,w){T[S]=T[S]||{},T[S][t.index]=w[S],r._listened=!0}})},afterUpdate:function(e){e[To]._labels=S2.prepare(e[To]._datasets)},afterDatasetsDraw:function(e){S2.draw(e,e[To]._labels)},beforeEvent:function(e,t){if(e[To]._listened){var n=t.event;switch(n.type){case"mousemove":case"mouseout":aJ(e,n);break;case"click":lJ(e,n);break}}},afterEvent:function(e){var t=e[To],n=t._actives,o=t._actives=e.getActiveElements(),r=y2.arrayDiff(n,o),i,s,a,c,d,u,p;for(i=0,s=r.length;i<s;++i)if(d=r[i],d[1])for(p=d[0].element[To]||[],a=0,c=p.length;a<c;++a)u=p[a],u.$context.active=d[1]===1,u.update(u.$context);(t._dirty||r.length)&&(S2.update(t._labels),e.render()),delete t._dirty}};const dJ=e=>{const{values:t,color:n,theme:o,updateCurrentSelectedPoint:r,...i}=e;return{...i,data:uJ(t,n),options:pJ(o,r),plugins:[hJ]}},uJ=(e,t)=>({datasets:[{data:e,backgroundColor:t,pointStyle:"circle",pointRadius:8,pointHoverRadius:9}],labels:Array.from(e.map(n=>n.label))}),pJ=(e,t)=>({plugins:{datalabels:{color:"#403d58",formatter:function(o){return o.label},align:"right",padding:{left:25},font:{weight:600,size:12,family:e.typography.fontFamily}},legend:{display:!1,usePointStyle:!0},tooltip:{enabled:!1,external:fJ}},scales:{x:{beginAtZero:!0,grace:"15%",linear:!0,border:{dash:[5,5]}},y:{beginAtZero:!0,linear:!0,grace:"20%",border:{dash:[5,5]}}},layout:{padding:{left:25,right:25,top:15,bottom:15}},onHover:(o,r)=>{if(o.type==="click"){if(r.length){t(r[0].index,o.x,o.y);return}t(null,null,null)}}}),mx={opacity:"0",position:"absolute",backgroundColor:"#393A36",color:"#fff",borderRadius:"4px",padding:"6px",pointerEvents:"none",textAlign:"center",fontSize:"10px",fontWeight:"600",minWidth:"30px"},fJ=e=>{const{chart:t,tooltip:n}=e;let o=document.getElementById("chartjs-tooltip-x");o||(o=document.createElement("div"),o.id="chartjs-tooltip-x",Object.assign(o.style,mx),document.body.appendChild(o));let r=document.getElementById("chartjs-tooltip-y");if(r||(r=document.createElement("div"),r.id="chartjs-tooltip-y",Object.assign(r.style,mx),document.body.appendChild(r)),n.opacity===0){o.style.opacity="0",r.style.opacity="0";return}if(n.dataPoints){const b=n.dataPoints[0],{x:v,y:C}=b.raw;o.textContent=`${v.toFixed(3)}`,r.textContent=`${C.toFixed(3)}`}const i=t.canvas.getBoundingClientRect(),s=t.scales.x,c=t.scales.y.bottom+i.top+window.scrollY,d=s.left+i.left+window.scrollX,u=i.left+window.scrollX+n.caretX-o.offsetWidth/2,p=c;o.style.left=`${u}px`,o.style.top=`${p}px`,o.style.opacity="1";const h=d-r.offsetWidth,g=i.top+window.scrollY+n.caretY-r.offsetHeight/2;r.style.left=`${h}px`,r.style.top=`${g}px`,r.style.opacity="1"},hJ={id:"crosshair",defaults:{width:1,color:"#000000",dash:[],tooltipBackground:"#f5f5f5",tooltipTextColor:"#000000",tooltipFontSize:10,tooltipPadding:6,tooltipRadius:4},afterInit:e=>{e.crosshair={x:0,y:0,draw:!1,xValue:null,yValue:null}},afterEvent:(e,t)=>{const{inChartArea:n}=t,o=e.getElementsAtEventForMode(t.event,"nearest",{intersect:!0},!1);if(o.length){const r=o[0].index,i=e.data.datasets[0].data[r],{x:s,y:a}=o[0].element;e.crosshair={x:s,y:a,draw:n,xValue:i.x,yValue:i.y}}else e.crosshair.draw=!1;e.draw()},beforeDatasetsDraw:e=>{var d,u,p,h,g,m,b,v;const{ctx:t,crosshair:n}=e;if(!n)return;const{bottom:o,left:r}=e.chartArea,{x:i,y:s,draw:a}=n;if(!a)return;t.save(),t.beginPath(),t.lineWidth=((u=(d=e.options.plugins)==null?void 0:d.crosshair)==null?void 0:u.width)??1,t.strokeStyle=((h=(p=e.options.plugins)==null?void 0:p.crosshair)==null?void 0:h.color)??"#000000";const c=((m=(g=e.options.plugins)==null?void 0:g.crosshair)==null?void 0:m.dash)??[];t.setLineDash(c.filter(C=>C!==void 0)),t.moveTo(i,s),t.lineTo(i,o),t.moveTo(r,s),t.lineTo(i,s),t.stroke(),t.font=`${((v=(b=e.options.plugins)==null?void 0:b.crosshair)==null?void 0:v.tooltipFontSize)??10}px ${t.font.split(" ").slice(-1)}`,t.textAlign="center",t.textBaseline="middle",t.restore()}};p2.register(...NK,cJ);const gJ=e=>{const t=(i,s,a)=>{var u;if(i===null||!((u=e.values)!=null&&u[i])||s===null||a===null){e.onPointSelection(null);return}const d={point:e.values[i],absoluteCoordinate:{x:s,y:a}};e.onPointSelection(d)},n="#F6A500",o=Pe(),r=dJ({...e,color:o.palette.primary[500]??n,theme:o,updateCurrentSelectedPoint:t});return f.jsxs(ee,{sx:{backgroundColor:o.custom.grey[200],borderRadius:"8px",border:`1px solid ${o.custom.grey[500]}`,padding:"12px"},children:[e.y,f.jsx(ZK,{...r}),f.jsx(ee,{sx:{width:"100%",display:"flex",justifyContent:"flex-end"},children:e.x})]})},bx=e=>{var T;const{chart:t,datasetIndex:n,dataIndex:o,evolution:r,reverse:i,positiveArrowIcon:s,negativeArrowIcon:a,positiveColor:c,negativeColor:d}=e,u=$.useRef(),[p,h]=$.useState([0,0,0]);if($.useEffect(()=>{!u.current||!t||n===void 0||h([u.current.offsetWidth,u.current.offsetHeight])},[t,o,n]),!t||n===void 0)return null;const g=t.canvas.getBoundingClientRect(),m=g.top+window.scrollY+t.getDatasetMeta(n).data[o].y-p[1]-10,b=g.left+window.scrollX+t.getDatasetMeta(n).data[o].x-p[0]/2;console.log(t.canvas.getBoundingClientRect().top,window.scrollY);const v=Math.sign(r??0),C=v===-1?i?c:d:i?d:c,y=v===-1?i?c:d:i?d:c,S=v===-1?a:s;return _o.createPortal(f.jsx(ee,{ref:u,position:"absolute",top:m+"px",left:b+"px",children:f.jsx(ur,{sx:bJ,children:f.jsxs(ye,{direction:"row",paddingX:1,paddingY:.5,display:"flex",gap:1,children:[f.jsx(pe,{fontWeight:700,fontSize:"10px",lineHeight:"16px",children:(T=t.data.datasets[n].data[o])==null?void 0:T.toString()}),f.jsx(mJ,{evolution:r,color:C,backgroundColor:y,icon:S})]})})}),document.body)},mJ=e=>{const{evolution:t,color:n,backgroundColor:o,icon:r}=e;return t===void 0?null:f.jsxs(ye,{direction:"row",alignItems:"center",gap:.5,children:[f.jsx(ye,{color:n,width:"14px",height:"14px",border:`1px solid ${n}`,sx:{backgroundColor:o},borderRadius:"20px",alignItems:"center",p:.25,children:f.jsx(Xt,{icon:r,size:.2})}),f.jsxs(pe,{fontWeight:700,fontSize:"10px",lineHeight:"16px",color:n,children:[Math.round(t)," %"]})]})},bJ={minWidth:"35px",minHeight:"24px",overflow:"visible",borderRadius:"8xp",boxShadow:"0px 4px 20px 0px rgba(81, 78, 78, 0.12)","&::after":{boxShadow:"0px 4px 20px 0px rgba(81, 78, 78, 0.12)",content:'""',position:"absolute",left:0,right:0,margin:"-1px auto",width:0,height:0,borderTop:"7.5px solid white",borderLeft:"15px solid transparent",borderRight:"15px solid transparent"}},vJ=e=>e.data.datasets.forEach(t=>{t.type==="line"&&(t.hidden=!0)}),CJ=(e,t,n=!1)=>{if(t===null)return;const o=e.data.datasets.filter(i=>i.type==="bar").length,r=n?t+o*2:t;e.data.datasets[r-o*2].hidden=!1,e.data.datasets[r-o].hidden=!1,e.update()},xJ=e=>{const t=e.data.datasets.filter(n=>n.type==="bar").length??0;e.data.datasets.forEach((n,o)=>{n.type==="bar"&&(n.backgroundColor=Ws[o%t])})},yJ=(e,t,n="66")=>{const o=e.data.datasets.filter(r=>r.type==="bar").length??0;e.data.datasets.forEach((r,i)=>{r.type==="bar"&&(i===t?r.backgroundColor=Ws[i%o]:r.backgroundColor=Ws[i%o]+n)})},Ws=["#ff8025","#4dcdf0","#f98cc0","#2b59a4","#ffb400","#db3d53","#00a950","#58595b","#8549ba"],wJ=e=>{const{labels:t,icons:n,chart:o,handleOnMouseOver:r,legend:i,labelIndex:s}=e,a=o.data.datasets.findIndex(h=>h.type==="bar")??0,d=h=>{const g=h!==null?h+a:void 0;r(o,g)},u=t.map((h,g)=>g),p=Ws;return f.jsx(ye,{className:"doughnut-chart-legend-wrapper",children:f.jsx(ye,{display:"inline-flex",children:t.map((h,g)=>{const m=u&&u[g]!==void 0;return f.jsx(ye,{direction:"row",alignItems:"center",gap:"12px",paddingY:"8px",onMouseEnter:()=>{m&&d(g)},onMouseLeave:()=>d(null),sx:{backgroundColor:b=>s===g?b.custom.grey[300]:"",...g===0?{}:{borderTop:b=>`1px solid ${b.custom.grey[500]}`}},children:f.jsxs(ye,{direction:"row",alignItems:"center",gap:"12px",sx:{width:"100%"},children:[n&&f.jsx(ye,{sx:{backgroundColor:b=>m?p[g]:b.custom.grey[400],color:"white"},p:.5,borderRadius:"4px",children:f.jsx(Xt,{icon:n[g]??"default",size:3.5})}),!n&&f.jsx(ee,{minWidth:"10px",height:"10px",bgcolor:b=>m?p[g]:b.custom.grey[400]}),f.jsx(pe,{variant:"h5",className:"doughnut-chart-legend-item-label",children:h}),(i==null?void 0:i.actions)&&(i==null?void 0:i.seeMore)&&(i==null?void 0:i.actions[g])&&f.jsx(hh,{action:i==null?void 0:i.actions[g],seeMore:i==null?void 0:i.seeMore})]})},g)})})})},SJ={id:"lineReposition",beforeDatasetsDraw(e,t,n){const{ctx:o,data:r,scales:{x:i}}=e;o.save();const s=e.getDatasetMeta(r.datasets.length-1).data[0].width,a=e.data.datasets.filter(d=>d.type==="bar").length,c=r.datasets.findIndex(d=>d.type==="bar");r.datasets.forEach((d,u)=>{if(d.type==="line"&&d.kind==="top"){const p=u+c-a;i.ticks.forEach((h,g)=>{const m=s/2,b=g%2===0?m:-m;e.getDatasetMeta(u).data[g].x=i.getPixelForValue(i.ticks[g].value)+b;const v=e.getDatasetMeta(p).data[g%2].y,{height:C}=e.getDatasetMeta(p).data[g%2].getProps(["height"]);e.getDatasetMeta(u).data[g].y=v+C})}d.type==="line"&&d.kind==="bottom"&&i.ticks.forEach((p,h)=>{const g=u+c,m=s/2,b=h%2===0?m:-m;e.getDatasetMeta(u).data[h].x=i.getPixelForValue(i.ticks[h].value)+b,e.getDatasetMeta(u).data[h].y=e.getDatasetMeta(g).data[h%2].y})})}},MJ=()=>{const e=$.useRef(),[t,n]=$.useState(!1);return $.useEffect(()=>{e.current&&n(!0)},[]),$.useEffect(()=>{if(!e.current)return;const o=()=>e.current.resize();return window.addEventListener("resize",o),()=>{window.removeEventListener("resize",o)}},[]),{ref:e,chartReady:t}},TJ=()=>{const[e,t]=$.useState(),[n,o]=$.useState(0);return{datasetIndex:e,evolution:n,highlightDataset:(i,s)=>{if(vJ(i),s===void 0){t(void 0),xJ(i);return}t(s);const a=i.data.datasets[s],c=(a.data[a.data.length-1]-a.data[0])/a.data[0]*100;o(c),yJ(i,s),CJ(i,s)}}},kJ=(e,t)=>{const{ref:n,chartReady:o}=MJ(),{datasetIndex:r,evolution:i,highlightDataset:s}=TJ(),a=$.useMemo(()=>[...t.map((p,h)=>({...p,type:"line",backgroundColor:Ws[h]+"66",label:`line - 1${h}`,hidden:!0,fill:"+3",kind:"bottom"})),...t.map((p,h)=>({...p,type:"line",backgroundColor:Ws[h]+"66",label:`line - 0${h}`,hidden:!0,kind:"top"})),...t.map((p,h)=>({...p,type:"bar",backgroundColor:Ws[h],barPercentage:.4,categoryPercentage:.9,stack:""}))],[t]);return{data:{labels:e,datasets:a},type:"line",ref:n,options:{animation:!1,responsive:!0,plugins:{legend:{display:!1},filler:{propagate:!1},datalabels:{display:!1},tooltip:{enabled:!1,external:()=>{}}},scales:{x:{grid:{display:!1}}}},plugins:[SJ],highlightDataset:s,chartReady:o,evolution:i,datasetIndex:r,labelIndex:r!==void 0?r%t.length:void 0}},OJ=e=>{const t=Pe(),{values:n,labels:o,icons:r,positiveArrowIcon:i="arrowUpRight",negativeArrowIcon:s="arrowDownRight",reverse:a=!1,positiveColor:c=t.custom.green[500],negativeColor:d=t.custom.red[500],legend:u}=e,p={positiveArrowIcon:i,negativeArrowIcon:s},h={positiveColor:c,negativeColor:d},{chartReady:g,data:m,datasetIndex:b,labelIndex:v,highlightDataset:C,evolution:y,options:S,plugins:T,ref:w,type:k}=kJ(o,n),O=E=>{var I;if(!w.current)return;const P=w.current,_=BK(P,E),R=(I=_==null?void 0:_[0])==null?void 0:I.datasetIndex;C(P,R)};return f.jsxs(ye,{position:"relative",direction:(u==null?void 0:u.position)==="bottom"?"column":"row",flexWrap:"wrap",sx:{backgroundColor:"white"},gap:6,children:[f.jsx(ee,{flex:2,width:"100%",height:"100%",children:f.jsx(Uf,{ref:w,type:k,data:m,options:S,plugins:T,onMouseMove:O})}),f.jsx(ee,{flex:1,flexBasis:"300px",width:"100%",children:g&&f.jsx(wJ,{labels:n.map(({label:E})=>E),icons:r,handleOnMouseOver:C,chart:w.current,legend:u,labelIndex:v})}),f.jsx(bx,{...p,...h,reverse:a,chart:w.current,datasetIndex:b,dataIndex:0}),f.jsx(bx,{...p,...h,reverse:a,chart:w.current,datasetIndex:b,dataIndex:1,evolution:y})]})},PJ={id:"moveDataset",beforeDatasetsDraw(e,t,n){const{ctx:o,data:r,scales:{x:i}}=e;o.save(),r.datasets.forEach((s,a)=>{const c=s.xoffset;c!==void 0&&e.getDatasetMeta(a).data.forEach((d,u)=>{d.x=i.getPixelForValue(i.ticks[c+u].value)})})}},EJ=()=>{const e=$.useRef(),[t,n]=$.useState(!1);return $.useEffect(()=>{e.current&&n(!0)},[]),$.useEffect(()=>{if(!e.current)return;const o=()=>e.current.resize();return window.addEventListener("resize",o),()=>{window.removeEventListener("resize",o)}},[]),{ref:e,chartReady:t}},_J=(e,t,n,o,r)=>{const{chartReady:i,ref:s}=EJ(),a=Pe(),c=n.map(b=>b.label),d=n.map(b=>b.value),u=[e.label,t.label].concat(c).concat([o.label]),p=$.useMemo(()=>{const b=d.reduce((C,y)=>{const[,S]=C.slice(-1).pop();return[...C,[S,S+y]]},[[0,t.value]]);b.shift();const[[,v]]=b.slice(-1);return[{label:e.label,data:[[0,e.value]],backgroundColor:(r==null?void 0:r.reference)??a.custom.dataviz.colors[2].main,xoffset:0,barThickness:80},{label:t.label,data:[[0,t.value]],backgroundColor:(r==null?void 0:r.start)??a.custom.dataviz.colors[4].main,xoffset:1,barThickness:80},{label:"values",data:b,backgroundColor:C=>{const[y,S]=C.raw;return S-y<0?a.custom.dataviz.extra[14].main:a.custom.dataviz.colors[6].main},xoffset:2,barThickness:80},{label:"diff",data:[[0,o.overrideValues!==void 0?o.overrideValues:v]],backgroundColor:(r==null?void 0:r.target)??a.custom.dataviz.colors[4].main,xoffset:d.length+2,barThickness:80}]},[e,t,d,r,o]);return{type:"bar",ref:s,chartReady:i,data:{labels:u,datasets:p},options:{animation:!1,responsive:!0,scales:{y:{grace:"5%"}},plugins:{legend:{display:!1},datalabels:{align:"start",anchor(b){const{dataset:{data:v}}=b;return v[0][0]==0?"end":"start"},offset(b){const{dataset:{data:v}}=b;return v[0][0]==0?-20:0},formatter([b,v],C){return v-b}}}},plugins:[PJ]}},RJ=e=>{const{reference:t,start:n,values:o,target:r,colors:i}=e,{data:s,ref:a,type:c,options:d,plugins:u}=_J(t,n,o,r,i);return f.jsx(ye,{position:"relative",flexWrap:"wrap",sx:{backgroundColor:"white"},gap:6,children:f.jsx(ee,{flex:2,width:"100%",height:"100%",children:f.jsx(Uf,{ref:a,type:c,data:s,options:d,plugins:u})})})},vx=e=>x.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},x.createElement("rect",{x:1,y:1,width:18,height:18,rx:3,fill:"white"}),x.createElement("rect",{x:1,y:1,width:18,height:18,rx:3,stroke:"#D1CFCE",strokeWidth:2})),Cx=e=>x.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},x.createElement("rect",{width:20,height:20,rx:4,fill:"url(#paint0_linear_2034_7850)"}),x.createElement("path",{d:"M8.32244 13.9335L4.56689 10.178L5.36133 9.38351L8.32244 12.3446L14.628 6.03906L15.4224 6.83351L8.32244 13.9335Z",fill:"white"}),x.createElement("defs",null,x.createElement("linearGradient",{id:"paint0_linear_2034_7850",x1:7.58928,y1:755124e-13,x2:7.58928,y2:20,gradientUnits:"userSpaceOnUse"},x.createElement("stop",{stopColor:"#484945"}),x.createElement("stop",{offset:1,stopColor:"#2A2B27"})))),IJ=z(Vr)(()=>({":hover":{background:Ee[400]}})),LJ=e=>{const{values:t,...n}=e,{onChange:o,...r}=n,i=Object.entries(t);return f.jsx(kp,{children:i.map(([s,a],c)=>f.jsx(Ga,{control:f.jsx(IJ,{...r,checkedIcon:f.jsx(Cx,{}),icon:f.jsx(vx,{}),disableRipple:!0,onChange:(d,u)=>{const p={};p[s]={name:a.name,state:u},o(p)}}),sx:{gap:"1rem"},label:a.name,checked:a.state},`${s}-${c}`))})},jJ=(e,t,n)=>Object.entries(t).flatMap(r=>{const[i,s]=r;if(s.state===!1)return[];const a=Number(i),c=e.find(d=>d.id===a);return c?[c]:[n({id:a,name:s.name})]}),DJ=(e,t)=>{const n={};return e.reduce((r,i)=>{const s=t.some(a=>a.id===i.id);return r[i.id]={name:i.name,state:s},r},n)},VJ=z(Vr)(()=>({":hover":{background:Ee[400]}})),AJ=e=>{const{values:t,onChange:n,FormGroupProps:o,FormControlLabelProps:r,CheckboxProps:i}=e,s=Object.entries(t);return f.jsx(kp,{...o,children:s.map(([a,c],d)=>f.jsx(Ga,{sx:{gap:"1rem"},checked:c.state,...r,label:c.name,control:f.jsx(VJ,{checkedIcon:f.jsx(Cx,{}),icon:f.jsx(vx,{}),disableRipple:!0,...i,onChange:(u,p)=>{const h={...t};h[a]={...h[a],name:c.name,state:p},n(h)}})},`${a}-${d}`))})},xx=e=>{const{values:t,selectedItems:n,onChange:o,getId:r=d=>d.id,getName:i=d=>d.name,...s}=e,a=(n==null?void 0:n.map(d=>r(d)))??[],c=t.reduce((d,u)=>{const p=r(u),h=a.includes(p),g=n===void 0?!1:h;return d[p]={name:i(u),state:g,rawData:u},d},{});return f.jsx(AJ,{values:c,onChange:d=>{const u=Object.values(d).flatMap(p=>p.state===!1?[]:p.rawData);return o(u)},...s})},FJ=e=>{const{title:t,subtitle:n,description:o,imageUrl:r,callToAction:i,sxProps:s={}}=e,a=Pe();return f.jsxs(ee,{sx:{display:"flex",maxWidth:"1200px",border:`1px solid ${Ee[500]}`,background:a.palette.background.paper,borderRadius:"16px",overflow:"hidden",justifyContent:"space-between",gap:"3rem",...s},children:[f.jsxs(ee,{sx:{padding:"48px 0 48px 48px",display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[f.jsxs(ee,{children:[f.jsx(el,{defaultVariant:"h2",text:t}),n&&f.jsx(el,{defaultVariant:"h5",text:n,typographyProps:{color:a.custom.grey[2e3],lineHeight:"1.625rem"}}),o&&f.jsx(ee,{my:"1.5rem",children:o})]}),f.jsx(ee,{children:i&&f.jsx(Wc,{buttonOptions:i,defaultOptions:{sx:{display:"inline-flex",gap:"12px",padding:"24px"},variant:"primary",endIcon:f.jsx(Xt,{size:2,icon:"arrowRight"})}})})]}),r&&f.jsx(ee,{sx:{width:500,mb:"-8px"},children:f.jsx("img",{src:r,alt:"description",style:{width:"100%",height:"auto",minWidth:500}})})]})},NJ=z(ee)(()=>({position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0)",zIndex:1e3,transition:"background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1)",visibility:"hidden","&.open":{backgroundColor:"rgba(0, 0, 0, 0.5)",visibility:"visible"}})),HJ=z(ee)(({theme:e})=>({position:"fixed",top:0,right:0,bottom:0,width:"75%",backgroundColor:e.palette.background.paper,zIndex:1001,overflowY:"auto",transform:"translateX(100%)",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",opacity:0,borderRadius:`${e.spacing(1)} 0 0 ${e.spacing(1)}`,"&.open":{transform:"translateX(0)",opacity:1,visibility:"visible",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"}})),yx=z(ee)({width:"100%",height:"400px",backgroundColor:"#f0f0f0","& img":{width:"100%",height:"100%",objectFit:"cover",transition:"opacity 0.3s ease-in-out"}}),$J=z(jt)(({theme:e})=>({position:"fixed",top:e.spacing(2),right:e.spacing(2.5),zIndex:1002,backgroundColor:"white",visibility:"hidden",transform:"translateX(200%)",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)","&:hover":{backgroundColor:"rgba(255, 255, 255, 0.8)"},"&.open":{transform:"translateX(0)",opacity:1,visibility:"visible",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"}})),BJ=z(ye)({padding:"2rem 4rem"}),zJ=({isOpen:e,onClose:t,article:n})=>($.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset"}),[e]),f.jsxs(f.Fragment,{children:[f.jsx(NJ,{className:e?"open":"",onClick:t}),f.jsx($J,{className:e?"open":"",onClick:t,children:f.jsx(Xt,{size:2,icon:"close"})}),f.jsxs(HJ,{className:e?"open":"",children:[f.jsx($.Suspense,{fallback:f.jsx(yx,{}),children:f.jsx(yx,{children:f.jsx("img",{src:n.imageSrc,alt:n.title,loading:"lazy",onLoad:o=>{o.target.style.opacity="1"},style:{opacity:0}})})}),f.jsxs(BJ,{spacing:3,children:[f.jsx(pe,{variant:"h2",children:n.title}),f.jsx(pe,{variant:"body1",dangerouslySetInnerHTML:{__html:n.content}})]})]})]})),WJ=z(ye,{shouldForwardProp:e=>e!=="isFirst"})(({isFirst:e,theme:t})=>({border:`1px solid ${Ee[500]}`,borderRadius:t.spacing(1),overflow:"hidden",margin:0,padding:0,height:"100%",width:"100%",flexDirection:e?"column":"row"})),ZJ=z(ee)(()=>({flex:1,lineHeight:0,position:"relative","& img":{width:"100%",height:"100%",objectFit:"cover",display:"block"}})),UJ=z(ye)(({theme:e})=>({flex:1,backgroundColor:e.palette.background.paper,padding:e.spacing(4),justifyContent:"space-between",gap:e.spacing(1)})),qJ=z(m8)({display:"block",width:"100%",height:"100%",cursor:"pointer"}),GJ=z(at)(({theme:e})=>({display:"inline-flex",alignSelf:"flex-start",fontWeight:700,gap:e.spacing(1)})),KJ=z(pe,{shouldForwardProp:e=>e!=="isFirst"})(({isFirst:e})=>({display:"-webkit-box",WebkitLineClamp:e?5:3,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis"})),vh=e=>{const[t,n]=$.useState(!1),{title:o,description:r,imageSrc:i,content:s,onClick:a,isFirst:c=!1,readMoreText:d="Lire l'article"}=e,u=()=>{a?a():n(!0)};return f.jsxs(f.Fragment,{children:[f.jsxs(WJ,{isFirst:c,children:[f.jsx(ZJ,{children:f.jsx(qJ,{onClick:u,children:f.jsx("img",{src:i,alt:o})})}),f.jsxs(UJ,{children:[f.jsxs(ee,{children:[f.jsx(pe,{variant:"h3",mb:"0.2rem",children:o}),f.jsx(KJ,{variant:"body",mb:"1rem",isFirst:c,dangerouslySetInnerHTML:{__html:r}})]}),f.jsxs(GJ,{variant:"text",onClick:u,children:[f.jsx(pe,{fontWeight:700,fontSize:"0.875rem",children:d}),f.jsx(Xt,{size:2,icon:"arrowRight"})]})]})]}),!a&&f.jsx(zJ,{isOpen:t,onClose:()=>n(!1),article:{title:o,description:r,imageSrc:i,content:s||r}})]})},YJ=e=>{const{articles:t=[],sxProps:n={}}=e,[o,...r]=t;return f.jsxs(Ar,{container:!0,columns:2,sx:{...n,height:"100%"},spacing:4,children:[f.jsx(Ar,{item:!0,xs:1,children:f.jsx(vh,{...o,isFirst:!0})}),f.jsx(Ar,{item:!0,xs:1,children:f.jsx(E3,{gap:3,display:"flex",flexDirection:"column",children:r.map((i,s)=>f.jsx(E3,{children:f.jsx(vh,{...i})},`article-${s}`))})})]})},XJ=e=>{const{title:t,children:n,objectives:o=[],tooltipMessage:r}=e,i=Pe();return f.jsxs(ye,{sx:{borderRadius:"12px",border:`1px solid ${i.palette.grey[500]}`,padding:"34px",maxWidth:"360px",background:i.palette.background.paper},children:[f.jsxs(ee,{display:"flex",children:[f.jsx(pe,{variant:"h3",component:"h3",mb:"1.5rem",children:t}),r&&f.jsx(Xt,{size:3,icon:"information"})]}),f.jsx(ee,{fontWeight:700,display:"flex",gap:"0.5rem",mb:"1rem",children:n}),f.jsx(ye,{sx:{"> div:not(:last-of-type)":{mb:"1rem"}},children:o.map((s,a)=>f.jsxs(ye,{flexDirection:"row",alignItems:"center",gap:".5rem",children:[f.jsx(pe,{variant:"small-medium",children:s.objective}),f.jsx(B9,{boxProps:{sx:{padding:"0.1rem 0.5rem"}},children:s.component})]},a))})]})},wx=z(({className:e,...t})=>f.jsx(Qt,{...t,arrow:!0,classes:{popper:e}}))(e=>({[`& .${xo.arrow}`]:{color:"#FFF"},[`& .${xo.tooltip}`]:{padding:"12px 16px 12px 16px",borderRadius:"8px",backgroundColor:"#FFF"}})),JJ=e=>{const{title:t,subtitle:n,description:o}=e,r=Pe();return f.jsxs(ye,{sx:{borderRadius:"12px",border:`1px solid ${r.palette.grey[500]}`,padding:"34px",maxWidth:"360px",background:r.palette.background.paper},children:[f.jsxs(ye,{flexDirection:"row",alignContent:"center",justifyContent:"space-between",children:[f.jsx(pe,{variant:"h3",component:"h3",mb:"1.5rem",children:t}),n&&f.jsx(QJ,{text:n})]}),f.jsx(ye,{children:f.jsx(pe,{variant:"body-medium",children:f.jsx(ee,{dangerouslySetInnerHTML:{__html:o}})})})]})};function QJ(e){const{text:t}=e;return f.jsx(wx,{title:f.jsx(pe,{variant:"body-medium",children:t}),placement:"right",children:f.jsx(ee,{children:f.jsx(Xt,{size:3,icon:"information"})})})}const eQ=e=>{const{value:t,maxLength:n,...o}=e,r=t.map((u,p)=>t.slice(0,p+1).reduce((h,g)=>{const m=h.length+g.length;if(m>n){const b=n-m,v=[...h.words,g.slice(0,b)].filter(Boolean);return{length:m,words:v,rest:t.length-v.length}}return{...h,length:m,words:[...h.words,g]}},{length:0,words:[],rest:0})),i=r[r.length-1],a=t[t.length-1].length===i.words[i.words.length-1].length?"":"…",c=i.words.join(", "),d=i.rest>0?`${c}… +${i.rest}`:c+a;return f.jsx(pe,{...o,children:d})},tQ=e=>{const{value:t,maxLength:n,separator:o=",",...r}=e;if(n===0)return f.jsx(pe,{...r,children:""});const i=t.join("").length;if(n>i)return f.jsx(pe,{...r,children:t.join(o)});let s=0;const a=t.reduce((C,y)=>{const S=s+y.length,T={low:s,high:S};return s=S,C.push(T),C},[]),c=a.findIndex(C=>C.low<n&&n<=C.high),d=c+1,u=a.length-d,h=a[c].high===n?"":"…",g=d*o.length,m=t.join(o).slice(0,n-1+g),b=u?`+${u}`:"",v=`${m}${h} ${b}`;return f.jsx(pe,{...r,children:v})},nQ=e=>{const{setOpen:t,options:n,onValidate:o,onCancel:r,canValidate:i=!0,confirmAction:s,cancelText:a,validateText:c,...d}=e,[u,p]=$.useState(!1),h=()=>t(!1),g=()=>{p(!1)},m=()=>{r&&r(),h()},b=()=>{if(!s){o&&o(),h();return}u?(p(!1),o&&o(),h()):p(!0)};return f.jsxs(Ec,{onClose:m,...d,fullWidth:!0,maxWidth:"md",scroll:"body",children:[f.jsxs(gu,{sx:Mx,children:[n.title,f.jsx(at,{variant:"text",endIcon:f.jsx(Fu,{}),onClick:m})]}),f.jsx(ee,{sx:{width:"100%"},children:n.content}),f.jsx(Sx,{onCancelAction:m,onConfirmAction:b,canValidate:i,cancelText:a,validateText:c}),s&&f.jsx(oQ,{openConfirmAction:u,onCancel:g,onValidate:b,confirmAction:s,cancelText:a,validateText:c})]})},oQ=e=>{const{confirmAction:t,onCancel:n,onValidate:o,openConfirmAction:r,cancelText:i,validateText:s}=e;return f.jsxs(Ec,{open:r,onClose:n,sx:{display:"flex",justifyContent:"space-between",alignItems:"center",borderBottom:`1px solid ${Ee[500]}`,minHeight:"68px",padding:"28px 27px 28px 32px"},children:[f.jsxs(gu,{sx:Mx,children:[t.title,f.jsx(at,{variant:"text",endIcon:f.jsx(Fu,{}),onClick:n})]}),f.jsx(ee,{sx:{padding:"32px",width:"100%"},children:t.content}),f.jsx(Sx,{onCancelAction:n,onConfirmAction:o,cancelText:t.cancelText??i,validateText:t.validateText??s})]})},Sx=e=>{const{onCancelAction:t,onConfirmAction:n,canValidate:o=!0,cancelText:r,validateText:i}=e;return f.jsxs(Tp,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",borderTop:`1px solid ${Ee[500]}`,minHeight:"68px",paddingInline:"1rem",padding:"28px 32px 32px 32px"},children:[f.jsx(at,{variant:"text",onClick:t,children:r}),f.jsx(at,{variant:"primary",onClick:n,disabled:!o,children:i})]})},Mx={display:"flex",justifyContent:"space-between",alignItems:"center",borderBottom:`1px solid ${Ee[500]}`,minHeight:"68px",padding:"28px 27px 28px 32px"},rQ=z(Mc)(({theme:e})=>({fontFamily:e.typography.fontFamily,...e.typography.body})),fl=$.forwardRef(function(e,t){const n=Pe(),{sx:o,error:r,...i}=e;return f.jsx(rQ,{...i,sx:{color:r?n.custom.red[600]:n.custom.grey[2800],border:r?`1px solid ${n.custom.red[600]}`:`1px solid ${n.custom.grey[1400]}`,backgroundColor:r?n.custom.red[100]:"inherit",borderRadius:"16px",paddingInline:"20px",...o}})}),iQ=e=>{const{title:t,unit:n,placeholder:o,value:r,description:i,error:s,required:a,...c}=e,d=a?"*":"",u=Pe(),p=$.useRef(!1),h=p.current&&s,[g,m]=$.useState(!1),[b,v]=$.useState(!1),[C,y]=$.useState(!1);$.useEffect(()=>{const O=S(T,e.setMinMaxError);m(O);const E=S(w,e.setMinError);v(E);const P=S(k,e.setMaxError);y(P)},[r]);const S=(O,E)=>{const P=O();return E!==void 0&&E(P),P},T=()=>{if(e.min===void 0&&e.max===void 0||r===void 0||r==="")return!1;const O=Number(r);return!(e.min!==void 0&&O>e.min&&e.max!==void 0&&O<e.max)},w=()=>e.min===void 0||r===void 0||r===""?!1:!(e.min<Number(r)&&e.max===void 0),k=()=>e.max===void 0||r===void 0||r===""?!1:!(e.max>Number(r)&&e.min===void 0);return f.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[f.jsx(pe,{variant:"h5",children:`${t}${d} :`}),f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"5px"},children:[f.jsx(fl,{...c,type:"number",style:{minWidth:"150px",width:"10%",borderColor:h?u.palette.error.main:"inherit",backgroundColor:h?u.palette.error.light:"inherit"},placeholder:o,value:r,onChange:O=>{p.current=!0,c.onChange&&c.onChange(O)}}),f.jsx(pe,{variant:"body",children:n})]}),(!!e.minMaxErrorMessage&&g||!!e.minErrorMessage&&b||!!e.maxErrorMessage&&C)&&f.jsxs(pe,{variant:"body",style:{color:u.custom.red[600]},children:[!!e.minMaxErrorMessage&&g&&e.minMaxErrorMessage,!!e.minErrorMessage&&b&&e.minErrorMessage,!!e.maxErrorMessage&&C&&e.maxErrorMessage]}),f.jsx(pe,{variant:"body",children:i})]})},sQ=e=>{const{unit:t,sx:n,...o}=e;return f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"1rem"},children:[f.jsx(fl,{type:"number",sx:{minWidth:"125px",width:"10%",...n},...o}),f.jsx(pe,{variant:"body",children:t})]})};function aQ(e){const t=Pe(),n={height:"40px",padding:"0px 6px 0px 20px",...t.custom.searchBox,minWidth:"350px"},o={height:"20px",padding:"0px",width:"100%","&>.MuiInputBase-root>fieldset":{border:"none"},"&>.MuiInputBase-root>input":{padding:"0"}},r={height:"48px",padding:"0px 16px 0px 24px",borderTop:"1px solid "+t.custom.grey[500],borderBottom:"1px solid "+t.custom.grey[500],background:t.custom.grey[200]},i={"&>.MuiInputBase-root>fieldset":{border:"none"},"&>.MuiInputBase-root>input":{width:"100%",height:"48px",padding:"0",border:"none"}};return f.jsxs(ye,{direction:"row",useFlexGap:!0,gap:"10px",justifyContent:"space-between",alignItems:"center",sx:e.variant==="standalone"?n:r,children:[f.jsx(ii,{label:"",type:"search",placeholder:e.placeholder,value:e.value,onChange:s=>{e.onChange(s.target.value)},sx:e.variant==="standalone"?o:i}),f.jsx(Iz,{})]})}const lQ=$.forwardRef(function(t,n){const{title:o,placeholder:r,value:i,description:s,sx:a,error:c,required:d,...u}=t,p=d?"*":"",h=Pe(),g=$.useRef(!1),m=g.current&&c;return f.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[f.jsx(pe,{variant:"h5",children:`${o}${p} :`}),f.jsx(fl,{...u,sx:{width:"70%",borderColor:m?h.custom.red[600]:"inherit",backgroundColor:m?h.custom.red[100]:"inherit",...a},placeholder:r,value:i,onChange:b=>{g.current=!0,u.onChange&&u.onChange(b)}}),f.jsx(pe,{variant:"body",children:s})]})});function cQ(e){return f.jsxs("div",{children:[f.jsx(pe,{variant:"body-bold",sx:{marginBottom:"16px"},children:e.header}),f.jsxs(ye,{direction:"column",useFlexGap:!0,gap:"12px",children:[f.jsxs(ye,{direction:"row",sx:{height:"20px"},useFlexGap:!0,gap:"12px",justifyContent:"flex-start",children:[f.jsx(Vr,{checked:!0,sx:{width:"20px",height:"20px"}}),f.jsx(pe,{variant:"body",children:e.allText})]}),e.values.map((t,n)=>f.jsxs(ye,{direction:"row",sx:{height:"20px"},useFlexGap:!0,gap:"12px",justifyContent:"flex-start",children:[f.jsx(Vr,{checked:!1,sx:{width:"20px",height:"20px"}}),f.jsx(pe,{variant:"body",children:t})]},n))]})]})}function dQ(e){return f.jsxs(ye,{direction:"column",useFlexGap:!0,gap:"12px",alignItems:"flex-start",children:[f.jsx(pe,{variant:"body-bold",children:e.header}),f.jsx(ye,{direction:"row",useFlexGap:!0,gap:"8px",flexWrap:"wrap",children:e.values.map((t,n)=>f.jsxs(ye,{direction:"row",useFlexGap:!0,gap:"4px",sx:{height:"28px",borderRadius:"4px",background:"#EFEDEC",paddingLeft:"8px"},alignItems:"center",children:[f.jsx(pe,{variant:"body",children:t}),f.jsx(jt,{sx:{width:"20px",height:"20px"},children:f.jsx(Kp,{sx:{width:"16px",height:"16px"}})})]},n))}),f.jsx(at,{variant:"text",startIcon:f.jsx(yz,{}),children:e.addText})]})}const Tx=e=>{const t=Pe(),{steps:n,currentStep:o=0,icons:r=[],clickable:i=!1,onClick:s}=e;return f.jsxs(ee,{display:"inline-flex",position:"relative",children:[f.jsx(ye,{direction:"row",gap:"12px",position:"relative",sx:{zIndex:1},children:[...Array(n??r.length).keys()].map(a=>{const c=a<=o;return f.jsx(Au,{size:"medium",border:`1px solid ${t.custom.grey[500]}`,color:c?"#FFF":t.custom.grey[2800],bgcolor:c?t.custom.grey[2800]:"#FFF",sx:{fill:c?"#FFF":t.custom.grey[2800],cursor:i?"pointer":"default","&:hover":i?{fill:"#FFF",color:"#FFF",bgcolor:t.custom.grey[c?2800:2e3]}:{}},onClick:()=>{i&&s&&s(a)},children:r&&r[a]?r[a]:a+1},a)})}),f.jsx(zn,{sx:{backgroundColor:t.custom.grey[500],position:"absolute",inset:`${36/2}px`}})]})},kx=e=>x.createElement("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},x.createElement("path",{d:"M11.021 7.69411H0.333496V6.30524H11.021L6.021 1.30522L7.00016 0.333008L13.6668 6.99967L7.00016 13.6663L6.021 12.6941L11.021 7.69411Z",fill:"white"})),Ox=e=>x.createElement("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},x.createElement("path",{d:"M2.97919 7.69411L7.97921 12.6941L7.00004 13.6663L0.333374 6.99967L7.00004 0.333008L7.97921 1.30522L2.97919 6.30524H13.6667V7.69411H2.97919Z",fill:"#B06803"})),Px=e=>{var t;return f.jsxs(ye,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{minHeight:"96px",zIndex:1e3,position:"sticky",top:"28px",border:"1px solid #E7E6E4",borderRadius:"52px",backgroundColor:"#FFFFFF",padding:"20px 28px"},children:[f.jsx(uQ,{title:e.title,subtitle:e.subtitle}),f.jsx(Tx,{icons:e.icons,steps:e.steps??((t=e.icons)==null?void 0:t.length)??0,currentStep:e.currentPage,clickable:e.navigable,onClick:e.onNavigate}),f.jsx(fQ,{onPageForward:e.onPageForward,onPageBack:e.onPageBack,nextPageText:e.nextPageText,previousPageText:e.previousPageText,currentPage:e.currentPage,validateSteps:e.validateSteps,validateStepsTexts:e.validateStepsTexts,warningText:e.warningText,savingState:e.savingState,closeable:e.closeable,onClose:e.onClose})]})},uQ=e=>{const t=Pe();return f.jsx(ye,{direction:"row",alignItems:"center",justifyContent:"start",marginX:"20px",maxWidth:"33%",children:f.jsxs(ye,{gap:"4px",children:[f.jsx(pe,{variant:"h3",children:e.title}),e.subtitle&&f.jsx(pe,{variant:"body",color:t.custom.grey[2e3],children:e.subtitle})]})})},pQ=e=>{const t=Pe(),n=e.saving?L9:I9,o=e.saving?{animation:"spin 1s linear infinite","@keyframes spin":{"0%":{transform:"rotate(360deg)"},"100%":{transform:"rotate(0deg)"}}}:{},r=f.jsx(n,{sx:{width:"24px",color:t.custom.grey[2e3],...o}}),i=f.jsx(ee,{padding:"12px 16px",textAlign:"center",children:f.jsx(pe,{variant:"body",children:e.saving?e.savingMessage:e.savedMessage})});return f.jsx(Zc,{icon:r,body:i,size:"260px"})},fQ=e=>{const t=Pe(),n=f.jsx(at,{variant:"primary",disabled:e.validateSteps&&!e.validateSteps[e.currentPage],endIcon:f.jsx(kx,{}),onClick:e.onPageForward,children:e.nextPageText}),o=f.jsxs(ee,{padding:"12px 16px",children:[f.jsx(pe,{variant:"body-bold",children:e.warningText||""}),f.jsx("br",{}),f.jsx(pe,{variant:"body",children:e.validateStepsTexts&&e.validateStepsTexts[e.currentPage]||""})]});return f.jsxs(ye,{direction:"row",alignItems:"center",justifyContent:"end",gap:"28px",children:[f.jsx(ee,{sx:{">*":{display:"flex"}},children:e.savingState&&f.jsx(pQ,{...e.savingState})}),f.jsxs(ye,{direction:"row",gap:"20px",children:[e.previousPageText&&f.jsx(at,{variant:"text",startIcon:f.jsx(Ox,{}),onClick:e.onPageBack,children:e.previousPageText}),e.validateSteps&&!e.validateSteps[e.currentPage]?e.nextPageText&&f.jsx(Zc,{icon:n,body:o,size:"260px"}):e.nextPageText&&n]}),e.closeable&&f.jsx(at,{variant:"white-filled",onClick:e.onClose,sx:{minWidth:0,aspectRatio:1,borderRadius:"100%",padding:0,"&:hover":{background:t.custom.grey[400]},"&:active":{background:t.custom.grey[600]}},children:f.jsx(R9,{sx:{width:"20px",color:t.custom.grey[2800]}})})]})},Ch=e=>{const t=Pe(),{title:n,titleSize:o,badge:r}=e,s=o||"h1";return f.jsxs(ye,{direction:"row",alignItems:"center",gap:"16px",children:[typeof r=="number"?f.jsx(Au,{size:"big",children:r}):f.jsx(ye,{width:"40px",alignItems:"center",color:t.custom.grey[2800],children:f.jsx(ye,{sx:{transform:"scale(250%)"},children:r})}),f.jsx(pe,{variant:s,children:n})]})},hQ=e=>{const{title:t,subtitle:n,pages:o,pageIndexToDisplay:r=0,savingState:i,closeable:s=!0}=e,a=o.map(u=>u.icon),c=o[r],d=(Array.isArray(c.content)?c.content:[c.content]).map((u,p)=>f.jsx($.Fragment,{children:u},p));return f.jsxs(f.Fragment,{children:[f.jsx(Px,{title:t,subtitle:n,icons:a,steps:o.length,currentPage:r,nextPageText:e.nextPageText,previousPageText:e.previousPageText,onPageForward:e.onPageForward,onPageBack:e.onPageBack,validateSteps:e.validateSteps,validateStepsTexts:e.validateStepsTexts,warningText:e.warningText,savingState:i,navigable:e.navigable,onNavigate:e.onNavigate,closeable:s,onClose:e.onClose}),f.jsx(ye,{direction:"column",alignItems:"center",children:f.jsxs("div",{style:{width:"1024px"},children:[f.jsxs(ye,{direction:"column",marginTop:"44px",marginBottom:"36px",gap:"2rem",children:[c.title&&f.jsx(Ch,{title:c.title,badge:c.icon??r+1}),c.subTitle&&f.jsx(pe,{variant:"h4",children:c.subTitle}),c.subTitle&&f.jsx(zn,{}),c.info]}),c.usesBaseLayout===!1?f.jsx(f.Fragment,{children:d}):f.jsx(gQ,{children:d})]})})]})},gQ=e=>{const{children:t}=e,n=Array.isArray(t)?t:[t];return f.jsx("div",{children:n.map((o,r)=>f.jsx($.Fragment,{children:o},r))})},mQ=({sx:e={},...t})=>f.jsx(ee,{sx:{boxShadow:"0px 2px 8px 0px #2A2B270A",border:`1px solid ${Ee[500]}`,borderRadius:"16px",backgroundColor:"#FFFFFF",padding:"2rem",height:"fit-content",...e},...t}),bQ=e=>{const{title:t,hint:n,indicator:o,children:r,...i}=e;return f.jsx(nr,{width:"100%",padding:"32px",...i,children:f.jsxs(ye,{gap:"32px",children:[f.jsxs(ye,{direction:"row",alignItems:"start",gap:"32px",children:[f.jsx(pe,{variant:"h4",flex:1,children:t}),o&&f.jsx(Vu,{value:o.value,unit:o.unit,sx:{top:"-12px",right:"-12px"}})]}),f.jsxs(ye,{gap:"24px",children:[r,n&&f.jsx(W9,{children:f.jsx(ee,{dangerouslySetInnerHTML:{__html:n}})})]})]})})},vQ=()=>{const[e,t]=$.useState({isLocked:!1}),n=u=>{t({isLocked:!0,message:u})},o=()=>{t({isLocked:!1})},[r,i]=$.useState({isLocked:!1}),s=u=>{i({isLocked:!0,message:u})},a=()=>{i({isLocked:!1})};return{forwardLock:e,lockForward:n,unlockForward:o,previousLock:r,lockPrevious:s,unlockPrevious:a,lockAll:u=>{n(u),s(u)},unlockAll:()=>{o(),a()}}},Ex=$.createContext(null),_x=e=>{const{children:t,startingPage:n=0,...o}=e,[r,i]=$.useState(!1),[s,a]=$.useState(!1),[c,d]=$.useState(n),u=e.pages.length,p=e.pages[c]??null,h=vQ(),[g,m]=$.useState(!1),b={...o,...h,isSaving:r,setSaving:i,selectedPage:p,selectedPageIndex:c,setPage:d,maxPage:u,formSaved:g,setFormSaved:m,isError:s,setError:a};return f.jsx(Ex.Provider,{value:b,children:t})},Zs=()=>{const e=$.useContext(Ex);if(e)return e;throw new Error("useFormBaseContext must be used within an FormBaseContextProvider")},CQ=()=>{const{selectedPageIndex:e,setPage:t,onPageChange:n,pages:o,previousLock:r,forwardLock:i,maxPage:s,setFormSaved:a,isLoading:c}=Zs(),d=Pe(),u={selected:{color:"#FFF",background:d.custom.grey[2800],hover:{color:"#FFF",background:d.custom.grey[2800]}},locked:{color:d.custom.grey[500],background:"#FFF",hover:{color:d.custom.grey[500],background:"#FFF"}},default:{color:d.custom.grey[2800],background:"#FFF",hover:{color:"#FFF",background:d.custom.grey[2e3]}}};return c?f.jsx(qa,{}):f.jsxs(ee,{display:"inline-flex",position:"relative",children:[f.jsx(ye,{direction:"row",gap:"12px",position:"relative",sx:{zIndex:1},children:[...Array(s)].map((p,h)=>{var S,T;const g=r.isLocked&&h<e,m=i.isLocked&&h>e,b=g||m,C=h===e?u.selected:u[b?"locked":"default"],y=((S=o[h])==null?void 0:S.icon)??h+1;return f.jsx(Au,{size:"medium",border:`1px solid ${d.custom.grey[500]}`,color:C.color,bgcolor:C.background,tooltip:(T=o[h])==null?void 0:T.title,sx:{fill:C.color,cursor:b?"default":"pointer","&:hover":{fill:C.hover.color,color:C.hover.color,bgcolor:C.hover.background}},onClick:()=>{h===e||b||(a(!1),t(h),n==null||n(h,e))},children:y},`page-top-display-${h}`)})}),f.jsx(zn,{sx:{backgroundColor:d.custom.grey[500],position:"absolute",inset:`${36/2}px`}})]})},xQ=()=>{const{textOptions:e,isLoading:t}=Zs(),n=Pe();return f.jsx(ye,{direction:"row",alignItems:"center",justifyContent:"start",marginX:"20px",maxWidth:"33%",children:f.jsxs(ye,{gap:"4px",children:[f.jsx(pe,{variant:"h3",children:t?f.jsx(qa,{size:"18px"}):e.title}),e.subtitle&&f.jsx(pe,{variant:"body",color:n.custom.grey[2e3],children:e.subtitle})]})})},yQ=()=>{const e=Pe(),{isSaving:t,textOptions:n,isError:o}=Zs(),r=t?L9:o?jz:I9,i=t?{animation:"spin 1s linear infinite","@keyframes spin":{"0%":{transform:"rotate(360deg)"},"100%":{transform:"rotate(0deg)"}}}:{},s=f.jsx(r,{sx:{width:"24px",color:o?e.custom.red[600]:e.custom.grey[2e3],...i}}),a=f.jsx(ee,{padding:"12px 16px",textAlign:"center",children:f.jsx(pe,{variant:"body-medium",children:t?n.syncingMessage:o?n.errorDefaultMessage:n.savingDefaultMessage})});return f.jsx(Zc,{icon:s,body:a,size:"260px"})},wQ=()=>{const{confirmExit:e,selectedPageIndex:t,setPage:n,maxPage:o,forwardLock:r,previousLock:i,textOptions:s,onClose:a,onValidate:c,onPageChange:d,showSync:u,setFormSaved:p,openConfirmDialog:h,isLoading:g}=Zs(),m=Pe(),v=t===o-1&&s.finalPage?s.finalPage:s.nextPage,C=f.jsx(at,{variant:"primary",disabled:r.isLocked||g,endIcon:f.jsx(kx,{}),onClick:()=>{if(t===o-1){p(!0),c==null||c();return}return p(!1),d==null||d(t+1,t),n(t+1)},children:v}),y=f.jsxs(ee,{padding:"12px 16px",children:[f.jsx(pe,{variant:"body-bold",children:s.warningText?s.warningText:""}),f.jsx("br",{}),f.jsx(pe,{variant:"body",children:r.isLocked&&r.message||""})]});return f.jsxs(ye,{direction:"row",alignItems:"center",justifyContent:"end",gap:"28px",children:[f.jsx(ee,{sx:{">*":{display:"flex"}},children:u&&f.jsx(yQ,{})}),f.jsxs(ye,{direction:"row",gap:"20px",children:[s.previousPage&&f.jsx(at,{sx:{minWidth:"90px"},variant:"text",disabled:i.isLocked||g,startIcon:i.isLocked||g?null:f.jsx(Ox,{}),onClick:()=>{if(p(!1),t===0){d==null||d(t,t);return}return d==null||d(t-1,t),n(t-1)},children:s.previousPage}),r.isLocked?v&&f.jsx(Zc,{icon:C,body:y,size:"260px",leftPosition:130}):v&&C]}),a&&f.jsx(at,{variant:"white-filled",onClick:e?h:a,sx:{minWidth:0,aspectRatio:1,borderRadius:"100%",padding:0,"&:hover":{background:m.custom.grey[400]},"&:active":{background:m.custom.grey[600]}},children:f.jsx(R9,{sx:{width:"20px",color:m.custom.grey[2800]}})})]})},SQ=()=>f.jsxs(ee,{sx:{zIndex:1e3,minHeight:"96px",position:"sticky",top:"28px",border:"1px solid #E7E6E4",borderRadius:"52px",backgroundColor:"#FFFFFF",padding:"20px 28px",display:"grid",gridTemplateColumns:"1fr 50% 1fr",gridTemplateRows:"1fr",alignItems:"center"},children:[f.jsx(ee,{sx:{gridColumn:"1 / 3",gridRow:" 1 / 1",display:"flex",justifyContent:"left"},children:f.jsx(xQ,{})}),f.jsx(ee,{sx:{gridColumn:"2 / 3",gridRow:" 1 / 1",display:"flex",justifyContent:"center"},children:f.jsx(CQ,{})}),f.jsx(ee,{sx:{gridColumn:"3 / 3",gridRow:" 1 / 1",display:"flex",justifyContent:"right"},children:f.jsx(wQ,{})})]}),MQ=()=>{const{selectedPage:e,selectedPageIndex:t,isLoading:n}=Zs(),o=e.icon??t+1,r=e.title,i=e.subtitle;return n?f.jsx(TQ,{}):f.jsx(ye,{direction:"column",alignItems:"center",children:f.jsxs("div",{style:{width:"1024px"},children:[f.jsxs(ye,{direction:"column",marginTop:"44px",marginBottom:"36px",gap:"2rem",children:[r&&f.jsx(Ch,{title:r,badge:o}),i&&f.jsxs(f.Fragment,{children:[f.jsx(pe,{variant:"h4",children:i}),f.jsx(zn,{})]})]}),e.content]})})},TQ=()=>f.jsx(ee,{sx:{marginLeft:"auto",marginRight:"auto",width:"fit-content",marginTop:"5%",marginBottom:"5%"},children:f.jsx(qa,{})}),kQ=e=>{const t=Pe(),{onClose:n,open:o,confirmOptions:r}=e,i=()=>{r.onConfirm(),n()},s=()=>{r.onCancel(),n()};return f.jsxs(Ec,{fullWidth:!0,maxWidth:"xs",open:o,onClose:n,sx:{".MuiPaper-rounded":{borderRadius:"12px"}},children:[f.jsxs(gu,{sx:{borderBottom:`1px solid ${t.custom.grey[500]}`},children:[f.jsxs(ee,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",minHeight:"68px"},children:[f.jsx(pe,{variant:"h3",children:r.titleText}),f.jsx(at,{variant:"text",endIcon:f.jsx(Fu,{}),onClick:n})]}),(r==null?void 0:r.infoText)&&f.jsx(pe,{sx:{marginBlock:1.5},children:r.infoText})]}),f.jsxs(ye,{flexDirection:"column",alignItems:"center",p:3,gap:"1rem",children:[f.jsx(at,{variant:"primary",onClick:i,children:r.confirmText}),f.jsx(at,{onClick:s,children:r.cancelText})]})]})},OQ=()=>{const{confirmExit:e,formSaved:t}=Zs(),n=o=>{o.preventDefault()};return $.useEffect(()=>{if(e)return window.removeEventListener("beforeunload",n),t===!1&&window.addEventListener("beforeunload",n),()=>{window.removeEventListener("beforeunload",n)}},[t,e]),f.jsxs(f.Fragment,{children:[f.jsx(SQ,{}),f.jsx(MQ,{})]})},PQ=e=>{const[t,n]=$.useState(!1);return f.jsxs(_x,{...e,openConfirmDialog:()=>n(!0),children:[f.jsx(OQ,{}),e.confirmExit&&f.jsx(kQ,{open:t,onClose:()=>n(!1),confirmOptions:e.confirmOptions})]})};/**
374
+ `)):Array.isArray(n)?e.push.apply(e,n):Pt(e)||t.unshift(""+n);return t},textSize:function(e,t,n){var o=[].concat(t),r=o.length,i=e.font,s=0,a;for(e.font=n.string,a=0;a<r;++a)s=Math.max(e.measureText(o[a]).width,s);return e.font=i,{height:r*n.lineHeight,width:s}},bound:function(e,t,n){return Math.max(e,Math.min(t,n))},arrayDiff:function(e,t){var n=e.slice(),o=[],r,i,s,a;for(r=0,s=t.length;r<s;++r)a=t[r],i=n.indexOf(a),i===-1?o.push([a,1]):n.splice(i,1);for(r=0,s=n.length;r<s;++r)o.push([n[r],-1]);return o},rasterize:function(e){return Math.round(e*sx)/sx}};function mh(e,t){var n=t.x,o=t.y;if(n===null)return{x:0,y:-1};if(o===null)return{x:1,y:0};var r=e.x-n,i=e.y-o,s=Math.sqrt(r*r+i*i);return{x:s?r/s:0,y:s?i/s:-1}}function BX(e,t,n,o,r){switch(r){case"center":n=o=0;break;case"bottom":n=0,o=1;break;case"right":n=1,o=0;break;case"left":n=-1,o=0;break;case"top":n=0,o=-1;break;case"start":n=-n,o=-o;break;case"end":break;default:r*=Math.PI/180,n=Math.cos(r),o=Math.sin(r);break}return{x:e,y:t,vx:n,vy:o}}var zX=0,ax=1,lx=2,cx=4,dx=8;function O0(e,t,n){var o=zX;return e<n.left?o|=ax:e>n.right&&(o|=lx),t<n.top?o|=dx:t>n.bottom&&(o|=cx),o}function WX(e,t){for(var n=e.x0,o=e.y0,r=e.x1,i=e.y1,s=O0(n,o,t),a=O0(r,i,t),c,d,u;!(!(s|a)||s&a);)c=s||a,c&dx?(d=n+(r-n)*(t.top-o)/(i-o),u=t.top):c&cx?(d=n+(r-n)*(t.bottom-o)/(i-o),u=t.bottom):c&lx?(u=o+(i-o)*(t.right-n)/(r-n),d=t.right):c&ax&&(u=o+(i-o)*(t.left-n)/(r-n),d=t.left),c===s?(n=d,o=u,s=O0(n,o,t)):(r=d,i=u,a=O0(r,i,t));return{x0:n,x1:r,y0:o,y1:i}}function P0(e,t){var n=t.anchor,o=e,r,i;return t.clamp&&(o=WX(o,t.area)),n==="start"?(r=o.x0,i=o.y0):n==="end"?(r=o.x1,i=o.y1):(r=(o.x0+o.x1)/2,i=(o.y0+o.y1)/2),BX(r,i,e.vx,e.vy,t.align)}var E0={arc:function(e,t){var n=(e.startAngle+e.endAngle)/2,o=Math.cos(n),r=Math.sin(n),i=e.innerRadius,s=e.outerRadius;return P0({x0:e.x+o*i,y0:e.y+r*i,x1:e.x+o*s,y1:e.y+r*s,vx:o,vy:r},t)},point:function(e,t){var n=mh(e,t.origin),o=n.x*e.options.radius,r=n.y*e.options.radius;return P0({x0:e.x-o,y0:e.y-r,x1:e.x+o,y1:e.y+r,vx:n.x,vy:n.y},t)},bar:function(e,t){var n=mh(e,t.origin),o=e.x,r=e.y,i=0,s=0;return e.horizontal?(o=Math.min(e.x,e.base),i=Math.abs(e.base-e.x)):(r=Math.min(e.y,e.base),s=Math.abs(e.base-e.y)),P0({x0:o,y0:r+s,x1:o+i,y1:r,vx:n.x,vy:n.y},t)},fallback:function(e,t){var n=mh(e,t.origin);return P0({x0:e.x,y0:e.y,x1:e.x+(e.width||0),y1:e.y+(e.height||0),vx:n.x,vy:n.y},t)}},bi=y2.rasterize;function ZX(e){var t=e.borderWidth||0,n=e.padding,o=e.size.height,r=e.size.width,i=-r/2,s=-o/2;return{frame:{x:i-n.left-t,y:s-n.top-t,w:r+n.width+t*2,h:o+n.height+t*2},text:{x:i,y:s,w:r,h:o}}}function UX(e,t){var n=t.chart.getDatasetMeta(t.datasetIndex).vScale;if(!n)return null;if(n.xCenter!==void 0&&n.yCenter!==void 0)return{x:n.xCenter,y:n.yCenter};var o=n.getBasePixel();return e.horizontal?{x:o,y:null}:{x:null,y:o}}function qX(e){return e instanceof Bs?E0.arc:e instanceof f2?E0.point:e instanceof h2?E0.bar:E0.fallback}function GX(e,t,n,o,r,i){var s=Math.PI/2;if(i){var a=Math.min(i,r/2,o/2),c=t+a,d=n+a,u=t+o-a,p=n+r-a;e.moveTo(t,d),c<u&&d<p?(e.arc(c,d,a,-Math.PI,-s),e.arc(u,d,a,-s,0),e.arc(u,p,a,0,s),e.arc(c,p,a,s,Math.PI)):c<u?(e.moveTo(c,n),e.arc(u,d,a,-s,s),e.arc(c,d,a,s,Math.PI+s)):d<p?(e.arc(c,d,a,-Math.PI,0),e.arc(c,p,a,0,Math.PI)):e.arc(c,d,a,-Math.PI,Math.PI),e.closePath(),e.moveTo(t,n)}else e.rect(t,n,o,r)}function KX(e,t,n){var o=n.backgroundColor,r=n.borderColor,i=n.borderWidth;!o&&(!r||!i)||(e.beginPath(),GX(e,bi(t.x)+i/2,bi(t.y)+i/2,bi(t.w)-i,bi(t.h)-i,n.borderRadius),e.closePath(),o&&(e.fillStyle=o,e.fill()),r&&i&&(e.strokeStyle=r,e.lineWidth=i,e.lineJoin="miter",e.stroke()))}function YX(e,t,n){var o=n.lineHeight,r=e.w,i=e.x,s=e.y+o/2;return t==="center"?i+=r/2:(t==="end"||t==="right")&&(i+=r),{h:o,w:r,x:i,y:s}}function XX(e,t,n){var o=e.shadowBlur,r=n.stroked,i=bi(n.x),s=bi(n.y),a=bi(n.w);r&&e.strokeText(t,i,s,a),n.filled&&(o&&r&&(e.shadowBlur=0),e.fillText(t,i,s,a),o&&r&&(e.shadowBlur=o))}function JX(e,t,n,o){var r=o.textAlign,i=o.color,s=!!i,a=o.font,c=t.length,d=o.textStrokeColor,u=o.textStrokeWidth,p=d&&u,h;if(!(!c||!s&&!p))for(n=YX(n,r,a),e.font=a.string,e.textAlign=r,e.textBaseline="middle",e.shadowBlur=o.textShadowBlur,e.shadowColor=o.textShadowColor,s&&(e.fillStyle=i),p&&(e.lineJoin="round",e.lineWidth=u,e.strokeStyle=d),h=0,c=t.length;h<c;++h)XX(e,t[h],{stroked:p,filled:s,w:n.w,x:n.x,y:n.y+n.h*h})}var ux=function(e,t,n,o){var r=this;r._config=e,r._index=o,r._model=null,r._rects=null,r._ctx=t,r._el=n};Hr(ux.prototype,{_modelize:function(e,t,n,o){var r=this,i=r._index,s=Mn(an([n.font,{}],o,i)),a=an([n.color,un.color],o,i);return{align:an([n.align,"center"],o,i),anchor:an([n.anchor,"center"],o,i),area:o.chart.chartArea,backgroundColor:an([n.backgroundColor,null],o,i),borderColor:an([n.borderColor,null],o,i),borderRadius:an([n.borderRadius,0],o,i),borderWidth:an([n.borderWidth,0],o,i),clamp:an([n.clamp,!1],o,i),clip:an([n.clip,!1],o,i),color:a,display:e,font:s,lines:t,offset:an([n.offset,4],o,i),opacity:an([n.opacity,1],o,i),origin:UX(r._el,o),padding:Wn(an([n.padding,4],o,i)),positioner:qX(r._el),rotation:an([n.rotation,0],o,i)*(Math.PI/180),size:y2.textSize(r._ctx,t,s),textAlign:an([n.textAlign,"start"],o,i),textShadowBlur:an([n.textShadowBlur,0],o,i),textShadowColor:an([n.textShadowColor,a],o,i),textStrokeColor:an([n.textStrokeColor,a],o,i),textStrokeWidth:an([n.textStrokeWidth,0],o,i)}},update:function(e){var t=this,n=null,o=null,r=t._index,i=t._config,s,a,c,d=an([i.display,!0],e,r);d&&(s=e.dataset.data[r],a=mt(Jt(i.formatter,[s,e]),s),c=Pt(a)?[]:y2.toTextLines(a),c.length&&(n=t._modelize(d,c,i,e),o=ZX(n))),t._model=n,t._rects=o},geometry:function(){return this._rects?this._rects.frame:{}},rotation:function(){return this._model?this._model.rotation:0},visible:function(){return this._model&&this._model.opacity},model:function(){return this._model},draw:function(e,t){var n=this,o=e.ctx,r=n._model,i=n._rects,s;this.visible()&&(o.save(),r.clip&&(s=r.area,o.beginPath(),o.rect(s.left,s.top,s.right-s.left,s.bottom-s.top),o.clip()),o.globalAlpha=y2.bound(0,r.opacity,1),o.translate(bi(t.x),bi(t.y)),o.rotate(r.rotation),KX(o,i.frame,r),JX(o,r.lines,i.text,r),o.restore())}});var QX=Number.MIN_SAFE_INTEGER||-9007199254740991,eJ=Number.MAX_SAFE_INTEGER||9007199254740991;function w2(e,t,n){var o=Math.cos(n),r=Math.sin(n),i=t.x,s=t.y;return{x:i+o*(e.x-i)-r*(e.y-s),y:s+r*(e.x-i)+o*(e.y-s)}}function px(e,t){var n=eJ,o=QX,r=t.origin,i,s,a,c,d;for(i=0;i<e.length;++i)s=e[i],a=s.x-r.x,c=s.y-r.y,d=t.vx*a+t.vy*c,n=Math.min(n,d),o=Math.max(o,d);return{min:n,max:o}}function _0(e,t){var n=t.x-e.x,o=t.y-e.y,r=Math.sqrt(n*n+o*o);return{vx:(t.x-e.x)/r,vy:(t.y-e.y)/r,origin:e,ln:r}}var fx=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};Hr(fx.prototype,{center:function(){var e=this._rect;return{x:e.x+e.w/2,y:e.y+e.h/2}},update:function(e,t,n){this._rotation=n,this._rect={x:t.x+e.x,y:t.y+e.y,w:t.w,h:t.h}},contains:function(e){var t=this,n=1,o=t._rect;return e=w2(e,t.center(),-t._rotation),!(e.x<o.x-n||e.y<o.y-n||e.x>o.x+o.w+n*2||e.y>o.y+o.h+n*2)},intersects:function(e){var t=this._points(),n=e._points(),o=[_0(t[0],t[1]),_0(t[0],t[3])],r,i,s;for(this._rotation!==e._rotation&&o.push(_0(n[0],n[1]),_0(n[0],n[3])),r=0;r<o.length;++r)if(i=px(t,o[r]),s=px(n,o[r]),i.max<s.min||s.max<i.min)return!1;return!0},_points:function(){var e=this,t=e._rect,n=e._rotation,o=e.center();return[w2({x:t.x,y:t.y},o,n),w2({x:t.x+t.w,y:t.y},o,n),w2({x:t.x+t.w,y:t.y+t.h},o,n),w2({x:t.x,y:t.y+t.h},o,n)]}});function hx(e,t,n){var o=t.positioner(e,t),r=o.vx,i=o.vy;if(!r&&!i)return{x:o.x,y:o.y};var s=n.w,a=n.h,c=t.rotation,d=Math.abs(s/2*Math.cos(c))+Math.abs(a/2*Math.sin(c)),u=Math.abs(s/2*Math.sin(c))+Math.abs(a/2*Math.cos(c)),p=1/Math.max(Math.abs(r),Math.abs(i));return d*=r*p,u*=i*p,d+=t.offset*r,u+=t.offset*i,{x:o.x+d,y:o.y+u}}function tJ(e,t){var n,o,r,i;for(n=e.length-1;n>=0;--n)for(r=e[n].$layout,o=n-1;o>=0&&r._visible;--o)i=e[o].$layout,i._visible&&r._box.intersects(i._box)&&t(r,i);return e}function nJ(e){var t,n,o,r,i,s,a;for(t=0,n=e.length;t<n;++t)o=e[t],r=o.$layout,r._visible&&(a=new Proxy(o._el,{get:(c,d)=>c.getProps([d],!0)[d]}),i=o.geometry(),s=hx(a,o.model(),i),r._box.update(s,i,o.rotation()));return tJ(e,function(c,d){var u=c._hidable,p=d._hidable;u&&p||p?d._visible=!1:u&&(c._visible=!1)})}var S2={prepare:function(e){var t=[],n,o,r,i,s;for(n=0,r=e.length;n<r;++n)for(o=0,i=e[n].length;o<i;++o)s=e[n][o],t.push(s),s.$layout={_box:new fx,_hidable:!1,_visible:!0,_set:n,_idx:s._index};return t.sort(function(a,c){var d=a.$layout,u=c.$layout;return d._idx===u._idx?u._set-d._set:u._idx-d._idx}),this.update(t),t},update:function(e){var t=!1,n,o,r,i,s;for(n=0,o=e.length;n<o;++n)r=e[n],i=r.model(),s=r.$layout,s._hidable=i&&i.display==="auto",s._visible=r.visible(),t|=s._hidable;t&&nJ(e)},lookup:function(e,t){var n,o;for(n=e.length-1;n>=0;--n)if(o=e[n].$layout,o&&o._visible&&o._box.contains(t))return e[n];return null},draw:function(e,t){var n,o,r,i,s,a;for(n=0,o=t.length;n<o;++n)r=t[n],i=r.$layout,i._visible&&(s=r.geometry(),a=hx(r._el,r.model(),s),i._box.update(a,s,r.rotation()),r.draw(e,a))}},oJ=function(e){if(Pt(e))return null;var t=e,n,o,r;if(Rt(e))if(!Pt(e.label))t=e.label;else if(!Pt(e.r))t=e.r;else for(t="",n=Object.keys(e),r=0,o=n.length;r<o;++r)t+=(r!==0?", ":"")+n[r]+": "+e[n[r]];return""+t},rJ={align:"center",anchor:"center",backgroundColor:null,borderColor:null,borderRadius:0,borderWidth:0,clamp:!1,clip:!1,color:void 0,display:!0,font:{family:void 0,lineHeight:1.2,size:void 0,style:void 0,weight:null},formatter:oJ,labels:void 0,listeners:{},offset:4,opacity:1,padding:{top:4,right:4,bottom:4,left:4},rotation:0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,textShadowBlur:0,textShadowColor:void 0},To="$datalabels",gx="$default";function iJ(e,t){var n=e.datalabels,o={},r=[],i,s;return n===!1?null:(n===!0&&(n={}),t=Hr({},[t,n]),i=t.labels||{},s=Object.keys(i),delete t.labels,s.length?s.forEach(function(a){i[a]&&r.push(Hr({},[t,i[a],{_key:a}]))}):r.push(t),o=r.reduce(function(a,c){return Ut(c.listeners||{},function(d,u){a[u]=a[u]||{},a[u][c._key||gx]=d}),delete c.listeners,a},{}),{labels:r,listeners:o})}function bh(e,t,n,o){if(t){var r=n.$context,i=n.$groups,s;t[i._set]&&(s=t[i._set][i._key],s&&Jt(s,[r,o])===!0&&(e[To]._dirty=!0,n.update(r)))}}function sJ(e,t,n,o,r){var i,s;!n&&!o||(n?o?n!==o&&(s=i=!0):s=!0:i=!0,s&&bh(e,t.leave,n,r),i&&bh(e,t.enter,o,r))}function aJ(e,t){var n=e[To],o=n._listeners,r,i;if(!(!o.enter&&!o.leave)){if(t.type==="mousemove")i=S2.lookup(n._labels,t);else if(t.type!=="mouseout")return;r=n._hovered,n._hovered=i,sJ(e,o,r,i,t)}}function lJ(e,t){var n=e[To],o=n._listeners.click,r=o&&S2.lookup(n._labels,t);r&&bh(e,o,r,t)}var cJ={id:"datalabels",defaults:rJ,beforeInit:function(e){e[To]={_actives:[]}},beforeUpdate:function(e){var t=e[To];t._listened=!1,t._listeners={},t._datasets=[],t._labels=[]},afterDatasetUpdate:function(e,t,n){var o=t.index,r=e[To],i=r._datasets[o]=[],s=e.isDatasetVisible(o),a=e.data.datasets[o],c=iJ(a,n),d=t.meta.data||[],u=e.ctx,p,h,g,m,b,v,C,y;for(u.save(),p=0,g=d.length;p<g;++p)if(C=d[p],C[To]=[],s&&C&&e.getDataVisibility(p)&&!C.skip)for(h=0,m=c.labels.length;h<m;++h)b=c.labels[h],v=b._key,y=new ux(b,u,C,p),y.$groups={_set:o,_key:v||gx},y.$context={active:!1,chart:e,dataIndex:p,dataset:a,datasetIndex:o},y.update(y.$context),C[To].push(y),i.push(y);u.restore(),Hr(r._listeners,c.listeners,{merger:function(S,T,w){T[S]=T[S]||{},T[S][t.index]=w[S],r._listened=!0}})},afterUpdate:function(e){e[To]._labels=S2.prepare(e[To]._datasets)},afterDatasetsDraw:function(e){S2.draw(e,e[To]._labels)},beforeEvent:function(e,t){if(e[To]._listened){var n=t.event;switch(n.type){case"mousemove":case"mouseout":aJ(e,n);break;case"click":lJ(e,n);break}}},afterEvent:function(e){var t=e[To],n=t._actives,o=t._actives=e.getActiveElements(),r=y2.arrayDiff(n,o),i,s,a,c,d,u,p;for(i=0,s=r.length;i<s;++i)if(d=r[i],d[1])for(p=d[0].element[To]||[],a=0,c=p.length;a<c;++a)u=p[a],u.$context.active=d[1]===1,u.update(u.$context);(t._dirty||r.length)&&(S2.update(t._labels),e.render()),delete t._dirty}};const dJ=e=>{const{values:t,color:n,theme:o,updateCurrentSelectedPoint:r,...i}=e;return{...i,data:uJ(t,n),options:pJ(o,r),plugins:[hJ]}},uJ=(e,t)=>({datasets:[{data:e,backgroundColor:t,pointStyle:"circle",pointRadius:8,pointHoverRadius:9}],labels:Array.from(e.map(n=>n.label))}),pJ=(e,t)=>({plugins:{datalabels:{color:"#403d58",formatter:function(o){return o.label},align:"right",padding:{left:25},font:{weight:600,size:12,family:e.typography.fontFamily}},legend:{display:!1,usePointStyle:!0},tooltip:{enabled:!1,external:fJ}},scales:{x:{beginAtZero:!0,grace:"15%",linear:!0,border:{dash:[5,5]}},y:{beginAtZero:!0,linear:!0,grace:"20%",border:{dash:[5,5]}}},layout:{padding:{left:25,right:25,top:15,bottom:15}},onHover:(o,r)=>{if(o.type==="click"){if(r.length){t(r[0].index,o.x,o.y);return}t(null,null,null)}}}),mx={opacity:"0",position:"absolute",backgroundColor:"#393A36",color:"#fff",borderRadius:"4px",padding:"6px",pointerEvents:"none",textAlign:"center",fontSize:"10px",fontWeight:"600",minWidth:"30px"},fJ=e=>{const{chart:t,tooltip:n}=e;let o=document.getElementById("chartjs-tooltip-x");o||(o=document.createElement("div"),o.id="chartjs-tooltip-x",Object.assign(o.style,mx),document.body.appendChild(o));let r=document.getElementById("chartjs-tooltip-y");if(r||(r=document.createElement("div"),r.id="chartjs-tooltip-y",Object.assign(r.style,mx),document.body.appendChild(r)),n.opacity===0){o.style.opacity="0",r.style.opacity="0";return}if(n.dataPoints){const b=n.dataPoints[0],{x:v,y:C}=b.raw;o.textContent=`${v.toFixed(3)}`,r.textContent=`${C.toFixed(3)}`}const i=t.canvas.getBoundingClientRect(),s=t.scales.x,c=t.scales.y.bottom+i.top+window.scrollY,d=s.left+i.left+window.scrollX,u=i.left+window.scrollX+n.caretX-o.offsetWidth/2,p=c;o.style.left=`${u}px`,o.style.top=`${p}px`,o.style.opacity="1";const h=d-r.offsetWidth,g=i.top+window.scrollY+n.caretY-r.offsetHeight/2;r.style.left=`${h}px`,r.style.top=`${g}px`,r.style.opacity="1"},hJ={id:"crosshair",defaults:{width:1,color:"#000000",dash:[],tooltipBackground:"#f5f5f5",tooltipTextColor:"#000000",tooltipFontSize:10,tooltipPadding:6,tooltipRadius:4},afterInit:e=>{e.crosshair={x:0,y:0,draw:!1,xValue:null,yValue:null}},afterEvent:(e,t)=>{const{inChartArea:n}=t,o=e.getElementsAtEventForMode(t.event,"nearest",{intersect:!0},!1);if(o.length){const r=o[0].index,i=e.data.datasets[0].data[r],{x:s,y:a}=o[0].element;e.crosshair={x:s,y:a,draw:n,xValue:i.x,yValue:i.y}}else e.crosshair.draw=!1;e.draw()},beforeDatasetsDraw:e=>{var d,u,p,h,g,m,b,v;const{ctx:t,crosshair:n}=e;if(!n)return;const{bottom:o,left:r}=e.chartArea,{x:i,y:s,draw:a}=n;if(!a)return;t.save(),t.beginPath(),t.lineWidth=((u=(d=e.options.plugins)==null?void 0:d.crosshair)==null?void 0:u.width)??1,t.strokeStyle=((h=(p=e.options.plugins)==null?void 0:p.crosshair)==null?void 0:h.color)??"#000000";const c=((m=(g=e.options.plugins)==null?void 0:g.crosshair)==null?void 0:m.dash)??[];t.setLineDash(c.filter(C=>C!==void 0)),t.moveTo(i,s),t.lineTo(i,o),t.moveTo(r,s),t.lineTo(i,s),t.stroke(),t.font=`${((v=(b=e.options.plugins)==null?void 0:b.crosshair)==null?void 0:v.tooltipFontSize)??10}px ${t.font.split(" ").slice(-1)}`,t.textAlign="center",t.textBaseline="middle",t.restore()}};p2.register(...NK,cJ);const gJ=e=>{const t=(i,s,a)=>{var u;if(i===null||!((u=e.values)!=null&&u[i])||s===null||a===null){e.onPointSelection(null);return}const d={point:e.values[i],absoluteCoordinate:{x:s,y:a}};e.onPointSelection(d)},n="#F6A500",o=Pe(),r=dJ({...e,color:o.palette.primary[500]??n,theme:o,updateCurrentSelectedPoint:t});return f.jsxs(ee,{sx:{backgroundColor:o.custom.grey[200],borderRadius:"8px",border:`1px solid ${o.custom.grey[500]}`,padding:"12px"},children:[e.y,f.jsx(ZK,{...r}),f.jsx(ee,{sx:{width:"100%",display:"flex",justifyContent:"flex-end"},children:e.x})]})},bx=e=>{var T;const{chart:t,datasetIndex:n,dataIndex:o,evolution:r,reverse:i,positiveArrowIcon:s,negativeArrowIcon:a,positiveColor:c,negativeColor:d}=e,u=$.useRef(),[p,h]=$.useState([0,0,0]);if($.useEffect(()=>{!u.current||!t||n===void 0||h([u.current.offsetWidth,u.current.offsetHeight])},[t,o,n]),!t||n===void 0)return null;const g=t.canvas.getBoundingClientRect(),m=g.top+window.scrollY+t.getDatasetMeta(n).data[o].y-p[1]-10,b=g.left+window.scrollX+t.getDatasetMeta(n).data[o].x-p[0]/2;console.log(t.canvas.getBoundingClientRect().top,window.scrollY);const v=Math.sign(r??0),C=v===-1?i?c:d:i?d:c,y=v===-1?i?c:d:i?d:c,S=v===-1?a:s;return _o.createPortal(f.jsx(ee,{ref:u,position:"absolute",top:m+"px",left:b+"px",children:f.jsx(ur,{sx:bJ,children:f.jsxs(ye,{direction:"row",paddingX:1,paddingY:.5,display:"flex",gap:1,children:[f.jsx(pe,{fontWeight:700,fontSize:"10px",lineHeight:"16px",children:(T=t.data.datasets[n].data[o])==null?void 0:T.toString()}),f.jsx(mJ,{evolution:r,color:C,backgroundColor:y,icon:S})]})})}),document.body)},mJ=e=>{const{evolution:t,color:n,backgroundColor:o,icon:r}=e;return t===void 0?null:f.jsxs(ye,{direction:"row",alignItems:"center",gap:.5,children:[f.jsx(ye,{color:n,width:"14px",height:"14px",border:`1px solid ${n}`,sx:{backgroundColor:o},borderRadius:"20px",alignItems:"center",p:.25,children:f.jsx(Xt,{icon:r,size:.2})}),f.jsxs(pe,{fontWeight:700,fontSize:"10px",lineHeight:"16px",color:n,children:[Math.round(t)," %"]})]})},bJ={minWidth:"35px",minHeight:"24px",overflow:"visible",borderRadius:"8xp",boxShadow:"0px 4px 20px 0px rgba(81, 78, 78, 0.12)","&::after":{boxShadow:"0px 4px 20px 0px rgba(81, 78, 78, 0.12)",content:'""',position:"absolute",left:0,right:0,margin:"-1px auto",width:0,height:0,borderTop:"7.5px solid white",borderLeft:"15px solid transparent",borderRight:"15px solid transparent"}},vJ=e=>e.data.datasets.forEach(t=>{t.type==="line"&&(t.hidden=!0)}),CJ=(e,t,n=!1)=>{if(t===null)return;const o=e.data.datasets.filter(i=>i.type==="bar").length,r=n?t+o*2:t;e.data.datasets[r-o*2].hidden=!1,e.data.datasets[r-o].hidden=!1,e.update()},xJ=e=>{const t=e.data.datasets.filter(n=>n.type==="bar").length??0;e.data.datasets.forEach((n,o)=>{n.type==="bar"&&(n.backgroundColor=Ws[o%t])})},yJ=(e,t,n="66")=>{const o=e.data.datasets.filter(r=>r.type==="bar").length??0;e.data.datasets.forEach((r,i)=>{r.type==="bar"&&(i===t?r.backgroundColor=Ws[i%o]:r.backgroundColor=Ws[i%o]+n)})},Ws=["#ff8025","#4dcdf0","#f98cc0","#2b59a4","#ffb400","#db3d53","#00a950","#58595b","#8549ba"],wJ=e=>{const{labels:t,icons:n,chart:o,handleOnMouseOver:r,legend:i,labelIndex:s}=e,a=o.data.datasets.findIndex(h=>h.type==="bar")??0,d=h=>{const g=h!==null?h+a:void 0;r(o,g)},u=t.map((h,g)=>g),p=Ws;return f.jsx(ye,{className:"doughnut-chart-legend-wrapper",children:f.jsx(ye,{display:"inline-flex",children:t.map((h,g)=>{const m=u&&u[g]!==void 0;return f.jsx(ye,{direction:"row",alignItems:"center",gap:"12px",paddingY:"8px",onMouseEnter:()=>{m&&d(g)},onMouseLeave:()=>d(null),sx:{backgroundColor:b=>s===g?b.custom.grey[300]:"",...g===0?{}:{borderTop:b=>`1px solid ${b.custom.grey[500]}`}},children:f.jsxs(ye,{direction:"row",alignItems:"center",gap:"12px",sx:{width:"100%"},children:[n&&f.jsx(ye,{sx:{backgroundColor:b=>m?p[g]:b.custom.grey[400],color:"white"},p:.5,borderRadius:"4px",children:f.jsx(Xt,{icon:n[g]??"default",size:3.5})}),!n&&f.jsx(ee,{minWidth:"10px",height:"10px",bgcolor:b=>m?p[g]:b.custom.grey[400]}),f.jsx(pe,{variant:"h5",className:"doughnut-chart-legend-item-label",children:h}),(i==null?void 0:i.actions)&&(i==null?void 0:i.seeMore)&&(i==null?void 0:i.actions[g])&&f.jsx(hh,{action:i==null?void 0:i.actions[g],seeMore:i==null?void 0:i.seeMore})]})},g)})})})},SJ={id:"lineReposition",beforeDatasetsDraw(e,t,n){const{ctx:o,data:r,scales:{x:i}}=e;o.save();const s=e.getDatasetMeta(r.datasets.length-1).data[0].width,a=e.data.datasets.filter(d=>d.type==="bar").length,c=r.datasets.findIndex(d=>d.type==="bar");r.datasets.forEach((d,u)=>{if(d.type==="line"&&d.kind==="top"){const p=u+c-a;i.ticks.forEach((h,g)=>{const m=s/2,b=g%2===0?m:-m;e.getDatasetMeta(u).data[g].x=i.getPixelForValue(i.ticks[g].value)+b;const v=e.getDatasetMeta(p).data[g%2].y,{height:C}=e.getDatasetMeta(p).data[g%2].getProps(["height"]);e.getDatasetMeta(u).data[g].y=v+C})}d.type==="line"&&d.kind==="bottom"&&i.ticks.forEach((p,h)=>{const g=u+c,m=s/2,b=h%2===0?m:-m;e.getDatasetMeta(u).data[h].x=i.getPixelForValue(i.ticks[h].value)+b,e.getDatasetMeta(u).data[h].y=e.getDatasetMeta(g).data[h%2].y})})}},MJ=()=>{const e=$.useRef(),[t,n]=$.useState(!1);return $.useEffect(()=>{e.current&&n(!0)},[]),$.useEffect(()=>{if(!e.current)return;const o=()=>e.current.resize();return window.addEventListener("resize",o),()=>{window.removeEventListener("resize",o)}},[]),{ref:e,chartReady:t}},TJ=()=>{const[e,t]=$.useState(),[n,o]=$.useState(0);return{datasetIndex:e,evolution:n,highlightDataset:(i,s)=>{if(vJ(i),s===void 0){t(void 0),xJ(i);return}t(s);const a=i.data.datasets[s],c=(a.data[a.data.length-1]-a.data[0])/a.data[0]*100;o(c),yJ(i,s),CJ(i,s)}}},kJ=(e,t)=>{const{ref:n,chartReady:o}=MJ(),{datasetIndex:r,evolution:i,highlightDataset:s}=TJ(),a=$.useMemo(()=>[...t.map((p,h)=>({...p,type:"line",backgroundColor:Ws[h]+"66",label:`line - 1${h}`,hidden:!0,fill:"+3",kind:"bottom"})),...t.map((p,h)=>({...p,type:"line",backgroundColor:Ws[h]+"66",label:`line - 0${h}`,hidden:!0,kind:"top"})),...t.map((p,h)=>({...p,type:"bar",backgroundColor:Ws[h],barPercentage:.4,categoryPercentage:.9,stack:""}))],[t]);return{data:{labels:e,datasets:a},type:"line",ref:n,options:{animation:!1,responsive:!0,plugins:{legend:{display:!1},filler:{propagate:!1},datalabels:{display:!1},tooltip:{enabled:!1,external:()=>{}}},scales:{x:{grid:{display:!1}}}},plugins:[SJ],highlightDataset:s,chartReady:o,evolution:i,datasetIndex:r,labelIndex:r!==void 0?r%t.length:void 0}},OJ=e=>{const t=Pe(),{values:n,labels:o,icons:r,positiveArrowIcon:i="arrowUpRight",negativeArrowIcon:s="arrowDownRight",reverse:a=!1,positiveColor:c=t.custom.green[500],negativeColor:d=t.custom.red[500],legend:u}=e,p={positiveArrowIcon:i,negativeArrowIcon:s},h={positiveColor:c,negativeColor:d},{chartReady:g,data:m,datasetIndex:b,labelIndex:v,highlightDataset:C,evolution:y,options:S,plugins:T,ref:w,type:k}=kJ(o,n),O=E=>{var I;if(!w.current)return;const P=w.current,_=BK(P,E),R=(I=_==null?void 0:_[0])==null?void 0:I.datasetIndex;C(P,R)};return f.jsxs(ye,{position:"relative",direction:(u==null?void 0:u.position)==="bottom"?"column":"row",flexWrap:"wrap",sx:{backgroundColor:"white"},gap:6,children:[f.jsx(ee,{flex:2,width:"100%",height:"100%",children:f.jsx(Uf,{ref:w,type:k,data:m,options:S,plugins:T,onMouseMove:O})}),f.jsx(ee,{flex:1,flexBasis:"300px",width:"100%",children:g&&f.jsx(wJ,{labels:n.map(({label:E})=>E),icons:r,handleOnMouseOver:C,chart:w.current,legend:u,labelIndex:v})}),f.jsx(bx,{...p,...h,reverse:a,chart:w.current,datasetIndex:b,dataIndex:0}),f.jsx(bx,{...p,...h,reverse:a,chart:w.current,datasetIndex:b,dataIndex:1,evolution:y})]})},PJ={id:"moveDataset",beforeDatasetsDraw(e,t,n){const{ctx:o,data:r,scales:{x:i}}=e;o.save(),r.datasets.forEach((s,a)=>{const c=s.xoffset;c!==void 0&&e.getDatasetMeta(a).data.forEach((d,u)=>{d.x=i.getPixelForValue(i.ticks[c+u].value)})})}},EJ=()=>{const e=$.useRef(),[t,n]=$.useState(!1);return $.useEffect(()=>{e.current&&n(!0)},[]),$.useEffect(()=>{if(!e.current)return;const o=()=>e.current.resize();return window.addEventListener("resize",o),()=>{window.removeEventListener("resize",o)}},[]),{ref:e,chartReady:t}},_J=(e,t,n,o,r)=>{const{chartReady:i,ref:s}=EJ(),a=Pe(),c=n.map(b=>b.label),d=n.map(b=>b.value),u=[e.label,t.label].concat(c).concat([o.label]),p=$.useMemo(()=>{const b=d.reduce((C,y)=>{const[,S]=C.slice(-1).pop();return[...C,[S,S+y]]},[[0,t.value]]);b.shift();const[[,v]]=b.slice(-1);return[{label:e.label,data:[[0,e.value]],backgroundColor:(r==null?void 0:r.reference)??a.custom.dataviz.colors[2].main,xoffset:0,barThickness:80},{label:t.label,data:[[0,t.value]],backgroundColor:(r==null?void 0:r.start)??a.custom.dataviz.colors[4].main,xoffset:1,barThickness:80},{label:"values",data:b,backgroundColor:C=>{const[y,S]=C.raw;return S-y<0?a.custom.dataviz.extra[14].main:a.custom.dataviz.colors[6].main},xoffset:2,barThickness:80},{label:"diff",data:[[0,o.overrideValues!==void 0?o.overrideValues:v]],backgroundColor:(r==null?void 0:r.target)??a.custom.dataviz.colors[4].main,xoffset:d.length+2,barThickness:80}]},[e,t,d,r,o]);return{type:"bar",ref:s,chartReady:i,data:{labels:u,datasets:p},options:{animation:!1,responsive:!0,scales:{y:{grace:"5%"}},plugins:{legend:{display:!1},datalabels:{align:"start",anchor(b){const{dataset:{data:v}}=b;return v[0][0]==0?"end":"start"},offset(b){const{dataset:{data:v}}=b;return v[0][0]==0?-20:0},formatter([b,v],C){return v-b}}}},plugins:[PJ]}},RJ=e=>{const{reference:t,start:n,values:o,target:r,colors:i}=e,{data:s,ref:a,type:c,options:d,plugins:u}=_J(t,n,o,r,i);return f.jsx(ye,{position:"relative",flexWrap:"wrap",sx:{backgroundColor:"white"},gap:6,children:f.jsx(ee,{flex:2,width:"100%",height:"100%",children:f.jsx(Uf,{ref:a,type:c,data:s,options:d,plugins:u})})})},vx=e=>x.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},x.createElement("rect",{x:1,y:1,width:18,height:18,rx:3,fill:"white"}),x.createElement("rect",{x:1,y:1,width:18,height:18,rx:3,stroke:"#D1CFCE",strokeWidth:2})),Cx=e=>x.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},x.createElement("rect",{width:20,height:20,rx:4,fill:"url(#paint0_linear_2034_7850)"}),x.createElement("path",{d:"M8.32244 13.9335L4.56689 10.178L5.36133 9.38351L8.32244 12.3446L14.628 6.03906L15.4224 6.83351L8.32244 13.9335Z",fill:"white"}),x.createElement("defs",null,x.createElement("linearGradient",{id:"paint0_linear_2034_7850",x1:7.58928,y1:755124e-13,x2:7.58928,y2:20,gradientUnits:"userSpaceOnUse"},x.createElement("stop",{stopColor:"#484945"}),x.createElement("stop",{offset:1,stopColor:"#2A2B27"})))),IJ=z(Vr)(()=>({":hover":{background:Ee[400]}})),LJ=e=>{const{values:t,...n}=e,{onChange:o,...r}=n,i=Object.entries(t);return f.jsx(kp,{children:i.map(([s,a],c)=>f.jsx(Ga,{control:f.jsx(IJ,{...r,checkedIcon:f.jsx(Cx,{}),icon:f.jsx(vx,{}),disableRipple:!0,onChange:(d,u)=>{const p={};p[s]={name:a.name,state:u},o(p)}}),sx:{gap:"1rem"},label:a.name,checked:a.state},`${s}-${c}`))})},jJ=(e,t,n)=>Object.entries(t).flatMap(r=>{const[i,s]=r;if(s.state===!1)return[];const a=Number(i),c=e.find(d=>d.id===a);return c?[c]:[n({id:a,name:s.name})]}),DJ=(e,t)=>{const n={};return e.reduce((r,i)=>{const s=t.some(a=>a.id===i.id);return r[i.id]={name:i.name,state:s},r},n)},VJ=z(Vr)(()=>({":hover":{background:Ee[400]}})),AJ=e=>{const{values:t,onChange:n,FormGroupProps:o,FormControlLabelProps:r,CheckboxProps:i}=e,s=Object.entries(t);return f.jsx(kp,{...o,children:s.map(([a,c],d)=>f.jsx(Ga,{sx:{gap:"1rem"},checked:c.state,...r,label:c.name,control:f.jsx(VJ,{checkedIcon:f.jsx(Cx,{}),icon:f.jsx(vx,{}),disableRipple:!0,...i,onChange:(u,p)=>{const h={...t};h[a]={...h[a],name:c.name,state:p},n(h)}})},`${a}-${d}`))})},xx=e=>{const{values:t,selectedItems:n,onChange:o,getId:r=d=>d.id,getName:i=d=>d.name,...s}=e,a=(n==null?void 0:n.map(d=>r(d)))??[],c=t.reduce((d,u)=>{const p=r(u),h=a.includes(p),g=n===void 0?!1:h;return d[p]={name:i(u),state:g,rawData:u},d},{});return f.jsx(AJ,{values:c,onChange:d=>{const u=Object.values(d).flatMap(p=>p.state===!1?[]:p.rawData);return o(u)},...s})},FJ=e=>{const{title:t,subtitle:n,description:o,imageUrl:r,callToAction:i,sxProps:s={}}=e,a=Pe();return f.jsxs(ee,{sx:{display:"flex",maxWidth:"1200px",border:`1px solid ${Ee[500]}`,background:a.palette.background.paper,borderRadius:"16px",overflow:"hidden",justifyContent:"space-between",gap:"3rem",...s},children:[f.jsxs(ee,{sx:{padding:"48px 0 48px 48px",display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[f.jsxs(ee,{children:[f.jsx(el,{defaultVariant:"h2",text:t}),n&&f.jsx(el,{defaultVariant:"h5",text:n,typographyProps:{color:a.custom.grey[2e3],lineHeight:"1.625rem"}}),o&&f.jsx(ee,{my:"1.5rem",children:o})]}),f.jsx(ee,{children:i&&f.jsx(Wc,{buttonOptions:i,defaultOptions:{sx:{display:"inline-flex",gap:"12px",padding:"24px"},variant:"primary",endIcon:f.jsx(Xt,{size:2,icon:"arrowRight"})}})})]}),r&&f.jsx(ee,{sx:{width:500,mb:"-8px"},children:f.jsx("img",{src:r,alt:"description",style:{width:"100%",height:"auto",minWidth:500}})})]})},NJ=z(ee)(()=>({position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0)",zIndex:1e3,transition:"background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1)",visibility:"hidden","&.open":{backgroundColor:"rgba(0, 0, 0, 0.5)",visibility:"visible"}})),HJ=z(ee)(({theme:e})=>({position:"fixed",top:0,right:0,bottom:0,width:"75%",backgroundColor:e.palette.background.paper,zIndex:1001,overflowY:"auto",transform:"translateX(100%)",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",opacity:0,borderRadius:`${e.spacing(1)} 0 0 ${e.spacing(1)}`,"&.open":{transform:"translateX(0)",opacity:1,visibility:"visible",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"}})),yx=z(ee)({width:"100%",height:"400px",backgroundColor:"#f0f0f0","& img":{width:"100%",height:"100%",objectFit:"cover",transition:"opacity 0.3s ease-in-out"}}),$J=z(jt)(({theme:e})=>({position:"fixed",top:e.spacing(2),right:e.spacing(2.5),zIndex:1002,backgroundColor:"white",visibility:"hidden",transform:"translateX(200%)",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)","&:hover":{backgroundColor:"rgba(255, 255, 255, 0.8)"},"&.open":{transform:"translateX(0)",opacity:1,visibility:"visible",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"}})),BJ=z(ye)({padding:"2rem 4rem"}),zJ=({isOpen:e,onClose:t,article:n})=>($.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset"}),[e]),f.jsxs(f.Fragment,{children:[f.jsx(NJ,{className:e?"open":"",onClick:t}),f.jsx($J,{className:e?"open":"",onClick:t,children:f.jsx(Xt,{size:2,icon:"close"})}),f.jsxs(HJ,{className:e?"open":"",children:[f.jsx($.Suspense,{fallback:f.jsx(yx,{}),children:f.jsx(yx,{children:f.jsx("img",{src:n.imageSrc,alt:n.title,loading:"lazy",onLoad:o=>{o.target.style.opacity="1"},style:{opacity:0}})})}),f.jsxs(BJ,{spacing:3,children:[f.jsx(pe,{variant:"h2",children:n.title}),f.jsx(pe,{variant:"body1",dangerouslySetInnerHTML:{__html:n.content}})]})]})]})),WJ=z(ye,{shouldForwardProp:e=>e!=="isFirst"})(({isFirst:e,theme:t})=>({border:`1px solid ${Ee[500]}`,borderRadius:t.spacing(1),overflow:"hidden",margin:0,padding:0,height:"100%",width:"100%",flexDirection:e?"column":"row"})),ZJ=z(ee)(()=>({flex:1,lineHeight:0,position:"relative","& img":{width:"100%",height:"100%",objectFit:"cover",display:"block"}})),UJ=z(ye)(({theme:e})=>({flex:1,backgroundColor:e.palette.background.paper,padding:e.spacing(4),justifyContent:"space-between",gap:e.spacing(1)})),qJ=z(m8)({display:"block",width:"100%",height:"100%",cursor:"pointer"}),GJ=z(at)(({theme:e})=>({display:"inline-flex",alignSelf:"flex-start",fontWeight:700,gap:e.spacing(1)})),KJ=z(pe,{shouldForwardProp:e=>e!=="isFirst"})(({isFirst:e})=>({display:"-webkit-box",WebkitLineClamp:e?5:3,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis"})),vh=e=>{const[t,n]=$.useState(!1),{title:o,description:r,imageSrc:i,content:s,onClick:a,isFirst:c=!1,readMoreText:d="Lire l'article"}=e,u=()=>{a?a():n(!0)};return f.jsxs(f.Fragment,{children:[f.jsxs(WJ,{isFirst:c,children:[f.jsx(ZJ,{children:f.jsx(qJ,{onClick:u,children:f.jsx("img",{src:i,alt:o})})}),f.jsxs(UJ,{children:[f.jsxs(ee,{children:[f.jsx(pe,{variant:"h3",mb:"0.2rem",children:o}),f.jsx(KJ,{variant:"body",mb:"1rem",isFirst:c,dangerouslySetInnerHTML:{__html:r}})]}),f.jsxs(GJ,{variant:"text",onClick:u,children:[f.jsx(pe,{fontWeight:700,fontSize:"0.875rem",children:d}),f.jsx(Xt,{size:2,icon:"arrowRight"})]})]})]}),!a&&f.jsx(zJ,{isOpen:t,onClose:()=>n(!1),article:{title:o,description:r,imageSrc:i,content:s||r}})]})},YJ=e=>{const{articles:t=[],sxProps:n={}}=e,[o,...r]=t;return f.jsxs(Ar,{container:!0,columns:2,sx:{...n,height:"100%"},spacing:4,children:[f.jsx(Ar,{item:!0,xs:1,children:f.jsx(vh,{...o,isFirst:!0})}),f.jsx(Ar,{item:!0,xs:1,children:f.jsx(E3,{gap:3,display:"flex",flexDirection:"column",justifyContent:"space-between",height:"100%",children:r.map((i,s)=>f.jsx(E3,{height:"100%",children:f.jsx(vh,{...i})},`article-${s}`))})})]})},XJ=e=>{const{title:t,children:n,objectives:o=[],tooltipMessage:r}=e,i=Pe();return f.jsxs(ye,{sx:{borderRadius:"12px",border:`1px solid ${i.palette.grey[500]}`,padding:"34px",maxWidth:"360px",background:i.palette.background.paper},children:[f.jsxs(ee,{display:"flex",children:[f.jsx(pe,{variant:"h3",component:"h3",mb:"1.5rem",children:t}),r&&f.jsx(Xt,{size:3,icon:"information"})]}),f.jsx(ee,{fontWeight:700,display:"flex",gap:"0.5rem",mb:"1rem",children:n}),f.jsx(ye,{sx:{"> div:not(:last-of-type)":{mb:"1rem"}},children:o.map((s,a)=>f.jsxs(ye,{flexDirection:"row",alignItems:"center",gap:".5rem",children:[f.jsx(pe,{variant:"small-medium",children:s.objective}),f.jsx(B9,{boxProps:{sx:{padding:"0.1rem 0.5rem"}},children:s.component})]},a))})]})},wx=z(({className:e,...t})=>f.jsx(Qt,{...t,arrow:!0,classes:{popper:e}}))(e=>({[`& .${xo.arrow}`]:{color:"#FFF"},[`& .${xo.tooltip}`]:{padding:"12px 16px 12px 16px",borderRadius:"8px",backgroundColor:"#FFF"}})),JJ=e=>{const{title:t,subtitle:n,description:o}=e,r=Pe();return f.jsxs(ye,{sx:{borderRadius:"12px",border:`1px solid ${r.palette.grey[500]}`,padding:"34px",maxWidth:"360px",background:r.palette.background.paper},children:[f.jsxs(ye,{flexDirection:"row",alignContent:"center",justifyContent:"space-between",children:[f.jsx(pe,{variant:"h3",component:"h3",mb:"1.5rem",children:t}),n&&f.jsx(QJ,{text:n})]}),f.jsx(ye,{children:f.jsx(pe,{variant:"body-medium",children:f.jsx(ee,{dangerouslySetInnerHTML:{__html:o}})})})]})};function QJ(e){const{text:t}=e;return f.jsx(wx,{title:f.jsx(pe,{variant:"body-medium",children:t}),placement:"right",children:f.jsx(ee,{children:f.jsx(Xt,{size:3,icon:"information"})})})}const eQ=e=>{const{value:t,maxLength:n,...o}=e,r=t.map((u,p)=>t.slice(0,p+1).reduce((h,g)=>{const m=h.length+g.length;if(m>n){const b=n-m,v=[...h.words,g.slice(0,b)].filter(Boolean);return{length:m,words:v,rest:t.length-v.length}}return{...h,length:m,words:[...h.words,g]}},{length:0,words:[],rest:0})),i=r[r.length-1],a=t[t.length-1].length===i.words[i.words.length-1].length?"":"…",c=i.words.join(", "),d=i.rest>0?`${c}… +${i.rest}`:c+a;return f.jsx(pe,{...o,children:d})},tQ=e=>{const{value:t,maxLength:n,separator:o=",",...r}=e;if(n===0)return f.jsx(pe,{...r,children:""});const i=t.join("").length;if(n>i)return f.jsx(pe,{...r,children:t.join(o)});let s=0;const a=t.reduce((C,y)=>{const S=s+y.length,T={low:s,high:S};return s=S,C.push(T),C},[]),c=a.findIndex(C=>C.low<n&&n<=C.high),d=c+1,u=a.length-d,h=a[c].high===n?"":"…",g=d*o.length,m=t.join(o).slice(0,n-1+g),b=u?`+${u}`:"",v=`${m}${h} ${b}`;return f.jsx(pe,{...r,children:v})},nQ=e=>{const{setOpen:t,options:n,onValidate:o,onCancel:r,canValidate:i=!0,confirmAction:s,cancelText:a,validateText:c,...d}=e,[u,p]=$.useState(!1),h=()=>t(!1),g=()=>{p(!1)},m=()=>{r&&r(),h()},b=()=>{if(!s){o&&o(),h();return}u?(p(!1),o&&o(),h()):p(!0)};return f.jsxs(Ec,{onClose:m,...d,fullWidth:!0,maxWidth:"md",scroll:"body",children:[f.jsxs(gu,{sx:Mx,children:[n.title,f.jsx(at,{variant:"text",endIcon:f.jsx(Fu,{}),onClick:m})]}),f.jsx(ee,{sx:{width:"100%"},children:n.content}),f.jsx(Sx,{onCancelAction:m,onConfirmAction:b,canValidate:i,cancelText:a,validateText:c}),s&&f.jsx(oQ,{openConfirmAction:u,onCancel:g,onValidate:b,confirmAction:s,cancelText:a,validateText:c})]})},oQ=e=>{const{confirmAction:t,onCancel:n,onValidate:o,openConfirmAction:r,cancelText:i,validateText:s}=e;return f.jsxs(Ec,{open:r,onClose:n,sx:{display:"flex",justifyContent:"space-between",alignItems:"center",borderBottom:`1px solid ${Ee[500]}`,minHeight:"68px",padding:"28px 27px 28px 32px"},children:[f.jsxs(gu,{sx:Mx,children:[t.title,f.jsx(at,{variant:"text",endIcon:f.jsx(Fu,{}),onClick:n})]}),f.jsx(ee,{sx:{padding:"32px",width:"100%"},children:t.content}),f.jsx(Sx,{onCancelAction:n,onConfirmAction:o,cancelText:t.cancelText??i,validateText:t.validateText??s})]})},Sx=e=>{const{onCancelAction:t,onConfirmAction:n,canValidate:o=!0,cancelText:r,validateText:i}=e;return f.jsxs(Tp,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",borderTop:`1px solid ${Ee[500]}`,minHeight:"68px",paddingInline:"1rem",padding:"28px 32px 32px 32px"},children:[f.jsx(at,{variant:"text",onClick:t,children:r}),f.jsx(at,{variant:"primary",onClick:n,disabled:!o,children:i})]})},Mx={display:"flex",justifyContent:"space-between",alignItems:"center",borderBottom:`1px solid ${Ee[500]}`,minHeight:"68px",padding:"28px 27px 28px 32px"},rQ=z(Mc)(({theme:e})=>({fontFamily:e.typography.fontFamily,...e.typography.body})),fl=$.forwardRef(function(e,t){const n=Pe(),{sx:o,error:r,...i}=e;return f.jsx(rQ,{...i,sx:{color:r?n.custom.red[600]:n.custom.grey[2800],border:r?`1px solid ${n.custom.red[600]}`:`1px solid ${n.custom.grey[1400]}`,backgroundColor:r?n.custom.red[100]:"inherit",borderRadius:"16px",paddingInline:"20px",...o}})}),iQ=e=>{const{title:t,unit:n,placeholder:o,value:r,description:i,error:s,required:a,...c}=e,d=a?"*":"",u=Pe(),p=$.useRef(!1),h=p.current&&s,[g,m]=$.useState(!1),[b,v]=$.useState(!1),[C,y]=$.useState(!1);$.useEffect(()=>{const O=S(T,e.setMinMaxError);m(O);const E=S(w,e.setMinError);v(E);const P=S(k,e.setMaxError);y(P)},[r]);const S=(O,E)=>{const P=O();return E!==void 0&&E(P),P},T=()=>{if(e.min===void 0&&e.max===void 0||r===void 0||r==="")return!1;const O=Number(r);return!(e.min!==void 0&&O>e.min&&e.max!==void 0&&O<e.max)},w=()=>e.min===void 0||r===void 0||r===""?!1:!(e.min<Number(r)&&e.max===void 0),k=()=>e.max===void 0||r===void 0||r===""?!1:!(e.max>Number(r)&&e.min===void 0);return f.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[f.jsx(pe,{variant:"h5",children:`${t}${d} :`}),f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"5px"},children:[f.jsx(fl,{...c,type:"number",style:{minWidth:"150px",width:"10%",borderColor:h?u.palette.error.main:"inherit",backgroundColor:h?u.palette.error.light:"inherit"},placeholder:o,value:r,onChange:O=>{p.current=!0,c.onChange&&c.onChange(O)}}),f.jsx(pe,{variant:"body",children:n})]}),(!!e.minMaxErrorMessage&&g||!!e.minErrorMessage&&b||!!e.maxErrorMessage&&C)&&f.jsxs(pe,{variant:"body",style:{color:u.custom.red[600]},children:[!!e.minMaxErrorMessage&&g&&e.minMaxErrorMessage,!!e.minErrorMessage&&b&&e.minErrorMessage,!!e.maxErrorMessage&&C&&e.maxErrorMessage]}),f.jsx(pe,{variant:"body",children:i})]})},sQ=e=>{const{unit:t,sx:n,...o}=e;return f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"1rem"},children:[f.jsx(fl,{type:"number",sx:{minWidth:"125px",width:"10%",...n},...o}),f.jsx(pe,{variant:"body",children:t})]})};function aQ(e){const t=Pe(),n={height:"40px",padding:"0px 6px 0px 20px",...t.custom.searchBox,minWidth:"350px"},o={height:"20px",padding:"0px",width:"100%","&>.MuiInputBase-root>fieldset":{border:"none"},"&>.MuiInputBase-root>input":{padding:"0"}},r={height:"48px",padding:"0px 16px 0px 24px",borderTop:"1px solid "+t.custom.grey[500],borderBottom:"1px solid "+t.custom.grey[500],background:t.custom.grey[200]},i={"&>.MuiInputBase-root>fieldset":{border:"none"},"&>.MuiInputBase-root>input":{width:"100%",height:"48px",padding:"0",border:"none"}};return f.jsxs(ye,{direction:"row",useFlexGap:!0,gap:"10px",justifyContent:"space-between",alignItems:"center",sx:e.variant==="standalone"?n:r,children:[f.jsx(ii,{label:"",type:"search",placeholder:e.placeholder,value:e.value,onChange:s=>{e.onChange(s.target.value)},sx:e.variant==="standalone"?o:i}),f.jsx(Iz,{})]})}const lQ=$.forwardRef(function(t,n){const{title:o,placeholder:r,value:i,description:s,sx:a,error:c,required:d,...u}=t,p=d?"*":"",h=Pe(),g=$.useRef(!1),m=g.current&&c;return f.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[f.jsx(pe,{variant:"h5",children:`${o}${p} :`}),f.jsx(fl,{...u,sx:{width:"70%",borderColor:m?h.custom.red[600]:"inherit",backgroundColor:m?h.custom.red[100]:"inherit",...a},placeholder:r,value:i,onChange:b=>{g.current=!0,u.onChange&&u.onChange(b)}}),f.jsx(pe,{variant:"body",children:s})]})});function cQ(e){return f.jsxs("div",{children:[f.jsx(pe,{variant:"body-bold",sx:{marginBottom:"16px"},children:e.header}),f.jsxs(ye,{direction:"column",useFlexGap:!0,gap:"12px",children:[f.jsxs(ye,{direction:"row",sx:{height:"20px"},useFlexGap:!0,gap:"12px",justifyContent:"flex-start",children:[f.jsx(Vr,{checked:!0,sx:{width:"20px",height:"20px"}}),f.jsx(pe,{variant:"body",children:e.allText})]}),e.values.map((t,n)=>f.jsxs(ye,{direction:"row",sx:{height:"20px"},useFlexGap:!0,gap:"12px",justifyContent:"flex-start",children:[f.jsx(Vr,{checked:!1,sx:{width:"20px",height:"20px"}}),f.jsx(pe,{variant:"body",children:t})]},n))]})]})}function dQ(e){return f.jsxs(ye,{direction:"column",useFlexGap:!0,gap:"12px",alignItems:"flex-start",children:[f.jsx(pe,{variant:"body-bold",children:e.header}),f.jsx(ye,{direction:"row",useFlexGap:!0,gap:"8px",flexWrap:"wrap",children:e.values.map((t,n)=>f.jsxs(ye,{direction:"row",useFlexGap:!0,gap:"4px",sx:{height:"28px",borderRadius:"4px",background:"#EFEDEC",paddingLeft:"8px"},alignItems:"center",children:[f.jsx(pe,{variant:"body",children:t}),f.jsx(jt,{sx:{width:"20px",height:"20px"},children:f.jsx(Kp,{sx:{width:"16px",height:"16px"}})})]},n))}),f.jsx(at,{variant:"text",startIcon:f.jsx(yz,{}),children:e.addText})]})}const Tx=e=>{const t=Pe(),{steps:n,currentStep:o=0,icons:r=[],clickable:i=!1,onClick:s}=e;return f.jsxs(ee,{display:"inline-flex",position:"relative",children:[f.jsx(ye,{direction:"row",gap:"12px",position:"relative",sx:{zIndex:1},children:[...Array(n??r.length).keys()].map(a=>{const c=a<=o;return f.jsx(Au,{size:"medium",border:`1px solid ${t.custom.grey[500]}`,color:c?"#FFF":t.custom.grey[2800],bgcolor:c?t.custom.grey[2800]:"#FFF",sx:{fill:c?"#FFF":t.custom.grey[2800],cursor:i?"pointer":"default","&:hover":i?{fill:"#FFF",color:"#FFF",bgcolor:t.custom.grey[c?2800:2e3]}:{}},onClick:()=>{i&&s&&s(a)},children:r&&r[a]?r[a]:a+1},a)})}),f.jsx(zn,{sx:{backgroundColor:t.custom.grey[500],position:"absolute",inset:`${36/2}px`}})]})},kx=e=>x.createElement("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},x.createElement("path",{d:"M11.021 7.69411H0.333496V6.30524H11.021L6.021 1.30522L7.00016 0.333008L13.6668 6.99967L7.00016 13.6663L6.021 12.6941L11.021 7.69411Z",fill:"white"})),Ox=e=>x.createElement("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},x.createElement("path",{d:"M2.97919 7.69411L7.97921 12.6941L7.00004 13.6663L0.333374 6.99967L7.00004 0.333008L7.97921 1.30522L2.97919 6.30524H13.6667V7.69411H2.97919Z",fill:"#B06803"})),Px=e=>{var t;return f.jsxs(ye,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{minHeight:"96px",zIndex:1e3,position:"sticky",top:"28px",border:"1px solid #E7E6E4",borderRadius:"52px",backgroundColor:"#FFFFFF",padding:"20px 28px"},children:[f.jsx(uQ,{title:e.title,subtitle:e.subtitle}),f.jsx(Tx,{icons:e.icons,steps:e.steps??((t=e.icons)==null?void 0:t.length)??0,currentStep:e.currentPage,clickable:e.navigable,onClick:e.onNavigate}),f.jsx(fQ,{onPageForward:e.onPageForward,onPageBack:e.onPageBack,nextPageText:e.nextPageText,previousPageText:e.previousPageText,currentPage:e.currentPage,validateSteps:e.validateSteps,validateStepsTexts:e.validateStepsTexts,warningText:e.warningText,savingState:e.savingState,closeable:e.closeable,onClose:e.onClose})]})},uQ=e=>{const t=Pe();return f.jsx(ye,{direction:"row",alignItems:"center",justifyContent:"start",marginX:"20px",maxWidth:"33%",children:f.jsxs(ye,{gap:"4px",children:[f.jsx(pe,{variant:"h3",children:e.title}),e.subtitle&&f.jsx(pe,{variant:"body",color:t.custom.grey[2e3],children:e.subtitle})]})})},pQ=e=>{const t=Pe(),n=e.saving?L9:I9,o=e.saving?{animation:"spin 1s linear infinite","@keyframes spin":{"0%":{transform:"rotate(360deg)"},"100%":{transform:"rotate(0deg)"}}}:{},r=f.jsx(n,{sx:{width:"24px",color:t.custom.grey[2e3],...o}}),i=f.jsx(ee,{padding:"12px 16px",textAlign:"center",children:f.jsx(pe,{variant:"body",children:e.saving?e.savingMessage:e.savedMessage})});return f.jsx(Zc,{icon:r,body:i,size:"260px"})},fQ=e=>{const t=Pe(),n=f.jsx(at,{variant:"primary",disabled:e.validateSteps&&!e.validateSteps[e.currentPage],endIcon:f.jsx(kx,{}),onClick:e.onPageForward,children:e.nextPageText}),o=f.jsxs(ee,{padding:"12px 16px",children:[f.jsx(pe,{variant:"body-bold",children:e.warningText||""}),f.jsx("br",{}),f.jsx(pe,{variant:"body",children:e.validateStepsTexts&&e.validateStepsTexts[e.currentPage]||""})]});return f.jsxs(ye,{direction:"row",alignItems:"center",justifyContent:"end",gap:"28px",children:[f.jsx(ee,{sx:{">*":{display:"flex"}},children:e.savingState&&f.jsx(pQ,{...e.savingState})}),f.jsxs(ye,{direction:"row",gap:"20px",children:[e.previousPageText&&f.jsx(at,{variant:"text",startIcon:f.jsx(Ox,{}),onClick:e.onPageBack,children:e.previousPageText}),e.validateSteps&&!e.validateSteps[e.currentPage]?e.nextPageText&&f.jsx(Zc,{icon:n,body:o,size:"260px"}):e.nextPageText&&n]}),e.closeable&&f.jsx(at,{variant:"white-filled",onClick:e.onClose,sx:{minWidth:0,aspectRatio:1,borderRadius:"100%",padding:0,"&:hover":{background:t.custom.grey[400]},"&:active":{background:t.custom.grey[600]}},children:f.jsx(R9,{sx:{width:"20px",color:t.custom.grey[2800]}})})]})},Ch=e=>{const t=Pe(),{title:n,titleSize:o,badge:r}=e,s=o||"h1";return f.jsxs(ye,{direction:"row",alignItems:"center",gap:"16px",children:[typeof r=="number"?f.jsx(Au,{size:"big",children:r}):f.jsx(ye,{width:"40px",alignItems:"center",color:t.custom.grey[2800],children:f.jsx(ye,{sx:{transform:"scale(250%)"},children:r})}),f.jsx(pe,{variant:s,children:n})]})},hQ=e=>{const{title:t,subtitle:n,pages:o,pageIndexToDisplay:r=0,savingState:i,closeable:s=!0}=e,a=o.map(u=>u.icon),c=o[r],d=(Array.isArray(c.content)?c.content:[c.content]).map((u,p)=>f.jsx($.Fragment,{children:u},p));return f.jsxs(f.Fragment,{children:[f.jsx(Px,{title:t,subtitle:n,icons:a,steps:o.length,currentPage:r,nextPageText:e.nextPageText,previousPageText:e.previousPageText,onPageForward:e.onPageForward,onPageBack:e.onPageBack,validateSteps:e.validateSteps,validateStepsTexts:e.validateStepsTexts,warningText:e.warningText,savingState:i,navigable:e.navigable,onNavigate:e.onNavigate,closeable:s,onClose:e.onClose}),f.jsx(ye,{direction:"column",alignItems:"center",children:f.jsxs("div",{style:{width:"1024px"},children:[f.jsxs(ye,{direction:"column",marginTop:"44px",marginBottom:"36px",gap:"2rem",children:[c.title&&f.jsx(Ch,{title:c.title,badge:c.icon??r+1}),c.subTitle&&f.jsx(pe,{variant:"h4",children:c.subTitle}),c.subTitle&&f.jsx(zn,{}),c.info]}),c.usesBaseLayout===!1?f.jsx(f.Fragment,{children:d}):f.jsx(gQ,{children:d})]})})]})},gQ=e=>{const{children:t}=e,n=Array.isArray(t)?t:[t];return f.jsx("div",{children:n.map((o,r)=>f.jsx($.Fragment,{children:o},r))})},mQ=({sx:e={},...t})=>f.jsx(ee,{sx:{boxShadow:"0px 2px 8px 0px #2A2B270A",border:`1px solid ${Ee[500]}`,borderRadius:"16px",backgroundColor:"#FFFFFF",padding:"2rem",height:"fit-content",...e},...t}),bQ=e=>{const{title:t,hint:n,indicator:o,children:r,...i}=e;return f.jsx(nr,{width:"100%",padding:"32px",...i,children:f.jsxs(ye,{gap:"32px",children:[f.jsxs(ye,{direction:"row",alignItems:"start",gap:"32px",children:[f.jsx(pe,{variant:"h4",flex:1,children:t}),o&&f.jsx(Vu,{value:o.value,unit:o.unit,sx:{top:"-12px",right:"-12px"}})]}),f.jsxs(ye,{gap:"24px",children:[r,n&&f.jsx(W9,{children:f.jsx(ee,{dangerouslySetInnerHTML:{__html:n}})})]})]})})},vQ=()=>{const[e,t]=$.useState({isLocked:!1}),n=u=>{t({isLocked:!0,message:u})},o=()=>{t({isLocked:!1})},[r,i]=$.useState({isLocked:!1}),s=u=>{i({isLocked:!0,message:u})},a=()=>{i({isLocked:!1})};return{forwardLock:e,lockForward:n,unlockForward:o,previousLock:r,lockPrevious:s,unlockPrevious:a,lockAll:u=>{n(u),s(u)},unlockAll:()=>{o(),a()}}},Ex=$.createContext(null),_x=e=>{const{children:t,startingPage:n=0,...o}=e,[r,i]=$.useState(!1),[s,a]=$.useState(!1),[c,d]=$.useState(n),u=e.pages.length,p=e.pages[c]??null,h=vQ(),[g,m]=$.useState(!1),b={...o,...h,isSaving:r,setSaving:i,selectedPage:p,selectedPageIndex:c,setPage:d,maxPage:u,formSaved:g,setFormSaved:m,isError:s,setError:a};return f.jsx(Ex.Provider,{value:b,children:t})},Zs=()=>{const e=$.useContext(Ex);if(e)return e;throw new Error("useFormBaseContext must be used within an FormBaseContextProvider")},CQ=()=>{const{selectedPageIndex:e,setPage:t,onPageChange:n,pages:o,previousLock:r,forwardLock:i,maxPage:s,setFormSaved:a,isLoading:c}=Zs(),d=Pe(),u={selected:{color:"#FFF",background:d.custom.grey[2800],hover:{color:"#FFF",background:d.custom.grey[2800]}},locked:{color:d.custom.grey[500],background:"#FFF",hover:{color:d.custom.grey[500],background:"#FFF"}},default:{color:d.custom.grey[2800],background:"#FFF",hover:{color:"#FFF",background:d.custom.grey[2e3]}}};return c?f.jsx(qa,{}):f.jsxs(ee,{display:"inline-flex",position:"relative",children:[f.jsx(ye,{direction:"row",gap:"12px",position:"relative",sx:{zIndex:1},children:[...Array(s)].map((p,h)=>{var S,T;const g=r.isLocked&&h<e,m=i.isLocked&&h>e,b=g||m,C=h===e?u.selected:u[b?"locked":"default"],y=((S=o[h])==null?void 0:S.icon)??h+1;return f.jsx(Au,{size:"medium",border:`1px solid ${d.custom.grey[500]}`,color:C.color,bgcolor:C.background,tooltip:(T=o[h])==null?void 0:T.title,sx:{fill:C.color,cursor:b?"default":"pointer","&:hover":{fill:C.hover.color,color:C.hover.color,bgcolor:C.hover.background}},onClick:()=>{h===e||b||(a(!1),t(h),n==null||n(h,e))},children:y},`page-top-display-${h}`)})}),f.jsx(zn,{sx:{backgroundColor:d.custom.grey[500],position:"absolute",inset:`${36/2}px`}})]})},xQ=()=>{const{textOptions:e,isLoading:t}=Zs(),n=Pe();return f.jsx(ye,{direction:"row",alignItems:"center",justifyContent:"start",marginX:"20px",maxWidth:"33%",children:f.jsxs(ye,{gap:"4px",children:[f.jsx(pe,{variant:"h3",children:t?f.jsx(qa,{size:"18px"}):e.title}),e.subtitle&&f.jsx(pe,{variant:"body",color:n.custom.grey[2e3],children:e.subtitle})]})})},yQ=()=>{const e=Pe(),{isSaving:t,textOptions:n,isError:o}=Zs(),r=t?L9:o?jz:I9,i=t?{animation:"spin 1s linear infinite","@keyframes spin":{"0%":{transform:"rotate(360deg)"},"100%":{transform:"rotate(0deg)"}}}:{},s=f.jsx(r,{sx:{width:"24px",color:o?e.custom.red[600]:e.custom.grey[2e3],...i}}),a=f.jsx(ee,{padding:"12px 16px",textAlign:"center",children:f.jsx(pe,{variant:"body-medium",children:t?n.syncingMessage:o?n.errorDefaultMessage:n.savingDefaultMessage})});return f.jsx(Zc,{icon:s,body:a,size:"260px"})},wQ=()=>{const{confirmExit:e,selectedPageIndex:t,setPage:n,maxPage:o,forwardLock:r,previousLock:i,textOptions:s,onClose:a,onValidate:c,onPageChange:d,showSync:u,setFormSaved:p,openConfirmDialog:h,isLoading:g}=Zs(),m=Pe(),v=t===o-1&&s.finalPage?s.finalPage:s.nextPage,C=f.jsx(at,{variant:"primary",disabled:r.isLocked||g,endIcon:f.jsx(kx,{}),onClick:()=>{if(t===o-1){p(!0),c==null||c();return}return p(!1),d==null||d(t+1,t),n(t+1)},children:v}),y=f.jsxs(ee,{padding:"12px 16px",children:[f.jsx(pe,{variant:"body-bold",children:s.warningText?s.warningText:""}),f.jsx("br",{}),f.jsx(pe,{variant:"body",children:r.isLocked&&r.message||""})]});return f.jsxs(ye,{direction:"row",alignItems:"center",justifyContent:"end",gap:"28px",children:[f.jsx(ee,{sx:{">*":{display:"flex"}},children:u&&f.jsx(yQ,{})}),f.jsxs(ye,{direction:"row",gap:"20px",children:[s.previousPage&&f.jsx(at,{sx:{minWidth:"90px"},variant:"text",disabled:i.isLocked||g,startIcon:i.isLocked||g?null:f.jsx(Ox,{}),onClick:()=>{if(p(!1),t===0){d==null||d(t,t);return}return d==null||d(t-1,t),n(t-1)},children:s.previousPage}),r.isLocked?v&&f.jsx(Zc,{icon:C,body:y,size:"260px",leftPosition:130}):v&&C]}),a&&f.jsx(at,{variant:"white-filled",onClick:e?h:a,sx:{minWidth:0,aspectRatio:1,borderRadius:"100%",padding:0,"&:hover":{background:m.custom.grey[400]},"&:active":{background:m.custom.grey[600]}},children:f.jsx(R9,{sx:{width:"20px",color:m.custom.grey[2800]}})})]})},SQ=()=>f.jsxs(ee,{sx:{zIndex:1e3,minHeight:"96px",position:"sticky",top:"28px",border:"1px solid #E7E6E4",borderRadius:"52px",backgroundColor:"#FFFFFF",padding:"20px 28px",display:"grid",gridTemplateColumns:"1fr 50% 1fr",gridTemplateRows:"1fr",alignItems:"center"},children:[f.jsx(ee,{sx:{gridColumn:"1 / 3",gridRow:" 1 / 1",display:"flex",justifyContent:"left"},children:f.jsx(xQ,{})}),f.jsx(ee,{sx:{gridColumn:"2 / 3",gridRow:" 1 / 1",display:"flex",justifyContent:"center"},children:f.jsx(CQ,{})}),f.jsx(ee,{sx:{gridColumn:"3 / 3",gridRow:" 1 / 1",display:"flex",justifyContent:"right"},children:f.jsx(wQ,{})})]}),MQ=()=>{const{selectedPage:e,selectedPageIndex:t,isLoading:n}=Zs(),o=e.icon??t+1,r=e.title,i=e.subtitle;return n?f.jsx(TQ,{}):f.jsx(ye,{direction:"column",alignItems:"center",children:f.jsxs("div",{style:{width:"1024px"},children:[f.jsxs(ye,{direction:"column",marginTop:"44px",marginBottom:"36px",gap:"2rem",children:[r&&f.jsx(Ch,{title:r,badge:o}),i&&f.jsxs(f.Fragment,{children:[f.jsx(pe,{variant:"h4",children:i}),f.jsx(zn,{})]})]}),e.content]})})},TQ=()=>f.jsx(ee,{sx:{marginLeft:"auto",marginRight:"auto",width:"fit-content",marginTop:"5%",marginBottom:"5%"},children:f.jsx(qa,{})}),kQ=e=>{const t=Pe(),{onClose:n,open:o,confirmOptions:r}=e,i=()=>{r.onConfirm(),n()},s=()=>{r.onCancel(),n()};return f.jsxs(Ec,{fullWidth:!0,maxWidth:"xs",open:o,onClose:n,sx:{".MuiPaper-rounded":{borderRadius:"12px"}},children:[f.jsxs(gu,{sx:{borderBottom:`1px solid ${t.custom.grey[500]}`},children:[f.jsxs(ee,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",minHeight:"68px"},children:[f.jsx(pe,{variant:"h3",children:r.titleText}),f.jsx(at,{variant:"text",endIcon:f.jsx(Fu,{}),onClick:n})]}),(r==null?void 0:r.infoText)&&f.jsx(pe,{sx:{marginBlock:1.5},children:r.infoText})]}),f.jsxs(ye,{flexDirection:"column",alignItems:"center",p:3,gap:"1rem",children:[f.jsx(at,{variant:"primary",onClick:i,children:r.confirmText}),f.jsx(at,{onClick:s,children:r.cancelText})]})]})},OQ=()=>{const{confirmExit:e,formSaved:t}=Zs(),n=o=>{o.preventDefault()};return $.useEffect(()=>{if(e)return window.removeEventListener("beforeunload",n),t===!1&&window.addEventListener("beforeunload",n),()=>{window.removeEventListener("beforeunload",n)}},[t,e]),f.jsxs(f.Fragment,{children:[f.jsx(SQ,{}),f.jsx(MQ,{})]})},PQ=e=>{const[t,n]=$.useState(!1);return f.jsxs(_x,{...e,openConfirmDialog:()=>n(!0),children:[f.jsx(OQ,{}),e.confirmExit&&f.jsx(kQ,{open:t,onClose:()=>n(!1),confirmOptions:e.confirmOptions})]})};/**
375
375
  * table-core
376
376
  *
377
377
  * Copyright (c) TanStack
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@foodpilot/foods",
3
3
  "private": false,
4
- "version": "0.3.94",
4
+ "version": "0.3.95",
5
5
  "type": "module",
6
6
  "main": "./dist/main.umd.cjs",
7
7
  "module": "./dist/main.js",