componentes-exagono 0.1.83 → 0.1.85
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.es.js +5 -4
- package/dist/index.umd.js +1 -1
- package/package.json +3 -3
package/dist/index.es.js
CHANGED
|
@@ -17330,7 +17330,7 @@ const SD = {
|
|
|
17330
17330
|
Rechazadas: ["Rechazada", "Rechazadas"],
|
|
17331
17331
|
"Finalizadas sin Venta": ["Sin Venta"],
|
|
17332
17332
|
"Finalizadas con Venta": ["Con Venta"],
|
|
17333
|
-
"En Proceso": ["Asignada"]
|
|
17333
|
+
"En Proceso": ["Asignada", "Prospección", "Sin Asignar", "Proceso de Compra", "En Espera de Unidad", "Auto Facturado"]
|
|
17334
17334
|
}, CD = {
|
|
17335
17335
|
Todos: [],
|
|
17336
17336
|
"Selección y presentación de vehículos": [
|
|
@@ -17340,7 +17340,8 @@ const SD = {
|
|
|
17340
17340
|
"Valoración del Auto a cuenta y/o enganche": [
|
|
17341
17341
|
"Valoración del Auto a cuenta y/o enganche"
|
|
17342
17342
|
],
|
|
17343
|
-
"Entrega de vehículo": ["Entrega de vehículo"]
|
|
17343
|
+
"Entrega de vehículo": ["Entrega de vehículo"],
|
|
17344
|
+
"Negociación y Cierre": ["Negociación y Cierre"]
|
|
17344
17345
|
}, kD = {
|
|
17345
17346
|
Todos: [],
|
|
17346
17347
|
"Algo interesado": ["Algo interesado"],
|
|
@@ -17421,8 +17422,8 @@ function DD({
|
|
|
17421
17422
|
"Valoración del Auto a cuenta y/o enganche",
|
|
17422
17423
|
// "Ingreso del Vehículo",
|
|
17423
17424
|
// "En reparación",
|
|
17424
|
-
"Entrega de vehículo"
|
|
17425
|
-
|
|
17425
|
+
"Entrega de vehículo",
|
|
17426
|
+
"Negociación y Cierre"
|
|
17426
17427
|
], ye = () => {
|
|
17427
17428
|
Ee(""), Ke(!1), V(!1), kt(de), lt(pe), te("Todos"), Q("Todos"), Re("Todos");
|
|
17428
17429
|
}, qe = E.useMemo(() => (xe ?? "").trim() !== "" || ne !== "Todos" || R !== "Todos" || be || M || he !== "Todos", [xe, ne, R, be, M, he]);
|
package/dist/index.umd.js
CHANGED
|
@@ -179,4 +179,4 @@ To suppress this warning, you need to explicitly provide the \`palette.${n}Chann
|
|
|
179
179
|
`)}g.write("payload.value = newResult;"),g.write("return payload;");const _=g.compile();return(T,S)=>_(p,T,S)};let s;const i=Hs,a=!Hd.jitless,l=a&&R1.value,u=n.catchall;let f;e._zod.parse=(p,g)=>{f??(f=r.value);const m=p.value;return i(m)?a&&l&&g?.async===!1&&g.jitless!==!0?(s||(s=o(n.shape)),p=s(p,g),u?df([],m,p,g,f,e):p):t(p,g):(p.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),p)}});function ff(e,n,t,r){for(const s of e)if(s.issues.length===0)return n.value=s.value,n;const o=e.filter(s=>!Pn(s));return o.length===1?(n.value=o[0].value,o[0]):(n.issues.push({code:"invalid_union",input:n.value,inst:t,errors:e.map(s=>s.issues.map(i=>on(i,r,nn())))}),n)}const Dx=q("$ZodUnion",(e,n)=>{at.init(e,n),Qe(e._zod,"optin",()=>n.options.some(o=>o._zod.optin==="optional")?"optional":void 0),Qe(e._zod,"optout",()=>n.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Qe(e._zod,"values",()=>{if(n.options.every(o=>o._zod.values))return new Set(n.options.flatMap(o=>Array.from(o._zod.values)))}),Qe(e._zod,"pattern",()=>{if(n.options.every(o=>o._zod.pattern)){const o=n.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>Pa(s.source)).join("|")})$`)}});const t=n.options.length===1,r=n.options[0]._zod.run;e._zod.parse=(o,s)=>{if(t)return r(o,s);let i=!1;const a=[];for(const c of n.options){const l=c._zod.run({value:o.value,issues:[]},s);if(l instanceof Promise)a.push(l),i=!0;else{if(l.issues.length===0)return l;a.push(l)}}return i?Promise.all(a).then(c=>ff(c,o,e,s)):ff(a,o,e,s)}}),Ex=q("$ZodIntersection",(e,n)=>{at.init(e,n),e._zod.parse=(t,r)=>{const o=t.value,s=n.left._zod.run({value:o,issues:[]},r),i=n.right._zod.run({value:o,issues:[]},r);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([c,l])=>pf(t,c,l)):pf(t,s,i)}});function $a(e,n){if(e===n)return{valid:!0,data:e};if(e instanceof Date&&n instanceof Date&&+e==+n)return{valid:!0,data:e};if(yo(e)&&yo(n)){const t=Object.keys(n),r=Object.keys(e).filter(s=>t.indexOf(s)!==-1),o={...e,...n};for(const s of r){const i=$a(e[s],n[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};o[s]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return{valid:!1,mergeErrorPath:[]};const t=[];for(let r=0;r<e.length;r++){const o=e[r],s=n[r],i=$a(o,s);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};t.push(i.data)}return{valid:!0,data:t}}return{valid:!1,mergeErrorPath:[]}}function pf(e,n,t){if(n.issues.length&&e.issues.push(...n.issues),t.issues.length&&e.issues.push(...t.issues),Pn(e))return e;const r=$a(n.value,t.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const Tx=q("$ZodEnum",(e,n)=>{at.init(e,n);const t=P1(n.entries),r=new Set(t);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.filter(o=>$1.has(typeof o)).map(o=>typeof o=="string"?On(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{const i=o.value;return r.has(i)||o.issues.push({code:"invalid_value",values:t,input:i,inst:e}),o}}),Ax=q("$ZodLiteral",(e,n)=>{if(at.init(e,n),n.values.length===0)throw new Error("Cannot create literal schema with no valid values");e._zod.values=new Set(n.values),e._zod.pattern=new RegExp(`^(${n.values.map(t=>typeof t=="string"?On(t):t?On(t.toString()):String(t)).join("|")})$`),e._zod.parse=(t,r)=>{const o=t.value;return e._zod.values.has(o)||t.issues.push({code:"invalid_value",values:n.values,input:o,inst:e}),t}}),Mx=q("$ZodTransform",(e,n)=>{at.init(e,n),e._zod.parse=(t,r)=>{if(r.direction==="backward")throw new Ud(e.constructor.name);const o=n.transform(t.value,t);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(i=>(t.value=i,t));if(o instanceof Promise)throw new Mn;return t.value=o,t}});function hf(e,n){return e.issues.length&&n===void 0?{issues:[],value:void 0}:e}const Ix=q("$ZodOptional",(e,n)=>{at.init(e,n),e._zod.optin="optional",e._zod.optout="optional",Qe(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,void 0]):void 0),Qe(e._zod,"pattern",()=>{const t=n.innerType._zod.pattern;return t?new RegExp(`^(${Pa(t.source)})?$`):void 0}),e._zod.parse=(t,r)=>{if(n.innerType._zod.optin==="optional"){const o=n.innerType._zod.run(t,r);return o instanceof Promise?o.then(s=>hf(s,t.value)):hf(o,t.value)}return t.value===void 0?t:n.innerType._zod.run(t,r)}}),Ox=q("$ZodNullable",(e,n)=>{at.init(e,n),Qe(e._zod,"optin",()=>n.innerType._zod.optin),Qe(e._zod,"optout",()=>n.innerType._zod.optout),Qe(e._zod,"pattern",()=>{const t=n.innerType._zod.pattern;return t?new RegExp(`^(${Pa(t.source)}|null)$`):void 0}),Qe(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,null]):void 0),e._zod.parse=(t,r)=>t.value===null?t:n.innerType._zod.run(t,r)}),Px=q("$ZodDefault",(e,n)=>{at.init(e,n),e._zod.optin="optional",Qe(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(t,r)=>{if(r.direction==="backward")return n.innerType._zod.run(t,r);if(t.value===void 0)return t.value=n.defaultValue,t;const o=n.innerType._zod.run(t,r);return o instanceof Promise?o.then(s=>mf(s,n)):mf(o,n)}});function mf(e,n){return e.value===void 0&&(e.value=n.defaultValue),e}const jx=q("$ZodPrefault",(e,n)=>{at.init(e,n),e._zod.optin="optional",Qe(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(t,r)=>(r.direction==="backward"||t.value===void 0&&(t.value=n.defaultValue),n.innerType._zod.run(t,r))}),Nx=q("$ZodNonOptional",(e,n)=>{at.init(e,n),Qe(e._zod,"values",()=>{const t=n.innerType._zod.values;return t?new Set([...t].filter(r=>r!==void 0)):void 0}),e._zod.parse=(t,r)=>{const o=n.innerType._zod.run(t,r);return o instanceof Promise?o.then(s=>gf(s,e)):gf(o,e)}});function gf(e,n){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:n}),e}const Rx=q("$ZodCatch",(e,n)=>{at.init(e,n),Qe(e._zod,"optin",()=>n.innerType._zod.optin),Qe(e._zod,"optout",()=>n.innerType._zod.optout),Qe(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(t,r)=>{if(r.direction==="backward")return n.innerType._zod.run(t,r);const o=n.innerType._zod.run(t,r);return o instanceof Promise?o.then(s=>(t.value=s.value,s.issues.length&&(t.value=n.catchValue({...t,error:{issues:s.issues.map(i=>on(i,r,nn()))},input:t.value}),t.issues=[]),t)):(t.value=o.value,o.issues.length&&(t.value=n.catchValue({...t,error:{issues:o.issues.map(s=>on(s,r,nn()))},input:t.value}),t.issues=[]),t)}}),$x=q("$ZodPipe",(e,n)=>{at.init(e,n),Qe(e._zod,"values",()=>n.in._zod.values),Qe(e._zod,"optin",()=>n.in._zod.optin),Qe(e._zod,"optout",()=>n.out._zod.optout),Qe(e._zod,"propValues",()=>n.in._zod.propValues),e._zod.parse=(t,r)=>{if(r.direction==="backward"){const s=n.out._zod.run(t,r);return s instanceof Promise?s.then(i=>ti(i,n.in,r)):ti(s,n.in,r)}const o=n.in._zod.run(t,r);return o instanceof Promise?o.then(s=>ti(s,n.out,r)):ti(o,n.out,r)}});function ti(e,n,t){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:e.value,issues:e.issues},t)}const Lx=q("$ZodReadonly",(e,n)=>{at.init(e,n),Qe(e._zod,"propValues",()=>n.innerType._zod.propValues),Qe(e._zod,"values",()=>n.innerType._zod.values),Qe(e._zod,"optin",()=>n.innerType._zod.optin),Qe(e._zod,"optout",()=>n.innerType._zod.optout),e._zod.parse=(t,r)=>{if(r.direction==="backward")return n.innerType._zod.run(t,r);const o=n.innerType._zod.run(t,r);return o instanceof Promise?o.then(vf):vf(o)}});function vf(e){return e.value=Object.freeze(e.value),e}const zx=q("$ZodCustom",(e,n)=>{$t.init(e,n),at.init(e,n),e._zod.parse=(t,r)=>t,e._zod.check=t=>{const r=t.value,o=n.fn(r);if(o instanceof Promise)return o.then(s=>yf(s,t,r,e));yf(o,t,r,e)}});function yf(e,n,t,r){if(!e){const o={code:"custom",input:t,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),n.issues.push(bo(o))}}class Bx{constructor(){this._map=new Map,this._idmap=new Map}add(n,...t){const r=t[0];if(this._map.set(n,r),r&&typeof r=="object"&&"id"in r){if(this._idmap.has(r.id))throw new Error(`ID ${r.id} already exists in the registry`);this._idmap.set(r.id,n)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(n){const t=this._map.get(n);return t&&typeof t=="object"&&"id"in t&&this._idmap.delete(t.id),this._map.delete(n),this}get(n){const t=n._zod.parent;if(t){const r={...this.get(t)??{}};delete r.id;const o={...r,...this._map.get(n)};return Object.keys(o).length?o:void 0}return this._map.get(n)}has(n){return this._map.has(n)}}function Fx(){return new Bx}const ri=Fx();function Vx(e,n){return new e({type:"string",...Ce(n)})}function Yx(e,n){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ce(n)})}function bf(e,n){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ce(n)})}function Wx(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ce(n)})}function Ux(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ce(n)})}function Hx(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ce(n)})}function Zx(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ce(n)})}function Gx(e,n){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ce(n)})}function qx(e,n){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ce(n)})}function Kx(e,n){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ce(n)})}function Qx(e,n){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ce(n)})}function Xx(e,n){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ce(n)})}function Jx(e,n){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ce(n)})}function ew(e,n){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ce(n)})}function tw(e,n){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ce(n)})}function rw(e,n){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ce(n)})}function nw(e,n){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ce(n)})}function ow(e,n){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ce(n)})}function sw(e,n){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ce(n)})}function iw(e,n){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ce(n)})}function aw(e,n){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ce(n)})}function cw(e,n){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ce(n)})}function lw(e,n){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ce(n)})}function uw(e,n){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ce(n)})}function dw(e,n){return new e({type:"string",format:"date",check:"string_format",...Ce(n)})}function fw(e,n){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ce(n)})}function pw(e,n){return new e({type:"string",format:"duration",check:"string_format",...Ce(n)})}function hw(e,n){return new e({type:"number",checks:[],...Ce(n)})}function mw(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ce(n)})}function gw(e,n){return new e({type:"boolean",...Ce(n)})}function vw(e){return new e({type:"unknown"})}function yw(e,n){return new e({type:"never",...Ce(n)})}function xf(e,n){return new of({check:"less_than",...Ce(n),value:e,inclusive:!1})}function La(e,n){return new of({check:"less_than",...Ce(n),value:e,inclusive:!0})}function wf(e,n){return new sf({check:"greater_than",...Ce(n),value:e,inclusive:!1})}function za(e,n){return new sf({check:"greater_than",...Ce(n),value:e,inclusive:!0})}function _f(e,n){return new j2({check:"multiple_of",...Ce(n),value:e})}function Sf(e,n){return new R2({check:"max_length",...Ce(n),maximum:e})}function ni(e,n){return new $2({check:"min_length",...Ce(n),minimum:e})}function Cf(e,n){return new L2({check:"length_equals",...Ce(n),length:e})}function bw(e,n){return new z2({check:"string_format",format:"regex",...Ce(n),pattern:e})}function xw(e){return new B2({check:"string_format",format:"lowercase",...Ce(e)})}function ww(e){return new F2({check:"string_format",format:"uppercase",...Ce(e)})}function _w(e,n){return new V2({check:"string_format",format:"includes",...Ce(n),includes:e})}function Sw(e,n){return new Y2({check:"string_format",format:"starts_with",...Ce(n),prefix:e})}function Cw(e,n){return new W2({check:"string_format",format:"ends_with",...Ce(n),suffix:e})}function xo(e){return new U2({check:"overwrite",tx:e})}function kw(e){return xo(n=>n.normalize(e))}function Dw(){return xo(e=>e.trim())}function Ew(){return xo(e=>e.toLowerCase())}function Tw(){return xo(e=>e.toUpperCase())}function Aw(e,n,t){return new e({type:"array",element:n,...Ce(t)})}function Mw(e,n,t){return new e({type:"custom",check:"custom",fn:n,...Ce(t)})}function Iw(e){const n=Ow(t=>(t.addIssue=r=>{if(typeof r=="string")t.issues.push(bo(r,t.value,n._zod.def));else{const o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=t.value),o.inst??(o.inst=n),o.continue??(o.continue=!n._zod.def.abort),t.issues.push(bo(o))}},e(t.value,t)));return n}function Ow(e,n){const t=new $t({check:"custom",...Ce(n)});return t._zod.check=e,t}function kf(e,n){try{var t=e()}catch(r){return n(r)}return t&&t.then?t.then(void 0,n):t}function Pw(e,n){for(var t={};e.length;){var r=e[0],o=r.code,s=r.message,i=r.path.join(".");if(!t[i])if("unionErrors"in r){var a=r.unionErrors[0].errors[0];t[i]={message:a.message,type:a.code}}else t[i]={message:s,type:o};if("unionErrors"in r&&r.unionErrors.forEach(function(u){return u.errors.forEach(function(f){return e.push(f)})}),n){var c=t[i].types,l=c&&c[r.code];t[i]=ka(i,n,t,o,l?[].concat(l,r.message):r.message)}e.shift()}return t}function jw(e,n){for(var t={};e.length;){var r=e[0],o=r.code,s=r.message,i=r.path.join(".");if(!t[i])if(r.code==="invalid_union"&&r.errors.length>0){var a=r.errors[0][0];t[i]={message:a.message,type:a.code}}else t[i]={message:s,type:o};if(r.code==="invalid_union"&&r.errors.forEach(function(u){return u.forEach(function(f){return e.push(f)})}),n){var c=t[i].types,l=c&&c[r.code];t[i]=ka(i,n,t,o,l?[].concat(l,r.message):r.message)}e.shift()}return t}function Nw(e,n,t){if(t===void 0&&(t={}),(function(r){return"_def"in r&&typeof r._def=="object"&&"typeName"in r._def})(e))return function(r,o,s){try{return Promise.resolve(kf(function(){return Promise.resolve(e[t.mode==="sync"?"parse":"parseAsync"](r,n)).then(function(i){return s.shouldUseNativeValidation&&Aa({},s),{errors:{},values:t.raw?Object.assign({},r):i}})},function(i){if((function(a){return Array.isArray(a?.issues)})(i))return{values:{},errors:Yd(Pw(i.errors,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw i}))}catch(i){return Promise.reject(i)}};if((function(r){return"_zod"in r&&typeof r._zod=="object"})(e))return function(r,o,s){try{return Promise.resolve(kf(function(){return Promise.resolve((t.mode==="sync"?q1:K1)(e,r,n)).then(function(i){return s.shouldUseNativeValidation&&Aa({},s),{errors:{},values:t.raw?Object.assign({},r):i}})},function(i){if((function(a){return a instanceof Na})(i))return{values:{},errors:Yd(jw(i.issues,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw i}))}catch(i){return Promise.reject(i)}};throw new Error("Invalid input: not a Zod schema")}const Rw=q("ZodISODateTime",(e,n)=>{sx.init(e,n),rt.init(e,n)});function $w(e){return uw(Rw,e)}const Lw=q("ZodISODate",(e,n)=>{ix.init(e,n),rt.init(e,n)});function zw(e){return dw(Lw,e)}const Bw=q("ZodISOTime",(e,n)=>{ax.init(e,n),rt.init(e,n)});function Fw(e){return fw(Bw,e)}const Vw=q("ZodISODuration",(e,n)=>{cx.init(e,n),rt.init(e,n)});function Yw(e){return pw(Vw,e)}const Xt=q("ZodError",(e,n)=>{Na.init(e,n),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>G1(e,t)},flatten:{value:t=>Z1(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Ma,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Ma,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Ww=qs(Xt),Uw=Ks(Xt),Hw=Qs(Xt),Zw=Xs(Xt),Gw=J1(Xt),qw=e2(Xt),Kw=t2(Xt),Qw=r2(Xt),Xw=n2(Xt),Jw=o2(Xt),e_=s2(Xt),t_=i2(Xt),ht=q("ZodType",(e,n)=>(at.init(e,n),e.def=n,e.type=n.type,Object.defineProperty(e,"_def",{value:n}),e.check=(...t)=>e.clone({...n,checks:[...n.checks??[],...t.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),e.clone=(t,r)=>Br(e,t,r),e.brand=()=>e,e.register=((t,r)=>(t.add(e,r),e)),e.parse=(t,r)=>Ww(e,t,r,{callee:e.parse}),e.safeParse=(t,r)=>Hw(e,t,r),e.parseAsync=async(t,r)=>Uw(e,t,r,{callee:e.parseAsync}),e.safeParseAsync=async(t,r)=>Zw(e,t,r),e.spa=e.safeParseAsync,e.encode=(t,r)=>Gw(e,t,r),e.decode=(t,r)=>qw(e,t,r),e.encodeAsync=async(t,r)=>Kw(e,t,r),e.decodeAsync=async(t,r)=>Qw(e,t,r),e.safeEncode=(t,r)=>Xw(e,t,r),e.safeDecode=(t,r)=>Jw(e,t,r),e.safeEncodeAsync=async(t,r)=>e_(e,t,r),e.safeDecodeAsync=async(t,r)=>t_(e,t,r),e.refine=(t,r)=>e.check(K_(t,r)),e.superRefine=t=>e.check(Q_(t)),e.overwrite=t=>e.check(xo(t)),e.optional=()=>Pf(e),e.nullable=()=>jf(e),e.nullish=()=>Pf(jf(e)),e.nonoptional=t=>Y_(e,t),e.array=()=>D_(e),e.or=t=>M_([e,t]),e.and=t=>O_(e,t),e.transform=t=>Rf(e,$_(t)),e.default=t=>B_(e,t),e.prefault=t=>V_(e,t),e.catch=t=>U_(e,t),e.pipe=t=>Rf(e,t),e.readonly=()=>G_(e),e.describe=t=>{const r=e.clone();return ri.add(r,{description:t}),r},Object.defineProperty(e,"description",{get(){return ri.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return ri.get(e);const r=e.clone();return ri.add(r,t[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Df=q("_ZodString",(e,n)=>{Ra.init(e,n),ht.init(e,n);const t=e._zod.bag;e.format=t.format??null,e.minLength=t.minimum??null,e.maxLength=t.maximum??null,e.regex=(...r)=>e.check(bw(...r)),e.includes=(...r)=>e.check(_w(...r)),e.startsWith=(...r)=>e.check(Sw(...r)),e.endsWith=(...r)=>e.check(Cw(...r)),e.min=(...r)=>e.check(ni(...r)),e.max=(...r)=>e.check(Sf(...r)),e.length=(...r)=>e.check(Cf(...r)),e.nonempty=(...r)=>e.check(ni(1,...r)),e.lowercase=r=>e.check(xw(r)),e.uppercase=r=>e.check(ww(r)),e.trim=()=>e.check(Dw()),e.normalize=(...r)=>e.check(kw(...r)),e.toLowerCase=()=>e.check(Ew()),e.toUpperCase=()=>e.check(Tw())}),r_=q("ZodString",(e,n)=>{Ra.init(e,n),Df.init(e,n),e.email=t=>e.check(Yx(n_,t)),e.url=t=>e.check(Gx(o_,t)),e.jwt=t=>e.check(lw(b_,t)),e.emoji=t=>e.check(qx(s_,t)),e.guid=t=>e.check(bf(Ef,t)),e.uuid=t=>e.check(Wx(oi,t)),e.uuidv4=t=>e.check(Ux(oi,t)),e.uuidv6=t=>e.check(Hx(oi,t)),e.uuidv7=t=>e.check(Zx(oi,t)),e.nanoid=t=>e.check(Kx(i_,t)),e.guid=t=>e.check(bf(Ef,t)),e.cuid=t=>e.check(Qx(a_,t)),e.cuid2=t=>e.check(Xx(c_,t)),e.ulid=t=>e.check(Jx(l_,t)),e.base64=t=>e.check(iw(g_,t)),e.base64url=t=>e.check(aw(v_,t)),e.xid=t=>e.check(ew(u_,t)),e.ksuid=t=>e.check(tw(d_,t)),e.ipv4=t=>e.check(rw(f_,t)),e.ipv6=t=>e.check(nw(p_,t)),e.cidrv4=t=>e.check(ow(h_,t)),e.cidrv6=t=>e.check(sw(m_,t)),e.e164=t=>e.check(cw(y_,t)),e.datetime=t=>e.check($w(t)),e.date=t=>e.check(zw(t)),e.time=t=>e.check(Fw(t)),e.duration=t=>e.check(Yw(t))});function ar(e){return Vx(r_,e)}const rt=q("ZodStringFormat",(e,n)=>{tt.init(e,n),Df.init(e,n)}),n_=q("ZodEmail",(e,n)=>{K2.init(e,n),rt.init(e,n)}),Ef=q("ZodGUID",(e,n)=>{G2.init(e,n),rt.init(e,n)}),oi=q("ZodUUID",(e,n)=>{q2.init(e,n),rt.init(e,n)}),o_=q("ZodURL",(e,n)=>{Q2.init(e,n),rt.init(e,n)}),s_=q("ZodEmoji",(e,n)=>{X2.init(e,n),rt.init(e,n)}),i_=q("ZodNanoID",(e,n)=>{J2.init(e,n),rt.init(e,n)}),a_=q("ZodCUID",(e,n)=>{ex.init(e,n),rt.init(e,n)}),c_=q("ZodCUID2",(e,n)=>{tx.init(e,n),rt.init(e,n)}),l_=q("ZodULID",(e,n)=>{rx.init(e,n),rt.init(e,n)}),u_=q("ZodXID",(e,n)=>{nx.init(e,n),rt.init(e,n)}),d_=q("ZodKSUID",(e,n)=>{ox.init(e,n),rt.init(e,n)}),f_=q("ZodIPv4",(e,n)=>{lx.init(e,n),rt.init(e,n)}),p_=q("ZodIPv6",(e,n)=>{ux.init(e,n),rt.init(e,n)}),h_=q("ZodCIDRv4",(e,n)=>{dx.init(e,n),rt.init(e,n)}),m_=q("ZodCIDRv6",(e,n)=>{fx.init(e,n),rt.init(e,n)}),g_=q("ZodBase64",(e,n)=>{px.init(e,n),rt.init(e,n)}),v_=q("ZodBase64URL",(e,n)=>{mx.init(e,n),rt.init(e,n)}),y_=q("ZodE164",(e,n)=>{gx.init(e,n),rt.init(e,n)}),b_=q("ZodJWT",(e,n)=>{yx.init(e,n),rt.init(e,n)}),Tf=q("ZodNumber",(e,n)=>{cf.init(e,n),ht.init(e,n),e.gt=(r,o)=>e.check(wf(r,o)),e.gte=(r,o)=>e.check(za(r,o)),e.min=(r,o)=>e.check(za(r,o)),e.lt=(r,o)=>e.check(xf(r,o)),e.lte=(r,o)=>e.check(La(r,o)),e.max=(r,o)=>e.check(La(r,o)),e.int=r=>e.check(Mf(r)),e.safe=r=>e.check(Mf(r)),e.positive=r=>e.check(wf(0,r)),e.nonnegative=r=>e.check(za(0,r)),e.negative=r=>e.check(xf(0,r)),e.nonpositive=r=>e.check(La(0,r)),e.multipleOf=(r,o)=>e.check(_f(r,o)),e.step=(r,o)=>e.check(_f(r,o)),e.finite=()=>e;const t=e._zod.bag;e.minValue=Math.max(t.minimum??Number.NEGATIVE_INFINITY,t.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(t.maximum??Number.POSITIVE_INFINITY,t.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(t.format??"").includes("int")||Number.isSafeInteger(t.multipleOf??.5),e.isFinite=!0,e.format=t.format??null});function Af(e){return hw(Tf,e)}const x_=q("ZodNumberFormat",(e,n)=>{bx.init(e,n),Tf.init(e,n)});function Mf(e){return mw(x_,e)}const w_=q("ZodBoolean",(e,n)=>{xx.init(e,n),ht.init(e,n)});function Ba(e){return gw(w_,e)}const __=q("ZodUnknown",(e,n)=>{wx.init(e,n),ht.init(e,n)});function If(){return vw(__)}const S_=q("ZodNever",(e,n)=>{_x.init(e,n),ht.init(e,n)});function C_(e){return yw(S_,e)}const k_=q("ZodArray",(e,n)=>{Sx.init(e,n),ht.init(e,n),e.element=n.element,e.min=(t,r)=>e.check(ni(t,r)),e.nonempty=t=>e.check(ni(1,t)),e.max=(t,r)=>e.check(Sf(t,r)),e.length=(t,r)=>e.check(Cf(t,r)),e.unwrap=()=>e.element});function D_(e,n){return Aw(k_,e,n)}const E_=q("ZodObject",(e,n)=>{kx.init(e,n),ht.init(e,n),Qe(e,"shape",()=>n.shape),e.keyof=()=>P_(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:If()}),e.loose=()=>e.clone({...e._zod.def,catchall:If()}),e.strict=()=>e.clone({...e._zod.def,catchall:C_()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>V1(e,t),e.safeExtend=t=>Y1(e,t),e.merge=t=>W1(e,t),e.pick=t=>B1(e,t),e.omit=t=>F1(e,t),e.partial=(...t)=>U1(Of,e,t[0]),e.required=(...t)=>H1(Nf,e,t[0])});function T_(e,n){const t={type:"object",get shape(){return zr(this,"shape",e?N1(e):{}),this.shape},...Ce(n)};return new E_(t)}const A_=q("ZodUnion",(e,n)=>{Dx.init(e,n),ht.init(e,n),e.options=n.options});function M_(e,n){return new A_({type:"union",options:e,...Ce(n)})}const I_=q("ZodIntersection",(e,n)=>{Ex.init(e,n),ht.init(e,n)});function O_(e,n){return new I_({type:"intersection",left:e,right:n})}const Fa=q("ZodEnum",(e,n)=>{Tx.init(e,n),ht.init(e,n),e.enum=n.entries,e.options=Object.values(n.entries);const t=new Set(Object.keys(n.entries));e.extract=(r,o)=>{const s={};for(const i of r)if(t.has(i))s[i]=n.entries[i];else throw new Error(`Key ${i} not found in enum`);return new Fa({...n,checks:[],...Ce(o),entries:s})},e.exclude=(r,o)=>{const s={...n.entries};for(const i of r)if(t.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new Fa({...n,checks:[],...Ce(o),entries:s})}});function P_(e,n){const t=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Fa({type:"enum",entries:t,...Ce(n)})}const j_=q("ZodLiteral",(e,n)=>{Ax.init(e,n),ht.init(e,n),e.values=new Set(n.values),Object.defineProperty(e,"value",{get(){if(n.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return n.values[0]}})});function N_(e,n){return new j_({type:"literal",values:Array.isArray(e)?e:[e],...Ce(n)})}const R_=q("ZodTransform",(e,n)=>{Mx.init(e,n),ht.init(e,n),e._zod.parse=(t,r)=>{if(r.direction==="backward")throw new Ud(e.constructor.name);t.addIssue=s=>{if(typeof s=="string")t.issues.push(bo(s,t.value,n));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=t.value),i.inst??(i.inst=e),t.issues.push(bo(i))}};const o=n.transform(t.value,t);return o instanceof Promise?o.then(s=>(t.value=s,t)):(t.value=o,t)}});function $_(e){return new R_({type:"transform",transform:e})}const Of=q("ZodOptional",(e,n)=>{Ix.init(e,n),ht.init(e,n),e.unwrap=()=>e._zod.def.innerType});function Pf(e){return new Of({type:"optional",innerType:e})}const L_=q("ZodNullable",(e,n)=>{Ox.init(e,n),ht.init(e,n),e.unwrap=()=>e._zod.def.innerType});function jf(e){return new L_({type:"nullable",innerType:e})}const z_=q("ZodDefault",(e,n)=>{Px.init(e,n),ht.init(e,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function B_(e,n){return new z_({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():Kd(n)}})}const F_=q("ZodPrefault",(e,n)=>{jx.init(e,n),ht.init(e,n),e.unwrap=()=>e._zod.def.innerType});function V_(e,n){return new F_({type:"prefault",innerType:e,get defaultValue(){return typeof n=="function"?n():Kd(n)}})}const Nf=q("ZodNonOptional",(e,n)=>{Nx.init(e,n),ht.init(e,n),e.unwrap=()=>e._zod.def.innerType});function Y_(e,n){return new Nf({type:"nonoptional",innerType:e,...Ce(n)})}const W_=q("ZodCatch",(e,n)=>{Rx.init(e,n),ht.init(e,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function U_(e,n){return new W_({type:"catch",innerType:e,catchValue:typeof n=="function"?n:()=>n})}const H_=q("ZodPipe",(e,n)=>{$x.init(e,n),ht.init(e,n),e.in=n.in,e.out=n.out});function Rf(e,n){return new H_({type:"pipe",in:e,out:n})}const Z_=q("ZodReadonly",(e,n)=>{Lx.init(e,n),ht.init(e,n),e.unwrap=()=>e._zod.def.innerType});function G_(e){return new Z_({type:"readonly",innerType:e})}const q_=q("ZodCustom",(e,n)=>{zx.init(e,n),ht.init(e,n)});function K_(e,n={}){return Mw(q_,e,n)}function Q_(e){return Iw(e)}const $f=/^([01][0-9]|2[0-3]):[0-5][0-9]$/,Lf=(e,n)=>{if(!e||!n)return null;const t=e.split("-");if(t.length!==3)return null;const r=parseInt(t[0],10),o=parseInt(t[1],10)-1,s=parseInt(t[2],10),i=n.split(":");if(i.length!==2)return null;const a=parseInt(i[0],10),c=parseInt(i[1],10),l=new Date(r,o,s,a,c);return isNaN(l.getTime())||!w.isValid(l)?null:l},X_=T_({titulo:ar().min(1,"El campo Título es requerido.").refine(e=>!e.startsWith(" "),{message:"El título no puede empezar con un espacio en blanco"}),fechaInicio:ar().min(1,"El campo fecha inicio es requerido."),horaInicio:ar().min(1,"La hora de inicio es requerida.").regex($f,{message:"Formato inválido"}),horaFin:ar().min(1,"La hora fin es requerida.").regex($f,{message:"Formato inválido"}),todoElDia:Ba(),fechaFin:ar().optional(),showEndDate:Ba().optional(),horaInicio2:ar().optional(),TodoElDia2:Ba().optional(),client:ar().optional().nullable(),repetir:ar().optional(),link:ar().trim().url("Debe ser una URL válida. Ejemplo https://meet.google.com/").or(N_("")).optional().refine(e=>e===void 0?!0:!/\s/.test(e),{message:"El enlace no puede contener espacios en blanco"}),descripcion:ar().optional(),color:ar().optional(),solID:Af().optional().nullable(),disID:Af().optional().nullable()}).refine(e=>e.showEndDate?e.fechaFin&&e.fechaFin.length>0:!0,{message:"La fecha de fin es requerida.",path:["fechaFin"]}).refine(e=>e.fechaFin!==void 0?!!e.fechaFin&&!!e.horaInicio2:!0,{message:"La hora de fin son requeridas.",path:["horaInicio2"]}).refine(e=>{if(e.todoElDia||!e.fechaInicio||!e.horaInicio||!e.fechaFin||!e.horaInicio2)return!0;const n=Lf(e.fechaInicio,e.horaInicio),t=Lf(e.fechaFin,e.horaFin);return!n||!t||!w.isValid(n)||!w.isValid(t)?!0:!(w.isBefore(t,n)&&!w.isSameDay(t,n)||w.isSameDay(n,t)&&w.isBefore(t,n))},{message:"",path:["horaFin"]}),zf=e=>se.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",...e},se.createElement("path",{fill:"#333",d:"M12 24C5.38 24 0 18.608 0 12S5.38 0 12 0s12 5.38 12 12-5.38 12-12 12"}),se.createElement("path",{fill:"#fff",d:"M16.703 7.275c.52.52.541 1.345.046 1.84l-2.874 2.874 2.874 2.873c.495.496.475 1.32-.046 1.841-.52.52-1.344.54-1.84.045l-2.873-2.873-2.874 2.873c-.496.496-1.32.475-1.84-.045-.521-.521-.541-1.345-.046-1.84l2.874-2.874L7.23 9.116c-.495-.496-.475-1.32.045-1.84.521-.521 1.345-.542 1.841-.046l2.874 2.873 2.873-2.873c.496-.496 1.32-.476 1.84.045"})),J_="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20fill='none'%3e%3cg%20fill='%23404756'%20clip-path='url(%23a)'%3e%3cpath%20d='M7.288%2022.986h-.147a6.2%206.2%200%200%201-4.28-1.85c-2.404-2.404-2.478-6.24-.16-8.557L4.28%2011a1.228%201.228%200%201%201%201.739%201.739L4.44%2014.317c-1.356%201.357-1.282%203.626.16%205.068a3.82%203.82%200%200%200%202.602%201.135c.95%200%201.825-.32%202.479-.974l1.578-1.579a1.23%201.23%200%200%201%201.739%200c.48.481.48%201.258%200%201.739l-1.579%201.578c-1.097%201.098-2.552%201.69-4.13%201.69zM17.98%2012.998a1.23%201.23%200%200%201%200-1.739l1.578-1.578c.654-.654.986-1.53.974-2.466a3.78%203.78%200%200%200-1.134-2.602c-1.443-1.443-3.712-1.517-5.068-.16L12.75%206.03c-.48.48-1.258.48-1.739%200a1.23%201.23%200%200%201%200-1.739l1.579-1.578c2.318-2.319%206.153-2.245%208.558.16a6.23%206.23%200%200%201%201.85%204.279%205.84%205.84%200%200%201-1.69%204.279l-1.578%201.578c-.481.481-1.258.481-1.74%200z'/%3e%3cpath%20d='M14.172%208.11%208.07%2014.214a1.233%201.233%200%200%200%201.743%201.744l6.104-6.104a1.233%201.233%200%201%200-1.744-1.744'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='a'%3e%3cpath%20fill='%23fff'%20d='M0%200h24v24H0z'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",eS=e=>se.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",...e},se.createElement("g",{clipPath:"url(#a)"},se.createElement("path",{fill:"#404756",d:"M21.24 5.72a2.98 2.98 0 0 0-2.97-2.96l-5.19-.06c-1.06-.03-2.12.41-2.87 1.17l-7.49 7.49c-.66.66-1.03 1.54-1.03 2.47s.36 1.81 1.03 2.47l4.97 4.97a3.5 3.5 0 0 0 2.47 1.02c.89 0 1.79-.34 2.47-1.02l7.49-7.49c.76-.76 1.18-1.81 1.17-2.88l-.06-5.19zm-4.2 4.43c-.44.44-1.02.66-1.6.66a2.256 2.256 0 1 1 0-4.51 2.256 2.256 0 0 1 1.6 3.85"})),se.createElement("defs",null,se.createElement("clipPath",{id:"a"},se.createElement("path",{fill:"#fff",d:"M0 0h24v24H0z"})))),tS="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20fill='none'%3e%3cpath%20fill='%23404756'%20d='M13.17%2013.68c2.06%200%204%20.8%205.46%202.27a7.7%207.7%200%200%201%202.26%205.47c0%20.79-.64%201.43-1.43%201.43l.01-.01H4.53c-.79%200-1.43-.64-1.43-1.43%200-4.27%203.46-7.73%207.72-7.73zM12%201.9c2.82%200%205.11%202.29%205.11%205.11s-2.29%205.11-5.11%205.11v-.01c-2.82%200-5.11-2.29-5.11-5.11S9.18%201.9%2012%201.9'/%3e%3c/svg%3e",rS=e=>se.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",...e},se.createElement("g",{fill:"#2571D6",clipPath:"url(#a)"},se.createElement("path",{d:"M13.085 7.331a1.096 1.096 0 1 0-2.192 0v9.316a1.096 1.096 0 0 0 2.192 0z"}),se.createElement("path",{d:"M16.647 10.893H7.33a1.096 1.096 0 1 0 0 2.192h9.316a1.096 1.096 0 0 0 0-2.192"}),se.createElement("path",{d:"M12 24C5.38 24 0 18.608 0 12S5.38 0 12 0s12 5.38 12 12-5.38 12-12 12m0-21.808c-5.414 0-9.808 4.394-9.808 9.808S6.586 21.808 12 21.808s9.808-4.394 9.808-9.808S17.403 2.192 12 2.192"})),se.createElement("defs",null,se.createElement("clipPath",{id:"a"},se.createElement("path",{fill:"#fff",d:"M0 0h24v24H0z"})))),nS="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20fill='none'%3e%3cg%20fill='%23404756'%20clip-path='url(%23a)'%3e%3cpath%20d='M13.789%2017H3.21C2.542%2017%202%2017.56%202%2018.25s.542%201.25%201.211%201.25H13.79c.669%200%201.211-.56%201.211-1.25S14.458%2017%2013.789%2017M20.718%204H3.282C2.574%204%202%204.56%202%205.25S2.574%206.5%203.282%206.5h17.436C21.426%206.5%2022%205.94%2022%205.25S21.426%204%2020.718%204M20.718%2010.5H3.282C2.574%2010.5%202%2011.06%202%2011.75S2.574%2013%203.282%2013h17.436c.708%200%201.282-.56%201.282-1.25s-.574-1.25-1.282-1.25'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='a'%3e%3cpath%20fill='%23fff'%20d='M0%200h24v24H0z'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",oS=e=>se.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",...e},se.createElement("path",{fill:"#2571D6",fillRule:"evenodd",d:"M17.333 11a6.34 6.34 0 0 1 6.334 6.333 6.34 6.34 0 0 1-6.334 6.334c-3.493 0-6.333-2.846-6.333-6.334A6.343 6.343 0 0 1 17.333 11m-.005 2.37c-.437 0-.79.338-.79.754v2.412h-2.414c-.416 0-.754.355-.754.792s.338.792.754.792h2.413v2.412c0 .416.354.754.791.754s.792-.338.792-.754V18.12h2.413c.416 0 .754-.355.754-.792s-.338-.792-.754-.792H18.12v-2.412c0-.416-.355-.754-.792-.754",clipRule:"evenodd"}),se.createElement("path",{fill:"#2571D6",d:"M11.12 12.297a7.97 7.97 0 0 0-1.787 5.036c0 1.763.571 3.392 1.537 4.714H3.044c-.84 0-1.523-.682-1.523-1.523 0-4.544 3.683-8.227 8.217-8.227zM10.995.139c2.925 0 5.3 2.376 5.3 5.3s-2.376 5.3-5.3 5.3v-.01a5.303 5.303 0 0 1-5.3-5.3 5.295 5.295 0 0 1 5.3-5.29"})),Bf=it(d.jsx("path",{d:"m12 4-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"}),"ArrowForward"),sn=it(d.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),sS=it(d.jsx("path",{d:"M16.53 11.06 15.47 10l-4.88 4.88-2.12-2.12-1.06 1.06L10.59 17zM19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 16H5V8h14z"}),"EventAvailable"),iS={position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:{xs:"90%",sm:450,md:500},bgcolor:"background.paper",boxShadow:24,p:{xs:2,sm:3},borderRadius:2,maxHeight:"90vh",overflowY:"auto"},Va=["#dbe3fe","#fcebc7","#d9f1d2","#fdf5d1","#ebe3d7","#e1d6fb","#f7c7cc","#f9e7fb","#eaedf2","#d5d8dd"],jn=(()=>{const e=[];for(let n=0;n<24;n++)for(let t=0;t<60;t+=15){const r=n.toString().padStart(2,"0"),o=t.toString().padStart(2,"0");e.push(`${r}:${o}`)}return e})(),wo=(e,n)=>{if(!e||!n)return null;const t=e.split("-");if(t.length!==3)return null;const r=parseInt(t[0],10),o=parseInt(t[1],10)-1,s=parseInt(t[2],10),i=n.split(":");if(i.length!==2)return null;const a=parseInt(i[0],10),c=parseInt(i[1],10),l=new Date(s,o,r,a,c);return isNaN(l.getTime())||!w.isValid(l)?null:l},aS=({isVisible:e,onClose:n,onSave:t,onDelete:r,selectedDate:o,initialEvent:s,userId:i,masNombreBD:a,disId:c})=>{const[l,u]=y.useState(!1),[f,p]=y.useState(!1),g=w.format(new Date,"yyyy-MM-dd"),[m,h]=y.useState(""),[x,C]=y.useState([]),[_,T]=y.useState(!1),S=va(),[D,P]=y.useState([]),[A,G]=y.useState(""),{control:R,handleSubmit:B,reset:Q,formState:{errors:v,isValid:j},watch:I,setValue:F}=Fd({resolver:Nw(X_),defaultValues:{titulo:"",fechaInicio:w.format(new Date,"yyyy-MM-dd"),horaInicio:w.format(new Date,"HH:mm"),horaFin:w.format(w.addHours(new Date,1),"HH:mm"),todoElDia:!1,client:"",repetir:"No repetir",link:"",descripcion:"",color:Va[0],solID:null},mode:"onChange"}),H=I("fechaInicio"),ee=I("fechaFin"),ne=I("todoElDia");y.useEffect(()=>{if(m.trim()===""||!i||!c||!a){C([]),P([]),F("solID",null),T(!1),G("");return}console.log("medo"),T(!0);const N=setTimeout(()=>{S.getClients(m,c,a,i).then(W=>{if(T(!1),W){const fe=W.map(Ee=>Ee.solID);P([...new Set(fe)])}else P([]);const he=Array.from(new Map(W.map(fe=>[fe.nombreCliente,fe])).values());if(he.length>0)C(he),G("");else if(s?.client&&s.solID!==null){const fe=[{solID:s.solID,nombreCliente:s.client}];C(fe),G("Sin resultados")}else C([]),G("Sin resultados")}).catch(W=>{console.error("Error al buscar clientes:",W),T(!1)})},500);return()=>clearTimeout(N)},[m,i,c,a]),y.useEffect(()=>{if(H&&ee){const N=new Date(H),W=new Date(ee);(N===W||N>W)&&F("fechaFin",H)}},[H,ee,F]),y.useEffect(()=>{H&&F("fechaFin",H)},[H]),y.useEffect(()=>{F("showEndDate",l)},[l,F]),y.useEffect(()=>{if(s){const N=w.format(s.fechaInicio,"yyyy-MM-dd")===w.format(s.fechaFin,"yyyy-MM-dd");u(!N),F("titulo",s?.titulo),F("fechaInicio",w.format(s.fechaInicio,"yyyy-MM-dd")),F("fechaFin",w.format(s.fechaFin,"yyyy-MM-dd")),F("horaInicio",w.format(s.fechaInicio,"HH:mm")),F("horaFin",w.format(s.fechaFin,"HH:mm")),F("horaInicio2",w.format(s.fechaFin,"HH:mm")),F("descripcion",s.descripcion),F("link",s.link),F("repetir","false"),F("color",s.color),F("todoElDia",s.todoElDia),F("solID",s.solID),F("client",s.client),s.solID?p(!0):p(!1)}else{const N=o||new Date,W=new Date,he=new Date(N.getFullYear(),N.getMonth(),N.getDate(),W.getHours(),W.getMinutes()),fe=w.addHours(he,1);Q({titulo:"",fechaInicio:w.format(he,"yyyy-MM-dd"),horaInicio:w.format(he,"HH:mm"),fechaFin:w.format(fe,"yyyy-MM-dd"),horaFin:w.format(fe,"HH:mm"),horaInicio2:w.format(fe,"HH:mm"),todoElDia:!1,client:"",repetir:"No repetir",link:"",descripcion:"",color:Va[0],solID:null}),u(!1),p(!1)}},[s,e,o]);const ye=B(N=>{t(N,s?.eventoID),n(),Q(),u(!1)},N=>{console.log("Errores de validación:",N)});y.useEffect(()=>{ne&&(F("horaInicio","00:00"),F("horaFin","23:59"))},[ne,F,I]);const V=()=>{const N=I("fechaInicio");if(N){const W=new Date(`${N}T00:00:00`),he=w.addDays(W,1);F("fechaFin",w.format(he,"yyyy-MM-dd"))}u(!0)},U=I("fechaInicio"),ce=I("horaInicio"),ue=I("fechaFin"),ge=I("horaFin"),[ve,pe]=y.useState(null),[de,_e]=y.useState(null);y.useEffect(()=>{(ve===null||ve!==ce)&&pe(ce)},[ce,ve]),y.useEffect(()=>{(de===null||de!==ge)&&_e(ge??"")},[ge,de]);const De=I("todoElDia");y.useEffect(()=>{if(De||!ce||!ge||!U||!ue)return;const N=wo(U,ce),W=wo(ue,ge);if(!N||!W||!w.isValid(N)||!w.isValid(W))return;const he=w.isSameDay(N,W),fe=he&&(w.isAfter(N,W)||N.getTime()===W.getTime()),Ee=w.isBefore(W,N)&&!he;(fe||Ee)&&(F("horaFin",""),_e(""))},[ce,U]);const xe=y.useMemo(()=>{if(!ce||!U)return jn;const N=wo(U,ce),W=wo(ue,"00:00");return!N||!W||!w.isValid(N)||!w.isValid(W)||w.isBefore(W,N)&&!w.isSameDay(W,N)?jn:w.isSameDay(N,W)?jn.filter(he=>{const fe=wo(ue,he);return fe&&w.isAfter(fe,N)}):(w.isAfter(W,N),jn)},[ce,U,ue]),Ge=y.useMemo(()=>jn,[]);return d.jsx(d.Fragment,{children:d.jsx(b.Modal,{open:e,onClose:n,children:d.jsx("form",{onSubmit:ye,children:d.jsxs(b.Box,{sx:iS,children:[d.jsx(b.IconButton,{"aria-label":"close",onClick:n,sx:{position:"absolute",right:8,top:12},children:d.jsx(sn,{})}),d.jsx(b.Typography,{variant:"h6",mb:2,children:s?.isGoogleEvent?d.jsxs(d.Fragment,{children:[d.jsx(sS,{sx:{mr:1}}),s.titulo||"Evento de Google"]}):s?"Editar evento":"Agregar evento"}),d.jsxs(b.Grid,{container:!0,spacing:1,marginBottom:l?0:1,children:[d.jsx(b.Grid,{size:{xs:12,md:12},children:d.jsx(Ht,{name:"titulo",control:R,render:({field:N})=>d.jsx(b.TextField,{...N,label:"Título",fullWidth:!0,variant:"outlined",size:"small",error:!!v.titulo,helperText:v.titulo?.message,inputProps:{maxLength:100},sx:{"& .MuiInputLabel-root.Mui-focused":{color:"black"},"& .MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"black"},"& .MuiInputLabel-root":{backgroundColor:"transparent !important",padding:"0 !important"}}})})}),d.jsx(b.Grid,{size:{xs:12,md:12},children:d.jsx(b.Divider,{})}),d.jsx(b.Grid,{size:{xs:12,md:4},children:d.jsx(Ht,{name:"fechaInicio",control:R,render:({field:N})=>d.jsx(b.TextField,{fullWidth:!0,...N,type:"date",placeholder:"Fecha de inicio",size:"small",InputLabelProps:{shrink:!0},error:!!v.fechaInicio,helperText:v.fechaInicio?.message})})}),l?d.jsxs(d.Fragment,{children:[d.jsx(b.Grid,{size:{xs:1,md:3},sx:{display:{xs:"none",sm:"block"}}}),d.jsx(b.Grid,{size:{xs:11,md:4},children:d.jsx(Ht,{name:"fechaFin",control:R,render:({field:N})=>d.jsx(b.TextField,{...N,type:"date",placeholder:"Fecha de fin",fullWidth:!!l,size:"small",InputLabelProps:{shrink:!0},inputProps:{min:H||g},error:!!v.fechaFin,helperText:v.fechaFin?.message})})}),!s&&d.jsx(b.Grid,{size:{xs:1,md:1},children:d.jsx(b.IconButton,{onClick:()=>u(!1),sx:{fontSize:18},children:d.jsx(zf,{})})})]}):d.jsx(b.Grid,{size:{xs:12,md:7}})]}),l&&d.jsx(d.Fragment,{children:d.jsxs(b.Grid,{container:!0,spacing:0,sx:{margin:0,padding:0,width:"100%"},children:[d.jsx(b.Grid,{size:{xs:6,md:5}}),d.jsx(b.Grid,{size:{xs:12,md:6},sx:{margin:0,padding:0,width:"100%",display:{xs:"none",sm:"block"}},children:d.jsx(Bf,{sx:{color:"#757575",margin:0,padding:0}})})]})}),d.jsxs(b.Grid,{container:!0,spacing:1,marginBottom:1,marginTop:1,children:[d.jsx(b.Grid,{size:{xs:12,md:4},children:d.jsx(Ht,{name:"horaInicio",control:R,render:({field:{onChange:N,value:W,...he}})=>d.jsx(b.Autocomplete,{freeSolo:!0,options:Ge,value:W||"",onChange:(fe,Ee)=>N(Ee||""),onInputChange:(fe,Ee)=>N(Ee),renderInput:fe=>d.jsx(b.TextField,{...fe,...he,size:"small",error:!!v.horaInicio,helperText:v.horaInicio?.message,InputProps:{...fe.InputProps,endAdornment:d.jsx(b.InputAdornment,{position:"end",sx:{position:"absolute",right:"10px"},children:d.jsx(vd,{})})}}),disabled:I("todoElDia")})})}),d.jsx(b.Grid,{size:{xs:1,md:1},sx:{display:"flex",alignItems:v.horaInicio?"start":"center",marginTop:v.horaInicio?"5px":"0px"},children:!l&&d.jsx(Bf,{sx:{color:"#757575"}})}),l&&d.jsx(b.Grid,{size:{xs:2,md:2}}),d.jsx(b.Grid,{size:{xs:12,md:4},children:d.jsx(Ht,{name:"horaFin",control:R,render:({field:{onChange:N,value:W,...he}})=>d.jsx(b.Autocomplete,{freeSolo:!0,options:xe,value:W||"",onChange:(fe,Ee)=>N(Ee||""),onInputChange:(fe,Ee)=>N(Ee),renderInput:fe=>d.jsx(b.TextField,{...fe,...he,size:"small",error:!!v.horaFin,helperText:v.horaFin?.message,InputProps:{...fe.InputProps,endAdornment:d.jsx(b.InputAdornment,{position:"end",sx:{position:"absolute",right:"10px"},children:d.jsx(vd,{})})}}),disabled:I("todoElDia")})})}),d.jsx(b.Grid,{size:{xs:12,md:3},hidden:l,children:d.jsx(Ht,{name:"todoElDia",control:R,render:({field:N})=>d.jsx(b.FormControlLabel,{control:d.jsx(b.Checkbox,{checked:N.value,onChange:W=>N.onChange(W.target.checked)}),label:d.jsx("label",{style:{fontSize:"0.7rem",fontWeight:"normal"},children:"Todo el día"}),sx:{whiteSpace:"nowrap"}})})}),!s?.isGoogleEvent&&d.jsx(b.Grid,{size:{xs:12,md:12},children:!l&&d.jsx(d.Fragment,{children:d.jsxs(b.Button,{onClick:V,size:"small",sx:{textTransform:"none",fontSize:16},children:[d.jsx(rS,{})," Agregar fecha final"]})})}),d.jsx(b.Grid,{size:{xs:12,md:12},children:d.jsx(b.Divider,{})}),!s?.isGoogleEvent&&d.jsxs(d.Fragment,{children:[d.jsx(b.Grid,{size:{xs:12,md:12},children:!f&&d.jsxs(b.Button,{onClick:()=>p(!0),size:"small",sx:{textTransform:"none",fontSize:16},children:[d.jsx(oS,{})," Vincular cliente"]})}),f&&d.jsxs(d.Fragment,{children:[d.jsx(b.Grid,{size:{xs:12,md:7},children:d.jsx(Ht,{name:"client",control:R,render:({field:N})=>d.jsx(b.Autocomplete,{options:x,loading:_,loadingText:"Buscando coincidencias...",getOptionLabel:W=>W.nombreCliente?.trim()||"",value:x.find(W=>W.nombreCliente===N.value)||(N.value&&typeof N.value=="string"?{solID:-1,nombreCliente:N.value}:null),noOptionsText:A,onInputChange:(W,he)=>{h(he)},onChange:(W,he)=>{N.onChange(he?he.nombreCliente:"")},renderInput:W=>d.jsx(b.TextField,{...W,placeholder:"Buscar cliente...",size:"small",InputProps:{...W.InputProps,startAdornment:d.jsx("img",{src:tS,width:20,style:{alignSelf:"flex-start",marginRight:"8px",marginTop:"5px"}}),endAdornment:d.jsxs(d.Fragment,{children:[_?d.jsx(b.CircularProgress,{color:"inherit",size:20}):null,W.InputProps.endAdornment]})}})})})}),d.jsx(b.Grid,{size:{xs:11,md:4},children:d.jsx(Ht,{name:"solID",control:R,render:({field:N})=>d.jsx(b.Autocomplete,{options:D,noOptionsText:"Sin resultados",getOptionLabel:W=>W.toString(),value:N.value??null,onChange:(W,he)=>N.onChange(he),renderInput:W=>d.jsx(b.TextField,{...W,label:"#Registro",variant:"outlined",size:"small",sx:{"& .MuiInputLabel-root":{backgroundColor:"transparent !important",padding:"0 !important"}}}),disabled:!x})})}),d.jsx(b.Grid,{size:{xs:1,md:1},children:d.jsx(b.IconButton,{onClick:()=>p(!1),sx:{fontSize:18},children:d.jsx(zf,{})})})]})]}),d.jsx(b.Grid,{size:{xs:12,md:12},children:d.jsx(b.Divider,{})}),d.jsx(b.Grid,{size:{xs:12,md:12},children:d.jsx(Ht,{name:"link",control:R,render:({field:N})=>d.jsx(b.TextField,{...N,placeholder:" Agregar enlace de reunión",fullWidth:!0,variant:"outlined",size:"small",error:!!v.link,helperText:v.link?.message,InputProps:{startAdornment:d.jsx("img",{src:J_,width:20,style:{alignSelf:"flex-start",marginRight:"8px",marginTop:"8px"}})}})})}),d.jsx(b.Grid,{size:{xs:12,md:12},children:d.jsx(Ht,{name:"descripcion",control:R,render:({field:N})=>d.jsx(b.TextField,{...N,placeholder:" Agregar descripción aquí...",fullWidth:!0,multiline:!0,rows:3,inputProps:{maxLength:500},variant:"outlined",size:"small",InputProps:{startAdornment:d.jsx("img",{src:nS,width:20,style:{alignSelf:"flex-start",marginRight:"8px"}})}})})}),d.jsx(b.Grid,{size:{xs:12,md:12},children:d.jsxs(b.Box,{sx:{display:"flex",alignItems:"center",gap:.5,flexWrap:"wrap"},children:[d.jsx(eS,{}),Va.map(N=>d.jsx(Ht,{name:"color",control:R,render:({field:W})=>d.jsx(b.IconButton,{onClick:()=>W.onChange(N),sx:{width:24,height:24,borderRadius:"50%",bgcolor:N,border:W.value===N?"2px solid":"none",borderColor:W.value===N?"primary.main":"transparent"}})},N))]})})]}),d.jsxs(b.Box,{sx:{display:s?.isGoogleEvent?"none":"flex",justifyContent:"flex-end",mt:3,gap:2},children:[s&&d.jsx(b.Button,{onClick:r,variant:"outlined",color:"error",sx:{textTransform:"none"},children:"Eliminar"}),d.jsx(b.Button,{onClick:n,variant:"outlined",sx:{textTransform:"none"},children:"Cancelar"}),d.jsx(b.Button,{onClick:ye,variant:"contained",sx:{textTransform:"none"},disabled:!j,children:"Guardar"})]})]})})})})},cS="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='48'%20height='49'%20fill='none'%3e%3cpath%20fill='%23E40B1C'%20d='M34.559%2048.077c-7.413%200-13.44-6.039-13.44-13.44s6.027-13.44%2013.44-13.44%2013.44%206.027%2013.44%2013.44c0%207.414-6.027%2013.44-13.44%2013.44'/%3e%3cpath%20fill='%23fff'%20d='M39.827%2029.346c.583.583.605%201.505.05%202.06l-3.218%203.219%203.219%203.218c.555.556.532%201.48-.051%202.062-.584.583-1.506.605-2.062.05l-3.218-3.218-3.218%203.218c-.556.555-1.478.533-2.061-.05s-.606-1.506-.05-2.062l3.217-3.218-3.218-3.218c-.555-.555-.533-1.478.05-2.061.583-.584%201.507-.606%202.063-.05l3.217%203.217%203.218-3.218c.556-.555%201.478-.533%202.062.05'/%3e%3cpath%20fill='%23404756'%20d='M30.367.078c1.112%200%202.001.868%202.001%201.954v1.195h.979c4.913%200%208.892%203.887%208.892%208.686v9.237a15.4%2015.4%200%200%200-4.424-1.691v-1.312H4.468V33.63c0%202.389%202%204.343%204.446%204.343H19.4a15.4%2015.4%200%200%200%201.676%204.343H8.892C3.979%2042.317%200%2038.43%200%2033.631V11.913c0-4.8%203.979-8.686%208.892-8.686h1V2.032c0-1.086.89-1.954%202.002-1.954s2%20.868%202%201.954v1.195h14.473V2.032c0-1.085.889-1.954%202-1.954'/%3e%3c/svg%3e",lS={position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:400,bgcolor:"background.paper",boxShadow:24,p:4,borderRadius:2,textAlign:"center"},uS=({isOpen:e,onClose:n,onConfirm:t,title:r,message:o})=>d.jsx(b.Modal,{open:e,onClose:n,children:d.jsxs(b.Box,{sx:lS,children:[d.jsx("img",{src:cS}),d.jsx(b.Typography,{variant:"h6",component:"h2",sx:{mt:1},children:r}),d.jsx(b.Typography,{sx:{mt:2},children:o}),d.jsxs(b.Box,{sx:{mt:4,display:"flex",justifyContent:"center",gap:2},children:[d.jsx(b.Button,{variant:"outlined",onClick:n,sx:{textTransform:"none"},children:"Regresar"}),d.jsxs(b.Button,{variant:"contained",color:"error",onClick:t,sx:{textTransform:"none"},children:[d.jsx("span",{className:"icon-eliminar",children:" "})," Eliminar"]})]})]})}),dS={position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:450,bgcolor:"background.paper",boxShadow:24,p:2,borderRadius:2},fS=({isOpen:e,onClose:n,events:t,date:r,onEventClick:o})=>{if(!r)return null;const s=i=>{o(i),n()};return d.jsx(b.Modal,{open:e,onClose:n,children:d.jsxs(b.Box,{sx:dS,children:[d.jsxs(b.Box,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:1},children:[d.jsxs(b.Typography,{sx:{fontSize:"20px"},component:"h2",children:["Eventos del"," ",r.toLocaleDateString("es-ES",{weekday:"long",day:"numeric",month:"long"})]}),d.jsx(b.IconButton,{onClick:n,children:d.jsx(sn,{})})]}),d.jsx(b.Divider,{}),d.jsx(b.List,{children:t.map(i=>d.jsx(b.ListItem,{disablePadding:!0,children:d.jsxs(b.ListItemButton,{onClick:()=>s(i),sx:{py:.5},children:[d.jsx(b.Box,{sx:{width:"15px",height:"15px",borderRadius:"50%",backgroundColor:i.color||"#ccc",mr:2,flexShrink:0,minWidth:"10px"}}),d.jsx(b.ListItemText,{primary:i.titulo,secondary:`${w.format(i.fechaInicio,"HH:mm")} - ${w.format(i.fechaFin,"HH:mm")}`,sx:{my:0,"& .MuiListItemText-primary":{display:"-webkit-box",WebkitLineClamp:3,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis"},"& .MuiListItemText-secondary":{display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis",fontSize:"12px"}}})]})},i.eventoID))})]})})},pS=it(d.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"}),"Error"),hS=it(d.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z"}),"Info"),mS="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20fill='none'%3e%3cpath%20fill='%23E40B1C'%20d='M20.36%204.14H16c0-1.65-1.35-3-3-3h-2c-1.65%200-3%201.35-3%203H3.64c-.55%200-1%20.45-1%201s.45%201%201%201h1.04l.84%2013.91a3%203%200%200%200%202.99%202.82h6.98c1.58%200%202.9-1.24%203-2.82l.84-13.91h1.04c.55%200%201-.45%201-1s-.45-1-1-1zm-9.36-1h2c.55%200%201%20.45%201%201h-4c0-.55.45-1%201-1m-.39%2014.9c0%20.55-.45%201-1%201s-1-.45-1-1V9.99c0-.55.45-1%201-1s1%20.45%201%201zm4.78%200c0%20.55-.45%201-1%201s-1-.45-1-1V9.99c0-.55.45-1%201-1s1%20.45%201%201z'/%3e%3c/svg%3e",gS="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20fill='none'%3e%3cpath%20fill='%23fff'%20d='M19.378%204.405a1.813%201.813%200%201%201%202.565%202.565L9.571%2019.342a1.813%201.813%200%200%201-2.565%200l-4.949-4.949a1.814%201.814%200%200%201%202.428-2.69l.137.126%203.666%203.666z'/%3e%3c/svg%3e",Ff=y.forwardRef(({id:e,message:n,variant:t},r)=>{const{closeSnackbar:o}=Do.useSnackbar(),s={success:{color:"#fff",icon:d.jsx("img",{width:25,src:gS,style:{borderRadius:"50%",backgroundColor:"#4caf50",color:"white",fontSize:"12px",padding:3}})},error:{color:"#f44336",icon:d.jsx(pS,{sx:{color:"#f44336"}})},info:{color:"#2196f3",icon:d.jsx(hS,{sx:{color:"#2196f3"}})},delete:{color:"#fff",icon:d.jsx("img",{src:mS,width:25,style:{borderRadius:"50%",backgroundColor:"#ffdfd4",color:"red",fontSize:"16px",padding:3}})}},i=s[t]||s.info;return d.jsx(Do.SnackbarContent,{ref:r,children:d.jsxs(b.Box,{sx:{backgroundColor:"white",color:"#333",padding:"8px 16px",borderRadius:"8px",boxShadow:"0 3px 10px rgba(0,0,0,0.2)",display:"flex",alignItems:"center",width:{xs:"90%",sm:"auto"},minWidth:"300px",borderLeft:`5px solid ${i.color}`},children:[d.jsx(b.Box,{sx:{mr:1.5},children:i.icon}),d.jsx(b.Typography,{variant:"body2",sx:{flexGrow:1},children:n}),d.jsx(b.IconButton,{size:"small",onClick:()=>o(e),children:d.jsx(sn,{fontSize:"small"})})]})})}),Vf=y.createContext(void 0),vS=({children:e})=>{const[n,t]=y.useState([]),[r,o]=y.useState(!1);return d.jsx(Vf.Provider,{value:{googleEvents:n,setGoogleEvents:t,isLoadingGoogleEvents:r,setIsLoadingGoogleEvents:o},children:e})},yS=()=>{const e=y.useContext(Vf);if(e===void 0)throw new Error("useEvents must be used within an EventsProvider");return e},bS=(e,n,t,r)=>{const o=e.start.dateTime?new Date(e.start.dateTime):e.start.date?new Date(e.start.date):new Date;let s=e.end.dateTime?new Date(e.end.dateTime):e.end.date?new Date(e.end.date):new Date;return e.end.date&&!e.end.dateTime&&s.setDate(s.getDate()-1),{eventoID:Math.abs(xS(e.id)),titulo:e.summary||"(Sin título)",descripcion:e.description,fechaInicio:o,fechaFin:s,todoElDia:!!(e.start.date&&!e.start.dateTime),color:"#4285F4",hasVideoCall:!!e.conferenceData,link:e.htmlLink,repetir:void 0,solID:null,disID:n,client:null,usrID:t,solicitudRelacionada:[],isGoogleEvent:!0}};function xS(e){let n=0;for(let t=0;t<e.length;t++){const r=e.charCodeAt(t);n=(n<<5)-n+r,n|=0}return n}const wS=({userId:e,leads30Days:n,leads90Days:t,disId:r,masNombreBD:o})=>{const[s,i]=y.useState(new Date),[a,c]=y.useState([]),[l,u]=y.useState(!1),[f,p]=y.useState(null),[g,m]=y.useState(!1),[h,x]=y.useState(null),[C,_]=y.useState([]),{enqueueSnackbar:T}=Do.useSnackbar(),S=va(),D=Ls(),[P,A]=y.useState(!1),[G,R]=y.useState([]),[B,Q]=y.useState(null),{session:v}=na(),{googleEvents:j,setGoogleEvents:I}=yS(),[F,H]=y.useState([]),ee=(W,he)=>{R(W),Q(he),A(!0)},ne=y.useRef(null);y.useEffect(()=>{const W=async()=>{try{if(e){const he=await S.getEventsByUser(e);c(he)}}catch{console.log("No se pudieron cargar los eventos. Revisa la consola para más detalles.")}};return W(),ne.current&&clearTimeout(ne.current),ne.current=setTimeout(()=>{W()},4e3),()=>{ne.current&&clearTimeout(ne.current)}},[s,e,j]),y.useEffect(()=>{const W=new Date,he=w.startOfDay(W),fe=w.endOfDay(w.addDays(he,6)),Ee={start:he,end:fe},_t=a.filter(nt=>{const ct={start:nt.fechaInicio,end:nt.fechaFin};return yu(ct,Ee)}).sort((nt,ct)=>nt.fechaInicio.getTime()-ct.fechaInicio.getTime());_(_t)},[a]);const ye=async W=>{try{if(console.log("validacion id",W),W?.isGoogleEvent)p(W),u(!0);else{const he=await S.getEventById(W.eventoID);p(he),u(!0)}}catch(he){console.error(he)}},V=()=>{u(!1),p(null)},U=async(W,he)=>{let fe,Ee;W.todoElDia?(fe=new Date(`${W.fechaInicio}T${W.horaInicio}`),Ee=new Date(`${W.fechaInicio}T${W.horaFin}`)):(fe=new Date(`${W.fechaInicio}T${W.horaInicio}`),Ee=W.fechaFin&&W.horaFin?new Date(`${W.fechaFin}T${W.horaFin}`):new Date(`${W.fechaInicio}T${W.horaFin}`));const _t=w.format(fe,"yyyy-MM-dd HH:mm:ss.SSS"),nt=w.format(Ee,"yyyy-MM-dd HH:mm:ss.SSS");if(he){const E={...W,eventoID:he,fechaInicio:_t,fechaFin:nt,solID:W.solID??null,disID:r??null,client:W.client};try{const M=await S.updateEvent(E);var ct=a.map(z=>z.eventoID===M.eventoID?M:z);c(ct),T("El evento se ha actualizado correctamente.",{variant:"success"}),V()}catch{T("Error al actualizar Evento",{variant:"error"})}}else{const E={...W,fechaInicio:_t,fechaFin:nt,todoElDia:W.todoElDia,solID:W.solID??null,disID:r??null,client:W.client};try{const M=await S.createEvent(E,e);c(z=>[...z,M]),T("El evento se ha creado con éxito",{variant:"success"}),V()}catch{T("Error al guardar Evento",{variant:"error"})}}if(e){const E=await S.getEventsByUser(e);c(E)}},ce=()=>{i(W=>new Date(W.getFullYear(),W.getMonth()-1,1))},ue=()=>{i(W=>new Date(W.getFullYear(),W.getMonth()+1,1))},ge=()=>{m(!0)},ve=()=>{x(new Date),u(!0)},pe=()=>alert("Sincronizar con Outlook Calendar"),de=W=>{W&&i(W)},_e=W=>{x(W),u(!0),p(null)},De=async()=>{if(f)try{await S.deleteEvent(f.eventoID),c(a.filter(W=>W.eventoID!==f.eventoID)),T("El evento se ha eliminado de tu calendario",{content:(W,he)=>d.jsx(Ff,{id:W,message:String(he),variant:"delete"})})}catch{T("Error al eliminar Evento",{variant:"error"})}finally{V(),m(!1)}};y.useEffect(()=>{const W=[...a];if(j.length>0&&v.userEmail&&(v.userEmail,r&&e)){const he=j.map(fe=>bS(fe,r,e));W.push(...he)}H(W)},[a,j]);const[xe,Ge]=y.useState([]),N=async W=>{if(v?.userEmail===null){console.warn("Faltan datos o calendarios para cargar eventos de Google."),I([]);return}const he=xe.filter(fe=>fe.selected).map(fe=>fe.id);console.log("googleCalendars",xe);try{const fe={disID:r,year:s.getFullYear(),month:s.getMonth()+1,usrMail:v?.userEmail,calendarIds:he};if(r){const Ee=await D.getGoogleEventsByMonth(fe);console.log("eventstosGmail",Ee),I(Ee)}}catch(fe){console.error("Error al obtener eventos de Google Calendar:",fe),I([])}};return r===void 0||e===void 0?d.jsx("div",{children:"Cargando configuración de usuario..."}):d.jsxs("div",{id:"Agenda",style:{height:"100%",width:"100%"},children:[d.jsx(D0,{header:d.jsx(Hv,{currentDate:s,onPrevMonth:ce,onNextMonth:ue,onAddEvent:ve,onDateChange:de}),sidebar:d.jsx(o1,{onEventClick:ye,upcomingEvents:C,onSyncOutlook:pe,leads30Days:n,leads90Days:t,disID:r,usrID:e,onGoogleEvents:N}),mainContent:d.jsx(p1,{onSeeMoreClick:ee,currentDate:s,events:F,onDayClick:_e,onEventClick:ye})}),l&&d.jsx(aS,{isVisible:l,onClose:V,onSave:U,onDelete:ge,selectedDate:h,initialEvent:f,userId:e,masNombreBD:o,disId:r}),d.jsx(uS,{isOpen:g,onClose:()=>m(!1),onConfirm:De,title:"Eliminar evento",message:"¿De verdad deseas eliminar este evento? Esta acción no se puede deshacer."}),d.jsx(fS,{isOpen:P,onClose:()=>A(!1),events:G,date:B,onEventClick:ye})]})},_S="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='22'%20height='22'%3e%3cpath%20fill='%23070c10'%20d='M18.575%203.172A10.829%2010.829%200%200%200%201.564%2016.284l-.028-.051L0%2021.843l5.739-1.506a10.7%2010.7%200%200%200%205.173%201.318%2010.83%2010.83%200%200%200%207.663-18.483m-7.658%2016.655a8.94%208.94%200%200%201-4.62-1.277l.041.023-.329-.194-3.405.894.908-3.321-.214-.34a8.9%208.9%200%200%201-1.376-4.782%209%209%200%201%201%209%209Zm4.935-6.736c-.27-.135-1.6-.789-1.848-.88s-.429-.135-.61.136-.7.879-.856%201.06-.316.2-.586.068a7.5%207.5%200%200%201-2.183-1.349l.007.007a8.2%208.2%200%200%201-1.483-1.842l-.02-.038c-.157-.27-.017-.417.118-.551s.271-.316.406-.473a1.9%201.9%200%200%200%20.267-.44v-.012a.5.5%200%200%200%20.05-.216.5.5%200%200%200-.074-.26c-.068-.135-.609-1.467-.834-2.009s-.444-.455-.609-.464-.338-.009-.519-.009a.99.99%200%200%200-.72.337%203.03%203.03%200%200%200-.947%202.2v.058a5.27%205.27%200%200%200%201.114%202.815v-.011a12.16%2012.16%200%200%200%204.553%204.053l.068.031a14%2014%200%200%200%201.434.539l.109.03a3.6%203.6%200%200%200%201.077.161%203.7%203.7%200%200%200%20.648-.057h-.023a2.8%202.8%200%200%200%201.819-1.274l.007-.012a2.2%202.2%200%200%200%20.19-.9%202.3%202.3%200%200%200-.034-.395v.014c-.067-.113-.248-.18-.519-.316Z'/%3e%3c/svg%3e",SS="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='25.085'%20height='18.5'%3e%3cdefs%3e%3cclipPath%20id='a'%3e%3cpath%20fill='none'%20d='M0%200h25.085v18.5H0z'%20data-name='Rectángulo%204598'/%3e%3c/clipPath%3e%3c/defs%3e%3cg%20clip-path='url(%23a)'%20data-name='Grupo%207946'%3e%3cpath%20d='M23.12%205.809V3.226a3.2%203.2%200%200%200-.068-.656l-3.141%202.21a7.8%207.8%200%200%201%203.209%201.032'%20data-name='Trazado%2013329'/%3e%3cpath%20d='M11.847%209.791c-.1.009-.2.023-.308.023a3.78%203.78%200%200%201-2.18-.688L.067%202.58A3.2%203.2%200%200%200%200%203.227V13.98a3.23%203.23%200%200%200%203.226%203.226h9.611a7.86%207.86%200%200%201-.99-7.414'%20data-name='Trazado%2013330'/%3e%3cpath%20d='M12.478%207.369%2021.92.737A3.2%203.2%200%200%200%2019.894%200H3.226a3.2%203.2%200%200%200-2.031.74l9.4%206.628a1.64%201.64%200%200%200%201.881%200'%20data-name='Trazado%2013331'/%3e%3cpath%20d='M23.356%208.407a5.914%205.914%200%201%200%200%208.364%205.92%205.92%200%200%200%200-8.364m-1.833%204.842a.54.54%200%200%201-1.081%200v-1.164l-2.513%202.516a.54.54%200%200%201-.765-.763l2.515-2.515h-1.167a.54.54%200%201%201%200-1.081h2.471a.54.54%200%200%201%20.54.54Z'%20data-name='Trazado%2013332'/%3e%3c/g%3e%3c/svg%3e";function Ya(e,n,t){return e.accessor?e.accessor(n,t):e.field?n?.[e.field]:n?.[e?.key||""]}function CS(e,n){const t=e??"",r=n??"";return t instanceof Date&&r instanceof Date?t.getTime()-r.getTime():typeof t=="number"&&typeof r=="number"?t-r:typeof t=="boolean"&&typeof r=="boolean"?Number(t)-Number(r):String(t).localeCompare(String(r),void 0,{numeric:!0,sensitivity:"base"})}function Wa(e,n,t=!0){return typeof e=="function"?e(n):e??t}function kS(e){return e.replace(/[^\d]/g,"")}function DS(e,n){return n}const ES=it(d.jsx("path",{d:"M4.25 5.61C6.27 8.2 10 13 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-6s3.72-4.8 5.74-7.39c.51-.66.04-1.61-.79-1.61H5.04c-.83 0-1.3.95-.79 1.61"}),"FilterAlt"),TS=it(d.jsx("path",{d:"M15.5 14h-.79l-.28-.27c1.2-1.4 1.82-3.31 1.48-5.34-.47-2.78-2.79-5-5.59-5.34-4.23-.52-7.79 3.04-7.27 7.27.34 2.8 2.56 5.12 5.34 5.59 2.03.34 3.94-.28 5.34-1.48l.27.28v.79l4.25 4.25c.41.41 1.08.41 1.49 0s.41-1.08 0-1.49zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"}),"SearchRounded"),AS=it(d.jsx("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"}),"KeyboardArrowDown"),MS=it(d.jsx("path",{d:"M7.41 15.41 12 10.83l4.59 4.58L18 14l-6-6-6 6z"}),"KeyboardArrowUp");function Yf(e){return e==="right"?"end":e==="center"?"center":"start"}function Wf(e){const n=e.filter(t=>!t.width).length||1;return e.map(t=>typeof t.width=="number"?`${t.width}px`:typeof t.width=="string"?t.width:`minmax(0, ${1/n}fr)`).join(" ")}const IS=1060,Ua=(e,n)=>e.metrics.find(t=>String(t.label).toLowerCase()===n.toLowerCase())?.value??"";function OS({sections:e,detailColumns:n,summaryWidths:t=["1fr",120,120,150],minWidth:r=IS,getDetailColumns:o,onRowClick:s}){function c(u){if(typeof u=="number")return u;if(!u)return 0;const f=/^(\d+)\s*px$/.exec(u.trim());return f?Number(f[1]):/fr$/i.test(u)?160:0}function l(u){const f=u.reduce((m,h)=>m+c(h.width),0),p=Math.max(u.length-1,0)*16;return f+p+32}return d.jsx(b.Box,{sx:{border:"1px solid rgba(0,0,0,0.15)",overflow:"hidden",bgcolor:"background.paper",width:"100%"},children:d.jsxs(b.Box,{children:[d.jsx(b.Box,{sx:{display:"grid",gridTemplateColumns:t.map(u=>typeof u=="number"?`${u}px`:u).join(" "),columnGap:"16px",alignItems:"center",px:"16px",py:1,bgcolor:"#1E5BCE",color:"#fff",boxSizing:"border-box"},children:["Tipo","En Proceso","Finalizadas","Último seg."].map(u=>d.jsx(b.Typography,{sx:{fontSize:13,fontWeight:800},children:u},u))}),e.map((u,f)=>{const[p,g]=se.useState(!!u.initiallyOpen),m=f%2===1,h=o?o(u):n,x=Math.max(r,l(h));return d.jsxs(b.Box,{children:[d.jsxs(b.Box,{sx:{display:"grid",gridTemplateColumns:t.map(C=>typeof C=="number"?`${C}px`:C).join(" "),columnGap:"16px",alignItems:"center",px:"16px",py:1,bgcolor:m?"rgba(30,91,206,0.06)":"background.paper",borderTop:"1px solid rgba(0,0,0,0.08)","&:hover":{bgcolor:"rgba(30,91,206,0.12)"},boxSizing:"border-box",cursor:"pointer"},onClick:()=>g(C=>!C),children:[d.jsxs(b.Box,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:[d.jsx(b.IconButton,{size:"small",disableRipple:!0,children:p?d.jsx(MS,{}):d.jsx(AS,{})}),d.jsx(b.Typography,{sx:{fontWeight:700,fontSize:14,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:String(u.title),children:u.title})]}),d.jsx(b.Typography,{sx:{fontSize:13.5,fontWeight:800},children:Ua(u,"En Proceso")}),d.jsx(b.Typography,{sx:{fontSize:13.5,fontWeight:800},children:Ua(u,"Finalizadas")}),d.jsx(b.Typography,{sx:{fontSize:13.5,fontWeight:800},children:Ua(u,"Último seg.")})]}),d.jsx(b.Collapse,{in:p,unmountOnExit:!0,children:d.jsxs(b.Box,{sx:{overflowX:"auto","&::-webkit-scrollbar":{height:"5px"}},children:[d.jsx(b.Box,{sx:{minWidth:x,display:"grid",gridTemplateColumns:Wf(h),columnGap:"16px",alignItems:"center",px:"16px",py:1,bgcolor:"rgba(30,91,206,0.18)",color:"#1a1a1a",borderTop:"1px solid rgba(0,0,0,0.12)",boxSizing:"border-box"},children:h.map(C=>d.jsx(b.Typography,{sx:{justifySelf:Yf(C.align),textAlign:C.align??"left",fontSize:12.5,fontWeight:800,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:C.header},C.key))}),(u.rows??[]).map((C,_)=>d.jsx(b.Box,{sx:{minWidth:x,display:"grid",gridTemplateColumns:Wf(h),columnGap:"16px",alignItems:"center",px:"16px",py:1,bgcolor:_%2===0?"background.paper":"rgba(30,91,206,0.06)",borderTop:"1px solid rgba(0,0,0,0.06)","&:hover":{bgcolor:"rgba(30,91,206,0.12)"},boxSizing:"border-box",cursor:"pointer"},onClick:()=>s?.(C,u),children:h.map((T,S)=>{const D=T.accessor?T.accessor(C,_):T.field?C[T.field]:null;return d.jsx(b.Box,{sx:{justifySelf:Yf(T.align),textAlign:T.align??"left",minWidth:0},children:typeof D=="string"||typeof D=="number"?d.jsx(b.Typography,{sx:{fontSize:13,fontWeight:/^(estatus|seg|avance|nivel|asesor|fecha)$/i.test(T.key)?700:500,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:String(D),children:D}):D},T.key??S)})},C.id??_))]})})]},u.id)})]})})}const PS=it(d.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2m3.3 14.71L11 12.41V7h2v4.59l3.71 3.71z"}),"AccessTimeFilled"),jS=e=>e?new Date(e).toLocaleDateString("es-MX",{day:"2-digit",month:"short",year:"numeric"}).replace(".",""):"",NS=e=>{const n=`${e?.Nombre??""} ${e?.Apellido??""}`.trim();return n||(e?.IdAsesor?e?.Correo??"Usuario":"Sin asesor asignado")},RS=e=>{const n=(e||"").split(" ").filter(Boolean);return n.length>=2?(n[0][0]+n[1][0]).toUpperCase():(e?.[0]??"?").toUpperCase()},$S=it(d.jsx("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"}),"Create"),Ha=({current:e,total:n,color:t="#4caf50"})=>d.jsx("div",{style:{display:"flex",gap:"1px",width:"100%",height:"100%",justifyContent:"center"},children:Array.from({length:n}).map((r,o)=>d.jsx("div",{style:{width:"7px",height:"7px",borderRadius:"2px",backgroundColor:o<e?t:"#e0e0e0",display:"flex"}},o))}),Uf=it(d.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add"),LS=it(d.jsx("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"}),"ArrowBack"),zS=e=>{const n=String(e??"").toLowerCase().trim();return n==="muy interesado"?{bg:"#E53935",color:"#FFFFFF"}:n==="interesado"?{bg:"#FB8C00",color:"#FFFFFF"}:n==="venta definitiva"?{bg:"#2E7D32",color:"#FFFFFF"}:n==="no sé"||n==="no se"?{bg:"#9E9E9E",color:"#FFFFFF"}:n==="algo interesado"?{bg:"#FFEB3B",color:"#000000"}:{bg:"#F59E0B",color:"#FFFFFF"}},BS=e=>{switch(parseInt(String(e??""),10)){case 1:return"Por Asignar";case 2:return"Solicitud Asignada";case 3:return"Solicitud asignada en proceso";case 4:return"Finalizadas sin Venta";case 5:return"Finalizadas con Venta";case 6:return"Rechazadas";case 7:return"Finalizada por sistema";case 8:return"";case 9:return"";case 10:return"Prospección";case 11:return"Interés Real";case 12:return"Proceso de Compra";case 13:return"";case 14:return"En espera de Unidad";case 15:return"Auto Facturado";case 16:return"";case 17:return"";case 18:return"Compró otra Marca";case 19:return"No comprará";default:return null}},FS=e=>{switch(parseInt(String(e??""),10)){case 1:return"Por asignar";case 2:return"Solicitud Asignada";case 3:return"En seguimiento";case 6:return"Rechazada";case 7:return"Finalizada sin enviar a Ventas";case 8:return"Finalizada enviado a Ventas";default:return null}},VS=e=>{switch(parseInt(String(e??""),10)){case 0:return"Sin asignar";case 1:return"Confirmado";case 2:return"Solicitud Asignada";case 3:return"En seguimiento";case 4:return"Confirmado";case 5:return"Finalizada";case 6:return"Rechazada";case 10:return"Reagendado";case 20:return"Seguimiento [Cita Finalizada]";case 30:return"Reenvio";case 40:return"Seguimiento [Mecanico]";case 50:return"Seguimiento";default:return null}};function YS(e){const n=new Date(e),t=n.toLocaleDateString("es-MX",{day:"2-digit",month:"short",year:"numeric"}),r=n.toLocaleTimeString("es-MX",{hour:"2-digit",minute:"2-digit"});return`${t.replace(".","")} • ${r}`}function WS(e){return e.replace(/<br\s*\/?>/gi,`
|
|
180
180
|
`).replace(/\r\n/g,`
|
|
181
181
|
`).replace(/\r/g,`
|
|
182
|
-
`)}const US={Todos:[],"Sin Asignar":["Sin Asignar"],"En prospección":["Prospección"],"Proceso de Compra":["Proceso de Compra"],"En espera de Unidad":["En Espera de Unidad"],"Auto Facturado":["Auto Facturado"],Rechazadas:["Rechazada","Rechazadas"],"Finalizadas sin Venta":["Sin Venta"],"Finalizadas con Venta":["Con Venta"],"En Proceso":["Asignada"]},HS={Todos:[],"Selección y presentación de vehículos":["Selección y presentación de vehículos"],"Prueba de Manejo":["Prueba de Manejo"],"Valoración del Auto a cuenta y/o enganche":["Valoración del Auto a cuenta y/o enganche"],"Entrega de vehículo":["Entrega de vehículo"]},ZS={Todos:[],"Algo interesado":["Algo interesado"],Interesado:["Interesado"],"Muy interesado":["Muy interesado"],"Venta definitiva":["Venta definitiva"],"No sé":["No sé"]};function GS(e,n){switch(e){case"pruebas":return FS(n)??"—";case"servicio":return VS(n)??"—";case"nuevos":case"seminuevos":default:return BS(n)??"—"}}function qS({open:e,onClose:n,customer:t,fields:r=[],header:o,extraSections:s,normalTable:i,normalTableColumns:a=[],history:c=[],advisorHistory:l=[],onRequestEdit:u,searchFilter:f,solicitudesNuevos:p=[],solicitudesPrueba:g=[],solicitudesServicio:m=[],solicitudesSeminuevos:h=[],onCreateSolicitud:x,isCrmMode:C=!1,onSolicitudBaseUrl:_}){if(console.log("estatus solicitudesSeminuevos",h),!t)return null;const T=3,[S,D]=y.useState(null),P=!!S,A=y.useMemo(()=>[...l].sort((Z,te)=>new Date(te.FechaAsignacion).getTime()-new Date(Z.FechaAsignacion).getTime()),[l]),G=o?.title??(Z=>Z?.Nombre||Z?.name||"Sin título"),R=o?.infoItems??[],B=Z=>{if(!Z)return{bg:"#E0E0E0",color:"#333"};const te=Z.toLowerCase();return te.includes("actualiz")?{bg:"#E8F1FF",color:"#1E60D1"}:te.includes("recorda")?{bg:"#F5E7FF",color:"#7A3DB8"}:{bg:"#EEE",color:"#333"}},Q=Z=>Z.NombreAsesor?.trim()||(Z.Email?Z.Email:"Sistema"),v=Z=>{const te=Z||"",Se=te.split(" ").filter(Boolean);return Se.length>=2?(Se[0][0]+Se[1][0]).toUpperCase():(te[0]||"?").toUpperCase()},j=[...c].sort((Z,te)=>new Date(te.FecAlta).getTime()-new Date(Z.FecAlta).getTime()),[I,F]=y.useState(!1),H=y.useMemo(()=>I?j:j.slice(0,T),[I,j]),ee=Math.max(j.length-T,0),ne=Z=>String(Z??"").normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase().trim(),ye=(Z,te)=>ne(JSON.stringify(Z)).includes(ne(te)),V=(Z,te)=>f?f(Z,te):ye(Z,te),U=(Z,te)=>{const Se=ne(te).split(/\s+/).filter(Boolean);return Se.length?Se.every(Ie=>V(Z,Ie)):!0},[ce,ue]=y.useState(""),[ge,ve]=y.useState([]);y.useMemo(()=>i??[],[i]),y.useMemo(()=>{const Z=ce.trim();return Z?(i??[]).filter(te=>U(te,Z)):i??[]},[i,ce]);const pe=b.useTheme(),de=b.useMediaQuery(pe.breakpoints.down("md")),[_e,De]=y.useState(""),[xe,Ge]=y.useState(!0),[N,W]=y.useState(!1),he=new Date().toISOString().slice(0,10),fe=new Date(Date.now()-720*3600*1e3).toISOString().slice(0,10),[Ee,_t]=y.useState(fe),[nt,ct]=y.useState(he),[E,M]=y.useState(null),z=!!E,[oe,re]=y.useState("Todos");console.log("estatus",oe);const[O,X]=y.useState("Todos"),[me,Ae]=y.useState("Todos"),$=["Algo interesado","Interesado","Muy interesado","Venta definitiva","No sé"],J=["Selección y presentación de vehículos","Prueba de Manejo","Valoración del Auto a cuenta y/o enganche","Entrega de vehículo"],be=()=>{De(""),Ge(!1),W(!1),_t(fe),ct(he),re("Todos"),X("Todos"),Ae("Todos")},qe=y.useMemo(()=>(_e??"").trim()!==""||oe!=="Todos"||O!=="Todos"||xe||N||me!=="Todos",[_e,oe,O,xe,N,me]);function St(Z){if(!Z)return"";const te=new Date(Z);if(isNaN(te.getTime()))return"";const Se=String(te.getDate()).padStart(2,"0"),Ie=String(te.getMonth()+1).padStart(2,"0"),yt=String(te.getFullYear()).slice(-2);return`${Se}/${Ie}/${yt}`}function Ct(Z){const te=Z?new Date(Z):null;return te&&!isNaN(te.getTime())?te:null}function Ar(Z,te){let Se=null;for(const Ie of Z){const yt=Ct(te(Ie));if(yt){const k=yt.getTime();(Se===null||k>Se)&&(Se=k)}}return Se?new Date(Se):null}function lr(Z){const te=Ar(Z,Se=>Se.UltimoSeguimiento||Se.FechaCita);return te?St(te.toISOString()):"—"}function Mr(Z){return Z.filter(te=>/finalizad/i.test(te.EstatusDescripcion??"")).length}function Ir(Z){return Z.length-Mr(Z)}const ii=({progress:Z,color:te})=>{if(!Z)return d.jsx(Ha,{current:0,total:0,color:te});const Se=Z.split("/").map(Number);if(Se.length!==2||Se.some(k=>Number.isNaN(k)))return d.jsx(Ha,{current:0,total:0,color:te});const[Ie,yt]=Se;return d.jsx(Ha,{current:Ie,total:yt,color:te})};function Or(Z){return[{key:"fecha",header:"Fecha",accessor:te=>St(te.Fecha),width:110},{key:"vehiculo",header:"Vehículo",accessor:te=>d.jsx(b.Tooltip,{title:te.Vehiculo??"",placement:"top",arrow:!0,children:d.jsx(b.Typography,{component:"span",sx:{fontSize:13,fontWeight:500,display:"block",maxWidth:260,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",lineHeight:1.3,cursor:"default"},children:te.Vehiculo??"—"})}),width:260},{key:"estatus",header:"Estatus",accessor:te=>d.jsx(b.Typography,{sx:{fontWeight:800,fontSize:13},children:GS(Z,te.IdEstatus)}),width:170},{key:"nivel",header:"Nivel de Interés",accessor:te=>{const{bg:Se,color:Ie}=zS(te.NivelInteres);return d.jsx(b.Box,{sx:{display:"inline-block",px:1,py:.25,borderRadius:9999,bgcolor:Se,color:Ie,fontSize:12,fontWeight:800},children:te.NivelInteres??"—"})},width:150},{key:"asesor",header:"Asesor",accessor:te=>d.jsx(b.Tooltip,{title:te.Asesor??"",placement:"top",children:d.jsx(b.Typography,{sx:{fontWeight:700,fontSize:13,textAlign:"center"},children:(te.Asesor??"").split(" ").filter(Boolean).map(Se=>Se[0]?.toUpperCase()).slice(0,2).join("")||"—"})}),width:120,align:"center"},{key:"origen",header:"Origen",accessor:te=>te.Origen??"—",width:90,align:"center"},{key:"actividad",header:"Actividad",accessor:te=>d.jsx(b.Tooltip,{title:te.Actividad??"",placement:"top",arrow:!0,children:d.jsx(b.Box,{sx:{maxWidth:"100%",overflow:"hidden"},children:d.jsx(b.Typography,{component:"span",noWrap:!0,sx:{fontSize:13,fontWeight:500,display:"block",overflow:"hidden",textOverflow:"ellipsis",lineHeight:1.3,cursor:(te.Actividad??"").length?"default":"inherit"},children:te.Actividad??"—"})})}),width:250},{key:"avance",header:"Avance",accessor:te=>d.jsx(ii,{progress:te.Avance,color:te.Color}),width:200,align:"left"}]}function _o(Z){const Se=Or(Z).slice(1);return[{key:"fecha",header:"Fecha",accessor:Ie=>St(Ie.Fecha),width:110},{key:"fechaCita",header:"Fecha Cita",accessor:Ie=>St(Ie.FechaCita),width:120},{key:"horaCita",header:"Hora Cita",accessor:Ie=>Ie.HoraCita??"—",width:110},...Se]}function So(Z){const te=Z.kind;switch(te){case"pruebas":case"servicio":return _o(te);case"nuevos":case"seminuevos":default:return Or(te)}}function an(Z,te,Se,Ie){return{id:Z,kind:Se,title:te,metrics:[{label:"En Proceso",value:Ir(Ie)},{label:"Finalizadas",value:Mr(Ie)},{label:"Último seg.",value:lr(Ie)}],rows:Ie,initiallyOpen:!1}}const ai=[an("n-1","Cotización de nuevos","nuevos",p),an("p-1","Prueba de Manejo","pruebas",g),an("s-1","Cita de Servicio","servicio",m),an("sn-1","Cotización para Seminuevos","seminuevos",h)],Co=y.useMemo(()=>{const Z=(_e??"").trim().toLowerCase(),te=(Se,Ie)=>{if(Z&&!(Se.Vehiculo??"").toLowerCase().includes(Z))return!1;const yt=N?Se.FechaCita:Se.Fecha;if(xe&&yt){const k=Ct(yt??"");if(!k)return!1;const K=Ee?new Date(`${Ee}T00:00:00`):null,ie=nt?new Date(`${nt}T00:00:00`):null;if(ie&&ie.setDate(ie.getDate()+1),K&&k<K||ie&&k>=ie)return!1}if(oe!=="Todos"){const k=(Se.EstatusDescripcion??"").toLowerCase();if(!(US[oe]??[]).some(ke=>k===ke.toLowerCase()))return!1}if(O!=="Todos"){const k=(Se.Actividad??"").toLowerCase();if(!(HS[O]??[]).some(ke=>k===ke.toLowerCase()))return!1}if(me!=="Todos"){const k=(Se.NivelInteres??"").toLowerCase();if(!(ZS[me]??[]).some(ke=>k===ke.toLowerCase()))return!1}return!0};return ai.map(Se=>{const Ie=(Se.rows??[]).filter(k=>te(k,Se.kind)),yt=[{label:"En Proceso",value:Ir(Ie)},{label:"Finalizadas",value:Mr(Ie)},{label:"Último seg.",value:lr(Ie)}];return{...Se,rows:Ie,metrics:yt}})},[ai,_e,xe,Ee,nt,N,oe,O,me]);console.log("filteredSections",Co);const[Ka,ko]=y.useState(!1),[Nn,Qa]=y.useState(null),Xa={nuevos:"cotizaciones",pruebas:"pruebademanejo",servicio:"citasservicio",seminuevos:"seminuevos"},ci=(Z,te)=>{const Se=Z.SolID;if(!Se)return;const Ie=te.kind,yt=Xa[Ie]??"cotizaciones",k=`https://qa2.crm.netcar.com.mx/netcar/${yt}/${Se}`,K=_?.({row:Z,section:te,slug:yt,solId:Se,baseUrl:k});if(!C){const ie=K??`https://qa2.crm.netcar.com.mx/netcar/${yt}/${Se}`;Qa(ie),ko(!0)}};return d.jsx(b.Dialog,{open:e,onClose:n,fullWidth:!0,fullScreen:de,PaperProps:{sx:{height:{xs:"100dvh",md:"90vh"},maxWidth:{xs:"100vw",md:"92vw"},overflow:"hidden",display:"flex",flexDirection:"column",borderRadius:{xs:0,md:3}}},children:d.jsxs(b.Box,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},height:"100%",minHeight:0,overflow:"auto",position:"relative"},children:[d.jsxs(b.Box,{sx:{width:{xs:"100%",md:405},maxWidth:{xs:"100%",md:405},bgcolor:{xs:"transparent",md:"#40404024"},display:"flex",flexDirection:"column",height:{xs:"auto",md:"100%"},borderRight:{xs:"none",md:"1px solid #EBEEF0"}},children:[d.jsxs(b.Box,{children:[d.jsx(b.Stack,{direction:"row",spacing:2,alignItems:"center",mb:1,sx:{px:2.5,pt:2.5},children:d.jsxs(b.Box,{display:"flex",flexDirection:"column",gap:1,width:"100%",children:[d.jsx(b.Box,{display:"flex",flexDirection:"row",justifyContent:"space-between",width:"100%",alignItems:"center",children:d.jsx(b.Box,{sx:{flex:1,minWidth:0,pr:1},children:d.jsxs(b.Typography,{component:"span",fontWeight:700,sx:{display:"inline",lineHeight:1.2,wordBreak:"break-word",pr:.5},children:[G(t)," ",d.jsx(b.IconButton,{component:"span",size:"small",disableRipple:!0,onClick:()=>{n?.(),t&&u?.(t)},sx:{p:0,ml:.5,verticalAlign:"text-bottom",color:"#336BE1","&:hover":{bgcolor:"transparent"},"&:focus-visible":{outline:"none"}},"aria-label":"Editar nombre",children:d.jsx($S,{sx:{fontSize:"1em"}})})]})})}),R.map((Z,te)=>d.jsxs(b.Box,{sx:{display:"flex",gap:1.2,alignItems:"center",cursor:Z.onClick?"pointer":"default"},onClick:()=>{Z.onClick&&Z.onClick(t)},children:[Z.icon,d.jsx(b.Typography,{variant:"body2",sx:{color:Z.inLink?"#336BE1":"#070C10"},style:{},children:Z.value(t)})]},te))]})}),d.jsx(b.Stack,{mb:2,sx:{px:2.5,pt:0,gap:2},children:r.map((Z,te)=>{const Se=Z.label?.toLowerCase().startsWith("asesor");return d.jsxs(b.Box,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[d.jsx(b.Box,{sx:{width:"50%"},children:d.jsx(b.Typography,{variant:"body2",color:"text.secondary",sx:{color:"#5C6372"},children:Z.label})}),d.jsxs(b.Box,{sx:{width:"50%",display:"flex",alignItems:"center",gap:1},children:[d.jsx("div",{children:Z?.avatar?Z.avatar(t):null}),d.jsx(b.Typography,{variant:"body2",color:"textPrimary",children:Z?.value(t)}),Se&&d.jsx(b.Tooltip,{title:"Historial asesores",placement:"top",arrow:!0,children:d.jsx(b.IconButton,{size:"small",onClick:Ie=>D(Ie.currentTarget),sx:{ml:.5},disableRipple:!0,children:d.jsx(PS,{fontSize:"small",sx:{color:"#5C6372"}})})})]})]},te)})}),d.jsx(b.Divider,{sx:{my:2}})]}),d.jsx(b.Box,{px:2.5,pb:.5,children:d.jsxs(b.Typography,{children:[d.jsx("span",{style:{fontWeight:800},children:"Última actividad"}),!Nn&&" por solicitud",":"]})}),d.jsxs(b.Box,{sx:{px:2.5,pt:0,gap:2,flex:1,overflowY:"auto",display:"flex",flexDirection:"column",pb:6,maxHeight:{xs:"140px",md:"100%"}},children:[H.length===0&&d.jsx(b.Typography,{variant:"body2",color:"text.secondary",children:"Sin actividad registrada."}),d.jsxs(b.Box,{children:[H?.map((Z,te)=>{const Se=Q(Z),{bg:Ie,color:yt}=B(Z.TipoComentario),k=WS(Z.Comentario||"");return d.jsxs(b.Box,{sx:{pb:1.5},children:[d.jsxs(b.Stack,{direction:"row",spacing:1,alignItems:"center",justifyContent:"space-between",sx:{mb:.75},children:[d.jsx(b.Typography,{variant:"subtitle2",sx:{color:"#5C6372"},children:Z.TipoComentario||"Evento"}),d.jsx(b.Chip,{size:"small",label:Z.DisID!=null?`${Z.NombreDistribuidora}`:"—",sx:{bgcolor:Ie,color:yt,height:20}})]}),k?d.jsx(b.Typography,{variant:"body2",color:"text.secondary",sx:{whiteSpace:"pre-line",lineHeight:1.5,mb:.75},children:k}):null,d.jsxs(b.Stack,{direction:"row",spacing:1.25,alignItems:"center",children:[Z?.ImgAsesor!=null?d.jsx(b.Avatar,{sx:{width:28,height:28,bgcolor:"#EAEBF2",color:"#5C6372",fontSize:14},alt:v(Se),src:Z?.ImgAsesor}):d.jsx(b.Avatar,{sx:{width:28,height:28,bgcolor:"#EAEBF2",color:"#5C6372",fontSize:14},children:v(Se)}),d.jsxs(b.Stack,{spacing:0,children:[d.jsx(b.Typography,{variant:"body2",fontWeight:600,children:Se}),d.jsx(b.Typography,{variant:"caption",color:"text.secondary",children:YS(Z.FecAlta)})]})]}),te<j.length-1&&d.jsx(b.Divider,{sx:{mt:1.25}})]},Z.SegID??te)}),j.length>T&&d.jsx(b.Box,{sx:{mt:1},children:d.jsx(b.Button,{onClick:()=>F(Z=>!Z),size:"small",sx:{textTransform:"none",px:0,color:"#336BE1","&:hover":{background:"transparent",textDecoration:"underline"}},children:I?"Ver menos":`Ver más (${ee})`})})]})]}),d.jsx(b.Menu,{anchorEl:S,open:P,onClose:()=>D(null),TransitionComponent:b.Fade,MenuListProps:{disablePadding:!0},PaperProps:{sx:{width:320,p:0,overflow:"hidden"}},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:d.jsxs(b.Box,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[d.jsx(b.Box,{sx:{position:"sticky",top:0,zIndex:1,px:1.5,py:1,fontWeight:700,bgcolor:"background.paper",borderBottom:"1px solid",borderColor:"divider"},children:"Historial asesores"}),d.jsxs(b.Box,{sx:{overflowY:"auto",py:.5,maxHeight:200},children:[A.length===0&&d.jsx(b.Box,{sx:{px:1.5,py:1},children:d.jsx(b.Typography,{variant:"body2",color:"text.secondary",children:"Sin registros"})}),A.map((Z,te)=>{const Se=NS(Z),Ie=jS(Z.FechaBaja??Z.FechaAsignacion);return d.jsx(b.Box,{sx:{px:1,py:.75},children:d.jsxs(b.Stack,{direction:"row",alignItems:"center",spacing:1,children:[d.jsx(b.Avatar,{sx:{width:28,height:28,bgcolor:"#EAEBF2",color:"#5C6372",fontSize:14},src:Z?.ImgAsesor??void 0,children:RS(Se)}),d.jsx(b.Box,{sx:{flex:1,minWidth:0},children:d.jsx(b.Typography,{variant:"body2",noWrap:!0,children:Se})}),d.jsx(b.Typography,{variant:"caption",color:"text.secondary",sx:{whiteSpace:"nowrap"},children:Ie})]})},te)})]})]})})]}),Ka?d.jsxs(b.Box,{sx:{flex:1,minWidth:0,overflow:"hidden",position:"relative"},children:[d.jsx(b.Box,{sx:{position:"absolute",top:18,left:24,zIndex:10,pointerEvents:"auto"},children:d.jsx(b.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:d.jsx(b.Button,{onClick:()=>ko(!1),sx:{backgroundColor:"#2571d6",minWidth:36,minHeight:36,p:.5,borderRadius:"8px",color:"#fff",boxShadow:3,"&:hover":{backgroundColor:"#2074e3"}},children:d.jsx(LS,{fontSize:"medium"})})})}),Nn&&d.jsx("iframe",{src:Nn,width:"100%",height:"100%"})]}):d.jsxs(b.Box,{sx:{width:"100%",minHeight:0,overflowY:"auto"},children:[d.jsx(b.Box,{sx:{mt:{xs:1.5,md:3}},children:d.jsxs(b.Box,{sx:{mt:3,display:"flex",flexDirection:"column",gap:4,padding:"0 20px 0 20px"},children:[d.jsx(b.Typography,{variant:"h4",sx:{fontWeight:800,textAlign:"center",mb:1,letterSpacing:.2},children:"Solicitudes"}),d.jsxs(b.Stack,{direction:{xs:"column",md:"column"},spacing:1.5,alignItems:{xs:"stretch",md:"center"},justifyContent:"space-between",sx:{mb:1.5},children:[d.jsxs(b.Stack,{direction:"row",spacing:1.5,alignItems:"flex-start",sx:{flexWrap:"wrap"},children:[d.jsx(b.TextField,{size:"small",placeholder:"Buscar por vehículo",value:_e,onChange:Z=>De(Z.target.value),InputProps:{endAdornment:d.jsx(TS,{fontSize:"small",sx:{color:"#b6afaf"}})},sx:{minWidth:220}}),d.jsxs(b.Box,{sx:{display:"flex",flexDirection:"column",gap:.5,position:"relative"},children:[d.jsxs(b.Stack,{direction:"row",spacing:1.1,position:"absolute",bottom:48,left:0,alignItems:"center",children:[d.jsx(b.FormControlLabel,{label:d.jsx(b.Typography,{sx:{fontSize:15,fontWeight:600,marginLeft:0},children:"Por fecha"}),labelPlacement:"start",control:d.jsx(b.Checkbox,{checked:xe,onChange:Z=>Ge(Z.target.checked),size:"small",sx:{p:.3,"& .MuiSvgIcon-root":{fontSize:19},color:"#bab4b4"}}),sx:{ml:0,"& .MuiFormControlLabel-label":{marginRight:0}}}),d.jsx(b.Typography,{sx:{fontSize:15,paddingLeft:.4},children:"De cita"})]}),d.jsxs(b.Stack,{direction:"row",spacing:1,children:[d.jsx(b.TextField,{size:"small",type:"date",label:"Desde",InputLabelProps:{shrink:!0},value:Ee,onChange:Z=>_t(Z.target.value),disabled:!xe,sx:{width:170}}),d.jsx(b.TextField,{size:"small",type:"date",label:"Hasta",InputLabelProps:{shrink:!0},value:nt,onChange:Z=>ct(Z.target.value),disabled:!xe,sx:{width:170}})]})]}),d.jsx(b.IconButton,{onClick:Z=>M(Z.currentTarget),disableRipple:!0,sx:{border:"1px solid #d4d7de",borderRadius:2,width:40,height:40,mt:2},children:d.jsx(ES,{})}),qe&&d.jsx(b.Button,{variant:"outlined",onClick:be,disableRipple:!0,sx:{height:40,textTransform:"none",borderColor:"#d4d7de",color:"#333",mt:2},children:"Limpiar filtros"}),d.jsxs(b.Button,{variant:"outlined",sx:{height:40,textTransform:"none",borderColor:"none",color:"#fff",backgroundColor:"#1e5bce","&:hover":{backgroundColor:"#1e5bce",boxShadow:"none"},mt:2},onClick:()=>{x?.(t)},disableRipple:!0,children:[d.jsx(Uf,{sx:{color:"#fff",fontSize:24,paddingRight:.6}}),"Crear Solicitud"]})]}),d.jsx(OS,{sections:Co,detailColumns:[],getDetailColumns:So,onRowClick:ci})]})]})}),d.jsx(b.Menu,{anchorEl:E,open:z,onClose:()=>M(null),TransitionComponent:b.Fade,PaperProps:{sx:{p:1.5,width:260,borderRadius:2,boxShadow:3}},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:d.jsxs(b.Stack,{spacing:1.5,paddingX:1.5,paddingY:1,children:[d.jsx(b.Typography,{variant:"subtitle2",sx:{fontWeight:700,color:"#070C10"},children:"Filtro"}),d.jsxs(b.Box,{children:[d.jsx(b.Typography,{variant:"body2",sx:{fontWeight:700,mb:.5,color:"#5C6372"},children:"Estatus"}),d.jsx(b.RadioGroup,{value:oe,onChange:Z=>re(Z.target.value),sx:{"& .MuiFormControlLabel-root":{m:0,py:.3},"& .MuiFormControlLabel-label":{fontSize:14,fontWeight:400,ml:0}},children:["Todos","Sin Asignar","En prospección","Proceso de Compra","En espera de Unidad","Auto Facturado","Rechazadas","Finalizadas sin Venta","Finalizadas con Venta","En Proceso"].map(Z=>d.jsx(b.FormControlLabel,{value:Z,control:d.jsx(b.Radio,{size:"small",sx:{p:.2,"& .MuiSvgIcon-root":{fontSize:18}}}),label:Z},Z))})]}),d.jsxs(b.Box,{children:[d.jsx(b.Typography,{variant:"body2",sx:{fontWeight:700,mb:.5,color:"#5C6372"},children:"Actividades"}),d.jsx(b.RadioGroup,{value:O,onChange:(Z,te)=>X(te),sx:{"& .MuiFormControlLabel-root":{m:0,py:.3},"& .MuiFormControlLabel-label":{fontSize:14,fontWeight:400,ml:0}},children:["Todos",...J].map(Z=>d.jsx(b.FormControlLabel,{value:Z,sx:{alignItems:"start"},control:d.jsx(b.Radio,{size:"small",sx:{p:.2,"& .MuiSvgIcon-root":{fontSize:18}}}),label:Z},Z))})]}),d.jsxs(b.Box,{children:[d.jsx(b.Typography,{variant:"body2",sx:{fontWeight:700,mb:.5,color:"#5C6372"},children:"Nivel de interés"}),d.jsx(b.RadioGroup,{value:me,onChange:(Z,te)=>Ae(te),sx:{"& .MuiFormControlLabel-root":{m:0,py:.3},"& .MuiFormControlLabel-label":{fontSize:14,fontWeight:400,ml:0}},children:["Todos",...$].map(Z=>d.jsx(b.FormControlLabel,{value:Z,control:d.jsx(b.Radio,{size:"small",sx:{p:.2,"& .MuiSvgIcon-root":{fontSize:18}}}),label:Z},Z))})]})]})})]})]})})}const Hf={tableClientes:"_tableClientes_acwe7_1",tableResponsive:"_tableResponsive_acwe7_1"};function Zf(e,n,t){const{fields:r,order:o=["nombreCliente","email","acciones"],header:s={},cells:i={},hide:a={},actions:c}=n,l=c??{},u=l.show??{},f=l.handlers??{},p=l.accessors??{},g=l.icons??{},m=l.className??"d-flex flex-row gap-2 align-items-center ",h=l.tooltip??{},x=g.view??d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24",style:{fill:"#070c10"},children:[d.jsx("path",{d:"M18.6,6.3c-3.9-3-9.3-3-13.2,0-1.9,1.5-3.2,3.5-3.9,5.7.7,2.3,2,4.3,3.9,5.7,1.9,1.5,4.2,2.3,6.6,2.3,2.4,0,4.7-.8,6.6-2.3,1.9-1.5,3.2-3.5,3.9-5.7-.7-2.3-2-4.3-3.9-5.7ZM17.2,12.1c0,2.9-2.5,5.3-5.4,5.2-2.9,0-5.3-2.5-5.2-5.4,0-2.9,2.5-5.3,5.4-5.2,2.9,0,5.3,2.4,5.2,5.3,0,0,0,0,0,0Z"}),d.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),C={nombreCliente:{key:"nombreCliente",header:s.nombreCliente??"Cliente",accessor:B=>B[r.nombreCliente],cell:i.nombreCliente,width:190},email:{key:"email",header:s.email??"Correo",accessor:B=>B[r.email],cell:i.email??(B=>{const Q=String(B[r.email]??"");return Q?d.jsx("a",{href:`mailto:${Q}`,children:Q}):d.jsx("span",{className:"text-muted",children:"—"})}),width:230},acciones:a.acciones?void 0:{key:"acciones",header:"",cell:i.acciones??(B=>{const Q=Wa(u.whatsapp,B,!0),v=Wa(u.email,B,!0),j=Wa(u.view,B,!0),I=p.phone?.(B),F=p.email?.(B),H=ye=>{if(ye.stopPropagation(),f.onWhatsApp)return f.onWhatsApp(B);if(!I)return;const V=p.countryCode??"52",U=kS(String(I));typeof window<"u"&&window.open(`https://wa.me/${V}${U}`,"_blank")},ee=ye=>{if(ye.stopPropagation(),f.onEmail)return f.onEmail(B);F&&typeof window<"u"&&(window.location.href=`mailto:${F}`)},ne=ye=>{ye.stopPropagation(),f.onView&&f.onView(B)};return d.jsxs("div",{className:m,children:[Q&&d.jsx("button",{type:"button",className:"btn p-0 border-0 bg-transparent",title:h.whatsapp??"WhatsApp",onClick:H,style:{width:24,height:24},children:d.jsx("img",{src:_S,alt:"WhatsApp"})}),v&&d.jsx("button",{type:"button",className:"btn p-0 border-0 bg-transparent",title:h.email??"Email",onClick:ee,style:{width:24,height:24},children:d.jsx("img",{src:SS,alt:"Email"})}),j&&d.jsx("button",{type:"button",className:"btn p-0 border-0 bg-transparent",title:h.view??"Ver detalle",onClick:ne,style:{width:24,height:24},children:x})]})}),width:120}},_=Object.values(C).filter(B=>!!B),T=(e??[]).filter(B=>!!B?.key),S=new Map;for(const B of _)S.set(String(B.key),B);for(const B of T)S.set(String(B.key),B);const D=[..._.map(B=>String(B.key)),...T.map(B=>String(B.key))],P=Array.from(new Set(o.map(B=>String(B)).filter(B=>S.has(B)))),A=D.filter(B=>!P.includes(B)),G=[...P,...A],R="acciones";if(S.has(R)){const B=G.filter(Q=>Q!==R);G.splice(0,G.length,...B,R)}return G.map(B=>S.get(B))}function KS(e){const{rows:n,columns:t,clientSort:r=!0,defaultSort:o,minWidth:s=1100,rowKey:i=DS,defaults:a,detailConfig:c,extraSections:l,normalTableColumns:u,normalTable:f,onRowClick:p,activityHistory:g,advisorHistory:m,forceOpenDetailFor:h,closeDetailFor:x,onRequestEdit:C,searchFilter:_,solicitudesNuevos:T,solicitudesPrueba:S,solicitudesServicio:D,solicitudesSeminuevos:P,onCreateSolicitud:A,isCrmMode:G,onSolicitudBaseUrl:R}=e,[B,Q]=y.useState(o??null),[v,j]=y.useState({open:!1,customer:null}),[I,F]=y.useState([]),H=U=>{j({open:!0,customer:U});const ce=c?.vehiclesProvider?.(U)??[];F(Array.isArray(ce)?ce:[])},ee=U=>{p?.(U),j({open:!0,customer:U});const ce=c?.vehiclesProvider?.(U)??[];F(Array.isArray(ce)?ce:[])},ne=()=>{j({open:!1,customer:null}),x?.()},ye=y.useMemo(()=>a?Zf(t??[],a):Zf(t??[],{fields:{},order:[]}),[t,a]),V=y.useMemo(()=>{if(!r||!B)return n;const U=ye.find(ue=>ue.key===B.key);if(!U)return n;const ce=[...n];return ce.sort((ue,ge)=>{const ve=Ya(U,ue,0),pe=Ya(U,ge,0),de=CS(ve,pe);return B.direction==="asc"?de:-de}),ce},[n,ye,B,r]);return y.useEffect(()=>{h&&H(h)},[h]),d.jsxs("div",{children:[d.jsx("div",{className:`${Hf.tableClientes} back-white rounded-3 shadow-main mt-4 mb-4`,children:d.jsx("div",{className:`${Hf.tableResponsive} table-responsive`,children:d.jsxs("table",{className:"table table-hover align-middle mb-0",children:[d.jsx("thead",{children:d.jsx("tr",{children:ye.map(U=>d.jsx("th",{style:{fontWeight:600,width:U.width,paddingTop:"20px",paddingBottom:"20px",textAlign:U.align??"left"},children:U.header},U.key))})}),d.jsx("tbody",{children:V.map((U,ce)=>d.jsx("tr",{onClick:()=>ee?.(U),role:"button",tabIndex:0,onKeyDown:ue=>{(ue.key==="Enter"||ue.key===" ")&&ee?.(U)},style:{cursor:"pointer"},children:ye.map((ue,ge)=>{const ve=ue.Component?d.jsx(ue.Component,{row:U,index:ce}):ue.cell?ue.cell(U,ce):(()=>{const pe=Ya(ue,U,ce);return pe==null||pe===""?"":String(pe)})();return d.jsx("td",{style:{paddingTop:"20px",paddingBottom:"20px",textAlign:ue.align??"left"},children:ve},`${String(ue.key)}-${ge}`)})},i(U,ce)))})]})})}),v.open&&d.jsx(qS,{open:v.open,onClose:ne,customer:v.customer,fields:c?.dynamicFields,header:c?.header,extraSections:l,normalTableColumns:u,normalTable:f,history:g,advisorHistory:m,onRequestEdit:U=>{ne(),C?.(U)},searchFilter:_,solicitudesNuevos:T,solicitudesPrueba:S,solicitudesServicio:D,solicitudesSeminuevos:P,onCreateSolicitud:A,isCrmMode:G,onSolicitudBaseUrl:R})]})}const Gf=se.forwardRef(({sx:e,...n},t)=>d.jsx(b.InputBase,{inputRef:t,...n,sx:{height:48,px:1.5,width:"100%",maxWidth:"none",bgcolor:"#EBEEF0",borderRadius:2,border:"1px solid transparent","&:hover":{borderColor:"transparent"},"& .MuiInputBase-input::placeholder":{opacity:.7},...e}}));Gf.displayName="SoftInput";const QS=it(d.jsx("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"ErrorOutline");function XS({message:e}){return e?d.jsxs(b.Box,{role:"alert",sx:{mt:1,display:"flex",alignItems:"center",gap:1,bgcolor:"#fdeaea",border:"1px solid rgb(253, 237, 237)",color:"#842029",borderRadius:1,px:2,py:1.25},children:[d.jsx(QS,{fontSize:"small",sx:{color:"rgb(211, 47, 47)"}}),d.jsx("span",{style:{color:"rgb(95, 33, 32)",fontSize:14,fontWeight:"500"},children:e})]}):null}function JS(e){if(e.required)return e.required===!0?"El campo es obligatorio.":e.required}function Za(e,n){const t=JS(e);return t?n?.isArray?{required:t,validate:r=>Array.isArray(r)&&r.length>0||t}:{required:t,validate:r=>r!==""&&r!==null&&r!==void 0||t}:{}}const qf={"& .MuiOutlinedInput-root .MuiOutlinedInput-notchedOutline":{borderColor:"transparent"},"& .MuiOutlinedInput-root:hover .MuiOutlinedInput-notchedOutline":{borderColor:"transparent"},"& .MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"transparent"},"& .MuiOutlinedInput-root.Mui-error .MuiOutlinedInput-notchedOutline":{borderColor:"transparent"},width:"100%"},eC={mb:1,fontWeight:600,color:"#1C1C1D","&.Mui-focused":{color:"#1C1C1D !important"},"&.Mui-error":{color:"#1C1C1D !important"}};function Ga({label:e,errorMsg:n,helperText:t,children:r,sx:o}){return d.jsxs(b.FormControl,{fullWidth:!0,error:!!n,sx:o,className:"1- FieldWrapper",children:[d.jsx(b.FormLabel,{sx:eC,children:e}),r,d.jsx(XS,{message:n||t})]})}function tC(e,n){const{register:t,formState:{errors:r}}=n,o={...Za(e)};e.minLength&&(o.minLength={value:e.minLength,message:`El campo espera minimo ${e.minLength} caracteres`}),e.maxLength&&(o.maxLength={value:e.maxLength,message:`El campo espera maximo ${e.maxLength} caracteres`}),e.pattern&&(o.pattern={value:e.pattern,message:"Formato inválido"});const s=e.type==="email";s&&!o.pattern&&(o.pattern={value:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,message:"Correo electrónico inválido"});const i=/[A-Za-zÁÉÍÓÚÜÑáéíóúüñ\s'.-]/g,a=/[0-9]/g,c=new Set(["Backspace","Delete","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Tab","Home","End","Escape","Enter"]),l=S=>e.onlyNumbers?(S.match(a)??[]).join(""):e.onlyLetters?(S.match(i)??[]).join(""):S,u=(S,D)=>c.has(S)||D?!0:e.onlyNumbers?/^[0-9]$/.test(S):e.onlyLetters?/^[A-Za-zÁÉÍÓÚÜÑáéíóúüñ\s'.-]$/.test(S):!0,f=r[e.name]?.message,p=t(e.name,o),g=(e.inputProps&&typeof e.inputProps.maxLength=="number"?e.inputProps.maxLength:void 0)??e.maxLength,m=S=>{u(S.key,S.ctrlKey||S.metaKey)||S.preventDefault()},h=S=>{const D=S.data??null;D!=null&&(e.onlyNumbers&&/[^0-9]/.test(D)&&S.preventDefault(),e.onlyLetters&&/[^A-Za-zÁÉÍÓÚÜÑáéíóúüñ ]/.test(D)&&S.preventDefault())},x=S=>{const D=S.clipboardData.getData("text"),P=l(D);if(P!==D){S.preventDefault();const A=S.target,G=A.selectionStart??A.value.length,R=A.selectionEnd??A.value.length;A.setRangeText(P,G,R,"end"),A.dispatchEvent(new Event("input",{bubbles:!0}))}},C=S=>{const D=l(S.target.value);D!==S.target.value&&(S.target.value=D),g&&S.target.value.length>g&&(S.target.value=S.target.value.slice(0,g)),p.onChange(S)},_={...e.inputProps,...s?{inputMode:"email",autoComplete:"email"}:{},maxLength:g,onKeyDown:m,onBeforeInput:h,onPaste:x,onInvalid:S=>S.preventDefault()},T=e.onlyNumbers||s?"text":e.type??"text";return d.jsx(Ga,{label:e.label,errorMsg:f,helperText:e.helperText,sx:qf,children:d.jsx(Gf,{placeholder:e.placeholder,type:T,inputProps:_,...p,onChange:C,sx:{width:"100%",maxWidth:"none"},className:"SoftInputData"})})}function rC(e,n){const{control:t}=n,r=!!e.multiple;return d.jsx(Ht,{name:e.name,control:t,rules:Za(e,{isArray:r}),render:({field:o,fieldState:s})=>d.jsx(Ga,{label:e.label,errorMsg:s.error?.message,helperText:e.helperText,sx:qf,children:d.jsxs(b.Select,{...o,multiple:r,displayEmpty:!0,sx:{height:48,backgroundColor:"#EBEEF0","& .MuiSelect-select":{display:"flex",alignItems:"center",py:0}},className:"2-SoftInputData",children:[!r&&d.jsx(b.MenuItem,{value:"",disabled:!0,children:"Selecciona…"}),e.options.map(i=>d.jsx(b.MenuItem,{value:i.value,children:i.label},String(i.value)))]})})})}function nC(e,n){return d.jsx(Ht,{name:e.name,control:n.control,rules:Za(e),render:({field:t,fieldState:r})=>d.jsx(Ga,{label:e.label,errorMsg:r.error?.message,helperText:e.helperText,children:d.jsx(b.RadioGroup,{row:!0,...t,className:"3-RadioFieldRender",children:e.options.map(o=>d.jsx(b.FormControlLabel,{value:o.value,control:d.jsx(b.Radio,{}),label:o.label},String(o.value)))})})})}function Kf(e,n){if(e.render)return e.render(n);switch(e.kind){case"text":return tC(e,n);case"select":return rC(e,n);case"radio":return nC(e,n);default:return null}}function oC(e,{initialPerPage:n=25,perPageOptions:t=[10,25,50,100,"Todos"],onPageChange:r,onPerPageChange:o,scrollTop:s,deps:i=[]}={}){const a=Array.isArray(e)?e:[],[c,l]=y.useState(1),[u,f]=y.useState(n),{currentItems:p,totalPages:g,showingFrom:m,showingTo:h,totalItems:x}=y.useMemo(()=>{const T=a.length,S=u==="Todos"?1/0:Number(u),D=S===1/0?1:Math.max(1,Math.ceil(T/S)),P=Math.min(c,D),A=S===1/0?T:P*S,G=S===1/0?0:A-S;return{currentItems:S===1/0?a:a.slice(G,A),totalPages:D,showingFrom:T===0?0:G+1,showingTo:S===1/0?T:Math.min(A,T),totalItems:T}},[a,c,u]),C=T=>{const S=Math.max(1,Math.min(T,g||1));l(S),r?.(S),s?.()};return{currentItems:p,totalPages:g,showingFrom:m,showingTo:h,totalItems:x,currentPage:c,itemsPerPage:u,perPageOptions:t,goTo:C,next:()=>C(c+1),prev:()=>C(c-1),setItemsPerPage:T=>{f(T),o?.(T),l(1),s?.()},setCurrentPage:C}}const sC=it(d.jsx("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"NavigateBefore"),iC=it(d.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"NavigateNext"),aC=({currentPage:e,totalPages:n,onPageChange:t,itemsPerPage:r,onItemsPerPageChange:o,itemsPerPageOptions:s,showingFrom:i,showingTo:a,totalItems:c})=>{const l=b.useTheme(),u=b.useMediaQuery(l.breakpoints.down("sm")),f=()=>{if(n<=1)return[1];const m=u?0:2,h=[],x=1,C=n,_=Math.max(x+1,e-m),T=Math.min(C-1,e+m);h.push(x),_>x+1&&h.push("...");for(let S=_;S<=T;S++)S>=x+1&&S<=C-1&&h.push(S);return T<C-1&&h.push("..."),h.push(C),h},p=m=>{const h=m.target.value;o(h)},g=Math.max(1,n);return d.jsxs(b.Box,{sx:{display:"flex",flexDirection:{xs:"column",sm:"row"},alignItems:"center",justifyContent:{xs:"center",sm:"space-between"},gap:2,my:0,py:2,borderTop:"#D3D4D5 1px solid",px:3},children:[d.jsxs(b.Box,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",justifyContent:"center"},children:[d.jsx(b.IconButton,{onClick:()=>t(e-1),disabled:e<=1,size:"medium",sx:{"&:hover":{backgroundColor:"action.hover"}},"aria-label":"Página anterior",children:d.jsx(sC,{fontSize:"large"})}),f().map((m,h)=>m==="..."?d.jsx(b.Box,{sx:{px:1,display:"flex",alignItems:"center",fontSize:"1.1rem"},children:". . ."},`dots-${h}`):d.jsx(b.Button,{onClick:()=>t(m),size:"small",sx:{minWidth:36,height:36,fontSize:"1.05rem",p:1,borderRadius:"10px",backgroundColor:e===m?"primary.main":"transparent",fontWeight:e===m?700:400,color:e===m?"#fff":"#5C6372","&:hover":{backgroundColor:e===m?"primary.dark":"action.hover"},boxShadow:"none",border:"none",mx:.5},children:m},`p-${m}`)),d.jsx(b.IconButton,{onClick:()=>t(e+1),disabled:e>=g,size:"medium",sx:{"&:hover":{backgroundColor:"action.hover"}},"aria-label":"Página siguiente",children:d.jsx(iC,{fontSize:"large"})})]}),d.jsxs(b.Box,{sx:{display:"flex",alignItems:"center",gap:1.25,justifyContent:{xs:"center",sm:"flex-start"},mt:{xs:1,sm:0}},children:[d.jsx(b.Typography,{variant:"body2",children:"Mostrar"}),d.jsx(b.FormControl,{size:"small",sx:{minWidth:72},children:d.jsx(b.Select,{value:r,onChange:p,renderValue:m=>m==="Todos"?"Todos":String(m),children:s.map(m=>d.jsx(b.MenuItem,{value:m,children:m==="Todos"?"Todos":m},String(m)))})}),d.jsx(b.Typography,{variant:"body2",children:"por página"})]})]})};function cC(e){const{open:n,dataAdd:t,fields:r,onSubmit:o,onCancel:s,defaultValues:i,txtBtnGuardar:a,haveId:c=!1,itemsTable:l,filter:u,getId:f,renderRow:p,selectedIds:g,onSelectedChange:m,onSubmitAddData:h,initialSelectedIds:x=[],showAutosPanel:C}=e,_=Fd({mode:"onSubmit",reValidateMode:"onChange",criteriaMode:"all",shouldUnregister:!1,defaultValues:i});y.useEffect(()=>{i&&_.reset(i)},[i,_]);const[T,S]=y.useState(""),[D,P]=y.useState(x),A=Array.isArray(g)&&!!m,G=A?g:D,R=O=>{const X=typeof O=="function"?O(G):O;A?m(X):P(X)},B=y.useCallback(O=>f?f(O):O?.IdAuto,[f]),Q=y.useMemo(()=>{const O=new Map;return(l??[]).forEach((X,me)=>O.set(B(X),me)),O},[l,B]),v=y.useRef(new Set),j=y.useMemo(()=>{const O=new Map;return(l??[]).forEach(X=>O.set(f?f(X):X?.IdAuto,X)),O},[l,f]),I=y.useMemo(()=>(r??[]).filter(O=>!!O.required).map(O=>O.name),[r]),F=Sd({control:_.control,name:I}),H=O=>O==null?!1:typeof O=="string"?O.trim().length>0:Array.isArray(O)?O.length>0:typeof O=="number"?!Number.isNaN(O):typeof O=="object"?Object.keys(O).length>0:!0,ee=y.useMemo(()=>I.length?F?.every(H)??!1:!0,[F,I]),{handleSubmit:ne,formState:{isSubmitting:ye,isDirty:V,isValid:U}}=_,ce=u??((O,X)=>JSON.stringify(O).toLowerCase().includes(X.toLowerCase())),ue=y.useMemo(()=>T.trim()?l?.filter(O=>ce(O,T)):l,[l,T,ce]),ge=y.useMemo(()=>{if(!ue)return ue;const O=v.current,X=[...ue];return X.sort((me,Ae)=>{const $=O.has(B(me))?0:1,J=O.has(B(Ae))?0:1;if($!==J)return $-J;const be=Q.get(B(me))??0,qe=Q.get(B(Ae))??0;return be-qe}),X},[ue,Q,B]),{currentItems:ve,totalPages:pe,showingFrom:de,showingTo:_e,totalItems:De,currentPage:xe,itemsPerPage:Ge,perPageOptions:N,goTo:W,setItemsPerPage:he}=oC(ge,{initialPerPage:25,perPageOptions:[10,25,50,100,"Todos"],deps:[T],scrollTop:()=>{}}),fe=O=>{const X=j.get(O)??null;R([O]),h?.({items:X})},Ee=O=>G.includes(O),_t=async O=>{try{await o?.(O),_.reset(_.getValues())}catch(X){console.error("Error al enviar AddCliente:",X)}},nt=y.useMemo(()=>{const O=new Map;return(r??[]).forEach(X=>O.set(String(X.name),X)),O},[r]),ct=(O,X)=>{const me=nt.get(String(O));if(!me)return null;const Ae={xs:12,...me.grid,...X||{}};return d.jsx(b.Grid,{item:!0,...Ae,children:me.render?me.render(_):Kf(me,_)},`fld-${String(O)}`)},E=C??(e.haveId?"edit":"new"),M=E!=="onlyCars",z=E==="new"||E==="onlyCars",oe=G?.length>0,re=E==="onlyCars"?oe:e.haveId?ee&&V||oe:ee&&oe;return d.jsx(b.Dialog,{open:n,onClose:s,maxWidth:"lg",fullWidth:!0,PaperProps:{sx:{height:{xs:"100dvh",md:z?"90vw":"auto"},maxWidth:{xs:"100vw",md:z?"98vw":"50%"},overflow:"hidden",display:"flex",flexDirection:"column",borderRadius:{xs:0,md:3}}},children:d.jsx(g1,{..._,children:d.jsxs(b.Box,{component:"form",noValidate:!0,onSubmit:ne(_t),display:"flex",flexDirection:{xs:"column",md:"row"},width:"100%",height:"100%",overflow:{xs:"auto",md:"unset"},position:"relative",children:[M&&d.jsxs(b.Box,{sx:{width:{xs:"100%",md:c?"100%":394},maxWidth:{xs:"100%",md:c?"100%":394},boxShadow:{xs:"none",md:c?"none":"2px 0px 8px #40404024"},borderRight:{xs:"none",md:c?"none":"1px solid #EBEEF0"},bgcolor:"background.paper",paddingBottom:3,mx:{xs:0,md:c?"auto":0},position:"relative"},children:[d.jsxs(b.Box,{p:{xs:2,md:2},height:"100%",width:"100%",children:[d.jsx(b.Typography,{fontWeight:700,fontSize:20,children:t.title}),d.jsxs(b.Box,{sx:{flex:1,height:"100%",overflowY:"auto",paddingBottom:10},children:[d.jsx(b.Typography,{fontSize:"18px",mt:2.5,fontWeight:500,children:t.subTitle}),d.jsx(b.Box,{mt:2,display:"flex",flexDirection:"column",width:"100%",gap:2,children:Array.isArray(e.formLayout)&&c?e.formLayout.map((O,X)=>d.jsx(b.Grid,{container:!0,spacing:2,alignItems:"flex-start",wrap:"wrap",width:"100%",children:O.map((me,Ae)=>{const $=typeof me=="string"?{name:me}:me;return $.hidden?.(_)?null:ct($.name,$.grid)})},`row-${X}`)):d.jsx(b.Grid,{container:!0,spacing:2,width:"100%",children:r?.map((O,X)=>{const me=O.grid??{xs:12,md:12};return d.jsx(b.Grid,{item:!0,...me,children:O.render?O.render(_):Kf(O,_)},`${String(O.name)}-${X}`)})})})]})]}),d.jsx(b.Box,{sx:{position:"absolute",zIndex:O=>O.zIndex.modal+1,bottom:0,width:"100%",borderRadius:2,boxShadow:{xs:"0",md:"0 -8px 8px -6px #0003"},p:1,backgroundColor:"#fff"},children:d.jsx(b.Box,{display:"flex",alignItems:"center",children:d.jsx(b.Box,{display:"flex",gap:1.5,width:"100%",justifyContent:c?"flex-end":"center",children:d.jsx(b.Button,{type:"submit",variant:"contained",disabled:ye||!re,sx:{backgroundColor:"#336BE1",color:"#fff",borderColor:"transparent",height:48,fontSize:15,textTransform:"none",fontWeight:"400",paddingX:5,width:c?"160px":"100%"},children:a})})})})]}),z&&d.jsx(b.Box,{flex:1,display:"flex",flexDirection:"column",minWidth:0,sx:{height:"100%"},children:d.jsx(b.Box,{mt:1,sx:{flex:1,display:"flex",flexDirection:"column",height:"100%"},children:d.jsxs(b.Box,{sx:{display:"flex",flexDirection:"column",flex:1,minHeight:0},children:[d.jsxs(b.Box,{p:3,sx:{borderBottom:1,borderBottomColor:"#D3D4D5",position:"sticky",top:0,zIndex:1,bgcolor:"#fff",flexDirection:{sm:"row",xs:"column"}},display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingTop:4,children:[d.jsx(b.TextField,{value:T,onChange:O=>S(O.target.value),placeholder:"Buscar marca, modelo, vin...",InputProps:{endAdornment:d.jsx(b.InputAdornment,{position:"start",children:d.jsx(ry,{})}),disableUnderline:!0},variant:"standard",sx:{maxWidth:360,width:"100%",backgroundColor:"#EBEEF0",paddingX:"16px",paddingY:"10px"}}),d.jsx(b.Box,{display:"flex",gap:2,alignItems:"center",sx:{marginTop:{sm:0,xs:2}},children:d.jsx(b.Box,{onClick:s,sx:{cursor:"pointer",position:"absolute",top:0,right:10},display:{xs:"none",md:"block"},children:d.jsx(sn,{sx:{color:"#070C10",fontSize:24}})})}),C=="onlyCars"&&d.jsx(b.Box,{display:"flex",alignItems:"center",justifyContent:"center",children:d.jsx(b.Box,{display:"flex",gap:1.5,width:"100%",children:d.jsxs(b.Button,{type:"submit",variant:"contained",disabled:ye||!re,sx:{backgroundColor:"#336BE1",color:"#fff",borderColor:"transparent",height:48,fontSize:15,textTransform:"none",fontWeight:"400",paddingX:5,width:"100%"},children:[d.jsx(Uf,{sx:{color:ye||!re?"gray":"#fff",fontSize:26,paddingRight:.6}}),"Crear Solicitud"]})})})]}),d.jsx(b.Box,{sx:{flex:1,minHeight:0,overflowY:"auto",overflowX:"auto",padding:0,height:"100%","&::-webkit-scrollbar:horizontal":{display:"none"},"&::-webkit-scrollbar:vertical":{width:8}},children:d.jsx(b.Box,{sx:{minWidth:1150,width:"max(1150px, 100%)",paddingBottom:10},children:d.jsxs(b.List,{disablePadding:!0,sx:{borderColor:"transparent",padding:0},children:[ve?.map((O,X)=>{const me=f?f(O):X,Ae=Ee(me);return d.jsx(b.Box,{sx:{borderBottom:"1px solid #D3D4D5",padding:0},children:d.jsx(b.ListItem,{disableGutters:!0,sx:{paddingTop:0,padding:0,m:0},children:d.jsx(b.ListItemButton,{onClick:()=>fe(me),disableRipple:!0,sx:{padding:0},children:d.jsx(b.ListItemText,{disableTypography:!0,primary:p?p({item:O,selected:Ae,toggle:()=>fe(me),index:X}):null})})})},`${String(me)}`)}),!ve?.length&&d.jsx(b.Box,{p:3,children:d.jsxs(b.Typography,{fontSize:14,color:"#5C6372",children:["Sin resultados para “",T,"”."]})})]})})}),d.jsx(b.Box,{sx:{position:"sticky",bottom:0,bgcolor:"#fff"},children:d.jsx(aC,{currentPage:xe,totalPages:pe,onPageChange:W,itemsPerPage:Ge,onItemsPerPageChange:he,itemsPerPageOptions:N,showingFrom:de,showingTo:_e,totalItems:De})})]})})})]})})})}const lC=it(d.jsx("path",{d:"M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12 2.5-2.5V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6z"}),"AttachFile"),qa=/^[^\s@]+@[^\s@]+\.[^\s@]+$/i,si=/[,\s;]+/g,Fr=e=>e.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase(),Vr=(e,n)=>Array.from(new Set([...e,...n.map(t=>t.trim()).filter(Boolean)])),Qf=(e,n)=>n?e.filter(t=>Fr(t)!==Fr(n)):e,uC=(e,n)=>e.filter(t=>!n.some(r=>Fr(r)===Fr(t)));function cr(e,n,t){if(t)return typeof t=="function"?t(e,n):e[t]}function dC(e,n){if(n)return!e||/^https?:\/\//i.test(n)?n:e+n}function fC({open:e,onClose:n,value:t,onChange:r,onRequestSend:o,customer:s,itemsSelects:i,renderItem:a,filterFields:c=[],multiSelectAutos:l=!0,imgCorreoSrc:u,baseURLImages:f,itemProps:p,defaultItemImageSrc:g}){const m=y.useRef(null),[h,x]=y.useState("idle"),C=y.useRef(e);y.useEffect(()=>{const $=C.current;e&&!$&&x("entering"),!e&&$&&x("exiting"),C.current=e},[e]),y.useEffect(()=>{if(h==="entering"){const be=setTimeout(()=>x("idle"),320);return()=>clearTimeout(be)}if(h==="exiting"){const be=setTimeout(()=>x("idle"),220);return()=>clearTimeout(be)}},[h]);const[_,T]=y.useState(""),[S,D]=y.useState(!1),[P,A]=y.useState(!1),[G,R]=y.useState(!1),[B,Q]=y.useState(""),[v,j]=y.useState([]),I=G?v:t.selectedIds,F=()=>{j([...t.selectedIds]),Q(""),R(!0)},H=()=>{R(!1),j([])},ee=()=>{const $=new Set(nt.map((be,qe)=>String(cr(be,qe,p.id)))),J=v.filter(be=>$.has(String(be)));r({...t,selectedIds:J}),R(!1)},ne=($,J)=>Fr($??"")===Fr(J??"");function ye($,J,be,qe,St){const Ct=J?$.some(lr=>ne(lr,J)):!1,Ar=be.length>0?be.some(lr=>$.some(Mr=>ne(Mr,lr))):!1;qe(Ct),St(Ar)}const V=$=>{const J=typeof $=="function"?$(t.recipients):$;r({...t,recipients:J}),ye(J,ve,de,D,A)},U=$=>r({...t,message:$}),ce=$=>r({...t,attachments:[...t.attachments,...$]}),ue=$=>r({...t,attachments:t.attachments.filter(J=>J.name!==$)}),ge=$=>{if(G)if(l){const J=new Set(v);J.has($)?J.delete($):J.add($),j(Array.from(J))}else{const J=v.includes($);j(J?[]:[$])}else if(l){const J=new Set(t.selectedIds);J.has($)?J.delete($):J.add($),r({...t,selectedIds:Array.from(J)})}else{const J=t.selectedIds.includes($);r({...t,selectedIds:J?[]:[$]})}},ve=y.useMemo(()=>(s?.Correo??"").trim(),[s]),pe=y.useMemo(()=>Array.isArray(s?.Asesores)?s.Asesores.filter($=>$?.EmailAsesor&&$?.Activo):[],[s]),de=y.useMemo(()=>pe.map($=>($.EmailAsesor??"").trim()).filter(Boolean),[pe]),_e=y.useRef(!1);y.useEffect(()=>{if(e&&!_e.current){let $=[];S&&ve&&($=Vr($,[ve])),P&&de.length&&($=Vr($,de)),V(J=>Vr(J,$)),ye(t.recipients,ve,de,D,A),T(""),_e.current=!0}e||(_e.current=!1)},[e,S,P,ve,de]);const De=$=>{const J=pe.find(be=>Fr(be.EmailAsesor??"")===Fr($));if(J){if(J.ImgAsesor)return d.jsx(b.Avatar,{src:J.ImgAsesor,alt:J.NombreAsesor});const be=(J.NombreAsesor||"").trim(),qe=(J.ApellidosAsesor||"").trim();return d.jsx(b.Avatar,{children:`${be[0]??""}${qe[0]??""}`.toUpperCase()})}return d.jsx(b.Avatar,{children:$[0]?.toUpperCase()})},xe=()=>{const $=_.trim();if(!$)return;const be=$.split(si).filter(Boolean).filter(qe=>qa.test(qe));be.length>0&&V(qe=>Vr(qe,be)),T("")},Ge=$=>{D($),V(J=>$&&ve?Vr(J,[ve]):Qf(J,ve))},N=$=>{A($),V(J=>$?Vr(J,de):uC(J,de))},W=$=>{const J=Array.from($.target.files||[]);ce(J.map(be=>({name:be.name,size:be.size,file:be}))),$.target.value=""},he=I[0],fe=y.useMemo(()=>!i||he===void 0?void 0:i.find((J,be)=>String(cr(J,be,p.id))===String(he)),[i,he,p.id]),Ee=y.useMemo(()=>{if(!(!fe||!p.distributorId))return cr(fe,0,p.distributorId)},[fe,p.distributorId]);console.log("lockedDisId",Ee);const _t=y.useMemo(()=>fe?(p.distributorTitle?cr(fe,0,p.distributorTitle):void 0)??(Ee!=null?String(Ee):void 0):void 0,[fe,p.distributorTitle,Ee]),nt=y.useMemo(()=>{const $=i??[];return Ee==null||!p.distributorId?$:$.filter((J,be)=>cr(J,be,p.distributorId)==Ee)},[i,Ee,p.distributorId]),ct=y.useMemo(()=>{if(!B.trim())return nt;const $=B.toLowerCase();return nt.filter(J=>(c??[]).some(be=>String(J?.[be]??"").toLowerCase().includes($)))},[nt,B,c]),E=y.useMemo(()=>{if(!i||!t.selectedIds.length)return[];const $=new Map;return i.forEach((J,be)=>{$.set(String(cr(J,be,p.id)),J)}),t.selectedIds.map(J=>$.get(String(J))).filter(Boolean)},[i,t.selectedIds,p.id]),M=$=>r({...t,selectedIds:t.selectedIds.filter(J=>String(J)!==String($))}),z=()=>{let $=t.recipients;if(_.trim()){const Ct=_.split(si).filter(Ar=>qa.test(Ar));$=Vr($,Ct),V($),T("")}const J=S?ve:"",be=pe.find(Ct=>Ct?.Activo&&Ct?.EmailAsesor)?.EmailAsesor?.trim()??"";o?.({recipients:$,toClient:S,toAdvisor:P,tipoInt:S&&P?2:1,correoCliente:J,correoAsesor:P?be:"",disIdLocked:Ee}),n?.()},oe=y.useMemo(()=>{const J=_.split(si).filter(Boolean).some(be=>qa.test(be));return t.recipients.length>0||J},[t.recipients,_]),re=(t.selectedIds?.length??0)>0,O=t.message.trim().length>0,X=oe&&re&&O,me=b.useTheme(),Ae=b.useMediaQuery(me.breakpoints.down("sm"));return d.jsxs(b.Drawer,{anchor:Ae?"bottom":"right",open:e,onClose:n,ModalProps:{keepMounted:!0,BackdropProps:{invisible:!Ae}},transitionDuration:{enter:320,exit:220},SlideProps:{direction:Ae?"up":"left",timeout:{enter:320,exit:220},easing:{enter:"cubic-bezier(0.22, 1, 0.36, 1)",exit:"cubic-bezier(0.4, 0, 1, 1)"}},PaperProps:{sx:{width:{xs:"100vw",sm:420},height:{xs:"85vh",sm:"auto"},maxHeight:{xs:"85vh",sm:"calc(100vh - 32px)"},left:{xs:0,sm:"auto"},right:{xs:0,sm:16},bottom:{xs:0,sm:16},top:{xs:"auto",sm:"auto"},borderRadius:{xs:"12px 12px 0 0",sm:2},boxShadow:6,overflow:"hidden"}},children:[d.jsxs(b.Box,{sx:{display:"flex",flexDirection:"column",height:{xs:"100%",sm:"auto"},position:"relative",overflow:"auto"},children:[d.jsxs(b.Box,{sx:{p:2,pb:1,position:"sticky",top:0,zIndex:1,bgcolor:"#fff",borderBottom:"1px solid #E5E7EB"},children:[d.jsxs(b.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:1},children:[d.jsxs(b.Box,{sx:{display:"flex",alignItems:"center",gap:2},children:[u?d.jsx("img",{src:u,alt:"Correo",style:{width:24,height:18}}):null,d.jsxs(b.Typography,{fontWeight:700,children:["Mensaje a"," ",s?`${s.Nombre??""} ${s.ApellidoP??""} ${s.ApellidoM??""}`.trim():"—"]})]}),d.jsx(b.IconButton,{onClick:n,size:"small",children:d.jsx(sn,{})})]}),d.jsx("div",{children:d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"10px 10px",backgroundColor:"#EBEEF0",border:"1px solid #E5E7EB",borderRadius:8,flexWrap:"wrap"},children:[d.jsx("label",{style:{fontSize:14,fontWeight:600,marginRight:4},children:"Para:"}),d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap",flex:1},children:[t.recipients.map($=>d.jsx(b.Chip,{avatar:De($),label:$,onDelete:()=>V(J=>Qf(J,$)),size:"small",variant:"outlined",sx:{borderRadius:999,height:28}},$)),d.jsx("input",{type:"text",value:_,onChange:$=>T($.target.value),onKeyDown:$=>{const J=$.key;J==="Enter"||J===","||J===";"||J===" "||J==="Tab"?($.preventDefault(),xe()):J==="Backspace"&&!_&&t.recipients.length&&V(qe=>qe.slice(0,-1))},onBlur:xe,onPaste:$=>{const be=$.clipboardData.getData("text").split(si).filter(Boolean);be.length>1&&($.preventDefault(),V(qe=>Vr(qe,be)),T(""))},placeholder:t.recipients.length?"":"correo@ejemplo.com",style:{flex:1,minWidth:140,border:"none",outline:"none",background:"transparent",fontSize:14,color:"#111827",padding:"4px 0"}})]})]})}),d.jsxs(b.Box,{sx:{display:"flex",alignItems:"center",gap:2,mb:1.5},children:[d.jsx(b.FormControlLabel,{control:d.jsx(b.Checkbox,{checked:S,onChange:$=>Ge($.target.checked),size:"small"}),label:"Cliente"}),pe.length!==0&&d.jsx(b.FormControlLabel,{control:d.jsx(b.Checkbox,{checked:P,onChange:$=>N($.target.checked),size:"small"}),label:`Asesor${pe.length>1?"es":""}`})]})]}),d.jsx(b.Divider,{}),d.jsxs(b.Box,{p:2,children:[d.jsxs(b.Box,{sx:{display:"flex",alignItems:"center",gap:1},onClick:F,children:[d.jsx(b.Typography,{fontSize:12,fontWeight:600,sx:{textDecorationLine:"underline",cursor:"pointer"},children:"Selecciona el auto de seguimiento"}),_t!=null&&d.jsx(b.Chip,{size:"small",label:`Distribuidora: ${_t}`})]}),E.length>0?d.jsx(b.Box,{sx:{mt:1.5,display:"flex",gap:1,flexWrap:"wrap"},children:E.map(($,J)=>{const be=cr($,J,p.id),qe=cr($,J,p.title)??"",St=cr($,J,p.image),Ct=dC(f,St);return d.jsx(b.Chip,{onDelete:()=>M(be),label:d.jsxs(b.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[d.jsx(b.Box,{sx:{width:28,height:20,borderRadius:.8,bgcolor:"#e5e6e8",overflow:"hidden",flex:"0 0 auto"},children:Ct?d.jsx("img",{src:Ct,alt:qe,style:{width:"100%",height:"100%",objectFit:"cover"}}):d.jsx("img",{src:g,alt:qe,style:{width:"100%",height:"100%",objectFit:"cover"}})}),d.jsx("span",{style:{fontSize:12},children:d.jsx("b",{children:qe})})]}),sx:{pl:.5,pr:.3,py:.2,borderRadius:2,".MuiChip-deleteIcon":{fontSize:18}},variant:"outlined"},String(be))})}):d.jsx(b.Typography,{fontSize:13,color:"#5C6372",sx:{mt:.5},children:"Aún no has seleccionado autos."})]}),d.jsx(b.Divider,{}),d.jsxs(b.Box,{sx:{p:2},children:[d.jsx(b.TextField,{placeholder:"Escribe aquí tu mensaje...",value:t.message,onChange:$=>U($.target.value),multiline:!0,minRows:6,fullWidth:!0,sx:{mb:1.5}}),t.attachments.length>0&&d.jsx(b.List,{dense:!0,sx:{display:"flex",flexDirection:"column",gap:2,border:"none"},children:t.attachments.map($=>d.jsxs(b.ListItem,{sx:{px:0,background:"#EAEBF2",borderRadius:2,paddingX:1},children:[d.jsx(b.ListItemText,{style:{gap:10,fontSize:15,color:"#5285F7",display:"flex",flexWrap:"wrap",flex:"none"},primary:$.name,secondary:$.size<1024?`${$.size} b`:$.size<1024*1024?`${($.size/1024).toFixed(0)} kb`:`${($.size/(1024*1024)).toFixed(1)} MB`,secondaryTypographyProps:{sx:{fontSize:12,color:"#64748B",fontWeight:500,mt:.25}},primaryTypographyProps:{noWrap:!0,width:"auto"}}),d.jsx(b.Tooltip,{title:"Quitar",children:d.jsx(b.IconButton,{edge:"end",onClick:()=>ue($.name),size:"small",children:d.jsx(sn,{fontSize:"small"})})})]},$.name))})]}),d.jsxs(b.Box,{sx:{position:{xs:"sticky",sm:"sticky"},bottom:0,bgcolor:"#fff",borderTop:"1px solid #E5E7EB",p:2,display:"flex",alignItems:"center",gap:2},children:[d.jsx("input",{ref:m,hidden:!0,type:"file",multiple:!0,accept:".jpg,.jpeg,.png,.mp4,.pdf,.xlsx,.csv,.docx,.pptx,.txt",onChange:W}),d.jsx(b.Button,{startIcon:d.jsx(lC,{}),variant:"text",onClick:()=>m.current?.click(),sx:{color:"#5C6372"},children:"Adjuntar archivo"}),d.jsx(b.Box,{sx:{flex:1}}),d.jsx(b.Button,{variant:"contained",onClick:z,disabled:!X,sx:{maxWidth:146,width:"100%",height:53,backgroundColor:"#336BE1"},children:"Enviar"})]})]}),d.jsxs(b.Dialog,{fullWidth:!0,maxWidth:"sm",fullScreen:Ae,open:G,onClose:H,children:[d.jsxs(b.DialogTitle,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:1},children:["Selecciona tu auto de seguimiento",d.jsx(b.IconButton,{onClick:H,size:"small",children:d.jsx(sn,{})})]}),d.jsxs(b.DialogContent,{children:[d.jsxs(b.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[d.jsx(b.TextField,{placeholder:"Buscar...",fullWidth:!0,size:"small",value:B,onChange:$=>Q($.target.value),sx:{mb:2}}),_t!=null&&d.jsx(b.Chip,{size:"small",label:`Distribuidora: ${_t}`})]}),d.jsxs(b.Typography,{variant:"caption",fontWeight:600,children:["RESULTADOS (",ct.length,")"]}),d.jsxs(b.List,{sx:{p:0},children:[ct.map(($,J)=>{const be=cr($,J,p.id),qe=I.includes(String(be))||I.includes(be),St=Ee==null||cr($,J,p.distributorId)==Ee;return d.jsx(b.ListItem,{disableGutters:!0,sx:{p:0,opacity:St?1:.5},children:d.jsx(b.Box,{onClick:()=>St&&ge(be),sx:{cursor:St?"pointer":"not-allowed",p:.5,backgroundColor:qe?"#e5f0ff":"transparent",width:"100%",borderBottom:"solid 1px #D3D4D5"},children:a?a($,J):d.jsx("pre",{style:{margin:0},children:JSON.stringify($,null,2)})})},String(be))}),ct.length===0&&d.jsx(b.Box,{p:2,children:d.jsx(b.Typography,{children:"Tu búsqueda no generó resultados"})})]})]}),d.jsxs(b.DialogActions,{sx:{px:3,pb:2},children:[d.jsx(b.Button,{variant:"text",onClick:H,sx:{color:"#5C6372"},children:"Cancelar"}),d.jsx(b.Button,{variant:"contained",onClick:ee,sx:{backgroundColor:"#336BE1"},children:"Guardar selección"})]})]})]})}lt.AddCliente=cC,lt.ApiProvider=e1,lt.AuthProvider=Ay,lt.Clientes=KS,lt.CustomSnackbar=Ff,lt.EventsProvider=vS,lt.ModalCorreo=fC,lt.MyCalendar=wS,lt.useAuth=na,lt.useAuthRepository=Ls,lt.useEventRepository=va,Object.defineProperty(lt,Symbol.toStringTag,{value:"Module"})}));
|
|
182
|
+
`)}const US={Todos:[],"Sin Asignar":["Sin Asignar"],"En prospección":["Prospección"],"Proceso de Compra":["Proceso de Compra"],"En espera de Unidad":["En Espera de Unidad"],"Auto Facturado":["Auto Facturado"],Rechazadas:["Rechazada","Rechazadas"],"Finalizadas sin Venta":["Sin Venta"],"Finalizadas con Venta":["Con Venta"],"En Proceso":["Asignada","Prospección","Sin Asignar","Proceso de Compra","En Espera de Unidad","Auto Facturado"]},HS={Todos:[],"Selección y presentación de vehículos":["Selección y presentación de vehículos"],"Prueba de Manejo":["Prueba de Manejo"],"Valoración del Auto a cuenta y/o enganche":["Valoración del Auto a cuenta y/o enganche"],"Entrega de vehículo":["Entrega de vehículo"],"Negociación y Cierre":["Negociación y Cierre"]},ZS={Todos:[],"Algo interesado":["Algo interesado"],Interesado:["Interesado"],"Muy interesado":["Muy interesado"],"Venta definitiva":["Venta definitiva"],"No sé":["No sé"]};function GS(e,n){switch(e){case"pruebas":return FS(n)??"—";case"servicio":return VS(n)??"—";case"nuevos":case"seminuevos":default:return BS(n)??"—"}}function qS({open:e,onClose:n,customer:t,fields:r=[],header:o,extraSections:s,normalTable:i,normalTableColumns:a=[],history:c=[],advisorHistory:l=[],onRequestEdit:u,searchFilter:f,solicitudesNuevos:p=[],solicitudesPrueba:g=[],solicitudesServicio:m=[],solicitudesSeminuevos:h=[],onCreateSolicitud:x,isCrmMode:C=!1,onSolicitudBaseUrl:_}){if(console.log("estatus solicitudesSeminuevos",h),!t)return null;const T=3,[S,D]=y.useState(null),P=!!S,A=y.useMemo(()=>[...l].sort((Z,te)=>new Date(te.FechaAsignacion).getTime()-new Date(Z.FechaAsignacion).getTime()),[l]),G=o?.title??(Z=>Z?.Nombre||Z?.name||"Sin título"),R=o?.infoItems??[],B=Z=>{if(!Z)return{bg:"#E0E0E0",color:"#333"};const te=Z.toLowerCase();return te.includes("actualiz")?{bg:"#E8F1FF",color:"#1E60D1"}:te.includes("recorda")?{bg:"#F5E7FF",color:"#7A3DB8"}:{bg:"#EEE",color:"#333"}},Q=Z=>Z.NombreAsesor?.trim()||(Z.Email?Z.Email:"Sistema"),v=Z=>{const te=Z||"",Se=te.split(" ").filter(Boolean);return Se.length>=2?(Se[0][0]+Se[1][0]).toUpperCase():(te[0]||"?").toUpperCase()},j=[...c].sort((Z,te)=>new Date(te.FecAlta).getTime()-new Date(Z.FecAlta).getTime()),[I,F]=y.useState(!1),H=y.useMemo(()=>I?j:j.slice(0,T),[I,j]),ee=Math.max(j.length-T,0),ne=Z=>String(Z??"").normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase().trim(),ye=(Z,te)=>ne(JSON.stringify(Z)).includes(ne(te)),V=(Z,te)=>f?f(Z,te):ye(Z,te),U=(Z,te)=>{const Se=ne(te).split(/\s+/).filter(Boolean);return Se.length?Se.every(Ie=>V(Z,Ie)):!0},[ce,ue]=y.useState(""),[ge,ve]=y.useState([]);y.useMemo(()=>i??[],[i]),y.useMemo(()=>{const Z=ce.trim();return Z?(i??[]).filter(te=>U(te,Z)):i??[]},[i,ce]);const pe=b.useTheme(),de=b.useMediaQuery(pe.breakpoints.down("md")),[_e,De]=y.useState(""),[xe,Ge]=y.useState(!0),[N,W]=y.useState(!1),he=new Date().toISOString().slice(0,10),fe=new Date(Date.now()-720*3600*1e3).toISOString().slice(0,10),[Ee,_t]=y.useState(fe),[nt,ct]=y.useState(he),[E,M]=y.useState(null),z=!!E,[oe,re]=y.useState("Todos");console.log("estatus",oe);const[O,X]=y.useState("Todos"),[me,Ae]=y.useState("Todos"),$=["Algo interesado","Interesado","Muy interesado","Venta definitiva","No sé"],J=["Selección y presentación de vehículos","Prueba de Manejo","Valoración del Auto a cuenta y/o enganche","Entrega de vehículo","Negociación y Cierre"],be=()=>{De(""),Ge(!1),W(!1),_t(fe),ct(he),re("Todos"),X("Todos"),Ae("Todos")},qe=y.useMemo(()=>(_e??"").trim()!==""||oe!=="Todos"||O!=="Todos"||xe||N||me!=="Todos",[_e,oe,O,xe,N,me]);function St(Z){if(!Z)return"";const te=new Date(Z);if(isNaN(te.getTime()))return"";const Se=String(te.getDate()).padStart(2,"0"),Ie=String(te.getMonth()+1).padStart(2,"0"),yt=String(te.getFullYear()).slice(-2);return`${Se}/${Ie}/${yt}`}function Ct(Z){const te=Z?new Date(Z):null;return te&&!isNaN(te.getTime())?te:null}function Ar(Z,te){let Se=null;for(const Ie of Z){const yt=Ct(te(Ie));if(yt){const k=yt.getTime();(Se===null||k>Se)&&(Se=k)}}return Se?new Date(Se):null}function lr(Z){const te=Ar(Z,Se=>Se.UltimoSeguimiento||Se.FechaCita);return te?St(te.toISOString()):"—"}function Mr(Z){return Z.filter(te=>/finalizad/i.test(te.EstatusDescripcion??"")).length}function Ir(Z){return Z.length-Mr(Z)}const ii=({progress:Z,color:te})=>{if(!Z)return d.jsx(Ha,{current:0,total:0,color:te});const Se=Z.split("/").map(Number);if(Se.length!==2||Se.some(k=>Number.isNaN(k)))return d.jsx(Ha,{current:0,total:0,color:te});const[Ie,yt]=Se;return d.jsx(Ha,{current:Ie,total:yt,color:te})};function Or(Z){return[{key:"fecha",header:"Fecha",accessor:te=>St(te.Fecha),width:110},{key:"vehiculo",header:"Vehículo",accessor:te=>d.jsx(b.Tooltip,{title:te.Vehiculo??"",placement:"top",arrow:!0,children:d.jsx(b.Typography,{component:"span",sx:{fontSize:13,fontWeight:500,display:"block",maxWidth:260,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",lineHeight:1.3,cursor:"default"},children:te.Vehiculo??"—"})}),width:260},{key:"estatus",header:"Estatus",accessor:te=>d.jsx(b.Typography,{sx:{fontWeight:800,fontSize:13},children:GS(Z,te.IdEstatus)}),width:170},{key:"nivel",header:"Nivel de Interés",accessor:te=>{const{bg:Se,color:Ie}=zS(te.NivelInteres);return d.jsx(b.Box,{sx:{display:"inline-block",px:1,py:.25,borderRadius:9999,bgcolor:Se,color:Ie,fontSize:12,fontWeight:800},children:te.NivelInteres??"—"})},width:150},{key:"asesor",header:"Asesor",accessor:te=>d.jsx(b.Tooltip,{title:te.Asesor??"",placement:"top",children:d.jsx(b.Typography,{sx:{fontWeight:700,fontSize:13,textAlign:"center"},children:(te.Asesor??"").split(" ").filter(Boolean).map(Se=>Se[0]?.toUpperCase()).slice(0,2).join("")||"—"})}),width:120,align:"center"},{key:"origen",header:"Origen",accessor:te=>te.Origen??"—",width:90,align:"center"},{key:"actividad",header:"Actividad",accessor:te=>d.jsx(b.Tooltip,{title:te.Actividad??"",placement:"top",arrow:!0,children:d.jsx(b.Box,{sx:{maxWidth:"100%",overflow:"hidden"},children:d.jsx(b.Typography,{component:"span",noWrap:!0,sx:{fontSize:13,fontWeight:500,display:"block",overflow:"hidden",textOverflow:"ellipsis",lineHeight:1.3,cursor:(te.Actividad??"").length?"default":"inherit"},children:te.Actividad??"—"})})}),width:250},{key:"avance",header:"Avance",accessor:te=>d.jsx(ii,{progress:te.Avance,color:te.Color}),width:200,align:"left"}]}function _o(Z){const Se=Or(Z).slice(1);return[{key:"fecha",header:"Fecha",accessor:Ie=>St(Ie.Fecha),width:110},{key:"fechaCita",header:"Fecha Cita",accessor:Ie=>St(Ie.FechaCita),width:120},{key:"horaCita",header:"Hora Cita",accessor:Ie=>Ie.HoraCita??"—",width:110},...Se]}function So(Z){const te=Z.kind;switch(te){case"pruebas":case"servicio":return _o(te);case"nuevos":case"seminuevos":default:return Or(te)}}function an(Z,te,Se,Ie){return{id:Z,kind:Se,title:te,metrics:[{label:"En Proceso",value:Ir(Ie)},{label:"Finalizadas",value:Mr(Ie)},{label:"Último seg.",value:lr(Ie)}],rows:Ie,initiallyOpen:!1}}const ai=[an("n-1","Cotización de nuevos","nuevos",p),an("p-1","Prueba de Manejo","pruebas",g),an("s-1","Cita de Servicio","servicio",m),an("sn-1","Cotización para Seminuevos","seminuevos",h)],Co=y.useMemo(()=>{const Z=(_e??"").trim().toLowerCase(),te=(Se,Ie)=>{if(Z&&!(Se.Vehiculo??"").toLowerCase().includes(Z))return!1;const yt=N?Se.FechaCita:Se.Fecha;if(xe&&yt){const k=Ct(yt??"");if(!k)return!1;const K=Ee?new Date(`${Ee}T00:00:00`):null,ie=nt?new Date(`${nt}T00:00:00`):null;if(ie&&ie.setDate(ie.getDate()+1),K&&k<K||ie&&k>=ie)return!1}if(oe!=="Todos"){const k=(Se.EstatusDescripcion??"").toLowerCase();if(!(US[oe]??[]).some(ke=>k===ke.toLowerCase()))return!1}if(O!=="Todos"){const k=(Se.Actividad??"").toLowerCase();if(!(HS[O]??[]).some(ke=>k===ke.toLowerCase()))return!1}if(me!=="Todos"){const k=(Se.NivelInteres??"").toLowerCase();if(!(ZS[me]??[]).some(ke=>k===ke.toLowerCase()))return!1}return!0};return ai.map(Se=>{const Ie=(Se.rows??[]).filter(k=>te(k,Se.kind)),yt=[{label:"En Proceso",value:Ir(Ie)},{label:"Finalizadas",value:Mr(Ie)},{label:"Último seg.",value:lr(Ie)}];return{...Se,rows:Ie,metrics:yt}})},[ai,_e,xe,Ee,nt,N,oe,O,me]);console.log("filteredSections",Co);const[Ka,ko]=y.useState(!1),[Nn,Qa]=y.useState(null),Xa={nuevos:"cotizaciones",pruebas:"pruebademanejo",servicio:"citasservicio",seminuevos:"seminuevos"},ci=(Z,te)=>{const Se=Z.SolID;if(!Se)return;const Ie=te.kind,yt=Xa[Ie]??"cotizaciones",k=`https://qa2.crm.netcar.com.mx/netcar/${yt}/${Se}`,K=_?.({row:Z,section:te,slug:yt,solId:Se,baseUrl:k});if(!C){const ie=K??`https://qa2.crm.netcar.com.mx/netcar/${yt}/${Se}`;Qa(ie),ko(!0)}};return d.jsx(b.Dialog,{open:e,onClose:n,fullWidth:!0,fullScreen:de,PaperProps:{sx:{height:{xs:"100dvh",md:"90vh"},maxWidth:{xs:"100vw",md:"92vw"},overflow:"hidden",display:"flex",flexDirection:"column",borderRadius:{xs:0,md:3}}},children:d.jsxs(b.Box,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},height:"100%",minHeight:0,overflow:"auto",position:"relative"},children:[d.jsxs(b.Box,{sx:{width:{xs:"100%",md:405},maxWidth:{xs:"100%",md:405},bgcolor:{xs:"transparent",md:"#40404024"},display:"flex",flexDirection:"column",height:{xs:"auto",md:"100%"},borderRight:{xs:"none",md:"1px solid #EBEEF0"}},children:[d.jsxs(b.Box,{children:[d.jsx(b.Stack,{direction:"row",spacing:2,alignItems:"center",mb:1,sx:{px:2.5,pt:2.5},children:d.jsxs(b.Box,{display:"flex",flexDirection:"column",gap:1,width:"100%",children:[d.jsx(b.Box,{display:"flex",flexDirection:"row",justifyContent:"space-between",width:"100%",alignItems:"center",children:d.jsx(b.Box,{sx:{flex:1,minWidth:0,pr:1},children:d.jsxs(b.Typography,{component:"span",fontWeight:700,sx:{display:"inline",lineHeight:1.2,wordBreak:"break-word",pr:.5},children:[G(t)," ",d.jsx(b.IconButton,{component:"span",size:"small",disableRipple:!0,onClick:()=>{n?.(),t&&u?.(t)},sx:{p:0,ml:.5,verticalAlign:"text-bottom",color:"#336BE1","&:hover":{bgcolor:"transparent"},"&:focus-visible":{outline:"none"}},"aria-label":"Editar nombre",children:d.jsx($S,{sx:{fontSize:"1em"}})})]})})}),R.map((Z,te)=>d.jsxs(b.Box,{sx:{display:"flex",gap:1.2,alignItems:"center",cursor:Z.onClick?"pointer":"default"},onClick:()=>{Z.onClick&&Z.onClick(t)},children:[Z.icon,d.jsx(b.Typography,{variant:"body2",sx:{color:Z.inLink?"#336BE1":"#070C10"},style:{},children:Z.value(t)})]},te))]})}),d.jsx(b.Stack,{mb:2,sx:{px:2.5,pt:0,gap:2},children:r.map((Z,te)=>{const Se=Z.label?.toLowerCase().startsWith("asesor");return d.jsxs(b.Box,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[d.jsx(b.Box,{sx:{width:"50%"},children:d.jsx(b.Typography,{variant:"body2",color:"text.secondary",sx:{color:"#5C6372"},children:Z.label})}),d.jsxs(b.Box,{sx:{width:"50%",display:"flex",alignItems:"center",gap:1},children:[d.jsx("div",{children:Z?.avatar?Z.avatar(t):null}),d.jsx(b.Typography,{variant:"body2",color:"textPrimary",children:Z?.value(t)}),Se&&d.jsx(b.Tooltip,{title:"Historial asesores",placement:"top",arrow:!0,children:d.jsx(b.IconButton,{size:"small",onClick:Ie=>D(Ie.currentTarget),sx:{ml:.5},disableRipple:!0,children:d.jsx(PS,{fontSize:"small",sx:{color:"#5C6372"}})})})]})]},te)})}),d.jsx(b.Divider,{sx:{my:2}})]}),d.jsx(b.Box,{px:2.5,pb:.5,children:d.jsxs(b.Typography,{children:[d.jsx("span",{style:{fontWeight:800},children:"Última actividad"}),!Nn&&" por solicitud",":"]})}),d.jsxs(b.Box,{sx:{px:2.5,pt:0,gap:2,flex:1,overflowY:"auto",display:"flex",flexDirection:"column",pb:6,maxHeight:{xs:"140px",md:"100%"}},children:[H.length===0&&d.jsx(b.Typography,{variant:"body2",color:"text.secondary",children:"Sin actividad registrada."}),d.jsxs(b.Box,{children:[H?.map((Z,te)=>{const Se=Q(Z),{bg:Ie,color:yt}=B(Z.TipoComentario),k=WS(Z.Comentario||"");return d.jsxs(b.Box,{sx:{pb:1.5},children:[d.jsxs(b.Stack,{direction:"row",spacing:1,alignItems:"center",justifyContent:"space-between",sx:{mb:.75},children:[d.jsx(b.Typography,{variant:"subtitle2",sx:{color:"#5C6372"},children:Z.TipoComentario||"Evento"}),d.jsx(b.Chip,{size:"small",label:Z.DisID!=null?`${Z.NombreDistribuidora}`:"—",sx:{bgcolor:Ie,color:yt,height:20}})]}),k?d.jsx(b.Typography,{variant:"body2",color:"text.secondary",sx:{whiteSpace:"pre-line",lineHeight:1.5,mb:.75},children:k}):null,d.jsxs(b.Stack,{direction:"row",spacing:1.25,alignItems:"center",children:[Z?.ImgAsesor!=null?d.jsx(b.Avatar,{sx:{width:28,height:28,bgcolor:"#EAEBF2",color:"#5C6372",fontSize:14},alt:v(Se),src:Z?.ImgAsesor}):d.jsx(b.Avatar,{sx:{width:28,height:28,bgcolor:"#EAEBF2",color:"#5C6372",fontSize:14},children:v(Se)}),d.jsxs(b.Stack,{spacing:0,children:[d.jsx(b.Typography,{variant:"body2",fontWeight:600,children:Se}),d.jsx(b.Typography,{variant:"caption",color:"text.secondary",children:YS(Z.FecAlta)})]})]}),te<j.length-1&&d.jsx(b.Divider,{sx:{mt:1.25}})]},Z.SegID??te)}),j.length>T&&d.jsx(b.Box,{sx:{mt:1},children:d.jsx(b.Button,{onClick:()=>F(Z=>!Z),size:"small",sx:{textTransform:"none",px:0,color:"#336BE1","&:hover":{background:"transparent",textDecoration:"underline"}},children:I?"Ver menos":`Ver más (${ee})`})})]})]}),d.jsx(b.Menu,{anchorEl:S,open:P,onClose:()=>D(null),TransitionComponent:b.Fade,MenuListProps:{disablePadding:!0},PaperProps:{sx:{width:320,p:0,overflow:"hidden"}},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:d.jsxs(b.Box,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[d.jsx(b.Box,{sx:{position:"sticky",top:0,zIndex:1,px:1.5,py:1,fontWeight:700,bgcolor:"background.paper",borderBottom:"1px solid",borderColor:"divider"},children:"Historial asesores"}),d.jsxs(b.Box,{sx:{overflowY:"auto",py:.5,maxHeight:200},children:[A.length===0&&d.jsx(b.Box,{sx:{px:1.5,py:1},children:d.jsx(b.Typography,{variant:"body2",color:"text.secondary",children:"Sin registros"})}),A.map((Z,te)=>{const Se=NS(Z),Ie=jS(Z.FechaBaja??Z.FechaAsignacion);return d.jsx(b.Box,{sx:{px:1,py:.75},children:d.jsxs(b.Stack,{direction:"row",alignItems:"center",spacing:1,children:[d.jsx(b.Avatar,{sx:{width:28,height:28,bgcolor:"#EAEBF2",color:"#5C6372",fontSize:14},src:Z?.ImgAsesor??void 0,children:RS(Se)}),d.jsx(b.Box,{sx:{flex:1,minWidth:0},children:d.jsx(b.Typography,{variant:"body2",noWrap:!0,children:Se})}),d.jsx(b.Typography,{variant:"caption",color:"text.secondary",sx:{whiteSpace:"nowrap"},children:Ie})]})},te)})]})]})})]}),Ka?d.jsxs(b.Box,{sx:{flex:1,minWidth:0,overflow:"hidden",position:"relative"},children:[d.jsx(b.Box,{sx:{position:"absolute",top:18,left:24,zIndex:10,pointerEvents:"auto"},children:d.jsx(b.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:d.jsx(b.Button,{onClick:()=>ko(!1),sx:{backgroundColor:"#2571d6",minWidth:36,minHeight:36,p:.5,borderRadius:"8px",color:"#fff",boxShadow:3,"&:hover":{backgroundColor:"#2074e3"}},children:d.jsx(LS,{fontSize:"medium"})})})}),Nn&&d.jsx("iframe",{src:Nn,width:"100%",height:"100%"})]}):d.jsxs(b.Box,{sx:{width:"100%",minHeight:0,overflowY:"auto"},children:[d.jsx(b.Box,{sx:{mt:{xs:1.5,md:3}},children:d.jsxs(b.Box,{sx:{mt:3,display:"flex",flexDirection:"column",gap:4,padding:"0 20px 0 20px"},children:[d.jsx(b.Typography,{variant:"h4",sx:{fontWeight:800,textAlign:"center",mb:1,letterSpacing:.2},children:"Solicitudes"}),d.jsxs(b.Stack,{direction:{xs:"column",md:"column"},spacing:1.5,alignItems:{xs:"stretch",md:"center"},justifyContent:"space-between",sx:{mb:1.5},children:[d.jsxs(b.Stack,{direction:"row",spacing:1.5,alignItems:"flex-start",sx:{flexWrap:"wrap"},children:[d.jsx(b.TextField,{size:"small",placeholder:"Buscar por vehículo",value:_e,onChange:Z=>De(Z.target.value),InputProps:{endAdornment:d.jsx(TS,{fontSize:"small",sx:{color:"#b6afaf"}})},sx:{minWidth:220}}),d.jsxs(b.Box,{sx:{display:"flex",flexDirection:"column",gap:.5,position:"relative"},children:[d.jsxs(b.Stack,{direction:"row",spacing:1.1,position:"absolute",bottom:48,left:0,alignItems:"center",children:[d.jsx(b.FormControlLabel,{label:d.jsx(b.Typography,{sx:{fontSize:15,fontWeight:600,marginLeft:0},children:"Por fecha"}),labelPlacement:"start",control:d.jsx(b.Checkbox,{checked:xe,onChange:Z=>Ge(Z.target.checked),size:"small",sx:{p:.3,"& .MuiSvgIcon-root":{fontSize:19},color:"#bab4b4"}}),sx:{ml:0,"& .MuiFormControlLabel-label":{marginRight:0}}}),d.jsx(b.Typography,{sx:{fontSize:15,paddingLeft:.4},children:"De cita"})]}),d.jsxs(b.Stack,{direction:"row",spacing:1,children:[d.jsx(b.TextField,{size:"small",type:"date",label:"Desde",InputLabelProps:{shrink:!0},value:Ee,onChange:Z=>_t(Z.target.value),disabled:!xe,sx:{width:170}}),d.jsx(b.TextField,{size:"small",type:"date",label:"Hasta",InputLabelProps:{shrink:!0},value:nt,onChange:Z=>ct(Z.target.value),disabled:!xe,sx:{width:170}})]})]}),d.jsx(b.IconButton,{onClick:Z=>M(Z.currentTarget),disableRipple:!0,sx:{border:"1px solid #d4d7de",borderRadius:2,width:40,height:40,mt:2},children:d.jsx(ES,{})}),qe&&d.jsx(b.Button,{variant:"outlined",onClick:be,disableRipple:!0,sx:{height:40,textTransform:"none",borderColor:"#d4d7de",color:"#333",mt:2},children:"Limpiar filtros"}),d.jsxs(b.Button,{variant:"outlined",sx:{height:40,textTransform:"none",borderColor:"none",color:"#fff",backgroundColor:"#1e5bce","&:hover":{backgroundColor:"#1e5bce",boxShadow:"none"},mt:2},onClick:()=>{x?.(t)},disableRipple:!0,children:[d.jsx(Uf,{sx:{color:"#fff",fontSize:24,paddingRight:.6}}),"Crear Solicitud"]})]}),d.jsx(OS,{sections:Co,detailColumns:[],getDetailColumns:So,onRowClick:ci})]})]})}),d.jsx(b.Menu,{anchorEl:E,open:z,onClose:()=>M(null),TransitionComponent:b.Fade,PaperProps:{sx:{p:1.5,width:260,borderRadius:2,boxShadow:3}},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:d.jsxs(b.Stack,{spacing:1.5,paddingX:1.5,paddingY:1,children:[d.jsx(b.Typography,{variant:"subtitle2",sx:{fontWeight:700,color:"#070C10"},children:"Filtro"}),d.jsxs(b.Box,{children:[d.jsx(b.Typography,{variant:"body2",sx:{fontWeight:700,mb:.5,color:"#5C6372"},children:"Estatus"}),d.jsx(b.RadioGroup,{value:oe,onChange:Z=>re(Z.target.value),sx:{"& .MuiFormControlLabel-root":{m:0,py:.3},"& .MuiFormControlLabel-label":{fontSize:14,fontWeight:400,ml:0}},children:["Todos","Sin Asignar","En prospección","Proceso de Compra","En espera de Unidad","Auto Facturado","Rechazadas","Finalizadas sin Venta","Finalizadas con Venta","En Proceso"].map(Z=>d.jsx(b.FormControlLabel,{value:Z,control:d.jsx(b.Radio,{size:"small",sx:{p:.2,"& .MuiSvgIcon-root":{fontSize:18}}}),label:Z},Z))})]}),d.jsxs(b.Box,{children:[d.jsx(b.Typography,{variant:"body2",sx:{fontWeight:700,mb:.5,color:"#5C6372"},children:"Actividades"}),d.jsx(b.RadioGroup,{value:O,onChange:(Z,te)=>X(te),sx:{"& .MuiFormControlLabel-root":{m:0,py:.3},"& .MuiFormControlLabel-label":{fontSize:14,fontWeight:400,ml:0}},children:["Todos",...J].map(Z=>d.jsx(b.FormControlLabel,{value:Z,sx:{alignItems:"start"},control:d.jsx(b.Radio,{size:"small",sx:{p:.2,"& .MuiSvgIcon-root":{fontSize:18}}}),label:Z},Z))})]}),d.jsxs(b.Box,{children:[d.jsx(b.Typography,{variant:"body2",sx:{fontWeight:700,mb:.5,color:"#5C6372"},children:"Nivel de interés"}),d.jsx(b.RadioGroup,{value:me,onChange:(Z,te)=>Ae(te),sx:{"& .MuiFormControlLabel-root":{m:0,py:.3},"& .MuiFormControlLabel-label":{fontSize:14,fontWeight:400,ml:0}},children:["Todos",...$].map(Z=>d.jsx(b.FormControlLabel,{value:Z,control:d.jsx(b.Radio,{size:"small",sx:{p:.2,"& .MuiSvgIcon-root":{fontSize:18}}}),label:Z},Z))})]})]})})]})]})})}const Hf={tableClientes:"_tableClientes_acwe7_1",tableResponsive:"_tableResponsive_acwe7_1"};function Zf(e,n,t){const{fields:r,order:o=["nombreCliente","email","acciones"],header:s={},cells:i={},hide:a={},actions:c}=n,l=c??{},u=l.show??{},f=l.handlers??{},p=l.accessors??{},g=l.icons??{},m=l.className??"d-flex flex-row gap-2 align-items-center ",h=l.tooltip??{},x=g.view??d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24",style:{fill:"#070c10"},children:[d.jsx("path",{d:"M18.6,6.3c-3.9-3-9.3-3-13.2,0-1.9,1.5-3.2,3.5-3.9,5.7.7,2.3,2,4.3,3.9,5.7,1.9,1.5,4.2,2.3,6.6,2.3,2.4,0,4.7-.8,6.6-2.3,1.9-1.5,3.2-3.5,3.9-5.7-.7-2.3-2-4.3-3.9-5.7ZM17.2,12.1c0,2.9-2.5,5.3-5.4,5.2-2.9,0-5.3-2.5-5.2-5.4,0-2.9,2.5-5.3,5.4-5.2,2.9,0,5.3,2.4,5.2,5.3,0,0,0,0,0,0Z"}),d.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),C={nombreCliente:{key:"nombreCliente",header:s.nombreCliente??"Cliente",accessor:B=>B[r.nombreCliente],cell:i.nombreCliente,width:190},email:{key:"email",header:s.email??"Correo",accessor:B=>B[r.email],cell:i.email??(B=>{const Q=String(B[r.email]??"");return Q?d.jsx("a",{href:`mailto:${Q}`,children:Q}):d.jsx("span",{className:"text-muted",children:"—"})}),width:230},acciones:a.acciones?void 0:{key:"acciones",header:"",cell:i.acciones??(B=>{const Q=Wa(u.whatsapp,B,!0),v=Wa(u.email,B,!0),j=Wa(u.view,B,!0),I=p.phone?.(B),F=p.email?.(B),H=ye=>{if(ye.stopPropagation(),f.onWhatsApp)return f.onWhatsApp(B);if(!I)return;const V=p.countryCode??"52",U=kS(String(I));typeof window<"u"&&window.open(`https://wa.me/${V}${U}`,"_blank")},ee=ye=>{if(ye.stopPropagation(),f.onEmail)return f.onEmail(B);F&&typeof window<"u"&&(window.location.href=`mailto:${F}`)},ne=ye=>{ye.stopPropagation(),f.onView&&f.onView(B)};return d.jsxs("div",{className:m,children:[Q&&d.jsx("button",{type:"button",className:"btn p-0 border-0 bg-transparent",title:h.whatsapp??"WhatsApp",onClick:H,style:{width:24,height:24},children:d.jsx("img",{src:_S,alt:"WhatsApp"})}),v&&d.jsx("button",{type:"button",className:"btn p-0 border-0 bg-transparent",title:h.email??"Email",onClick:ee,style:{width:24,height:24},children:d.jsx("img",{src:SS,alt:"Email"})}),j&&d.jsx("button",{type:"button",className:"btn p-0 border-0 bg-transparent",title:h.view??"Ver detalle",onClick:ne,style:{width:24,height:24},children:x})]})}),width:120}},_=Object.values(C).filter(B=>!!B),T=(e??[]).filter(B=>!!B?.key),S=new Map;for(const B of _)S.set(String(B.key),B);for(const B of T)S.set(String(B.key),B);const D=[..._.map(B=>String(B.key)),...T.map(B=>String(B.key))],P=Array.from(new Set(o.map(B=>String(B)).filter(B=>S.has(B)))),A=D.filter(B=>!P.includes(B)),G=[...P,...A],R="acciones";if(S.has(R)){const B=G.filter(Q=>Q!==R);G.splice(0,G.length,...B,R)}return G.map(B=>S.get(B))}function KS(e){const{rows:n,columns:t,clientSort:r=!0,defaultSort:o,minWidth:s=1100,rowKey:i=DS,defaults:a,detailConfig:c,extraSections:l,normalTableColumns:u,normalTable:f,onRowClick:p,activityHistory:g,advisorHistory:m,forceOpenDetailFor:h,closeDetailFor:x,onRequestEdit:C,searchFilter:_,solicitudesNuevos:T,solicitudesPrueba:S,solicitudesServicio:D,solicitudesSeminuevos:P,onCreateSolicitud:A,isCrmMode:G,onSolicitudBaseUrl:R}=e,[B,Q]=y.useState(o??null),[v,j]=y.useState({open:!1,customer:null}),[I,F]=y.useState([]),H=U=>{j({open:!0,customer:U});const ce=c?.vehiclesProvider?.(U)??[];F(Array.isArray(ce)?ce:[])},ee=U=>{p?.(U),j({open:!0,customer:U});const ce=c?.vehiclesProvider?.(U)??[];F(Array.isArray(ce)?ce:[])},ne=()=>{j({open:!1,customer:null}),x?.()},ye=y.useMemo(()=>a?Zf(t??[],a):Zf(t??[],{fields:{},order:[]}),[t,a]),V=y.useMemo(()=>{if(!r||!B)return n;const U=ye.find(ue=>ue.key===B.key);if(!U)return n;const ce=[...n];return ce.sort((ue,ge)=>{const ve=Ya(U,ue,0),pe=Ya(U,ge,0),de=CS(ve,pe);return B.direction==="asc"?de:-de}),ce},[n,ye,B,r]);return y.useEffect(()=>{h&&H(h)},[h]),d.jsxs("div",{children:[d.jsx("div",{className:`${Hf.tableClientes} back-white rounded-3 shadow-main mt-4 mb-4`,children:d.jsx("div",{className:`${Hf.tableResponsive} table-responsive`,children:d.jsxs("table",{className:"table table-hover align-middle mb-0",children:[d.jsx("thead",{children:d.jsx("tr",{children:ye.map(U=>d.jsx("th",{style:{fontWeight:600,width:U.width,paddingTop:"20px",paddingBottom:"20px",textAlign:U.align??"left"},children:U.header},U.key))})}),d.jsx("tbody",{children:V.map((U,ce)=>d.jsx("tr",{onClick:()=>ee?.(U),role:"button",tabIndex:0,onKeyDown:ue=>{(ue.key==="Enter"||ue.key===" ")&&ee?.(U)},style:{cursor:"pointer"},children:ye.map((ue,ge)=>{const ve=ue.Component?d.jsx(ue.Component,{row:U,index:ce}):ue.cell?ue.cell(U,ce):(()=>{const pe=Ya(ue,U,ce);return pe==null||pe===""?"":String(pe)})();return d.jsx("td",{style:{paddingTop:"20px",paddingBottom:"20px",textAlign:ue.align??"left"},children:ve},`${String(ue.key)}-${ge}`)})},i(U,ce)))})]})})}),v.open&&d.jsx(qS,{open:v.open,onClose:ne,customer:v.customer,fields:c?.dynamicFields,header:c?.header,extraSections:l,normalTableColumns:u,normalTable:f,history:g,advisorHistory:m,onRequestEdit:U=>{ne(),C?.(U)},searchFilter:_,solicitudesNuevos:T,solicitudesPrueba:S,solicitudesServicio:D,solicitudesSeminuevos:P,onCreateSolicitud:A,isCrmMode:G,onSolicitudBaseUrl:R})]})}const Gf=se.forwardRef(({sx:e,...n},t)=>d.jsx(b.InputBase,{inputRef:t,...n,sx:{height:48,px:1.5,width:"100%",maxWidth:"none",bgcolor:"#EBEEF0",borderRadius:2,border:"1px solid transparent","&:hover":{borderColor:"transparent"},"& .MuiInputBase-input::placeholder":{opacity:.7},...e}}));Gf.displayName="SoftInput";const QS=it(d.jsx("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"ErrorOutline");function XS({message:e}){return e?d.jsxs(b.Box,{role:"alert",sx:{mt:1,display:"flex",alignItems:"center",gap:1,bgcolor:"#fdeaea",border:"1px solid rgb(253, 237, 237)",color:"#842029",borderRadius:1,px:2,py:1.25},children:[d.jsx(QS,{fontSize:"small",sx:{color:"rgb(211, 47, 47)"}}),d.jsx("span",{style:{color:"rgb(95, 33, 32)",fontSize:14,fontWeight:"500"},children:e})]}):null}function JS(e){if(e.required)return e.required===!0?"El campo es obligatorio.":e.required}function Za(e,n){const t=JS(e);return t?n?.isArray?{required:t,validate:r=>Array.isArray(r)&&r.length>0||t}:{required:t,validate:r=>r!==""&&r!==null&&r!==void 0||t}:{}}const qf={"& .MuiOutlinedInput-root .MuiOutlinedInput-notchedOutline":{borderColor:"transparent"},"& .MuiOutlinedInput-root:hover .MuiOutlinedInput-notchedOutline":{borderColor:"transparent"},"& .MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"transparent"},"& .MuiOutlinedInput-root.Mui-error .MuiOutlinedInput-notchedOutline":{borderColor:"transparent"},width:"100%"},eC={mb:1,fontWeight:600,color:"#1C1C1D","&.Mui-focused":{color:"#1C1C1D !important"},"&.Mui-error":{color:"#1C1C1D !important"}};function Ga({label:e,errorMsg:n,helperText:t,children:r,sx:o}){return d.jsxs(b.FormControl,{fullWidth:!0,error:!!n,sx:o,className:"1- FieldWrapper",children:[d.jsx(b.FormLabel,{sx:eC,children:e}),r,d.jsx(XS,{message:n||t})]})}function tC(e,n){const{register:t,formState:{errors:r}}=n,o={...Za(e)};e.minLength&&(o.minLength={value:e.minLength,message:`El campo espera minimo ${e.minLength} caracteres`}),e.maxLength&&(o.maxLength={value:e.maxLength,message:`El campo espera maximo ${e.maxLength} caracteres`}),e.pattern&&(o.pattern={value:e.pattern,message:"Formato inválido"});const s=e.type==="email";s&&!o.pattern&&(o.pattern={value:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,message:"Correo electrónico inválido"});const i=/[A-Za-zÁÉÍÓÚÜÑáéíóúüñ\s'.-]/g,a=/[0-9]/g,c=new Set(["Backspace","Delete","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Tab","Home","End","Escape","Enter"]),l=S=>e.onlyNumbers?(S.match(a)??[]).join(""):e.onlyLetters?(S.match(i)??[]).join(""):S,u=(S,D)=>c.has(S)||D?!0:e.onlyNumbers?/^[0-9]$/.test(S):e.onlyLetters?/^[A-Za-zÁÉÍÓÚÜÑáéíóúüñ\s'.-]$/.test(S):!0,f=r[e.name]?.message,p=t(e.name,o),g=(e.inputProps&&typeof e.inputProps.maxLength=="number"?e.inputProps.maxLength:void 0)??e.maxLength,m=S=>{u(S.key,S.ctrlKey||S.metaKey)||S.preventDefault()},h=S=>{const D=S.data??null;D!=null&&(e.onlyNumbers&&/[^0-9]/.test(D)&&S.preventDefault(),e.onlyLetters&&/[^A-Za-zÁÉÍÓÚÜÑáéíóúüñ ]/.test(D)&&S.preventDefault())},x=S=>{const D=S.clipboardData.getData("text"),P=l(D);if(P!==D){S.preventDefault();const A=S.target,G=A.selectionStart??A.value.length,R=A.selectionEnd??A.value.length;A.setRangeText(P,G,R,"end"),A.dispatchEvent(new Event("input",{bubbles:!0}))}},C=S=>{const D=l(S.target.value);D!==S.target.value&&(S.target.value=D),g&&S.target.value.length>g&&(S.target.value=S.target.value.slice(0,g)),p.onChange(S)},_={...e.inputProps,...s?{inputMode:"email",autoComplete:"email"}:{},maxLength:g,onKeyDown:m,onBeforeInput:h,onPaste:x,onInvalid:S=>S.preventDefault()},T=e.onlyNumbers||s?"text":e.type??"text";return d.jsx(Ga,{label:e.label,errorMsg:f,helperText:e.helperText,sx:qf,children:d.jsx(Gf,{placeholder:e.placeholder,type:T,inputProps:_,...p,onChange:C,sx:{width:"100%",maxWidth:"none"},className:"SoftInputData"})})}function rC(e,n){const{control:t}=n,r=!!e.multiple;return d.jsx(Ht,{name:e.name,control:t,rules:Za(e,{isArray:r}),render:({field:o,fieldState:s})=>d.jsx(Ga,{label:e.label,errorMsg:s.error?.message,helperText:e.helperText,sx:qf,children:d.jsxs(b.Select,{...o,multiple:r,displayEmpty:!0,sx:{height:48,backgroundColor:"#EBEEF0","& .MuiSelect-select":{display:"flex",alignItems:"center",py:0}},className:"2-SoftInputData",children:[!r&&d.jsx(b.MenuItem,{value:"",disabled:!0,children:"Selecciona…"}),e.options.map(i=>d.jsx(b.MenuItem,{value:i.value,children:i.label},String(i.value)))]})})})}function nC(e,n){return d.jsx(Ht,{name:e.name,control:n.control,rules:Za(e),render:({field:t,fieldState:r})=>d.jsx(Ga,{label:e.label,errorMsg:r.error?.message,helperText:e.helperText,children:d.jsx(b.RadioGroup,{row:!0,...t,className:"3-RadioFieldRender",children:e.options.map(o=>d.jsx(b.FormControlLabel,{value:o.value,control:d.jsx(b.Radio,{}),label:o.label},String(o.value)))})})})}function Kf(e,n){if(e.render)return e.render(n);switch(e.kind){case"text":return tC(e,n);case"select":return rC(e,n);case"radio":return nC(e,n);default:return null}}function oC(e,{initialPerPage:n=25,perPageOptions:t=[10,25,50,100,"Todos"],onPageChange:r,onPerPageChange:o,scrollTop:s,deps:i=[]}={}){const a=Array.isArray(e)?e:[],[c,l]=y.useState(1),[u,f]=y.useState(n),{currentItems:p,totalPages:g,showingFrom:m,showingTo:h,totalItems:x}=y.useMemo(()=>{const T=a.length,S=u==="Todos"?1/0:Number(u),D=S===1/0?1:Math.max(1,Math.ceil(T/S)),P=Math.min(c,D),A=S===1/0?T:P*S,G=S===1/0?0:A-S;return{currentItems:S===1/0?a:a.slice(G,A),totalPages:D,showingFrom:T===0?0:G+1,showingTo:S===1/0?T:Math.min(A,T),totalItems:T}},[a,c,u]),C=T=>{const S=Math.max(1,Math.min(T,g||1));l(S),r?.(S),s?.()};return{currentItems:p,totalPages:g,showingFrom:m,showingTo:h,totalItems:x,currentPage:c,itemsPerPage:u,perPageOptions:t,goTo:C,next:()=>C(c+1),prev:()=>C(c-1),setItemsPerPage:T=>{f(T),o?.(T),l(1),s?.()},setCurrentPage:C}}const sC=it(d.jsx("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"NavigateBefore"),iC=it(d.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"NavigateNext"),aC=({currentPage:e,totalPages:n,onPageChange:t,itemsPerPage:r,onItemsPerPageChange:o,itemsPerPageOptions:s,showingFrom:i,showingTo:a,totalItems:c})=>{const l=b.useTheme(),u=b.useMediaQuery(l.breakpoints.down("sm")),f=()=>{if(n<=1)return[1];const m=u?0:2,h=[],x=1,C=n,_=Math.max(x+1,e-m),T=Math.min(C-1,e+m);h.push(x),_>x+1&&h.push("...");for(let S=_;S<=T;S++)S>=x+1&&S<=C-1&&h.push(S);return T<C-1&&h.push("..."),h.push(C),h},p=m=>{const h=m.target.value;o(h)},g=Math.max(1,n);return d.jsxs(b.Box,{sx:{display:"flex",flexDirection:{xs:"column",sm:"row"},alignItems:"center",justifyContent:{xs:"center",sm:"space-between"},gap:2,my:0,py:2,borderTop:"#D3D4D5 1px solid",px:3},children:[d.jsxs(b.Box,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",justifyContent:"center"},children:[d.jsx(b.IconButton,{onClick:()=>t(e-1),disabled:e<=1,size:"medium",sx:{"&:hover":{backgroundColor:"action.hover"}},"aria-label":"Página anterior",children:d.jsx(sC,{fontSize:"large"})}),f().map((m,h)=>m==="..."?d.jsx(b.Box,{sx:{px:1,display:"flex",alignItems:"center",fontSize:"1.1rem"},children:". . ."},`dots-${h}`):d.jsx(b.Button,{onClick:()=>t(m),size:"small",sx:{minWidth:36,height:36,fontSize:"1.05rem",p:1,borderRadius:"10px",backgroundColor:e===m?"primary.main":"transparent",fontWeight:e===m?700:400,color:e===m?"#fff":"#5C6372","&:hover":{backgroundColor:e===m?"primary.dark":"action.hover"},boxShadow:"none",border:"none",mx:.5},children:m},`p-${m}`)),d.jsx(b.IconButton,{onClick:()=>t(e+1),disabled:e>=g,size:"medium",sx:{"&:hover":{backgroundColor:"action.hover"}},"aria-label":"Página siguiente",children:d.jsx(iC,{fontSize:"large"})})]}),d.jsxs(b.Box,{sx:{display:"flex",alignItems:"center",gap:1.25,justifyContent:{xs:"center",sm:"flex-start"},mt:{xs:1,sm:0}},children:[d.jsx(b.Typography,{variant:"body2",children:"Mostrar"}),d.jsx(b.FormControl,{size:"small",sx:{minWidth:72},children:d.jsx(b.Select,{value:r,onChange:p,renderValue:m=>m==="Todos"?"Todos":String(m),children:s.map(m=>d.jsx(b.MenuItem,{value:m,children:m==="Todos"?"Todos":m},String(m)))})}),d.jsx(b.Typography,{variant:"body2",children:"por página"})]})]})};function cC(e){const{open:n,dataAdd:t,fields:r,onSubmit:o,onCancel:s,defaultValues:i,txtBtnGuardar:a,haveId:c=!1,itemsTable:l,filter:u,getId:f,renderRow:p,selectedIds:g,onSelectedChange:m,onSubmitAddData:h,initialSelectedIds:x=[],showAutosPanel:C}=e,_=Fd({mode:"onSubmit",reValidateMode:"onChange",criteriaMode:"all",shouldUnregister:!1,defaultValues:i});y.useEffect(()=>{i&&_.reset(i)},[i,_]);const[T,S]=y.useState(""),[D,P]=y.useState(x),A=Array.isArray(g)&&!!m,G=A?g:D,R=O=>{const X=typeof O=="function"?O(G):O;A?m(X):P(X)},B=y.useCallback(O=>f?f(O):O?.IdAuto,[f]),Q=y.useMemo(()=>{const O=new Map;return(l??[]).forEach((X,me)=>O.set(B(X),me)),O},[l,B]),v=y.useRef(new Set),j=y.useMemo(()=>{const O=new Map;return(l??[]).forEach(X=>O.set(f?f(X):X?.IdAuto,X)),O},[l,f]),I=y.useMemo(()=>(r??[]).filter(O=>!!O.required).map(O=>O.name),[r]),F=Sd({control:_.control,name:I}),H=O=>O==null?!1:typeof O=="string"?O.trim().length>0:Array.isArray(O)?O.length>0:typeof O=="number"?!Number.isNaN(O):typeof O=="object"?Object.keys(O).length>0:!0,ee=y.useMemo(()=>I.length?F?.every(H)??!1:!0,[F,I]),{handleSubmit:ne,formState:{isSubmitting:ye,isDirty:V,isValid:U}}=_,ce=u??((O,X)=>JSON.stringify(O).toLowerCase().includes(X.toLowerCase())),ue=y.useMemo(()=>T.trim()?l?.filter(O=>ce(O,T)):l,[l,T,ce]),ge=y.useMemo(()=>{if(!ue)return ue;const O=v.current,X=[...ue];return X.sort((me,Ae)=>{const $=O.has(B(me))?0:1,J=O.has(B(Ae))?0:1;if($!==J)return $-J;const be=Q.get(B(me))??0,qe=Q.get(B(Ae))??0;return be-qe}),X},[ue,Q,B]),{currentItems:ve,totalPages:pe,showingFrom:de,showingTo:_e,totalItems:De,currentPage:xe,itemsPerPage:Ge,perPageOptions:N,goTo:W,setItemsPerPage:he}=oC(ge,{initialPerPage:25,perPageOptions:[10,25,50,100,"Todos"],deps:[T],scrollTop:()=>{}}),fe=O=>{const X=j.get(O)??null;R([O]),h?.({items:X})},Ee=O=>G.includes(O),_t=async O=>{try{await o?.(O),_.reset(_.getValues())}catch(X){console.error("Error al enviar AddCliente:",X)}},nt=y.useMemo(()=>{const O=new Map;return(r??[]).forEach(X=>O.set(String(X.name),X)),O},[r]),ct=(O,X)=>{const me=nt.get(String(O));if(!me)return null;const Ae={xs:12,...me.grid,...X||{}};return d.jsx(b.Grid,{item:!0,...Ae,children:me.render?me.render(_):Kf(me,_)},`fld-${String(O)}`)},E=C??(e.haveId?"edit":"new"),M=E!=="onlyCars",z=E==="new"||E==="onlyCars",oe=G?.length>0,re=E==="onlyCars"?oe:e.haveId?ee&&V||oe:ee&&oe;return d.jsx(b.Dialog,{open:n,onClose:s,maxWidth:"lg",fullWidth:!0,PaperProps:{sx:{height:{xs:"100dvh",md:z?"90vw":"auto"},maxWidth:{xs:"100vw",md:z?"98vw":"50%"},overflow:"hidden",display:"flex",flexDirection:"column",borderRadius:{xs:0,md:3}}},children:d.jsx(g1,{..._,children:d.jsxs(b.Box,{component:"form",noValidate:!0,onSubmit:ne(_t),display:"flex",flexDirection:{xs:"column",md:"row"},width:"100%",height:"100%",overflow:{xs:"auto",md:"unset"},position:"relative",children:[M&&d.jsxs(b.Box,{sx:{width:{xs:"100%",md:c?"100%":394},maxWidth:{xs:"100%",md:c?"100%":394},boxShadow:{xs:"none",md:c?"none":"2px 0px 8px #40404024"},borderRight:{xs:"none",md:c?"none":"1px solid #EBEEF0"},bgcolor:"background.paper",paddingBottom:3,mx:{xs:0,md:c?"auto":0},position:"relative"},children:[d.jsxs(b.Box,{p:{xs:2,md:2},height:"100%",width:"100%",children:[d.jsx(b.Typography,{fontWeight:700,fontSize:20,children:t.title}),d.jsxs(b.Box,{sx:{flex:1,height:"100%",overflowY:"auto",paddingBottom:10},children:[d.jsx(b.Typography,{fontSize:"18px",mt:2.5,fontWeight:500,children:t.subTitle}),d.jsx(b.Box,{mt:2,display:"flex",flexDirection:"column",width:"100%",gap:2,children:Array.isArray(e.formLayout)&&c?e.formLayout.map((O,X)=>d.jsx(b.Grid,{container:!0,spacing:2,alignItems:"flex-start",wrap:"wrap",width:"100%",children:O.map((me,Ae)=>{const $=typeof me=="string"?{name:me}:me;return $.hidden?.(_)?null:ct($.name,$.grid)})},`row-${X}`)):d.jsx(b.Grid,{container:!0,spacing:2,width:"100%",children:r?.map((O,X)=>{const me=O.grid??{xs:12,md:12};return d.jsx(b.Grid,{item:!0,...me,children:O.render?O.render(_):Kf(O,_)},`${String(O.name)}-${X}`)})})})]})]}),d.jsx(b.Box,{sx:{position:"absolute",zIndex:O=>O.zIndex.modal+1,bottom:0,width:"100%",borderRadius:2,boxShadow:{xs:"0",md:"0 -8px 8px -6px #0003"},p:1,backgroundColor:"#fff"},children:d.jsx(b.Box,{display:"flex",alignItems:"center",children:d.jsx(b.Box,{display:"flex",gap:1.5,width:"100%",justifyContent:c?"flex-end":"center",children:d.jsx(b.Button,{type:"submit",variant:"contained",disabled:ye||!re,sx:{backgroundColor:"#336BE1",color:"#fff",borderColor:"transparent",height:48,fontSize:15,textTransform:"none",fontWeight:"400",paddingX:5,width:c?"160px":"100%"},children:a})})})})]}),z&&d.jsx(b.Box,{flex:1,display:"flex",flexDirection:"column",minWidth:0,sx:{height:"100%"},children:d.jsx(b.Box,{mt:1,sx:{flex:1,display:"flex",flexDirection:"column",height:"100%"},children:d.jsxs(b.Box,{sx:{display:"flex",flexDirection:"column",flex:1,minHeight:0},children:[d.jsxs(b.Box,{p:3,sx:{borderBottom:1,borderBottomColor:"#D3D4D5",position:"sticky",top:0,zIndex:1,bgcolor:"#fff",flexDirection:{sm:"row",xs:"column"}},display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingTop:4,children:[d.jsx(b.TextField,{value:T,onChange:O=>S(O.target.value),placeholder:"Buscar marca, modelo, vin...",InputProps:{endAdornment:d.jsx(b.InputAdornment,{position:"start",children:d.jsx(ry,{})}),disableUnderline:!0},variant:"standard",sx:{maxWidth:360,width:"100%",backgroundColor:"#EBEEF0",paddingX:"16px",paddingY:"10px"}}),d.jsx(b.Box,{display:"flex",gap:2,alignItems:"center",sx:{marginTop:{sm:0,xs:2}},children:d.jsx(b.Box,{onClick:s,sx:{cursor:"pointer",position:"absolute",top:0,right:10},display:{xs:"none",md:"block"},children:d.jsx(sn,{sx:{color:"#070C10",fontSize:24}})})}),C=="onlyCars"&&d.jsx(b.Box,{display:"flex",alignItems:"center",justifyContent:"center",children:d.jsx(b.Box,{display:"flex",gap:1.5,width:"100%",children:d.jsxs(b.Button,{type:"submit",variant:"contained",disabled:ye||!re,sx:{backgroundColor:"#336BE1",color:"#fff",borderColor:"transparent",height:48,fontSize:15,textTransform:"none",fontWeight:"400",paddingX:5,width:"100%"},children:[d.jsx(Uf,{sx:{color:ye||!re?"gray":"#fff",fontSize:26,paddingRight:.6}}),"Crear Solicitud"]})})})]}),d.jsx(b.Box,{sx:{flex:1,minHeight:0,overflowY:"auto",overflowX:"auto",padding:0,height:"100%","&::-webkit-scrollbar:horizontal":{display:"none"},"&::-webkit-scrollbar:vertical":{width:8}},children:d.jsx(b.Box,{sx:{minWidth:1150,width:"max(1150px, 100%)",paddingBottom:10},children:d.jsxs(b.List,{disablePadding:!0,sx:{borderColor:"transparent",padding:0},children:[ve?.map((O,X)=>{const me=f?f(O):X,Ae=Ee(me);return d.jsx(b.Box,{sx:{borderBottom:"1px solid #D3D4D5",padding:0},children:d.jsx(b.ListItem,{disableGutters:!0,sx:{paddingTop:0,padding:0,m:0},children:d.jsx(b.ListItemButton,{onClick:()=>fe(me),disableRipple:!0,sx:{padding:0},children:d.jsx(b.ListItemText,{disableTypography:!0,primary:p?p({item:O,selected:Ae,toggle:()=>fe(me),index:X}):null})})})},`${String(me)}`)}),!ve?.length&&d.jsx(b.Box,{p:3,children:d.jsxs(b.Typography,{fontSize:14,color:"#5C6372",children:["Sin resultados para “",T,"”."]})})]})})}),d.jsx(b.Box,{sx:{position:"sticky",bottom:0,bgcolor:"#fff"},children:d.jsx(aC,{currentPage:xe,totalPages:pe,onPageChange:W,itemsPerPage:Ge,onItemsPerPageChange:he,itemsPerPageOptions:N,showingFrom:de,showingTo:_e,totalItems:De})})]})})})]})})})}const lC=it(d.jsx("path",{d:"M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12 2.5-2.5V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6z"}),"AttachFile"),qa=/^[^\s@]+@[^\s@]+\.[^\s@]+$/i,si=/[,\s;]+/g,Fr=e=>e.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase(),Vr=(e,n)=>Array.from(new Set([...e,...n.map(t=>t.trim()).filter(Boolean)])),Qf=(e,n)=>n?e.filter(t=>Fr(t)!==Fr(n)):e,uC=(e,n)=>e.filter(t=>!n.some(r=>Fr(r)===Fr(t)));function cr(e,n,t){if(t)return typeof t=="function"?t(e,n):e[t]}function dC(e,n){if(n)return!e||/^https?:\/\//i.test(n)?n:e+n}function fC({open:e,onClose:n,value:t,onChange:r,onRequestSend:o,customer:s,itemsSelects:i,renderItem:a,filterFields:c=[],multiSelectAutos:l=!0,imgCorreoSrc:u,baseURLImages:f,itemProps:p,defaultItemImageSrc:g}){const m=y.useRef(null),[h,x]=y.useState("idle"),C=y.useRef(e);y.useEffect(()=>{const $=C.current;e&&!$&&x("entering"),!e&&$&&x("exiting"),C.current=e},[e]),y.useEffect(()=>{if(h==="entering"){const be=setTimeout(()=>x("idle"),320);return()=>clearTimeout(be)}if(h==="exiting"){const be=setTimeout(()=>x("idle"),220);return()=>clearTimeout(be)}},[h]);const[_,T]=y.useState(""),[S,D]=y.useState(!1),[P,A]=y.useState(!1),[G,R]=y.useState(!1),[B,Q]=y.useState(""),[v,j]=y.useState([]),I=G?v:t.selectedIds,F=()=>{j([...t.selectedIds]),Q(""),R(!0)},H=()=>{R(!1),j([])},ee=()=>{const $=new Set(nt.map((be,qe)=>String(cr(be,qe,p.id)))),J=v.filter(be=>$.has(String(be)));r({...t,selectedIds:J}),R(!1)},ne=($,J)=>Fr($??"")===Fr(J??"");function ye($,J,be,qe,St){const Ct=J?$.some(lr=>ne(lr,J)):!1,Ar=be.length>0?be.some(lr=>$.some(Mr=>ne(Mr,lr))):!1;qe(Ct),St(Ar)}const V=$=>{const J=typeof $=="function"?$(t.recipients):$;r({...t,recipients:J}),ye(J,ve,de,D,A)},U=$=>r({...t,message:$}),ce=$=>r({...t,attachments:[...t.attachments,...$]}),ue=$=>r({...t,attachments:t.attachments.filter(J=>J.name!==$)}),ge=$=>{if(G)if(l){const J=new Set(v);J.has($)?J.delete($):J.add($),j(Array.from(J))}else{const J=v.includes($);j(J?[]:[$])}else if(l){const J=new Set(t.selectedIds);J.has($)?J.delete($):J.add($),r({...t,selectedIds:Array.from(J)})}else{const J=t.selectedIds.includes($);r({...t,selectedIds:J?[]:[$]})}},ve=y.useMemo(()=>(s?.Correo??"").trim(),[s]),pe=y.useMemo(()=>Array.isArray(s?.Asesores)?s.Asesores.filter($=>$?.EmailAsesor&&$?.Activo):[],[s]),de=y.useMemo(()=>pe.map($=>($.EmailAsesor??"").trim()).filter(Boolean),[pe]),_e=y.useRef(!1);y.useEffect(()=>{if(e&&!_e.current){let $=[];S&&ve&&($=Vr($,[ve])),P&&de.length&&($=Vr($,de)),V(J=>Vr(J,$)),ye(t.recipients,ve,de,D,A),T(""),_e.current=!0}e||(_e.current=!1)},[e,S,P,ve,de]);const De=$=>{const J=pe.find(be=>Fr(be.EmailAsesor??"")===Fr($));if(J){if(J.ImgAsesor)return d.jsx(b.Avatar,{src:J.ImgAsesor,alt:J.NombreAsesor});const be=(J.NombreAsesor||"").trim(),qe=(J.ApellidosAsesor||"").trim();return d.jsx(b.Avatar,{children:`${be[0]??""}${qe[0]??""}`.toUpperCase()})}return d.jsx(b.Avatar,{children:$[0]?.toUpperCase()})},xe=()=>{const $=_.trim();if(!$)return;const be=$.split(si).filter(Boolean).filter(qe=>qa.test(qe));be.length>0&&V(qe=>Vr(qe,be)),T("")},Ge=$=>{D($),V(J=>$&&ve?Vr(J,[ve]):Qf(J,ve))},N=$=>{A($),V(J=>$?Vr(J,de):uC(J,de))},W=$=>{const J=Array.from($.target.files||[]);ce(J.map(be=>({name:be.name,size:be.size,file:be}))),$.target.value=""},he=I[0],fe=y.useMemo(()=>!i||he===void 0?void 0:i.find((J,be)=>String(cr(J,be,p.id))===String(he)),[i,he,p.id]),Ee=y.useMemo(()=>{if(!(!fe||!p.distributorId))return cr(fe,0,p.distributorId)},[fe,p.distributorId]);console.log("lockedDisId",Ee);const _t=y.useMemo(()=>fe?(p.distributorTitle?cr(fe,0,p.distributorTitle):void 0)??(Ee!=null?String(Ee):void 0):void 0,[fe,p.distributorTitle,Ee]),nt=y.useMemo(()=>{const $=i??[];return Ee==null||!p.distributorId?$:$.filter((J,be)=>cr(J,be,p.distributorId)==Ee)},[i,Ee,p.distributorId]),ct=y.useMemo(()=>{if(!B.trim())return nt;const $=B.toLowerCase();return nt.filter(J=>(c??[]).some(be=>String(J?.[be]??"").toLowerCase().includes($)))},[nt,B,c]),E=y.useMemo(()=>{if(!i||!t.selectedIds.length)return[];const $=new Map;return i.forEach((J,be)=>{$.set(String(cr(J,be,p.id)),J)}),t.selectedIds.map(J=>$.get(String(J))).filter(Boolean)},[i,t.selectedIds,p.id]),M=$=>r({...t,selectedIds:t.selectedIds.filter(J=>String(J)!==String($))}),z=()=>{let $=t.recipients;if(_.trim()){const Ct=_.split(si).filter(Ar=>qa.test(Ar));$=Vr($,Ct),V($),T("")}const J=S?ve:"",be=pe.find(Ct=>Ct?.Activo&&Ct?.EmailAsesor)?.EmailAsesor?.trim()??"";o?.({recipients:$,toClient:S,toAdvisor:P,tipoInt:S&&P?2:1,correoCliente:J,correoAsesor:P?be:"",disIdLocked:Ee}),n?.()},oe=y.useMemo(()=>{const J=_.split(si).filter(Boolean).some(be=>qa.test(be));return t.recipients.length>0||J},[t.recipients,_]),re=(t.selectedIds?.length??0)>0,O=t.message.trim().length>0,X=oe&&re&&O,me=b.useTheme(),Ae=b.useMediaQuery(me.breakpoints.down("sm"));return d.jsxs(b.Drawer,{anchor:Ae?"bottom":"right",open:e,onClose:n,ModalProps:{keepMounted:!0,BackdropProps:{invisible:!Ae}},transitionDuration:{enter:320,exit:220},SlideProps:{direction:Ae?"up":"left",timeout:{enter:320,exit:220},easing:{enter:"cubic-bezier(0.22, 1, 0.36, 1)",exit:"cubic-bezier(0.4, 0, 1, 1)"}},PaperProps:{sx:{width:{xs:"100vw",sm:420},height:{xs:"85vh",sm:"auto"},maxHeight:{xs:"85vh",sm:"calc(100vh - 32px)"},left:{xs:0,sm:"auto"},right:{xs:0,sm:16},bottom:{xs:0,sm:16},top:{xs:"auto",sm:"auto"},borderRadius:{xs:"12px 12px 0 0",sm:2},boxShadow:6,overflow:"hidden"}},children:[d.jsxs(b.Box,{sx:{display:"flex",flexDirection:"column",height:{xs:"100%",sm:"auto"},position:"relative",overflow:"auto"},children:[d.jsxs(b.Box,{sx:{p:2,pb:1,position:"sticky",top:0,zIndex:1,bgcolor:"#fff",borderBottom:"1px solid #E5E7EB"},children:[d.jsxs(b.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:1},children:[d.jsxs(b.Box,{sx:{display:"flex",alignItems:"center",gap:2},children:[u?d.jsx("img",{src:u,alt:"Correo",style:{width:24,height:18}}):null,d.jsxs(b.Typography,{fontWeight:700,children:["Mensaje a"," ",s?`${s.Nombre??""} ${s.ApellidoP??""} ${s.ApellidoM??""}`.trim():"—"]})]}),d.jsx(b.IconButton,{onClick:n,size:"small",children:d.jsx(sn,{})})]}),d.jsx("div",{children:d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"10px 10px",backgroundColor:"#EBEEF0",border:"1px solid #E5E7EB",borderRadius:8,flexWrap:"wrap"},children:[d.jsx("label",{style:{fontSize:14,fontWeight:600,marginRight:4},children:"Para:"}),d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap",flex:1},children:[t.recipients.map($=>d.jsx(b.Chip,{avatar:De($),label:$,onDelete:()=>V(J=>Qf(J,$)),size:"small",variant:"outlined",sx:{borderRadius:999,height:28}},$)),d.jsx("input",{type:"text",value:_,onChange:$=>T($.target.value),onKeyDown:$=>{const J=$.key;J==="Enter"||J===","||J===";"||J===" "||J==="Tab"?($.preventDefault(),xe()):J==="Backspace"&&!_&&t.recipients.length&&V(qe=>qe.slice(0,-1))},onBlur:xe,onPaste:$=>{const be=$.clipboardData.getData("text").split(si).filter(Boolean);be.length>1&&($.preventDefault(),V(qe=>Vr(qe,be)),T(""))},placeholder:t.recipients.length?"":"correo@ejemplo.com",style:{flex:1,minWidth:140,border:"none",outline:"none",background:"transparent",fontSize:14,color:"#111827",padding:"4px 0"}})]})]})}),d.jsxs(b.Box,{sx:{display:"flex",alignItems:"center",gap:2,mb:1.5},children:[d.jsx(b.FormControlLabel,{control:d.jsx(b.Checkbox,{checked:S,onChange:$=>Ge($.target.checked),size:"small"}),label:"Cliente"}),pe.length!==0&&d.jsx(b.FormControlLabel,{control:d.jsx(b.Checkbox,{checked:P,onChange:$=>N($.target.checked),size:"small"}),label:`Asesor${pe.length>1?"es":""}`})]})]}),d.jsx(b.Divider,{}),d.jsxs(b.Box,{p:2,children:[d.jsxs(b.Box,{sx:{display:"flex",alignItems:"center",gap:1},onClick:F,children:[d.jsx(b.Typography,{fontSize:12,fontWeight:600,sx:{textDecorationLine:"underline",cursor:"pointer"},children:"Selecciona el auto de seguimiento"}),_t!=null&&d.jsx(b.Chip,{size:"small",label:`Distribuidora: ${_t}`})]}),E.length>0?d.jsx(b.Box,{sx:{mt:1.5,display:"flex",gap:1,flexWrap:"wrap"},children:E.map(($,J)=>{const be=cr($,J,p.id),qe=cr($,J,p.title)??"",St=cr($,J,p.image),Ct=dC(f,St);return d.jsx(b.Chip,{onDelete:()=>M(be),label:d.jsxs(b.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[d.jsx(b.Box,{sx:{width:28,height:20,borderRadius:.8,bgcolor:"#e5e6e8",overflow:"hidden",flex:"0 0 auto"},children:Ct?d.jsx("img",{src:Ct,alt:qe,style:{width:"100%",height:"100%",objectFit:"cover"}}):d.jsx("img",{src:g,alt:qe,style:{width:"100%",height:"100%",objectFit:"cover"}})}),d.jsx("span",{style:{fontSize:12},children:d.jsx("b",{children:qe})})]}),sx:{pl:.5,pr:.3,py:.2,borderRadius:2,".MuiChip-deleteIcon":{fontSize:18}},variant:"outlined"},String(be))})}):d.jsx(b.Typography,{fontSize:13,color:"#5C6372",sx:{mt:.5},children:"Aún no has seleccionado autos."})]}),d.jsx(b.Divider,{}),d.jsxs(b.Box,{sx:{p:2},children:[d.jsx(b.TextField,{placeholder:"Escribe aquí tu mensaje...",value:t.message,onChange:$=>U($.target.value),multiline:!0,minRows:6,fullWidth:!0,sx:{mb:1.5}}),t.attachments.length>0&&d.jsx(b.List,{dense:!0,sx:{display:"flex",flexDirection:"column",gap:2,border:"none"},children:t.attachments.map($=>d.jsxs(b.ListItem,{sx:{px:0,background:"#EAEBF2",borderRadius:2,paddingX:1},children:[d.jsx(b.ListItemText,{style:{gap:10,fontSize:15,color:"#5285F7",display:"flex",flexWrap:"wrap",flex:"none"},primary:$.name,secondary:$.size<1024?`${$.size} b`:$.size<1024*1024?`${($.size/1024).toFixed(0)} kb`:`${($.size/(1024*1024)).toFixed(1)} MB`,secondaryTypographyProps:{sx:{fontSize:12,color:"#64748B",fontWeight:500,mt:.25}},primaryTypographyProps:{noWrap:!0,width:"auto"}}),d.jsx(b.Tooltip,{title:"Quitar",children:d.jsx(b.IconButton,{edge:"end",onClick:()=>ue($.name),size:"small",children:d.jsx(sn,{fontSize:"small"})})})]},$.name))})]}),d.jsxs(b.Box,{sx:{position:{xs:"sticky",sm:"sticky"},bottom:0,bgcolor:"#fff",borderTop:"1px solid #E5E7EB",p:2,display:"flex",alignItems:"center",gap:2},children:[d.jsx("input",{ref:m,hidden:!0,type:"file",multiple:!0,accept:".jpg,.jpeg,.png,.mp4,.pdf,.xlsx,.csv,.docx,.pptx,.txt",onChange:W}),d.jsx(b.Button,{startIcon:d.jsx(lC,{}),variant:"text",onClick:()=>m.current?.click(),sx:{color:"#5C6372"},children:"Adjuntar archivo"}),d.jsx(b.Box,{sx:{flex:1}}),d.jsx(b.Button,{variant:"contained",onClick:z,disabled:!X,sx:{maxWidth:146,width:"100%",height:53,backgroundColor:"#336BE1"},children:"Enviar"})]})]}),d.jsxs(b.Dialog,{fullWidth:!0,maxWidth:"sm",fullScreen:Ae,open:G,onClose:H,children:[d.jsxs(b.DialogTitle,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:1},children:["Selecciona tu auto de seguimiento",d.jsx(b.IconButton,{onClick:H,size:"small",children:d.jsx(sn,{})})]}),d.jsxs(b.DialogContent,{children:[d.jsxs(b.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[d.jsx(b.TextField,{placeholder:"Buscar...",fullWidth:!0,size:"small",value:B,onChange:$=>Q($.target.value),sx:{mb:2}}),_t!=null&&d.jsx(b.Chip,{size:"small",label:`Distribuidora: ${_t}`})]}),d.jsxs(b.Typography,{variant:"caption",fontWeight:600,children:["RESULTADOS (",ct.length,")"]}),d.jsxs(b.List,{sx:{p:0},children:[ct.map(($,J)=>{const be=cr($,J,p.id),qe=I.includes(String(be))||I.includes(be),St=Ee==null||cr($,J,p.distributorId)==Ee;return d.jsx(b.ListItem,{disableGutters:!0,sx:{p:0,opacity:St?1:.5},children:d.jsx(b.Box,{onClick:()=>St&&ge(be),sx:{cursor:St?"pointer":"not-allowed",p:.5,backgroundColor:qe?"#e5f0ff":"transparent",width:"100%",borderBottom:"solid 1px #D3D4D5"},children:a?a($,J):d.jsx("pre",{style:{margin:0},children:JSON.stringify($,null,2)})})},String(be))}),ct.length===0&&d.jsx(b.Box,{p:2,children:d.jsx(b.Typography,{children:"Tu búsqueda no generó resultados"})})]})]}),d.jsxs(b.DialogActions,{sx:{px:3,pb:2},children:[d.jsx(b.Button,{variant:"text",onClick:H,sx:{color:"#5C6372"},children:"Cancelar"}),d.jsx(b.Button,{variant:"contained",onClick:ee,sx:{backgroundColor:"#336BE1"},children:"Guardar selección"})]})]})]})}lt.AddCliente=cC,lt.ApiProvider=e1,lt.AuthProvider=Ay,lt.Clientes=KS,lt.CustomSnackbar=Ff,lt.EventsProvider=vS,lt.ModalCorreo=fC,lt.MyCalendar=wS,lt.useAuth=na,lt.useAuthRepository=Ls,lt.useEventRepository=va,Object.defineProperty(lt,Symbol.toStringTag,{value:"Module"})}));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "componentes-exagono",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.85",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.umd.js",
|
|
7
7
|
"module": "./dist/index.es.js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"react": "^18.2.0",
|
|
29
29
|
"react-dom": "^18.2.0",
|
|
30
|
-
"@mui/material": "^5.0.0",
|
|
30
|
+
"@mui/material": "^5.0.0",
|
|
31
31
|
"@mui/icons-material": "^5.0.0",
|
|
32
32
|
"@emotion/react": "^11.0.0",
|
|
33
33
|
"@emotion/styled": "^11.0.0",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"zod": "^4.1.0"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
|
|
55
|
+
"@mui/material": "^5.0.0",
|
|
56
56
|
"@mui/icons-material": "^5.0.0",
|
|
57
57
|
"@emotion/react": "^11.0.0",
|
|
58
58
|
"@emotion/styled": "^11.0.0",
|