@crystaldesign/media-upload 24.15.0-beta.13 → 24.15.0-beta.15

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.
@@ -960,7 +960,7 @@ function index (_ref) {
960
960
  children = _ref.children,
961
961
  acceptedFiles = _ref.acceptedFiles,
962
962
  _ref$maxSize = _ref.maxSize,
963
- maxSize = _ref$maxSize === void 0 ? 26214400 : _ref$maxSize;
963
+ maxSize = _ref$maxSize === void 0 ? 52428800 : _ref$maxSize;
964
964
  var _useTranslation = divaCore.useTranslation(),
965
965
  t = _useTranslation.t;
966
966
  _useTranslation.i18n;
@@ -936,7 +936,7 @@ function index (_ref) {
936
936
  children = _ref.children,
937
937
  acceptedFiles = _ref.acceptedFiles,
938
938
  _ref$maxSize = _ref.maxSize,
939
- maxSize = _ref$maxSize === void 0 ? 26214400 : _ref$maxSize;
939
+ maxSize = _ref$maxSize === void 0 ? 52428800 : _ref$maxSize;
940
940
  var _useTranslation = useTranslation(),
941
941
  t = _useTranslation.t;
942
942
  _useTranslation.i18n;
@@ -123,4 +123,4 @@ var CrystaldesignMediaUpload;(()=>{var o,c,d,g,m={9094:(o,c,d)=>{"use strict";d.
123
123
  }
124
124
  `,nn="string"!=typeof rn?Xr.iv`
125
125
  animation: ${rn} 3s infinite linear;
126
- `:null,getColorShade=(o,c)=>o.vars?o.vars.palette.LinearProgress[`${c}Bg`]:"light"===o.palette.mode?(0,vr.$n)(o.palette[c].main,.62):(0,vr._j)(o.palette[c].main,.5),on=(0,Se.ZP)("span",{name:"MuiLinearProgress",slot:"Root",overridesResolver:(o,c)=>{const{ownerState:d}=o;return[c.root,c[`color${(0,ge.Z)(d.color)}`],c[d.variant]]}})((0,we.Z)((({theme:o})=>({position:"relative",overflow:"hidden",display:"block",height:4,zIndex:0,"@media print":{colorAdjust:"exact"},variants:[...Object.entries(o.palette).filter((0,xe.Z)()).map((([c])=>({props:{color:c},style:{backgroundColor:getColorShade(o,c)}}))),{props:({ownerState:o})=>"inherit"===o.color&&"buffer"!==o.variant,style:{"&::before":{content:'""',position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:"currentColor",opacity:.3}}},{props:{variant:"buffer"},style:{backgroundColor:"transparent"}},{props:{variant:"query"},style:{transform:"rotate(180deg)"}}]})))),an=(0,Se.ZP)("span",{name:"MuiLinearProgress",slot:"Dashed",overridesResolver:(o,c)=>{const{ownerState:d}=o;return[c.dashed,c[`dashedColor${(0,ge.Z)(d.color)}`]]}})((0,we.Z)((({theme:o})=>({position:"absolute",marginTop:0,height:"100%",width:"100%",backgroundSize:"10px 10px",backgroundPosition:"0 -23px",variants:[{props:{color:"inherit"},style:{opacity:.3,backgroundImage:"radial-gradient(currentColor 0%, currentColor 16%, transparent 42%)"}},...Object.entries(o.palette).filter((0,xe.Z)()).map((([c])=>{const d=getColorShade(o,c);return{props:{color:c},style:{backgroundImage:`radial-gradient(${d} 0%, ${d} 16%, transparent 42%)`}}}))]}))),nn||{animation:`${rn} 3s infinite linear`}),sn=(0,Se.ZP)("span",{name:"MuiLinearProgress",slot:"Bar1",overridesResolver:(o,c)=>{const{ownerState:d}=o;return[c.bar,c[`barColor${(0,ge.Z)(d.color)}`],("indeterminate"===d.variant||"query"===d.variant)&&c.bar1Indeterminate,"determinate"===d.variant&&c.bar1Determinate,"buffer"===d.variant&&c.bar1Buffer]}})((0,we.Z)((({theme:o})=>({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left",variants:[{props:{color:"inherit"},style:{backgroundColor:"currentColor"}},...Object.entries(o.palette).filter((0,xe.Z)()).map((([c])=>({props:{color:c},style:{backgroundColor:(o.vars||o).palette[c].main}}))),{props:{variant:"determinate"},style:{transition:"transform .4s linear"}},{props:{variant:"buffer"},style:{zIndex:1,transition:"transform .4s linear"}},{props:({ownerState:o})=>"indeterminate"===o.variant||"query"===o.variant,style:{width:"auto"}},{props:({ownerState:o})=>"indeterminate"===o.variant||"query"===o.variant,style:Qr||{animation:`${Jr} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite`}}]})))),ln=(0,Se.ZP)("span",{name:"MuiLinearProgress",slot:"Bar2",overridesResolver:(o,c)=>{const{ownerState:d}=o;return[c.bar,c[`barColor${(0,ge.Z)(d.color)}`],("indeterminate"===d.variant||"query"===d.variant)&&c.bar2Indeterminate,"buffer"===d.variant&&c.bar2Buffer]}})((0,we.Z)((({theme:o})=>({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left",variants:[...Object.entries(o.palette).filter((0,xe.Z)()).map((([c])=>({props:{color:c},style:{"--LinearProgressBar2-barColor":(o.vars||o).palette[c].main}}))),{props:({ownerState:o})=>"buffer"!==o.variant&&"inherit"!==o.color,style:{backgroundColor:"var(--LinearProgressBar2-barColor, currentColor)"}},{props:({ownerState:o})=>"buffer"!==o.variant&&"inherit"===o.color,style:{backgroundColor:"currentColor"}},{props:{color:"inherit"},style:{opacity:.3}},...Object.entries(o.palette).filter((0,xe.Z)()).map((([c])=>({props:{color:c,variant:"buffer"},style:{backgroundColor:getColorShade(o,c),transition:"transform .4s linear"}}))),{props:({ownerState:o})=>"indeterminate"===o.variant||"query"===o.variant,style:{width:"auto"}},{props:({ownerState:o})=>"indeterminate"===o.variant||"query"===o.variant,style:tn||{animation:`${en} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite`}}]})))),cn=_.forwardRef((function LinearProgress(o,c){const d=(0,_e.i)({props:o,name:"MuiLinearProgress"}),{className:g,color:m="primary",value:b,valueBuffer:S,variant:_="indeterminate",...O}=d,I={...d,color:m,variant:_},j=(o=>{const{classes:c,variant:d,color:g}=o,m={root:["root",`color${(0,ge.Z)(g)}`,d],dashed:["dashed",`dashedColor${(0,ge.Z)(g)}`],bar1:["bar",`barColor${(0,ge.Z)(g)}`,("indeterminate"===d||"query"===d)&&"bar1Indeterminate","determinate"===d&&"bar1Determinate","buffer"===d&&"bar1Buffer"],bar2:["bar","buffer"!==d&&`barColor${(0,ge.Z)(g)}`,"buffer"===d&&`color${(0,ge.Z)(g)}`,("indeterminate"===d||"query"===d)&&"bar2Indeterminate","buffer"===d&&"bar2Buffer"]};return(0,fe.Z)(m,getLinearProgressUtilityClass,c)})(I),B=(0,bt.V)(),N={},H={bar1:{},bar2:{}};if("determinate"===_||"buffer"===_)if(void 0!==b){N["aria-valuenow"]=Math.round(b),N["aria-valuemin"]=0,N["aria-valuemax"]=100;let o=b-100;B&&(o=-o),H.bar1.transform=`translateX(${o}%)`}else 0;if("buffer"===_)if(void 0!==S){let o=(S||0)-100;B&&(o=-o),H.bar2.transform=`translateX(${o}%)`}else 0;return(0,te.jsxs)(on,{className:(0,pe.Z)(j.root,g),ownerState:I,role:"progressbar",...N,ref:c,...O,children:["buffer"===_?(0,te.jsx)(an,{className:j.dashed,ownerState:I}):null,(0,te.jsx)(sn,{className:j.bar1,ownerState:I,style:H.bar1}),"determinate"===_?null:(0,te.jsx)(ln,{className:j.bar2,ownerState:I,style:H.bar2})]})}));function easeInOutSin(o){return(1+Math.sin(Math.PI*o-Math.PI/2))/2}const un={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};const dn=(0,ee.Z)((0,te.jsx)("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),pn=(0,ee.Z)((0,te.jsx)("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight");function getTabScrollButtonUtilityClass(o){return(0,ve.ZP)("MuiTabScrollButton",o)}const hn=(0,me.Z)("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),gn=(0,Se.ZP)(he.Z,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(o,c)=>{const{ownerState:d}=o;return[c.root,d.orientation&&c[d.orientation]]}})({width:40,flexShrink:0,opacity:.8,[`&.${hn.disabled}`]:{opacity:0},variants:[{props:{orientation:"vertical"},style:{width:"100%",height:40,"& svg":{transform:"var(--TabScrollButton-svgRotate)"}}}]}),mn=_.forwardRef((function TabScrollButton(o,c){const d=(0,_e.i)({props:o,name:"MuiTabScrollButton"}),{className:g,slots:m={},slotProps:b={},direction:S,orientation:_,disabled:O,...I}=d,j=(0,bt.V)(),B={isRtl:j,...d},N=(o=>{const{classes:c,orientation:d,disabled:g}=o,m={root:["root",d,g&&"disabled"]};return(0,fe.Z)(m,getTabScrollButtonUtilityClass,c)})(B),H=m.StartScrollButtonIcon??dn,$=m.EndScrollButtonIcon??pn,K=(0,St.Z)({elementType:H,externalSlotProps:b.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:B}),ee=(0,St.Z)({elementType:$,externalSlotProps:b.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:B});return(0,te.jsx)(gn,{component:"div",className:(0,pe.Z)(N.root,g),ref:c,role:null,ownerState:B,tabIndex:null,...I,style:{...I.style,..."vertical"===_&&{"--TabScrollButton-svgRotate":`rotate(${j?-90:90}deg)`}},children:"left"===S?(0,te.jsx)(H,{...K}):(0,te.jsx)($,{...ee})})}));var vn=__webpack_require__(8376);function getTabsUtilityClass(o){return(0,ve.ZP)("MuiTabs",o)}const yn=(0,me.Z)("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),Tabs_nextItem=(o,c)=>o===c?o.firstChild:c&&c.nextElementSibling?c.nextElementSibling:o.firstChild,Tabs_previousItem=(o,c)=>o===c?o.lastChild:c&&c.previousElementSibling?c.previousElementSibling:o.lastChild,Tabs_moveFocus=(o,c,d)=>{let g=!1,m=d(o,c);for(;m;){if(m===o.firstChild){if(g)return;g=!0}const c=m.disabled||"true"===m.getAttribute("aria-disabled");if(m.hasAttribute("tabindex")&&!c)return void m.focus();m=d(o,m)}},bn=(0,Se.ZP)("div",{name:"MuiTabs",slot:"Root",overridesResolver:(o,c)=>{const{ownerState:d}=o;return[{[`& .${yn.scrollButtons}`]:c.scrollButtons},{[`& .${yn.scrollButtons}`]:d.scrollButtonsHideMobile&&c.scrollButtonsHideMobile},c.root,d.vertical&&c.vertical]}})((0,we.Z)((({theme:o})=>({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex",variants:[{props:({ownerState:o})=>o.vertical,style:{flexDirection:"column"}},{props:({ownerState:o})=>o.scrollButtonsHideMobile,style:{[`& .${yn.scrollButtons}`]:{[o.breakpoints.down("sm")]:{display:"none"}}}}]})))),Sn=(0,Se.ZP)("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(o,c)=>{const{ownerState:d}=o;return[c.scroller,d.fixed&&c.fixed,d.hideScrollbar&&c.hideScrollbar,d.scrollableX&&c.scrollableX,d.scrollableY&&c.scrollableY]}})({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap",variants:[{props:({ownerState:o})=>o.fixed,style:{overflowX:"hidden",width:"100%"}},{props:({ownerState:o})=>o.hideScrollbar,style:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}},{props:({ownerState:o})=>o.scrollableX,style:{overflowX:"auto",overflowY:"hidden"}},{props:({ownerState:o})=>o.scrollableY,style:{overflowY:"auto",overflowX:"hidden"}}]}),wn=(0,Se.ZP)("div",{name:"MuiTabs",slot:"FlexContainer",overridesResolver:(o,c)=>{const{ownerState:d}=o;return[c.flexContainer,d.vertical&&c.flexContainerVertical,d.centered&&c.centered]}})({display:"flex",variants:[{props:({ownerState:o})=>o.vertical,style:{flexDirection:"column"}},{props:({ownerState:o})=>o.centered,style:{justifyContent:"center"}}]}),xn=(0,Se.ZP)("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(o,c)=>c.indicator})((0,we.Z)((({theme:o})=>({position:"absolute",height:2,bottom:0,width:"100%",transition:o.transitions.create(),variants:[{props:{indicatorColor:"primary"},style:{backgroundColor:(o.vars||o).palette.primary.main}},{props:{indicatorColor:"secondary"},style:{backgroundColor:(o.vars||o).palette.secondary.main}},{props:({ownerState:o})=>o.vertical,style:{height:"100%",width:2,right:0}}]})))),_n=(0,Se.ZP)((function ScrollbarSize(o){const{onChange:c,...d}=o,g=_.useRef(),m=_.useRef(null),setMeasurements=()=>{g.current=m.current.offsetHeight-m.current.clientHeight};return(0,Et.Z)((()=>{const o=At((()=>{const o=g.current;setMeasurements(),o!==g.current&&c(g.current)})),d=kt(m.current);return d.addEventListener("resize",o),()=>{o.clear(),d.removeEventListener("resize",o)}}),[c]),_.useEffect((()=>{setMeasurements(),c(g.current)}),[c]),(0,te.jsx)("div",{style:un,ref:m,...d})}))({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),Cn={};const Tn=_.forwardRef((function Tabs(o,c){const d=(0,_e.i)({props:o,name:"MuiTabs"}),g=(0,Pe.Z)(),m=(0,bt.V)(),{"aria-label":b,"aria-labelledby":S,action:O,centered:I=!1,children:j,className:B,component:N="div",allowScrollButtonsMobile:H=!1,indicatorColor:$="primary",onChange:K,orientation:ee="horizontal",ScrollButtonComponent:re=mn,scrollButtons:ne="auto",selectionFollowsFocus:oe,slots:ie={},slotProps:ae={},TabIndicatorProps:se={},TabScrollButtonProps:le={},textColor:ce="primary",value:ue,variant:de="standard",visibleScrollbar:he=!1,...ge}=d,me="scrollable"===de,ve="vertical"===ee,ye=ve?"scrollTop":"scrollLeft",be=ve?"top":"left",Se=ve?"bottom":"right",we=ve?"clientHeight":"clientWidth",xe=ve?"height":"width",Ce={...d,component:N,allowScrollButtonsMobile:H,indicatorColor:$,orientation:ee,vertical:ve,scrollButtons:ne,textColor:ce,variant:de,visibleScrollbar:he,fixed:!me,hideScrollbar:me&&!he,scrollableX:me&&!ve,scrollableY:me&&ve,centered:I&&!me,scrollButtonsHideMobile:!H},Te=(o=>{const{vertical:c,fixed:d,hideScrollbar:g,scrollableX:m,scrollableY:b,centered:S,scrollButtonsHideMobile:_,classes:O}=o,I={root:["root",c&&"vertical"],scroller:["scroller",d&&"fixed",g&&"hideScrollbar",m&&"scrollableX",b&&"scrollableY"],flexContainer:["flexContainer",c&&"flexContainerVertical",S&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",_&&"scrollButtonsHideMobile"],scrollableX:[m&&"scrollableX"],hideScrollbar:[g&&"hideScrollbar"]};return(0,fe.Z)(I,getTabsUtilityClass,O)})(Ce),Ee=(0,St.Z)({elementType:ie.StartScrollButtonIcon,externalSlotProps:ae.startScrollButtonIcon,ownerState:Ce}),ke=(0,St.Z)({elementType:ie.EndScrollButtonIcon,externalSlotProps:ae.endScrollButtonIcon,ownerState:Ce});const[Oe,Ae]=_.useState(!1),[Me,Ie]=_.useState(Cn),[je,Re]=_.useState(!1),[De,Le]=_.useState(!1),[Be,Ne]=_.useState(!1),[Fe,ze]=_.useState({overflow:"hidden",scrollbarWidth:0}),Ze=new Map,He=_.useRef(null),Ge=_.useRef(null),getTabsMeta=()=>{const o=He.current;let c,d;if(o){const d=o.getBoundingClientRect();c={clientWidth:o.clientWidth,scrollLeft:o.scrollLeft,scrollTop:o.scrollTop,scrollWidth:o.scrollWidth,top:d.top,bottom:d.bottom,left:d.left,right:d.right}}if(o&&!1!==ue){const o=Ge.current.children;if(o.length>0){const c=o[Ze.get(ue)];0,d=c?c.getBoundingClientRect():null}}return{tabsMeta:c,tabMeta:d}},Ue=(0,vn.Z)((()=>{const{tabsMeta:o,tabMeta:c}=getTabsMeta();let d,g=0;ve?(d="top",c&&o&&(g=c.top-o.top+o.scrollTop)):(d=m?"right":"left",c&&o&&(g=(m?-1:1)*(c[d]-o[d]+o.scrollLeft)));const b={[d]:g,[xe]:c?c[xe]:0};if("number"!=typeof Me[d]||"number"!=typeof Me[xe])Ie(b);else{const o=Math.abs(Me[d]-b[d]),c=Math.abs(Me[xe]-b[xe]);(o>=1||c>=1)&&Ie(b)}})),scroll=(o,{animation:c=!0}={})=>{c?function animate(o,c,d,g={},m=(()=>{})){const{ease:b=easeInOutSin,duration:S=300}=g;let _=null;const O=c[o];let I=!1;const cancel=()=>{I=!0},step=g=>{if(I)return void m(new Error("Animation cancelled"));null===_&&(_=g);const j=Math.min(1,(g-_)/S);c[o]=b(j)*(d-O)+O,j>=1?requestAnimationFrame((()=>{m(null)})):requestAnimationFrame(step)};return O===d?(m(new Error("Element already at target position")),cancel):(requestAnimationFrame(step),cancel)}(ye,He.current,o,{duration:g.transitions.duration.standard}):He.current[ye]=o},moveTabsScroll=o=>{let c=He.current[ye];c+=ve?o:o*(m?-1:1),scroll(c)},getScrollSize=()=>{const o=He.current[we];let c=0;const d=Array.from(Ge.current.children);for(let g=0;g<d.length;g+=1){const m=d[g];if(c+m[we]>o){0===g&&(c=o);break}c+=m[we]}return c},handleStartScrollClick=()=>{moveTabsScroll(-1*getScrollSize())},handleEndScrollClick=()=>{moveTabsScroll(getScrollSize())},Ve=_.useCallback((o=>{ze({overflow:null,scrollbarWidth:o})}),[]),$e=(0,vn.Z)((o=>{const{tabsMeta:c,tabMeta:d}=getTabsMeta();if(d&&c)if(d[be]<c[be]){const g=c[ye]+(d[be]-c[be]);scroll(g,{animation:o})}else if(d[Se]>c[Se]){const g=c[ye]+(d[Se]-c[Se]);scroll(g,{animation:o})}})),We=(0,vn.Z)((()=>{me&&!1!==ne&&Ne(!Be)}));_.useEffect((()=>{const o=At((()=>{He.current&&Ue()}));let c;const handleMutation=d=>{d.forEach((o=>{o.removedNodes.forEach((o=>{c?.unobserve(o)})),o.addedNodes.forEach((o=>{c?.observe(o)}))})),o(),We()},d=kt(He.current);let g;return d.addEventListener("resize",o),"undefined"!=typeof ResizeObserver&&(c=new ResizeObserver(o),Array.from(Ge.current.children).forEach((o=>{c.observe(o)}))),"undefined"!=typeof MutationObserver&&(g=new MutationObserver(handleMutation),g.observe(Ge.current,{childList:!0})),()=>{o.clear(),d.removeEventListener("resize",o),g?.disconnect(),c?.disconnect()}}),[Ue,We]),_.useEffect((()=>{const o=Array.from(Ge.current.children),c=o.length;if("undefined"!=typeof IntersectionObserver&&c>0&&me&&!1!==ne){const d=o[0],g=o[c-1],m={root:He.current,threshold:.99},b=new IntersectionObserver((o=>{Re(!o[0].isIntersecting)}),m);b.observe(d);const S=new IntersectionObserver((o=>{Le(!o[0].isIntersecting)}),m);return S.observe(g),()=>{b.disconnect(),S.disconnect()}}}),[me,ne,Be,j?.length]),_.useEffect((()=>{Ae(!0)}),[]),_.useEffect((()=>{Ue()})),_.useEffect((()=>{$e(Cn!==Me)}),[$e,Me]),_.useImperativeHandle(O,(()=>({updateIndicator:Ue,updateScrollButtons:We})),[Ue,We]);const qe=(0,te.jsx)(xn,{...se,className:(0,pe.Z)(Te.indicator,se.className),ownerState:Ce,style:{...Me,...se.style}});let Ke=0;const Ye=_.Children.map(j,(o=>{if(!_.isValidElement(o))return null;const c=void 0===o.props.value?Ke:o.props.value;Ze.set(c,Ke);const d=c===ue;return Ke+=1,_.cloneElement(o,{fullWidth:"fullWidth"===de,indicator:d&&!Oe&&qe,selected:d,selectionFollowsFocus:oe,onChange:K,textColor:ce,value:c,...1!==Ke||!1!==ue||o.props.tabIndex?{}:{tabIndex:0}})})),Xe=(()=>{const o={};o.scrollbarSizeListener=me?(0,te.jsx)(_n,{onChange:Ve,className:(0,pe.Z)(Te.scrollableX,Te.hideScrollbar)}):null;const c=me&&("auto"===ne&&(je||De)||!0===ne);return o.scrollButtonStart=c?(0,te.jsx)(re,{slots:{StartScrollButtonIcon:ie.StartScrollButtonIcon},slotProps:{startScrollButtonIcon:Ee},orientation:ee,direction:m?"right":"left",onClick:handleStartScrollClick,disabled:!je,...le,className:(0,pe.Z)(Te.scrollButtons,le.className)}):null,o.scrollButtonEnd=c?(0,te.jsx)(re,{slots:{EndScrollButtonIcon:ie.EndScrollButtonIcon},slotProps:{endScrollButtonIcon:ke},orientation:ee,direction:m?"left":"right",onClick:handleEndScrollClick,disabled:!De,...le,className:(0,pe.Z)(Te.scrollButtons,le.className)}):null,o})();return(0,te.jsxs)(bn,{className:(0,pe.Z)(Te.root,B),ownerState:Ce,ref:c,as:N,...ge,children:[Xe.scrollButtonStart,Xe.scrollbarSizeListener,(0,te.jsxs)(Sn,{className:Te.scroller,ownerState:Ce,style:{overflow:Fe.overflow,[ve?"margin"+(m?"Left":"Right"):"marginBottom"]:he?void 0:-Fe.scrollbarWidth},ref:He,children:[(0,te.jsx)(wn,{"aria-label":b,"aria-labelledby":S,"aria-orientation":"vertical"===ee?"vertical":null,className:Te.flexContainer,ownerState:Ce,onKeyDown:o=>{const c=Ge.current,d=yt(c).activeElement;if("tab"!==d.getAttribute("role"))return;let g="horizontal"===ee?"ArrowLeft":"ArrowUp",b="horizontal"===ee?"ArrowRight":"ArrowDown";switch("horizontal"===ee&&m&&(g="ArrowRight",b="ArrowLeft"),o.key){case g:o.preventDefault(),Tabs_moveFocus(c,d,Tabs_previousItem);break;case b:o.preventDefault(),Tabs_moveFocus(c,d,Tabs_nextItem);break;case"Home":o.preventDefault(),Tabs_moveFocus(c,null,Tabs_nextItem);break;case"End":o.preventDefault(),Tabs_moveFocus(c,null,Tabs_previousItem)}},ref:Ge,role:"tablist",children:Ye}),Oe&&qe]}),Xe.scrollButtonEnd]})}));function getTabUtilityClass(o){return(0,ve.ZP)("MuiTab",o)}const En=(0,me.Z)("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper","icon"]),kn=(0,Se.ZP)(he.Z,{name:"MuiTab",slot:"Root",overridesResolver:(o,c)=>{const{ownerState:d}=o;return[c.root,d.label&&d.icon&&c.labelIcon,c[`textColor${(0,ge.Z)(d.textColor)}`],d.fullWidth&&c.fullWidth,d.wrapped&&c.wrapped,{[`& .${En.iconWrapper}`]:c.iconWrapper},{[`& .${En.icon}`]:c.icon}]}})((0,we.Z)((({theme:o})=>({...o.typography.button,maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center",lineHeight:1.25,variants:[{props:({ownerState:o})=>o.label&&("top"===o.iconPosition||"bottom"===o.iconPosition),style:{flexDirection:"column"}},{props:({ownerState:o})=>o.label&&"top"!==o.iconPosition&&"bottom"!==o.iconPosition,style:{flexDirection:"row"}},{props:({ownerState:o})=>o.icon&&o.label,style:{minHeight:72,paddingTop:9,paddingBottom:9}},{props:({ownerState:o,iconPosition:c})=>o.icon&&o.label&&"top"===c,style:{[`& > .${En.icon}`]:{marginBottom:6}}},{props:({ownerState:o,iconPosition:c})=>o.icon&&o.label&&"bottom"===c,style:{[`& > .${En.icon}`]:{marginTop:6}}},{props:({ownerState:o,iconPosition:c})=>o.icon&&o.label&&"start"===c,style:{[`& > .${En.icon}`]:{marginRight:o.spacing(1)}}},{props:({ownerState:o,iconPosition:c})=>o.icon&&o.label&&"end"===c,style:{[`& > .${En.icon}`]:{marginLeft:o.spacing(1)}}},{props:{textColor:"inherit"},style:{color:"inherit",opacity:.6,[`&.${En.selected}`]:{opacity:1},[`&.${En.disabled}`]:{opacity:(o.vars||o).palette.action.disabledOpacity}}},{props:{textColor:"primary"},style:{color:(o.vars||o).palette.text.secondary,[`&.${En.selected}`]:{color:(o.vars||o).palette.primary.main},[`&.${En.disabled}`]:{color:(o.vars||o).palette.text.disabled}}},{props:{textColor:"secondary"},style:{color:(o.vars||o).palette.text.secondary,[`&.${En.selected}`]:{color:(o.vars||o).palette.secondary.main},[`&.${En.disabled}`]:{color:(o.vars||o).palette.text.disabled}}},{props:({ownerState:o})=>o.fullWidth,style:{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"}},{props:({ownerState:o})=>o.wrapped,style:{fontSize:o.typography.pxToRem(12)}}]})))),Pn=_.forwardRef((function Tab(o,c){const d=(0,_e.i)({props:o,name:"MuiTab"}),{className:g,disabled:m=!1,disableFocusRipple:b=!1,fullWidth:S,icon:O,iconPosition:I="top",indicator:j,label:B,onChange:N,onClick:H,onFocus:$,selected:K,selectionFollowsFocus:ee,textColor:re="inherit",value:ne,wrapped:oe=!1,...ie}=d,ae={...d,disabled:m,disableFocusRipple:b,selected:K,icon:!!O,iconPosition:I,label:!!B,fullWidth:S,textColor:re,wrapped:oe},se=(o=>{const{classes:c,textColor:d,fullWidth:g,wrapped:m,icon:b,label:S,selected:_,disabled:O}=o,I={root:["root",b&&S&&"labelIcon",`textColor${(0,ge.Z)(d)}`,g&&"fullWidth",m&&"wrapped",_&&"selected",O&&"disabled"],icon:["iconWrapper","icon"]};return(0,fe.Z)(I,getTabUtilityClass,c)})(ae),le=O&&B&&_.isValidElement(O)?_.cloneElement(O,{className:(0,pe.Z)(se.icon,O.props.className)}):O;return(0,te.jsxs)(kn,{focusRipple:!b,className:(0,pe.Z)(se.root,g),ref:c,role:"tab","aria-selected":K,disabled:m,onClick:o=>{!K&&N&&N(o,ne),H&&H(o)},onFocus:o=>{ee&&!K&&N&&N(o,ne),$&&$(o)},ownerState:ae,tabIndex:K?0:-1,...ie,children:["top"===I||"start"===I?(0,te.jsxs)(_.Fragment,{children:[le,B]}):(0,te.jsxs)(_.Fragment,{children:[B,le]}),j]})}));var On=__webpack_require__(183),An=__webpack_require__(4477);function src_ownKeys(o,c){var d=Object.keys(o);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(o);c&&(g=g.filter((function(c){return Object.getOwnPropertyDescriptor(o,c).enumerable}))),d.push.apply(d,g)}return d}function src_objectSpread(c){for(var d=1;d<arguments.length;d++){var g=null!=arguments[d]?arguments[d]:{};d%2?src_ownKeys(Object(g),!0).forEach((function(d){(0,o.Z)(c,d,g[d])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(g)):src_ownKeys(Object(g)).forEach((function(o){Object.defineProperty(c,o,Object.getOwnPropertyDescriptor(g,o))}))}return c}var Mn=(0,st.jl)("MediaViewer","MediaUpload");function media_upload_src(o){var m=o.themeType,S=o.onChange,O=o.organizationId,I=o.functionType,j=o.initFile,B=o.config,N=o.createRef,H=void 0===N||N,$=o.disabled,K=o.children,ee=o.acceptedFiles,re=o.maxSize,ne=void 0===re?26214400:re,oe=(0,st.$G)(),ie=oe.t,ae=(oe.i18n,(0,st.Vr)().state.theme),se=(0,_.useState)([]),le=(0,g.Z)(se,2),ce=le[0],ue=le[1],de=(0,_.useState)(),pe=(0,g.Z)(de,2),fe=pe[0],he=pe[1],ge=(0,_.useState)(),me=(0,g.Z)(ge,2),ve=me[0],ye=me[1],be=(0,_.useState)(),Se=(0,g.Z)(be,2),we=Se[0],xe=Se[1],_e=(0,_.useState)(I),Ce=(0,g.Z)(_e,2),Te=Ce[0],Ee=Ce[1],ke=(0,_.useState)([]),Pe=(0,g.Z)(ke,2),Oe=Pe[0],Ae=Pe[1],Me=(0,_.useState)(!1),Ie=(0,g.Z)(Me,2),je=Ie[0],Re=Ie[1],De=(0,_.useState)(!1),Le=(0,g.Z)(De,2),Be=Le[0],Ne=Le[1],Fe=(0,_.useState)(),ze=(0,g.Z)(Fe,2),Ze=ze[0],He=ze[1],Ge=(0,_.useState)("standard"),Ue=(0,g.Z)(Ge,2),Ve=Ue[0],$e=Ue[1],We=(0,_.useState)([]),qe=(0,g.Z)(We,2),Ke=qe[0],Ye=qe[1],Xe=function(){var o=(0,d.Z)(b().mark((function _callee(o){var c,d,g,m,S,_,I,j,N,$,K,ee,te,re;return b().wrap((function _callee$(ne){for(;;)switch(ne.prev=ne.next){case 0:d=[],Re(!0),g=Array.isArray(o)?o:[o],m=[],S=b().mark((function _loop(){var o,c,S;return b().wrap((function _loop$(b){for(;;)switch(b.prev=b.next){case 0:(o=g[_])instanceof Yr?d.push(o):(c=new Yr(B,o,H),(S=m.find((function(o){return o.url===c.url&&o.files.length<=250})))?S.files.push(c):m.push({files:[c],url:c.url}));case 2:case"end":return b.stop()}}),_loop)})),_=0;case 6:if(!(_<g.length)){ne.next=11;break}return ne.delegateYield(S(),"t0",8);case 8:_++,ne.next=6;break;case 11:I=0;case 12:if(!(I<m.length)){ne.next=29;break}return j=m[I],ne.next=16,j.files[0].loadMany({refIds:j.files.map((function(o){return o.ref})),organizationId:O});case 16:N=ne.sent,$=N.mediaItem,K=N.refs,ee=b().mark((function _loop2(){var o,c;return b().wrap((function _loop2$(g){for(;;)switch(g.prev=g.next){case 0:if(o=K[te],c=j.files.find((function(c){return c.ref===o._id}))){g.next=4;break}throw new Error("file with refid "+o._id+" not found");case 4:c.setMediaItemAndRef({item:$,ref:o}),d.push(c);case 6:case"end":return g.stop()}}),_loop2)})),te=0;case 21:if(!(te<K.length)){ne.next=26;break}return ne.delegateYield(ee(),"t1",23);case 23:te++,ne.next=21;break;case 26:I++,ne.next=12;break;case 29:ue(d),d[0].fileName&&(re=d[0].fileName.lastIndexOf("."),he(d[0].fileName.substring(0,re))),ye(d[0].description),xe(d[0].borderPercentage),Ee(d[0].functionType),Ae(null!==(c=d[0].classes)&&void 0!==c?c:[]),$e("SPIN"==d[0].mediaType?"spin":"standard"),Re(!1);case 37:case"end":return ne.stop()}}),_callee)})));return function initState(c){return o.apply(this,arguments)}}();(0,_.useEffect)((function(){j&&Xe(j)}),[j]);var Je=function createState(o){try{var c=new Yr(B,"spin"==Ve?o:o[0],H);ue([c]);var d=c.fileName.lastIndexOf(".");he(c.fileName.substring(0,d)),Ee(c.functionType),He(void 0)}catch(o){He(ie("mediaupload.error.general")),Mn.error(new st.GE("Error creating state",{cause:o,code:"MEDUP_0001"}))}};if(je)return(0,te.jsx)(cn,{});var Qe=Array.isArray(K)?K[K.length-1]:K,et=Array.isArray(K)&&K.length>=2?K.slice(0,K.length-1):(0,te.jsx)(te.Fragment,{});return(0,te.jsx)(On.Z,{theme:"darkmode"==m?(0,An.Z)({palette:{mode:"dark",primary:{main:"rgba(255, 255, 255, 255)"}},typography:{allVariants:{color:"white"}}}):(0,An.Z)(ae),children:(0,te.jsxs)("form",{noValidate:!0,autoComplete:"off",onSubmit:function onSubmit(o){o.preventDefault(),function onSubmit(){"spin"==Ve&&Ke.length>1&&Ke.length<8?He(ie("mediaupload.error.spinsize")):(ce.forEach((function(o){var c=o.fileName.lastIndexOf("."),d=o.fileName.substring(c+1,o.fileName.length);o.fileName="".concat(fe,".").concat(d),o.description=ve,o.borderPercentage=we,o.functionType=Te,o.classes=Oe})),S(ce.length<=1?ce[0]:ce))}()},style:{height:"100%",display:"flex",flexDirection:"column"},children:[Ze&&(0,te.jsx)(Vr,{severity:"error",children:Ze+" --- "+st.Lm.formatDate(new Date,!0,void 0,!0)+(st.Lm.getCurrentTraceId()?" --- "+ie("modal.errorcode")+": "+st.Lm.getCurrentTraceId():"")}),(0,te.jsx)("div",{style:{borderBottom:"1px solid lightgray",marginBottom:"10px"},children:(0,te.jsxs)(Tn,{value:Ve,onChange:function onChange(o,c){return $e(c)},"aria-label":"basic tabs example",textColor:"primary",children:[(0,te.jsx)(Pn,{label:"Standard",value:"standard",disabled:ce[0]&&"standard"!=Ve}),(0,te.jsx)(Pn,{label:"Spin",value:"spin",disabled:ce[0]&&"spin"!=Ve})]})}),(!ce[0]||"spin"==Ve&&Ke.length>0)&&(0,te.jsxs)(te.Fragment,{children:[Be&&(0,te.jsx)(cn,{}),(0,te.jsx)(nt,{fileObjects:Ke,onAdd:function onAddFile(o){if(o.length){var d=[].concat((0,c.Z)(Ke),(0,c.Z)(o));Ye(d),Je(d)}},onDrop:function onDrop(){Ne(!0)},onDelete:function onDelete(o){var d=Ke.findIndex((function(c){return c==o})),g=(0,c.Z)(Ke);g.splice(d,1),Ye(g),Je(g)},onAlert:function onAlert(o,c){Ne(!1),"error"==c?o.includes("File is too big")?(He(ie("mediaupload.error.tobig",{fileName:fe,mb:ne/1048576})),Mn.error(new st.GE(o,{code:"MEDUP_0001"}))):o.includes("File type not supported")?(He(ie("mediaupload.error.wrongtype",{fileName:fe,types:null==ee?void 0:ee.join(", ")})),Mn.error(new st.GE(o,{code:"MEDUP_0001"}))):(He(ie("mediaupload.error.general")),Mn.error(new st.GE(o,{code:"MEDUP_0001"}))):"info"==c&&o&&Mn.log(o)},showPreviewsInDropzone:!1,showPreviews:!0,useChipsForPreview:!0,previewGridProps:{container:{spacing:1,direction:"row"}},dropzoneText:ie("spin"==Ve?"asseteditor.dropzone.spintext":"asseteditor.dropzone.text"),filesLimit:"spin"==Ve?36:1,maxFileSize:ne,showAlerts:!1,disableRejectionFeedback:!0,previewText:ie("asseteditor.dropzone.preview"),acceptedFiles:"spin"==Ve?[".jpg",".png",".jpeg"]:ee}),"spin"!=Ve&&(0,te.jsx)(FileFromWeb,{onEnter:function onFileFromWeb(o){var c=o.lastIndexOf("/"),d=o.substring(c+1,o.length),g=d.lastIndexOf("."),m=d.substring(g,o.length);if(!ee||ee.find((function(o){return o==m})))try{var b=new Yr(B,o,H);ue([b]);var S=b.fileName.lastIndexOf(".");he(b.fileName.substring(0,S)),Ee(b.functionType),He(void 0)}catch(o){He(ie("mediaupload.error.general")),Mn.error(new st.GE("Error creating state",{cause:o,code:"MEDUP_0001"}))}else He(ie("mediaupload.error.wrongtype",{fileName:d,types:ee.join(", ")}))}})]}),ce[0]&&(0,te.jsxs)(te.Fragment,{children:["PCT"==ce[0].mediaType&&(0,te.jsx)("img",{src:ce[0].url,style:{maxHeight:250,alignSelf:"center"}}),(0,te.jsx)(mr,{label:ie("asseteditor.form.mediaType"),fullWidth:!0,defaultValue:ce[0].mediaType,disabled:!0}),(0,te.jsx)(mr,{label:ie("asseteditor.form.fileName"),fullWidth:!0,value:fe||"",onChange:function onChange(o){return he(o.target.value)}}),(0,te.jsx)(mr,{label:ie("asseteditor.form.description"),id:"description",fullWidth:!0,value:ve||"",onChange:function onChange(o){return ye(o.target.value)}}),(0,te.jsx)(mr,{label:ie("asseteditor.form.borderPercentage"),id:"borderPercentage",fullWidth:!0,value:we||"",type:"number",onChange:function onChange(o){return xe(Number(o.target.value))}}),H&&(0,te.jsxs)(ft.Z,{style:{marginTop:12},fullWidth:!0,children:[(0,te.jsx)(pt.Z,{id:"functionTypeLabel",children:ie("asseteditor.form.functionType")}),(0,te.jsx)(fr,{labelId:"functionTypeLabel",id:"functionType",value:Te,disabled:"spin"==Ve,onChange:function onChange(o){Ee(o.target.value)},children:In.map((function(o){return(0,te.jsx)(_r,{value:o,children:"".concat(o," - ").concat(ie("functionType."+o,o))})}))})]}),(0,te.jsx)(Cr.ZP,{label:ie("asseteditor.form.classes"),value:Oe,onAdd:function onAdd(o){return Ae([].concat((0,c.Z)(Oe),[o]))},onDelete:function onDelete(o,d){Oe.splice(d,1),Ae((0,c.Z)(Oe))},fullWidth:!0})]}),et,(0,_.createElement)(Qe.type,src_objectSpread(src_objectSpread({},Qe.props),{},{key:Qe.key,disabled:!ce||H&&!Te||$}))]})})}var In=["PROD","PROD_SEC","PROD_CLOSE","PROD_MILIEU","SHO","CONFIG_INFO","AR_INFO","PROD_DETAIL","CAT","PLN","LOG","FUNC","COMMERCIAL","TPL","ASI","PLT","CAI","BAN","INF","OTH","ART","OPV"]})(),CrystaldesignMediaUpload=S})();
126
+ `:null,getColorShade=(o,c)=>o.vars?o.vars.palette.LinearProgress[`${c}Bg`]:"light"===o.palette.mode?(0,vr.$n)(o.palette[c].main,.62):(0,vr._j)(o.palette[c].main,.5),on=(0,Se.ZP)("span",{name:"MuiLinearProgress",slot:"Root",overridesResolver:(o,c)=>{const{ownerState:d}=o;return[c.root,c[`color${(0,ge.Z)(d.color)}`],c[d.variant]]}})((0,we.Z)((({theme:o})=>({position:"relative",overflow:"hidden",display:"block",height:4,zIndex:0,"@media print":{colorAdjust:"exact"},variants:[...Object.entries(o.palette).filter((0,xe.Z)()).map((([c])=>({props:{color:c},style:{backgroundColor:getColorShade(o,c)}}))),{props:({ownerState:o})=>"inherit"===o.color&&"buffer"!==o.variant,style:{"&::before":{content:'""',position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:"currentColor",opacity:.3}}},{props:{variant:"buffer"},style:{backgroundColor:"transparent"}},{props:{variant:"query"},style:{transform:"rotate(180deg)"}}]})))),an=(0,Se.ZP)("span",{name:"MuiLinearProgress",slot:"Dashed",overridesResolver:(o,c)=>{const{ownerState:d}=o;return[c.dashed,c[`dashedColor${(0,ge.Z)(d.color)}`]]}})((0,we.Z)((({theme:o})=>({position:"absolute",marginTop:0,height:"100%",width:"100%",backgroundSize:"10px 10px",backgroundPosition:"0 -23px",variants:[{props:{color:"inherit"},style:{opacity:.3,backgroundImage:"radial-gradient(currentColor 0%, currentColor 16%, transparent 42%)"}},...Object.entries(o.palette).filter((0,xe.Z)()).map((([c])=>{const d=getColorShade(o,c);return{props:{color:c},style:{backgroundImage:`radial-gradient(${d} 0%, ${d} 16%, transparent 42%)`}}}))]}))),nn||{animation:`${rn} 3s infinite linear`}),sn=(0,Se.ZP)("span",{name:"MuiLinearProgress",slot:"Bar1",overridesResolver:(o,c)=>{const{ownerState:d}=o;return[c.bar,c[`barColor${(0,ge.Z)(d.color)}`],("indeterminate"===d.variant||"query"===d.variant)&&c.bar1Indeterminate,"determinate"===d.variant&&c.bar1Determinate,"buffer"===d.variant&&c.bar1Buffer]}})((0,we.Z)((({theme:o})=>({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left",variants:[{props:{color:"inherit"},style:{backgroundColor:"currentColor"}},...Object.entries(o.palette).filter((0,xe.Z)()).map((([c])=>({props:{color:c},style:{backgroundColor:(o.vars||o).palette[c].main}}))),{props:{variant:"determinate"},style:{transition:"transform .4s linear"}},{props:{variant:"buffer"},style:{zIndex:1,transition:"transform .4s linear"}},{props:({ownerState:o})=>"indeterminate"===o.variant||"query"===o.variant,style:{width:"auto"}},{props:({ownerState:o})=>"indeterminate"===o.variant||"query"===o.variant,style:Qr||{animation:`${Jr} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite`}}]})))),ln=(0,Se.ZP)("span",{name:"MuiLinearProgress",slot:"Bar2",overridesResolver:(o,c)=>{const{ownerState:d}=o;return[c.bar,c[`barColor${(0,ge.Z)(d.color)}`],("indeterminate"===d.variant||"query"===d.variant)&&c.bar2Indeterminate,"buffer"===d.variant&&c.bar2Buffer]}})((0,we.Z)((({theme:o})=>({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left",variants:[...Object.entries(o.palette).filter((0,xe.Z)()).map((([c])=>({props:{color:c},style:{"--LinearProgressBar2-barColor":(o.vars||o).palette[c].main}}))),{props:({ownerState:o})=>"buffer"!==o.variant&&"inherit"!==o.color,style:{backgroundColor:"var(--LinearProgressBar2-barColor, currentColor)"}},{props:({ownerState:o})=>"buffer"!==o.variant&&"inherit"===o.color,style:{backgroundColor:"currentColor"}},{props:{color:"inherit"},style:{opacity:.3}},...Object.entries(o.palette).filter((0,xe.Z)()).map((([c])=>({props:{color:c,variant:"buffer"},style:{backgroundColor:getColorShade(o,c),transition:"transform .4s linear"}}))),{props:({ownerState:o})=>"indeterminate"===o.variant||"query"===o.variant,style:{width:"auto"}},{props:({ownerState:o})=>"indeterminate"===o.variant||"query"===o.variant,style:tn||{animation:`${en} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite`}}]})))),cn=_.forwardRef((function LinearProgress(o,c){const d=(0,_e.i)({props:o,name:"MuiLinearProgress"}),{className:g,color:m="primary",value:b,valueBuffer:S,variant:_="indeterminate",...O}=d,I={...d,color:m,variant:_},j=(o=>{const{classes:c,variant:d,color:g}=o,m={root:["root",`color${(0,ge.Z)(g)}`,d],dashed:["dashed",`dashedColor${(0,ge.Z)(g)}`],bar1:["bar",`barColor${(0,ge.Z)(g)}`,("indeterminate"===d||"query"===d)&&"bar1Indeterminate","determinate"===d&&"bar1Determinate","buffer"===d&&"bar1Buffer"],bar2:["bar","buffer"!==d&&`barColor${(0,ge.Z)(g)}`,"buffer"===d&&`color${(0,ge.Z)(g)}`,("indeterminate"===d||"query"===d)&&"bar2Indeterminate","buffer"===d&&"bar2Buffer"]};return(0,fe.Z)(m,getLinearProgressUtilityClass,c)})(I),B=(0,bt.V)(),N={},H={bar1:{},bar2:{}};if("determinate"===_||"buffer"===_)if(void 0!==b){N["aria-valuenow"]=Math.round(b),N["aria-valuemin"]=0,N["aria-valuemax"]=100;let o=b-100;B&&(o=-o),H.bar1.transform=`translateX(${o}%)`}else 0;if("buffer"===_)if(void 0!==S){let o=(S||0)-100;B&&(o=-o),H.bar2.transform=`translateX(${o}%)`}else 0;return(0,te.jsxs)(on,{className:(0,pe.Z)(j.root,g),ownerState:I,role:"progressbar",...N,ref:c,...O,children:["buffer"===_?(0,te.jsx)(an,{className:j.dashed,ownerState:I}):null,(0,te.jsx)(sn,{className:j.bar1,ownerState:I,style:H.bar1}),"determinate"===_?null:(0,te.jsx)(ln,{className:j.bar2,ownerState:I,style:H.bar2})]})}));function easeInOutSin(o){return(1+Math.sin(Math.PI*o-Math.PI/2))/2}const un={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};const dn=(0,ee.Z)((0,te.jsx)("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),pn=(0,ee.Z)((0,te.jsx)("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight");function getTabScrollButtonUtilityClass(o){return(0,ve.ZP)("MuiTabScrollButton",o)}const hn=(0,me.Z)("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),gn=(0,Se.ZP)(he.Z,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(o,c)=>{const{ownerState:d}=o;return[c.root,d.orientation&&c[d.orientation]]}})({width:40,flexShrink:0,opacity:.8,[`&.${hn.disabled}`]:{opacity:0},variants:[{props:{orientation:"vertical"},style:{width:"100%",height:40,"& svg":{transform:"var(--TabScrollButton-svgRotate)"}}}]}),mn=_.forwardRef((function TabScrollButton(o,c){const d=(0,_e.i)({props:o,name:"MuiTabScrollButton"}),{className:g,slots:m={},slotProps:b={},direction:S,orientation:_,disabled:O,...I}=d,j=(0,bt.V)(),B={isRtl:j,...d},N=(o=>{const{classes:c,orientation:d,disabled:g}=o,m={root:["root",d,g&&"disabled"]};return(0,fe.Z)(m,getTabScrollButtonUtilityClass,c)})(B),H=m.StartScrollButtonIcon??dn,$=m.EndScrollButtonIcon??pn,K=(0,St.Z)({elementType:H,externalSlotProps:b.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:B}),ee=(0,St.Z)({elementType:$,externalSlotProps:b.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:B});return(0,te.jsx)(gn,{component:"div",className:(0,pe.Z)(N.root,g),ref:c,role:null,ownerState:B,tabIndex:null,...I,style:{...I.style,..."vertical"===_&&{"--TabScrollButton-svgRotate":`rotate(${j?-90:90}deg)`}},children:"left"===S?(0,te.jsx)(H,{...K}):(0,te.jsx)($,{...ee})})}));var vn=__webpack_require__(8376);function getTabsUtilityClass(o){return(0,ve.ZP)("MuiTabs",o)}const yn=(0,me.Z)("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),Tabs_nextItem=(o,c)=>o===c?o.firstChild:c&&c.nextElementSibling?c.nextElementSibling:o.firstChild,Tabs_previousItem=(o,c)=>o===c?o.lastChild:c&&c.previousElementSibling?c.previousElementSibling:o.lastChild,Tabs_moveFocus=(o,c,d)=>{let g=!1,m=d(o,c);for(;m;){if(m===o.firstChild){if(g)return;g=!0}const c=m.disabled||"true"===m.getAttribute("aria-disabled");if(m.hasAttribute("tabindex")&&!c)return void m.focus();m=d(o,m)}},bn=(0,Se.ZP)("div",{name:"MuiTabs",slot:"Root",overridesResolver:(o,c)=>{const{ownerState:d}=o;return[{[`& .${yn.scrollButtons}`]:c.scrollButtons},{[`& .${yn.scrollButtons}`]:d.scrollButtonsHideMobile&&c.scrollButtonsHideMobile},c.root,d.vertical&&c.vertical]}})((0,we.Z)((({theme:o})=>({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex",variants:[{props:({ownerState:o})=>o.vertical,style:{flexDirection:"column"}},{props:({ownerState:o})=>o.scrollButtonsHideMobile,style:{[`& .${yn.scrollButtons}`]:{[o.breakpoints.down("sm")]:{display:"none"}}}}]})))),Sn=(0,Se.ZP)("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(o,c)=>{const{ownerState:d}=o;return[c.scroller,d.fixed&&c.fixed,d.hideScrollbar&&c.hideScrollbar,d.scrollableX&&c.scrollableX,d.scrollableY&&c.scrollableY]}})({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap",variants:[{props:({ownerState:o})=>o.fixed,style:{overflowX:"hidden",width:"100%"}},{props:({ownerState:o})=>o.hideScrollbar,style:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}},{props:({ownerState:o})=>o.scrollableX,style:{overflowX:"auto",overflowY:"hidden"}},{props:({ownerState:o})=>o.scrollableY,style:{overflowY:"auto",overflowX:"hidden"}}]}),wn=(0,Se.ZP)("div",{name:"MuiTabs",slot:"FlexContainer",overridesResolver:(o,c)=>{const{ownerState:d}=o;return[c.flexContainer,d.vertical&&c.flexContainerVertical,d.centered&&c.centered]}})({display:"flex",variants:[{props:({ownerState:o})=>o.vertical,style:{flexDirection:"column"}},{props:({ownerState:o})=>o.centered,style:{justifyContent:"center"}}]}),xn=(0,Se.ZP)("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(o,c)=>c.indicator})((0,we.Z)((({theme:o})=>({position:"absolute",height:2,bottom:0,width:"100%",transition:o.transitions.create(),variants:[{props:{indicatorColor:"primary"},style:{backgroundColor:(o.vars||o).palette.primary.main}},{props:{indicatorColor:"secondary"},style:{backgroundColor:(o.vars||o).palette.secondary.main}},{props:({ownerState:o})=>o.vertical,style:{height:"100%",width:2,right:0}}]})))),_n=(0,Se.ZP)((function ScrollbarSize(o){const{onChange:c,...d}=o,g=_.useRef(),m=_.useRef(null),setMeasurements=()=>{g.current=m.current.offsetHeight-m.current.clientHeight};return(0,Et.Z)((()=>{const o=At((()=>{const o=g.current;setMeasurements(),o!==g.current&&c(g.current)})),d=kt(m.current);return d.addEventListener("resize",o),()=>{o.clear(),d.removeEventListener("resize",o)}}),[c]),_.useEffect((()=>{setMeasurements(),c(g.current)}),[c]),(0,te.jsx)("div",{style:un,ref:m,...d})}))({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),Cn={};const Tn=_.forwardRef((function Tabs(o,c){const d=(0,_e.i)({props:o,name:"MuiTabs"}),g=(0,Pe.Z)(),m=(0,bt.V)(),{"aria-label":b,"aria-labelledby":S,action:O,centered:I=!1,children:j,className:B,component:N="div",allowScrollButtonsMobile:H=!1,indicatorColor:$="primary",onChange:K,orientation:ee="horizontal",ScrollButtonComponent:re=mn,scrollButtons:ne="auto",selectionFollowsFocus:oe,slots:ie={},slotProps:ae={},TabIndicatorProps:se={},TabScrollButtonProps:le={},textColor:ce="primary",value:ue,variant:de="standard",visibleScrollbar:he=!1,...ge}=d,me="scrollable"===de,ve="vertical"===ee,ye=ve?"scrollTop":"scrollLeft",be=ve?"top":"left",Se=ve?"bottom":"right",we=ve?"clientHeight":"clientWidth",xe=ve?"height":"width",Ce={...d,component:N,allowScrollButtonsMobile:H,indicatorColor:$,orientation:ee,vertical:ve,scrollButtons:ne,textColor:ce,variant:de,visibleScrollbar:he,fixed:!me,hideScrollbar:me&&!he,scrollableX:me&&!ve,scrollableY:me&&ve,centered:I&&!me,scrollButtonsHideMobile:!H},Te=(o=>{const{vertical:c,fixed:d,hideScrollbar:g,scrollableX:m,scrollableY:b,centered:S,scrollButtonsHideMobile:_,classes:O}=o,I={root:["root",c&&"vertical"],scroller:["scroller",d&&"fixed",g&&"hideScrollbar",m&&"scrollableX",b&&"scrollableY"],flexContainer:["flexContainer",c&&"flexContainerVertical",S&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",_&&"scrollButtonsHideMobile"],scrollableX:[m&&"scrollableX"],hideScrollbar:[g&&"hideScrollbar"]};return(0,fe.Z)(I,getTabsUtilityClass,O)})(Ce),Ee=(0,St.Z)({elementType:ie.StartScrollButtonIcon,externalSlotProps:ae.startScrollButtonIcon,ownerState:Ce}),ke=(0,St.Z)({elementType:ie.EndScrollButtonIcon,externalSlotProps:ae.endScrollButtonIcon,ownerState:Ce});const[Oe,Ae]=_.useState(!1),[Me,Ie]=_.useState(Cn),[je,Re]=_.useState(!1),[De,Le]=_.useState(!1),[Be,Ne]=_.useState(!1),[Fe,ze]=_.useState({overflow:"hidden",scrollbarWidth:0}),Ze=new Map,He=_.useRef(null),Ge=_.useRef(null),getTabsMeta=()=>{const o=He.current;let c,d;if(o){const d=o.getBoundingClientRect();c={clientWidth:o.clientWidth,scrollLeft:o.scrollLeft,scrollTop:o.scrollTop,scrollWidth:o.scrollWidth,top:d.top,bottom:d.bottom,left:d.left,right:d.right}}if(o&&!1!==ue){const o=Ge.current.children;if(o.length>0){const c=o[Ze.get(ue)];0,d=c?c.getBoundingClientRect():null}}return{tabsMeta:c,tabMeta:d}},Ue=(0,vn.Z)((()=>{const{tabsMeta:o,tabMeta:c}=getTabsMeta();let d,g=0;ve?(d="top",c&&o&&(g=c.top-o.top+o.scrollTop)):(d=m?"right":"left",c&&o&&(g=(m?-1:1)*(c[d]-o[d]+o.scrollLeft)));const b={[d]:g,[xe]:c?c[xe]:0};if("number"!=typeof Me[d]||"number"!=typeof Me[xe])Ie(b);else{const o=Math.abs(Me[d]-b[d]),c=Math.abs(Me[xe]-b[xe]);(o>=1||c>=1)&&Ie(b)}})),scroll=(o,{animation:c=!0}={})=>{c?function animate(o,c,d,g={},m=(()=>{})){const{ease:b=easeInOutSin,duration:S=300}=g;let _=null;const O=c[o];let I=!1;const cancel=()=>{I=!0},step=g=>{if(I)return void m(new Error("Animation cancelled"));null===_&&(_=g);const j=Math.min(1,(g-_)/S);c[o]=b(j)*(d-O)+O,j>=1?requestAnimationFrame((()=>{m(null)})):requestAnimationFrame(step)};return O===d?(m(new Error("Element already at target position")),cancel):(requestAnimationFrame(step),cancel)}(ye,He.current,o,{duration:g.transitions.duration.standard}):He.current[ye]=o},moveTabsScroll=o=>{let c=He.current[ye];c+=ve?o:o*(m?-1:1),scroll(c)},getScrollSize=()=>{const o=He.current[we];let c=0;const d=Array.from(Ge.current.children);for(let g=0;g<d.length;g+=1){const m=d[g];if(c+m[we]>o){0===g&&(c=o);break}c+=m[we]}return c},handleStartScrollClick=()=>{moveTabsScroll(-1*getScrollSize())},handleEndScrollClick=()=>{moveTabsScroll(getScrollSize())},Ve=_.useCallback((o=>{ze({overflow:null,scrollbarWidth:o})}),[]),$e=(0,vn.Z)((o=>{const{tabsMeta:c,tabMeta:d}=getTabsMeta();if(d&&c)if(d[be]<c[be]){const g=c[ye]+(d[be]-c[be]);scroll(g,{animation:o})}else if(d[Se]>c[Se]){const g=c[ye]+(d[Se]-c[Se]);scroll(g,{animation:o})}})),We=(0,vn.Z)((()=>{me&&!1!==ne&&Ne(!Be)}));_.useEffect((()=>{const o=At((()=>{He.current&&Ue()}));let c;const handleMutation=d=>{d.forEach((o=>{o.removedNodes.forEach((o=>{c?.unobserve(o)})),o.addedNodes.forEach((o=>{c?.observe(o)}))})),o(),We()},d=kt(He.current);let g;return d.addEventListener("resize",o),"undefined"!=typeof ResizeObserver&&(c=new ResizeObserver(o),Array.from(Ge.current.children).forEach((o=>{c.observe(o)}))),"undefined"!=typeof MutationObserver&&(g=new MutationObserver(handleMutation),g.observe(Ge.current,{childList:!0})),()=>{o.clear(),d.removeEventListener("resize",o),g?.disconnect(),c?.disconnect()}}),[Ue,We]),_.useEffect((()=>{const o=Array.from(Ge.current.children),c=o.length;if("undefined"!=typeof IntersectionObserver&&c>0&&me&&!1!==ne){const d=o[0],g=o[c-1],m={root:He.current,threshold:.99},b=new IntersectionObserver((o=>{Re(!o[0].isIntersecting)}),m);b.observe(d);const S=new IntersectionObserver((o=>{Le(!o[0].isIntersecting)}),m);return S.observe(g),()=>{b.disconnect(),S.disconnect()}}}),[me,ne,Be,j?.length]),_.useEffect((()=>{Ae(!0)}),[]),_.useEffect((()=>{Ue()})),_.useEffect((()=>{$e(Cn!==Me)}),[$e,Me]),_.useImperativeHandle(O,(()=>({updateIndicator:Ue,updateScrollButtons:We})),[Ue,We]);const qe=(0,te.jsx)(xn,{...se,className:(0,pe.Z)(Te.indicator,se.className),ownerState:Ce,style:{...Me,...se.style}});let Ke=0;const Ye=_.Children.map(j,(o=>{if(!_.isValidElement(o))return null;const c=void 0===o.props.value?Ke:o.props.value;Ze.set(c,Ke);const d=c===ue;return Ke+=1,_.cloneElement(o,{fullWidth:"fullWidth"===de,indicator:d&&!Oe&&qe,selected:d,selectionFollowsFocus:oe,onChange:K,textColor:ce,value:c,...1!==Ke||!1!==ue||o.props.tabIndex?{}:{tabIndex:0}})})),Xe=(()=>{const o={};o.scrollbarSizeListener=me?(0,te.jsx)(_n,{onChange:Ve,className:(0,pe.Z)(Te.scrollableX,Te.hideScrollbar)}):null;const c=me&&("auto"===ne&&(je||De)||!0===ne);return o.scrollButtonStart=c?(0,te.jsx)(re,{slots:{StartScrollButtonIcon:ie.StartScrollButtonIcon},slotProps:{startScrollButtonIcon:Ee},orientation:ee,direction:m?"right":"left",onClick:handleStartScrollClick,disabled:!je,...le,className:(0,pe.Z)(Te.scrollButtons,le.className)}):null,o.scrollButtonEnd=c?(0,te.jsx)(re,{slots:{EndScrollButtonIcon:ie.EndScrollButtonIcon},slotProps:{endScrollButtonIcon:ke},orientation:ee,direction:m?"left":"right",onClick:handleEndScrollClick,disabled:!De,...le,className:(0,pe.Z)(Te.scrollButtons,le.className)}):null,o})();return(0,te.jsxs)(bn,{className:(0,pe.Z)(Te.root,B),ownerState:Ce,ref:c,as:N,...ge,children:[Xe.scrollButtonStart,Xe.scrollbarSizeListener,(0,te.jsxs)(Sn,{className:Te.scroller,ownerState:Ce,style:{overflow:Fe.overflow,[ve?"margin"+(m?"Left":"Right"):"marginBottom"]:he?void 0:-Fe.scrollbarWidth},ref:He,children:[(0,te.jsx)(wn,{"aria-label":b,"aria-labelledby":S,"aria-orientation":"vertical"===ee?"vertical":null,className:Te.flexContainer,ownerState:Ce,onKeyDown:o=>{const c=Ge.current,d=yt(c).activeElement;if("tab"!==d.getAttribute("role"))return;let g="horizontal"===ee?"ArrowLeft":"ArrowUp",b="horizontal"===ee?"ArrowRight":"ArrowDown";switch("horizontal"===ee&&m&&(g="ArrowRight",b="ArrowLeft"),o.key){case g:o.preventDefault(),Tabs_moveFocus(c,d,Tabs_previousItem);break;case b:o.preventDefault(),Tabs_moveFocus(c,d,Tabs_nextItem);break;case"Home":o.preventDefault(),Tabs_moveFocus(c,null,Tabs_nextItem);break;case"End":o.preventDefault(),Tabs_moveFocus(c,null,Tabs_previousItem)}},ref:Ge,role:"tablist",children:Ye}),Oe&&qe]}),Xe.scrollButtonEnd]})}));function getTabUtilityClass(o){return(0,ve.ZP)("MuiTab",o)}const En=(0,me.Z)("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper","icon"]),kn=(0,Se.ZP)(he.Z,{name:"MuiTab",slot:"Root",overridesResolver:(o,c)=>{const{ownerState:d}=o;return[c.root,d.label&&d.icon&&c.labelIcon,c[`textColor${(0,ge.Z)(d.textColor)}`],d.fullWidth&&c.fullWidth,d.wrapped&&c.wrapped,{[`& .${En.iconWrapper}`]:c.iconWrapper},{[`& .${En.icon}`]:c.icon}]}})((0,we.Z)((({theme:o})=>({...o.typography.button,maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center",lineHeight:1.25,variants:[{props:({ownerState:o})=>o.label&&("top"===o.iconPosition||"bottom"===o.iconPosition),style:{flexDirection:"column"}},{props:({ownerState:o})=>o.label&&"top"!==o.iconPosition&&"bottom"!==o.iconPosition,style:{flexDirection:"row"}},{props:({ownerState:o})=>o.icon&&o.label,style:{minHeight:72,paddingTop:9,paddingBottom:9}},{props:({ownerState:o,iconPosition:c})=>o.icon&&o.label&&"top"===c,style:{[`& > .${En.icon}`]:{marginBottom:6}}},{props:({ownerState:o,iconPosition:c})=>o.icon&&o.label&&"bottom"===c,style:{[`& > .${En.icon}`]:{marginTop:6}}},{props:({ownerState:o,iconPosition:c})=>o.icon&&o.label&&"start"===c,style:{[`& > .${En.icon}`]:{marginRight:o.spacing(1)}}},{props:({ownerState:o,iconPosition:c})=>o.icon&&o.label&&"end"===c,style:{[`& > .${En.icon}`]:{marginLeft:o.spacing(1)}}},{props:{textColor:"inherit"},style:{color:"inherit",opacity:.6,[`&.${En.selected}`]:{opacity:1},[`&.${En.disabled}`]:{opacity:(o.vars||o).palette.action.disabledOpacity}}},{props:{textColor:"primary"},style:{color:(o.vars||o).palette.text.secondary,[`&.${En.selected}`]:{color:(o.vars||o).palette.primary.main},[`&.${En.disabled}`]:{color:(o.vars||o).palette.text.disabled}}},{props:{textColor:"secondary"},style:{color:(o.vars||o).palette.text.secondary,[`&.${En.selected}`]:{color:(o.vars||o).palette.secondary.main},[`&.${En.disabled}`]:{color:(o.vars||o).palette.text.disabled}}},{props:({ownerState:o})=>o.fullWidth,style:{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"}},{props:({ownerState:o})=>o.wrapped,style:{fontSize:o.typography.pxToRem(12)}}]})))),Pn=_.forwardRef((function Tab(o,c){const d=(0,_e.i)({props:o,name:"MuiTab"}),{className:g,disabled:m=!1,disableFocusRipple:b=!1,fullWidth:S,icon:O,iconPosition:I="top",indicator:j,label:B,onChange:N,onClick:H,onFocus:$,selected:K,selectionFollowsFocus:ee,textColor:re="inherit",value:ne,wrapped:oe=!1,...ie}=d,ae={...d,disabled:m,disableFocusRipple:b,selected:K,icon:!!O,iconPosition:I,label:!!B,fullWidth:S,textColor:re,wrapped:oe},se=(o=>{const{classes:c,textColor:d,fullWidth:g,wrapped:m,icon:b,label:S,selected:_,disabled:O}=o,I={root:["root",b&&S&&"labelIcon",`textColor${(0,ge.Z)(d)}`,g&&"fullWidth",m&&"wrapped",_&&"selected",O&&"disabled"],icon:["iconWrapper","icon"]};return(0,fe.Z)(I,getTabUtilityClass,c)})(ae),le=O&&B&&_.isValidElement(O)?_.cloneElement(O,{className:(0,pe.Z)(se.icon,O.props.className)}):O;return(0,te.jsxs)(kn,{focusRipple:!b,className:(0,pe.Z)(se.root,g),ref:c,role:"tab","aria-selected":K,disabled:m,onClick:o=>{!K&&N&&N(o,ne),H&&H(o)},onFocus:o=>{ee&&!K&&N&&N(o,ne),$&&$(o)},ownerState:ae,tabIndex:K?0:-1,...ie,children:["top"===I||"start"===I?(0,te.jsxs)(_.Fragment,{children:[le,B]}):(0,te.jsxs)(_.Fragment,{children:[B,le]}),j]})}));var On=__webpack_require__(183),An=__webpack_require__(4477);function src_ownKeys(o,c){var d=Object.keys(o);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(o);c&&(g=g.filter((function(c){return Object.getOwnPropertyDescriptor(o,c).enumerable}))),d.push.apply(d,g)}return d}function src_objectSpread(c){for(var d=1;d<arguments.length;d++){var g=null!=arguments[d]?arguments[d]:{};d%2?src_ownKeys(Object(g),!0).forEach((function(d){(0,o.Z)(c,d,g[d])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(g)):src_ownKeys(Object(g)).forEach((function(o){Object.defineProperty(c,o,Object.getOwnPropertyDescriptor(g,o))}))}return c}var Mn=(0,st.jl)("MediaViewer","MediaUpload");function media_upload_src(o){var m=o.themeType,S=o.onChange,O=o.organizationId,I=o.functionType,j=o.initFile,B=o.config,N=o.createRef,H=void 0===N||N,$=o.disabled,K=o.children,ee=o.acceptedFiles,re=o.maxSize,ne=void 0===re?52428800:re,oe=(0,st.$G)(),ie=oe.t,ae=(oe.i18n,(0,st.Vr)().state.theme),se=(0,_.useState)([]),le=(0,g.Z)(se,2),ce=le[0],ue=le[1],de=(0,_.useState)(),pe=(0,g.Z)(de,2),fe=pe[0],he=pe[1],ge=(0,_.useState)(),me=(0,g.Z)(ge,2),ve=me[0],ye=me[1],be=(0,_.useState)(),Se=(0,g.Z)(be,2),we=Se[0],xe=Se[1],_e=(0,_.useState)(I),Ce=(0,g.Z)(_e,2),Te=Ce[0],Ee=Ce[1],ke=(0,_.useState)([]),Pe=(0,g.Z)(ke,2),Oe=Pe[0],Ae=Pe[1],Me=(0,_.useState)(!1),Ie=(0,g.Z)(Me,2),je=Ie[0],Re=Ie[1],De=(0,_.useState)(!1),Le=(0,g.Z)(De,2),Be=Le[0],Ne=Le[1],Fe=(0,_.useState)(),ze=(0,g.Z)(Fe,2),Ze=ze[0],He=ze[1],Ge=(0,_.useState)("standard"),Ue=(0,g.Z)(Ge,2),Ve=Ue[0],$e=Ue[1],We=(0,_.useState)([]),qe=(0,g.Z)(We,2),Ke=qe[0],Ye=qe[1],Xe=function(){var o=(0,d.Z)(b().mark((function _callee(o){var c,d,g,m,S,_,I,j,N,$,K,ee,te,re;return b().wrap((function _callee$(ne){for(;;)switch(ne.prev=ne.next){case 0:d=[],Re(!0),g=Array.isArray(o)?o:[o],m=[],S=b().mark((function _loop(){var o,c,S;return b().wrap((function _loop$(b){for(;;)switch(b.prev=b.next){case 0:(o=g[_])instanceof Yr?d.push(o):(c=new Yr(B,o,H),(S=m.find((function(o){return o.url===c.url&&o.files.length<=250})))?S.files.push(c):m.push({files:[c],url:c.url}));case 2:case"end":return b.stop()}}),_loop)})),_=0;case 6:if(!(_<g.length)){ne.next=11;break}return ne.delegateYield(S(),"t0",8);case 8:_++,ne.next=6;break;case 11:I=0;case 12:if(!(I<m.length)){ne.next=29;break}return j=m[I],ne.next=16,j.files[0].loadMany({refIds:j.files.map((function(o){return o.ref})),organizationId:O});case 16:N=ne.sent,$=N.mediaItem,K=N.refs,ee=b().mark((function _loop2(){var o,c;return b().wrap((function _loop2$(g){for(;;)switch(g.prev=g.next){case 0:if(o=K[te],c=j.files.find((function(c){return c.ref===o._id}))){g.next=4;break}throw new Error("file with refid "+o._id+" not found");case 4:c.setMediaItemAndRef({item:$,ref:o}),d.push(c);case 6:case"end":return g.stop()}}),_loop2)})),te=0;case 21:if(!(te<K.length)){ne.next=26;break}return ne.delegateYield(ee(),"t1",23);case 23:te++,ne.next=21;break;case 26:I++,ne.next=12;break;case 29:ue(d),d[0].fileName&&(re=d[0].fileName.lastIndexOf("."),he(d[0].fileName.substring(0,re))),ye(d[0].description),xe(d[0].borderPercentage),Ee(d[0].functionType),Ae(null!==(c=d[0].classes)&&void 0!==c?c:[]),$e("SPIN"==d[0].mediaType?"spin":"standard"),Re(!1);case 37:case"end":return ne.stop()}}),_callee)})));return function initState(c){return o.apply(this,arguments)}}();(0,_.useEffect)((function(){j&&Xe(j)}),[j]);var Je=function createState(o){try{var c=new Yr(B,"spin"==Ve?o:o[0],H);ue([c]);var d=c.fileName.lastIndexOf(".");he(c.fileName.substring(0,d)),Ee(c.functionType),He(void 0)}catch(o){He(ie("mediaupload.error.general")),Mn.error(new st.GE("Error creating state",{cause:o,code:"MEDUP_0001"}))}};if(je)return(0,te.jsx)(cn,{});var Qe=Array.isArray(K)?K[K.length-1]:K,et=Array.isArray(K)&&K.length>=2?K.slice(0,K.length-1):(0,te.jsx)(te.Fragment,{});return(0,te.jsx)(On.Z,{theme:"darkmode"==m?(0,An.Z)({palette:{mode:"dark",primary:{main:"rgba(255, 255, 255, 255)"}},typography:{allVariants:{color:"white"}}}):(0,An.Z)(ae),children:(0,te.jsxs)("form",{noValidate:!0,autoComplete:"off",onSubmit:function onSubmit(o){o.preventDefault(),function onSubmit(){"spin"==Ve&&Ke.length>1&&Ke.length<8?He(ie("mediaupload.error.spinsize")):(ce.forEach((function(o){var c=o.fileName.lastIndexOf("."),d=o.fileName.substring(c+1,o.fileName.length);o.fileName="".concat(fe,".").concat(d),o.description=ve,o.borderPercentage=we,o.functionType=Te,o.classes=Oe})),S(ce.length<=1?ce[0]:ce))}()},style:{height:"100%",display:"flex",flexDirection:"column"},children:[Ze&&(0,te.jsx)(Vr,{severity:"error",children:Ze+" --- "+st.Lm.formatDate(new Date,!0,void 0,!0)+(st.Lm.getCurrentTraceId()?" --- "+ie("modal.errorcode")+": "+st.Lm.getCurrentTraceId():"")}),(0,te.jsx)("div",{style:{borderBottom:"1px solid lightgray",marginBottom:"10px"},children:(0,te.jsxs)(Tn,{value:Ve,onChange:function onChange(o,c){return $e(c)},"aria-label":"basic tabs example",textColor:"primary",children:[(0,te.jsx)(Pn,{label:"Standard",value:"standard",disabled:ce[0]&&"standard"!=Ve}),(0,te.jsx)(Pn,{label:"Spin",value:"spin",disabled:ce[0]&&"spin"!=Ve})]})}),(!ce[0]||"spin"==Ve&&Ke.length>0)&&(0,te.jsxs)(te.Fragment,{children:[Be&&(0,te.jsx)(cn,{}),(0,te.jsx)(nt,{fileObjects:Ke,onAdd:function onAddFile(o){if(o.length){var d=[].concat((0,c.Z)(Ke),(0,c.Z)(o));Ye(d),Je(d)}},onDrop:function onDrop(){Ne(!0)},onDelete:function onDelete(o){var d=Ke.findIndex((function(c){return c==o})),g=(0,c.Z)(Ke);g.splice(d,1),Ye(g),Je(g)},onAlert:function onAlert(o,c){Ne(!1),"error"==c?o.includes("File is too big")?(He(ie("mediaupload.error.tobig",{fileName:fe,mb:ne/1048576})),Mn.error(new st.GE(o,{code:"MEDUP_0001"}))):o.includes("File type not supported")?(He(ie("mediaupload.error.wrongtype",{fileName:fe,types:null==ee?void 0:ee.join(", ")})),Mn.error(new st.GE(o,{code:"MEDUP_0001"}))):(He(ie("mediaupload.error.general")),Mn.error(new st.GE(o,{code:"MEDUP_0001"}))):"info"==c&&o&&Mn.log(o)},showPreviewsInDropzone:!1,showPreviews:!0,useChipsForPreview:!0,previewGridProps:{container:{spacing:1,direction:"row"}},dropzoneText:ie("spin"==Ve?"asseteditor.dropzone.spintext":"asseteditor.dropzone.text"),filesLimit:"spin"==Ve?36:1,maxFileSize:ne,showAlerts:!1,disableRejectionFeedback:!0,previewText:ie("asseteditor.dropzone.preview"),acceptedFiles:"spin"==Ve?[".jpg",".png",".jpeg"]:ee}),"spin"!=Ve&&(0,te.jsx)(FileFromWeb,{onEnter:function onFileFromWeb(o){var c=o.lastIndexOf("/"),d=o.substring(c+1,o.length),g=d.lastIndexOf("."),m=d.substring(g,o.length);if(!ee||ee.find((function(o){return o==m})))try{var b=new Yr(B,o,H);ue([b]);var S=b.fileName.lastIndexOf(".");he(b.fileName.substring(0,S)),Ee(b.functionType),He(void 0)}catch(o){He(ie("mediaupload.error.general")),Mn.error(new st.GE("Error creating state",{cause:o,code:"MEDUP_0001"}))}else He(ie("mediaupload.error.wrongtype",{fileName:d,types:ee.join(", ")}))}})]}),ce[0]&&(0,te.jsxs)(te.Fragment,{children:["PCT"==ce[0].mediaType&&(0,te.jsx)("img",{src:ce[0].url,style:{maxHeight:250,alignSelf:"center"}}),(0,te.jsx)(mr,{label:ie("asseteditor.form.mediaType"),fullWidth:!0,defaultValue:ce[0].mediaType,disabled:!0}),(0,te.jsx)(mr,{label:ie("asseteditor.form.fileName"),fullWidth:!0,value:fe||"",onChange:function onChange(o){return he(o.target.value)}}),(0,te.jsx)(mr,{label:ie("asseteditor.form.description"),id:"description",fullWidth:!0,value:ve||"",onChange:function onChange(o){return ye(o.target.value)}}),(0,te.jsx)(mr,{label:ie("asseteditor.form.borderPercentage"),id:"borderPercentage",fullWidth:!0,value:we||"",type:"number",onChange:function onChange(o){return xe(Number(o.target.value))}}),H&&(0,te.jsxs)(ft.Z,{style:{marginTop:12},fullWidth:!0,children:[(0,te.jsx)(pt.Z,{id:"functionTypeLabel",children:ie("asseteditor.form.functionType")}),(0,te.jsx)(fr,{labelId:"functionTypeLabel",id:"functionType",value:Te,disabled:"spin"==Ve,onChange:function onChange(o){Ee(o.target.value)},children:In.map((function(o){return(0,te.jsx)(_r,{value:o,children:"".concat(o," - ").concat(ie("functionType."+o,o))})}))})]}),(0,te.jsx)(Cr.ZP,{label:ie("asseteditor.form.classes"),value:Oe,onAdd:function onAdd(o){return Ae([].concat((0,c.Z)(Oe),[o]))},onDelete:function onDelete(o,d){Oe.splice(d,1),Ae((0,c.Z)(Oe))},fullWidth:!0})]}),et,(0,_.createElement)(Qe.type,src_objectSpread(src_objectSpread({},Qe.props),{},{key:Qe.key,disabled:!ce||H&&!Te||$}))]})})}var In=["PROD","PROD_SEC","PROD_CLOSE","PROD_MILIEU","SHO","CONFIG_INFO","AR_INFO","PROD_DETAIL","CAT","PLN","LOG","FUNC","COMMERCIAL","TPL","ASI","PLT","CAI","BAN","INF","OTH","ART","OPV"]})(),CrystaldesignMediaUpload=S})();