diff --git a/client/package.json b/client/package.json index 1c28a5e..39dd471 100644 --- a/client/package.json +++ b/client/package.json @@ -1,7 +1,7 @@ { "name": "@uecko-presupuestador/client", "private": true, - "version": "1.1.7", + "version": "1.1.8", "author": "Rodax Software ", "type": "module", "scripts": { diff --git a/dist/client/assets/index-qquRaZ4m.js b/dist/client/assets/index-CCfX-UYJ.js similarity index 93% rename from dist/client/assets/index-qquRaZ4m.js rename to dist/client/assets/index-CCfX-UYJ.js index dff7b37..ab11f4b 100644 --- a/dist/client/assets/index-qquRaZ4m.js +++ b/dist/client/assets/index-CCfX-UYJ.js @@ -1,4 +1,4 @@ -var k_=Object.defineProperty;var q_=(n,a,r)=>a in n?k_(n,a,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[a]=r;var Se=(n,a,r)=>q_(n,typeof a!="symbol"?a+"":a,r);import{u as Fc,a as Jt,b as en,c as Mn,d as Ne,j as i,P as $_,e as z_,f as he,g as B_,N as Wi,R as Pe,J as Nt,h as ke,i as Jn,D as er,l as Aa,M as Tt,V as V_,r as M,k as Mc,m as Dc,n as rr,o as Tc,B as G,C as U_,p as ir,q as sr,s as ar,S as no,t as or,v as Vi,w,x as ro,y as Yi,z as Qi,A as Xi,E as Lr,F as io,G as so,H as ao,I as oo,K as lo,L as G_,O as Or,Q as H_,T as K_,U as W_,W as Le,X as pt,Y as Ge,Z as Ze,_ as Oe,$ as hn,a0 as uo,a1 as Y_,a2 as co,a3 as pn,a4 as fo,a5 as go,a6 as qr,a7 as Dt,a8 as Lc,a9 as Q_,aa as Ui,ab as lr,ac as mo,ad as ho,ae as po,af as xo,ag as Oc,ah as vo,ai as _o,aj as bo,ak as Zi,al as X_,am as Z_,an as J_,ao as gc,ap as e0,aq as t0,ar as mc,as as hc,at as Ia,au as n0,av as r0,aw as In,ax as pc,ay as i0,az as s0,aA as a0,aB as wo,aC as zt,aD as _n,aE as Ji,aF as Pc,aG as Fn,aH as o0,aI as kc,aJ as l0,aK as le,aL as es,aM as xc,aN as qc,aO as $c,aP as zc,aQ as Dn,aR as Bc,aS as ts,aT as zr,aU as Br,aV as Vr,aW as $r,aX as u0,aY as Vc,aZ as He,a_ as Ke,a$ as Ua,b0 as We,b1 as tr,b2 as ur,b3 as nr,b4 as c0,b5 as d0,b6 as f0,b7 as Ga,b8 as g0,b9 as m0,ba as Xn,bb as Uc,bc as Ha,bd as Gc,be as qt,bf as h0,bg as vc,bh as ns,bi as cr,bj as Hc,bk as p0,bl as So,bm as x0,bn as Kc,bo as Wc,bp as Yc,bq as Qc,br as Xc,bs as Zc,bt as Jc,bu as ed,bv as td,bw as v0,bx as Pi,by as _0,bz as b0,bA as w0,bB as S0,bC as j0,bD as C0,bE as y0,bF as N0,bG as R0,bH as E0,bI as A0,bJ as _c,bK as nd,bL as rd,bM as id,bN as sd,bO as ad,bP as od,bQ as ld,bR as I0,bS as Fa,bT as F0,bU as M0,bV as D0,bW as ud,bX as cd,bY as Ka,bZ as Wa,b_ as T0,b$ as Ma,c0 as L0,c1 as O0,c2 as P0}from"./index-vq9AFyzk.js";const k0=n=>{const{onSuccess:a,...r}=n||{},o=Mn(),{login:l}=Fc(),c=Jt();return en({mutationKey:o().auth().action("login").get(),mutationFn:l,onSuccess:async(d,h,p)=>{d.success&&c.removeQueries({queryKey:o().auth().get()}),await(a==null?void 0:a(d,h,p))},...r})};/** +var k_=Object.defineProperty;var q_=(n,a,r)=>a in n?k_(n,a,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[a]=r;var Se=(n,a,r)=>q_(n,typeof a!="symbol"?a+"":a,r);import{u as Fc,a as Jt,b as en,c as Mn,d as Ne,j as i,P as $_,e as z_,f as he,g as B_,N as Wi,R as Pe,J as Nt,h as ke,i as Jn,D as er,l as Aa,M as Tt,V as V_,r as M,k as Mc,m as Dc,n as rr,o as Tc,B as G,C as U_,p as ir,q as sr,s as ar,S as no,t as or,v as Vi,w,x as ro,y as Yi,z as Qi,A as Xi,E as Lr,F as io,G as so,H as ao,I as oo,K as lo,L as G_,O as Or,Q as H_,T as K_,U as W_,W as Le,X as pt,Y as Ge,Z as Ze,_ as Oe,$ as hn,a0 as uo,a1 as Y_,a2 as co,a3 as pn,a4 as fo,a5 as go,a6 as qr,a7 as Dt,a8 as Lc,a9 as Q_,aa as Ui,ab as lr,ac as mo,ad as ho,ae as po,af as xo,ag as Oc,ah as vo,ai as _o,aj as bo,ak as Zi,al as X_,am as Z_,an as J_,ao as gc,ap as e0,aq as t0,ar as mc,as as hc,at as Ia,au as n0,av as r0,aw as In,ax as pc,ay as i0,az as s0,aA as a0,aB as wo,aC as zt,aD as _n,aE as Ji,aF as Pc,aG as Fn,aH as o0,aI as kc,aJ as l0,aK as le,aL as es,aM as xc,aN as qc,aO as $c,aP as zc,aQ as Dn,aR as Bc,aS as ts,aT as zr,aU as Br,aV as Vr,aW as $r,aX as u0,aY as Vc,aZ as He,a_ as Ke,a$ as Ua,b0 as We,b1 as tr,b2 as ur,b3 as nr,b4 as c0,b5 as d0,b6 as f0,b7 as Ga,b8 as g0,b9 as m0,ba as Xn,bb as Uc,bc as Ha,bd as Gc,be as qt,bf as h0,bg as vc,bh as ns,bi as cr,bj as Hc,bk as p0,bl as So,bm as x0,bn as Kc,bo as Wc,bp as Yc,bq as Qc,br as Xc,bs as Zc,bt as Jc,bu as ed,bv as td,bw as v0,bx as Pi,by as _0,bz as b0,bA as w0,bB as S0,bC as j0,bD as C0,bE as y0,bF as N0,bG as R0,bH as E0,bI as A0,bJ as _c,bK as nd,bL as rd,bM as id,bN as sd,bO as ad,bP as od,bQ as ld,bR as I0,bS as Fa,bT as F0,bU as M0,bV as D0,bW as ud,bX as cd,bY as Ka,bZ as Wa,b_ as T0,b$ as Ma,c0 as L0,c1 as O0,c2 as P0}from"./index-CJmQk4ZY.js";const k0=n=>{const{onSuccess:a,...r}=n||{},o=Mn(),{login:l}=Fc(),c=Jt();return en({mutationKey:o().auth().action("login").get(),mutationFn:l,onSuccess:async(d,h,p)=>{d.success&&c.removeQueries({queryKey:o().auth().get()}),await(a==null?void 0:a(d,h,p))},...r})};/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. @@ -144,7 +144,7 @@ var k_=Object.defineProperty;var q_=(n,a,r)=>a in n?k_(n,a,{enumerable:!0,config * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Gi(n,a){return n?nw(n)?M.createElement(n,a):n:null}function nw(n){return rw(n)||typeof n=="function"||iw(n)}function rw(n){return typeof n=="function"&&(()=>{const a=Object.getPrototypeOf(n);return a.prototype&&a.prototype.isReactComponent})()}function iw(n){return typeof n=="object"&&typeof n.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(n.$$typeof.description)}function Dd(n){const a={state:{},onStateChange:()=>{},renderFallbackValue:null,...n},[r]=M.useState(()=>({current:Yb(a)})),[o,l]=M.useState(()=>r.current.initialState);return r.current.setOptions(c=>({...c,...n,state:{...o,...n.state},onStateChange:d=>{l(d),n.onStateChange==null||n.onStateChange(d)}})),r.current}const sw=({buttonText:n,title:a="",content:r,className:o=""})=>i.jsx("div",{className:`flex items-baseline justify-center mr-4 font-medium ${o}`,children:i.jsxs(rr,{children:[i.jsx(Tc,{asChild:!0,children:i.jsxs(G,{variant:"link",className:"inline-flex items-center font-medium group",children:[i.jsx("span",{className:"underline-offset-4 group-hover:underline",children:n}),i.jsx(U_,{className:"w-4 h-4 ml-1 text-muted-foreground"})]})}),i.jsxs(ir,{className:"sm:max-w-[425px]",children:[i.jsx(sr,{children:i.jsx(ar,{children:a})}),i.jsxs(no,{className:"grid gap-4 py-2",children:[r,i.jsx(or,{children:i.jsx(Vi,{asChild:!0,children:i.jsx(G,{type:"button",children:w("common.close")})})})]})]})]})});function aw(n){let o=0;for(let v=0;v>v*8&255;l+=("00"+R.toString(16)).substr(-2)}const c=parseInt(l.substr(1,2),16),d=parseInt(l.substr(3,2),16),h=parseInt(l.substr(5,2),16),p=`#${(c*.7|0).toString(16).padStart(2,"0")}${(d*.7|0).toString(16).padStart(2,"0")}${(h*.7|0).toString(16).padStart(2,"0")}`,x=`#${Math.min(255,Math.floor(c+(255-c)*.7)).toString(16).padStart(2,"0")}${Math.min(255,Math.floor(d+(255-d)*.7)).toString(16).padStart(2,"0")}${Math.min(255,Math.floor(h+(255-h)*.7)).toString(16).padStart(2,"0")}`;return[p,x]}const Td=({label:n,className:a})=>{const[r,o]=aw(n);return i.jsx(ro,{className:a,style:a?{}:{backgroundColor:o,color:r},children:n})};function Ld({table:n,header:a,className:r}){return a.column.getCanSort()?i.jsx("div",{className:he("flex items-center space-x-2",r),children:i.jsxs(Yi,{children:[i.jsx(Qi,{asChild:!0,children:i.jsxs(G,{"aria-label":a.column.getIsSorted()==="desc"?w("common.sort_desc_description"):a.column.getIsSorted()==="asc"?w("common.sort_asc_description"):w("sort_none_description"),size:"sm",variant:"ghost",className:"-ml-3 h-8 data-[state=open]:bg-accent font-bold text-muted-foreground",children:[Gi(a.column.columnDef.header,a.getContext()),a.column.getIsSorted()==="desc"?i.jsx(bc,{className:"w-4 h-4 ml-2","aria-hidden":"true"}):a.column.getIsSorted()==="asc"?i.jsx(wc,{className:"w-4 h-4 ml-2","aria-hidden":"true"}):i.jsx(q0,{className:"w-4 h-4 ml-2 text-muted-foreground/30","aria-hidden":"true"})]})}),i.jsxs(Xi,{align:"start",children:[a.column.getCanSort()&&i.jsxs(i.Fragment,{children:[i.jsxs(Lr,{onClick:()=>a.column.toggleSorting(!1),"aria-label":w("common.sort_asc"),children:[i.jsx(wc,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70","aria-hidden":"true"}),w("common.sort_asc")]}),i.jsxs(Lr,{onClick:()=>a.column.toggleSorting(!0),"aria-label":w("common.sort_desc"),children:[i.jsx(bc,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70","aria-hidden":"true"}),w("common.sort_desc")]})]}),a.column.getCanSort()&&a.column.getCanHide()&&i.jsx(io,{}),a.column.getCanHide()&&i.jsxs(Lr,{onClick:()=>a.column.toggleVisibility(!1),"aria-label":w("Hide"),children:[i.jsx(md,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70","aria-hidden":"true"}),w("Hide")]})]})]})}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:he("data-[state=open]:bg-accent tracking-wide text-ellipsis",r),children:a.isPlaceholder?null:Gi(a.column.columnDef.header,a.getContext())}),!1]})}function ow({table:n,className:a,enablePageSizeSelector:r=!0,visible:o="auto"}){const l=M.useMemo(()=>o===!0,[o]),c=M.useMemo(()=>o==="auto",[o]);return!l||c&&n.getPageCount()<1?null:i.jsxs("div",{className:a,children:[i.jsx("div",{className:"flex-1 text-base text-muted-foreground",children:n.getSelectedRowModel().rows.length>0&&i.jsx(i.Fragment,{children:w("common.rows_selected_of_total",{count:n.getFilteredSelectedRowModel().rows.length,total:n.getFilteredRowModel().rows.length})})}),i.jsxs("div",{className:"flex justify-between space-x-6 lg:space-x-8",children:[r&&i.jsxs("div",{className:"flex items-center space-x-2 grow",children:[i.jsx("p",{className:"text-sm font-medium",children:w("common.rows_per_page")}),i.jsxs(so,{value:`${n.getState().pagination.pageSize}`,onValueChange:d=>{n.setPageSize(Number(d))},children:[i.jsx(ao,{className:"h-8 w-[70px]",children:i.jsx(oo,{placeholder:n.getState().pagination.pageSize})}),i.jsx(lo,{side:"top",children:G_.map(d=>i.jsx(Or,{value:`${d}`,children:d},d))})]})]}),i.jsxs("div",{className:he("flex space-x-2 flex-1",r?"justify-end":"justify-between"),children:[i.jsx("div",{className:"flex w-[150px] items-center justify-start",children:i.jsx("p",{className:"text-sm font-medium ",children:w("common.num_page_of_total",{count:n.getState().pagination.pageIndex+1,total:n.getPageCount()})})}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsxs(G,{type:"button",variant:"outline",className:"hidden w-8 h-8 p-0 lg:flex",onClick:()=>n.setPageIndex(H_),disabled:!n.getCanPreviousPage(),children:[i.jsx("span",{className:"sr-only",children:w("common.go_to_first_page")}),i.jsx($0,{className:"w-4 h-4"})]}),i.jsxs(G,{type:"button",variant:"outline",className:"w-8 h-8 p-0",onClick:()=>n.previousPage(),disabled:!n.getCanPreviousPage(),children:[i.jsx("span",{className:"sr-only",children:w("common.go_to_prev_page")}),i.jsx(K_,{className:"w-4 h-4"})]}),i.jsxs(G,{type:"button",variant:"outline",className:"w-8 h-8 p-0",onClick:()=>n.nextPage(),disabled:!n.getCanNextPage(),children:[i.jsx("span",{className:"sr-only",children:w("common.go_to_next_page")}),i.jsx(W_,{className:"w-4 h-4"})]}),i.jsxs(G,{type:"button",variant:"outline",className:"hidden w-8 h-8 p-0 lg:flex",onClick:()=>n.setPageIndex(n.getPageCount()+1),disabled:!n.getCanNextPage(),children:[i.jsx("span",{className:"sr-only",children:w("common.go_to_last_page")}),i.jsx(z0,{className:"w-4 h-4"})]})]})]})]})]})}function is({table:n,title:a,description:r,caption:o,paginationOptions:l,headerOptions:c={visible:!0},children:d,className:h,contentClassName:p,footerClassName:x,rowClassName:v,cellClassName:R,onRowClick:y,activeRowIndex:b}){var j;const E=c==null?void 0:c.visible;return i.jsxs(Le,{className:h,children:[(a||r)&&i.jsxs(pt,{className:"pb-0",children:[i.jsx(Ge,{children:a}),i.jsx(Ze,{children:r})]}),i.jsxs(Oe,{className:he("pt-6",p),children:[d&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex space-x-2",children:d}),i.jsx(hn,{className:"my-4"})]}),i.jsxs(uo,{children:[typeof o<"u"&&i.jsx(Y_,{children:o}),E&&n.getHeaderGroups().length&&i.jsx(co,{children:n.getHeaderGroups().map(D=>i.jsx(pn,{className:v,children:D.headers.map(F=>i.jsx(fo,{colSpan:F.colSpan,style:{width:F.getSize()===Number.MAX_SAFE_INTEGER?"auto":F.getSize()},children:i.jsx(Ld,{table:n,header:F})},F.id))},D.id))}),i.jsx(go,{children:(j=n.getRowModel().rows)!=null&&j.length?n.getRowModel().rows.map(D=>i.jsx(pn,{onClick:()=>{y&&y(D)},tabIndex:0,"data-state":D.getIsSelected()&&"selected",className:he(D.getIsSelected()||b===D.index?"bg-accent cursor-pointer hover:bg-accent":"cursor-pointer",v),children:D.getVisibleCells().map(F=>i.jsx(qr,{className:R,style:{width:F.column.getSize()===Number.MAX_SAFE_INTEGER?"auto":F.column.getSize()},children:Gi(F.column.columnDef.cell,F.getContext())},F.id))},D.id)):i.jsx(pn,{className:v,children:i.jsx(qr,{className:he("h-24 text-center",R),colSpan:n.getAllColumns.length,children:"No hay datos para mostrar"})})})]})]}),i.jsx(Dt,{className:x,children:i.jsx(ow,{className:"flex-1",table:n,...l})})]})}function lw({actions:n,rowContext:a}){return i.jsxs(Yi,{children:[i.jsx(Qi,{asChild:!0,children:i.jsxs(G,{size:"icon",variant:"outline",className:"w-8 h-8",children:[i.jsx(G0,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"sr-only",children:w("common.open_menu")})]})}),i.jsxs(Xi,{align:"end",children:[i.jsxs(Lc,{children:[w("common.actions")," "]}),n&&n(a).map((r,o)=>r.label==="-"?i.jsx(io,{},o):i.jsxs(Lr,{onClick:l=>r.onClick?r.onClick(a,l):null,children:[r.icon&&i.jsx(i.Fragment,{children:r.icon}),r.label,r.shortcut&&i.jsx(Q_,{children:r.shortcut})]},o))]})]})}function uw(){return{id:"select",header:({table:n})=>i.jsx(Ui,{id:"select-all",checked:n.getIsAllPageRowsSelected()||n.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:a=>n.toggleAllPageRowsSelected(!!a),"aria-label":"Seleccionar todo",className:"translate-y-[2px]"}),cell:({row:n})=>i.jsx(Ui,{id:`select-row-${n.id}`,checked:n.getIsSelected(),onCheckedChange:a=>{n.toggleSelected(!!a)},"aria-label":"Seleccionar file",className:"translate-y-[2px]"}),enableSorting:!1,enableHiding:!1}}function ss({columnCount:n,rowCount:a=10,searchableColumnCount:r=0,filterableColumnCount:o=0,showViewOptions:l=!0,cellWidths:c=["auto"],withPagination:d=!0,shrinkZero:h=!1,className:p,...x}){return i.jsxs("div",{className:he("w-full space-y-2.5 overflow-auto",p),...x,children:[i.jsxs("div",{className:"flex items-center justify-between w-full p-1 space-x-2 overflow-auto",children:[i.jsxs("div",{className:"flex items-center flex-1 space-x-2",children:[r>0?Array.from({length:r}).map((v,R)=>i.jsx(ut,{className:"w-40 h-7 lg:w-60"},R)):null,o>0?Array.from({length:o}).map((v,R)=>i.jsx(ut,{className:"h-7 w-[4.5rem] border-dashed"},R)):null]}),l?i.jsx(ut,{className:"ml-auto hidden h-7 w-[4.5rem] lg:flex"}):null]}),i.jsx("div",{className:"border rounded-md",children:i.jsxs(uo,{children:[i.jsx(co,{children:Array.from({length:1}).map((v,R)=>i.jsx(pn,{className:"hover:bg-transparent",children:Array.from({length:n}).map((y,b)=>i.jsx(fo,{style:{width:c[b],minWidth:h?c[b]:"auto"},children:i.jsx(ut,{className:"w-full h-6"})},b))},R))}),i.jsx(go,{children:Array.from({length:a}).map((v,R)=>i.jsx(pn,{className:"hover:bg-transparent",children:Array.from({length:n}).map((y,b)=>i.jsx(qr,{style:{width:c[b],minWidth:h?c[b]:"auto"},children:i.jsx(ut,{className:"w-full h-6"})},b))},R))})]})}),d?i.jsxs("div",{className:"flex items-center justify-between w-full gap-4 p-1 overflow-auto sm:gap-8",children:[i.jsx(ut,{className:"w-40 h-7 shrink-0"}),i.jsxs("div",{className:"flex items-center gap-4 sm:gap-6 lg:gap-8",children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(ut,{className:"w-24 h-7"}),i.jsx(ut,{className:"h-7 w-[4.5rem]"})]}),i.jsx("div",{className:"flex items-center justify-center text-sm font-medium",children:i.jsx(ut,{className:"w-20 h-7"})}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(ut,{className:"hidden size-7 lg:block"}),i.jsx(ut,{className:"size-7"}),i.jsx(ut,{className:"size-7"}),i.jsx(ut,{className:"hidden size-7 lg:block"})]})]})]}):null]})}const as=({title:n="Esto está muy vacío",subtitle:a="Empieza solicitando la carga del catálogo",buttonText:r="Solicitar carga del catálogo",onButtonClick:o=()=>{},actions:l=()=>i.jsx(i.Fragment,{})})=>i.jsxs("div",{className:"text-center",children:[i.jsx("svg",{className:"w-12 h-12 mx-auto text-slate-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:i.jsx("path",{vectorEffect:"non-scaling-stroke",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z"})}),i.jsx("h3",{className:"mt-2 text-lg font-semibold text-slate-900",children:n}),i.jsx("p",{className:"mt-1 text-base text-slate-500",children:a}),i.jsxs("div",{className:"items-center mt-6",children:[l&&i.jsx(i.Fragment,{children:l}),!l&&i.jsxs(G,{className:"my-4",onClick:o,children:[i.jsx(yo,{}),r]})]})]}),cw=vo("flex h-10 w-full rounded-md bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",{variants:{variant:{default:"border border-input ring-offset-background focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ",outline:"focus-visible:border focus-visible:border-input"}},defaultVariants:{variant:"default"}}),Hi=n=>{const{name:a,label:r,hint:o,description:l,placeholder:c,className:d,disabled:h,defaultValue:p,rules:x,readOnly:v,scale:R,variant:y}=n,{control:b}=lr(),[E,j]=M.useState(""),D={input:F=>{if(typeof F!="object")return F;const q=$t.create(F);if(q.isFailure)throw q.error;const $=q.object.toString();return E.endsWith(",")?$.replace(/.0$/,","):$},output:(F,q,$)=>{const{value:Q}=$??{value:null};j(Q??"");const O=$t.createFromFormattedValue(Q);if(O.isFailure)throw O.error;return O.object.toObject()}};return i.jsx(mo,{defaultValue:p,control:b,name:a,disabled:h,rules:{max:100,min:0,...x},render:({field:F})=>{const q=D.input(F.value),$=h||F.disabled,Q=!!((x==null?void 0:x.required)??!1);return i.jsxs(ho,{className:he(d,"space-y-3"),children:[r&&i.jsx(po,{label:r,hint:o,required:Q}),i.jsx(xo,{children:i.jsx(Oc,{name:F.name,ref:F.ref,onBlur:F.onBlur,disabled:$,readOnly:v,className:he(cw({variant:y,className:d})),groupSeparator:".",decimalSeparator:",",placeholder:c,allowDecimals:R!==0,decimalsLimit:R,decimalScale:R,step:1,value:q,onValueChange:(O,k,H)=>F.onChange(D.output(O,k,H))})}),l&&i.jsx(_o,{children:l}),i.jsx(bo,{})]})}})},dw=vo("flex h-10 w-full rounded-md bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",{variants:{variant:{default:"border border-input ring-offset-background focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ",outline:"focus-visible:border focus-visible:border-input"}},defaultVariants:{variant:"default"}}),fw=n=>{const{name:a,label:r,hint:o,description:l,placeholder:c,className:d,disabled:h,defaultValue:p,rules:x,readOnly:v,scale:R,variant:y}=n,{control:b}=lr(),[E,j]=M.useState(""),D={input:F=>{if(typeof F!="object")return F;const q=xn.create(F);if(q.isFailure)throw q.error;const $=q.object.toString();return E.endsWith(",")?$.replace(/.0$/,","):$},output:(F,q,$)=>{const{value:Q}=$??{value:null};j(Q??"");const O=xn.createFromFormattedValue(Q);if(O.isFailure)throw O.error;return O.object.toObject()}};return i.jsx(mo,{defaultValue:p,control:b,name:a,disabled:h,rules:x,render:({field:F})=>{const q=D.input(F.value),$=h||F.disabled,Q=!!((x==null?void 0:x.required)??!1);return i.jsxs(ho,{className:he(d,"space-y-3"),children:[r&&i.jsx(po,{label:r,hint:o,required:Q}),i.jsx(xo,{children:i.jsx(Oc,{name:F.name,ref:F.ref,onBlur:F.onBlur,disabled:$,readOnly:v,className:he(dw({variant:y,className:d})),groupSeparator:".",decimalSeparator:",",placeholder:c,allowDecimals:R!==0,decimalsLimit:R,decimalScale:R,step:1,value:q,onValueChange:(O,k,H)=>F.onChange(D.output(O,k,H))})}),l&&i.jsx(_o,{children:l}),i.jsx(bo,{})]})}})},gw=vo("",{variants:{variant:{default:"",ghost:"border-0 focus-visible:border focus-visible:border-input focus-visible:ring-0 focus-visible:ring-offset-0 "}},defaultVariants:{variant:"default"}}),mn=n=>{const{name:a,label:r,hint:o,description:l,placeholder:c,className:d,disabled:h,rules:p,required:x,type:v,variant:R}=n,{control:y}=lr();return i.jsx(mo,{control:y,name:a,disabled:h,rules:{required:x,...p},render:({field:b,fieldState:E})=>{const j=!!((p==null?void 0:p.required)??x);return i.jsxs(ho,{className:he(d,"space-y-3"),children:[r&&i.jsx(po,{label:r,hint:o,required:j}),i.jsx(xo,{className:"block",children:i.jsx(Zi,{type:v,placeholder:c,className:he(E.error?"border-destructive focus-visible:ring-destructive":"",gw({variant:R,className:d})),...b})}),l&&i.jsx(_o,{children:l}),i.jsx(bo,{})]})}})},mw=(n,a)=>{const r=M.useRef();return M.useEffect(()=>{r.current=n},[n,a]),r.current},Od=(n,a,r,o)=>n.getFixedT(a,r,o),hw=(n,a,r,o)=>M.useCallback(Od(n,a,r,o),[n,a,r,o]),Fo=(n,a={})=>{var Q,O,k,H;const{i18n:r}=a,{i18n:o,defaultNS:l}=M.useContext(X_)||{},c=r||o||Z_();if(c&&!c.reportNamespaces&&(c.reportNamespaces=new J_),!c){gc(c,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const W=(se,ce)=>Ia(ce)?ce:n0(ce)&&Ia(ce.defaultValue)?ce.defaultValue:Array.isArray(se)?se[se.length-1]:se,B=[W,{},!1];return B.t=W,B.i18n={},B.ready=!1,B}(Q=c.options.react)!=null&&Q.wait&&gc(c,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const d={...t0(),...c.options.react,...a},{useSuspense:h,keyPrefix:p}=d;let x=l||((O=c.options)==null?void 0:O.defaultNS);x=Ia(x)?[x]:x||["translation"],(H=(k=c.reportNamespaces).addUsedNamespaces)==null||H.call(k,x);const v=(c.isInitialized||c.initializedStoreOnce)&&x.every(W=>e0(W,c,d)),R=hw(c,a.lng||null,d.nsMode==="fallback"?x:x[0],p),y=()=>R,b=()=>Od(c,a.lng||null,d.nsMode==="fallback"?x:x[0],p),[E,j]=M.useState(y);let D=x.join();a.lng&&(D=`${a.lng}${D}`);const F=mw(D),q=M.useRef(!0);M.useEffect(()=>{const{bindI18n:W,bindI18nStore:B}=d;q.current=!0,!v&&!h&&(a.lng?mc(c,a.lng,x,()=>{q.current&&j(b)}):hc(c,x,()=>{q.current&&j(b)})),v&&F&&F!==D&&q.current&&j(b);const se=()=>{q.current&&j(b)};return W&&(c==null||c.on(W,se)),B&&(c==null||c.store.on(B,se)),()=>{q.current=!1,c&&(W==null||W.split(" ").forEach(ce=>c.off(ce,se))),B&&c&&B.split(" ").forEach(ce=>c.store.off(ce,se))}},[c,D]),M.useEffect(()=>{q.current&&v&&j(y)},[c,p,v]);const $=[E,c,v];if($.t=E,$.i18n=c,$.ready=v,v||!v&&!h)return $;throw new Promise(W=>{a.lng?mc(c,a.lng,x,()=>W()):hc(c,x,()=>W())})};function pw(n=!1){const[a,r]=M.useState(n);return[a,()=>r(l=>!l)]}const Tn=()=>{const n=M.useContext(r0);if(n===null)throw new Error("useDataTableContext must be used within a DataTableProvider");return n};function os({data:n,columns:a,pageCount:r,enableSorting:o=!1,enableHiding:l=!1,enableRowSelection:c=!1,initialState:d,onPaginationChange:h,meta:p}){const{pagination:x,setPagination:v,sorting:R}=Tn(),[y,b]=In.useState({}),[E,j]=In.useState((d==null?void 0:d.columnVisibility)||{}),D=Q=>{if(typeof Q=="function"){const O=Q(x);v(O)}h&&h(Q)},F=Q=>{},q=M.useCallback(()=>{const Q=a;return c&&Q.unshift(uw()),Q},[a,c]);return{table:Dd({data:n,columns:q(),pageCount:r??-1,meta:p,getCoreRowModel:Fd(),initialState:d,state:{pagination:x,sorting:R,columnVisibility:E,rowSelection:y},enableRowSelection:c,onRowSelectionChange:b,manualSorting:!0,enableSorting:o,getSortedRowModel:tw(),onSortingChange:F,enableHiding:l,onColumnVisibilityChange:j,manualPagination:!0,onPaginationChange:D,manualFiltering:!0,getFilteredRowModel:ew(),getFacetedRowModel:Zb(),getFacetedUniqueValues:Jb(),debugTable:!1,debugHeaders:!1,debugColumns:!1,defaultColumn:{minSize:0,size:Number.MAX_SAFE_INTEGER,maxSize:Number.MAX_SAFE_INTEGER}})}}const xw=({setSize:n,setControllerCallback:a,setPercentageCallback:r,setErrorCallback:o})=>l=>{if(!l.ok)throw Error(`${l.status} ${l.type} ${l.statusText}`);if(!l.body)throw Error("ReadableStream not yet supported in this browser.");const c=l.body,d=l.headers.get("content-encoding"),h=l.headers.get(d?"x-file-size":"content-length"),p=parseInt(h||"0",10);n(()=>p);let x=0;const v=new ReadableStream({start(R){a(R);const y=c.getReader();async function b(){return y.read().then(({done:E,value:j})=>E?R.close():(x+=(j==null?void 0:j.byteLength)||0,j&&R.enqueue(j),r({loaded:x,total:p}),b())).catch(E=>(o(E),y.cancel("Cancelled"),R.error(E)))}return b()}});return new Response(v)},Rc=(n,a,r)=>{const o=[n],l=new Blob(o,{type:r||"application/octet-stream"});if(typeof window.navigator.msSaveBlob<"u")return window.navigator.msSaveBlob(l,a);const c=window.URL&&window.URL.createObjectURL?window.URL.createObjectURL(l):window.webkitURL.createObjectURL(l),d=document.createElement("a");return d.style.display="none",d.href=c,d.setAttribute("download",a),typeof d.download>"u"&&d.setAttribute("target","_blank"),document.body.appendChild(d),d.click(),setTimeout(()=>{document.body.removeChild(d),window.URL.revokeObjectURL(c)},200)};function Ec({customHandleDownload:n,...a}={}){var Q;let r=!1;try{r=process?!!((Q=process==null?void 0:process.env)!=null&&Q.REACT_APP_DEBUG_MODE):!1}catch{r=!1}const[o,l]=M.useState(0),[c,d]=M.useState(0),[h,p]=M.useState(0),[x,v]=M.useState(null),[R,y]=M.useState(!1),b=M.useRef(null),E=M.useCallback(({loaded:O,total:k})=>{const H=Math.round(O/k*100);d(()=>H)},[]),j=M.useCallback(O=>{const k={"Failed to execute 'enqueue' on 'ReadableStreamDefaultController': Cannot enqueue a chunk into an errored readable stream":"Download canceled","The user aborted a request.":"Download timed out"};v(()=>({errorMessage:k[O.message]?k[O.message]:O.message}))},[]),D=M.useCallback(O=>{b.current=O},[]),F=M.useCallback(()=>{b.current&&b.current.error()},[]),q=M.useCallback(()=>{D(null),l(()=>0),d(()=>0),p(()=>0),y(()=>!1)},[D]),$=M.useCallback(async(O,k,H=0,W={})=>{if(R)return null;q(),v(()=>null),y(()=>!0);const B=setInterval(()=>l(rt=>rt+1),r?1:1e3),se=xw({setSize:p,setControllerCallback:D,setPercentageCallback:E,setErrorCallback:j}),ce=new AbortController,Y=setTimeout(()=>{H>0&&ce.abort()},H),Re=n||Rc;try{const rt=await fetch(O,{method:"GET",...a,...W,signal:ce.signal}),je=await se(rt).blob();Re(je,k),q()}catch(rt){q(),v(ee=>{const{message:je}=rt;return je!=="Failed to fetch"?{errorMessage:je}:ee}),clearTimeout(Y)}finally{clearInterval(B)}},[R,q,r,D,E,j,a,n]);return M.useMemo(()=>({elapsed:o,percentage:c,size:h,download:$,cancel:F,error:x,isInProgress:R,jsDownload:Rc}),[o,c,h,$,F,x,R])}const vw=()=>{const{i18n:n}=Fo();return Pd({locale:n.language})},Pd=n=>{const{locale:a}=n,r=M.useCallback(c=>{if(c==null)return"";const{amount:d,scale:h,currency_code:p}=c;return new Intl.NumberFormat(a??"ES",{style:"currency",currency:p,currencyDisplay:"symbol",useGrouping:!0,maximumFractionDigits:h}).format(d===null?0:pc({amount:d,scale:h}))},[a]),o=M.useCallback(c=>{if(c==null)return"";const{amount:d,scale:h}=c;return new Intl.NumberFormat("es",{minimumFractionDigits:h,useGrouping:!0}).format(d===null?0:pc({amount:d,scale:h}))},[a]),l=M.useCallback(c=>{if(c==null)return"";const{amount:d,scale:h}=c;return new Intl.NumberFormat(a,{style:"decimal",minimumFractionDigits:h}).format(d===null?0:d)},[a]);return{formatCurrency:r,formatNumber:o,formatPercentage:l}};function kd(n){const[a,r]=M.useState(!1);return M.useEffect(()=>{function o(c){r(c.matches)}const l=matchMedia(n);return l.addEventListener("change",o),r(l.matches),()=>l.removeEventListener("change",o)},[n]),a}const _w=()=>{const n=M.useContext(i0);if(n===null)throw new Error("useWarnAboutChange must be used within a UnsavedWarnProvider");return n},Mo=({isDirty:n=!1,title:a=w("hooks.use_unsaved_changes_notifier.title"),subtitle:r=w("hooks.use_unsaved_changes_notifier.subtitle"),confirmText:o=w("hooks.use_unsaved_changes_notifier.confirm_text"),cancelText:l=w("hooks.use_unsaved_changes_notifier.cancel_text"),onConfirm:c,onCancel:d,type:h="warning"})=>{const p=s0(n),{show:x}=_w(),v=M.useCallback(()=>n?new Promise(R=>{x({title:a,subtitle:r,confirmText:o,cancelText:l,type:h,onConfirm:()=>{R(!0),c==null||c()},onCancel:()=>{R(!1),d==null||d()}})}):Promise.resolve(!0),[l,o,n,d,c,x,r,a,h]);return M.useEffect(()=>{p.state==="blocked"&&v().then(R=>{R?p.proceed():p.reset()})},[p,v]),M.useEffect(()=>(n&&(window.onbeforeunload=()=>r),()=>{window.onbeforeunload=null}),[n,r]),{confirm:v}},qd=n=>{const{isSubmitting:a,isLoading:r,isValidating:o}=a0();return i.jsx(wo,{disabled:a||r||o,...n})};qd.displayName="FormSubmitButton";const $d={"any.unknown":"{{#label}}: no está permitido","any.invalid":"{{#label}}: contiene un valor invalido","any.empty":"{{#label}}: no está permitido que sea vacío","any.required":"{{#label}}: es un campo requerido","any.allowOnly":"{{#label}}: debería ser uno de las siguientes variantes: {{valids}}","any.default":"emitió un error cuando se ejecutó el metodo default","alternatives.base":"{{#label}}: no coincide con ninguna de las alternativas permitidas","array.base":"{{#label}}: debe ser un array","array.includes":"{{#label}}: en la posición {{pos}} no coincide con ninguno de los tipos permitidos","array.includesSingle":'{{#label}}: el valor de "{{!key}}" no coincide con ninguno de los tipos permitidos',"array.includesOne":"{{#label}}: en la posición {{pos}} falló porque {{reason}}","array.includesOneSingle":'{{#label}}: el valor "{{!key}}" falló porque {{reason}}',"array.includesRequiredUnknowns":"{{#label}}: no contiene valor/es requerido/s: {{unknownMisses}} ","array.includesRequiredKnowns":"{{#label}}: no contiene: {{knownMisses}}","array.includesRequiredBoth":"{{#label}}: no contiene {{knownMisses}} y {{unknownMisses}} otros valores requeridos","array.excludes":"{{#label}}: en la posición {{pos}} contiene un valor excluído","array.excludesSingle":'{{#label}}: el valor "{{!key}}" contiene un valor excluído',"array.min":"{{#label}}: debe contener al menos {{limit}} items","array.max":"{{#label}}: debe contener máximo {{limit}} items","array.length":"{{#label}}: debe contener exactamente {{limit}} items","array.ordered":"{{#label}}: en la posición {{pos}} falló porque {{reason}}","array.orderedLength":"{{#label}}: en la posición {{pos}} falló porque el array debre contener como máximo {{limit}} items","array.sparse":"{{#label}}: no debe ser un array esparcido","array.unique":"{{#label}}: posición {{pos}} contiene un valor duplicado","boolean.base":"{{#label}}: debe ser un valor verdadero/falso o si/no","binary.base":"{{#label}}: debe ser un buffer o un string","binary.min":"{{#label}}: debe ser como mínimo de {{limit}} bytes","binary.max":"{{#label}}: debe ser como máximo de {{limit}} bytes","binary.length":"{{#label}}: debe tener exactamente {{limit}} bytes","date.base":"{{#label}}: debe ser una cantidad de milisegundos o una fecha en cadena de texto válida","date.min":'{{#label}}: debe ser mayor o igual a "{{limit}}"',"date.max":'{{#label}}: debe ser menor o igual que "{{limit}}"',"date.isoDate":"{{#label}}: debe ser una fecha en formato ISO 8601","date.ref":'referencia a "{{ref}}", que no es una fecha válida',"function.base":"{{#label}}: debe ser una función","object.base":"{{#label}}: debe ser un objeto","object.child":'hijo "{{!key}}" falló porque {{reason}}',"object.min":"{{#label}}: debe tener como mínimo {{limit}} hijo","object.max":"{{#label}}: debe tener menos o a lo sumo {{limit}} hijo","object.length":"{{#label}}: debe tener máximo {{limit}} hijo/s","object.allowUnknown":"no está permitido","object.with":'peer faltante: "{{peer}}"',"object.without":'conflicto con peer prohibido: "{{peer}}"',"object.missing":"{{#label}}: debe contener al menos uno de: {{peers}}","object.xor":"{{#label}}: contiene un conflicto con alguno de: {{peers}}","object.or":"{{#label}}: debe contener al menos uno de: {{peers}}","object.and":"contiene {{present}} sin el requerido: {{missing}}","object.nand":'!!"{{main}}" no debe existir simultáneamente con {{peers}}',"object.assert":'!!"{{ref}}" falló validacion porque "{{ref}}" falló a {{message}}',"object.rename.multiple":'{{#label}}: no se puede renombrar el hijo "{{from}}" porque múltiples re-nombramientos estan deshabilitados y otra clave fue renombrada a "{{to}}"',"object.rename.override":'{{#label}}: no se puede renombrar el hijo "{{from}}" porque la sobre escritura esta deshabilitada y el target "{{to}}" existe',"object.type":'{{#label}}: debe ser una instancia de "{{type}}"',"number.base":"{{#label}}: debe ser un número","number.min":"{{#label}}: debe ser mayor o igual que {{limit}}","number.max":"{{#label}}: debe ser menor o igual que {{limit}}","number.less":"{{#label}}: debe ser menor a {{limit}}","number.greater":"{{#label}}: debe ser mayor a {{limit}}","number.float":"{{#label}}: debe ser un numero flotante","number.integer":"{{#label}}: debe ser un número entero","number.negative":"{{#label}}: debe ser un número negativo","number.positive":"{{#label}}: debe ser un número positivo","number.precision":"{{#label}}: no debe tener mas de {{limit}} decimales","number.ref":'{{#label}}: referencia a "{{ref}}" que no es un número',"number.multiple":"{{#label}}: debe ser un múltiplo de {{multiple}}","string.base":"{{#label}}: debe ser una cadena de texto","string.empty":"{{#label}}: no está permitido que sea vacío","string.min":"{{#label}}: debe ser mínimo de {{limit}} caracteres de largo","string.max":"{{#label}}: debe ser de máximo {{limit}} caracteres de largo","string.length":"{{#label}}: debe ser exactamente de {{limit}} caracteres de largo","string.alphanum":"{{#label}}: debe contener solo letras y números","string.token":"{{#label}}: debe contener solo letras, números y guines bajos","string.regex.base":'{{#label}}: el valor "{{!value}}" no coincide con el pattern requerido: {{pattern}}',"string.regex.name":'{{#label}}: el valor "{{!value}}" no coincide con el nombre de pattern {{name}}',"string.email":"{{#label}}: debe ser un email válido","string.uri":"{{#label}}: debe sre una uri válida","string.uriCustomScheme":"{{#label}}: debe ser una uri válida con el esquema concidiente con el patrón {{scheme}}","string.isoDate":"{{#label}}: debe ser una fecha en formato ISO 8601 válida","string.guid":"{{#label}}: debe ser un GUID valido","string.hex":"{{#label}}: debe contener solo caracteres hexadecimales","string.hostname":"{{#label}}: deber ser un hostname válido","string.lowercase":"{{#label}}: solo debe contener minúsculas","string.uppercase":"{{#label}}: solo debe contener mayúsculas","string.trim":"{{#label}}: no debe tener espacios en blanco delante o atrás","string.creditCard":"{{#label}}: debe ser una tarjeta de crédito","string.ref":'Referencia "{{ref}}" que no es un número',"string.ip":"{{#label}}: debe ser una dirección ip válida con un CDIR {{cidr}}","string.ipVersion":"{{#label}}: debe ser una dirección ip válida de una de las siguientes versiones {{version}} con un CDIR {{cidr}}","object.unknown":"{{#label}}: es un campo no es permitido","luxon.lt":"{{#label}}: must be before {{#date}}","luxon.gt":"{{#label}}: must be after {{#date}}","luxon.lte":"{{#label}}: must be same as or before {{#date}}","luxon.gte":"{{#label}}: must be same as or after {{#date}}"},Bi=[{code:"en",name:"English",flag:()=>i.jsx("span",{className:"fi fi-gb"})},{code:"es",name:"Español",flag:()=>i.jsx("span",{className:"fi fi-es"})}],oS=()=>{var R,y,b,E;const{t:n,i18n:a}=Fo(),[r,o]=M.useState(a.language),l=zt(),{toast:c}=_n();M.useEffect(()=>{const j=navigator.language.split("-")[0],D=Bi.find(F=>F.code===j);D&&d(D.code)},[]);const d=j=>{a.changeLanguage(j),o(j)},{mutate:h,status:p}=k0({onSuccess:j=>{const{success:D,error:F}=j;!D&&F&&x.setError("root",F),D&&l("/quotes",{replace:!0})},onError:j=>{const{message:D}=j;c({description:D,title:"Error"}),console.log(j)}}),x=Ji({mode:"onBlur",defaultValues:{email:"",password:""},resolver:Pc(Fn.object({email:Fn.string().email({tlds:{allow:!1}}).required(),password:Fn.string().min(4).alphanum().required()}),{messages:$d})}),v=async j=>{h({email:j.email,password:j.password},{})};return i.jsxs(o0,{variant:"full",className:"p-0 lg:grid lg:min-h-[600px] lg:grid-cols-2 xl:min-h-[800px] h-screen ",children:[i.jsx("div",{className:"flex items-center justify-center py-12 ",children:i.jsxs("div",{className:"mx-auto grid w-[650px] gap-6 relative ",children:[i.jsx("div",{className:"absolute flex space-x-2 top-4 right-4 ",children:i.jsxs(Yi,{children:[i.jsx(Qi,{asChild:!0,children:i.jsxs(G,{variant:"outline",className:"w-[140px] justify-start",children:[i.jsx("span",{className:"mr-2",children:(R=Bi.find(j=>j.code===r))==null?void 0:R.flag()}),(y=Bi.find(j=>j.code===r))==null?void 0:y.name,i.jsx(kc,{className:"w-4 h-4 ml-auto opacity-50"})]})}),i.jsx(Xi,{className:"w-[140px]",children:Bi.map(j=>i.jsxs(Lr,{onSelect:()=>d(j.code),children:[i.jsx("span",{className:"mr-2",children:j.flag()}),j.name]},j.code))})]})}),i.jsxs(Le,{className:"px-12 py-6 bg-muted/50",children:[i.jsxs(pt,{children:[i.jsx(l0,{className:"inline-block m-auto mb-6 align-middle max-w-32"}),i.jsx(Ge,{children:i.jsx(le,{i18nKey:"login_page.title"})}),i.jsx(Ze,{children:i.jsx(le,{i18nKey:"login_page.description"})})]}),i.jsx(Oe,{children:i.jsx(es,{...x,children:i.jsx("form",{onSubmit:x.handleSubmit(v),children:i.jsxs("div",{className:"grid items-start gap-6",children:[i.jsx("div",{className:"grid gap-6",children:i.jsx(mn,{required:!0,disabled:p==="pending",name:"email",label:n("login_page.email_label"),type:"email",placeholder:n("login_page.email_placeholder")})}),i.jsxs("div",{className:"grid gap-6",children:[i.jsx(mn,{required:!0,disabled:p==="pending",name:"password",label:n("login_page.password_label"),type:"password"}),i.jsxs("div",{className:"mb-4 -mt-2 text-sm",children:[i.jsx(le,{i18nKey:"login_page.forgotten_password"}),i.jsx("br",{}),i.jsx(xc,{to:"https://uecko.com/distribuidores",className:"underline",children:i.jsx(le,{i18nKey:"login_page.contact_us"})})]})]}),((b=x.formState.errors.root)==null?void 0:b.message)&&i.jsxs(qc,{variant:"destructive",children:[i.jsx(fd,{className:"w-4 h-4"}),i.jsx($c,{children:i.jsx(le,{i18nKey:"common.error"})}),i.jsx(zc,{children:(E=x.formState.errors.root)==null?void 0:E.message})]}),i.jsx(qd,{className:"w-full",disabled:p==="pending"}),i.jsxs("div",{className:"mt-4 text-sm text-center",children:[i.jsx(le,{i18nKey:"login_page.become_dealer"}),i.jsx("br",{}),i.jsx(xc,{to:"https://uecko.com/distribuidores",className:"underline",children:i.jsx(le,{i18nKey:"login_page.contact_us"})}),i.jsx("br",{}),i.jsxs("p",{className:"mx-auto mt-4 -mb-6 text-xs text-muted-foreground/50",children:["v.","1.1.7"]})]})]})})})})]}),i.jsx("img",{className:"block w-11/12 mx-auto aspect-auto",src:"/img/uecko-footer_logos.jpg"})]})}),i.jsx("div",{className:"hidden bg-muted lg:block",children:i.jsx("img",{src:"/img/nara2.jpg",alt:"Image",width:"1920",height:"1080",className:"h-full w-full object-cover dark:brightness-[0.2] dark:grayscale"})})]})},bw=n=>{const{onSuccess:a,onError:r,...o}=n||{},l=Jt(),c=Mn(),{logout:d}=Fc(),h=zt(),{toast:p}=_n();return en({mutationKey:c().auth().action("logout").get(),mutationFn:d,onSuccess:async(x,v,R)=>{l.clear();const{success:y,redirectTo:b}=x;y&&b&&h(b||"/"),a&&a(x,v,R)},onError:(x,v,R)=>{const{message:y}=x;p({title:"Error",description:y,variant:"destructive"}),r&&r(x,v,R)},...o})},lS=()=>{const{mutate:n}=bw({});return M.useEffect(()=>n(),[n]),i.jsx(Dn,{})},ww=M.createContext(null),Sw=({children:n})=>{const[a,r]=Bc();return i.jsx(ww.Provider,{value:{pagination:a,setPagination:r},children:n})},uS=({children:n})=>i.jsx(ts,{children:i.jsx(Sw,{children:i.jsxs(zr,{className:"catalog-layout",children:[i.jsx(Br,{}),i.jsx(Vr,{children:n})]})})}),zd=n=>{const a=$r(),r=Mn(),{pagination:o,searchTerm:l=[],enabled:c=!0,queryOptions:d}=n;return No({queryKey:r().data().resource("catalog").action("list").params(n).get(),queryFn:()=>a.getList({resource:"catalog",quickSearchTerm:l,pagination:o}),enabled:c,queryOptions:d})};function Bd({table:n,className:a,children:r,...o}){const{globalFilter:l,isFiltered:c,setGlobalFilter:d,resetGlobalFilter:h}=Tn(),p=In.useRef(null),[x,v]=In.useState(""),R=In.useCallback(E=>{E.key==="Enter"&&x.trim()&&(E.preventDefault(),d(j=>[...j,x.trim()]),v("")),E.key==="Backspace"&&!x&&l.length>0&&(E.preventDefault(),d(j=>j.slice(0,-1)))},[l,x]),y=In.useCallback(E=>{d(j=>j.filter(D=>D!==E))},[]),b=In.useCallback(()=>{var E;x.trim()&&(d(j=>[...j,x.trim()]),v(""),(E=p.current)==null||E.focus())},[x]);return i.jsx(u0,{children:i.jsxs("div",{className:"w-full space-y-2",...o,children:[i.jsxs("div",{className:he("relative flex items-center flex-1 p-2 space-x-2 border rounded-md",c?"border-primary":"border-input"),children:[i.jsx(Vc,{className:he("w-4 h-4 text-gray-500")}),i.jsxs("div",{className:"flex flex-wrap items-center flex-1 gap-2",children:[l&&l.map(E=>i.jsxs(ro,{variant:"default",className:"px-1 text-base font-normal rounded-sm",children:[E,i.jsxs(G,{variant:"ghost",onClick:()=>y(E),className:"h-auto p-0 px-1 ml-1 hover:bg-transparent",children:[i.jsxs(He,{children:[i.jsx(Ke,{asChild:!0,children:i.jsx(Ua,{className:"w-4 h-4"})}),i.jsx(We,{children:i.jsx("p",{children:w("catalog.filter.badget_remove_tooltip")})})]}),i.jsx("span",{className:"sr-only",children:w("catalog.filter.badget_remove_tooltip")})]})]},E)),i.jsxs("div",{className:"flex-1 flex items-center min-w-[300px]",children:[i.jsx("input",{ref:p,value:x,onChange:E=>v(E.target.value),onKeyDown:R,placeholder:w("common.filter.input_placeholder"),className:"flex-1 w-full h-8 bg-transparent outline-none placeholder:text-muted-foreground"}),i.jsxs(tr,{children:[c&&i.jsxs(He,{children:[i.jsx(Ke,{asChild:!0,children:i.jsxs(G,{variant:"ghost",onClick:()=>h(),className:"h-8 px-2 transition-all lg:px-3 text-primary",children:[i.jsx(Ua,{className:"w-4 h-4 mr-2"}),w("common.filter.reset_filter")]})}),i.jsx(We,{children:i.jsx("p",{children:w("common.filter.reset_filter")})})]}),i.jsxs(He,{children:[i.jsx(Ke,{asChild:!0,children:i.jsxs(G,{variant:"default",size:"icon",disabled:!x,onClick:b,className:"w-8 h-8 p-0 transition-all",children:[i.jsx(yo,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:w("common.filter.button_add_term")})]})}),i.jsx(We,{children:i.jsx("p",{children:w("common.filter.button_add_term_tooltip")})})]})]})]})]})]}),i.jsx("p",{className:"text-sm text-muted-foreground",children:w("common.filter.help_text")})]})})}const jw=()=>{const n=zt(),{pagination:a,globalFilter:r,isFiltered:o}=Tn(),{data:l,isPending:c,isError:d,error:h}=zd({pagination:{pageIndex:a.pageIndex,pageSize:a.pageSize},searchTerm:r}),p=M.useMemo(()=>[{id:"id",accessorKey:"id"},{id:"id_article",accessorKey:"id_article"},{id:"catalog_name",accessorKey:"catalog_name"},{id:"description",accessorKey:"description",header:()=>i.jsx(i.Fragment,{children:w("catalog.list.columns.description")})},{id:"points",accessorKey:"points",header:()=>i.jsx("div",{className:"text-right",children:w("catalog.list.columns.points")}),cell:({renderValue:v})=>i.jsx("div",{className:"text-right",children:v()})},{id:"retail_price",accessorKey:"retail_price",header:()=>i.jsx("div",{className:"text-right",children:w("catalog.list.columns.retail_price")}),cell:({row:v})=>{const R=Tt.create(v.original.retail_price).object;return i.jsx("div",{className:"text-right",children:R.toFormat()})}}],[]),{table:x}=os({data:(l==null?void 0:l.items)??[],columns:p,pageCount:(l==null?void 0:l.total_pages)??-1,initialState:{columnVisibility:{id:!1,id_article:!1,catalog_name:!1}}});return d?i.jsx(ur,{subtitle:h.message}):c?i.jsx(Le,{children:i.jsx(Oe,{children:i.jsx(ss,{columnCount:6,searchableColumnCount:1,filterableColumnCount:2,shrinkZero:!0})})}):(l==null?void 0:l.total_items)===0&&!o?i.jsx(as,{subtitle:"Empieza cargando los artículos del catálogo",buttonText:"",onButtonClick:()=>n("/catalog/add")}):i.jsx(is,{table:x,paginationOptions:{visible:!0},children:i.jsx(Bd,{table:x})})},cS=()=>i.jsxs(nr,{children:[i.jsx("div",{className:"flex items-center justify-between space-y-2",children:i.jsx("div",{children:i.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:i.jsx(le,{i18nKey:"catalog.list.title"})})})}),i.jsx(jw,{})]}),dS=()=>{const{data:n,status:a}=c0();return i.jsxs(zr,{children:[i.jsx(Br,{}),i.jsx(Vr,{children:a==="success"?i.jsx("div",{className:"flex items-center",children:i.jsx("h1",{className:"text-lg font-semibold md:text-2xl",children:`${w("dashboard.welcome")}, ${n==null?void 0:n.name}`})}):i.jsx(ut,{className:"w-[100px] h-[20px] rounded-full"})})]})},fS=({children:n})=>i.jsx(ts,{children:i.jsxs(zr,{className:"dealers-layout",children:[i.jsx(Br,{}),i.jsx(Vr,{children:n})]})});function Cw({table:n}){return i.jsxs(Yi,{children:[i.jsx(Qi,{asChild:!0,children:i.jsxs(G,{variant:"outline",size:"sm",className:"hidden h-8 ml-auto lg:flex",children:[i.jsx(X0,{className:"w-4 h-4 mr-2"}),"Columnas"]})}),i.jsxs(Xi,{align:"end",className:"w-[150px]",children:[i.jsx(Lc,{children:"Columnas"}),i.jsx(io,{}),n.getAllColumns().filter(a=>typeof a.accessorFn<"u"&&a.getCanHide()).map(a=>i.jsx(d0,{className:"capitalize",checked:a.getIsVisible(),onCheckedChange:r=>a.toggleVisibility(!!r),children:i.jsx(i.Fragment,{children:a.columnDef.header})},a.id))]})]})}function Vd({table:n,className:a,children:r,...o}){const{globalFilter:l,isFiltered:c,setGlobalFilter:d,resetGlobalFilter:h}=Tn(),p=x=>{const v=String(x.target.value);v===""?h():d([v])};return i.jsxs("div",{className:he("flex w-full items-center justify-between space-x-2 overflow-auto p-1",a),...o,children:[i.jsxs("div",{className:"flex items-center flex-1 space-x-2",children:[i.jsx(Vc,{className:"w-4 h-4 text-gray-500"}),i.jsx(Zi,{placeholder:w("common.filter.input_placeholder"),value:l,onChange:p,className:he("h-8 w-full transition-all")},"global-filter"),c&&i.jsxs(G,{variant:"outline",onClick:()=>h(),className:"h-8 px-2 transition-all lg:px-3",children:[i.jsx(Ua,{className:"w-4 h-4 mr-2"}),w("common.filter.reset_filter")]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[r,n.options.enableHiding&&i.jsx(Cw,{table:n})]})]})}const yw=n=>{const a=$r(),r=Mn(),{pagination:o,searchTerm:l=void 0,enabled:c=!0,queryOptions:d}=n;return No({queryKey:r().data().resource("dealer").action("list").params(n).get(),queryFn:()=>a.getList({resource:"dealers",quickSearchTerm:l,pagination:o}),enabled:c,queryOptions:d})},Nw=()=>{const n=zt(),{pagination:a,globalFilter:r,isFiltered:o}=Tn(),{data:l,isPending:c,isError:d,error:h}=yw({pagination:{pageIndex:a.pageIndex,pageSize:a.pageSize},searchTerm:r}),p=M.useMemo(()=>[{id:"id",accessorKey:"id",enableResizing:!1,size:10},{id:"name",accessorKey:"name",enableResizing:!1,size:10}],[]),{table:x}=os({data:(l==null?void 0:l.items)??[],columns:p,pageCount:(l==null?void 0:l.total_pages)??-1});return d?i.jsx(ur,{subtitle:h.message}):c?i.jsx(Le,{children:i.jsx(Oe,{children:i.jsx(ss,{columnCount:6,searchableColumnCount:1,filterableColumnCount:2,shrinkZero:!0})})}):(l==null?void 0:l.total_items)===0&&!o?i.jsx(as,{subtitle:"Empieza cargando los artículos del catálogo",buttonText:"",onButtonClick:()=>n("/catalog/add")}):i.jsx(i.Fragment,{children:i.jsx(is,{table:x,paginationOptions:{visible:!0},children:i.jsx(Vd,{table:x})})})},gS=()=>i.jsx(nr,{children:i.jsx(Nw,{})}),mS=()=>i.jsx("div",{className:"flex min-h-[100dvh] flex-col items-center justify-center bg-background px-4 py-12 sm:px-6 lg:px-8",children:i.jsxs("div",{className:"max-w-md mx-auto text-center",children:[i.jsx("div",{className:"w-12 h-12 mx-auto text-primary"}),i.jsx("h1",{className:"mt-4 text-3xl font-bold tracking-tight text-foreground sm:text-4xl",children:"Oops, page not found!"}),i.jsx("p",{className:"mt-4 text-muted-foreground",children:"The page you're looking for doesn't exist or has been moved."}),i.jsx("div",{className:"mt-6",children:i.jsx(G,{className:"inline-flex items-center px-4 py-2 text-sm font-medium transition-colors rounded-md shadow-sm bg-primary text-primary-foreground hover:bg-primary/90 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",children:"Go to Homepage"})})]})}),Ud=M.createContext({attributes:{role:"button",tabIndex:0,"aria-disabled":!1,"aria-pressed":void 0,"aria-roledescription":"sortable","aria-describedby":""},listeners:void 0,ref(){},isDragging:!1});function Rw(n){return n.isSorting||n.wasDragging?g0(n):!0}function Ew({id:n,children:a,isActive:r=!1,onActivate:o}){const{attributes:l,isDragging:c,listeners:d,setNodeRef:h,setActivatorNodeRef:p,transform:x,transition:v}=f0({animateLayoutChanges:Rw,id:n}),R={transform:Ga.Translate.toString(x),transition:v},y=M.useMemo(()=>({attributes:l,listeners:d,ref:p,isDragging:c}),[l,c,d,p]);return i.jsx(Ud.Provider,{value:y,children:i.jsx(pn,{id:String(n),className:he(c?"opacity-60":"opacity-100",r?"border border-destructive/30 border-b-0 border-l-4 border-l-destructive bg-destructive/5 hover:bg-destructive/5 focus-within:bg-destructive/5":"hover:bg-muted hover:focus-within:bg-accent focus-within:bg-accent","m-0"),ref:h,style:R,onClick:o,onFocusCapture:o,children:a},n)})}const Aw=({className:n})=>{const{attributes:a,isDragging:r,listeners:o,ref:l}=M.useContext(Ud);return i.jsxs(G,{ref:l,onClick:c=>{c.preventDefault()},size:"icon",variant:"link",className:he(r?"cursor-grabbing":"cursor-grab","w-4 h-4 mt-2 text-ring hover:text-muted-foreground",n),...a,...o,children:[i.jsx(hd,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:w("common.move_row")})]})};function Iw(n,a={}){const{enableDragHandleColumn:r=!1,enableSelectionColumn:o=!1,enableActionsColumn:l=!1,rowActionFn:c=void 0}=a;return M.useMemo(()=>(r&&n.unshift({id:"row_drag_handle",header:()=>null,cell:()=>i.jsx(Aw,{}),enableSorting:!1,enableHiding:!1,size:40}),o&&n.unshift({id:"select",header:({table:d})=>i.jsx(Ui,{id:"select-all",checked:d.getIsAllPageRowsSelected()||d.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:h=>d.toggleAllPageRowsSelected(!!h),"aria-label":"Seleccionar todo",className:"translate-y-[0px]"}),cell:({row:d})=>i.jsx(Ui,{id:`select-row-${d.id}`,checked:d.getIsSelected(),disabled:!d.getCanSelect(),onCheckedChange:d.getToggleSelectedHandler(),"aria-label":"Seleccionar fila",className:"mt-2"}),enableSorting:!1,enableHiding:!1,size:40}),l&&n.push({id:"row_actions",cell:d=>i.jsx(lw,{rowContext:d,actions:c}),enableSorting:!1,enableHiding:!1,size:48}),n),[l,r,o])}var Gd={exports:{}};(function(n,a){(function(r,o,l){n.exports=l(),n.exports.default=l()})("slugify",Xn,function(){var r=JSON.parse(`{"$":"dollar","%":"percent","&":"and","<":"less",">":"greater","|":"or","¢":"cent","£":"pound","¤":"currency","¥":"yen","©":"(c)","ª":"a","®":"(r)","º":"o","À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","Þ":"TH","ß":"ss","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","þ":"th","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Č":"C","č":"c","Ď":"D","ď":"d","Đ":"DJ","đ":"dj","Ē":"E","ē":"e","Ė":"E","ė":"e","Ę":"e","ę":"e","Ě":"E","ě":"e","Ğ":"G","ğ":"g","Ģ":"G","ģ":"g","Ĩ":"I","ĩ":"i","Ī":"i","ī":"i","Į":"I","į":"i","İ":"I","ı":"i","Ķ":"k","ķ":"k","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ł":"L","ł":"l","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","Ō":"O","ō":"o","Ő":"O","ő":"o","Œ":"OE","œ":"oe","Ŕ":"R","ŕ":"r","Ř":"R","ř":"r","Ś":"S","ś":"s","Ş":"S","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","Ť":"T","ť":"t","Ũ":"U","ũ":"u","Ū":"u","ū":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z","Ə":"E","ƒ":"f","Ơ":"O","ơ":"o","Ư":"U","ư":"u","Lj":"LJ","lj":"lj","Nj":"NJ","nj":"nj","Ș":"S","ș":"s","Ț":"T","ț":"t","ə":"e","˚":"o","Ά":"A","Έ":"E","Ή":"H","Ί":"I","Ό":"O","Ύ":"Y","Ώ":"W","ΐ":"i","Α":"A","Β":"B","Γ":"G","Δ":"D","Ε":"E","Ζ":"Z","Η":"H","Θ":"8","Ι":"I","Κ":"K","Λ":"L","Μ":"M","Ν":"N","Ξ":"3","Ο":"O","Π":"P","Ρ":"R","Σ":"S","Τ":"T","Υ":"Y","Φ":"F","Χ":"X","Ψ":"PS","Ω":"W","Ϊ":"I","Ϋ":"Y","ά":"a","έ":"e","ή":"h","ί":"i","ΰ":"y","α":"a","β":"b","γ":"g","δ":"d","ε":"e","ζ":"z","η":"h","θ":"8","ι":"i","κ":"k","λ":"l","μ":"m","ν":"n","ξ":"3","ο":"o","π":"p","ρ":"r","ς":"s","σ":"s","τ":"t","υ":"y","φ":"f","χ":"x","ψ":"ps","ω":"w","ϊ":"i","ϋ":"y","ό":"o","ύ":"y","ώ":"w","Ё":"Yo","Ђ":"DJ","Є":"Ye","І":"I","Ї":"Yi","Ј":"J","Љ":"LJ","Њ":"NJ","Ћ":"C","Џ":"DZ","А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ж":"Zh","З":"Z","И":"I","Й":"J","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"H","Ц":"C","Ч":"Ch","Ш":"Sh","Щ":"Sh","Ъ":"U","Ы":"Y","Ь":"","Э":"E","Ю":"Yu","Я":"Ya","а":"a","б":"b","в":"v","г":"g","д":"d","е":"e","ж":"zh","з":"z","и":"i","й":"j","к":"k","л":"l","м":"m","н":"n","о":"o","п":"p","р":"r","с":"s","т":"t","у":"u","ф":"f","х":"h","ц":"c","ч":"ch","ш":"sh","щ":"sh","ъ":"u","ы":"y","ь":"","э":"e","ю":"yu","я":"ya","ё":"yo","ђ":"dj","є":"ye","і":"i","ї":"yi","ј":"j","љ":"lj","њ":"nj","ћ":"c","ѝ":"u","џ":"dz","Ґ":"G","ґ":"g","Ғ":"GH","ғ":"gh","Қ":"KH","қ":"kh","Ң":"NG","ң":"ng","Ү":"UE","ү":"ue","Ұ":"U","ұ":"u","Һ":"H","һ":"h","Ә":"AE","ә":"ae","Ө":"OE","ө":"oe","Ա":"A","Բ":"B","Գ":"G","Դ":"D","Ե":"E","Զ":"Z","Է":"E'","Ը":"Y'","Թ":"T'","Ժ":"JH","Ի":"I","Լ":"L","Խ":"X","Ծ":"C'","Կ":"K","Հ":"H","Ձ":"D'","Ղ":"GH","Ճ":"TW","Մ":"M","Յ":"Y","Ն":"N","Շ":"SH","Չ":"CH","Պ":"P","Ջ":"J","Ռ":"R'","Ս":"S","Վ":"V","Տ":"T","Ր":"R","Ց":"C","Փ":"P'","Ք":"Q'","Օ":"O''","Ֆ":"F","և":"EV","ء":"a","آ":"aa","أ":"a","ؤ":"u","إ":"i","ئ":"e","ا":"a","ب":"b","ة":"h","ت":"t","ث":"th","ج":"j","ح":"h","خ":"kh","د":"d","ذ":"th","ر":"r","ز":"z","س":"s","ش":"sh","ص":"s","ض":"dh","ط":"t","ظ":"z","ع":"a","غ":"gh","ف":"f","ق":"q","ك":"k","ل":"l","م":"m","ن":"n","ه":"h","و":"w","ى":"a","ي":"y","ً":"an","ٌ":"on","ٍ":"en","َ":"a","ُ":"u","ِ":"e","ْ":"","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","پ":"p","چ":"ch","ژ":"zh","ک":"k","گ":"g","ی":"y","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","฿":"baht","ა":"a","ბ":"b","გ":"g","დ":"d","ე":"e","ვ":"v","ზ":"z","თ":"t","ი":"i","კ":"k","ლ":"l","მ":"m","ნ":"n","ო":"o","პ":"p","ჟ":"zh","რ":"r","ს":"s","ტ":"t","უ":"u","ფ":"f","ქ":"k","ღ":"gh","ყ":"q","შ":"sh","ჩ":"ch","ც":"ts","ძ":"dz","წ":"ts","ჭ":"ch","ხ":"kh","ჯ":"j","ჰ":"h","Ṣ":"S","ṣ":"s","Ẁ":"W","ẁ":"w","Ẃ":"W","ẃ":"w","Ẅ":"W","ẅ":"w","ẞ":"SS","Ạ":"A","ạ":"a","Ả":"A","ả":"a","Ấ":"A","ấ":"a","Ầ":"A","ầ":"a","Ẩ":"A","ẩ":"a","Ẫ":"A","ẫ":"a","Ậ":"A","ậ":"a","Ắ":"A","ắ":"a","Ằ":"A","ằ":"a","Ẳ":"A","ẳ":"a","Ẵ":"A","ẵ":"a","Ặ":"A","ặ":"a","Ẹ":"E","ẹ":"e","Ẻ":"E","ẻ":"e","Ẽ":"E","ẽ":"e","Ế":"E","ế":"e","Ề":"E","ề":"e","Ể":"E","ể":"e","Ễ":"E","ễ":"e","Ệ":"E","ệ":"e","Ỉ":"I","ỉ":"i","Ị":"I","ị":"i","Ọ":"O","ọ":"o","Ỏ":"O","ỏ":"o","Ố":"O","ố":"o","Ồ":"O","ồ":"o","Ổ":"O","ổ":"o","Ỗ":"O","ỗ":"o","Ộ":"O","ộ":"o","Ớ":"O","ớ":"o","Ờ":"O","ờ":"o","Ở":"O","ở":"o","Ỡ":"O","ỡ":"o","Ợ":"O","ợ":"o","Ụ":"U","ụ":"u","Ủ":"U","ủ":"u","Ứ":"U","ứ":"u","Ừ":"U","ừ":"u","Ử":"U","ử":"u","Ữ":"U","ữ":"u","Ự":"U","ự":"u","Ỳ":"Y","ỳ":"y","Ỵ":"Y","ỵ":"y","Ỷ":"Y","ỷ":"y","Ỹ":"Y","ỹ":"y","–":"-","‘":"'","’":"'","“":"\\"","”":"\\"","„":"\\"","†":"+","•":"*","…":"...","₠":"ecu","₢":"cruzeiro","₣":"french franc","₤":"lira","₥":"mill","₦":"naira","₧":"peseta","₨":"rupee","₩":"won","₪":"new shequel","₫":"dong","€":"euro","₭":"kip","₮":"tugrik","₯":"drachma","₰":"penny","₱":"peso","₲":"guarani","₳":"austral","₴":"hryvnia","₵":"cedi","₸":"kazakhstani tenge","₹":"indian rupee","₺":"turkish lira","₽":"russian ruble","₿":"bitcoin","℠":"sm","™":"tm","∂":"d","∆":"delta","∑":"sum","∞":"infinity","♥":"love","元":"yuan","円":"yen","﷼":"rial","ﻵ":"laa","ﻷ":"laa","ﻹ":"lai","ﻻ":"la"}`),o=JSON.parse('{"bg":{"Й":"Y","Ц":"Ts","Щ":"Sht","Ъ":"A","Ь":"Y","й":"y","ц":"ts","щ":"sht","ъ":"a","ь":"y"},"de":{"Ä":"AE","ä":"ae","Ö":"OE","ö":"oe","Ü":"UE","ü":"ue","ß":"ss","%":"prozent","&":"und","|":"oder","∑":"summe","∞":"unendlich","♥":"liebe"},"es":{"%":"por ciento","&":"y","<":"menor que",">":"mayor que","|":"o","¢":"centavos","£":"libras","¤":"moneda","₣":"francos","∑":"suma","∞":"infinito","♥":"amor"},"fr":{"%":"pourcent","&":"et","<":"plus petit",">":"plus grand","|":"ou","¢":"centime","£":"livre","¤":"devise","₣":"franc","∑":"somme","∞":"infini","♥":"amour"},"pt":{"%":"porcento","&":"e","<":"menor",">":"maior","|":"ou","¢":"centavo","∑":"soma","£":"libra","∞":"infinito","♥":"amor"},"uk":{"И":"Y","и":"y","Й":"Y","й":"y","Ц":"Ts","ц":"ts","Х":"Kh","х":"kh","Щ":"Shch","щ":"shch","Г":"H","г":"h"},"vi":{"Đ":"D","đ":"d"},"da":{"Ø":"OE","ø":"oe","Å":"AA","å":"aa","%":"procent","&":"og","|":"eller","$":"dollar","<":"mindre end",">":"større end"},"nb":{"&":"og","Å":"AA","Æ":"AE","Ø":"OE","å":"aa","æ":"ae","ø":"oe"},"it":{"&":"e"},"nl":{"&":"en"},"sv":{"&":"och","Å":"AA","Ä":"AE","Ö":"OE","å":"aa","ä":"ae","ö":"oe"}}');function l(c,d){if(typeof c!="string")throw new Error("slugify: string argument expected");d=typeof d=="string"?{replacement:d}:d||{};var h=o[d.locale]||{},p=d.replacement===void 0?"-":d.replacement,x=d.trim===void 0?!0:d.trim,v=c.normalize().split("").reduce(function(R,y){var b=h[y];return b===void 0&&(b=r[y]),b===void 0&&(b=y),b===p&&(b=" "),R+b.replace(d.remove||/[^\w\s$*_+~.()'"!\-:@]+/g,"")},"");return d.strict&&(v=v.replace(/[^A-Za-z0-9\s]/g,"")),x&&(v=v.trim()),v=v.replace(/\s+/g,p),d.lower&&(v=v.toLowerCase()),v}return l.extend=function(c){Object.assign(r,c)},l})})(Gd);var Fw=Gd.exports;const Mw=m0(Fw),Ur=()=>{const n=$r(),a=Mn(),r=M.useCallback(c=>`${n.getApiUrl()}/quotes/${c}/report`,[n]),o=M.useCallback(c=>`quote-${Mw(c.reference,{lower:!0,strict:!0,locale:"en",trim:!0})}.pdf`,[]),l={useList:c=>{const d=$r(),h=Mn(),{pagination:p,status:x="draft",quickSearchTerm:v=void 0,enabled:R=!0,queryOptions:y}=c;return No({queryKey:h().data().resource("quotes").action("list").params(c).get(),queryFn:()=>d.getList({resource:"quotes",quickSearchTerm:v,filters:x!=="all"?[{field:"status",operator:"eq",value:x}]:[{field:"status",operator:"ne",value:"archived"}],pagination:p}),enabled:R,queryOptions:y})},useCreate:()=>{const c=Jt();return cb({mutationFn:d=>{const{date:h}=d,p=dn.generateNewID().object.toString();return n.createOne({resource:"quotes",data:{...d,date:new Date(h).toISOString().slice(0,10),status:"draft",id:p}})},onSuccess:()=>{c.invalidateQueries({queryKey:["data","default","quotes"]})}})},useUpdate:c=>{const d=Jt();return en({mutationKey:a().data().resource("quotes").action("one").id(c).params().get(),mutationFn:h=>n.updateOne({resource:"quotes",id:c,data:h}),onSuccess:()=>{d.invalidateQueries({queryKey:["data","default","quotes"]})}})},useSetStatus:()=>{const c=Jt();return en({mutationFn:d=>{const{id:h,newStatus:p}=d;return n.custom({url:`${n.getApiUrl()}/quotes/${h}/setStatus`,method:"put",data:{newStatus:p}})},onSuccess:()=>{c.invalidateQueries({queryKey:["data","default","quotes"]})}})},useDuplicate:()=>{const c=Jt();return en({mutationFn:d=>{const{id:h}=d;return n.custom({url:`${n.getApiUrl()}/quotes/${h}/duplicate`,method:"post"})},onSuccess:()=>{c.invalidateQueries({queryKey:["data","default","quotes"]})}})},useSentTo:c=>{const d=Jt();return en({mutationKey:a().data().resource("quotes").action("one").id(c).params().get(),mutationFn:h=>{const{sent_date:p}=h;return n.custom({url:`${n.getApiUrl()}/quotes/${c}/send`,method:"put",data:{sent_date:p}})},onSuccess:()=>{d.invalidateQueries({queryKey:["data","default","quotes"]})}})},useOne:(c,d)=>wd({queryKey:a().data().resource("quotes").action("one").id(c).params().get(),queryFn:()=>n.getOne({resource:"quotes",id:String(c)}),enabled:!!c,...d}),getQuotePDFDownloadURL:r,getQuotePDFFilename:o,useReport:()=>{const c=n.getApiAuthorization(),[d,h]=M.useState(void 0),{download:p,...x}=Ec({headers:{Authorization:c},customHandleDownload:M.useCallback(R=>{const y=[R],b=new Blob(y,{type:"application/octet-stream"});return h(b),!0},[h])}),v=M.useCallback(R=>p(l.getQuotePDFDownloadURL(R),""),[p]);return{...x,preview:v,report:d}},useDownloader:()=>{const c=n.getApiAuthorization(),d=Ec({headers:{Authorization:c}});return{...d,download:(p,x)=>{const v=l.getQuotePDFDownloadURL(p);return d.download(v,x)}}}};return l},hS=()=>{const n=zt(),{toast:a}=_n(),{useCreate:r}=Ur(),{mutate:o,isPending:l}=r(),c=M.useMemo(()=>({date:new Date(Date.now()).toUTCString(),customer_reference:"",customer_information:""}),[]),d=Ji({mode:"onBlur",defaultValues:c,resolver:Pc(Fn.object({customer_reference:Fn.string(),date:Fn.date().required(),customer_information:Fn.string().required()}),{messages:{es:$d}})}),{formState:h,reset:p,getValues:x,handleSubmit:v}=d,{isSubmitting:R,isDirty:y}=h;Mo({isDirty:y});const b=async E=>{try{o(E,{onError:j=>{console.debug(j),a({title:"Error",description:j.message,variant:"destructive"})},onSuccess:j=>{p(x()),a({title:"Cotización creada",variant:"default"}),n(`/quotes/edit/${j.id}`,{relative:"path"})}})}finally{}};return R?i.jsx(Dn,{title:"Guardando ajustes"}):l?i.jsx(Dn,{}):i.jsx(es,{...d,children:i.jsx("form",{onSubmit:v(b),children:i.jsxs("div",{className:"mx-auto grid max-w-[90rem] flex-1 auto-rows-max gap-6",children:[i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx(Uc,{}),i.jsx("h1",{className:"flex-1 text-xl font-semibold tracking-tight shrink-0 whitespace-nowrap sm:grow-0",children:w("quotes.create.title")})]}),i.jsx("div",{className:"grid w-6/12 gap-6 mx-auto",children:i.jsxs(Ha,{className:"md:col-span-4",title:w("quotes.create.form_groups.general.title"),description:w("quotes.create.form_groups.general.desc"),footerActions:i.jsxs("div",{className:"flex items-stretch justify-between flex-1",children:[i.jsx(G,{size:"sm",variant:"outline",onClick:()=>n("/quotes"),children:w("common.discard")}),i.jsx(wo,{size:"sm",label:w("common.continue")})]}),children:[i.jsx(mn,{required:!0,name:"customer_reference",label:w("quotes.form_fields.customer_reference.label"),description:w("quotes.form_fields.customer_reference.desc"),placeholder:w("quotes.form_fields.customer_reference.placeholder")}),i.jsx(Gc,{required:!0,label:w("quotes.form_fields.date.label"),description:w("quotes.form_fields.date.desc"),placeholder:w("quotes.form_fields.date.placeholder"),name:"date"}),i.jsx(hn,{}),i.jsx(qt,{rows:4,className:"row-span-2",name:"customer_information",required:!0,label:w("quotes.form_fields.customer_information.label"),description:w("quotes.form_fields.customer_information.desc"),placeholder:w("quotes.form_fields.customer_information.placeholder")})]})})]})})})},Va=(n,a=!1)=>{const{discount:r,tax:o,subtotal_price:l}=n||{},c=$t.create(r||{amount:null,scale:2});if(c.isFailure)throw c.error;const d=c.object,h=$t.create(o||{amount:null,scale:2});if(h.isFailure)throw h.error;const p=h.object,x=Tt.create(l||{amount:null,scale:2});if(x.isFailure)throw x.error;const v=a?Dw(n.items).convertScale(2):x.object,R=v.percentage(d.toNumber()).convertScale(2),y=v.subtract(R).convertScale(2),b=y.percentage(p.toNumber()).convertScale(2),E=y.add(b).convertScale(2);return{subtotal_price:v,discount:n.discount,discount_price:R,before_tax_price:y,tax:p,tax_price:b,total_price:E}},Dw=n=>{let a=Tt.create({amount:0,scale:2}).object;return n&&n.map(r=>{const o=eo(r);a=a.add(o.total_price)}),a},eo=n=>{const{quantity:a,unit_price:r,discount:o}=n||{};if((!a||a&&a.amount===null)&&(!r||r&&r.amount===null)&&(!o||o&&o.amount===null))return{quantity:xn.create({amount:null,scale:0}).object,unit_price:Tt.create({amount:null,scale:2}).object,subtotal_price:Tt.create({amount:null,scale:2}).object,discount:$t.create({amount:null,scale:2}).object,total_price:Tt.create({amount:null,scale:2}).object};const l=xn.create(a);if(l.isFailure)throw l.error;const c=l.object,d=Tt.create(r);if(d.isFailure)throw d.error;const h=d.object,p=$t.create(o);if(p.isFailure)throw p.error;const x=p.object,v=h.multiply(c.toNumber()),R=v.subtract(v.percentage(x.toNumber()));return{quantity:c,unit_price:h,subtotal_price:v,discount:x,total_price:R}},Tw=()=>{const{id:n}=h0();return n};var Ki={exports:{}};/** + */function Gi(n,a){return n?nw(n)?M.createElement(n,a):n:null}function nw(n){return rw(n)||typeof n=="function"||iw(n)}function rw(n){return typeof n=="function"&&(()=>{const a=Object.getPrototypeOf(n);return a.prototype&&a.prototype.isReactComponent})()}function iw(n){return typeof n=="object"&&typeof n.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(n.$$typeof.description)}function Dd(n){const a={state:{},onStateChange:()=>{},renderFallbackValue:null,...n},[r]=M.useState(()=>({current:Yb(a)})),[o,l]=M.useState(()=>r.current.initialState);return r.current.setOptions(c=>({...c,...n,state:{...o,...n.state},onStateChange:d=>{l(d),n.onStateChange==null||n.onStateChange(d)}})),r.current}const sw=({buttonText:n,title:a="",content:r,className:o=""})=>i.jsx("div",{className:`flex items-baseline justify-center mr-4 font-medium ${o}`,children:i.jsxs(rr,{children:[i.jsx(Tc,{asChild:!0,children:i.jsxs(G,{variant:"link",className:"inline-flex items-center font-medium group",children:[i.jsx("span",{className:"underline-offset-4 group-hover:underline",children:n}),i.jsx(U_,{className:"w-4 h-4 ml-1 text-muted-foreground"})]})}),i.jsxs(ir,{className:"sm:max-w-[425px]",children:[i.jsx(sr,{children:i.jsx(ar,{children:a})}),i.jsxs(no,{className:"grid gap-4 py-2",children:[r,i.jsx(or,{children:i.jsx(Vi,{asChild:!0,children:i.jsx(G,{type:"button",children:w("common.close")})})})]})]})]})});function aw(n){let o=0;for(let v=0;v>v*8&255;l+=("00"+R.toString(16)).substr(-2)}const c=parseInt(l.substr(1,2),16),d=parseInt(l.substr(3,2),16),h=parseInt(l.substr(5,2),16),p=`#${(c*.7|0).toString(16).padStart(2,"0")}${(d*.7|0).toString(16).padStart(2,"0")}${(h*.7|0).toString(16).padStart(2,"0")}`,x=`#${Math.min(255,Math.floor(c+(255-c)*.7)).toString(16).padStart(2,"0")}${Math.min(255,Math.floor(d+(255-d)*.7)).toString(16).padStart(2,"0")}${Math.min(255,Math.floor(h+(255-h)*.7)).toString(16).padStart(2,"0")}`;return[p,x]}const Td=({label:n,className:a})=>{const[r,o]=aw(n);return i.jsx(ro,{className:a,style:a?{}:{backgroundColor:o,color:r},children:n})};function Ld({table:n,header:a,className:r}){return a.column.getCanSort()?i.jsx("div",{className:he("flex items-center space-x-2",r),children:i.jsxs(Yi,{children:[i.jsx(Qi,{asChild:!0,children:i.jsxs(G,{"aria-label":a.column.getIsSorted()==="desc"?w("common.sort_desc_description"):a.column.getIsSorted()==="asc"?w("common.sort_asc_description"):w("sort_none_description"),size:"sm",variant:"ghost",className:"-ml-3 h-8 data-[state=open]:bg-accent font-bold text-muted-foreground",children:[Gi(a.column.columnDef.header,a.getContext()),a.column.getIsSorted()==="desc"?i.jsx(bc,{className:"w-4 h-4 ml-2","aria-hidden":"true"}):a.column.getIsSorted()==="asc"?i.jsx(wc,{className:"w-4 h-4 ml-2","aria-hidden":"true"}):i.jsx(q0,{className:"w-4 h-4 ml-2 text-muted-foreground/30","aria-hidden":"true"})]})}),i.jsxs(Xi,{align:"start",children:[a.column.getCanSort()&&i.jsxs(i.Fragment,{children:[i.jsxs(Lr,{onClick:()=>a.column.toggleSorting(!1),"aria-label":w("common.sort_asc"),children:[i.jsx(wc,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70","aria-hidden":"true"}),w("common.sort_asc")]}),i.jsxs(Lr,{onClick:()=>a.column.toggleSorting(!0),"aria-label":w("common.sort_desc"),children:[i.jsx(bc,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70","aria-hidden":"true"}),w("common.sort_desc")]})]}),a.column.getCanSort()&&a.column.getCanHide()&&i.jsx(io,{}),a.column.getCanHide()&&i.jsxs(Lr,{onClick:()=>a.column.toggleVisibility(!1),"aria-label":w("Hide"),children:[i.jsx(md,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70","aria-hidden":"true"}),w("Hide")]})]})]})}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:he("data-[state=open]:bg-accent tracking-wide text-ellipsis",r),children:a.isPlaceholder?null:Gi(a.column.columnDef.header,a.getContext())}),!1]})}function ow({table:n,className:a,enablePageSizeSelector:r=!0,visible:o="auto"}){const l=M.useMemo(()=>o===!0,[o]),c=M.useMemo(()=>o==="auto",[o]);return!l||c&&n.getPageCount()<1?null:i.jsxs("div",{className:a,children:[i.jsx("div",{className:"flex-1 text-base text-muted-foreground",children:n.getSelectedRowModel().rows.length>0&&i.jsx(i.Fragment,{children:w("common.rows_selected_of_total",{count:n.getFilteredSelectedRowModel().rows.length,total:n.getFilteredRowModel().rows.length})})}),i.jsxs("div",{className:"flex justify-between space-x-6 lg:space-x-8",children:[r&&i.jsxs("div",{className:"flex items-center space-x-2 grow",children:[i.jsx("p",{className:"text-sm font-medium",children:w("common.rows_per_page")}),i.jsxs(so,{value:`${n.getState().pagination.pageSize}`,onValueChange:d=>{n.setPageSize(Number(d))},children:[i.jsx(ao,{className:"h-8 w-[70px]",children:i.jsx(oo,{placeholder:n.getState().pagination.pageSize})}),i.jsx(lo,{side:"top",children:G_.map(d=>i.jsx(Or,{value:`${d}`,children:d},d))})]})]}),i.jsxs("div",{className:he("flex space-x-2 flex-1",r?"justify-end":"justify-between"),children:[i.jsx("div",{className:"flex w-[150px] items-center justify-start",children:i.jsx("p",{className:"text-sm font-medium ",children:w("common.num_page_of_total",{count:n.getState().pagination.pageIndex+1,total:n.getPageCount()})})}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsxs(G,{type:"button",variant:"outline",className:"hidden w-8 h-8 p-0 lg:flex",onClick:()=>n.setPageIndex(H_),disabled:!n.getCanPreviousPage(),children:[i.jsx("span",{className:"sr-only",children:w("common.go_to_first_page")}),i.jsx($0,{className:"w-4 h-4"})]}),i.jsxs(G,{type:"button",variant:"outline",className:"w-8 h-8 p-0",onClick:()=>n.previousPage(),disabled:!n.getCanPreviousPage(),children:[i.jsx("span",{className:"sr-only",children:w("common.go_to_prev_page")}),i.jsx(K_,{className:"w-4 h-4"})]}),i.jsxs(G,{type:"button",variant:"outline",className:"w-8 h-8 p-0",onClick:()=>n.nextPage(),disabled:!n.getCanNextPage(),children:[i.jsx("span",{className:"sr-only",children:w("common.go_to_next_page")}),i.jsx(W_,{className:"w-4 h-4"})]}),i.jsxs(G,{type:"button",variant:"outline",className:"hidden w-8 h-8 p-0 lg:flex",onClick:()=>n.setPageIndex(n.getPageCount()+1),disabled:!n.getCanNextPage(),children:[i.jsx("span",{className:"sr-only",children:w("common.go_to_last_page")}),i.jsx(z0,{className:"w-4 h-4"})]})]})]})]})]})}function is({table:n,title:a,description:r,caption:o,paginationOptions:l,headerOptions:c={visible:!0},children:d,className:h,contentClassName:p,footerClassName:x,rowClassName:v,cellClassName:R,onRowClick:y,activeRowIndex:b}){var j;const E=c==null?void 0:c.visible;return i.jsxs(Le,{className:h,children:[(a||r)&&i.jsxs(pt,{className:"pb-0",children:[i.jsx(Ge,{children:a}),i.jsx(Ze,{children:r})]}),i.jsxs(Oe,{className:he("pt-6",p),children:[d&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex space-x-2",children:d}),i.jsx(hn,{className:"my-4"})]}),i.jsxs(uo,{children:[typeof o<"u"&&i.jsx(Y_,{children:o}),E&&n.getHeaderGroups().length&&i.jsx(co,{children:n.getHeaderGroups().map(D=>i.jsx(pn,{className:v,children:D.headers.map(F=>i.jsx(fo,{colSpan:F.colSpan,style:{width:F.getSize()===Number.MAX_SAFE_INTEGER?"auto":F.getSize()},children:i.jsx(Ld,{table:n,header:F})},F.id))},D.id))}),i.jsx(go,{children:(j=n.getRowModel().rows)!=null&&j.length?n.getRowModel().rows.map(D=>i.jsx(pn,{onClick:()=>{y&&y(D)},tabIndex:0,"data-state":D.getIsSelected()&&"selected",className:he(D.getIsSelected()||b===D.index?"bg-accent cursor-pointer hover:bg-accent":"cursor-pointer",v),children:D.getVisibleCells().map(F=>i.jsx(qr,{className:R,style:{width:F.column.getSize()===Number.MAX_SAFE_INTEGER?"auto":F.column.getSize()},children:Gi(F.column.columnDef.cell,F.getContext())},F.id))},D.id)):i.jsx(pn,{className:v,children:i.jsx(qr,{className:he("h-24 text-center",R),colSpan:n.getAllColumns.length,children:"No hay datos para mostrar"})})})]})]}),i.jsx(Dt,{className:x,children:i.jsx(ow,{className:"flex-1",table:n,...l})})]})}function lw({actions:n,rowContext:a}){return i.jsxs(Yi,{children:[i.jsx(Qi,{asChild:!0,children:i.jsxs(G,{size:"icon",variant:"outline",className:"w-8 h-8",children:[i.jsx(G0,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"sr-only",children:w("common.open_menu")})]})}),i.jsxs(Xi,{align:"end",children:[i.jsxs(Lc,{children:[w("common.actions")," "]}),n&&n(a).map((r,o)=>r.label==="-"?i.jsx(io,{},o):i.jsxs(Lr,{onClick:l=>r.onClick?r.onClick(a,l):null,children:[r.icon&&i.jsx(i.Fragment,{children:r.icon}),r.label,r.shortcut&&i.jsx(Q_,{children:r.shortcut})]},o))]})]})}function uw(){return{id:"select",header:({table:n})=>i.jsx(Ui,{id:"select-all",checked:n.getIsAllPageRowsSelected()||n.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:a=>n.toggleAllPageRowsSelected(!!a),"aria-label":"Seleccionar todo",className:"translate-y-[2px]"}),cell:({row:n})=>i.jsx(Ui,{id:`select-row-${n.id}`,checked:n.getIsSelected(),onCheckedChange:a=>{n.toggleSelected(!!a)},"aria-label":"Seleccionar file",className:"translate-y-[2px]"}),enableSorting:!1,enableHiding:!1}}function ss({columnCount:n,rowCount:a=10,searchableColumnCount:r=0,filterableColumnCount:o=0,showViewOptions:l=!0,cellWidths:c=["auto"],withPagination:d=!0,shrinkZero:h=!1,className:p,...x}){return i.jsxs("div",{className:he("w-full space-y-2.5 overflow-auto",p),...x,children:[i.jsxs("div",{className:"flex items-center justify-between w-full p-1 space-x-2 overflow-auto",children:[i.jsxs("div",{className:"flex items-center flex-1 space-x-2",children:[r>0?Array.from({length:r}).map((v,R)=>i.jsx(ut,{className:"w-40 h-7 lg:w-60"},R)):null,o>0?Array.from({length:o}).map((v,R)=>i.jsx(ut,{className:"h-7 w-[4.5rem] border-dashed"},R)):null]}),l?i.jsx(ut,{className:"ml-auto hidden h-7 w-[4.5rem] lg:flex"}):null]}),i.jsx("div",{className:"border rounded-md",children:i.jsxs(uo,{children:[i.jsx(co,{children:Array.from({length:1}).map((v,R)=>i.jsx(pn,{className:"hover:bg-transparent",children:Array.from({length:n}).map((y,b)=>i.jsx(fo,{style:{width:c[b],minWidth:h?c[b]:"auto"},children:i.jsx(ut,{className:"w-full h-6"})},b))},R))}),i.jsx(go,{children:Array.from({length:a}).map((v,R)=>i.jsx(pn,{className:"hover:bg-transparent",children:Array.from({length:n}).map((y,b)=>i.jsx(qr,{style:{width:c[b],minWidth:h?c[b]:"auto"},children:i.jsx(ut,{className:"w-full h-6"})},b))},R))})]})}),d?i.jsxs("div",{className:"flex items-center justify-between w-full gap-4 p-1 overflow-auto sm:gap-8",children:[i.jsx(ut,{className:"w-40 h-7 shrink-0"}),i.jsxs("div",{className:"flex items-center gap-4 sm:gap-6 lg:gap-8",children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(ut,{className:"w-24 h-7"}),i.jsx(ut,{className:"h-7 w-[4.5rem]"})]}),i.jsx("div",{className:"flex items-center justify-center text-sm font-medium",children:i.jsx(ut,{className:"w-20 h-7"})}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(ut,{className:"hidden size-7 lg:block"}),i.jsx(ut,{className:"size-7"}),i.jsx(ut,{className:"size-7"}),i.jsx(ut,{className:"hidden size-7 lg:block"})]})]})]}):null]})}const as=({title:n="Esto está muy vacío",subtitle:a="Empieza solicitando la carga del catálogo",buttonText:r="Solicitar carga del catálogo",onButtonClick:o=()=>{},actions:l=()=>i.jsx(i.Fragment,{})})=>i.jsxs("div",{className:"text-center",children:[i.jsx("svg",{className:"w-12 h-12 mx-auto text-slate-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:i.jsx("path",{vectorEffect:"non-scaling-stroke",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z"})}),i.jsx("h3",{className:"mt-2 text-lg font-semibold text-slate-900",children:n}),i.jsx("p",{className:"mt-1 text-base text-slate-500",children:a}),i.jsxs("div",{className:"items-center mt-6",children:[l&&i.jsx(i.Fragment,{children:l}),!l&&i.jsxs(G,{className:"my-4",onClick:o,children:[i.jsx(yo,{}),r]})]})]}),cw=vo("flex h-10 w-full rounded-md bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",{variants:{variant:{default:"border border-input ring-offset-background focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ",outline:"focus-visible:border focus-visible:border-input"}},defaultVariants:{variant:"default"}}),Hi=n=>{const{name:a,label:r,hint:o,description:l,placeholder:c,className:d,disabled:h,defaultValue:p,rules:x,readOnly:v,scale:R,variant:y}=n,{control:b}=lr(),[E,j]=M.useState(""),D={input:F=>{if(typeof F!="object")return F;const q=$t.create(F);if(q.isFailure)throw q.error;const $=q.object.toString();return E.endsWith(",")?$.replace(/.0$/,","):$},output:(F,q,$)=>{const{value:Q}=$??{value:null};j(Q??"");const O=$t.createFromFormattedValue(Q);if(O.isFailure)throw O.error;return O.object.toObject()}};return i.jsx(mo,{defaultValue:p,control:b,name:a,disabled:h,rules:{max:100,min:0,...x},render:({field:F})=>{const q=D.input(F.value),$=h||F.disabled,Q=!!((x==null?void 0:x.required)??!1);return i.jsxs(ho,{className:he(d,"space-y-3"),children:[r&&i.jsx(po,{label:r,hint:o,required:Q}),i.jsx(xo,{children:i.jsx(Oc,{name:F.name,ref:F.ref,onBlur:F.onBlur,disabled:$,readOnly:v,className:he(cw({variant:y,className:d})),groupSeparator:".",decimalSeparator:",",placeholder:c,allowDecimals:R!==0,decimalsLimit:R,decimalScale:R,step:1,value:q,onValueChange:(O,k,H)=>F.onChange(D.output(O,k,H))})}),l&&i.jsx(_o,{children:l}),i.jsx(bo,{})]})}})},dw=vo("flex h-10 w-full rounded-md bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",{variants:{variant:{default:"border border-input ring-offset-background focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ",outline:"focus-visible:border focus-visible:border-input"}},defaultVariants:{variant:"default"}}),fw=n=>{const{name:a,label:r,hint:o,description:l,placeholder:c,className:d,disabled:h,defaultValue:p,rules:x,readOnly:v,scale:R,variant:y}=n,{control:b}=lr(),[E,j]=M.useState(""),D={input:F=>{if(typeof F!="object")return F;const q=xn.create(F);if(q.isFailure)throw q.error;const $=q.object.toString();return E.endsWith(",")?$.replace(/.0$/,","):$},output:(F,q,$)=>{const{value:Q}=$??{value:null};j(Q??"");const O=xn.createFromFormattedValue(Q);if(O.isFailure)throw O.error;return O.object.toObject()}};return i.jsx(mo,{defaultValue:p,control:b,name:a,disabled:h,rules:x,render:({field:F})=>{const q=D.input(F.value),$=h||F.disabled,Q=!!((x==null?void 0:x.required)??!1);return i.jsxs(ho,{className:he(d,"space-y-3"),children:[r&&i.jsx(po,{label:r,hint:o,required:Q}),i.jsx(xo,{children:i.jsx(Oc,{name:F.name,ref:F.ref,onBlur:F.onBlur,disabled:$,readOnly:v,className:he(dw({variant:y,className:d})),groupSeparator:".",decimalSeparator:",",placeholder:c,allowDecimals:R!==0,decimalsLimit:R,decimalScale:R,step:1,value:q,onValueChange:(O,k,H)=>F.onChange(D.output(O,k,H))})}),l&&i.jsx(_o,{children:l}),i.jsx(bo,{})]})}})},gw=vo("",{variants:{variant:{default:"",ghost:"border-0 focus-visible:border focus-visible:border-input focus-visible:ring-0 focus-visible:ring-offset-0 "}},defaultVariants:{variant:"default"}}),mn=n=>{const{name:a,label:r,hint:o,description:l,placeholder:c,className:d,disabled:h,rules:p,required:x,type:v,variant:R}=n,{control:y}=lr();return i.jsx(mo,{control:y,name:a,disabled:h,rules:{required:x,...p},render:({field:b,fieldState:E})=>{const j=!!((p==null?void 0:p.required)??x);return i.jsxs(ho,{className:he(d,"space-y-3"),children:[r&&i.jsx(po,{label:r,hint:o,required:j}),i.jsx(xo,{className:"block",children:i.jsx(Zi,{type:v,placeholder:c,className:he(E.error?"border-destructive focus-visible:ring-destructive":"",gw({variant:R,className:d})),...b})}),l&&i.jsx(_o,{children:l}),i.jsx(bo,{})]})}})},mw=(n,a)=>{const r=M.useRef();return M.useEffect(()=>{r.current=n},[n,a]),r.current},Od=(n,a,r,o)=>n.getFixedT(a,r,o),hw=(n,a,r,o)=>M.useCallback(Od(n,a,r,o),[n,a,r,o]),Fo=(n,a={})=>{var Q,O,k,H;const{i18n:r}=a,{i18n:o,defaultNS:l}=M.useContext(X_)||{},c=r||o||Z_();if(c&&!c.reportNamespaces&&(c.reportNamespaces=new J_),!c){gc(c,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const W=(se,ce)=>Ia(ce)?ce:n0(ce)&&Ia(ce.defaultValue)?ce.defaultValue:Array.isArray(se)?se[se.length-1]:se,B=[W,{},!1];return B.t=W,B.i18n={},B.ready=!1,B}(Q=c.options.react)!=null&&Q.wait&&gc(c,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const d={...t0(),...c.options.react,...a},{useSuspense:h,keyPrefix:p}=d;let x=l||((O=c.options)==null?void 0:O.defaultNS);x=Ia(x)?[x]:x||["translation"],(H=(k=c.reportNamespaces).addUsedNamespaces)==null||H.call(k,x);const v=(c.isInitialized||c.initializedStoreOnce)&&x.every(W=>e0(W,c,d)),R=hw(c,a.lng||null,d.nsMode==="fallback"?x:x[0],p),y=()=>R,b=()=>Od(c,a.lng||null,d.nsMode==="fallback"?x:x[0],p),[E,j]=M.useState(y);let D=x.join();a.lng&&(D=`${a.lng}${D}`);const F=mw(D),q=M.useRef(!0);M.useEffect(()=>{const{bindI18n:W,bindI18nStore:B}=d;q.current=!0,!v&&!h&&(a.lng?mc(c,a.lng,x,()=>{q.current&&j(b)}):hc(c,x,()=>{q.current&&j(b)})),v&&F&&F!==D&&q.current&&j(b);const se=()=>{q.current&&j(b)};return W&&(c==null||c.on(W,se)),B&&(c==null||c.store.on(B,se)),()=>{q.current=!1,c&&(W==null||W.split(" ").forEach(ce=>c.off(ce,se))),B&&c&&B.split(" ").forEach(ce=>c.store.off(ce,se))}},[c,D]),M.useEffect(()=>{q.current&&v&&j(y)},[c,p,v]);const $=[E,c,v];if($.t=E,$.i18n=c,$.ready=v,v||!v&&!h)return $;throw new Promise(W=>{a.lng?mc(c,a.lng,x,()=>W()):hc(c,x,()=>W())})};function pw(n=!1){const[a,r]=M.useState(n);return[a,()=>r(l=>!l)]}const Tn=()=>{const n=M.useContext(r0);if(n===null)throw new Error("useDataTableContext must be used within a DataTableProvider");return n};function os({data:n,columns:a,pageCount:r,enableSorting:o=!1,enableHiding:l=!1,enableRowSelection:c=!1,initialState:d,onPaginationChange:h,meta:p}){const{pagination:x,setPagination:v,sorting:R}=Tn(),[y,b]=In.useState({}),[E,j]=In.useState((d==null?void 0:d.columnVisibility)||{}),D=Q=>{if(typeof Q=="function"){const O=Q(x);v(O)}h&&h(Q)},F=Q=>{},q=M.useCallback(()=>{const Q=a;return c&&Q.unshift(uw()),Q},[a,c]);return{table:Dd({data:n,columns:q(),pageCount:r??-1,meta:p,getCoreRowModel:Fd(),initialState:d,state:{pagination:x,sorting:R,columnVisibility:E,rowSelection:y},enableRowSelection:c,onRowSelectionChange:b,manualSorting:!0,enableSorting:o,getSortedRowModel:tw(),onSortingChange:F,enableHiding:l,onColumnVisibilityChange:j,manualPagination:!0,onPaginationChange:D,manualFiltering:!0,getFilteredRowModel:ew(),getFacetedRowModel:Zb(),getFacetedUniqueValues:Jb(),debugTable:!1,debugHeaders:!1,debugColumns:!1,defaultColumn:{minSize:0,size:Number.MAX_SAFE_INTEGER,maxSize:Number.MAX_SAFE_INTEGER}})}}const xw=({setSize:n,setControllerCallback:a,setPercentageCallback:r,setErrorCallback:o})=>l=>{if(!l.ok)throw Error(`${l.status} ${l.type} ${l.statusText}`);if(!l.body)throw Error("ReadableStream not yet supported in this browser.");const c=l.body,d=l.headers.get("content-encoding"),h=l.headers.get(d?"x-file-size":"content-length"),p=parseInt(h||"0",10);n(()=>p);let x=0;const v=new ReadableStream({start(R){a(R);const y=c.getReader();async function b(){return y.read().then(({done:E,value:j})=>E?R.close():(x+=(j==null?void 0:j.byteLength)||0,j&&R.enqueue(j),r({loaded:x,total:p}),b())).catch(E=>(o(E),y.cancel("Cancelled"),R.error(E)))}return b()}});return new Response(v)},Rc=(n,a,r)=>{const o=[n],l=new Blob(o,{type:r||"application/octet-stream"});if(typeof window.navigator.msSaveBlob<"u")return window.navigator.msSaveBlob(l,a);const c=window.URL&&window.URL.createObjectURL?window.URL.createObjectURL(l):window.webkitURL.createObjectURL(l),d=document.createElement("a");return d.style.display="none",d.href=c,d.setAttribute("download",a),typeof d.download>"u"&&d.setAttribute("target","_blank"),document.body.appendChild(d),d.click(),setTimeout(()=>{document.body.removeChild(d),window.URL.revokeObjectURL(c)},200)};function Ec({customHandleDownload:n,...a}={}){var Q;let r=!1;try{r=process?!!((Q=process==null?void 0:process.env)!=null&&Q.REACT_APP_DEBUG_MODE):!1}catch{r=!1}const[o,l]=M.useState(0),[c,d]=M.useState(0),[h,p]=M.useState(0),[x,v]=M.useState(null),[R,y]=M.useState(!1),b=M.useRef(null),E=M.useCallback(({loaded:O,total:k})=>{const H=Math.round(O/k*100);d(()=>H)},[]),j=M.useCallback(O=>{const k={"Failed to execute 'enqueue' on 'ReadableStreamDefaultController': Cannot enqueue a chunk into an errored readable stream":"Download canceled","The user aborted a request.":"Download timed out"};v(()=>({errorMessage:k[O.message]?k[O.message]:O.message}))},[]),D=M.useCallback(O=>{b.current=O},[]),F=M.useCallback(()=>{b.current&&b.current.error()},[]),q=M.useCallback(()=>{D(null),l(()=>0),d(()=>0),p(()=>0),y(()=>!1)},[D]),$=M.useCallback(async(O,k,H=0,W={})=>{if(R)return null;q(),v(()=>null),y(()=>!0);const B=setInterval(()=>l(rt=>rt+1),r?1:1e3),se=xw({setSize:p,setControllerCallback:D,setPercentageCallback:E,setErrorCallback:j}),ce=new AbortController,Y=setTimeout(()=>{H>0&&ce.abort()},H),Re=n||Rc;try{const rt=await fetch(O,{method:"GET",...a,...W,signal:ce.signal}),je=await se(rt).blob();Re(je,k),q()}catch(rt){q(),v(ee=>{const{message:je}=rt;return je!=="Failed to fetch"?{errorMessage:je}:ee}),clearTimeout(Y)}finally{clearInterval(B)}},[R,q,r,D,E,j,a,n]);return M.useMemo(()=>({elapsed:o,percentage:c,size:h,download:$,cancel:F,error:x,isInProgress:R,jsDownload:Rc}),[o,c,h,$,F,x,R])}const vw=()=>{const{i18n:n}=Fo();return Pd({locale:n.language})},Pd=n=>{const{locale:a}=n,r=M.useCallback(c=>{if(c==null)return"";const{amount:d,scale:h,currency_code:p}=c;return new Intl.NumberFormat(a??"ES",{style:"currency",currency:p,currencyDisplay:"symbol",useGrouping:!0,maximumFractionDigits:h}).format(d===null?0:pc({amount:d,scale:h}))},[a]),o=M.useCallback(c=>{if(c==null)return"";const{amount:d,scale:h}=c;return new Intl.NumberFormat("es",{minimumFractionDigits:h,useGrouping:!0}).format(d===null?0:pc({amount:d,scale:h}))},[a]),l=M.useCallback(c=>{if(c==null)return"";const{amount:d,scale:h}=c;return new Intl.NumberFormat(a,{style:"decimal",minimumFractionDigits:h}).format(d===null?0:d)},[a]);return{formatCurrency:r,formatNumber:o,formatPercentage:l}};function kd(n){const[a,r]=M.useState(!1);return M.useEffect(()=>{function o(c){r(c.matches)}const l=matchMedia(n);return l.addEventListener("change",o),r(l.matches),()=>l.removeEventListener("change",o)},[n]),a}const _w=()=>{const n=M.useContext(i0);if(n===null)throw new Error("useWarnAboutChange must be used within a UnsavedWarnProvider");return n},Mo=({isDirty:n=!1,title:a=w("hooks.use_unsaved_changes_notifier.title"),subtitle:r=w("hooks.use_unsaved_changes_notifier.subtitle"),confirmText:o=w("hooks.use_unsaved_changes_notifier.confirm_text"),cancelText:l=w("hooks.use_unsaved_changes_notifier.cancel_text"),onConfirm:c,onCancel:d,type:h="warning"})=>{const p=s0(n),{show:x}=_w(),v=M.useCallback(()=>n?new Promise(R=>{x({title:a,subtitle:r,confirmText:o,cancelText:l,type:h,onConfirm:()=>{R(!0),c==null||c()},onCancel:()=>{R(!1),d==null||d()}})}):Promise.resolve(!0),[l,o,n,d,c,x,r,a,h]);return M.useEffect(()=>{p.state==="blocked"&&v().then(R=>{R?p.proceed():p.reset()})},[p,v]),M.useEffect(()=>(n&&(window.onbeforeunload=()=>r),()=>{window.onbeforeunload=null}),[n,r]),{confirm:v}},qd=n=>{const{isSubmitting:a,isLoading:r,isValidating:o}=a0();return i.jsx(wo,{disabled:a||r||o,...n})};qd.displayName="FormSubmitButton";const $d={"any.unknown":"{{#label}}: no está permitido","any.invalid":"{{#label}}: contiene un valor invalido","any.empty":"{{#label}}: no está permitido que sea vacío","any.required":"{{#label}}: es un campo requerido","any.allowOnly":"{{#label}}: debería ser uno de las siguientes variantes: {{valids}}","any.default":"emitió un error cuando se ejecutó el metodo default","alternatives.base":"{{#label}}: no coincide con ninguna de las alternativas permitidas","array.base":"{{#label}}: debe ser un array","array.includes":"{{#label}}: en la posición {{pos}} no coincide con ninguno de los tipos permitidos","array.includesSingle":'{{#label}}: el valor de "{{!key}}" no coincide con ninguno de los tipos permitidos',"array.includesOne":"{{#label}}: en la posición {{pos}} falló porque {{reason}}","array.includesOneSingle":'{{#label}}: el valor "{{!key}}" falló porque {{reason}}',"array.includesRequiredUnknowns":"{{#label}}: no contiene valor/es requerido/s: {{unknownMisses}} ","array.includesRequiredKnowns":"{{#label}}: no contiene: {{knownMisses}}","array.includesRequiredBoth":"{{#label}}: no contiene {{knownMisses}} y {{unknownMisses}} otros valores requeridos","array.excludes":"{{#label}}: en la posición {{pos}} contiene un valor excluído","array.excludesSingle":'{{#label}}: el valor "{{!key}}" contiene un valor excluído',"array.min":"{{#label}}: debe contener al menos {{limit}} items","array.max":"{{#label}}: debe contener máximo {{limit}} items","array.length":"{{#label}}: debe contener exactamente {{limit}} items","array.ordered":"{{#label}}: en la posición {{pos}} falló porque {{reason}}","array.orderedLength":"{{#label}}: en la posición {{pos}} falló porque el array debre contener como máximo {{limit}} items","array.sparse":"{{#label}}: no debe ser un array esparcido","array.unique":"{{#label}}: posición {{pos}} contiene un valor duplicado","boolean.base":"{{#label}}: debe ser un valor verdadero/falso o si/no","binary.base":"{{#label}}: debe ser un buffer o un string","binary.min":"{{#label}}: debe ser como mínimo de {{limit}} bytes","binary.max":"{{#label}}: debe ser como máximo de {{limit}} bytes","binary.length":"{{#label}}: debe tener exactamente {{limit}} bytes","date.base":"{{#label}}: debe ser una cantidad de milisegundos o una fecha en cadena de texto válida","date.min":'{{#label}}: debe ser mayor o igual a "{{limit}}"',"date.max":'{{#label}}: debe ser menor o igual que "{{limit}}"',"date.isoDate":"{{#label}}: debe ser una fecha en formato ISO 8601","date.ref":'referencia a "{{ref}}", que no es una fecha válida',"function.base":"{{#label}}: debe ser una función","object.base":"{{#label}}: debe ser un objeto","object.child":'hijo "{{!key}}" falló porque {{reason}}',"object.min":"{{#label}}: debe tener como mínimo {{limit}} hijo","object.max":"{{#label}}: debe tener menos o a lo sumo {{limit}} hijo","object.length":"{{#label}}: debe tener máximo {{limit}} hijo/s","object.allowUnknown":"no está permitido","object.with":'peer faltante: "{{peer}}"',"object.without":'conflicto con peer prohibido: "{{peer}}"',"object.missing":"{{#label}}: debe contener al menos uno de: {{peers}}","object.xor":"{{#label}}: contiene un conflicto con alguno de: {{peers}}","object.or":"{{#label}}: debe contener al menos uno de: {{peers}}","object.and":"contiene {{present}} sin el requerido: {{missing}}","object.nand":'!!"{{main}}" no debe existir simultáneamente con {{peers}}',"object.assert":'!!"{{ref}}" falló validacion porque "{{ref}}" falló a {{message}}',"object.rename.multiple":'{{#label}}: no se puede renombrar el hijo "{{from}}" porque múltiples re-nombramientos estan deshabilitados y otra clave fue renombrada a "{{to}}"',"object.rename.override":'{{#label}}: no se puede renombrar el hijo "{{from}}" porque la sobre escritura esta deshabilitada y el target "{{to}}" existe',"object.type":'{{#label}}: debe ser una instancia de "{{type}}"',"number.base":"{{#label}}: debe ser un número","number.min":"{{#label}}: debe ser mayor o igual que {{limit}}","number.max":"{{#label}}: debe ser menor o igual que {{limit}}","number.less":"{{#label}}: debe ser menor a {{limit}}","number.greater":"{{#label}}: debe ser mayor a {{limit}}","number.float":"{{#label}}: debe ser un numero flotante","number.integer":"{{#label}}: debe ser un número entero","number.negative":"{{#label}}: debe ser un número negativo","number.positive":"{{#label}}: debe ser un número positivo","number.precision":"{{#label}}: no debe tener mas de {{limit}} decimales","number.ref":'{{#label}}: referencia a "{{ref}}" que no es un número',"number.multiple":"{{#label}}: debe ser un múltiplo de {{multiple}}","string.base":"{{#label}}: debe ser una cadena de texto","string.empty":"{{#label}}: no está permitido que sea vacío","string.min":"{{#label}}: debe ser mínimo de {{limit}} caracteres de largo","string.max":"{{#label}}: debe ser de máximo {{limit}} caracteres de largo","string.length":"{{#label}}: debe ser exactamente de {{limit}} caracteres de largo","string.alphanum":"{{#label}}: debe contener solo letras y números","string.token":"{{#label}}: debe contener solo letras, números y guines bajos","string.regex.base":'{{#label}}: el valor "{{!value}}" no coincide con el pattern requerido: {{pattern}}',"string.regex.name":'{{#label}}: el valor "{{!value}}" no coincide con el nombre de pattern {{name}}',"string.email":"{{#label}}: debe ser un email válido","string.uri":"{{#label}}: debe sre una uri válida","string.uriCustomScheme":"{{#label}}: debe ser una uri válida con el esquema concidiente con el patrón {{scheme}}","string.isoDate":"{{#label}}: debe ser una fecha en formato ISO 8601 válida","string.guid":"{{#label}}: debe ser un GUID valido","string.hex":"{{#label}}: debe contener solo caracteres hexadecimales","string.hostname":"{{#label}}: deber ser un hostname válido","string.lowercase":"{{#label}}: solo debe contener minúsculas","string.uppercase":"{{#label}}: solo debe contener mayúsculas","string.trim":"{{#label}}: no debe tener espacios en blanco delante o atrás","string.creditCard":"{{#label}}: debe ser una tarjeta de crédito","string.ref":'Referencia "{{ref}}" que no es un número',"string.ip":"{{#label}}: debe ser una dirección ip válida con un CDIR {{cidr}}","string.ipVersion":"{{#label}}: debe ser una dirección ip válida de una de las siguientes versiones {{version}} con un CDIR {{cidr}}","object.unknown":"{{#label}}: es un campo no es permitido","luxon.lt":"{{#label}}: must be before {{#date}}","luxon.gt":"{{#label}}: must be after {{#date}}","luxon.lte":"{{#label}}: must be same as or before {{#date}}","luxon.gte":"{{#label}}: must be same as or after {{#date}}"},Bi=[{code:"en",name:"English",flag:()=>i.jsx("span",{className:"fi fi-gb"})},{code:"es",name:"Español",flag:()=>i.jsx("span",{className:"fi fi-es"})}],oS=()=>{var R,y,b,E;const{t:n,i18n:a}=Fo(),[r,o]=M.useState(a.language),l=zt(),{toast:c}=_n();M.useEffect(()=>{const j=navigator.language.split("-")[0],D=Bi.find(F=>F.code===j);D&&d(D.code)},[]);const d=j=>{a.changeLanguage(j),o(j)},{mutate:h,status:p}=k0({onSuccess:j=>{const{success:D,error:F}=j;!D&&F&&x.setError("root",F),D&&l("/quotes",{replace:!0})},onError:j=>{const{message:D}=j;c({description:D,title:"Error"}),console.log(j)}}),x=Ji({mode:"onBlur",defaultValues:{email:"",password:""},resolver:Pc(Fn.object({email:Fn.string().email({tlds:{allow:!1}}).required(),password:Fn.string().min(4).alphanum().required()}),{messages:$d})}),v=async j=>{h({email:j.email,password:j.password},{})};return i.jsxs(o0,{variant:"full",className:"p-0 lg:grid lg:min-h-[600px] lg:grid-cols-2 xl:min-h-[800px] h-screen ",children:[i.jsx("div",{className:"flex items-center justify-center py-12 ",children:i.jsxs("div",{className:"mx-auto grid w-[650px] gap-6 relative ",children:[i.jsx("div",{className:"absolute flex space-x-2 top-4 right-4 ",children:i.jsxs(Yi,{children:[i.jsx(Qi,{asChild:!0,children:i.jsxs(G,{variant:"outline",className:"w-[140px] justify-start",children:[i.jsx("span",{className:"mr-2",children:(R=Bi.find(j=>j.code===r))==null?void 0:R.flag()}),(y=Bi.find(j=>j.code===r))==null?void 0:y.name,i.jsx(kc,{className:"w-4 h-4 ml-auto opacity-50"})]})}),i.jsx(Xi,{className:"w-[140px]",children:Bi.map(j=>i.jsxs(Lr,{onSelect:()=>d(j.code),children:[i.jsx("span",{className:"mr-2",children:j.flag()}),j.name]},j.code))})]})}),i.jsxs(Le,{className:"px-12 py-6 bg-muted/50",children:[i.jsxs(pt,{children:[i.jsx(l0,{className:"inline-block m-auto mb-6 align-middle max-w-32"}),i.jsx(Ge,{children:i.jsx(le,{i18nKey:"login_page.title"})}),i.jsx(Ze,{children:i.jsx(le,{i18nKey:"login_page.description"})})]}),i.jsx(Oe,{children:i.jsx(es,{...x,children:i.jsx("form",{onSubmit:x.handleSubmit(v),children:i.jsxs("div",{className:"grid items-start gap-6",children:[i.jsx("div",{className:"grid gap-6",children:i.jsx(mn,{required:!0,disabled:p==="pending",name:"email",label:n("login_page.email_label"),type:"email",placeholder:n("login_page.email_placeholder")})}),i.jsxs("div",{className:"grid gap-6",children:[i.jsx(mn,{required:!0,disabled:p==="pending",name:"password",label:n("login_page.password_label"),type:"password"}),i.jsxs("div",{className:"mb-4 -mt-2 text-sm",children:[i.jsx(le,{i18nKey:"login_page.forgotten_password"}),i.jsx("br",{}),i.jsx(xc,{to:"https://uecko.com/distribuidores",className:"underline",children:i.jsx(le,{i18nKey:"login_page.contact_us"})})]})]}),((b=x.formState.errors.root)==null?void 0:b.message)&&i.jsxs(qc,{variant:"destructive",children:[i.jsx(fd,{className:"w-4 h-4"}),i.jsx($c,{children:i.jsx(le,{i18nKey:"common.error"})}),i.jsx(zc,{children:(E=x.formState.errors.root)==null?void 0:E.message})]}),i.jsx(qd,{className:"w-full",disabled:p==="pending"}),i.jsxs("div",{className:"mt-4 text-sm text-center",children:[i.jsx(le,{i18nKey:"login_page.become_dealer"}),i.jsx("br",{}),i.jsx(xc,{to:"https://uecko.com/distribuidores",className:"underline",children:i.jsx(le,{i18nKey:"login_page.contact_us"})}),i.jsx("br",{}),i.jsxs("p",{className:"mx-auto mt-4 -mb-6 text-xs text-muted-foreground/50",children:["v.","1.1.8"]})]})]})})})})]}),i.jsx("img",{className:"block w-11/12 mx-auto aspect-auto",src:"/img/uecko-footer_logos.jpg"})]})}),i.jsx("div",{className:"hidden bg-muted lg:block",children:i.jsx("img",{src:"/img/nara2.jpg",alt:"Image",width:"1920",height:"1080",className:"h-full w-full object-cover dark:brightness-[0.2] dark:grayscale"})})]})},bw=n=>{const{onSuccess:a,onError:r,...o}=n||{},l=Jt(),c=Mn(),{logout:d}=Fc(),h=zt(),{toast:p}=_n();return en({mutationKey:c().auth().action("logout").get(),mutationFn:d,onSuccess:async(x,v,R)=>{l.clear();const{success:y,redirectTo:b}=x;y&&b&&h(b||"/"),a&&a(x,v,R)},onError:(x,v,R)=>{const{message:y}=x;p({title:"Error",description:y,variant:"destructive"}),r&&r(x,v,R)},...o})},lS=()=>{const{mutate:n}=bw({});return M.useEffect(()=>n(),[n]),i.jsx(Dn,{})},ww=M.createContext(null),Sw=({children:n})=>{const[a,r]=Bc();return i.jsx(ww.Provider,{value:{pagination:a,setPagination:r},children:n})},uS=({children:n})=>i.jsx(ts,{children:i.jsx(Sw,{children:i.jsxs(zr,{className:"catalog-layout",children:[i.jsx(Br,{}),i.jsx(Vr,{children:n})]})})}),zd=n=>{const a=$r(),r=Mn(),{pagination:o,searchTerm:l=[],enabled:c=!0,queryOptions:d}=n;return No({queryKey:r().data().resource("catalog").action("list").params(n).get(),queryFn:()=>a.getList({resource:"catalog",quickSearchTerm:l,pagination:o}),enabled:c,queryOptions:d})};function Bd({table:n,className:a,children:r,...o}){const{globalFilter:l,isFiltered:c,setGlobalFilter:d,resetGlobalFilter:h}=Tn(),p=In.useRef(null),[x,v]=In.useState(""),R=In.useCallback(E=>{E.key==="Enter"&&x.trim()&&(E.preventDefault(),d(j=>[...j,x.trim()]),v("")),E.key==="Backspace"&&!x&&l.length>0&&(E.preventDefault(),d(j=>j.slice(0,-1)))},[l,x]),y=In.useCallback(E=>{d(j=>j.filter(D=>D!==E))},[]),b=In.useCallback(()=>{var E;x.trim()&&(d(j=>[...j,x.trim()]),v(""),(E=p.current)==null||E.focus())},[x]);return i.jsx(u0,{children:i.jsxs("div",{className:"w-full space-y-2",...o,children:[i.jsxs("div",{className:he("relative flex items-center flex-1 p-2 space-x-2 border rounded-md",c?"border-primary":"border-input"),children:[i.jsx(Vc,{className:he("w-4 h-4 text-gray-500")}),i.jsxs("div",{className:"flex flex-wrap items-center flex-1 gap-2",children:[l&&l.map(E=>i.jsxs(ro,{variant:"default",className:"px-1 text-base font-normal rounded-sm",children:[E,i.jsxs(G,{variant:"ghost",onClick:()=>y(E),className:"h-auto p-0 px-1 ml-1 hover:bg-transparent",children:[i.jsxs(He,{children:[i.jsx(Ke,{asChild:!0,children:i.jsx(Ua,{className:"w-4 h-4"})}),i.jsx(We,{children:i.jsx("p",{children:w("catalog.filter.badget_remove_tooltip")})})]}),i.jsx("span",{className:"sr-only",children:w("catalog.filter.badget_remove_tooltip")})]})]},E)),i.jsxs("div",{className:"flex-1 flex items-center min-w-[300px]",children:[i.jsx("input",{ref:p,value:x,onChange:E=>v(E.target.value),onKeyDown:R,placeholder:w("common.filter.input_placeholder"),className:"flex-1 w-full h-8 bg-transparent outline-none placeholder:text-muted-foreground"}),i.jsxs(tr,{children:[c&&i.jsxs(He,{children:[i.jsx(Ke,{asChild:!0,children:i.jsxs(G,{variant:"ghost",onClick:()=>h(),className:"h-8 px-2 transition-all lg:px-3 text-primary",children:[i.jsx(Ua,{className:"w-4 h-4 mr-2"}),w("common.filter.reset_filter")]})}),i.jsx(We,{children:i.jsx("p",{children:w("common.filter.reset_filter")})})]}),i.jsxs(He,{children:[i.jsx(Ke,{asChild:!0,children:i.jsxs(G,{variant:"default",size:"icon",disabled:!x,onClick:b,className:"w-8 h-8 p-0 transition-all",children:[i.jsx(yo,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:w("common.filter.button_add_term")})]})}),i.jsx(We,{children:i.jsx("p",{children:w("common.filter.button_add_term_tooltip")})})]})]})]})]})]}),i.jsx("p",{className:"text-sm text-muted-foreground",children:w("common.filter.help_text")})]})})}const jw=()=>{const n=zt(),{pagination:a,globalFilter:r,isFiltered:o}=Tn(),{data:l,isPending:c,isError:d,error:h}=zd({pagination:{pageIndex:a.pageIndex,pageSize:a.pageSize},searchTerm:r}),p=M.useMemo(()=>[{id:"id",accessorKey:"id"},{id:"id_article",accessorKey:"id_article"},{id:"catalog_name",accessorKey:"catalog_name"},{id:"description",accessorKey:"description",header:()=>i.jsx(i.Fragment,{children:w("catalog.list.columns.description")})},{id:"points",accessorKey:"points",header:()=>i.jsx("div",{className:"text-right",children:w("catalog.list.columns.points")}),cell:({renderValue:v})=>i.jsx("div",{className:"text-right",children:v()})},{id:"retail_price",accessorKey:"retail_price",header:()=>i.jsx("div",{className:"text-right",children:w("catalog.list.columns.retail_price")}),cell:({row:v})=>{const R=Tt.create(v.original.retail_price).object;return i.jsx("div",{className:"text-right",children:R.toFormat()})}}],[]),{table:x}=os({data:(l==null?void 0:l.items)??[],columns:p,pageCount:(l==null?void 0:l.total_pages)??-1,initialState:{columnVisibility:{id:!1,id_article:!1,catalog_name:!1}}});return d?i.jsx(ur,{subtitle:h.message}):c?i.jsx(Le,{children:i.jsx(Oe,{children:i.jsx(ss,{columnCount:6,searchableColumnCount:1,filterableColumnCount:2,shrinkZero:!0})})}):(l==null?void 0:l.total_items)===0&&!o?i.jsx(as,{subtitle:"Empieza cargando los artículos del catálogo",buttonText:"",onButtonClick:()=>n("/catalog/add")}):i.jsx(is,{table:x,paginationOptions:{visible:!0},children:i.jsx(Bd,{table:x})})},cS=()=>i.jsxs(nr,{children:[i.jsx("div",{className:"flex items-center justify-between space-y-2",children:i.jsx("div",{children:i.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:i.jsx(le,{i18nKey:"catalog.list.title"})})})}),i.jsx(jw,{})]}),dS=()=>{const{data:n,status:a}=c0();return i.jsxs(zr,{children:[i.jsx(Br,{}),i.jsx(Vr,{children:a==="success"?i.jsx("div",{className:"flex items-center",children:i.jsx("h1",{className:"text-lg font-semibold md:text-2xl",children:`${w("dashboard.welcome")}, ${n==null?void 0:n.name}`})}):i.jsx(ut,{className:"w-[100px] h-[20px] rounded-full"})})]})},fS=({children:n})=>i.jsx(ts,{children:i.jsxs(zr,{className:"dealers-layout",children:[i.jsx(Br,{}),i.jsx(Vr,{children:n})]})});function Cw({table:n}){return i.jsxs(Yi,{children:[i.jsx(Qi,{asChild:!0,children:i.jsxs(G,{variant:"outline",size:"sm",className:"hidden h-8 ml-auto lg:flex",children:[i.jsx(X0,{className:"w-4 h-4 mr-2"}),"Columnas"]})}),i.jsxs(Xi,{align:"end",className:"w-[150px]",children:[i.jsx(Lc,{children:"Columnas"}),i.jsx(io,{}),n.getAllColumns().filter(a=>typeof a.accessorFn<"u"&&a.getCanHide()).map(a=>i.jsx(d0,{className:"capitalize",checked:a.getIsVisible(),onCheckedChange:r=>a.toggleVisibility(!!r),children:i.jsx(i.Fragment,{children:a.columnDef.header})},a.id))]})]})}function Vd({table:n,className:a,children:r,...o}){const{globalFilter:l,isFiltered:c,setGlobalFilter:d,resetGlobalFilter:h}=Tn(),p=x=>{const v=String(x.target.value);v===""?h():d([v])};return i.jsxs("div",{className:he("flex w-full items-center justify-between space-x-2 overflow-auto p-1",a),...o,children:[i.jsxs("div",{className:"flex items-center flex-1 space-x-2",children:[i.jsx(Vc,{className:"w-4 h-4 text-gray-500"}),i.jsx(Zi,{placeholder:w("common.filter.input_placeholder"),value:l,onChange:p,className:he("h-8 w-full transition-all")},"global-filter"),c&&i.jsxs(G,{variant:"outline",onClick:()=>h(),className:"h-8 px-2 transition-all lg:px-3",children:[i.jsx(Ua,{className:"w-4 h-4 mr-2"}),w("common.filter.reset_filter")]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[r,n.options.enableHiding&&i.jsx(Cw,{table:n})]})]})}const yw=n=>{const a=$r(),r=Mn(),{pagination:o,searchTerm:l=void 0,enabled:c=!0,queryOptions:d}=n;return No({queryKey:r().data().resource("dealer").action("list").params(n).get(),queryFn:()=>a.getList({resource:"dealers",quickSearchTerm:l,pagination:o}),enabled:c,queryOptions:d})},Nw=()=>{const n=zt(),{pagination:a,globalFilter:r,isFiltered:o}=Tn(),{data:l,isPending:c,isError:d,error:h}=yw({pagination:{pageIndex:a.pageIndex,pageSize:a.pageSize},searchTerm:r}),p=M.useMemo(()=>[{id:"id",accessorKey:"id",enableResizing:!1,size:10},{id:"name",accessorKey:"name",enableResizing:!1,size:10}],[]),{table:x}=os({data:(l==null?void 0:l.items)??[],columns:p,pageCount:(l==null?void 0:l.total_pages)??-1});return d?i.jsx(ur,{subtitle:h.message}):c?i.jsx(Le,{children:i.jsx(Oe,{children:i.jsx(ss,{columnCount:6,searchableColumnCount:1,filterableColumnCount:2,shrinkZero:!0})})}):(l==null?void 0:l.total_items)===0&&!o?i.jsx(as,{subtitle:"Empieza cargando los artículos del catálogo",buttonText:"",onButtonClick:()=>n("/catalog/add")}):i.jsx(i.Fragment,{children:i.jsx(is,{table:x,paginationOptions:{visible:!0},children:i.jsx(Vd,{table:x})})})},gS=()=>i.jsx(nr,{children:i.jsx(Nw,{})}),mS=()=>i.jsx("div",{className:"flex min-h-[100dvh] flex-col items-center justify-center bg-background px-4 py-12 sm:px-6 lg:px-8",children:i.jsxs("div",{className:"max-w-md mx-auto text-center",children:[i.jsx("div",{className:"w-12 h-12 mx-auto text-primary"}),i.jsx("h1",{className:"mt-4 text-3xl font-bold tracking-tight text-foreground sm:text-4xl",children:"Oops, page not found!"}),i.jsx("p",{className:"mt-4 text-muted-foreground",children:"The page you're looking for doesn't exist or has been moved."}),i.jsx("div",{className:"mt-6",children:i.jsx(G,{className:"inline-flex items-center px-4 py-2 text-sm font-medium transition-colors rounded-md shadow-sm bg-primary text-primary-foreground hover:bg-primary/90 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",children:"Go to Homepage"})})]})}),Ud=M.createContext({attributes:{role:"button",tabIndex:0,"aria-disabled":!1,"aria-pressed":void 0,"aria-roledescription":"sortable","aria-describedby":""},listeners:void 0,ref(){},isDragging:!1});function Rw(n){return n.isSorting||n.wasDragging?g0(n):!0}function Ew({id:n,children:a,isActive:r=!1,onActivate:o}){const{attributes:l,isDragging:c,listeners:d,setNodeRef:h,setActivatorNodeRef:p,transform:x,transition:v}=f0({animateLayoutChanges:Rw,id:n}),R={transform:Ga.Translate.toString(x),transition:v},y=M.useMemo(()=>({attributes:l,listeners:d,ref:p,isDragging:c}),[l,c,d,p]);return i.jsx(Ud.Provider,{value:y,children:i.jsx(pn,{id:String(n),className:he(c?"opacity-60":"opacity-100",r?"border border-destructive/30 border-b-0 border-l-4 border-l-destructive bg-destructive/5 hover:bg-destructive/5 focus-within:bg-destructive/5":"hover:bg-muted hover:focus-within:bg-accent focus-within:bg-accent","m-0"),ref:h,style:R,onClick:o,onFocusCapture:o,children:a},n)})}const Aw=({className:n})=>{const{attributes:a,isDragging:r,listeners:o,ref:l}=M.useContext(Ud);return i.jsxs(G,{ref:l,onClick:c=>{c.preventDefault()},size:"icon",variant:"link",className:he(r?"cursor-grabbing":"cursor-grab","w-4 h-4 mt-2 text-ring hover:text-muted-foreground",n),...a,...o,children:[i.jsx(hd,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:w("common.move_row")})]})};function Iw(n,a={}){const{enableDragHandleColumn:r=!1,enableSelectionColumn:o=!1,enableActionsColumn:l=!1,rowActionFn:c=void 0}=a;return M.useMemo(()=>(r&&n.unshift({id:"row_drag_handle",header:()=>null,cell:()=>i.jsx(Aw,{}),enableSorting:!1,enableHiding:!1,size:40}),o&&n.unshift({id:"select",header:({table:d})=>i.jsx(Ui,{id:"select-all",checked:d.getIsAllPageRowsSelected()||d.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:h=>d.toggleAllPageRowsSelected(!!h),"aria-label":"Seleccionar todo",className:"translate-y-[0px]"}),cell:({row:d})=>i.jsx(Ui,{id:`select-row-${d.id}`,checked:d.getIsSelected(),disabled:!d.getCanSelect(),onCheckedChange:d.getToggleSelectedHandler(),"aria-label":"Seleccionar fila",className:"mt-2"}),enableSorting:!1,enableHiding:!1,size:40}),l&&n.push({id:"row_actions",cell:d=>i.jsx(lw,{rowContext:d,actions:c}),enableSorting:!1,enableHiding:!1,size:48}),n),[l,r,o])}var Gd={exports:{}};(function(n,a){(function(r,o,l){n.exports=l(),n.exports.default=l()})("slugify",Xn,function(){var r=JSON.parse(`{"$":"dollar","%":"percent","&":"and","<":"less",">":"greater","|":"or","¢":"cent","£":"pound","¤":"currency","¥":"yen","©":"(c)","ª":"a","®":"(r)","º":"o","À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","Þ":"TH","ß":"ss","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","þ":"th","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Č":"C","č":"c","Ď":"D","ď":"d","Đ":"DJ","đ":"dj","Ē":"E","ē":"e","Ė":"E","ė":"e","Ę":"e","ę":"e","Ě":"E","ě":"e","Ğ":"G","ğ":"g","Ģ":"G","ģ":"g","Ĩ":"I","ĩ":"i","Ī":"i","ī":"i","Į":"I","į":"i","İ":"I","ı":"i","Ķ":"k","ķ":"k","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ł":"L","ł":"l","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","Ō":"O","ō":"o","Ő":"O","ő":"o","Œ":"OE","œ":"oe","Ŕ":"R","ŕ":"r","Ř":"R","ř":"r","Ś":"S","ś":"s","Ş":"S","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","Ť":"T","ť":"t","Ũ":"U","ũ":"u","Ū":"u","ū":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z","Ə":"E","ƒ":"f","Ơ":"O","ơ":"o","Ư":"U","ư":"u","Lj":"LJ","lj":"lj","Nj":"NJ","nj":"nj","Ș":"S","ș":"s","Ț":"T","ț":"t","ə":"e","˚":"o","Ά":"A","Έ":"E","Ή":"H","Ί":"I","Ό":"O","Ύ":"Y","Ώ":"W","ΐ":"i","Α":"A","Β":"B","Γ":"G","Δ":"D","Ε":"E","Ζ":"Z","Η":"H","Θ":"8","Ι":"I","Κ":"K","Λ":"L","Μ":"M","Ν":"N","Ξ":"3","Ο":"O","Π":"P","Ρ":"R","Σ":"S","Τ":"T","Υ":"Y","Φ":"F","Χ":"X","Ψ":"PS","Ω":"W","Ϊ":"I","Ϋ":"Y","ά":"a","έ":"e","ή":"h","ί":"i","ΰ":"y","α":"a","β":"b","γ":"g","δ":"d","ε":"e","ζ":"z","η":"h","θ":"8","ι":"i","κ":"k","λ":"l","μ":"m","ν":"n","ξ":"3","ο":"o","π":"p","ρ":"r","ς":"s","σ":"s","τ":"t","υ":"y","φ":"f","χ":"x","ψ":"ps","ω":"w","ϊ":"i","ϋ":"y","ό":"o","ύ":"y","ώ":"w","Ё":"Yo","Ђ":"DJ","Є":"Ye","І":"I","Ї":"Yi","Ј":"J","Љ":"LJ","Њ":"NJ","Ћ":"C","Џ":"DZ","А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ж":"Zh","З":"Z","И":"I","Й":"J","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"H","Ц":"C","Ч":"Ch","Ш":"Sh","Щ":"Sh","Ъ":"U","Ы":"Y","Ь":"","Э":"E","Ю":"Yu","Я":"Ya","а":"a","б":"b","в":"v","г":"g","д":"d","е":"e","ж":"zh","з":"z","и":"i","й":"j","к":"k","л":"l","м":"m","н":"n","о":"o","п":"p","р":"r","с":"s","т":"t","у":"u","ф":"f","х":"h","ц":"c","ч":"ch","ш":"sh","щ":"sh","ъ":"u","ы":"y","ь":"","э":"e","ю":"yu","я":"ya","ё":"yo","ђ":"dj","є":"ye","і":"i","ї":"yi","ј":"j","љ":"lj","њ":"nj","ћ":"c","ѝ":"u","џ":"dz","Ґ":"G","ґ":"g","Ғ":"GH","ғ":"gh","Қ":"KH","қ":"kh","Ң":"NG","ң":"ng","Ү":"UE","ү":"ue","Ұ":"U","ұ":"u","Һ":"H","һ":"h","Ә":"AE","ә":"ae","Ө":"OE","ө":"oe","Ա":"A","Բ":"B","Գ":"G","Դ":"D","Ե":"E","Զ":"Z","Է":"E'","Ը":"Y'","Թ":"T'","Ժ":"JH","Ի":"I","Լ":"L","Խ":"X","Ծ":"C'","Կ":"K","Հ":"H","Ձ":"D'","Ղ":"GH","Ճ":"TW","Մ":"M","Յ":"Y","Ն":"N","Շ":"SH","Չ":"CH","Պ":"P","Ջ":"J","Ռ":"R'","Ս":"S","Վ":"V","Տ":"T","Ր":"R","Ց":"C","Փ":"P'","Ք":"Q'","Օ":"O''","Ֆ":"F","և":"EV","ء":"a","آ":"aa","أ":"a","ؤ":"u","إ":"i","ئ":"e","ا":"a","ب":"b","ة":"h","ت":"t","ث":"th","ج":"j","ح":"h","خ":"kh","د":"d","ذ":"th","ر":"r","ز":"z","س":"s","ش":"sh","ص":"s","ض":"dh","ط":"t","ظ":"z","ع":"a","غ":"gh","ف":"f","ق":"q","ك":"k","ل":"l","م":"m","ن":"n","ه":"h","و":"w","ى":"a","ي":"y","ً":"an","ٌ":"on","ٍ":"en","َ":"a","ُ":"u","ِ":"e","ْ":"","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","پ":"p","چ":"ch","ژ":"zh","ک":"k","گ":"g","ی":"y","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","฿":"baht","ა":"a","ბ":"b","გ":"g","დ":"d","ე":"e","ვ":"v","ზ":"z","თ":"t","ი":"i","კ":"k","ლ":"l","მ":"m","ნ":"n","ო":"o","პ":"p","ჟ":"zh","რ":"r","ს":"s","ტ":"t","უ":"u","ფ":"f","ქ":"k","ღ":"gh","ყ":"q","შ":"sh","ჩ":"ch","ც":"ts","ძ":"dz","წ":"ts","ჭ":"ch","ხ":"kh","ჯ":"j","ჰ":"h","Ṣ":"S","ṣ":"s","Ẁ":"W","ẁ":"w","Ẃ":"W","ẃ":"w","Ẅ":"W","ẅ":"w","ẞ":"SS","Ạ":"A","ạ":"a","Ả":"A","ả":"a","Ấ":"A","ấ":"a","Ầ":"A","ầ":"a","Ẩ":"A","ẩ":"a","Ẫ":"A","ẫ":"a","Ậ":"A","ậ":"a","Ắ":"A","ắ":"a","Ằ":"A","ằ":"a","Ẳ":"A","ẳ":"a","Ẵ":"A","ẵ":"a","Ặ":"A","ặ":"a","Ẹ":"E","ẹ":"e","Ẻ":"E","ẻ":"e","Ẽ":"E","ẽ":"e","Ế":"E","ế":"e","Ề":"E","ề":"e","Ể":"E","ể":"e","Ễ":"E","ễ":"e","Ệ":"E","ệ":"e","Ỉ":"I","ỉ":"i","Ị":"I","ị":"i","Ọ":"O","ọ":"o","Ỏ":"O","ỏ":"o","Ố":"O","ố":"o","Ồ":"O","ồ":"o","Ổ":"O","ổ":"o","Ỗ":"O","ỗ":"o","Ộ":"O","ộ":"o","Ớ":"O","ớ":"o","Ờ":"O","ờ":"o","Ở":"O","ở":"o","Ỡ":"O","ỡ":"o","Ợ":"O","ợ":"o","Ụ":"U","ụ":"u","Ủ":"U","ủ":"u","Ứ":"U","ứ":"u","Ừ":"U","ừ":"u","Ử":"U","ử":"u","Ữ":"U","ữ":"u","Ự":"U","ự":"u","Ỳ":"Y","ỳ":"y","Ỵ":"Y","ỵ":"y","Ỷ":"Y","ỷ":"y","Ỹ":"Y","ỹ":"y","–":"-","‘":"'","’":"'","“":"\\"","”":"\\"","„":"\\"","†":"+","•":"*","…":"...","₠":"ecu","₢":"cruzeiro","₣":"french franc","₤":"lira","₥":"mill","₦":"naira","₧":"peseta","₨":"rupee","₩":"won","₪":"new shequel","₫":"dong","€":"euro","₭":"kip","₮":"tugrik","₯":"drachma","₰":"penny","₱":"peso","₲":"guarani","₳":"austral","₴":"hryvnia","₵":"cedi","₸":"kazakhstani tenge","₹":"indian rupee","₺":"turkish lira","₽":"russian ruble","₿":"bitcoin","℠":"sm","™":"tm","∂":"d","∆":"delta","∑":"sum","∞":"infinity","♥":"love","元":"yuan","円":"yen","﷼":"rial","ﻵ":"laa","ﻷ":"laa","ﻹ":"lai","ﻻ":"la"}`),o=JSON.parse('{"bg":{"Й":"Y","Ц":"Ts","Щ":"Sht","Ъ":"A","Ь":"Y","й":"y","ц":"ts","щ":"sht","ъ":"a","ь":"y"},"de":{"Ä":"AE","ä":"ae","Ö":"OE","ö":"oe","Ü":"UE","ü":"ue","ß":"ss","%":"prozent","&":"und","|":"oder","∑":"summe","∞":"unendlich","♥":"liebe"},"es":{"%":"por ciento","&":"y","<":"menor que",">":"mayor que","|":"o","¢":"centavos","£":"libras","¤":"moneda","₣":"francos","∑":"suma","∞":"infinito","♥":"amor"},"fr":{"%":"pourcent","&":"et","<":"plus petit",">":"plus grand","|":"ou","¢":"centime","£":"livre","¤":"devise","₣":"franc","∑":"somme","∞":"infini","♥":"amour"},"pt":{"%":"porcento","&":"e","<":"menor",">":"maior","|":"ou","¢":"centavo","∑":"soma","£":"libra","∞":"infinito","♥":"amor"},"uk":{"И":"Y","и":"y","Й":"Y","й":"y","Ц":"Ts","ц":"ts","Х":"Kh","х":"kh","Щ":"Shch","щ":"shch","Г":"H","г":"h"},"vi":{"Đ":"D","đ":"d"},"da":{"Ø":"OE","ø":"oe","Å":"AA","å":"aa","%":"procent","&":"og","|":"eller","$":"dollar","<":"mindre end",">":"større end"},"nb":{"&":"og","Å":"AA","Æ":"AE","Ø":"OE","å":"aa","æ":"ae","ø":"oe"},"it":{"&":"e"},"nl":{"&":"en"},"sv":{"&":"och","Å":"AA","Ä":"AE","Ö":"OE","å":"aa","ä":"ae","ö":"oe"}}');function l(c,d){if(typeof c!="string")throw new Error("slugify: string argument expected");d=typeof d=="string"?{replacement:d}:d||{};var h=o[d.locale]||{},p=d.replacement===void 0?"-":d.replacement,x=d.trim===void 0?!0:d.trim,v=c.normalize().split("").reduce(function(R,y){var b=h[y];return b===void 0&&(b=r[y]),b===void 0&&(b=y),b===p&&(b=" "),R+b.replace(d.remove||/[^\w\s$*_+~.()'"!\-:@]+/g,"")},"");return d.strict&&(v=v.replace(/[^A-Za-z0-9\s]/g,"")),x&&(v=v.trim()),v=v.replace(/\s+/g,p),d.lower&&(v=v.toLowerCase()),v}return l.extend=function(c){Object.assign(r,c)},l})})(Gd);var Fw=Gd.exports;const Mw=m0(Fw),Ur=()=>{const n=$r(),a=Mn(),r=M.useCallback(c=>`${n.getApiUrl()}/quotes/${c}/report`,[n]),o=M.useCallback(c=>`quote-${Mw(c.reference,{lower:!0,strict:!0,locale:"en",trim:!0})}.pdf`,[]),l={useList:c=>{const d=$r(),h=Mn(),{pagination:p,status:x="draft",quickSearchTerm:v=void 0,enabled:R=!0,queryOptions:y}=c;return No({queryKey:h().data().resource("quotes").action("list").params(c).get(),queryFn:()=>d.getList({resource:"quotes",quickSearchTerm:v,filters:x!=="all"?[{field:"status",operator:"eq",value:x}]:[{field:"status",operator:"ne",value:"archived"}],pagination:p}),enabled:R,queryOptions:y})},useCreate:()=>{const c=Jt();return cb({mutationFn:d=>{const{date:h}=d,p=dn.generateNewID().object.toString();return n.createOne({resource:"quotes",data:{...d,date:new Date(h).toISOString().slice(0,10),status:"draft",id:p}})},onSuccess:()=>{c.invalidateQueries({queryKey:["data","default","quotes"]})}})},useUpdate:c=>{const d=Jt();return en({mutationKey:a().data().resource("quotes").action("one").id(c).params().get(),mutationFn:h=>n.updateOne({resource:"quotes",id:c,data:h}),onSuccess:()=>{d.invalidateQueries({queryKey:["data","default","quotes"]})}})},useSetStatus:()=>{const c=Jt();return en({mutationFn:d=>{const{id:h,newStatus:p}=d;return n.custom({url:`${n.getApiUrl()}/quotes/${h}/setStatus`,method:"put",data:{newStatus:p}})},onSuccess:()=>{c.invalidateQueries({queryKey:["data","default","quotes"]})}})},useDuplicate:()=>{const c=Jt();return en({mutationFn:d=>{const{id:h}=d;return n.custom({url:`${n.getApiUrl()}/quotes/${h}/duplicate`,method:"post"})},onSuccess:()=>{c.invalidateQueries({queryKey:["data","default","quotes"]})}})},useSentTo:c=>{const d=Jt();return en({mutationKey:a().data().resource("quotes").action("one").id(c).params().get(),mutationFn:h=>{const{sent_date:p}=h;return n.custom({url:`${n.getApiUrl()}/quotes/${c}/send`,method:"put",data:{sent_date:p}})},onSuccess:()=>{d.invalidateQueries({queryKey:["data","default","quotes"]})}})},useOne:(c,d)=>wd({queryKey:a().data().resource("quotes").action("one").id(c).params().get(),queryFn:()=>n.getOne({resource:"quotes",id:String(c)}),enabled:!!c,...d}),getQuotePDFDownloadURL:r,getQuotePDFFilename:o,useReport:()=>{const c=n.getApiAuthorization(),[d,h]=M.useState(void 0),{download:p,...x}=Ec({headers:{Authorization:c},customHandleDownload:M.useCallback(R=>{const y=[R],b=new Blob(y,{type:"application/octet-stream"});return h(b),!0},[h])}),v=M.useCallback(R=>p(l.getQuotePDFDownloadURL(R),""),[p]);return{...x,preview:v,report:d}},useDownloader:()=>{const c=n.getApiAuthorization(),d=Ec({headers:{Authorization:c}});return{...d,download:(p,x)=>{const v=l.getQuotePDFDownloadURL(p);return d.download(v,x)}}}};return l},hS=()=>{const n=zt(),{toast:a}=_n(),{useCreate:r}=Ur(),{mutate:o,isPending:l}=r(),c=M.useMemo(()=>({date:new Date(Date.now()).toUTCString(),customer_reference:"",customer_information:""}),[]),d=Ji({mode:"onBlur",defaultValues:c,resolver:Pc(Fn.object({customer_reference:Fn.string(),date:Fn.date().required(),customer_information:Fn.string().required()}),{messages:{es:$d}})}),{formState:h,reset:p,getValues:x,handleSubmit:v}=d,{isSubmitting:R,isDirty:y}=h;Mo({isDirty:y});const b=async E=>{try{o(E,{onError:j=>{console.debug(j),a({title:"Error",description:j.message,variant:"destructive"})},onSuccess:j=>{p(x()),a({title:"Cotización creada",variant:"default"}),n(`/quotes/edit/${j.id}`,{relative:"path"})}})}finally{}};return R?i.jsx(Dn,{title:"Guardando ajustes"}):l?i.jsx(Dn,{}):i.jsx(es,{...d,children:i.jsx("form",{onSubmit:v(b),children:i.jsxs("div",{className:"mx-auto grid max-w-[90rem] flex-1 auto-rows-max gap-6",children:[i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx(Uc,{}),i.jsx("h1",{className:"flex-1 text-xl font-semibold tracking-tight shrink-0 whitespace-nowrap sm:grow-0",children:w("quotes.create.title")})]}),i.jsx("div",{className:"grid w-6/12 gap-6 mx-auto",children:i.jsxs(Ha,{className:"md:col-span-4",title:w("quotes.create.form_groups.general.title"),description:w("quotes.create.form_groups.general.desc"),footerActions:i.jsxs("div",{className:"flex items-stretch justify-between flex-1",children:[i.jsx(G,{size:"sm",variant:"outline",onClick:()=>n("/quotes"),children:w("common.discard")}),i.jsx(wo,{size:"sm",label:w("common.continue")})]}),children:[i.jsx(mn,{required:!0,name:"customer_reference",label:w("quotes.form_fields.customer_reference.label"),description:w("quotes.form_fields.customer_reference.desc"),placeholder:w("quotes.form_fields.customer_reference.placeholder")}),i.jsx(Gc,{required:!0,label:w("quotes.form_fields.date.label"),description:w("quotes.form_fields.date.desc"),placeholder:w("quotes.form_fields.date.placeholder"),name:"date"}),i.jsx(hn,{}),i.jsx(qt,{rows:4,className:"row-span-2",name:"customer_information",required:!0,label:w("quotes.form_fields.customer_information.label"),description:w("quotes.form_fields.customer_information.desc"),placeholder:w("quotes.form_fields.customer_information.placeholder")})]})})]})})})},Va=(n,a=!1)=>{const{discount:r,tax:o,subtotal_price:l}=n||{},c=$t.create(r||{amount:null,scale:2});if(c.isFailure)throw c.error;const d=c.object,h=$t.create(o||{amount:null,scale:2});if(h.isFailure)throw h.error;const p=h.object,x=Tt.create(l||{amount:null,scale:2});if(x.isFailure)throw x.error;const v=a?Dw(n.items).convertScale(2):x.object,R=v.percentage(d.toNumber()).convertScale(2),y=v.subtract(R).convertScale(2),b=y.percentage(p.toNumber()).convertScale(2),E=y.add(b).convertScale(2);return{subtotal_price:v,discount:n.discount,discount_price:R,before_tax_price:y,tax:p,tax_price:b,total_price:E}},Dw=n=>{let a=Tt.create({amount:0,scale:2}).object;return n&&n.map(r=>{const o=eo(r);a=a.add(o.total_price)}),a},eo=n=>{const{quantity:a,unit_price:r,discount:o}=n||{};if((!a||a&&a.amount===null)&&(!r||r&&r.amount===null)&&(!o||o&&o.amount===null))return{quantity:xn.create({amount:null,scale:0}).object,unit_price:Tt.create({amount:null,scale:2}).object,subtotal_price:Tt.create({amount:null,scale:2}).object,discount:$t.create({amount:null,scale:2}).object,total_price:Tt.create({amount:null,scale:2}).object};const l=xn.create(a);if(l.isFailure)throw l.error;const c=l.object,d=Tt.create(r);if(d.isFailure)throw d.error;const h=d.object,p=$t.create(o);if(p.isFailure)throw p.error;const x=p.object,v=h.multiply(c.toNumber()),R=v.subtract(v.percentage(x.toNumber()));return{quantity:c,unit_price:h,subtotal_price:v,discount:x,total_price:R}},Tw=()=>{const{id:n}=h0();return n};var Ki={exports:{}};/** * @license * Lodash * Copyright OpenJS Foundation and other contributors @@ -170,7 +170,7 @@ __p += '`),ge&&(P+=`' + function print() { __p += __j.call(arguments, '') } `:`; `)+P+`return __p -}`;var oe=cc(function(){return me(m,K+"return "+P).apply(r,_)});if(oe.source=P,va(oe))throw oe;return oe}function Gv(e){return pe(e).toLowerCase()}function Hv(e){return pe(e).toUpperCase()}function Kv(e,t,s){if(e=pe(e),e&&(s||t===r))return _l(e);if(!e||!(t=ft(t)))return e;var u=At(e),f=At(t),m=bl(u,f),_=wl(u,f)+1;return un(u,m,_).join("")}function Wv(e,t,s){if(e=pe(e),e&&(s||t===r))return e.slice(0,jl(e)+1);if(!e||!(t=ft(t)))return e;var u=At(e),f=wl(u,At(t))+1;return un(u,0,f).join("")}function Yv(e,t,s){if(e=pe(e),e&&(s||t===r))return e.replace(vs,"");if(!e||!(t=ft(t)))return e;var u=At(e),f=bl(u,At(t));return un(u,f).join("")}function Qv(e,t){var s=se,u=ce;if(Ae(t)){var f="separator"in t?t.separator:f;s="length"in t?ae(t.length):s,u="omission"in t?ft(t.omission):u}e=pe(e);var m=e.length;if(qn(e)){var _=At(e);m=_.length}if(s>=m)return e;var S=s-$n(u);if(S<1)return u;var N=_?un(_,0,S).join(""):e.slice(0,S);if(f===r)return N+u;if(_&&(S+=N.length-S),_a(f)){if(e.slice(S).search(f)){var T,L=N;for(f.global||(f=Ls(f.source,pe(zo.exec(f))+"g")),f.lastIndex=0;T=f.exec(L);)var P=T.index;N=N.slice(0,P===r?S:P)}}else if(e.indexOf(ft(f),S)!=S){var z=N.lastIndexOf(f);z>-1&&(N=N.slice(0,z))}return N+u}function Xv(e){return e=pe(e),e&&lf.test(e)?e.replace(ko,Ng):e}var Zv=Kn(function(e,t,s){return e+(s?" ":"")+t.toUpperCase()}),Sa=du("toUpperCase");function uc(e,t,s){return e=pe(e),t=s?r:t,t===r?wg(e)?Ag(e):fg(e):e.match(t)||[]}var cc=ue(function(e,t){try{return ct(e,r,t)}catch(s){return va(s)?s:new re(s)}}),Jv=Kt(function(e,t){return _t(t,function(s){s=kt(s),Gt(e,s,pa(e[s],e))}),e});function e_(e){var t=e==null?0:e.length,s=X();return e=t?Ee(e,function(u){if(typeof u[1]!="function")throw new bt(d);return[s(u[0]),u[1]]}):[],ue(function(u){for(var f=-1;++fU)return[];var s=it,u=Ye(e,it);t=X(t),e-=it;for(var f=Ms(u,t);++s0||t<0)?new fe(s):(e<0?s=s.takeRight(-e):e&&(s=s.drop(e)),t!==r&&(t=ae(t),s=t<0?s.dropRight(-t):s.take(t-e)),s)},fe.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},fe.prototype.toArray=function(){return this.take(it)},Ot(fe.prototype,function(e,t){var s=/^(?:filter|find|map|reject)|While$/.test(t),u=/^(?:head|last)$/.test(t),f=g[u?"take"+(t=="last"?"Right":""):t],m=u||/^find/.test(t);f&&(g.prototype[t]=function(){var _=this.__wrapped__,S=u?[1]:arguments,N=_ instanceof fe,T=S[0],L=N||ie(_),P=function(de){var ge=f.apply(g,nn([de],S));return u&&z?ge[0]:ge};L&&s&&typeof T=="function"&&T.length!=1&&(N=L=!1);var z=this.__chain__,K=!!this.__actions__.length,te=m&&!z,oe=N&&!K;if(!m&&L){_=oe?_:new fe(this);var ne=e.apply(_,S);return ne.__actions__.push({func:Ai,args:[P],thisArg:r}),new wt(ne,z)}return te&&oe?e.apply(this,S):(ne=this.thru(P),te?u?ne.value()[0]:ne.value():ne)})}),_t(["pop","push","shift","sort","splice","unshift"],function(e){var t=ti[e],s=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",u=/^(?:pop|shift)$/.test(e);g.prototype[e]=function(){var f=arguments;if(u&&!this.__chain__){var m=this.value();return t.apply(ie(m)?m:[],f)}return this[s](function(_){return t.apply(ie(_)?_:[],f)})}}),Ot(fe.prototype,function(e,t){var s=g[t];if(s){var u=s.name+"";xe.call(Un,u)||(Un[u]=[]),Un[u].push({name:t,func:s})}}),Un[Si(r,F).name]=[{name:"wrapper",func:r}],fe.prototype.clone=Xg,fe.prototype.reverse=Zg,fe.prototype.value=Jg,g.prototype.at=Ep,g.prototype.chain=Ap,g.prototype.commit=Ip,g.prototype.next=Fp,g.prototype.plant=Dp,g.prototype.reverse=Tp,g.prototype.toJSON=g.prototype.valueOf=g.prototype.value=Lp,g.prototype.first=g.prototype.head,_r&&(g.prototype[_r]=Mp),g},zn=Ig();wn?((wn.exports=zn)._=zn,Cs._=zn):Be._=zn}).call(Xn)})(Ki,Ki.exports);var Fe=Ki.exports;const Lw=n=>{console.debug("calculateQuoteTotals",n);const a=$t.create(n[1]||{amount:null,scale:2});if(a.isFailure)throw a.error;const r=a.object,o=$t.create(n[2]||{amount:null,scale:2});if(o.isFailure)throw o.error;const l=o.object,c=Tt.create(n[0]||{amount:null,scale:2});if(c.isFailure)throw c.error;const d=c.object,h=d.percentage(r.toNumber()).convertScale(2),p=d.subtract(h).convertScale(2),x=p.percentage(l.toNumber()).convertScale(2),v=p.add(x).convertScale(2);return{subtotalPrice:d.toObject(),discount:r.toObject(),discountPrice:h.toObject(),priceBeforeTaxes:p.toObject(),tax:l.toObject(),taxesPrice:x.toObject(),totalPrice:v.toObject()}},Ow=({currency:n})=>{const{formState:a,control:r}=lr(),{formatNumber:o}=vw(),l=vc({control:r,name:["subtotal_price","discount","tax"]}),c=vc({control:r,name:"tax_label"})||w("quotes.form_fields.tax.label"),d=Lw(l),h=o(d.subtotalPrice),p=o(d.discountPrice),x=o(d.taxesPrice),v=o(d.totalPrice),R=M.useMemo(()=>n.symbol||"",[n]);return i.jsx(Le,{className:"w-full bg-muted",children:i.jsxs(Oe,{className:"flex flex-row items-end gap-2 p-4 border-t",children:[i.jsx("div",{className:"grid flex-1 h-16 grid-cols-1 auto-rows-max",children:i.jsxs("div",{className:"grid gap-1 font-semibold text-right text-muted-foreground",children:[i.jsx(Ze,{className:"text-sm",children:w("quotes.form_fields.subtotal_price.label")}),i.jsxs(Ge,{className:"flex items-baseline justify-end text-2xl tabular-nums",children:[h,i.jsx("span",{className:"ml-1 text-lg tracking-normal",children:R})]})]})}),i.jsx(hn,{orientation:"vertical",className:"w-px h-16 mx-2"}),i.jsxs("div",{className:"grid flex-1 h-16 grid-cols-2 gap-6 auto-rows-max",children:[i.jsxs("div",{className:"grid gap-1 font-medium text-muted-foreground",children:[i.jsx(Ze,{className:"text-sm",children:w("quotes.form_fields.discount.label")}),i.jsx(Hi,{scale:2,disabled:a.disabled,placeholder:w("quotes.form_fields.discount.placeholder"),name:"discount",onChange:y=>{console.log("discount",y)}})]}),i.jsxs("div",{className:"grid gap-1 font-semibold text-muted-foreground",children:[i.jsx(Ze,{className:"text-sm text-right",children:w("quotes.form_fields.discount_price.label")}),i.jsxs(Ge,{className:"flex items-baseline justify-end text-2xl tabular-nums",children:[p,i.jsx("span",{className:"ml-1 text-lg tracking-normal",children:R})]})]})]}),i.jsx(hn,{orientation:"vertical",className:"w-px h-16 mx-2"}),i.jsxs("div",{className:"grid flex-1 h-16 grid-cols-2 gap-6 auto-rows-max",children:[i.jsxs("div",{className:"grid gap-1 font-medium text-muted-foreground",children:[i.jsx(Ze,{className:"text-sm",children:c}),i.jsx(Hi,{scale:2,disabled:a.disabled,placeholder:w("quotes.form_fields.tax.placeholder"),name:"tax"})]}),i.jsxs("div",{className:"grid gap-1 font-semibold text-muted-foreground",children:[i.jsx(Ze,{className:"text-sm text-right",children:w("quotes.form_fields.tax_price.label",{label:c})}),i.jsxs(Ge,{className:"flex items-baseline justify-end gap-1 text-2xl tabular-nums",children:[x,i.jsx("span",{className:"text-base font-medium tracking-normal",children:R})]})]})]})," ",i.jsx(hn,{orientation:"vertical",className:"w-px h-16 mx-2"}),i.jsx("div",{className:"grid flex-1 h-16 grid-cols-1 auto-rows-max",children:i.jsxs("div",{className:"grid gap-0",children:[i.jsx(Ze,{className:"text-sm font-semibold text-right text-foreground",children:w("quotes.form_fields.total_price.label")}),i.jsxs(Ge,{className:"flex items-baseline justify-end gap-1 text-3xl tabular-nums",children:[v,i.jsx("span",{className:"ml-1 text-lg tracking-normal",children:R})]})]})})]})})},Hd=n=>{const{percentage:a,cancel:r,error:o,isInProgress:l,onFinishDownload:c}=n,d=M.useId();return M.useEffect(()=>{l&&!o&&a===100&&c&&c()},[a,l,o,c]),i.jsx(rr,{open:l,children:i.jsxs(ir,{className:"sm:max-w-md",children:[i.jsxs(sr,{children:[i.jsx(ar,{children:w("quotes.downloading_dialog.title")}),i.jsx(ns,{children:w("quotes.downloading_dialog.description")})]}),i.jsxs("div",{className:"mb-4 space-y-2",id:d,children:[i.jsx(cr,{children:w("quotes.downloading_dialog.progress.label",{status:w(l?"quotes.downloading_dialog.progress.status_in_progress":"quotes.downloading_dialog.progress.status_stopped")})}),i.jsx(Hc,{value:a,max:100,getValueLabel:()=>w("quotes.downloading_dialog.progress.label",{})}),o&&i.jsxs("p",{children:["Error: ",JSON.stringify(o)]})]}),i.jsx(or,{className:"sm:justify-end",children:i.jsx(Vi,{asChild:!0,children:i.jsx(G,{type:"button",variant:"secondary",onClick:()=>r(),children:w("quotes.downloading_dialog.cancel_button")})})})]})})},Pw=({isInProgress:n,percentage:a,elapsed:r,cancel:o,error:l,className:c})=>{const[d,h]=M.useState(10);return M.useEffect(()=>{if(n&&a>0){const p=r/a*100;h(Math.max(0,Math.round(p-r)))}},[n,a,r]),!n&&!(l!=null&&l.errorMessage)?null:i.jsxs(Le,{className:he("overflow-hidden",c),children:[i.jsx(pt,{children:i.jsxs(Ge,{className:"flex items-center justify-between",children:[l!=null&&l.errorMessage?"Error en la generación del PDF":"Generando PDF",n&&i.jsx(W0,{className:"w-4 h-4 animate-spin"}),(l==null?void 0:l.errorMessage)&&i.jsx(V0,{className:"w-4 h-4 text-destructive"})]})}),i.jsx(Oe,{children:l!=null&&l.errorMessage?i.jsx("div",{className:"text-destructive",children:l==null?void 0:l.errorMessage}):i.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[i.jsxs("div",{className:"relative w-32 h-40 overflow-hidden rounded-lg bg-muted",children:[i.jsx("div",{className:"absolute bottom-0 left-0 right-0 transition-all duration-1000 ease-out bg-primary",style:{height:`${a}%`}}),i.jsx(K0,{className:"absolute transform -translate-x-1/2 -translate-y-1/2 animate-pulse top-1/2 left-1/2 text-muted-foreground",size:48})]}),i.jsx(Hc,{value:a,className:"w-full"}),i.jsxs("div",{className:"text-sm text-center text-muted-foreground",children:[i.jsxs("p",{children:["Progreso: ",a,"%"]}),i.jsxs("div",{className:"hidden",children:[i.jsxs("p",{children:["Tiempo transcurrido: ",r," segundos"]}),d>0&&i.jsxs("p",{children:["Tiempo estimado restante: ",d," segundos"]})]})]}),i.jsx(G,{variant:"destructive",onClick:o,className:"hidden",children:"Cancelar generación"})]})})]})},Kd=({quote:n,className:a})=>{const{useReport:r,getQuotePDFFilename:o,useDownloader:l}=Ur(),{download:c}=l(),{report:d,preview:h,isInProgress:p,...x}=r(),[v,R]=M.useState(void 0),y=M.useCallback(()=>{n&&c(n.id,o(n))},[n]);return M.useEffect(()=>{const b=setTimeout(()=>{n&&n.id&&h(n.id)},200);return()=>clearTimeout(b)},[n]),M.useEffect(()=>{if(!p&&d){const b=window.URL&&window.URL.createObjectURL?window.URL.createObjectURL(d):window.webkitURL.createObjectURL(d);return R(b),()=>{R(void 0),window.URL.revokeObjectURL(b)}}},[d,p]),n?p?i.jsx(Pw,{isInProgress:p,...x}):i.jsx(p0,{file:v,className:"object-contain",onThumbnailClick:y}):i.jsx(Le,{className:he("overflow-hidden",a),children:i.jsx(Oe,{className:"px-4 py-6 text-center",children:i.jsx("p",{className:"mx-auto",children:"Select a quote"})})})};Kd.whyDidYouRender=!0;const Tr=db();function kw({row:n,table:a}){var l;const r=(l=a.options.meta)==null?void 0:l.catalogPicker;if(!r)return null;const o=r.quantities[n.index]??1;return i.jsx(Zi,{type:"number",name:"quantity",min:1,className:"w-24",value:o,onChange:c=>{const d=c.target.value;r.setQuantity(n.index,d===""?"":Number(d))}})}function qw({row:n,table:a}){var o;const r=(o=a.options.meta)==null?void 0:o.catalogPicker;return i.jsxs(G,{size:"sm",variant:"outline",className:"h-8 gap-1",onClick:l=>{l.preventDefault(),r==null||r.selectArticle(n.original,n.index)},children:[i.jsx(Co,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"sr-only xl:not-sr-only xl:whitespace-nowrap",children:w("common.add")})]})}const to=({onSelect:n})=>{const a=zt(),{pagination:r,globalFilter:o,isFiltered:l}=Tn(),[c,d]=M.useState([]),h=M.useCallback((D,F)=>{d(q=>{const $=[...q];return $[D]=F,$})},[]),p=()=>{d([])},{data:x,isPending:v,isError:R,error:y}=zd({pagination:{pageIndex:r.pageIndex,pageSize:r.pageSize},searchTerm:o});M.useEffect(()=>{p()},[r,o,l]);const b=M.useMemo(()=>({catalogPicker:{quantities:c,setQuantity:h,selectArticle:(D,F)=>n(D,c[F]===""?1:c[F]??1)}}),[h,n,c]),E=M.useMemo(()=>[Tr.accessor("description",{id:"description",header:()=>i.jsx(i.Fragment,{children:w("catalog.list.columns.description")})}),Tr.accessor("points",{id:"points",header:()=>i.jsx("div",{className:"text-right",children:w("catalog.list.columns.points")}),cell:({renderValue:D})=>i.jsx("div",{className:"text-right",children:D()})}),Tr.accessor("retail_price",{id:"retail_price",header:()=>i.jsx("div",{className:"text-right",children:w("catalog.list.columns.retail_price")}),cell:({row:D})=>{const F=Tt.create(D.original.retail_price).object;return i.jsx("div",{className:"text-right",children:F.toFormat()})}}),Tr.display({id:"quantity",header:()=>i.jsx("div",{className:"font-medium text-right text-foreground",children:w("catalog.list.columns.quantity")}),cell:kw}),Tr.display({id:"row-actions",header:()=>null,cell:qw})],[]),{table:j}=os({data:[...(x==null?void 0:x.items)||[]],columns:E,pageCount:(x==null?void 0:x.total_pages)??-1,meta:b});return R?i.jsx(ur,{subtitle:y.message}):v?i.jsx(ss,{columnCount:6,searchableColumnCount:1,filterableColumnCount:2,shrinkZero:!0}):(x==null?void 0:x.total_items)===0&&!l?i.jsx(as,{subtitle:"Empieza cargando los artículos del catálogo",buttonText:"",onButtonClick:()=>a("/catalog/add")}):i.jsx(is,{className:"bg-transparent border-0 shadow-none",table:j,paginationOptions:{visible:!0,enablePageSizeSelector:!1},footerClassName:"px-10 pt-2 border-t",children:i.jsx(Bd,{table:j})})},Do=M.forwardRef(({label:n=w("common.append_block"),className:a,...r},o)=>i.jsxs(G,{type:"button",variant:"outline",ref:o,...r,children:[" ",i.jsx(Co,{className:n?"w-4 h-4 mr-2":"w-4 h-4"}),n&&i.jsx(i.Fragment,{children:n})]}));Do.displayName="AppendBlockRowButton";const To=M.forwardRef(({label:n=w("common.append_article"),className:a,...r},o)=>i.jsxs(G,{type:"button",variant:"outline",ref:o,...r,children:[" ",i.jsx(Co,{className:n?"w-4 h-4 mr-2":"w-4 h-4"}),n&&i.jsx(i.Fragment,{children:n})]}));To.displayName="AppendCatalogArticleRowButton";const Lo=M.forwardRef(({label:n=w("common.append_empty_row"),className:a,...r},o)=>i.jsxs(G,{type:"button",variant:"outline",ref:o,...r,children:[i.jsx(B0,{className:n?"w-4 h-4 mr-2":"w-4 h-4"}),n&&i.jsx(i.Fragment,{children:n})]}));Lo.displayName="AppendEmptyRowButton";const $w=({table:n,showLineDiscountColumn:a,hasLineDiscounts:r,onShowLineDiscountColumnChange:o})=>{const l=n.getSelectedRowModel().rows.length,[c,d]=M.useState(!1),h=x=>{if(!x&&a&&r){d(!0);return}o(x)},p=i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[i.jsxs("div",{className:"grid gap-0.5",children:[i.jsx(cr,{htmlFor:"show-line-discount-column",className:"text-sm font-medium",children:w("quotes.discount_column.label")}),i.jsx("p",{className:"text-xs font-normal text-muted-foreground",children:w("quotes.discount_column.description")})]}),i.jsx(So,{id:"show-line-discount-column",checked:a,onCheckedChange:h})]}),i.jsx(rr,{open:c,onOpenChange:d,children:i.jsxs(ir,{children:[i.jsxs(sr,{children:[i.jsx(ar,{children:w("quotes.discount_column.confirmation.title")}),i.jsx(ns,{children:w("quotes.discount_column.confirmation.description")})]}),i.jsxs(or,{children:[i.jsx(G,{type:"button",variant:"secondary",onClick:()=>d(!1),children:w("common.cancel")}),i.jsx(G,{type:"button",onClick:()=>{o(!1),d(!1)},children:w("quotes.discount_column.confirmation.confirm")})]})]})})]});return l?i.jsx("nav",{className:"flex items-center h-12 p-1 rounded-md text-muted-foreground bg-muted ",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs(He,{children:[i.jsx(Ke,{asChild:!0,children:i.jsxs(G,{type:"button",variant:"link",disabled:!n.getSelectedRowModel().rows.length,onClick:()=>{var x;return(x=n.options.meta)==null?void 0:x.duplicateItems()},children:[i.jsx(U0,{className:"w-4 h-4 sm:mr-2"}),i.jsx("span",{className:"sr-only sm:not-sr-only",children:w("common.duplicate_selected_rows")})]})}),i.jsx(We,{children:w("common.duplicate_selected_rows_tooltip")})]}),i.jsxs(He,{children:[i.jsx(Ke,{asChild:!0,children:i.jsxs(G,{type:"button",variant:"link",disabled:!n.getSelectedRowModel().rows.length,onClick:()=>{var x;return(x=n.options.meta)==null?void 0:x.deleteItems()},children:[i.jsx(xd,{className:"w-4 h-4 sm:mr-2"}),i.jsx("span",{className:"sr-only sm:not-sr-only",children:w("common.remove_selected_rows")})]})}),i.jsx(We,{children:w("common.remove_selected_rows_tooltip")})]}),i.jsxs(He,{children:[i.jsx(Ke,{asChild:!0,children:i.jsxs(G,{type:"button",variant:"link",disabled:!n.getSelectedRowModel().rows.length,onClick:()=>n.resetRowSelection(),children:[i.jsx(Y0,{className:"w-4 h-4 sm:mr-2"}),i.jsx("span",{className:"sr-only sm:not-sr-only",children:w("common.reset_selected_rows")})]})}),i.jsx(We,{children:w("common.reset_selected_rows_tooltip")})]}),i.jsx(hn,{orientation:"vertical",className:"h-6 ml-1 mr-4"}),i.jsx("p",{className:"text-sm font-normal",children:w("common.rows_selected",{count:l})}),p]})}):i.jsxs("nav",{className:"flex items-center h-12 p-1 rounded-md bg-accent/75 text-muted-foreground",children:[i.jsxs("div",{className:"flex space-x-2",children:[i.jsxs(He,{children:[i.jsx(Ke,{asChild:!0,children:i.jsx(Lo,{variant:"link",onClick:()=>{var x;return(x=n.options.meta)==null?void 0:x.appendItem()}})}),i.jsx(We,{children:w("common.append_empty_row_tooltip")})]}),i.jsxs(He,{children:[i.jsx(Ke,{asChild:!0,children:i.jsx(To,{variant:"link",onClick:()=>{var x;n.options.meta&&n.options.meta.pickCatalogArticle&&((x=n.options.meta)==null||x.pickCatalogArticle())}})}),i.jsx(We,{children:w("common.append_article_tooltip")})]}),i.jsxs(He,{children:[i.jsx(Ke,{asChild:!0,children:i.jsx(Do,{variant:"link",onClick:()=>{var x;n.options.meta&&n.options.meta.pickBlock&&((x=n.options.meta)==null||x.pickBlock())}})}),i.jsx(We,{children:w("common.append_block_tooltip")})]})]}),p]})},zw=({row:n,table:a,onDelete:r})=>{const o=()=>{var l;(l=a.options.meta)==null||l.deleteItems(n.index),r()};return i.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[i.jsxs(G,{type:"button",variant:"outline",size:"sm",onClick:()=>{var l;return(l=a.options.meta)==null?void 0:l.insertItem(n.index)},children:[i.jsx(x0,{className:"w-4 h-4 mr-2"}),w("common.insert_row_above")]}),i.jsxs(G,{type:"button",variant:"outline",size:"sm",onClick:()=>{var l;return(l=a.options.meta)==null?void 0:l.insertItem(n.index+1)},children:[i.jsx(kc,{className:"w-4 h-4 mr-2"}),w("common.insert_row_below")]}),i.jsxs(G,{type:"button",variant:"outline",size:"sm",onClick:()=>{var l;return(l=a.options.meta)==null?void 0:l.duplicateItems(n.index)},children:[i.jsx(jo,{className:"w-4 h-4 mr-2"}),w("common.duplicate_row")]}),i.jsxs(Kc,{children:[i.jsx(Wc,{asChild:!0,children:i.jsxs(G,{type:"button",variant:"destructive",size:"sm",children:[i.jsx(xd,{className:"w-4 h-4 mr-2"}),w("common.remove_row")]})}),i.jsxs(Yc,{children:[i.jsxs(Qc,{children:[i.jsx(Xc,{children:w("quotes.inline_row_actions.delete_confirmation.title")}),i.jsx(Zc,{children:w("quotes.inline_row_actions.delete_confirmation.description")})]}),i.jsxs(Jc,{children:[i.jsx(ed,{children:w("common.cancel")}),i.jsx(td,{asChild:!0,children:i.jsx(G,{type:"button",variant:"destructive",onClick:o,children:w("quotes.inline_row_actions.delete_confirmation.confirm")})})]})]})]})]})},Bw={droppable:{strategy:w0.Always}},Vw={keyframes({transform:n}){return[{opacity:1,transform:Ga.Transform.toString(n.initial)},{opacity:0,transform:Ga.Transform.toString({...n.final,x:n.final.x+5,y:n.final.y+5})}]},easing:"ease-out",sideEffects({active:n}){n.node.animate([{opacity:0},{opacity:1}],{duration:_c.duration,easing:_c.easing})}};function Ac({columns:n,data:a,defaultValues:r,initialState:o,actions:l,showLineDiscountColumn:c,hasLineDiscounts:d,onShowLineDiscountColumnChange:h}){const[p,x]=M.useState({}),[v,R]=M.useState(),[y,b]=M.useState(null),E=M.useMemo(()=>a.map(O=>O.id),[a]),j=Dd({data:a,columns:n,enableColumnResizing:!1,columnResizeMode:"onChange",autoResetAll:!1,initialState:o,state:{rowSelection:p,columnVisibility:{...o==null?void 0:o.columnVisibility,discount:c}},enableRowSelection:!0,enableMultiRowSelection:!0,enableSorting:!1,enableHiding:!0,onRowSelectionChange:x,getCoreRowModel:Fd(),getRowId:O=>O==null?void 0:O.id,debugTable:!1,debugHeaders:!1,debugColumns:!1,defaultColumn:{minSize:0,size:Number.MAX_SAFE_INTEGER,maxSize:Number.MAX_SAFE_INTEGER},meta:{insertItem:(O,k)=>{l.insert(O,k||(r==null?void 0:r.items[0]),{shouldFocus:!0})},appendItem:O=>{l.append(O||(r==null?void 0:r.items[0]),{shouldFocus:!0})},pickCatalogArticle:()=>{l.pickCatalogArticle&&(l==null||l.pickCatalogArticle())},pickBlock:()=>{l.pickBlock&&(l==null||l.pickBlock())},duplicateItems:O=>{var k;if(O!=null){const H=((k=l.getItem)==null?void 0:k.call(l,O))??j.getRowModel().rows[O].original;l.insert(O+1,{...H,id:void 0},{shouldFocus:!0})}else if(j.getSelectedRowModel().rows.length){const H=j.getSelectedRowModel().rows[j.getSelectedRowModel().rows.length-1].index,W=j.getSelectedRowModel().rows.map(B=>({...B.original,id:void 0}));j.getRowModel().rows.length{if(O!=null)l.remove(O);else if(j.getSelectedRowModel().rows.length>0){let k=j.getSelectedRowModel().rows.length-1;for(;k>=0;k--){const H=E.indexOf(String(j.getSelectedRowModel().rows[k].id));l.remove(H),E.splice(H,1)}j.resetRowSelection()}else l.remove()},updateItem:(O,k,H,W)=>{l.update(O,{...k,[`${H}`]:W})}}}),D=v0(Pi(A0,{}),Pi(E0,{}),Pi(R0,{}),Pi(N0,{}));function F(O){var W;let k=O.active.id,H=(W=O.over)==null?void 0:W.id;if(H!==void 0&&k!==H){let B=E.indexOf(String(H));if(j.getSelectedRowModel().rows.length>1)j.getSelectedRowModel().rows.forEach((se,ce)=>{const Y=E.indexOf(String(se.id));ce>0&&(k=se.id,B=E.indexOf(String(H)),B{const H=typeof k=="string"?k:k.id;return H===v||!j.getSelectedRowModel().rowsById[H]}):O}return i.jsx(_0,{measuring:Bw,sensors:D,onDragEnd:F,onDragStart:q,onDragCancel:$,collisionDetection:b0,children:i.jsxs(Le,{children:[i.jsx(pt,{className:"sticky z-10 top-16 bg-card/90",children:i.jsx(Ge,{children:i.jsx($w,{table:j,showLineDiscountColumn:c,hasLineDiscounts:d,onShowLineDiscountColumnChange:h})})}),i.jsxs(Oe,{children:[i.jsxs(uo,{className:"table-fixed",children:[i.jsx(co,{className:"sticky top-0 z-10 bg-background",children:j.getHeaderGroups().map(O=>i.jsx(pn,{className:"hover:bg-transparent",children:O.headers.map(k=>i.jsx(fo,{className:"px-2 py-1",style:{width:k.getSize()===Number.MAX_SAFE_INTEGER?"auto":k.getSize()},children:k.isPlaceholder?null:i.jsx(Ld,{table:j,header:k})},k.id))},O.id))}),i.jsx(go,{children:i.jsx(j0,{items:Q(E),strategy:C0,children:Q(j.getRowModel().rows).map(O=>{const k=O,H=k.id===y;return i.jsxs(M.Fragment,{children:[i.jsx(Ew,{id:k.id,isActive:H,onActivate:()=>b(k.id),children:k.getVisibleCells().map(W=>i.jsx(qr,{className:"px-2 py-2 align-top",style:{width:W.column.getSize()===Number.MAX_SAFE_INTEGER?"auto":W.column.getSize()},children:Gi(W.column.columnDef.cell,W.getContext())},W.id))}),H&&i.jsx(pn,{className:"border border-t-0 border-destructive/30 border-l-4 border-l-destructive bg-destructive/5 hover:bg-destructive/5",children:i.jsx(qr,{colSpan:k.getVisibleCells().length,className:"px-2 py-2",children:i.jsx(zw,{row:k,table:j,onDelete:()=>b(null)})})})]},k.id)})})})]}),S0.createPortal(i.jsx(y0,{dropAnimation:Vw,className:"z-40 opacity-100",children:v&&i.jsx("div",{className:"relative flex flex-wrap",children:j.getSelectedRowModel().rows.length?i.jsx(ro,{variant:"destructive",className:"absolute z-50 flex items-center justify-center w-2 h-2 p-3 rounded-full top left -left-2 -top-2",children:j.getSelectedRowModel().rows.length}):null})}),document.body),!1]}),i.jsx(Dt,{children:i.jsxs(tr,{children:[i.jsx(Lo,{onClick:()=>{var O;return(O=j.options.meta)==null?void 0:O.appendItem()}}),i.jsx(To,{onClick:()=>{var O;j.options.meta&&j.options.meta.pickCatalogArticle&&((O=j.options.meta)==null||O.pickCatalogArticle())}}),i.jsx(Do,{onClick:()=>{var O;j.options.meta&&j.options.meta.pickBlock&&((O=j.options.meta)==null||O.pickBlock())}})]})})]})})}const Uw={en:[{id:2000000098,code:"CAP_CLA_SEMI_SUSPENDIDO_EN",title:"Finish: MELAMINE / colour: TO BE DETERMINED",body:`Thickness block: 19 mm / Thickness complements: 19 mm.\r +}`;var oe=cc(function(){return me(m,K+"return "+P).apply(r,_)});if(oe.source=P,va(oe))throw oe;return oe}function Gv(e){return pe(e).toLowerCase()}function Hv(e){return pe(e).toUpperCase()}function Kv(e,t,s){if(e=pe(e),e&&(s||t===r))return _l(e);if(!e||!(t=ft(t)))return e;var u=At(e),f=At(t),m=bl(u,f),_=wl(u,f)+1;return un(u,m,_).join("")}function Wv(e,t,s){if(e=pe(e),e&&(s||t===r))return e.slice(0,jl(e)+1);if(!e||!(t=ft(t)))return e;var u=At(e),f=wl(u,At(t))+1;return un(u,0,f).join("")}function Yv(e,t,s){if(e=pe(e),e&&(s||t===r))return e.replace(vs,"");if(!e||!(t=ft(t)))return e;var u=At(e),f=bl(u,At(t));return un(u,f).join("")}function Qv(e,t){var s=se,u=ce;if(Ae(t)){var f="separator"in t?t.separator:f;s="length"in t?ae(t.length):s,u="omission"in t?ft(t.omission):u}e=pe(e);var m=e.length;if(qn(e)){var _=At(e);m=_.length}if(s>=m)return e;var S=s-$n(u);if(S<1)return u;var N=_?un(_,0,S).join(""):e.slice(0,S);if(f===r)return N+u;if(_&&(S+=N.length-S),_a(f)){if(e.slice(S).search(f)){var T,L=N;for(f.global||(f=Ls(f.source,pe(zo.exec(f))+"g")),f.lastIndex=0;T=f.exec(L);)var P=T.index;N=N.slice(0,P===r?S:P)}}else if(e.indexOf(ft(f),S)!=S){var z=N.lastIndexOf(f);z>-1&&(N=N.slice(0,z))}return N+u}function Xv(e){return e=pe(e),e&&lf.test(e)?e.replace(ko,Ng):e}var Zv=Kn(function(e,t,s){return e+(s?" ":"")+t.toUpperCase()}),Sa=du("toUpperCase");function uc(e,t,s){return e=pe(e),t=s?r:t,t===r?wg(e)?Ag(e):fg(e):e.match(t)||[]}var cc=ue(function(e,t){try{return ct(e,r,t)}catch(s){return va(s)?s:new re(s)}}),Jv=Kt(function(e,t){return _t(t,function(s){s=kt(s),Gt(e,s,pa(e[s],e))}),e});function e_(e){var t=e==null?0:e.length,s=X();return e=t?Ee(e,function(u){if(typeof u[1]!="function")throw new bt(d);return[s(u[0]),u[1]]}):[],ue(function(u){for(var f=-1;++fU)return[];var s=it,u=Ye(e,it);t=X(t),e-=it;for(var f=Ms(u,t);++s0||t<0)?new fe(s):(e<0?s=s.takeRight(-e):e&&(s=s.drop(e)),t!==r&&(t=ae(t),s=t<0?s.dropRight(-t):s.take(t-e)),s)},fe.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},fe.prototype.toArray=function(){return this.take(it)},Ot(fe.prototype,function(e,t){var s=/^(?:filter|find|map|reject)|While$/.test(t),u=/^(?:head|last)$/.test(t),f=g[u?"take"+(t=="last"?"Right":""):t],m=u||/^find/.test(t);f&&(g.prototype[t]=function(){var _=this.__wrapped__,S=u?[1]:arguments,N=_ instanceof fe,T=S[0],L=N||ie(_),P=function(de){var ge=f.apply(g,nn([de],S));return u&&z?ge[0]:ge};L&&s&&typeof T=="function"&&T.length!=1&&(N=L=!1);var z=this.__chain__,K=!!this.__actions__.length,te=m&&!z,oe=N&&!K;if(!m&&L){_=oe?_:new fe(this);var ne=e.apply(_,S);return ne.__actions__.push({func:Ai,args:[P],thisArg:r}),new wt(ne,z)}return te&&oe?e.apply(this,S):(ne=this.thru(P),te?u?ne.value()[0]:ne.value():ne)})}),_t(["pop","push","shift","sort","splice","unshift"],function(e){var t=ti[e],s=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",u=/^(?:pop|shift)$/.test(e);g.prototype[e]=function(){var f=arguments;if(u&&!this.__chain__){var m=this.value();return t.apply(ie(m)?m:[],f)}return this[s](function(_){return t.apply(ie(_)?_:[],f)})}}),Ot(fe.prototype,function(e,t){var s=g[t];if(s){var u=s.name+"";xe.call(Un,u)||(Un[u]=[]),Un[u].push({name:t,func:s})}}),Un[Si(r,F).name]=[{name:"wrapper",func:r}],fe.prototype.clone=Xg,fe.prototype.reverse=Zg,fe.prototype.value=Jg,g.prototype.at=Ep,g.prototype.chain=Ap,g.prototype.commit=Ip,g.prototype.next=Fp,g.prototype.plant=Dp,g.prototype.reverse=Tp,g.prototype.toJSON=g.prototype.valueOf=g.prototype.value=Lp,g.prototype.first=g.prototype.head,_r&&(g.prototype[_r]=Mp),g},zn=Ig();wn?((wn.exports=zn)._=zn,Cs._=zn):Be._=zn}).call(Xn)})(Ki,Ki.exports);var Fe=Ki.exports;const Lw=n=>{console.debug("calculateQuoteTotals",n);const a=$t.create(n[1]||{amount:null,scale:2});if(a.isFailure)throw a.error;const r=a.object,o=$t.create(n[2]||{amount:null,scale:2});if(o.isFailure)throw o.error;const l=o.object,c=Tt.create(n[0]||{amount:null,scale:2});if(c.isFailure)throw c.error;const d=c.object,h=d.percentage(r.toNumber()).convertScale(2),p=d.subtract(h).convertScale(2),x=p.percentage(l.toNumber()).convertScale(2),v=p.add(x).convertScale(2);return{subtotalPrice:d.toObject(),discount:r.toObject(),discountPrice:h.toObject(),priceBeforeTaxes:p.toObject(),tax:l.toObject(),taxesPrice:x.toObject(),totalPrice:v.toObject()}},Ow=({currency:n})=>{const{formState:a,control:r}=lr(),{formatNumber:o}=vw(),l=vc({control:r,name:["subtotal_price","discount","tax"]}),c=vc({control:r,name:"tax_label"})||w("quotes.form_fields.tax.label"),d=Lw(l),h=o(d.subtotalPrice),p=o(d.discountPrice),x=o(d.taxesPrice),v=o(d.totalPrice),R=M.useMemo(()=>n.symbol||"",[n]);return i.jsx(Le,{className:"w-full bg-muted",children:i.jsxs(Oe,{className:"flex flex-row items-end gap-2 p-4 border-t",children:[i.jsx("div",{className:"grid flex-1 h-16 grid-cols-1 auto-rows-max",children:i.jsxs("div",{className:"grid gap-1 font-semibold text-right text-muted-foreground",children:[i.jsx(Ze,{className:"text-sm",children:w("quotes.form_fields.subtotal_price.label")}),i.jsxs(Ge,{className:"flex items-baseline justify-end text-2xl tabular-nums",children:[h,i.jsx("span",{className:"ml-1 text-lg tracking-normal",children:R})]})]})}),i.jsx(hn,{orientation:"vertical",className:"w-px h-16 mx-2"}),i.jsxs("div",{className:"grid flex-1 h-16 grid-cols-2 gap-6 auto-rows-max",children:[i.jsxs("div",{className:"grid gap-1 font-medium text-muted-foreground",children:[i.jsx(Ze,{className:"text-sm",children:w("quotes.form_fields.discount.label")}),i.jsx(Hi,{scale:2,disabled:a.disabled,placeholder:w("quotes.form_fields.discount.placeholder"),name:"discount",onChange:y=>{console.log("discount",y)}})]}),i.jsxs("div",{className:"grid gap-1 font-semibold text-muted-foreground",children:[i.jsx(Ze,{className:"text-sm text-right",children:w("quotes.form_fields.discount_price.label")}),i.jsxs(Ge,{className:"flex items-baseline justify-end text-2xl tabular-nums",children:[p,i.jsx("span",{className:"ml-1 text-lg tracking-normal",children:R})]})]})]}),i.jsx(hn,{orientation:"vertical",className:"w-px h-16 mx-2"}),i.jsxs("div",{className:"grid flex-1 h-16 grid-cols-2 gap-6 auto-rows-max",children:[i.jsxs("div",{className:"grid gap-1 font-medium text-muted-foreground",children:[i.jsx(Ze,{className:"text-sm",children:c}),i.jsx(Hi,{scale:2,disabled:a.disabled,placeholder:w("quotes.form_fields.tax.placeholder"),name:"tax"})]}),i.jsxs("div",{className:"grid gap-1 font-semibold text-muted-foreground",children:[i.jsx(Ze,{className:"text-sm text-right",children:w("quotes.form_fields.tax_price.label",{label:""})}),i.jsxs(Ge,{className:"flex items-baseline justify-end gap-1 text-2xl tabular-nums",children:[x,i.jsx("span",{className:"text-base font-medium tracking-normal",children:R})]})]})]})," ",i.jsx(hn,{orientation:"vertical",className:"w-px h-16 mx-2"}),i.jsx("div",{className:"grid flex-1 h-16 grid-cols-1 auto-rows-max",children:i.jsxs("div",{className:"grid gap-0",children:[i.jsx(Ze,{className:"text-sm font-semibold text-right text-foreground",children:w("quotes.form_fields.total_price.label")}),i.jsxs(Ge,{className:"flex items-baseline justify-end gap-1 text-3xl tabular-nums",children:[v,i.jsx("span",{className:"ml-1 text-lg tracking-normal",children:R})]})]})})]})})},Hd=n=>{const{percentage:a,cancel:r,error:o,isInProgress:l,onFinishDownload:c}=n,d=M.useId();return M.useEffect(()=>{l&&!o&&a===100&&c&&c()},[a,l,o,c]),i.jsx(rr,{open:l,children:i.jsxs(ir,{className:"sm:max-w-md",children:[i.jsxs(sr,{children:[i.jsx(ar,{children:w("quotes.downloading_dialog.title")}),i.jsx(ns,{children:w("quotes.downloading_dialog.description")})]}),i.jsxs("div",{className:"mb-4 space-y-2",id:d,children:[i.jsx(cr,{children:w("quotes.downloading_dialog.progress.label",{status:w(l?"quotes.downloading_dialog.progress.status_in_progress":"quotes.downloading_dialog.progress.status_stopped")})}),i.jsx(Hc,{value:a,max:100,getValueLabel:()=>w("quotes.downloading_dialog.progress.label",{})}),o&&i.jsxs("p",{children:["Error: ",JSON.stringify(o)]})]}),i.jsx(or,{className:"sm:justify-end",children:i.jsx(Vi,{asChild:!0,children:i.jsx(G,{type:"button",variant:"secondary",onClick:()=>r(),children:w("quotes.downloading_dialog.cancel_button")})})})]})})},Pw=({isInProgress:n,percentage:a,elapsed:r,cancel:o,error:l,className:c})=>{const[d,h]=M.useState(10);return M.useEffect(()=>{if(n&&a>0){const p=r/a*100;h(Math.max(0,Math.round(p-r)))}},[n,a,r]),!n&&!(l!=null&&l.errorMessage)?null:i.jsxs(Le,{className:he("overflow-hidden",c),children:[i.jsx(pt,{children:i.jsxs(Ge,{className:"flex items-center justify-between",children:[l!=null&&l.errorMessage?"Error en la generación del PDF":"Generando PDF",n&&i.jsx(W0,{className:"w-4 h-4 animate-spin"}),(l==null?void 0:l.errorMessage)&&i.jsx(V0,{className:"w-4 h-4 text-destructive"})]})}),i.jsx(Oe,{children:l!=null&&l.errorMessage?i.jsx("div",{className:"text-destructive",children:l==null?void 0:l.errorMessage}):i.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[i.jsxs("div",{className:"relative w-32 h-40 overflow-hidden rounded-lg bg-muted",children:[i.jsx("div",{className:"absolute bottom-0 left-0 right-0 transition-all duration-1000 ease-out bg-primary",style:{height:`${a}%`}}),i.jsx(K0,{className:"absolute transform -translate-x-1/2 -translate-y-1/2 animate-pulse top-1/2 left-1/2 text-muted-foreground",size:48})]}),i.jsx(Hc,{value:a,className:"w-full"}),i.jsxs("div",{className:"text-sm text-center text-muted-foreground",children:[i.jsxs("p",{children:["Progreso: ",a,"%"]}),i.jsxs("div",{className:"hidden",children:[i.jsxs("p",{children:["Tiempo transcurrido: ",r," segundos"]}),d>0&&i.jsxs("p",{children:["Tiempo estimado restante: ",d," segundos"]})]})]}),i.jsx(G,{variant:"destructive",onClick:o,className:"hidden",children:"Cancelar generación"})]})})]})},Kd=({quote:n,className:a})=>{const{useReport:r,getQuotePDFFilename:o,useDownloader:l}=Ur(),{download:c}=l(),{report:d,preview:h,isInProgress:p,...x}=r(),[v,R]=M.useState(void 0),y=M.useCallback(()=>{n&&c(n.id,o(n))},[n]);return M.useEffect(()=>{const b=setTimeout(()=>{n&&n.id&&h(n.id)},200);return()=>clearTimeout(b)},[n]),M.useEffect(()=>{if(!p&&d){const b=window.URL&&window.URL.createObjectURL?window.URL.createObjectURL(d):window.webkitURL.createObjectURL(d);return R(b),()=>{R(void 0),window.URL.revokeObjectURL(b)}}},[d,p]),n?p?i.jsx(Pw,{isInProgress:p,...x}):i.jsx(p0,{file:v,className:"object-contain",onThumbnailClick:y}):i.jsx(Le,{className:he("overflow-hidden",a),children:i.jsx(Oe,{className:"px-4 py-6 text-center",children:i.jsx("p",{className:"mx-auto",children:"Select a quote"})})})};Kd.whyDidYouRender=!0;const Tr=db();function kw({row:n,table:a}){var l;const r=(l=a.options.meta)==null?void 0:l.catalogPicker;if(!r)return null;const o=r.quantities[n.index]??1;return i.jsx(Zi,{type:"number",name:"quantity",min:1,className:"w-24",value:o,onChange:c=>{const d=c.target.value;r.setQuantity(n.index,d===""?"":Number(d))}})}function qw({row:n,table:a}){var o;const r=(o=a.options.meta)==null?void 0:o.catalogPicker;return i.jsxs(G,{size:"sm",variant:"outline",className:"h-8 gap-1",onClick:l=>{l.preventDefault(),r==null||r.selectArticle(n.original,n.index)},children:[i.jsx(Co,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"sr-only xl:not-sr-only xl:whitespace-nowrap",children:w("common.add")})]})}const to=({onSelect:n})=>{const a=zt(),{pagination:r,globalFilter:o,isFiltered:l}=Tn(),[c,d]=M.useState([]),h=M.useCallback((D,F)=>{d(q=>{const $=[...q];return $[D]=F,$})},[]),p=()=>{d([])},{data:x,isPending:v,isError:R,error:y}=zd({pagination:{pageIndex:r.pageIndex,pageSize:r.pageSize},searchTerm:o});M.useEffect(()=>{p()},[r,o,l]);const b=M.useMemo(()=>({catalogPicker:{quantities:c,setQuantity:h,selectArticle:(D,F)=>n(D,c[F]===""?1:c[F]??1)}}),[h,n,c]),E=M.useMemo(()=>[Tr.accessor("description",{id:"description",header:()=>i.jsx(i.Fragment,{children:w("catalog.list.columns.description")})}),Tr.accessor("points",{id:"points",header:()=>i.jsx("div",{className:"text-right",children:w("catalog.list.columns.points")}),cell:({renderValue:D})=>i.jsx("div",{className:"text-right",children:D()})}),Tr.accessor("retail_price",{id:"retail_price",header:()=>i.jsx("div",{className:"text-right",children:w("catalog.list.columns.retail_price")}),cell:({row:D})=>{const F=Tt.create(D.original.retail_price).object;return i.jsx("div",{className:"text-right",children:F.toFormat()})}}),Tr.display({id:"quantity",header:()=>i.jsx("div",{className:"font-medium text-right text-foreground",children:w("catalog.list.columns.quantity")}),cell:kw}),Tr.display({id:"row-actions",header:()=>null,cell:qw})],[]),{table:j}=os({data:[...(x==null?void 0:x.items)||[]],columns:E,pageCount:(x==null?void 0:x.total_pages)??-1,meta:b});return R?i.jsx(ur,{subtitle:y.message}):v?i.jsx(ss,{columnCount:6,searchableColumnCount:1,filterableColumnCount:2,shrinkZero:!0}):(x==null?void 0:x.total_items)===0&&!l?i.jsx(as,{subtitle:"Empieza cargando los artículos del catálogo",buttonText:"",onButtonClick:()=>a("/catalog/add")}):i.jsx(is,{className:"bg-transparent border-0 shadow-none",table:j,paginationOptions:{visible:!0,enablePageSizeSelector:!1},footerClassName:"px-10 pt-2 border-t",children:i.jsx(Bd,{table:j})})},Do=M.forwardRef(({label:n=w("common.append_block"),className:a,...r},o)=>i.jsxs(G,{type:"button",variant:"outline",ref:o,...r,children:[" ",i.jsx(Co,{className:n?"w-4 h-4 mr-2":"w-4 h-4"}),n&&i.jsx(i.Fragment,{children:n})]}));Do.displayName="AppendBlockRowButton";const To=M.forwardRef(({label:n=w("common.append_article"),className:a,...r},o)=>i.jsxs(G,{type:"button",variant:"outline",ref:o,...r,children:[" ",i.jsx(Co,{className:n?"w-4 h-4 mr-2":"w-4 h-4"}),n&&i.jsx(i.Fragment,{children:n})]}));To.displayName="AppendCatalogArticleRowButton";const Lo=M.forwardRef(({label:n=w("common.append_empty_row"),className:a,...r},o)=>i.jsxs(G,{type:"button",variant:"outline",ref:o,...r,children:[i.jsx(B0,{className:n?"w-4 h-4 mr-2":"w-4 h-4"}),n&&i.jsx(i.Fragment,{children:n})]}));Lo.displayName="AppendEmptyRowButton";const $w=({table:n,showLineDiscountColumn:a,hasLineDiscounts:r,onShowLineDiscountColumnChange:o})=>{const l=n.getSelectedRowModel().rows.length,[c,d]=M.useState(!1),h=x=>{if(!x&&a&&r){d(!0);return}o(x)},p=i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[i.jsxs("div",{className:"grid gap-0.5",children:[i.jsx(cr,{htmlFor:"show-line-discount-column",className:"text-sm font-medium",children:w("quotes.discount_column.label")}),i.jsx("p",{className:"text-xs font-normal text-muted-foreground",children:w("quotes.discount_column.description")})]}),i.jsx(So,{id:"show-line-discount-column",checked:a,onCheckedChange:h})]}),i.jsx(rr,{open:c,onOpenChange:d,children:i.jsxs(ir,{children:[i.jsxs(sr,{children:[i.jsx(ar,{children:w("quotes.discount_column.confirmation.title")}),i.jsx(ns,{children:w("quotes.discount_column.confirmation.description")})]}),i.jsxs(or,{children:[i.jsx(G,{type:"button",variant:"secondary",onClick:()=>d(!1),children:w("common.cancel")}),i.jsx(G,{type:"button",onClick:()=>{o(!1),d(!1)},children:w("quotes.discount_column.confirmation.confirm")})]})]})})]});return l?i.jsx("nav",{className:"flex items-center h-12 p-1 rounded-md text-muted-foreground bg-muted ",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs(He,{children:[i.jsx(Ke,{asChild:!0,children:i.jsxs(G,{type:"button",variant:"link",disabled:!n.getSelectedRowModel().rows.length,onClick:()=>{var x;return(x=n.options.meta)==null?void 0:x.duplicateItems()},children:[i.jsx(U0,{className:"w-4 h-4 sm:mr-2"}),i.jsx("span",{className:"sr-only sm:not-sr-only",children:w("common.duplicate_selected_rows")})]})}),i.jsx(We,{children:w("common.duplicate_selected_rows_tooltip")})]}),i.jsxs(He,{children:[i.jsx(Ke,{asChild:!0,children:i.jsxs(G,{type:"button",variant:"link",disabled:!n.getSelectedRowModel().rows.length,onClick:()=>{var x;return(x=n.options.meta)==null?void 0:x.deleteItems()},children:[i.jsx(xd,{className:"w-4 h-4 sm:mr-2"}),i.jsx("span",{className:"sr-only sm:not-sr-only",children:w("common.remove_selected_rows")})]})}),i.jsx(We,{children:w("common.remove_selected_rows_tooltip")})]}),i.jsxs(He,{children:[i.jsx(Ke,{asChild:!0,children:i.jsxs(G,{type:"button",variant:"link",disabled:!n.getSelectedRowModel().rows.length,onClick:()=>n.resetRowSelection(),children:[i.jsx(Y0,{className:"w-4 h-4 sm:mr-2"}),i.jsx("span",{className:"sr-only sm:not-sr-only",children:w("common.reset_selected_rows")})]})}),i.jsx(We,{children:w("common.reset_selected_rows_tooltip")})]}),i.jsx(hn,{orientation:"vertical",className:"h-6 ml-1 mr-4"}),i.jsx("p",{className:"text-sm font-normal",children:w("common.rows_selected",{count:l})}),p]})}):i.jsxs("nav",{className:"flex items-center h-12 p-1 rounded-md bg-accent/75 text-muted-foreground",children:[i.jsxs("div",{className:"flex space-x-2",children:[i.jsxs(He,{children:[i.jsx(Ke,{asChild:!0,children:i.jsx(Lo,{variant:"link",onClick:()=>{var x;return(x=n.options.meta)==null?void 0:x.appendItem()}})}),i.jsx(We,{children:w("common.append_empty_row_tooltip")})]}),i.jsxs(He,{children:[i.jsx(Ke,{asChild:!0,children:i.jsx(To,{variant:"link",onClick:()=>{var x;n.options.meta&&n.options.meta.pickCatalogArticle&&((x=n.options.meta)==null||x.pickCatalogArticle())}})}),i.jsx(We,{children:w("common.append_article_tooltip")})]}),i.jsxs(He,{children:[i.jsx(Ke,{asChild:!0,children:i.jsx(Do,{variant:"link",onClick:()=>{var x;n.options.meta&&n.options.meta.pickBlock&&((x=n.options.meta)==null||x.pickBlock())}})}),i.jsx(We,{children:w("common.append_block_tooltip")})]})]}),p]})},zw=({row:n,table:a,onDelete:r})=>{const o=()=>{var l;(l=a.options.meta)==null||l.deleteItems(n.index),r()};return i.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[i.jsxs(G,{type:"button",variant:"outline",size:"sm",onClick:()=>{var l;return(l=a.options.meta)==null?void 0:l.insertItem(n.index)},children:[i.jsx(x0,{className:"w-4 h-4 mr-2"}),w("common.insert_row_above")]}),i.jsxs(G,{type:"button",variant:"outline",size:"sm",onClick:()=>{var l;return(l=a.options.meta)==null?void 0:l.insertItem(n.index+1)},children:[i.jsx(kc,{className:"w-4 h-4 mr-2"}),w("common.insert_row_below")]}),i.jsxs(G,{type:"button",variant:"outline",size:"sm",onClick:()=>{var l;return(l=a.options.meta)==null?void 0:l.duplicateItems(n.index)},children:[i.jsx(jo,{className:"w-4 h-4 mr-2"}),w("common.duplicate_row")]}),i.jsxs(Kc,{children:[i.jsx(Wc,{asChild:!0,children:i.jsxs(G,{type:"button",variant:"destructive",size:"sm",children:[i.jsx(xd,{className:"w-4 h-4 mr-2"}),w("common.remove_row")]})}),i.jsxs(Yc,{children:[i.jsxs(Qc,{children:[i.jsx(Xc,{children:w("quotes.inline_row_actions.delete_confirmation.title")}),i.jsx(Zc,{children:w("quotes.inline_row_actions.delete_confirmation.description")})]}),i.jsxs(Jc,{children:[i.jsx(ed,{children:w("common.cancel")}),i.jsx(td,{asChild:!0,children:i.jsx(G,{type:"button",variant:"destructive",onClick:o,children:w("quotes.inline_row_actions.delete_confirmation.confirm")})})]})]})]})]})},Bw={droppable:{strategy:w0.Always}},Vw={keyframes({transform:n}){return[{opacity:1,transform:Ga.Transform.toString(n.initial)},{opacity:0,transform:Ga.Transform.toString({...n.final,x:n.final.x+5,y:n.final.y+5})}]},easing:"ease-out",sideEffects({active:n}){n.node.animate([{opacity:0},{opacity:1}],{duration:_c.duration,easing:_c.easing})}};function Ac({columns:n,data:a,defaultValues:r,initialState:o,actions:l,showLineDiscountColumn:c,hasLineDiscounts:d,onShowLineDiscountColumnChange:h}){const[p,x]=M.useState({}),[v,R]=M.useState(),[y,b]=M.useState(null),E=M.useMemo(()=>a.map(O=>O.id),[a]),j=Dd({data:a,columns:n,enableColumnResizing:!1,columnResizeMode:"onChange",autoResetAll:!1,initialState:o,state:{rowSelection:p,columnVisibility:{...o==null?void 0:o.columnVisibility,discount:c}},enableRowSelection:!0,enableMultiRowSelection:!0,enableSorting:!1,enableHiding:!0,onRowSelectionChange:x,getCoreRowModel:Fd(),getRowId:O=>O==null?void 0:O.id,debugTable:!1,debugHeaders:!1,debugColumns:!1,defaultColumn:{minSize:0,size:Number.MAX_SAFE_INTEGER,maxSize:Number.MAX_SAFE_INTEGER},meta:{insertItem:(O,k)=>{l.insert(O,k||(r==null?void 0:r.items[0]),{shouldFocus:!0})},appendItem:O=>{l.append(O||(r==null?void 0:r.items[0]),{shouldFocus:!0})},pickCatalogArticle:()=>{l.pickCatalogArticle&&(l==null||l.pickCatalogArticle())},pickBlock:()=>{l.pickBlock&&(l==null||l.pickBlock())},duplicateItems:O=>{var k;if(O!=null){const H=((k=l.getItem)==null?void 0:k.call(l,O))??j.getRowModel().rows[O].original;l.insert(O+1,{...H,id:void 0},{shouldFocus:!0})}else if(j.getSelectedRowModel().rows.length){const H=j.getSelectedRowModel().rows[j.getSelectedRowModel().rows.length-1].index,W=j.getSelectedRowModel().rows.map(B=>({...B.original,id:void 0}));j.getRowModel().rows.length{if(O!=null)l.remove(O);else if(j.getSelectedRowModel().rows.length>0){let k=j.getSelectedRowModel().rows.length-1;for(;k>=0;k--){const H=E.indexOf(String(j.getSelectedRowModel().rows[k].id));l.remove(H),E.splice(H,1)}j.resetRowSelection()}else l.remove()},updateItem:(O,k,H,W)=>{l.update(O,{...k,[`${H}`]:W})}}}),D=v0(Pi(A0,{}),Pi(E0,{}),Pi(R0,{}),Pi(N0,{}));function F(O){var W;let k=O.active.id,H=(W=O.over)==null?void 0:W.id;if(H!==void 0&&k!==H){let B=E.indexOf(String(H));if(j.getSelectedRowModel().rows.length>1)j.getSelectedRowModel().rows.forEach((se,ce)=>{const Y=E.indexOf(String(se.id));ce>0&&(k=se.id,B=E.indexOf(String(H)),B{const H=typeof k=="string"?k:k.id;return H===v||!j.getSelectedRowModel().rowsById[H]}):O}return i.jsx(_0,{measuring:Bw,sensors:D,onDragEnd:F,onDragStart:q,onDragCancel:$,collisionDetection:b0,children:i.jsxs(Le,{children:[i.jsx(pt,{className:"sticky z-10 top-16 bg-card/90",children:i.jsx(Ge,{children:i.jsx($w,{table:j,showLineDiscountColumn:c,hasLineDiscounts:d,onShowLineDiscountColumnChange:h})})}),i.jsxs(Oe,{children:[i.jsxs(uo,{className:"table-fixed",children:[i.jsx(co,{className:"sticky top-0 z-10 bg-background",children:j.getHeaderGroups().map(O=>i.jsx(pn,{className:"hover:bg-transparent",children:O.headers.map(k=>i.jsx(fo,{className:"px-2 py-1",style:{width:k.getSize()===Number.MAX_SAFE_INTEGER?"auto":k.getSize()},children:k.isPlaceholder?null:i.jsx(Ld,{table:j,header:k})},k.id))},O.id))}),i.jsx(go,{children:i.jsx(j0,{items:Q(E),strategy:C0,children:Q(j.getRowModel().rows).map(O=>{const k=O,H=k.id===y;return i.jsxs(M.Fragment,{children:[i.jsx(Ew,{id:k.id,isActive:H,onActivate:()=>b(k.id),children:k.getVisibleCells().map(W=>i.jsx(qr,{className:"px-2 py-2 align-top",style:{width:W.column.getSize()===Number.MAX_SAFE_INTEGER?"auto":W.column.getSize()},children:Gi(W.column.columnDef.cell,W.getContext())},W.id))}),H&&i.jsx(pn,{className:"border border-t-0 border-destructive/30 border-l-4 border-l-destructive bg-destructive/5 hover:bg-destructive/5",children:i.jsx(qr,{colSpan:k.getVisibleCells().length,className:"px-2 py-2",children:i.jsx(zw,{row:k,table:j,onDelete:()=>b(null)})})})]},k.id)})})})]}),S0.createPortal(i.jsx(y0,{dropAnimation:Vw,className:"z-40 opacity-100",children:v&&i.jsx("div",{className:"relative flex flex-wrap",children:j.getSelectedRowModel().rows.length?i.jsx(ro,{variant:"destructive",className:"absolute z-50 flex items-center justify-center w-2 h-2 p-3 rounded-full top left -left-2 -top-2",children:j.getSelectedRowModel().rows.length}):null})}),document.body),!1]}),i.jsx(Dt,{children:i.jsxs(tr,{children:[i.jsx(Lo,{onClick:()=>{var O;return(O=j.options.meta)==null?void 0:O.appendItem()}}),i.jsx(To,{onClick:()=>{var O;j.options.meta&&j.options.meta.pickCatalogArticle&&((O=j.options.meta)==null||O.pickCatalogArticle())}}),i.jsx(Do,{onClick:()=>{var O;j.options.meta&&j.options.meta.pickBlock&&((O=j.options.meta)==null||O.pickBlock())}})]})})]})})}const Uw={en:[{id:2000000098,code:"CAP_CLA_SEMI_SUSPENDIDO_EN",title:"Finish: MELAMINE / colour: TO BE DETERMINED",body:`Thickness block: 19 mm / Thickness complements: 19 mm.\r Hanging rods: CHROME/ BLACK\r Glass drawer fronts: STRAIGHT / "U" - FLOAT BRONZE C-424 \r Drawer handle: xxxxx / Drawers: 4 DE 180 MM.\r diff --git a/dist/client/assets/index-vq9AFyzk.js b/dist/client/assets/index-CJmQk4ZY.js similarity index 99% rename from dist/client/assets/index-vq9AFyzk.js rename to dist/client/assets/index-CJmQk4ZY.js index 3dab346..4888009 100644 --- a/dist/client/assets/index-vq9AFyzk.js +++ b/dist/client/assets/index-CJmQk4ZY.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-qquRaZ4m.js","assets/index-DtTssDoC.css"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CCfX-UYJ.js","assets/index-DtTssDoC.css"])))=>i.map(i=>d[i]); var vle=Object.defineProperty;var Sj=t=>{throw TypeError(t)};var yle=(t,e,n)=>e in t?vle(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var He=(t,e,n)=>yle(t,typeof e!="symbol"?e+"":e,n),_P=(t,e,n)=>e.has(t)||Sj("Cannot "+n);var C=(t,e,n)=>(_P(t,e,"read from private field"),n?n.call(t):e.get(t)),z=(t,e,n)=>e.has(t)?Sj("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),$=(t,e,n,r)=>(_P(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),B=(t,e,n)=>(_P(t,e,"access private method"),n);var vs=(t,e,n,r)=>({set _(s){$(t,e,s,n)},get _(){return C(t,e,r)}});function l5(t,e){for(var n=0;nr[s]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();var yr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Dd(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function ble(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var s=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,s.get?s:{enumerable:!0,get:function(){return t[r]}})}),n}var c5={exports:{}},g1={},u5={exports:{}},Mt={};/** * @license React * react.production.min.js @@ -309,7 +309,7 @@ function print() { __p += __j.call(arguments, '') } `)){const o=document.createElement("div");o.append(a?document.createTextNode(a):document.createElement("br")),r.append(o)}const i=Nn._internalPadding*this.parentScale;return n.updateEdited({rect:this.getRect(i,i),popupContent:C(this,Hi)}),r}resetAnnotationElement(n){super.resetAnnotationElement(n),n.resetEdited()}};yw=new WeakMap,bw=new WeakMap,ww=new WeakMap,_w=new WeakMap,xw=new WeakMap,aa=new WeakMap,Hi=new WeakMap,Sw=new WeakMap,Vi=new WeakMap,Mg=new WeakMap,Ar=new WeakSet,OJ=function(n){const r=i=>{this.editorDiv.style.fontSize=`calc(${i}px * var(--scale-factor))`,this.translate(0,-(i-C(this,Vi))*this.parentScale),$(this,Vi,i),B(this,Ar,cE).call(this)},s=C(this,Vi);this.addCommands({cmd:r.bind(this,n),undo:r.bind(this,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:ht.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})},MJ=function(n){const r=i=>{$(this,aa,this.editorDiv.style.color=i)},s=C(this,aa);this.addCommands({cmd:r.bind(this,n),undo:r.bind(this,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:ht.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},LJ=function(){var r;const n=[];this.editorDiv.normalize();for(const s of this.editorDiv.childNodes)n.push(B(r=Nn,Ic,uE).call(r,s));return n.join(` `)},cE=function(){const[n,r]=this.parentDimensions;let s;if(this.isAttachedToDOM)s=this.div.getBoundingClientRect();else{const{currentLayer:i,div:a}=this,o=a.style.display,c=a.classList.contains("hidden");a.classList.remove("hidden"),a.style.display="hidden",i.div.append(this.div),s=a.getBoundingClientRect(),a.remove(),a.style.display=o,a.classList.toggle("hidden",c)}this.rotation%180===this.parentRotation%180?(this.width=s.width/n,this.height=s.height/r):(this.width=s.height/n,this.height=s.width/r),this.fixAndSetPosition()},Ic=new WeakSet,uE=function(n){return(n.nodeType===Node.TEXT_NODE?n.nodeValue:n.innerText).replaceAll(CS,"")},dE=function(){if(this.editorDiv.replaceChildren(),!!C(this,Hi))for(const n of C(this,Hi).split(` `)){const r=document.createElement("div");r.append(n?document.createTextNode(n):document.createElement("br")),this.editorDiv.append(r)}},IJ=function(){return C(this,Hi).replaceAll(" "," ")},EO=function(n){return n.replaceAll(" "," ")},$J=function(n){const{value:r,fontSize:s,color:i,pageIndex:a}=C(this,Mg);return this._hasBeenMoved||n.value!==r||n.fontSize!==s||n.color.some((o,c)=>o!==i[c])||n.pageIndex!==a},z(Nn,Ic),He(Nn,"_freeTextDefaultContent",""),He(Nn,"_internalPadding",0),He(Nn,"_defaultColor",null),He(Nn,"_defaultFontSize",10),He(Nn,"_type","freetext"),He(Nn,"_editorType",Vt.FREETEXT);let SO=Nn;var Ew,Ju,la,Xs,FJ,fE,jJ,zJ,AO;class CO{constructor(e,n=0,r=0,s=!0){z(this,Xs);z(this,Ew);z(this,Ju,[]);z(this,la,[]);let i=1/0,a=-1/0,o=1/0,c=-1/0;const u=10**-4;for(const{x:y,y:g,width:v,height:w}of e){const x=Math.floor((y-n)/u)*u,A=Math.ceil((y+v+n)/u)*u,k=Math.floor((g-n)/u)*u,R=Math.ceil((g+w+n)/u)*u,E=[x,k,R,!0],T=[A,k,R,!1];C(this,Ju).push(E,T),i=Math.min(i,x),a=Math.max(a,A),o=Math.min(o,k),c=Math.max(c,R)}const f=a-i+2*r,l=c-o+2*r,d=i-r,m=o-r,p=C(this,Ju).at(s?-1:-2),h=[p[0],p[2]];for(const y of C(this,Ju)){const[g,v,w]=y;y[0]=(g-d)/f,y[1]=(v-m)/l,y[2]=(w-m)/l}$(this,Ew,{x:d,y:m,width:f,height:l,lastPoint:h})}getOutlines(){C(this,Ju).sort((n,r)=>n[0]-r[0]||n[1]-r[1]||n[2]-r[2]);const e=[];for(const n of C(this,Ju))n[3]?(e.push(...B(this,Xs,AO).call(this,n)),B(this,Xs,jJ).call(this,n)):(B(this,Xs,zJ).call(this,n),e.push(...B(this,Xs,AO).call(this,n)));return B(this,Xs,FJ).call(this,e)}}Ew=new WeakMap,Ju=new WeakMap,la=new WeakMap,Xs=new WeakSet,FJ=function(e){const n=[],r=new Set;for(const a of e){const[o,c,u]=a;n.push([o,c,a],[o,u,a])}n.sort((a,o)=>a[1]-o[1]||a[0]-o[0]);for(let a=0,o=n.length;a0;){const a=r.values().next().value;let[o,c,u,f,l]=a;r.delete(a);let d=o,m=c;for(i=[o,u],s.push(i);;){let p;if(r.has(f))p=f;else if(r.has(l))p=l;else break;r.delete(p),[o,c,u,f,l]=p,d!==o&&(i.push(d,m,o,m===c?c:u),d=o),m=m===c?u:c}i.push(d,m)}return new gFe(s,C(this,Ew))},fE=function(e){const n=C(this,la);let r=0,s=n.length-1;for(;r<=s;){const i=r+s>>1,a=n[i][0];if(a===e)return i;a=0;s--){const[i,a]=C(this,la)[s];if(i!==e)break;if(i===e&&a===n){C(this,la).splice(s,1);return}}},AO=function(e){const[n,r,s]=e,i=[[n,r,s]],a=B(this,Xs,fE).call(this,s);for(let o=0;o=c){if(m>u)i[f][1]=u;else{if(l===1)return[];i.splice(f,1),f--,l--}continue}i[f][2]=c,m>u&&i.push([n,u,m])}}}return i};class BJ{toSVGPath(){throw new Error("Abstract method `toSVGPath` must be implemented.")}get box(){throw new Error("Abstract getter `box` must be implemented.")}serialize(e,n){throw new Error("Abstract method `serialize` must be implemented.")}get free(){return this instanceof PO}}var Cw,Lg;class gFe extends BJ{constructor(n,r){super();z(this,Cw);z(this,Lg);$(this,Lg,n),$(this,Cw,r)}toSVGPath(){const n=[];for(const r of C(this,Lg)){let[s,i]=r;n.push(`M${s} ${i}`);for(let a=2;a=6;p-=6)isNaN(n[p])?m.push(`L${n[p+4]} ${n[p+5]}`):m.push(`C${n[p]} ${n[p+1]} ${n[p+2]} ${n[p+3]} ${n[p+4]} ${n[p+5]}`);return m.push(`L${n[4]} ${n[5]} Z`),m.join(" ")}getOutlines(){var g;const e=C(this,tl),n=C(this,vc),r=C(this,zt),s=r.subarray(4,6),i=r.subarray(16,18),[a,o,c,u]=C(this,el),f=new Float64Array((((g=C(this,ed))==null?void 0:g.length)??0)+2);for(let v=0,w=f.length-2;v=6;v-=6)for(let w=0;w<6;w+=2){if(isNaN(n[v+w])){h[y]=h[y+1]=NaN,y+=2;continue}h[y]=n[v+w],h[y+1]=n[v+w+1],y+=2}return h.set([NaN,NaN,NaN,NaN,n[4],n[5]],y),new PO(h,f,C(this,el),C(this,Fg),C(this,Ig),C(this,$g))}};el=new WeakMap,vc=new WeakMap,Ig=new WeakMap,$g=new WeakMap,tl=new WeakMap,zt=new WeakMap,hh=new WeakMap,ph=new WeakMap,Aw=new WeakMap,Rw=new WeakMap,Fg=new WeakMap,jg=new WeakMap,ed=new WeakMap,Pw=new WeakMap,h1=new WeakMap,p1=new WeakMap,Tw=new WeakSet,RO=function(){const e=C(this,zt).subarray(4,6),n=C(this,zt).subarray(16,18),[r,s,i,a]=C(this,el);return[(C(this,hh)+(e[0]-n[0])/2-r)/i,(C(this,ph)+(e[1]-n[1])/2-s)/a,(C(this,hh)+(n[0]-e[0])/2-r)/i,(C(this,ph)+(n[1]-e[1])/2-s)/a]},z(Yl,Pw,8),z(Yl,h1,2),z(Yl,p1,C(Yl,Pw)+C(Yl,h1));let VC=Yl;var zg,mh,yc,kw,Wi,Dw,gr,bi,Qy,Zy,UJ;class PO extends BJ{constructor(n,r,s,i,a,o){super();z(this,bi);z(this,zg);z(this,mh,null);z(this,yc);z(this,kw);z(this,Wi);z(this,Dw);z(this,gr);$(this,gr,n),$(this,Wi,r),$(this,zg,s),$(this,Dw,i),$(this,yc,a),$(this,kw,o),B(this,bi,UJ).call(this,o);const{x:c,y:u,width:f,height:l}=C(this,mh);for(let d=0,m=n.length;d-1?($(this,Gi,!0),B(this,Ot,NO).call(this,n),B(this,Ot,Jy).call(this)):($(this,Vg,n.anchorNode),$(this,$w,n.anchorOffset),$(this,Fw,n.focusNode),$(this,jw,n.focusOffset),B(this,Ot,DO).call(this),B(this,Ot,Jy).call(this),this.rotate(this.rotation))}static get _keyboardManager(){const n=tn.prototype;return Gt(this,"_keyboardManager",new I_([[["ArrowLeft","mac+ArrowLeft"],n._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],n._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],n._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],n._moveCaret,{args:[3]}]]))}get telemetryInitialData(){return{action:"added",type:C(this,Gi)?"free_highlight":"highlight",color:this._uiManager.highlightColorNames.get(this.color),thickness:C(this,nl),methodOfCreation:C(this,zw)}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.highlightColorNames.get(this.color)}}static computeTelemetryFinalData(n){return{numberOfColors:n.get("color").size}}static initialize(n,r){var s;hn.initialize(n,r),tn._defaultColor||(tn._defaultColor=((s=r.highlightColors)==null?void 0:s.values().next().value)||"#fff066")}static updateDefaultParams(n,r){switch(n){case ht.HIGHLIGHT_DEFAULT_COLOR:tn._defaultColor=r;break;case ht.HIGHLIGHT_THICKNESS:tn._defaultThickness=r;break}}translateInPage(n,r){}get toolbarPosition(){return C(this,Gg)}updateParams(n,r){switch(n){case ht.HIGHLIGHT_COLOR:B(this,Ot,WJ).call(this,r);break;case ht.HIGHLIGHT_THICKNESS:B(this,Ot,GJ).call(this,r);break}}static get defaultPropertiesToUpdate(){return[[ht.HIGHLIGHT_DEFAULT_COLOR,tn._defaultColor],[ht.HIGHLIGHT_THICKNESS,tn._defaultThickness]]}get propertiesToUpdate(){return[[ht.HIGHLIGHT_COLOR,this.color||tn._defaultColor],[ht.HIGHLIGHT_THICKNESS,C(this,nl)||tn._defaultThickness],[ht.HIGHLIGHT_FREE,C(this,Gi)]]}async addEditToolbar(){const n=await super.addEditToolbar();return n?(this._uiManager.highlightColors&&($(this,Wg,new WC({editor:this})),n.addColorPicker(C(this,Wg))),n):null}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(B(this,Ot,eb).call(this))}getBaseTranslation(){return[0,0]}getRect(n,r){return super.getRect(n,r,B(this,Ot,eb).call(this))}onceAdded(){this.parent.addUndoableEditor(this),this.div.focus()}remove(){B(this,Ot,OO).call(this),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(B(this,Ot,Jy).call(this),this.isAttachedToDOM||this.parent.add(this)))}setParent(n){var s;let r=!1;this.parent&&!n?B(this,Ot,OO).call(this):n&&(B(this,Ot,Jy).call(this,n),r=!this.parent&&((s=this.div)==null?void 0:s.classList.contains("selectedEditor"))),super.setParent(n),this.show(this._isVisible),r&&this.select()}rotate(n){var i,a,o;const{drawLayer:r}=this.parent;let s;C(this,Gi)?(n=(n-this.rotation+360)%360,s=B(i=tn,No,im).call(i,C(this,da).box,n)):s=B(a=tn,No,im).call(a,this,n),r.rotate(C(this,Bs),n),r.rotate(C(this,Or),n),r.updateBox(C(this,Bs),s),r.updateBox(C(this,Or),B(o=tn,No,im).call(o,C(this,xo).box,n))}render(){if(this.div)return this.div;const n=super.render();C(this,qg)&&(n.setAttribute("aria-label",C(this,qg)),n.setAttribute("role","mark")),C(this,Gi)?n.classList.add("free"):this.div.addEventListener("keydown",C(this,m1),{signal:this._uiManager._signal});const r=$(this,yh,document.createElement("div"));n.append(r),r.setAttribute("aria-hidden","true"),r.className="internal",r.style.clipPath=C(this,vh);const[s,i]=this.parentDimensions;return this.setDims(this.width*s,this.height*i),zC(this,C(this,yh),["pointerover","pointerleave"]),this.enableEditing(),n}pointerover(){this.parent.drawLayer.addClass(C(this,Or),"hovered")}pointerleave(){this.parent.drawLayer.removeClass(C(this,Or),"hovered")}_moveCaret(n){switch(this.parent.unselect(this),n){case 0:case 2:B(this,Ot,hE).call(this,!0);break;case 1:case 3:B(this,Ot,hE).call(this,!1);break}}select(){var n,r;super.select(),C(this,Or)&&((n=this.parent)==null||n.drawLayer.removeClass(C(this,Or),"hovered"),(r=this.parent)==null||r.drawLayer.addClass(C(this,Or),"selected"))}unselect(){var n;super.unselect(),C(this,Or)&&((n=this.parent)==null||n.drawLayer.removeClass(C(this,Or),"selected"),C(this,Gi)||B(this,Ot,hE).call(this,!1))}get _mustFixPosition(){return!C(this,Gi)}show(n=this._isVisible){super.show(n),this.parent&&(this.parent.drawLayer.show(C(this,Bs),n),this.parent.drawLayer.show(C(this,Or),n))}static startHighlighting(n,r,{target:s,x:i,y:a}){const{x:o,y:c,width:u,height:f}=s.getBoundingClientRect(),l=y=>{B(this,No,QJ).call(this,n,y)},d=n._signal,m={capture:!0,passive:!1,signal:d},p=y=>{y.preventDefault(),y.stopPropagation()},h=y=>{s.removeEventListener("pointermove",l),window.removeEventListener("blur",h),window.removeEventListener("pointerup",h),window.removeEventListener("pointerdown",p,m),window.removeEventListener("contextmenu",Ei),B(this,No,ZJ).call(this,n,y)};window.addEventListener("blur",h,{signal:d}),window.addEventListener("pointerup",h,{signal:d}),window.addEventListener("pointerdown",p,m),window.addEventListener("contextmenu",Ei,{signal:d}),s.addEventListener("pointermove",l,{signal:d}),this._freeHighlight=new VC({x:i,y:a},[o,c,u,f],n.scale,this._defaultThickness/2,r,.001),{id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=n.drawLayer.highlight(this._freeHighlight,this._defaultColor,this._defaultOpacity,!0)}static deserialize(n,r,s){var h;const i=super.deserialize(n,r,s),{rect:[a,o,c,u],color:f,quadPoints:l}=n;i.color=et.makeHexColor(...f),$(i,bh,n.opacity);const[d,m]=i.pageDimensions;i.width=(c-a)/d,i.height=(u-o)/m;const p=$(i,td,[]);for(let y=0;y=0)$(this,Bs,r),$(this,vh,s),this.parent.drawLayer.finalizeLine(r,n),$(this,Or,this.parent.drawLayer.highlightOutline(C(this,xo)));else if(this.parent){const m=this.parent.viewport.rotation;this.parent.drawLayer.updateLine(C(this,Bs),n),this.parent.drawLayer.updateBox(C(this,Bs),B(l=tn,No,im).call(l,C(this,da).box,(m-this.rotation+360)%360)),this.parent.drawLayer.updateLine(C(this,Or),C(this,xo)),this.parent.drawLayer.updateBox(C(this,Or),B(d=tn,No,im).call(d,C(this,xo).box,m))}const{x:a,y:o,width:c,height:u}=n.box;switch(this.rotation){case 0:this.x=a,this.y=o,this.width=c,this.height=u;break;case 90:{const[m,p]=this.parentDimensions;this.x=o,this.y=1-a,this.width=c*p/m,this.height=u*m/p;break}case 180:this.x=1-a,this.y=1-o,this.width=c,this.height=u;break;case 270:{const[m,p]=this.parentDimensions;this.x=1-o,this.y=a,this.width=c*p/m,this.height=u*m/p;break}}const{lastPoint:f}=C(this,xo).box;$(this,Gg,[(f[0]-a)/c,(f[1]-o)/u])},WJ=function(n){const r=i=>{var a,o;this.color=i,(a=this.parent)==null||a.drawLayer.changeColor(C(this,Bs),i),(o=C(this,Wg))==null||o.updateColor(i)},s=this.color;this.addCommands({cmd:r.bind(this,n),undo:r.bind(this,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:ht.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.highlightColorNames.get(n)},!0)},GJ=function(n){const r=C(this,nl),s=i=>{$(this,nl,i),B(this,Ot,qJ).call(this,i)};this.addCommands({cmd:s.bind(this,n),undo:s.bind(this,r),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:ht.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:n},!0)},qJ=function(n){if(!C(this,Gi))return;B(this,Ot,NO).call(this,{highlightOutlines:C(this,da).getNewOutline(n/2)}),this.fixAndSetPosition();const[r,s]=this.parentDimensions;this.setDims(this.width*r,this.height*s)},OO=function(){C(this,Bs)===null||!this.parent||(this.parent.drawLayer.remove(C(this,Bs)),$(this,Bs,null),this.parent.drawLayer.remove(C(this,Or)),$(this,Or,null))},Jy=function(n=this.parent){C(this,Bs)===null&&({id:vs(this,Bs)._,clipPathId:vs(this,vh)._}=n.drawLayer.highlight(C(this,da),this.color,C(this,bh)),$(this,Or,n.drawLayer.highlightOutline(C(this,xo))),C(this,yh)&&(C(this,yh).style.clipPath=C(this,vh)))},No=new WeakSet,im=function({x:n,y:r,width:s,height:i},a){switch(a){case 90:return{x:1-r-i,y:n,width:i,height:s};case 180:return{x:1-n-s,y:1-r-i,width:s,height:i};case 270:return{x:r,y:1-n-s,width:i,height:s}}return{x:n,y:r,width:s,height:i}},KJ=function(n){tn._keyboardManager.exec(this,n)},hE=function(n){if(!C(this,Vg))return;const r=window.getSelection();n?r.setPosition(C(this,Vg),C(this,$w)):r.setPosition(C(this,Fw),C(this,jw))},eb=function(){return C(this,Gi)?this.rotation:0},YJ=function(){if(C(this,Gi))return null;const[n,r]=this.pageDimensions,s=C(this,td),i=new Float32Array(s.length*8);let a=0;for(const{x:o,y:c,width:u,height:f}of s){const l=o*n,d=(1-c-f)*r;i[a]=i[a+4]=l,i[a+1]=i[a+3]=d,i[a+2]=i[a+6]=l+u*n,i[a+5]=i[a+7]=d+f*r,a+=8}return i},XJ=function(n){return C(this,da).serialize(n,B(this,Ot,eb).call(this))},QJ=function(n,r){this._freeHighlight.add(r)&&n.drawLayer.updatePath(this._freeHighlightId,this._freeHighlight)},ZJ=function(n,r){this._freeHighlight.isEmpty()?n.drawLayer.removeFreeHighlight(this._freeHighlightId):n.createAndAddNewEditor(r,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""},z(tn,No),He(tn,"_defaultColor",null),He(tn,"_defaultOpacity",1),He(tn,"_defaultThickness",12),He(tn,"_l10nPromise"),He(tn,"_type","highlight"),He(tn,"_editorType",Vt.HIGHLIGHT),He(tn,"_freeHighlightId",-1),He(tn,"_freeHighlight",null),He(tn,"_freeHighlightClipId","");let GC=tn;var wh,_h,Bw,Uw,Hw,xh,rl,bc,So,Sh,Eh,wc,Ch,Ah,nd,ze,JJ,eee,tee,nee,LO,ree,IO,see,iee,oee,aee,lee,hf,$O,pE,mE,om,FO,gE,Wc,cee,jO,uee,dee,zO,vE,tb;const Xn=class Xn extends hn{constructor(n){super({...n,name:"inkEditor"});z(this,ze);z(this,wh,0);z(this,_h,0);z(this,Bw,this.canvasPointermove.bind(this));z(this,Uw,this.canvasPointerleave.bind(this));z(this,Hw,this.canvasPointerup.bind(this));z(this,xh,this.canvasPointerdown.bind(this));z(this,rl,null);z(this,bc,new Path2D);z(this,So,!1);z(this,Sh,!1);z(this,Eh,!1);z(this,wc,null);z(this,Ch,0);z(this,Ah,0);z(this,nd,null);this.color=n.color||null,this.thickness=n.thickness||null,this.opacity=n.opacity||null,this.paths=[],this.bezierPath2D=[],this.allRawPaths=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0,this._willKeepAspectRatio=!0}static initialize(n,r){hn.initialize(n,r)}static updateDefaultParams(n,r){switch(n){case ht.INK_THICKNESS:Xn._defaultThickness=r;break;case ht.INK_COLOR:Xn._defaultColor=r;break;case ht.INK_OPACITY:Xn._defaultOpacity=r/100;break}}updateParams(n,r){switch(n){case ht.INK_THICKNESS:B(this,ze,JJ).call(this,r);break;case ht.INK_COLOR:B(this,ze,eee).call(this,r);break;case ht.INK_OPACITY:B(this,ze,tee).call(this,r);break}}static get defaultPropertiesToUpdate(){return[[ht.INK_THICKNESS,Xn._defaultThickness],[ht.INK_COLOR,Xn._defaultColor||hn._defaultLineColor],[ht.INK_OPACITY,Math.round(Xn._defaultOpacity*100)]]}get propertiesToUpdate(){return[[ht.INK_THICKNESS,this.thickness||Xn._defaultThickness],[ht.INK_COLOR,this.color||Xn._defaultColor||hn._defaultLineColor],[ht.INK_OPACITY,Math.round(100*(this.opacity??Xn._defaultOpacity))]]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.canvas||(B(this,ze,pE).call(this),B(this,ze,mE).call(this)),this.isAttachedToDOM||(this.parent.add(this),B(this,ze,om).call(this)),B(this,ze,tb).call(this)))}remove(){var n;this.canvas!==null&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,C(this,rl)&&(clearTimeout(C(this,rl)),$(this,rl,null)),(n=C(this,wc))==null||n.disconnect(),$(this,wc,null),super.remove())}setParent(n){!this.parent&&n?this._uiManager.removeShouldRescale(this):this.parent&&n===null&&this._uiManager.addShouldRescale(this),super.setParent(n)}onScaleChanging(){const[n,r]=this.parentDimensions,s=this.width*n,i=this.height*r;this.setDimensions(s,i)}enableEditMode(){C(this,So)||this.canvas===null||(super.enableEditMode(),this._isDraggable=!1,this.canvas.addEventListener("pointerdown",C(this,xh),{signal:this._uiManager._signal}))}disableEditMode(){!this.isInEditMode()||this.canvas===null||(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",C(this,xh)))}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return this.paths.length===0||this.paths.length===1&&this.paths[0].length===0}commit(){C(this,So)||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),$(this,So,!0),this.div.classList.add("disabled"),B(this,ze,tb).call(this,!0),this.select(),this.parent.addInkEditorIfNeeded(!0),this.moveInDOM(),this.div.focus({preventScroll:!0}))}focusin(n){this._focusEventsAllowed&&(super.focusin(n),this.enableEditMode())}canvasPointerdown(n){n.button!==0||!this.isInEditMode()||C(this,So)||(this.setInForeground(),n.preventDefault(),this.div.contains(document.activeElement)||this.div.focus({preventScroll:!0}),B(this,ze,ree).call(this,n.offsetX,n.offsetY))}canvasPointermove(n){n.preventDefault(),B(this,ze,IO).call(this,n.offsetX,n.offsetY)}canvasPointerup(n){n.preventDefault(),B(this,ze,$O).call(this,n)}canvasPointerleave(n){B(this,ze,$O).call(this,n)}get isResizable(){return!this.isEmpty()&&C(this,So)}render(){if(this.div)return this.div;let n,r;this.width&&(n=this.x,r=this.y),super.render(),this.div.setAttribute("data-l10n-id","pdfjs-ink");const[s,i,a,o]=B(this,ze,nee).call(this);if(this.setAt(s,i,0,0),this.setDims(a,o),B(this,ze,pE).call(this),this.width){const[c,u]=this.parentDimensions;this.setAspectRatio(this.width*c,this.height*u),this.setAt(n*c,r*u,this.width*c,this.height*u),$(this,Eh,!0),B(this,ze,om).call(this),this.setDims(this.width*c,this.height*u),B(this,ze,hf).call(this),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return B(this,ze,mE).call(this),this.div}setDimensions(n,r){const s=Math.round(n),i=Math.round(r);if(C(this,Ch)===s&&C(this,Ah)===i)return;$(this,Ch,s),$(this,Ah,i),this.canvas.style.visibility="hidden";const[a,o]=this.parentDimensions;this.width=n/a,this.height=r/o,this.fixAndSetPosition(),C(this,So)&&B(this,ze,FO).call(this,n,r),B(this,ze,om).call(this),B(this,ze,hf).call(this),this.canvas.style.visibility="visible",this.fixDims()}static deserialize(n,r,s){var y,g,v;if(n instanceof kJ)return null;const i=super.deserialize(n,r,s);i.thickness=n.thickness,i.color=et.makeHexColor(...n.color),i.opacity=n.opacity;const[a,o]=i.pageDimensions,c=i.width*a,u=i.height*o,f=i.parentScale,l=n.thickness/2;$(i,So,!0),$(i,Ch,Math.round(c)),$(i,Ah,Math.round(u));const{paths:d,rect:m,rotation:p}=n;for(let{bezier:w}of d){w=B(y=Xn,Wc,uee).call(y,w,m,p);const x=[];i.paths.push(x);let A=f*(w[0]-l),k=f*(w[1]-l);for(let E=2,T=w.length;E{this.thickness=i,B(this,ze,tb).call(this)},s=this.thickness;this.addCommands({cmd:r.bind(this,n),undo:r.bind(this,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:ht.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})},eee=function(n){const r=i=>{this.color=i,B(this,ze,hf).call(this)},s=this.color;this.addCommands({cmd:r.bind(this,n),undo:r.bind(this,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:ht.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})},tee=function(n){const r=i=>{this.opacity=i,B(this,ze,hf).call(this)};n/=100;const s=this.opacity;this.addCommands({cmd:r.bind(this,n),undo:r.bind(this,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:ht.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})},nee=function(){const{parentRotation:n,parentDimensions:[r,s]}=this;switch(n){case 90:return[0,s,s,r];case 180:return[r,s,r,s];case 270:return[r,0,s,r];default:return[0,0,r,s]}},LO=function(){const{ctx:n,color:r,opacity:s,thickness:i,parentScale:a,scaleFactor:o}=this;n.lineWidth=i*a/o,n.lineCap="round",n.lineJoin="round",n.miterLimit=10,n.strokeStyle=`${r}${z$e(s)}`},ree=function(n,r){const s=this._uiManager._signal;this.canvas.addEventListener("contextmenu",Ei,{signal:s}),this.canvas.addEventListener("pointerleave",C(this,Uw),{signal:s}),this.canvas.addEventListener("pointermove",C(this,Bw),{signal:s}),this.canvas.addEventListener("pointerup",C(this,Hw),{signal:s}),this.canvas.removeEventListener("pointerdown",C(this,xh)),this.isEditing=!0,C(this,Eh)||($(this,Eh,!0),B(this,ze,om).call(this),this.thickness||(this.thickness=Xn._defaultThickness),this.color||(this.color=Xn._defaultColor||hn._defaultLineColor),this.opacity??(this.opacity=Xn._defaultOpacity)),this.currentPath.push([n,r]),$(this,Sh,!1),B(this,ze,LO).call(this),$(this,nd,()=>{B(this,ze,oee).call(this),C(this,nd)&&window.requestAnimationFrame(C(this,nd))}),window.requestAnimationFrame(C(this,nd))},IO=function(n,r){const[s,i]=this.currentPath.at(-1);if(this.currentPath.length>1&&n===s&&r===i)return;const a=this.currentPath;let o=C(this,bc);if(a.push([n,r]),$(this,Sh,!0),a.length<=2){o.moveTo(...a[0]),o.lineTo(n,r);return}a.length===3&&($(this,bc,o=new Path2D),o.moveTo(...a[0])),B(this,ze,aee).call(this,o,...a.at(-3),...a.at(-2),n,r)},see=function(){if(this.currentPath.length===0)return;const n=this.currentPath.at(-1);C(this,bc).lineTo(...n)},iee=function(n,r){$(this,nd,null),n=Math.min(Math.max(n,0),this.canvas.width),r=Math.min(Math.max(r,0),this.canvas.height),B(this,ze,IO).call(this,n,r),B(this,ze,see).call(this);let s;if(this.currentPath.length!==1)s=B(this,ze,lee).call(this);else{const u=[n,r];s=[[u,u.slice(),u.slice(),u]]}const i=C(this,bc),a=this.currentPath;this.currentPath=[],$(this,bc,new Path2D);const o=()=>{this.allRawPaths.push(a),this.paths.push(s),this.bezierPath2D.push(i),this._uiManager.rebuild(this)},c=()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),this.paths.length===0?this.remove():(this.canvas||(B(this,ze,pE).call(this),B(this,ze,mE).call(this)),B(this,ze,tb).call(this))};this.addCommands({cmd:o,undo:c,mustExec:!0})},oee=function(){if(!C(this,Sh))return;$(this,Sh,!1);const n=Math.ceil(this.thickness*this.parentScale),r=this.currentPath.slice(-3),s=r.map(o=>o[0]),i=r.map(o=>o[1]);Math.min(...s)-n,Math.max(...s)+n,Math.min(...i)-n,Math.max(...i)+n;const{ctx:a}=this;a.save(),a.clearRect(0,0,this.canvas.width,this.canvas.height);for(const o of this.bezierPath2D)a.stroke(o);a.stroke(C(this,bc)),a.restore()},aee=function(n,r,s,i,a,o,c){const u=(r+i)/2,f=(s+a)/2,l=(i+o)/2,d=(a+c)/2;n.bezierCurveTo(u+2*(i-u)/3,f+2*(a-f)/3,l+2*(i-l)/3,d+2*(a-d)/3,l,d)},lee=function(){const n=this.currentPath;if(n.length<=2)return[[n[0],n[0],n.at(-1),n.at(-1)]];const r=[];let s,[i,a]=n[0];for(s=1;s{$(this,rl,null),this.canvas.removeEventListener("contextmenu",Ei)},10)),B(this,ze,iee).call(this,n.offsetX,n.offsetY),this.addToAnnotationStorage(),this.setInBackground()},pE=function(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",this.canvas.setAttribute("data-l10n-id","pdfjs-ink-canvas"),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")},mE=function(){$(this,wc,new ResizeObserver(n=>{const r=n[0].contentRect;r.width&&r.height&&this.setDimensions(r.width,r.height)})),C(this,wc).observe(this.div),this._uiManager._signal.addEventListener("abort",()=>{var n;(n=C(this,wc))==null||n.disconnect(),$(this,wc,null)},{once:!0})},om=function(){if(!C(this,Eh))return;const[n,r]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*n),this.canvas.height=Math.ceil(this.height*r),B(this,ze,gE).call(this)},FO=function(n,r){const s=B(this,ze,vE).call(this),i=(n-s)/C(this,_h),a=(r-s)/C(this,wh);this.scaleFactor=Math.min(i,a)},gE=function(){const n=B(this,ze,vE).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+n,this.translationY*this.scaleFactor+n)},Wc=new WeakSet,cee=function(n){const r=new Path2D;for(let s=0,i=n.length;s`image/${r}`))}static get supportedTypesStr(){return Gt(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(n){return this.supportedTypes.includes(n)}static paste(n,r){r.pasteEditor(Vt.STAMP,{bitmapFile:n.getAsFile()})}remove(){var n,r;C(this,as)&&($(this,os,null),this._uiManager.imageManager.deleteId(C(this,as)),(n=C(this,sl))==null||n.remove(),$(this,sl,null),(r=C(this,xc))==null||r.disconnect(),$(this,xc,null),C(this,il)&&(clearTimeout(C(this,il)),$(this,il,null))),super.remove()}rebuild(){if(!this.parent){C(this,as)&&B(this,Jt,yE).call(this);return}super.rebuild(),this.div!==null&&(C(this,as)&&C(this,sl)===null&&B(this,Jt,yE).call(this),this.isAttachedToDOM||this.parent.add(this))}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(C(this,rd)||C(this,os)||C(this,_c)||C(this,sd)||C(this,as))}get isResizable(){return!0}render(){if(this.div)return this.div;let n,r;if(this.width&&(n=this.x,r=this.y),super.render(),this.div.hidden=!0,this.addAltTextButton(),C(this,os)?B(this,Jt,UO).call(this):B(this,Jt,yE).call(this),this.width){const[s,i]=this.parentDimensions;this.setAt(n*s,r*i,this.width*s,this.height*i)}return this.div}getImageForAltText(){return C(this,sl)}static deserialize(n,r,s){if(n instanceof DJ)return null;const i=super.deserialize(n,r,s),{rect:a,bitmapUrl:o,bitmapId:c,isSvg:u,accessibilityData:f}=n;c&&s.imageManager.isValidId(c)?$(i,as,c):$(i,_c,o),$(i,fa,u);const[l,d]=i.pageDimensions;return i.width=(a[2]-a[0])/l,i.height=(a[3]-a[1])/d,f&&(i.altTextData=f),i}serialize(n=!1,r=null){if(this.isEmpty())return null;const s={annotationType:Vt.STAMP,bitmapId:C(this,as),pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:C(this,fa),structTreeParentId:this._structTreeParentId};if(n)return s.bitmapUrl=B(this,Jt,bE).call(this,!0),s.accessibilityData=this.altTextData,s;const{decorative:i,altText:a}=this.altTextData;if(!i&&a&&(s.accessibilityData={type:"Figure",alt:a}),r===null)return s;r.stamps||(r.stamps=new Map);const o=C(this,fa)?(s.rect[2]-s.rect[0])*(s.rect[3]-s.rect[1]):null;if(!r.stamps.has(C(this,as)))r.stamps.set(C(this,as),{area:o,serialized:s}),s.bitmap=B(this,Jt,bE).call(this,!1);else if(C(this,fa)){const c=r.stamps.get(C(this,as));o>c.area&&(c.area=o,c.serialized.bitmap.close(),c.serialized.bitmap=B(this,Jt,bE).call(this,!1))}return s}};os=new WeakMap,as=new WeakMap,rd=new WeakMap,_c=new WeakMap,sd=new WeakMap,Kg=new WeakMap,sl=new WeakMap,xc=new WeakMap,il=new WeakMap,fa=new WeakMap,Vw=new WeakMap,Jt=new WeakSet,nb=function(n,r=!1){if(!n){this.remove();return}$(this,os,n.bitmap),r||($(this,as,n.id),$(this,fa,n.isSvg)),n.file&&$(this,Kg,n.file.name),B(this,Jt,UO).call(this)},rb=function(){$(this,rd,null),this._uiManager.enableWaiting(!1),C(this,sl)&&this.div.focus()},yE=function(){if(C(this,as)){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(C(this,as)).then(s=>B(this,Jt,nb).call(this,s,!0)).finally(()=>B(this,Jt,rb).call(this));return}if(C(this,_c)){const s=C(this,_c);$(this,_c,null),this._uiManager.enableWaiting(!0),$(this,rd,this._uiManager.imageManager.getFromUrl(s).then(i=>B(this,Jt,nb).call(this,i)).finally(()=>B(this,Jt,rb).call(this)));return}if(C(this,sd)){const s=C(this,sd);$(this,sd,null),this._uiManager.enableWaiting(!0),$(this,rd,this._uiManager.imageManager.getFromFile(s).then(i=>B(this,Jt,nb).call(this,i)).finally(()=>B(this,Jt,rb).call(this)));return}const n=document.createElement("input");n.type="file",n.accept=Eb.supportedTypesStr;const r=this._uiManager._signal;$(this,rd,new Promise(s=>{n.addEventListener("change",async()=>{if(!n.files||n.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);const i=await this._uiManager.imageManager.getFromFile(n.files[0]);B(this,Jt,nb).call(this,i)}s()},{signal:r}),n.addEventListener("cancel",()=>{this.remove(),s()},{signal:r})}).finally(()=>B(this,Jt,rb).call(this))),n.click()},UO=function(){const{div:n}=this;let{width:r,height:s}=C(this,os);const[i,a]=this.pageDimensions,o=.75;if(this.width)r=this.width*i,s=this.height*a;else if(r>o*i||s>o*a){const l=Math.min(o*i/r,o*a/s);r*=l,s*=l}const[c,u]=this.parentDimensions;this.setDims(r*c/i,s*u/a),this._uiManager.enableWaiting(!1);const f=$(this,sl,document.createElement("canvas"));n.append(f),n.hidden=!1,B(this,Jt,HO).call(this,r,s),B(this,Jt,pee).call(this),C(this,Vw)||(this.parent.addUndoableEditor(this),$(this,Vw,!0)),this._reportTelemetry({action:"inserted_image"}),C(this,Kg)&&f.setAttribute("aria-label",C(this,Kg))},fee=function(n,r){var o;const[s,i]=this.parentDimensions;this.width=n/s,this.height=r/i,this.setDims(n,r),(o=this._initialOptions)!=null&&o.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,C(this,il)!==null&&clearTimeout(C(this,il)),$(this,il,setTimeout(()=>{$(this,il,null),B(this,Jt,HO).call(this,n,r)},200))},hee=function(n,r){const{width:s,height:i}=C(this,os);let a=s,o=i,c=C(this,os);for(;a>2*n||o>2*r;){const u=a,f=o;a>2*n&&(a=a>=16384?Math.floor(a/2)-1:Math.ceil(a/2)),o>2*r&&(o=o>=16384?Math.floor(o/2)-1:Math.ceil(o/2));const l=new OffscreenCanvas(a,o);l.getContext("2d").drawImage(c,0,0,u,f,0,0,a,o),c=l.transferToImageBitmap()}return c},HO=function(n,r){n=Math.ceil(n),r=Math.ceil(r);const s=C(this,sl);if(!s||s.width===n&&s.height===r)return;s.width=n,s.height=r;const i=C(this,fa)?C(this,os):B(this,Jt,hee).call(this,n,r);if(this._uiManager.hasMLManager&&!this.hasAltText()){const c=new OffscreenCanvas(n,r).getContext("2d");c.drawImage(i,0,0,i.width,i.height,0,0,n,r),this._uiManager.mlGuess({service:"image-to-text",request:{data:c.getImageData(0,0,n,r).data,width:n,height:r,channels:4}}).then(u=>{const f=(u==null?void 0:u.output)||"";this.parent&&f&&!this.hasAltText()&&(this.altTextData={altText:f,decorative:!1})})}const a=s.getContext("2d");a.filter=this._uiManager.hcmFilter,a.drawImage(i,0,0,i.width,i.height,0,0,n,r)},bE=function(n){if(n){if(C(this,fa)){const i=this._uiManager.imageManager.getSvgUrl(C(this,as));if(i)return i}const r=document.createElement("canvas");return{width:r.width,height:r.height}=C(this,os),r.getContext("2d").drawImage(C(this,os),0,0),r.toDataURL()}if(C(this,fa)){const[r,s]=this.pageDimensions,i=Math.round(this.width*r*Pd.PDF_TO_CSS_UNITS),a=Math.round(this.height*s*Pd.PDF_TO_CSS_UNITS),o=new OffscreenCanvas(i,a);return o.getContext("2d").drawImage(C(this,os),0,0,C(this,os).width,C(this,os).height,0,0,i,a),o.transferToImageBitmap()}return structuredClone(C(this,os))},pee=function(){this._uiManager._signal&&($(this,xc,new ResizeObserver(n=>{const r=n[0].contentRect;r.width&&r.height&&B(this,Jt,fee).call(this,r.width,r.height)})),C(this,xc).observe(this.div),this._uiManager._signal.addEventListener("abort",()=>{var n;(n=C(this,xc))==null||n.disconnect(),$(this,xc,null)},{once:!0}))},He(Eb,"_type","stamp"),He(Eb,"_editorType",Vt.STAMP);let BO=Eb;var Rh,Yg,ol,Ph,Sc,Ec,Cc,qi,id,Xg,Qg,Us,rt,od,us,mee,WO,GO,qO,wE;const Yo=class Yo{constructor({uiManager:e,pageIndex:n,div:r,accessibilityManager:s,annotationLayer:i,drawLayer:a,textLayer:o,viewport:c,l10n:u}){z(this,us);z(this,Rh);z(this,Yg,!1);z(this,ol,null);z(this,Ph,null);z(this,Sc,null);z(this,Ec,null);z(this,Cc,null);z(this,qi,new Map);z(this,id,!1);z(this,Xg,!1);z(this,Qg,!1);z(this,Us,null);z(this,rt);const f=[...C(Yo,od).values()];if(!Yo._initialized){Yo._initialized=!0;for(const l of f)l.initialize(u,e)}e.registerEditorTypes(f),$(this,rt,e),this.pageIndex=n,this.div=r,$(this,Rh,s),$(this,ol,i),this.viewport=c,$(this,Us,o),this.drawLayer=a,C(this,rt).addLayer(this)}get isEmpty(){return C(this,qi).size===0}get isInvisible(){return this.isEmpty&&C(this,rt).getMode()===Vt.NONE}updateToolbar(e){C(this,rt).updateToolbar(e)}updateMode(e=C(this,rt).getMode()){switch(B(this,us,wE).call(this),e){case Vt.NONE:this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),this.disableClick();return;case Vt.INK:this.addInkEditorIfNeeded(!1),this.disableTextSelection(),this.togglePointerEvents(!0),this.disableClick();break;case Vt.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:n}=this.div;for(const r of C(Yo,od).values())n.toggle(`${r._type}Editing`,e===r._editorType);this.div.hidden=!1}hasTextLayer(e){var n;return e===((n=C(this,Us))==null?void 0:n.div)}addInkEditorIfNeeded(e){if(C(this,rt).getMode()!==Vt.INK)return;if(!e){for(const r of C(this,qi).values())if(r.isEmpty()){r.setInBackground();return}}this.createAndAddNewEditor({offsetX:0,offsetY:0},!1).setInBackground()}setEditingState(e){C(this,rt).setEditingState(e)}addCommands(e){C(this,rt).addCommands(e)}togglePointerEvents(e=!1){this.div.classList.toggle("disabled",!e)}toggleAnnotationLayerPointerEvents(e=!1){var n;(n=C(this,ol))==null||n.div.classList.toggle("disabled",!e)}enable(){this.div.tabIndex=0,this.togglePointerEvents(!0);const e=new Set;for(const r of C(this,qi).values())r.enableEditing(),r.show(!0),r.annotationElementId&&(C(this,rt).removeChangedExistingAnnotation(r),e.add(r.annotationElementId));if(!C(this,ol))return;const n=C(this,ol).getEditableAnnotations();for(const r of n){if(r.hide(),C(this,rt).isDeletedAnnotationElement(r.data.id)||e.has(r.data.id))continue;const s=this.deserialize(r);s&&(this.addOrRebuild(s),s.enableEditing())}}disable(){var s;$(this,Qg,!0),this.div.tabIndex=-1,this.togglePointerEvents(!1);const e=new Map,n=new Map;for(const i of C(this,qi).values())if(i.disableEditing(),!!i.annotationElementId){if(i.serialize()!==null){e.set(i.annotationElementId,i);continue}else n.set(i.annotationElementId,i);(s=this.getEditableAnnotation(i.annotationElementId))==null||s.show(),i.remove()}if(C(this,ol)){const i=C(this,ol).getEditableAnnotations();for(const a of i){const{id:o}=a.data;if(C(this,rt).isDeletedAnnotationElement(o))continue;let c=n.get(o);if(c){c.resetAnnotationElement(a),c.show(!1),a.show();continue}c=e.get(o),c&&(C(this,rt).addChangedExistingAnnotation(c),c.renderAnnotationElement(a),c.show(!1)),a.show()}}B(this,us,wE).call(this),this.isEmpty&&(this.div.hidden=!0);const{classList:r}=this.div;for(const i of C(Yo,od).values())r.remove(`${i._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),$(this,Qg,!1)}getEditableAnnotation(e){var n;return((n=C(this,ol))==null?void 0:n.getEditableAnnotation(e))||null}setActiveEditor(e){C(this,rt).getActive()!==e&&C(this,rt).setActiveEditor(e)}enableTextSelection(){var e;this.div.tabIndex=-1,(e=C(this,Us))!=null&&e.div&&!C(this,Ec)&&($(this,Ec,B(this,us,mee).bind(this)),C(this,Us).div.addEventListener("pointerdown",C(this,Ec),{signal:C(this,rt)._signal}),C(this,Us).div.classList.add("highlighting"))}disableTextSelection(){var e;this.div.tabIndex=0,(e=C(this,Us))!=null&&e.div&&C(this,Ec)&&(C(this,Us).div.removeEventListener("pointerdown",C(this,Ec)),$(this,Ec,null),C(this,Us).div.classList.remove("highlighting"))}enableClick(){if(C(this,Sc))return;const e=C(this,rt)._signal;$(this,Sc,this.pointerdown.bind(this)),$(this,Ph,this.pointerup.bind(this)),this.div.addEventListener("pointerdown",C(this,Sc),{signal:e}),this.div.addEventListener("pointerup",C(this,Ph),{signal:e})}disableClick(){C(this,Sc)&&(this.div.removeEventListener("pointerdown",C(this,Sc)),this.div.removeEventListener("pointerup",C(this,Ph)),$(this,Sc,null),$(this,Ph,null))}attach(e){C(this,qi).set(e.id,e);const{annotationElementId:n}=e;n&&C(this,rt).isDeletedAnnotationElement(n)&&C(this,rt).removeDeletedAnnotationElement(e)}detach(e){var n;C(this,qi).delete(e.id),(n=C(this,Rh))==null||n.removePointerInTextLayer(e.contentDiv),!C(this,Qg)&&e.annotationElementId&&C(this,rt).addDeletedAnnotationElement(e)}remove(e){this.detach(e),C(this,rt).removeEditor(e),e.div.remove(),e.isAttachedToDOM=!1,C(this,Xg)||this.addInkEditorIfNeeded(!1)}changeParent(e){var n;e.parent!==this&&(e.parent&&e.annotationElementId&&(C(this,rt).addDeletedAnnotationElement(e.annotationElementId),hn.deleteAnnotationElement(e),e.annotationElementId=null),this.attach(e),(n=e.parent)==null||n.detach(e),e.setParent(this),e.div&&e.isAttachedToDOM&&(e.div.remove(),this.div.append(e.div)))}add(e){if(!(e.parent===this&&e.isAttachedToDOM)){if(this.changeParent(e),C(this,rt).addEditor(e),this.attach(e),!e.isAttachedToDOM){const n=e.render();this.div.append(n),e.isAttachedToDOM=!0}e.fixAndSetPosition(),e.onceAdded(),C(this,rt).addToAnnotationStorage(e),e._reportTelemetry(e.telemetryInitialData)}}moveEditorInDOM(e){var r;if(!e.isAttachedToDOM)return;const{activeElement:n}=document;e.div.contains(n)&&!C(this,Cc)&&(e._focusEventsAllowed=!1,$(this,Cc,setTimeout(()=>{$(this,Cc,null),e.div.contains(document.activeElement)?e._focusEventsAllowed=!0:(e.div.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:C(this,rt)._signal}),n.focus())},0))),e._structTreeParentId=(r=C(this,Rh))==null?void 0:r.moveElementInDOM(this.div,e.div,e.contentDiv,!0)}addOrRebuild(e){e.needsToBeRebuilt()?(e.parent||(e.parent=this),e.rebuild(),e.show()):this.add(e)}addUndoableEditor(e){const n=()=>e._uiManager.rebuild(e),r=()=>{e.remove()};this.addCommands({cmd:n,undo:r,mustExec:!1})}getNextId(){return C(this,rt).getId()}get _signal(){return C(this,rt)._signal}canCreateNewEmptyEditor(){var e;return(e=C(this,us,WO))==null?void 0:e.canCreateNewEmptyEditor()}pasteEditor(e,n){C(this,rt).updateToolbar(e),C(this,rt).updateMode(e);const{offsetX:r,offsetY:s}=B(this,us,qO).call(this),i=this.getNextId(),a=B(this,us,GO).call(this,{parent:this,id:i,x:r,y:s,uiManager:C(this,rt),isCentered:!0,...n});a&&this.add(a)}deserialize(e){var n;return((n=C(Yo,od).get(e.annotationType??e.annotationEditorType))==null?void 0:n.deserialize(e,this,C(this,rt)))||null}createAndAddNewEditor(e,n,r={}){const s=this.getNextId(),i=B(this,us,GO).call(this,{parent:this,id:s,x:e.offsetX,y:e.offsetY,uiManager:C(this,rt),isCentered:n,...r});return i&&this.add(i),i}addNewEditor(){this.createAndAddNewEditor(B(this,us,qO).call(this),!0)}setSelected(e){C(this,rt).setSelected(e)}toggleSelected(e){C(this,rt).toggleSelected(e)}isSelected(e){return C(this,rt).isSelected(e)}unselect(e){C(this,rt).unselect(e)}pointerup(e){const{isMac:n}=yi.platform;if(!(e.button!==0||e.ctrlKey&&n)&&e.target===this.div&&C(this,id)){if($(this,id,!1),!C(this,Yg)){$(this,Yg,!0);return}if(C(this,rt).getMode()===Vt.STAMP){C(this,rt).unselectAll();return}this.createAndAddNewEditor(e,!1)}}pointerdown(e){if(C(this,rt).getMode()===Vt.HIGHLIGHT&&this.enableTextSelection(),C(this,id)){$(this,id,!1);return}const{isMac:n}=yi.platform;if(e.button!==0||e.ctrlKey&&n||e.target!==this.div)return;$(this,id,!0);const r=C(this,rt).getActive();$(this,Yg,!r||r.isEmpty())}findNewParent(e,n,r){const s=C(this,rt).findParent(n,r);return s===null||s===this?!1:(s.changeParent(e),!0)}destroy(){var e,n;((e=C(this,rt).getActive())==null?void 0:e.parent)===this&&(C(this,rt).commitOrRemove(),C(this,rt).setActiveEditor(null)),C(this,Cc)&&(clearTimeout(C(this,Cc)),$(this,Cc,null));for(const r of C(this,qi).values())(n=C(this,Rh))==null||n.removePointerInTextLayer(r.contentDiv),r.setParent(null),r.isAttachedToDOM=!1,r.div.remove();this.div=null,C(this,qi).clear(),C(this,rt).removeLayer(this)}render({viewport:e}){this.viewport=e,ep(this.div,e);for(const n of C(this,rt).getEditors(this.pageIndex))this.add(n),n.rebuild();this.updateMode()}update({viewport:e}){C(this,rt).commitOrRemove(),B(this,us,wE).call(this);const n=this.viewport.rotation,r=e.rotation;if(this.viewport=e,ep(this.div,{rotation:r}),n!==r)for(const s of C(this,qi).values())s.rotate(r);this.addInkEditorIfNeeded(!1)}get pageDimensions(){const{pageWidth:e,pageHeight:n}=this.viewport.rawDims;return[e,n]}get scale(){return C(this,rt).viewParameters.realScale}};Rh=new WeakMap,Yg=new WeakMap,ol=new WeakMap,Ph=new WeakMap,Sc=new WeakMap,Ec=new WeakMap,Cc=new WeakMap,qi=new WeakMap,id=new WeakMap,Xg=new WeakMap,Qg=new WeakMap,Us=new WeakMap,rt=new WeakMap,od=new WeakMap,us=new WeakSet,mee=function(e){if(C(this,rt).unselectAll(),e.target===C(this,Us).div){const{isMac:n}=yi.platform;if(e.button!==0||e.ctrlKey&&n)return;C(this,rt).showAllEditors("highlight",!0,!0),C(this,Us).div.classList.add("free"),GC.startHighlighting(this,C(this,rt).direction==="ltr",e),C(this,Us).div.addEventListener("pointerup",()=>{C(this,Us).div.classList.remove("free")},{once:!0,signal:C(this,rt)._signal}),e.preventDefault()}},WO=function(){return C(Yo,od).get(C(this,rt).getMode())},GO=function(e){const n=C(this,us,WO);return n?new n.prototype.constructor(e):null},qO=function(){const{x:e,y:n,width:r,height:s}=this.div.getBoundingClientRect(),i=Math.max(0,e),a=Math.max(0,n),o=Math.min(window.innerWidth,e+r),c=Math.min(window.innerHeight,n+s),u=(i+o)/2-e,f=(a+c)/2-n,[l,d]=this.viewport.rotation%180===0?[u,f]:[f,u];return{offsetX:l,offsetY:d}},wE=function(){$(this,Xg,!0);for(const e of C(this,qi).values())e.isEmpty()&&e.remove();$(this,Xg,!1)},He(Yo,"_initialized",!1),z(Yo,od,new Map([SO,MO,BO,GC].map(e=>[e._editorType,e])));let VO=Yo;var al,Ww,Mr,ad,Gw,YO,op,XO,gee;const ts=class ts{constructor({pageIndex:e}){z(this,op);z(this,al,null);z(this,Ww,0);z(this,Mr,new Map);z(this,ad,new Map);this.pageIndex=e}setParent(e){if(!C(this,al)){$(this,al,e);return}if(C(this,al)!==e){if(C(this,Mr).size>0)for(const n of C(this,Mr).values())n.remove(),e.append(n);$(this,al,e)}}static get _svgFactory(){return Gt(this,"_svgFactory",new z$)}highlight(e,n,r,s=!1){const i=vs(this,Ww)._++,a=B(this,op,XO).call(this,e.box);a.classList.add("highlight"),e.free&&a.classList.add("free");const o=ts._svgFactory.createElement("defs");a.append(o);const c=ts._svgFactory.createElement("path");o.append(c);const u=`path_p${this.pageIndex}_${i}`;c.setAttribute("id",u),c.setAttribute("d",e.toSVGPath()),s&&C(this,ad).set(i,c);const f=B(this,op,gee).call(this,o,u),l=ts._svgFactory.createElement("use");return a.append(l),a.setAttribute("fill",n),a.setAttribute("fill-opacity",r),l.setAttribute("href",`#${u}`),C(this,Mr).set(i,a),{id:i,clipPathId:`url(#${f})`}}highlightOutline(e){const n=vs(this,Ww)._++,r=B(this,op,XO).call(this,e.box);r.classList.add("highlightOutline");const s=ts._svgFactory.createElement("defs");r.append(s);const i=ts._svgFactory.createElement("path");s.append(i);const a=`path_p${this.pageIndex}_${n}`;i.setAttribute("id",a),i.setAttribute("d",e.toSVGPath()),i.setAttribute("vector-effect","non-scaling-stroke");let o;if(e.free){r.classList.add("free");const f=ts._svgFactory.createElement("mask");s.append(f),o=`mask_p${this.pageIndex}_${n}`,f.setAttribute("id",o),f.setAttribute("maskUnits","objectBoundingBox");const l=ts._svgFactory.createElement("rect");f.append(l),l.setAttribute("width","1"),l.setAttribute("height","1"),l.setAttribute("fill","white");const d=ts._svgFactory.createElement("use");f.append(d),d.setAttribute("href",`#${a}`),d.setAttribute("stroke","none"),d.setAttribute("fill","black"),d.setAttribute("fill-rule","nonzero"),d.classList.add("mask")}const c=ts._svgFactory.createElement("use");r.append(c),c.setAttribute("href",`#${a}`),o&&c.setAttribute("mask",`url(#${o})`);const u=c.cloneNode();return r.append(u),c.classList.add("mainOutline"),u.classList.add("secondaryOutline"),C(this,Mr).set(n,r),n}finalizeLine(e,n){const r=C(this,ad).get(e);C(this,ad).delete(e),this.updateBox(e,n.box),r.setAttribute("d",n.toSVGPath())}updateLine(e,n){C(this,Mr).get(e).firstChild.firstChild.setAttribute("d",n.toSVGPath())}removeFreeHighlight(e){this.remove(e),C(this,ad).delete(e)}updatePath(e,n){C(this,ad).get(e).setAttribute("d",n.toSVGPath())}updateBox(e,n){var r;B(r=ts,Gw,YO).call(r,C(this,Mr).get(e),n)}show(e,n){C(this,Mr).get(e).classList.toggle("hidden",!n)}rotate(e,n){C(this,Mr).get(e).setAttribute("data-main-rotation",n)}changeColor(e,n){C(this,Mr).get(e).setAttribute("fill",n)}changeOpacity(e,n){C(this,Mr).get(e).setAttribute("fill-opacity",n)}addClass(e,n){C(this,Mr).get(e).classList.add(n)}removeClass(e,n){C(this,Mr).get(e).classList.remove(n)}remove(e){C(this,al)!==null&&(C(this,Mr).get(e).remove(),C(this,Mr).delete(e))}destroy(){$(this,al,null);for(const e of C(this,Mr).values())e.remove();C(this,Mr).clear()}};al=new WeakMap,Ww=new WeakMap,Mr=new WeakMap,ad=new WeakMap,Gw=new WeakSet,YO=function(e,{x:n=0,y:r=0,width:s=1,height:i=1}={}){const{style:a}=e;a.top=`${100*r}%`,a.left=`${100*n}%`,a.width=`${100*s}%`,a.height=`${100*i}%`},op=new WeakSet,XO=function(e){var r;const n=ts._svgFactory.create(1,1,!0);return C(this,al).append(n),n.setAttribute("aria-hidden",!0),B(r=ts,Gw,YO).call(r,n,e),n},gee=function(e,n){const r=ts._svgFactory.createElement("clipPath");e.append(r);const s=`clip_${n}`;r.setAttribute("id",s),r.setAttribute("clipPathUnits","objectBoundingBox");const i=ts._svgFactory.createElement("use");return r.append(i),i.setAttribute("href",`#${n}`),i.classList.add("clip"),s},z(ts,Gw);let KO=ts;var vFe=ft.AbortException,yFe=ft.AnnotationEditorLayer,bFe=ft.AnnotationEditorParamsType,wFe=ft.AnnotationEditorType,_Fe=ft.AnnotationEditorUIManager,vee=ft.AnnotationLayer,yee=ft.AnnotationMode,xFe=ft.CMapCompressionType,SFe=ft.ColorPicker,EFe=ft.DOMSVGFactory,CFe=ft.DrawLayer,AFe=ft.FeatureTest,K$=ft.GlobalWorkerOptions,RFe=ft.ImageKind,PFe=ft.InvalidPDFException,TFe=ft.MissingPDFException,kFe=ft.OPS,DFe=ft.Outliner,NFe=ft.PDFDataRangeTransport,OFe=ft.PDFDateString,MFe=ft.PDFWorker,LFe=ft.PasswordResponses,IFe=ft.PermissionFlag,$Fe=ft.PixelsPerInch,FFe=ft.RenderingCancelledException,bee=ft.TextLayer,jFe=ft.UnexpectedResponseException,zFe=ft.Util,BFe=ft.VerbosityLevel,UFe=ft.XfaLayer,HFe=ft.build,VFe=ft.createValidAbsoluteUrl,WFe=ft.fetchData,wee=ft.getDocument,GFe=ft.getFilenameFromUrl,qFe=ft.getPdfFilenameFromUrl,KFe=ft.getXfaPageViewport,YFe=ft.isDataScheme,XFe=ft.isPdfFile,QFe=ft.noContextMenu,ZFe=ft.normalizeUnicode,JFe=ft.renderTextLayer,eje=ft.setLayerDimensions,tje=ft.shadow,nje=ft.updateTextLayer,_ee=ft.version;const rje=Object.freeze(Object.defineProperty({__proto__:null,AbortException:vFe,AnnotationEditorLayer:yFe,AnnotationEditorParamsType:bFe,AnnotationEditorType:wFe,AnnotationEditorUIManager:_Fe,AnnotationLayer:vee,AnnotationMode:yee,CMapCompressionType:xFe,ColorPicker:SFe,DOMSVGFactory:EFe,DrawLayer:CFe,FeatureTest:AFe,GlobalWorkerOptions:K$,ImageKind:RFe,InvalidPDFException:PFe,MissingPDFException:TFe,OPS:kFe,Outliner:DFe,PDFDataRangeTransport:NFe,PDFDateString:OFe,PDFWorker:MFe,PasswordResponses:LFe,PermissionFlag:IFe,PixelsPerInch:$Fe,RenderingCancelledException:FFe,TextLayer:bee,UnexpectedResponseException:jFe,Util:zFe,VerbosityLevel:BFe,XfaLayer:UFe,build:HFe,createValidAbsoluteUrl:VFe,fetchData:WFe,getDocument:wee,getFilenameFromUrl:GFe,getPdfFilenameFromUrl:qFe,getXfaPageViewport:KFe,isDataScheme:YFe,isPdfFile:XFe,noContextMenu:QFe,normalizeUnicode:ZFe,renderTextLayer:JFe,setLayerDimensions:eje,shadow:tje,updateTextLayer:nje,version:_ee},Symbol.toStringTag,{value:"Module"}));var Wr=function(t,e,n){if(n||arguments.length===2)for(var r=0,s=e.length,i;r{An(this.pdfDocument),An(e),typeof e=="string"?this.pdfDocument.getDestination(e).then(n):Array.isArray(e)?n(e):e.then(n)}).then(n=>{An(Array.isArray(n));const r=n[0];new Promise(s=>{An(this.pdfDocument),r instanceof Object?this.pdfDocument.getPageIndex(r).then(i=>{s(i)}).catch(()=>{An(!1)}):typeof r=="number"?s(r):An(!1)}).then(s=>{const i=s+1;An(this.pdfViewer),An(i>=1&&i<=this.pagesCount),this.pdfViewer.scrollPageIntoView({dest:n,pageIndex:s,pageNumber:i})})})}navigateTo(e){this.goToDestination(e)}goToPage(e){const n=e-1;An(this.pdfViewer),An(e>=1&&e<=this.pagesCount),this.pdfViewer.scrollPageIntoView({pageIndex:n,pageNumber:e})}addLinkAttributes(e,n,r){e.href=n,e.rel=this.externalLinkRel||Cje,e.target=r?"_blank":this.externalLinkTarget||""}getDestinationHash(){return"#"}getAnchorUrl(){return"#"}setHash(){}executeNamedAction(){}cachePageRef(){}isPageVisible(){return!0}isPageCached(){return!0}executeSetOCGState(){}}const hU={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},JA=typeof document<"u",Eee=JA&&window.location.protocol==="file:";function Rje(t){return typeof t<"u"}function af(t){return Rje(t)&&t!==null}function Pje(t){return typeof t=="string"}function Tje(t){return t instanceof ArrayBuffer}function kje(t){return An(JA),t instanceof Blob}function QO(t){return Pje(t)&&/^data:/.test(t)}function pU(t){An(QO(t));const[e="",n=""]=t.split(",");return e.split(";").indexOf("base64")!==-1?atob(n):unescape(n)}function Dje(){return JA&&window.devicePixelRatio||1}const Cee="On Chromium based browsers, you can use --allow-file-access-from-files flag for debugging purposes.";function mU(){Ps(!Eee,`Loading PDF as base64 strings/URLs may not work on protocols other than HTTP/HTTPS. ${Cee}`)}function Nje(){Ps(!Eee,`Loading PDF.js worker may not work on protocols other than HTTP/HTTPS. ${Cee}`)}function rp(t){t!=null&&t.cancel&&t.cancel()}function ZO(t,e){return Object.defineProperty(t,"width",{get(){return this.view[2]*e},configurable:!0}),Object.defineProperty(t,"height",{get(){return this.view[3]*e},configurable:!0}),Object.defineProperty(t,"originalWidth",{get(){return this.view[2]},configurable:!0}),Object.defineProperty(t,"originalHeight",{get(){return this.view[3]},configurable:!0}),t}function Oje(t){return t.name==="RenderingCancelledException"}function Mje(t){return new Promise((e,n)=>{const r=new FileReader;r.onload=()=>{if(!r.result)return n(new Error("Error while reading a file."));e(r.result)},r.onerror=s=>{if(!s.target)return n(new Error("Error while reading a file."));const{error:i}=s.target;if(!i)return n(new Error("Error while reading a file."));switch(i.code){case i.NOT_FOUND_ERR:return n(new Error("Error while reading a file: File not found."));case i.SECURITY_ERR:return n(new Error("Error while reading a file: Security error."));case i.ABORT_ERR:return n(new Error("Error while reading a file: Aborted."));default:return n(new Error("Error while reading a file."))}},r.readAsArrayBuffer(t)})}function Lje(t,e){switch(e.type){case"RESOLVE":return{value:e.value,error:void 0};case"REJECT":return{value:!1,error:e.error};case"RESET":return{value:void 0,error:void 0};default:return t}}function pv(){return _.useReducer(Lje,{value:void 0,error:void 0})}var Ije=function(t,e,n,r){function s(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function o(f){try{u(r.next(f))}catch(l){a(l)}}function c(f){try{u(r.throw(f))}catch(l){a(l)}}function u(f){f.done?i(f.value):s(f.value).then(o,c)}u((r=r.apply(t,e||[])).next())})},gU=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(t);s{switch(e){case hU.NEED_PASSWORD:{const n=prompt("Enter the password to open this PDF file.");t(n);break}case hU.INCORRECT_PASSWORD:{const n=prompt("Invalid password. Please try again.");t(n);break}}};function vU(t){return typeof t=="object"&&t!==null&&("data"in t||"range"in t||"url"in t)}const jje=_.forwardRef(function(e,n){var{children:r,className:s,error:i="Failed to load PDF file.",externalLinkRel:a,externalLinkTarget:o,file:c,inputRef:u,imageResourcesPath:f,loading:l="Loading PDF…",noData:d="No PDF file specified.",onItemClick:m,onLoadError:p,onLoadProgress:h,onLoadSuccess:y,onPassword:g=Fje,onSourceError:v,onSourceSuccess:w,options:x,renderMode:A,rotate:k}=e,R=gU(e,["children","className","error","externalLinkRel","externalLinkTarget","file","inputRef","imageResourcesPath","loading","noData","onItemClick","onLoadError","onLoadProgress","onLoadSuccess","onPassword","onSourceError","onSourceSuccess","options","renderMode","rotate"]);const[E,T]=pv(),{value:D,error:O}=E,[L,I]=pv(),{value:F,error:U}=L,Y=_.useRef(new Aje),V=_.useRef([]),H=_.useRef(void 0),ee=_.useRef(void 0);c&&c!==H.current&&vU(c)&&(Ps(!Um(c,H.current),`File prop passed to changed, but it's equal to previous one. This might result in unnecessary reloads. Consider memoizing the value passed to "file" prop.`),H.current=c),x&&x!==ee.current&&(Ps(!Um(x,ee.current),`Options prop passed to changed, but it's equal to previous one. This might result in unnecessary reloads. Consider memoizing the value passed to "options" prop.`),ee.current=x);const re=_.useRef({scrollPageIntoView:ye=>{const{dest:$e,pageNumber:ut,pageIndex:Qe=ut-1}=ye;if(m){m({dest:$e,pageIndex:Qe,pageNumber:ut});return}const vt=V.current[Qe];if(vt){vt.scrollIntoView();return}Ps(!1,`An internal link leading to page ${ut} was clicked, but neither was provided with onItemClick nor it was able to find the page within itself. Either provide onItemClick to and handle navigating by yourself or ensure that all pages are rendered within .`)}});_.useImperativeHandle(n,()=>({linkService:Y,pages:V,viewer:re}),[]);function X(){w&&w()}function q(){O&&(Ps(!1,O.toString()),v&&v(O))}function K(){T({type:"RESET"})}_.useEffect(K,[c,T]);const Z=_.useCallback(()=>Ije(this,void 0,void 0,function*(){if(!c)return null;if(typeof c=="string")return QO(c)?{data:pU(c)}:(mU(),{url:c});if(c instanceof $je)return{range:c};if(Tje(c))return{data:c};if(JA&&kje(c))return{data:yield Mje(c)};if(An(typeof c=="object"),An(vU(c)),"url"in c&&typeof c.url=="string"){if(QO(c.url)){const{url:ye}=c,$e=gU(c,["url"]),ut=pU(ye);return Object.assign({data:ut},$e)}mU()}return c}),[c]);_.useEffect(()=>{const ye=j_(Z());return ye.promise.then($e=>{T({type:"RESOLVE",value:$e})}).catch($e=>{T({type:"REJECT",error:$e})}),()=>{rp(ye)}},[Z,T]),_.useEffect(()=>{if(!(typeof D>"u")){if(D===!1){q();return}X()}},[D]);function ue(){F&&(y&&y(F),V.current=new Array(F.numPages),Y.current.setDocument(F))}function de(){U&&(Ps(!1,U.toString()),p&&p(U))}_.useEffect(function(){I({type:"RESET"})},[I,D]),_.useEffect(function(){if(!D)return;const $e=Object.assign(Object.assign({},D),x),ut=wee($e);h&&(ut.onProgress=h),g&&(ut.onPassword=g);const Qe=ut;return Qe.promise.then(vt=>{I({type:"RESOLVE",value:vt})}).catch(vt=>{Qe.destroyed||I({type:"REJECT",error:vt})}),()=>{Qe.destroy()}},[x,I,D]),_.useEffect(()=>{if(!(typeof F>"u")){if(F===!1){de();return}ue()}},[F]),_.useEffect(function(){Y.current.setViewer(re.current),Y.current.setExternalLinkRel(a),Y.current.setExternalLinkTarget(o)},[a,o]);const ie=_.useCallback((ye,$e)=>{V.current[ye]=$e},[]),be=_.useCallback(ye=>{delete V.current[ye]},[]),Ae=_.useMemo(()=>({imageResourcesPath:f,linkService:Y.current,onItemClick:m,pdf:F,registerPage:ie,renderMode:A,rotate:k,unregisterPage:be}),[f,m,F,ie,A,k,be]),_e=_.useMemo(()=>xee(R,()=>F),[R,F]);function Me(){return P.jsx(See.Provider,{value:Ae,children:r})}function Ne(){return c?F==null?P.jsx(Hm,{type:"loading",children:typeof l=="function"?l():l}):F===!1?P.jsx(Hm,{type:"error",children:typeof i=="function"?i():i}):Me():P.jsx(Hm,{type:"no-data",children:typeof d=="function"?d():d})}return P.jsx("div",Object.assign({className:cp("react-pdf__Document",s),ref:u,style:{"--scale-factor":"1"}},_e,{children:Ne()}))});function Aee(){return _.useContext(See)}function Ree(){for(var t=[],e=0;eHje(e),[e]),r=_.useMemo(()=>!eR(e)||kee(e)?null:e.children.map((s,i)=>P.jsx(Nee,{node:s},i)),[e]);return P.jsx("span",Object.assign({className:t},n,{children:r}))}function tR(){return _.useContext(Pee)}function Vje(){const t=tR();An(t);const{onGetStructTreeError:e,onGetStructTreeSuccess:n}=t,[r,s]=pv(),{value:i,error:a}=r,{customTextRenderer:o,page:c}=t;function u(){i&&n&&n(i)}function f(){a&&(Ps(!1,a.toString()),e&&e(a))}return _.useEffect(function(){s({type:"RESET"})},[s,c]),_.useEffect(function(){if(o||!c)return;const d=j_(c.getStructTree()),m=d;return d.promise.then(p=>{s({type:"RESOLVE",value:p})}).catch(p=>{s({type:"REJECT",error:p})}),()=>rp(m)},[o,c,s]),_.useEffect(()=>{if(i!==void 0){if(i===!1){f();return}u()}},[i]),i?P.jsx(Nee,{className:"react-pdf__Page__structTree structTree",node:i}):null}const yU=yee;function Wje(t){const e=tR();An(e);const n=Object.assign(Object.assign({},e),t),{_className:r,canvasBackground:s,devicePixelRatio:i=Dje(),onRenderError:a,onRenderSuccess:o,page:c,renderForms:u,renderTextLayer:f,rotate:l,scale:d}=n,{canvasRef:m}=t;An(c);const p=_.useRef(null);function h(){c&&o&&o(ZO(c,d))}function y(x){Oje(x)||(Ps(!1,x.toString()),a&&a(x))}const g=_.useMemo(()=>c.getViewport({scale:d*i,rotation:l}),[i,c,l,d]),v=_.useMemo(()=>c.getViewport({scale:d,rotation:l}),[c,l,d]);_.useEffect(function(){if(!c)return;c.cleanup();const{current:A}=p;if(!A)return;A.width=g.width,A.height=g.height,A.style.width=`${Math.floor(v.width)}px`,A.style.height=`${Math.floor(v.height)}px`,A.style.visibility="hidden";const k={annotationMode:u?yU.ENABLE_FORMS:yU.ENABLE,canvasContext:A.getContext("2d",{alpha:!1}),viewport:g};s&&(k.background=s);const R=c.render(k),E=R;return R.promise.then(()=>{A.style.visibility="",h()}).catch(y),()=>rp(E)},[s,c,u,g,v]);const w=_.useCallback(()=>{const{current:x}=p;x&&(x.width=0,x.height=0)},[]);return _.useEffect(()=>w,[w]),P.jsx("canvas",{className:`${r}__canvas`,dir:"ltr",ref:Ree(m,p),style:{display:"block",userSelect:"none"},children:f?P.jsx(Vje,{}):null})}function Gje(t){return"str"in t}function qje(){const t=tR();An(t);const{customTextRenderer:e,onGetTextError:n,onGetTextSuccess:r,onRenderTextLayerError:s,onRenderTextLayerSuccess:i,page:a,pageIndex:o,pageNumber:c,rotate:u,scale:f}=t;An(a);const[l,d]=pv(),{value:m,error:p}=l,h=_.useRef(null),y=_.useRef(void 0);Ps(Number.parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-text-layer"),10)===1,"TextLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-text-layer");function g(){m&&r&&r(m)}function v(){p&&(Ps(!1,p.toString()),n&&n(p))}_.useEffect(function(){d({type:"RESET"})},[a,d]),_.useEffect(function(){if(!a)return;const T=j_(a.getTextContent()),D=T;return T.promise.then(O=>{d({type:"RESOLVE",value:O})}).catch(O=>{d({type:"REJECT",error:O})}),()=>rp(D)},[a,d]),_.useEffect(()=>{if(m!==void 0){if(m===!1){v();return}g()}},[m]);const w=_.useCallback(()=>{i&&i()},[i]),x=_.useCallback(E=>{Ps(!1,E.toString()),s&&s(E)},[s]);function A(){const E=y.current;E&&E.classList.add("active")}function k(){const E=y.current;E&&E.classList.remove("active")}const R=_.useMemo(()=>a.getViewport({scale:f,rotation:u}),[a,u,f]);return _.useLayoutEffect(function(){if(!a||!m)return;const{current:T}=h;if(!T)return;T.innerHTML="";const D=a.streamTextContent({includeMarkedContent:!0}),O={container:T,textContentSource:D,viewport:R},L=new bee(O),I=L;return L.render().then(()=>{const F=document.createElement("div");F.className="endOfContent",T.append(F),y.current=F;const U=T.querySelectorAll('[role="presentation"]');if(e){let Y=0;m.items.forEach((V,H)=>{if(!Gje(V))return;const ee=U[Y];if(!ee)return;const re=e(Object.assign({pageIndex:o,pageNumber:c,itemIndex:H},V));ee.innerHTML=re,Y+=V.str&&V.hasEOL?2:1})}w()}).catch(x),()=>rp(I)},[e,x,w,a,o,c,m,R]),P.jsx("div",{className:cp("react-pdf__Page__textContent","textLayer"),onMouseUp:k,onMouseDown:A,ref:h})}function Kje(){const t=Aee(),e=tR();An(e);const n=Object.assign(Object.assign({},t),e),{imageResourcesPath:r,linkService:s,onGetAnnotationsError:i,onGetAnnotationsSuccess:a,onRenderAnnotationLayerError:o,onRenderAnnotationLayerSuccess:c,page:u,pdf:f,renderForms:l,rotate:d,scale:m=1}=n;An(f),An(u),An(s);const[p,h]=pv(),{value:y,error:g}=p,v=_.useRef(null);Ps(Number.parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-annotation-layer"),10)===1,"AnnotationLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-annotations");function w(){y&&a&&a(y)}function x(){g&&(Ps(!1,g.toString()),i&&i(g))}_.useEffect(function(){h({type:"RESET"})},[h,u]),_.useEffect(function(){if(!u)return;const T=j_(u.getAnnotations()),D=T;return T.promise.then(O=>{h({type:"RESOLVE",value:O})}).catch(O=>{h({type:"REJECT",error:O})}),()=>{rp(D)}},[h,u]),_.useEffect(()=>{if(y!==void 0){if(y===!1){x();return}w()}},[y]);function A(){c&&c()}function k(E){Ps(!1,`${E}`),o&&o(E)}const R=_.useMemo(()=>u.getViewport({scale:m,rotation:d}),[u,d,m]);return _.useEffect(function(){if(!f||!u||!s||!y)return;const{current:T}=v;if(!T)return;const D=R.clone({dontFlip:!0}),O={accessibilityManager:null,annotationCanvasMap:null,annotationEditorUIManager:null,div:T,l10n:null,page:u,viewport:D},L={annotations:y,annotationStorage:f.annotationStorage,div:T,imageResourcesPath:r,linkService:s,page:u,renderForms:l,viewport:D};T.innerHTML="";try{new vee(O).render(L),A()}catch(I){k(I)}return()=>{}},[y,r,s,u,f,l,R]),P.jsx("div",{className:cp("react-pdf__Page__annotations","annotationLayer"),ref:v})}var Yje=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(t);s{if(!_e)return null;let xe=1;const Te=Z??bU;if(de||m){const Ye=_e.getViewport({scale:1,rotation:ut});de?xe=de/Ye.width:m&&(xe=m/Ye.height)}return Te*xe},[m,_e,ut,Z,de]);_.useEffect(function(){return()=>{af(ye)&&s&&ue&&ue(ye)}},[s,V,ye,ue]);function vt(){if(E){if(!_e||!Qe)return;E(ZO(_e,Qe))}if(s&&H){if(!af(ye)||!Ne.current)return;H(ye,Ne.current)}}function Sn(){Me&&(Ps(!1,Me.toString()),R&&R(Me))}_.useEffect(function(){Ae({type:"RESET"})},[Ae,V,ye]),_.useEffect(function(){if(!V||!$e)return;const Te=j_(V.getPage($e)),Ye=Te;return Te.promise.then(Rt=>{Ae({type:"RESOLVE",value:Rt})}).catch(Rt=>{Ae({type:"REJECT",error:Rt})}),()=>rp(Ye)},[Ae,V,$e]),_.useEffect(()=>{if(_e!==void 0){if(_e===!1){Sn();return}vt()}},[_e,Qe]);const Yt=_.useMemo(()=>_e&&af(ye)&&$e&&af(ut)&&af(Qe)?{_className:r,canvasBackground:i,customTextRenderer:f,devicePixelRatio:l,onGetAnnotationsError:g,onGetAnnotationsSuccess:v,onGetStructTreeError:w,onGetStructTreeSuccess:x,onGetTextError:A,onGetTextSuccess:k,onRenderAnnotationLayerError:T,onRenderAnnotationLayerSuccess:D,onRenderError:O,onRenderSuccess:L,onRenderTextLayerError:I,onRenderTextLayerSuccess:F,page:_e,pageIndex:ye,pageNumber:$e,renderForms:re,renderTextLayer:q,rotate:ut,scale:Qe}:null,[r,i,f,l,g,v,w,x,A,k,T,D,O,L,I,F,_e,ye,$e,re,q,ut,Qe]),mn=_.useMemo(()=>xee(ie,()=>_e&&(Qe?ZO(_e,Qe):void 0)),[ie,_e,Qe]),Xt=`${ye}@${Qe}/${ut}`;function J(){switch(X){case"custom":return An(u),P.jsx(u,{},`${Xt}_custom`);case"none":return null;case"canvas":default:return P.jsx(Wje,{canvasRef:a},`${Xt}_canvas`)}}function fe(){return q?P.jsx(qje,{},`${Xt}_text`):null}function ge(){return ee?P.jsx(Kje,{},`${Xt}_annotations`):null}function Pe(){return P.jsxs(Pee.Provider,{value:Yt,children:[J(),fe(),ge(),o]})}function Oe(){return $e?V===null||_e===void 0||_e===null?P.jsx(Hm,{type:"loading",children:typeof h=="function"?h():h}):V===!1||_e===!1?P.jsx(Hm,{type:"error",children:typeof d=="function"?d():d}):Pe():P.jsx(Hm,{type:"no-data",children:typeof y=="function"?y():y})}return P.jsx("div",Object.assign({className:cp(r,c),"data-page-number":$e,ref:Ree(p,Ne),style:{"--scale-factor":`${Qe}`,backgroundColor:i||"white",position:"relative",minWidth:"min-content",minHeight:"min-content"}},mn,{children:Oe()}))}Nje();K$.workerSrc="pdf.worker.mjs";K$.workerSrc=`//unpkg.com/pdfjs-dist@${_ee}/build/pdf.worker.min.mjs`;const Kp=800,Xje={},qUe=({file:t,onThumbnailClick:e,className:n})=>{const[r,s]=_.useState(0),[i,a]=_.useState(1),[o,c]=_.useState(void 0),[u,f]=_.useState(null),[l,d]=_.useState(),m=_.useCallback(A=>{const[k]=A;k&&d(k.contentRect.width)},[]);m$e(u,Xje,m);const p=_.useCallback(()=>{c(i)},[c,i]);function h({numPages:A}){a(1),s(A)}const y=_.useCallback(A=>a(k=>A>0?Math.min(k+A,r):Math.max(k+A,1)),[r]),g=_.useCallback(()=>y(1),[y]),v=_.useCallback(()=>y(-1),[y]),w=_.useMemo(()=>o!==i,[o,i]),x=_.useMemo(()=>({cMapUrl:"/cmaps/",standardFontDataUrl:"/standard_fonts/"}),[]);return P.jsxs("div",{className:ce("flex flex-col cursor-default text-center",n),ref:f,children:[P.jsxs(jje,{file:t,onLoadSuccess:h,loading:P.jsx(wZ,{className:"w-full mx-auto mt-32"}),options:x,className:ce(`w-full aspect-[3/4] relative bg-white shadow w-[${l?Math.min(l,Kp):Kp}]`,e?"cursor-pointer":""),children:[P.jsx(wU,{className:w&&o?"visible":"hidden",pageNumber:o,canvasBackground:"white",width:l?Math.min(l,Kp):Kp,onClick:()=>e?e():null},`page_${o}`),P.jsx(wU,{className:ce(w&&o?"hidden":"visible","text-center"),pageNumber:i,canvasBackground:"white",onRenderSuccess:p,width:l?Math.min(l,Kp):Kp,onClick:()=>e?e():null},i)]}),P.jsxs("div",{className:"flex flex-row justify-center w-full mt-4 space-x-4",children:[P.jsxs(no,{type:"button",variant:"outline",className:"w-8 h-8 p-0",onClick:v,disabled:w,children:[P.jsx("span",{className:"sr-only",children:tr("common.go_to_prev_page")}),P.jsx(dL,{className:"w-4 h-4"})]}),P.jsxs(no,{type:"button",variant:"outline",className:"w-8 h-8 p-0",onClick:g,disabled:w,children:[P.jsx("span",{className:"sr-only",children:tr("common.go_to_next_page")}),P.jsx(n_,{className:"w-4 h-4"})]})]}),P.jsx("p",{className:"mt-4 text-sm font-medium text-center",children:tr("common.num_page_of_total",{count:i,total:r})})]})},_U=({children:t})=>{const e=Ud(),n=_.useId(),{isSuccess:r,isLoading:s,data:{authenticated:i=!1,redirectTo:a="/login"}={}}=$de(),{isSuccess:o,isLoading:c,isFetching:u,error:f,data:l}=jV({enabled:r&&i});return s||c||o&&l===null&&u?P.jsx(xs,{}):f?(console.error("Error loading profile:",f),P.jsx(aZ,{subtitle:f.message})):r&&!i||o&&!(l!=null&&l.id)?(console.debug("Not authenticated, redirecting to:",a),P.jsx(wQ,{to:a,state:{from:e},replace:!0})):P.jsx("div",{id:`${n}-${l==null?void 0:l.lang_code}`,children:t??null})},AS={draft:{color:"text-gray-700",bgColor:"bg-gray-200",hoverColor:"hover:text-gray-900",hoverBgColor:"hover:bg-gray-300"},ready:{color:"text-blue-700",bgColor:"bg-blue-200",hoverColor:"hover:text-blue-900",hoverBgColor:"hover:bg-blue-300"},delivered:{color:"text-yellow-700",bgColor:"bg-yellow-200",hoverColor:"hover:text-yellow-900",hoverBgColor:"hover:bg-yellow-300"},accepted:{color:"text-green-700",bgColor:"bg-green-200",hoverColor:"hover:text-green-900",hoverBgColor:"hover:bg-green-300"},rejected:{color:"text-red-700",bgColor:"bg-red-200",hoverColor:"hover:text-red-900",hoverBgColor:"hover:bg-red-300"},archived:{color:"text-purple-700",bgColor:"bg-purple-200",hoverColor:"hover:text-purple-900",hoverBgColor:"hover:bg-purple-300"}},KUe=_.forwardRef(({status:t,isEditable:e,className:n,...r},s)=>P.jsx("div",{ref:s,children:P.jsxs(Bpe,{className:ce(AS[t].bgColor,AS[t].color,AS[t].hoverBgColor,AS[t].hoverColor,"transition-colors duration-200 cursor-pointer flex items-center group",n),...r,children:[tr(`quotes.status.${t}`),e&&P.jsx(Pfe,{className:"w-3 h-3 ml-2 transition-opacity opacity-0 group-hover:opacity-100"})]})}));function Qje(){return null}var Y$={},z_={},Oee={exports:{}};function Zje(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var fk={exports:{}};const Jje={},sb=Object.freeze(Object.defineProperty({__proto__:null,default:Jje},Symbol.toStringTag,{value:"Module"})),e3e=ble(sb);var xU;function Vd(){return xU||(xU=1,function(t,e){(function(n,r){t.exports=r()})(yr,function(){var n=n||function(r,s){var i;if(typeof window<"u"&&window.crypto&&(i=window.crypto),typeof self<"u"&&self.crypto&&(i=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(i=globalThis.crypto),!i&&typeof window<"u"&&window.msCrypto&&(i=window.msCrypto),!i&&typeof yr<"u"&&yr.crypto&&(i=yr.crypto),!i&&typeof Zje=="function")try{i=e3e}catch{}var a=function(){if(i){if(typeof i.getRandomValues=="function")try{return i.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof i.randomBytes=="function")try{return i.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function v(){}return function(w){var x;return v.prototype=w,x=new v,v.prototype=null,x}}(),c={},u=c.lib={},f=u.Base=function(){return{extend:function(v){var w=o(this);return v&&w.mixIn(v),(!w.hasOwnProperty("init")||this.init===w.init)&&(w.init=function(){w.$super.init.apply(this,arguments)}),w.init.prototype=w,w.$super=this,w},create:function(){var v=this.extend();return v.init.apply(v,arguments),v},init:function(){},mixIn:function(v){for(var w in v)v.hasOwnProperty(w)&&(this[w]=v[w]);v.hasOwnProperty("toString")&&(this.toString=v.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),l=u.WordArray=f.extend({init:function(v,w){v=this.words=v||[],w!=s?this.sigBytes=w:this.sigBytes=v.length*4},toString:function(v){return(v||m).stringify(this)},concat:function(v){var w=this.words,x=v.words,A=this.sigBytes,k=v.sigBytes;if(this.clamp(),A%4)for(var R=0;R>>2]>>>24-R%4*8&255;w[A+R>>>2]|=E<<24-(A+R)%4*8}else for(var T=0;T>>2]=x[T>>>2];return this.sigBytes+=k,this},clamp:function(){var v=this.words,w=this.sigBytes;v[w>>>2]&=4294967295<<32-w%4*8,v.length=r.ceil(w/4)},clone:function(){var v=f.clone.call(this);return v.words=this.words.slice(0),v},random:function(v){for(var w=[],x=0;x>>2]>>>24-k%4*8&255;A.push((R>>>4).toString(16)),A.push((R&15).toString(16))}return A.join("")},parse:function(v){for(var w=v.length,x=[],A=0;A>>3]|=parseInt(v.substr(A,2),16)<<24-A%8*4;return new l.init(x,w/2)}},p=d.Latin1={stringify:function(v){for(var w=v.words,x=v.sigBytes,A=[],k=0;k>>2]>>>24-k%4*8&255;A.push(String.fromCharCode(R))}return A.join("")},parse:function(v){for(var w=v.length,x=[],A=0;A>>2]|=(v.charCodeAt(A)&255)<<24-A%4*8;return new l.init(x,w)}},h=d.Utf8={stringify:function(v){try{return decodeURIComponent(escape(p.stringify(v)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(v){return p.parse(unescape(encodeURIComponent(v)))}},y=u.BufferedBlockAlgorithm=f.extend({reset:function(){this._data=new l.init,this._nDataBytes=0},_append:function(v){typeof v=="string"&&(v=h.parse(v)),this._data.concat(v),this._nDataBytes+=v.sigBytes},_process:function(v){var w,x=this._data,A=x.words,k=x.sigBytes,R=this.blockSize,E=R*4,T=k/E;v?T=r.ceil(T):T=r.max((T|0)-this._minBufferSize,0);var D=T*R,O=r.min(D*4,k);if(D){for(var L=0;L>>2]>>>24-m%4*8&255,h=u[m+1>>>2]>>>24-(m+1)%4*8&255,y=u[m+2>>>2]>>>24-(m+2)%4*8&255,g=p<<16|h<<8|y,v=0;v<4&&m+v*.75>>6*(3-v)&63));var w=l.charAt(64);if(w)for(;d.length%4;)d.push(w);return d.join("")},parse:function(c){var u=c.length,f=this._map,l=this._reverseMap;if(!l){l=this._reverseMap=[];for(var d=0;d>>6-m%4*2,y=p|h;l[d>>>2]|=y<<24-d%4*8,d++}return i.create(l,d)}}(),n.enc.Base64})}(hk)),hk.exports}var pk={exports:{}},EU;function r3e(){return EU||(EU=1,function(t,e){(function(n,r){t.exports=r(Vd())})(yr,function(n){return function(r){var s=n,i=s.lib,a=i.WordArray,o=i.Hasher,c=s.algo,u=[];(function(){for(var h=0;h<64;h++)u[h]=r.abs(r.sin(h+1))*4294967296|0})();var f=c.MD5=o.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(h,y){for(var g=0;g<16;g++){var v=y+g,w=h[v];h[v]=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360}var x=this._hash.words,A=h[y+0],k=h[y+1],R=h[y+2],E=h[y+3],T=h[y+4],D=h[y+5],O=h[y+6],L=h[y+7],I=h[y+8],F=h[y+9],U=h[y+10],Y=h[y+11],V=h[y+12],H=h[y+13],ee=h[y+14],re=h[y+15],X=x[0],q=x[1],K=x[2],Z=x[3];X=l(X,q,K,Z,A,7,u[0]),Z=l(Z,X,q,K,k,12,u[1]),K=l(K,Z,X,q,R,17,u[2]),q=l(q,K,Z,X,E,22,u[3]),X=l(X,q,K,Z,T,7,u[4]),Z=l(Z,X,q,K,D,12,u[5]),K=l(K,Z,X,q,O,17,u[6]),q=l(q,K,Z,X,L,22,u[7]),X=l(X,q,K,Z,I,7,u[8]),Z=l(Z,X,q,K,F,12,u[9]),K=l(K,Z,X,q,U,17,u[10]),q=l(q,K,Z,X,Y,22,u[11]),X=l(X,q,K,Z,V,7,u[12]),Z=l(Z,X,q,K,H,12,u[13]),K=l(K,Z,X,q,ee,17,u[14]),q=l(q,K,Z,X,re,22,u[15]),X=d(X,q,K,Z,k,5,u[16]),Z=d(Z,X,q,K,O,9,u[17]),K=d(K,Z,X,q,Y,14,u[18]),q=d(q,K,Z,X,A,20,u[19]),X=d(X,q,K,Z,D,5,u[20]),Z=d(Z,X,q,K,U,9,u[21]),K=d(K,Z,X,q,re,14,u[22]),q=d(q,K,Z,X,T,20,u[23]),X=d(X,q,K,Z,F,5,u[24]),Z=d(Z,X,q,K,ee,9,u[25]),K=d(K,Z,X,q,E,14,u[26]),q=d(q,K,Z,X,I,20,u[27]),X=d(X,q,K,Z,H,5,u[28]),Z=d(Z,X,q,K,R,9,u[29]),K=d(K,Z,X,q,L,14,u[30]),q=d(q,K,Z,X,V,20,u[31]),X=m(X,q,K,Z,D,4,u[32]),Z=m(Z,X,q,K,I,11,u[33]),K=m(K,Z,X,q,Y,16,u[34]),q=m(q,K,Z,X,ee,23,u[35]),X=m(X,q,K,Z,k,4,u[36]),Z=m(Z,X,q,K,T,11,u[37]),K=m(K,Z,X,q,L,16,u[38]),q=m(q,K,Z,X,U,23,u[39]),X=m(X,q,K,Z,H,4,u[40]),Z=m(Z,X,q,K,A,11,u[41]),K=m(K,Z,X,q,E,16,u[42]),q=m(q,K,Z,X,O,23,u[43]),X=m(X,q,K,Z,F,4,u[44]),Z=m(Z,X,q,K,V,11,u[45]),K=m(K,Z,X,q,re,16,u[46]),q=m(q,K,Z,X,R,23,u[47]),X=p(X,q,K,Z,A,6,u[48]),Z=p(Z,X,q,K,L,10,u[49]),K=p(K,Z,X,q,ee,15,u[50]),q=p(q,K,Z,X,D,21,u[51]),X=p(X,q,K,Z,V,6,u[52]),Z=p(Z,X,q,K,E,10,u[53]),K=p(K,Z,X,q,U,15,u[54]),q=p(q,K,Z,X,k,21,u[55]),X=p(X,q,K,Z,I,6,u[56]),Z=p(Z,X,q,K,re,10,u[57]),K=p(K,Z,X,q,O,15,u[58]),q=p(q,K,Z,X,H,21,u[59]),X=p(X,q,K,Z,T,6,u[60]),Z=p(Z,X,q,K,Y,10,u[61]),K=p(K,Z,X,q,R,15,u[62]),q=p(q,K,Z,X,F,21,u[63]),x[0]=x[0]+X|0,x[1]=x[1]+q|0,x[2]=x[2]+K|0,x[3]=x[3]+Z|0},_doFinalize:function(){var h=this._data,y=h.words,g=this._nDataBytes*8,v=h.sigBytes*8;y[v>>>5]|=128<<24-v%32;var w=r.floor(g/4294967296),x=g;y[(v+64>>>9<<4)+15]=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360,y[(v+64>>>9<<4)+14]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,h.sigBytes=(y.length+1)*4,this._process();for(var A=this._hash,k=A.words,R=0;R<4;R++){var E=k[R];k[R]=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360}return A},clone:function(){var h=o.clone.call(this);return h._hash=this._hash.clone(),h}});function l(h,y,g,v,w,x,A){var k=h+(y&g|~y&v)+w+A;return(k<>>32-x)+y}function d(h,y,g,v,w,x,A){var k=h+(y&v|g&~v)+w+A;return(k<>>32-x)+y}function m(h,y,g,v,w,x,A){var k=h+(y^g^v)+w+A;return(k<>>32-x)+y}function p(h,y,g,v,w,x,A){var k=h+(g^(y|~v))+w+A;return(k<>>32-x)+y}s.MD5=o._createHelper(f),s.HmacMD5=o._createHmacHelper(f)}(Math),n.MD5})}(pk)),pk.exports}var mk={exports:{}},gk={exports:{}},CU;function s3e(){return CU||(CU=1,function(t,e){(function(n,r){t.exports=r(Vd())})(yr,function(n){return function(){var r=n,s=r.lib,i=s.WordArray,a=s.Hasher,o=r.algo,c=[],u=o.SHA1=a.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(f,l){for(var d=this._hash.words,m=d[0],p=d[1],h=d[2],y=d[3],g=d[4],v=0;v<80;v++){if(v<16)c[v]=f[l+v]|0;else{var w=c[v-3]^c[v-8]^c[v-14]^c[v-16];c[v]=w<<1|w>>>31}var x=(m<<5|m>>>27)+g+c[v];v<20?x+=(p&h|~p&y)+1518500249:v<40?x+=(p^h^y)+1859775393:v<60?x+=(p&h|p&y|h&y)-1894007588:x+=(p^h^y)-899497514,g=y,y=h,h=p<<30|p>>>2,p=m,m=x}d[0]=d[0]+m|0,d[1]=d[1]+p|0,d[2]=d[2]+h|0,d[3]=d[3]+y|0,d[4]=d[4]+g|0},_doFinalize:function(){var f=this._data,l=f.words,d=this._nDataBytes*8,m=f.sigBytes*8;return l[m>>>5]|=128<<24-m%32,l[(m+64>>>9<<4)+14]=Math.floor(d/4294967296),l[(m+64>>>9<<4)+15]=d,f.sigBytes=l.length*4,this._process(),this._hash},clone:function(){var f=a.clone.call(this);return f._hash=this._hash.clone(),f}});r.SHA1=a._createHelper(u),r.HmacSHA1=a._createHmacHelper(u)}(),n.SHA1})}(gk)),gk.exports}var vk={exports:{}},AU;function i3e(){return AU||(AU=1,function(t,e){(function(n,r){t.exports=r(Vd())})(yr,function(n){(function(){var r=n,s=r.lib,i=s.Base,a=r.enc,o=a.Utf8,c=r.algo;c.HMAC=i.extend({init:function(u,f){u=this._hasher=new u.init,typeof f=="string"&&(f=o.parse(f));var l=u.blockSize,d=l*4;f.sigBytes>d&&(f=u.finalize(f)),f.clamp();for(var m=this._oKey=f.clone(),p=this._iKey=f.clone(),h=m.words,y=p.words,g=0;g>>2]&255;D.sigBytes-=O}};i.BlockCipher=m.extend({cfg:m.cfg.extend({mode:y,padding:v}),reset:function(){var D;m.reset.call(this);var O=this.cfg,L=O.iv,I=O.mode;this._xformMode==this._ENC_XFORM_MODE?D=I.createEncryptor:(D=I.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==D?this._mode.init(this,L&&L.words):(this._mode=D.call(I,this,L&&L.words),this._mode.__creator=D)},_doProcessBlock:function(D,O){this._mode.processBlock(D,O)},_doFinalize:function(){var D,O=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(O.pad(this._data,this.blockSize),D=this._process(!0)):(D=this._process(!0),O.unpad(D)),D},blockSize:128/32});var w=i.CipherParams=a.extend({init:function(D){this.mixIn(D)},toString:function(D){return(D||this.formatter).stringify(this)}}),x=s.format={},A=x.OpenSSL={stringify:function(D){var O,L=D.ciphertext,I=D.salt;return I?O=o.create([1398893684,1701076831]).concat(I).concat(L):O=L,O.toString(f)},parse:function(D){var O,L=f.parse(D),I=L.words;return I[0]==1398893684&&I[1]==1701076831&&(O=o.create(I.slice(2,4)),I.splice(0,4),L.sigBytes-=16),w.create({ciphertext:L,salt:O})}},k=i.SerializableCipher=a.extend({cfg:a.extend({format:A}),encrypt:function(D,O,L,I){I=this.cfg.extend(I);var F=D.createEncryptor(L,I),U=F.finalize(O),Y=F.cfg;return w.create({ciphertext:U,key:L,iv:Y.iv,algorithm:D,mode:Y.mode,padding:Y.padding,blockSize:D.blockSize,formatter:I.format})},decrypt:function(D,O,L,I){I=this.cfg.extend(I),O=this._parse(O,I.format);var F=D.createDecryptor(L,I).finalize(O.ciphertext);return F},_parse:function(D,O){return typeof D=="string"?O.parse(D,this):D}}),R=s.kdf={},E=R.OpenSSL={execute:function(D,O,L,I,F){if(I||(I=o.random(64/8)),F)var U=d.create({keySize:O+L,hasher:F}).compute(D,I);else var U=d.create({keySize:O+L}).compute(D,I);var Y=o.create(U.words.slice(O),L*4);return U.sigBytes=O*4,w.create({key:U,iv:Y,salt:I})}},T=i.PasswordBasedCipher=k.extend({cfg:k.cfg.extend({kdf:E}),encrypt:function(D,O,L,I){I=this.cfg.extend(I);var F=I.kdf.execute(L,D.keySize,D.ivSize,I.salt,I.hasher);I.iv=F.iv;var U=k.encrypt.call(this,D,O,F.key,I);return U.mixIn(F),U},decrypt:function(D,O,L,I){I=this.cfg.extend(I),O=this._parse(O,I.format);var F=I.kdf.execute(L,D.keySize,D.ivSize,O.salt,I.hasher);I.iv=F.iv;var U=k.decrypt.call(this,D,O,F.key,I);return U}})}()})}(yk)),yk.exports}(function(t,e){(function(n,r,s){t.exports=r(Vd(),n3e(),r3e(),Lee(),o3e())})(yr,function(n){return function(){var r=n,s=r.lib,i=s.BlockCipher,a=r.algo,o=[],c=[],u=[],f=[],l=[],d=[],m=[],p=[],h=[],y=[];(function(){for(var w=[],x=0;x<256;x++)x<128?w[x]=x<<1:w[x]=x<<1^283;for(var A=0,k=0,x=0;x<256;x++){var R=k^k<<1^k<<2^k<<3^k<<4;R=R>>>8^R&255^99,o[A]=R,c[R]=A;var E=w[A],T=w[E],D=w[T],O=w[R]*257^R*16843008;u[A]=O<<24|O>>>8,f[A]=O<<16|O>>>16,l[A]=O<<8|O>>>24,d[A]=O;var O=D*16843009^T*65537^E*257^A*16843008;m[R]=O<<24|O>>>8,p[R]=O<<16|O>>>16,h[R]=O<<8|O>>>24,y[R]=O,A?(A=E^w[w[w[D^E]]],k^=w[w[k]]):A=k=1}})();var g=[0,1,2,4,8,16,32,64,128,27,54],v=a.AES=i.extend({_doReset:function(){var w;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var x=this._keyPriorReset=this._key,A=x.words,k=x.sigBytes/4,R=this._nRounds=k+6,E=(R+1)*4,T=this._keySchedule=[],D=0;D6&&D%k==4&&(w=o[w>>>24]<<24|o[w>>>16&255]<<16|o[w>>>8&255]<<8|o[w&255]):(w=w<<8|w>>>24,w=o[w>>>24]<<24|o[w>>>16&255]<<16|o[w>>>8&255]<<8|o[w&255],w^=g[D/k|0]<<24),T[D]=T[D-k]^w);for(var O=this._invKeySchedule=[],L=0;L>>24]]^p[o[w>>>16&255]]^h[o[w>>>8&255]]^y[o[w&255]]}}},encryptBlock:function(w,x){this._doCryptBlock(w,x,this._keySchedule,u,f,l,d,o)},decryptBlock:function(w,x){var A=w[x+1];w[x+1]=w[x+3],w[x+3]=A,this._doCryptBlock(w,x,this._invKeySchedule,m,p,h,y,c);var A=w[x+1];w[x+1]=w[x+3],w[x+3]=A},_doCryptBlock:function(w,x,A,k,R,E,T,D){for(var O=this._nRounds,L=w[x]^A[0],I=w[x+1]^A[1],F=w[x+2]^A[2],U=w[x+3]^A[3],Y=4,V=1;V>>24]^R[I>>>16&255]^E[F>>>8&255]^T[U&255]^A[Y++],ee=k[I>>>24]^R[F>>>16&255]^E[U>>>8&255]^T[L&255]^A[Y++],re=k[F>>>24]^R[U>>>16&255]^E[L>>>8&255]^T[I&255]^A[Y++],X=k[U>>>24]^R[L>>>16&255]^E[I>>>8&255]^T[F&255]^A[Y++];L=H,I=ee,F=re,U=X}var H=(D[L>>>24]<<24|D[I>>>16&255]<<16|D[F>>>8&255]<<8|D[U&255])^A[Y++],ee=(D[I>>>24]<<24|D[F>>>16&255]<<16|D[U>>>8&255]<<8|D[L&255])^A[Y++],re=(D[F>>>24]<<24|D[U>>>16&255]<<16|D[L>>>8&255]<<8|D[I&255])^A[Y++],X=(D[U>>>24]<<24|D[L>>>16&255]<<16|D[I>>>8&255]<<8|D[F&255])^A[Y++];w[x]=H,w[x+1]=ee,w[x+2]=re,w[x+3]=X},keySize:256/32});r.AES=i._createHelper(v)}(),n.AES})})(Mee);var a3e=Mee.exports,nR={},B_={},qs={};Object.defineProperty(B_,"__esModule",{value:!0});B_.default=void 0;var l3e=function(){var e=null;try{typeof Cypress<"u"?e=Cypress.env("SECURE_LOCAL_STORAGE_HASH_KEY")||Cypress.env("REACT_APP_SECURE_LOCAL_STORAGE_HASH_KEY")||Cypress.env("NEXT_PUBLIC_SECURE_LOCAL_STORAGE_HASH_KEY")||Cypress.env("VITE_SECURE_LOCAL_STORAGE_HASH_KEY"):typeof qs<"u"?e=qs.SECURE_LOCAL_STORAGE_HASH_KEY||qs.REACT_APP_SECURE_LOCAL_STORAGE_HASH_KEY||qs.NEXT_PUBLIC_SECURE_LOCAL_STORAGE_HASH_KEY||qs.VITE_SECURE_LOCAL_STORAGE_HASH_KEY:console.warn("react-secure-storage : process is not defined! Just a warning!")}catch{return null}return e},c3e=function(){var e=null;try{typeof Cypress<"u"?e=Cypress.env("SECURE_LOCAL_STORAGE_PREFIX")||Cypress.env("REACT_APP_SECURE_LOCAL_STORAGE_PREFIX")||Cypress.env("NEXT_PUBLIC_SECURE_LOCAL_STORAGE_PREFIX")||Cypress.env("VITE_SECURE_LOCAL_STORAGE_PREFIX"):typeof qs<"u"?e=qs.SECURE_LOCAL_STORAGE_PREFIX||qs.REACT_APP_SECURE_LOCAL_STORAGE_PREFIX||qs.NEXT_PUBLIC_SECURE_LOCAL_STORAGE_PREFIX||qs.VITE_SECURE_LOCAL_STORAGE_PREFIX:console.warn("react-secure-storage : process is not defined! Just a warning!")}catch{return null}return e},u3e=function(){var e=null;try{typeof Cypress<"u"?e=Cypress.env("SECURE_LOCAL_STORAGE_DISABLED_KEYS")||Cypress.env("REACT_APP_SECURE_LOCAL_STORAGE_DISABLED_KEYS")||Cypress.env("NEXT_PUBLIC_SECURE_LOCAL_STORAGE_DISABLED_KEYS")||Cypress.env("VITE_SECURE_LOCAL_STORAGE_DISABLED_KEYS"):typeof qs<"u"?e=qs.SECURE_LOCAL_STORAGE_DISABLED_KEYS||qs.REACT_APP_SECURE_LOCAL_STORAGE_DISABLED_KEYS||qs.NEXT_PUBLIC_SECURE_LOCAL_STORAGE_DISABLED_KEYS||qs.VITE_SECURE_LOCAL_STORAGE_DISABLED_KEYS:console.warn("react-secure-storage : process is not defined! Just a warning!")}catch{return null}return e},d3e={getHashKey:l3e,getStoragePrefix:c3e,getDisabledKeys:u3e},f3e=d3e;B_.default=f3e;var rR={},Iee={exports:{}};(function(t){function e(n,r){var s,i,a,o,c,u,f,l;for(s=n.length&3,i=n.length-s,a=r,c=3432918353,u=461845907,l=0;l>>16)*c&65535)<<16)&4294967295,f=f<<15|f>>>17,f=(f&65535)*u+(((f>>>16)*u&65535)<<16)&4294967295,a^=f,a=a<<13|a>>>19,o=(a&65535)*5+(((a>>>16)*5&65535)<<16)&4294967295,a=(o&65535)+27492+(((o>>>16)+58964&65535)<<16);switch(f=0,s){case 3:f^=(n.charCodeAt(l+2)&255)<<16;case 2:f^=(n.charCodeAt(l+1)&255)<<8;case 1:f^=n.charCodeAt(l)&255,f=(f&65535)*c+(((f>>>16)*c&65535)<<16)&4294967295,f=f<<15|f>>>17,f=(f&65535)*u+(((f>>>16)*u&65535)<<16)&4294967295,a^=f}return a^=n.length,a^=a>>>16,a=(a&65535)*2246822507+(((a>>>16)*2246822507&65535)<<16)&4294967295,a^=a>>>13,a=(a&65535)*3266489909+(((a>>>16)*3266489909&65535)<<16)&4294967295,a^=a>>>16,a>>>0}t.exports=e})(Iee);var h3e=Iee.exports,ml={};Object.defineProperty(ml,"__esModule",{value:!0});ml.getSecurePrefix=ml.getDisabledKeys=ml.FINGERPRINT_KEYS=void 0;var $ee=p3e(B_);function p3e(t){return t&&t.__esModule?t:{default:t}}var m3e=function(){var e=$ee.default.getStoragePrefix()||"@secure.";return e.endsWith(".")?e:e+"."};ml.getSecurePrefix=m3e;var Fi={USERAGENT:"UserAgent",SCREEN_PRINT:"ScreenPrint",PLUGINS:"Plugins",FONTS:"Fonts",LOCAL_STORAGE:"LocalStorage",SESSION_STORAGE:"SessionStorage",TIMEZONE:"TimeZone",LANGUAGE:"Language",SYSTEM_LANGUAGE:"SystemLanguage",COOKIE:"Cookie",CANVAS:"Canvas",HOSTNAME:"Hostname"};ml.FINGERPRINT_KEYS=Fi;var g3e=function(){var e=$ee.default.getDisabledKeys()||"";if(e==="")return[];var n=[Fi.USERAGENT,Fi.SCREEN_PRINT,Fi.PLUGINS,Fi.FONTS,Fi.LOCAL_STORAGE,Fi.SESSION_STORAGE,Fi.TIMEZONE,Fi.LANGUAGE,Fi.SYSTEM_LANGUAGE,Fi.COOKIE,Fi.CANVAS,Fi.HOSTNAME],r=[];return e.split("|").forEach(function(s){s===""||(n.includes(s)?r.push(s):console.warn("react-secure-storage : ".concat(s," is not present in the available disabled keys options! Please go through the documentation")))}),r};ml.getDisabledKeys=g3e;Object.defineProperty(rR,"__esModule",{value:!0});rR.default=void 0;var v3e=y3e(h3e),Ii=ml;function y3e(t){return t&&t.__esModule?t:{default:t}}function b3e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function w3e(t,e){for(var n=0;n"u"?e:A3e.default.getFingerprint()+e},T3e=P3e;nR.default=T3e;Object.defineProperty(z_,"__esModule",{value:!0});z_.default=void 0;var k3e=X$(t3e),TU=X$(a3e),D3e=X$(nR);function X$(t){return t&&t.__esModule?t:{default:t}}function N3e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function O3e(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);nnull},oze=_.createContext(ize);function aze({children:t,defaultTheme:e="system",storageKey:n="vite-ui-theme",...r}){const[s,i]=_.useState(()=>Ao.getItem(n)||e);_.useEffect(()=>{const o=window.document.documentElement;if(o.classList.remove("light","dark"),s==="system"){const c=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";o.classList.add(c);return}o.classList.add(s)},[s]);const a={theme:s,setTheme:o=>{Ao.setItem(n,o),i(o)}};return P.jsx(oze.Provider,{...r,value:a,children:t})}const lze=_.createContext(null),zee=({children:t})=>{const[e,n]=_.useState(null),[r,s]=_.useState(!1),i=_.useCallback(u=>{n(u),s(!0)},[s,n]),a=()=>{var u;(u=e==null?void 0:e.onConfirm)==null||u.call(e),s(!1)},o=()=>{var u;(u=e==null?void 0:e.onCancel)==null||u.call(e),s(!1)},c=_.useMemo(()=>({show:i}),[i]);return P.jsxs(lze.Provider,{value:c,children:[t,P.jsx(_Q,{onCancel:()=>{o()},onConfirm:()=>a(),title:e==null?void 0:e.title,description:e==null?void 0:e.subtitle,confirmLabel:e==null?void 0:e.confirmText,cancelLabel:e==null?void 0:e.cancelText,isOpen:r})]})},cze=_.lazy(()=>Xr(()=>import("./index-qquRaZ4m.js"),__vite__mapDeps([0,1])).then(t=>({default:t.DealerLayout}))),uze=_.lazy(()=>Xr(()=>import("./index-qquRaZ4m.js"),__vite__mapDeps([0,1])).then(t=>({default:t.DealersList}))),dze=_.lazy(()=>Xr(()=>import("./index-qquRaZ4m.js"),__vite__mapDeps([0,1])).then(t=>({default:t.ErrorPage}))),fze=_.lazy(()=>Xr(()=>import("./index-qquRaZ4m.js"),__vite__mapDeps([0,1])).then(t=>({default:t.LoginPageWithLanguageSelector}))),hze=_.lazy(()=>Xr(()=>import("./index-qquRaZ4m.js"),__vite__mapDeps([0,1])).then(t=>({default:t.LogoutPage}))),pze=_.lazy(()=>Xr(()=>import("./index-qquRaZ4m.js"),__vite__mapDeps([0,1])).then(t=>({default:t.QuoteCreate}))),mze=_.lazy(()=>Xr(()=>import("./index-qquRaZ4m.js"),__vite__mapDeps([0,1])).then(t=>({default:t.QuoteEdit}))),gze=_.lazy(()=>Xr(()=>import("./index-qquRaZ4m.js"),__vite__mapDeps([0,1])).then(t=>({default:t.SettingsEditor}))),vze=_.lazy(()=>Xr(()=>import("./index-qquRaZ4m.js"),__vite__mapDeps([0,1])).then(t=>({default:t.SettingsLayout}))),yze=_.lazy(()=>Xr(()=>import("./index-qquRaZ4m.js"),__vite__mapDeps([0,1])).then(t=>({default:t.CatalogLayout}))),bze=_.lazy(()=>Xr(()=>import("./index-qquRaZ4m.js"),__vite__mapDeps([0,1])).then(t=>({default:t.CatalogList}))),wze=_.lazy(()=>Xr(()=>import("./index-qquRaZ4m.js"),__vite__mapDeps([0,1])).then(t=>({default:t.DashboardPage}))),_ze=_.lazy(()=>Xr(()=>import("./index-qquRaZ4m.js"),__vite__mapDeps([0,1])).then(t=>({default:t.QuotesLayout}))),xze=_.lazy(()=>Xr(()=>import("./index-qquRaZ4m.js"),__vite__mapDeps([0,1])).then(t=>({default:t.QuotesList}))),Sze=()=>{const t=[{path:"*",Element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(dze,{})})}],e=[{path:"/",element:P.jsx(_U,{children:P.jsx(wQ,{to:"/quotes",replace:!0})})},{path:"/home",element:P.jsx(_U,{children:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(wze,{})})})},{path:"/catalog",element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(yze,{children:P.jsx(gS,{})})}),children:[{index:!0,element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(bze,{})})}]},{path:"/dealers",element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(cze,{children:P.jsx(gS,{})})}),children:[{index:!0,element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(uze,{})})}]},{path:"/quotes",element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(_ze,{children:P.jsx(gS,{})})}),children:[{index:!0,element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(xze,{})})},{path:"add",element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(pze,{})})},{path:"edit/:id",element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(mze,{})})}]},{path:"/settings",element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(vze,{children:P.jsx(gS,{})})}),children:[{index:!0,element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(gze,{})})}]},{path:"/logout",element:P.jsx(hze,{})}],n=[{path:"/login",element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(fze,{})})}],r=rOe([...e,...n,...t],{});return P.jsx(fOe,{router:r})};function Bee(t,e){return function(){return t.apply(e,arguments)}}const{toString:Eze}=Object.prototype,{getPrototypeOf:Q$}=Object,iR=(t=>e=>{const n=Eze.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Oa=t=>(t=t.toLowerCase(),e=>iR(e)===t),oR=t=>e=>typeof e===t,{isArray:jv}=Array,u0=oR("undefined");function Cze(t){return t!==null&&!u0(t)&&t.constructor!==null&&!u0(t.constructor)&&so(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Uee=Oa("ArrayBuffer");function Aze(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Uee(t.buffer),e}const Rze=oR("string"),so=oR("function"),Hee=oR("number"),aR=t=>t!==null&&typeof t=="object",Pze=t=>t===!0||t===!1,xE=t=>{if(iR(t)!=="object")return!1;const e=Q$(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},Tze=Oa("Date"),kze=Oa("File"),Dze=Oa("Blob"),Nze=Oa("FileList"),Oze=t=>aR(t)&&so(t.pipe),Mze=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||so(t.append)&&((e=iR(t))==="formdata"||e==="object"&&so(t.toString)&&t.toString()==="[object FormData]"))},Lze=Oa("URLSearchParams"),[Ize,$ze,Fze,jze]=["ReadableStream","Request","Response","Headers"].map(Oa),zze=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function U_(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,s;if(typeof t!="object"&&(t=[t]),jv(t))for(r=0,s=t.length;r0;)if(s=n[r],e===s.toLowerCase())return s;return null}const Cf=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Wee=t=>!u0(t)&&t!==Cf;function JO(){const{caseless:t}=Wee(this)&&this||{},e={},n=(r,s)=>{const i=t&&Vee(e,s)||s;xE(e[i])&&xE(r)?e[i]=JO(e[i],r):xE(r)?e[i]=JO({},r):jv(r)?e[i]=r.slice():e[i]=r};for(let r=0,s=arguments.length;r(U_(e,(s,i)=>{n&&so(s)?t[i]=Bee(s,n):t[i]=s},{allOwnKeys:r}),t),Uze=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Hze=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},Vze=(t,e,n,r)=>{let s,i,a;const o={};if(e=e||{},t==null)return e;do{for(s=Object.getOwnPropertyNames(t),i=s.length;i-- >0;)a=s[i],(!r||r(a,t,e))&&!o[a]&&(e[a]=t[a],o[a]=!0);t=n!==!1&&Q$(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},Wze=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},Gze=t=>{if(!t)return null;if(jv(t))return t;let e=t.length;if(!Hee(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},qze=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Q$(Uint8Array)),Kze=(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let s;for(;(s=r.next())&&!s.done;){const i=s.value;e.call(t,i[0],i[1])}},Yze=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},Xze=Oa("HTMLFormElement"),Qze=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),OU=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),Zze=Oa("RegExp"),Gee=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};U_(n,(s,i)=>{let a;(a=e(s,i,t))!==!1&&(r[i]=a||s)}),Object.defineProperties(t,r)},Jze=t=>{Gee(t,(e,n)=>{if(so(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(so(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},eBe=(t,e)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return jv(t)?r(t):r(String(t).split(e)),n},tBe=()=>{},nBe=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function rBe(t){return!!(t&&so(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const sBe=t=>{const e=new Array(10),n=(r,s)=>{if(aR(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[s]=r;const i=jv(r)?[]:{};return U_(r,(a,o)=>{const c=n(a,s+1);!u0(c)&&(i[o]=c)}),e[s]=void 0,i}}return r};return n(t,0)},iBe=Oa("AsyncFunction"),oBe=t=>t&&(aR(t)||so(t))&&so(t.then)&&so(t.catch),qee=((t,e)=>t?setImmediate:e?((n,r)=>(Cf.addEventListener("message",({source:s,data:i})=>{s===Cf&&i===n&&r.length&&r.shift()()},!1),s=>{r.push(s),Cf.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",so(Cf.postMessage)),aBe=typeof queueMicrotask<"u"?queueMicrotask.bind(Cf):typeof process<"u"&&process.nextTick||qee,ve={isArray:jv,isArrayBuffer:Uee,isBuffer:Cze,isFormData:Mze,isArrayBufferView:Aze,isString:Rze,isNumber:Hee,isBoolean:Pze,isObject:aR,isPlainObject:xE,isReadableStream:Ize,isRequest:$ze,isResponse:Fze,isHeaders:jze,isUndefined:u0,isDate:Tze,isFile:kze,isBlob:Dze,isRegExp:Zze,isFunction:so,isStream:Oze,isURLSearchParams:Lze,isTypedArray:qze,isFileList:Nze,forEach:U_,merge:JO,extend:Bze,trim:zze,stripBOM:Uze,inherits:Hze,toFlatObject:Vze,kindOf:iR,kindOfTest:Oa,endsWith:Wze,toArray:Gze,forEachEntry:Kze,matchAll:Yze,isHTMLForm:Xze,hasOwnProperty:OU,hasOwnProp:OU,reduceDescriptors:Gee,freezeMethods:Jze,toObjectSet:eBe,toCamelCase:Qze,noop:tBe,toFiniteNumber:nBe,findKey:Vee,global:Cf,isContextDefined:Wee,isSpecCompliantForm:rBe,toJSONObject:sBe,isAsyncFn:iBe,isThenable:oBe,setImmediate:qee,asap:aBe};function wt(t,e,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}ve.inherits(wt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ve.toJSONObject(this.config),code:this.code,status:this.status}}});const Kee=wt.prototype,Yee={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{Yee[t]={value:t}});Object.defineProperties(wt,Yee);Object.defineProperty(Kee,"isAxiosError",{value:!0});wt.from=(t,e,n,r,s,i)=>{const a=Object.create(Kee);return ve.toFlatObject(t,a,function(c){return c!==Error.prototype},o=>o!=="isAxiosError"),wt.call(a,t.message,e,n,r,s),a.cause=t,a.name=t.name,i&&Object.assign(a,i),a};const lBe=null;function eM(t){return ve.isPlainObject(t)||ve.isArray(t)}function Xee(t){return ve.endsWith(t,"[]")?t.slice(0,-2):t}function MU(t,e,n){return t?t.concat(e).map(function(s,i){return s=Xee(s),!n&&i?"["+s+"]":s}).join(n?".":""):e}function cBe(t){return ve.isArray(t)&&!t.some(eM)}const uBe=ve.toFlatObject(ve,{},null,function(e){return/^is[A-Z]/.test(e)});function lR(t,e,n){if(!ve.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=ve.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(h,y){return!ve.isUndefined(y[h])});const r=n.metaTokens,s=n.visitor||f,i=n.dots,a=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&ve.isSpecCompliantForm(e);if(!ve.isFunction(s))throw new TypeError("visitor must be a function");function u(p){if(p===null)return"";if(ve.isDate(p))return p.toISOString();if(!c&&ve.isBlob(p))throw new wt("Blob is not supported. Use a Buffer instead.");return ve.isArrayBuffer(p)||ve.isTypedArray(p)?c&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function f(p,h,y){let g=p;if(p&&!y&&typeof p=="object"){if(ve.endsWith(h,"{}"))h=r?h:h.slice(0,-2),p=JSON.stringify(p);else if(ve.isArray(p)&&cBe(p)||(ve.isFileList(p)||ve.endsWith(h,"[]"))&&(g=ve.toArray(p)))return h=Xee(h),g.forEach(function(w,x){!(ve.isUndefined(w)||w===null)&&e.append(a===!0?MU([h],x,i):a===null?h:h+"[]",u(w))}),!1}return eM(p)?!0:(e.append(MU(y,h,i),u(p)),!1)}const l=[],d=Object.assign(uBe,{defaultVisitor:f,convertValue:u,isVisitable:eM});function m(p,h){if(!ve.isUndefined(p)){if(l.indexOf(p)!==-1)throw Error("Circular reference detected in "+h.join("."));l.push(p),ve.forEach(p,function(g,v){(!(ve.isUndefined(g)||g===null)&&s.call(e,g,ve.isString(v)?v.trim():v,h,d))===!0&&m(g,h?h.concat(v):[v])}),l.pop()}}if(!ve.isObject(t))throw new TypeError("data must be an object");return m(t),e}function LU(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function Z$(t,e){this._pairs=[],t&&lR(t,this,e)}const Qee=Z$.prototype;Qee.append=function(e,n){this._pairs.push([e,n])};Qee.toString=function(e){const n=e?function(r){return e.call(this,r,LU)}:LU;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function dBe(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Zee(t,e,n){if(!e)return t;const r=n&&n.encode||dBe;ve.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let i;if(s?i=s(e,n):i=ve.isURLSearchParams(e)?e.toString():new Z$(e,n).toString(r),i){const a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class IU{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){ve.forEach(this.handlers,function(r){r!==null&&e(r)})}}const Jee={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},fBe=typeof URLSearchParams<"u"?URLSearchParams:Z$,hBe=typeof FormData<"u"?FormData:null,pBe=typeof Blob<"u"?Blob:null,mBe={isBrowser:!0,classes:{URLSearchParams:fBe,FormData:hBe,Blob:pBe},protocols:["http","https","file","blob","url","data"]},J$=typeof window<"u"&&typeof document<"u",tM=typeof navigator=="object"&&navigator||void 0,gBe=J$&&(!tM||["ReactNative","NativeScript","NS"].indexOf(tM.product)<0),vBe=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",yBe=J$&&window.location.href||"http://localhost",bBe=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:J$,hasStandardBrowserEnv:gBe,hasStandardBrowserWebWorkerEnv:vBe,navigator:tM,origin:yBe},Symbol.toStringTag,{value:"Module"})),Ts={...bBe,...mBe};function wBe(t,e){return lR(t,new Ts.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,i){return Ts.isNode&&ve.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}function _Be(t){return ve.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function xBe(t){const e={},n=Object.keys(t);let r;const s=n.length;let i;for(r=0;r=n.length;return a=!a&&ve.isArray(s)?s.length:a,c?(ve.hasOwnProp(s,a)?s[a]=[s[a],r]:s[a]=r,!o):((!s[a]||!ve.isObject(s[a]))&&(s[a]=[]),e(n,r,s[a],i)&&ve.isArray(s[a])&&(s[a]=xBe(s[a])),!o)}if(ve.isFormData(t)&&ve.isFunction(t.entries)){const n={};return ve.forEachEntry(t,(r,s)=>{e(_Be(r),s,n,0)}),n}return null}function SBe(t,e,n){if(ve.isString(t))try{return(e||JSON.parse)(t),ve.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const H_={transitional:Jee,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=ve.isObject(e);if(i&&ve.isHTMLForm(e)&&(e=new FormData(e)),ve.isFormData(e))return s?JSON.stringify(ete(e)):e;if(ve.isArrayBuffer(e)||ve.isBuffer(e)||ve.isStream(e)||ve.isFile(e)||ve.isBlob(e)||ve.isReadableStream(e))return e;if(ve.isArrayBufferView(e))return e.buffer;if(ve.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return wBe(e,this.formSerializer).toString();if((o=ve.isFileList(e))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return lR(o?{"files[]":e}:e,c&&new c,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),SBe(e)):e}],transformResponse:[function(e){const n=this.transitional||H_.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(ve.isResponse(e)||ve.isReadableStream(e))return e;if(e&&ve.isString(e)&&(r&&!this.responseType||s)){const a=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(e)}catch(o){if(a)throw o.name==="SyntaxError"?wt.from(o,wt.ERR_BAD_RESPONSE,this,null,this.response):o}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ts.classes.FormData,Blob:Ts.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ve.forEach(["delete","get","head","post","put","patch"],t=>{H_.headers[t]={}});const EBe=ve.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),CBe=t=>{const e={};let n,r,s;return t&&t.split(` +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function H3e(t,e){if(t){if(typeof t=="string")return kU(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kU(t,e)}}function kU(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nnull},oze=_.createContext(ize);function aze({children:t,defaultTheme:e="system",storageKey:n="vite-ui-theme",...r}){const[s,i]=_.useState(()=>Ao.getItem(n)||e);_.useEffect(()=>{const o=window.document.documentElement;if(o.classList.remove("light","dark"),s==="system"){const c=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";o.classList.add(c);return}o.classList.add(s)},[s]);const a={theme:s,setTheme:o=>{Ao.setItem(n,o),i(o)}};return P.jsx(oze.Provider,{...r,value:a,children:t})}const lze=_.createContext(null),zee=({children:t})=>{const[e,n]=_.useState(null),[r,s]=_.useState(!1),i=_.useCallback(u=>{n(u),s(!0)},[s,n]),a=()=>{var u;(u=e==null?void 0:e.onConfirm)==null||u.call(e),s(!1)},o=()=>{var u;(u=e==null?void 0:e.onCancel)==null||u.call(e),s(!1)},c=_.useMemo(()=>({show:i}),[i]);return P.jsxs(lze.Provider,{value:c,children:[t,P.jsx(_Q,{onCancel:()=>{o()},onConfirm:()=>a(),title:e==null?void 0:e.title,description:e==null?void 0:e.subtitle,confirmLabel:e==null?void 0:e.confirmText,cancelLabel:e==null?void 0:e.cancelText,isOpen:r})]})},cze=_.lazy(()=>Xr(()=>import("./index-CCfX-UYJ.js"),__vite__mapDeps([0,1])).then(t=>({default:t.DealerLayout}))),uze=_.lazy(()=>Xr(()=>import("./index-CCfX-UYJ.js"),__vite__mapDeps([0,1])).then(t=>({default:t.DealersList}))),dze=_.lazy(()=>Xr(()=>import("./index-CCfX-UYJ.js"),__vite__mapDeps([0,1])).then(t=>({default:t.ErrorPage}))),fze=_.lazy(()=>Xr(()=>import("./index-CCfX-UYJ.js"),__vite__mapDeps([0,1])).then(t=>({default:t.LoginPageWithLanguageSelector}))),hze=_.lazy(()=>Xr(()=>import("./index-CCfX-UYJ.js"),__vite__mapDeps([0,1])).then(t=>({default:t.LogoutPage}))),pze=_.lazy(()=>Xr(()=>import("./index-CCfX-UYJ.js"),__vite__mapDeps([0,1])).then(t=>({default:t.QuoteCreate}))),mze=_.lazy(()=>Xr(()=>import("./index-CCfX-UYJ.js"),__vite__mapDeps([0,1])).then(t=>({default:t.QuoteEdit}))),gze=_.lazy(()=>Xr(()=>import("./index-CCfX-UYJ.js"),__vite__mapDeps([0,1])).then(t=>({default:t.SettingsEditor}))),vze=_.lazy(()=>Xr(()=>import("./index-CCfX-UYJ.js"),__vite__mapDeps([0,1])).then(t=>({default:t.SettingsLayout}))),yze=_.lazy(()=>Xr(()=>import("./index-CCfX-UYJ.js"),__vite__mapDeps([0,1])).then(t=>({default:t.CatalogLayout}))),bze=_.lazy(()=>Xr(()=>import("./index-CCfX-UYJ.js"),__vite__mapDeps([0,1])).then(t=>({default:t.CatalogList}))),wze=_.lazy(()=>Xr(()=>import("./index-CCfX-UYJ.js"),__vite__mapDeps([0,1])).then(t=>({default:t.DashboardPage}))),_ze=_.lazy(()=>Xr(()=>import("./index-CCfX-UYJ.js"),__vite__mapDeps([0,1])).then(t=>({default:t.QuotesLayout}))),xze=_.lazy(()=>Xr(()=>import("./index-CCfX-UYJ.js"),__vite__mapDeps([0,1])).then(t=>({default:t.QuotesList}))),Sze=()=>{const t=[{path:"*",Element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(dze,{})})}],e=[{path:"/",element:P.jsx(_U,{children:P.jsx(wQ,{to:"/quotes",replace:!0})})},{path:"/home",element:P.jsx(_U,{children:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(wze,{})})})},{path:"/catalog",element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(yze,{children:P.jsx(gS,{})})}),children:[{index:!0,element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(bze,{})})}]},{path:"/dealers",element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(cze,{children:P.jsx(gS,{})})}),children:[{index:!0,element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(uze,{})})}]},{path:"/quotes",element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(_ze,{children:P.jsx(gS,{})})}),children:[{index:!0,element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(xze,{})})},{path:"add",element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(pze,{})})},{path:"edit/:id",element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(mze,{})})}]},{path:"/settings",element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(vze,{children:P.jsx(gS,{})})}),children:[{index:!0,element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(gze,{})})}]},{path:"/logout",element:P.jsx(hze,{})}],n=[{path:"/login",element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(fze,{})})}],r=rOe([...e,...n,...t],{});return P.jsx(fOe,{router:r})};function Bee(t,e){return function(){return t.apply(e,arguments)}}const{toString:Eze}=Object.prototype,{getPrototypeOf:Q$}=Object,iR=(t=>e=>{const n=Eze.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Oa=t=>(t=t.toLowerCase(),e=>iR(e)===t),oR=t=>e=>typeof e===t,{isArray:jv}=Array,u0=oR("undefined");function Cze(t){return t!==null&&!u0(t)&&t.constructor!==null&&!u0(t.constructor)&&so(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Uee=Oa("ArrayBuffer");function Aze(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Uee(t.buffer),e}const Rze=oR("string"),so=oR("function"),Hee=oR("number"),aR=t=>t!==null&&typeof t=="object",Pze=t=>t===!0||t===!1,xE=t=>{if(iR(t)!=="object")return!1;const e=Q$(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},Tze=Oa("Date"),kze=Oa("File"),Dze=Oa("Blob"),Nze=Oa("FileList"),Oze=t=>aR(t)&&so(t.pipe),Mze=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||so(t.append)&&((e=iR(t))==="formdata"||e==="object"&&so(t.toString)&&t.toString()==="[object FormData]"))},Lze=Oa("URLSearchParams"),[Ize,$ze,Fze,jze]=["ReadableStream","Request","Response","Headers"].map(Oa),zze=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function U_(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,s;if(typeof t!="object"&&(t=[t]),jv(t))for(r=0,s=t.length;r0;)if(s=n[r],e===s.toLowerCase())return s;return null}const Cf=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Wee=t=>!u0(t)&&t!==Cf;function JO(){const{caseless:t}=Wee(this)&&this||{},e={},n=(r,s)=>{const i=t&&Vee(e,s)||s;xE(e[i])&&xE(r)?e[i]=JO(e[i],r):xE(r)?e[i]=JO({},r):jv(r)?e[i]=r.slice():e[i]=r};for(let r=0,s=arguments.length;r(U_(e,(s,i)=>{n&&so(s)?t[i]=Bee(s,n):t[i]=s},{allOwnKeys:r}),t),Uze=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Hze=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},Vze=(t,e,n,r)=>{let s,i,a;const o={};if(e=e||{},t==null)return e;do{for(s=Object.getOwnPropertyNames(t),i=s.length;i-- >0;)a=s[i],(!r||r(a,t,e))&&!o[a]&&(e[a]=t[a],o[a]=!0);t=n!==!1&&Q$(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},Wze=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},Gze=t=>{if(!t)return null;if(jv(t))return t;let e=t.length;if(!Hee(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},qze=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Q$(Uint8Array)),Kze=(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let s;for(;(s=r.next())&&!s.done;){const i=s.value;e.call(t,i[0],i[1])}},Yze=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},Xze=Oa("HTMLFormElement"),Qze=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),OU=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),Zze=Oa("RegExp"),Gee=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};U_(n,(s,i)=>{let a;(a=e(s,i,t))!==!1&&(r[i]=a||s)}),Object.defineProperties(t,r)},Jze=t=>{Gee(t,(e,n)=>{if(so(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(so(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},eBe=(t,e)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return jv(t)?r(t):r(String(t).split(e)),n},tBe=()=>{},nBe=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function rBe(t){return!!(t&&so(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const sBe=t=>{const e=new Array(10),n=(r,s)=>{if(aR(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[s]=r;const i=jv(r)?[]:{};return U_(r,(a,o)=>{const c=n(a,s+1);!u0(c)&&(i[o]=c)}),e[s]=void 0,i}}return r};return n(t,0)},iBe=Oa("AsyncFunction"),oBe=t=>t&&(aR(t)||so(t))&&so(t.then)&&so(t.catch),qee=((t,e)=>t?setImmediate:e?((n,r)=>(Cf.addEventListener("message",({source:s,data:i})=>{s===Cf&&i===n&&r.length&&r.shift()()},!1),s=>{r.push(s),Cf.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",so(Cf.postMessage)),aBe=typeof queueMicrotask<"u"?queueMicrotask.bind(Cf):typeof process<"u"&&process.nextTick||qee,ve={isArray:jv,isArrayBuffer:Uee,isBuffer:Cze,isFormData:Mze,isArrayBufferView:Aze,isString:Rze,isNumber:Hee,isBoolean:Pze,isObject:aR,isPlainObject:xE,isReadableStream:Ize,isRequest:$ze,isResponse:Fze,isHeaders:jze,isUndefined:u0,isDate:Tze,isFile:kze,isBlob:Dze,isRegExp:Zze,isFunction:so,isStream:Oze,isURLSearchParams:Lze,isTypedArray:qze,isFileList:Nze,forEach:U_,merge:JO,extend:Bze,trim:zze,stripBOM:Uze,inherits:Hze,toFlatObject:Vze,kindOf:iR,kindOfTest:Oa,endsWith:Wze,toArray:Gze,forEachEntry:Kze,matchAll:Yze,isHTMLForm:Xze,hasOwnProperty:OU,hasOwnProp:OU,reduceDescriptors:Gee,freezeMethods:Jze,toObjectSet:eBe,toCamelCase:Qze,noop:tBe,toFiniteNumber:nBe,findKey:Vee,global:Cf,isContextDefined:Wee,isSpecCompliantForm:rBe,toJSONObject:sBe,isAsyncFn:iBe,isThenable:oBe,setImmediate:qee,asap:aBe};function wt(t,e,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}ve.inherits(wt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ve.toJSONObject(this.config),code:this.code,status:this.status}}});const Kee=wt.prototype,Yee={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{Yee[t]={value:t}});Object.defineProperties(wt,Yee);Object.defineProperty(Kee,"isAxiosError",{value:!0});wt.from=(t,e,n,r,s,i)=>{const a=Object.create(Kee);return ve.toFlatObject(t,a,function(c){return c!==Error.prototype},o=>o!=="isAxiosError"),wt.call(a,t.message,e,n,r,s),a.cause=t,a.name=t.name,i&&Object.assign(a,i),a};const lBe=null;function eM(t){return ve.isPlainObject(t)||ve.isArray(t)}function Xee(t){return ve.endsWith(t,"[]")?t.slice(0,-2):t}function MU(t,e,n){return t?t.concat(e).map(function(s,i){return s=Xee(s),!n&&i?"["+s+"]":s}).join(n?".":""):e}function cBe(t){return ve.isArray(t)&&!t.some(eM)}const uBe=ve.toFlatObject(ve,{},null,function(e){return/^is[A-Z]/.test(e)});function lR(t,e,n){if(!ve.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=ve.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(h,y){return!ve.isUndefined(y[h])});const r=n.metaTokens,s=n.visitor||f,i=n.dots,a=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&ve.isSpecCompliantForm(e);if(!ve.isFunction(s))throw new TypeError("visitor must be a function");function u(p){if(p===null)return"";if(ve.isDate(p))return p.toISOString();if(!c&&ve.isBlob(p))throw new wt("Blob is not supported. Use a Buffer instead.");return ve.isArrayBuffer(p)||ve.isTypedArray(p)?c&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function f(p,h,y){let g=p;if(p&&!y&&typeof p=="object"){if(ve.endsWith(h,"{}"))h=r?h:h.slice(0,-2),p=JSON.stringify(p);else if(ve.isArray(p)&&cBe(p)||(ve.isFileList(p)||ve.endsWith(h,"[]"))&&(g=ve.toArray(p)))return h=Xee(h),g.forEach(function(w,x){!(ve.isUndefined(w)||w===null)&&e.append(a===!0?MU([h],x,i):a===null?h:h+"[]",u(w))}),!1}return eM(p)?!0:(e.append(MU(y,h,i),u(p)),!1)}const l=[],d=Object.assign(uBe,{defaultVisitor:f,convertValue:u,isVisitable:eM});function m(p,h){if(!ve.isUndefined(p)){if(l.indexOf(p)!==-1)throw Error("Circular reference detected in "+h.join("."));l.push(p),ve.forEach(p,function(g,v){(!(ve.isUndefined(g)||g===null)&&s.call(e,g,ve.isString(v)?v.trim():v,h,d))===!0&&m(g,h?h.concat(v):[v])}),l.pop()}}if(!ve.isObject(t))throw new TypeError("data must be an object");return m(t),e}function LU(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function Z$(t,e){this._pairs=[],t&&lR(t,this,e)}const Qee=Z$.prototype;Qee.append=function(e,n){this._pairs.push([e,n])};Qee.toString=function(e){const n=e?function(r){return e.call(this,r,LU)}:LU;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function dBe(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Zee(t,e,n){if(!e)return t;const r=n&&n.encode||dBe;ve.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let i;if(s?i=s(e,n):i=ve.isURLSearchParams(e)?e.toString():new Z$(e,n).toString(r),i){const a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class IU{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){ve.forEach(this.handlers,function(r){r!==null&&e(r)})}}const Jee={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},fBe=typeof URLSearchParams<"u"?URLSearchParams:Z$,hBe=typeof FormData<"u"?FormData:null,pBe=typeof Blob<"u"?Blob:null,mBe={isBrowser:!0,classes:{URLSearchParams:fBe,FormData:hBe,Blob:pBe},protocols:["http","https","file","blob","url","data"]},J$=typeof window<"u"&&typeof document<"u",tM=typeof navigator=="object"&&navigator||void 0,gBe=J$&&(!tM||["ReactNative","NativeScript","NS"].indexOf(tM.product)<0),vBe=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",yBe=J$&&window.location.href||"http://localhost",bBe=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:J$,hasStandardBrowserEnv:gBe,hasStandardBrowserWebWorkerEnv:vBe,navigator:tM,origin:yBe},Symbol.toStringTag,{value:"Module"})),Ts={...bBe,...mBe};function wBe(t,e){return lR(t,new Ts.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,i){return Ts.isNode&&ve.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}function _Be(t){return ve.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function xBe(t){const e={},n=Object.keys(t);let r;const s=n.length;let i;for(r=0;r=n.length;return a=!a&&ve.isArray(s)?s.length:a,c?(ve.hasOwnProp(s,a)?s[a]=[s[a],r]:s[a]=r,!o):((!s[a]||!ve.isObject(s[a]))&&(s[a]=[]),e(n,r,s[a],i)&&ve.isArray(s[a])&&(s[a]=xBe(s[a])),!o)}if(ve.isFormData(t)&&ve.isFunction(t.entries)){const n={};return ve.forEachEntry(t,(r,s)=>{e(_Be(r),s,n,0)}),n}return null}function SBe(t,e,n){if(ve.isString(t))try{return(e||JSON.parse)(t),ve.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const H_={transitional:Jee,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=ve.isObject(e);if(i&&ve.isHTMLForm(e)&&(e=new FormData(e)),ve.isFormData(e))return s?JSON.stringify(ete(e)):e;if(ve.isArrayBuffer(e)||ve.isBuffer(e)||ve.isStream(e)||ve.isFile(e)||ve.isBlob(e)||ve.isReadableStream(e))return e;if(ve.isArrayBufferView(e))return e.buffer;if(ve.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return wBe(e,this.formSerializer).toString();if((o=ve.isFileList(e))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return lR(o?{"files[]":e}:e,c&&new c,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),SBe(e)):e}],transformResponse:[function(e){const n=this.transitional||H_.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(ve.isResponse(e)||ve.isReadableStream(e))return e;if(e&&ve.isString(e)&&(r&&!this.responseType||s)){const a=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(e)}catch(o){if(a)throw o.name==="SyntaxError"?wt.from(o,wt.ERR_BAD_RESPONSE,this,null,this.response):o}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ts.classes.FormData,Blob:Ts.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ve.forEach(["delete","get","head","post","put","patch"],t=>{H_.headers[t]={}});const EBe=ve.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),CBe=t=>{const e={};let n,r,s;return t&&t.split(` `).forEach(function(a){s=a.indexOf(":"),n=a.substring(0,s).trim().toLowerCase(),r=a.substring(s+1).trim(),!(!n||e[n]&&EBe[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},$U=Symbol("internals");function Dy(t){return t&&String(t).trim().toLowerCase()}function SE(t){return t===!1||t==null?t:ve.isArray(t)?t.map(SE):String(t)}function ABe(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const RBe=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function bk(t,e,n,r,s){if(ve.isFunction(r))return r.call(this,e,n);if(s&&(e=n),!!ve.isString(e)){if(ve.isString(r))return e.indexOf(r)!==-1;if(ve.isRegExp(r))return r.test(e)}}function PBe(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function TBe(t,e){const n=ve.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(s,i,a){return this[r].call(this,e,s,i,a)},configurable:!0})})}let Ci=class{constructor(e){e&&this.set(e)}set(e,n,r){const s=this;function i(o,c,u){const f=Dy(c);if(!f)throw new Error("header name must be a non-empty string");const l=ve.findKey(s,f);(!l||s[l]===void 0||u===!0||u===void 0&&s[l]!==!1)&&(s[l||c]=SE(o))}const a=(o,c)=>ve.forEach(o,(u,f)=>i(u,f,c));if(ve.isPlainObject(e)||e instanceof this.constructor)a(e,n);else if(ve.isString(e)&&(e=e.trim())&&!RBe(e))a(CBe(e),n);else if(ve.isHeaders(e))for(const[o,c]of e.entries())i(c,o,r);else e!=null&&i(n,e,r);return this}get(e,n){if(e=Dy(e),e){const r=ve.findKey(this,e);if(r){const s=this[r];if(!n)return s;if(n===!0)return ABe(s);if(ve.isFunction(n))return n.call(this,s,r);if(ve.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=Dy(e),e){const r=ve.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||bk(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let s=!1;function i(a){if(a=Dy(a),a){const o=ve.findKey(r,a);o&&(!n||bk(r,r[o],o,n))&&(delete r[o],s=!0)}}return ve.isArray(e)?e.forEach(i):i(e),s}clear(e){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const i=n[r];(!e||bk(this,this[i],i,e,!0))&&(delete this[i],s=!0)}return s}normalize(e){const n=this,r={};return ve.forEach(this,(s,i)=>{const a=ve.findKey(r,i);if(a){n[a]=SE(s),delete n[i];return}const o=e?PBe(i):String(i).trim();o!==i&&delete n[i],n[o]=SE(s),r[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return ve.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=e&&ve.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(` `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(s=>r.set(s)),r}static accessor(e){const r=(this[$U]=this[$U]={accessors:{}}).accessors,s=this.prototype;function i(a){const o=Dy(a);r[o]||(TBe(s,a),r[o]=!0)}return ve.isArray(e)?e.forEach(i):i(e),this}};Ci.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ve.reduceDescriptors(Ci.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});ve.freezeMethods(Ci);function wk(t,e){const n=this||H_,r=e||n,s=Ci.from(r.headers);let i=r.data;return ve.forEach(t,function(o){i=o.call(n,i,s.normalize(),e?e.status:void 0)}),s.normalize(),i}function tte(t){return!!(t&&t.__CANCEL__)}function zv(t,e,n){wt.call(this,t??"canceled",wt.ERR_CANCELED,e,n),this.name="CanceledError"}ve.inherits(zv,wt,{__CANCEL__:!0});function nte(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new wt("Request failed with status code "+n.status,[wt.ERR_BAD_REQUEST,wt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function kBe(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function DBe(t,e){t=t||10;const n=new Array(t),r=new Array(t);let s=0,i=0,a;return e=e!==void 0?e:1e3,function(c){const u=Date.now(),f=r[i];a||(a=u),n[s]=c,r[s]=u;let l=i,d=0;for(;l!==s;)d+=n[l++],l=l%t;if(s=(s+1)%t,s===i&&(i=(i+1)%t),u-a{n=f,s=null,i&&(clearTimeout(i),i=null),t.apply(null,u)};return[(...u)=>{const f=Date.now(),l=f-n;l>=r?a(u,f):(s=u,i||(i=setTimeout(()=>{i=null,a(s)},r-l)))},()=>s&&a(s)]}const KC=(t,e,n=3)=>{let r=0;const s=DBe(50,250);return NBe(i=>{const a=i.loaded,o=i.lengthComputable?i.total:void 0,c=a-r,u=s(c),f=a<=o;r=a;const l={loaded:a,total:o,progress:o?a/o:void 0,bytes:c,rate:u||void 0,estimated:u&&o&&f?(o-a)/u:void 0,event:i,lengthComputable:o!=null,[e?"download":"upload"]:!0};t(l)},n)},FU=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},jU=t=>(...e)=>ve.asap(()=>t(...e)),OBe=Ts.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,Ts.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(Ts.origin),Ts.navigator&&/(msie|trident)/i.test(Ts.navigator.userAgent)):()=>!0,MBe=Ts.hasStandardBrowserEnv?{write(t,e,n,r,s,i){const a=[t+"="+encodeURIComponent(e)];ve.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),ve.isString(r)&&a.push("path="+r),ve.isString(s)&&a.push("domain="+s),i===!0&&a.push("secure"),document.cookie=a.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function LBe(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function IBe(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function rte(t,e,n){let r=!LBe(e);return t&&(r||n==!1)?IBe(t,e):e}const zU=t=>t instanceof Ci?{...t}:t;function sp(t,e){e=e||{};const n={};function r(u,f,l,d){return ve.isPlainObject(u)&&ve.isPlainObject(f)?ve.merge.call({caseless:d},u,f):ve.isPlainObject(f)?ve.merge({},f):ve.isArray(f)?f.slice():f}function s(u,f,l,d){if(ve.isUndefined(f)){if(!ve.isUndefined(u))return r(void 0,u,l,d)}else return r(u,f,l,d)}function i(u,f){if(!ve.isUndefined(f))return r(void 0,f)}function a(u,f){if(ve.isUndefined(f)){if(!ve.isUndefined(u))return r(void 0,u)}else return r(void 0,f)}function o(u,f,l){if(l in e)return r(u,f);if(l in t)return r(void 0,u)}const c={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:o,headers:(u,f,l)=>s(zU(u),zU(f),l,!0)};return ve.forEach(Object.keys(Object.assign({},t,e)),function(f){const l=c[f]||s,d=l(t[f],e[f],f);ve.isUndefined(d)&&l!==o||(n[f]=d)}),n}const ste=t=>{const e=sp({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:i,headers:a,auth:o}=e;e.headers=a=Ci.from(a),e.url=Zee(rte(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),o&&a.set("Authorization","Basic "+btoa((o.username||"")+":"+(o.password?unescape(encodeURIComponent(o.password)):"")));let c;if(ve.isFormData(n)){if(Ts.hasStandardBrowserEnv||Ts.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((c=a.getContentType())!==!1){const[u,...f]=c?c.split(";").map(l=>l.trim()).filter(Boolean):[];a.setContentType([u||"multipart/form-data",...f].join("; "))}}if(Ts.hasStandardBrowserEnv&&(r&&ve.isFunction(r)&&(r=r(e)),r||r!==!1&&OBe(e.url))){const u=s&&i&&MBe.read(i);u&&a.set(s,u)}return e},$Be=typeof XMLHttpRequest<"u",FBe=$Be&&function(t){return new Promise(function(n,r){const s=ste(t);let i=s.data;const a=Ci.from(s.headers).normalize();let{responseType:o,onUploadProgress:c,onDownloadProgress:u}=s,f,l,d,m,p;function h(){m&&m(),p&&p(),s.cancelToken&&s.cancelToken.unsubscribe(f),s.signal&&s.signal.removeEventListener("abort",f)}let y=new XMLHttpRequest;y.open(s.method.toUpperCase(),s.url,!0),y.timeout=s.timeout;function g(){if(!y)return;const w=Ci.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),A={data:!o||o==="text"||o==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:w,config:t,request:y};nte(function(R){n(R),h()},function(R){r(R),h()},A),y=null}"onloadend"in y?y.onloadend=g:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(g)},y.onabort=function(){y&&(r(new wt("Request aborted",wt.ECONNABORTED,t,y)),y=null)},y.onerror=function(){r(new wt("Network Error",wt.ERR_NETWORK,t,y)),y=null},y.ontimeout=function(){let x=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const A=s.transitional||Jee;s.timeoutErrorMessage&&(x=s.timeoutErrorMessage),r(new wt(x,A.clarifyTimeoutError?wt.ETIMEDOUT:wt.ECONNABORTED,t,y)),y=null},i===void 0&&a.setContentType(null),"setRequestHeader"in y&&ve.forEach(a.toJSON(),function(x,A){y.setRequestHeader(A,x)}),ve.isUndefined(s.withCredentials)||(y.withCredentials=!!s.withCredentials),o&&o!=="json"&&(y.responseType=s.responseType),u&&([d,p]=KC(u,!0),y.addEventListener("progress",d)),c&&y.upload&&([l,m]=KC(c),y.upload.addEventListener("progress",l),y.upload.addEventListener("loadend",m)),(s.cancelToken||s.signal)&&(f=w=>{y&&(r(!w||w.type?new zv(null,t,y):w),y.abort(),y=null)},s.cancelToken&&s.cancelToken.subscribe(f),s.signal&&(s.signal.aborted?f():s.signal.addEventListener("abort",f)));const v=kBe(s.url);if(v&&Ts.protocols.indexOf(v)===-1){r(new wt("Unsupported protocol "+v+":",wt.ERR_BAD_REQUEST,t));return}y.send(i||null)})},jBe=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,s;const i=function(u){if(!s){s=!0,o();const f=u instanceof Error?u:this.reason;r.abort(f instanceof wt?f:new zv(f instanceof Error?f.message:f))}};let a=e&&setTimeout(()=>{a=null,i(new wt(`timeout ${e} of ms exceeded`,wt.ETIMEDOUT))},e);const o=()=>{t&&(a&&clearTimeout(a),a=null,t.forEach(u=>{u.unsubscribe?u.unsubscribe(i):u.removeEventListener("abort",i)}),t=null)};t.forEach(u=>u.addEventListener("abort",i));const{signal:c}=r;return c.unsubscribe=()=>ve.asap(o),c}},zBe=function*(t,e){let n=t.byteLength;if(n{const s=BBe(t,e);let i=0,a,o=c=>{a||(a=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:u,value:f}=await s.next();if(u){o(),c.close();return}let l=f.byteLength;if(n){let d=i+=l;n(d)}c.enqueue(new Uint8Array(f))}catch(u){throw o(u),u}},cancel(c){return o(c),s.return()}},{highWaterMark:2})},cR=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",ite=cR&&typeof ReadableStream=="function",HBe=cR&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),ote=(t,...e)=>{try{return!!t(...e)}catch{return!1}},VBe=ite&&ote(()=>{let t=!1;const e=new Request(Ts.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),UU=64*1024,nM=ite&&ote(()=>ve.isReadableStream(new Response("").body)),YC={stream:nM&&(t=>t.body)};cR&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!YC[e]&&(YC[e]=ve.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new wt(`Response type '${e}' is not supported`,wt.ERR_NOT_SUPPORT,r)})})})(new Response);const WBe=async t=>{if(t==null)return 0;if(ve.isBlob(t))return t.size;if(ve.isSpecCompliantForm(t))return(await new Request(Ts.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(ve.isArrayBufferView(t)||ve.isArrayBuffer(t))return t.byteLength;if(ve.isURLSearchParams(t)&&(t=t+""),ve.isString(t))return(await HBe(t)).byteLength},GBe=async(t,e)=>{const n=ve.toFiniteNumber(t.getContentLength());return n??WBe(e)},qBe=cR&&(async t=>{let{url:e,method:n,data:r,signal:s,cancelToken:i,timeout:a,onDownloadProgress:o,onUploadProgress:c,responseType:u,headers:f,withCredentials:l="same-origin",fetchOptions:d}=ste(t);u=u?(u+"").toLowerCase():"text";let m=jBe([s,i&&i.toAbortSignal()],a),p;const h=m&&m.unsubscribe&&(()=>{m.unsubscribe()});let y;try{if(c&&VBe&&n!=="get"&&n!=="head"&&(y=await GBe(f,r))!==0){let A=new Request(e,{method:"POST",body:r,duplex:"half"}),k;if(ve.isFormData(r)&&(k=A.headers.get("content-type"))&&f.setContentType(k),A.body){const[R,E]=FU(y,KC(jU(c)));r=BU(A.body,UU,R,E)}}ve.isString(l)||(l=l?"include":"omit");const g="credentials"in Request.prototype;p=new Request(e,{...d,signal:m,method:n.toUpperCase(),headers:f.normalize().toJSON(),body:r,duplex:"half",credentials:g?l:void 0});let v=await fetch(p);const w=nM&&(u==="stream"||u==="response");if(nM&&(o||w&&h)){const A={};["status","statusText","headers"].forEach(T=>{A[T]=v[T]});const k=ve.toFiniteNumber(v.headers.get("content-length")),[R,E]=o&&FU(k,KC(jU(o),!0))||[];v=new Response(BU(v.body,UU,R,()=>{E&&E(),h&&h()}),A)}u=u||"text";let x=await YC[ve.findKey(YC,u)||"text"](v,t);return!w&&h&&h(),await new Promise((A,k)=>{nte(A,k,{data:x,headers:Ci.from(v.headers),status:v.status,statusText:v.statusText,config:t,request:p})})}catch(g){throw h&&h(),g&&g.name==="TypeError"&&/fetch/i.test(g.message)?Object.assign(new wt("Network Error",wt.ERR_NETWORK,t,p),{cause:g.cause||g}):wt.from(g,g&&g.code,t,p)}}),rM={http:lBe,xhr:FBe,fetch:qBe};ve.forEach(rM,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const HU=t=>`- ${t}`,KBe=t=>ve.isFunction(t)||t===null||t===!1,ate={getAdapter:t=>{t=ve.isArray(t)?t:[t];const{length:e}=t;let n,r;const s={};for(let i=0;i`adapter ${o} `+(c===!1?"is not supported by the environment":"is not available in the build"));let a=e?i.length>1?`since : `+i.map(HU).join(` @@ -317,7 +317,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `+i):r.stack=i}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=sp(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&EE.assertOptions(r,{silentJSONParsing:za.transitional(za.boolean),forcedJSONParsing:za.transitional(za.boolean),clarifyTimeoutError:za.transitional(za.boolean)},!1),s!=null&&(ve.isFunction(s)?n.paramsSerializer={serialize:s}:EE.assertOptions(s,{encode:za.function,serialize:za.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),EE.assertOptions(n,{baseUrl:za.spelling("baseURL"),withXsrfToken:za.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&ve.merge(i.common,i[n.method]);i&&ve.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),n.headers=Ci.concat(a,i);const o=[];let c=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(n)===!1||(c=c&&h.synchronous,o.unshift(h.fulfilled,h.rejected))});const u=[];this.interceptors.response.forEach(function(h){u.push(h.fulfilled,h.rejected)});let f,l=0,d;if(!c){const p=[VU.bind(this),void 0];for(p.unshift.apply(p,o),p.push.apply(p,u),d=p.length,f=Promise.resolve(n);l{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](s);r._listeners=null}),this.promise.then=s=>{let i;const a=new Promise(o=>{r.subscribe(o),i=o}).then(s);return a.cancel=function(){r.unsubscribe(i)},a},e(function(i,a,o){r.reason||(r.reason=new zv(i,a,o),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new cte(function(s){e=s}),cancel:e}}};function QBe(t){return function(n){return t.apply(null,n)}}function ZBe(t){return ve.isObject(t)&&t.isAxiosError===!0}const sM={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(sM).forEach(([t,e])=>{sM[e]=t});function ute(t){const e=new Mh(t),n=Bee(Mh.prototype.request,e);return ve.extend(n,Mh.prototype,e,{allOwnKeys:!0}),ve.extend(n,e,null,{allOwnKeys:!0}),n.create=function(s){return ute(sp(t,s))},n}const _r=ute(H_);_r.Axios=Mh;_r.CanceledError=zv;_r.CancelToken=XBe;_r.isCancel=tte;_r.VERSION=lte;_r.toFormData=lR;_r.AxiosError=wt;_r.Cancel=_r.CanceledError;_r.all=function(e){return Promise.all(e)};_r.spread=QBe;_r.isAxiosError=ZBe;_r.mergeConfig=sp;_r.AxiosHeaders=Ci;_r.formToJSON=t=>ete(ve.isHTMLForm(t)?new FormData(t):t);_r.getAdapter=ate.getAdapter;_r.HttpStatusCode=sM;_r.default=_r;const{Axios:QUe,AxiosError:ZUe,CanceledError:JUe,isCancel:e5e,CancelToken:t5e,VERSION:n5e,all:r5e,Cancel:s5e,isAxiosError:i5e,spread:o5e,toFormData:a5e,AxiosHeaders:l5e,HttpStatusCode:c5e,formToJSON:u5e,getAdapter:d5e,mergeConfig:f5e}=_r,dte=()=>{const t=Ao.getItem("uecko.auth");return t&&t.token?`Bearer ${t.token}`:""},JBe=t=>(t.headers.Authorization=dte(),t),e4e=t=>Promise.reject(t),t4e=t=>((t==null?void 0:t.config).raw,t),n4e=t=>{if(console.debug("[response error]"),t.response){console.debug("1 => El servidor respondió con un código de estado > 200");const e=t.response.data,n=t.response.status;switch(console.debug(e),console.debug(n),n){case 400:console.error("Bad Request");break;case 401:console.error("UnAuthorized");break;case 403:console.error("Forbidden");break;case 404:console.error("Not found");break;case 422:console.error("Unprocessable Content");break}return Promise.reject(e)}else t.request?(console.debug("2 => El servidor no respondió"),console.error(t)):t.code==="ERR_CANCELED"?console.debug("3 => Petición cancelada"):(console.debug("4 => Error desconocido"),console.error(t));return console.groupEnd(),Promise.reject(t)};function r4e(t){return t.interceptors.request.use(JBe,e4e),t.interceptors.response.use(t4e,n4e),t}const fte={mode:"cors",cache:"no-cache",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json; charset=utf-8","Cache-Control":"no-cache","Access-Control-Allow-Origin":"*"}},hte=()=>r4e(_r.create(fte)),s4e=(t,e=hte())=>({login:async({email:n,password:r})=>{Ao.clear();try{const s=await e.request({url:`${t}/auth/login`,method:"POST",data:{email:n,password:r}}),{data:i}=s;return Ao.setItem("uecko.auth",i),{success:!0,data:i}}catch{return{success:!1,error:{message:"Login failed",name:"Invalid email or password"}}}},logout:()=>(Ao.clear(),Promise.resolve({success:!0,redirectTo:"/login"})),check:()=>{const n=Ao.getItem("uecko.auth"),r=!!(n!=null&&n.token);return r||Ao.clear(),Promise.resolve(r?{authenticated:!0}:{authenticated:!1,redirectTo:"/login"})},getProfile:async()=>{try{const n=await e.request({url:`${t}/profile`,method:"GET"}),{data:r}=n,s=Ao.getItem("uecko.auth");return(s==null?void 0:s.id)===(r==null?void 0:r.id)?(Ao.setItem("uecko.profile",r),Promise.resolve(r)):Promise.resolve(null)}catch(n){throw n}},onError:n=>(Ao.clear(),Promise.resolve({error:n,logout:!0}))}),i4e=(t,e=hte())=>({name:()=>"AxiosDataProvider",getApiUrl:()=>t,getApiAuthorization:dte,getList:async n=>{const{resource:r,quickSearchTerm:s,pagination:i,filters:a=[],sort:o=[]}=n,c=`${t}/${r}`,u=new URLSearchParams,{page:f,limit:l}=c4e(i);u.append("page",String(f)),u.append("limit",String(l));const d=o4e(o);d.length&&u.append("$sort_by",d.join(","));const m=l4e(s,a);m.length&&u.append("q",m.join(","));const p=a4e(a);return p.length&&u.append("$filters",p.join(",")),(await e.request({url:`${c}?${u.toString()}`,method:"GET"})).data},getOne:async n=>{const{resource:r,id:s}=n;return(await e.request({url:`${t}/${r}/${s}`,method:"GET"})).data},createOne:async n=>{const{resource:r,data:s}=n;return(await e.request({url:`${t}/${r}`,method:"POST",data:s})).data},updateOne:async n=>{const{resource:r,data:s,id:i}=n;return(await e.request({url:`${t}/${r}/${i}`,method:"PUT",data:s})).data},removeOne:async n=>{const{resource:r,id:s}=n;await e.request({url:`${t}/${r}/${s}`,method:"DELETE"})},uploadFile:async n=>{const{path:r,file:s,key:i,onUploadProgress:a}=n,o=`${t}/${r}`,c=new FormData;return c.append(i||"file",s),(await e.post(o,c,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:a})).data},downloadPDF:async n=>{const{url:r,config:s}=n,i=await e.get(r,{responseType:"arraybuffer",...s}),a=i.headers["content-disposition"];let o="downloaded-file.pdf";if(a){const u=a.match(/filename="?(.+)"?/);u&&u[1]&&(o=u[1])}const c=new Blob([i.data],{type:"application/pdf"});return{filename:o,filedata:c}},custom:async n=>{const{url:r,path:s,method:i,responseType:a,headers:o,signal:c,data:u,...f}=n;let l;if(s)l=`${t}/${s}`;else if(r)l=r;else throw new Error('"url" or "path" param is missing');let d;const m={url:l.toString(),method:i,responseType:a,signal:c,...f,...fte};switch(i){case"put":case"post":case"patch":d=await e.request({...m,data:u});break;case"delete":d=await e.delete(l.toString(),{responseType:a,headers:o,...f});break;default:d=await e.get(l.toString(),{responseType:a,signal:c,headers:o,...f});break}return d.data}}),o4e=(t=[])=>t.map(({field:e,order:n})=>`${n==="DESC"?"-":"+"}${e}`),a4e=(t=[])=>t.filter(({field:e})=>e!=="q").map(({field:e,operator:n,value:r})=>`${e}[${n}]${r}`),l4e=(t=[],e=[])=>{var n;return(n=e.find(({field:r})=>r==="q"))!=null&&n.value?[e.find(({field:r})=>r==="q").value]:t},c4e=t=>{const{pageIndex:e=yb,pageSize:n=T$}=t||{};return{page:e,limit:n}},{slice:u4e,forEach:d4e}=[];function f4e(t){return d4e.call(u4e.call(arguments,1),e=>{if(e)for(const n in e)t[n]===void 0&&(t[n]=e[n])}),t}const GU=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,h4e=function(t,e){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},s=encodeURIComponent(e);let i=`${t}=${s}`;if(r.maxAge>0){const a=r.maxAge-0;if(Number.isNaN(a))throw new Error("maxAge should be a Number");i+=`; Max-Age=${Math.floor(a)}`}if(r.domain){if(!GU.test(r.domain))throw new TypeError("option domain is invalid");i+=`; Domain=${r.domain}`}if(r.path){if(!GU.test(r.path))throw new TypeError("option path is invalid");i+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");i+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(i+="; HttpOnly"),r.secure&&(i+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"strict":i+="; SameSite=Strict";break;case"none":i+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return i},qU={create(t,e,n,r){let s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(s.expires=new Date,s.expires.setTime(s.expires.getTime()+n*60*1e3)),r&&(s.domain=r),document.cookie=h4e(t,encodeURIComponent(e),s)},read(t){const e=`${t}=`,n=document.cookie.split(";");for(let r=0;r-1&&(s=window.location.hash.substring(window.location.hash.indexOf("?")));const a=s.substring(1).split("&");for(let o=0;o0&&a[o].substring(0,c)===e&&(n=a[o].substring(c+1))}}return n}};let Yp=null;const KU=()=>{if(Yp!==null)return Yp;try{if(Yp=typeof window<"u"&&window.localStorage!==null,!Yp)return!1;const t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{Yp=!1}return Yp};var g4e={name:"localStorage",lookup(t){let{lookupLocalStorage:e}=t;if(e&&KU())return window.localStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupLocalStorage:n}=e;n&&KU()&&window.localStorage.setItem(n,t)}};let Xp=null;const YU=()=>{if(Xp!==null)return Xp;try{if(Xp=typeof window<"u"&&window.sessionStorage!==null,!Xp)return!1;const t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{Xp=!1}return Xp};var v4e={name:"sessionStorage",lookup(t){let{lookupSessionStorage:e}=t;if(e&&YU())return window.sessionStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupSessionStorage:n}=e;n&&YU()&&window.sessionStorage.setItem(n,t)}},y4e={name:"navigator",lookup(t){const e=[];if(typeof navigator<"u"){const{languages:n,userLanguage:r,language:s}=navigator;if(n)for(let i=0;i0?e:void 0}},b4e={name:"htmlTag",lookup(t){let{htmlTag:e}=t,n;const r=e||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},w4e={name:"path",lookup(t){var s;let{lookupFromPathIndex:e}=t;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?(s=n[typeof e=="number"?e:0])==null?void 0:s.replace("/",""):void 0}},_4e={name:"subdomain",lookup(t){var s,i;let{lookupFromSubdomainIndex:e}=t;const n=typeof e=="number"?e+1:1,r=typeof window<"u"&&((i=(s=window.location)==null?void 0:s.hostname)==null?void 0:i.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(r)return r[n]}};let pte=!1;try{document.cookie,pte=!0}catch{}const mte=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];pte||mte.splice(1,1);const x4e=()=>({order:mte,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:t=>t});class gte{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,n)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e,this.options=f4e(n,this.options||{},x4e()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=s=>s.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(p4e),this.addDetector(m4e),this.addDetector(g4e),this.addDetector(v4e),this.addDetector(y4e),this.addDetector(b4e),this.addDetector(w4e),this.addDetector(_4e)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,n=[];return e.forEach(r=>{if(this.detectors[r]){let s=this.detectors[r].lookup(this.options);s&&typeof s=="string"&&(s=[s]),s&&(n=n.concat(s))}}),n=n.map(r=>this.options.convertDetectedLanguage(r)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||n.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(e,this.options)}))}}gte.type="languageDetector";const S4e={title:"Presupuestador para distribuidores",LoginPage:{title:"Pressupostador per a distribuïdors",description:"Introdueixi la seva adreça de correu electrònic i contrasenya per accedir-hi"}},E4e={translation:S4e},C4e={common:{loading:"Loading...",required:"required",cancel:"Cancel",no:"No",yes:"Yes",save:"Save",save_close:"Save and Close",accept:"OK",discard:"Discard",hide:"Hide",back:"Back",upload:"Upload",continue:"Continue",close:"Close",more:"More",add:"Add",sort_asc:"Asc",sort_asc_description:"In ascending order. Click to sort descending order.",sort_desc:"Desc",sort_desc_description:"In descending order. Click to sort in ascending order.",sort_none_description:"No sorting order. Click to sort in ascending order.",rows_selected:"{{count}} row(s) selected.",rows_selected_of_total:"{{count}} of {{total}} row(s) selected.",rows_per_page:"Rows per page",num_page_of_total:"Page {{count}} of {{total}}",go_to_first_page:"Go to first page",go_to_prev_page:"Go to previous page",go_to_next_page:"Go to next page",go_to_last_page:"Go to last page",error:"Error",actions:"Actions",open_menu:"Open menu",duplicate_row:"Duplicate",duplicate_selected_rows:"Duplicate",duplicate_selected_rows_tooltip:"Duplicate selected row(s)",append_empty_row:"Append row",append_empty_row_tooltip:"Append a empty row",append_article:"Append article",append_article_tooltip:"Select and add an item from the catalog",append_block:"Append text block",append_block_tooltip:"Select and add a text block",move_row:"Move row",remove_row:"Remove",remove_selected_rows:"Remove",remove_selected_rows_tooltip:"Remove selected row(s)",reset_selected_rows:"Reset selection",reset_selected_rows_tooltip:"Reset selected row(s)",insert_row_above:"Insert row above",insert_row_below:"Insert row below",pick_date:"Select a date",required_field:"This field is required",unsaved_changes_prompt:"There are unsaved changes. If you leave, you'll lose your changes.",edit:"Edit",remove:"Remove",archive:"Archive",duplicate:"Duplicate",print:"Print",disable_preview:"Disable preview",enable_preview:"Enable preview",filter:{reset_filter:"Reset filter",badget_remove_tooltip:"Remove this filter term",input_placeholder:"Type here to filter...",button_add_term:"Add filter term",button_add_term_tooltip:"Add filter term (or press Enter)",button_remove_all:"Remove all terms from filter",help_text:"Press Enter or click the + button to add a term to the filter. Use multiple terms for a broader search."}},components:{loading_indicator:{title:"Loading..."},loading_overlay:{title:"Loading...",subtitle:"This may take a few seconds. Please do not close this page."}},hooks:{use_unsaved_changes_notifier:{title:"Changes detected",subtitle:`Caution, there are pending changes to save on this page. If you continue, you will lose the changes.`,confirm_text:"Continue",cancel_text:"Cancel"}},main_menu:{home:"Home",settings:"Settings",dealers:"Dealers",catalog:"Catalog",quotes:"Quotes",orders:"Orders",search_placeholder:"Type here for search quotes and articles",user:{user_menu:"User menu",my_account:"My account",profile:"Profile",settings:"Settings",support:"Support",logout:"Logout"},logout_dialog:{title:"Confirm",description:"Are you sure you want to log out?",confirm_label:"Log out",cancel_label:"Cancel"}},login_page:{title:"Partner intranet",description:"Enter your email address and password to login",email_label:"Email",email_placeholder:"myemail@sample.com",password_label:"Password",forgotten_password:"Forgot your password?",become_dealer:"Do you want to become a Uecko partner?",contact_us:"Contact us",login:"Log in"},dashboard:{welcome:"Welcome"},catalog:{list:{title:"Catalog of articles",columns:{description:"Description",points:"Points",retail_price:"Retail price",quantity:"quantity"}}},quotes:{list:{title:"Quotes",subtitle:"",tabs_title:"Status",tabs:{all:"All",draft:"Draft",ready:"Ready",delivered:"Delivered",accepted:"Accepted",rejected:"Rejected",archived:"Archived"},columns:{date:"Date",date_sent:"Sent to Uecko",reference:"Reference",status:"Status",customer_reference:"Customer Ref.",customer_information:"Customer",total_price:"Imp. total",actions:{edit:"Edit quote",sent_to:"Send to Uecko"}},resume:{title:"Quote",download_quote:"Download quote",tabs:{resume:"Resume",preview:"Preview"},quote_information:"Quote Information",customer_information:"Customer Information",payment_information:"Payment Information",price_information:"Quote totals"}},create:{title:"New quote",tabs:{general:"General data",items:"Quote items",preview:"Quote preview",documents:"Documents",history:"History"},form_groups:{general:{title:"General Data",desc:"General data and quote customer"},status:{title:"Status",desc:"Quote status"},items:{title:"Quote Items",desc:"Quote detail lines. Use the catalog to make it easier to fill in the content."},documents:{title:"Attached Documents",desc:"Attach documents such as photos, drawings, sketches, etc. to your quotation."},history:{title:"History",desc:"Quote history"}},edit:{title:"Quote"}},edit:{title:"Quote",buttons:{save_quote:"Save quote"}},duplicate_action:{toast_success:"Quote duplicated"},downloading_dialog:{title:"Downloading quote",description:"Please wait while your quotation is generated and downloaded in PDF format...",progress:{label:"Download is in {{status}}",status_in_progress:"in progress",status_stopped:"stopped",value_label:"Elapsed time in seconds {{elapsed}}"},cancel_button:"Cancel the download",toast_success:"Quote downloaded"},catalog_picker_dialog:{title:"Select catalog items",description:"To complete your quote, you can add items from the catalog.",toast_article_added:"Catalog item added:"},blocks_picker_dialog:{title:"Select a text block",description:"To complete your quote, you can default text blocks.",toast_article_added:"Text block added:"},quote_status_editor:{trigger_button:"Change quote status",title:"Change quote status",status:{draft:{title:"Draft",description:"The quote is in the initial stages of creation."},ready:{title:"Ready",description:"The quote is completed and ready to be delivered to the customer."},delivered:{title:"Delivered",description:"The quote has been sent to the client and a response is awaited."},accepted:{title:"Accepted",description:"The customer has approved the quote."},rejected:{title:"Rejected",description:"The customer has not accepted the quotation."},archived:{title:"Archived",description:"The quote is archived."}},submit_button:"Change status",toast_status_changed:"Quote status changed to: {{newStatus}}"},discount_column:{label:"Show discount column",description:"Shows or hides the discount column in quote lines.",confirmation:{title:"Hide line discounts",description:"There are lines with discounts applied. Hiding the column will not remove those discounts: they will still affect the quote amount, but will no longer be shown in the lines or PDF.",confirm:"Hide column"}},inline_row_actions:{delete_confirmation:{title:"Remove row",description:"Are you sure you want to remove this row? This action cannot be undone.",confirm:"Remove row"}},status:{draft:"Draft",ready:"Ready",delivered:"Delivered",accepted:"Accepted",rejected:"Rejected",archived:"Archived"},form_fields:{date:{label:"Date",desc:"Quote's date",placeholder:""},reference:{label:"Reference",desc:"Quote reference",placeholder:""},status:{label:"Status",desc:"Quote status",placeholder:""},lang_code:{label:"Language",desc:"Quote language",placeholder:""},currency_code:{label:"Currency",desc:"Quote currency",placeholder:""},customer_reference:{label:"Customer reference",desc:"Customer reference for this quote",placeholder:""},customer_information:{label:"Customer's contact data",desc:"Recommendation: enter the customer's name on the first line, the address on the second line, and the zip code and city/state on the third line.",placeholder:`Name and surname Street and number -zip code and city or state...`},payment_method:{label:"Payment method",placeholder:"",desc:"Method of payment for this quote"},notes:{label:"Notes",placeholder:"",desc:"Quote's notes"},validity:{label:"Validity time",placeholder:"",desc:"Quote's validity time"},subtotal_price:{label:"Subtotal",placeholder:"",desc:"Quote subtotal"},discount:{label:"Discount (%)",placeholder:"",desc:"Percentage discount"},discount_value:{label:"Discount ({{value}}%)",placeholder:"",desc:"Percentage discount"},discount_price:{label:"Discount price",placeholder:"",desc:"Percentage discount price"},before_tax_price:{label:"Before tax price",placeholder:"",desc:"Before tax price"},tax:{label:"Tax (%)",placeholder:"",desc:"Percentage Tax"},tax_value:{label:"{{label}} ({{value}}%)",placeholder:"",desc:"Percentage Tax"},tax_price:{label:"{{label}} amount",placeholder:"",desc:"Percentage tax price"},total_price:{label:"Total price",placeholder:"",desc:"Quote total price"},items:{quantity:{label:"Quantity",placeholder:"",desc:""},description:{label:"Description",placeholder:"",desc:""},unit_price:{label:"Unit price",placeholder:"",desc:"Item unit price"},subtotal_price:{label:"Subtotal",placeholder:"",desc:""},discount:{label:"Dto (%)",placeholder:"",desc:"Percentage discount"},total_price:{label:"Total price",placeholder:"",desc:"Total price with percentage discount"}}}},settings:{edit:{title:"Settings",subtitle:"",tabs:{profile:"Profile settings",quotes:"Quote settings",legal:"Legal settings"}},form_fields:{image:{label:"Logotype",placeholder:"",desc:""},contact_information:{label:"Your contact information",placeholder:"",desc:"Your contact information as a dealer that will appear on the quotes given to your customers."},default_tax:{label:"Default tax (%)",placeholder:"",desc:"Default tax rate for your quotes"},default_tax_label:{label:"Tax label",placeholder:"% VAT",desc:"Name or label shown alongside the tax"},default_show_line_discount_column:{label:"Show discount column by default",desc:"New quotes will initially show the discount column in their lines. You can change this option later for each quote."},default_legal_terms:{label:"Legal terms",placeholder:"",desc:"Legal information to be included at the end of your quotes"},default_payment_method:{label:"Payment method",placeholder:"",desc:"Default payment method to be used for new quotes"},default_notes:{label:"Notes",placeholder:"",desc:"Default notes to be used for new quotes"},default_quote_validity:{label:"Quote validity",placeholder:"",desc:"Default validity time to be used for new quotes"}}}},A4e={translation:C4e},R4e={common:{loading:"Cargando...",required:"obligatorio",cancel:"Cancelar",no:"No",yes:"Sí",save:"Guardar",save_close:"Guardar y Cerrar",accept:"Aceptar",discard:"Descartar",hide:"Ocultar",back:"Volver",upload:"Cargar",continue:"Continuar",close:"Cerrar",more:"More",add:"Añadir",sort_asc:"Asc",sort_asc_description:"En order ascendente. Click para ordenar descendentemente.",sort_desc:"Desc",sort_desc_description:"En orden descendente. Click para ordenar ascendentemente.",sort_none_description:"Sin orden. Click para ordenar ascendentemente.",rows_selected:"{{count}} fila(s) seleccionadas.",rows_selected_of_total:"{{count}} de {{total}} fila(s) seleccionadas.",rows_per_page:"Filas por página",num_page_of_total:"Página {{count}} de {{total}}",go_to_first_page:"Ir a la primera página",go_to_prev_page:"Ir a la página anterior",go_to_next_page:"Ir a la página siguiente",go_to_last_page:"Ir a la última página",error:"Error",actions:"Acciones",open_menu:"Abrir el menú",duplicate_row:"Duplicar",duplicate_selected_rows:"Duplicar",duplicate_selected_rows_tooltip:"Duplica las fila(s) seleccionadas(s)",append_empty_row:"Añadir fila",append_empty_row_tooltip:"Añadir una fila vacía",append_article:"Añadir artículo",append_article_tooltip:"Elegir un artículo del catálogo y añadirlo",append_block:"Añadir bloque de texto",append_block_tooltip:"Elegir un bloque de texto y añadirlo",move_row:"Mover fila",remove_row:"Eliminar",remove_selected_rows:"Eliminar",remove_selected_rows_tooltip:"Elimina las fila(s) seleccionadas(s)",reset_selected_rows:"Quitar selection",reset_selected_rows_tooltip:"Dejar de seleccionar la(s) fila(s)",insert_row_above:"Insertar fila encima",insert_row_below:"Insertar fila debajo",pick_date:"Elige una fecha",required_field:"Este campo es obligatorio",unsaved_changes_prompt:"Los últimos cambios no se han guardado. Si continúas, se perderán.",edit:"Editar",remove:"Eliminar",archive:"Archivar",duplicate:"Duplicar",print:"Imprimir",disable_preview:"Ocultar vista previa",enable_preview:"Mostrar vista previa",filter:{reset_filter:"Quitar el filtro",badget_remove_tooltip:"Quitar este término del filtro",input_placeholder:"Escribe aquí para filtrar...",button_add_term:"Añadir término al filtro",button_add_term_tooltip:"Añadir término al filtro (o pulsa Enter)",button_remove_all:"Quitar todos los términos del filtro",help_text:"Presiona Enter o haz clic en el botón + para añadir un término al filtro. Usa múltiples términos para una búsqueda más amplia."}},components:{LoadingIndicator:{title:"Cargando..."},loading_overlay:{title:"Cargando...",subtitle:"Esto puede tardar unos segundos. Por favor, no cierre esta página."}},hooks:{use_unsaved_changes_notifier:{title:"Se han detectado cambios",subtitle:`Atención, hay cambios pendientes de guardar en esta página. +zip code and city or state...`},payment_method:{label:"Payment method",placeholder:"",desc:"Method of payment for this quote"},notes:{label:"Notes",placeholder:"",desc:"Quote's notes"},validity:{label:"Validity time",placeholder:"",desc:"Quote's validity time"},subtotal_price:{label:"Subtotal",placeholder:"",desc:"Quote subtotal"},discount:{label:"Discount (%)",placeholder:"",desc:"Percentage discount"},discount_value:{label:"Discount ({{value}}%)",placeholder:"",desc:"Percentage discount"},discount_price:{label:"Discount price",placeholder:"",desc:"Percentage discount price"},before_tax_price:{label:"Before tax price",placeholder:"",desc:"Before tax price"},tax:{label:"Tax (%)",placeholder:"",desc:"Percentage Tax"},tax_value:{label:"{{label}} ({{value}}%)",placeholder:"",desc:"Percentage Tax"},tax_price:{label:"Tax amount",placeholder:"",desc:"Percentage tax price"},total_price:{label:"Total price",placeholder:"",desc:"Quote total price"},items:{quantity:{label:"Quantity",placeholder:"",desc:""},description:{label:"Description",placeholder:"",desc:""},unit_price:{label:"Unit price",placeholder:"",desc:"Item unit price"},subtotal_price:{label:"Subtotal",placeholder:"",desc:""},discount:{label:"Dto (%)",placeholder:"",desc:"Percentage discount"},total_price:{label:"Total price",placeholder:"",desc:"Total price with percentage discount"}}}},settings:{edit:{title:"Settings",subtitle:"",tabs:{profile:"Profile settings",quotes:"Quote settings",legal:"Legal settings"}},form_fields:{image:{label:"Logotype",placeholder:"",desc:""},contact_information:{label:"Your contact information",placeholder:"",desc:"Your contact information as a dealer that will appear on the quotes given to your customers."},default_tax:{label:"Default tax (%)",placeholder:"",desc:"Default tax rate for your quotes"},default_tax_label:{label:"Tax label",placeholder:"% VAT",desc:"Name or label shown alongside the tax"},default_show_line_discount_column:{label:"Show discount column by default",desc:"New quotes will initially show the discount column in their lines. You can change this option later for each quote."},default_legal_terms:{label:"Legal terms",placeholder:"",desc:"Legal information to be included at the end of your quotes"},default_payment_method:{label:"Payment method",placeholder:"",desc:"Default payment method to be used for new quotes"},default_notes:{label:"Notes",placeholder:"",desc:"Default notes to be used for new quotes"},default_quote_validity:{label:"Quote validity",placeholder:"",desc:"Default validity time to be used for new quotes"}}}},A4e={translation:C4e},R4e={common:{loading:"Cargando...",required:"obligatorio",cancel:"Cancelar",no:"No",yes:"Sí",save:"Guardar",save_close:"Guardar y Cerrar",accept:"Aceptar",discard:"Descartar",hide:"Ocultar",back:"Volver",upload:"Cargar",continue:"Continuar",close:"Cerrar",more:"More",add:"Añadir",sort_asc:"Asc",sort_asc_description:"En order ascendente. Click para ordenar descendentemente.",sort_desc:"Desc",sort_desc_description:"En orden descendente. Click para ordenar ascendentemente.",sort_none_description:"Sin orden. Click para ordenar ascendentemente.",rows_selected:"{{count}} fila(s) seleccionadas.",rows_selected_of_total:"{{count}} de {{total}} fila(s) seleccionadas.",rows_per_page:"Filas por página",num_page_of_total:"Página {{count}} de {{total}}",go_to_first_page:"Ir a la primera página",go_to_prev_page:"Ir a la página anterior",go_to_next_page:"Ir a la página siguiente",go_to_last_page:"Ir a la última página",error:"Error",actions:"Acciones",open_menu:"Abrir el menú",duplicate_row:"Duplicar",duplicate_selected_rows:"Duplicar",duplicate_selected_rows_tooltip:"Duplica las fila(s) seleccionadas(s)",append_empty_row:"Añadir fila",append_empty_row_tooltip:"Añadir una fila vacía",append_article:"Añadir artículo",append_article_tooltip:"Elegir un artículo del catálogo y añadirlo",append_block:"Añadir bloque de texto",append_block_tooltip:"Elegir un bloque de texto y añadirlo",move_row:"Mover fila",remove_row:"Eliminar",remove_selected_rows:"Eliminar",remove_selected_rows_tooltip:"Elimina las fila(s) seleccionadas(s)",reset_selected_rows:"Quitar selection",reset_selected_rows_tooltip:"Dejar de seleccionar la(s) fila(s)",insert_row_above:"Insertar fila encima",insert_row_below:"Insertar fila debajo",pick_date:"Elige una fecha",required_field:"Este campo es obligatorio",unsaved_changes_prompt:"Los últimos cambios no se han guardado. Si continúas, se perderán.",edit:"Editar",remove:"Eliminar",archive:"Archivar",duplicate:"Duplicar",print:"Imprimir",disable_preview:"Ocultar vista previa",enable_preview:"Mostrar vista previa",filter:{reset_filter:"Quitar el filtro",badget_remove_tooltip:"Quitar este término del filtro",input_placeholder:"Escribe aquí para filtrar...",button_add_term:"Añadir término al filtro",button_add_term_tooltip:"Añadir término al filtro (o pulsa Enter)",button_remove_all:"Quitar todos los términos del filtro",help_text:"Presiona Enter o haz clic en el botón + para añadir un término al filtro. Usa múltiples términos para una búsqueda más amplia."}},components:{LoadingIndicator:{title:"Cargando..."},loading_overlay:{title:"Cargando...",subtitle:"Esto puede tardar unos segundos. Por favor, no cierre esta página."}},hooks:{use_unsaved_changes_notifier:{title:"Se han detectado cambios",subtitle:`Atención, hay cambios pendientes de guardar en esta página. Si continúa, perderá los cambios.`,confirm_text:"Continuar",cancel_text:"No continuar"}},main_menu:{home:"Inicio",settings:"Ajustes",dealers:"Distribuidores",catalog:"Catálogo",quotes:"Cotizaciones",orders:"Pedidos",search_placeholder:"Buscar productos, cotizaciones, etc...",user:{user_menu:"Menú del usuario",my_account:"Mi cuenta",profile:"Perfil",settings:"Ajustes",support:"Soporte",logout:"Salir"},logout_dialog:{title:"Salir de la cuenta",description:"¿Desea salir de su cuenta?",confirm_label:"Salir",cancel_label:"Cancelar"}},login_page:{title:"Presupuestador para distribuidores",description:"Introduzca su dirección de correo electrónico y contraseña para acceder",email_label:"Email",email_placeholder:"micorreo@ejemplo.com",password_label:"Contraseña",forgotten_password:"¿Has olvidado tu contraseña?",become_dealer:"¿Quieres ser distribuidor de Uecko?",contact_us:"Contacta con nosotros",login:"Entrar"},dashboard:{welcome:"Bienvenido"},catalog:{list:{title:"Catálogo de artículos",columns:{description:"Descripción",points:"Puntos",retail_price:"PVP",quantity:"Cantidad"}}},quotes:{list:{title:"Cotizaciones",subtitle:"",tabs_title:"Estados",tabs:{all:"Todas",draft:"Borradores",ready:"Preparados",delivered:"Entregado",accepted:"Aceptados",rejected:"Rechazados",archived:"Archivados"},columns:{date:"Fecha",date_sent:"Enviado a Uecko",reference:"Referencia",status:"Estado",customer_reference:"Ref. cliente",customer_information:"Cliente",total_price:"Imp. total",actions:{edit:"Editar",sent_to:"Enviar a Uecko"}},resume:{title:"Cotización",download_quote:"Descargar",tabs:{resume:"Resumen",preview:"Previsualización"},quote_information:"Información",customer_information:"Cliente",payment_information:"Pago",price_information:"Importes"}},create:{title:"Nueva cotización",tabs:{general:"Datos generales",items:"Contenido",preview:"Vista previa",documents:"Documentos",history:"Historial"},form_groups:{general:{title:"Datos generales",desc:"Datos generales y cliente al que va la cotización"},status:{title:"Estado",desc:"Estado de la cotización"},items:{title:"Contenido de la cotización",desc:"Líneas de detalle de la cotización. Ayúdese del catálogo para rellenar más fácilmente el contenido."},documents:{title:"Documentos",desc:"Añada adjuntar con su cotización documentos como fotos, planos, croquis, etc."},history:{title:"Historial",desc:"Historial de la cotización"}},edit:{title:"Cotización"}},edit:{title:"Cotización",buttons:{save_quote:"Guardar cotización"}},duplicate_action:{toast_success:"Cotización duplicada"},downloading_dialog:{title:"Descargando cotización",description:"Espere mientras se genera la cotización y se descarga en formato PDF...",progress:{label:"La descarga está {{status}}",status_in_progress:"en marcha",status_stopped:"parada",value_label:"Elapsed time in seconds {{elapsed}}"},cancel_button:"Cancelar la descarga",toast_success:"Cotización descargada"},catalog_picker_dialog:{title:"Seleccionar artículos del catálogo",description:"Para rellenar su cotización, puede añadir artículos del catálogo.",toast_article_added:"Artículo del catálogo añadido:"},blocks_picker_dialog:{title:"Selecctionar bloques de texto",description:"Para ayudar a rellenar la cotización, puede añadir bloques de texto predefinidos de esta lista.",toast_article_added:"Bloque de texto añadido:"},quote_sent_to_editor:{trigger_button:"Enviar a Uecko",title:"Enviar la cotización a Uecko",description:"¿Desea enviar esta cotización a Uecko? Esta acción no se puede deshacer.",submit_button:"Enviar",toast_status_changed:"Cotización enviada a Uecko"},quote_status_editor:{trigger_button:"Cambiar el estado",title:"Cambiar el estado de la cotización",status:{draft:{title:"Borrador",description:"La cotización está en fase inicial de creación."},ready:{title:"Preparado",description:"La cotización está completo y listo para ser entregado al cliente."},delivered:{title:"Entregado",description:"La cotización ha sido enviado al cliente y se espera su respuesta."},accepted:{title:"Aceptado",description:"El cliente ha aprobado la cotización."},rejected:{title:"Rechazado",description:"El cliente no ha aceptado la cotización."},archived:{title:"Archivado",description:"La cotización se ha guardado para referencia futura."}},submit_button:"Cambiar estado",toast_status_changed:"Estado de la cotización cambiado a: {{newStatus}}"},discount_column:{label:"Mostrar columna descuento",description:"Muestra u oculta la columna de descuento en las líneas.",confirmation:{title:"Ocultar descuentos de línea",description:"Hay líneas con descuento aplicado. Ocultar la columna no eliminará esos descuentos: seguirán afectando al importe de la cotización, pero dejarán de mostrarse en las líneas y en el PDF.",confirm:"Ocultar columna"}},inline_row_actions:{delete_confirmation:{title:"Eliminar fila",description:"¿Seguro que quieres eliminar esta fila? Esta acción no se puede deshacer.",confirm:"Eliminar fila"}},status:{draft:"Borrador",ready:"Preparado",delivered:"Entregado",accepted:"Aceptado",rejected:"Rechazado",archived:"Archivado"},form_fields:{date:{label:"Fecha",desc:"Fecha de esta cotización",placeholder:""},reference:{label:"Referencia",desc:"Referencia para esta cotización",placeholder:""},lang_code:{label:"Idioma",desc:"Idioma de la cotización",placeholder:""},currency_code:{label:"Moneda",desc:"Moneda de la cotización",placeholder:""},customer_reference:{label:"Referencia del cliente",desc:"Referencia para el cliente de esta cotización",placeholder:""},customer_information:{label:"Datos del cliente",desc:"Recomensación: escriba el nombre del cliente en la primera línea, la direccion en la segunda y el código postal y ciudad en la tercera.",placeholder:`Nombre y apellidos Calle y número -Código postal y ciudad...`},payment_method:{label:"Forma de pago",placeholder:"placeholder",desc:"Forma de pago que se utilizará en esta cotización"},notes:{label:"Notas",placeholder:"",desc:"Notas a incluir en la cotización"},validity:{label:"Validez de la cotización",placeholder:"",desc:"Validez de la cotización"},subtotal_price:{label:"Importe neto",placeholder:"",desc:""},discount:{label:"Descuento (%)",placeholder:"",desc:"Porcentaje de descuento"},discount_value:{label:"Descuento ({{value}}%)",placeholder:"",desc:"Porcentaje de descuento"},discount_price:{label:"Imp. descuento",placeholder:"",desc:"Importe del descuento"},before_tax_price:{label:"Base imponible",placeholder:"",desc:""},tax:{label:"Impuesto (%)",placeholder:"",desc:"Porcentaje de impuesto"},tax_value:{label:"{{label}} ({{value}}%)",placeholder:"",desc:"Porcentaje de impuesto"},tax_price:{label:"Importe {{label}}",placeholder:"",desc:"Importe del impuesto"},total_price:{label:"Total price",placeholder:"",desc:"Quote total price"},items:{quantity:{label:"Cantidad",placeholder:"",desc:""},description:{label:"Descripción",placeholder:"",desc:""},unit_price:{label:"Imp. unitario",placeholder:"",desc:"Importe unitario del artículo"},subtotal_price:{label:"Subtotal",placeholder:"",desc:""},discount:{label:"Dto (%)",placeholder:"",desc:"Porcentaje de descuento"},total_price:{label:"Imp. total",placeholder:"",desc:"Importe total con el descuento ya aplicado"}}}},settings:{edit:{title:"Ajustes",subtitle:"",tabs:{profile:"Ajustes de perfil",quotes:"Ajustes para cotizaciones",legal:"Ajustes legales"}},form_fields:{logo:{label:"Logotipo",placeholder:"",desc:"Este logotipo aparecerá en las propuestas exportadas en PDF",requirements:"Se permiten ficheros JPG o PNG. Las dimensiones del logotipo deben ser 200x100 píxeles o proporcionales.",upload:"Subir logotipo",invalid_format:"Sólo se permiten ficheros JPG o PNG",invalid_dimensions:"Las dimensiones del logotipo deben ser 200x100 píxeles o proporcionales."},contact_information:{label:"Información de contacto",placeholder:"",desc:"Esta información de contacto aparecerá en las cotizaciones que entregue a sus clientes."},default_tax:{label:"Impuesto por defecto (%)",placeholder:"",desc:"Porcentaje de impuesto por defecto en las cotizaciones"},default_tax_label:{label:"Etiqueta del impuesto",placeholder:"% IVA",desc:"Nombre o etiqueta que se mostrará junto al impuesto"},default_show_line_discount_column:{label:"Mostrar columna descuento por defecto",desc:"Los nuevos presupuestos mostrarán inicialmente la columna de descuento en las líneas. Podrás cambiar esta opción posteriormente en cada presupuesto."},default_legal_terms:{label:"Cláusulas legales",placeholder:"",desc:"Texto de texto legal que desee incluir en todas las cotizaciones nuevas"},default_payment_method:{label:"Forma de pago",placeholder:"",desc:"Texto para la forma de pago que se utilizará en las cotizaciones nuevas"},default_notes:{label:"Notas",placeholder:"",desc:"Notas a incluir en todas las cotizaciones nuevas"},default_quote_validity:{label:"Validez por defecto",placeholder:"",desc:"Texto para indicar el tiempo de validez de la cotización"}}},support:{modal:{title:"Enviar una incidencia",subtitle:"Utiliza este formulario para informar sobre cualquier problema que hayas encontrado mientras usabas la aplicación. Nuestro equipo de desarrollo revisará tu incidencia y tratará de resolverla."},form_fields:{}}},P4e={translation:R4e};hs.use(gte).use(s$e).init({detection:{order:["navigator"]},debug:!1,fallbackLng:"es",interpolation:{escapeValue:!1},resources:{ca:E4e,en:A4e,es:P4e}});function T4e(){const t=new lde({defaultOptions:{queries:{retry:!1,staleTime:1e4}}});return P.jsx(i$e,{i18n:hs,children:P.jsx(hde,{client:t,children:P.jsx(hMe,{dataSource:i4e("https://presupuestos.uecko.com:13001/api/v1"),children:P.jsx(Gue,{authActions:s4e("https://presupuestos.uecko.com:13001/api/v1"),children:P.jsxs(aze,{defaultTheme:"light",storageKey:"vite-ui-theme",children:[P.jsx(LDe,{delayDuration:0,children:P.jsx(zee,{children:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(Sze,{})})})}),P.jsx(IX,{}),P.jsx(Qje,{}),!1]})})})})})}xk.createRoot(document.getElementById("uecko")).render(P.jsx(se.StrictMode,{children:P.jsx(T4e,{})}));export{jRe as $,aK as A,no as B,_fe as C,i0 as D,QD as E,ZD as F,oUe as G,BTe as H,aUe as I,dr as J,UTe as K,DUe as L,NC as M,WOe as N,VTe as O,PPe as P,yb as Q,Zl as R,pTe as S,dL as T,n_ as U,RQ as V,LW as W,IW as X,$W as Y,FW as Z,jW as _,MV as a,fL as a$,Ske as a0,kke as a1,Eke as a2,Rke as a3,Pke as a4,Cke as a5,Tke as a6,zW as a7,lK as a8,q1e as a9,Q1e as aA,wMe as aB,Lv as aC,LX as aD,pAe as aE,kIe as aF,z4 as aG,xMe as aH,M1 as aI,V4 as aJ,H4 as aK,vAe as aL,gf as aM,hhe as aN,phe as aO,mhe as aP,xs as aQ,OQ as aR,_U as aS,AIe as aT,a$e as aU,RIe as aV,NIe as aW,LDe as aX,Tfe as aY,gUe as aZ,vUe as a_,Owe as aa,Id as ab,VI as ac,fA as ad,UA as ae,hA as af,cZ as ag,jo as ah,pA as ai,BA as aj,AAe as ak,yZ as al,mZ as am,VUe as an,$$ as ao,HUe as ap,YIe as aq,UUe as ar,HIe as as,Hc as at,_m as au,gMe as av,se as aw,fMe as ax,lze as ay,bUe as az,Cde as b,kC as b$,IDe as b0,vMe as b1,aZ as b2,NUe as b3,jV as b4,W1e as b5,zUe as b6,Jh as b7,iIe as b8,Dd as b9,l0 as bA,ks as bB,jUe as bC,FUe as bD,$Ue as bE,YQ as bF,KQ as bG,dLe as bH,uLe as bI,XLe as bJ,h1e as bK,m1e as bL,g1e as bM,y1e as bN,b1e as bO,v1e as bP,G4e as bQ,K4e as bR,SIe as bS,Pfe as bT,KUe as bU,O6 as bV,dUe as bW,Mke as bX,Lke as bY,Ike as bZ,PUe as b_,yr as ba,SMe as bb,EIe as bc,BUe as bd,CIe as be,yUe as bf,Z1e as bg,L8 as bh,AK as bi,cPe as bj,qUe as bk,xke as bl,wfe as bm,rW as bn,L4e as bo,AL as bp,RL as bq,TL as br,kL as bs,PL as bt,NL as bu,DL as bv,MUe as bw,OUe as bx,IUe as by,LUe as bz,FV as c,yMe as c0,uDe as c1,eAe as c2,Zr as d,ZPe as e,ce as f,eTe as g,_a as h,CQ as i,P as j,$V as k,dMe as l,D4e as m,fxe as n,hxe as o,D8 as p,N8 as q,_ as r,M8 as s,O8 as t,xV as u,z4e as v,tr as w,Bpe as x,z1e as y,B1e as z}; +Código postal y ciudad...`},payment_method:{label:"Forma de pago",placeholder:"placeholder",desc:"Forma de pago que se utilizará en esta cotización"},notes:{label:"Notas",placeholder:"",desc:"Notas a incluir en la cotización"},validity:{label:"Validez de la cotización",placeholder:"",desc:"Validez de la cotización"},subtotal_price:{label:"Importe neto",placeholder:"",desc:""},discount:{label:"Descuento (%)",placeholder:"",desc:"Porcentaje de descuento"},discount_value:{label:"Descuento ({{value}}%)",placeholder:"",desc:"Porcentaje de descuento"},discount_price:{label:"Imp. descuento",placeholder:"",desc:"Importe del descuento"},before_tax_price:{label:"Base imponible",placeholder:"",desc:""},tax:{label:"Impuesto (%)",placeholder:"",desc:"Porcentaje de impuesto"},tax_value:{label:"{{label}} ({{value}}%)",placeholder:"",desc:"Porcentaje de impuesto"},tax_price:{label:"Imp. impuesto",placeholder:"",desc:"Importe del impuesto"},total_price:{label:"Imp. total",placeholder:"",desc:"Importe total"},items:{quantity:{label:"Cantidad",placeholder:"",desc:""},description:{label:"Descripción",placeholder:"",desc:""},unit_price:{label:"Imp. unitario",placeholder:"",desc:"Importe unitario del artículo"},subtotal_price:{label:"Subtotal",placeholder:"",desc:""},discount:{label:"Dto (%)",placeholder:"",desc:"Porcentaje de descuento"},total_price:{label:"Imp. total",placeholder:"",desc:"Importe total con el descuento ya aplicado"}}}},settings:{edit:{title:"Ajustes",subtitle:"",tabs:{profile:"Ajustes de perfil",quotes:"Ajustes para cotizaciones",legal:"Ajustes legales"}},form_fields:{logo:{label:"Logotipo",placeholder:"",desc:"Este logotipo aparecerá en las propuestas exportadas en PDF",requirements:"Se permiten ficheros JPG o PNG. Las dimensiones del logotipo deben ser 200x100 píxeles o proporcionales.",upload:"Subir logotipo",invalid_format:"Sólo se permiten ficheros JPG o PNG",invalid_dimensions:"Las dimensiones del logotipo deben ser 200x100 píxeles o proporcionales."},contact_information:{label:"Información de contacto",placeholder:"",desc:"Esta información de contacto aparecerá en las cotizaciones que entregue a sus clientes."},default_tax:{label:"Impuesto por defecto (%)",placeholder:"",desc:"Porcentaje de impuesto por defecto en las cotizaciones"},default_tax_label:{label:"Etiqueta del impuesto",placeholder:"% IVA",desc:"Nombre o etiqueta que se mostrará junto al impuesto"},default_show_line_discount_column:{label:"Mostrar columna descuento por defecto",desc:"Los nuevos presupuestos mostrarán inicialmente la columna de descuento en las líneas. Podrás cambiar esta opción posteriormente en cada presupuesto."},default_legal_terms:{label:"Cláusulas legales",placeholder:"",desc:"Texto de texto legal que desee incluir en todas las cotizaciones nuevas"},default_payment_method:{label:"Forma de pago",placeholder:"",desc:"Texto para la forma de pago que se utilizará en las cotizaciones nuevas"},default_notes:{label:"Notas",placeholder:"",desc:"Notas a incluir en todas las cotizaciones nuevas"},default_quote_validity:{label:"Validez por defecto",placeholder:"",desc:"Texto para indicar el tiempo de validez de la cotización"}}},support:{modal:{title:"Enviar una incidencia",subtitle:"Utiliza este formulario para informar sobre cualquier problema que hayas encontrado mientras usabas la aplicación. Nuestro equipo de desarrollo revisará tu incidencia y tratará de resolverla."},form_fields:{}}},P4e={translation:R4e};hs.use(gte).use(s$e).init({detection:{order:["navigator"]},debug:!1,fallbackLng:"es",interpolation:{escapeValue:!1},resources:{ca:E4e,en:A4e,es:P4e}});function T4e(){const t=new lde({defaultOptions:{queries:{retry:!1,staleTime:1e4}}});return P.jsx(i$e,{i18n:hs,children:P.jsx(hde,{client:t,children:P.jsx(hMe,{dataSource:i4e("https://presupuestos.uecko.com:13001/api/v1"),children:P.jsx(Gue,{authActions:s4e("https://presupuestos.uecko.com:13001/api/v1"),children:P.jsxs(aze,{defaultTheme:"light",storageKey:"vite-ui-theme",children:[P.jsx(LDe,{delayDuration:0,children:P.jsx(zee,{children:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(Sze,{})})})}),P.jsx(IX,{}),P.jsx(Qje,{}),!1]})})})})})}xk.createRoot(document.getElementById("uecko")).render(P.jsx(se.StrictMode,{children:P.jsx(T4e,{})}));export{jRe as $,aK as A,no as B,_fe as C,i0 as D,QD as E,ZD as F,oUe as G,BTe as H,aUe as I,dr as J,UTe as K,DUe as L,NC as M,WOe as N,VTe as O,PPe as P,yb as Q,Zl as R,pTe as S,dL as T,n_ as U,RQ as V,LW as W,IW as X,$W as Y,FW as Z,jW as _,MV as a,fL as a$,Ske as a0,kke as a1,Eke as a2,Rke as a3,Pke as a4,Cke as a5,Tke as a6,zW as a7,lK as a8,q1e as a9,Q1e as aA,wMe as aB,Lv as aC,LX as aD,pAe as aE,kIe as aF,z4 as aG,xMe as aH,M1 as aI,V4 as aJ,H4 as aK,vAe as aL,gf as aM,hhe as aN,phe as aO,mhe as aP,xs as aQ,OQ as aR,_U as aS,AIe as aT,a$e as aU,RIe as aV,NIe as aW,LDe as aX,Tfe as aY,gUe as aZ,vUe as a_,Owe as aa,Id as ab,VI as ac,fA as ad,UA as ae,hA as af,cZ as ag,jo as ah,pA as ai,BA as aj,AAe as ak,yZ as al,mZ as am,VUe as an,$$ as ao,HUe as ap,YIe as aq,UUe as ar,HIe as as,Hc as at,_m as au,gMe as av,se as aw,fMe as ax,lze as ay,bUe as az,Cde as b,kC as b$,IDe as b0,vMe as b1,aZ as b2,NUe as b3,jV as b4,W1e as b5,zUe as b6,Jh as b7,iIe as b8,Dd as b9,l0 as bA,ks as bB,jUe as bC,FUe as bD,$Ue as bE,YQ as bF,KQ as bG,dLe as bH,uLe as bI,XLe as bJ,h1e as bK,m1e as bL,g1e as bM,y1e as bN,b1e as bO,v1e as bP,G4e as bQ,K4e as bR,SIe as bS,Pfe as bT,KUe as bU,O6 as bV,dUe as bW,Mke as bX,Lke as bY,Ike as bZ,PUe as b_,yr as ba,SMe as bb,EIe as bc,BUe as bd,CIe as be,yUe as bf,Z1e as bg,L8 as bh,AK as bi,cPe as bj,qUe as bk,xke as bl,wfe as bm,rW as bn,L4e as bo,AL as bp,RL as bq,TL as br,kL as bs,PL as bt,NL as bu,DL as bv,MUe as bw,OUe as bx,IUe as by,LUe as bz,FV as c,yMe as c0,uDe as c1,eAe as c2,Zr as d,ZPe as e,ce as f,eTe as g,_a as h,CQ as i,P as j,$V as k,dMe as l,D4e as m,fxe as n,hxe as o,D8 as p,N8 as q,_ as r,M8 as s,O8 as t,xV as u,z4e as v,tr as w,Bpe as x,z1e as y,B1e as z}; diff --git a/dist/client/index.html b/dist/client/index.html index 623e16f..db9b6ad 100644 --- a/dist/client/index.html +++ b/dist/client/index.html @@ -8,7 +8,7 @@ Presupuestador Uecko - + diff --git a/package.json b/package.json index 0854228..bc659c5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "uecko-presupuestador", - "version": "1.1.7", + "version": "1.1.8", "author": "Rodax Software ", "license": "ISC", "private": true, @@ -33,4 +33,4 @@ "dependencies": { "typescript": "^5.2.2" } -} +} \ No newline at end of file diff --git a/server/package.json b/server/package.json index df8bf73..79c2f72 100644 --- a/server/package.json +++ b/server/package.json @@ -1,7 +1,7 @@ { "name": "@uecko-presupuestador/server", "private": true, - "version": "1.1.7", + "version": "1.1.8", "author": "Rodax Software ", "main": "./src/index.ts", "scripts": { diff --git a/shared/package.json b/shared/package.json index 62a90da..7262299 100644 --- a/shared/package.json +++ b/shared/package.json @@ -1,7 +1,7 @@ { "name": "@uecko-presupuestador/shared", "private": false, - "version": "1.1.5", + "version": "1.1.8", "main": "./index.ts", "author": "Rodax Software ", "license": "ISC", @@ -29,4 +29,4 @@ "ts-jest": "^29.1.1", "typescript": "^5.5.4" } -} +} \ No newline at end of file