@data-c/ui 0.0.197 → 0.0.198
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/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ Valid keys: `+JSON.stringify(Object.keys(m),null," "));var re=ae($,L,k,D,A+"."+
|
|
|
3
3
|
`)):n.some(i=>i===void 0)&&console.error(`MUI: the styled(${o})(...args) API requires all its args to be defined.`),r(...n)}:r}var bi=(t,e)=>{Array.isArray(t.__emotion_styles)&&(t.__emotion_styles=e(t.__emotion_styles))};function R(){return R=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},R.apply(this,arguments)}function ge(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function Oe(t){if(typeof t!="object"||t===null)return!1;let e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function Ti(t){if(!Oe(t))return t;let e={};return Object.keys(t).forEach(r=>{e[r]=Ti(t[r])}),e}function xe(t,e,r={clone:!0}){let n=r.clone?R({},t):t;return Oe(t)&&Oe(e)&&Object.keys(e).forEach(o=>{o!=="__proto__"&&(Oe(e[o])&&o in t&&Oe(t[o])?n[o]=xe(t[o],e[o],r):r.clone?n[o]=Oe(e[o])?Ti(e[o]):e[o]:n[o]=e[o])}),n}var lu=["values","unit","step"];var uu=t=>{let e=Object.keys(t).map(r=>({key:r,val:t[r]}))||[];return e.sort((r,n)=>r.val-n.val),e.reduce((r,n)=>R({},r,{[n.key]:n.val}),{})};function $n(t){let{values:e={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:r="px",step:n=5}=t,o=ge(t,lu),i=uu(e),s=Object.keys(i);function l(c){return`@media (min-width:${typeof e[c]=="number"?e[c]:c}${r})`}function a(c){return`@media (max-width:${(typeof e[c]=="number"?e[c]:c)-n/100}${r})`}function u(c,d){let y=s.indexOf(d);return`@media (min-width:${typeof e[c]=="number"?e[c]:c}${r}) and (max-width:${(y!==-1&&typeof e[s[y]]=="number"?e[s[y]]:d)-n/100}${r})`}function p(c){return s.indexOf(c)+1<s.length?u(c,s[s.indexOf(c)+1]):l(c)}function f(c){let d=s.indexOf(c);return d===0?l(s[1]):d===s.length-1?a(s[d]):u(c,s[s.indexOf(c)+1]).replace("@media","@media not all and")}return R({keys:s,values:i,up:l,down:a,between:u,only:p,not:f,unit:r},o)}var cu={borderRadius:4},Si=cu;var ct=Ge(sr()),fu=process.env.NODE_ENV!=="production"?ct.default.oneOfType([ct.default.number,ct.default.string,ct.default.object,ct.default.array]):{},be=fu;function pu(t,e){return e?xe(t,e,{clone:!1}):t}var ze=pu;var ar={xs:0,sm:600,md:900,lg:1200,xl:1536},Ci={keys:["xs","sm","md","lg","xl"],up:t=>`@media (min-width:${ar[t]}px)`};function ie(t,e,r){let n=t.theme||{};if(Array.isArray(e)){let i=n.breakpoints||Ci;return e.reduce((s,l,a)=>(s[i.up(i.keys[a])]=r(e[a]),s),{})}if(typeof e=="object"){let i=n.breakpoints||Ci;return Object.keys(e).reduce((s,l)=>{if(Object.keys(i.values||ar).indexOf(l)!==-1){let a=i.up(l);s[a]=r(e[l],l)}else{let a=l;s[a]=e[a]}return s},{})}return r(e)}function Dn(t={}){var e;return((e=t.keys)==null?void 0:e.reduce((n,o)=>{let i=t.up(o);return n[i]={},n},{}))||{}}function Rn(t,e){return t.reduce((r,n)=>{let o=r[n];return(!o||Object.keys(o).length===0)&&delete r[n],r},e)}function Pi(t,...e){let r=Dn(t),n=[r,...e].reduce((o,i)=>xe(o,i),{});return Rn(Object.keys(r),n)}function du(t,e){if(typeof t!="object")return{};let r={},n=Object.keys(e);return Array.isArray(t)?n.forEach((o,i)=>{i<t.length&&(r[o]=!0)}):n.forEach(o=>{t[o]!=null&&(r[o]=!0)}),r}function lr({values:t,breakpoints:e,base:r}){let n=r||du(t,e),o=Object.keys(n);if(o.length===0)return t;let i;return o.reduce((s,l,a)=>(Array.isArray(t)?(s[l]=t[a]!=null?t[a]:t[i],i=a):typeof t=="object"?(s[l]=t[l]!=null?t[l]:t[i],i=l):s[l]=t,s),{})}function Ve(t){if(typeof t!="string")throw new Error(process.env.NODE_ENV!=="production"?"MUI: `capitalize(string)` expects a string argument.":Yt(7));return t.charAt(0).toUpperCase()+t.slice(1)}function ft(t,e,r=!0){if(!e||typeof e!="string")return null;if(t&&t.vars&&r){let n=`vars.${e}`.split(".").reduce((o,i)=>o&&o[i]?o[i]:null,t);if(n!=null)return n}return e.split(".").reduce((n,o)=>n&&n[o]!=null?n[o]:null,t)}function Ft(t,e,r,n=r){let o;return typeof t=="function"?o=t(r):Array.isArray(t)?o=t[r]||n:o=ft(t,r)||n,e&&(o=e(o,n,t)),o}function mu(t){let{prop:e,cssProperty:r=t.prop,themeKey:n,transform:o}=t,i=s=>{if(s[e]==null)return null;let l=s[e],a=s.theme,u=ft(a,n)||{};return ie(s,l,f=>{let c=Ft(u,o,f);return f===c&&typeof f=="string"&&(c=Ft(u,o,`${e}${f==="default"?"":Ve(f)}`,f)),r===!1?c:{[r]:c}})};return i.propTypes=process.env.NODE_ENV!=="production"?{[e]:be}:{},i.filterProps=[e],i}var J=mu;function Bn(t){let e={};return r=>(e[r]===void 0&&(e[r]=t(r)),e[r])}var hu={m:"margin",p:"padding"},gu={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},Ei={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},yu=Bn(t=>{if(t.length>2)if(Ei[t])t=Ei[t];else return[t];let[e,r]=t.split(""),n=hu[e],o=gu[r]||"";return Array.isArray(o)?o.map(i=>n+i):[n+o]}),ur=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],cr=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],In=[...ur,...cr];function Ze(t,e,r,n){var o;let i=(o=ft(t,e,!1))!=null?o:r;return typeof i=="number"?s=>typeof s=="string"?s:(process.env.NODE_ENV!=="production"&&typeof s!="number"&&console.error(`MUI: Expected ${n} argument to be a number or a string, got ${s}.`),i*s):Array.isArray(i)?s=>typeof s=="string"?s:(process.env.NODE_ENV!=="production"&&(Number.isInteger(s)?s>i.length-1&&console.error([`MUI: The value provided (${s}) overflows.`,`The supported values are: ${JSON.stringify(i)}.`,`${s} > ${i.length-1}, you need to add the missing values.`].join(`
|
|
4
4
|
`)):console.error([`MUI: The \`theme.${e}\` array type cannot be combined with non integer values.You should either use an integer value that can be used as index, or define the \`theme.${e}\` as a number.`].join(`
|
|
5
5
|
`))),i[s]):typeof i=="function"?i:(process.env.NODE_ENV!=="production"&&console.error([`MUI: The \`theme.${e}\` value (${i}) is invalid.`,"It should be a number, an array or a function."].join(`
|
|
6
|
-
`)),()=>{})}function Ot(t){return Ze(t,"spacing",8,"spacing")}function ke(t,e){if(typeof e=="string"||e==null)return e;let r=Math.abs(e),n=t(r);return e>=0?n:typeof n=="number"?-n:`-${n}`}function xu(t,e){return r=>t.reduce((n,o)=>(n[o]=ke(e,r),n),{})}function bu(t,e,r,n){if(e.indexOf(r)===-1)return null;let o=yu(r),i=xu(o,n),s=t[r];return ie(t,s,i)}function Ln(t,e){let r=Ot(t.theme);return Object.keys(t).map(n=>bu(t,e,n,r)).reduce(ze,{})}function ee(t){return Ln(t,ur)}ee.propTypes=process.env.NODE_ENV!=="production"?ur.reduce((t,e)=>(t[e]=be,t),{}):{};ee.filterProps=ur;function te(t){return Ln(t,cr)}te.propTypes=process.env.NODE_ENV!=="production"?cr.reduce((t,e)=>(t[e]=be,t),{}):{};te.filterProps=cr;function wi(t){return Ln(t,In)}wi.propTypes=process.env.NODE_ENV!=="production"?In.reduce((t,e)=>(t[e]=be,t),{}):{};wi.filterProps=In;function jn(t=8){if(t.mui)return t;let e=Ot({spacing:t}),r=(...n)=>(process.env.NODE_ENV!=="production"&&(n.length<=4||console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${n.length}`)),(n.length===0?[1]:n).map(i=>{let s=e(i);return typeof s=="number"?`${s}px`:s}).join(" "));return r.mui=!0,r}function vu(...t){let e=t.reduce((n,o)=>(o.filterProps.forEach(i=>{n[i]=o}),n),{}),r=n=>Object.keys(n).reduce((o,i)=>e[i]?ze(o,e[i](n)):o,{});return r.propTypes=process.env.NODE_ENV!=="production"?t.reduce((n,o)=>Object.assign(n,o.propTypes),{}):{},r.filterProps=t.reduce((n,o)=>n.concat(o.filterProps),[]),r}var Ue=vu;function ye(t){return typeof t!="number"?t:`${t}px solid`}function ve(t,e){return J({prop:t,themeKey:"borders",transform:e})}var Tu=ve("border",ye),Su=ve("borderTop",ye),Cu=ve("borderRight",ye),Pu=ve("borderBottom",ye),Eu=ve("borderLeft",ye),wu=ve("borderColor"),Fu=ve("borderTopColor"),Ou=ve("borderRightColor"),ku=ve("borderBottomColor"),_u=ve("borderLeftColor"),Au=ve("outline",ye),Mu=ve("outlineColor"),kt=t=>{if(t.borderRadius!==void 0&&t.borderRadius!==null){let e=Ze(t.theme,"shape.borderRadius",4,"borderRadius"),r=n=>({borderRadius:ke(e,n)});return ie(t,t.borderRadius,r)}return null};kt.propTypes=process.env.NODE_ENV!=="production"?{borderRadius:be}:{};kt.filterProps=["borderRadius"];var ey=Ue(Tu,Su,Cu,Pu,Eu,wu,Fu,Ou,ku,_u,kt,Au,Mu);var _t=t=>{if(t.gap!==void 0&&t.gap!==null){let e=Ze(t.theme,"spacing",8,"gap"),r=n=>({gap:ke(e,n)});return ie(t,t.gap,r)}return null};_t.propTypes=process.env.NODE_ENV!=="production"?{gap:be}:{};_t.filterProps=["gap"];var At=t=>{if(t.columnGap!==void 0&&t.columnGap!==null){let e=Ze(t.theme,"spacing",8,"columnGap"),r=n=>({columnGap:ke(e,n)});return ie(t,t.columnGap,r)}return null};At.propTypes=process.env.NODE_ENV!=="production"?{columnGap:be}:{};At.filterProps=["columnGap"];var Mt=t=>{if(t.rowGap!==void 0&&t.rowGap!==null){let e=Ze(t.theme,"spacing",8,"rowGap"),r=n=>({rowGap:ke(e,n)});return ie(t,t.rowGap,r)}return null};Mt.propTypes=process.env.NODE_ENV!=="production"?{rowGap:be}:{};Mt.filterProps=["rowGap"];var $u=J({prop:"gridColumn"}),Du=J({prop:"gridRow"}),Ru=J({prop:"gridAutoFlow"}),Bu=J({prop:"gridAutoColumns"}),Iu=J({prop:"gridAutoRows"}),Lu=J({prop:"gridTemplateColumns"}),ju=J({prop:"gridTemplateRows"}),Nu=J({prop:"gridTemplateAreas"}),zu=J({prop:"gridArea"}),ay=Ue(_t,At,Mt,$u,Du,Ru,Bu,Iu,Lu,ju,Nu,zu);function Xe(t,e){return e==="grey"?e:t}var Vu=J({prop:"color",themeKey:"palette",transform:Xe}),Uu=J({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Xe}),qu=J({prop:"backgroundColor",themeKey:"palette",transform:Xe}),fy=Ue(Vu,Uu,qu);function de(t){return t<=1&&t!==0?`${t*100}%`:t}var Wu=J({prop:"width",transform:de}),fr=t=>{if(t.maxWidth!==void 0&&t.maxWidth!==null){let e=r=>{var n,o;let i=((n=t.theme)==null||(n=n.breakpoints)==null||(n=n.values)==null?void 0:n[r])||ar[r];return i?((o=t.theme)==null||(o=o.breakpoints)==null?void 0:o.unit)!=="px"?{maxWidth:`${i}${t.theme.breakpoints.unit}`}:{maxWidth:i}:{maxWidth:de(r)}};return ie(t,t.maxWidth,e)}return null};fr.filterProps=["maxWidth"];var Yu=J({prop:"minWidth",transform:de}),Gu=J({prop:"height",transform:de}),Ku=J({prop:"maxHeight",transform:de}),Hu=J({prop:"minHeight",transform:de}),gy=J({prop:"size",cssProperty:"width",transform:de}),yy=J({prop:"size",cssProperty:"height",transform:de}),Zu=J({prop:"boxSizing"}),xy=Ue(Wu,fr,Yu,Gu,Ku,Hu,Zu);var Xu={border:{themeKey:"borders",transform:ye},borderTop:{themeKey:"borders",transform:ye},borderRight:{themeKey:"borders",transform:ye},borderBottom:{themeKey:"borders",transform:ye},borderLeft:{themeKey:"borders",transform:ye},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:ye},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:kt},color:{themeKey:"palette",transform:Xe},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Xe},backgroundColor:{themeKey:"palette",transform:Xe},p:{style:te},pt:{style:te},pr:{style:te},pb:{style:te},pl:{style:te},px:{style:te},py:{style:te},padding:{style:te},paddingTop:{style:te},paddingRight:{style:te},paddingBottom:{style:te},paddingLeft:{style:te},paddingX:{style:te},paddingY:{style:te},paddingInline:{style:te},paddingInlineStart:{style:te},paddingInlineEnd:{style:te},paddingBlock:{style:te},paddingBlockStart:{style:te},paddingBlockEnd:{style:te},m:{style:ee},mt:{style:ee},mr:{style:ee},mb:{style:ee},ml:{style:ee},mx:{style:ee},my:{style:ee},margin:{style:ee},marginTop:{style:ee},marginRight:{style:ee},marginBottom:{style:ee},marginLeft:{style:ee},marginX:{style:ee},marginY:{style:ee},marginInline:{style:ee},marginInlineStart:{style:ee},marginInlineEnd:{style:ee},marginBlock:{style:ee},marginBlockStart:{style:ee},marginBlockEnd:{style:ee},displayPrint:{cssProperty:!1,transform:t=>({"@media print":{display:t}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:_t},rowGap:{style:Mt},columnGap:{style:At},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:de},maxWidth:{style:fr},minWidth:{transform:de},height:{transform:de},maxHeight:{transform:de},minHeight:{transform:de},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}},pt=Xu;function Ju(...t){let e=t.reduce((n,o)=>n.concat(Object.keys(o)),[]),r=new Set(e);return t.every(n=>r.size===Object.keys(n).length)}function Qu(t,e){return typeof t=="function"?t(e):t}function ec(){function t(r,n,o,i){let s={[r]:n,theme:o},l=i[r];if(!l)return{[r]:n};let{cssProperty:a=r,themeKey:u,transform:p,style:f}=l;if(n==null)return null;if(u==="typography"&&n==="inherit")return{[r]:n};let c=ft(o,u)||{};return f?f(s):ie(s,n,y=>{let x=Ft(c,p,y);return y===x&&typeof y=="string"&&(x=Ft(c,p,`${r}${y==="default"?"":Ve(y)}`,y)),a===!1?x:{[a]:x}})}function e(r){var n;let{sx:o,theme:i={}}=r||{};if(!o)return null;let s=(n=i.unstable_sxConfig)!=null?n:pt;function l(a){let u=a;if(typeof a=="function")u=a(i);else if(typeof a!="object")return a;if(!u)return null;let p=Dn(i.breakpoints),f=Object.keys(p),c=p;return Object.keys(u).forEach(d=>{let y=Qu(u[d],i);if(y!=null)if(typeof y=="object")if(s[d])c=ze(c,t(d,y,i,s));else{let x=ie({theme:i},y,v=>({[d]:v}));Ju(x,y)?c[d]=e({sx:y,theme:i}):c=ze(c,x)}else c=ze(c,t(d,y,i,s))}),Rn(f,c)}return Array.isArray(o)?o.map(l):l(o)}return e}var Fi=ec();Fi.filterProps=["sx"];var $t=Fi;function Nn(t,e){let r=this;return r.vars&&typeof r.getColorSchemeSelector=="function"?{[r.getColorSchemeSelector(t).replace(/(\[[^\]]+\])/,"*:where($1)")]:e}:r.palette.mode===t?e:{}}var tc=["breakpoints","palette","spacing","shape"];function rc(t={},...e){let{breakpoints:r={},palette:n={},spacing:o,shape:i={}}=t,s=ge(t,tc),l=$n(r),a=jn(o),u=xe({breakpoints:l,direction:"ltr",components:{},palette:R({mode:"light"},n),spacing:a,shape:R({},Si,i)},s);return u.applyStyles=Nn,u=e.reduce((p,f)=>xe(p,f),u),u.unstable_sxConfig=R({},pt,s==null?void 0:s.unstable_sxConfig),u.unstable_sx=function(f){return $t({sx:f,theme:this})},u}var Je=rc;function nc(t){return Object.keys(t).length===0}function oc(t=null){let e=Oi.useContext(_react2.ThemeContext);return!e||nc(e)?t:e}var ki=oc;var ic=Je();function sc(t=ic){return ki(t)}var _i=sc;var ac=["sx"],lc=t=>{var e,r;let n={systemProps:{},otherProps:{}},o=(e=t==null||(r=t.theme)==null?void 0:r.unstable_sxConfig)!=null?e:pt;return Object.keys(t).forEach(i=>{o[i]?n.systemProps[i]=t[i]:n.otherProps[i]=t[i]}),n};function pr(t){let{sx:e}=t,r=ge(t,ac),{systemProps:n,otherProps:o}=lc(r),i;return Array.isArray(e)?i=[n,...e]:typeof e=="function"?i=(...s)=>{let l=e(...s);return Oe(l)?R({},n,l):n}:i=R({},n,e),R({},o,{sx:i})}var Ai=t=>t,uc=()=>{let t=Ai;return{configure(e){t=e},generate(e){return t(e)},reset(){t=Ai}}},cc=uc(),zn=cc;function Mi(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(e=0;e<o;e++)t[e]&&(r=Mi(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function fc(){for(var t,e,r=0,n="",o=arguments.length;r<o;r++)(t=arguments[r])&&(e=Mi(t))&&(n&&(n+=" "),n+=e);return n}var $i=fc;var pc={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function dr(t,e,r="Mui"){let n=pc[e];return n?`${r}-${n}`:`${zn.generate(t)}-${e}`}var Pr=Ge(Ii()),hc=/^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;function gc(t){let e=`${t}`.match(hc);return e&&e[1]||""}function ji(t,e=""){return t.displayName||t.name||gc(t)||e}function Li(t,e,r){let n=ji(e);return t.displayName||(n!==""?`${r}(${n})`:r)}function Er(t){if(t!=null){if(typeof t=="string")return t;if(typeof t=="function")return ji(t,"Component");if(typeof t=="object")switch(t.$$typeof){case Pr.ForwardRef:return Li(t,t.render,"ForwardRef");case Pr.Memo:return Li(t,t.type,"memo");default:return}}}var yc=["ownerState"],xc=["variants"],bc=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function vc(t){return Object.keys(t).length===0}function Tc(t){return typeof t=="string"&&t.charCodeAt(0)>96}function Wn(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}var Sc=Je(),Ni=t=>t&&t.charAt(0).toLowerCase()+t.slice(1);function wr({defaultTheme:t,theme:e,themeId:r}){return vc(e)?t:e[r]||e}function Cc(t){return t?(e,r)=>r[t]:null}function Fr(t,e){let{ownerState:r}=e,n=ge(e,yc),o=typeof t=="function"?t(R({ownerState:r},n)):t;if(Array.isArray(o))return o.flatMap(i=>Fr(i,R({ownerState:r},n)));if(o&&typeof o=="object"&&Array.isArray(o.variants)){let{variants:i=[]}=o,l=ge(o,xc);return i.forEach(a=>{let u=!0;typeof a.props=="function"?u=a.props(R({ownerState:r},n,r)):Object.keys(a.props).forEach(p=>{(r==null?void 0:r[p])!==a.props[p]&&n[p]!==a.props[p]&&(u=!1)}),u&&(Array.isArray(l)||(l=[l]),l.push(typeof a.style=="function"?a.style(R({ownerState:r},n,r)):a.style))}),l}return o}function Yn(t={}){let{themeId:e,defaultTheme:r=Sc,rootShouldForwardProp:n=Wn,slotShouldForwardProp:o=Wn}=t,i=s=>$t(R({},s,{theme:wr(R({},s,{defaultTheme:r,themeId:e}))}));return i.__mui_systemSx=!0,(s,l={})=>{bi(s,E=>E.filter(z=>!(z!=null&&z.__mui_systemSx)));let{name:a,slot:u,skipVariantsResolver:p,skipSx:f,overridesResolver:c=Cc(Ni(u))}=l,d=ge(l,bc),y=p!==void 0?p:u&&u!=="Root"&&u!=="root"||!1,x=f||!1,v;process.env.NODE_ENV!=="production"&&a&&(v=`${a}-${Ni(u||"Root")}`);let C=Wn;u==="Root"||u==="root"?C=n:u?C=o:Tc(s)&&(C=void 0);let M=Mn(s,R({shouldForwardProp:C,label:v},d)),_=E=>typeof E=="function"&&E.__emotion_real!==E||Oe(E)?z=>Fr(E,R({},z,{theme:wr({theme:z.theme,defaultTheme:r,themeId:e})})):E,w=(E,...z)=>{let K=_(E),j=z?z.map(_):[];a&&c&&j.push(b=>{let F=wr(R({},b,{defaultTheme:r,themeId:e}));if(!F.components||!F.components[a]||!F.components[a].styleOverrides)return null;let m=F.components[a].styleOverrides,h={};return Object.entries(m).forEach(([O,P])=>{h[O]=Fr(P,R({},b,{theme:F}))}),c(b,h)}),a&&!y&&j.push(b=>{var F;let m=wr(R({},b,{defaultTheme:r,themeId:e})),h=m==null||(F=m.components)==null||(F=F[a])==null?void 0:F.variants;return Fr({variants:h},R({},b,{theme:m}))}),x||j.push(i);let H=j.length-z.length;if(Array.isArray(E)&&H>0){let b=new Array(H).fill("");K=[...E,...b],K.raw=[...E.raw,...b]}let V=M(K,...j);if(process.env.NODE_ENV!=="production"){let b;a&&(b=`${a}${Ve(u||"")}`),b===void 0&&(b=`Styled(${Er(s)})`),V.displayName=b}return s.muiName&&(V.muiName=s.muiName),V};return M.withConfig&&(w.withConfig=M.withConfig),w}}var Pc=Yn(),zi=Pc;function Dt(t,e){let r=R({},e);return Object.keys(t).forEach(n=>{if(n.toString().match(/^(components|slots)$/))r[n]=R({},t[n],r[n]);else if(n.toString().match(/^(componentsProps|slotProps)$/)){let o=t[n]||{},i=e[n];r[n]={},!i||!Object.keys(i)?r[n]=o:!o||!Object.keys(o)?r[n]=i:(r[n]=R({},i),Object.keys(o).forEach(s=>{r[n][s]=Dt(o[s],i[s])}))}else r[n]===void 0&&(r[n]=t[n])}),r}function Gn(t){let{theme:e,name:r,props:n}=t;return!e||!e.components||!e.components[r]||!e.components[r].defaultProps?n:Dt(e.components[r].defaultProps,n)}function Or({props:t,name:e,defaultTheme:r,themeId:n}){let o=_i(r);return n&&(o=o[n]||o),Gn({theme:o,name:e,props:t})}function kr(t,e,r=void 0){let n={};return Object.keys(t).forEach(o=>{n[o]=t[o].reduce((i,s)=>{if(s){let l=e(s);l!==""&&i.push(l),r&&r[s]&&i.push(r[s])}return i},[]).join(" ")}),n}var Z=Ge(sr());var Q=Ge(sr());var Ec=["component","direction","spacing","divider","children","className","useFlexGap"],Fc=Je(),Oc=zi("div",{name:"MuiStack",slot:"Root",overridesResolver:(t,e)=>e.root});function kc(t){return Or({props:t,name:"MuiStack",defaultTheme:Fc})}function _c(t,e){let r=dt.Children.toArray(t).filter(Boolean);return r.reduce((n,o,i)=>(n.push(o),i<r.length-1&&n.push(dt.cloneElement(e,{key:`separator-${i}`})),n),[])}var Ac=t=>({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[t],Mc=({ownerState:t,theme:e})=>{let r=R({display:"flex",flexDirection:"column"},ie({theme:e},lr({values:t.direction,breakpoints:e.breakpoints.values}),n=>({flexDirection:n})));if(t.spacing){let n=Ot(e),o=Object.keys(e.breakpoints.values).reduce((a,u)=>((typeof t.spacing=="object"&&t.spacing[u]!=null||typeof t.direction=="object"&&t.direction[u]!=null)&&(a[u]=!0),a),{}),i=lr({values:t.direction,base:o}),s=lr({values:t.spacing,base:o});typeof i=="object"&&Object.keys(i).forEach((a,u,p)=>{if(!i[a]){let c=u>0?i[p[u-1]]:"column";i[a]=c}}),r=xe(r,ie({theme:e},s,(a,u)=>t.useFlexGap?{gap:ke(n,a)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${Ac(u?i[u]:t.direction)}`]:ke(n,a)}}))}return r=Pi(e.breakpoints,r),r};function Kn(t={}){let{createStyledComponent:e=Oc,useThemeProps:r=kc,componentName:n="MuiStack"}=t,o=()=>kr({root:["root"]},a=>dr(n,a),{}),i=e(Mc),s=dt.forwardRef(function(a,u){let p=r(a),f=pr(p),{component:c="div",direction:d="column",spacing:y=0,divider:x,children:v,className:C,useFlexGap:M=!1}=f,_=ge(f,Ec),w={direction:d,spacing:y,useFlexGap:M},E=o();return _jsxruntime.jsx.call(void 0, i,R({as:c,ownerState:w,ref:u,className:$i(E.root,C)},_,{children:x?_c(v,x):v}))});return process.env.NODE_ENV!=="production"&&(s.propTypes={children:Q.default.node,direction:Q.default.oneOfType([Q.default.oneOf(["column-reverse","column","row-reverse","row"]),Q.default.arrayOf(Q.default.oneOf(["column-reverse","column","row-reverse","row"])),Q.default.object]),divider:Q.default.node,spacing:Q.default.oneOfType([Q.default.arrayOf(Q.default.oneOfType([Q.default.number,Q.default.string])),Q.default.number,Q.default.object,Q.default.string]),sx:Q.default.oneOfType([Q.default.arrayOf(Q.default.oneOfType([Q.default.func,Q.default.object,Q.default.bool])),Q.default.func,Q.default.object])}),s}var Vi=Kn();process.env.NODE_ENV!=="production"&&(Vi.propTypes={children:Z.default.node,component:Z.default.elementType,direction:Z.default.oneOfType([Z.default.oneOf(["column-reverse","column","row-reverse","row"]),Z.default.arrayOf(Z.default.oneOf(["column-reverse","column","row-reverse","row"])),Z.default.object]),divider:Z.default.node,spacing:Z.default.oneOfType([Z.default.arrayOf(Z.default.oneOfType([Z.default.number,Z.default.string])),Z.default.number,Z.default.object,Z.default.string]),sx:Z.default.oneOfType([Z.default.arrayOf(Z.default.oneOfType([Z.default.func,Z.default.object,Z.default.bool])),Z.default.func,Z.default.object]),useFlexGap:Z.default.bool});var _r=Vi;var Bc=_styled2.default.call(void 0, (0, _material.Typography))(({theme:t})=>({fontWeight:"bold"}));function Wi(t){let{label:e,children:r,labelProps:n,contentProps:o,isNumber:i,showDivider:s}=t;return _jsxruntime.jsxs.call(void 0, _material.Box,{sx:{display:"flex",gap:4},children:[_jsxruntime.jsxs.call(void 0, _material.Box,{children:[_jsxruntime.jsx.call(void 0, _r,{children:_jsxruntime.jsx.call(void 0, Bc,B(g({},n),{children:e}))}),_jsxruntime.jsx.call(void 0, _r,{direction:i?"row":"column",justifyContent:i?"flex-end":"center",children:r})]}),s&&_jsxruntime.jsx.call(void 0, _material.Divider,{orientation:"vertical",flexItem:!0})]})}function Mr(t){let{typographyProps:e,onChange:r,onEscape:n,value:o,displayEditButton:i,displaySaveButton:s,textFieldProps:l,isEditing:a,isLoading:u,error:p}=t,z=l||{},{InputProps:f,value:c,onKeyDown:d,onChange:y}=z,x=X(z,["InputProps","value","onKeyDown","onChange"]),[v,C]=_react.useState.call(void 0, !1),[M,_]=_react.useState.call(void 0, !1),[w,E]=_react.useState.call(void 0, );return _react.useEffect.call(void 0, ()=>{E(o)},[o]),_react.useEffect.call(void 0, ()=>{C(!!a)},[a]),_react.useEffect.call(void 0, ()=>{p&&_(!0)},[p]),_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[!v&&!u&&!M&&_jsxruntime.jsxs.call(void 0, _material.Stack,{sx:{cursor:"pointer"},direction:"row",alignItems:"center",spacing:1,children:[_jsxruntime.jsx.call(void 0, _material.Typography,B(g({onClick:()=>{C(!0)}},e),{children:w})),i&&_jsxruntime.jsx.call(void 0, _material.IconButton,{onClick:()=>{C(!0)},children:_jsxruntime.jsx.call(void 0, _iconsmaterial.Edit,{})})]}),(v||u||M)&&_jsxruntime.jsx.call(void 0, _material.ClickAwayListener,{onClickAway:()=>C(!1),children:_jsxruntime.jsx.call(void 0, _material.TextField,g({disabled:u,autoFocus:!0,value:w,error:M,onKeyDown:K=>{K.key==="Enter"&&(r(w),C(!1)),K.key==="Escape"&&(E(o),C(!1),_(!1),n&&n(o,w))},onChange:K=>{let j=K.target.value;E(j)},InputProps:{endAdornment:_jsxruntime.jsxs.call(void 0, _material.InputAdornment,{position:"end",children:[u&&_jsxruntime.jsx.call(void 0, _material.CircularProgress,{size:18}),s&&_jsxruntime.jsx.call(void 0, _material.IconButton,{onClick:()=>{o!=w&&r(w),C(!1)},edge:"end",children:o!=w?_jsxruntime.jsx.call(void 0, _iconsmaterial.Save,{}):_jsxruntime.jsx.call(void 0, _iconsmaterial.Cancel,{})})]})}},x))})]})}var _lodash = require('lodash'); var _lodash2 = _interopRequireDefault(_lodash);function mt(t){let i=t,{onSearch:e}=i,r=X(i,["onSearch"]),n=_lodash2.default.debounce(s=>e(s),500);function o(s){let l=s.target.value;n(l)}return _jsxruntime.jsx.call(void 0, _material.TextField,g({onChange:o,autoFocus:!0,InputProps:{startAdornment:_jsxruntime.jsx.call(void 0, _material.InputAdornment,{position:"start",children:_jsxruntime.jsx.call(void 0, _iconsmaterial.Search,{})})}},r))}function Xi(t){let{title:e,children:r,onBack:n,onClose:o,onUpdate:i,onSearch:s,storagePath:l,toolbarProps:a}=t,[u,p]=_react.useState.call(void 0, !1),[f,c]=_react.useState.call(void 0, "");_react.useEffect.call(void 0, ()=>{c(e)},[e]);let d=_react.useRef.call(void 0, null);_react.useEffect.call(void 0, ()=>{if(s&&l){let C=localStorage.getItem(l);d.current&&(d.current.value=C),s(C||"")}},[l]);let y=_material.useMediaQuery.call(void 0, C=>C.breakpoints.down("sm"));function x(C){l&&localStorage.setItem(l,C),s&&s(C)}let v={component:"h1",variant:"h4",sx:{fontWeight:"500"}};return _jsxruntime.jsx.call(void 0, _material.Toolbar,B(g({},a),{children:_jsxruntime.jsxs.call(void 0, _material.Box,{sx:{display:"flex",flexDirection:y||o?"column":"row",justifyContent:"space-between",alignContent:"center",alignItems:"center",flexGrow:1},children:[_jsxruntime.jsxs.call(void 0, _material.Box,{sx:{display:"flex",alignItems:"center",flexDirection:"row"},children:[n&&_jsxruntime.jsx.call(void 0, _material.IconButton,{sx:{mr:1},onClick:n,children:_jsxruntime.jsx.call(void 0, _iconsmaterial.ArrowBack,{})}),i&&_jsxruntime.jsx.call(void 0, Mr,{typographyProps:v,value:f,onChange:C=>{i&&i(C)}}),!i&&_jsxruntime.jsx.call(void 0, _material.Typography,B(g({},v),{children:e}))]}),o&&_jsxruntime.jsx.call(void 0, _material.IconButton,{sx:{marginLeft:"auto"},onClick:o,children:_jsxruntime.jsx.call(void 0, _iconsmaterial.Close,{fontSize:"medium"})}),_jsxruntime.jsxs.call(void 0, _material.Stack,{spacing:1,children:[s&&_jsxruntime.jsx.call(void 0, mt,{inputRef:d,autoFocus:!0,onSearch:x}),r]})]})}))}function ro(t){let b=t,{value:e,label:r,options:n,isLoading:o,form:i,table:s,tableProps:l,onChange:a,onSearch:u,renderValue:p,dialogProps:f,disabled:c,filterOptions:d,optionKeyName:y}=b,x=X(b,["value","label","options","isLoading","form","table","tableProps","onChange","onSearch","renderValue","dialogProps","disabled","filterOptions","optionKeyName"]),{isOpen:v,openDialog:C,closeDialog:M}=_hooks.useDialog.call(void 0, ),[_,w]=_react.useState.call(void 0, null),E=i||Oi.default.Fragment,z=_lodash2.default.debounce(F=>u(F),500),K=_react.useCallback.call(void 0, (F,m)=>ue(this,null,function*(){z(m)}),[z]),j=_react.useCallback.call(void 0, (F,m,h)=>{if(y&&(m!=null&&m[y].includes("Adicionar op\xE7\xE3o:"))){let O=m[y].replace("Adicionar op\xE7\xE3o:","").trim().replace(/["']/g,""),P=B(g({},m),{[y]:O});a&&a(P);return}a&&a(m)},[a]);function H(F,m=!1,h=!1){var O;if(F){let P=Oi.default.Children.toArray((O=F.props)==null?void 0:O.children),k=P.length===1?0:1;return P.splice(k,0,_jsxruntime.jsx.call(void 0, _material.IconButton,{sx:{padding:"2px"},size:"small",color:"default",onClick:()=>C(),disabled:h,children:_jsxruntime.jsx.call(void 0, _iconsmaterial.SearchOutlined,{fontSize:"small"})})),m&&P.unshift(_jsxruntime.jsx.call(void 0, _material.IconButton,{disabled:!0,children:_jsxruntime.jsx.call(void 0, _material.CircularProgress,{color:"primary",size:18})})),Oi.default.cloneElement(F,{},P)}return F}function V(F,m){if(!y)return F;let O=_material.createFilterOptions.call(void 0, )(F,m),{inputValue:P}=m,k=F.some(D=>P===D[y]);return P!==""&&!k&&O.push({[y]:`Adicionar op\xE7\xE3o: "${P}"`}),O}return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, _material.Autocomplete,{disabled:c,loadingText:"Carregando...",loading:o,onChange:j,value:e,onInputChange:K,options:n,getOptionLabel:p,filterOptions:V,renderInput:F=>_jsxruntime.jsx.call(void 0, _material.TextField,g(B(g({label:r,onDoubleClick:()=>{c||C()}},F),{InputProps:B(g({},F.InputProps),{endAdornment:H(F.InputProps.endAdornment,o,c)}),disabled:c}),x)),clearIcon:_jsxruntime.jsx.call(void 0, _iconsmaterial.BackspaceOutlined,{}),componentsProps:{clearIndicator:{sx:{visibility:"visible"}}},noOptionsText:"Nenhum registro"}),_jsxruntime.jsx.call(void 0, _providers.FormProvider,{children:_jsxruntime.jsx.call(void 0, Ee,B(g({open:v,onClose:()=>M(),actions:"none"},f),{children:_jsxruntime.jsxs.call(void 0, _material.Stack,{spacing:1,children:[_jsxruntime.jsxs.call(void 0, _material.Stack,{direction:"row",justifyContent:"flex-end",alignItems:"center",spacing:1,children:[_jsxruntime.jsx.call(void 0, mt,{placeholder:"Pesquisar",onSearch:F=>w(F)}),i&&_jsxruntime.jsx.call(void 0, E,{})]}),_jsxruntime.jsx.call(void 0, s,g({query:_,enableTransporter:!0,onTransport:F=>{M(),a&&a(F)}},l))]})}))})]})}var hf={dialogProps:{maxWidth:"md",fullWidth:!0}};ro.defaultProps=hf;function no(t){let{label:e}=t;return _jsxruntime.jsx.call(void 0, _material.Stack,{component:"header",sx:{alignItems:"center",gap:1},children:_jsxruntime.jsx.call(void 0, _material.Typography,{component:"h1",variant:"h3",sx:{fontWeight:"medium",color:r=>r.palette.grey[600]},children:e})})}var _axios = require('axios');var Ce=Ge(as()),Rt=Ge(cs()),gs=Ge(ps()),Bf=Object.prototype.toString,If=Error.prototype.toString,Lf=RegExp.prototype.toString,jf=typeof Symbol!="undefined"?Symbol.prototype.toString:()=>"",Nf=/^Symbol\((.*)\)(.*)$/;function zf(t){return t!=+t?"NaN":t===0&&1/t<0?"-0":""+t}function ds(t,e=!1){if(t==null||t===!0||t===!1)return""+t;let r=typeof t;if(r==="number")return zf(t);if(r==="string")return e?`"${t}"`:t;if(r==="function")return"[Function "+(t.name||"anonymous")+"]";if(r==="symbol")return jf.call(t).replace(Nf,"Symbol($1)");let n=Bf.call(t).slice(8,-1);return n==="Date"?isNaN(t.getTime())?""+t:t.toISOString(t):n==="Error"||t instanceof Error?"["+If.call(t)+"]":n==="RegExp"?Lf.call(t):null}function De(t,e){let r=ds(t,e);return r!==null?r:JSON.stringify(t,function(n,o){let i=ds(this[n],e);return i!==null?i:o},2)}function ys(t){return t==null?[]:[].concat(t)}var xs,bs,vs,Vf=/\$\{\s*(\w+)\s*\}/g;xs=Symbol.toStringTag;var Lr=class{constructor(e,r,n,o){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[xs]="Error",this.name="ValidationError",this.value=r,this.path=n,this.type=o,this.errors=[],this.inner=[],ys(e).forEach(i=>{if(fe.isError(i)){this.errors.push(...i.errors);let s=i.inner.length?i.inner:[i];this.inner.push(...s)}else this.errors.push(i)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}};bs=Symbol.hasInstance;vs=Symbol.toStringTag;var fe=class extends Error{static formatError(e,r){let n=r.label||r.path||"this";return n!==r.path&&(r=Object.assign({},r,{path:n})),typeof e=="string"?e.replace(Vf,(o,i)=>De(r[i])):typeof e=="function"?e(r):e}static isError(e){return e&&e.name==="ValidationError"}constructor(e,r,n,o,i){let s=new Lr(e,r,n,o);if(i)return s;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[vs]="Error",this.name=s.name,this.message=s.message,this.type=s.type,this.value=s.value,this.path=s.path,this.errors=s.errors,this.inner=s.inner,Error.captureStackTrace&&Error.captureStackTrace(this,fe)}static[bs](e){return Lr[Symbol.hasInstance](e)||super[Symbol.hasInstance](e)}},_e={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:t,type:e,value:r,originalValue:n})=>{let o=n!=null&&n!==r?` (cast from the value \`${De(n,!0)}\`).`:".";return e!=="mixed"?`${t} must be a \`${e}\` type, but the final value was: \`${De(r,!0)}\``+o:`${t} must match the configured type. The validated value was: \`${De(r,!0)}\``+o}},me={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},We={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},co={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},fo={isValue:"${path} field must be ${value}"},po={noUnknown:"${path} field has unspecified keys: ${unknown}"},Br={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},Ts={notType:t=>{let{path:e,value:r,spec:n}=t,o=n.types.length;if(Array.isArray(r)){if(r.length<o)return`${e} tuple value has too few items, expected a length of ${o} but got ${r.length} for value: \`${De(r,!0)}\``;if(r.length>o)return`${e} tuple value has too many items, expected a length of ${o} but got ${r.length} for value: \`${De(r,!0)}\``}return fe.formatError(_e.notType,t)}},_v=Object.assign(Object.create(null),{mixed:_e,string:me,number:We,date:co,object:po,array:Br,boolean:fo,tuple:Ts}),Yr=t=>t&&t.__isYupSchema__,yt=class{static fromOptions(e,r){if(!r.then&&!r.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:n,then:o,otherwise:i}=r,s=typeof n=="function"?n:(...l)=>l.every(a=>a===n);return new yt(e,(l,a)=>{var u;let p=s(...l)?o:i;return(u=p==null?void 0:p(a))!=null?u:a})}constructor(e,r){this.fn=void 0,this.refs=e,this.refs=e,this.fn=r}resolve(e,r){let n=this.refs.map(i=>i.getValue(r==null?void 0:r.value,r==null?void 0:r.parent,r==null?void 0:r.context)),o=this.fn(n,e,r);if(o===void 0||o===e)return e;if(!Yr(o))throw new TypeError("conditions must return a schema object");return o.resolve(r)}},Rr={context:"$",value:"."};var Re=class{constructor(e,r={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof e!="string")throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),e==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===Rr.context,this.isValue=this.key[0]===Rr.value,this.isSibling=!this.isContext&&!this.isValue;let n=this.isContext?Rr.context:this.isValue?Rr.value:"";this.path=this.key.slice(n.length),this.getter=this.path&&(0,Ce.getter)(this.path,!0),this.map=r.map}getValue(e,r,n){let o=this.isContext?n:this.isValue?e:r;return this.getter&&(o=this.getter(o||{})),this.map&&(o=this.map(o)),o}cast(e,r){return this.getValue(e,r==null?void 0:r.parent,r==null?void 0:r.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}};Re.prototype.__isYupRef=!0;var we=t=>t==null;function ht(t){function e({value:r,path:n="",options:o,originalValue:i,schema:s},l,a){let{name:u,test:p,params:f,message:c,skipAbsent:d}=t,{parent:y,context:x,abortEarly:v=s.spec.abortEarly,disableStackTrace:C=s.spec.disableStackTrace}=o;function M(b){return Re.isRef(b)?b.getValue(r,y,x):b}function _(b={}){let F=Object.assign({value:r,originalValue:i,label:s.spec.label,path:b.path||n,spec:s.spec,disableStackTrace:b.disableStackTrace||C},f,b.params);for(let h of Object.keys(F))F[h]=M(F[h]);let m=new fe(fe.formatError(b.message||c,F),r,F.path,b.type||u,F.disableStackTrace);return m.params=F,m}let w=v?l:a,E={path:n,parent:y,type:u,from:o.from,createError:_,resolve:M,options:o,originalValue:i,schema:s},z=b=>{fe.isError(b)?w(b):b?a(null):w(_())},K=b=>{fe.isError(b)?w(b):l(b)};if(d&&we(r))return z(!0);let H;try{var V;if(H=p.call(E,r,E),typeof((V=H)==null?void 0:V.then)=="function"){if(o.sync)throw new Error(`Validation test of type: "${E.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(H).then(z,K)}}catch(b){K(b);return}z(H)}return e.OPTIONS=t,e}function Uf(t,e,r,n=r){let o,i,s;return e?((0,Ce.forEach)(e,(l,a,u)=>{let p=a?l.slice(1,l.length-1):l;t=t.resolve({context:n,parent:o,value:r});let f=t.type==="tuple",c=u?parseInt(p,10):0;if(t.innerType||f){if(f&&!u)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${s}" must contain an index to the tuple element, e.g. "${s}[0]"`);if(r&&c>=r.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${l}, in the path: ${e}. because there is no value at that index. `);o=r,r=r&&r[c],t=f?t.spec.types[c]:t.innerType}if(!u){if(!t.fields||!t.fields[p])throw new Error(`The schema does not contain the path: ${e}. (failed at: ${s} which is a type: "${t.type}")`);o=r,r=r&&r[p],t=t.fields[p]}i=p,s=a?"["+l+"]":"."+l}),{schema:t,parent:o,parentPath:i}):{parent:o,parentPath:e,schema:t}}var xt=class extends Set{describe(){let e=[];for(let r of this.values())e.push(Re.isRef(r)?r.describe():r);return e}resolveAll(e){let r=[];for(let n of this.values())r.push(e(n));return r}clone(){return new xt(this.values())}merge(e,r){let n=this.clone();return e.forEach(o=>n.add(o)),r.forEach(o=>n.delete(o)),n}};function gt(t,e=new Map){if(Yr(t)||!t||typeof t!="object")return t;if(e.has(t))return e.get(t);let r;if(t instanceof Date)r=new Date(t.getTime()),e.set(t,r);else if(t instanceof RegExp)r=new RegExp(t),e.set(t,r);else if(Array.isArray(t)){r=new Array(t.length),e.set(t,r);for(let n=0;n<t.length;n++)r[n]=gt(t[n],e)}else if(t instanceof Map){r=new Map,e.set(t,r);for(let[n,o]of t.entries())r.set(n,gt(o,e))}else if(t instanceof Set){r=new Set,e.set(t,r);for(let n of t)r.add(gt(n,e))}else if(t instanceof Object){r={},e.set(t,r);for(let[n,o]of Object.entries(t))r[n]=gt(o,e)}else throw Error(`Unable to clone ${t}`);return r}var se=class{constructor(e){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new xt,this._blacklist=new xt,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(_e.notType)}),this.type=e.type,this._typeCheck=e.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},e==null?void 0:e.spec),this.withMutation(r=>{r.nonNullable()})}get _type(){return this.type}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;let r=Object.create(Object.getPrototypeOf(this));return r.type=this.type,r._typeCheck=this._typeCheck,r._whitelist=this._whitelist.clone(),r._blacklist=this._blacklist.clone(),r.internalTests=Object.assign({},this.internalTests),r.exclusiveTests=Object.assign({},this.exclusiveTests),r.deps=[...this.deps],r.conditions=[...this.conditions],r.tests=[...this.tests],r.transforms=[...this.transforms],r.spec=gt(Object.assign({},this.spec,e)),r}label(e){let r=this.clone();return r.spec.label=e,r}meta(...e){if(e.length===0)return this.spec.meta;let r=this.clone();return r.spec.meta=Object.assign(r.spec.meta||{},e[0]),r}withMutation(e){let r=this._mutate;this._mutate=!0;let n=e(this);return this._mutate=r,n}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let r=this,n=e.clone(),o=Object.assign({},r.spec,n.spec);return n.spec=o,n.internalTests=Object.assign({},r.internalTests,n.internalTests),n._whitelist=r._whitelist.merge(e._whitelist,e._blacklist),n._blacklist=r._blacklist.merge(e._blacklist,e._whitelist),n.tests=r.tests,n.exclusiveTests=r.exclusiveTests,n.withMutation(i=>{e.tests.forEach(s=>{i.test(s.OPTIONS)})}),n.transforms=[...r.transforms,...n.transforms],n}isType(e){return e==null?!!(this.spec.nullable&&e===null||this.spec.optional&&e===void 0):this._typeCheck(e)}resolve(e){let r=this;if(r.conditions.length){let n=r.conditions;r=r.clone(),r.conditions=[],r=n.reduce((o,i)=>i.resolve(o,e),r),r=r.resolve(e)}return r}resolveOptions(e){var r,n,o,i;return Object.assign({},e,{from:e.from||[],strict:(r=e.strict)!=null?r:this.spec.strict,abortEarly:(n=e.abortEarly)!=null?n:this.spec.abortEarly,recursive:(o=e.recursive)!=null?o:this.spec.recursive,disableStackTrace:(i=e.disableStackTrace)!=null?i:this.spec.disableStackTrace})}cast(e,r={}){let n=this.resolve(Object.assign({value:e},r)),o=r.assert==="ignore-optionality",i=n._cast(e,r);if(r.assert!==!1&&!n.isType(i)){if(o&&we(i))return i;let s=De(e),l=De(i);throw new TypeError(`The value of ${r.path||"field"} could not be cast to a value that satisfies the schema type: "${n.type}".
|
|
6
|
+
`)),()=>{})}function Ot(t){return Ze(t,"spacing",8,"spacing")}function ke(t,e){if(typeof e=="string"||e==null)return e;let r=Math.abs(e),n=t(r);return e>=0?n:typeof n=="number"?-n:`-${n}`}function xu(t,e){return r=>t.reduce((n,o)=>(n[o]=ke(e,r),n),{})}function bu(t,e,r,n){if(e.indexOf(r)===-1)return null;let o=yu(r),i=xu(o,n),s=t[r];return ie(t,s,i)}function Ln(t,e){let r=Ot(t.theme);return Object.keys(t).map(n=>bu(t,e,n,r)).reduce(ze,{})}function ee(t){return Ln(t,ur)}ee.propTypes=process.env.NODE_ENV!=="production"?ur.reduce((t,e)=>(t[e]=be,t),{}):{};ee.filterProps=ur;function te(t){return Ln(t,cr)}te.propTypes=process.env.NODE_ENV!=="production"?cr.reduce((t,e)=>(t[e]=be,t),{}):{};te.filterProps=cr;function wi(t){return Ln(t,In)}wi.propTypes=process.env.NODE_ENV!=="production"?In.reduce((t,e)=>(t[e]=be,t),{}):{};wi.filterProps=In;function jn(t=8){if(t.mui)return t;let e=Ot({spacing:t}),r=(...n)=>(process.env.NODE_ENV!=="production"&&(n.length<=4||console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${n.length}`)),(n.length===0?[1]:n).map(i=>{let s=e(i);return typeof s=="number"?`${s}px`:s}).join(" "));return r.mui=!0,r}function vu(...t){let e=t.reduce((n,o)=>(o.filterProps.forEach(i=>{n[i]=o}),n),{}),r=n=>Object.keys(n).reduce((o,i)=>e[i]?ze(o,e[i](n)):o,{});return r.propTypes=process.env.NODE_ENV!=="production"?t.reduce((n,o)=>Object.assign(n,o.propTypes),{}):{},r.filterProps=t.reduce((n,o)=>n.concat(o.filterProps),[]),r}var Ue=vu;function ye(t){return typeof t!="number"?t:`${t}px solid`}function ve(t,e){return J({prop:t,themeKey:"borders",transform:e})}var Tu=ve("border",ye),Su=ve("borderTop",ye),Cu=ve("borderRight",ye),Pu=ve("borderBottom",ye),Eu=ve("borderLeft",ye),wu=ve("borderColor"),Fu=ve("borderTopColor"),Ou=ve("borderRightColor"),ku=ve("borderBottomColor"),_u=ve("borderLeftColor"),Au=ve("outline",ye),Mu=ve("outlineColor"),kt=t=>{if(t.borderRadius!==void 0&&t.borderRadius!==null){let e=Ze(t.theme,"shape.borderRadius",4,"borderRadius"),r=n=>({borderRadius:ke(e,n)});return ie(t,t.borderRadius,r)}return null};kt.propTypes=process.env.NODE_ENV!=="production"?{borderRadius:be}:{};kt.filterProps=["borderRadius"];var ey=Ue(Tu,Su,Cu,Pu,Eu,wu,Fu,Ou,ku,_u,kt,Au,Mu);var _t=t=>{if(t.gap!==void 0&&t.gap!==null){let e=Ze(t.theme,"spacing",8,"gap"),r=n=>({gap:ke(e,n)});return ie(t,t.gap,r)}return null};_t.propTypes=process.env.NODE_ENV!=="production"?{gap:be}:{};_t.filterProps=["gap"];var At=t=>{if(t.columnGap!==void 0&&t.columnGap!==null){let e=Ze(t.theme,"spacing",8,"columnGap"),r=n=>({columnGap:ke(e,n)});return ie(t,t.columnGap,r)}return null};At.propTypes=process.env.NODE_ENV!=="production"?{columnGap:be}:{};At.filterProps=["columnGap"];var Mt=t=>{if(t.rowGap!==void 0&&t.rowGap!==null){let e=Ze(t.theme,"spacing",8,"rowGap"),r=n=>({rowGap:ke(e,n)});return ie(t,t.rowGap,r)}return null};Mt.propTypes=process.env.NODE_ENV!=="production"?{rowGap:be}:{};Mt.filterProps=["rowGap"];var $u=J({prop:"gridColumn"}),Du=J({prop:"gridRow"}),Ru=J({prop:"gridAutoFlow"}),Bu=J({prop:"gridAutoColumns"}),Iu=J({prop:"gridAutoRows"}),Lu=J({prop:"gridTemplateColumns"}),ju=J({prop:"gridTemplateRows"}),Nu=J({prop:"gridTemplateAreas"}),zu=J({prop:"gridArea"}),ay=Ue(_t,At,Mt,$u,Du,Ru,Bu,Iu,Lu,ju,Nu,zu);function Xe(t,e){return e==="grey"?e:t}var Vu=J({prop:"color",themeKey:"palette",transform:Xe}),Uu=J({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Xe}),qu=J({prop:"backgroundColor",themeKey:"palette",transform:Xe}),fy=Ue(Vu,Uu,qu);function de(t){return t<=1&&t!==0?`${t*100}%`:t}var Wu=J({prop:"width",transform:de}),fr=t=>{if(t.maxWidth!==void 0&&t.maxWidth!==null){let e=r=>{var n,o;let i=((n=t.theme)==null||(n=n.breakpoints)==null||(n=n.values)==null?void 0:n[r])||ar[r];return i?((o=t.theme)==null||(o=o.breakpoints)==null?void 0:o.unit)!=="px"?{maxWidth:`${i}${t.theme.breakpoints.unit}`}:{maxWidth:i}:{maxWidth:de(r)}};return ie(t,t.maxWidth,e)}return null};fr.filterProps=["maxWidth"];var Yu=J({prop:"minWidth",transform:de}),Gu=J({prop:"height",transform:de}),Ku=J({prop:"maxHeight",transform:de}),Hu=J({prop:"minHeight",transform:de}),gy=J({prop:"size",cssProperty:"width",transform:de}),yy=J({prop:"size",cssProperty:"height",transform:de}),Zu=J({prop:"boxSizing"}),xy=Ue(Wu,fr,Yu,Gu,Ku,Hu,Zu);var Xu={border:{themeKey:"borders",transform:ye},borderTop:{themeKey:"borders",transform:ye},borderRight:{themeKey:"borders",transform:ye},borderBottom:{themeKey:"borders",transform:ye},borderLeft:{themeKey:"borders",transform:ye},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:ye},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:kt},color:{themeKey:"palette",transform:Xe},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Xe},backgroundColor:{themeKey:"palette",transform:Xe},p:{style:te},pt:{style:te},pr:{style:te},pb:{style:te},pl:{style:te},px:{style:te},py:{style:te},padding:{style:te},paddingTop:{style:te},paddingRight:{style:te},paddingBottom:{style:te},paddingLeft:{style:te},paddingX:{style:te},paddingY:{style:te},paddingInline:{style:te},paddingInlineStart:{style:te},paddingInlineEnd:{style:te},paddingBlock:{style:te},paddingBlockStart:{style:te},paddingBlockEnd:{style:te},m:{style:ee},mt:{style:ee},mr:{style:ee},mb:{style:ee},ml:{style:ee},mx:{style:ee},my:{style:ee},margin:{style:ee},marginTop:{style:ee},marginRight:{style:ee},marginBottom:{style:ee},marginLeft:{style:ee},marginX:{style:ee},marginY:{style:ee},marginInline:{style:ee},marginInlineStart:{style:ee},marginInlineEnd:{style:ee},marginBlock:{style:ee},marginBlockStart:{style:ee},marginBlockEnd:{style:ee},displayPrint:{cssProperty:!1,transform:t=>({"@media print":{display:t}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:_t},rowGap:{style:Mt},columnGap:{style:At},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:de},maxWidth:{style:fr},minWidth:{transform:de},height:{transform:de},maxHeight:{transform:de},minHeight:{transform:de},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}},pt=Xu;function Ju(...t){let e=t.reduce((n,o)=>n.concat(Object.keys(o)),[]),r=new Set(e);return t.every(n=>r.size===Object.keys(n).length)}function Qu(t,e){return typeof t=="function"?t(e):t}function ec(){function t(r,n,o,i){let s={[r]:n,theme:o},l=i[r];if(!l)return{[r]:n};let{cssProperty:a=r,themeKey:u,transform:p,style:f}=l;if(n==null)return null;if(u==="typography"&&n==="inherit")return{[r]:n};let c=ft(o,u)||{};return f?f(s):ie(s,n,y=>{let x=Ft(c,p,y);return y===x&&typeof y=="string"&&(x=Ft(c,p,`${r}${y==="default"?"":Ve(y)}`,y)),a===!1?x:{[a]:x}})}function e(r){var n;let{sx:o,theme:i={}}=r||{};if(!o)return null;let s=(n=i.unstable_sxConfig)!=null?n:pt;function l(a){let u=a;if(typeof a=="function")u=a(i);else if(typeof a!="object")return a;if(!u)return null;let p=Dn(i.breakpoints),f=Object.keys(p),c=p;return Object.keys(u).forEach(d=>{let y=Qu(u[d],i);if(y!=null)if(typeof y=="object")if(s[d])c=ze(c,t(d,y,i,s));else{let x=ie({theme:i},y,v=>({[d]:v}));Ju(x,y)?c[d]=e({sx:y,theme:i}):c=ze(c,x)}else c=ze(c,t(d,y,i,s))}),Rn(f,c)}return Array.isArray(o)?o.map(l):l(o)}return e}var Fi=ec();Fi.filterProps=["sx"];var $t=Fi;function Nn(t,e){let r=this;return r.vars&&typeof r.getColorSchemeSelector=="function"?{[r.getColorSchemeSelector(t).replace(/(\[[^\]]+\])/,"*:where($1)")]:e}:r.palette.mode===t?e:{}}var tc=["breakpoints","palette","spacing","shape"];function rc(t={},...e){let{breakpoints:r={},palette:n={},spacing:o,shape:i={}}=t,s=ge(t,tc),l=$n(r),a=jn(o),u=xe({breakpoints:l,direction:"ltr",components:{},palette:R({mode:"light"},n),spacing:a,shape:R({},Si,i)},s);return u.applyStyles=Nn,u=e.reduce((p,f)=>xe(p,f),u),u.unstable_sxConfig=R({},pt,s==null?void 0:s.unstable_sxConfig),u.unstable_sx=function(f){return $t({sx:f,theme:this})},u}var Je=rc;function nc(t){return Object.keys(t).length===0}function oc(t=null){let e=Oi.useContext(_react2.ThemeContext);return!e||nc(e)?t:e}var ki=oc;var ic=Je();function sc(t=ic){return ki(t)}var _i=sc;var ac=["sx"],lc=t=>{var e,r;let n={systemProps:{},otherProps:{}},o=(e=t==null||(r=t.theme)==null?void 0:r.unstable_sxConfig)!=null?e:pt;return Object.keys(t).forEach(i=>{o[i]?n.systemProps[i]=t[i]:n.otherProps[i]=t[i]}),n};function pr(t){let{sx:e}=t,r=ge(t,ac),{systemProps:n,otherProps:o}=lc(r),i;return Array.isArray(e)?i=[n,...e]:typeof e=="function"?i=(...s)=>{let l=e(...s);return Oe(l)?R({},n,l):n}:i=R({},n,e),R({},o,{sx:i})}var Ai=t=>t,uc=()=>{let t=Ai;return{configure(e){t=e},generate(e){return t(e)},reset(){t=Ai}}},cc=uc(),zn=cc;function Mi(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(e=0;e<o;e++)t[e]&&(r=Mi(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function fc(){for(var t,e,r=0,n="",o=arguments.length;r<o;r++)(t=arguments[r])&&(e=Mi(t))&&(n&&(n+=" "),n+=e);return n}var $i=fc;var pc={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function dr(t,e,r="Mui"){let n=pc[e];return n?`${r}-${n}`:`${zn.generate(t)}-${e}`}var Pr=Ge(Ii()),hc=/^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;function gc(t){let e=`${t}`.match(hc);return e&&e[1]||""}function ji(t,e=""){return t.displayName||t.name||gc(t)||e}function Li(t,e,r){let n=ji(e);return t.displayName||(n!==""?`${r}(${n})`:r)}function Er(t){if(t!=null){if(typeof t=="string")return t;if(typeof t=="function")return ji(t,"Component");if(typeof t=="object")switch(t.$$typeof){case Pr.ForwardRef:return Li(t,t.render,"ForwardRef");case Pr.Memo:return Li(t,t.type,"memo");default:return}}}var yc=["ownerState"],xc=["variants"],bc=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function vc(t){return Object.keys(t).length===0}function Tc(t){return typeof t=="string"&&t.charCodeAt(0)>96}function Wn(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}var Sc=Je(),Ni=t=>t&&t.charAt(0).toLowerCase()+t.slice(1);function wr({defaultTheme:t,theme:e,themeId:r}){return vc(e)?t:e[r]||e}function Cc(t){return t?(e,r)=>r[t]:null}function Fr(t,e){let{ownerState:r}=e,n=ge(e,yc),o=typeof t=="function"?t(R({ownerState:r},n)):t;if(Array.isArray(o))return o.flatMap(i=>Fr(i,R({ownerState:r},n)));if(o&&typeof o=="object"&&Array.isArray(o.variants)){let{variants:i=[]}=o,l=ge(o,xc);return i.forEach(a=>{let u=!0;typeof a.props=="function"?u=a.props(R({ownerState:r},n,r)):Object.keys(a.props).forEach(p=>{(r==null?void 0:r[p])!==a.props[p]&&n[p]!==a.props[p]&&(u=!1)}),u&&(Array.isArray(l)||(l=[l]),l.push(typeof a.style=="function"?a.style(R({ownerState:r},n,r)):a.style))}),l}return o}function Yn(t={}){let{themeId:e,defaultTheme:r=Sc,rootShouldForwardProp:n=Wn,slotShouldForwardProp:o=Wn}=t,i=s=>$t(R({},s,{theme:wr(R({},s,{defaultTheme:r,themeId:e}))}));return i.__mui_systemSx=!0,(s,l={})=>{bi(s,E=>E.filter(z=>!(z!=null&&z.__mui_systemSx)));let{name:a,slot:u,skipVariantsResolver:p,skipSx:f,overridesResolver:c=Cc(Ni(u))}=l,d=ge(l,bc),y=p!==void 0?p:u&&u!=="Root"&&u!=="root"||!1,x=f||!1,v;process.env.NODE_ENV!=="production"&&a&&(v=`${a}-${Ni(u||"Root")}`);let C=Wn;u==="Root"||u==="root"?C=n:u?C=o:Tc(s)&&(C=void 0);let M=Mn(s,R({shouldForwardProp:C,label:v},d)),_=E=>typeof E=="function"&&E.__emotion_real!==E||Oe(E)?z=>Fr(E,R({},z,{theme:wr({theme:z.theme,defaultTheme:r,themeId:e})})):E,w=(E,...z)=>{let K=_(E),j=z?z.map(_):[];a&&c&&j.push(b=>{let F=wr(R({},b,{defaultTheme:r,themeId:e}));if(!F.components||!F.components[a]||!F.components[a].styleOverrides)return null;let m=F.components[a].styleOverrides,h={};return Object.entries(m).forEach(([O,P])=>{h[O]=Fr(P,R({},b,{theme:F}))}),c(b,h)}),a&&!y&&j.push(b=>{var F;let m=wr(R({},b,{defaultTheme:r,themeId:e})),h=m==null||(F=m.components)==null||(F=F[a])==null?void 0:F.variants;return Fr({variants:h},R({},b,{theme:m}))}),x||j.push(i);let H=j.length-z.length;if(Array.isArray(E)&&H>0){let b=new Array(H).fill("");K=[...E,...b],K.raw=[...E.raw,...b]}let V=M(K,...j);if(process.env.NODE_ENV!=="production"){let b;a&&(b=`${a}${Ve(u||"")}`),b===void 0&&(b=`Styled(${Er(s)})`),V.displayName=b}return s.muiName&&(V.muiName=s.muiName),V};return M.withConfig&&(w.withConfig=M.withConfig),w}}var Pc=Yn(),zi=Pc;function Dt(t,e){let r=R({},e);return Object.keys(t).forEach(n=>{if(n.toString().match(/^(components|slots)$/))r[n]=R({},t[n],r[n]);else if(n.toString().match(/^(componentsProps|slotProps)$/)){let o=t[n]||{},i=e[n];r[n]={},!i||!Object.keys(i)?r[n]=o:!o||!Object.keys(o)?r[n]=i:(r[n]=R({},i),Object.keys(o).forEach(s=>{r[n][s]=Dt(o[s],i[s])}))}else r[n]===void 0&&(r[n]=t[n])}),r}function Gn(t){let{theme:e,name:r,props:n}=t;return!e||!e.components||!e.components[r]||!e.components[r].defaultProps?n:Dt(e.components[r].defaultProps,n)}function Or({props:t,name:e,defaultTheme:r,themeId:n}){let o=_i(r);return n&&(o=o[n]||o),Gn({theme:o,name:e,props:t})}function kr(t,e,r=void 0){let n={};return Object.keys(t).forEach(o=>{n[o]=t[o].reduce((i,s)=>{if(s){let l=e(s);l!==""&&i.push(l),r&&r[s]&&i.push(r[s])}return i},[]).join(" ")}),n}var Z=Ge(sr());var Q=Ge(sr());var Ec=["component","direction","spacing","divider","children","className","useFlexGap"],Fc=Je(),Oc=zi("div",{name:"MuiStack",slot:"Root",overridesResolver:(t,e)=>e.root});function kc(t){return Or({props:t,name:"MuiStack",defaultTheme:Fc})}function _c(t,e){let r=dt.Children.toArray(t).filter(Boolean);return r.reduce((n,o,i)=>(n.push(o),i<r.length-1&&n.push(dt.cloneElement(e,{key:`separator-${i}`})),n),[])}var Ac=t=>({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[t],Mc=({ownerState:t,theme:e})=>{let r=R({display:"flex",flexDirection:"column"},ie({theme:e},lr({values:t.direction,breakpoints:e.breakpoints.values}),n=>({flexDirection:n})));if(t.spacing){let n=Ot(e),o=Object.keys(e.breakpoints.values).reduce((a,u)=>((typeof t.spacing=="object"&&t.spacing[u]!=null||typeof t.direction=="object"&&t.direction[u]!=null)&&(a[u]=!0),a),{}),i=lr({values:t.direction,base:o}),s=lr({values:t.spacing,base:o});typeof i=="object"&&Object.keys(i).forEach((a,u,p)=>{if(!i[a]){let c=u>0?i[p[u-1]]:"column";i[a]=c}}),r=xe(r,ie({theme:e},s,(a,u)=>t.useFlexGap?{gap:ke(n,a)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${Ac(u?i[u]:t.direction)}`]:ke(n,a)}}))}return r=Pi(e.breakpoints,r),r};function Kn(t={}){let{createStyledComponent:e=Oc,useThemeProps:r=kc,componentName:n="MuiStack"}=t,o=()=>kr({root:["root"]},a=>dr(n,a),{}),i=e(Mc),s=dt.forwardRef(function(a,u){let p=r(a),f=pr(p),{component:c="div",direction:d="column",spacing:y=0,divider:x,children:v,className:C,useFlexGap:M=!1}=f,_=ge(f,Ec),w={direction:d,spacing:y,useFlexGap:M},E=o();return _jsxruntime.jsx.call(void 0, i,R({as:c,ownerState:w,ref:u,className:$i(E.root,C)},_,{children:x?_c(v,x):v}))});return process.env.NODE_ENV!=="production"&&(s.propTypes={children:Q.default.node,direction:Q.default.oneOfType([Q.default.oneOf(["column-reverse","column","row-reverse","row"]),Q.default.arrayOf(Q.default.oneOf(["column-reverse","column","row-reverse","row"])),Q.default.object]),divider:Q.default.node,spacing:Q.default.oneOfType([Q.default.arrayOf(Q.default.oneOfType([Q.default.number,Q.default.string])),Q.default.number,Q.default.object,Q.default.string]),sx:Q.default.oneOfType([Q.default.arrayOf(Q.default.oneOfType([Q.default.func,Q.default.object,Q.default.bool])),Q.default.func,Q.default.object])}),s}var Vi=Kn();process.env.NODE_ENV!=="production"&&(Vi.propTypes={children:Z.default.node,component:Z.default.elementType,direction:Z.default.oneOfType([Z.default.oneOf(["column-reverse","column","row-reverse","row"]),Z.default.arrayOf(Z.default.oneOf(["column-reverse","column","row-reverse","row"])),Z.default.object]),divider:Z.default.node,spacing:Z.default.oneOfType([Z.default.arrayOf(Z.default.oneOfType([Z.default.number,Z.default.string])),Z.default.number,Z.default.object,Z.default.string]),sx:Z.default.oneOfType([Z.default.arrayOf(Z.default.oneOfType([Z.default.func,Z.default.object,Z.default.bool])),Z.default.func,Z.default.object]),useFlexGap:Z.default.bool});var _r=Vi;var Bc=_styled2.default.call(void 0, (0, _material.Typography))(({theme:t})=>({fontWeight:"bold"}));function Wi(t){let{label:e,children:r,labelProps:n,contentProps:o,isNumber:i,showDivider:s}=t;return _jsxruntime.jsxs.call(void 0, _material.Box,{sx:{display:"flex",gap:4},children:[_jsxruntime.jsxs.call(void 0, _material.Box,{children:[_jsxruntime.jsx.call(void 0, _r,{children:_jsxruntime.jsx.call(void 0, Bc,B(g({},n),{children:e}))}),_jsxruntime.jsx.call(void 0, _r,{direction:i?"row":"column",justifyContent:i?"flex-end":"center",children:r})]}),s&&_jsxruntime.jsx.call(void 0, _material.Divider,{orientation:"vertical",flexItem:!0})]})}function Mr(t){let{typographyProps:e,onChange:r,onEscape:n,value:o,displayEditButton:i,displaySaveButton:s,textFieldProps:l,isEditing:a,isLoading:u,error:p}=t,z=l||{},{InputProps:f,value:c,onKeyDown:d,onChange:y}=z,x=X(z,["InputProps","value","onKeyDown","onChange"]),[v,C]=_react.useState.call(void 0, !1),[M,_]=_react.useState.call(void 0, !1),[w,E]=_react.useState.call(void 0, );return _react.useEffect.call(void 0, ()=>{E(o)},[o]),_react.useEffect.call(void 0, ()=>{C(!!a)},[a]),_react.useEffect.call(void 0, ()=>{p&&_(!0)},[p]),_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[!v&&!u&&!M&&_jsxruntime.jsxs.call(void 0, _material.Stack,{sx:{cursor:"pointer"},direction:"row",alignItems:"center",spacing:1,children:[_jsxruntime.jsx.call(void 0, _material.Typography,B(g({onClick:()=>{C(!0)}},e),{children:w})),i&&_jsxruntime.jsx.call(void 0, _material.IconButton,{onClick:()=>{C(!0)},children:_jsxruntime.jsx.call(void 0, _iconsmaterial.Edit,{})})]}),(v||u||M)&&_jsxruntime.jsx.call(void 0, _material.ClickAwayListener,{onClickAway:()=>C(!1),children:_jsxruntime.jsx.call(void 0, _material.TextField,g({disabled:u,autoFocus:!0,value:w,error:M,onKeyDown:K=>{K.key==="Enter"&&(r(w),C(!1)),K.key==="Escape"&&(E(o),C(!1),_(!1),n&&n(o,w))},onChange:K=>{let j=K.target.value;E(j)},InputProps:{endAdornment:_jsxruntime.jsxs.call(void 0, _material.InputAdornment,{position:"end",children:[u&&_jsxruntime.jsx.call(void 0, _material.CircularProgress,{size:18}),s&&_jsxruntime.jsx.call(void 0, _material.IconButton,{onClick:()=>{o!=w&&r(w),C(!1)},edge:"end",children:o!=w?_jsxruntime.jsx.call(void 0, _iconsmaterial.Save,{}):_jsxruntime.jsx.call(void 0, _iconsmaterial.Cancel,{})})]})}},x))})]})}var _lodash = require('lodash'); var _lodash2 = _interopRequireDefault(_lodash);function mt(t){let i=t,{onSearch:e}=i,r=X(i,["onSearch"]),n=_lodash2.default.debounce(s=>e(s),500);function o(s){let l=s.target.value;n(l)}return _jsxruntime.jsx.call(void 0, _material.TextField,g({onChange:o,autoFocus:!0,InputProps:{startAdornment:_jsxruntime.jsx.call(void 0, _material.InputAdornment,{position:"start",children:_jsxruntime.jsx.call(void 0, _iconsmaterial.Search,{})})}},r))}function Xi(t){let{title:e,children:r,onBack:n,onClose:o,onUpdate:i,onSearch:s,storagePath:l,toolbarProps:a}=t,[u,p]=_react.useState.call(void 0, !1),[f,c]=_react.useState.call(void 0, "");_react.useEffect.call(void 0, ()=>{c(e)},[e]);let d=_react.useRef.call(void 0, null);_react.useEffect.call(void 0, ()=>{if(s&&l){let C=localStorage.getItem(l);d.current&&(d.current.value=C),s(C||"")}},[l]);let y=_material.useMediaQuery.call(void 0, C=>C.breakpoints.down("sm"));function x(C){l&&localStorage.setItem(l,C),s&&s(C)}let v={component:"h1",variant:"h4",sx:{fontWeight:"500"}};return _jsxruntime.jsx.call(void 0, _material.Toolbar,B(g({},a),{children:_jsxruntime.jsxs.call(void 0, _material.Box,{sx:{display:"flex",flexDirection:y||o?"column":"row",justifyContent:"space-between",alignContent:"center",alignItems:"center",flexGrow:1},children:[_jsxruntime.jsxs.call(void 0, _material.Box,{sx:{display:"flex",alignItems:"center",flexDirection:"row"},children:[n&&_jsxruntime.jsx.call(void 0, _material.IconButton,{sx:{mr:1},onClick:n,children:_jsxruntime.jsx.call(void 0, _iconsmaterial.ArrowBack,{})}),i&&_jsxruntime.jsx.call(void 0, Mr,{typographyProps:v,value:f,onChange:C=>{i&&i(C)}}),!i&&_jsxruntime.jsx.call(void 0, _material.Typography,B(g({},v),{children:e}))]}),o&&_jsxruntime.jsx.call(void 0, _material.IconButton,{sx:{marginLeft:"auto"},onClick:o,children:_jsxruntime.jsx.call(void 0, _iconsmaterial.Close,{fontSize:"medium"})}),_jsxruntime.jsxs.call(void 0, _material.Stack,{spacing:1,direction:"row",children:[s&&_jsxruntime.jsx.call(void 0, mt,{inputRef:d,autoFocus:!0,onSearch:x}),r]})]})}))}function ro(t){let b=t,{value:e,label:r,options:n,isLoading:o,form:i,table:s,tableProps:l,onChange:a,onSearch:u,renderValue:p,dialogProps:f,disabled:c,filterOptions:d,optionKeyName:y}=b,x=X(b,["value","label","options","isLoading","form","table","tableProps","onChange","onSearch","renderValue","dialogProps","disabled","filterOptions","optionKeyName"]),{isOpen:v,openDialog:C,closeDialog:M}=_hooks.useDialog.call(void 0, ),[_,w]=_react.useState.call(void 0, null),E=i||Oi.default.Fragment,z=_lodash2.default.debounce(F=>u(F),500),K=_react.useCallback.call(void 0, (F,m)=>ue(this,null,function*(){z(m)}),[z]),j=_react.useCallback.call(void 0, (F,m,h)=>{if(y&&(m!=null&&m[y].includes("Adicionar op\xE7\xE3o:"))){let O=m[y].replace("Adicionar op\xE7\xE3o:","").trim().replace(/["']/g,""),P=B(g({},m),{[y]:O});a&&a(P);return}a&&a(m)},[a]);function H(F,m=!1,h=!1){var O;if(F){let P=Oi.default.Children.toArray((O=F.props)==null?void 0:O.children),k=P.length===1?0:1;return P.splice(k,0,_jsxruntime.jsx.call(void 0, _material.IconButton,{sx:{padding:"2px"},size:"small",color:"default",onClick:()=>C(),disabled:h,children:_jsxruntime.jsx.call(void 0, _iconsmaterial.SearchOutlined,{fontSize:"small"})})),m&&P.unshift(_jsxruntime.jsx.call(void 0, _material.IconButton,{disabled:!0,children:_jsxruntime.jsx.call(void 0, _material.CircularProgress,{color:"primary",size:18})})),Oi.default.cloneElement(F,{},P)}return F}function V(F,m){if(!y)return F;let O=_material.createFilterOptions.call(void 0, )(F,m),{inputValue:P}=m,k=F.some(D=>P===D[y]);return P!==""&&!k&&O.push({[y]:`Adicionar op\xE7\xE3o: "${P}"`}),O}return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, _material.Autocomplete,{disabled:c,loadingText:"Carregando...",loading:o,onChange:j,value:e,onInputChange:K,options:n,getOptionLabel:p,filterOptions:V,renderInput:F=>_jsxruntime.jsx.call(void 0, _material.TextField,g(B(g({label:r,onDoubleClick:()=>{c||C()}},F),{InputProps:B(g({},F.InputProps),{endAdornment:H(F.InputProps.endAdornment,o,c)}),disabled:c}),x)),clearIcon:_jsxruntime.jsx.call(void 0, _iconsmaterial.BackspaceOutlined,{}),componentsProps:{clearIndicator:{sx:{visibility:"visible"}}},noOptionsText:"Nenhum registro"}),_jsxruntime.jsx.call(void 0, _providers.FormProvider,{children:_jsxruntime.jsx.call(void 0, Ee,B(g({open:v,onClose:()=>M(),actions:"none"},f),{children:_jsxruntime.jsxs.call(void 0, _material.Stack,{spacing:1,children:[_jsxruntime.jsxs.call(void 0, _material.Stack,{direction:"row",justifyContent:"flex-end",alignItems:"center",spacing:1,children:[_jsxruntime.jsx.call(void 0, mt,{placeholder:"Pesquisar",onSearch:F=>w(F)}),i&&_jsxruntime.jsx.call(void 0, E,{})]}),_jsxruntime.jsx.call(void 0, s,g({query:_,enableTransporter:!0,onTransport:F=>{M(),a&&a(F)}},l))]})}))})]})}var hf={dialogProps:{maxWidth:"md",fullWidth:!0}};ro.defaultProps=hf;function no(t){let{label:e}=t;return _jsxruntime.jsx.call(void 0, _material.Stack,{component:"header",sx:{alignItems:"center",gap:1},children:_jsxruntime.jsx.call(void 0, _material.Typography,{component:"h1",variant:"h3",sx:{fontWeight:"medium",color:r=>r.palette.grey[600]},children:e})})}var _axios = require('axios');var Ce=Ge(as()),Rt=Ge(cs()),gs=Ge(ps()),Bf=Object.prototype.toString,If=Error.prototype.toString,Lf=RegExp.prototype.toString,jf=typeof Symbol!="undefined"?Symbol.prototype.toString:()=>"",Nf=/^Symbol\((.*)\)(.*)$/;function zf(t){return t!=+t?"NaN":t===0&&1/t<0?"-0":""+t}function ds(t,e=!1){if(t==null||t===!0||t===!1)return""+t;let r=typeof t;if(r==="number")return zf(t);if(r==="string")return e?`"${t}"`:t;if(r==="function")return"[Function "+(t.name||"anonymous")+"]";if(r==="symbol")return jf.call(t).replace(Nf,"Symbol($1)");let n=Bf.call(t).slice(8,-1);return n==="Date"?isNaN(t.getTime())?""+t:t.toISOString(t):n==="Error"||t instanceof Error?"["+If.call(t)+"]":n==="RegExp"?Lf.call(t):null}function De(t,e){let r=ds(t,e);return r!==null?r:JSON.stringify(t,function(n,o){let i=ds(this[n],e);return i!==null?i:o},2)}function ys(t){return t==null?[]:[].concat(t)}var xs,bs,vs,Vf=/\$\{\s*(\w+)\s*\}/g;xs=Symbol.toStringTag;var Lr=class{constructor(e,r,n,o){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[xs]="Error",this.name="ValidationError",this.value=r,this.path=n,this.type=o,this.errors=[],this.inner=[],ys(e).forEach(i=>{if(fe.isError(i)){this.errors.push(...i.errors);let s=i.inner.length?i.inner:[i];this.inner.push(...s)}else this.errors.push(i)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}};bs=Symbol.hasInstance;vs=Symbol.toStringTag;var fe=class extends Error{static formatError(e,r){let n=r.label||r.path||"this";return n!==r.path&&(r=Object.assign({},r,{path:n})),typeof e=="string"?e.replace(Vf,(o,i)=>De(r[i])):typeof e=="function"?e(r):e}static isError(e){return e&&e.name==="ValidationError"}constructor(e,r,n,o,i){let s=new Lr(e,r,n,o);if(i)return s;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[vs]="Error",this.name=s.name,this.message=s.message,this.type=s.type,this.value=s.value,this.path=s.path,this.errors=s.errors,this.inner=s.inner,Error.captureStackTrace&&Error.captureStackTrace(this,fe)}static[bs](e){return Lr[Symbol.hasInstance](e)||super[Symbol.hasInstance](e)}},_e={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:t,type:e,value:r,originalValue:n})=>{let o=n!=null&&n!==r?` (cast from the value \`${De(n,!0)}\`).`:".";return e!=="mixed"?`${t} must be a \`${e}\` type, but the final value was: \`${De(r,!0)}\``+o:`${t} must match the configured type. The validated value was: \`${De(r,!0)}\``+o}},me={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},We={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},co={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},fo={isValue:"${path} field must be ${value}"},po={noUnknown:"${path} field has unspecified keys: ${unknown}"},Br={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},Ts={notType:t=>{let{path:e,value:r,spec:n}=t,o=n.types.length;if(Array.isArray(r)){if(r.length<o)return`${e} tuple value has too few items, expected a length of ${o} but got ${r.length} for value: \`${De(r,!0)}\``;if(r.length>o)return`${e} tuple value has too many items, expected a length of ${o} but got ${r.length} for value: \`${De(r,!0)}\``}return fe.formatError(_e.notType,t)}},_v=Object.assign(Object.create(null),{mixed:_e,string:me,number:We,date:co,object:po,array:Br,boolean:fo,tuple:Ts}),Yr=t=>t&&t.__isYupSchema__,yt=class{static fromOptions(e,r){if(!r.then&&!r.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:n,then:o,otherwise:i}=r,s=typeof n=="function"?n:(...l)=>l.every(a=>a===n);return new yt(e,(l,a)=>{var u;let p=s(...l)?o:i;return(u=p==null?void 0:p(a))!=null?u:a})}constructor(e,r){this.fn=void 0,this.refs=e,this.refs=e,this.fn=r}resolve(e,r){let n=this.refs.map(i=>i.getValue(r==null?void 0:r.value,r==null?void 0:r.parent,r==null?void 0:r.context)),o=this.fn(n,e,r);if(o===void 0||o===e)return e;if(!Yr(o))throw new TypeError("conditions must return a schema object");return o.resolve(r)}},Rr={context:"$",value:"."};var Re=class{constructor(e,r={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof e!="string")throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),e==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===Rr.context,this.isValue=this.key[0]===Rr.value,this.isSibling=!this.isContext&&!this.isValue;let n=this.isContext?Rr.context:this.isValue?Rr.value:"";this.path=this.key.slice(n.length),this.getter=this.path&&(0,Ce.getter)(this.path,!0),this.map=r.map}getValue(e,r,n){let o=this.isContext?n:this.isValue?e:r;return this.getter&&(o=this.getter(o||{})),this.map&&(o=this.map(o)),o}cast(e,r){return this.getValue(e,r==null?void 0:r.parent,r==null?void 0:r.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}};Re.prototype.__isYupRef=!0;var we=t=>t==null;function ht(t){function e({value:r,path:n="",options:o,originalValue:i,schema:s},l,a){let{name:u,test:p,params:f,message:c,skipAbsent:d}=t,{parent:y,context:x,abortEarly:v=s.spec.abortEarly,disableStackTrace:C=s.spec.disableStackTrace}=o;function M(b){return Re.isRef(b)?b.getValue(r,y,x):b}function _(b={}){let F=Object.assign({value:r,originalValue:i,label:s.spec.label,path:b.path||n,spec:s.spec,disableStackTrace:b.disableStackTrace||C},f,b.params);for(let h of Object.keys(F))F[h]=M(F[h]);let m=new fe(fe.formatError(b.message||c,F),r,F.path,b.type||u,F.disableStackTrace);return m.params=F,m}let w=v?l:a,E={path:n,parent:y,type:u,from:o.from,createError:_,resolve:M,options:o,originalValue:i,schema:s},z=b=>{fe.isError(b)?w(b):b?a(null):w(_())},K=b=>{fe.isError(b)?w(b):l(b)};if(d&&we(r))return z(!0);let H;try{var V;if(H=p.call(E,r,E),typeof((V=H)==null?void 0:V.then)=="function"){if(o.sync)throw new Error(`Validation test of type: "${E.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(H).then(z,K)}}catch(b){K(b);return}z(H)}return e.OPTIONS=t,e}function Uf(t,e,r,n=r){let o,i,s;return e?((0,Ce.forEach)(e,(l,a,u)=>{let p=a?l.slice(1,l.length-1):l;t=t.resolve({context:n,parent:o,value:r});let f=t.type==="tuple",c=u?parseInt(p,10):0;if(t.innerType||f){if(f&&!u)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${s}" must contain an index to the tuple element, e.g. "${s}[0]"`);if(r&&c>=r.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${l}, in the path: ${e}. because there is no value at that index. `);o=r,r=r&&r[c],t=f?t.spec.types[c]:t.innerType}if(!u){if(!t.fields||!t.fields[p])throw new Error(`The schema does not contain the path: ${e}. (failed at: ${s} which is a type: "${t.type}")`);o=r,r=r&&r[p],t=t.fields[p]}i=p,s=a?"["+l+"]":"."+l}),{schema:t,parent:o,parentPath:i}):{parent:o,parentPath:e,schema:t}}var xt=class extends Set{describe(){let e=[];for(let r of this.values())e.push(Re.isRef(r)?r.describe():r);return e}resolveAll(e){let r=[];for(let n of this.values())r.push(e(n));return r}clone(){return new xt(this.values())}merge(e,r){let n=this.clone();return e.forEach(o=>n.add(o)),r.forEach(o=>n.delete(o)),n}};function gt(t,e=new Map){if(Yr(t)||!t||typeof t!="object")return t;if(e.has(t))return e.get(t);let r;if(t instanceof Date)r=new Date(t.getTime()),e.set(t,r);else if(t instanceof RegExp)r=new RegExp(t),e.set(t,r);else if(Array.isArray(t)){r=new Array(t.length),e.set(t,r);for(let n=0;n<t.length;n++)r[n]=gt(t[n],e)}else if(t instanceof Map){r=new Map,e.set(t,r);for(let[n,o]of t.entries())r.set(n,gt(o,e))}else if(t instanceof Set){r=new Set,e.set(t,r);for(let n of t)r.add(gt(n,e))}else if(t instanceof Object){r={},e.set(t,r);for(let[n,o]of Object.entries(t))r[n]=gt(o,e)}else throw Error(`Unable to clone ${t}`);return r}var se=class{constructor(e){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new xt,this._blacklist=new xt,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(_e.notType)}),this.type=e.type,this._typeCheck=e.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},e==null?void 0:e.spec),this.withMutation(r=>{r.nonNullable()})}get _type(){return this.type}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;let r=Object.create(Object.getPrototypeOf(this));return r.type=this.type,r._typeCheck=this._typeCheck,r._whitelist=this._whitelist.clone(),r._blacklist=this._blacklist.clone(),r.internalTests=Object.assign({},this.internalTests),r.exclusiveTests=Object.assign({},this.exclusiveTests),r.deps=[...this.deps],r.conditions=[...this.conditions],r.tests=[...this.tests],r.transforms=[...this.transforms],r.spec=gt(Object.assign({},this.spec,e)),r}label(e){let r=this.clone();return r.spec.label=e,r}meta(...e){if(e.length===0)return this.spec.meta;let r=this.clone();return r.spec.meta=Object.assign(r.spec.meta||{},e[0]),r}withMutation(e){let r=this._mutate;this._mutate=!0;let n=e(this);return this._mutate=r,n}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let r=this,n=e.clone(),o=Object.assign({},r.spec,n.spec);return n.spec=o,n.internalTests=Object.assign({},r.internalTests,n.internalTests),n._whitelist=r._whitelist.merge(e._whitelist,e._blacklist),n._blacklist=r._blacklist.merge(e._blacklist,e._whitelist),n.tests=r.tests,n.exclusiveTests=r.exclusiveTests,n.withMutation(i=>{e.tests.forEach(s=>{i.test(s.OPTIONS)})}),n.transforms=[...r.transforms,...n.transforms],n}isType(e){return e==null?!!(this.spec.nullable&&e===null||this.spec.optional&&e===void 0):this._typeCheck(e)}resolve(e){let r=this;if(r.conditions.length){let n=r.conditions;r=r.clone(),r.conditions=[],r=n.reduce((o,i)=>i.resolve(o,e),r),r=r.resolve(e)}return r}resolveOptions(e){var r,n,o,i;return Object.assign({},e,{from:e.from||[],strict:(r=e.strict)!=null?r:this.spec.strict,abortEarly:(n=e.abortEarly)!=null?n:this.spec.abortEarly,recursive:(o=e.recursive)!=null?o:this.spec.recursive,disableStackTrace:(i=e.disableStackTrace)!=null?i:this.spec.disableStackTrace})}cast(e,r={}){let n=this.resolve(Object.assign({value:e},r)),o=r.assert==="ignore-optionality",i=n._cast(e,r);if(r.assert!==!1&&!n.isType(i)){if(o&&we(i))return i;let s=De(e),l=De(i);throw new TypeError(`The value of ${r.path||"field"} could not be cast to a value that satisfies the schema type: "${n.type}".
|
|
7
7
|
|
|
8
8
|
attempted value: ${s}
|
|
9
9
|
`+(l!==s?`result of cast: ${l}`:""))}return i}_cast(e,r){let n=e===void 0?e:this.transforms.reduce((o,i)=>i.call(this,o,e,this),e);return n===void 0&&(n=this.getDefault(r)),n}_validate(e,r={},n,o){let{path:i,originalValue:s=e,strict:l=this.spec.strict}=r,a=e;l||(a=this._cast(a,Object.assign({assert:!1},r)));let u=[];for(let p of Object.values(this.internalTests))p&&u.push(p);this.runTests({path:i,value:a,originalValue:s,options:r,tests:u},n,p=>{if(p.length)return o(p,a);this.runTests({path:i,value:a,originalValue:s,options:r,tests:this.tests},n,o)})}runTests(e,r,n){let o=!1,{tests:i,value:s,originalValue:l,path:a,options:u}=e,p=x=>{o||(o=!0,r(x,s))},f=x=>{o||(o=!0,n(x,s))},c=i.length,d=[];if(!c)return f([]);let y={value:s,originalValue:l,path:a,options:u,schema:this};for(let x=0;x<i.length;x++){let v=i[x];v(y,p,function(M){M&&(Array.isArray(M)?d.push(...M):d.push(M)),--c<=0&&f(d)})}}asNestedTest({key:e,index:r,parent:n,parentPath:o,originalParent:i,options:s}){let l=e!=null?e:r;if(l==null)throw TypeError("Must include `key` or `index` for nested validations");let a=typeof l=="number",u=n[l],p=Object.assign({},s,{strict:!0,parent:n,value:u,originalValue:i[l],key:void 0,[a?"index":"key"]:l,path:a||l.includes(".")?`${o||""}[${a?l:`"${l}"`}]`:(o?`${o}.`:"")+e});return(f,c,d)=>this.resolve(p)._validate(u,p,c,d)}validate(e,r){var n;let o=this.resolve(Object.assign({},r,{value:e})),i=(n=r==null?void 0:r.disableStackTrace)!=null?n:o.spec.disableStackTrace;return new Promise((s,l)=>o._validate(e,r,(a,u)=>{fe.isError(a)&&(a.value=u),l(a)},(a,u)=>{a.length?l(new fe(a,u,void 0,void 0,i)):s(u)}))}validateSync(e,r){var n;let o=this.resolve(Object.assign({},r,{value:e})),i,s=(n=r==null?void 0:r.disableStackTrace)!=null?n:o.spec.disableStackTrace;return o._validate(e,Object.assign({},r,{sync:!0}),(l,a)=>{throw fe.isError(l)&&(l.value=a),l},(l,a)=>{if(l.length)throw new fe(l,e,void 0,void 0,s);i=a}),i}isValid(e,r){return this.validate(e,r).then(()=>!0,n=>{if(fe.isError(n))return!1;throw n})}isValidSync(e,r){try{return this.validateSync(e,r),!0}catch(n){if(fe.isError(n))return!1;throw n}}_getDefault(e){let r=this.spec.default;return r==null?r:typeof r=="function"?r.call(this,e):gt(r)}getDefault(e){return this.resolve(e||{})._getDefault(e)}default(e){return arguments.length===0?this._getDefault():this.clone({default:e})}strict(e=!0){return this.clone({strict:e})}nullability(e,r){let n=this.clone({nullable:e});return n.internalTests.nullable=ht({message:r,name:"nullable",test(o){return o===null?this.schema.spec.nullable:!0}}),n}optionality(e,r){let n=this.clone({optional:e});return n.internalTests.optionality=ht({message:r,name:"optionality",test(o){return o===void 0?this.schema.spec.optional:!0}}),n}optional(){return this.optionality(!0)}defined(e=_e.defined){return this.optionality(!1,e)}nullable(){return this.nullability(!0)}nonNullable(e=_e.notNull){return this.nullability(!1,e)}required(e=_e.required){return this.clone().withMutation(r=>r.nonNullable(e).defined(e))}notRequired(){return this.clone().withMutation(e=>e.nullable().optional())}transform(e){let r=this.clone();return r.transforms.push(e),r}test(...e){let r;if(e.length===1?typeof e[0]=="function"?r={test:e[0]}:r=e[0]:e.length===2?r={name:e[0],test:e[1]}:r={name:e[0],message:e[1],test:e[2]},r.message===void 0&&(r.message=_e.default),typeof r.test!="function")throw new TypeError("`test` is a required parameters");let n=this.clone(),o=ht(r),i=r.exclusive||r.name&&n.exclusiveTests[r.name]===!0;if(r.exclusive&&!r.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return r.name&&(n.exclusiveTests[r.name]=!!r.exclusive),n.tests=n.tests.filter(s=>!(s.OPTIONS.name===r.name&&(i||s.OPTIONS.test===o.OPTIONS.test))),n.tests.push(o),n}when(e,r){!Array.isArray(e)&&typeof e!="string"&&(r=e,e=".");let n=this.clone(),o=ys(e).map(i=>new Re(i));return o.forEach(i=>{i.isSibling&&n.deps.push(i.key)}),n.conditions.push(typeof r=="function"?new yt(o,r):yt.fromOptions(o,r)),n}typeError(e){let r=this.clone();return r.internalTests.typeError=ht({message:e,name:"typeError",skipAbsent:!0,test(n){return this.schema._typeCheck(n)?!0:this.createError({params:{type:this.schema.type}})}}),r}oneOf(e,r=_e.oneOf){let n=this.clone();return e.forEach(o=>{n._whitelist.add(o),n._blacklist.delete(o)}),n.internalTests.whiteList=ht({message:r,name:"oneOf",skipAbsent:!0,test(o){let i=this.schema._whitelist,s=i.resolveAll(this.resolve);return s.includes(o)?!0:this.createError({params:{values:Array.from(i).join(", "),resolved:s}})}}),n}notOneOf(e,r=_e.notOneOf){let n=this.clone();return e.forEach(o=>{n._blacklist.add(o),n._whitelist.delete(o)}),n.internalTests.blacklist=ht({message:r,name:"notOneOf",test(o){let i=this.schema._blacklist,s=i.resolveAll(this.resolve);return s.includes(o)?this.createError({params:{values:Array.from(i).join(", "),resolved:s}}):!0}}),n}strip(e=!0){let r=this.clone();return r.spec.strip=e,r}describe(e){let r=(e?this.resolve(e):this).clone(),{label:n,meta:o,optional:i,nullable:s}=r.spec;return{meta:o,label:n,optional:i,nullable:s,default:r.getDefault(e),type:r.type,oneOf:r._whitelist.describe(),notOneOf:r._blacklist.describe(),tests:r.tests.map(a=>({name:a.OPTIONS.name,params:a.OPTIONS.params})).filter((a,u,p)=>p.findIndex(f=>f.name===a.name)===u)}}};se.prototype.__isYupSchema__=!0;for(let t of["validate","validateSync"])se.prototype[`${t}At`]=function(e,r,n={}){let{parent:o,parentPath:i,schema:s}=Uf(this,e,r,n.context);return s[t](o&&o[i],Object.assign({},n,{parent:o,path:e}))};for(let t of["equals","is"])se.prototype[t]=se.prototype.oneOf;for(let t of["not","nope"])se.prototype[t]=se.prototype.notOneOf;var qf=()=>!0;function Wf(t){return new jr(t)}var jr=class extends se{constructor(e){super(typeof e=="function"?{type:"mixed",check:e}:Object.assign({type:"mixed",check:qf},e))}};Wf.prototype=jr.prototype;function Yf(){return new Nr}var Nr=class extends se{constructor(){super({type:"boolean",check(e){return e instanceof Boolean&&(e=e.valueOf()),typeof e=="boolean"}}),this.withMutation(()=>{this.transform((e,r,n)=>{if(n.spec.coerce&&!n.isType(e)){if(/^(true|1)$/i.test(String(e)))return!0;if(/^(false|0)$/i.test(String(e)))return!1}return e})})}isTrue(e=fo.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"true"},test(r){return we(r)||r===!0}})}isFalse(e=fo.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"false"},test(r){return we(r)||r===!1}})}default(e){return super.default(e)}defined(e){return super.defined(e)}optional(){return super.optional()}required(e){return super.required(e)}notRequired(){return super.notRequired()}nullable(){return super.nullable()}nonNullable(e){return super.nonNullable(e)}strip(e){return super.strip(e)}};Yf.prototype=Nr.prototype;var Gf=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function Kf(t){let e=mo(t);if(!e)return Date.parse?Date.parse(t):Number.NaN;if(e.z===void 0&&e.plusMinus===void 0)return new Date(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond).valueOf();let r=0;return e.z!=="Z"&&e.plusMinus!==void 0&&(r=e.hourOffset*60+e.minuteOffset,e.plusMinus==="+"&&(r=0-r)),Date.UTC(e.year,e.month,e.day,e.hour,e.minute+r,e.second,e.millisecond)}function mo(t){var e,r;let n=Gf.exec(t);return n?{year:$e(n[1]),month:$e(n[2],1)-1,day:$e(n[3],1),hour:$e(n[4]),minute:$e(n[5]),second:$e(n[6]),millisecond:n[7]?$e(n[7].substring(0,3)):0,precision:(e=(r=n[7])==null?void 0:r.length)!=null?e:void 0,z:n[8]||void 0,plusMinus:n[9]||void 0,hourOffset:$e(n[10]),minuteOffset:$e(n[11])}:null}function $e(t,e=0){return Number(t)||e}var Hf=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Zf=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,Xf=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,Jf="^\\d{4}-\\d{2}-\\d{2}",Qf="\\d{2}:\\d{2}:\\d{2}",ep="(([+-]\\d{2}(:?\\d{2})?)|Z)",tp=new RegExp(`${Jf}T${Qf}(\\.\\d+)?${ep}$`),rp=t=>we(t)||t===t.trim(),np={}.toString();function Be(){return new zr}var zr=class extends se{constructor(){super({type:"string",check(e){return e instanceof String&&(e=e.valueOf()),typeof e=="string"}}),this.withMutation(()=>{this.transform((e,r,n)=>{if(!n.spec.coerce||n.isType(e)||Array.isArray(e))return e;let o=e!=null&&e.toString?e.toString():e;return o===np?e:o})})}required(e){return super.required(e).withMutation(r=>r.test({message:e||_e.required,name:"required",skipAbsent:!0,test:n=>!!n.length}))}notRequired(){return super.notRequired().withMutation(e=>(e.tests=e.tests.filter(r=>r.OPTIONS.name!=="required"),e))}length(e,r=me.length){return this.test({message:r,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(n){return n.length===this.resolve(e)}})}min(e,r=me.min){return this.test({message:r,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(n){return n.length>=this.resolve(e)}})}max(e,r=me.max){return this.test({name:"max",exclusive:!0,message:r,params:{max:e},skipAbsent:!0,test(n){return n.length<=this.resolve(e)}})}matches(e,r){let n=!1,o,i;return r&&(typeof r=="object"?{excludeEmptyString:n=!1,message:o,name:i}=r:o=r),this.test({name:i||"matches",message:o||me.matches,params:{regex:e},skipAbsent:!0,test:s=>s===""&&n||s.search(e)!==-1})}email(e=me.email){return this.matches(Hf,{name:"email",message:e,excludeEmptyString:!0})}url(e=me.url){return this.matches(Zf,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=me.uuid){return this.matches(Xf,{name:"uuid",message:e,excludeEmptyString:!1})}datetime(e){let r="",n,o;return e&&(typeof e=="object"?{message:r="",allowOffset:n=!1,precision:o=void 0}=e:r=e),this.matches(tp,{name:"datetime",message:r||me.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:r||me.datetime_offset,params:{allowOffset:n},skipAbsent:!0,test:i=>{if(!i||n)return!0;let s=mo(i);return s?!!s.z:!1}}).test({name:"datetime_precision",message:r||me.datetime_precision,params:{precision:o},skipAbsent:!0,test:i=>{if(!i||o==null)return!0;let s=mo(i);return s?s.precision===o:!1}})}ensure(){return this.default("").transform(e=>e===null?"":e)}trim(e=me.trim){return this.transform(r=>r!=null?r.trim():r).test({message:e,name:"trim",test:rp})}lowercase(e=me.lowercase){return this.transform(r=>we(r)?r:r.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:r=>we(r)||r===r.toLowerCase()})}uppercase(e=me.uppercase){return this.transform(r=>we(r)?r:r.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:r=>we(r)||r===r.toUpperCase()})}};Be.prototype=zr.prototype;var op=t=>t!=+t;function ip(){return new Vr}var Vr=class extends se{constructor(){super({type:"number",check(e){return e instanceof Number&&(e=e.valueOf()),typeof e=="number"&&!op(e)}}),this.withMutation(()=>{this.transform((e,r,n)=>{if(!n.spec.coerce)return e;let o=e;if(typeof o=="string"){if(o=o.replace(/\s/g,""),o==="")return NaN;o=+o}return n.isType(o)||o===null?o:parseFloat(o)})})}min(e,r=We.min){return this.test({message:r,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(n){return n>=this.resolve(e)}})}max(e,r=We.max){return this.test({message:r,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(n){return n<=this.resolve(e)}})}lessThan(e,r=We.lessThan){return this.test({message:r,name:"max",exclusive:!0,params:{less:e},skipAbsent:!0,test(n){return n<this.resolve(e)}})}moreThan(e,r=We.moreThan){return this.test({message:r,name:"min",exclusive:!0,params:{more:e},skipAbsent:!0,test(n){return n>this.resolve(e)}})}positive(e=We.positive){return this.moreThan(0,e)}negative(e=We.negative){return this.lessThan(0,e)}integer(e=We.integer){return this.test({name:"integer",message:e,skipAbsent:!0,test:r=>Number.isInteger(r)})}truncate(){return this.transform(e=>we(e)?e:e|0)}round(e){var r;let n=["ceil","floor","round","trunc"];if(e=((r=e)==null?void 0:r.toLowerCase())||"round",e==="trunc")return this.truncate();if(n.indexOf(e.toLowerCase())===-1)throw new TypeError("Only valid options for round() are: "+n.join(", "));return this.transform(o=>we(o)?o:Math[e](o))}};ip.prototype=Vr.prototype;var Ss=new Date(""),sp=t=>Object.prototype.toString.call(t)==="[object Date]";function Cs(){return new et}var et=class extends se{constructor(){super({type:"date",check(e){return sp(e)&&!isNaN(e.getTime())}}),this.withMutation(()=>{this.transform((e,r,n)=>!n.spec.coerce||n.isType(e)||e===null?e:(e=Kf(e),isNaN(e)?et.INVALID_DATE:new Date(e)))})}prepareParam(e,r){let n;if(Re.isRef(e))n=e;else{let o=this.cast(e);if(!this._typeCheck(o))throw new TypeError(`\`${r}\` must be a Date or a value that can be \`cast()\` to a Date`);n=o}return n}min(e,r=co.min){let n=this.prepareParam(e,"min");return this.test({message:r,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(o){return o>=this.resolve(n)}})}max(e,r=co.max){let n=this.prepareParam(e,"max");return this.test({message:r,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(o){return o<=this.resolve(n)}})}};et.INVALID_DATE=Ss;Cs.prototype=et.prototype;Cs.INVALID_DATE=Ss;function ap(t,e=[]){let r=[],n=new Set,o=new Set(e.map(([s,l])=>`${s}-${l}`));function i(s,l){let a=(0,Ce.split)(s)[0];n.add(a),o.has(`${l}-${a}`)||r.push([l,a])}for(let s of Object.keys(t)){let l=t[s];n.add(s),Re.isRef(l)&&l.isSibling?i(l.path,s):Yr(l)&&"deps"in l&&l.deps.forEach(a=>i(a,s))}return gs.default.array(Array.from(n),r).reverse()}function ms(t,e){let r=1/0;return t.some((n,o)=>{var i;if((i=e.path)!=null&&i.includes(n))return r=o,!0}),r}function Ps(t){return(e,r)=>ms(t,e)-ms(t,r)}var Es=(t,e,r)=>{if(typeof t!="string")return t;let n=t;try{n=JSON.parse(t)}catch(o){}return r.isType(n)?n:t};function Ir(t){if("fields"in t){let e={};for(let[r,n]of Object.entries(t.fields))e[r]=Ir(n);return t.setFields(e)}if(t.type==="array"){let e=t.optional();return e.innerType&&(e.innerType=Ir(e.innerType)),e}return t.type==="tuple"?t.optional().clone({types:t.spec.types.map(Ir)}):"optional"in t?t.optional():t}var lp=(t,e)=>{let r=[...(0,Ce.normalizePath)(e)];if(r.length===1)return r[0]in t;let n=r.pop(),o=(0,Ce.getter)((0,Ce.join)(r),!0)(t);return!!(o&&n in o)},hs=t=>Object.prototype.toString.call(t)==="[object Object]";function up(t,e){let r=Object.keys(t.fields);return Object.keys(e).filter(n=>r.indexOf(n)===-1)}var cp=Ps([]);function tt(t){return new Ur(t)}var Ur=class extends se{constructor(e){super({type:"object",check(r){return hs(r)||typeof r=="function"}}),this.fields=Object.create(null),this._sortErrors=cp,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{e&&this.shape(e)})}_cast(e,r={}){var n;let o=super._cast(e,r);if(o===void 0)return this.getDefault(r);if(!this._typeCheck(o))return o;let i=this.fields,s=(n=r.stripUnknown)!=null?n:this.spec.noUnknown,l=[].concat(this._nodes,Object.keys(o).filter(f=>!this._nodes.includes(f))),a={},u=Object.assign({},r,{parent:a,__validating:r.__validating||!1}),p=!1;for(let f of l){let c=i[f],d=f in o;if(c){let y,x=o[f];u.path=(r.path?`${r.path}.`:"")+f,c=c.resolve({value:x,context:r.context,parent:a});let v=c instanceof se?c.spec:void 0,C=v==null?void 0:v.strict;if(v!=null&&v.strip){p=p||f in o;continue}y=!r.__validating||!C?c.cast(o[f],u):o[f],y!==void 0&&(a[f]=y)}else d&&!s&&(a[f]=o[f]);(d!==f in a||a[f]!==o[f])&&(p=!0)}return p?a:o}_validate(e,r={},n,o){let{from:i=[],originalValue:s=e,recursive:l=this.spec.recursive}=r;r.from=[{schema:this,value:s},...i],r.__validating=!0,r.originalValue=s,super._validate(e,r,n,(a,u)=>{if(!l||!hs(u)){o(a,u);return}s=s||u;let p=[];for(let f of this._nodes){let c=this.fields[f];!c||Re.isRef(c)||p.push(c.asNestedTest({options:r,key:f,parent:u,parentPath:r.path,originalParent:s}))}this.runTests({tests:p,value:u,originalValue:s,options:r},n,f=>{o(f.sort(this._sortErrors).concat(a),u)})})}clone(e){let r=super.clone(e);return r.fields=Object.assign({},this.fields),r._nodes=this._nodes,r._excludedEdges=this._excludedEdges,r._sortErrors=this._sortErrors,r}concat(e){let r=super.concat(e),n=r.fields;for(let[o,i]of Object.entries(this.fields)){let s=n[o];n[o]=s===void 0?i:s}return r.withMutation(o=>o.setFields(n,[...this._excludedEdges,...e._excludedEdges]))}_getDefault(e){if("default"in this.spec)return super._getDefault(e);if(!this._nodes.length)return;let r={};return this._nodes.forEach(n=>{var o;let i=this.fields[n],s=e;(o=s)!=null&&o.value&&(s=Object.assign({},s,{parent:s.value,value:s.value[n]})),r[n]=i&&"getDefault"in i?i.getDefault(s):void 0}),r}setFields(e,r){let n=this.clone();return n.fields=e,n._nodes=ap(e,r),n._sortErrors=Ps(Object.keys(e)),r&&(n._excludedEdges=r),n}shape(e,r=[]){return this.clone().withMutation(n=>{let o=n._excludedEdges;return r.length&&(Array.isArray(r[0])||(r=[r]),o=[...n._excludedEdges,...r]),n.setFields(Object.assign(n.fields,e),o)})}partial(){let e={};for(let[r,n]of Object.entries(this.fields))e[r]="optional"in n&&n.optional instanceof Function?n.optional():n;return this.setFields(e)}deepPartial(){return Ir(this)}pick(e){let r={};for(let n of e)this.fields[n]&&(r[n]=this.fields[n]);return this.setFields(r,this._excludedEdges.filter(([n,o])=>e.includes(n)&&e.includes(o)))}omit(e){let r=[];for(let n of Object.keys(this.fields))e.includes(n)||r.push(n);return this.pick(r)}from(e,r,n){let o=(0,Ce.getter)(e,!0);return this.transform(i=>{if(!i)return i;let s=i;return lp(i,e)&&(s=Object.assign({},i),n||delete s[e],s[r]=o(i)),s})}json(){return this.transform(Es)}noUnknown(e=!0,r=po.noUnknown){typeof e!="boolean"&&(r=e,e=!0);let n=this.test({name:"noUnknown",exclusive:!0,message:r,test(o){if(o==null)return!0;let i=up(this.schema,o);return!e||i.length===0||this.createError({params:{unknown:i.join(", ")}})}});return n.spec.noUnknown=e,n}unknown(e=!0,r=po.noUnknown){return this.noUnknown(!e,r)}transformKeys(e){return this.transform(r=>{if(!r)return r;let n={};for(let o of Object.keys(r))n[e(o)]=r[o];return n})}camelCase(){return this.transformKeys(Rt.camelCase)}snakeCase(){return this.transformKeys(Rt.snakeCase)}constantCase(){return this.transformKeys(e=>(0,Rt.snakeCase)(e).toUpperCase())}describe(e){let r=(e?this.resolve(e):this).clone(),n=super.describe(e);n.fields={};for(let[i,s]of Object.entries(r.fields)){var o;let l=e;(o=l)!=null&&o.value&&(l=Object.assign({},l,{parent:l.value,value:l.value[i]})),n.fields[i]=s.describe(l)}return n}};tt.prototype=Ur.prototype;function fp(t){return new qr(t)}var qr=class extends se{constructor(e){super({type:"array",spec:{types:e},check(r){return Array.isArray(r)}}),this.innerType=void 0,this.innerType=e}_cast(e,r){let n=super._cast(e,r);if(!this._typeCheck(n)||!this.innerType)return n;let o=!1,i=n.map((s,l)=>{let a=this.innerType.cast(s,Object.assign({},r,{path:`${r.path||""}[${l}]`}));return a!==s&&(o=!0),a});return o?i:n}_validate(e,r={},n,o){var i;let s=this.innerType,l=(i=r.recursive)!=null?i:this.spec.recursive;r.originalValue!=null&&r.originalValue,super._validate(e,r,n,(a,u)=>{var p;if(!l||!s||!this._typeCheck(u)){o(a,u);return}let f=new Array(u.length);for(let d=0;d<u.length;d++){var c;f[d]=s.asNestedTest({options:r,index:d,parent:u,parentPath:r.path,originalParent:(c=r.originalValue)!=null?c:e})}this.runTests({value:u,tests:f,originalValue:(p=r.originalValue)!=null?p:e,options:r},n,d=>o(d.concat(a),u))})}clone(e){let r=super.clone(e);return r.innerType=this.innerType,r}json(){return this.transform(Es)}concat(e){let r=super.concat(e);return r.innerType=this.innerType,e.innerType&&(r.innerType=r.innerType?r.innerType.concat(e.innerType):e.innerType),r}of(e){let r=this.clone();if(!Yr(e))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+De(e));return r.innerType=e,r.spec=Object.assign({},r.spec,{types:e}),r}length(e,r=Br.length){return this.test({message:r,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(n){return n.length===this.resolve(e)}})}min(e,r){return r=r||Br.min,this.test({message:r,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(n){return n.length>=this.resolve(e)}})}max(e,r){return r=r||Br.max,this.test({message:r,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(n){return n.length<=this.resolve(e)}})}ensure(){return this.default(()=>[]).transform((e,r)=>this._typeCheck(e)?e:r==null?[]:[].concat(r))}compact(e){let r=e?(n,o,i)=>!e(n,o,i):n=>!!n;return this.transform(n=>n!=null?n.filter(r):n)}describe(e){let r=(e?this.resolve(e):this).clone(),n=super.describe(e);if(r.innerType){var o;let i=e;(o=i)!=null&&o.value&&(i=Object.assign({},i,{parent:i.value,value:i.value[0]})),n.innerType=r.innerType.describe(i)}return n}};fp.prototype=qr.prototype;function pp(t){return new Wr(t)}var Wr=class extends se{constructor(e){super({type:"tuple",spec:{types:e},check(r){let n=this.spec.types;return Array.isArray(r)&&r.length===n.length}}),this.withMutation(()=>{this.typeError(Ts.notType)})}_cast(e,r){let{types:n}=this.spec,o=super._cast(e,r);if(!this._typeCheck(o))return o;let i=!1,s=n.map((l,a)=>{let u=l.cast(o[a],Object.assign({},r,{path:`${r.path||""}[${a}]`}));return u!==o[a]&&(i=!0),u});return i?s:o}_validate(e,r={},n,o){let i=this.spec.types;super._validate(e,r,n,(s,l)=>{var a;if(!this._typeCheck(l)){o(s,l);return}let u=[];for(let[f,c]of i.entries()){var p;u[f]=c.asNestedTest({options:r,index:f,parent:l,parentPath:r.path,originalParent:(p=r.originalValue)!=null?p:e})}this.runTests({value:l,tests:u,originalValue:(a=r.originalValue)!=null?a:e,options:r},n,f=>o(f.concat(s),l))})}describe(e){let r=(e?this.resolve(e):this).clone(),n=super.describe(e);return n.innerType=r.spec.types.map((o,i)=>{var s;let l=e;return(s=l)!=null&&s.value&&(l=Object.assign({},l,{parent:l.value,value:l.value[i]})),o.describe(l)}),n}};pp.prototype=Wr.prototype;var _isStrongPassword = require('validator/lib/isStrongPassword'); var _isStrongPassword2 = _interopRequireDefault(_isStrongPassword);function Bt(t){let u=t,{name:e,label:r,value:n,onChange:o}=u,i=X(u,["name","label","value","onChange"]),[s,l]=_react.useState.call(void 0, !1);function a(){l(!s)}return _jsxruntime.jsx.call(void 0, _material.TextField,g({name:e,label:r,value:n||"",onChange:o,type:s?"text":"password",InputProps:{endAdornment:_jsxruntime.jsx.call(void 0, _material.InputAdornment,{position:"start",children:_jsxruntime.jsx.call(void 0, _material.InputAdornment,{position:"end",children:_jsxruntime.jsx.call(void 0, _material.IconButton,{onClick:a,edge:"end",children:s?_jsxruntime.jsx.call(void 0, _iconsmaterial.VisibilityOff,{}):_jsxruntime.jsx.call(void 0, _iconsmaterial.Visibility,{})})})})}},i))}function rt(t){let{isValid:e,message:r}=t,n=_material.useTheme.call(void 0, );return _jsxruntime.jsxs.call(void 0, _material.Box,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[_jsxruntime.jsx.call(void 0, _iconsmaterial.Circle,{color:e?"success":"inherit",sx:{fontSize:"8pt"}}),_jsxruntime.jsx.call(void 0, _material.Typography,{variant:"body2",sx:{color:e?n.palette.success.main:"inherit",textDecoration:e?"line-through":"none",ml:1,fontSize:"10pt"},children:r})]})}var As={senhaAtual:"",senhaNova:""},Op=tt().shape({senhaAtual:Be().required("Informe a Senha Atual."),senhaNova:Be().required("Informe a Nova Senha.")});function Kr(t){let{isOpen:e,credentialsConfig:r,onClose:n,onSuccess:o,onFailed:i,primeiroAcesso:s,senhaAtual:l,email:a}=t,{alterarSenha:u,isSubmitting:p}=_hooks.useCredentials.call(void 0, r),{setValidationErrors:f,validationProps:c}=_hooks.useValidations.call(void 0, ),{data:d,handleChange:y,setData:x,changeValue:v}=_hooks.useForm.call(void 0, As),[C,M]=_react.useState.call(void 0, !1),[_,w]=_react.useState.call(void 0, null);_react.useEffect.call(void 0, ()=>{l&&v("senhaAtual",l)},[l]),_react.useEffect.call(void 0, ()=>{d.senhaNova&&M(_isStrongPassword2.default.call(void 0, d.senhaNova,{minLength:8,minLowercase:1,minUppercase:1,minNumbers:1,minSymbols:1}))},[d.senhaNova]);function E(){return ue(this,null,function*(){f(null),w(null),Op.validate(d,{abortEarly:!1}).then(()=>ue(this,null,function*(){var m;let{senhaAtual:b,senhaNova:F}=d;try{(yield u(b,F,a))&&(o&&o(),x(As))}catch(h){if(i&&i(h),_axios.isAxiosError.call(void 0, h)){w((m=h.response)==null?void 0:m.data.message);return}w("Ocorreu um erro ao tentar alterar a senha")}})).catch(b=>{f(b)})})}function z(){return(d==null?void 0:d.senhaNova.length)>=8}function K(){if(d!=null&&d.senhaNova){let b=d==null?void 0:d.senhaNova.match(/[a-z]/g);return Array.isArray(b)&&b.length>0}return!1}function j(){if(d!=null&&d.senhaNova){let b=d==null?void 0:d.senhaNova.match(/[A-Z]/g);return Array.isArray(b)&&b.length>0}return!1}function H(){if(d!=null&&d.senhaNova){let b=d==null?void 0:d.senhaNova.match(/\d/g);return Array.isArray(b)&&b.length>0}return!1}function V(){if(d!=null&&d.senhaNova){let b=d==null?void 0:d.senhaNova.match(/\W/g);return Array.isArray(b)&&b.length>0}return!1}return _jsxruntime.jsx.call(void 0, Ee,{title:"Atualizar senha",open:!!e,onClose:()=>n(),actions:_jsxruntime.jsxs.call(void 0, Ie,{children:[_jsxruntime.jsx.call(void 0, ne,{title:"Cancelar altera\xE7\xE3o de senha",color:"error",onClick:n,children:"Cancelar"}),_jsxruntime.jsx.call(void 0, ne,{title:"Confirmar altera\xE7\xE3o de senha",variant:"contained",onClick:E,isLoading:p,disabled:!C,children:"Alterar Senha"})]}),children:_jsxruntime.jsxs.call(void 0, _material.Grid,{container:!0,spacing:2,children:[s&&_jsxruntime.jsx.call(void 0, _material.Grid,{item:!0,xl:12,lg:12,md:12,sm:12,xs:12,children:_jsxruntime.jsxs.call(void 0, _material.Alert,{severity:"info",children:["Voc\xEA est\xE1 acessando o sistema com uma senha tempor\xE1ria.",_jsxruntime.jsx.call(void 0, "br",{}),"Cadastre uma senha segura para deixar sua conta mais protegida."]})}),_jsxruntime.jsx.call(void 0, _material.Grid,{item:!0,xl:12,lg:12,md:12,sm:12,xs:12,children:_jsxruntime.jsx.call(void 0, Bt,g({name:"senhaAtual",label:"Senha Atual",value:(d==null?void 0:d.senhaAtual)||"",onChange:y},c("senhaAtual")))}),_jsxruntime.jsx.call(void 0, _material.Grid,{item:!0,xl:12,lg:12,md:12,sm:12,xs:12,children:_jsxruntime.jsx.call(void 0, Bt,g({name:"senhaNova",label:"Nova Senha",value:(d==null?void 0:d.senhaNova)||"",onChange:y},c("senhaNova")))}),_jsxruntime.jsxs.call(void 0, _material.Grid,{item:!0,xl:12,lg:12,md:12,sm:12,xs:12,children:[_jsxruntime.jsx.call(void 0, rt,{isValid:z(),message:"O tamanho m\xEDnimo da nova senha \xE9 de 8 caracteres"}),_jsxruntime.jsx.call(void 0, rt,{isValid:K(),message:"A nova senha deve ter ao menos uma letra min\xFAscula"}),_jsxruntime.jsx.call(void 0, rt,{isValid:j(),message:"A nova senha deve ter ao menos uma letra mai\xFAscula"}),_jsxruntime.jsx.call(void 0, rt,{isValid:H(),message:"A nova senha deve ter ao menos um n\xFAmero"}),_jsxruntime.jsx.call(void 0, rt,{isValid:V(),message:"A nova senha deve ter ao menos um caracter especial"})]}),_&&_jsxruntime.jsx.call(void 0, _material.Grid,{item:!0,xl:12,lg:12,md:12,sm:12,xs:12,children:_jsxruntime.jsx.call(void 0, _material.Alert,{severity:"error",children:_})})]})})}var Bp=tt().shape({email:Be().required("Informe o e-mail"),password:Be().required("Informe a senha")});function go(t){let{onLoginSuccess:e,onLoginFailed:r,onEsqueciSenhaClick:n,credentialsConfig:o}=t,[i,s]=_react.useState.call(void 0, ""),[l,a]=_react.useState.call(void 0, ""),[u,p]=_react.useState.call(void 0, !1),[f,c]=_react.useState.call(void 0, !1),[d,y]=_react.useState.call(void 0, !1),[x,v]=_react.useState.call(void 0, !1),[C,M]=_react.useState.call(void 0, null),{login:_}=_hooks.useCredentials.call(void 0, o),{validationProps:w,setValidationErrors:E}=_hooks.useValidations.call(void 0, );function z(){p(!u)}function K(){return ue(this,null,function*(){E(null),M(null),Bp.validate({email:i,password:l},{abortEarly:!1}).then(()=>ue(this,null,function*(){var j,H;c(!0);try{let V=yield _(i,l);V&&e(V)}catch(V){if(_axios.isAxiosError.call(void 0, V)){if(((j=V.response)==null?void 0:j.data.code)==="E_FIRST_ACCESS"){y(!0);return}M((H=V.response)==null?void 0:H.data.message)}r(V)}})).catch(j=>{E(j)}).finally(()=>{c(!1)})})}return _jsxruntime.jsxs.call(void 0, _material.Box,{component:"form",children:[x&&_jsxruntime.jsxs.call(void 0, _material.Alert,{severity:"success",children:["Senha cadastrada com sucesso",_jsxruntime.jsx.call(void 0, "br",{}),"Tudo pronto para voc\xEA fazer o login"]}),_jsxruntime.jsx.call(void 0, _material.TextField,g({name:"email",label:"E-mail",margin:"normal",autoFocus:!0,value:i||"",onChange:j=>s(j.target.value)},w("email"))),_jsxruntime.jsx.call(void 0, _material.TextField,g({name:"password",label:"Senha",margin:"normal",value:l||"",onChange:j=>a(j.target.value),type:u?"text":"password",onKeyDown:j=>j.key==="Enter"&&K(),InputProps:{endAdornment:_jsxruntime.jsx.call(void 0, _material.InputAdornment,{position:"start",children:_jsxruntime.jsx.call(void 0, _material.InputAdornment,{position:"end",children:_jsxruntime.jsx.call(void 0, _material.IconButton,{onClick:z,edge:"end",children:u?_jsxruntime.jsx.call(void 0, _iconsmaterial.VisibilityOff,{}):_jsxruntime.jsx.call(void 0, _iconsmaterial.Visibility,{})})})})}},w("password"))),_jsxruntime.jsx.call(void 0, ne,{fullWidth:!0,variant:"contained",onClick:K,isLoading:f,sx:{mt:1},children:"Entrar"}),_jsxruntime.jsx.call(void 0, ne,{onClick:n,variant:"text",sx:{marginTop:.5,fontWeight:"400",":hover":{color:j=>j.palette.primary.dark}},children:"Esqueci a senha"}),C&&_jsxruntime.jsx.call(void 0, _material.Alert,{severity:"error",children:C}),_jsxruntime.jsx.call(void 0, Kr,{senhaAtual:l,email:i,primeiroAcesso:!0,isOpen:d,onClose:()=>y(!1),onSuccess:()=>{y(!1),v(!0),a("")},credentialsConfig:o})]})}var zp=tt().shape({email:Be().required("Informe o e-mail")});function yo(t){let{onLoginClick:e,credentialsConfig:r}=t,[n,o]=_react.useState.call(void 0, ""),[i,s]=_react.useState.call(void 0, !1),[l,a]=_react.useState.call(void 0, !1),[u,p]=_react.useState.call(void 0, null),{recuperarSenha:f}=_hooks.useCredentials.call(void 0, r),{validationProps:c,setValidationErrors:d}=_hooks.useValidations.call(void 0, );function y(){return ue(this,null,function*(){d(null),zp.validate({email:n},{abortEarly:!1}).then(()=>ue(this,null,function*(){var x;try{s(!0),yield f(n),a(!0)}catch(v){p((x=v.response)==null?void 0:x.data.message)}finally{s(!1)}})).catch(x=>{d(x)})})}return _jsxruntime.jsxs.call(void 0, _material.Box,{component:"form",children:[_jsxruntime.jsx.call(void 0, _material.TextField,g({name:"email",label:"E-mail",margin:"normal",placeholder:"Informe o e-mail utilizado para acessar o sistema",autoFocus:!0,value:n||"",onChange:x=>o(x.target.value)},c("email"))),_jsxruntime.jsxs.call(void 0, Ie,{sx:{display:"inline-flex",justifyContent:"space-between",width:"100%",marginTop:1},children:[_jsxruntime.jsx.call(void 0, ne,{onClick:e,variant:"text",sx:{fontWeight:"400",":hover":{color:x=>x.palette.primary.dark}},children:"Voltar"}),_jsxruntime.jsx.call(void 0, ne,{variant:"contained",onClick:y,isLoading:i,children:"Recuperar Senha"})]}),l&&_jsxruntime.jsx.call(void 0, _material.Alert,{severity:"success",action:_jsxruntime.jsx.call(void 0, ne,{onClick:e,variant:"text",sx:{fontWeight:"400",":hover":{color:x=>x.palette.primary.dark}},children:"Ir para o Login"}),children:"Enviamos para o seu e-mail as instru\xE7\xF5es para recuperar a sua senha"}),u&&_jsxruntime.jsx.call(void 0, _material.Alert,{severity:"error",children:u})]})}function bo(t){var p;let{loginData:e,credentialsConfig:r,onLoginFailed:n,onLoginSuccess:o}=t,[i,s]=_react.useState.call(void 0, ""),{selecionarLicenca:l,isSubmitting:a}=_hooks.useCredentials.call(void 0, r);_react.useEffect.call(void 0, ()=>{if(Array.isArray(e==null?void 0:e.empresas)){let f=e==null?void 0:e.empresas[0];s(f==null?void 0:f.uuid)}},[e]);function u(){return ue(this,null,function*(){try{let f=yield l(e==null?void 0:e.token,i);f?o(f):n("Nenhuma token definida")}catch(f){n(f)}})}return _jsxruntime.jsxs.call(void 0, _material.Box,{component:"form",sx:{minWidth:"290px"},children:[_jsxruntime.jsx.call(void 0, _material.TextField,{label:"Licen\xE7as",margin:"normal",select:!0,autoFocus:!0,value:i,onChange:f=>{s(f.target.value)},children:(p=e==null?void 0:e.empresas)==null?void 0:p.map(f=>_jsxruntime.jsx.call(void 0, _material.MenuItem,{value:f.uuid,children:f.nome},f.uuid))}),_jsxruntime.jsx.call(void 0, ne,{fullWidth:!0,variant:"contained",onClick:u,isLoading:a,sx:{mt:1},children:"Confirmar"})]})}function zs(t){var x;let{credentialsConfig:e,onLoginSuccess:r,onLoginFailed:n,onAlreadyLogged:o,appName:i}=t,[s,l]=_react.useState.call(void 0, ),{selecionarLicenca:a,isAuthenticated:u}=_hooks.useCredentials.call(void 0, e),[p,f]=_react.useState.call(void 0, !1);_react.useEffect.call(void 0, ()=>{u&&o&&o()},[u]);function c(v){return ue(this,null,function*(){try{if(Array.isArray(v==null?void 0:v.empresas)){if((v==null?void 0:v.empresas.length)===1){let C=yield a(v==null?void 0:v.token,v.empresas[0].uuid);C&&r(C);return}l(v);return}r(v)}catch(C){n(C)}})}function d(v){return ue(this,null,function*(){n(v)})}function y(){f(!p)}return _jsxruntime.jsxs.call(void 0, _material.Container,{component:"main",maxWidth:"xs",sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2},children:[_jsxruntime.jsx.call(void 0, "img",{src:"https://datac-site-assets.s3.sa-east-1.amazonaws.com/logo.png"}),_jsxruntime.jsx.call(void 0, _material.Paper,{children:_jsxruntime.jsxs.call(void 0, _material.Stack,{sx:{padding:5},children:[_jsxruntime.jsx.call(void 0, no,{label:i}),!p&&_jsxruntime.jsx.call(void 0, _material.Box,{sx:{marginTop:3},children:s!=null&&s.empresas&&((x=s==null?void 0:s.empresas)==null?void 0:x.length)>0?_jsxruntime.jsx.call(void 0, bo,{loginData:s,credentialsConfig:e,onLoginSuccess:r,onLoginFailed:n}):_jsxruntime.jsx.call(void 0, go,{credentialsConfig:e,onLoginSuccess:c,onLoginFailed:d,onEsqueciSenhaClick:y})}),p&&_jsxruntime.jsx.call(void 0, _material.Box,{sx:{marginTop:3},children:_jsxruntime.jsx.call(void 0, yo,{onLoginClick:y,credentialsConfig:e})})]})})]})}var rd=_styles.styled.call(void 0, _material.MenuItem,{})(({theme:t})=>({borderRadius:"6px",width:"90%",gap:"16px",margin:"0 auto",padding:"8px 16px",transition:"0.1s ease-in-out","&:hover":{backgroundColor:"rgba(89, 195, 224, 15%);","& .MuiTypography-root":{color:t.palette.primary.main},"& .MuiSvgIcon-root":{color:t.palette.primary.main},"& .MuiIcon-root":{color:t.palette.primary.main}},"& .MuiIcon-root":{color:t.palette.grey[500],fontSize:"20px"},"& .MuiTypography-root":{letterSpacing:"0.5px",color:t.palette.text.secondary,fontSize:t.typography.body1},"& .MuiSvgIcon-root":{fontSize:"24px"}})),nd=t=>_jsxruntime.jsx.call(void 0, rd,g({},t)),Zr=nd;function vo(t){let{menuItem:e,activeMenu:r,onMenuClick:n}=t,[o,i]=_react.useState.call(void 0, !1);if(!e.visible)return null;let s=!!(e!=null&&e.items&&(e==null?void 0:e.items.length)>0);function l(){i(!o)}return _jsxruntime.jsxs.call(void 0, _material.Box,{children:[_jsxruntime.jsxs.call(void 0, Zr,{onClick:()=>{if(e!=null&&e.link){n(e.link);return}l()},selected:r===e.link,children:[!!e.icon&&_jsxruntime.jsx.call(void 0, _material.Icon,{children:e.icon}),_jsxruntime.jsx.call(void 0, _material.ListItemText,{primary:e.label}),s&&!o&&_jsxruntime.jsx.call(void 0, _iconsmaterial.ExpandMore,{}),s&&o&&_jsxruntime.jsx.call(void 0, _iconsmaterial.ExpandLess,{})]}),(e==null?void 0:e.items)&&_jsxruntime.jsx.call(void 0, _material.Collapse,{in:o,timeout:"auto",unmountOnExit:!0,children:_jsxruntime.jsx.call(void 0, ot,{activeMenu:r,sx:{pl:a=>a.spacing(1.5)},menus:(e==null?void 0:e.items)||[],onMenuClick:n})})]})}function ot(t){let i=t,{menus:e,activeMenu:r,onMenuClick:n}=i,o=X(i,["menus","activeMenu","onMenuClick"]);return _jsxruntime.jsx.call(void 0, _material.List,B(g({component:"nav",disablePadding:!0},o),{children:e.map(s=>_jsxruntime.jsx.call(void 0, vo,{onMenuClick:n,activeMenu:r,menuItem:s},s.id))}))}function To(t){let{menus:e,activeMenu:r,onMenuClick:n}=t,[o,i]=_react.useState.call(void 0, null),s=(a,u,p)=>{i({element:a.currentTarget,id:u,items:p})},l=()=>{i(null)};return _jsxruntime.jsx.call(void 0, _material.List,{component:"nav",disablePadding:!0,children:e.map(a=>a.visible?_jsxruntime.jsxs.call(void 0, Zr,{onMouseEnter:u=>{a!=null&&a.link||s(u,a.id,a.items)},onMouseLeave:()=>{a!=null&&a.link||l()},onClick:()=>{a!=null&&a.link&&n(a.link)},selected:r===a.link,children:[_jsxruntime.jsx.call(void 0, _material.ListItemIcon,{children:_jsxruntime.jsx.call(void 0, _material.Icon,{children:a.icon})}),(o==null?void 0:o.id)===a.id&&_jsxruntime.jsx.call(void 0, _material.Popper,{sx:{zIndex:999999},anchorEl:o==null?void 0:o.element,open:!!(o!=null&&o.element),placement:"right-start",children:_jsxruntime.jsx.call(void 0, ot,{activeMenu:r,onMenuClick:n,menus:(a==null?void 0:a.items)||[],sx:{minWidth:"240px",backgroundColor:U.palette.background.paper,borderRadius:"12px",padding:"16px 4px",boxShadow:"0px 5px 5px -3px rgb(0 0 0 / 20%), 0px 8px 10px 1px rgb(0 0 0 / 14%), 0px 3px 14px 2px rgb(0 0 0 / 12%);"}})})]},`minMenu-${a.id}`):null)})}var qs=(t,e)=>({width:t,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen}),overflowX:"hidden"}),Ws=t=>({transition:t.transitions.create("width",{easing:t.transitions.easing.sharp,duration:t.transitions.duration.leavingScreen}),overflowX:"hidden",width:`calc(${t.spacing(8)} + 1px)`,[t.breakpoints.up("sm")]:{width:`calc(${t.spacing(8)} + 1px)`}}),Sd=_styles.styled.call(void 0, _material.Drawer,{shouldForwardProp:t=>t!=="open"&&t!=="width"})(({theme:t,open:e,width:r})=>g(g({width:r,bgcolor:t.palette.background.paper,boxShadow:"2px 3px 20px -16px rgb(32 32 36 / 30%)",borderRightStyle:"none",whiteSpace:"nowrap",boxSizing:"border-box"},e&&B(g({},qs(r,t)),{"& .MuiDrawer-paper":qs(r,t)})),!e&&B(g({},Ws(t)),{"& .MuiDrawer-paper":Ws(t)})));function Ys(t){let a=t,{open:e,items:r,width:n,activeMenu:o,onMenuClick:i,toggleMenu:s}=a,l=X(a,["open","items","width","activeMenu","onMenuClick","toggleMenu"]);return _jsxruntime.jsxs.call(void 0, Sd,B(g({width:n,open:e,onClose:()=>s(!1)},l),{children:[_jsxruntime.jsx.call(void 0, _material.Toolbar,{}),e&&_jsxruntime.jsx.call(void 0, ot,{onMenuClick:i,activeMenu:o,menus:r}),!e&&_jsxruntime.jsx.call(void 0, To,{onMenuClick:i,activeMenu:o,menus:r})]}))}function Gs(t){return _jsxruntime.jsx.call(void 0, _material.Box,g({m:2,sx:{display:"flex",flexDirection:"column",flexGrow:1}},t))}exports.AlterarSenha = Kr; exports.Button = ne; exports.ButtonContainer = Ie; exports.Checkbox = Fo; exports.ColorsGrid = ko; exports.Content = Gs; exports.CurrencyCellStyle = rh; exports.CurrencyTextField = ln; exports.DataTable = sl; exports.DataTableOptions = dn; exports.DeleteContainer = fn; exports.Dialog = Ee; exports.DrawerMenu = Ys; exports.Editable = Mr; exports.FilterContainer = bn; exports.FilterControl = qt; exports.Flag = Ho; exports.FormContainer = Sn; exports.LabelValue = Wi; exports.MioAuth = zs; exports.OptionStyles = th; exports.PageTitle = Xi; exports.PasswordTextField = Bt; exports.SearchTextField = mt; exports.Surface = zt; exports.Tooltip = st; exports.Transporter = ro; exports.theme = U;
|