From e70706389ae119fb00f2fe18f6e5fa43cd5e4779 Mon Sep 17 00:00:00 2001 From: David Arranz Date: Thu, 8 Oct 2026 19:46:43 +0200 Subject: [PATCH] v1.2.0 --- client/package.json | 2 +- .../{index-CxhwxQ3i.js => index-DanLbc5g.js} | 4 +- .../{index-D4r7ZFDJ.js => index-oEuJT1z9.js} | 153 +++++++++++------- dist/client/index.html | 2 +- package.json | 2 +- server/package.json | 2 +- shared/package.json | 2 +- 7 files changed, 102 insertions(+), 65 deletions(-) rename dist/client/assets/{index-CxhwxQ3i.js => index-DanLbc5g.js} (99%) rename dist/client/assets/{index-D4r7ZFDJ.js => index-oEuJT1z9.js} (68%) diff --git a/client/package.json b/client/package.json index 4068658..9d4b62b 100644 --- a/client/package.json +++ b/client/package.json @@ -1,7 +1,7 @@ { "name": "@uecko-presupuestador/client", "private": true, - "version": "1.1.9", + "version": "1.2.0", "author": "Rodax Software ", "type": "module", "scripts": { diff --git a/dist/client/assets/index-CxhwxQ3i.js b/dist/client/assets/index-DanLbc5g.js similarity index 99% rename from dist/client/assets/index-CxhwxQ3i.js rename to dist/client/assets/index-DanLbc5g.js index 4b06120..1680dac 100644 --- a/dist/client/assets/index-CxhwxQ3i.js +++ b/dist/client/assets/index-DanLbc5g.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-D4r7ZFDJ.js","assets/index-DtTssDoC.css"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-oEuJT1z9.js","assets/index-DtTssDoC.css"])))=>i.map(i=>d[i]); var _le=Object.defineProperty;var Aj=t=>{throw TypeError(t)};var xle=(t,e,n)=>e in t?_le(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var He=(t,e,n)=>xle(t,typeof e!="symbol"?e+"":e,n),xP=(t,e,n)=>e.has(t)||Aj("Cannot "+n);var C=(t,e,n)=>(xP(t,e,"read from private field"),n?n.call(t):e.get(t)),z=(t,e,n)=>e.has(t)?Aj("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),$=(t,e,n,r)=>(xP(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),B=(t,e,n)=>(xP(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 f5(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 Sle(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 h5={exports:{}},v1={},p5={exports:{}},Lt={};/** * @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=Mn._internalPadding*this.parentScale;return n.updateEdited({rect:this.getRect(i,i),popupContent:C(this,Hi)}),r}resetAnnotationElement(n){super.resetAnnotationElement(n),n.resetEdited()}};bw=new WeakMap,ww=new WeakMap,_w=new WeakMap,xw=new WeakMap,Sw=new WeakMap,la=new WeakMap,Hi=new WeakMap,Ew=new WeakMap,Vi=new WeakMap,Og=new WeakMap,Ar=new WeakSet,$J=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,uE).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:pt.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})},FJ=function(n){const r=i=>{$(this,la,this.editorDiv.style.color=i)},s=C(this,la);this.addCommands({cmd:r.bind(this,n),undo:r.bind(this,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:pt.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},jJ=function(){var r;const n=[];this.editorDiv.normalize();for(const s of this.editorDiv.childNodes)n.push(B(r=Mn,$c,dE).call(r,s));return n.join(` `)},uE=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()},$c=new WeakSet,dE=function(n){return(n.nodeType===Node.TEXT_NODE?n.nodeValue:n.innerText).replaceAll(AS,"")},fE=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)}},zJ=function(){return C(this,Hi).replaceAll(" "," ")},AM=function(n){return n.replaceAll(" "," ")},BJ=function(n){const{value:r,fontSize:s,color:i,pageIndex:a}=C(this,Og);return this._hasBeenMoved||n.value!==r||n.fontSize!==s||n.color.some((o,c)=>o!==i[c])||n.pageIndex!==a},z(Mn,$c),He(Mn,"_freeTextDefaultContent",""),He(Mn,"_internalPadding",0),He(Mn,"_defaultColor",null),He(Mn,"_defaultFontSize",10),He(Mn,"_type","freetext"),He(Mn,"_editorType",Wt.FREETEXT);let CM=Mn;var Cw,Ju,ca,Xs,UJ,hE,HJ,VJ,PM;class RM{constructor(e,n=0,r=0,s=!0){z(this,Xs);z(this,Cw);z(this,Ju,[]);z(this,ca,[]);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,Cw,{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,PM).call(this,n)),B(this,Xs,HJ).call(this,n)):(B(this,Xs,VJ).call(this,n),e.push(...B(this,Xs,PM).call(this,n)));return B(this,Xs,UJ).call(this,e)}}Cw=new WeakMap,Ju=new WeakMap,ca=new WeakMap,Xs=new WeakSet,UJ=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 SFe(s,C(this,Cw))},hE=function(e){const n=C(this,ca);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,ca)[s];if(i!==e)break;if(i===e&&a===n){C(this,ca).splice(s,1);return}}},PM=function(e){const[n,r,s]=e,i=[[n,r,s]],a=B(this,Xs,hE).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 WJ{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 kM}}var Aw,Lg;class SFe extends WJ{constructor(n,r){super();z(this,Aw);z(this,Lg);$(this,Lg,n),$(this,Aw,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,nl),n=C(this,yc),r=C(this,Bt),s=r.subarray(4,6),i=r.subarray(16,18),[a,o,c,u]=C(this,tl),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 kM(h,f,C(this,tl),C(this,Fg),C(this,Ig),C(this,$g))}};tl=new WeakMap,yc=new WeakMap,Ig=new WeakMap,$g=new WeakMap,nl=new WeakMap,Bt=new WeakMap,ph=new WeakMap,mh=new WeakMap,Rw=new WeakMap,Pw=new WeakMap,Fg=new WeakMap,jg=new WeakMap,ed=new WeakMap,Tw=new WeakMap,p1=new WeakMap,m1=new WeakMap,kw=new WeakSet,TM=function(){const e=C(this,Bt).subarray(4,6),n=C(this,Bt).subarray(16,18),[r,s,i,a]=C(this,tl);return[(C(this,ph)+(e[0]-n[0])/2-r)/i,(C(this,mh)+(e[1]-n[1])/2-s)/a,(C(this,ph)+(n[0]-e[0])/2-r)/i,(C(this,mh)+(n[1]-e[1])/2-s)/a]},z(Xl,Tw,8),z(Xl,p1,2),z(Xl,m1,C(Xl,Tw)+C(Xl,p1));let WC=Xl;var zg,gh,bc,Dw,Wi,Nw,gr,bi,Qy,Zy,qJ;class kM extends WJ{constructor(n,r,s,i,a,o){super();z(this,bi);z(this,zg);z(this,gh,null);z(this,bc);z(this,Dw);z(this,Wi);z(this,Nw);z(this,gr);$(this,gr,n),$(this,Wi,r),$(this,zg,s),$(this,Nw,i),$(this,bc,a),$(this,Dw,o),B(this,bi,qJ).call(this,o);const{x:c,y:u,width:f,height:l}=C(this,gh);for(let d=0,m=n.length;d-1?($(this,qi,!0),B(this,Ot,OM).call(this,n),B(this,Ot,Jy).call(this)):($(this,Vg,n.anchorNode),$(this,Fw,n.anchorOffset),$(this,jw,n.focusNode),$(this,zw,n.focusOffset),B(this,Ot,MM).call(this),B(this,Ot,Jy).call(this),this.rotate(this.rotation))}static get _keyboardManager(){const n=nn.prototype;return Gt(this,"_keyboardManager",new $_([[["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,qi)?"free_highlight":"highlight",color:this._uiManager.highlightColorNames.get(this.color),thickness:C(this,rl),methodOfCreation:C(this,Bw)}}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;pn.initialize(n,r),nn._defaultColor||(nn._defaultColor=((s=r.highlightColors)==null?void 0:s.values().next().value)||"#fff066")}static updateDefaultParams(n,r){switch(n){case pt.HIGHLIGHT_DEFAULT_COLOR:nn._defaultColor=r;break;case pt.HIGHLIGHT_THICKNESS:nn._defaultThickness=r;break}}translateInPage(n,r){}get toolbarPosition(){return C(this,qg)}updateParams(n,r){switch(n){case pt.HIGHLIGHT_COLOR:B(this,Ot,YJ).call(this,r);break;case pt.HIGHLIGHT_THICKNESS:B(this,Ot,XJ).call(this,r);break}}static get defaultPropertiesToUpdate(){return[[pt.HIGHLIGHT_DEFAULT_COLOR,nn._defaultColor],[pt.HIGHLIGHT_THICKNESS,nn._defaultThickness]]}get propertiesToUpdate(){return[[pt.HIGHLIGHT_COLOR,this.color||nn._defaultColor],[pt.HIGHLIGHT_THICKNESS,C(this,rl)||nn._defaultThickness],[pt.HIGHLIGHT_FREE,C(this,qi)]]}async addEditToolbar(){const n=await super.addEditToolbar();return n?(this._uiManager.highlightColors&&($(this,Wg,new qC({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,LM).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,LM).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,qi)?(n=(n-this.rotation+360)%360,s=B(i=nn,No,om).call(i,C(this,fa).box,n)):s=B(a=nn,No,om).call(a,this,n),r.rotate(C(this,Bs),n),r.rotate(C(this,Mr),n),r.updateBox(C(this,Bs),s),r.updateBox(C(this,Mr),B(o=nn,No,om).call(o,C(this,xo).box,n))}render(){if(this.div)return this.div;const n=super.render();C(this,Gg)&&(n.setAttribute("aria-label",C(this,Gg)),n.setAttribute("role","mark")),C(this,qi)?n.classList.add("free"):this.div.addEventListener("keydown",C(this,g1),{signal:this._uiManager._signal});const r=$(this,bh,document.createElement("div"));n.append(r),r.setAttribute("aria-hidden","true"),r.className="internal",r.style.clipPath=C(this,yh);const[s,i]=this.parentDimensions;return this.setDims(this.width*s,this.height*i),BC(this,C(this,bh),["pointerover","pointerleave"]),this.enableEditing(),n}pointerover(){this.parent.drawLayer.addClass(C(this,Mr),"hovered")}pointerleave(){this.parent.drawLayer.removeClass(C(this,Mr),"hovered")}_moveCaret(n){switch(this.parent.unselect(this),n){case 0:case 2:B(this,Ot,pE).call(this,!0);break;case 1:case 3:B(this,Ot,pE).call(this,!1);break}}select(){var n,r;super.select(),C(this,Mr)&&((n=this.parent)==null||n.drawLayer.removeClass(C(this,Mr),"hovered"),(r=this.parent)==null||r.drawLayer.addClass(C(this,Mr),"selected"))}unselect(){var n;super.unselect(),C(this,Mr)&&((n=this.parent)==null||n.drawLayer.removeClass(C(this,Mr),"selected"),C(this,qi)||B(this,Ot,pE).call(this,!1))}get _mustFixPosition(){return!C(this,qi)}show(n=this._isVisible){super.show(n),this.parent&&(this.parent.drawLayer.show(C(this,Bs),n),this.parent.drawLayer.show(C(this,Mr),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,tee).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,nee).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 WC({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,wh,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,yh,s),this.parent.drawLayer.finalizeLine(r,n),$(this,Mr,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=nn,No,om).call(l,C(this,fa).box,(m-this.rotation+360)%360)),this.parent.drawLayer.updateLine(C(this,Mr),C(this,xo)),this.parent.drawLayer.updateBox(C(this,Mr),B(d=nn,No,om).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,qg,[(f[0]-a)/c,(f[1]-o)/u])},YJ=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:pt.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.highlightColorNames.get(n)},!0)},XJ=function(n){const r=C(this,rl),s=i=>{$(this,rl,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:pt.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:n},!0)},QJ=function(n){if(!C(this,qi))return;B(this,Ot,OM).call(this,{highlightOutlines:C(this,fa).getNewOutline(n/2)}),this.fixAndSetPosition();const[r,s]=this.parentDimensions;this.setDims(this.width*r,this.height*s)},LM=function(){C(this,Bs)===null||!this.parent||(this.parent.drawLayer.remove(C(this,Bs)),$(this,Bs,null),this.parent.drawLayer.remove(C(this,Mr)),$(this,Mr,null))},Jy=function(n=this.parent){C(this,Bs)===null&&({id:vs(this,Bs)._,clipPathId:vs(this,yh)._}=n.drawLayer.highlight(C(this,fa),this.color,C(this,wh)),$(this,Mr,n.drawLayer.highlightOutline(C(this,xo))),C(this,bh)&&(C(this,bh).style.clipPath=C(this,yh)))},No=new WeakSet,om=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}},ZJ=function(n){nn._keyboardManager.exec(this,n)},pE=function(n){if(!C(this,Vg))return;const r=window.getSelection();n?r.setPosition(C(this,Vg),C(this,Fw)):r.setPosition(C(this,jw),C(this,zw))},eb=function(){return C(this,qi)?this.rotation:0},JJ=function(){if(C(this,qi))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},eee=function(n){return C(this,fa).serialize(n,B(this,Ot,eb).call(this))},tee=function(n,r){this._freeHighlight.add(r)&&n.drawLayer.updatePath(this._freeHighlightId,this._freeHighlight)},nee=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(nn,No),He(nn,"_defaultColor",null),He(nn,"_defaultOpacity",1),He(nn,"_defaultThickness",12),He(nn,"_l10nPromise"),He(nn,"_type","highlight"),He(nn,"_editorType",Wt.HIGHLIGHT),He(nn,"_freeHighlightId",-1),He(nn,"_freeHighlight",null),He(nn,"_freeHighlightClipId","");let GC=nn;var _h,xh,Uw,Hw,Vw,Sh,sl,wc,So,Eh,Ch,_c,Ah,Rh,nd,ze,ree,see,iee,oee,$M,aee,FM,lee,cee,uee,dee,fee,hf,jM,mE,gE,am,zM,vE,Wc,hee,BM,pee,mee,UM,yE,tb;const Qn=class Qn extends pn{constructor(n){super({...n,name:"inkEditor"});z(this,ze);z(this,_h,0);z(this,xh,0);z(this,Uw,this.canvasPointermove.bind(this));z(this,Hw,this.canvasPointerleave.bind(this));z(this,Vw,this.canvasPointerup.bind(this));z(this,Sh,this.canvasPointerdown.bind(this));z(this,sl,null);z(this,wc,new Path2D);z(this,So,!1);z(this,Eh,!1);z(this,Ch,!1);z(this,_c,null);z(this,Ah,0);z(this,Rh,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){pn.initialize(n,r)}static updateDefaultParams(n,r){switch(n){case pt.INK_THICKNESS:Qn._defaultThickness=r;break;case pt.INK_COLOR:Qn._defaultColor=r;break;case pt.INK_OPACITY:Qn._defaultOpacity=r/100;break}}updateParams(n,r){switch(n){case pt.INK_THICKNESS:B(this,ze,ree).call(this,r);break;case pt.INK_COLOR:B(this,ze,see).call(this,r);break;case pt.INK_OPACITY:B(this,ze,iee).call(this,r);break}}static get defaultPropertiesToUpdate(){return[[pt.INK_THICKNESS,Qn._defaultThickness],[pt.INK_COLOR,Qn._defaultColor||pn._defaultLineColor],[pt.INK_OPACITY,Math.round(Qn._defaultOpacity*100)]]}get propertiesToUpdate(){return[[pt.INK_THICKNESS,this.thickness||Qn._defaultThickness],[pt.INK_COLOR,this.color||Qn._defaultColor||pn._defaultLineColor],[pt.INK_OPACITY,Math.round(100*(this.opacity??Qn._defaultOpacity))]]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.canvas||(B(this,ze,mE).call(this),B(this,ze,gE).call(this)),this.isAttachedToDOM||(this.parent.add(this),B(this,ze,am).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,sl)&&(clearTimeout(C(this,sl)),$(this,sl,null)),(n=C(this,_c))==null||n.disconnect(),$(this,_c,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,Sh),{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,Sh)))}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,aee).call(this,n.offsetX,n.offsetY))}canvasPointermove(n){n.preventDefault(),B(this,ze,FM).call(this,n.offsetX,n.offsetY)}canvasPointerup(n){n.preventDefault(),B(this,ze,jM).call(this,n)}canvasPointerleave(n){B(this,ze,jM).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,oee).call(this);if(this.setAt(s,i,0,0),this.setDims(a,o),B(this,ze,mE).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,Ch,!0),B(this,ze,am).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,gE).call(this),this.div}setDimensions(n,r){const s=Math.round(n),i=Math.round(r);if(C(this,Ah)===s&&C(this,Rh)===i)return;$(this,Ah,s),$(this,Rh,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,zM).call(this,n,r),B(this,ze,am).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 OJ)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,Ah,Math.round(c)),$(i,Rh,Math.round(u));const{paths:d,rect:m,rotation:p}=n;for(let{bezier:w}of d){w=B(y=Qn,Wc,pee).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:pt.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})},see=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:pt.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})},iee=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:pt.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})},oee=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]}},$M=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}${G$e(s)}`},aee=function(n,r){const s=this._uiManager._signal;this.canvas.addEventListener("contextmenu",Ei,{signal:s}),this.canvas.addEventListener("pointerleave",C(this,Hw),{signal:s}),this.canvas.addEventListener("pointermove",C(this,Uw),{signal:s}),this.canvas.addEventListener("pointerup",C(this,Vw),{signal:s}),this.canvas.removeEventListener("pointerdown",C(this,Sh)),this.isEditing=!0,C(this,Ch)||($(this,Ch,!0),B(this,ze,am).call(this),this.thickness||(this.thickness=Qn._defaultThickness),this.color||(this.color=Qn._defaultColor||pn._defaultLineColor),this.opacity??(this.opacity=Qn._defaultOpacity)),this.currentPath.push([n,r]),$(this,Eh,!1),B(this,ze,$M).call(this),$(this,nd,()=>{B(this,ze,uee).call(this),C(this,nd)&&window.requestAnimationFrame(C(this,nd))}),window.requestAnimationFrame(C(this,nd))},FM=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,wc);if(a.push([n,r]),$(this,Eh,!0),a.length<=2){o.moveTo(...a[0]),o.lineTo(n,r);return}a.length===3&&($(this,wc,o=new Path2D),o.moveTo(...a[0])),B(this,ze,dee).call(this,o,...a.at(-3),...a.at(-2),n,r)},lee=function(){if(this.currentPath.length===0)return;const n=this.currentPath.at(-1);C(this,wc).lineTo(...n)},cee=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,FM).call(this,n,r),B(this,ze,lee).call(this);let s;if(this.currentPath.length!==1)s=B(this,ze,fee).call(this);else{const u=[n,r];s=[[u,u.slice(),u.slice(),u]]}const i=C(this,wc),a=this.currentPath;this.currentPath=[],$(this,wc,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,mE).call(this),B(this,ze,gE).call(this)),B(this,ze,tb).call(this))};this.addCommands({cmd:o,undo:c,mustExec:!0})},uee=function(){if(!C(this,Eh))return;$(this,Eh,!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,wc)),a.restore()},dee=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)},fee=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,sl,null),this.canvas.removeEventListener("contextmenu",Ei)},10)),B(this,ze,cee).call(this,n.offsetX,n.offsetY),this.addToAnnotationStorage(),this.setInBackground()},mE=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")},gE=function(){$(this,_c,new ResizeObserver(n=>{const r=n[0].contentRect;r.width&&r.height&&this.setDimensions(r.width,r.height)})),C(this,_c).observe(this.div),this._uiManager._signal.addEventListener("abort",()=>{var n;(n=C(this,_c))==null||n.disconnect(),$(this,_c,null)},{once:!0})},am=function(){if(!C(this,Ch))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,vE).call(this)},zM=function(n,r){const s=B(this,ze,yE).call(this),i=(n-s)/C(this,xh),a=(r-s)/C(this,_h);this.scaleFactor=Math.min(i,a)},vE=function(){const n=B(this,ze,yE).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,hee=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(Wt.STAMP,{bitmapFile:n.getAsFile()})}remove(){var n,r;C(this,as)&&($(this,os,null),this._uiManager.imageManager.deleteId(C(this,as)),(n=C(this,il))==null||n.remove(),$(this,il,null),(r=C(this,Sc))==null||r.disconnect(),$(this,Sc,null),C(this,ol)&&(clearTimeout(C(this,ol)),$(this,ol,null))),super.remove()}rebuild(){if(!this.parent){C(this,as)&&B(this,en,bE).call(this);return}super.rebuild(),this.div!==null&&(C(this,as)&&C(this,il)===null&&B(this,en,bE).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,xc)||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,en,VM).call(this):B(this,en,bE).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,il)}static deserialize(n,r,s){if(n instanceof LJ)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,xc,o),$(i,ha,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:Wt.STAMP,bitmapId:C(this,as),pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:C(this,ha),structTreeParentId:this._structTreeParentId};if(n)return s.bitmapUrl=B(this,en,wE).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,ha)?(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,en,wE).call(this,!1);else if(C(this,ha)){const c=r.stamps.get(C(this,as));o>c.area&&(c.area=o,c.serialized.bitmap.close(),c.serialized.bitmap=B(this,en,wE).call(this,!1))}return s}};os=new WeakMap,as=new WeakMap,rd=new WeakMap,xc=new WeakMap,sd=new WeakMap,Kg=new WeakMap,il=new WeakMap,Sc=new WeakMap,ol=new WeakMap,ha=new WeakMap,Ww=new WeakMap,en=new WeakSet,nb=function(n,r=!1){if(!n){this.remove();return}$(this,os,n.bitmap),r||($(this,as,n.id),$(this,ha,n.isSvg)),n.file&&$(this,Kg,n.file.name),B(this,en,VM).call(this)},rb=function(){$(this,rd,null),this._uiManager.enableWaiting(!1),C(this,il)&&this.div.focus()},bE=function(){if(C(this,as)){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(C(this,as)).then(s=>B(this,en,nb).call(this,s,!0)).finally(()=>B(this,en,rb).call(this));return}if(C(this,xc)){const s=C(this,xc);$(this,xc,null),this._uiManager.enableWaiting(!0),$(this,rd,this._uiManager.imageManager.getFromUrl(s).then(i=>B(this,en,nb).call(this,i)).finally(()=>B(this,en,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,en,nb).call(this,i)).finally(()=>B(this,en,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,en,nb).call(this,i)}s()},{signal:r}),n.addEventListener("cancel",()=>{this.remove(),s()},{signal:r})}).finally(()=>B(this,en,rb).call(this))),n.click()},VM=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,il,document.createElement("canvas"));n.append(f),n.hidden=!1,B(this,en,WM).call(this,r,s),B(this,en,yee).call(this),C(this,Ww)||(this.parent.addUndoableEditor(this),$(this,Ww,!0)),this._reportTelemetry({action:"inserted_image"}),C(this,Kg)&&f.setAttribute("aria-label",C(this,Kg))},gee=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,ol)!==null&&clearTimeout(C(this,ol)),$(this,ol,setTimeout(()=>{$(this,ol,null),B(this,en,WM).call(this,n,r)},200))},vee=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},WM=function(n,r){n=Math.ceil(n),r=Math.ceil(r);const s=C(this,il);if(!s||s.width===n&&s.height===r)return;s.width=n,s.height=r;const i=C(this,ha)?C(this,os):B(this,en,vee).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)},wE=function(n){if(n){if(C(this,ha)){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,ha)){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))},yee=function(){this._uiManager._signal&&($(this,Sc,new ResizeObserver(n=>{const r=n[0].contentRect;r.width&&r.height&&B(this,en,gee).call(this,r.width,r.height)})),C(this,Sc).observe(this.div),this._uiManager._signal.addEventListener("abort",()=>{var n;(n=C(this,Sc))==null||n.disconnect(),$(this,Sc,null)},{once:!0}))},He(Eb,"_type","stamp"),He(Eb,"_editorType",Wt.STAMP);let HM=Eb;var Ph,Yg,al,Th,Ec,Cc,Ac,Gi,id,Xg,Qg,Us,rt,od,us,bee,GM,KM,YM,_E;const Xo=class Xo{constructor({uiManager:e,pageIndex:n,div:r,accessibilityManager:s,annotationLayer:i,drawLayer:a,textLayer:o,viewport:c,l10n:u}){z(this,us);z(this,Ph);z(this,Yg,!1);z(this,al,null);z(this,Th,null);z(this,Ec,null);z(this,Cc,null);z(this,Ac,null);z(this,Gi,new Map);z(this,id,!1);z(this,Xg,!1);z(this,Qg,!1);z(this,Us,null);z(this,rt);const f=[...C(Xo,od).values()];if(!Xo._initialized){Xo._initialized=!0;for(const l of f)l.initialize(u,e)}e.registerEditorTypes(f),$(this,rt,e),this.pageIndex=n,this.div=r,$(this,Ph,s),$(this,al,i),this.viewport=c,$(this,Us,o),this.drawLayer=a,C(this,rt).addLayer(this)}get isEmpty(){return C(this,Gi).size===0}get isInvisible(){return this.isEmpty&&C(this,rt).getMode()===Wt.NONE}updateToolbar(e){C(this,rt).updateToolbar(e)}updateMode(e=C(this,rt).getMode()){switch(B(this,us,_E).call(this),e){case Wt.NONE:this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),this.disableClick();return;case Wt.INK:this.addInkEditorIfNeeded(!1),this.disableTextSelection(),this.togglePointerEvents(!0),this.disableClick();break;case Wt.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(Xo,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()!==Wt.INK)return;if(!e){for(const r of C(this,Gi).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,al))==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,Gi).values())r.enableEditing(),r.show(!0),r.annotationElementId&&(C(this,rt).removeChangedExistingAnnotation(r),e.add(r.annotationElementId));if(!C(this,al))return;const n=C(this,al).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,Gi).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,al)){const i=C(this,al).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,_E).call(this),this.isEmpty&&(this.div.hidden=!0);const{classList:r}=this.div;for(const i of C(Xo,od).values())r.remove(`${i._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),$(this,Qg,!1)}getEditableAnnotation(e){var n;return((n=C(this,al))==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,Cc)&&($(this,Cc,B(this,us,bee).bind(this)),C(this,Us).div.addEventListener("pointerdown",C(this,Cc),{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,Cc)&&(C(this,Us).div.removeEventListener("pointerdown",C(this,Cc)),$(this,Cc,null),C(this,Us).div.classList.remove("highlighting"))}enableClick(){if(C(this,Ec))return;const e=C(this,rt)._signal;$(this,Ec,this.pointerdown.bind(this)),$(this,Th,this.pointerup.bind(this)),this.div.addEventListener("pointerdown",C(this,Ec),{signal:e}),this.div.addEventListener("pointerup",C(this,Th),{signal:e})}disableClick(){C(this,Ec)&&(this.div.removeEventListener("pointerdown",C(this,Ec)),this.div.removeEventListener("pointerup",C(this,Th)),$(this,Ec,null),$(this,Th,null))}attach(e){C(this,Gi).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,Gi).delete(e.id),(n=C(this,Ph))==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),pn.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,Ac)&&(e._focusEventsAllowed=!1,$(this,Ac,setTimeout(()=>{$(this,Ac,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,Ph))==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,GM))==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,YM).call(this),i=this.getNextId(),a=B(this,us,KM).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(Xo,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,KM).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,YM).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()===Wt.STAMP){C(this,rt).unselectAll();return}this.createAndAddNewEditor(e,!1)}}pointerdown(e){if(C(this,rt).getMode()===Wt.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,Ac)&&(clearTimeout(C(this,Ac)),$(this,Ac,null));for(const r of C(this,Gi).values())(n=C(this,Ph))==null||n.removePointerInTextLayer(r.contentDiv),r.setParent(null),r.isAttachedToDOM=!1,r.div.remove();this.div=null,C(this,Gi).clear(),C(this,rt).removeLayer(this)}render({viewport:e}){this.viewport=e,tp(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,_E).call(this);const n=this.viewport.rotation,r=e.rotation;if(this.viewport=e,tp(this.div,{rotation:r}),n!==r)for(const s of C(this,Gi).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}};Ph=new WeakMap,Yg=new WeakMap,al=new WeakMap,Th=new WeakMap,Ec=new WeakMap,Cc=new WeakMap,Ac=new WeakMap,Gi=new WeakMap,id=new WeakMap,Xg=new WeakMap,Qg=new WeakMap,Us=new WeakMap,rt=new WeakMap,od=new WeakMap,us=new WeakSet,bee=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()}},GM=function(){return C(Xo,od).get(C(this,rt).getMode())},KM=function(e){const n=C(this,us,GM);return n?new n.prototype.constructor(e):null},YM=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}},_E=function(){$(this,Xg,!0);for(const e of C(this,Gi).values())e.isEmpty()&&e.remove();$(this,Xg,!1)},He(Xo,"_initialized",!1),z(Xo,od,new Map([CM,IM,HM,GC].map(e=>[e._editorType,e])));let qM=Xo;var ll,qw,Or,ad,Gw,QM,ap,ZM,wee;const ts=class ts{constructor({pageIndex:e}){z(this,ap);z(this,ll,null);z(this,qw,0);z(this,Or,new Map);z(this,ad,new Map);this.pageIndex=e}setParent(e){if(!C(this,ll)){$(this,ll,e);return}if(C(this,ll)!==e){if(C(this,Or).size>0)for(const n of C(this,Or).values())n.remove(),e.append(n);$(this,ll,e)}}static get _svgFactory(){return Gt(this,"_svgFactory",new H$)}highlight(e,n,r,s=!1){const i=vs(this,qw)._++,a=B(this,ap,ZM).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,ap,wee).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,Or).set(i,a),{id:i,clipPathId:`url(#${f})`}}highlightOutline(e){const n=vs(this,qw)._++,r=B(this,ap,ZM).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,Or).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,Or).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,QM).call(r,C(this,Or).get(e),n)}show(e,n){C(this,Or).get(e).classList.toggle("hidden",!n)}rotate(e,n){C(this,Or).get(e).setAttribute("data-main-rotation",n)}changeColor(e,n){C(this,Or).get(e).setAttribute("fill",n)}changeOpacity(e,n){C(this,Or).get(e).setAttribute("fill-opacity",n)}addClass(e,n){C(this,Or).get(e).classList.add(n)}removeClass(e,n){C(this,Or).get(e).classList.remove(n)}remove(e){C(this,ll)!==null&&(C(this,Or).get(e).remove(),C(this,Or).delete(e))}destroy(){$(this,ll,null);for(const e of C(this,Or).values())e.remove();C(this,Or).clear()}};ll=new WeakMap,qw=new WeakMap,Or=new WeakMap,ad=new WeakMap,Gw=new WeakSet,QM=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}%`},ap=new WeakSet,ZM=function(e){var r;const n=ts._svgFactory.create(1,1,!0);return C(this,ll).append(n),n.setAttribute("aria-hidden",!0),B(r=ts,Gw,QM).call(r,n,e),n},wee=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 XM=ts;var EFe=ht.AbortException,CFe=ht.AnnotationEditorLayer,AFe=ht.AnnotationEditorParamsType,RFe=ht.AnnotationEditorType,PFe=ht.AnnotationEditorUIManager,_ee=ht.AnnotationLayer,xee=ht.AnnotationMode,TFe=ht.CMapCompressionType,kFe=ht.ColorPicker,DFe=ht.DOMSVGFactory,NFe=ht.DrawLayer,MFe=ht.FeatureTest,Q$=ht.GlobalWorkerOptions,OFe=ht.ImageKind,LFe=ht.InvalidPDFException,IFe=ht.MissingPDFException,$Fe=ht.OPS,FFe=ht.Outliner,jFe=ht.PDFDataRangeTransport,zFe=ht.PDFDateString,BFe=ht.PDFWorker,UFe=ht.PasswordResponses,HFe=ht.PermissionFlag,VFe=ht.PixelsPerInch,WFe=ht.RenderingCancelledException,See=ht.TextLayer,qFe=ht.UnexpectedResponseException,GFe=ht.Util,KFe=ht.VerbosityLevel,YFe=ht.XfaLayer,XFe=ht.build,QFe=ht.createValidAbsoluteUrl,ZFe=ht.fetchData,Eee=ht.getDocument,JFe=ht.getFilenameFromUrl,eje=ht.getPdfFilenameFromUrl,tje=ht.getXfaPageViewport,nje=ht.isDataScheme,rje=ht.isPdfFile,sje=ht.noContextMenu,ije=ht.normalizeUnicode,oje=ht.renderTextLayer,aje=ht.setLayerDimensions,lje=ht.shadow,cje=ht.updateTextLayer,Cee=ht.version;const uje=Object.freeze(Object.defineProperty({__proto__:null,AbortException:EFe,AnnotationEditorLayer:CFe,AnnotationEditorParamsType:AFe,AnnotationEditorType:RFe,AnnotationEditorUIManager:PFe,AnnotationLayer:_ee,AnnotationMode:xee,CMapCompressionType:TFe,ColorPicker:kFe,DOMSVGFactory:DFe,DrawLayer:NFe,FeatureTest:MFe,GlobalWorkerOptions:Q$,ImageKind:OFe,InvalidPDFException:LFe,MissingPDFException:IFe,OPS:$Fe,Outliner:FFe,PDFDataRangeTransport:jFe,PDFDateString:zFe,PDFWorker:BFe,PasswordResponses:UFe,PermissionFlag:HFe,PixelsPerInch:VFe,RenderingCancelledException:WFe,TextLayer:See,UnexpectedResponseException:qFe,Util:GFe,VerbosityLevel:KFe,XfaLayer:YFe,build:XFe,createValidAbsoluteUrl:QFe,fetchData:ZFe,getDocument:Eee,getFilenameFromUrl:JFe,getPdfFilenameFromUrl:eje,getXfaPageViewport:tje,isDataScheme:nje,isPdfFile:rje,noContextMenu:sje,normalizeUnicode:ije,renderTextLayer:oje,setLayerDimensions:aje,shadow:lje,updateTextLayer:cje,version:Cee},Symbol.toStringTag,{value:"Module"}));var Wr=function(t,e,n){if(n||arguments.length===2)for(var r=0,s=e.length,i;r{Rn(this.pdfDocument),Rn(e),typeof e=="string"?this.pdfDocument.getDestination(e).then(n):Array.isArray(e)?n(e):e.then(n)}).then(n=>{Rn(Array.isArray(n));const r=n[0];new Promise(s=>{Rn(this.pdfDocument),r instanceof Object?this.pdfDocument.getPageIndex(r).then(i=>{s(i)}).catch(()=>{Rn(!1)}):typeof r=="number"?s(r):Rn(!1)}).then(s=>{const i=s+1;Rn(this.pdfViewer),Rn(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;Rn(this.pdfViewer),Rn(e>=1&&e<=this.pagesCount),this.pdfViewer.scrollPageIntoView({pageIndex:n,pageNumber:e})}addLinkAttributes(e,n,r){e.href=n,e.rel=this.externalLinkRel||Nje,e.target=r?"_blank":this.externalLinkTarget||""}getDestinationHash(){return"#"}getAnchorUrl(){return"#"}setHash(){}executeNamedAction(){}cachePageRef(){}isPageVisible(){return!0}isPageCached(){return!0}executeSetOCGState(){}}const vU={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},eR=typeof document<"u",Pee=eR&&window.location.protocol==="file:";function Oje(t){return typeof t<"u"}function af(t){return Oje(t)&&t!==null}function Lje(t){return typeof t=="string"}function Ije(t){return t instanceof ArrayBuffer}function $je(t){return Rn(eR),t instanceof Blob}function JM(t){return Lje(t)&&/^data:/.test(t)}function yU(t){Rn(JM(t));const[e="",n=""]=t.split(",");return e.split(";").indexOf("base64")!==-1?atob(n):unescape(n)}function Fje(){return eR&&window.devicePixelRatio||1}const Tee="On Chromium based browsers, you can use --allow-file-access-from-files flag for debugging purposes.";function bU(){Ps(!Pee,`Loading PDF as base64 strings/URLs may not work on protocols other than HTTP/HTTPS. ${Tee}`)}function jje(){Ps(!Pee,`Loading PDF.js worker may not work on protocols other than HTTP/HTTPS. ${Tee}`)}function sp(t){t!=null&&t.cancel&&t.cancel()}function eO(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 zje(t){return t.name==="RenderingCancelledException"}function Bje(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 Uje(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(Uje,{value:void 0,error:void 0})}var Hje=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())})},wU=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 vU.NEED_PASSWORD:{const n=prompt("Enter the password to open this PDF file.");t(n);break}case vU.INCORRECT_PASSWORD:{const n=prompt("Invalid password. Please try again.");t(n);break}}};function _U(t){return typeof t=="object"&&t!==null&&("data"in t||"range"in t||"url"in t)}const qje=_.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=Wje,onSourceError:v,onSourceSuccess:w,options:x,renderMode:A,rotate:k}=e,R=wU(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:M}=E,[L,I]=pv(),{value:F,error:U}=L,Y=_.useRef(new Mje),V=_.useRef([]),H=_.useRef(void 0),ee=_.useRef(void 0);c&&c!==H.current&&_U(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 yt=V.current[Qe];if(yt){yt.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 G(){M&&(Ps(!1,M.toString()),v&&v(M))}function K(){T({type:"RESET"})}_.useEffect(K,[c,T]);const Z=_.useCallback(()=>Hje(this,void 0,void 0,function*(){if(!c)return null;if(typeof c=="string")return JM(c)?{data:yU(c)}:(bU(),{url:c});if(c instanceof Vje)return{range:c};if(Ije(c))return{data:c};if(eR&&$je(c))return{data:yield Bje(c)};if(Rn(typeof c=="object"),Rn(_U(c)),"url"in c&&typeof c.url=="string"){if(JM(c.url)){const{url:ye}=c,$e=wU(c,["url"]),ut=yU(ye);return Object.assign({data:ut},$e)}bU()}return c}),[c]);_.useEffect(()=>{const ye=z_(Z());return ye.promise.then($e=>{T({type:"RESOLVE",value:$e})}).catch($e=>{T({type:"REJECT",error:$e})}),()=>{sp(ye)}},[Z,T]),_.useEffect(()=>{if(!(typeof D>"u")){if(D===!1){G();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=Eee($e);h&&(ut.onProgress=h),g&&(ut.onPassword=g);const Qe=ut;return Qe.promise.then(yt=>{I({type:"RESOLVE",value:yt})}).catch(yt=>{Qe.destroyed||I({type:"REJECT",error:yt})}),()=>{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(()=>Aee(R,()=>F),[R,F]);function Oe(){return P.jsx(Ree.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}):Oe():P.jsx(Hm,{type:"no-data",children:typeof d=="function"?d():d})}return P.jsx("div",Object.assign({className:up("react-pdf__Document",s),ref:u,style:{"--scale-factor":"1"}},_e,{children:Ne()}))});function kee(){return _.useContext(Ree)}function Dee(){for(var t=[],e=0;eXje(e),[e]),r=_.useMemo(()=>!tR(e)||Oee(e)?null:e.children.map((s,i)=>P.jsx(Iee,{node:s},i)),[e]);return P.jsx("span",Object.assign({className:t},n,{children:r}))}function nR(){return _.useContext(Nee)}function Qje(){const t=nR();Rn(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=z_(c.getStructTree()),m=d;return d.promise.then(p=>{s({type:"RESOLVE",value:p})}).catch(p=>{s({type:"REJECT",error:p})}),()=>sp(m)},[o,c,s]),_.useEffect(()=>{if(i!==void 0){if(i===!1){f();return}u()}},[i]),i?P.jsx(Iee,{className:"react-pdf__Page__structTree structTree",node:i}):null}const xU=xee;function Zje(t){const e=nR();Rn(e);const n=Object.assign(Object.assign({},e),t),{_className:r,canvasBackground:s,devicePixelRatio:i=Fje(),onRenderError:a,onRenderSuccess:o,page:c,renderForms:u,renderTextLayer:f,rotate:l,scale:d}=n,{canvasRef:m}=t;Rn(c);const p=_.useRef(null);function h(){c&&o&&o(eO(c,d))}function y(x){zje(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?xU.ENABLE_FORMS:xU.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),()=>sp(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:Dee(m,p),style:{display:"block",userSelect:"none"},children:f?P.jsx(Qje,{}):null})}function Jje(t){return"str"in t}function e3e(){const t=nR();Rn(t);const{customTextRenderer:e,onGetTextError:n,onGetTextSuccess:r,onRenderTextLayerError:s,onRenderTextLayerSuccess:i,page:a,pageIndex:o,pageNumber:c,rotate:u,scale:f}=t;Rn(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=z_(a.getTextContent()),D=T;return T.promise.then(M=>{d({type:"RESOLVE",value:M})}).catch(M=>{d({type:"REJECT",error:M})}),()=>sp(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}),M={container:T,textContentSource:D,viewport:R},L=new See(M),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(!Jje(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),()=>sp(I)},[e,x,w,a,o,c,m,R]),P.jsx("div",{className:up("react-pdf__Page__textContent","textLayer"),onMouseUp:k,onMouseDown:A,ref:h})}function t3e(){const t=kee(),e=nR();Rn(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;Rn(f),Rn(u),Rn(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=z_(u.getAnnotations()),D=T;return T.promise.then(M=>{h({type:"RESOLVE",value:M})}).catch(M=>{h({type:"REJECT",error:M})}),()=>{sp(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}),M={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 _ee(M).render(L),A()}catch(I){k(I)}return()=>{}},[y,r,s,u,f,l,R]),P.jsx("div",{className:up("react-pdf__Page__annotations","annotationLayer"),ref:v})}var n3e=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??SU;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 yt(){if(E){if(!_e||!Qe)return;E(eO(_e,Qe))}if(s&&H){if(!af(ye)||!Ne.current)return;H(ye,Ne.current)}}function En(){Oe&&(Ps(!1,Oe.toString()),R&&R(Oe))}_.useEffect(function(){Ae({type:"RESET"})},[Ae,V,ye]),_.useEffect(function(){if(!V||!$e)return;const Te=z_(V.getPage($e)),Ye=Te;return Te.promise.then(Pt=>{Ae({type:"RESOLVE",value:Pt})}).catch(Pt=>{Ae({type:"REJECT",error:Pt})}),()=>sp(Ye)},[Ae,V,$e]),_.useEffect(()=>{if(_e!==void 0){if(_e===!1){En();return}yt()}},[_e,Qe]);const Xt=_.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:M,onRenderSuccess:L,onRenderTextLayerError:I,onRenderTextLayerSuccess:F,page:_e,pageIndex:ye,pageNumber:$e,renderForms:re,renderTextLayer:G,rotate:ut,scale:Qe}:null,[r,i,f,l,g,v,w,x,A,k,T,D,M,L,I,F,_e,ye,$e,re,G,ut,Qe]),gn=_.useMemo(()=>Aee(ie,()=>_e&&(Qe?eO(_e,Qe):void 0)),[ie,_e,Qe]),Qt=`${ye}@${Qe}/${ut}`;function J(){switch(X){case"custom":return Rn(u),P.jsx(u,{},`${Qt}_custom`);case"none":return null;case"canvas":default:return P.jsx(Zje,{canvasRef:a},`${Qt}_canvas`)}}function fe(){return G?P.jsx(e3e,{},`${Qt}_text`):null}function ge(){return ee?P.jsx(t3e,{},`${Qt}_annotations`):null}function Pe(){return P.jsxs(Nee.Provider,{value:Xt,children:[J(),fe(),ge(),o]})}function Me(){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:up(r,c),"data-page-number":$e,ref:Dee(p,Ne),style:{"--scale-factor":`${Qe}`,backgroundColor:i||"white",position:"relative",minWidth:"min-content",minHeight:"min-content"}},gn,{children:Me()}))}jje();Q$.workerSrc="pdf.worker.mjs";Q$.workerSrc=`//unpkg.com/pdfjs-dist@${Cee}/build/pdf.worker.min.mjs`;const Yp=800,r3e={},JUe=({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)},[]);x$e(u,r3e,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(qje,{file:t,onLoadSuccess:h,loading:P.jsx(EZ,{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,Yp):Yp}]`,e?"cursor-pointer":""),children:[P.jsx(EU,{className:w&&o?"visible":"hidden",pageNumber:o,canvasBackground:"white",width:l?Math.min(l,Yp):Yp,onClick:()=>e?e():null},`page_${o}`),P.jsx(EU,{className:ce(w&&o?"hidden":"visible","text-center"),pageNumber:i,canvasBackground:"white",onRenderSuccess:p,width:l?Math.min(l,Yp):Yp,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:ft("common.go_to_prev_page")}),P.jsx(hL,{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:ft("common.go_to_next_page")}),P.jsx(r_,{className:"w-4 h-4"})]})]}),P.jsx("p",{className:"mt-4 text-sm font-medium text-center",children:ft("common.num_page_of_total",{count:i,total:r})})]})},CU=({children:t})=>{const e=Ud(),{i18n:n}=d$e(),r=_.useId(),{isSuccess:s,isLoading:i,data:{authenticated:a=!1,redirectTo:o="/login"}={}}=Bde(),{isSuccess:c,isLoading:u,isFetching:f,error:l,data:d}=HV({enabled:s&&a}),m=d==null?void 0:d.lang_code,p=n.resolvedLanguage??n.language,h=!m||p===m;return se.useEffect(()=>{c&&m&&!h&&n.changeLanguage(m)},[c,m,h,n]),i||u||c&&d===null&&f||c&&(d!=null&&d.id)&&!h?P.jsx(xs,{}):l?(console.error("Error loading profile:",l),P.jsx(dZ,{subtitle:l.message})):s&&!a||c&&!(d!=null&&d.id)?(console.debug("Not authenticated, redirecting to:",o),P.jsx(AQ,{to:o,state:{from:e},replace:!0})):P.jsx("div",{id:`${r}-${d==null?void 0:d.lang_code}`,children:t??null})},RS={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"}},e5e=_.forwardRef(({status:t,isEditable:e,className:n,...r},s)=>P.jsx("div",{ref:s,children:P.jsxs(Wpe,{className:ce(RS[t].bgColor,RS[t].color,RS[t].hoverBgColor,RS[t].hoverColor,"transition-colors duration-200 cursor-pointer flex items-center group",n),...r,children:[ft(`quotes.status.${t}`),e&&P.jsx(Nfe,{className:"w-3 h-3 ml-2 transition-opacity opacity-0 group-hover:opacity-100"})]})}));function s3e(){return null}var Z$={},B_={},$ee={exports:{}};function i3e(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 hk={exports:{}};const o3e={},sb=Object.freeze(Object.defineProperty({__proto__:null,default:o3e},Symbol.toStringTag,{value:"Module"})),a3e=Sle(sb);var AU;function Vd(){return AU||(AU=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 i3e=="function")try{i=a3e}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,M=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})}(pk)),pk.exports}var mk={exports:{}},PU;function u3e(){return PU||(PU=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],M=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],G=x[1],K=x[2],Z=x[3];X=l(X,G,K,Z,A,7,u[0]),Z=l(Z,X,G,K,k,12,u[1]),K=l(K,Z,X,G,R,17,u[2]),G=l(G,K,Z,X,E,22,u[3]),X=l(X,G,K,Z,T,7,u[4]),Z=l(Z,X,G,K,D,12,u[5]),K=l(K,Z,X,G,M,17,u[6]),G=l(G,K,Z,X,L,22,u[7]),X=l(X,G,K,Z,I,7,u[8]),Z=l(Z,X,G,K,F,12,u[9]),K=l(K,Z,X,G,U,17,u[10]),G=l(G,K,Z,X,Y,22,u[11]),X=l(X,G,K,Z,V,7,u[12]),Z=l(Z,X,G,K,H,12,u[13]),K=l(K,Z,X,G,ee,17,u[14]),G=l(G,K,Z,X,re,22,u[15]),X=d(X,G,K,Z,k,5,u[16]),Z=d(Z,X,G,K,M,9,u[17]),K=d(K,Z,X,G,Y,14,u[18]),G=d(G,K,Z,X,A,20,u[19]),X=d(X,G,K,Z,D,5,u[20]),Z=d(Z,X,G,K,U,9,u[21]),K=d(K,Z,X,G,re,14,u[22]),G=d(G,K,Z,X,T,20,u[23]),X=d(X,G,K,Z,F,5,u[24]),Z=d(Z,X,G,K,ee,9,u[25]),K=d(K,Z,X,G,E,14,u[26]),G=d(G,K,Z,X,I,20,u[27]),X=d(X,G,K,Z,H,5,u[28]),Z=d(Z,X,G,K,R,9,u[29]),K=d(K,Z,X,G,L,14,u[30]),G=d(G,K,Z,X,V,20,u[31]),X=m(X,G,K,Z,D,4,u[32]),Z=m(Z,X,G,K,I,11,u[33]),K=m(K,Z,X,G,Y,16,u[34]),G=m(G,K,Z,X,ee,23,u[35]),X=m(X,G,K,Z,k,4,u[36]),Z=m(Z,X,G,K,T,11,u[37]),K=m(K,Z,X,G,L,16,u[38]),G=m(G,K,Z,X,U,23,u[39]),X=m(X,G,K,Z,H,4,u[40]),Z=m(Z,X,G,K,A,11,u[41]),K=m(K,Z,X,G,E,16,u[42]),G=m(G,K,Z,X,M,23,u[43]),X=m(X,G,K,Z,F,4,u[44]),Z=m(Z,X,G,K,V,11,u[45]),K=m(K,Z,X,G,re,16,u[46]),G=m(G,K,Z,X,R,23,u[47]),X=p(X,G,K,Z,A,6,u[48]),Z=p(Z,X,G,K,L,10,u[49]),K=p(K,Z,X,G,ee,15,u[50]),G=p(G,K,Z,X,D,21,u[51]),X=p(X,G,K,Z,V,6,u[52]),Z=p(Z,X,G,K,E,10,u[53]),K=p(K,Z,X,G,U,15,u[54]),G=p(G,K,Z,X,k,21,u[55]),X=p(X,G,K,Z,I,6,u[56]),Z=p(Z,X,G,K,re,10,u[57]),K=p(K,Z,X,G,M,15,u[58]),G=p(G,K,Z,X,H,21,u[59]),X=p(X,G,K,Z,T,6,u[60]),Z=p(Z,X,G,K,Y,10,u[61]),K=p(K,Z,X,G,R,15,u[62]),G=p(G,K,Z,X,F,21,u[63]),x[0]=x[0]+X|0,x[1]=x[1]+G|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})}(mk)),mk.exports}var gk={exports:{}},vk={exports:{}},TU;function d3e(){return TU||(TU=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})}(vk)),vk.exports}var yk={exports:{}},kU;function f3e(){return kU||(kU=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-=M}};i.BlockCipher=m.extend({cfg:m.cfg.extend({mode:y,padding:v}),reset:function(){var D;m.reset.call(this);var M=this.cfg,L=M.iv,I=M.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,M){this._mode.processBlock(D,M)},_doFinalize:function(){var D,M=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(M.pad(this._data,this.blockSize),D=this._process(!0)):(D=this._process(!0),M.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 M,L=D.ciphertext,I=D.salt;return I?M=o.create([1398893684,1701076831]).concat(I).concat(L):M=L,M.toString(f)},parse:function(D){var M,L=f.parse(D),I=L.words;return I[0]==1398893684&&I[1]==1701076831&&(M=o.create(I.slice(2,4)),I.splice(0,4),L.sigBytes-=16),w.create({ciphertext:L,salt:M})}},k=i.SerializableCipher=a.extend({cfg:a.extend({format:A}),encrypt:function(D,M,L,I){I=this.cfg.extend(I);var F=D.createEncryptor(L,I),U=F.finalize(M),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,M,L,I){I=this.cfg.extend(I),M=this._parse(M,I.format);var F=D.createDecryptor(L,I).finalize(M.ciphertext);return F},_parse:function(D,M){return typeof D=="string"?M.parse(D,this):D}}),R=s.kdf={},E=R.OpenSSL={execute:function(D,M,L,I,F){if(I||(I=o.random(64/8)),F)var U=d.create({keySize:M+L,hasher:F}).compute(D,I);else var U=d.create({keySize:M+L}).compute(D,I);var Y=o.create(U.words.slice(M),L*4);return U.sigBytes=M*4,w.create({key:U,iv:Y,salt:I})}},T=i.PasswordBasedCipher=k.extend({cfg:k.cfg.extend({kdf:E}),encrypt:function(D,M,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,M,F.key,I);return U.mixIn(F),U},decrypt:function(D,M,L,I){I=this.cfg.extend(I),M=this._parse(M,I.format);var F=I.kdf.execute(L,D.keySize,D.ivSize,M.salt,I.hasher);I.iv=F.iv;var U=k.decrypt.call(this,D,M,F.key,I);return U}})}()})}(bk)),bk.exports}(function(t,e){(function(n,r,s){t.exports=r(Vd(),c3e(),u3e(),jee(),h3e())})(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],M=w[R]*257^R*16843008;u[A]=M<<24|M>>>8,f[A]=M<<16|M>>>16,l[A]=M<<8|M>>>24,d[A]=M;var M=D*16843009^T*65537^E*257^A*16843008;m[R]=M<<24|M>>>8,p[R]=M<<16|M>>>16,h[R]=M<<8|M>>>24,y[R]=M,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 M=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 M=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})})(Fee);var p3e=Fee.exports,rR={},U_={},Gs={};Object.defineProperty(U_,"__esModule",{value:!0});U_.default=void 0;var m3e=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 Gs<"u"?e=Gs.SECURE_LOCAL_STORAGE_HASH_KEY||Gs.REACT_APP_SECURE_LOCAL_STORAGE_HASH_KEY||Gs.NEXT_PUBLIC_SECURE_LOCAL_STORAGE_HASH_KEY||Gs.VITE_SECURE_LOCAL_STORAGE_HASH_KEY:console.warn("react-secure-storage : process is not defined! Just a warning!")}catch{return null}return e},g3e=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 Gs<"u"?e=Gs.SECURE_LOCAL_STORAGE_PREFIX||Gs.REACT_APP_SECURE_LOCAL_STORAGE_PREFIX||Gs.NEXT_PUBLIC_SECURE_LOCAL_STORAGE_PREFIX||Gs.VITE_SECURE_LOCAL_STORAGE_PREFIX:console.warn("react-secure-storage : process is not defined! Just a warning!")}catch{return null}return e},v3e=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 Gs<"u"?e=Gs.SECURE_LOCAL_STORAGE_DISABLED_KEYS||Gs.REACT_APP_SECURE_LOCAL_STORAGE_DISABLED_KEYS||Gs.NEXT_PUBLIC_SECURE_LOCAL_STORAGE_DISABLED_KEYS||Gs.VITE_SECURE_LOCAL_STORAGE_DISABLED_KEYS:console.warn("react-secure-storage : process is not defined! Just a warning!")}catch{return null}return e},y3e={getHashKey:m3e,getStoragePrefix:g3e,getDisabledKeys:v3e},b3e=y3e;U_.default=b3e;var sR={},zee={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})(zee);var w3e=zee.exports,gl={};Object.defineProperty(gl,"__esModule",{value:!0});gl.getSecurePrefix=gl.getDisabledKeys=gl.FINGERPRINT_KEYS=void 0;var Bee=_3e(U_);function _3e(t){return t&&t.__esModule?t:{default:t}}var x3e=function(){var e=Bee.default.getStoragePrefix()||"@secure.";return e.endsWith(".")?e:e+"."};gl.getSecurePrefix=x3e;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"};gl.FINGERPRINT_KEYS=Fi;var S3e=function(){var e=Bee.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};gl.getDisabledKeys=S3e;Object.defineProperty(sR,"__esModule",{value:!0});sR.default=void 0;var E3e=C3e(w3e),Ii=gl;function C3e(t){return t&&t.__esModule?t:{default:t}}function A3e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function R3e(t,e){for(var n=0;n"u"?e:M3e.default.getFingerprint()+e},I3e=L3e;rR.default=I3e;Object.defineProperty(B_,"__esModule",{value:!0});B_.default=void 0;var $3e=J$(l3e),MU=J$(p3e),F3e=J$(rR);function J$(t){return t&&t.__esModule?t:{default:t}}function j3e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function z3e(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);nnull},hze=_.createContext(fze);function pze({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(hze.Provider,{...r,value:a,children:t})}const mze=_.createContext(null),Vee=({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(mze.Provider,{value:c,children:[t,P.jsx(RQ,{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})]})},gze=_.lazy(()=>Xr(()=>import("./index-D4r7ZFDJ.js"),__vite__mapDeps([0,1])).then(t=>({default:t.DealerLayout}))),vze=_.lazy(()=>Xr(()=>import("./index-D4r7ZFDJ.js"),__vite__mapDeps([0,1])).then(t=>({default:t.DealersList}))),yze=_.lazy(()=>Xr(()=>import("./index-D4r7ZFDJ.js"),__vite__mapDeps([0,1])).then(t=>({default:t.ErrorPage}))),bze=_.lazy(()=>Xr(()=>import("./index-D4r7ZFDJ.js"),__vite__mapDeps([0,1])).then(t=>({default:t.LoginPageWithLanguageSelector}))),wze=_.lazy(()=>Xr(()=>import("./index-D4r7ZFDJ.js"),__vite__mapDeps([0,1])).then(t=>({default:t.LogoutPage}))),_ze=_.lazy(()=>Xr(()=>import("./index-D4r7ZFDJ.js"),__vite__mapDeps([0,1])).then(t=>({default:t.QuoteCreate}))),xze=_.lazy(()=>Xr(()=>import("./index-D4r7ZFDJ.js"),__vite__mapDeps([0,1])).then(t=>({default:t.QuoteEdit}))),Sze=_.lazy(()=>Xr(()=>import("./index-D4r7ZFDJ.js"),__vite__mapDeps([0,1])).then(t=>({default:t.SettingsEditor}))),Eze=_.lazy(()=>Xr(()=>import("./index-D4r7ZFDJ.js"),__vite__mapDeps([0,1])).then(t=>({default:t.SettingsLayout}))),Cze=_.lazy(()=>Xr(()=>import("./index-D4r7ZFDJ.js"),__vite__mapDeps([0,1])).then(t=>({default:t.CatalogLayout}))),Aze=_.lazy(()=>Xr(()=>import("./index-D4r7ZFDJ.js"),__vite__mapDeps([0,1])).then(t=>({default:t.CatalogList}))),Rze=_.lazy(()=>Xr(()=>import("./index-D4r7ZFDJ.js"),__vite__mapDeps([0,1])).then(t=>({default:t.DashboardPage}))),Pze=_.lazy(()=>Xr(()=>import("./index-D4r7ZFDJ.js"),__vite__mapDeps([0,1])).then(t=>({default:t.QuotesLayout}))),Tze=_.lazy(()=>Xr(()=>import("./index-D4r7ZFDJ.js"),__vite__mapDeps([0,1])).then(t=>({default:t.QuotesList}))),kze=()=>{const t=[{path:"*",Element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(yze,{})})}],e=[{path:"/",element:P.jsx(CU,{children:P.jsx(AQ,{to:"/quotes",replace:!0})})},{path:"/home",element:P.jsx(CU,{children:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(Rze,{})})})},{path:"/catalog",element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(Cze,{children:P.jsx(yS,{})})}),children:[{index:!0,element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(Aze,{})})}]},{path:"/dealers",element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(gze,{children:P.jsx(yS,{})})}),children:[{index:!0,element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(vze,{})})}]},{path:"/quotes",element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(Pze,{children:P.jsx(yS,{})})}),children:[{index:!0,element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(Tze,{})})},{path:"add",element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(_ze,{})})},{path:"edit/:id",element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(xze,{})})}]},{path:"/settings",element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(Eze,{children:P.jsx(yS,{})})}),children:[{index:!0,element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(Sze,{})})}]},{path:"/logout",element:P.jsx(wze,{})}],n=[{path:"/login",element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(bze,{})})}],r=kMe([...e,...n,...t],{});return P.jsx(jMe,{router:r})};function Wee(t,e){return function(){return t.apply(e,arguments)}}const{toString:Dze}=Object.prototype,{getPrototypeOf:e2}=Object,oR=(t=>e=>{const n=Dze.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Oa=t=>(t=t.toLowerCase(),e=>oR(e)===t),aR=t=>e=>typeof e===t,{isArray:jv}=Array,d0=aR("undefined");function Nze(t){return t!==null&&!d0(t)&&t.constructor!==null&&!d0(t.constructor)&&so(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const qee=Oa("ArrayBuffer");function Mze(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&qee(t.buffer),e}const Oze=aR("string"),so=aR("function"),Gee=aR("number"),lR=t=>t!==null&&typeof t=="object",Lze=t=>t===!0||t===!1,SE=t=>{if(oR(t)!=="object")return!1;const e=e2(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},Ize=Oa("Date"),$ze=Oa("File"),Fze=Oa("Blob"),jze=Oa("FileList"),zze=t=>lR(t)&&so(t.pipe),Bze=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||so(t.append)&&((e=oR(t))==="formdata"||e==="object"&&so(t.toString)&&t.toString()==="[object FormData]"))},Uze=Oa("URLSearchParams"),[Hze,Vze,Wze,qze]=["ReadableStream","Request","Response","Headers"].map(Oa),Gze=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function H_(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 Af=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Yee=t=>!d0(t)&&t!==Af;function tO(){const{caseless:t}=Yee(this)&&this||{},e={},n=(r,s)=>{const i=t&&Kee(e,s)||s;SE(e[i])&&SE(r)?e[i]=tO(e[i],r):SE(r)?e[i]=tO({},r):jv(r)?e[i]=r.slice():e[i]=r};for(let r=0,s=arguments.length;r(H_(e,(s,i)=>{n&&so(s)?t[i]=Wee(s,n):t[i]=s},{allOwnKeys:r}),t),Yze=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Xze=(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)},Qze=(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&&e2(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},Zze=(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},Jze=t=>{if(!t)return null;if(jv(t))return t;let e=t.length;if(!Gee(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},eBe=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&e2(Uint8Array)),tBe=(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])}},nBe=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},rBe=Oa("HTMLFormElement"),sBe=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),$U=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),iBe=Oa("RegExp"),Xee=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};H_(n,(s,i)=>{let a;(a=e(s,i,t))!==!1&&(r[i]=a||s)}),Object.defineProperties(t,r)},oBe=t=>{Xee(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+"'")})}})},aBe=(t,e)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return jv(t)?r(t):r(String(t).split(e)),n},lBe=()=>{},cBe=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function uBe(t){return!!(t&&so(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const dBe=t=>{const e=new Array(10),n=(r,s)=>{if(lR(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[s]=r;const i=jv(r)?[]:{};return H_(r,(a,o)=>{const c=n(a,s+1);!d0(c)&&(i[o]=c)}),e[s]=void 0,i}}return r};return n(t,0)},fBe=Oa("AsyncFunction"),hBe=t=>t&&(lR(t)||so(t))&&so(t.then)&&so(t.catch),Qee=((t,e)=>t?setImmediate:e?((n,r)=>(Af.addEventListener("message",({source:s,data:i})=>{s===Af&&i===n&&r.length&&r.shift()()},!1),s=>{r.push(s),Af.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",so(Af.postMessage)),pBe=typeof queueMicrotask<"u"?queueMicrotask.bind(Af):typeof process<"u"&&process.nextTick||Qee,ve={isArray:jv,isArrayBuffer:qee,isBuffer:Nze,isFormData:Bze,isArrayBufferView:Mze,isString:Oze,isNumber:Gee,isBoolean:Lze,isObject:lR,isPlainObject:SE,isReadableStream:Hze,isRequest:Vze,isResponse:Wze,isHeaders:qze,isUndefined:d0,isDate:Ize,isFile:$ze,isBlob:Fze,isRegExp:iBe,isFunction:so,isStream:zze,isURLSearchParams:Uze,isTypedArray:eBe,isFileList:jze,forEach:H_,merge:tO,extend:Kze,trim:Gze,stripBOM:Yze,inherits:Xze,toFlatObject:Qze,kindOf:oR,kindOfTest:Oa,endsWith:Zze,toArray:Jze,forEachEntry:tBe,matchAll:nBe,isHTMLForm:rBe,hasOwnProperty:$U,hasOwnProp:$U,reduceDescriptors:Xee,freezeMethods:oBe,toObjectSet:aBe,toCamelCase:sBe,noop:lBe,toFiniteNumber:cBe,findKey:Kee,global:Af,isContextDefined:Yee,isSpecCompliantForm:uBe,toJSONObject:dBe,isAsyncFn:fBe,isThenable:hBe,setImmediate:Qee,asap:pBe};function _t(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(_t,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 Zee=_t.prototype,Jee={};["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=>{Jee[t]={value:t}});Object.defineProperties(_t,Jee);Object.defineProperty(Zee,"isAxiosError",{value:!0});_t.from=(t,e,n,r,s,i)=>{const a=Object.create(Zee);return ve.toFlatObject(t,a,function(c){return c!==Error.prototype},o=>o!=="isAxiosError"),_t.call(a,t.message,e,n,r,s),a.cause=t,a.name=t.name,i&&Object.assign(a,i),a};const mBe=null;function nO(t){return ve.isPlainObject(t)||ve.isArray(t)}function ete(t){return ve.endsWith(t,"[]")?t.slice(0,-2):t}function FU(t,e,n){return t?t.concat(e).map(function(s,i){return s=ete(s),!n&&i?"["+s+"]":s}).join(n?".":""):e}function gBe(t){return ve.isArray(t)&&!t.some(nO)}const vBe=ve.toFlatObject(ve,{},null,function(e){return/^is[A-Z]/.test(e)});function cR(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 _t("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)&&gBe(p)||(ve.isFileList(p)||ve.endsWith(h,"[]"))&&(g=ve.toArray(p)))return h=ete(h),g.forEach(function(w,x){!(ve.isUndefined(w)||w===null)&&e.append(a===!0?FU([h],x,i):a===null?h:h+"[]",u(w))}),!1}return nO(p)?!0:(e.append(FU(y,h,i),u(p)),!1)}const l=[],d=Object.assign(vBe,{defaultVisitor:f,convertValue:u,isVisitable:nO});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 jU(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function t2(t,e){this._pairs=[],t&&cR(t,this,e)}const tte=t2.prototype;tte.append=function(e,n){this._pairs.push([e,n])};tte.toString=function(e){const n=e?function(r){return e.call(this,r,jU)}:jU;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function yBe(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function nte(t,e,n){if(!e)return t;const r=n&&n.encode||yBe;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 t2(e,n).toString(r),i){const a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class zU{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 rte={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},bBe=typeof URLSearchParams<"u"?URLSearchParams:t2,wBe=typeof FormData<"u"?FormData:null,_Be=typeof Blob<"u"?Blob:null,xBe={isBrowser:!0,classes:{URLSearchParams:bBe,FormData:wBe,Blob:_Be},protocols:["http","https","file","blob","url","data"]},n2=typeof window<"u"&&typeof document<"u",rO=typeof navigator=="object"&&navigator||void 0,SBe=n2&&(!rO||["ReactNative","NativeScript","NS"].indexOf(rO.product)<0),EBe=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",CBe=n2&&window.location.href||"http://localhost",ABe=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:n2,hasStandardBrowserEnv:SBe,hasStandardBrowserWebWorkerEnv:EBe,navigator:rO,origin:CBe},Symbol.toStringTag,{value:"Module"})),Ts={...ABe,...xBe};function RBe(t,e){return cR(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 PBe(t){return ve.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function TBe(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]=TBe(s[a])),!o)}if(ve.isFormData(t)&&ve.isFunction(t.entries)){const n={};return ve.forEachEntry(t,(r,s)=>{e(PBe(r),s,n,0)}),n}return null}function kBe(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 V_={transitional:rte,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(ste(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 RBe(e,this.formSerializer).toString();if((o=ve.isFileList(e))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return cR(o?{"files[]":e}:e,c&&new c,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),kBe(e)):e}],transformResponse:[function(e){const n=this.transitional||V_.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"?_t.from(o,_t.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=>{V_.headers[t]={}});const DBe=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"]),NBe=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 X3e(t,e){if(t){if(typeof t=="string")return OU(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 OU(t,e)}}function OU(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nnull},hze=_.createContext(fze);function pze({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(hze.Provider,{...r,value:a,children:t})}const mze=_.createContext(null),Vee=({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(mze.Provider,{value:c,children:[t,P.jsx(RQ,{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})]})},gze=_.lazy(()=>Xr(()=>import("./index-oEuJT1z9.js"),__vite__mapDeps([0,1])).then(t=>({default:t.DealerLayout}))),vze=_.lazy(()=>Xr(()=>import("./index-oEuJT1z9.js"),__vite__mapDeps([0,1])).then(t=>({default:t.DealersList}))),yze=_.lazy(()=>Xr(()=>import("./index-oEuJT1z9.js"),__vite__mapDeps([0,1])).then(t=>({default:t.ErrorPage}))),bze=_.lazy(()=>Xr(()=>import("./index-oEuJT1z9.js"),__vite__mapDeps([0,1])).then(t=>({default:t.LoginPageWithLanguageSelector}))),wze=_.lazy(()=>Xr(()=>import("./index-oEuJT1z9.js"),__vite__mapDeps([0,1])).then(t=>({default:t.LogoutPage}))),_ze=_.lazy(()=>Xr(()=>import("./index-oEuJT1z9.js"),__vite__mapDeps([0,1])).then(t=>({default:t.QuoteCreate}))),xze=_.lazy(()=>Xr(()=>import("./index-oEuJT1z9.js"),__vite__mapDeps([0,1])).then(t=>({default:t.QuoteEdit}))),Sze=_.lazy(()=>Xr(()=>import("./index-oEuJT1z9.js"),__vite__mapDeps([0,1])).then(t=>({default:t.SettingsEditor}))),Eze=_.lazy(()=>Xr(()=>import("./index-oEuJT1z9.js"),__vite__mapDeps([0,1])).then(t=>({default:t.SettingsLayout}))),Cze=_.lazy(()=>Xr(()=>import("./index-oEuJT1z9.js"),__vite__mapDeps([0,1])).then(t=>({default:t.CatalogLayout}))),Aze=_.lazy(()=>Xr(()=>import("./index-oEuJT1z9.js"),__vite__mapDeps([0,1])).then(t=>({default:t.CatalogList}))),Rze=_.lazy(()=>Xr(()=>import("./index-oEuJT1z9.js"),__vite__mapDeps([0,1])).then(t=>({default:t.DashboardPage}))),Pze=_.lazy(()=>Xr(()=>import("./index-oEuJT1z9.js"),__vite__mapDeps([0,1])).then(t=>({default:t.QuotesLayout}))),Tze=_.lazy(()=>Xr(()=>import("./index-oEuJT1z9.js"),__vite__mapDeps([0,1])).then(t=>({default:t.QuotesList}))),kze=()=>{const t=[{path:"*",Element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(yze,{})})}],e=[{path:"/",element:P.jsx(CU,{children:P.jsx(AQ,{to:"/quotes",replace:!0})})},{path:"/home",element:P.jsx(CU,{children:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(Rze,{})})})},{path:"/catalog",element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(Cze,{children:P.jsx(yS,{})})}),children:[{index:!0,element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(Aze,{})})}]},{path:"/dealers",element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(gze,{children:P.jsx(yS,{})})}),children:[{index:!0,element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(vze,{})})}]},{path:"/quotes",element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(Pze,{children:P.jsx(yS,{})})}),children:[{index:!0,element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(Tze,{})})},{path:"add",element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(_ze,{})})},{path:"edit/:id",element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(xze,{})})}]},{path:"/settings",element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(Eze,{children:P.jsx(yS,{})})}),children:[{index:!0,element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(Sze,{})})}]},{path:"/logout",element:P.jsx(wze,{})}],n=[{path:"/login",element:P.jsx(_.Suspense,{fallback:P.jsx(xs,{}),children:P.jsx(bze,{})})}],r=kMe([...e,...n,...t],{});return P.jsx(jMe,{router:r})};function Wee(t,e){return function(){return t.apply(e,arguments)}}const{toString:Dze}=Object.prototype,{getPrototypeOf:e2}=Object,oR=(t=>e=>{const n=Dze.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Oa=t=>(t=t.toLowerCase(),e=>oR(e)===t),aR=t=>e=>typeof e===t,{isArray:jv}=Array,d0=aR("undefined");function Nze(t){return t!==null&&!d0(t)&&t.constructor!==null&&!d0(t.constructor)&&so(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const qee=Oa("ArrayBuffer");function Mze(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&qee(t.buffer),e}const Oze=aR("string"),so=aR("function"),Gee=aR("number"),lR=t=>t!==null&&typeof t=="object",Lze=t=>t===!0||t===!1,SE=t=>{if(oR(t)!=="object")return!1;const e=e2(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},Ize=Oa("Date"),$ze=Oa("File"),Fze=Oa("Blob"),jze=Oa("FileList"),zze=t=>lR(t)&&so(t.pipe),Bze=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||so(t.append)&&((e=oR(t))==="formdata"||e==="object"&&so(t.toString)&&t.toString()==="[object FormData]"))},Uze=Oa("URLSearchParams"),[Hze,Vze,Wze,qze]=["ReadableStream","Request","Response","Headers"].map(Oa),Gze=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function H_(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 Af=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Yee=t=>!d0(t)&&t!==Af;function tO(){const{caseless:t}=Yee(this)&&this||{},e={},n=(r,s)=>{const i=t&&Kee(e,s)||s;SE(e[i])&&SE(r)?e[i]=tO(e[i],r):SE(r)?e[i]=tO({},r):jv(r)?e[i]=r.slice():e[i]=r};for(let r=0,s=arguments.length;r(H_(e,(s,i)=>{n&&so(s)?t[i]=Wee(s,n):t[i]=s},{allOwnKeys:r}),t),Yze=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Xze=(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)},Qze=(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&&e2(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},Zze=(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},Jze=t=>{if(!t)return null;if(jv(t))return t;let e=t.length;if(!Gee(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},eBe=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&e2(Uint8Array)),tBe=(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])}},nBe=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},rBe=Oa("HTMLFormElement"),sBe=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),$U=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),iBe=Oa("RegExp"),Xee=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};H_(n,(s,i)=>{let a;(a=e(s,i,t))!==!1&&(r[i]=a||s)}),Object.defineProperties(t,r)},oBe=t=>{Xee(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+"'")})}})},aBe=(t,e)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return jv(t)?r(t):r(String(t).split(e)),n},lBe=()=>{},cBe=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function uBe(t){return!!(t&&so(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const dBe=t=>{const e=new Array(10),n=(r,s)=>{if(lR(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[s]=r;const i=jv(r)?[]:{};return H_(r,(a,o)=>{const c=n(a,s+1);!d0(c)&&(i[o]=c)}),e[s]=void 0,i}}return r};return n(t,0)},fBe=Oa("AsyncFunction"),hBe=t=>t&&(lR(t)||so(t))&&so(t.then)&&so(t.catch),Qee=((t,e)=>t?setImmediate:e?((n,r)=>(Af.addEventListener("message",({source:s,data:i})=>{s===Af&&i===n&&r.length&&r.shift()()},!1),s=>{r.push(s),Af.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",so(Af.postMessage)),pBe=typeof queueMicrotask<"u"?queueMicrotask.bind(Af):typeof process<"u"&&process.nextTick||Qee,ve={isArray:jv,isArrayBuffer:qee,isBuffer:Nze,isFormData:Bze,isArrayBufferView:Mze,isString:Oze,isNumber:Gee,isBoolean:Lze,isObject:lR,isPlainObject:SE,isReadableStream:Hze,isRequest:Vze,isResponse:Wze,isHeaders:qze,isUndefined:d0,isDate:Ize,isFile:$ze,isBlob:Fze,isRegExp:iBe,isFunction:so,isStream:zze,isURLSearchParams:Uze,isTypedArray:eBe,isFileList:jze,forEach:H_,merge:tO,extend:Kze,trim:Gze,stripBOM:Yze,inherits:Xze,toFlatObject:Qze,kindOf:oR,kindOfTest:Oa,endsWith:Zze,toArray:Jze,forEachEntry:tBe,matchAll:nBe,isHTMLForm:rBe,hasOwnProperty:$U,hasOwnProp:$U,reduceDescriptors:Xee,freezeMethods:oBe,toObjectSet:aBe,toCamelCase:sBe,noop:lBe,toFiniteNumber:cBe,findKey:Kee,global:Af,isContextDefined:Yee,isSpecCompliantForm:uBe,toJSONObject:dBe,isAsyncFn:fBe,isThenable:hBe,setImmediate:Qee,asap:pBe};function _t(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(_t,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 Zee=_t.prototype,Jee={};["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=>{Jee[t]={value:t}});Object.defineProperties(_t,Jee);Object.defineProperty(Zee,"isAxiosError",{value:!0});_t.from=(t,e,n,r,s,i)=>{const a=Object.create(Zee);return ve.toFlatObject(t,a,function(c){return c!==Error.prototype},o=>o!=="isAxiosError"),_t.call(a,t.message,e,n,r,s),a.cause=t,a.name=t.name,i&&Object.assign(a,i),a};const mBe=null;function nO(t){return ve.isPlainObject(t)||ve.isArray(t)}function ete(t){return ve.endsWith(t,"[]")?t.slice(0,-2):t}function FU(t,e,n){return t?t.concat(e).map(function(s,i){return s=ete(s),!n&&i?"["+s+"]":s}).join(n?".":""):e}function gBe(t){return ve.isArray(t)&&!t.some(nO)}const vBe=ve.toFlatObject(ve,{},null,function(e){return/^is[A-Z]/.test(e)});function cR(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 _t("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)&&gBe(p)||(ve.isFileList(p)||ve.endsWith(h,"[]"))&&(g=ve.toArray(p)))return h=ete(h),g.forEach(function(w,x){!(ve.isUndefined(w)||w===null)&&e.append(a===!0?FU([h],x,i):a===null?h:h+"[]",u(w))}),!1}return nO(p)?!0:(e.append(FU(y,h,i),u(p)),!1)}const l=[],d=Object.assign(vBe,{defaultVisitor:f,convertValue:u,isVisitable:nO});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 jU(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function t2(t,e){this._pairs=[],t&&cR(t,this,e)}const tte=t2.prototype;tte.append=function(e,n){this._pairs.push([e,n])};tte.toString=function(e){const n=e?function(r){return e.call(this,r,jU)}:jU;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function yBe(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function nte(t,e,n){if(!e)return t;const r=n&&n.encode||yBe;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 t2(e,n).toString(r),i){const a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class zU{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 rte={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},bBe=typeof URLSearchParams<"u"?URLSearchParams:t2,wBe=typeof FormData<"u"?FormData:null,_Be=typeof Blob<"u"?Blob:null,xBe={isBrowser:!0,classes:{URLSearchParams:bBe,FormData:wBe,Blob:_Be},protocols:["http","https","file","blob","url","data"]},n2=typeof window<"u"&&typeof document<"u",rO=typeof navigator=="object"&&navigator||void 0,SBe=n2&&(!rO||["ReactNative","NativeScript","NS"].indexOf(rO.product)<0),EBe=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",CBe=n2&&window.location.href||"http://localhost",ABe=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:n2,hasStandardBrowserEnv:SBe,hasStandardBrowserWebWorkerEnv:EBe,navigator:rO,origin:CBe},Symbol.toStringTag,{value:"Module"})),Ts={...ABe,...xBe};function RBe(t,e){return cR(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 PBe(t){return ve.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function TBe(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]=TBe(s[a])),!o)}if(ve.isFormData(t)&&ve.isFunction(t.entries)){const n={};return ve.forEachEntry(t,(r,s)=>{e(PBe(r),s,n,0)}),n}return null}function kBe(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 V_={transitional:rte,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(ste(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 RBe(e,this.formSerializer).toString();if((o=ve.isFileList(e))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return cR(o?{"files[]":e}:e,c&&new c,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),kBe(e)):e}],transformResponse:[function(e){const n=this.transitional||V_.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"?_t.from(o,_t.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=>{V_.headers[t]={}});const DBe=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"]),NBe=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]&&DBe[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},BU=Symbol("internals");function Dy(t){return t&&String(t).trim().toLowerCase()}function EE(t){return t===!1||t==null?t:ve.isArray(t)?t.map(EE):String(t)}function MBe(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 OBe=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function wk(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 LBe(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function IBe(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]=EE(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())&&!OBe(e))a(NBe(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 MBe(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||wk(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||wk(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||wk(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]=EE(s),delete n[i];return}const o=e?LBe(i):String(i).trim();o!==i&&delete n[i],n[o]=EE(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[BU]=this[BU]={accessors:{}}).accessors,s=this.prototype;function i(a){const o=Dy(a);r[o]||(IBe(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 _k(t,e){const n=this||V_,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 ite(t){return!!(t&&t.__CANCEL__)}function zv(t,e,n){_t.call(this,t??"canceled",_t.ERR_CANCELED,e,n),this.name="CanceledError"}ve.inherits(zv,_t,{__CANCEL__:!0});function ote(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new _t("Request failed with status code "+n.status,[_t.ERR_BAD_REQUEST,_t.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function $Be(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function FBe(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 YC=(t,e,n=3)=>{let r=0;const s=FBe(50,250);return jBe(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)},UU=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},HU=t=>(...e)=>ve.asap(()=>t(...e)),zBe=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,BBe=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 UBe(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function HBe(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function ate(t,e,n){let r=!UBe(e);return t&&(r||n==!1)?HBe(t,e):e}const VU=t=>t instanceof Ci?{...t}:t;function ip(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(VU(u),VU(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 lte=t=>{const e=ip({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:i,headers:a,auth:o}=e;e.headers=a=Ci.from(a),e.url=nte(ate(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&&zBe(e.url))){const u=s&&i&&BBe.read(i);u&&a.set(s,u)}return e},VBe=typeof XMLHttpRequest<"u",WBe=VBe&&function(t){return new Promise(function(n,r){const s=lte(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};ote(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 _t("Request aborted",_t.ECONNABORTED,t,y)),y=null)},y.onerror=function(){r(new _t("Network Error",_t.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||rte;s.timeoutErrorMessage&&(x=s.timeoutErrorMessage),r(new _t(x,A.clarifyTimeoutError?_t.ETIMEDOUT:_t.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]=YC(u,!0),y.addEventListener("progress",d)),c&&y.upload&&([l,m]=YC(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=$Be(s.url);if(v&&Ts.protocols.indexOf(v)===-1){r(new _t("Unsupported protocol "+v+":",_t.ERR_BAD_REQUEST,t));return}y.send(i||null)})},qBe=(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 _t?f:new zv(f instanceof Error?f.message:f))}};let a=e&&setTimeout(()=>{a=null,i(new _t(`timeout ${e} of ms exceeded`,_t.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}},GBe=function*(t,e){let n=t.byteLength;if(n{const s=KBe(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})},uR=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",cte=uR&&typeof ReadableStream=="function",XBe=uR&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),ute=(t,...e)=>{try{return!!t(...e)}catch{return!1}},QBe=cte&&ute(()=>{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}),qU=64*1024,sO=cte&&ute(()=>ve.isReadableStream(new Response("").body)),XC={stream:sO&&(t=>t.body)};uR&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!XC[e]&&(XC[e]=ve.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new _t(`Response type '${e}' is not supported`,_t.ERR_NOT_SUPPORT,r)})})})(new Response);const ZBe=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 XBe(t)).byteLength},JBe=async(t,e)=>{const n=ve.toFiniteNumber(t.getContentLength());return n??ZBe(e)},e4e=uR&&(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}=lte(t);u=u?(u+"").toLowerCase():"text";let m=qBe([s,i&&i.toAbortSignal()],a),p;const h=m&&m.unsubscribe&&(()=>{m.unsubscribe()});let y;try{if(c&&QBe&&n!=="get"&&n!=="head"&&(y=await JBe(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]=UU(y,YC(HU(c)));r=WU(A.body,qU,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=sO&&(u==="stream"||u==="response");if(sO&&(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&&UU(k,YC(HU(o),!0))||[];v=new Response(WU(v.body,qU,R,()=>{E&&E(),h&&h()}),A)}u=u||"text";let x=await XC[ve.findKey(XC,u)||"text"](v,t);return!w&&h&&h(),await new Promise((A,k)=>{ote(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 _t("Network Error",_t.ERR_NETWORK,t,p),{cause:g.cause||g}):_t.from(g,g&&g.code,t,p)}}),iO={http:mBe,xhr:WBe,fetch:e4e};ve.forEach(iO,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const GU=t=>`- ${t}`,t4e=t=>ve.isFunction(t)||t===null||t===!1,dte={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(GU).join(` diff --git a/dist/client/assets/index-D4r7ZFDJ.js b/dist/client/assets/index-oEuJT1z9.js similarity index 68% rename from dist/client/assets/index-D4r7ZFDJ.js rename to dist/client/assets/index-oEuJT1z9.js index fa9f139..1308436 100644 --- a/dist/client/assets/index-D4r7ZFDJ.js +++ b/dist/client/assets/index-oEuJT1z9.js @@ -1,4 +1,4 @@ -var T_=Object.defineProperty;var O_=(n,o,r)=>o in n?T_(n,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[o]=r;var Se=(n,o,r)=>O_(n,typeof o!="symbol"?o+"":o,r);import{u as Fc,a as tn,b as nn,c as Pn,d as Ne,j as i,P as P_,e as q_,f as he,g as k_,N as ns,R as Pe,J as Et,h as qe,i as ir,D as sr,l as Pa,M as Tt,V as $_,r as L,k as Mc,m as Dc,n as fr,o as Lc,B as G,C as z_,p as gr,q as mr,s as hr,S as uo,t as pr,v as Qi,w,x as co,y as rs,z as is,A as ss,E as Ur,F as fo,G as ar,H as or,I as lr,K as ur,L as V_,O as xn,Q as B_,T as U_,U as G_,W as Le,X as ct,Y as Ue,Z as We,_ as Te,$ as _n,a0 as go,a1 as H_,a2 as mo,a3 as bn,a4 as ho,a5 as po,a6 as Kr,a7 as Rt,a8 as Tc,a9 as K_,aa as Xi,ab as xr,ac as xo,ad as vo,ae as _o,af as bo,ag as Oc,ah as wo,ai as So,aj as jo,ak as as,al as W_,am as Tn,an as Pt,ao as hc,ap as Y_,aq as Q_,ar as X_,as as Co,at as Bt,au as Cn,av as os,aw as Pc,ax as pn,ay as Z_,az as qc,aA as J_,aB as se,aC as ls,aD as pc,aE as kc,aF as $c,aG as zc,aH as qn,aI as Vc,aJ as us,aK as Yr,aL as Qr,aM as Xr,aN as Wr,aO as e0,aP as Bc,aQ as Ye,aR as Qe,aS as Xa,aT as Xe,aU as cr,aV as vr,aW as dr,aX as t0,aY as n0,aZ as r0,a_ as Za,a$ as i0,b0 as s0,b1 as nr,b2 as Uc,b3 as Ja,b4 as Gc,b5 as wn,b6 as Zi,b7 as zt,b8 as a0,b9 as xc,ba as cs,bb as Hc,bc as o0,bd as yo,be as l0,bf as Kc,bg as Wc,bh as Yc,bi as Qc,bj as Xc,bk as Zc,bl as Jc,bm as ed,bn as td,bo as u0,bp as Gi,bq as c0,br as d0,bs as f0,bt as g0,bu as m0,bv as h0,bw as p0,bx as x0,by as v0,bz as _0,bA as b0,bB as vc,bC as nd,bD as rd,bE as id,bF as sd,bG as ad,bH as od,bI as ld,bJ as w0,bK as qa,bL as S0,bM as j0,bN as C0,bO as ud,bP as cd,bQ as eo,bR as to,bS as y0,bT as ka,bU as N0,bV as R0}from"./index-CxhwxQ3i.js";const E0=n=>{const{onSuccess:o,...r}=n||{},a=Pn(),{login:l}=Fc(),c=tn();return nn({mutationKey:a().auth().action("login").get(),mutationFn:l,onSuccess:async(d,m,p)=>{d.success&&c.removeQueries({queryKey:a().auth().get()}),await(o==null?void 0:o(d,m,p))},...r})};/** +var D_=Object.defineProperty;var L_=(n,o,r)=>o in n?D_(n,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[o]=r;var Se=(n,o,r)=>L_(n,typeof o!="symbol"?o+"":o,r);import{u as Fc,a as tn,b as nn,c as Pn,d as Ne,j as i,P as P_,e as q_,f as he,g as k_,N as ns,R as Pe,J as Et,h as qe,i as ir,D as sr,l as Pa,M as Dt,V as $_,r as O,k as Mc,m as Tc,n as fr,o as Oc,B as H,C as B_,p as gr,q as mr,s as hr,S as uo,t as pr,v as Yi,w,x as co,y as rs,z as is,A as ss,E as Vr,F as fo,G as ar,H as or,I as lr,K as ur,L as U_,O as xn,Q as z_,T as V_,U as H_,W as Oe,X as ct,Y as Ve,Z as We,_ as De,$ as _n,a0 as go,a1 as G_,a2 as mo,a3 as bn,a4 as ho,a5 as po,a6 as Kr,a7 as Rt,a8 as Dc,a9 as K_,aa as Zi,ab as xr,ac as xo,ad as vo,ae as _o,af as bo,ag as Lc,ah as wo,ai as So,aj as jo,ak as as,al as W_,am as Dn,an as Pt,ao as hc,ap as Q_,aq as Y_,ar as Z_,as as Co,at as zt,au as Cn,av as os,aw as Pc,ax as pn,ay as X_,az as qc,aA as J_,aB as se,aC as ls,aD as pc,aE as kc,aF as $c,aG as Bc,aH as qn,aI as Uc,aJ as us,aK as Qr,aL as Yr,aM as Zr,aN as Wr,aO as e0,aP as zc,aQ as Qe,aR as Ye,aS as Za,aT as Ze,aU as cr,aV as vr,aW as dr,aX as t0,aY as n0,aZ as r0,a_ as Xa,a$ as i0,b0 as s0,b1 as nr,b2 as Vc,b3 as Ja,b4 as Hc,b5 as wn,b6 as Xi,b7 as Bt,b8 as a0,b9 as xc,ba as cs,bb as Gc,bc as o0,bd as yo,be as l0,bf as Kc,bg as Wc,bh as Qc,bi as Yc,bj as Zc,bk as Xc,bl as Jc,bm as ed,bn as td,bo as u0,bp as Hi,bq as c0,br as d0,bs as f0,bt as g0,bu as m0,bv as h0,bw as p0,bx as x0,by as v0,bz as _0,bA as b0,bB as vc,bC as nd,bD as rd,bE as id,bF as sd,bG as ad,bH as od,bI as ld,bJ as w0,bK as qa,bL as S0,bM as j0,bN as C0,bO as ud,bP as cd,bQ as eo,bR as to,bS as y0,bT as ka,bU as N0,bV as R0}from"./index-DanLbc5g.js";const E0=n=>{const{onSuccess:o,...r}=n||{},a=Pn(),{login:l}=Fc(),c=tn();return nn({mutationKey:a().auth().action("login").get(),mutationFn:l,onSuccess:async(d,m,p)=>{d.success&&c.removeQueries({queryKey:a().auth().get()}),await(o==null?void 0:o(d,m,p))},...r})};/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. @@ -43,12 +43,12 @@ var T_=Object.defineProperty;var O_=(n,o,r)=>o in n?T_(n,o,{enumerable:!0,config * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const D0=Ne("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** + */const T0=Ne("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const L0=Ne("CopyPlus",[["line",{x1:"15",x2:"15",y1:"12",y2:"18",key:"1p7wdc"}],["line",{x1:"12",x2:"18",y1:"15",y2:"15",key:"1nscbv"}],["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** + */const O0=Ne("CopyPlus",[["line",{x1:"15",x2:"15",y1:"12",y2:"18",key:"1p7wdc"}],["line",{x1:"12",x2:"18",y1:"15",y2:"15",key:"1nscbv"}],["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. @@ -63,7 +63,7 @@ var T_=Object.defineProperty;var O_=(n,o,r)=>o in n?T_(n,o,{enumerable:!0,config * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const T0=Ne("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);/** + */const D0=Ne("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. @@ -73,7 +73,7 @@ var T_=Object.defineProperty;var O_=(n,o,r)=>o in n?T_(n,o,{enumerable:!0,config * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const O0=Ne("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + */const L0=Ne("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. @@ -113,7 +113,7 @@ var T_=Object.defineProperty;var O_=(n,o,r)=>o in n?T_(n,o,{enumerable:!0,config * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const z0=Ne("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/** + */const B0=Ne("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. @@ -123,7 +123,7 @@ var T_=Object.defineProperty;var O_=(n,o,r)=>o in n?T_(n,o,{enumerable:!0,config * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const xd=Ne("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]),V0=({className:n,...o})=>i.jsx(q_,{className:he("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",n),...o}),wc=P_,B0=({withHandle:n,className:o,...r})=>i.jsx(k_,{className:he("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",o),...r,children:n&&i.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:i.jsx(hd,{className:"h-2.5 w-2.5"})})});function ut({className:n,...o}){return i.jsx("div",{className:he("animate-pulse rounded-md bg-muted",n),...o})}const U0=n=>typeof n=="object"&&n!==null&&n.hasOwnProperty("total_items");let Hi;const G0=new Uint8Array(16);function H0(){if(!Hi&&(Hi=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Hi))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Hi(G0)}const Ke=[];for(let n=0;n<256;++n)Ke.push((n+256).toString(16).slice(1));function K0(n,o=0){return Ke[n[o+0]]+Ke[n[o+1]]+Ke[n[o+2]]+Ke[n[o+3]]+"-"+Ke[n[o+4]]+Ke[n[o+5]]+"-"+Ke[n[o+6]]+Ke[n[o+7]]+"-"+Ke[n[o+8]]+Ke[n[o+9]]+"-"+Ke[n[o+10]]+Ke[n[o+11]]+Ke[n[o+12]]+Ke[n[o+13]]+Ke[n[o+14]]+Ke[n[o+15]]}const W0=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Sc={randomUUID:W0};function Y0(n,o,r){if(Sc.randomUUID&&!n)return Sc.randomUUID();n=n||{};const a=n.random||(n.rng||H0)();return a[6]=a[6]&15|64,a[8]=a[8]&63|128,K0(a)}class mn extends ns{static validate(o,r){const a=Pe.RULE_ALLOW_EMPTY.default(""),l=Et.string().guid({version:["uuidv4"]}).label(r.label?r.label:"id"),c=Et.alternatives(a,l);return Pe.validate(c,o)}static sanitize(o){return o.trim()}static create(o,r={}){const a={label:"id",generateOnEmpty:!1,...r};if(!o&&!a.generateOnEmpty)return qe.fail(ir(sr.INVALID_INPUT_DATA,"ID is null or empty"));if(o){const l=mn.validate(o,a);return l.isFailure?qe.fail(ir(sr.INVALID_INPUT_DATA,l.error.message,a)):qe.ok(new mn(mn.sanitize(l.object)))}return a.generateOnEmpty?mn.generateNewID():qe.ok(new mn(null))}static generateNewID(){return qe.ok(new mn(Y0()))}get value(){return String(this.props)}toString(){return String(this.props)}toPrimitive(){return this.toString()}}const $a={aa:{name:"Afar",nativeName:"Afaraf"},ab:{name:"Abkhaz",nativeName:"аҧсуа бызшәа"},ae:{name:"Avestan",nativeName:"avesta"},af:{name:"Afrikaans",nativeName:"Afrikaans"},ak:{name:"Akan",nativeName:"Akan"},am:{name:"Amharic",nativeName:"አማርኛ"},an:{name:"Aragonese",nativeName:"aragonés"},ar:{name:"Arabic",nativeName:"اَلْعَرَبِيَّةُ"},as:{name:"Assamese",nativeName:"অসমীয়া"},av:{name:"Avaric",nativeName:"авар мацӀ"},ay:{name:"Aymara",nativeName:"aymar aru"},az:{name:"Azerbaijani",nativeName:"azərbaycan dili"},ba:{name:"Bashkir",nativeName:"башҡорт теле"},be:{name:"Belarusian",nativeName:"беларуская мова"},bg:{name:"Bulgarian",nativeName:"български език"},bi:{name:"Bislama",nativeName:"Bislama"},bm:{name:"Bambara",nativeName:"bamanankan"},bn:{name:"Bengali",nativeName:"বাংলা"},bo:{name:"Tibetan",nativeName:"བོད་ཡིག"},br:{name:"Breton",nativeName:"brezhoneg"},bs:{name:"Bosnian",nativeName:"bosanski jezik"},ca:{name:"Catalan",nativeName:"Català"},ce:{name:"Chechen",nativeName:"нохчийн мотт"},ch:{name:"Chamorro",nativeName:"Chamoru"},co:{name:"Corsican",nativeName:"corsu"},cr:{name:"Cree",nativeName:"ᓀᐦᐃᔭᐍᐏᐣ"},cs:{name:"Czech",nativeName:"čeština"},cu:{name:"Old Church Slavonic",nativeName:"ѩзыкъ словѣньскъ"},cv:{name:"Chuvash",nativeName:"чӑваш чӗлхи"},cy:{name:"Welsh",nativeName:"Cymraeg"},da:{name:"Danish",nativeName:"dansk"},de:{name:"German",nativeName:"Deutsch"},dv:{name:"Divehi",nativeName:"ދިވެހި"},dz:{name:"Dzongkha",nativeName:"རྫོང་ཁ"},ee:{name:"Ewe",nativeName:"Eʋegbe"},el:{name:"Greek",nativeName:"Ελληνικά"},en:{name:"English",nativeName:"English"},eo:{name:"Esperanto",nativeName:"Esperanto"},es:{name:"Spanish",nativeName:"Español"},et:{name:"Estonian",nativeName:"eesti"},eu:{name:"Basque",nativeName:"euskara"},fa:{name:"Persian",nativeName:"فارسی"},ff:{name:"Fula",nativeName:"Fulfulde"},fi:{name:"Finnish",nativeName:"suomi"},fj:{name:"Fijian",nativeName:"vosa Vakaviti"},fo:{name:"Faroese",nativeName:"føroyskt"},fr:{name:"French",nativeName:"Français"},fy:{name:"Western Frisian",nativeName:"Frysk"},ga:{name:"Irish",nativeName:"Gaeilge"},gd:{name:"Scottish Gaelic",nativeName:"Gàidhlig"},gl:{name:"Galician",nativeName:"galego"},gn:{name:"Guaraní",nativeName:"Avañe'ẽ"},gu:{name:"Gujarati",nativeName:"ગુજરાતી"},gv:{name:"Manx",nativeName:"Gaelg"},ha:{name:"Hausa",nativeName:"هَوُسَ"},he:{name:"Hebrew",nativeName:"עברית"},hi:{name:"Hindi",nativeName:"हिन्दी"},ho:{name:"Hiri Motu",nativeName:"Hiri Motu"},hr:{name:"Croatian",nativeName:"Hrvatski"},ht:{name:"Haitian",nativeName:"Kreyòl ayisyen"},hu:{name:"Hungarian",nativeName:"magyar"},hy:{name:"Armenian",nativeName:"Հայերեն"},hz:{name:"Herero",nativeName:"Otjiherero"},ia:{name:"Interlingua",nativeName:"Interlingua"},id:{name:"Indonesian",nativeName:"Bahasa Indonesia"},ie:{name:"Interlingue",nativeName:"Interlingue"},ig:{name:"Igbo",nativeName:"Asụsụ Igbo"},ii:{name:"Nuosu",nativeName:"ꆈꌠ꒿ Nuosuhxop"},ik:{name:"Inupiaq",nativeName:"Iñupiaq"},io:{name:"Ido",nativeName:"Ido"},is:{name:"Icelandic",nativeName:"Íslenska"},it:{name:"Italian",nativeName:"Italiano"},iu:{name:"Inuktitut",nativeName:"ᐃᓄᒃᑎᑐᑦ"},ja:{name:"Japanese",nativeName:"日本語"},jv:{name:"Javanese",nativeName:"basa Jawa"},ka:{name:"Georgian",nativeName:"ქართული"},kg:{name:"Kongo",nativeName:"Kikongo"},ki:{name:"Kikuyu",nativeName:"Gĩkũyũ"},kj:{name:"Kwanyama",nativeName:"Kuanyama"},kk:{name:"Kazakh",nativeName:"қазақ тілі"},kl:{name:"Kalaallisut",nativeName:"kalaallisut"},km:{name:"Khmer",nativeName:"ខេមរភាសា"},kn:{name:"Kannada",nativeName:"ಕನ್ನಡ"},ko:{name:"Korean",nativeName:"한국어"},kr:{name:"Kanuri",nativeName:"Kanuri"},ks:{name:"Kashmiri",nativeName:"कश्मीरी"},ku:{name:"Kurdish",nativeName:"Kurdî"},kv:{name:"Komi",nativeName:"коми кыв"},kw:{name:"Cornish",nativeName:"Kernewek"},ky:{name:"Kyrgyz",nativeName:"Кыргызча"},la:{name:"Latin",nativeName:"latine"},lb:{name:"Luxembourgish",nativeName:"Lëtzebuergesch"},lg:{name:"Ganda",nativeName:"Luganda"},li:{name:"Limburgish",nativeName:"Limburgs"},ln:{name:"Lingala",nativeName:"Lingála"},lo:{name:"Lao",nativeName:"ພາສາລາວ"},lt:{name:"Lithuanian",nativeName:"lietuvių kalba"},lu:{name:"Luba-Katanga",nativeName:"Kiluba"},lv:{name:"Latvian",nativeName:"latviešu valoda"},mg:{name:"Malagasy",nativeName:"fiteny malagasy"},mh:{name:"Marshallese",nativeName:"Kajin M̧ajeļ"},mi:{name:"Māori",nativeName:"te reo Māori"},mk:{name:"Macedonian",nativeName:"македонски јазик"},ml:{name:"Malayalam",nativeName:"മലയാളം"},mn:{name:"Mongolian",nativeName:"Монгол хэл"},mr:{name:"Marathi",nativeName:"मराठी"},ms:{name:"Malay",nativeName:"Bahasa Melayu"},mt:{name:"Maltese",nativeName:"Malti"},my:{name:"Burmese",nativeName:"ဗမာစာ"},na:{name:"Nauru",nativeName:"Dorerin Naoero"},nb:{name:"Norwegian Bokmål",nativeName:"Norsk bokmål"},nd:{name:"Northern Ndebele",nativeName:"isiNdebele"},ne:{name:"Nepali",nativeName:"नेपाली"},ng:{name:"Ndonga",nativeName:"Owambo"},nl:{name:"Dutch",nativeName:"Nederlands"},nn:{name:"Norwegian Nynorsk",nativeName:"Norsk nynorsk"},no:{name:"Norwegian",nativeName:"Norsk"},nr:{name:"Southern Ndebele",nativeName:"isiNdebele"},nv:{name:"Navajo",nativeName:"Diné bizaad"},ny:{name:"Chichewa",nativeName:"chiCheŵa"},oc:{name:"Occitan",nativeName:"occitan"},oj:{name:"Ojibwe",nativeName:"ᐊᓂᔑᓈᐯᒧᐎᓐ"},om:{name:"Oromo",nativeName:"Afaan Oromoo"},or:{name:"Oriya",nativeName:"ଓଡ଼ିଆ"},os:{name:"Ossetian",nativeName:"ирон æвзаг"},pa:{name:"Panjabi",nativeName:"ਪੰਜਾਬੀ"},pi:{name:"Pāli",nativeName:"पाऴि"},pl:{name:"Polish",nativeName:"Polski"},ps:{name:"Pashto",nativeName:"پښتو"},pt:{name:"Portuguese",nativeName:"Português"},qu:{name:"Quechua",nativeName:"Runa Simi"},rm:{name:"Romansh",nativeName:"rumantsch grischun"},rn:{name:"Kirundi",nativeName:"Ikirundi"},ro:{name:"Romanian",nativeName:"Română"},ru:{name:"Russian",nativeName:"Русский"},rw:{name:"Kinyarwanda",nativeName:"Ikinyarwanda"},sa:{name:"Sanskrit",nativeName:"संस्कृतम्"},sc:{name:"Sardinian",nativeName:"sardu"},sd:{name:"Sindhi",nativeName:"सिन्धी"},se:{name:"Northern Sami",nativeName:"Davvisámegiella"},sg:{name:"Sango",nativeName:"yângâ tî sängö"},si:{name:"Sinhala",nativeName:"සිංහල"},sk:{name:"Slovak",nativeName:"slovenčina"},sl:{name:"Slovenian",nativeName:"slovenščina"},sm:{name:"Samoan",nativeName:"gagana fa'a Samoa"},sn:{name:"Shona",nativeName:"chiShona"},so:{name:"Somali",nativeName:"Soomaaliga"},sq:{name:"Albanian",nativeName:"Shqip"},sr:{name:"Serbian",nativeName:"српски језик"},ss:{name:"Swati",nativeName:"SiSwati"},st:{name:"Southern Sotho",nativeName:"Sesotho"},su:{name:"Sundanese",nativeName:"Basa Sunda"},sv:{name:"Swedish",nativeName:"Svenska"},sw:{name:"Swahili",nativeName:"Kiswahili"},ta:{name:"Tamil",nativeName:"தமிழ்"},te:{name:"Telugu",nativeName:"తెలుగు"},tg:{name:"Tajik",nativeName:"тоҷикӣ"},th:{name:"Thai",nativeName:"ไทย"},ti:{name:"Tigrinya",nativeName:"ትግርኛ"},tk:{name:"Turkmen",nativeName:"Türkmençe"},tl:{name:"Tagalog",nativeName:"Wikang Tagalog"},tn:{name:"Tswana",nativeName:"Setswana"},to:{name:"Tonga",nativeName:"faka Tonga"},tr:{name:"Turkish",nativeName:"Türkçe"},ts:{name:"Tsonga",nativeName:"Xitsonga"},tt:{name:"Tatar",nativeName:"татар теле"},tw:{name:"Twi",nativeName:"Twi"},ty:{name:"Tahitian",nativeName:"Reo Tahiti"},ug:{name:"Uyghur",nativeName:"ئۇيغۇرچە‎"},uk:{name:"Ukrainian",nativeName:"Українська"},ur:{name:"Urdu",nativeName:"اردو"},uz:{name:"Uzbek",nativeName:"Ўзбек"},ve:{name:"Venda",nativeName:"Tshivenḓa"},vi:{name:"Vietnamese",nativeName:"Tiếng Việt"},vo:{name:"Volapük",nativeName:"Volapük"},wa:{name:"Walloon",nativeName:"walon"},wo:{name:"Wolof",nativeName:"Wollof"},xh:{name:"Xhosa",nativeName:"isiXhosa"},yi:{name:"Yiddish",nativeName:"ייִדיש"},yo:{name:"Yoruba",nativeName:"Yorùbá"},za:{name:"Zhuang",nativeName:"Saɯ cueŋƅ"},zh:{name:"Chinese",nativeName:"中文"},zu:{name:"Zulu",nativeName:"isiZulu"}},hn=class hn extends ns{constructor(){super(...arguments);Se(this,"toString",()=>this.code)}static validate(r,a){const l=Et.alternatives(Pe.RULE_ALLOW_EMPTY.default(""),Et.string().lowercase().valid(...Object.keys($a)).label(String(a.label)));return Pe.validate(l,r)}static sanitize(r){return r?String(r).toLowerCase():void 0}static createFromCode(r,a={}){const l={...a,label:a.label?a.label:"lang_code"},c=hn.validate(r,l);if(c.isFailure)return qe.fail(ir(sr.INVALID_INPUT_DATA,c.error.message,l));const d=hn.sanitize(c.object),m=d?{...$a[c.object],code:d}:void 0;return qe.ok(new hn(m))}static createDefaultCode(){return hn.createFromCode(this.DEFAULT_LANGUAGE_CODE)}get name(){return this.props?String(this.props.name):""}get nativeName(){return this.props?String(this.props.nativeName):""}get code(){return this.props?String(this.props.code):""}isEmpty(){return this.isNull()||this.props===void 0}toPrimitive(){return this.toString()}};Se(hn,"DEFAULT_LANGUAGE_CODE","es"),Se(hn,"LANGUAGES",$a);let Gr=hn;class vd{constructor(o){Se(this,"_collection",[]);this._collection=o??[]}add(o){this._collection.push(o)}reset(){this._collection=[]}hasSomeFaultyResult(){return this._collection.some(o=>o.isFailure)}getFirstFaultyResult(){return this._collection.find(o=>o.isFailure)}getAllFaultyResults(){return this._collection.filter(o=>o.isFailure)}get objects(){return this._collection.filter(o=>o.isSuccess).map(o=>o.object)}get errors(){return this._collection.filter(o=>o.isFailure).map(o=>o.error)}}const _d=2,za={amount:0,scale:_d},ve=class ve extends ns{constructor(r,a,l){super(r);Se(this,"_isNull");Se(this,"_options");Se(this,"isEmpty",()=>this.isNull());Se(this,"isNull",()=>this._isNull);this._isNull=Object.freeze(a),this._options=Object.freeze(l)}static validate(r,a,l){const c=Pe.RULE_ALLOW_NULL_OR_UNDEFINED,d=Pe.RULE_ALLOW_EMPTY,m=Pe.RULE_IS_TYPE_NUMBER.label(l.label?l.label:"amount"),p=Pe.RULE_IS_TYPE_STRING.regex(/^[-]?\d+$/).label(l.label?l.label:"amount"),x=Et.number().min(ve.MIN_SCALE).max(ve.MAX_SCALE).label(l.label?l.label:"scale"),v=new vd([Pe.validate(Et.alternatives(c,d,m,p),r),Pe.validate(Et.alternatives(Pe.RULE_IS_TYPE_NUMBER.label(l.label?l.label:"scale"),x),a)]);if(v.hasSomeFaultyResult())return v.getFirstFaultyResult();let j=typeof r=="string"?parseInt(r,10):Number(r),y=Pa.isNull(a)?ve.DEFAULT_SCALE:Number(a);const _=j/Math.pow(10,y);return _ve.MAX_VALUE?qe.fail(new Error(`Value with scale is out of range: ${_}`)):qe.ok()}static create(r=za,a={}){if(r===null)throw new Error("InvalidParams: props params is missing");const{amount:l=za.amount,scale:c=za.scale}=r,d={label:"percentage",...a},m=ve.validate(l,c,d);if(m.isFailure)return qe.fail(ir(sr.INVALID_INPUT_DATA,m.error.message,d));let p=ve._sanitize(l);const x={amount:Pa.isNull(p)?0:p,scale:c};return qe.ok(new this(x,Pa.isNull(p),a))}static createFromFormattedValue(r,a={}){if(r===null||r==="")return ve.create({amount:null,scale:ve.DEFAULT_SCALE});const l=String(r),[c,d]=l.split(",");let m=c,p=2;return d===void 0?p=0:(d===""&&(m=c+d.padEnd(1,"0"),p=1),d.length===1?(m=c+d.padEnd(1,"0"),p=1):d.length===2&&(m=c+d.padEnd(2,"0"),p=2)),ve.create({amount:m,scale:p},a)}static _sanitize(r){let a=null;return typeof r=="string"?a=parseInt(r,10):a=r,a}static _toString(r,a){if(r===null)return"";const l=Math.pow(10,a);return(Number(r)/l).toFixed(a)}static _isWithinRange(r,a){const l=Number(ve._toString(r,a));return l>=ve.MIN_VALUE&&l<=ve.MAX_VALUE}get amount(){var r;return this.isNull()?null:Number((r=this.props)==null?void 0:r.amount)}get scale(){var r;return Number((r=this.props)==null?void 0:r.scale)}getAmount(){var r;return this.isNull()?null:Number((r=this.props)==null?void 0:r.amount)}getScale(){var r;return this.isNull()?0:Number((r=this.props)==null?void 0:r.scale)}toString(){return ve._toString(this.amount,this.scale)}toNumber(){return this.isNull()?0:Number(this.toString())}toFormat(){return this._isNull?"":Intl.NumberFormat("es-ES",{maximumFractionDigits:2}).format(this.toNumber())}toPrimitive(){return this.scale!==ve.DEFAULT_SCALE?this.convertScale(ve.DEFAULT_SCALE).toPrimitive():this.amount}toPrimitives(){return this.toObject()}toObject(){return{amount:this.amount,scale:this.scale}}convertScale(r){if(rve.MAX_SCALE)throw new Error(`Scale out of range: ${r}`);if(this.isNull())return new ve({amount:null,scale:r},!0,this._options);const a=Math.pow(10,this.scale),l=Number(this.amount)/a,c=Math.pow(10,r),d=Math.round(l*c);if(!ve._isWithinRange(d,r))throw new Error(`Value out of range after conversion: ${d} ${r}`);return new ve({amount:d,scale:r},!1,this._options)}hasSameScale(r){return this.scale===r.scale}isWithinRange(){return ve._isWithinRange(this.amount,this.scale)}};Se(ve,"DEFAULT_SCALE",_d),Se(ve,"MIN_VALUE",0),Se(ve,"MAX_VALUE",100),Se(ve,"MIN_SCALE",0),Se(ve,"MAX_SCALE",2);let Vt=ve;const bd=2,Va={amount:0,scale:bd},be=class be extends ns{constructor(r,a,l){super(r);Se(this,"_isNull");Se(this,"_options");Se(this,"isEmpty",()=>this.isNull());Se(this,"isNull",()=>this._isNull);this._isNull=Object.freeze(a),this._options=Object.freeze(l)}static validate(r,a,l={}){const c=Pe.RULE_ALLOW_NULL_OR_UNDEFINED,d=Pe.RULE_ALLOW_EMPTY,m=Pe.RULE_IS_TYPE_NUMBER.label(l.label?l.label:"amount"),p=Pe.RULE_IS_TYPE_STRING.regex(/^[-]?\d+$/).label(l.label?l.label:"amount"),x=Et.number().min(be.MIN_SCALE).max(be.MAX_SCALE).label(l.label?l.label:"scale"),v=new vd([Pe.validate(Et.alternatives(c,d,m,p),r),Pe.validate(Et.alternatives(Pe.RULE_IS_TYPE_NUMBER.label(l.label?l.label:"scale"),x),a)]);return v.hasSomeFaultyResult()?v.getFirstFaultyResult():qe.ok()}static create(r=Va,a={}){if(r===null)throw new Error("InvalidParams: props params is missing");const{amount:l=Va.amount,scale:c=Va.scale}=r,d={label:"quantity",...a},m=be.validate(l,c,d);if(m.isFailure)return qe.fail(ir(sr.INVALID_INPUT_DATA,m.error.message,d));let p=be._sanitize(l);const x={amount:p===null?0:p,scale:c};return qe.ok(new be(x,p===null,a))}static createFromFormattedValue(r,a={}){if(r===null||r==="")return be.create({amount:null,scale:be.DEFAULT_SCALE});const l=String(r),[c,d]=l.split(",");let m=c,p=2;return d===void 0?p=0:(d===""&&(m=c+d.padEnd(1,"0"),p=1),d.length===1?(m=c+d.padEnd(1,"0"),p=1):d.length===2&&(m=c+d.padEnd(2,"0"),p=2)),be.create({amount:m,scale:p},a)}static _sanitize(r){let a=null;return typeof r=="string"?a=parseInt(r,10):a=r,a}static _toString(r,a){if(r===null)return"";const l=Math.pow(10,a);return(Number(r)/l).toFixed(a)}get amount(){var r;return this.isNull()?null:Number((r=this.props)==null?void 0:r.amount)}get scale(){var r;return Number((r=this.props)==null?void 0:r.scale)}getAmount(){var r;return this.isNull()?null:Number((r=this.props)==null?void 0:r.amount)}getScale(){var r;return this.isNull()?0:Number((r=this.props)==null?void 0:r.scale)}toString(){return be._toString(this.amount,this.scale)}toNumber(){return this.isNull()?0:Number(this.toString())}toFormat(){return this._isNull?"":Intl.NumberFormat("es-ES",{maximumFractionDigits:2}).format(this.toNumber())}toPrimitive(){return this.scale!==be.DEFAULT_SCALE?this.convertScale(be.DEFAULT_SCALE).toPrimitive():this.amount}toPrimitives(){return this.toObject()}toObject(){return{amount:this.amount,scale:this.scale}}convertScale(r){if(rbe.MAX_SCALE)throw new Error(`Scale out of range: ${r}`);if(this.isNull())return new be({amount:null,scale:r},!0,this._options);const a=Math.pow(10,this.scale),l=Number(this.amount)/a,c=Math.pow(10,r),d=Math.round(l*c);return new be({amount:d,scale:r},!1,this._options)}hasSameScale(r){return this.scale===r.scale}increment(r){return this.isNull()?r?be.create(r.toObject()):be.create():r?this.hasSameScale(r)?be.create({amount:Number(this.amount)+Number(r.amount),scale:this.scale},this._options):qe.fail(Error("No se pueden sumar cantidades con diferentes escalas.")):be.create({amount:Number(this.amount)+1,scale:this.scale},this._options)}decrement(r){return this.isNull()?r?be.create(r.toObject()):be.create():r?this.hasSameScale(r)?be.create({amount:Number(this.amount)-Number(r.amount),scale:this.scale},this._options):qe.fail(Error("No se pueden restar cantidades con diferentes escalas.")):be.create({amount:Number(this.amount)-1,scale:this.scale},this._options)}};Se(be,"DEFAULT_SCALE",bd),Se(be,"MIN_SCALE",0),Se(be,"MAX_SCALE",2);let Sn=be;const jc=2;class Q0 extends Tt{static create(o){const{amount:r,currencyCode:a,scale:l=jc}=o,c=Tt.create({amount:r,currencyCode:a,scale:l});if(c.isFailure)return c;const d=c.object.convertScale(jc);return qe.ok(d)}}class rr extends $_{constructor(){super(...arguments);Se(this,"isValid",()=>!isNaN(this.props.valueOf())&&this.props.valueOf()!==0);Se(this,"isEmpty",()=>!this.isValid());Se(this,"toISO8601",()=>this.isValid()?this.props.toISOString():"");Se(this,"toDateString",()=>this.isValid()?this.props.toDateString():"");Se(this,"toLocaleDateString",(r,a)=>this.isValid()?this.props.toLocaleDateString(r,a):"");Se(this,"toLocaleTimeString",()=>this.isValid()?this.props.toLocaleTimeString():"")}static validate(r,a){const l=Pe.RULE_ALLOW_EMPTY.default(0),c=Et.date().label(String(a.label)),d=Et.alternatives(l,c);return Pe.validate(d,r)}static createCurrentDate(){return qe.ok(new rr(new Date))}static create(r,a={}){const l={...a,dateFormat:a.dateFormat?a.dateFormat:"YYYY-MM-DD",label:a.label?a.label:"date"},c=rr.validate(r,l);return c.isFailure?qe.fail(ir(sr.INVALID_INPUT_DATA,c.error.message,l)):qe.ok(new rr(new Date(c.object)))}toString(){if(!this.isEmpty()){const r=this.props.getFullYear(),a=String(this.props.getMonth()+1).padStart(2,"0"),l=String(this.props.getDate()).padStart(2,"0");return`${r}-${a}-${l}`}return""}toPrimitive(){return this.toISO8601()}}const X0=({isPending:n,interval:o=1e3,onInterval:r})=>{const[a,l]=L.useState(void 0);return L.useEffect(()=>{let c;return n&&(c=setInterval(()=>{l(d=>d===void 0?o:d+o)},o)),()=>{clearInterval(c),l(void 0)}},[n,o]),L.useEffect(()=>{r&&a&&r(a)},[a]),{elapsedTime:a}},Z0=2*60*1e3,J0=60*1e3,Ao=({queryKey:n,queryFn:o,enabled:r,select:a,queryOptions:l={},overtimeOptions:c})=>{const[d,m]=L.useState(!1),p=Mc({queryKey:n,queryFn:o,placeholderData:Dc,staleTime:J0,refetchInterval:Z0,refetchOnWindowFocus:!0,enabled:r&&!!o,select:a,...l});L.useEffect(()=>{p.isSuccess&&U0(p.data)&&m(p.data.total_items===0)},[p]);const{elapsedTime:x}=X0({isPending:p.isFetching,interval:c==null?void 0:c.interval,onInterval:c==null?void 0:c.onInterval});return{...p,overtime:{elapsedTime:x},isEmpty:d}},wd=n=>Mc({placeholderData:Dc,...n});function eb(n){return nn({...n})}/** + */const xd=Ne("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]),U0=({className:n,...o})=>i.jsx(q_,{className:he("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",n),...o}),wc=P_,z0=({withHandle:n,className:o,...r})=>i.jsx(k_,{className:he("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",o),...r,children:n&&i.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:i.jsx(hd,{className:"h-2.5 w-2.5"})})});function ut({className:n,...o}){return i.jsx("div",{className:he("animate-pulse rounded-md bg-muted",n),...o})}const V0=n=>typeof n=="object"&&n!==null&&n.hasOwnProperty("total_items");let Gi;const H0=new Uint8Array(16);function G0(){if(!Gi&&(Gi=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Gi))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Gi(H0)}const Ke=[];for(let n=0;n<256;++n)Ke.push((n+256).toString(16).slice(1));function K0(n,o=0){return Ke[n[o+0]]+Ke[n[o+1]]+Ke[n[o+2]]+Ke[n[o+3]]+"-"+Ke[n[o+4]]+Ke[n[o+5]]+"-"+Ke[n[o+6]]+Ke[n[o+7]]+"-"+Ke[n[o+8]]+Ke[n[o+9]]+"-"+Ke[n[o+10]]+Ke[n[o+11]]+Ke[n[o+12]]+Ke[n[o+13]]+Ke[n[o+14]]+Ke[n[o+15]]}const W0=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Sc={randomUUID:W0};function Q0(n,o,r){if(Sc.randomUUID&&!n)return Sc.randomUUID();n=n||{};const a=n.random||(n.rng||G0)();return a[6]=a[6]&15|64,a[8]=a[8]&63|128,K0(a)}class mn extends ns{static validate(o,r){const a=Pe.RULE_ALLOW_EMPTY.default(""),l=Et.string().guid({version:["uuidv4"]}).label(r.label?r.label:"id"),c=Et.alternatives(a,l);return Pe.validate(c,o)}static sanitize(o){return o.trim()}static create(o,r={}){const a={label:"id",generateOnEmpty:!1,...r};if(!o&&!a.generateOnEmpty)return qe.fail(ir(sr.INVALID_INPUT_DATA,"ID is null or empty"));if(o){const l=mn.validate(o,a);return l.isFailure?qe.fail(ir(sr.INVALID_INPUT_DATA,l.error.message,a)):qe.ok(new mn(mn.sanitize(l.object)))}return a.generateOnEmpty?mn.generateNewID():qe.ok(new mn(null))}static generateNewID(){return qe.ok(new mn(Q0()))}get value(){return String(this.props)}toString(){return String(this.props)}toPrimitive(){return this.toString()}}const $a={aa:{name:"Afar",nativeName:"Afaraf"},ab:{name:"Abkhaz",nativeName:"аҧсуа бызшәа"},ae:{name:"Avestan",nativeName:"avesta"},af:{name:"Afrikaans",nativeName:"Afrikaans"},ak:{name:"Akan",nativeName:"Akan"},am:{name:"Amharic",nativeName:"አማርኛ"},an:{name:"Aragonese",nativeName:"aragonés"},ar:{name:"Arabic",nativeName:"اَلْعَرَبِيَّةُ"},as:{name:"Assamese",nativeName:"অসমীয়া"},av:{name:"Avaric",nativeName:"авар мацӀ"},ay:{name:"Aymara",nativeName:"aymar aru"},az:{name:"Azerbaijani",nativeName:"azərbaycan dili"},ba:{name:"Bashkir",nativeName:"башҡорт теле"},be:{name:"Belarusian",nativeName:"беларуская мова"},bg:{name:"Bulgarian",nativeName:"български език"},bi:{name:"Bislama",nativeName:"Bislama"},bm:{name:"Bambara",nativeName:"bamanankan"},bn:{name:"Bengali",nativeName:"বাংলা"},bo:{name:"Tibetan",nativeName:"བོད་ཡིག"},br:{name:"Breton",nativeName:"brezhoneg"},bs:{name:"Bosnian",nativeName:"bosanski jezik"},ca:{name:"Catalan",nativeName:"Català"},ce:{name:"Chechen",nativeName:"нохчийн мотт"},ch:{name:"Chamorro",nativeName:"Chamoru"},co:{name:"Corsican",nativeName:"corsu"},cr:{name:"Cree",nativeName:"ᓀᐦᐃᔭᐍᐏᐣ"},cs:{name:"Czech",nativeName:"čeština"},cu:{name:"Old Church Slavonic",nativeName:"ѩзыкъ словѣньскъ"},cv:{name:"Chuvash",nativeName:"чӑваш чӗлхи"},cy:{name:"Welsh",nativeName:"Cymraeg"},da:{name:"Danish",nativeName:"dansk"},de:{name:"German",nativeName:"Deutsch"},dv:{name:"Divehi",nativeName:"ދިވެހި"},dz:{name:"Dzongkha",nativeName:"རྫོང་ཁ"},ee:{name:"Ewe",nativeName:"Eʋegbe"},el:{name:"Greek",nativeName:"Ελληνικά"},en:{name:"English",nativeName:"English"},eo:{name:"Esperanto",nativeName:"Esperanto"},es:{name:"Spanish",nativeName:"Español"},et:{name:"Estonian",nativeName:"eesti"},eu:{name:"Basque",nativeName:"euskara"},fa:{name:"Persian",nativeName:"فارسی"},ff:{name:"Fula",nativeName:"Fulfulde"},fi:{name:"Finnish",nativeName:"suomi"},fj:{name:"Fijian",nativeName:"vosa Vakaviti"},fo:{name:"Faroese",nativeName:"føroyskt"},fr:{name:"French",nativeName:"Français"},fy:{name:"Western Frisian",nativeName:"Frysk"},ga:{name:"Irish",nativeName:"Gaeilge"},gd:{name:"Scottish Gaelic",nativeName:"Gàidhlig"},gl:{name:"Galician",nativeName:"galego"},gn:{name:"Guaraní",nativeName:"Avañe'ẽ"},gu:{name:"Gujarati",nativeName:"ગુજરાતી"},gv:{name:"Manx",nativeName:"Gaelg"},ha:{name:"Hausa",nativeName:"هَوُسَ"},he:{name:"Hebrew",nativeName:"עברית"},hi:{name:"Hindi",nativeName:"हिन्दी"},ho:{name:"Hiri Motu",nativeName:"Hiri Motu"},hr:{name:"Croatian",nativeName:"Hrvatski"},ht:{name:"Haitian",nativeName:"Kreyòl ayisyen"},hu:{name:"Hungarian",nativeName:"magyar"},hy:{name:"Armenian",nativeName:"Հայերեն"},hz:{name:"Herero",nativeName:"Otjiherero"},ia:{name:"Interlingua",nativeName:"Interlingua"},id:{name:"Indonesian",nativeName:"Bahasa Indonesia"},ie:{name:"Interlingue",nativeName:"Interlingue"},ig:{name:"Igbo",nativeName:"Asụsụ Igbo"},ii:{name:"Nuosu",nativeName:"ꆈꌠ꒿ Nuosuhxop"},ik:{name:"Inupiaq",nativeName:"Iñupiaq"},io:{name:"Ido",nativeName:"Ido"},is:{name:"Icelandic",nativeName:"Íslenska"},it:{name:"Italian",nativeName:"Italiano"},iu:{name:"Inuktitut",nativeName:"ᐃᓄᒃᑎᑐᑦ"},ja:{name:"Japanese",nativeName:"日本語"},jv:{name:"Javanese",nativeName:"basa Jawa"},ka:{name:"Georgian",nativeName:"ქართული"},kg:{name:"Kongo",nativeName:"Kikongo"},ki:{name:"Kikuyu",nativeName:"Gĩkũyũ"},kj:{name:"Kwanyama",nativeName:"Kuanyama"},kk:{name:"Kazakh",nativeName:"қазақ тілі"},kl:{name:"Kalaallisut",nativeName:"kalaallisut"},km:{name:"Khmer",nativeName:"ខេមរភាសា"},kn:{name:"Kannada",nativeName:"ಕನ್ನಡ"},ko:{name:"Korean",nativeName:"한국어"},kr:{name:"Kanuri",nativeName:"Kanuri"},ks:{name:"Kashmiri",nativeName:"कश्मीरी"},ku:{name:"Kurdish",nativeName:"Kurdî"},kv:{name:"Komi",nativeName:"коми кыв"},kw:{name:"Cornish",nativeName:"Kernewek"},ky:{name:"Kyrgyz",nativeName:"Кыргызча"},la:{name:"Latin",nativeName:"latine"},lb:{name:"Luxembourgish",nativeName:"Lëtzebuergesch"},lg:{name:"Ganda",nativeName:"Luganda"},li:{name:"Limburgish",nativeName:"Limburgs"},ln:{name:"Lingala",nativeName:"Lingála"},lo:{name:"Lao",nativeName:"ພາສາລາວ"},lt:{name:"Lithuanian",nativeName:"lietuvių kalba"},lu:{name:"Luba-Katanga",nativeName:"Kiluba"},lv:{name:"Latvian",nativeName:"latviešu valoda"},mg:{name:"Malagasy",nativeName:"fiteny malagasy"},mh:{name:"Marshallese",nativeName:"Kajin M̧ajeļ"},mi:{name:"Māori",nativeName:"te reo Māori"},mk:{name:"Macedonian",nativeName:"македонски јазик"},ml:{name:"Malayalam",nativeName:"മലയാളം"},mn:{name:"Mongolian",nativeName:"Монгол хэл"},mr:{name:"Marathi",nativeName:"मराठी"},ms:{name:"Malay",nativeName:"Bahasa Melayu"},mt:{name:"Maltese",nativeName:"Malti"},my:{name:"Burmese",nativeName:"ဗမာစာ"},na:{name:"Nauru",nativeName:"Dorerin Naoero"},nb:{name:"Norwegian Bokmål",nativeName:"Norsk bokmål"},nd:{name:"Northern Ndebele",nativeName:"isiNdebele"},ne:{name:"Nepali",nativeName:"नेपाली"},ng:{name:"Ndonga",nativeName:"Owambo"},nl:{name:"Dutch",nativeName:"Nederlands"},nn:{name:"Norwegian Nynorsk",nativeName:"Norsk nynorsk"},no:{name:"Norwegian",nativeName:"Norsk"},nr:{name:"Southern Ndebele",nativeName:"isiNdebele"},nv:{name:"Navajo",nativeName:"Diné bizaad"},ny:{name:"Chichewa",nativeName:"chiCheŵa"},oc:{name:"Occitan",nativeName:"occitan"},oj:{name:"Ojibwe",nativeName:"ᐊᓂᔑᓈᐯᒧᐎᓐ"},om:{name:"Oromo",nativeName:"Afaan Oromoo"},or:{name:"Oriya",nativeName:"ଓଡ଼ିଆ"},os:{name:"Ossetian",nativeName:"ирон æвзаг"},pa:{name:"Panjabi",nativeName:"ਪੰਜਾਬੀ"},pi:{name:"Pāli",nativeName:"पाऴि"},pl:{name:"Polish",nativeName:"Polski"},ps:{name:"Pashto",nativeName:"پښتو"},pt:{name:"Portuguese",nativeName:"Português"},qu:{name:"Quechua",nativeName:"Runa Simi"},rm:{name:"Romansh",nativeName:"rumantsch grischun"},rn:{name:"Kirundi",nativeName:"Ikirundi"},ro:{name:"Romanian",nativeName:"Română"},ru:{name:"Russian",nativeName:"Русский"},rw:{name:"Kinyarwanda",nativeName:"Ikinyarwanda"},sa:{name:"Sanskrit",nativeName:"संस्कृतम्"},sc:{name:"Sardinian",nativeName:"sardu"},sd:{name:"Sindhi",nativeName:"सिन्धी"},se:{name:"Northern Sami",nativeName:"Davvisámegiella"},sg:{name:"Sango",nativeName:"yângâ tî sängö"},si:{name:"Sinhala",nativeName:"සිංහල"},sk:{name:"Slovak",nativeName:"slovenčina"},sl:{name:"Slovenian",nativeName:"slovenščina"},sm:{name:"Samoan",nativeName:"gagana fa'a Samoa"},sn:{name:"Shona",nativeName:"chiShona"},so:{name:"Somali",nativeName:"Soomaaliga"},sq:{name:"Albanian",nativeName:"Shqip"},sr:{name:"Serbian",nativeName:"српски језик"},ss:{name:"Swati",nativeName:"SiSwati"},st:{name:"Southern Sotho",nativeName:"Sesotho"},su:{name:"Sundanese",nativeName:"Basa Sunda"},sv:{name:"Swedish",nativeName:"Svenska"},sw:{name:"Swahili",nativeName:"Kiswahili"},ta:{name:"Tamil",nativeName:"தமிழ்"},te:{name:"Telugu",nativeName:"తెలుగు"},tg:{name:"Tajik",nativeName:"тоҷикӣ"},th:{name:"Thai",nativeName:"ไทย"},ti:{name:"Tigrinya",nativeName:"ትግርኛ"},tk:{name:"Turkmen",nativeName:"Türkmençe"},tl:{name:"Tagalog",nativeName:"Wikang Tagalog"},tn:{name:"Tswana",nativeName:"Setswana"},to:{name:"Tonga",nativeName:"faka Tonga"},tr:{name:"Turkish",nativeName:"Türkçe"},ts:{name:"Tsonga",nativeName:"Xitsonga"},tt:{name:"Tatar",nativeName:"татар теле"},tw:{name:"Twi",nativeName:"Twi"},ty:{name:"Tahitian",nativeName:"Reo Tahiti"},ug:{name:"Uyghur",nativeName:"ئۇيغۇرچە‎"},uk:{name:"Ukrainian",nativeName:"Українська"},ur:{name:"Urdu",nativeName:"اردو"},uz:{name:"Uzbek",nativeName:"Ўзбек"},ve:{name:"Venda",nativeName:"Tshivenḓa"},vi:{name:"Vietnamese",nativeName:"Tiếng Việt"},vo:{name:"Volapük",nativeName:"Volapük"},wa:{name:"Walloon",nativeName:"walon"},wo:{name:"Wolof",nativeName:"Wollof"},xh:{name:"Xhosa",nativeName:"isiXhosa"},yi:{name:"Yiddish",nativeName:"ייִדיש"},yo:{name:"Yoruba",nativeName:"Yorùbá"},za:{name:"Zhuang",nativeName:"Saɯ cueŋƅ"},zh:{name:"Chinese",nativeName:"中文"},zu:{name:"Zulu",nativeName:"isiZulu"}},hn=class hn extends ns{constructor(){super(...arguments);Se(this,"toString",()=>this.code)}static validate(r,a){const l=Et.alternatives(Pe.RULE_ALLOW_EMPTY.default(""),Et.string().lowercase().valid(...Object.keys($a)).label(String(a.label)));return Pe.validate(l,r)}static sanitize(r){return r?String(r).toLowerCase():void 0}static createFromCode(r,a={}){const l={...a,label:a.label?a.label:"lang_code"},c=hn.validate(r,l);if(c.isFailure)return qe.fail(ir(sr.INVALID_INPUT_DATA,c.error.message,l));const d=hn.sanitize(c.object),m=d?{...$a[c.object],code:d}:void 0;return qe.ok(new hn(m))}static createDefaultCode(){return hn.createFromCode(this.DEFAULT_LANGUAGE_CODE)}get name(){return this.props?String(this.props.name):""}get nativeName(){return this.props?String(this.props.nativeName):""}get code(){return this.props?String(this.props.code):""}isEmpty(){return this.isNull()||this.props===void 0}toPrimitive(){return this.toString()}};Se(hn,"DEFAULT_LANGUAGE_CODE","es"),Se(hn,"LANGUAGES",$a);let Hr=hn;class vd{constructor(o){Se(this,"_collection",[]);this._collection=o??[]}add(o){this._collection.push(o)}reset(){this._collection=[]}hasSomeFaultyResult(){return this._collection.some(o=>o.isFailure)}getFirstFaultyResult(){return this._collection.find(o=>o.isFailure)}getAllFaultyResults(){return this._collection.filter(o=>o.isFailure)}get objects(){return this._collection.filter(o=>o.isSuccess).map(o=>o.object)}get errors(){return this._collection.filter(o=>o.isFailure).map(o=>o.error)}}const _d=2,Ba={amount:0,scale:_d},ve=class ve extends ns{constructor(r,a,l){super(r);Se(this,"_isNull");Se(this,"_options");Se(this,"isEmpty",()=>this.isNull());Se(this,"isNull",()=>this._isNull);this._isNull=Object.freeze(a),this._options=Object.freeze(l)}static validate(r,a,l){const c=Pe.RULE_ALLOW_NULL_OR_UNDEFINED,d=Pe.RULE_ALLOW_EMPTY,m=Pe.RULE_IS_TYPE_NUMBER.label(l.label?l.label:"amount"),p=Pe.RULE_IS_TYPE_STRING.regex(/^[-]?\d+$/).label(l.label?l.label:"amount"),x=Et.number().min(ve.MIN_SCALE).max(ve.MAX_SCALE).label(l.label?l.label:"scale"),v=new vd([Pe.validate(Et.alternatives(c,d,m,p),r),Pe.validate(Et.alternatives(Pe.RULE_IS_TYPE_NUMBER.label(l.label?l.label:"scale"),x),a)]);if(v.hasSomeFaultyResult())return v.getFirstFaultyResult();let j=typeof r=="string"?parseInt(r,10):Number(r),y=Pa.isNull(a)?ve.DEFAULT_SCALE:Number(a);const _=j/Math.pow(10,y);return _ve.MAX_VALUE?qe.fail(new Error(`Value with scale is out of range: ${_}`)):qe.ok()}static create(r=Ba,a={}){if(r===null)throw new Error("InvalidParams: props params is missing");const{amount:l=Ba.amount,scale:c=Ba.scale}=r,d={label:"percentage",...a},m=ve.validate(l,c,d);if(m.isFailure)return qe.fail(ir(sr.INVALID_INPUT_DATA,m.error.message,d));let p=ve._sanitize(l);const x={amount:Pa.isNull(p)?0:p,scale:c};return qe.ok(new this(x,Pa.isNull(p),a))}static createFromFormattedValue(r,a={}){if(r===null||r==="")return ve.create({amount:null,scale:ve.DEFAULT_SCALE});const l=String(r),[c,d]=l.split(",");let m=c,p=2;return d===void 0?p=0:(d===""&&(m=c+d.padEnd(1,"0"),p=1),d.length===1?(m=c+d.padEnd(1,"0"),p=1):d.length===2&&(m=c+d.padEnd(2,"0"),p=2)),ve.create({amount:m,scale:p},a)}static _sanitize(r){let a=null;return typeof r=="string"?a=parseInt(r,10):a=r,a}static _toString(r,a){if(r===null)return"";const l=Math.pow(10,a);return(Number(r)/l).toFixed(a)}static _isWithinRange(r,a){const l=Number(ve._toString(r,a));return l>=ve.MIN_VALUE&&l<=ve.MAX_VALUE}get amount(){var r;return this.isNull()?null:Number((r=this.props)==null?void 0:r.amount)}get scale(){var r;return Number((r=this.props)==null?void 0:r.scale)}getAmount(){var r;return this.isNull()?null:Number((r=this.props)==null?void 0:r.amount)}getScale(){var r;return this.isNull()?0:Number((r=this.props)==null?void 0:r.scale)}toString(){return ve._toString(this.amount,this.scale)}toNumber(){return this.isNull()?0:Number(this.toString())}toFormat(){return this._isNull?"":Intl.NumberFormat("es-ES",{maximumFractionDigits:2}).format(this.toNumber())}toPrimitive(){return this.scale!==ve.DEFAULT_SCALE?this.convertScale(ve.DEFAULT_SCALE).toPrimitive():this.amount}toPrimitives(){return this.toObject()}toObject(){return{amount:this.amount,scale:this.scale}}convertScale(r){if(rve.MAX_SCALE)throw new Error(`Scale out of range: ${r}`);if(this.isNull())return new ve({amount:null,scale:r},!0,this._options);const a=Math.pow(10,this.scale),l=Number(this.amount)/a,c=Math.pow(10,r),d=Math.round(l*c);if(!ve._isWithinRange(d,r))throw new Error(`Value out of range after conversion: ${d} ${r}`);return new ve({amount:d,scale:r},!1,this._options)}hasSameScale(r){return this.scale===r.scale}isWithinRange(){return ve._isWithinRange(this.amount,this.scale)}};Se(ve,"DEFAULT_SCALE",_d),Se(ve,"MIN_VALUE",0),Se(ve,"MAX_VALUE",100),Se(ve,"MIN_SCALE",0),Se(ve,"MAX_SCALE",2);let Ut=ve;const bd=2,Ua={amount:0,scale:bd},be=class be extends ns{constructor(r,a,l){super(r);Se(this,"_isNull");Se(this,"_options");Se(this,"isEmpty",()=>this.isNull());Se(this,"isNull",()=>this._isNull);this._isNull=Object.freeze(a),this._options=Object.freeze(l)}static validate(r,a,l={}){const c=Pe.RULE_ALLOW_NULL_OR_UNDEFINED,d=Pe.RULE_ALLOW_EMPTY,m=Pe.RULE_IS_TYPE_NUMBER.label(l.label?l.label:"amount"),p=Pe.RULE_IS_TYPE_STRING.regex(/^[-]?\d+$/).label(l.label?l.label:"amount"),x=Et.number().min(be.MIN_SCALE).max(be.MAX_SCALE).label(l.label?l.label:"scale"),v=new vd([Pe.validate(Et.alternatives(c,d,m,p),r),Pe.validate(Et.alternatives(Pe.RULE_IS_TYPE_NUMBER.label(l.label?l.label:"scale"),x),a)]);return v.hasSomeFaultyResult()?v.getFirstFaultyResult():qe.ok()}static create(r=Ua,a={}){if(r===null)throw new Error("InvalidParams: props params is missing");const{amount:l=Ua.amount,scale:c=Ua.scale}=r,d={label:"quantity",...a},m=be.validate(l,c,d);if(m.isFailure)return qe.fail(ir(sr.INVALID_INPUT_DATA,m.error.message,d));let p=be._sanitize(l);const x={amount:p===null?0:p,scale:c};return qe.ok(new be(x,p===null,a))}static createFromFormattedValue(r,a={}){if(r===null||r==="")return be.create({amount:null,scale:be.DEFAULT_SCALE});const l=String(r),[c,d]=l.split(",");let m=c,p=2;return d===void 0?p=0:(d===""&&(m=c+d.padEnd(1,"0"),p=1),d.length===1?(m=c+d.padEnd(1,"0"),p=1):d.length===2&&(m=c+d.padEnd(2,"0"),p=2)),be.create({amount:m,scale:p},a)}static _sanitize(r){let a=null;return typeof r=="string"?a=parseInt(r,10):a=r,a}static _toString(r,a){if(r===null)return"";const l=Math.pow(10,a);return(Number(r)/l).toFixed(a)}get amount(){var r;return this.isNull()?null:Number((r=this.props)==null?void 0:r.amount)}get scale(){var r;return Number((r=this.props)==null?void 0:r.scale)}getAmount(){var r;return this.isNull()?null:Number((r=this.props)==null?void 0:r.amount)}getScale(){var r;return this.isNull()?0:Number((r=this.props)==null?void 0:r.scale)}toString(){return be._toString(this.amount,this.scale)}toNumber(){return this.isNull()?0:Number(this.toString())}toFormat(){return this._isNull?"":Intl.NumberFormat("es-ES",{maximumFractionDigits:2}).format(this.toNumber())}toPrimitive(){return this.scale!==be.DEFAULT_SCALE?this.convertScale(be.DEFAULT_SCALE).toPrimitive():this.amount}toPrimitives(){return this.toObject()}toObject(){return{amount:this.amount,scale:this.scale}}convertScale(r){if(rbe.MAX_SCALE)throw new Error(`Scale out of range: ${r}`);if(this.isNull())return new be({amount:null,scale:r},!0,this._options);const a=Math.pow(10,this.scale),l=Number(this.amount)/a,c=Math.pow(10,r),d=Math.round(l*c);return new be({amount:d,scale:r},!1,this._options)}hasSameScale(r){return this.scale===r.scale}increment(r){return this.isNull()?r?be.create(r.toObject()):be.create():r?this.hasSameScale(r)?be.create({amount:Number(this.amount)+Number(r.amount),scale:this.scale},this._options):qe.fail(Error("No se pueden sumar cantidades con diferentes escalas.")):be.create({amount:Number(this.amount)+1,scale:this.scale},this._options)}decrement(r){return this.isNull()?r?be.create(r.toObject()):be.create():r?this.hasSameScale(r)?be.create({amount:Number(this.amount)-Number(r.amount),scale:this.scale},this._options):qe.fail(Error("No se pueden restar cantidades con diferentes escalas.")):be.create({amount:Number(this.amount)-1,scale:this.scale},this._options)}};Se(be,"DEFAULT_SCALE",bd),Se(be,"MIN_SCALE",0),Se(be,"MAX_SCALE",2);let Sn=be;const jc=2;class Y0 extends Dt{static create(o){const{amount:r,currencyCode:a,scale:l=jc}=o,c=Dt.create({amount:r,currencyCode:a,scale:l});if(c.isFailure)return c;const d=c.object.convertScale(jc);return qe.ok(d)}}class rr extends $_{constructor(){super(...arguments);Se(this,"isValid",()=>!isNaN(this.props.valueOf())&&this.props.valueOf()!==0);Se(this,"isEmpty",()=>!this.isValid());Se(this,"toISO8601",()=>this.isValid()?this.props.toISOString():"");Se(this,"toDateString",()=>this.isValid()?this.props.toDateString():"");Se(this,"toLocaleDateString",(r,a)=>this.isValid()?this.props.toLocaleDateString(r,a):"");Se(this,"toLocaleTimeString",()=>this.isValid()?this.props.toLocaleTimeString():"")}static validate(r,a){const l=Pe.RULE_ALLOW_EMPTY.default(0),c=Et.date().label(String(a.label)),d=Et.alternatives(l,c);return Pe.validate(d,r)}static createCurrentDate(){return qe.ok(new rr(new Date))}static create(r,a={}){const l={...a,dateFormat:a.dateFormat?a.dateFormat:"YYYY-MM-DD",label:a.label?a.label:"date"},c=rr.validate(r,l);return c.isFailure?qe.fail(ir(sr.INVALID_INPUT_DATA,c.error.message,l)):qe.ok(new rr(new Date(c.object)))}toString(){if(!this.isEmpty()){const r=this.props.getFullYear(),a=String(this.props.getMonth()+1).padStart(2,"0"),l=String(this.props.getDate()).padStart(2,"0");return`${r}-${a}-${l}`}return""}toPrimitive(){return this.toISO8601()}}const Z0=({isPending:n,interval:o=1e3,onInterval:r})=>{const[a,l]=O.useState(void 0);return O.useEffect(()=>{let c;return n&&(c=setInterval(()=>{l(d=>d===void 0?o:d+o)},o)),()=>{clearInterval(c),l(void 0)}},[n,o]),O.useEffect(()=>{r&&a&&r(a)},[a]),{elapsedTime:a}},X0=2*60*1e3,J0=60*1e3,Ao=({queryKey:n,queryFn:o,enabled:r,select:a,queryOptions:l={},overtimeOptions:c})=>{const[d,m]=O.useState(!1),p=Mc({queryKey:n,queryFn:o,placeholderData:Tc,staleTime:J0,refetchInterval:X0,refetchOnWindowFocus:!0,enabled:r&&!!o,select:a,...l});O.useEffect(()=>{p.isSuccess&&V0(p.data)&&m(p.data.total_items===0)},[p]);const{elapsedTime:x}=Z0({isPending:p.isFetching,interval:c==null?void 0:c.interval,onInterval:c==null?void 0:c.onInterval});return{...p,overtime:{elapsedTime:x},isEmpty:d}},wd=n=>Mc({placeholderData:Tc,...n});function eb(n){return nn({...n})}/** * table-core * * Copyright (c) TanStack @@ -132,10 +132,10 @@ var T_=Object.defineProperty;var O_=(n,o,r)=>o in n?T_(n,o,{enumerable:!0,config * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function tb(){return{accessor:(n,o)=>typeof n=="function"?{...o,accessorFn:n}:{...o,accessorKey:n},display:n=>n,group:n=>n}}function vn(n,o){return typeof n=="function"?n(o):n}function xt(n,o){return r=>{o.setState(a=>({...a,[n]:vn(r,a[n])}))}}function ds(n){return n instanceof Function}function nb(n){return Array.isArray(n)&&n.every(o=>typeof o=="number")}function rb(n,o){const r=[],a=l=>{l.forEach(c=>{r.push(c);const d=o(c);d!=null&&d.length&&a(d)})};return a(n),r}function Q(n,o,r){let a=[],l;return c=>{let d;r.key&&r.debug&&(d=Date.now());const m=n(c);if(!(m.length!==a.length||m.some((v,j)=>a[j]!==v)))return l;a=m;let x;if(r.key&&r.debug&&(x=Date.now()),l=o(...m),r==null||r.onChange==null||r.onChange(l),r.key&&r.debug&&r!=null&&r.debug()){const v=Math.round((Date.now()-d)*100)/100,j=Math.round((Date.now()-x)*100)/100,y=j/16,_=(E,R)=>{for(E=String(E);E.lengthtypeof n=="function"?{...o,accessorFn:n}:{...o,accessorKey:n},display:n=>n,group:n=>n}}function vn(n,o){return typeof n=="function"?n(o):n}function xt(n,o){return r=>{o.setState(a=>({...a,[n]:vn(r,a[n])}))}}function ds(n){return n instanceof Function}function nb(n){return Array.isArray(n)&&n.every(o=>typeof o=="number")}function rb(n,o){const r=[],a=l=>{l.forEach(c=>{r.push(c);const d=o(c);d!=null&&d.length&&a(d)})};return a(n),r}function Y(n,o,r){let a=[],l;return c=>{let d;r.key&&r.debug&&(d=Date.now());const m=n(c);if(!(m.length!==a.length||m.some((v,j)=>a[j]!==v)))return l;a=m;let x;if(r.key&&r.debug&&(x=Date.now()),l=o(...m),r==null||r.onChange==null||r.onChange(l),r.key&&r.debug&&r!=null&&r.debug()){const v=Math.round((Date.now()-d)*100)/100,j=Math.round((Date.now()-x)*100)/100,y=j/16,_=(E,R)=>{for(E=String(E);E.length{var l;return(l=n==null?void 0:n.debugAll)!=null?l:n[o]},key:!1,onChange:a}}function ib(n,o,r,a){const l=()=>{var d;return(d=c.getValue())!=null?d:n.options.renderFallbackValue},c={id:`${o.id}_${r.id}`,row:o,column:r,getValue:()=>o.getValue(a),renderValue:l,getContext:Q(()=>[n,r,o,c],(d,m,p,x)=>({table:d,column:m,row:p,cell:x,getValue:x.getValue,renderValue:x.renderValue}),X(n.options,"debugCells"))};return n._features.forEach(d=>{d.createCell==null||d.createCell(c,r,o,n)},{}),c}function sb(n,o,r,a){var l,c;const m={...n._getDefaultColumnDef(),...o},p=m.accessorKey;let x=(l=(c=m.id)!=null?c:p?typeof String.prototype.replaceAll=="function"?p.replaceAll(".","_"):p.replace(/\./g,"_"):void 0)!=null?l:typeof m.header=="string"?m.header:void 0,v;if(m.accessorFn?v=m.accessorFn:p&&(p.includes(".")?v=y=>{let _=y;for(const R of p.split(".")){var E;_=(E=_)==null?void 0:E[R]}return _}:v=y=>y[m.accessorKey]),!x)throw new Error;let j={id:`${String(x)}`,accessorFn:v,parent:a,depth:r,columnDef:m,columns:[],getFlatColumns:Q(()=>[!0],()=>{var y;return[j,...(y=j.columns)==null?void 0:y.flatMap(_=>_.getFlatColumns())]},X(n.options,"debugColumns")),getLeafColumns:Q(()=>[n._getOrderColumnsFn()],y=>{var _;if((_=j.columns)!=null&&_.length){let E=j.columns.flatMap(R=>R.getLeafColumns());return y(E)}return[j]},X(n.options,"debugColumns"))};for(const y of n._features)y.createColumn==null||y.createColumn(j,n);return j}const et="debugHeaders";function Cc(n,o,r){var a;let c={id:(a=r.id)!=null?a:o.id,column:o,index:r.index,isPlaceholder:!!r.isPlaceholder,placeholderId:r.placeholderId,depth:r.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const d=[],m=p=>{p.subHeaders&&p.subHeaders.length&&p.subHeaders.map(m),d.push(p)};return m(c),d},getContext:()=>({table:n,header:c,column:o})};return n._features.forEach(d=>{d.createHeader==null||d.createHeader(c,n)}),c}const ab={createTable:n=>{n.getHeaderGroups=Q(()=>[n.getAllColumns(),n.getVisibleLeafColumns(),n.getState().columnPinning.left,n.getState().columnPinning.right],(o,r,a,l)=>{var c,d;const m=(c=a==null?void 0:a.map(j=>r.find(y=>y.id===j)).filter(Boolean))!=null?c:[],p=(d=l==null?void 0:l.map(j=>r.find(y=>y.id===j)).filter(Boolean))!=null?d:[],x=r.filter(j=>!(a!=null&&a.includes(j.id))&&!(l!=null&&l.includes(j.id)));return Ki(o,[...m,...x,...p],n)},X(n.options,et)),n.getCenterHeaderGroups=Q(()=>[n.getAllColumns(),n.getVisibleLeafColumns(),n.getState().columnPinning.left,n.getState().columnPinning.right],(o,r,a,l)=>(r=r.filter(c=>!(a!=null&&a.includes(c.id))&&!(l!=null&&l.includes(c.id))),Ki(o,r,n,"center")),X(n.options,et)),n.getLeftHeaderGroups=Q(()=>[n.getAllColumns(),n.getVisibleLeafColumns(),n.getState().columnPinning.left],(o,r,a)=>{var l;const c=(l=a==null?void 0:a.map(d=>r.find(m=>m.id===d)).filter(Boolean))!=null?l:[];return Ki(o,c,n,"left")},X(n.options,et)),n.getRightHeaderGroups=Q(()=>[n.getAllColumns(),n.getVisibleLeafColumns(),n.getState().columnPinning.right],(o,r,a)=>{var l;const c=(l=a==null?void 0:a.map(d=>r.find(m=>m.id===d)).filter(Boolean))!=null?l:[];return Ki(o,c,n,"right")},X(n.options,et)),n.getFooterGroups=Q(()=>[n.getHeaderGroups()],o=>[...o].reverse(),X(n.options,et)),n.getLeftFooterGroups=Q(()=>[n.getLeftHeaderGroups()],o=>[...o].reverse(),X(n.options,et)),n.getCenterFooterGroups=Q(()=>[n.getCenterHeaderGroups()],o=>[...o].reverse(),X(n.options,et)),n.getRightFooterGroups=Q(()=>[n.getRightHeaderGroups()],o=>[...o].reverse(),X(n.options,et)),n.getFlatHeaders=Q(()=>[n.getHeaderGroups()],o=>o.map(r=>r.headers).flat(),X(n.options,et)),n.getLeftFlatHeaders=Q(()=>[n.getLeftHeaderGroups()],o=>o.map(r=>r.headers).flat(),X(n.options,et)),n.getCenterFlatHeaders=Q(()=>[n.getCenterHeaderGroups()],o=>o.map(r=>r.headers).flat(),X(n.options,et)),n.getRightFlatHeaders=Q(()=>[n.getRightHeaderGroups()],o=>o.map(r=>r.headers).flat(),X(n.options,et)),n.getCenterLeafHeaders=Q(()=>[n.getCenterFlatHeaders()],o=>o.filter(r=>{var a;return!((a=r.subHeaders)!=null&&a.length)}),X(n.options,et)),n.getLeftLeafHeaders=Q(()=>[n.getLeftFlatHeaders()],o=>o.filter(r=>{var a;return!((a=r.subHeaders)!=null&&a.length)}),X(n.options,et)),n.getRightLeafHeaders=Q(()=>[n.getRightFlatHeaders()],o=>o.filter(r=>{var a;return!((a=r.subHeaders)!=null&&a.length)}),X(n.options,et)),n.getLeafHeaders=Q(()=>[n.getLeftHeaderGroups(),n.getCenterHeaderGroups(),n.getRightHeaderGroups()],(o,r,a)=>{var l,c,d,m,p,x;return[...(l=(c=o[0])==null?void 0:c.headers)!=null?l:[],...(d=(m=r[0])==null?void 0:m.headers)!=null?d:[],...(p=(x=a[0])==null?void 0:x.headers)!=null?p:[]].map(v=>v.getLeafHeaders()).flat()},X(n.options,et))}};function Ki(n,o,r,a){var l,c;let d=0;const m=function(y,_){_===void 0&&(_=1),d=Math.max(d,_),y.filter(E=>E.getIsVisible()).forEach(E=>{var R;(R=E.columns)!=null&&R.length&&m(E.columns,_+1)},0)};m(n);let p=[];const x=(y,_)=>{const E={depth:_,id:[a,`${_}`].filter(Boolean).join("_"),headers:[]},R=[];y.forEach(O=>{const M=[...R].reverse()[0],$=O.column.depth===E.depth;let q,U=!1;if($&&O.column.parent?q=O.column.parent:(q=O.column,U=!0),M&&(M==null?void 0:M.column)===q)M.subHeaders.push(O);else{const T=Cc(r,q,{id:[a,_,q.id,O==null?void 0:O.id].filter(Boolean).join("_"),isPlaceholder:U,placeholderId:U?`${R.filter(k=>k.column===q).length}`:void 0,depth:_,index:R.length});T.subHeaders.push(O),R.push(T)}E.headers.push(O),O.headerGroup=E}),p.push(E),_>0&&x(R,_-1)},v=o.map((y,_)=>Cc(r,y,{depth:d,index:_}));x(v,d-1),p.reverse();const j=y=>y.filter(E=>E.column.getIsVisible()).map(E=>{let R=0,O=0,M=[0];E.subHeaders&&E.subHeaders.length?(M=[],j(E.subHeaders).forEach(q=>{let{colSpan:U,rowSpan:T}=q;R+=U,M.push(T)})):R=1;const $=Math.min(...M);return O=O+$,E.colSpan=R,E.rowSpan=O,{colSpan:R,rowSpan:O}});return j((l=(c=p[0])==null?void 0:c.headers)!=null?l:[]),p}const Io=(n,o,r,a,l,c,d)=>{let m={id:o,index:a,original:r,depth:l,parentId:d,_valuesCache:{},_uniqueValuesCache:{},getValue:p=>{if(m._valuesCache.hasOwnProperty(p))return m._valuesCache[p];const x=n.getColumn(p);if(x!=null&&x.accessorFn)return m._valuesCache[p]=x.accessorFn(m.original,a),m._valuesCache[p]},getUniqueValues:p=>{if(m._uniqueValuesCache.hasOwnProperty(p))return m._uniqueValuesCache[p];const x=n.getColumn(p);if(x!=null&&x.accessorFn)return x.columnDef.getUniqueValues?(m._uniqueValuesCache[p]=x.columnDef.getUniqueValues(m.original,a),m._uniqueValuesCache[p]):(m._uniqueValuesCache[p]=[m.getValue(p)],m._uniqueValuesCache[p])},renderValue:p=>{var x;return(x=m.getValue(p))!=null?x:n.options.renderFallbackValue},subRows:[],getLeafRows:()=>rb(m.subRows,p=>p.subRows),getParentRow:()=>m.parentId?n.getRow(m.parentId,!0):void 0,getParentRows:()=>{let p=[],x=m;for(;;){const v=x.getParentRow();if(!v)break;p.push(v),x=v}return p.reverse()},getAllCells:Q(()=>[n.getAllLeafColumns()],p=>p.map(x=>ib(n,m,x,x.id)),X(n.options,"debugRows")),_getAllCellsByColumnId:Q(()=>[m.getAllCells()],p=>p.reduce((x,v)=>(x[v.column.id]=v,x),{}),X(n.options,"debugRows"))};for(let p=0;p{n._getFacetedRowModel=o.options.getFacetedRowModel&&o.options.getFacetedRowModel(o,n.id),n.getFacetedRowModel=()=>n._getFacetedRowModel?n._getFacetedRowModel():o.getPreFilteredRowModel(),n._getFacetedUniqueValues=o.options.getFacetedUniqueValues&&o.options.getFacetedUniqueValues(o,n.id),n.getFacetedUniqueValues=()=>n._getFacetedUniqueValues?n._getFacetedUniqueValues():new Map,n._getFacetedMinMaxValues=o.options.getFacetedMinMaxValues&&o.options.getFacetedMinMaxValues(o,n.id),n.getFacetedMinMaxValues=()=>{if(n._getFacetedMinMaxValues)return n._getFacetedMinMaxValues()}}},Sd=(n,o,r)=>{var a,l;const c=r==null||(a=r.toString())==null?void 0:a.toLowerCase();return!!(!((l=n.getValue(o))==null||(l=l.toString())==null||(l=l.toLowerCase())==null)&&l.includes(c))};Sd.autoRemove=n=>Ot(n);const jd=(n,o,r)=>{var a;return!!(!((a=n.getValue(o))==null||(a=a.toString())==null)&&a.includes(r))};jd.autoRemove=n=>Ot(n);const Cd=(n,o,r)=>{var a;return((a=n.getValue(o))==null||(a=a.toString())==null?void 0:a.toLowerCase())===(r==null?void 0:r.toLowerCase())};Cd.autoRemove=n=>Ot(n);const yd=(n,o,r)=>{var a;return(a=n.getValue(o))==null?void 0:a.includes(r)};yd.autoRemove=n=>Ot(n);const Nd=(n,o,r)=>!r.some(a=>{var l;return!((l=n.getValue(o))!=null&&l.includes(a))});Nd.autoRemove=n=>Ot(n)||!(n!=null&&n.length);const Rd=(n,o,r)=>r.some(a=>{var l;return(l=n.getValue(o))==null?void 0:l.includes(a)});Rd.autoRemove=n=>Ot(n)||!(n!=null&&n.length);const Ed=(n,o,r)=>n.getValue(o)===r;Ed.autoRemove=n=>Ot(n);const Ad=(n,o,r)=>n.getValue(o)==r;Ad.autoRemove=n=>Ot(n);const Fo=(n,o,r)=>{let[a,l]=r;const c=n.getValue(o);return c>=a&&c<=l};Fo.resolveFilterValue=n=>{let[o,r]=n,a=typeof o!="number"?parseFloat(o):o,l=typeof r!="number"?parseFloat(r):r,c=o===null||Number.isNaN(a)?-1/0:a,d=r===null||Number.isNaN(l)?1/0:l;if(c>d){const m=c;c=d,d=m}return[c,d]};Fo.autoRemove=n=>Ot(n)||Ot(n[0])&&Ot(n[1]);const en={includesString:Sd,includesStringSensitive:jd,equalsString:Cd,arrIncludes:yd,arrIncludesAll:Nd,arrIncludesSome:Rd,equals:Ed,weakEquals:Ad,inNumberRange:Fo};function Ot(n){return n==null||n===""}const lb={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:n=>({columnFilters:[],...n}),getDefaultOptions:n=>({onColumnFiltersChange:xt("columnFilters",n),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(n,o)=>{n.getAutoFilterFn=()=>{const r=o.getCoreRowModel().flatRows[0],a=r==null?void 0:r.getValue(n.id);return typeof a=="string"?en.includesString:typeof a=="number"?en.inNumberRange:typeof a=="boolean"||a!==null&&typeof a=="object"?en.equals:Array.isArray(a)?en.arrIncludes:en.weakEquals},n.getFilterFn=()=>{var r,a;return ds(n.columnDef.filterFn)?n.columnDef.filterFn:n.columnDef.filterFn==="auto"?n.getAutoFilterFn():(r=(a=o.options.filterFns)==null?void 0:a[n.columnDef.filterFn])!=null?r:en[n.columnDef.filterFn]},n.getCanFilter=()=>{var r,a,l;return((r=n.columnDef.enableColumnFilter)!=null?r:!0)&&((a=o.options.enableColumnFilters)!=null?a:!0)&&((l=o.options.enableFilters)!=null?l:!0)&&!!n.accessorFn},n.getIsFiltered=()=>n.getFilterIndex()>-1,n.getFilterValue=()=>{var r;return(r=o.getState().columnFilters)==null||(r=r.find(a=>a.id===n.id))==null?void 0:r.value},n.getFilterIndex=()=>{var r,a;return(r=(a=o.getState().columnFilters)==null?void 0:a.findIndex(l=>l.id===n.id))!=null?r:-1},n.setFilterValue=r=>{o.setColumnFilters(a=>{const l=n.getFilterFn(),c=a==null?void 0:a.find(v=>v.id===n.id),d=vn(r,c?c.value:void 0);if(yc(l,d,n)){var m;return(m=a==null?void 0:a.filter(v=>v.id!==n.id))!=null?m:[]}const p={id:n.id,value:d};if(c){var x;return(x=a==null?void 0:a.map(v=>v.id===n.id?p:v))!=null?x:[]}return a!=null&&a.length?[...a,p]:[p]})}},createRow:(n,o)=>{n.columnFilters={},n.columnFiltersMeta={}},createTable:n=>{n.setColumnFilters=o=>{const r=n.getAllLeafColumns(),a=l=>{var c;return(c=vn(o,l))==null?void 0:c.filter(d=>{const m=r.find(p=>p.id===d.id);if(m){const p=m.getFilterFn();if(yc(p,d.value,m))return!1}return!0})};n.options.onColumnFiltersChange==null||n.options.onColumnFiltersChange(a)},n.resetColumnFilters=o=>{var r,a;n.setColumnFilters(o?[]:(r=(a=n.initialState)==null?void 0:a.columnFilters)!=null?r:[])},n.getPreFilteredRowModel=()=>n.getCoreRowModel(),n.getFilteredRowModel=()=>(!n._getFilteredRowModel&&n.options.getFilteredRowModel&&(n._getFilteredRowModel=n.options.getFilteredRowModel(n)),n.options.manualFiltering||!n._getFilteredRowModel?n.getPreFilteredRowModel():n._getFilteredRowModel())}};function yc(n,o,r){return(n&&n.autoRemove?n.autoRemove(o,r):!1)||typeof o>"u"||typeof o=="string"&&!o}const ub=(n,o,r)=>r.reduce((a,l)=>{const c=l.getValue(n);return a+(typeof c=="number"?c:0)},0),cb=(n,o,r)=>{let a;return r.forEach(l=>{const c=l.getValue(n);c!=null&&(a>c||a===void 0&&c>=c)&&(a=c)}),a},db=(n,o,r)=>{let a;return r.forEach(l=>{const c=l.getValue(n);c!=null&&(a=c)&&(a=c)}),a},fb=(n,o,r)=>{let a,l;return r.forEach(c=>{const d=c.getValue(n);d!=null&&(a===void 0?d>=d&&(a=l=d):(a>d&&(a=d),l{let r=0,a=0;if(o.forEach(l=>{let c=l.getValue(n);c!=null&&(c=+c)>=c&&(++r,a+=c)}),r)return a/r},mb=(n,o)=>{if(!o.length)return;const r=o.map(c=>c.getValue(n));if(!nb(r))return;if(r.length===1)return r[0];const a=Math.floor(r.length/2),l=r.sort((c,d)=>c-d);return r.length%2!==0?l[a]:(l[a-1]+l[a])/2},hb=(n,o)=>Array.from(new Set(o.map(r=>r.getValue(n))).values()),pb=(n,o)=>new Set(o.map(r=>r.getValue(n))).size,xb=(n,o)=>o.length,Ba={sum:ub,min:cb,max:db,extent:fb,mean:gb,median:mb,unique:hb,uniqueCount:pb,count:xb},vb={getDefaultColumnDef:()=>({aggregatedCell:n=>{var o,r;return(o=(r=n.getValue())==null||r.toString==null?void 0:r.toString())!=null?o:null},aggregationFn:"auto"}),getInitialState:n=>({grouping:[],...n}),getDefaultOptions:n=>({onGroupingChange:xt("grouping",n),groupedColumnMode:"reorder"}),createColumn:(n,o)=>{n.toggleGrouping=()=>{o.setGrouping(r=>r!=null&&r.includes(n.id)?r.filter(a=>a!==n.id):[...r??[],n.id])},n.getCanGroup=()=>{var r,a;return((r=n.columnDef.enableGrouping)!=null?r:!0)&&((a=o.options.enableGrouping)!=null?a:!0)&&(!!n.accessorFn||!!n.columnDef.getGroupingValue)},n.getIsGrouped=()=>{var r;return(r=o.getState().grouping)==null?void 0:r.includes(n.id)},n.getGroupedIndex=()=>{var r;return(r=o.getState().grouping)==null?void 0:r.indexOf(n.id)},n.getToggleGroupingHandler=()=>{const r=n.getCanGroup();return()=>{r&&n.toggleGrouping()}},n.getAutoAggregationFn=()=>{const r=o.getCoreRowModel().flatRows[0],a=r==null?void 0:r.getValue(n.id);if(typeof a=="number")return Ba.sum;if(Object.prototype.toString.call(a)==="[object Date]")return Ba.extent},n.getAggregationFn=()=>{var r,a;if(!n)throw new Error;return ds(n.columnDef.aggregationFn)?n.columnDef.aggregationFn:n.columnDef.aggregationFn==="auto"?n.getAutoAggregationFn():(r=(a=o.options.aggregationFns)==null?void 0:a[n.columnDef.aggregationFn])!=null?r:Ba[n.columnDef.aggregationFn]}},createTable:n=>{n.setGrouping=o=>n.options.onGroupingChange==null?void 0:n.options.onGroupingChange(o),n.resetGrouping=o=>{var r,a;n.setGrouping(o?[]:(r=(a=n.initialState)==null?void 0:a.grouping)!=null?r:[])},n.getPreGroupedRowModel=()=>n.getFilteredRowModel(),n.getGroupedRowModel=()=>(!n._getGroupedRowModel&&n.options.getGroupedRowModel&&(n._getGroupedRowModel=n.options.getGroupedRowModel(n)),n.options.manualGrouping||!n._getGroupedRowModel?n.getPreGroupedRowModel():n._getGroupedRowModel())},createRow:(n,o)=>{n.getIsGrouped=()=>!!n.groupingColumnId,n.getGroupingValue=r=>{if(n._groupingValuesCache.hasOwnProperty(r))return n._groupingValuesCache[r];const a=o.getColumn(r);return a!=null&&a.columnDef.getGroupingValue?(n._groupingValuesCache[r]=a.columnDef.getGroupingValue(n.original),n._groupingValuesCache[r]):n.getValue(r)},n._groupingValuesCache={}},createCell:(n,o,r,a)=>{n.getIsGrouped=()=>o.getIsGrouped()&&o.id===r.groupingColumnId,n.getIsPlaceholder=()=>!n.getIsGrouped()&&o.getIsGrouped(),n.getIsAggregated=()=>{var l;return!n.getIsGrouped()&&!n.getIsPlaceholder()&&!!((l=r.subRows)!=null&&l.length)}}};function _b(n,o,r){if(!(o!=null&&o.length)||!r)return n;const a=n.filter(c=>!o.includes(c.id));return r==="remove"?a:[...o.map(c=>n.find(d=>d.id===c)).filter(Boolean),...a]}const bb={getInitialState:n=>({columnOrder:[],...n}),getDefaultOptions:n=>({onColumnOrderChange:xt("columnOrder",n)}),createColumn:(n,o)=>{n.getIndex=Q(r=>[Hr(o,r)],r=>r.findIndex(a=>a.id===n.id),X(o.options,"debugColumns")),n.getIsFirstColumn=r=>{var a;return((a=Hr(o,r)[0])==null?void 0:a.id)===n.id},n.getIsLastColumn=r=>{var a;const l=Hr(o,r);return((a=l[l.length-1])==null?void 0:a.id)===n.id}},createTable:n=>{n.setColumnOrder=o=>n.options.onColumnOrderChange==null?void 0:n.options.onColumnOrderChange(o),n.resetColumnOrder=o=>{var r;n.setColumnOrder(o?[]:(r=n.initialState.columnOrder)!=null?r:[])},n._getOrderColumnsFn=Q(()=>[n.getState().columnOrder,n.getState().grouping,n.options.groupedColumnMode],(o,r,a)=>l=>{let c=[];if(!(o!=null&&o.length))c=l;else{const d=[...o],m=[...l];for(;m.length&&d.length;){const p=d.shift(),x=m.findIndex(v=>v.id===p);x>-1&&c.push(m.splice(x,1)[0])}c=[...c,...m]}return _b(c,r,a)},X(n.options,"debugTable"))}},Ua=()=>({left:[],right:[]}),wb={getInitialState:n=>({columnPinning:Ua(),...n}),getDefaultOptions:n=>({onColumnPinningChange:xt("columnPinning",n)}),createColumn:(n,o)=>{n.pin=r=>{const a=n.getLeafColumns().map(l=>l.id).filter(Boolean);o.setColumnPinning(l=>{var c,d;if(r==="right"){var m,p;return{left:((m=l==null?void 0:l.left)!=null?m:[]).filter(j=>!(a!=null&&a.includes(j))),right:[...((p=l==null?void 0:l.right)!=null?p:[]).filter(j=>!(a!=null&&a.includes(j))),...a]}}if(r==="left"){var x,v;return{left:[...((x=l==null?void 0:l.left)!=null?x:[]).filter(j=>!(a!=null&&a.includes(j))),...a],right:((v=l==null?void 0:l.right)!=null?v:[]).filter(j=>!(a!=null&&a.includes(j)))}}return{left:((c=l==null?void 0:l.left)!=null?c:[]).filter(j=>!(a!=null&&a.includes(j))),right:((d=l==null?void 0:l.right)!=null?d:[]).filter(j=>!(a!=null&&a.includes(j)))}})},n.getCanPin=()=>n.getLeafColumns().some(a=>{var l,c,d;return((l=a.columnDef.enablePinning)!=null?l:!0)&&((c=(d=o.options.enableColumnPinning)!=null?d:o.options.enablePinning)!=null?c:!0)}),n.getIsPinned=()=>{const r=n.getLeafColumns().map(m=>m.id),{left:a,right:l}=o.getState().columnPinning,c=r.some(m=>a==null?void 0:a.includes(m)),d=r.some(m=>l==null?void 0:l.includes(m));return c?"left":d?"right":!1},n.getPinnedIndex=()=>{var r,a;const l=n.getIsPinned();return l?(r=(a=o.getState().columnPinning)==null||(a=a[l])==null?void 0:a.indexOf(n.id))!=null?r:-1:0}},createRow:(n,o)=>{n.getCenterVisibleCells=Q(()=>[n._getAllVisibleCells(),o.getState().columnPinning.left,o.getState().columnPinning.right],(r,a,l)=>{const c=[...a??[],...l??[]];return r.filter(d=>!c.includes(d.column.id))},X(o.options,"debugRows")),n.getLeftVisibleCells=Q(()=>[n._getAllVisibleCells(),o.getState().columnPinning.left],(r,a)=>(a??[]).map(c=>r.find(d=>d.column.id===c)).filter(Boolean).map(c=>({...c,position:"left"})),X(o.options,"debugRows")),n.getRightVisibleCells=Q(()=>[n._getAllVisibleCells(),o.getState().columnPinning.right],(r,a)=>(a??[]).map(c=>r.find(d=>d.column.id===c)).filter(Boolean).map(c=>({...c,position:"right"})),X(o.options,"debugRows"))},createTable:n=>{n.setColumnPinning=o=>n.options.onColumnPinningChange==null?void 0:n.options.onColumnPinningChange(o),n.resetColumnPinning=o=>{var r,a;return n.setColumnPinning(o?Ua():(r=(a=n.initialState)==null?void 0:a.columnPinning)!=null?r:Ua())},n.getIsSomeColumnsPinned=o=>{var r;const a=n.getState().columnPinning;if(!o){var l,c;return!!((l=a.left)!=null&&l.length||(c=a.right)!=null&&c.length)}return!!((r=a[o])!=null&&r.length)},n.getLeftLeafColumns=Q(()=>[n.getAllLeafColumns(),n.getState().columnPinning.left],(o,r)=>(r??[]).map(a=>o.find(l=>l.id===a)).filter(Boolean),X(n.options,"debugColumns")),n.getRightLeafColumns=Q(()=>[n.getAllLeafColumns(),n.getState().columnPinning.right],(o,r)=>(r??[]).map(a=>o.find(l=>l.id===a)).filter(Boolean),X(n.options,"debugColumns")),n.getCenterLeafColumns=Q(()=>[n.getAllLeafColumns(),n.getState().columnPinning.left,n.getState().columnPinning.right],(o,r,a)=>{const l=[...r??[],...a??[]];return o.filter(c=>!l.includes(c.id))},X(n.options,"debugColumns"))}},Wi={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Ga=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Sb={getDefaultColumnDef:()=>Wi,getInitialState:n=>({columnSizing:{},columnSizingInfo:Ga(),...n}),getDefaultOptions:n=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:xt("columnSizing",n),onColumnSizingInfoChange:xt("columnSizingInfo",n)}),createColumn:(n,o)=>{n.getSize=()=>{var r,a,l;const c=o.getState().columnSizing[n.id];return Math.min(Math.max((r=n.columnDef.minSize)!=null?r:Wi.minSize,(a=c??n.columnDef.size)!=null?a:Wi.size),(l=n.columnDef.maxSize)!=null?l:Wi.maxSize)},n.getStart=Q(r=>[r,Hr(o,r),o.getState().columnSizing],(r,a)=>a.slice(0,n.getIndex(r)).reduce((l,c)=>l+c.getSize(),0),X(o.options,"debugColumns")),n.getAfter=Q(r=>[r,Hr(o,r),o.getState().columnSizing],(r,a)=>a.slice(n.getIndex(r)+1).reduce((l,c)=>l+c.getSize(),0),X(o.options,"debugColumns")),n.resetSize=()=>{o.setColumnSizing(r=>{let{[n.id]:a,...l}=r;return l})},n.getCanResize=()=>{var r,a;return((r=n.columnDef.enableResizing)!=null?r:!0)&&((a=o.options.enableColumnResizing)!=null?a:!0)},n.getIsResizing=()=>o.getState().columnSizingInfo.isResizingColumn===n.id},createHeader:(n,o)=>{n.getSize=()=>{let r=0;const a=l=>{if(l.subHeaders.length)l.subHeaders.forEach(a);else{var c;r+=(c=l.column.getSize())!=null?c:0}};return a(n),r},n.getStart=()=>{if(n.index>0){const r=n.headerGroup.headers[n.index-1];return r.getStart()+r.getSize()}return 0},n.getResizeHandler=r=>{const a=o.getColumn(n.column.id),l=a==null?void 0:a.getCanResize();return c=>{if(!a||!l||(c.persist==null||c.persist(),Ha(c)&&c.touches&&c.touches.length>1))return;const d=n.getSize(),m=n?n.getLeafHeaders().map(M=>[M.column.id,M.column.getSize()]):[[a.id,a.getSize()]],p=Ha(c)?Math.round(c.touches[0].clientX):c.clientX,x={},v=(M,$)=>{typeof $=="number"&&(o.setColumnSizingInfo(q=>{var U,T;const k=o.options.columnResizeDirection==="rtl"?-1:1,W=($-((U=q==null?void 0:q.startOffset)!=null?U:0))*k,te=Math.max(W/((T=q==null?void 0:q.startSize)!=null?T:0),-.999999);return q.columnSizingStart.forEach(V=>{let[ge,_e]=V;x[ge]=Math.round(Math.max(_e+_e*te,0)*100)/100}),{...q,deltaOffset:W,deltaPercentage:te}}),(o.options.columnResizeMode==="onChange"||M==="end")&&o.setColumnSizing(q=>({...q,...x})))},j=M=>v("move",M),y=M=>{v("end",M),o.setColumnSizingInfo($=>({...$,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},_=r||typeof document<"u"?document:null,E={moveHandler:M=>j(M.clientX),upHandler:M=>{_==null||_.removeEventListener("mousemove",E.moveHandler),_==null||_.removeEventListener("mouseup",E.upHandler),y(M.clientX)}},R={moveHandler:M=>(M.cancelable&&(M.preventDefault(),M.stopPropagation()),j(M.touches[0].clientX),!1),upHandler:M=>{var $;_==null||_.removeEventListener("touchmove",R.moveHandler),_==null||_.removeEventListener("touchend",R.upHandler),M.cancelable&&(M.preventDefault(),M.stopPropagation()),y(($=M.touches[0])==null?void 0:$.clientX)}},O=jb()?{passive:!1}:!1;Ha(c)?(_==null||_.addEventListener("touchmove",R.moveHandler,O),_==null||_.addEventListener("touchend",R.upHandler,O)):(_==null||_.addEventListener("mousemove",E.moveHandler,O),_==null||_.addEventListener("mouseup",E.upHandler,O)),o.setColumnSizingInfo(M=>({...M,startOffset:p,startSize:d,deltaOffset:0,deltaPercentage:0,columnSizingStart:m,isResizingColumn:a.id}))}}},createTable:n=>{n.setColumnSizing=o=>n.options.onColumnSizingChange==null?void 0:n.options.onColumnSizingChange(o),n.setColumnSizingInfo=o=>n.options.onColumnSizingInfoChange==null?void 0:n.options.onColumnSizingInfoChange(o),n.resetColumnSizing=o=>{var r;n.setColumnSizing(o?{}:(r=n.initialState.columnSizing)!=null?r:{})},n.resetHeaderSizeInfo=o=>{var r;n.setColumnSizingInfo(o?Ga():(r=n.initialState.columnSizingInfo)!=null?r:Ga())},n.getTotalSize=()=>{var o,r;return(o=(r=n.getHeaderGroups()[0])==null?void 0:r.headers.reduce((a,l)=>a+l.getSize(),0))!=null?o:0},n.getLeftTotalSize=()=>{var o,r;return(o=(r=n.getLeftHeaderGroups()[0])==null?void 0:r.headers.reduce((a,l)=>a+l.getSize(),0))!=null?o:0},n.getCenterTotalSize=()=>{var o,r;return(o=(r=n.getCenterHeaderGroups()[0])==null?void 0:r.headers.reduce((a,l)=>a+l.getSize(),0))!=null?o:0},n.getRightTotalSize=()=>{var o,r;return(o=(r=n.getRightHeaderGroups()[0])==null?void 0:r.headers.reduce((a,l)=>a+l.getSize(),0))!=null?o:0}}};let Yi=null;function jb(){if(typeof Yi=="boolean")return Yi;let n=!1;try{const o={get passive(){return n=!0,!1}},r=()=>{};window.addEventListener("test",r,o),window.removeEventListener("test",r)}catch{n=!1}return Yi=n,Yi}function Ha(n){return n.type==="touchstart"}const Cb={getInitialState:n=>({columnVisibility:{},...n}),getDefaultOptions:n=>({onColumnVisibilityChange:xt("columnVisibility",n)}),createColumn:(n,o)=>{n.toggleVisibility=r=>{n.getCanHide()&&o.setColumnVisibility(a=>({...a,[n.id]:r??!n.getIsVisible()}))},n.getIsVisible=()=>{var r,a;const l=n.columns;return(r=l.length?l.some(c=>c.getIsVisible()):(a=o.getState().columnVisibility)==null?void 0:a[n.id])!=null?r:!0},n.getCanHide=()=>{var r,a;return((r=n.columnDef.enableHiding)!=null?r:!0)&&((a=o.options.enableHiding)!=null?a:!0)},n.getToggleVisibilityHandler=()=>r=>{n.toggleVisibility==null||n.toggleVisibility(r.target.checked)}},createRow:(n,o)=>{n._getAllVisibleCells=Q(()=>[n.getAllCells(),o.getState().columnVisibility],r=>r.filter(a=>a.column.getIsVisible()),X(o.options,"debugRows")),n.getVisibleCells=Q(()=>[n.getLeftVisibleCells(),n.getCenterVisibleCells(),n.getRightVisibleCells()],(r,a,l)=>[...r,...a,...l],X(o.options,"debugRows"))},createTable:n=>{const o=(r,a)=>Q(()=>[a(),a().filter(l=>l.getIsVisible()).map(l=>l.id).join("_")],l=>l.filter(c=>c.getIsVisible==null?void 0:c.getIsVisible()),X(n.options,"debugColumns"));n.getVisibleFlatColumns=o("getVisibleFlatColumns",()=>n.getAllFlatColumns()),n.getVisibleLeafColumns=o("getVisibleLeafColumns",()=>n.getAllLeafColumns()),n.getLeftVisibleLeafColumns=o("getLeftVisibleLeafColumns",()=>n.getLeftLeafColumns()),n.getRightVisibleLeafColumns=o("getRightVisibleLeafColumns",()=>n.getRightLeafColumns()),n.getCenterVisibleLeafColumns=o("getCenterVisibleLeafColumns",()=>n.getCenterLeafColumns()),n.setColumnVisibility=r=>n.options.onColumnVisibilityChange==null?void 0:n.options.onColumnVisibilityChange(r),n.resetColumnVisibility=r=>{var a;n.setColumnVisibility(r?{}:(a=n.initialState.columnVisibility)!=null?a:{})},n.toggleAllColumnsVisible=r=>{var a;r=(a=r)!=null?a:!n.getIsAllColumnsVisible(),n.setColumnVisibility(n.getAllLeafColumns().reduce((l,c)=>({...l,[c.id]:r||!(c.getCanHide!=null&&c.getCanHide())}),{}))},n.getIsAllColumnsVisible=()=>!n.getAllLeafColumns().some(r=>!(r.getIsVisible!=null&&r.getIsVisible())),n.getIsSomeColumnsVisible=()=>n.getAllLeafColumns().some(r=>r.getIsVisible==null?void 0:r.getIsVisible()),n.getToggleAllColumnsVisibilityHandler=()=>r=>{var a;n.toggleAllColumnsVisible((a=r.target)==null?void 0:a.checked)}}};function Hr(n,o){return o?o==="center"?n.getCenterVisibleLeafColumns():o==="left"?n.getLeftVisibleLeafColumns():n.getRightVisibleLeafColumns():n.getVisibleLeafColumns()}const yb={createTable:n=>{n._getGlobalFacetedRowModel=n.options.getFacetedRowModel&&n.options.getFacetedRowModel(n,"__global__"),n.getGlobalFacetedRowModel=()=>n.options.manualFiltering||!n._getGlobalFacetedRowModel?n.getPreFilteredRowModel():n._getGlobalFacetedRowModel(),n._getGlobalFacetedUniqueValues=n.options.getFacetedUniqueValues&&n.options.getFacetedUniqueValues(n,"__global__"),n.getGlobalFacetedUniqueValues=()=>n._getGlobalFacetedUniqueValues?n._getGlobalFacetedUniqueValues():new Map,n._getGlobalFacetedMinMaxValues=n.options.getFacetedMinMaxValues&&n.options.getFacetedMinMaxValues(n,"__global__"),n.getGlobalFacetedMinMaxValues=()=>{if(n._getGlobalFacetedMinMaxValues)return n._getGlobalFacetedMinMaxValues()}}},Nb={getInitialState:n=>({globalFilter:void 0,...n}),getDefaultOptions:n=>({onGlobalFilterChange:xt("globalFilter",n),globalFilterFn:"auto",getColumnCanGlobalFilter:o=>{var r;const a=(r=n.getCoreRowModel().flatRows[0])==null||(r=r._getAllCellsByColumnId()[o.id])==null?void 0:r.getValue();return typeof a=="string"||typeof a=="number"}}),createColumn:(n,o)=>{n.getCanGlobalFilter=()=>{var r,a,l,c;return((r=n.columnDef.enableGlobalFilter)!=null?r:!0)&&((a=o.options.enableGlobalFilter)!=null?a:!0)&&((l=o.options.enableFilters)!=null?l:!0)&&((c=o.options.getColumnCanGlobalFilter==null?void 0:o.options.getColumnCanGlobalFilter(n))!=null?c:!0)&&!!n.accessorFn}},createTable:n=>{n.getGlobalAutoFilterFn=()=>en.includesString,n.getGlobalFilterFn=()=>{var o,r;const{globalFilterFn:a}=n.options;return ds(a)?a:a==="auto"?n.getGlobalAutoFilterFn():(o=(r=n.options.filterFns)==null?void 0:r[a])!=null?o:en[a]},n.setGlobalFilter=o=>{n.options.onGlobalFilterChange==null||n.options.onGlobalFilterChange(o)},n.resetGlobalFilter=o=>{n.setGlobalFilter(o?void 0:n.initialState.globalFilter)}}},Rb={getInitialState:n=>({expanded:{},...n}),getDefaultOptions:n=>({onExpandedChange:xt("expanded",n),paginateExpandedRows:!0}),createTable:n=>{let o=!1,r=!1;n._autoResetExpanded=()=>{var a,l;if(!o){n._queue(()=>{o=!0});return}if((a=(l=n.options.autoResetAll)!=null?l:n.options.autoResetExpanded)!=null?a:!n.options.manualExpanding){if(r)return;r=!0,n._queue(()=>{n.resetExpanded(),r=!1})}},n.setExpanded=a=>n.options.onExpandedChange==null?void 0:n.options.onExpandedChange(a),n.toggleAllRowsExpanded=a=>{a??!n.getIsAllRowsExpanded()?n.setExpanded(!0):n.setExpanded({})},n.resetExpanded=a=>{var l,c;n.setExpanded(a?{}:(l=(c=n.initialState)==null?void 0:c.expanded)!=null?l:{})},n.getCanSomeRowsExpand=()=>n.getPrePaginationRowModel().flatRows.some(a=>a.getCanExpand()),n.getToggleAllRowsExpandedHandler=()=>a=>{a.persist==null||a.persist(),n.toggleAllRowsExpanded()},n.getIsSomeRowsExpanded=()=>{const a=n.getState().expanded;return a===!0||Object.values(a).some(Boolean)},n.getIsAllRowsExpanded=()=>{const a=n.getState().expanded;return typeof a=="boolean"?a===!0:!(!Object.keys(a).length||n.getRowModel().flatRows.some(l=>!l.getIsExpanded()))},n.getExpandedDepth=()=>{let a=0;return(n.getState().expanded===!0?Object.keys(n.getRowModel().rowsById):Object.keys(n.getState().expanded)).forEach(c=>{const d=c.split(".");a=Math.max(a,d.length)}),a},n.getPreExpandedRowModel=()=>n.getSortedRowModel(),n.getExpandedRowModel=()=>(!n._getExpandedRowModel&&n.options.getExpandedRowModel&&(n._getExpandedRowModel=n.options.getExpandedRowModel(n)),n.options.manualExpanding||!n._getExpandedRowModel?n.getPreExpandedRowModel():n._getExpandedRowModel())},createRow:(n,o)=>{n.toggleExpanded=r=>{o.setExpanded(a=>{var l;const c=a===!0?!0:!!(a!=null&&a[n.id]);let d={};if(a===!0?Object.keys(o.getRowModel().rowsById).forEach(m=>{d[m]=!0}):d=a,r=(l=r)!=null?l:!c,!c&&r)return{...d,[n.id]:!0};if(c&&!r){const{[n.id]:m,...p}=d;return p}return a})},n.getIsExpanded=()=>{var r;const a=o.getState().expanded;return!!((r=o.options.getIsRowExpanded==null?void 0:o.options.getIsRowExpanded(n))!=null?r:a===!0||a!=null&&a[n.id])},n.getCanExpand=()=>{var r,a,l;return(r=o.options.getRowCanExpand==null?void 0:o.options.getRowCanExpand(n))!=null?r:((a=o.options.enableExpanding)!=null?a:!0)&&!!((l=n.subRows)!=null&&l.length)},n.getIsAllParentsExpanded=()=>{let r=!0,a=n;for(;r&&a.parentId;)a=o.getRow(a.parentId,!0),r=a.getIsExpanded();return r},n.getToggleExpandedHandler=()=>{const r=n.getCanExpand();return()=>{r&&n.toggleExpanded()}}}},no=0,ro=10,Ka=()=>({pageIndex:no,pageSize:ro}),Eb={getInitialState:n=>({...n,pagination:{...Ka(),...n==null?void 0:n.pagination}}),getDefaultOptions:n=>({onPaginationChange:xt("pagination",n)}),createTable:n=>{let o=!1,r=!1;n._autoResetPageIndex=()=>{var a,l;if(!o){n._queue(()=>{o=!0});return}if((a=(l=n.options.autoResetAll)!=null?l:n.options.autoResetPageIndex)!=null?a:!n.options.manualPagination){if(r)return;r=!0,n._queue(()=>{n.resetPageIndex(),r=!1})}},n.setPagination=a=>{const l=c=>vn(a,c);return n.options.onPaginationChange==null?void 0:n.options.onPaginationChange(l)},n.resetPagination=a=>{var l;n.setPagination(a?Ka():(l=n.initialState.pagination)!=null?l:Ka())},n.setPageIndex=a=>{n.setPagination(l=>{let c=vn(a,l.pageIndex);const d=typeof n.options.pageCount>"u"||n.options.pageCount===-1?Number.MAX_SAFE_INTEGER:n.options.pageCount-1;return c=Math.max(0,Math.min(c,d)),{...l,pageIndex:c}})},n.resetPageIndex=a=>{var l,c;n.setPageIndex(a?no:(l=(c=n.initialState)==null||(c=c.pagination)==null?void 0:c.pageIndex)!=null?l:no)},n.resetPageSize=a=>{var l,c;n.setPageSize(a?ro:(l=(c=n.initialState)==null||(c=c.pagination)==null?void 0:c.pageSize)!=null?l:ro)},n.setPageSize=a=>{n.setPagination(l=>{const c=Math.max(1,vn(a,l.pageSize)),d=l.pageSize*l.pageIndex,m=Math.floor(d/c);return{...l,pageIndex:m,pageSize:c}})},n.setPageCount=a=>n.setPagination(l=>{var c;let d=vn(a,(c=n.options.pageCount)!=null?c:-1);return typeof d=="number"&&(d=Math.max(-1,d)),{...l,pageCount:d}}),n.getPageOptions=Q(()=>[n.getPageCount()],a=>{let l=[];return a&&a>0&&(l=[...new Array(a)].fill(null).map((c,d)=>d)),l},X(n.options,"debugTable")),n.getCanPreviousPage=()=>n.getState().pagination.pageIndex>0,n.getCanNextPage=()=>{const{pageIndex:a}=n.getState().pagination,l=n.getPageCount();return l===-1?!0:l===0?!1:an.setPageIndex(a=>a-1),n.nextPage=()=>n.setPageIndex(a=>a+1),n.firstPage=()=>n.setPageIndex(0),n.lastPage=()=>n.setPageIndex(n.getPageCount()-1),n.getPrePaginationRowModel=()=>n.getExpandedRowModel(),n.getPaginationRowModel=()=>(!n._getPaginationRowModel&&n.options.getPaginationRowModel&&(n._getPaginationRowModel=n.options.getPaginationRowModel(n)),n.options.manualPagination||!n._getPaginationRowModel?n.getPrePaginationRowModel():n._getPaginationRowModel()),n.getPageCount=()=>{var a;return(a=n.options.pageCount)!=null?a:Math.ceil(n.getRowCount()/n.getState().pagination.pageSize)},n.getRowCount=()=>{var a;return(a=n.options.rowCount)!=null?a:n.getPrePaginationRowModel().rows.length}}},Wa=()=>({top:[],bottom:[]}),Ab={getInitialState:n=>({rowPinning:Wa(),...n}),getDefaultOptions:n=>({onRowPinningChange:xt("rowPinning",n)}),createRow:(n,o)=>{n.pin=(r,a,l)=>{const c=a?n.getLeafRows().map(p=>{let{id:x}=p;return x}):[],d=l?n.getParentRows().map(p=>{let{id:x}=p;return x}):[],m=new Set([...d,n.id,...c]);o.setRowPinning(p=>{var x,v;if(r==="bottom"){var j,y;return{top:((j=p==null?void 0:p.top)!=null?j:[]).filter(R=>!(m!=null&&m.has(R))),bottom:[...((y=p==null?void 0:p.bottom)!=null?y:[]).filter(R=>!(m!=null&&m.has(R))),...Array.from(m)]}}if(r==="top"){var _,E;return{top:[...((_=p==null?void 0:p.top)!=null?_:[]).filter(R=>!(m!=null&&m.has(R))),...Array.from(m)],bottom:((E=p==null?void 0:p.bottom)!=null?E:[]).filter(R=>!(m!=null&&m.has(R)))}}return{top:((x=p==null?void 0:p.top)!=null?x:[]).filter(R=>!(m!=null&&m.has(R))),bottom:((v=p==null?void 0:p.bottom)!=null?v:[]).filter(R=>!(m!=null&&m.has(R)))}})},n.getCanPin=()=>{var r;const{enableRowPinning:a,enablePinning:l}=o.options;return typeof a=="function"?a(n):(r=a??l)!=null?r:!0},n.getIsPinned=()=>{const r=[n.id],{top:a,bottom:l}=o.getState().rowPinning,c=r.some(m=>a==null?void 0:a.includes(m)),d=r.some(m=>l==null?void 0:l.includes(m));return c?"top":d?"bottom":!1},n.getPinnedIndex=()=>{var r,a;const l=n.getIsPinned();if(!l)return-1;const c=(r=l==="top"?o.getTopRows():o.getBottomRows())==null?void 0:r.map(d=>{let{id:m}=d;return m});return(a=c==null?void 0:c.indexOf(n.id))!=null?a:-1}},createTable:n=>{n.setRowPinning=o=>n.options.onRowPinningChange==null?void 0:n.options.onRowPinningChange(o),n.resetRowPinning=o=>{var r,a;return n.setRowPinning(o?Wa():(r=(a=n.initialState)==null?void 0:a.rowPinning)!=null?r:Wa())},n.getIsSomeRowsPinned=o=>{var r;const a=n.getState().rowPinning;if(!o){var l,c;return!!((l=a.top)!=null&&l.length||(c=a.bottom)!=null&&c.length)}return!!((r=a[o])!=null&&r.length)},n._getPinnedRows=(o,r,a)=>{var l;return((l=n.options.keepPinnedRows)==null||l?(r??[]).map(d=>{const m=n.getRow(d,!0);return m.getIsAllParentsExpanded()?m:null}):(r??[]).map(d=>o.find(m=>m.id===d))).filter(Boolean).map(d=>({...d,position:a}))},n.getTopRows=Q(()=>[n.getRowModel().rows,n.getState().rowPinning.top],(o,r)=>n._getPinnedRows(o,r,"top"),X(n.options,"debugRows")),n.getBottomRows=Q(()=>[n.getRowModel().rows,n.getState().rowPinning.bottom],(o,r)=>n._getPinnedRows(o,r,"bottom"),X(n.options,"debugRows")),n.getCenterRows=Q(()=>[n.getRowModel().rows,n.getState().rowPinning.top,n.getState().rowPinning.bottom],(o,r,a)=>{const l=new Set([...r??[],...a??[]]);return o.filter(c=>!l.has(c.id))},X(n.options,"debugRows"))}},Ib={getInitialState:n=>({rowSelection:{},...n}),getDefaultOptions:n=>({onRowSelectionChange:xt("rowSelection",n),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:n=>{n.setRowSelection=o=>n.options.onRowSelectionChange==null?void 0:n.options.onRowSelectionChange(o),n.resetRowSelection=o=>{var r;return n.setRowSelection(o?{}:(r=n.initialState.rowSelection)!=null?r:{})},n.toggleAllRowsSelected=o=>{n.setRowSelection(r=>{o=typeof o<"u"?o:!n.getIsAllRowsSelected();const a={...r},l=n.getPreGroupedRowModel().flatRows;return o?l.forEach(c=>{c.getCanSelect()&&(a[c.id]=!0)}):l.forEach(c=>{delete a[c.id]}),a})},n.toggleAllPageRowsSelected=o=>n.setRowSelection(r=>{const a=typeof o<"u"?o:!n.getIsAllPageRowsSelected(),l={...r};return n.getRowModel().rows.forEach(c=>{io(l,c.id,a,!0,n)}),l}),n.getPreSelectedRowModel=()=>n.getCoreRowModel(),n.getSelectedRowModel=Q(()=>[n.getState().rowSelection,n.getCoreRowModel()],(o,r)=>Object.keys(o).length?Ya(n,r):{rows:[],flatRows:[],rowsById:{}},X(n.options,"debugTable")),n.getFilteredSelectedRowModel=Q(()=>[n.getState().rowSelection,n.getFilteredRowModel()],(o,r)=>Object.keys(o).length?Ya(n,r):{rows:[],flatRows:[],rowsById:{}},X(n.options,"debugTable")),n.getGroupedSelectedRowModel=Q(()=>[n.getState().rowSelection,n.getSortedRowModel()],(o,r)=>Object.keys(o).length?Ya(n,r):{rows:[],flatRows:[],rowsById:{}},X(n.options,"debugTable")),n.getIsAllRowsSelected=()=>{const o=n.getFilteredRowModel().flatRows,{rowSelection:r}=n.getState();let a=!!(o.length&&Object.keys(r).length);return a&&o.some(l=>l.getCanSelect()&&!r[l.id])&&(a=!1),a},n.getIsAllPageRowsSelected=()=>{const o=n.getPaginationRowModel().flatRows.filter(l=>l.getCanSelect()),{rowSelection:r}=n.getState();let a=!!o.length;return a&&o.some(l=>!r[l.id])&&(a=!1),a},n.getIsSomeRowsSelected=()=>{var o;const r=Object.keys((o=n.getState().rowSelection)!=null?o:{}).length;return r>0&&r{const o=n.getPaginationRowModel().flatRows;return n.getIsAllPageRowsSelected()?!1:o.filter(r=>r.getCanSelect()).some(r=>r.getIsSelected()||r.getIsSomeSelected())},n.getToggleAllRowsSelectedHandler=()=>o=>{n.toggleAllRowsSelected(o.target.checked)},n.getToggleAllPageRowsSelectedHandler=()=>o=>{n.toggleAllPageRowsSelected(o.target.checked)}},createRow:(n,o)=>{n.toggleSelected=(r,a)=>{const l=n.getIsSelected();o.setRowSelection(c=>{var d;if(r=typeof r<"u"?r:!l,n.getCanSelect()&&l===r)return c;const m={...c};return io(m,n.id,r,(d=a==null?void 0:a.selectChildren)!=null?d:!0,o),m})},n.getIsSelected=()=>{const{rowSelection:r}=o.getState();return Mo(n,r)},n.getIsSomeSelected=()=>{const{rowSelection:r}=o.getState();return so(n,r)==="some"},n.getIsAllSubRowsSelected=()=>{const{rowSelection:r}=o.getState();return so(n,r)==="all"},n.getCanSelect=()=>{var r;return typeof o.options.enableRowSelection=="function"?o.options.enableRowSelection(n):(r=o.options.enableRowSelection)!=null?r:!0},n.getCanSelectSubRows=()=>{var r;return typeof o.options.enableSubRowSelection=="function"?o.options.enableSubRowSelection(n):(r=o.options.enableSubRowSelection)!=null?r:!0},n.getCanMultiSelect=()=>{var r;return typeof o.options.enableMultiRowSelection=="function"?o.options.enableMultiRowSelection(n):(r=o.options.enableMultiRowSelection)!=null?r:!0},n.getToggleSelectedHandler=()=>{const r=n.getCanSelect();return a=>{var l;r&&n.toggleSelected((l=a.target)==null?void 0:l.checked)}}}},io=(n,o,r,a,l)=>{var c;const d=l.getRow(o,!0);r?(d.getCanMultiSelect()||Object.keys(n).forEach(m=>delete n[m]),d.getCanSelect()&&(n[o]=!0)):delete n[o],a&&(c=d.subRows)!=null&&c.length&&d.getCanSelectSubRows()&&d.subRows.forEach(m=>io(n,m.id,r,a,l))};function Ya(n,o){const r=n.getState().rowSelection,a=[],l={},c=function(d,m){return d.map(p=>{var x;const v=Mo(p,r);if(v&&(a.push(p),l[p.id]=p),(x=p.subRows)!=null&&x.length&&(p={...p,subRows:c(p.subRows)}),v)return p}).filter(Boolean)};return{rows:c(o.rows),flatRows:a,rowsById:l}}function Mo(n,o){var r;return(r=o[n.id])!=null?r:!1}function so(n,o,r){var a;if(!((a=n.subRows)!=null&&a.length))return!1;let l=!0,c=!1;return n.subRows.forEach(d=>{if(!(c&&!l)&&(d.getCanSelect()&&(Mo(d,o)?c=!0:l=!1),d.subRows&&d.subRows.length)){const m=so(d,o);m==="all"?c=!0:(m==="some"&&(c=!0),l=!1)}}),l?"all":c?"some":!1}const ao=/([0-9]+)/gm,Fb=(n,o,r)=>Id(jn(n.getValue(r)).toLowerCase(),jn(o.getValue(r)).toLowerCase()),Mb=(n,o,r)=>Id(jn(n.getValue(r)),jn(o.getValue(r))),Db=(n,o,r)=>Do(jn(n.getValue(r)).toLowerCase(),jn(o.getValue(r)).toLowerCase()),Lb=(n,o,r)=>Do(jn(n.getValue(r)),jn(o.getValue(r))),Tb=(n,o,r)=>{const a=n.getValue(r),l=o.getValue(r);return a>l?1:aDo(n.getValue(r),o.getValue(r));function Do(n,o){return n===o?0:n>o?1:-1}function jn(n){return typeof n=="number"?isNaN(n)||n===1/0||n===-1/0?"":String(n):typeof n=="string"?n:""}function Id(n,o){const r=n.split(ao).filter(Boolean),a=o.split(ao).filter(Boolean);for(;r.length&&a.length;){const l=r.shift(),c=a.shift(),d=parseInt(l,10),m=parseInt(c,10),p=[d,m].sort();if(isNaN(p[0])){if(l>c)return 1;if(c>l)return-1;continue}if(isNaN(p[1]))return isNaN(d)?-1:1;if(d>m)return 1;if(m>d)return-1}return r.length-a.length}const Vr={alphanumeric:Fb,alphanumericCaseSensitive:Mb,text:Db,textCaseSensitive:Lb,datetime:Tb,basic:Ob},Pb={getInitialState:n=>({sorting:[],...n}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:n=>({onSortingChange:xt("sorting",n),isMultiSortEvent:o=>o.shiftKey}),createColumn:(n,o)=>{n.getAutoSortingFn=()=>{const r=o.getFilteredRowModel().flatRows.slice(10);let a=!1;for(const l of r){const c=l==null?void 0:l.getValue(n.id);if(Object.prototype.toString.call(c)==="[object Date]")return Vr.datetime;if(typeof c=="string"&&(a=!0,c.split(ao).length>1))return Vr.alphanumeric}return a?Vr.text:Vr.basic},n.getAutoSortDir=()=>{const r=o.getFilteredRowModel().flatRows[0];return typeof(r==null?void 0:r.getValue(n.id))=="string"?"asc":"desc"},n.getSortingFn=()=>{var r,a;if(!n)throw new Error;return ds(n.columnDef.sortingFn)?n.columnDef.sortingFn:n.columnDef.sortingFn==="auto"?n.getAutoSortingFn():(r=(a=o.options.sortingFns)==null?void 0:a[n.columnDef.sortingFn])!=null?r:Vr[n.columnDef.sortingFn]},n.toggleSorting=(r,a)=>{const l=n.getNextSortingOrder(),c=typeof r<"u"&&r!==null;o.setSorting(d=>{const m=d==null?void 0:d.find(_=>_.id===n.id),p=d==null?void 0:d.findIndex(_=>_.id===n.id);let x=[],v,j=c?r:l==="desc";if(d!=null&&d.length&&n.getCanMultiSort()&&a?m?v="toggle":v="add":d!=null&&d.length&&p!==d.length-1?v="replace":m?v="toggle":v="replace",v==="toggle"&&(c||l||(v="remove")),v==="add"){var y;x=[...d,{id:n.id,desc:j}],x.splice(0,x.length-((y=o.options.maxMultiSortColCount)!=null?y:Number.MAX_SAFE_INTEGER))}else v==="toggle"?x=d.map(_=>_.id===n.id?{..._,desc:j}:_):v==="remove"?x=d.filter(_=>_.id!==n.id):x=[{id:n.id,desc:j}];return x})},n.getFirstSortDir=()=>{var r,a;return((r=(a=n.columnDef.sortDescFirst)!=null?a:o.options.sortDescFirst)!=null?r:n.getAutoSortDir()==="desc")?"desc":"asc"},n.getNextSortingOrder=r=>{var a,l;const c=n.getFirstSortDir(),d=n.getIsSorted();return d?d!==c&&((a=o.options.enableSortingRemoval)==null||a)&&(!(r&&(l=o.options.enableMultiRemove)!=null)||l)?!1:d==="desc"?"asc":"desc":c},n.getCanSort=()=>{var r,a;return((r=n.columnDef.enableSorting)!=null?r:!0)&&((a=o.options.enableSorting)!=null?a:!0)&&!!n.accessorFn},n.getCanMultiSort=()=>{var r,a;return(r=(a=n.columnDef.enableMultiSort)!=null?a:o.options.enableMultiSort)!=null?r:!!n.accessorFn},n.getIsSorted=()=>{var r;const a=(r=o.getState().sorting)==null?void 0:r.find(l=>l.id===n.id);return a?a.desc?"desc":"asc":!1},n.getSortIndex=()=>{var r,a;return(r=(a=o.getState().sorting)==null?void 0:a.findIndex(l=>l.id===n.id))!=null?r:-1},n.clearSorting=()=>{o.setSorting(r=>r!=null&&r.length?r.filter(a=>a.id!==n.id):[])},n.getToggleSortingHandler=()=>{const r=n.getCanSort();return a=>{r&&(a.persist==null||a.persist(),n.toggleSorting==null||n.toggleSorting(void 0,n.getCanMultiSort()?o.options.isMultiSortEvent==null?void 0:o.options.isMultiSortEvent(a):!1))}}},createTable:n=>{n.setSorting=o=>n.options.onSortingChange==null?void 0:n.options.onSortingChange(o),n.resetSorting=o=>{var r,a;n.setSorting(o?[]:(r=(a=n.initialState)==null?void 0:a.sorting)!=null?r:[])},n.getPreSortedRowModel=()=>n.getGroupedRowModel(),n.getSortedRowModel=()=>(!n._getSortedRowModel&&n.options.getSortedRowModel&&(n._getSortedRowModel=n.options.getSortedRowModel(n)),n.options.manualSorting||!n._getSortedRowModel?n.getPreSortedRowModel():n._getSortedRowModel())}},qb=[ab,Cb,bb,wb,ob,lb,yb,Nb,Pb,vb,Rb,Eb,Ab,Ib,Sb];function kb(n){var o,r;const a=[...qb,...(o=n._features)!=null?o:[]];let l={_features:a};const c=l._features.reduce((y,_)=>Object.assign(y,_.getDefaultOptions==null?void 0:_.getDefaultOptions(l)),{}),d=y=>l.options.mergeOptions?l.options.mergeOptions(c,y):{...c,...y};let p={...{},...(r=n.initialState)!=null?r:{}};l._features.forEach(y=>{var _;p=(_=y.getInitialState==null?void 0:y.getInitialState(p))!=null?_:p});const x=[];let v=!1;const j={_features:a,options:{...c,...n},initialState:p,_queue:y=>{x.push(y),v||(v=!0,Promise.resolve().then(()=>{for(;x.length;)x.shift()();v=!1}).catch(_=>setTimeout(()=>{throw _})))},reset:()=>{l.setState(l.initialState)},setOptions:y=>{const _=vn(y,l.options);l.options=d(_)},getState:()=>l.options.state,setState:y=>{l.options.onStateChange==null||l.options.onStateChange(y)},_getRowId:(y,_,E)=>{var R;return(R=l.options.getRowId==null?void 0:l.options.getRowId(y,_,E))!=null?R:`${E?[E.id,_].join("."):_}`},getCoreRowModel:()=>(l._getCoreRowModel||(l._getCoreRowModel=l.options.getCoreRowModel(l)),l._getCoreRowModel()),getRowModel:()=>l.getPaginationRowModel(),getRow:(y,_)=>{let E=(_?l.getPrePaginationRowModel():l.getRowModel()).rowsById[y];if(!E&&(E=l.getCoreRowModel().rowsById[y],!E))throw new Error;return E},_getDefaultColumnDef:Q(()=>[l.options.defaultColumn],y=>{var _;return y=(_=y)!=null?_:{},{header:E=>{const R=E.header.column.columnDef;return R.accessorKey?R.accessorKey:R.accessorFn?R.id:null},cell:E=>{var R,O;return(R=(O=E.renderValue())==null||O.toString==null?void 0:O.toString())!=null?R:null},...l._features.reduce((E,R)=>Object.assign(E,R.getDefaultColumnDef==null?void 0:R.getDefaultColumnDef()),{}),...y}},X(n,"debugColumns")),_getColumnDefs:()=>l.options.columns,getAllColumns:Q(()=>[l._getColumnDefs()],y=>{const _=function(E,R,O){return O===void 0&&(O=0),E.map(M=>{const $=sb(l,M,O,R),q=M;return $.columns=q.columns?_(q.columns,$,O+1):[],$})};return _(y)},X(n,"debugColumns")),getAllFlatColumns:Q(()=>[l.getAllColumns()],y=>y.flatMap(_=>_.getFlatColumns()),X(n,"debugColumns")),_getAllFlatColumnsById:Q(()=>[l.getAllFlatColumns()],y=>y.reduce((_,E)=>(_[E.id]=E,_),{}),X(n,"debugColumns")),getAllLeafColumns:Q(()=>[l.getAllColumns(),l._getOrderColumnsFn()],(y,_)=>{let E=y.flatMap(R=>R.getLeafColumns());return _(E)},X(n,"debugColumns")),getColumn:y=>l._getAllFlatColumnsById()[y]};Object.assign(l,j);for(let y=0;yQ(()=>[n.options.data],o=>{const r={rows:[],flatRows:[],rowsById:{}},a=function(l,c,d){c===void 0&&(c=0);const m=[];for(let x=0;xn._autoResetPageIndex()))}function Md(n,o,r){return r.options.filterFromLeafRows?$b(n,o,r):zb(n,o,r)}function $b(n,o,r){var a;const l=[],c={},d=(a=r.options.maxLeafRowFilterDepth)!=null?a:100,m=function(p,x){x===void 0&&(x=0);const v=[];for(let y=0;yQ(()=>[n.getPreFilteredRowModel(),n.getState().columnFilters,n.getState().globalFilter,n.getFilteredRowModel()],(r,a,l)=>{if(!r.rows.length||!(a!=null&&a.length)&&!l)return r;const c=[...a.map(m=>m.id).filter(m=>m!==o),l?"__global__":void 0].filter(Boolean),d=m=>{for(let p=0;pQ(()=>{var r;return[(r=n.getColumn(o))==null?void 0:r.getFacetedRowModel()]},r=>{if(!r)return new Map;let a=new Map;for(let c=0;cQ(()=>[n.getPreFilteredRowModel(),n.getState().columnFilters,n.getState().globalFilter],(o,r,a)=>{if(!o.rows.length||!(r!=null&&r.length)&&!a){for(let y=0;y{var _;const E=n.getColumn(y.id);if(!E)return;const R=E.getFilterFn();R&&l.push({id:y.id,filterFn:R,resolvedValue:(_=R.resolveFilterValue==null?void 0:R.resolveFilterValue(y.value))!=null?_:y.value})});const d=(r??[]).map(y=>y.id),m=n.getGlobalFilterFn(),p=n.getAllLeafColumns().filter(y=>y.getCanGlobalFilter());a&&m&&p.length&&(d.push("__global__"),p.forEach(y=>{var _;c.push({id:y.id,filterFn:m,resolvedValue:(_=m.resolveFilterValue==null?void 0:m.resolveFilterValue(a))!=null?_:a})}));let x,v;for(let y=0;y{_.columnFiltersMeta[R]=O})}if(c.length){for(let E=0;E{_.columnFiltersMeta[R]=O})){_.columnFilters.__global__=!0;break}}_.columnFilters.__global__!==!0&&(_.columnFilters.__global__=!1)}}const j=y=>{for(let _=0;_n._autoResetPageIndex()))}function Gb(){return n=>Q(()=>[n.getState().sorting,n.getPreSortedRowModel()],(o,r)=>{if(!r.rows.length||!(o!=null&&o.length))return r;const a=n.getState().sorting,l=[],c=a.filter(p=>{var x;return(x=n.getColumn(p.id))==null?void 0:x.getCanSort()}),d={};c.forEach(p=>{const x=n.getColumn(p.id);x&&(d[p.id]={sortUndefined:x.columnDef.sortUndefined,invertSorting:x.columnDef.invertSorting,sortingFn:x.getSortingFn()})});const m=p=>{const x=p.map(v=>({...v}));return x.sort((v,j)=>{for(let _=0;_{var j;l.push(v),(j=v.subRows)!=null&&j.length&&(v.subRows=m(v.subRows))}),x};return{rows:m(r.rows),flatRows:l,rowsById:r.rowsById}},X(n.options,"debugTable","getSortedRowModel",()=>n._autoResetPageIndex()))}/** + color: hsl(${Math.max(0,Math.min(120-120*y,120))}deg 100% 31%);`,r==null?void 0:r.key)}return l}}function Z(n,o,r,a){return{debug:()=>{var l;return(l=n==null?void 0:n.debugAll)!=null?l:n[o]},key:!1,onChange:a}}function ib(n,o,r,a){const l=()=>{var d;return(d=c.getValue())!=null?d:n.options.renderFallbackValue},c={id:`${o.id}_${r.id}`,row:o,column:r,getValue:()=>o.getValue(a),renderValue:l,getContext:Y(()=>[n,r,o,c],(d,m,p,x)=>({table:d,column:m,row:p,cell:x,getValue:x.getValue,renderValue:x.renderValue}),Z(n.options,"debugCells"))};return n._features.forEach(d=>{d.createCell==null||d.createCell(c,r,o,n)},{}),c}function sb(n,o,r,a){var l,c;const m={...n._getDefaultColumnDef(),...o},p=m.accessorKey;let x=(l=(c=m.id)!=null?c:p?typeof String.prototype.replaceAll=="function"?p.replaceAll(".","_"):p.replace(/\./g,"_"):void 0)!=null?l:typeof m.header=="string"?m.header:void 0,v;if(m.accessorFn?v=m.accessorFn:p&&(p.includes(".")?v=y=>{let _=y;for(const R of p.split(".")){var E;_=(E=_)==null?void 0:E[R]}return _}:v=y=>y[m.accessorKey]),!x)throw new Error;let j={id:`${String(x)}`,accessorFn:v,parent:a,depth:r,columnDef:m,columns:[],getFlatColumns:Y(()=>[!0],()=>{var y;return[j,...(y=j.columns)==null?void 0:y.flatMap(_=>_.getFlatColumns())]},Z(n.options,"debugColumns")),getLeafColumns:Y(()=>[n._getOrderColumnsFn()],y=>{var _;if((_=j.columns)!=null&&_.length){let E=j.columns.flatMap(R=>R.getLeafColumns());return y(E)}return[j]},Z(n.options,"debugColumns"))};for(const y of n._features)y.createColumn==null||y.createColumn(j,n);return j}const et="debugHeaders";function Cc(n,o,r){var a;let c={id:(a=r.id)!=null?a:o.id,column:o,index:r.index,isPlaceholder:!!r.isPlaceholder,placeholderId:r.placeholderId,depth:r.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const d=[],m=p=>{p.subHeaders&&p.subHeaders.length&&p.subHeaders.map(m),d.push(p)};return m(c),d},getContext:()=>({table:n,header:c,column:o})};return n._features.forEach(d=>{d.createHeader==null||d.createHeader(c,n)}),c}const ab={createTable:n=>{n.getHeaderGroups=Y(()=>[n.getAllColumns(),n.getVisibleLeafColumns(),n.getState().columnPinning.left,n.getState().columnPinning.right],(o,r,a,l)=>{var c,d;const m=(c=a==null?void 0:a.map(j=>r.find(y=>y.id===j)).filter(Boolean))!=null?c:[],p=(d=l==null?void 0:l.map(j=>r.find(y=>y.id===j)).filter(Boolean))!=null?d:[],x=r.filter(j=>!(a!=null&&a.includes(j.id))&&!(l!=null&&l.includes(j.id)));return Ki(o,[...m,...x,...p],n)},Z(n.options,et)),n.getCenterHeaderGroups=Y(()=>[n.getAllColumns(),n.getVisibleLeafColumns(),n.getState().columnPinning.left,n.getState().columnPinning.right],(o,r,a,l)=>(r=r.filter(c=>!(a!=null&&a.includes(c.id))&&!(l!=null&&l.includes(c.id))),Ki(o,r,n,"center")),Z(n.options,et)),n.getLeftHeaderGroups=Y(()=>[n.getAllColumns(),n.getVisibleLeafColumns(),n.getState().columnPinning.left],(o,r,a)=>{var l;const c=(l=a==null?void 0:a.map(d=>r.find(m=>m.id===d)).filter(Boolean))!=null?l:[];return Ki(o,c,n,"left")},Z(n.options,et)),n.getRightHeaderGroups=Y(()=>[n.getAllColumns(),n.getVisibleLeafColumns(),n.getState().columnPinning.right],(o,r,a)=>{var l;const c=(l=a==null?void 0:a.map(d=>r.find(m=>m.id===d)).filter(Boolean))!=null?l:[];return Ki(o,c,n,"right")},Z(n.options,et)),n.getFooterGroups=Y(()=>[n.getHeaderGroups()],o=>[...o].reverse(),Z(n.options,et)),n.getLeftFooterGroups=Y(()=>[n.getLeftHeaderGroups()],o=>[...o].reverse(),Z(n.options,et)),n.getCenterFooterGroups=Y(()=>[n.getCenterHeaderGroups()],o=>[...o].reverse(),Z(n.options,et)),n.getRightFooterGroups=Y(()=>[n.getRightHeaderGroups()],o=>[...o].reverse(),Z(n.options,et)),n.getFlatHeaders=Y(()=>[n.getHeaderGroups()],o=>o.map(r=>r.headers).flat(),Z(n.options,et)),n.getLeftFlatHeaders=Y(()=>[n.getLeftHeaderGroups()],o=>o.map(r=>r.headers).flat(),Z(n.options,et)),n.getCenterFlatHeaders=Y(()=>[n.getCenterHeaderGroups()],o=>o.map(r=>r.headers).flat(),Z(n.options,et)),n.getRightFlatHeaders=Y(()=>[n.getRightHeaderGroups()],o=>o.map(r=>r.headers).flat(),Z(n.options,et)),n.getCenterLeafHeaders=Y(()=>[n.getCenterFlatHeaders()],o=>o.filter(r=>{var a;return!((a=r.subHeaders)!=null&&a.length)}),Z(n.options,et)),n.getLeftLeafHeaders=Y(()=>[n.getLeftFlatHeaders()],o=>o.filter(r=>{var a;return!((a=r.subHeaders)!=null&&a.length)}),Z(n.options,et)),n.getRightLeafHeaders=Y(()=>[n.getRightFlatHeaders()],o=>o.filter(r=>{var a;return!((a=r.subHeaders)!=null&&a.length)}),Z(n.options,et)),n.getLeafHeaders=Y(()=>[n.getLeftHeaderGroups(),n.getCenterHeaderGroups(),n.getRightHeaderGroups()],(o,r,a)=>{var l,c,d,m,p,x;return[...(l=(c=o[0])==null?void 0:c.headers)!=null?l:[],...(d=(m=r[0])==null?void 0:m.headers)!=null?d:[],...(p=(x=a[0])==null?void 0:x.headers)!=null?p:[]].map(v=>v.getLeafHeaders()).flat()},Z(n.options,et))}};function Ki(n,o,r,a){var l,c;let d=0;const m=function(y,_){_===void 0&&(_=1),d=Math.max(d,_),y.filter(E=>E.getIsVisible()).forEach(E=>{var R;(R=E.columns)!=null&&R.length&&m(E.columns,_+1)},0)};m(n);let p=[];const x=(y,_)=>{const E={depth:_,id:[a,`${_}`].filter(Boolean).join("_"),headers:[]},R=[];y.forEach(L=>{const M=[...R].reverse()[0],$=L.column.depth===E.depth;let q,V=!1;if($&&L.column.parent?q=L.column.parent:(q=L.column,V=!0),M&&(M==null?void 0:M.column)===q)M.subHeaders.push(L);else{const D=Cc(r,q,{id:[a,_,q.id,L==null?void 0:L.id].filter(Boolean).join("_"),isPlaceholder:V,placeholderId:V?`${R.filter(k=>k.column===q).length}`:void 0,depth:_,index:R.length});D.subHeaders.push(L),R.push(D)}E.headers.push(L),L.headerGroup=E}),p.push(E),_>0&&x(R,_-1)},v=o.map((y,_)=>Cc(r,y,{depth:d,index:_}));x(v,d-1),p.reverse();const j=y=>y.filter(E=>E.column.getIsVisible()).map(E=>{let R=0,L=0,M=[0];E.subHeaders&&E.subHeaders.length?(M=[],j(E.subHeaders).forEach(q=>{let{colSpan:V,rowSpan:D}=q;R+=V,M.push(D)})):R=1;const $=Math.min(...M);return L=L+$,E.colSpan=R,E.rowSpan=L,{colSpan:R,rowSpan:L}});return j((l=(c=p[0])==null?void 0:c.headers)!=null?l:[]),p}const Io=(n,o,r,a,l,c,d)=>{let m={id:o,index:a,original:r,depth:l,parentId:d,_valuesCache:{},_uniqueValuesCache:{},getValue:p=>{if(m._valuesCache.hasOwnProperty(p))return m._valuesCache[p];const x=n.getColumn(p);if(x!=null&&x.accessorFn)return m._valuesCache[p]=x.accessorFn(m.original,a),m._valuesCache[p]},getUniqueValues:p=>{if(m._uniqueValuesCache.hasOwnProperty(p))return m._uniqueValuesCache[p];const x=n.getColumn(p);if(x!=null&&x.accessorFn)return x.columnDef.getUniqueValues?(m._uniqueValuesCache[p]=x.columnDef.getUniqueValues(m.original,a),m._uniqueValuesCache[p]):(m._uniqueValuesCache[p]=[m.getValue(p)],m._uniqueValuesCache[p])},renderValue:p=>{var x;return(x=m.getValue(p))!=null?x:n.options.renderFallbackValue},subRows:[],getLeafRows:()=>rb(m.subRows,p=>p.subRows),getParentRow:()=>m.parentId?n.getRow(m.parentId,!0):void 0,getParentRows:()=>{let p=[],x=m;for(;;){const v=x.getParentRow();if(!v)break;p.push(v),x=v}return p.reverse()},getAllCells:Y(()=>[n.getAllLeafColumns()],p=>p.map(x=>ib(n,m,x,x.id)),Z(n.options,"debugRows")),_getAllCellsByColumnId:Y(()=>[m.getAllCells()],p=>p.reduce((x,v)=>(x[v.column.id]=v,x),{}),Z(n.options,"debugRows"))};for(let p=0;p{n._getFacetedRowModel=o.options.getFacetedRowModel&&o.options.getFacetedRowModel(o,n.id),n.getFacetedRowModel=()=>n._getFacetedRowModel?n._getFacetedRowModel():o.getPreFilteredRowModel(),n._getFacetedUniqueValues=o.options.getFacetedUniqueValues&&o.options.getFacetedUniqueValues(o,n.id),n.getFacetedUniqueValues=()=>n._getFacetedUniqueValues?n._getFacetedUniqueValues():new Map,n._getFacetedMinMaxValues=o.options.getFacetedMinMaxValues&&o.options.getFacetedMinMaxValues(o,n.id),n.getFacetedMinMaxValues=()=>{if(n._getFacetedMinMaxValues)return n._getFacetedMinMaxValues()}}},Sd=(n,o,r)=>{var a,l;const c=r==null||(a=r.toString())==null?void 0:a.toLowerCase();return!!(!((l=n.getValue(o))==null||(l=l.toString())==null||(l=l.toLowerCase())==null)&&l.includes(c))};Sd.autoRemove=n=>Lt(n);const jd=(n,o,r)=>{var a;return!!(!((a=n.getValue(o))==null||(a=a.toString())==null)&&a.includes(r))};jd.autoRemove=n=>Lt(n);const Cd=(n,o,r)=>{var a;return((a=n.getValue(o))==null||(a=a.toString())==null?void 0:a.toLowerCase())===(r==null?void 0:r.toLowerCase())};Cd.autoRemove=n=>Lt(n);const yd=(n,o,r)=>{var a;return(a=n.getValue(o))==null?void 0:a.includes(r)};yd.autoRemove=n=>Lt(n);const Nd=(n,o,r)=>!r.some(a=>{var l;return!((l=n.getValue(o))!=null&&l.includes(a))});Nd.autoRemove=n=>Lt(n)||!(n!=null&&n.length);const Rd=(n,o,r)=>r.some(a=>{var l;return(l=n.getValue(o))==null?void 0:l.includes(a)});Rd.autoRemove=n=>Lt(n)||!(n!=null&&n.length);const Ed=(n,o,r)=>n.getValue(o)===r;Ed.autoRemove=n=>Lt(n);const Ad=(n,o,r)=>n.getValue(o)==r;Ad.autoRemove=n=>Lt(n);const Fo=(n,o,r)=>{let[a,l]=r;const c=n.getValue(o);return c>=a&&c<=l};Fo.resolveFilterValue=n=>{let[o,r]=n,a=typeof o!="number"?parseFloat(o):o,l=typeof r!="number"?parseFloat(r):r,c=o===null||Number.isNaN(a)?-1/0:a,d=r===null||Number.isNaN(l)?1/0:l;if(c>d){const m=c;c=d,d=m}return[c,d]};Fo.autoRemove=n=>Lt(n)||Lt(n[0])&&Lt(n[1]);const en={includesString:Sd,includesStringSensitive:jd,equalsString:Cd,arrIncludes:yd,arrIncludesAll:Nd,arrIncludesSome:Rd,equals:Ed,weakEquals:Ad,inNumberRange:Fo};function Lt(n){return n==null||n===""}const lb={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:n=>({columnFilters:[],...n}),getDefaultOptions:n=>({onColumnFiltersChange:xt("columnFilters",n),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(n,o)=>{n.getAutoFilterFn=()=>{const r=o.getCoreRowModel().flatRows[0],a=r==null?void 0:r.getValue(n.id);return typeof a=="string"?en.includesString:typeof a=="number"?en.inNumberRange:typeof a=="boolean"||a!==null&&typeof a=="object"?en.equals:Array.isArray(a)?en.arrIncludes:en.weakEquals},n.getFilterFn=()=>{var r,a;return ds(n.columnDef.filterFn)?n.columnDef.filterFn:n.columnDef.filterFn==="auto"?n.getAutoFilterFn():(r=(a=o.options.filterFns)==null?void 0:a[n.columnDef.filterFn])!=null?r:en[n.columnDef.filterFn]},n.getCanFilter=()=>{var r,a,l;return((r=n.columnDef.enableColumnFilter)!=null?r:!0)&&((a=o.options.enableColumnFilters)!=null?a:!0)&&((l=o.options.enableFilters)!=null?l:!0)&&!!n.accessorFn},n.getIsFiltered=()=>n.getFilterIndex()>-1,n.getFilterValue=()=>{var r;return(r=o.getState().columnFilters)==null||(r=r.find(a=>a.id===n.id))==null?void 0:r.value},n.getFilterIndex=()=>{var r,a;return(r=(a=o.getState().columnFilters)==null?void 0:a.findIndex(l=>l.id===n.id))!=null?r:-1},n.setFilterValue=r=>{o.setColumnFilters(a=>{const l=n.getFilterFn(),c=a==null?void 0:a.find(v=>v.id===n.id),d=vn(r,c?c.value:void 0);if(yc(l,d,n)){var m;return(m=a==null?void 0:a.filter(v=>v.id!==n.id))!=null?m:[]}const p={id:n.id,value:d};if(c){var x;return(x=a==null?void 0:a.map(v=>v.id===n.id?p:v))!=null?x:[]}return a!=null&&a.length?[...a,p]:[p]})}},createRow:(n,o)=>{n.columnFilters={},n.columnFiltersMeta={}},createTable:n=>{n.setColumnFilters=o=>{const r=n.getAllLeafColumns(),a=l=>{var c;return(c=vn(o,l))==null?void 0:c.filter(d=>{const m=r.find(p=>p.id===d.id);if(m){const p=m.getFilterFn();if(yc(p,d.value,m))return!1}return!0})};n.options.onColumnFiltersChange==null||n.options.onColumnFiltersChange(a)},n.resetColumnFilters=o=>{var r,a;n.setColumnFilters(o?[]:(r=(a=n.initialState)==null?void 0:a.columnFilters)!=null?r:[])},n.getPreFilteredRowModel=()=>n.getCoreRowModel(),n.getFilteredRowModel=()=>(!n._getFilteredRowModel&&n.options.getFilteredRowModel&&(n._getFilteredRowModel=n.options.getFilteredRowModel(n)),n.options.manualFiltering||!n._getFilteredRowModel?n.getPreFilteredRowModel():n._getFilteredRowModel())}};function yc(n,o,r){return(n&&n.autoRemove?n.autoRemove(o,r):!1)||typeof o>"u"||typeof o=="string"&&!o}const ub=(n,o,r)=>r.reduce((a,l)=>{const c=l.getValue(n);return a+(typeof c=="number"?c:0)},0),cb=(n,o,r)=>{let a;return r.forEach(l=>{const c=l.getValue(n);c!=null&&(a>c||a===void 0&&c>=c)&&(a=c)}),a},db=(n,o,r)=>{let a;return r.forEach(l=>{const c=l.getValue(n);c!=null&&(a=c)&&(a=c)}),a},fb=(n,o,r)=>{let a,l;return r.forEach(c=>{const d=c.getValue(n);d!=null&&(a===void 0?d>=d&&(a=l=d):(a>d&&(a=d),l{let r=0,a=0;if(o.forEach(l=>{let c=l.getValue(n);c!=null&&(c=+c)>=c&&(++r,a+=c)}),r)return a/r},mb=(n,o)=>{if(!o.length)return;const r=o.map(c=>c.getValue(n));if(!nb(r))return;if(r.length===1)return r[0];const a=Math.floor(r.length/2),l=r.sort((c,d)=>c-d);return r.length%2!==0?l[a]:(l[a-1]+l[a])/2},hb=(n,o)=>Array.from(new Set(o.map(r=>r.getValue(n))).values()),pb=(n,o)=>new Set(o.map(r=>r.getValue(n))).size,xb=(n,o)=>o.length,za={sum:ub,min:cb,max:db,extent:fb,mean:gb,median:mb,unique:hb,uniqueCount:pb,count:xb},vb={getDefaultColumnDef:()=>({aggregatedCell:n=>{var o,r;return(o=(r=n.getValue())==null||r.toString==null?void 0:r.toString())!=null?o:null},aggregationFn:"auto"}),getInitialState:n=>({grouping:[],...n}),getDefaultOptions:n=>({onGroupingChange:xt("grouping",n),groupedColumnMode:"reorder"}),createColumn:(n,o)=>{n.toggleGrouping=()=>{o.setGrouping(r=>r!=null&&r.includes(n.id)?r.filter(a=>a!==n.id):[...r??[],n.id])},n.getCanGroup=()=>{var r,a;return((r=n.columnDef.enableGrouping)!=null?r:!0)&&((a=o.options.enableGrouping)!=null?a:!0)&&(!!n.accessorFn||!!n.columnDef.getGroupingValue)},n.getIsGrouped=()=>{var r;return(r=o.getState().grouping)==null?void 0:r.includes(n.id)},n.getGroupedIndex=()=>{var r;return(r=o.getState().grouping)==null?void 0:r.indexOf(n.id)},n.getToggleGroupingHandler=()=>{const r=n.getCanGroup();return()=>{r&&n.toggleGrouping()}},n.getAutoAggregationFn=()=>{const r=o.getCoreRowModel().flatRows[0],a=r==null?void 0:r.getValue(n.id);if(typeof a=="number")return za.sum;if(Object.prototype.toString.call(a)==="[object Date]")return za.extent},n.getAggregationFn=()=>{var r,a;if(!n)throw new Error;return ds(n.columnDef.aggregationFn)?n.columnDef.aggregationFn:n.columnDef.aggregationFn==="auto"?n.getAutoAggregationFn():(r=(a=o.options.aggregationFns)==null?void 0:a[n.columnDef.aggregationFn])!=null?r:za[n.columnDef.aggregationFn]}},createTable:n=>{n.setGrouping=o=>n.options.onGroupingChange==null?void 0:n.options.onGroupingChange(o),n.resetGrouping=o=>{var r,a;n.setGrouping(o?[]:(r=(a=n.initialState)==null?void 0:a.grouping)!=null?r:[])},n.getPreGroupedRowModel=()=>n.getFilteredRowModel(),n.getGroupedRowModel=()=>(!n._getGroupedRowModel&&n.options.getGroupedRowModel&&(n._getGroupedRowModel=n.options.getGroupedRowModel(n)),n.options.manualGrouping||!n._getGroupedRowModel?n.getPreGroupedRowModel():n._getGroupedRowModel())},createRow:(n,o)=>{n.getIsGrouped=()=>!!n.groupingColumnId,n.getGroupingValue=r=>{if(n._groupingValuesCache.hasOwnProperty(r))return n._groupingValuesCache[r];const a=o.getColumn(r);return a!=null&&a.columnDef.getGroupingValue?(n._groupingValuesCache[r]=a.columnDef.getGroupingValue(n.original),n._groupingValuesCache[r]):n.getValue(r)},n._groupingValuesCache={}},createCell:(n,o,r,a)=>{n.getIsGrouped=()=>o.getIsGrouped()&&o.id===r.groupingColumnId,n.getIsPlaceholder=()=>!n.getIsGrouped()&&o.getIsGrouped(),n.getIsAggregated=()=>{var l;return!n.getIsGrouped()&&!n.getIsPlaceholder()&&!!((l=r.subRows)!=null&&l.length)}}};function _b(n,o,r){if(!(o!=null&&o.length)||!r)return n;const a=n.filter(c=>!o.includes(c.id));return r==="remove"?a:[...o.map(c=>n.find(d=>d.id===c)).filter(Boolean),...a]}const bb={getInitialState:n=>({columnOrder:[],...n}),getDefaultOptions:n=>({onColumnOrderChange:xt("columnOrder",n)}),createColumn:(n,o)=>{n.getIndex=Y(r=>[Gr(o,r)],r=>r.findIndex(a=>a.id===n.id),Z(o.options,"debugColumns")),n.getIsFirstColumn=r=>{var a;return((a=Gr(o,r)[0])==null?void 0:a.id)===n.id},n.getIsLastColumn=r=>{var a;const l=Gr(o,r);return((a=l[l.length-1])==null?void 0:a.id)===n.id}},createTable:n=>{n.setColumnOrder=o=>n.options.onColumnOrderChange==null?void 0:n.options.onColumnOrderChange(o),n.resetColumnOrder=o=>{var r;n.setColumnOrder(o?[]:(r=n.initialState.columnOrder)!=null?r:[])},n._getOrderColumnsFn=Y(()=>[n.getState().columnOrder,n.getState().grouping,n.options.groupedColumnMode],(o,r,a)=>l=>{let c=[];if(!(o!=null&&o.length))c=l;else{const d=[...o],m=[...l];for(;m.length&&d.length;){const p=d.shift(),x=m.findIndex(v=>v.id===p);x>-1&&c.push(m.splice(x,1)[0])}c=[...c,...m]}return _b(c,r,a)},Z(n.options,"debugTable"))}},Va=()=>({left:[],right:[]}),wb={getInitialState:n=>({columnPinning:Va(),...n}),getDefaultOptions:n=>({onColumnPinningChange:xt("columnPinning",n)}),createColumn:(n,o)=>{n.pin=r=>{const a=n.getLeafColumns().map(l=>l.id).filter(Boolean);o.setColumnPinning(l=>{var c,d;if(r==="right"){var m,p;return{left:((m=l==null?void 0:l.left)!=null?m:[]).filter(j=>!(a!=null&&a.includes(j))),right:[...((p=l==null?void 0:l.right)!=null?p:[]).filter(j=>!(a!=null&&a.includes(j))),...a]}}if(r==="left"){var x,v;return{left:[...((x=l==null?void 0:l.left)!=null?x:[]).filter(j=>!(a!=null&&a.includes(j))),...a],right:((v=l==null?void 0:l.right)!=null?v:[]).filter(j=>!(a!=null&&a.includes(j)))}}return{left:((c=l==null?void 0:l.left)!=null?c:[]).filter(j=>!(a!=null&&a.includes(j))),right:((d=l==null?void 0:l.right)!=null?d:[]).filter(j=>!(a!=null&&a.includes(j)))}})},n.getCanPin=()=>n.getLeafColumns().some(a=>{var l,c,d;return((l=a.columnDef.enablePinning)!=null?l:!0)&&((c=(d=o.options.enableColumnPinning)!=null?d:o.options.enablePinning)!=null?c:!0)}),n.getIsPinned=()=>{const r=n.getLeafColumns().map(m=>m.id),{left:a,right:l}=o.getState().columnPinning,c=r.some(m=>a==null?void 0:a.includes(m)),d=r.some(m=>l==null?void 0:l.includes(m));return c?"left":d?"right":!1},n.getPinnedIndex=()=>{var r,a;const l=n.getIsPinned();return l?(r=(a=o.getState().columnPinning)==null||(a=a[l])==null?void 0:a.indexOf(n.id))!=null?r:-1:0}},createRow:(n,o)=>{n.getCenterVisibleCells=Y(()=>[n._getAllVisibleCells(),o.getState().columnPinning.left,o.getState().columnPinning.right],(r,a,l)=>{const c=[...a??[],...l??[]];return r.filter(d=>!c.includes(d.column.id))},Z(o.options,"debugRows")),n.getLeftVisibleCells=Y(()=>[n._getAllVisibleCells(),o.getState().columnPinning.left],(r,a)=>(a??[]).map(c=>r.find(d=>d.column.id===c)).filter(Boolean).map(c=>({...c,position:"left"})),Z(o.options,"debugRows")),n.getRightVisibleCells=Y(()=>[n._getAllVisibleCells(),o.getState().columnPinning.right],(r,a)=>(a??[]).map(c=>r.find(d=>d.column.id===c)).filter(Boolean).map(c=>({...c,position:"right"})),Z(o.options,"debugRows"))},createTable:n=>{n.setColumnPinning=o=>n.options.onColumnPinningChange==null?void 0:n.options.onColumnPinningChange(o),n.resetColumnPinning=o=>{var r,a;return n.setColumnPinning(o?Va():(r=(a=n.initialState)==null?void 0:a.columnPinning)!=null?r:Va())},n.getIsSomeColumnsPinned=o=>{var r;const a=n.getState().columnPinning;if(!o){var l,c;return!!((l=a.left)!=null&&l.length||(c=a.right)!=null&&c.length)}return!!((r=a[o])!=null&&r.length)},n.getLeftLeafColumns=Y(()=>[n.getAllLeafColumns(),n.getState().columnPinning.left],(o,r)=>(r??[]).map(a=>o.find(l=>l.id===a)).filter(Boolean),Z(n.options,"debugColumns")),n.getRightLeafColumns=Y(()=>[n.getAllLeafColumns(),n.getState().columnPinning.right],(o,r)=>(r??[]).map(a=>o.find(l=>l.id===a)).filter(Boolean),Z(n.options,"debugColumns")),n.getCenterLeafColumns=Y(()=>[n.getAllLeafColumns(),n.getState().columnPinning.left,n.getState().columnPinning.right],(o,r,a)=>{const l=[...r??[],...a??[]];return o.filter(c=>!l.includes(c.id))},Z(n.options,"debugColumns"))}},Wi={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Ha=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Sb={getDefaultColumnDef:()=>Wi,getInitialState:n=>({columnSizing:{},columnSizingInfo:Ha(),...n}),getDefaultOptions:n=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:xt("columnSizing",n),onColumnSizingInfoChange:xt("columnSizingInfo",n)}),createColumn:(n,o)=>{n.getSize=()=>{var r,a,l;const c=o.getState().columnSizing[n.id];return Math.min(Math.max((r=n.columnDef.minSize)!=null?r:Wi.minSize,(a=c??n.columnDef.size)!=null?a:Wi.size),(l=n.columnDef.maxSize)!=null?l:Wi.maxSize)},n.getStart=Y(r=>[r,Gr(o,r),o.getState().columnSizing],(r,a)=>a.slice(0,n.getIndex(r)).reduce((l,c)=>l+c.getSize(),0),Z(o.options,"debugColumns")),n.getAfter=Y(r=>[r,Gr(o,r),o.getState().columnSizing],(r,a)=>a.slice(n.getIndex(r)+1).reduce((l,c)=>l+c.getSize(),0),Z(o.options,"debugColumns")),n.resetSize=()=>{o.setColumnSizing(r=>{let{[n.id]:a,...l}=r;return l})},n.getCanResize=()=>{var r,a;return((r=n.columnDef.enableResizing)!=null?r:!0)&&((a=o.options.enableColumnResizing)!=null?a:!0)},n.getIsResizing=()=>o.getState().columnSizingInfo.isResizingColumn===n.id},createHeader:(n,o)=>{n.getSize=()=>{let r=0;const a=l=>{if(l.subHeaders.length)l.subHeaders.forEach(a);else{var c;r+=(c=l.column.getSize())!=null?c:0}};return a(n),r},n.getStart=()=>{if(n.index>0){const r=n.headerGroup.headers[n.index-1];return r.getStart()+r.getSize()}return 0},n.getResizeHandler=r=>{const a=o.getColumn(n.column.id),l=a==null?void 0:a.getCanResize();return c=>{if(!a||!l||(c.persist==null||c.persist(),Ga(c)&&c.touches&&c.touches.length>1))return;const d=n.getSize(),m=n?n.getLeafHeaders().map(M=>[M.column.id,M.column.getSize()]):[[a.id,a.getSize()]],p=Ga(c)?Math.round(c.touches[0].clientX):c.clientX,x={},v=(M,$)=>{typeof $=="number"&&(o.setColumnSizingInfo(q=>{var V,D;const k=o.options.columnResizeDirection==="rtl"?-1:1,W=($-((V=q==null?void 0:q.startOffset)!=null?V:0))*k,te=Math.max(W/((D=q==null?void 0:q.startSize)!=null?D:0),-.999999);return q.columnSizingStart.forEach(U=>{let[ge,_e]=U;x[ge]=Math.round(Math.max(_e+_e*te,0)*100)/100}),{...q,deltaOffset:W,deltaPercentage:te}}),(o.options.columnResizeMode==="onChange"||M==="end")&&o.setColumnSizing(q=>({...q,...x})))},j=M=>v("move",M),y=M=>{v("end",M),o.setColumnSizingInfo($=>({...$,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},_=r||typeof document<"u"?document:null,E={moveHandler:M=>j(M.clientX),upHandler:M=>{_==null||_.removeEventListener("mousemove",E.moveHandler),_==null||_.removeEventListener("mouseup",E.upHandler),y(M.clientX)}},R={moveHandler:M=>(M.cancelable&&(M.preventDefault(),M.stopPropagation()),j(M.touches[0].clientX),!1),upHandler:M=>{var $;_==null||_.removeEventListener("touchmove",R.moveHandler),_==null||_.removeEventListener("touchend",R.upHandler),M.cancelable&&(M.preventDefault(),M.stopPropagation()),y(($=M.touches[0])==null?void 0:$.clientX)}},L=jb()?{passive:!1}:!1;Ga(c)?(_==null||_.addEventListener("touchmove",R.moveHandler,L),_==null||_.addEventListener("touchend",R.upHandler,L)):(_==null||_.addEventListener("mousemove",E.moveHandler,L),_==null||_.addEventListener("mouseup",E.upHandler,L)),o.setColumnSizingInfo(M=>({...M,startOffset:p,startSize:d,deltaOffset:0,deltaPercentage:0,columnSizingStart:m,isResizingColumn:a.id}))}}},createTable:n=>{n.setColumnSizing=o=>n.options.onColumnSizingChange==null?void 0:n.options.onColumnSizingChange(o),n.setColumnSizingInfo=o=>n.options.onColumnSizingInfoChange==null?void 0:n.options.onColumnSizingInfoChange(o),n.resetColumnSizing=o=>{var r;n.setColumnSizing(o?{}:(r=n.initialState.columnSizing)!=null?r:{})},n.resetHeaderSizeInfo=o=>{var r;n.setColumnSizingInfo(o?Ha():(r=n.initialState.columnSizingInfo)!=null?r:Ha())},n.getTotalSize=()=>{var o,r;return(o=(r=n.getHeaderGroups()[0])==null?void 0:r.headers.reduce((a,l)=>a+l.getSize(),0))!=null?o:0},n.getLeftTotalSize=()=>{var o,r;return(o=(r=n.getLeftHeaderGroups()[0])==null?void 0:r.headers.reduce((a,l)=>a+l.getSize(),0))!=null?o:0},n.getCenterTotalSize=()=>{var o,r;return(o=(r=n.getCenterHeaderGroups()[0])==null?void 0:r.headers.reduce((a,l)=>a+l.getSize(),0))!=null?o:0},n.getRightTotalSize=()=>{var o,r;return(o=(r=n.getRightHeaderGroups()[0])==null?void 0:r.headers.reduce((a,l)=>a+l.getSize(),0))!=null?o:0}}};let Qi=null;function jb(){if(typeof Qi=="boolean")return Qi;let n=!1;try{const o={get passive(){return n=!0,!1}},r=()=>{};window.addEventListener("test",r,o),window.removeEventListener("test",r)}catch{n=!1}return Qi=n,Qi}function Ga(n){return n.type==="touchstart"}const Cb={getInitialState:n=>({columnVisibility:{},...n}),getDefaultOptions:n=>({onColumnVisibilityChange:xt("columnVisibility",n)}),createColumn:(n,o)=>{n.toggleVisibility=r=>{n.getCanHide()&&o.setColumnVisibility(a=>({...a,[n.id]:r??!n.getIsVisible()}))},n.getIsVisible=()=>{var r,a;const l=n.columns;return(r=l.length?l.some(c=>c.getIsVisible()):(a=o.getState().columnVisibility)==null?void 0:a[n.id])!=null?r:!0},n.getCanHide=()=>{var r,a;return((r=n.columnDef.enableHiding)!=null?r:!0)&&((a=o.options.enableHiding)!=null?a:!0)},n.getToggleVisibilityHandler=()=>r=>{n.toggleVisibility==null||n.toggleVisibility(r.target.checked)}},createRow:(n,o)=>{n._getAllVisibleCells=Y(()=>[n.getAllCells(),o.getState().columnVisibility],r=>r.filter(a=>a.column.getIsVisible()),Z(o.options,"debugRows")),n.getVisibleCells=Y(()=>[n.getLeftVisibleCells(),n.getCenterVisibleCells(),n.getRightVisibleCells()],(r,a,l)=>[...r,...a,...l],Z(o.options,"debugRows"))},createTable:n=>{const o=(r,a)=>Y(()=>[a(),a().filter(l=>l.getIsVisible()).map(l=>l.id).join("_")],l=>l.filter(c=>c.getIsVisible==null?void 0:c.getIsVisible()),Z(n.options,"debugColumns"));n.getVisibleFlatColumns=o("getVisibleFlatColumns",()=>n.getAllFlatColumns()),n.getVisibleLeafColumns=o("getVisibleLeafColumns",()=>n.getAllLeafColumns()),n.getLeftVisibleLeafColumns=o("getLeftVisibleLeafColumns",()=>n.getLeftLeafColumns()),n.getRightVisibleLeafColumns=o("getRightVisibleLeafColumns",()=>n.getRightLeafColumns()),n.getCenterVisibleLeafColumns=o("getCenterVisibleLeafColumns",()=>n.getCenterLeafColumns()),n.setColumnVisibility=r=>n.options.onColumnVisibilityChange==null?void 0:n.options.onColumnVisibilityChange(r),n.resetColumnVisibility=r=>{var a;n.setColumnVisibility(r?{}:(a=n.initialState.columnVisibility)!=null?a:{})},n.toggleAllColumnsVisible=r=>{var a;r=(a=r)!=null?a:!n.getIsAllColumnsVisible(),n.setColumnVisibility(n.getAllLeafColumns().reduce((l,c)=>({...l,[c.id]:r||!(c.getCanHide!=null&&c.getCanHide())}),{}))},n.getIsAllColumnsVisible=()=>!n.getAllLeafColumns().some(r=>!(r.getIsVisible!=null&&r.getIsVisible())),n.getIsSomeColumnsVisible=()=>n.getAllLeafColumns().some(r=>r.getIsVisible==null?void 0:r.getIsVisible()),n.getToggleAllColumnsVisibilityHandler=()=>r=>{var a;n.toggleAllColumnsVisible((a=r.target)==null?void 0:a.checked)}}};function Gr(n,o){return o?o==="center"?n.getCenterVisibleLeafColumns():o==="left"?n.getLeftVisibleLeafColumns():n.getRightVisibleLeafColumns():n.getVisibleLeafColumns()}const yb={createTable:n=>{n._getGlobalFacetedRowModel=n.options.getFacetedRowModel&&n.options.getFacetedRowModel(n,"__global__"),n.getGlobalFacetedRowModel=()=>n.options.manualFiltering||!n._getGlobalFacetedRowModel?n.getPreFilteredRowModel():n._getGlobalFacetedRowModel(),n._getGlobalFacetedUniqueValues=n.options.getFacetedUniqueValues&&n.options.getFacetedUniqueValues(n,"__global__"),n.getGlobalFacetedUniqueValues=()=>n._getGlobalFacetedUniqueValues?n._getGlobalFacetedUniqueValues():new Map,n._getGlobalFacetedMinMaxValues=n.options.getFacetedMinMaxValues&&n.options.getFacetedMinMaxValues(n,"__global__"),n.getGlobalFacetedMinMaxValues=()=>{if(n._getGlobalFacetedMinMaxValues)return n._getGlobalFacetedMinMaxValues()}}},Nb={getInitialState:n=>({globalFilter:void 0,...n}),getDefaultOptions:n=>({onGlobalFilterChange:xt("globalFilter",n),globalFilterFn:"auto",getColumnCanGlobalFilter:o=>{var r;const a=(r=n.getCoreRowModel().flatRows[0])==null||(r=r._getAllCellsByColumnId()[o.id])==null?void 0:r.getValue();return typeof a=="string"||typeof a=="number"}}),createColumn:(n,o)=>{n.getCanGlobalFilter=()=>{var r,a,l,c;return((r=n.columnDef.enableGlobalFilter)!=null?r:!0)&&((a=o.options.enableGlobalFilter)!=null?a:!0)&&((l=o.options.enableFilters)!=null?l:!0)&&((c=o.options.getColumnCanGlobalFilter==null?void 0:o.options.getColumnCanGlobalFilter(n))!=null?c:!0)&&!!n.accessorFn}},createTable:n=>{n.getGlobalAutoFilterFn=()=>en.includesString,n.getGlobalFilterFn=()=>{var o,r;const{globalFilterFn:a}=n.options;return ds(a)?a:a==="auto"?n.getGlobalAutoFilterFn():(o=(r=n.options.filterFns)==null?void 0:r[a])!=null?o:en[a]},n.setGlobalFilter=o=>{n.options.onGlobalFilterChange==null||n.options.onGlobalFilterChange(o)},n.resetGlobalFilter=o=>{n.setGlobalFilter(o?void 0:n.initialState.globalFilter)}}},Rb={getInitialState:n=>({expanded:{},...n}),getDefaultOptions:n=>({onExpandedChange:xt("expanded",n),paginateExpandedRows:!0}),createTable:n=>{let o=!1,r=!1;n._autoResetExpanded=()=>{var a,l;if(!o){n._queue(()=>{o=!0});return}if((a=(l=n.options.autoResetAll)!=null?l:n.options.autoResetExpanded)!=null?a:!n.options.manualExpanding){if(r)return;r=!0,n._queue(()=>{n.resetExpanded(),r=!1})}},n.setExpanded=a=>n.options.onExpandedChange==null?void 0:n.options.onExpandedChange(a),n.toggleAllRowsExpanded=a=>{a??!n.getIsAllRowsExpanded()?n.setExpanded(!0):n.setExpanded({})},n.resetExpanded=a=>{var l,c;n.setExpanded(a?{}:(l=(c=n.initialState)==null?void 0:c.expanded)!=null?l:{})},n.getCanSomeRowsExpand=()=>n.getPrePaginationRowModel().flatRows.some(a=>a.getCanExpand()),n.getToggleAllRowsExpandedHandler=()=>a=>{a.persist==null||a.persist(),n.toggleAllRowsExpanded()},n.getIsSomeRowsExpanded=()=>{const a=n.getState().expanded;return a===!0||Object.values(a).some(Boolean)},n.getIsAllRowsExpanded=()=>{const a=n.getState().expanded;return typeof a=="boolean"?a===!0:!(!Object.keys(a).length||n.getRowModel().flatRows.some(l=>!l.getIsExpanded()))},n.getExpandedDepth=()=>{let a=0;return(n.getState().expanded===!0?Object.keys(n.getRowModel().rowsById):Object.keys(n.getState().expanded)).forEach(c=>{const d=c.split(".");a=Math.max(a,d.length)}),a},n.getPreExpandedRowModel=()=>n.getSortedRowModel(),n.getExpandedRowModel=()=>(!n._getExpandedRowModel&&n.options.getExpandedRowModel&&(n._getExpandedRowModel=n.options.getExpandedRowModel(n)),n.options.manualExpanding||!n._getExpandedRowModel?n.getPreExpandedRowModel():n._getExpandedRowModel())},createRow:(n,o)=>{n.toggleExpanded=r=>{o.setExpanded(a=>{var l;const c=a===!0?!0:!!(a!=null&&a[n.id]);let d={};if(a===!0?Object.keys(o.getRowModel().rowsById).forEach(m=>{d[m]=!0}):d=a,r=(l=r)!=null?l:!c,!c&&r)return{...d,[n.id]:!0};if(c&&!r){const{[n.id]:m,...p}=d;return p}return a})},n.getIsExpanded=()=>{var r;const a=o.getState().expanded;return!!((r=o.options.getIsRowExpanded==null?void 0:o.options.getIsRowExpanded(n))!=null?r:a===!0||a!=null&&a[n.id])},n.getCanExpand=()=>{var r,a,l;return(r=o.options.getRowCanExpand==null?void 0:o.options.getRowCanExpand(n))!=null?r:((a=o.options.enableExpanding)!=null?a:!0)&&!!((l=n.subRows)!=null&&l.length)},n.getIsAllParentsExpanded=()=>{let r=!0,a=n;for(;r&&a.parentId;)a=o.getRow(a.parentId,!0),r=a.getIsExpanded();return r},n.getToggleExpandedHandler=()=>{const r=n.getCanExpand();return()=>{r&&n.toggleExpanded()}}}},no=0,ro=10,Ka=()=>({pageIndex:no,pageSize:ro}),Eb={getInitialState:n=>({...n,pagination:{...Ka(),...n==null?void 0:n.pagination}}),getDefaultOptions:n=>({onPaginationChange:xt("pagination",n)}),createTable:n=>{let o=!1,r=!1;n._autoResetPageIndex=()=>{var a,l;if(!o){n._queue(()=>{o=!0});return}if((a=(l=n.options.autoResetAll)!=null?l:n.options.autoResetPageIndex)!=null?a:!n.options.manualPagination){if(r)return;r=!0,n._queue(()=>{n.resetPageIndex(),r=!1})}},n.setPagination=a=>{const l=c=>vn(a,c);return n.options.onPaginationChange==null?void 0:n.options.onPaginationChange(l)},n.resetPagination=a=>{var l;n.setPagination(a?Ka():(l=n.initialState.pagination)!=null?l:Ka())},n.setPageIndex=a=>{n.setPagination(l=>{let c=vn(a,l.pageIndex);const d=typeof n.options.pageCount>"u"||n.options.pageCount===-1?Number.MAX_SAFE_INTEGER:n.options.pageCount-1;return c=Math.max(0,Math.min(c,d)),{...l,pageIndex:c}})},n.resetPageIndex=a=>{var l,c;n.setPageIndex(a?no:(l=(c=n.initialState)==null||(c=c.pagination)==null?void 0:c.pageIndex)!=null?l:no)},n.resetPageSize=a=>{var l,c;n.setPageSize(a?ro:(l=(c=n.initialState)==null||(c=c.pagination)==null?void 0:c.pageSize)!=null?l:ro)},n.setPageSize=a=>{n.setPagination(l=>{const c=Math.max(1,vn(a,l.pageSize)),d=l.pageSize*l.pageIndex,m=Math.floor(d/c);return{...l,pageIndex:m,pageSize:c}})},n.setPageCount=a=>n.setPagination(l=>{var c;let d=vn(a,(c=n.options.pageCount)!=null?c:-1);return typeof d=="number"&&(d=Math.max(-1,d)),{...l,pageCount:d}}),n.getPageOptions=Y(()=>[n.getPageCount()],a=>{let l=[];return a&&a>0&&(l=[...new Array(a)].fill(null).map((c,d)=>d)),l},Z(n.options,"debugTable")),n.getCanPreviousPage=()=>n.getState().pagination.pageIndex>0,n.getCanNextPage=()=>{const{pageIndex:a}=n.getState().pagination,l=n.getPageCount();return l===-1?!0:l===0?!1:an.setPageIndex(a=>a-1),n.nextPage=()=>n.setPageIndex(a=>a+1),n.firstPage=()=>n.setPageIndex(0),n.lastPage=()=>n.setPageIndex(n.getPageCount()-1),n.getPrePaginationRowModel=()=>n.getExpandedRowModel(),n.getPaginationRowModel=()=>(!n._getPaginationRowModel&&n.options.getPaginationRowModel&&(n._getPaginationRowModel=n.options.getPaginationRowModel(n)),n.options.manualPagination||!n._getPaginationRowModel?n.getPrePaginationRowModel():n._getPaginationRowModel()),n.getPageCount=()=>{var a;return(a=n.options.pageCount)!=null?a:Math.ceil(n.getRowCount()/n.getState().pagination.pageSize)},n.getRowCount=()=>{var a;return(a=n.options.rowCount)!=null?a:n.getPrePaginationRowModel().rows.length}}},Wa=()=>({top:[],bottom:[]}),Ab={getInitialState:n=>({rowPinning:Wa(),...n}),getDefaultOptions:n=>({onRowPinningChange:xt("rowPinning",n)}),createRow:(n,o)=>{n.pin=(r,a,l)=>{const c=a?n.getLeafRows().map(p=>{let{id:x}=p;return x}):[],d=l?n.getParentRows().map(p=>{let{id:x}=p;return x}):[],m=new Set([...d,n.id,...c]);o.setRowPinning(p=>{var x,v;if(r==="bottom"){var j,y;return{top:((j=p==null?void 0:p.top)!=null?j:[]).filter(R=>!(m!=null&&m.has(R))),bottom:[...((y=p==null?void 0:p.bottom)!=null?y:[]).filter(R=>!(m!=null&&m.has(R))),...Array.from(m)]}}if(r==="top"){var _,E;return{top:[...((_=p==null?void 0:p.top)!=null?_:[]).filter(R=>!(m!=null&&m.has(R))),...Array.from(m)],bottom:((E=p==null?void 0:p.bottom)!=null?E:[]).filter(R=>!(m!=null&&m.has(R)))}}return{top:((x=p==null?void 0:p.top)!=null?x:[]).filter(R=>!(m!=null&&m.has(R))),bottom:((v=p==null?void 0:p.bottom)!=null?v:[]).filter(R=>!(m!=null&&m.has(R)))}})},n.getCanPin=()=>{var r;const{enableRowPinning:a,enablePinning:l}=o.options;return typeof a=="function"?a(n):(r=a??l)!=null?r:!0},n.getIsPinned=()=>{const r=[n.id],{top:a,bottom:l}=o.getState().rowPinning,c=r.some(m=>a==null?void 0:a.includes(m)),d=r.some(m=>l==null?void 0:l.includes(m));return c?"top":d?"bottom":!1},n.getPinnedIndex=()=>{var r,a;const l=n.getIsPinned();if(!l)return-1;const c=(r=l==="top"?o.getTopRows():o.getBottomRows())==null?void 0:r.map(d=>{let{id:m}=d;return m});return(a=c==null?void 0:c.indexOf(n.id))!=null?a:-1}},createTable:n=>{n.setRowPinning=o=>n.options.onRowPinningChange==null?void 0:n.options.onRowPinningChange(o),n.resetRowPinning=o=>{var r,a;return n.setRowPinning(o?Wa():(r=(a=n.initialState)==null?void 0:a.rowPinning)!=null?r:Wa())},n.getIsSomeRowsPinned=o=>{var r;const a=n.getState().rowPinning;if(!o){var l,c;return!!((l=a.top)!=null&&l.length||(c=a.bottom)!=null&&c.length)}return!!((r=a[o])!=null&&r.length)},n._getPinnedRows=(o,r,a)=>{var l;return((l=n.options.keepPinnedRows)==null||l?(r??[]).map(d=>{const m=n.getRow(d,!0);return m.getIsAllParentsExpanded()?m:null}):(r??[]).map(d=>o.find(m=>m.id===d))).filter(Boolean).map(d=>({...d,position:a}))},n.getTopRows=Y(()=>[n.getRowModel().rows,n.getState().rowPinning.top],(o,r)=>n._getPinnedRows(o,r,"top"),Z(n.options,"debugRows")),n.getBottomRows=Y(()=>[n.getRowModel().rows,n.getState().rowPinning.bottom],(o,r)=>n._getPinnedRows(o,r,"bottom"),Z(n.options,"debugRows")),n.getCenterRows=Y(()=>[n.getRowModel().rows,n.getState().rowPinning.top,n.getState().rowPinning.bottom],(o,r,a)=>{const l=new Set([...r??[],...a??[]]);return o.filter(c=>!l.has(c.id))},Z(n.options,"debugRows"))}},Ib={getInitialState:n=>({rowSelection:{},...n}),getDefaultOptions:n=>({onRowSelectionChange:xt("rowSelection",n),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:n=>{n.setRowSelection=o=>n.options.onRowSelectionChange==null?void 0:n.options.onRowSelectionChange(o),n.resetRowSelection=o=>{var r;return n.setRowSelection(o?{}:(r=n.initialState.rowSelection)!=null?r:{})},n.toggleAllRowsSelected=o=>{n.setRowSelection(r=>{o=typeof o<"u"?o:!n.getIsAllRowsSelected();const a={...r},l=n.getPreGroupedRowModel().flatRows;return o?l.forEach(c=>{c.getCanSelect()&&(a[c.id]=!0)}):l.forEach(c=>{delete a[c.id]}),a})},n.toggleAllPageRowsSelected=o=>n.setRowSelection(r=>{const a=typeof o<"u"?o:!n.getIsAllPageRowsSelected(),l={...r};return n.getRowModel().rows.forEach(c=>{io(l,c.id,a,!0,n)}),l}),n.getPreSelectedRowModel=()=>n.getCoreRowModel(),n.getSelectedRowModel=Y(()=>[n.getState().rowSelection,n.getCoreRowModel()],(o,r)=>Object.keys(o).length?Qa(n,r):{rows:[],flatRows:[],rowsById:{}},Z(n.options,"debugTable")),n.getFilteredSelectedRowModel=Y(()=>[n.getState().rowSelection,n.getFilteredRowModel()],(o,r)=>Object.keys(o).length?Qa(n,r):{rows:[],flatRows:[],rowsById:{}},Z(n.options,"debugTable")),n.getGroupedSelectedRowModel=Y(()=>[n.getState().rowSelection,n.getSortedRowModel()],(o,r)=>Object.keys(o).length?Qa(n,r):{rows:[],flatRows:[],rowsById:{}},Z(n.options,"debugTable")),n.getIsAllRowsSelected=()=>{const o=n.getFilteredRowModel().flatRows,{rowSelection:r}=n.getState();let a=!!(o.length&&Object.keys(r).length);return a&&o.some(l=>l.getCanSelect()&&!r[l.id])&&(a=!1),a},n.getIsAllPageRowsSelected=()=>{const o=n.getPaginationRowModel().flatRows.filter(l=>l.getCanSelect()),{rowSelection:r}=n.getState();let a=!!o.length;return a&&o.some(l=>!r[l.id])&&(a=!1),a},n.getIsSomeRowsSelected=()=>{var o;const r=Object.keys((o=n.getState().rowSelection)!=null?o:{}).length;return r>0&&r{const o=n.getPaginationRowModel().flatRows;return n.getIsAllPageRowsSelected()?!1:o.filter(r=>r.getCanSelect()).some(r=>r.getIsSelected()||r.getIsSomeSelected())},n.getToggleAllRowsSelectedHandler=()=>o=>{n.toggleAllRowsSelected(o.target.checked)},n.getToggleAllPageRowsSelectedHandler=()=>o=>{n.toggleAllPageRowsSelected(o.target.checked)}},createRow:(n,o)=>{n.toggleSelected=(r,a)=>{const l=n.getIsSelected();o.setRowSelection(c=>{var d;if(r=typeof r<"u"?r:!l,n.getCanSelect()&&l===r)return c;const m={...c};return io(m,n.id,r,(d=a==null?void 0:a.selectChildren)!=null?d:!0,o),m})},n.getIsSelected=()=>{const{rowSelection:r}=o.getState();return Mo(n,r)},n.getIsSomeSelected=()=>{const{rowSelection:r}=o.getState();return so(n,r)==="some"},n.getIsAllSubRowsSelected=()=>{const{rowSelection:r}=o.getState();return so(n,r)==="all"},n.getCanSelect=()=>{var r;return typeof o.options.enableRowSelection=="function"?o.options.enableRowSelection(n):(r=o.options.enableRowSelection)!=null?r:!0},n.getCanSelectSubRows=()=>{var r;return typeof o.options.enableSubRowSelection=="function"?o.options.enableSubRowSelection(n):(r=o.options.enableSubRowSelection)!=null?r:!0},n.getCanMultiSelect=()=>{var r;return typeof o.options.enableMultiRowSelection=="function"?o.options.enableMultiRowSelection(n):(r=o.options.enableMultiRowSelection)!=null?r:!0},n.getToggleSelectedHandler=()=>{const r=n.getCanSelect();return a=>{var l;r&&n.toggleSelected((l=a.target)==null?void 0:l.checked)}}}},io=(n,o,r,a,l)=>{var c;const d=l.getRow(o,!0);r?(d.getCanMultiSelect()||Object.keys(n).forEach(m=>delete n[m]),d.getCanSelect()&&(n[o]=!0)):delete n[o],a&&(c=d.subRows)!=null&&c.length&&d.getCanSelectSubRows()&&d.subRows.forEach(m=>io(n,m.id,r,a,l))};function Qa(n,o){const r=n.getState().rowSelection,a=[],l={},c=function(d,m){return d.map(p=>{var x;const v=Mo(p,r);if(v&&(a.push(p),l[p.id]=p),(x=p.subRows)!=null&&x.length&&(p={...p,subRows:c(p.subRows)}),v)return p}).filter(Boolean)};return{rows:c(o.rows),flatRows:a,rowsById:l}}function Mo(n,o){var r;return(r=o[n.id])!=null?r:!1}function so(n,o,r){var a;if(!((a=n.subRows)!=null&&a.length))return!1;let l=!0,c=!1;return n.subRows.forEach(d=>{if(!(c&&!l)&&(d.getCanSelect()&&(Mo(d,o)?c=!0:l=!1),d.subRows&&d.subRows.length)){const m=so(d,o);m==="all"?c=!0:(m==="some"&&(c=!0),l=!1)}}),l?"all":c?"some":!1}const ao=/([0-9]+)/gm,Fb=(n,o,r)=>Id(jn(n.getValue(r)).toLowerCase(),jn(o.getValue(r)).toLowerCase()),Mb=(n,o,r)=>Id(jn(n.getValue(r)),jn(o.getValue(r))),Tb=(n,o,r)=>To(jn(n.getValue(r)).toLowerCase(),jn(o.getValue(r)).toLowerCase()),Ob=(n,o,r)=>To(jn(n.getValue(r)),jn(o.getValue(r))),Db=(n,o,r)=>{const a=n.getValue(r),l=o.getValue(r);return a>l?1:aTo(n.getValue(r),o.getValue(r));function To(n,o){return n===o?0:n>o?1:-1}function jn(n){return typeof n=="number"?isNaN(n)||n===1/0||n===-1/0?"":String(n):typeof n=="string"?n:""}function Id(n,o){const r=n.split(ao).filter(Boolean),a=o.split(ao).filter(Boolean);for(;r.length&&a.length;){const l=r.shift(),c=a.shift(),d=parseInt(l,10),m=parseInt(c,10),p=[d,m].sort();if(isNaN(p[0])){if(l>c)return 1;if(c>l)return-1;continue}if(isNaN(p[1]))return isNaN(d)?-1:1;if(d>m)return 1;if(m>d)return-1}return r.length-a.length}const Ur={alphanumeric:Fb,alphanumericCaseSensitive:Mb,text:Tb,textCaseSensitive:Ob,datetime:Db,basic:Lb},Pb={getInitialState:n=>({sorting:[],...n}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:n=>({onSortingChange:xt("sorting",n),isMultiSortEvent:o=>o.shiftKey}),createColumn:(n,o)=>{n.getAutoSortingFn=()=>{const r=o.getFilteredRowModel().flatRows.slice(10);let a=!1;for(const l of r){const c=l==null?void 0:l.getValue(n.id);if(Object.prototype.toString.call(c)==="[object Date]")return Ur.datetime;if(typeof c=="string"&&(a=!0,c.split(ao).length>1))return Ur.alphanumeric}return a?Ur.text:Ur.basic},n.getAutoSortDir=()=>{const r=o.getFilteredRowModel().flatRows[0];return typeof(r==null?void 0:r.getValue(n.id))=="string"?"asc":"desc"},n.getSortingFn=()=>{var r,a;if(!n)throw new Error;return ds(n.columnDef.sortingFn)?n.columnDef.sortingFn:n.columnDef.sortingFn==="auto"?n.getAutoSortingFn():(r=(a=o.options.sortingFns)==null?void 0:a[n.columnDef.sortingFn])!=null?r:Ur[n.columnDef.sortingFn]},n.toggleSorting=(r,a)=>{const l=n.getNextSortingOrder(),c=typeof r<"u"&&r!==null;o.setSorting(d=>{const m=d==null?void 0:d.find(_=>_.id===n.id),p=d==null?void 0:d.findIndex(_=>_.id===n.id);let x=[],v,j=c?r:l==="desc";if(d!=null&&d.length&&n.getCanMultiSort()&&a?m?v="toggle":v="add":d!=null&&d.length&&p!==d.length-1?v="replace":m?v="toggle":v="replace",v==="toggle"&&(c||l||(v="remove")),v==="add"){var y;x=[...d,{id:n.id,desc:j}],x.splice(0,x.length-((y=o.options.maxMultiSortColCount)!=null?y:Number.MAX_SAFE_INTEGER))}else v==="toggle"?x=d.map(_=>_.id===n.id?{..._,desc:j}:_):v==="remove"?x=d.filter(_=>_.id!==n.id):x=[{id:n.id,desc:j}];return x})},n.getFirstSortDir=()=>{var r,a;return((r=(a=n.columnDef.sortDescFirst)!=null?a:o.options.sortDescFirst)!=null?r:n.getAutoSortDir()==="desc")?"desc":"asc"},n.getNextSortingOrder=r=>{var a,l;const c=n.getFirstSortDir(),d=n.getIsSorted();return d?d!==c&&((a=o.options.enableSortingRemoval)==null||a)&&(!(r&&(l=o.options.enableMultiRemove)!=null)||l)?!1:d==="desc"?"asc":"desc":c},n.getCanSort=()=>{var r,a;return((r=n.columnDef.enableSorting)!=null?r:!0)&&((a=o.options.enableSorting)!=null?a:!0)&&!!n.accessorFn},n.getCanMultiSort=()=>{var r,a;return(r=(a=n.columnDef.enableMultiSort)!=null?a:o.options.enableMultiSort)!=null?r:!!n.accessorFn},n.getIsSorted=()=>{var r;const a=(r=o.getState().sorting)==null?void 0:r.find(l=>l.id===n.id);return a?a.desc?"desc":"asc":!1},n.getSortIndex=()=>{var r,a;return(r=(a=o.getState().sorting)==null?void 0:a.findIndex(l=>l.id===n.id))!=null?r:-1},n.clearSorting=()=>{o.setSorting(r=>r!=null&&r.length?r.filter(a=>a.id!==n.id):[])},n.getToggleSortingHandler=()=>{const r=n.getCanSort();return a=>{r&&(a.persist==null||a.persist(),n.toggleSorting==null||n.toggleSorting(void 0,n.getCanMultiSort()?o.options.isMultiSortEvent==null?void 0:o.options.isMultiSortEvent(a):!1))}}},createTable:n=>{n.setSorting=o=>n.options.onSortingChange==null?void 0:n.options.onSortingChange(o),n.resetSorting=o=>{var r,a;n.setSorting(o?[]:(r=(a=n.initialState)==null?void 0:a.sorting)!=null?r:[])},n.getPreSortedRowModel=()=>n.getGroupedRowModel(),n.getSortedRowModel=()=>(!n._getSortedRowModel&&n.options.getSortedRowModel&&(n._getSortedRowModel=n.options.getSortedRowModel(n)),n.options.manualSorting||!n._getSortedRowModel?n.getPreSortedRowModel():n._getSortedRowModel())}},qb=[ab,Cb,bb,wb,ob,lb,yb,Nb,Pb,vb,Rb,Eb,Ab,Ib,Sb];function kb(n){var o,r;const a=[...qb,...(o=n._features)!=null?o:[]];let l={_features:a};const c=l._features.reduce((y,_)=>Object.assign(y,_.getDefaultOptions==null?void 0:_.getDefaultOptions(l)),{}),d=y=>l.options.mergeOptions?l.options.mergeOptions(c,y):{...c,...y};let p={...{},...(r=n.initialState)!=null?r:{}};l._features.forEach(y=>{var _;p=(_=y.getInitialState==null?void 0:y.getInitialState(p))!=null?_:p});const x=[];let v=!1;const j={_features:a,options:{...c,...n},initialState:p,_queue:y=>{x.push(y),v||(v=!0,Promise.resolve().then(()=>{for(;x.length;)x.shift()();v=!1}).catch(_=>setTimeout(()=>{throw _})))},reset:()=>{l.setState(l.initialState)},setOptions:y=>{const _=vn(y,l.options);l.options=d(_)},getState:()=>l.options.state,setState:y=>{l.options.onStateChange==null||l.options.onStateChange(y)},_getRowId:(y,_,E)=>{var R;return(R=l.options.getRowId==null?void 0:l.options.getRowId(y,_,E))!=null?R:`${E?[E.id,_].join("."):_}`},getCoreRowModel:()=>(l._getCoreRowModel||(l._getCoreRowModel=l.options.getCoreRowModel(l)),l._getCoreRowModel()),getRowModel:()=>l.getPaginationRowModel(),getRow:(y,_)=>{let E=(_?l.getPrePaginationRowModel():l.getRowModel()).rowsById[y];if(!E&&(E=l.getCoreRowModel().rowsById[y],!E))throw new Error;return E},_getDefaultColumnDef:Y(()=>[l.options.defaultColumn],y=>{var _;return y=(_=y)!=null?_:{},{header:E=>{const R=E.header.column.columnDef;return R.accessorKey?R.accessorKey:R.accessorFn?R.id:null},cell:E=>{var R,L;return(R=(L=E.renderValue())==null||L.toString==null?void 0:L.toString())!=null?R:null},...l._features.reduce((E,R)=>Object.assign(E,R.getDefaultColumnDef==null?void 0:R.getDefaultColumnDef()),{}),...y}},Z(n,"debugColumns")),_getColumnDefs:()=>l.options.columns,getAllColumns:Y(()=>[l._getColumnDefs()],y=>{const _=function(E,R,L){return L===void 0&&(L=0),E.map(M=>{const $=sb(l,M,L,R),q=M;return $.columns=q.columns?_(q.columns,$,L+1):[],$})};return _(y)},Z(n,"debugColumns")),getAllFlatColumns:Y(()=>[l.getAllColumns()],y=>y.flatMap(_=>_.getFlatColumns()),Z(n,"debugColumns")),_getAllFlatColumnsById:Y(()=>[l.getAllFlatColumns()],y=>y.reduce((_,E)=>(_[E.id]=E,_),{}),Z(n,"debugColumns")),getAllLeafColumns:Y(()=>[l.getAllColumns(),l._getOrderColumnsFn()],(y,_)=>{let E=y.flatMap(R=>R.getLeafColumns());return _(E)},Z(n,"debugColumns")),getColumn:y=>l._getAllFlatColumnsById()[y]};Object.assign(l,j);for(let y=0;yY(()=>[n.options.data],o=>{const r={rows:[],flatRows:[],rowsById:{}},a=function(l,c,d){c===void 0&&(c=0);const m=[];for(let x=0;xn._autoResetPageIndex()))}function Md(n,o,r){return r.options.filterFromLeafRows?$b(n,o,r):Bb(n,o,r)}function $b(n,o,r){var a;const l=[],c={},d=(a=r.options.maxLeafRowFilterDepth)!=null?a:100,m=function(p,x){x===void 0&&(x=0);const v=[];for(let y=0;yY(()=>[n.getPreFilteredRowModel(),n.getState().columnFilters,n.getState().globalFilter,n.getFilteredRowModel()],(r,a,l)=>{if(!r.rows.length||!(a!=null&&a.length)&&!l)return r;const c=[...a.map(m=>m.id).filter(m=>m!==o),l?"__global__":void 0].filter(Boolean),d=m=>{for(let p=0;pY(()=>{var r;return[(r=n.getColumn(o))==null?void 0:r.getFacetedRowModel()]},r=>{if(!r)return new Map;let a=new Map;for(let c=0;cY(()=>[n.getPreFilteredRowModel(),n.getState().columnFilters,n.getState().globalFilter],(o,r,a)=>{if(!o.rows.length||!(r!=null&&r.length)&&!a){for(let y=0;y{var _;const E=n.getColumn(y.id);if(!E)return;const R=E.getFilterFn();R&&l.push({id:y.id,filterFn:R,resolvedValue:(_=R.resolveFilterValue==null?void 0:R.resolveFilterValue(y.value))!=null?_:y.value})});const d=(r??[]).map(y=>y.id),m=n.getGlobalFilterFn(),p=n.getAllLeafColumns().filter(y=>y.getCanGlobalFilter());a&&m&&p.length&&(d.push("__global__"),p.forEach(y=>{var _;c.push({id:y.id,filterFn:m,resolvedValue:(_=m.resolveFilterValue==null?void 0:m.resolveFilterValue(a))!=null?_:a})}));let x,v;for(let y=0;y{_.columnFiltersMeta[R]=L})}if(c.length){for(let E=0;E{_.columnFiltersMeta[R]=L})){_.columnFilters.__global__=!0;break}}_.columnFilters.__global__!==!0&&(_.columnFilters.__global__=!1)}}const j=y=>{for(let _=0;_n._autoResetPageIndex()))}function Hb(){return n=>Y(()=>[n.getState().sorting,n.getPreSortedRowModel()],(o,r)=>{if(!r.rows.length||!(o!=null&&o.length))return r;const a=n.getState().sorting,l=[],c=a.filter(p=>{var x;return(x=n.getColumn(p.id))==null?void 0:x.getCanSort()}),d={};c.forEach(p=>{const x=n.getColumn(p.id);x&&(d[p.id]={sortUndefined:x.columnDef.sortUndefined,invertSorting:x.columnDef.invertSorting,sortingFn:x.getSortingFn()})});const m=p=>{const x=p.map(v=>({...v}));return x.sort((v,j)=>{for(let _=0;_{var j;l.push(v),(j=v.subRows)!=null&&j.length&&(v.subRows=m(v.subRows))}),x};return{rows:m(r.rows),flatRows:l,rowsById:r.rowsById}},Z(n.options,"debugTable","getSortedRowModel",()=>n._autoResetPageIndex()))}/** * react-table * * Copyright (c) TanStack @@ -144,17 +144,17 @@ var T_=Object.defineProperty;var O_=(n,o,r)=>o in n?T_(n,o,{enumerable:!0,config * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Ji(n,o){return n?Hb(n)?L.createElement(n,o):n:null}function Hb(n){return Kb(n)||typeof n=="function"||Wb(n)}function Kb(n){return typeof n=="function"&&(()=>{const o=Object.getPrototypeOf(n);return o.prototype&&o.prototype.isReactComponent})()}function Wb(n){return typeof n=="object"&&typeof n.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(n.$$typeof.description)}function Dd(n){const o={state:{},onStateChange:()=>{},renderFallbackValue:null,...n},[r]=L.useState(()=>({current:kb(o)})),[a,l]=L.useState(()=>r.current.initialState);return r.current.setOptions(c=>({...c,...n,state:{...a,...n.state},onStateChange:d=>{l(d),n.onStateChange==null||n.onStateChange(d)}})),r.current}const Yb=({buttonText:n,title:o="",content:r,className:a=""})=>i.jsx("div",{className:`flex items-baseline justify-center mr-4 font-medium ${a}`,children:i.jsxs(fr,{children:[i.jsx(Lc,{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(z_,{className:"w-4 h-4 ml-1 text-muted-foreground"})]})}),i.jsxs(gr,{className:"sm:max-w-[425px]",children:[i.jsx(mr,{children:i.jsx(hr,{children:o})}),i.jsxs(uo,{className:"grid gap-4 py-2",children:[r,i.jsx(pr,{children:i.jsx(Qi,{asChild:!0,children:i.jsx(G,{type:"button",children:w("common.close")})})})]})]})]})});function Qb(n){let a=0;for(let v=0;v>v*8&255;l+=("00"+j.toString(16)).substr(-2)}const c=parseInt(l.substr(1,2),16),d=parseInt(l.substr(3,2),16),m=parseInt(l.substr(5,2),16),p=`#${(c*.7|0).toString(16).padStart(2,"0")}${(d*.7|0).toString(16).padStart(2,"0")}${(m*.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(m+(255-m)*.7)).toString(16).padStart(2,"0")}`;return[p,x]}const Ld=({label:n,className:o})=>{const[r,a]=Qb(n);return i.jsx(co,{className:o,style:o?{}:{backgroundColor:a,color:r},children:n})};function Td({table:n,header:o,className:r}){return o.column.getCanSort()?i.jsx("div",{className:he("flex items-center space-x-2",r),children:i.jsxs(rs,{children:[i.jsx(is,{asChild:!0,children:i.jsxs(G,{"aria-label":o.column.getIsSorted()==="desc"?w("common.sort_desc_description"):o.column.getIsSorted()==="asc"?w("common.sort_asc_description"):w("common.sort_none_description"),size:"sm",variant:"ghost",className:"-ml-3 h-8 data-[state=open]:bg-accent font-bold text-muted-foreground",children:[Ji(o.column.columnDef.header,o.getContext()),o.column.getIsSorted()==="desc"?i.jsx(_c,{className:"w-4 h-4 ml-2","aria-hidden":"true"}):o.column.getIsSorted()==="asc"?i.jsx(bc,{className:"w-4 h-4 ml-2","aria-hidden":"true"}):i.jsx(A0,{className:"w-4 h-4 ml-2 text-muted-foreground/30","aria-hidden":"true"})]})}),i.jsxs(ss,{align:"start",children:[o.column.getCanSort()&&i.jsxs(i.Fragment,{children:[i.jsxs(Ur,{onClick:()=>o.column.toggleSorting(!1),"aria-label":w("common.sort_asc"),children:[i.jsx(bc,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70","aria-hidden":"true"}),w("common.sort_asc")]}),i.jsxs(Ur,{onClick:()=>o.column.toggleSorting(!0),"aria-label":w("common.sort_desc"),children:[i.jsx(_c,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70","aria-hidden":"true"}),w("common.sort_desc")]})]}),o.column.getCanSort()&&o.column.getCanHide()&&i.jsx(fo,{}),o.column.getCanHide()&&i.jsxs(Ur,{onClick:()=>o.column.toggleVisibility(!1),"aria-label":w("common.hide"),children:[i.jsx(md,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70","aria-hidden":"true"}),w("common.hide")]})]})]})}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:he("data-[state=open]:bg-accent tracking-wide text-ellipsis",r),children:o.isPlaceholder?null:Ji(o.column.columnDef.header,o.getContext())}),!1]})}function Xb({table:n,className:o,enablePageSizeSelector:r=!0,visible:a="auto"}){const l=L.useMemo(()=>a===!0,[a]),c=L.useMemo(()=>a==="auto",[a]);return!l||c&&n.getPageCount()<1?null:i.jsxs("div",{className:o,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(ar,{value:`${n.getState().pagination.pageSize}`,onValueChange:d=>{n.setPageSize(Number(d))},children:[i.jsx(or,{className:"h-8 w-[70px]",children:i.jsx(lr,{placeholder:n.getState().pagination.pageSize})}),i.jsx(ur,{side:"top",children:V_.map(d=>i.jsx(xn,{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(B_),disabled:!n.getCanPreviousPage(),children:[i.jsx("span",{className:"sr-only",children:w("common.go_to_first_page")}),i.jsx(I0,{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(U_,{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(G_,{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(F0,{className:"w-4 h-4"})]})]})]})]})]})}function fs({table:n,title:o,description:r,caption:a,paginationOptions:l,headerOptions:c={visible:!0},children:d,className:m,contentClassName:p,footerClassName:x,rowClassName:v,cellClassName:j,onRowClick:y,activeRowIndex:_}){var R;const E=c==null?void 0:c.visible;return i.jsxs(Le,{className:m,children:[(o||r)&&i.jsxs(ct,{className:"pb-0",children:[i.jsx(Ue,{children:o}),i.jsx(We,{children:r})]}),i.jsxs(Te,{className:he("pt-6",p),children:[d&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex space-x-2",children:d}),i.jsx(_n,{className:"my-4"})]}),i.jsxs(go,{children:[typeof a<"u"&&i.jsx(H_,{children:a}),E&&n.getHeaderGroups().length&&i.jsx(mo,{children:n.getHeaderGroups().map(O=>i.jsx(bn,{className:v,children:O.headers.map(M=>i.jsx(ho,{colSpan:M.colSpan,style:{width:M.getSize()===Number.MAX_SAFE_INTEGER?"auto":M.getSize()},children:i.jsx(Td,{table:n,header:M})},M.id))},O.id))}),i.jsx(po,{children:(R=n.getRowModel().rows)!=null&&R.length?n.getRowModel().rows.map(O=>i.jsx(bn,{onClick:()=>{y&&y(O)},tabIndex:0,"data-state":O.getIsSelected()&&"selected",className:he(O.getIsSelected()||_===O.index?"bg-accent cursor-pointer hover:bg-accent":"cursor-pointer",v),children:O.getVisibleCells().map(M=>i.jsx(Kr,{className:j,style:{width:M.column.getSize()===Number.MAX_SAFE_INTEGER?"auto":M.column.getSize()},children:Ji(M.column.columnDef.cell,M.getContext())},M.id))},O.id)):i.jsx(bn,{className:v,children:i.jsx(Kr,{className:he("h-24 text-center",j),colSpan:n.getAllColumns.length,children:"No hay datos para mostrar"})})})]})]}),i.jsx(Rt,{className:x,children:i.jsx(Xb,{className:"flex-1",table:n,...l})})]})}function Zb({actions:n,rowContext:o}){return i.jsxs(rs,{children:[i.jsx(is,{asChild:!0,children:i.jsxs(G,{size:"icon",variant:"outline",className:"w-8 h-8",children:[i.jsx(T0,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"sr-only",children:w("common.open_menu")})]})}),i.jsxs(ss,{align:"end",children:[i.jsxs(Tc,{children:[w("common.actions")," "]}),n&&n(o).map((r,a)=>r.label==="-"?i.jsx(fo,{},a):i.jsxs(Ur,{onClick:l=>r.onClick?r.onClick(o,l):null,children:[r.icon&&i.jsx(i.Fragment,{children:r.icon}),r.label,r.shortcut&&i.jsx(K_,{children:r.shortcut})]},a))]})]})}function Jb(){return{id:"select",header:({table:n})=>i.jsx(Xi,{id:"select-all",checked:n.getIsAllPageRowsSelected()||n.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:o=>n.toggleAllPageRowsSelected(!!o),"aria-label":w("common.select_all"),className:"translate-y-[2px]"}),cell:({row:n})=>i.jsx(Xi,{id:`select-row-${n.id}`,checked:n.getIsSelected(),onCheckedChange:o=>{n.toggleSelected(!!o)},"aria-label":w("common.select_row"),className:"translate-y-[2px]"}),enableSorting:!1,enableHiding:!1}}function gs({columnCount:n,rowCount:o=10,searchableColumnCount:r=0,filterableColumnCount:a=0,showViewOptions:l=!0,cellWidths:c=["auto"],withPagination:d=!0,shrinkZero:m=!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,j)=>i.jsx(ut,{className:"w-40 h-7 lg:w-60"},j)):null,a>0?Array.from({length:a}).map((v,j)=>i.jsx(ut,{className:"h-7 w-[4.5rem] border-dashed"},j)):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(go,{children:[i.jsx(mo,{children:Array.from({length:1}).map((v,j)=>i.jsx(bn,{className:"hover:bg-transparent",children:Array.from({length:n}).map((y,_)=>i.jsx(ho,{style:{width:c[_],minWidth:m?c[_]:"auto"},children:i.jsx(ut,{className:"w-full h-6"})},_))},j))}),i.jsx(po,{children:Array.from({length:o}).map((v,j)=>i.jsx(bn,{className:"hover:bg-transparent",children:Array.from({length:n}).map((y,_)=>i.jsx(Kr,{style:{width:c[_],minWidth:m?c[_]:"auto"},children:i.jsx(ut,{className:"w-full h-6"})},_))},j))})]})}),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 ms=({title:n=w("components.empty_state.title"),subtitle:o=w("components.empty_state.subtitle"),buttonText:r=w("components.empty_state.button"),onButtonClick:a=()=>{},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:o}),i.jsxs("div",{className:"items-center mt-6",children:[l&&i.jsx(i.Fragment,{children:l}),!l&&i.jsxs(G,{className:"my-4",onClick:a,children:[i.jsx(Eo,{}),r]})]})]}),ew=wo("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"}}),es=n=>{const{name:o,label:r,hint:a,description:l,placeholder:c,className:d,disabled:m,defaultValue:p,rules:x,readOnly:v,scale:j,variant:y}=n,{control:_}=xr(),[E,R]=L.useState(""),O={input:M=>{if(typeof M!="object")return M;const $=Vt.create(M);if($.isFailure)throw $.error;const q=$.object.toString();return E.endsWith(",")?q.replace(/.0$/,","):q},output:(M,$,q)=>{const{value:U}=q??{value:null};R(U??"");const T=Vt.createFromFormattedValue(U);if(T.isFailure)throw T.error;return T.object.toObject()}};return i.jsx(xo,{defaultValue:p,control:_,name:o,disabled:m,rules:{max:100,min:0,...x},render:({field:M})=>{const $=O.input(M.value),q=m||M.disabled,U=!!((x==null?void 0:x.required)??!1);return i.jsxs(vo,{className:he(d,"space-y-3"),children:[r&&i.jsx(_o,{label:r,hint:a,required:U}),i.jsx(bo,{children:i.jsx(Oc,{name:M.name,ref:M.ref,onBlur:M.onBlur,disabled:q,readOnly:v,className:he(ew({variant:y,className:d})),groupSeparator:".",decimalSeparator:",",placeholder:c,allowDecimals:j!==0,decimalsLimit:j,decimalScale:j,step:1,value:$,onValueChange:(T,k,W)=>M.onChange(O.output(T,k,W))})}),l&&i.jsx(So,{children:l}),i.jsx(jo,{})]})}})},tw=wo("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"}}),nw=n=>{const{name:o,label:r,hint:a,description:l,placeholder:c,className:d,disabled:m,defaultValue:p,rules:x,readOnly:v,scale:j,variant:y}=n,{control:_}=xr(),[E,R]=L.useState(""),O={input:M=>{if(typeof M!="object")return M;const $=Sn.create(M);if($.isFailure)throw $.error;const q=$.object.toString();return E.endsWith(",")?q.replace(/.0$/,","):q},output:(M,$,q)=>{const{value:U}=q??{value:null};R(U??"");const T=Sn.createFromFormattedValue(U);if(T.isFailure)throw T.error;return T.object.toObject()}};return i.jsx(xo,{defaultValue:p,control:_,name:o,disabled:m,rules:x,render:({field:M})=>{const $=O.input(M.value),q=m||M.disabled,U=!!((x==null?void 0:x.required)??!1);return i.jsxs(vo,{className:he(d,"space-y-3"),children:[r&&i.jsx(_o,{label:r,hint:a,required:U}),i.jsx(bo,{children:i.jsx(Oc,{name:M.name,ref:M.ref,onBlur:M.onBlur,disabled:q,readOnly:v,className:he(tw({variant:y,className:d})),groupSeparator:".",decimalSeparator:",",placeholder:c,allowDecimals:j!==0,decimalsLimit:j,decimalScale:j,step:1,value:$,onValueChange:(T,k,W)=>M.onChange(O.output(T,k,W))})}),l&&i.jsx(So,{children:l}),i.jsx(jo,{})]})}})},rw=wo("",{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"}}),On=n=>{const{name:o,label:r,hint:a,description:l,placeholder:c,className:d,disabled:m,rules:p,required:x,type:v,variant:j}=n,{control:y}=xr();return i.jsx(xo,{control:y,name:o,disabled:m,rules:{required:x,...p},render:({field:_,fieldState:E})=>{const R=!!((p==null?void 0:p.required)??x);return i.jsxs(vo,{className:he(d,"space-y-3"),children:[r&&i.jsx(_o,{label:r,hint:a,required:R}),i.jsx(bo,{className:"block",children:i.jsx(as,{type:v,placeholder:c,className:he(E.error?"border-destructive focus-visible:ring-destructive":"",rw({variant:j,className:d})),..._})}),l&&i.jsx(So,{children:l}),i.jsx(jo,{})]})}})};function iw(n=!1){const[o,r]=L.useState(n);return[o,()=>r(l=>!l)]}const kn=()=>{const n=L.useContext(W_);if(n===null)throw new Error("useDataTableContext must be used within a DataTableProvider");return n};function hs({data:n,columns:o,pageCount:r,enableSorting:a=!1,enableHiding:l=!1,enableRowSelection:c=!1,initialState:d,onPaginationChange:m,meta:p}){const{pagination:x,setPagination:v,sorting:j}=kn(),[y,_]=Tn.useState({}),[E,R]=Tn.useState((d==null?void 0:d.columnVisibility)||{}),O=U=>{if(typeof U=="function"){const T=U(x);v(T)}m&&m(U)},M=U=>{},$=L.useCallback(()=>{const U=o;return c&&U.unshift(Jb()),U},[o,c]);return{table:Dd({data:n,columns:$(),pageCount:r??-1,meta:p,getCoreRowModel:Fd(),initialState:d,state:{pagination:x,sorting:j,columnVisibility:E,rowSelection:y},enableRowSelection:c,onRowSelectionChange:_,manualSorting:!0,enableSorting:a,getSortedRowModel:Gb(),onSortingChange:M,enableHiding:l,onColumnVisibilityChange:R,manualPagination:!0,onPaginationChange:O,manualFiltering:!0,getFilteredRowModel:Ub(),getFacetedRowModel:Vb(),getFacetedUniqueValues:Bb(),debugTable:!1,debugHeaders:!1,debugColumns:!1,defaultColumn:{minSize:0,size:Number.MAX_SAFE_INTEGER,maxSize:Number.MAX_SAFE_INTEGER}})}}const sw=({setSize:n,setControllerCallback:o,setPercentageCallback:r,setErrorCallback:a})=>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"),m=l.headers.get(d?"x-file-size":"content-length"),p=parseInt(m||"0",10);n(()=>p);let x=0;const v=new ReadableStream({start(j){o(j);const y=c.getReader();async function _(){return y.read().then(({done:E,value:R})=>E?j.close():(x+=(R==null?void 0:R.byteLength)||0,R&&j.enqueue(R),r({loaded:x,total:p}),_())).catch(E=>(a(E),y.cancel("Cancelled"),j.error(E)))}return _()}});return new Response(v)},Nc=(n,o,r)=>{const a=[n],l=new Blob(a,{type:r||"application/octet-stream"});if(typeof window.navigator.msSaveBlob<"u")return window.navigator.msSaveBlob(l,o);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",o),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 Rc({customHandleDownload:n,...o}={}){var U;let r=!1;try{r=process?!!((U=process==null?void 0:process.env)!=null&&U.REACT_APP_DEBUG_MODE):!1}catch{r=!1}const[a,l]=L.useState(0),[c,d]=L.useState(0),[m,p]=L.useState(0),[x,v]=L.useState(null),[j,y]=L.useState(!1),_=L.useRef(null),E=L.useCallback(({loaded:T,total:k})=>{const W=Math.round(T/k*100);d(()=>W)},[]),R=L.useCallback(T=>{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[T.message]?k[T.message]:T.message}))},[]),O=L.useCallback(T=>{_.current=T},[]),M=L.useCallback(()=>{_.current&&_.current.error()},[]),$=L.useCallback(()=>{O(null),l(()=>0),d(()=>0),p(()=>0),y(()=>!1)},[O]),q=L.useCallback(async(T,k,W=0,te={})=>{if(j)return null;$(),v(()=>null),y(()=>!0);const V=setInterval(()=>l(ke=>ke+1),r?1:1e3),ge=sw({setSize:p,setControllerCallback:O,setPercentageCallback:E,setErrorCallback:R}),_e=new AbortController,K=setTimeout(()=>{W>0&&_e.abort()},W),Ee=n||Nc;try{const ke=await fetch(T,{method:"GET",...o,...te,signal:_e.signal}),tt=await ge(ke).blob();Ee(tt,k),$()}catch(ke){$(),v(Z=>{const{message:tt}=ke;return tt!=="Failed to fetch"?{errorMessage:tt}:Z}),clearTimeout(K)}finally{clearInterval(V)}},[j,$,r,O,E,R,o,n]);return L.useMemo(()=>({elapsed:a,percentage:c,size:m,download:q,cancel:M,error:x,isInProgress:j,jsDownload:Nc}),[a,c,m,q,M,x,j])}const aw=()=>{const{i18n:n}=Pt();return Od({locale:n.language})},Od=n=>{const{locale:o}=n,r=L.useCallback(c=>{if(c==null)return"";const{amount:d,scale:m,currency_code:p}=c;return new Intl.NumberFormat(o??"ES",{style:"currency",currency:p,currencyDisplay:"symbol",useGrouping:!0,maximumFractionDigits:m}).format(d===null?0:hc({amount:d,scale:m}))},[o]),a=L.useCallback(c=>{if(c==null)return"";const{amount:d,scale:m}=c;return new Intl.NumberFormat("es",{minimumFractionDigits:m,useGrouping:!0}).format(d===null?0:hc({amount:d,scale:m}))},[o]),l=L.useCallback(c=>{if(c==null)return"";const{amount:d,scale:m}=c;return new Intl.NumberFormat(o,{style:"decimal",minimumFractionDigits:m}).format(d===null?0:d)},[o]);return{formatCurrency:r,formatNumber:a,formatPercentage:l}};function Pd(n){const[o,r]=L.useState(!1);return L.useEffect(()=>{function a(c){r(c.matches)}const l=matchMedia(n);return l.addEventListener("change",a),r(l.matches),()=>l.removeEventListener("change",a)},[n]),o}const ow=()=>{const n=L.useContext(Y_);if(n===null)throw new Error("useWarnAboutChange must be used within a UnsavedWarnProvider");return n},Lo=({isDirty:n=!1,title:o=w("hooks.use_unsaved_changes_notifier.title"),subtitle:r=w("hooks.use_unsaved_changes_notifier.subtitle"),confirmText:a=w("hooks.use_unsaved_changes_notifier.confirm_text"),cancelText:l=w("hooks.use_unsaved_changes_notifier.cancel_text"),onConfirm:c,onCancel:d,type:m="warning"})=>{const p=Q_(n),{show:x}=ow(),v=L.useCallback(()=>n?new Promise(j=>{x({title:o,subtitle:r,confirmText:a,cancelText:l,type:m,onConfirm:()=>{j(!0),c==null||c()},onCancel:()=>{j(!1),d==null||d()}})}):Promise.resolve(!0),[l,a,n,d,c,x,r,o,m]);return L.useEffect(()=>{p.state==="blocked"&&v().then(j=>{j?p.proceed():p.reset()})},[p,v]),L.useEffect(()=>(n&&(window.onbeforeunload=()=>r),()=>{window.onbeforeunload=null}),[n,r]),{confirm:v}},qd=n=>{const{isSubmitting:o,isLoading:r,isValidating:a}=X_();return i.jsx(Co,{disabled:o||r||a,...n})};qd.displayName="FormSubmitButton";const rn=[{code:"es",name:"Español",flagClassName:"fi fi-es"},{code:"en",name:"English",flagClassName:"fi fi-gb"},{code:"fr",name:"Français",flagClassName:"fi fi-fr"}],kd={"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}}"},Ww=()=>{var j,y,_,E;const{t:n,i18n:o}=Pt(),[r,a]=L.useState(o.language),l=Bt(),{toast:c}=Cn();L.useEffect(()=>{const R=navigator.language.split("-")[0],O=rn.find(M=>M.code===R);O&&d(O.code)},[]);const d=R=>{o.changeLanguage(R),a(R)},{mutate:m,status:p}=E0({onSuccess:R=>{const{success:O,error:M}=R;!O&&M&&x.setError("root",M),O&&l("/quotes",{replace:!0})},onError:R=>{const{message:O}=R;c({description:O,title:n("common.error")}),console.log(R)}}),x=os({mode:"onBlur",defaultValues:{email:"",password:""},resolver:Pc(pn.object({email:pn.string().email({tlds:{allow:!1}}).required(),password:pn.string().min(4).alphanum().required()}),{messages:kd})}),v=async R=>{m({email:R.email,password:R.password},{})};return i.jsxs(Z_,{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(rs,{children:[i.jsx(is,{asChild:!0,children:i.jsxs(G,{variant:"outline",className:"w-[140px] justify-start",children:[i.jsx("span",{className:"mr-2",children:i.jsx("span",{"aria-hidden":"true",className:(j=rn.find(R=>R.code===r))==null?void 0:j.flagClassName})}),(y=rn.find(R=>R.code===r))==null?void 0:y.name,i.jsx(qc,{className:"w-4 h-4 ml-auto opacity-50"})]})}),i.jsx(ss,{className:"w-[140px]",children:rn.map(R=>i.jsxs(Ur,{onSelect:()=>d(R.code),children:[i.jsx("span",{"aria-hidden":"true",className:`mr-2 ${R.flagClassName}`}),R.name]},R.code))})]})}),i.jsxs(Le,{className:"px-12 py-6 bg-muted/50",children:[i.jsxs(ct,{children:[i.jsx(J_,{className:"inline-block m-auto mb-6 align-middle max-w-32"}),i.jsx(Ue,{children:i.jsx(se,{i18nKey:"login_page.title"})}),i.jsx(We,{children:i.jsx(se,{i18nKey:"login_page.description"})})]}),i.jsx(Te,{children:i.jsx(ls,{...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(On,{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(On,{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(se,{i18nKey:"login_page.forgotten_password"}),i.jsx("br",{}),i.jsx(pc,{to:"https://uecko.com/distribuidores",className:"underline",children:i.jsx(se,{i18nKey:"login_page.contact_us"})})]})]}),((_=x.formState.errors.root)==null?void 0:_.message)&&i.jsxs(kc,{variant:"destructive",children:[i.jsx(fd,{className:"w-4 h-4"}),i.jsx($c,{children:i.jsx(se,{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(se,{i18nKey:"login_page.become_dealer"}),i.jsx("br",{}),i.jsx(pc,{to:"https://uecko.com/distribuidores",className:"underline",children:i.jsx(se,{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.9"]})]})]})})})})]}),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"})})]})},lw=n=>{const{onSuccess:o,onError:r,...a}=n||{},l=tn(),c=Pn(),{logout:d}=Fc(),m=Bt(),{toast:p}=Cn();return nn({mutationKey:c().auth().action("logout").get(),mutationFn:d,onSuccess:async(x,v,j)=>{l.clear();const{success:y,redirectTo:_}=x;y&&_&&m(_||"/"),o&&o(x,v,j)},onError:(x,v,j)=>{const{message:y}=x;p({title:w("common.error"),description:y,variant:"destructive"}),r&&r(x,v,j)},...a})},Yw=()=>{const{mutate:n}=lw({});return L.useEffect(()=>n(),[n]),i.jsx(qn,{})},uw=L.createContext(null),cw=({children:n})=>{const[o,r]=Vc();return i.jsx(uw.Provider,{value:{pagination:o,setPagination:r},children:n})},Qw=({children:n})=>i.jsx(us,{children:i.jsx(cw,{children:i.jsxs(Yr,{className:"catalog-layout",children:[i.jsx(Qr,{}),i.jsx(Xr,{children:n})]})})}),$d=n=>{const o=Wr(),r=Pn(),{pagination:a,searchTerm:l=[],enabled:c=!0,queryOptions:d}=n;return Ao({queryKey:r().data().resource("catalog").action("list").params(n).get(),queryFn:()=>o.getList({resource:"catalog",quickSearchTerm:l,pagination:a}),enabled:c,queryOptions:d})};function zd({table:n,className:o,children:r,...a}){const{globalFilter:l,isFiltered:c,setGlobalFilter:d,resetGlobalFilter:m}=kn(),p=Tn.useRef(null),[x,v]=Tn.useState(""),j=Tn.useCallback(E=>{E.key==="Enter"&&x.trim()&&(E.preventDefault(),d(R=>[...R,x.trim()]),v("")),E.key==="Backspace"&&!x&&l.length>0&&(E.preventDefault(),d(R=>R.slice(0,-1)))},[l,x]),y=Tn.useCallback(E=>{d(R=>R.filter(O=>O!==E))},[]),_=Tn.useCallback(()=>{var E;x.trim()&&(d(R=>[...R,x.trim()]),v(""),(E=p.current)==null||E.focus())},[x]);return i.jsx(e0,{children:i.jsxs("div",{className:"w-full space-y-2",...a,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(Bc,{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(co,{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(Ye,{children:[i.jsx(Qe,{asChild:!0,children:i.jsx(Xa,{className:"w-4 h-4"})}),i.jsx(Xe,{children:i.jsx("p",{children:w("common.filter.badget_remove_tooltip")})})]}),i.jsx("span",{className:"sr-only",children:w("common.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:j,placeholder:w("common.filter.input_placeholder"),className:"flex-1 w-full h-8 bg-transparent outline-none placeholder:text-muted-foreground"}),i.jsxs(cr,{children:[c&&i.jsxs(Ye,{children:[i.jsx(Qe,{asChild:!0,children:i.jsxs(G,{variant:"ghost",onClick:()=>m(),className:"h-8 px-2 transition-all lg:px-3 text-primary",children:[i.jsx(Xa,{className:"w-4 h-4 mr-2"}),w("common.filter.reset_filter")]})}),i.jsx(Xe,{children:i.jsx("p",{children:w("common.filter.reset_filter")})})]}),i.jsxs(Ye,{children:[i.jsx(Qe,{asChild:!0,children:i.jsxs(G,{variant:"default",size:"icon",disabled:!x,onClick:_,className:"w-8 h-8 p-0 transition-all",children:[i.jsx(Eo,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:w("common.filter.button_add_term")})]})}),i.jsx(Xe,{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 dw=()=>{const n=Bt(),{pagination:o,globalFilter:r,isFiltered:a}=kn(),{data:l,isPending:c,isError:d,error:m}=$d({pagination:{pageIndex:o.pageIndex,pageSize:o.pageSize},searchTerm:r}),p=L.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 j=Tt.create(v.original.retail_price).object;return i.jsx("div",{className:"text-right",children:j.toFormat()})}}],[]),{table:x}=hs({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(vr,{subtitle:m.message}):c?i.jsx(Le,{children:i.jsx(Te,{children:i.jsx(gs,{columnCount:6,searchableColumnCount:1,filterableColumnCount:2,shrinkZero:!0})})}):(l==null?void 0:l.total_items)===0&&!a?i.jsx(ms,{subtitle:w("catalog.list.empty_state.subtitle"),buttonText:"",onButtonClick:()=>n("/catalog/add")}):i.jsx(fs,{table:x,paginationOptions:{visible:!0},children:i.jsx(zd,{table:x})})},Xw=()=>i.jsxs(dr,{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(se,{i18nKey:"catalog.list.title"})})})}),i.jsx(dw,{})]}),Zw=()=>{const{data:n,status:o}=t0();return i.jsxs(Yr,{children:[i.jsx(Qr,{}),i.jsx(Xr,{children:o==="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"})})]})},Jw=({children:n})=>i.jsx(us,{children:i.jsxs(Yr,{className:"dealers-layout",children:[i.jsx(Qr,{}),i.jsx(Xr,{children:n})]})});function fw({table:n}){return i.jsxs(rs,{children:[i.jsx(is,{asChild:!0,children:i.jsxs(G,{variant:"outline",size:"sm",className:"hidden h-8 ml-auto lg:flex",children:[i.jsx(z0,{className:"w-4 h-4 mr-2"}),w("components.data_table.columns")]})}),i.jsxs(ss,{align:"end",className:"w-[150px]",children:[i.jsx(Tc,{children:w("components.data_table.columns")}),i.jsx(fo,{}),n.getAllColumns().filter(o=>typeof o.accessorFn<"u"&&o.getCanHide()).map(o=>i.jsx(n0,{className:"capitalize",checked:o.getIsVisible(),onCheckedChange:r=>o.toggleVisibility(!!r),children:i.jsx(i.Fragment,{children:o.columnDef.header})},o.id))]})]})}function Vd({table:n,className:o,children:r,...a}){const{globalFilter:l,isFiltered:c,setGlobalFilter:d,resetGlobalFilter:m}=kn(),p=x=>{const v=String(x.target.value);v===""?m():d([v])};return i.jsxs("div",{className:he("flex w-full items-center justify-between space-x-2 overflow-auto p-1",o),...a,children:[i.jsxs("div",{className:"flex items-center flex-1 space-x-2",children:[i.jsx(Bc,{className:"w-4 h-4 text-gray-500"}),i.jsx(as,{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:()=>m(),className:"h-8 px-2 transition-all lg:px-3",children:[i.jsx(Xa,{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(fw,{table:n})]})]})}const gw=n=>{const o=Wr(),r=Pn(),{pagination:a,searchTerm:l=void 0,enabled:c=!0,queryOptions:d}=n;return Ao({queryKey:r().data().resource("dealer").action("list").params(n).get(),queryFn:()=>o.getList({resource:"dealers",quickSearchTerm:l,pagination:a}),enabled:c,queryOptions:d})},mw=()=>{const n=Bt(),{pagination:o,globalFilter:r,isFiltered:a}=kn(),{data:l,isPending:c,isError:d,error:m}=gw({pagination:{pageIndex:o.pageIndex,pageSize:o.pageSize},searchTerm:r}),p=L.useMemo(()=>[{id:"id",accessorKey:"id",enableResizing:!1,size:10},{id:"name",accessorKey:"name",enableResizing:!1,size:10}],[]),{table:x}=hs({data:(l==null?void 0:l.items)??[],columns:p,pageCount:(l==null?void 0:l.total_pages)??-1});return d?i.jsx(vr,{subtitle:m.message}):c?i.jsx(Le,{children:i.jsx(Te,{children:i.jsx(gs,{columnCount:6,searchableColumnCount:1,filterableColumnCount:2,shrinkZero:!0})})}):(l==null?void 0:l.total_items)===0&&!a?i.jsx(ms,{subtitle:w("catalog.list.empty_state.subtitle"),buttonText:"",onButtonClick:()=>n("/catalog/add")}):i.jsx(i.Fragment,{children:i.jsx(fs,{table:x,paginationOptions:{visible:!0},children:i.jsx(Vd,{table:x})})})},eS=()=>i.jsx(dr,{children:i.jsx(mw,{})}),tS=()=>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"})})]})}),Bd=L.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 hw(n){return n.isSorting||n.wasDragging?i0(n):!0}function pw({id:n,children:o,isActive:r=!1,onActivate:a}){const{attributes:l,isDragging:c,listeners:d,setNodeRef:m,setActivatorNodeRef:p,transform:x,transition:v}=r0({animateLayoutChanges:hw,id:n}),j={transform:Za.Translate.toString(x),transition:v},y=L.useMemo(()=>({attributes:l,listeners:d,ref:p,isDragging:c}),[l,c,d,p]);return i.jsx(Bd.Provider,{value:y,children:i.jsx(bn,{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:m,style:j,onClick:a,onFocusCapture:a,children:o},n)})}const xw=({className:n})=>{const{attributes:o,isDragging:r,listeners:a,ref:l}=L.useContext(Bd);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),...o,...a,children:[i.jsx(hd,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:w("common.move_row")})]})};function vw(n,o={}){const{t:r,i18n:a}=Pt(),{enableDragHandleColumn:l=!1,enableSelectionColumn:c=!1,enableActionsColumn:d=!1,rowActionFn:m=void 0}=o;return L.useMemo(()=>(l&&n.unshift({id:"row_drag_handle",header:()=>null,cell:()=>i.jsx(xw,{}),enableSorting:!1,enableHiding:!1,size:40}),c&&n.unshift({id:"select",header:({table:p})=>i.jsx(Xi,{id:"select-all",checked:p.getIsAllPageRowsSelected()||p.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:x=>p.toggleAllPageRowsSelected(!!x),"aria-label":r("common.select_all"),className:"translate-y-[0px]"}),cell:({row:p})=>i.jsx(Xi,{id:`select-row-${p.id}`,checked:p.getIsSelected(),disabled:!p.getCanSelect(),onCheckedChange:p.getToggleSelectedHandler(),"aria-label":r("common.select_row"),className:"mt-2"}),enableSorting:!1,enableHiding:!1,size:40}),d&&n.push({id:"row_actions",cell:p=>i.jsx(Zb,{rowContext:p,actions:m}),enableSorting:!1,enableHiding:!1,size:48}),n),[d,l,c,r,a.resolvedLanguage])}var Ud={exports:{}};(function(n,o){(function(r,a,l){n.exports=l(),n.exports.default=l()})("slugify",nr,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"}`),a=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 m=a[d.locale]||{},p=d.replacement===void 0?"-":d.replacement,x=d.trim===void 0?!0:d.trim,v=c.normalize().split("").reduce(function(j,y){var _=m[y];return _===void 0&&(_=r[y]),_===void 0&&(_=y),_===p&&(_=" "),j+_.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})})(Ud);var _w=Ud.exports;const bw=s0(_w),Zr=()=>{const n=Wr(),o=Pn(),{i18n:r}=Pt(),a=L.useCallback(d=>`${n.getApiUrl()}/quotes/${d}/report`,[n]),l=L.useCallback(d=>`quote-${bw(d.reference,{lower:!0,strict:!0,locale:"en",trim:!0})}.pdf`,[]),c={useList:d=>{const m=Wr(),p=Pn(),{pagination:x,status:v="draft",quickSearchTerm:j=void 0,enabled:y=!0,queryOptions:_}=d;return Ao({queryKey:p().data().resource("quotes").action("list").params(d).get(),queryFn:()=>m.getList({resource:"quotes",quickSearchTerm:j,filters:v!=="all"?[{field:"status",operator:"eq",value:v}]:[{field:"status",operator:"ne",value:"archived"}],pagination:x}),enabled:y,queryOptions:_})},useCreate:()=>{const d=tn();return eb({mutationFn:m=>{const{date:p}=m,x=mn.generateNewID().object.toString();return n.createOne({resource:"quotes",data:{...m,date:new Date(p).toISOString().slice(0,10),status:"draft",id:x}})},onSuccess:()=>{d.invalidateQueries({queryKey:["data","default","quotes"]})}})},useUpdate:d=>{const m=tn();return nn({mutationKey:o().data().resource("quotes").action("one").id(d).params().get(),mutationFn:p=>n.updateOne({resource:"quotes",id:d,data:p}),onSuccess:()=>{m.invalidateQueries({queryKey:["data","default","quotes"]})}})},useSetStatus:()=>{const d=tn();return nn({mutationFn:m=>{const{id:p,newStatus:x}=m;return n.custom({url:`${n.getApiUrl()}/quotes/${p}/setStatus`,method:"put",data:{newStatus:x}})},onSuccess:()=>{d.invalidateQueries({queryKey:["data","default","quotes"]})}})},useDuplicate:()=>{const d=tn();return nn({mutationFn:m=>{const{id:p}=m;return n.custom({url:`${n.getApiUrl()}/quotes/${p}/duplicate`,method:"post"})},onSuccess:()=>{d.invalidateQueries({queryKey:["data","default","quotes"]})}})},useSentTo:d=>{const m=tn();return nn({mutationKey:o().data().resource("quotes").action("one").id(d).params().get(),mutationFn:p=>{const{sent_date:x}=p;return n.custom({url:`${n.getApiUrl()}/quotes/${d}/send`,method:"put",data:{sent_date:x}})},onSuccess:()=>{m.invalidateQueries({queryKey:["data","default","quotes"]})}})},useOne:(d,m)=>wd({queryKey:o().data().resource("quotes").action("one").id(d).params({language:r.language}).get(),queryFn:()=>n.getOne({resource:"quotes",id:String(d)}),enabled:!!d,...m}),getQuotePDFDownloadURL:a,getQuotePDFFilename:l,useReport:()=>{const d=n.getApiAuthorization(),[m,p]=L.useState(void 0),{download:x,...v}=Rc({headers:{Authorization:d},customHandleDownload:L.useCallback(y=>{const _=[y],E=new Blob(_,{type:"application/octet-stream"});return p(E),!0},[p])}),j=L.useCallback(y=>x(c.getQuotePDFDownloadURL(y),""),[x]);return{...v,preview:j,report:m}},useDownloader:()=>{const d=n.getApiAuthorization(),m=Rc({headers:{Authorization:d}});return{...m,download:(x,v)=>{const j=c.getQuotePDFDownloadURL(x);return m.download(j,v)}}}};return c},nS=()=>{const n=Bt(),{i18n:o}=Pt(),{toast:r}=Cn(),{useCreate:a}=Zr(),{mutateAsync:l,isPending:c}=a(),[d,m]=L.useState(),p=o.resolvedLanguage??o.language,x=rn.some(({code:$})=>$===p)?p:"es",v=L.useMemo(()=>({date:new Date(Date.now()).toUTCString(),lang_code:x,customer_reference:"",customer_information:""}),[x]),j=os({mode:"onBlur",defaultValues:v,resolver:Pc(pn.object({customer_reference:pn.string(),date:pn.date().required(),customer_information:pn.string().required(),lang_code:pn.string().valid(...rn.map(({code:$})=>$)).required()}),{messages:{es:kd}})}),{formState:y,reset:_,handleSubmit:E}=j,{isSubmitting:R,isDirty:O}=y;Lo({isDirty:O}),L.useEffect(()=>{d&&n(`/quotes/edit/${d}`,{relative:"path"})},[d,n]);const M=async $=>{try{const q=await l($);_($),r({title:w("quotes.notifications.created"),variant:"default"}),m(q.id)}catch(q){console.debug(q),r({title:w("common.error"),description:q.message,variant:"destructive"})}};return R?i.jsx(qn,{title:w("quotes.notifications.saving")}):c?i.jsx(qn,{}):i.jsx(ls,{...j,children:i.jsx("form",{onSubmit:E(M),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(Ja,{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,{type:"button",size:"sm",variant:"outline",onClick:()=>n("/quotes"),children:w("common.discard")}),i.jsx(Co,{size:"sm",label:w("common.continue")})]}),children:[i.jsx(On,{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.jsxs("div",{className:"grid gap-2",children:[i.jsx(wn,{htmlFor:"lang_code",className:"font-semibold",children:w("quotes.form_fields.lang_code.label")}),i.jsx(Zi,{control:j.control,name:"lang_code",render:({field:$})=>i.jsxs(ar,{value:$.value||"es",onValueChange:$.onChange,children:[i.jsx(or,{id:"lang_code","aria-label":w("quotes.form_fields.lang_code.label"),children:i.jsx(lr,{})}),i.jsx(ur,{children:rn.map(q=>i.jsxs(xn,{value:q.code,children:[i.jsx("span",{"aria-hidden":"true",className:`mr-2 ${q.flagClassName}`}),q.name]},q.code))})]})}),i.jsx("p",{className:"text-sm text-muted-foreground",children:w("quotes.form_fields.lang_code.desc")})]}),i.jsx(_n,{}),i.jsx(zt,{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")})]})})]})})})},Qa=(n,o=!1)=>{const{discount:r,tax:a,subtotal_price:l}=n||{},c=Vt.create(r||{amount:null,scale:2});if(c.isFailure)throw c.error;const d=c.object,m=Vt.create(a||{amount:null,scale:2});if(m.isFailure)throw m.error;const p=m.object,x=Tt.create(l||{amount:null,scale:2});if(x.isFailure)throw x.error;const v=o?ww(n.items).convertScale(2):x.object,j=v.percentage(d.toNumber()).convertScale(2),y=v.subtract(j).convertScale(2),_=y.percentage(p.toNumber()).convertScale(2),E=y.add(_).convertScale(2);return{subtotal_price:v,discount:n.discount,discount_price:j,before_tax_price:y,tax:p,tax_price:_,total_price:E}},ww=n=>{let o=Tt.create({amount:0,scale:2}).object;return n&&n.map(r=>{const a=oo(r);o=o.add(a.total_price)}),o},oo=n=>{const{quantity:o,unit_price:r,discount:a}=n||{};if((!o||o&&o.amount===null)&&(!r||r&&r.amount===null)&&(!a||a&&a.amount===null))return{quantity:Sn.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:Vt.create({amount:null,scale:2}).object,total_price:Tt.create({amount:null,scale:2}).object};const l=Sn.create(o);if(l.isFailure)throw l.error;const c=l.object,d=Tt.create(r);if(d.isFailure)throw d.error;const m=d.object,p=Vt.create(a);if(p.isFailure)throw p.error;const x=p.object,v=m.multiply(c.toNumber()),j=v.subtract(v.percentage(x.toNumber()));return{quantity:c,unit_price:m,subtotal_price:v,discount:x,total_price:j}},Sw=()=>{const{id:n}=a0();return n};var ts={exports:{}};/** + */function Ji(n,o){return n?Gb(n)?O.createElement(n,o):n:null}function Gb(n){return Kb(n)||typeof n=="function"||Wb(n)}function Kb(n){return typeof n=="function"&&(()=>{const o=Object.getPrototypeOf(n);return o.prototype&&o.prototype.isReactComponent})()}function Wb(n){return typeof n=="object"&&typeof n.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(n.$$typeof.description)}function Td(n){const o={state:{},onStateChange:()=>{},renderFallbackValue:null,...n},[r]=O.useState(()=>({current:kb(o)})),[a,l]=O.useState(()=>r.current.initialState);return r.current.setOptions(c=>({...c,...n,state:{...a,...n.state},onStateChange:d=>{l(d),n.onStateChange==null||n.onStateChange(d)}})),r.current}const Qb=({buttonText:n,title:o="",content:r,className:a=""})=>i.jsx("div",{className:`flex items-baseline justify-center mr-4 font-medium ${a}`,children:i.jsxs(fr,{children:[i.jsx(Oc,{asChild:!0,children:i.jsxs(H,{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(B_,{className:"w-4 h-4 ml-1 text-muted-foreground"})]})}),i.jsxs(gr,{className:"sm:max-w-[425px]",children:[i.jsx(mr,{children:i.jsx(hr,{children:o})}),i.jsxs(uo,{className:"grid gap-4 py-2",children:[r,i.jsx(pr,{children:i.jsx(Yi,{asChild:!0,children:i.jsx(H,{type:"button",children:w("common.close")})})})]})]})]})});function Yb(n){let a=0;for(let v=0;v>v*8&255;l+=("00"+j.toString(16)).substr(-2)}const c=parseInt(l.substr(1,2),16),d=parseInt(l.substr(3,2),16),m=parseInt(l.substr(5,2),16),p=`#${(c*.7|0).toString(16).padStart(2,"0")}${(d*.7|0).toString(16).padStart(2,"0")}${(m*.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(m+(255-m)*.7)).toString(16).padStart(2,"0")}`;return[p,x]}const Od=({label:n,className:o})=>{const[r,a]=Yb(n);return i.jsx(co,{className:o,style:o?{}:{backgroundColor:a,color:r},children:n})};function Dd({table:n,header:o,className:r}){return o.column.getCanSort()?i.jsx("div",{className:he("flex items-center space-x-2",r),children:i.jsxs(rs,{children:[i.jsx(is,{asChild:!0,children:i.jsxs(H,{"aria-label":o.column.getIsSorted()==="desc"?w("common.sort_desc_description"):o.column.getIsSorted()==="asc"?w("common.sort_asc_description"):w("common.sort_none_description"),size:"sm",variant:"ghost",className:"-ml-3 h-8 data-[state=open]:bg-accent font-bold text-muted-foreground",children:[Ji(o.column.columnDef.header,o.getContext()),o.column.getIsSorted()==="desc"?i.jsx(_c,{className:"w-4 h-4 ml-2","aria-hidden":"true"}):o.column.getIsSorted()==="asc"?i.jsx(bc,{className:"w-4 h-4 ml-2","aria-hidden":"true"}):i.jsx(A0,{className:"w-4 h-4 ml-2 text-muted-foreground/30","aria-hidden":"true"})]})}),i.jsxs(ss,{align:"start",children:[o.column.getCanSort()&&i.jsxs(i.Fragment,{children:[i.jsxs(Vr,{onClick:()=>o.column.toggleSorting(!1),"aria-label":w("common.sort_asc"),children:[i.jsx(bc,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70","aria-hidden":"true"}),w("common.sort_asc")]}),i.jsxs(Vr,{onClick:()=>o.column.toggleSorting(!0),"aria-label":w("common.sort_desc"),children:[i.jsx(_c,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70","aria-hidden":"true"}),w("common.sort_desc")]})]}),o.column.getCanSort()&&o.column.getCanHide()&&i.jsx(fo,{}),o.column.getCanHide()&&i.jsxs(Vr,{onClick:()=>o.column.toggleVisibility(!1),"aria-label":w("common.hide"),children:[i.jsx(md,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70","aria-hidden":"true"}),w("common.hide")]})]})]})}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:he("data-[state=open]:bg-accent tracking-wide text-ellipsis",r),children:o.isPlaceholder?null:Ji(o.column.columnDef.header,o.getContext())}),!1]})}function Zb({table:n,className:o,enablePageSizeSelector:r=!0,visible:a="auto"}){const l=O.useMemo(()=>a===!0,[a]),c=O.useMemo(()=>a==="auto",[a]);return!l||c&&n.getPageCount()<1?null:i.jsxs("div",{className:o,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(ar,{value:`${n.getState().pagination.pageSize}`,onValueChange:d=>{n.setPageSize(Number(d))},children:[i.jsx(or,{className:"h-8 w-[70px]",children:i.jsx(lr,{placeholder:n.getState().pagination.pageSize})}),i.jsx(ur,{side:"top",children:U_.map(d=>i.jsx(xn,{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(H,{type:"button",variant:"outline",className:"hidden w-8 h-8 p-0 lg:flex",onClick:()=>n.setPageIndex(z_),disabled:!n.getCanPreviousPage(),children:[i.jsx("span",{className:"sr-only",children:w("common.go_to_first_page")}),i.jsx(I0,{className:"w-4 h-4"})]}),i.jsxs(H,{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(V_,{className:"w-4 h-4"})]}),i.jsxs(H,{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(H_,{className:"w-4 h-4"})]}),i.jsxs(H,{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(F0,{className:"w-4 h-4"})]})]})]})]})]})}function fs({table:n,title:o,description:r,caption:a,paginationOptions:l,headerOptions:c={visible:!0},children:d,className:m,contentClassName:p,footerClassName:x,rowClassName:v,cellClassName:j,onRowClick:y,activeRowIndex:_}){var R;const E=c==null?void 0:c.visible;return i.jsxs(Oe,{className:m,children:[(o||r)&&i.jsxs(ct,{className:"pb-0",children:[i.jsx(Ve,{children:o}),i.jsx(We,{children:r})]}),i.jsxs(De,{className:he("pt-6",p),children:[d&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex space-x-2",children:d}),i.jsx(_n,{className:"my-4"})]}),i.jsxs(go,{children:[typeof a<"u"&&i.jsx(G_,{children:a}),E&&n.getHeaderGroups().length&&i.jsx(mo,{children:n.getHeaderGroups().map(L=>i.jsx(bn,{className:v,children:L.headers.map(M=>i.jsx(ho,{colSpan:M.colSpan,style:{width:M.getSize()===Number.MAX_SAFE_INTEGER?"auto":M.getSize()},children:i.jsx(Dd,{table:n,header:M})},M.id))},L.id))}),i.jsx(po,{children:(R=n.getRowModel().rows)!=null&&R.length?n.getRowModel().rows.map(L=>i.jsx(bn,{onClick:()=>{y&&y(L)},tabIndex:0,"data-state":L.getIsSelected()&&"selected",className:he(L.getIsSelected()||_===L.index?"bg-accent cursor-pointer hover:bg-accent":"cursor-pointer",v),children:L.getVisibleCells().map(M=>i.jsx(Kr,{className:j,style:{width:M.column.getSize()===Number.MAX_SAFE_INTEGER?"auto":M.column.getSize()},children:Ji(M.column.columnDef.cell,M.getContext())},M.id))},L.id)):i.jsx(bn,{className:v,children:i.jsx(Kr,{className:he("h-24 text-center",j),colSpan:n.getAllColumns.length,children:"No hay datos para mostrar"})})})]})]}),i.jsx(Rt,{className:x,children:i.jsx(Zb,{className:"flex-1",table:n,...l})})]})}function Xb({actions:n,rowContext:o}){return i.jsxs(rs,{children:[i.jsx(is,{asChild:!0,children:i.jsxs(H,{size:"icon",variant:"outline",className:"w-8 h-8",children:[i.jsx(D0,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"sr-only",children:w("common.open_menu")})]})}),i.jsxs(ss,{align:"end",children:[i.jsxs(Dc,{children:[w("common.actions")," "]}),n&&n(o).map((r,a)=>r.label==="-"?i.jsx(fo,{},a):i.jsxs(Vr,{onClick:l=>r.onClick?r.onClick(o,l):null,children:[r.icon&&i.jsx(i.Fragment,{children:r.icon}),r.label,r.shortcut&&i.jsx(K_,{children:r.shortcut})]},a))]})]})}function Jb(){return{id:"select",header:({table:n})=>i.jsx(Zi,{id:"select-all",checked:n.getIsAllPageRowsSelected()||n.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:o=>n.toggleAllPageRowsSelected(!!o),"aria-label":w("common.select_all"),className:"translate-y-[2px]"}),cell:({row:n})=>i.jsx(Zi,{id:`select-row-${n.id}`,checked:n.getIsSelected(),onCheckedChange:o=>{n.toggleSelected(!!o)},"aria-label":w("common.select_row"),className:"translate-y-[2px]"}),enableSorting:!1,enableHiding:!1}}function gs({columnCount:n,rowCount:o=10,searchableColumnCount:r=0,filterableColumnCount:a=0,showViewOptions:l=!0,cellWidths:c=["auto"],withPagination:d=!0,shrinkZero:m=!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,j)=>i.jsx(ut,{className:"w-40 h-7 lg:w-60"},j)):null,a>0?Array.from({length:a}).map((v,j)=>i.jsx(ut,{className:"h-7 w-[4.5rem] border-dashed"},j)):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(go,{children:[i.jsx(mo,{children:Array.from({length:1}).map((v,j)=>i.jsx(bn,{className:"hover:bg-transparent",children:Array.from({length:n}).map((y,_)=>i.jsx(ho,{style:{width:c[_],minWidth:m?c[_]:"auto"},children:i.jsx(ut,{className:"w-full h-6"})},_))},j))}),i.jsx(po,{children:Array.from({length:o}).map((v,j)=>i.jsx(bn,{className:"hover:bg-transparent",children:Array.from({length:n}).map((y,_)=>i.jsx(Kr,{style:{width:c[_],minWidth:m?c[_]:"auto"},children:i.jsx(ut,{className:"w-full h-6"})},_))},j))})]})}),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 ms=({title:n=w("components.empty_state.title"),subtitle:o=w("components.empty_state.subtitle"),buttonText:r=w("components.empty_state.button"),onButtonClick:a=()=>{},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:o}),i.jsxs("div",{className:"items-center mt-6",children:[l&&i.jsx(i.Fragment,{children:l}),!l&&i.jsxs(H,{className:"my-4",onClick:a,children:[i.jsx(Eo,{}),r]})]})]}),ew=wo("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"}}),es=n=>{const{name:o,label:r,hint:a,description:l,placeholder:c,className:d,disabled:m,defaultValue:p,rules:x,readOnly:v,scale:j,variant:y}=n,{control:_}=xr(),[E,R]=O.useState(""),L={input:M=>{if(typeof M!="object")return M;const $=Ut.create(M);if($.isFailure)throw $.error;const q=$.object.toString();return E.endsWith(",")?q.replace(/.0$/,","):q},output:(M,$,q)=>{const{value:V}=q??{value:null};R(V??"");const D=Ut.createFromFormattedValue(V);if(D.isFailure)throw D.error;return D.object.toObject()}};return i.jsx(xo,{defaultValue:p,control:_,name:o,disabled:m,rules:{max:100,min:0,...x},render:({field:M})=>{const $=L.input(M.value),q=m||M.disabled,V=!!((x==null?void 0:x.required)??!1);return i.jsxs(vo,{className:he(d,"space-y-3"),children:[r&&i.jsx(_o,{label:r,hint:a,required:V}),i.jsx(bo,{children:i.jsx(Lc,{name:M.name,ref:M.ref,onBlur:M.onBlur,disabled:q,readOnly:v,className:he(ew({variant:y,className:d})),groupSeparator:".",decimalSeparator:",",placeholder:c,allowDecimals:j!==0,decimalsLimit:j,decimalScale:j,step:1,value:$,onValueChange:(D,k,W)=>M.onChange(L.output(D,k,W))})}),l&&i.jsx(So,{children:l}),i.jsx(jo,{})]})}})},tw=wo("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"}}),nw=n=>{const{name:o,label:r,hint:a,description:l,placeholder:c,className:d,disabled:m,defaultValue:p,rules:x,readOnly:v,scale:j,variant:y}=n,{control:_}=xr(),[E,R]=O.useState(""),L={input:M=>{if(typeof M!="object")return M;const $=Sn.create(M);if($.isFailure)throw $.error;const q=$.object.toString();return E.endsWith(",")?q.replace(/.0$/,","):q},output:(M,$,q)=>{const{value:V}=q??{value:null};R(V??"");const D=Sn.createFromFormattedValue(V);if(D.isFailure)throw D.error;return D.object.toObject()}};return i.jsx(xo,{defaultValue:p,control:_,name:o,disabled:m,rules:x,render:({field:M})=>{const $=L.input(M.value),q=m||M.disabled,V=!!((x==null?void 0:x.required)??!1);return i.jsxs(vo,{className:he(d,"space-y-3"),children:[r&&i.jsx(_o,{label:r,hint:a,required:V}),i.jsx(bo,{children:i.jsx(Lc,{name:M.name,ref:M.ref,onBlur:M.onBlur,disabled:q,readOnly:v,className:he(tw({variant:y,className:d})),groupSeparator:".",decimalSeparator:",",placeholder:c,allowDecimals:j!==0,decimalsLimit:j,decimalScale:j,step:1,value:$,onValueChange:(D,k,W)=>M.onChange(L.output(D,k,W))})}),l&&i.jsx(So,{children:l}),i.jsx(jo,{})]})}})},rw=wo("",{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"}}),Ln=n=>{const{name:o,label:r,hint:a,description:l,placeholder:c,className:d,disabled:m,rules:p,required:x,type:v,variant:j}=n,{control:y}=xr();return i.jsx(xo,{control:y,name:o,disabled:m,rules:{required:x,...p},render:({field:_,fieldState:E})=>{const R=!!((p==null?void 0:p.required)??x);return i.jsxs(vo,{className:he(d,"space-y-3"),children:[r&&i.jsx(_o,{label:r,hint:a,required:R}),i.jsx(bo,{className:"block",children:i.jsx(as,{type:v,placeholder:c,className:he(E.error?"border-destructive focus-visible:ring-destructive":"",rw({variant:j,className:d})),..._})}),l&&i.jsx(So,{children:l}),i.jsx(jo,{})]})}})};function iw(n=!1){const[o,r]=O.useState(n);return[o,()=>r(l=>!l)]}const kn=()=>{const n=O.useContext(W_);if(n===null)throw new Error("useDataTableContext must be used within a DataTableProvider");return n};function hs({data:n,columns:o,pageCount:r,enableSorting:a=!1,enableHiding:l=!1,enableRowSelection:c=!1,initialState:d,onPaginationChange:m,meta:p}){const{pagination:x,setPagination:v,sorting:j}=kn(),[y,_]=Dn.useState({}),[E,R]=Dn.useState((d==null?void 0:d.columnVisibility)||{}),L=V=>{if(typeof V=="function"){const D=V(x);v(D)}m&&m(V)},M=V=>{},$=O.useCallback(()=>{const V=o;return c&&V.unshift(Jb()),V},[o,c]);return{table:Td({data:n,columns:$(),pageCount:r??-1,meta:p,getCoreRowModel:Fd(),initialState:d,state:{pagination:x,sorting:j,columnVisibility:E,rowSelection:y},enableRowSelection:c,onRowSelectionChange:_,manualSorting:!0,enableSorting:a,getSortedRowModel:Hb(),onSortingChange:M,enableHiding:l,onColumnVisibilityChange:R,manualPagination:!0,onPaginationChange:L,manualFiltering:!0,getFilteredRowModel:Vb(),getFacetedRowModel:Ub(),getFacetedUniqueValues:zb(),debugTable:!1,debugHeaders:!1,debugColumns:!1,defaultColumn:{minSize:0,size:Number.MAX_SAFE_INTEGER,maxSize:Number.MAX_SAFE_INTEGER}})}}const sw=({setSize:n,setControllerCallback:o,setPercentageCallback:r,setErrorCallback:a})=>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"),m=l.headers.get(d?"x-file-size":"content-length"),p=parseInt(m||"0",10);n(()=>p);let x=0;const v=new ReadableStream({start(j){o(j);const y=c.getReader();async function _(){return y.read().then(({done:E,value:R})=>E?j.close():(x+=(R==null?void 0:R.byteLength)||0,R&&j.enqueue(R),r({loaded:x,total:p}),_())).catch(E=>(a(E),y.cancel("Cancelled"),j.error(E)))}return _()}});return new Response(v)},Nc=(n,o,r)=>{const a=[n],l=new Blob(a,{type:r||"application/octet-stream"});if(typeof window.navigator.msSaveBlob<"u")return window.navigator.msSaveBlob(l,o);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",o),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 Rc({customHandleDownload:n,...o}={}){var V;let r=!1;try{r=process?!!((V=process==null?void 0:process.env)!=null&&V.REACT_APP_DEBUG_MODE):!1}catch{r=!1}const[a,l]=O.useState(0),[c,d]=O.useState(0),[m,p]=O.useState(0),[x,v]=O.useState(null),[j,y]=O.useState(!1),_=O.useRef(null),E=O.useCallback(({loaded:D,total:k})=>{const W=Math.round(D/k*100);d(()=>W)},[]),R=O.useCallback(D=>{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[D.message]?k[D.message]:D.message}))},[]),L=O.useCallback(D=>{_.current=D},[]),M=O.useCallback(()=>{_.current&&_.current.error()},[]),$=O.useCallback(()=>{L(null),l(()=>0),d(()=>0),p(()=>0),y(()=>!1)},[L]),q=O.useCallback(async(D,k,W=0,te={})=>{if(j)return null;$(),v(()=>null),y(()=>!0);const U=setInterval(()=>l(ke=>ke+1),r?1:1e3),ge=sw({setSize:p,setControllerCallback:L,setPercentageCallback:E,setErrorCallback:R}),_e=new AbortController,K=setTimeout(()=>{W>0&&_e.abort()},W),Ee=n||Nc;try{const ke=await fetch(D,{method:"GET",...o,...te,signal:_e.signal}),tt=await ge(ke).blob();Ee(tt,k),$()}catch(ke){$(),v(X=>{const{message:tt}=ke;return tt!=="Failed to fetch"?{errorMessage:tt}:X}),clearTimeout(K)}finally{clearInterval(U)}},[j,$,r,L,E,R,o,n]);return O.useMemo(()=>({elapsed:a,percentage:c,size:m,download:q,cancel:M,error:x,isInProgress:j,jsDownload:Nc}),[a,c,m,q,M,x,j])}const aw=()=>{const{i18n:n}=Pt();return Ld({locale:n.language})},Ld=n=>{const{locale:o}=n,r=O.useCallback(c=>{if(c==null)return"";const{amount:d,scale:m,currency_code:p}=c;return new Intl.NumberFormat(o??"ES",{style:"currency",currency:p,currencyDisplay:"symbol",useGrouping:!0,maximumFractionDigits:m}).format(d===null?0:hc({amount:d,scale:m}))},[o]),a=O.useCallback(c=>{if(c==null)return"";const{amount:d,scale:m}=c;return new Intl.NumberFormat("es",{minimumFractionDigits:m,useGrouping:!0}).format(d===null?0:hc({amount:d,scale:m}))},[o]),l=O.useCallback(c=>{if(c==null)return"";const{amount:d,scale:m}=c;return new Intl.NumberFormat(o,{style:"decimal",minimumFractionDigits:m}).format(d===null?0:d)},[o]);return{formatCurrency:r,formatNumber:a,formatPercentage:l}};function Pd(n){const[o,r]=O.useState(!1);return O.useEffect(()=>{function a(c){r(c.matches)}const l=matchMedia(n);return l.addEventListener("change",a),r(l.matches),()=>l.removeEventListener("change",a)},[n]),o}const ow=()=>{const n=O.useContext(Q_);if(n===null)throw new Error("useWarnAboutChange must be used within a UnsavedWarnProvider");return n},Oo=({isDirty:n=!1,title:o=w("hooks.use_unsaved_changes_notifier.title"),subtitle:r=w("hooks.use_unsaved_changes_notifier.subtitle"),confirmText:a=w("hooks.use_unsaved_changes_notifier.confirm_text"),cancelText:l=w("hooks.use_unsaved_changes_notifier.cancel_text"),onConfirm:c,onCancel:d,type:m="warning"})=>{const p=Y_(n),{show:x}=ow(),v=O.useCallback(()=>n?new Promise(j=>{x({title:o,subtitle:r,confirmText:a,cancelText:l,type:m,onConfirm:()=>{j(!0),c==null||c()},onCancel:()=>{j(!1),d==null||d()}})}):Promise.resolve(!0),[l,a,n,d,c,x,r,o,m]);return O.useEffect(()=>{p.state==="blocked"&&v().then(j=>{j?p.proceed():p.reset()})},[p,v]),O.useEffect(()=>(n&&(window.onbeforeunload=()=>r),()=>{window.onbeforeunload=null}),[n,r]),{confirm:v}},qd=n=>{const{isSubmitting:o,isLoading:r,isValidating:a}=Z_();return i.jsx(Co,{disabled:o||r||a,...n})};qd.displayName="FormSubmitButton";const rn=[{code:"es",name:"Español",flagClassName:"fi fi-es"},{code:"en",name:"English",flagClassName:"fi fi-gb"},{code:"fr",name:"Français",flagClassName:"fi fi-fr"}],kd={"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}}"},Ww=()=>{var j,y,_,E;const{t:n,i18n:o}=Pt(),[r,a]=O.useState(o.language),l=zt(),{toast:c}=Cn();O.useEffect(()=>{const R=navigator.language.split("-")[0],L=rn.find(M=>M.code===R);L&&d(L.code)},[]);const d=R=>{o.changeLanguage(R),a(R)},{mutate:m,status:p}=E0({onSuccess:R=>{const{success:L,error:M}=R;!L&&M&&x.setError("root",M),L&&l("/quotes",{replace:!0})},onError:R=>{const{message:L}=R;c({description:L,title:n("common.error")}),console.log(R)}}),x=os({mode:"onBlur",defaultValues:{email:"",password:""},resolver:Pc(pn.object({email:pn.string().email({tlds:{allow:!1}}).required(),password:pn.string().min(4).alphanum().required()}),{messages:kd})}),v=async R=>{m({email:R.email,password:R.password},{})};return i.jsxs(X_,{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(rs,{children:[i.jsx(is,{asChild:!0,children:i.jsxs(H,{variant:"outline",className:"w-[140px] justify-start",children:[i.jsx("span",{className:"mr-2",children:i.jsx("span",{"aria-hidden":"true",className:(j=rn.find(R=>R.code===r))==null?void 0:j.flagClassName})}),(y=rn.find(R=>R.code===r))==null?void 0:y.name,i.jsx(qc,{className:"w-4 h-4 ml-auto opacity-50"})]})}),i.jsx(ss,{className:"w-[140px]",children:rn.map(R=>i.jsxs(Vr,{onSelect:()=>d(R.code),children:[i.jsx("span",{"aria-hidden":"true",className:`mr-2 ${R.flagClassName}`}),R.name]},R.code))})]})}),i.jsxs(Oe,{className:"px-12 py-6 bg-muted/50",children:[i.jsxs(ct,{children:[i.jsx(J_,{className:"inline-block m-auto mb-6 align-middle max-w-32"}),i.jsx(Ve,{children:i.jsx(se,{i18nKey:"login_page.title"})}),i.jsx(We,{children:i.jsx(se,{i18nKey:"login_page.description"})})]}),i.jsx(De,{children:i.jsx(ls,{...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(Ln,{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(Ln,{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(se,{i18nKey:"login_page.forgotten_password"}),i.jsx("br",{}),i.jsx(pc,{to:"https://uecko.com/distribuidores",className:"underline",children:i.jsx(se,{i18nKey:"login_page.contact_us"})})]})]}),((_=x.formState.errors.root)==null?void 0:_.message)&&i.jsxs(kc,{variant:"destructive",children:[i.jsx(fd,{className:"w-4 h-4"}),i.jsx($c,{children:i.jsx(se,{i18nKey:"common.error"})}),i.jsx(Bc,{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(se,{i18nKey:"login_page.become_dealer"}),i.jsx("br",{}),i.jsx(pc,{to:"https://uecko.com/distribuidores",className:"underline",children:i.jsx(se,{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.2.0"]})]})]})})})})]}),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"})})]})},lw=n=>{const{onSuccess:o,onError:r,...a}=n||{},l=tn(),c=Pn(),{logout:d}=Fc(),m=zt(),{toast:p}=Cn();return nn({mutationKey:c().auth().action("logout").get(),mutationFn:d,onSuccess:async(x,v,j)=>{l.clear();const{success:y,redirectTo:_}=x;y&&_&&m(_||"/"),o&&o(x,v,j)},onError:(x,v,j)=>{const{message:y}=x;p({title:w("common.error"),description:y,variant:"destructive"}),r&&r(x,v,j)},...a})},Qw=()=>{const{mutate:n}=lw({});return O.useEffect(()=>n(),[n]),i.jsx(qn,{})},uw=O.createContext(null),cw=({children:n})=>{const[o,r]=Uc();return i.jsx(uw.Provider,{value:{pagination:o,setPagination:r},children:n})},Yw=({children:n})=>i.jsx(us,{children:i.jsx(cw,{children:i.jsxs(Qr,{className:"catalog-layout",children:[i.jsx(Yr,{}),i.jsx(Zr,{children:n})]})})}),$d=n=>{const o=Wr(),r=Pn(),{pagination:a,searchTerm:l=[],enabled:c=!0,queryOptions:d}=n;return Ao({queryKey:r().data().resource("catalog").action("list").params(n).get(),queryFn:()=>o.getList({resource:"catalog",quickSearchTerm:l,pagination:a}),enabled:c,queryOptions:d})};function Bd({table:n,className:o,children:r,...a}){const{globalFilter:l,isFiltered:c,setGlobalFilter:d,resetGlobalFilter:m}=kn(),p=Dn.useRef(null),[x,v]=Dn.useState(""),j=Dn.useCallback(E=>{E.key==="Enter"&&x.trim()&&(E.preventDefault(),d(R=>[...R,x.trim()]),v("")),E.key==="Backspace"&&!x&&l.length>0&&(E.preventDefault(),d(R=>R.slice(0,-1)))},[l,x]),y=Dn.useCallback(E=>{d(R=>R.filter(L=>L!==E))},[]),_=Dn.useCallback(()=>{var E;x.trim()&&(d(R=>[...R,x.trim()]),v(""),(E=p.current)==null||E.focus())},[x]);return i.jsx(e0,{children:i.jsxs("div",{className:"w-full space-y-2",...a,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(zc,{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(co,{variant:"default",className:"px-1 text-base font-normal rounded-sm",children:[E,i.jsxs(H,{variant:"ghost",onClick:()=>y(E),className:"h-auto p-0 px-1 ml-1 hover:bg-transparent",children:[i.jsxs(Qe,{children:[i.jsx(Ye,{asChild:!0,children:i.jsx(Za,{className:"w-4 h-4"})}),i.jsx(Ze,{children:i.jsx("p",{children:w("common.filter.badget_remove_tooltip")})})]}),i.jsx("span",{className:"sr-only",children:w("common.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:j,placeholder:w("common.filter.input_placeholder"),className:"flex-1 w-full h-8 bg-transparent outline-none placeholder:text-muted-foreground"}),i.jsxs(cr,{children:[c&&i.jsxs(Qe,{children:[i.jsx(Ye,{asChild:!0,children:i.jsxs(H,{variant:"ghost",onClick:()=>m(),className:"h-8 px-2 transition-all lg:px-3 text-primary",children:[i.jsx(Za,{className:"w-4 h-4 mr-2"}),w("common.filter.reset_filter")]})}),i.jsx(Ze,{children:i.jsx("p",{children:w("common.filter.reset_filter")})})]}),i.jsxs(Qe,{children:[i.jsx(Ye,{asChild:!0,children:i.jsxs(H,{variant:"default",size:"icon",disabled:!x,onClick:_,className:"w-8 h-8 p-0 transition-all",children:[i.jsx(Eo,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:w("common.filter.button_add_term")})]})}),i.jsx(Ze,{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 dw=()=>{const n=zt(),{pagination:o,globalFilter:r,isFiltered:a}=kn(),{data:l,isPending:c,isError:d,error:m}=$d({pagination:{pageIndex:o.pageIndex,pageSize:o.pageSize},searchTerm:r}),p=O.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 j=Dt.create(v.original.retail_price).object;return i.jsx("div",{className:"text-right",children:j.toFormat()})}}],[]),{table:x}=hs({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(vr,{subtitle:m.message}):c?i.jsx(Oe,{children:i.jsx(De,{children:i.jsx(gs,{columnCount:6,searchableColumnCount:1,filterableColumnCount:2,shrinkZero:!0})})}):(l==null?void 0:l.total_items)===0&&!a?i.jsx(ms,{subtitle:w("catalog.list.empty_state.subtitle"),buttonText:"",onButtonClick:()=>n("/catalog/add")}):i.jsx(fs,{table:x,paginationOptions:{visible:!0},children:i.jsx(Bd,{table:x})})},Zw=()=>i.jsxs(dr,{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(se,{i18nKey:"catalog.list.title"})})})}),i.jsx(dw,{})]}),Xw=()=>{const{data:n,status:o}=t0();return i.jsxs(Qr,{children:[i.jsx(Yr,{}),i.jsx(Zr,{children:o==="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"})})]})},Jw=({children:n})=>i.jsx(us,{children:i.jsxs(Qr,{className:"dealers-layout",children:[i.jsx(Yr,{}),i.jsx(Zr,{children:n})]})});function fw({table:n}){return i.jsxs(rs,{children:[i.jsx(is,{asChild:!0,children:i.jsxs(H,{variant:"outline",size:"sm",className:"hidden h-8 ml-auto lg:flex",children:[i.jsx(B0,{className:"w-4 h-4 mr-2"}),w("components.data_table.columns")]})}),i.jsxs(ss,{align:"end",className:"w-[150px]",children:[i.jsx(Dc,{children:w("components.data_table.columns")}),i.jsx(fo,{}),n.getAllColumns().filter(o=>typeof o.accessorFn<"u"&&o.getCanHide()).map(o=>i.jsx(n0,{className:"capitalize",checked:o.getIsVisible(),onCheckedChange:r=>o.toggleVisibility(!!r),children:i.jsx(i.Fragment,{children:o.columnDef.header})},o.id))]})]})}function Ud({table:n,className:o,children:r,...a}){const{globalFilter:l,isFiltered:c,setGlobalFilter:d,resetGlobalFilter:m}=kn(),p=x=>{const v=String(x.target.value);v===""?m():d([v])};return i.jsxs("div",{className:he("flex w-full items-center justify-between space-x-2 overflow-auto p-1",o),...a,children:[i.jsxs("div",{className:"flex items-center flex-1 space-x-2",children:[i.jsx(zc,{className:"w-4 h-4 text-gray-500"}),i.jsx(as,{placeholder:w("common.filter.input_placeholder"),value:l,onChange:p,className:he("h-8 w-full transition-all")},"global-filter"),c&&i.jsxs(H,{variant:"outline",onClick:()=>m(),className:"h-8 px-2 transition-all lg:px-3",children:[i.jsx(Za,{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(fw,{table:n})]})]})}const gw=n=>{const o=Wr(),r=Pn(),{pagination:a,searchTerm:l=void 0,enabled:c=!0,queryOptions:d}=n;return Ao({queryKey:r().data().resource("dealer").action("list").params(n).get(),queryFn:()=>o.getList({resource:"dealers",quickSearchTerm:l,pagination:a}),enabled:c,queryOptions:d})},mw=()=>{const n=zt(),{pagination:o,globalFilter:r,isFiltered:a}=kn(),{data:l,isPending:c,isError:d,error:m}=gw({pagination:{pageIndex:o.pageIndex,pageSize:o.pageSize},searchTerm:r}),p=O.useMemo(()=>[{id:"id",accessorKey:"id",enableResizing:!1,size:10},{id:"name",accessorKey:"name",enableResizing:!1,size:10}],[]),{table:x}=hs({data:(l==null?void 0:l.items)??[],columns:p,pageCount:(l==null?void 0:l.total_pages)??-1});return d?i.jsx(vr,{subtitle:m.message}):c?i.jsx(Oe,{children:i.jsx(De,{children:i.jsx(gs,{columnCount:6,searchableColumnCount:1,filterableColumnCount:2,shrinkZero:!0})})}):(l==null?void 0:l.total_items)===0&&!a?i.jsx(ms,{subtitle:w("catalog.list.empty_state.subtitle"),buttonText:"",onButtonClick:()=>n("/catalog/add")}):i.jsx(i.Fragment,{children:i.jsx(fs,{table:x,paginationOptions:{visible:!0},children:i.jsx(Ud,{table:x})})})},eS=()=>i.jsx(dr,{children:i.jsx(mw,{})}),tS=()=>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(H,{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"})})]})}),zd=O.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 hw(n){return n.isSorting||n.wasDragging?i0(n):!0}function pw({id:n,children:o,isActive:r=!1,onActivate:a}){const{attributes:l,isDragging:c,listeners:d,setNodeRef:m,setActivatorNodeRef:p,transform:x,transition:v}=r0({animateLayoutChanges:hw,id:n}),j={transform:Xa.Translate.toString(x),transition:v},y=O.useMemo(()=>({attributes:l,listeners:d,ref:p,isDragging:c}),[l,c,d,p]);return i.jsx(zd.Provider,{value:y,children:i.jsx(bn,{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:m,style:j,onClick:a,onFocusCapture:a,children:o},n)})}const xw=({className:n})=>{const{attributes:o,isDragging:r,listeners:a,ref:l}=O.useContext(zd);return i.jsxs(H,{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),...o,...a,children:[i.jsx(hd,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:w("common.move_row")})]})};function vw(n,o={}){const{t:r,i18n:a}=Pt(),{enableDragHandleColumn:l=!1,enableSelectionColumn:c=!1,enableActionsColumn:d=!1,rowActionFn:m=void 0}=o;return O.useMemo(()=>(l&&n.unshift({id:"row_drag_handle",header:()=>null,cell:()=>i.jsx(xw,{}),enableSorting:!1,enableHiding:!1,size:40}),c&&n.unshift({id:"select",header:({table:p})=>i.jsx(Zi,{id:"select-all",checked:p.getIsAllPageRowsSelected()||p.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:x=>p.toggleAllPageRowsSelected(!!x),"aria-label":r("common.select_all"),className:"translate-y-[0px]"}),cell:({row:p})=>i.jsx(Zi,{id:`select-row-${p.id}`,checked:p.getIsSelected(),disabled:!p.getCanSelect(),onCheckedChange:p.getToggleSelectedHandler(),"aria-label":r("common.select_row"),className:"mt-2"}),enableSorting:!1,enableHiding:!1,size:40}),d&&n.push({id:"row_actions",cell:p=>i.jsx(Xb,{rowContext:p,actions:m}),enableSorting:!1,enableHiding:!1,size:48}),n),[d,l,c,r,a.resolvedLanguage])}var Vd={exports:{}};(function(n,o){(function(r,a,l){n.exports=l(),n.exports.default=l()})("slugify",nr,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"}`),a=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 m=a[d.locale]||{},p=d.replacement===void 0?"-":d.replacement,x=d.trim===void 0?!0:d.trim,v=c.normalize().split("").reduce(function(j,y){var _=m[y];return _===void 0&&(_=r[y]),_===void 0&&(_=y),_===p&&(_=" "),j+_.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})})(Vd);var _w=Vd.exports;const bw=s0(_w),Xr=()=>{const n=Wr(),o=Pn(),{i18n:r}=Pt(),a=O.useCallback(d=>`${n.getApiUrl()}/quotes/${d}/report`,[n]),l=O.useCallback(d=>`quote-${bw(d.reference,{lower:!0,strict:!0,locale:"en",trim:!0})}.pdf`,[]),c={useList:d=>{const m=Wr(),p=Pn(),{pagination:x,status:v="draft",quickSearchTerm:j=void 0,enabled:y=!0,queryOptions:_}=d;return Ao({queryKey:p().data().resource("quotes").action("list").params(d).get(),queryFn:()=>m.getList({resource:"quotes",quickSearchTerm:j,filters:v!=="all"?[{field:"status",operator:"eq",value:v}]:[{field:"status",operator:"ne",value:"archived"}],pagination:x}),enabled:y,queryOptions:_})},useCreate:()=>{const d=tn();return eb({mutationFn:m=>{const{date:p}=m,x=mn.generateNewID().object.toString();return n.createOne({resource:"quotes",data:{...m,date:new Date(p).toISOString().slice(0,10),status:"draft",id:x}})},onSuccess:()=>{d.invalidateQueries({queryKey:["data","default","quotes"]})}})},useUpdate:d=>{const m=tn();return nn({mutationKey:o().data().resource("quotes").action("one").id(d).params().get(),mutationFn:p=>n.updateOne({resource:"quotes",id:d,data:p}),onSuccess:()=>{m.invalidateQueries({queryKey:["data","default","quotes"]})}})},useSetStatus:()=>{const d=tn();return nn({mutationFn:m=>{const{id:p,newStatus:x}=m;return n.custom({url:`${n.getApiUrl()}/quotes/${p}/setStatus`,method:"put",data:{newStatus:x}})},onSuccess:()=>{d.invalidateQueries({queryKey:["data","default","quotes"]})}})},useDuplicate:()=>{const d=tn();return nn({mutationFn:m=>{const{id:p}=m;return n.custom({url:`${n.getApiUrl()}/quotes/${p}/duplicate`,method:"post"})},onSuccess:()=>{d.invalidateQueries({queryKey:["data","default","quotes"]})}})},useSentTo:d=>{const m=tn();return nn({mutationKey:o().data().resource("quotes").action("one").id(d).params().get(),mutationFn:p=>{const{sent_date:x}=p;return n.custom({url:`${n.getApiUrl()}/quotes/${d}/send`,method:"put",data:{sent_date:x}})},onSuccess:()=>{m.invalidateQueries({queryKey:["data","default","quotes"]})}})},useOne:(d,m)=>wd({queryKey:o().data().resource("quotes").action("one").id(d).params({language:r.language}).get(),queryFn:()=>n.getOne({resource:"quotes",id:String(d)}),enabled:!!d,...m}),getQuotePDFDownloadURL:a,getQuotePDFFilename:l,useReport:()=>{const d=n.getApiAuthorization(),[m,p]=O.useState(void 0),{download:x,...v}=Rc({headers:{Authorization:d},customHandleDownload:O.useCallback(y=>{const _=[y],E=new Blob(_,{type:"application/octet-stream"});return p(E),!0},[p])}),j=O.useCallback(y=>x(c.getQuotePDFDownloadURL(y),""),[x]);return{...v,preview:j,report:m}},useDownloader:()=>{const d=n.getApiAuthorization(),m=Rc({headers:{Authorization:d}});return{...m,download:(x,v)=>{const j=c.getQuotePDFDownloadURL(x);return m.download(j,v)}}}};return c},nS=()=>{const n=zt(),{i18n:o}=Pt(),{toast:r}=Cn(),{useCreate:a}=Xr(),{mutateAsync:l,isPending:c}=a(),[d,m]=O.useState(),p=o.resolvedLanguage??o.language,x=rn.some(({code:$})=>$===p)?p:"es",v=O.useMemo(()=>({date:new Date(Date.now()).toUTCString(),lang_code:x,customer_reference:"",customer_information:""}),[x]),j=os({mode:"onBlur",defaultValues:v,resolver:Pc(pn.object({customer_reference:pn.string(),date:pn.date().required(),customer_information:pn.string().required(),lang_code:pn.string().valid(...rn.map(({code:$})=>$)).required()}),{messages:{es:kd}})}),{formState:y,reset:_,handleSubmit:E}=j,{isSubmitting:R,isDirty:L}=y;Oo({isDirty:L}),O.useEffect(()=>{d&&n(`/quotes/edit/${d}`,{relative:"path"})},[d,n]);const M=async $=>{try{const q=await l($);_($),r({title:w("quotes.notifications.created"),variant:"default"}),m(q.id)}catch(q){console.debug(q),r({title:w("common.error"),description:q.message,variant:"destructive"})}};return R?i.jsx(qn,{title:w("quotes.notifications.saving")}):c?i.jsx(qn,{}):i.jsx(ls,{...j,children:i.jsx("form",{onSubmit:E(M),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(Vc,{}),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(Ja,{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(H,{type:"button",size:"sm",variant:"outline",onClick:()=>n("/quotes"),children:w("common.discard")}),i.jsx(Co,{size:"sm",label:w("common.continue")})]}),children:[i.jsx(Ln,{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(Hc,{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.jsxs("div",{className:"grid gap-2",children:[i.jsx(wn,{htmlFor:"lang_code",className:"font-semibold",children:w("quotes.form_fields.lang_code.label")}),i.jsx(Xi,{control:j.control,name:"lang_code",render:({field:$})=>i.jsxs(ar,{value:$.value||"es",onValueChange:$.onChange,children:[i.jsx(or,{id:"lang_code","aria-label":w("quotes.form_fields.lang_code.label"),children:i.jsx(lr,{})}),i.jsx(ur,{children:rn.map(q=>i.jsxs(xn,{value:q.code,children:[i.jsx("span",{"aria-hidden":"true",className:`mr-2 ${q.flagClassName}`}),q.name]},q.code))})]})}),i.jsx("p",{className:"text-sm text-muted-foreground",children:w("quotes.form_fields.lang_code.desc")})]}),i.jsx(_n,{}),i.jsx(Bt,{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")})]})})]})})})},Ya=(n,o=!1)=>{const{discount:r,tax:a,subtotal_price:l}=n||{},c=Ut.create(r||{amount:null,scale:2});if(c.isFailure)throw c.error;const d=c.object,m=Ut.create(a||{amount:null,scale:2});if(m.isFailure)throw m.error;const p=m.object,x=Dt.create(l||{amount:null,scale:2});if(x.isFailure)throw x.error;const v=o?ww(n.items).convertScale(2):x.object,j=v.percentage(d.toNumber()).convertScale(2),y=v.subtract(j).convertScale(2),_=y.percentage(p.toNumber()).convertScale(2),E=y.add(_).convertScale(2);return{subtotal_price:v,discount:n.discount,discount_price:j,before_tax_price:y,tax:p,tax_price:_,total_price:E}},ww=n=>{let o=Dt.create({amount:0,scale:2}).object;return n&&n.map(r=>{const a=oo(r);o=o.add(a.total_price)}),o},oo=n=>{const{quantity:o,unit_price:r,discount:a}=n||{};if((!o||o&&o.amount===null)&&(!r||r&&r.amount===null)&&(!a||a&&a.amount===null))return{quantity:Sn.create({amount:null,scale:0}).object,unit_price:Dt.create({amount:null,scale:2}).object,subtotal_price:Dt.create({amount:null,scale:2}).object,discount:Ut.create({amount:null,scale:2}).object,total_price:Dt.create({amount:null,scale:2}).object};const l=Sn.create(o);if(l.isFailure)throw l.error;const c=l.object,d=Dt.create(r);if(d.isFailure)throw d.error;const m=d.object,p=Ut.create(a);if(p.isFailure)throw p.error;const x=p.object,v=m.multiply(c.toNumber()),j=v.subtract(v.percentage(x.toNumber()));return{quantity:c,unit_price:m,subtotal_price:v,discount:x,total_price:j}},Sw=()=>{const{id:n}=a0();return n};var ts={exports:{}};/** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ts.exports;(function(n,o){(function(){var r,a="4.17.21",l=200,c="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",d="Expected a function",m="Invalid `variable` option passed into `_.template`",p="__lodash_hash_undefined__",x=500,v="__lodash_placeholder__",j=1,y=2,_=4,E=1,R=2,O=1,M=2,$=4,q=8,U=16,T=32,k=64,W=128,te=256,V=512,ge=30,_e="...",K=800,Ee=16,ke=1,Z=2,tt=3,Oe=1/0,de=9007199254740991,$e=17976931348623157e292,ne=NaN,Ce=4294967295,vt=Ce-1,_r=Ce>>>1,yn=[["ary",W],["bind",O],["bindKey",M],["curry",q],["curryRight",U],["flip",V],["partial",T],["partialRight",k],["rearg",te]],$n="[object Arguments]",Jr="[object Array]",Yd="[object AsyncFunction]",br="[object Boolean]",wr="[object Date]",Qd="[object DOMException]",ei="[object Error]",ti="[object Function]",qo="[object GeneratorFunction]",At="[object Map]",Sr="[object Number]",Xd="[object Null]",Ut="[object Object]",ko="[object Promise]",Zd="[object Proxy]",jr="[object RegExp]",It="[object Set]",Cr="[object String]",ni="[object Symbol]",Jd="[object Undefined]",yr="[object WeakMap]",ef="[object WeakSet]",Nr="[object ArrayBuffer]",zn="[object DataView]",ps="[object Float32Array]",xs="[object Float64Array]",vs="[object Int8Array]",_s="[object Int16Array]",bs="[object Int32Array]",ws="[object Uint8Array]",Ss="[object Uint8ClampedArray]",js="[object Uint16Array]",Cs="[object Uint32Array]",tf=/\b__p \+= '';/g,nf=/\b(__p \+=) '' \+/g,rf=/(__e\(.*?\)|\b__t\)) \+\n'';/g,$o=/&(?:amp|lt|gt|quot|#39);/g,zo=/[&<>"']/g,sf=RegExp($o.source),af=RegExp(zo.source),of=/<%-([\s\S]+?)%>/g,lf=/<%([\s\S]+?)%>/g,Vo=/<%=([\s\S]+?)%>/g,uf=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,cf=/^\w*$/,df=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ys=/[\\^$.*+?()[\]{}|]/g,ff=RegExp(ys.source),Ns=/^\s+/,gf=/\s/,mf=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,hf=/\{\n\/\* \[wrapped with (.+)\] \*/,pf=/,? & /,xf=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,vf=/[()=,{}\[\]\/\s]/,_f=/\\(\\)?/g,bf=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Bo=/\w*$/,wf=/^[-+]0x[0-9a-f]+$/i,Sf=/^0b[01]+$/i,jf=/^\[object .+?Constructor\]$/,Cf=/^0o[0-7]+$/i,yf=/^(?:0|[1-9]\d*)$/,Nf=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ri=/($^)/,Rf=/['\n\r\u2028\u2029\\]/g,ii="\\ud800-\\udfff",Ef="\\u0300-\\u036f",Af="\\ufe20-\\ufe2f",If="\\u20d0-\\u20ff",Uo=Ef+Af+If,Go="\\u2700-\\u27bf",Ho="a-z\\xdf-\\xf6\\xf8-\\xff",Ff="\\xac\\xb1\\xd7\\xf7",Mf="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Df="\\u2000-\\u206f",Lf=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ko="A-Z\\xc0-\\xd6\\xd8-\\xde",Wo="\\ufe0e\\ufe0f",Yo=Ff+Mf+Df+Lf,Rs="['’]",Tf="["+ii+"]",Qo="["+Yo+"]",si="["+Uo+"]",Xo="\\d+",Of="["+Go+"]",Zo="["+Ho+"]",Jo="[^"+ii+Yo+Xo+Go+Ho+Ko+"]",Es="\\ud83c[\\udffb-\\udfff]",Pf="(?:"+si+"|"+Es+")",el="[^"+ii+"]",As="(?:\\ud83c[\\udde6-\\uddff]){2}",Is="[\\ud800-\\udbff][\\udc00-\\udfff]",Vn="["+Ko+"]",tl="\\u200d",nl="(?:"+Zo+"|"+Jo+")",qf="(?:"+Vn+"|"+Jo+")",rl="(?:"+Rs+"(?:d|ll|m|re|s|t|ve))?",il="(?:"+Rs+"(?:D|LL|M|RE|S|T|VE))?",sl=Pf+"?",al="["+Wo+"]?",kf="(?:"+tl+"(?:"+[el,As,Is].join("|")+")"+al+sl+")*",$f="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",zf="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ol=al+sl+kf,Vf="(?:"+[Of,As,Is].join("|")+")"+ol,Bf="(?:"+[el+si+"?",si,As,Is,Tf].join("|")+")",Uf=RegExp(Rs,"g"),Gf=RegExp(si,"g"),Fs=RegExp(Es+"(?="+Es+")|"+Bf+ol,"g"),Hf=RegExp([Vn+"?"+Zo+"+"+rl+"(?="+[Qo,Vn,"$"].join("|")+")",qf+"+"+il+"(?="+[Qo,Vn+nl,"$"].join("|")+")",Vn+"?"+nl+"+"+rl,Vn+"+"+il,zf,$f,Xo,Vf].join("|"),"g"),Kf=RegExp("["+tl+ii+Uo+Wo+"]"),Wf=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Yf=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Qf=-1,ye={};ye[ps]=ye[xs]=ye[vs]=ye[_s]=ye[bs]=ye[ws]=ye[Ss]=ye[js]=ye[Cs]=!0,ye[$n]=ye[Jr]=ye[Nr]=ye[br]=ye[zn]=ye[wr]=ye[ei]=ye[ti]=ye[At]=ye[Sr]=ye[Ut]=ye[jr]=ye[It]=ye[Cr]=ye[yr]=!1;var je={};je[$n]=je[Jr]=je[Nr]=je[zn]=je[br]=je[wr]=je[ps]=je[xs]=je[vs]=je[_s]=je[bs]=je[At]=je[Sr]=je[Ut]=je[jr]=je[It]=je[Cr]=je[ni]=je[ws]=je[Ss]=je[js]=je[Cs]=!0,je[ei]=je[ti]=je[yr]=!1;var Xf={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Zf={"&":"&","<":"<",">":">",'"':""","'":"'"},Jf={"&":"&","<":"<",">":">",""":'"',"'":"'"},eg={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},tg=parseFloat,ng=parseInt,ll=typeof nr=="object"&&nr&&nr.Object===Object&&nr,rg=typeof self=="object"&&self&&self.Object===Object&&self,Ge=ll||rg||Function("return this")(),Ms=o&&!o.nodeType&&o,Nn=Ms&&!0&&n&&!n.nodeType&&n,ul=Nn&&Nn.exports===Ms,Ds=ul&&ll.process,_t=function(){try{var C=Nn&&Nn.require&&Nn.require("util").types;return C||Ds&&Ds.binding&&Ds.binding("util")}catch{}}(),cl=_t&&_t.isArrayBuffer,dl=_t&&_t.isDate,fl=_t&&_t.isMap,gl=_t&&_t.isRegExp,ml=_t&&_t.isSet,hl=_t&&_t.isTypedArray;function dt(C,I,A){switch(A.length){case 0:return C.call(I);case 1:return C.call(I,A[0]);case 2:return C.call(I,A[0],A[1]);case 3:return C.call(I,A[0],A[1],A[2])}return C.apply(I,A)}function ig(C,I,A,B){for(var re=-1,me=C==null?0:C.length;++re-1}function Ls(C,I,A){for(var B=-1,re=C==null?0:C.length;++B-1;);return A}function jl(C,I){for(var A=C.length;A--&&Bn(I,C[A],0)>-1;);return A}function gg(C,I){for(var A=C.length,B=0;A--;)C[A]===I&&++B;return B}var mg=qs(Xf),hg=qs(Zf);function pg(C){return"\\"+eg[C]}function xg(C,I){return C==null?r:C[I]}function Un(C){return Kf.test(C)}function vg(C){return Wf.test(C)}function _g(C){for(var I,A=[];!(I=C.next()).done;)A.push(I.value);return A}function Vs(C){var I=-1,A=Array(C.size);return C.forEach(function(B,re){A[++I]=[re,B]}),A}function Cl(C,I){return function(A){return C(I(A))}}function on(C,I){for(var A=-1,B=C.length,re=0,me=[];++A-1}function am(e,t){var s=this.__data__,u=ji(s,e);return u<0?(++this.size,s.push([e,t])):s[u][1]=t,this}Gt.prototype.clear=nm,Gt.prototype.delete=rm,Gt.prototype.get=im,Gt.prototype.has=sm,Gt.prototype.set=am;function Ht(e){var t=-1,s=e==null?0:e.length;for(this.clear();++t=t?e:t)),e}function jt(e,t,s,u,f,h){var b,S=t&j,N=t&y,F=t&_;if(s&&(b=f?s(e,u,f,h):s(e)),b!==r)return b;if(!Ae(e))return e;var D=ie(e);if(D){if(b=ch(e),!S)return st(e,b)}else{var P=Je(e),z=P==ti||P==qo;if(gn(e))return au(e,S);if(P==Ut||P==$n||z&&!f){if(b=N||z?{}:yu(e),!S)return N?Jm(e,Sm(b,e)):Zm(e,Ol(b,e))}else{if(!je[P])return f?e:{};b=dh(e,P,S)}}h||(h=new Mt);var H=h.get(e);if(H)return H;h.set(e,b),ec(e)?e.forEach(function(ee){b.add(jt(ee,t,s,ee,e,h))}):Zu(e)&&e.forEach(function(ee,ue){b.set(ue,jt(ee,t,s,ue,e,h))});var J=F?N?ma:ga:N?ot:Be,oe=D?r:J(e);return bt(oe||e,function(ee,ue){oe&&(ue=ee,ee=e[ue]),Dr(b,ue,jt(ee,t,s,ue,e,h))}),b}function jm(e){var t=Be(e);return function(s){return Pl(s,e,t)}}function Pl(e,t,s){var u=s.length;if(e==null)return!u;for(e=we(e);u--;){var f=s[u],h=t[f],b=e[f];if(b===r&&!(f in e)||!h(b))return!1}return!0}function ql(e,t,s){if(typeof e!="function")throw new wt(d);return $r(function(){e.apply(r,s)},t)}function Lr(e,t,s,u){var f=-1,h=ai,b=!0,S=e.length,N=[],F=t.length;if(!S)return N;s&&(t=Re(t,ft(s))),u?(h=Ls,b=!1):t.length>=l&&(h=Rr,b=!1,t=new An(t));e:for(;++ff?0:f+s),u=u===r||u>f?f:ae(u),u<0&&(u+=f),u=s>u?0:nc(u);s0&&s(S)?t>1?He(S,t-1,s,u,f):an(f,S):u||(f[f.length]=S)}return f}var Ys=fu(),zl=fu(!0);function qt(e,t){return e&&Ys(e,t,Be)}function Qs(e,t){return e&&zl(e,t,Be)}function yi(e,t){return sn(t,function(s){return Xt(e[s])})}function Fn(e,t){t=dn(t,e);for(var s=0,u=t.length;e!=null&&st}function Nm(e,t){return e!=null&&xe.call(e,t)}function Rm(e,t){return e!=null&&t in we(e)}function Em(e,t,s){return e>=Ze(t,s)&&e=120&&D.length>=120)?new An(b&&D):r}D=e[0];var P=-1,z=S[0];e:for(;++P-1;)S!==e&&pi.call(S,N,1),pi.call(e,N,1);return e}function Zl(e,t){for(var s=e?t.length:0,u=s-1;s--;){var f=t[s];if(s==u||f!==h){var h=f;Qt(f)?pi.call(e,f,1):aa(e,f)}}return e}function ra(e,t){return e+_i(Ml()*(t-e+1))}function zm(e,t,s,u){for(var f=-1,h=Ve(vi((t-e)/(s||1)),0),b=A(h);h--;)b[u?h:++f]=e,e+=s;return b}function ia(e,t){var s="";if(!e||t<1||t>de)return s;do t%2&&(s+=e),t=_i(t/2),t&&(e+=e);while(t);return s}function le(e,t){return wa(Eu(e,t,lt),e+"")}function Vm(e){return Tl(tr(e))}function Bm(e,t){var s=tr(e);return Oi(s,In(t,0,s.length))}function Pr(e,t,s,u){if(!Ae(e))return e;t=dn(t,e);for(var f=-1,h=t.length,b=h-1,S=e;S!=null&&++ff?0:f+t),s=s>f?f:s,s<0&&(s+=f),f=t>s?0:s-t>>>0,t>>>=0;for(var h=A(f);++u>>1,b=e[h];b!==null&&!mt(b)&&(s?b<=t:b=l){var F=t?null:rh(e);if(F)return li(F);b=!1,f=Rr,N=new An}else N=t?[]:S;e:for(;++u=u?e:Ct(e,t,s)}var su=Lg||function(e){return Ge.clearTimeout(e)};function au(e,t){if(t)return e.slice();var s=e.length,u=Rl?Rl(s):new e.constructor(s);return e.copy(u),u}function ca(e){var t=new e.constructor(e.byteLength);return new mi(t).set(new mi(e)),t}function Wm(e,t){var s=t?ca(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.byteLength)}function Ym(e){var t=new e.constructor(e.source,Bo.exec(e));return t.lastIndex=e.lastIndex,t}function Qm(e){return Mr?we(Mr.call(e)):{}}function ou(e,t){var s=t?ca(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.length)}function lu(e,t){if(e!==t){var s=e!==r,u=e===null,f=e===e,h=mt(e),b=t!==r,S=t===null,N=t===t,F=mt(t);if(!S&&!F&&!h&&e>t||h&&b&&N&&!S&&!F||u&&b&&N||!s&&N||!f)return 1;if(!u&&!h&&!F&&e=S)return N;var F=s[u];return N*(F=="desc"?-1:1)}}return e.index-t.index}function uu(e,t,s,u){for(var f=-1,h=e.length,b=s.length,S=-1,N=t.length,F=Ve(h-b,0),D=A(N+F),P=!u;++S1?s[f-1]:r,b=f>2?s[2]:r;for(h=e.length>3&&typeof h=="function"?(f--,h):r,b&&rt(s[0],s[1],b)&&(h=f<3?r:h,f=1),t=we(t);++u-1?f[h?t[b]:b]:r}}function hu(e){return Yt(function(t){var s=t.length,u=s,f=St.prototype.thru;for(e&&t.reverse();u--;){var h=t[u];if(typeof h!="function")throw new wt(d);if(f&&!b&&Li(h)=="wrapper")var b=new St([],!0)}for(u=b?u:s;++u1&&fe.reverse(),D&&NS))return!1;var F=h.get(e),D=h.get(t);if(F&&D)return F==t&&D==e;var P=-1,z=!0,H=s&R?new An:r;for(h.set(e,t),h.set(t,e);++P1?"& ":"")+t[u],t=t.join(s>2?", ":" "),e.replace(mf,`{ + */ts.exports;(function(n,o){(function(){var r,a="4.17.21",l=200,c="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",d="Expected a function",m="Invalid `variable` option passed into `_.template`",p="__lodash_hash_undefined__",x=500,v="__lodash_placeholder__",j=1,y=2,_=4,E=1,R=2,L=1,M=2,$=4,q=8,V=16,D=32,k=64,W=128,te=256,U=512,ge=30,_e="...",K=800,Ee=16,ke=1,X=2,tt=3,Le=1/0,de=9007199254740991,$e=17976931348623157e292,ne=NaN,Ce=4294967295,vt=Ce-1,_r=Ce>>>1,yn=[["ary",W],["bind",L],["bindKey",M],["curry",q],["curryRight",V],["flip",U],["partial",D],["partialRight",k],["rearg",te]],$n="[object Arguments]",Jr="[object Array]",Qd="[object AsyncFunction]",br="[object Boolean]",wr="[object Date]",Yd="[object DOMException]",ei="[object Error]",ti="[object Function]",qo="[object GeneratorFunction]",At="[object Map]",Sr="[object Number]",Zd="[object Null]",Vt="[object Object]",ko="[object Promise]",Xd="[object Proxy]",jr="[object RegExp]",It="[object Set]",Cr="[object String]",ni="[object Symbol]",Jd="[object Undefined]",yr="[object WeakMap]",ef="[object WeakSet]",Nr="[object ArrayBuffer]",Bn="[object DataView]",ps="[object Float32Array]",xs="[object Float64Array]",vs="[object Int8Array]",_s="[object Int16Array]",bs="[object Int32Array]",ws="[object Uint8Array]",Ss="[object Uint8ClampedArray]",js="[object Uint16Array]",Cs="[object Uint32Array]",tf=/\b__p \+= '';/g,nf=/\b(__p \+=) '' \+/g,rf=/(__e\(.*?\)|\b__t\)) \+\n'';/g,$o=/&(?:amp|lt|gt|quot|#39);/g,Bo=/[&<>"']/g,sf=RegExp($o.source),af=RegExp(Bo.source),of=/<%-([\s\S]+?)%>/g,lf=/<%([\s\S]+?)%>/g,Uo=/<%=([\s\S]+?)%>/g,uf=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,cf=/^\w*$/,df=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ys=/[\\^$.*+?()[\]{}|]/g,ff=RegExp(ys.source),Ns=/^\s+/,gf=/\s/,mf=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,hf=/\{\n\/\* \[wrapped with (.+)\] \*/,pf=/,? & /,xf=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,vf=/[()=,{}\[\]\/\s]/,_f=/\\(\\)?/g,bf=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,zo=/\w*$/,wf=/^[-+]0x[0-9a-f]+$/i,Sf=/^0b[01]+$/i,jf=/^\[object .+?Constructor\]$/,Cf=/^0o[0-7]+$/i,yf=/^(?:0|[1-9]\d*)$/,Nf=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ri=/($^)/,Rf=/['\n\r\u2028\u2029\\]/g,ii="\\ud800-\\udfff",Ef="\\u0300-\\u036f",Af="\\ufe20-\\ufe2f",If="\\u20d0-\\u20ff",Vo=Ef+Af+If,Ho="\\u2700-\\u27bf",Go="a-z\\xdf-\\xf6\\xf8-\\xff",Ff="\\xac\\xb1\\xd7\\xf7",Mf="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Tf="\\u2000-\\u206f",Of=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ko="A-Z\\xc0-\\xd6\\xd8-\\xde",Wo="\\ufe0e\\ufe0f",Qo=Ff+Mf+Tf+Of,Rs="['’]",Df="["+ii+"]",Yo="["+Qo+"]",si="["+Vo+"]",Zo="\\d+",Lf="["+Ho+"]",Xo="["+Go+"]",Jo="[^"+ii+Qo+Zo+Ho+Go+Ko+"]",Es="\\ud83c[\\udffb-\\udfff]",Pf="(?:"+si+"|"+Es+")",el="[^"+ii+"]",As="(?:\\ud83c[\\udde6-\\uddff]){2}",Is="[\\ud800-\\udbff][\\udc00-\\udfff]",Un="["+Ko+"]",tl="\\u200d",nl="(?:"+Xo+"|"+Jo+")",qf="(?:"+Un+"|"+Jo+")",rl="(?:"+Rs+"(?:d|ll|m|re|s|t|ve))?",il="(?:"+Rs+"(?:D|LL|M|RE|S|T|VE))?",sl=Pf+"?",al="["+Wo+"]?",kf="(?:"+tl+"(?:"+[el,As,Is].join("|")+")"+al+sl+")*",$f="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Bf="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ol=al+sl+kf,Uf="(?:"+[Lf,As,Is].join("|")+")"+ol,zf="(?:"+[el+si+"?",si,As,Is,Df].join("|")+")",Vf=RegExp(Rs,"g"),Hf=RegExp(si,"g"),Fs=RegExp(Es+"(?="+Es+")|"+zf+ol,"g"),Gf=RegExp([Un+"?"+Xo+"+"+rl+"(?="+[Yo,Un,"$"].join("|")+")",qf+"+"+il+"(?="+[Yo,Un+nl,"$"].join("|")+")",Un+"?"+nl+"+"+rl,Un+"+"+il,Bf,$f,Zo,Uf].join("|"),"g"),Kf=RegExp("["+tl+ii+Vo+Wo+"]"),Wf=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Qf=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Yf=-1,ye={};ye[ps]=ye[xs]=ye[vs]=ye[_s]=ye[bs]=ye[ws]=ye[Ss]=ye[js]=ye[Cs]=!0,ye[$n]=ye[Jr]=ye[Nr]=ye[br]=ye[Bn]=ye[wr]=ye[ei]=ye[ti]=ye[At]=ye[Sr]=ye[Vt]=ye[jr]=ye[It]=ye[Cr]=ye[yr]=!1;var je={};je[$n]=je[Jr]=je[Nr]=je[Bn]=je[br]=je[wr]=je[ps]=je[xs]=je[vs]=je[_s]=je[bs]=je[At]=je[Sr]=je[Vt]=je[jr]=je[It]=je[Cr]=je[ni]=je[ws]=je[Ss]=je[js]=je[Cs]=!0,je[ei]=je[ti]=je[yr]=!1;var Zf={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Xf={"&":"&","<":"<",">":">",'"':""","'":"'"},Jf={"&":"&","<":"<",">":">",""":'"',"'":"'"},eg={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},tg=parseFloat,ng=parseInt,ll=typeof nr=="object"&&nr&&nr.Object===Object&&nr,rg=typeof self=="object"&&self&&self.Object===Object&&self,He=ll||rg||Function("return this")(),Ms=o&&!o.nodeType&&o,Nn=Ms&&!0&&n&&!n.nodeType&&n,ul=Nn&&Nn.exports===Ms,Ts=ul&&ll.process,_t=function(){try{var C=Nn&&Nn.require&&Nn.require("util").types;return C||Ts&&Ts.binding&&Ts.binding("util")}catch{}}(),cl=_t&&_t.isArrayBuffer,dl=_t&&_t.isDate,fl=_t&&_t.isMap,gl=_t&&_t.isRegExp,ml=_t&&_t.isSet,hl=_t&&_t.isTypedArray;function dt(C,I,A){switch(A.length){case 0:return C.call(I);case 1:return C.call(I,A[0]);case 2:return C.call(I,A[0],A[1]);case 3:return C.call(I,A[0],A[1],A[2])}return C.apply(I,A)}function ig(C,I,A,z){for(var re=-1,me=C==null?0:C.length;++re-1}function Os(C,I,A){for(var z=-1,re=C==null?0:C.length;++z-1;);return A}function jl(C,I){for(var A=C.length;A--&&zn(I,C[A],0)>-1;);return A}function gg(C,I){for(var A=C.length,z=0;A--;)C[A]===I&&++z;return z}var mg=qs(Zf),hg=qs(Xf);function pg(C){return"\\"+eg[C]}function xg(C,I){return C==null?r:C[I]}function Vn(C){return Kf.test(C)}function vg(C){return Wf.test(C)}function _g(C){for(var I,A=[];!(I=C.next()).done;)A.push(I.value);return A}function Us(C){var I=-1,A=Array(C.size);return C.forEach(function(z,re){A[++I]=[re,z]}),A}function Cl(C,I){return function(A){return C(I(A))}}function on(C,I){for(var A=-1,z=C.length,re=0,me=[];++A-1}function am(e,t){var s=this.__data__,u=ji(s,e);return u<0?(++this.size,s.push([e,t])):s[u][1]=t,this}Ht.prototype.clear=nm,Ht.prototype.delete=rm,Ht.prototype.get=im,Ht.prototype.has=sm,Ht.prototype.set=am;function Gt(e){var t=-1,s=e==null?0:e.length;for(this.clear();++t=t?e:t)),e}function jt(e,t,s,u,f,h){var b,S=t&j,N=t&y,F=t&_;if(s&&(b=f?s(e,u,f,h):s(e)),b!==r)return b;if(!Ae(e))return e;var T=ie(e);if(T){if(b=ch(e),!S)return st(e,b)}else{var P=Je(e),B=P==ti||P==qo;if(gn(e))return au(e,S);if(P==Vt||P==$n||B&&!f){if(b=N||B?{}:yu(e),!S)return N?Jm(e,Sm(b,e)):Xm(e,Ll(b,e))}else{if(!je[P])return f?e:{};b=dh(e,P,S)}}h||(h=new Mt);var G=h.get(e);if(G)return G;h.set(e,b),ec(e)?e.forEach(function(ee){b.add(jt(ee,t,s,ee,e,h))}):Xu(e)&&e.forEach(function(ee,ue){b.set(ue,jt(ee,t,s,ue,e,h))});var J=F?N?ma:ga:N?ot:ze,oe=T?r:J(e);return bt(oe||e,function(ee,ue){oe&&(ue=ee,ee=e[ue]),Tr(b,ue,jt(ee,t,s,ue,e,h))}),b}function jm(e){var t=ze(e);return function(s){return Pl(s,e,t)}}function Pl(e,t,s){var u=s.length;if(e==null)return!u;for(e=we(e);u--;){var f=s[u],h=t[f],b=e[f];if(b===r&&!(f in e)||!h(b))return!1}return!0}function ql(e,t,s){if(typeof e!="function")throw new wt(d);return $r(function(){e.apply(r,s)},t)}function Or(e,t,s,u){var f=-1,h=ai,b=!0,S=e.length,N=[],F=t.length;if(!S)return N;s&&(t=Re(t,ft(s))),u?(h=Os,b=!1):t.length>=l&&(h=Rr,b=!1,t=new An(t));e:for(;++ff?0:f+s),u=u===r||u>f?f:ae(u),u<0&&(u+=f),u=s>u?0:nc(u);s0&&s(S)?t>1?Ge(S,t-1,s,u,f):an(f,S):u||(f[f.length]=S)}return f}var Qs=fu(),Bl=fu(!0);function qt(e,t){return e&&Qs(e,t,ze)}function Ys(e,t){return e&&Bl(e,t,ze)}function yi(e,t){return sn(t,function(s){return Zt(e[s])})}function Fn(e,t){t=dn(t,e);for(var s=0,u=t.length;e!=null&&st}function Nm(e,t){return e!=null&&xe.call(e,t)}function Rm(e,t){return e!=null&&t in we(e)}function Em(e,t,s){return e>=Xe(t,s)&&e=120&&T.length>=120)?new An(b&&T):r}T=e[0];var P=-1,B=S[0];e:for(;++P-1;)S!==e&&pi.call(S,N,1),pi.call(e,N,1);return e}function Xl(e,t){for(var s=e?t.length:0,u=s-1;s--;){var f=t[s];if(s==u||f!==h){var h=f;Yt(f)?pi.call(e,f,1):aa(e,f)}}return e}function ra(e,t){return e+_i(Ml()*(t-e+1))}function Bm(e,t,s,u){for(var f=-1,h=Ue(vi((t-e)/(s||1)),0),b=A(h);h--;)b[u?h:++f]=e,e+=s;return b}function ia(e,t){var s="";if(!e||t<1||t>de)return s;do t%2&&(s+=e),t=_i(t/2),t&&(e+=e);while(t);return s}function le(e,t){return wa(Eu(e,t,lt),e+"")}function Um(e){return Dl(tr(e))}function zm(e,t){var s=tr(e);return Li(s,In(t,0,s.length))}function Pr(e,t,s,u){if(!Ae(e))return e;t=dn(t,e);for(var f=-1,h=t.length,b=h-1,S=e;S!=null&&++ff?0:f+t),s=s>f?f:s,s<0&&(s+=f),f=t>s?0:s-t>>>0,t>>>=0;for(var h=A(f);++u>>1,b=e[h];b!==null&&!mt(b)&&(s?b<=t:b=l){var F=t?null:rh(e);if(F)return li(F);b=!1,f=Rr,N=new An}else N=t?[]:S;e:for(;++u=u?e:Ct(e,t,s)}var su=Og||function(e){return He.clearTimeout(e)};function au(e,t){if(t)return e.slice();var s=e.length,u=Rl?Rl(s):new e.constructor(s);return e.copy(u),u}function ca(e){var t=new e.constructor(e.byteLength);return new mi(t).set(new mi(e)),t}function Wm(e,t){var s=t?ca(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.byteLength)}function Qm(e){var t=new e.constructor(e.source,zo.exec(e));return t.lastIndex=e.lastIndex,t}function Ym(e){return Mr?we(Mr.call(e)):{}}function ou(e,t){var s=t?ca(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.length)}function lu(e,t){if(e!==t){var s=e!==r,u=e===null,f=e===e,h=mt(e),b=t!==r,S=t===null,N=t===t,F=mt(t);if(!S&&!F&&!h&&e>t||h&&b&&N&&!S&&!F||u&&b&&N||!s&&N||!f)return 1;if(!u&&!h&&!F&&e=S)return N;var F=s[u];return N*(F=="desc"?-1:1)}}return e.index-t.index}function uu(e,t,s,u){for(var f=-1,h=e.length,b=s.length,S=-1,N=t.length,F=Ue(h-b,0),T=A(N+F),P=!u;++S1?s[f-1]:r,b=f>2?s[2]:r;for(h=e.length>3&&typeof h=="function"?(f--,h):r,b&&rt(s[0],s[1],b)&&(h=f<3?r:h,f=1),t=we(t);++u-1?f[h?t[b]:b]:r}}function hu(e){return Qt(function(t){var s=t.length,u=s,f=St.prototype.thru;for(e&&t.reverse();u--;){var h=t[u];if(typeof h!="function")throw new wt(d);if(f&&!b&&Oi(h)=="wrapper")var b=new St([],!0)}for(u=b?u:s;++u1&&fe.reverse(),T&&NS))return!1;var F=h.get(e),T=h.get(t);if(F&&T)return F==t&&T==e;var P=-1,B=!0,G=s&R?new An:r;for(h.set(e,t),h.set(t,e);++P1?"& ":"")+t[u],t=t.join(s>2?", ":" "),e.replace(mf,`{ /* [wrapped with `+t+`] */ -`)}function gh(e){return ie(e)||Ln(e)||!!(Il&&e&&e[Il])}function Qt(e,t){var s=typeof e;return t=t??de,!!t&&(s=="number"||s!="symbol"&&yf.test(e))&&e>-1&&e%1==0&&e0){if(++t>=K)return arguments[0]}else t=0;return e.apply(r,arguments)}}function Oi(e,t){var s=-1,u=e.length,f=u-1;for(t=t===r?u:t;++s1?e[t-1]:r;return s=typeof s=="function"?(e.pop(),s):r,$u(e,s)});function zu(e){var t=g(e);return t.__chain__=!0,t}function Cp(e,t){return t(e),e}function Pi(e,t){return t(e)}var yp=Yt(function(e){var t=e.length,s=t?e[0]:0,u=this.__wrapped__,f=function(h){return Ws(h,e)};return t>1||this.__actions__.length||!(u instanceof ce)||!Qt(s)?this.thru(f):(u=u.slice(s,+s+(t?1:0)),u.__actions__.push({func:Pi,args:[f],thisArg:r}),new St(u,this.__chain__).thru(function(h){return t&&!h.length&&h.push(r),h}))});function Np(){return zu(this)}function Rp(){return new St(this.value(),this.__chain__)}function Ep(){this.__values__===r&&(this.__values__=tc(this.value()));var e=this.__index__>=this.__values__.length,t=e?r:this.__values__[this.__index__++];return{done:e,value:t}}function Ap(){return this}function Ip(e){for(var t,s=this;s instanceof Si;){var u=Lu(s);u.__index__=0,u.__values__=r,t?f.__wrapped__=u:t=u;var f=u;s=s.__wrapped__}return f.__wrapped__=e,t}function Fp(){var e=this.__wrapped__;if(e instanceof ce){var t=e;return this.__actions__.length&&(t=new ce(this)),t=t.reverse(),t.__actions__.push({func:Pi,args:[Sa],thisArg:r}),new St(t,this.__chain__)}return this.thru(Sa)}function Mp(){return ru(this.__wrapped__,this.__actions__)}var Dp=Ai(function(e,t,s){xe.call(e,s)?++e[s]:Kt(e,s,1)});function Lp(e,t,s){var u=ie(e)?pl:Cm;return s&&rt(e,t,s)&&(t=r),u(e,Y(t,3))}function Tp(e,t){var s=ie(e)?sn:$l;return s(e,Y(t,3))}var Op=mu(Tu),Pp=mu(Ou);function qp(e,t){return He(qi(e,t),1)}function kp(e,t){return He(qi(e,t),Oe)}function $p(e,t,s){return s=s===r?1:ae(s),He(qi(e,t),s)}function Vu(e,t){var s=ie(e)?bt:un;return s(e,Y(t,3))}function Bu(e,t){var s=ie(e)?sg:kl;return s(e,Y(t,3))}var zp=Ai(function(e,t,s){xe.call(e,s)?e[s].push(t):Kt(e,s,[t])});function Vp(e,t,s,u){e=at(e)?e:tr(e),s=s&&!u?ae(s):0;var f=e.length;return s<0&&(s=Ve(f+s,0)),Bi(e)?s<=f&&e.indexOf(t,s)>-1:!!f&&Bn(e,t,s)>-1}var Bp=le(function(e,t,s){var u=-1,f=typeof t=="function",h=at(e)?A(e.length):[];return un(e,function(b){h[++u]=f?dt(t,b,s):Tr(b,t,s)}),h}),Up=Ai(function(e,t,s){Kt(e,s,t)});function qi(e,t){var s=ie(e)?Re:Hl;return s(e,Y(t,3))}function Gp(e,t,s,u){return e==null?[]:(ie(t)||(t=t==null?[]:[t]),s=u?r:s,ie(s)||(s=s==null?[]:[s]),Ql(e,t,s))}var Hp=Ai(function(e,t,s){e[s?0:1].push(t)},function(){return[[],[]]});function Kp(e,t,s){var u=ie(e)?Ts:bl,f=arguments.length<3;return u(e,Y(t,4),s,f,un)}function Wp(e,t,s){var u=ie(e)?ag:bl,f=arguments.length<3;return u(e,Y(t,4),s,f,kl)}function Yp(e,t){var s=ie(e)?sn:$l;return s(e,zi(Y(t,3)))}function Qp(e){var t=ie(e)?Tl:Vm;return t(e)}function Xp(e,t,s){(s?rt(e,t,s):t===r)?t=1:t=ae(t);var u=ie(e)?_m:Bm;return u(e,t)}function Zp(e){var t=ie(e)?bm:Gm;return t(e)}function Jp(e){if(e==null)return 0;if(at(e))return Bi(e)?Gn(e):e.length;var t=Je(e);return t==At||t==It?e.size:ea(e).length}function ex(e,t,s){var u=ie(e)?Os:Hm;return s&&rt(e,t,s)&&(t=r),u(e,Y(t,3))}var tx=le(function(e,t){if(e==null)return[];var s=t.length;return s>1&&rt(e,t[0],t[1])?t=[]:s>2&&rt(t[0],t[1],t[2])&&(t=[t[0]]),Ql(e,He(t,1),[])}),ki=Tg||function(){return Ge.Date.now()};function nx(e,t){if(typeof t!="function")throw new wt(d);return e=ae(e),function(){if(--e<1)return t.apply(this,arguments)}}function Uu(e,t,s){return t=s?r:t,t=e&&t==null?e.length:t,Wt(e,W,r,r,r,r,t)}function Gu(e,t){var s;if(typeof t!="function")throw new wt(d);return e=ae(e),function(){return--e>0&&(s=t.apply(this,arguments)),e<=1&&(t=r),s}}var Ca=le(function(e,t,s){var u=O;if(s.length){var f=on(s,Jn(Ca));u|=T}return Wt(e,u,t,s,f)}),Hu=le(function(e,t,s){var u=O|M;if(s.length){var f=on(s,Jn(Hu));u|=T}return Wt(t,u,e,s,f)});function Ku(e,t,s){t=s?r:t;var u=Wt(e,q,r,r,r,r,r,t);return u.placeholder=Ku.placeholder,u}function Wu(e,t,s){t=s?r:t;var u=Wt(e,U,r,r,r,r,r,t);return u.placeholder=Wu.placeholder,u}function Yu(e,t,s){var u,f,h,b,S,N,F=0,D=!1,P=!1,z=!0;if(typeof e!="function")throw new wt(d);t=Nt(t)||0,Ae(s)&&(D=!!s.leading,P="maxWait"in s,h=P?Ve(Nt(s.maxWait)||0,t):h,z="trailing"in s?!!s.trailing:z);function H(De){var Lt=u,Jt=f;return u=f=r,F=De,b=e.apply(Jt,Lt),b}function J(De){return F=De,S=$r(ue,t),D?H(De):b}function oe(De){var Lt=De-N,Jt=De-F,mc=t-Lt;return P?Ze(mc,h-Jt):mc}function ee(De){var Lt=De-N,Jt=De-F;return N===r||Lt>=t||Lt<0||P&&Jt>=h}function ue(){var De=ki();if(ee(De))return fe(De);S=$r(ue,oe(De))}function fe(De){return S=r,z&&u?H(De):(u=f=r,b)}function ht(){S!==r&&su(S),F=0,u=N=f=S=r}function it(){return S===r?b:fe(ki())}function pt(){var De=ki(),Lt=ee(De);if(u=arguments,f=this,N=De,Lt){if(S===r)return J(N);if(P)return su(S),S=$r(ue,t),H(N)}return S===r&&(S=$r(ue,t)),b}return pt.cancel=ht,pt.flush=it,pt}var rx=le(function(e,t){return ql(e,1,t)}),ix=le(function(e,t,s){return ql(e,Nt(t)||0,s)});function sx(e){return Wt(e,V)}function $i(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new wt(d);var s=function(){var u=arguments,f=t?t.apply(this,u):u[0],h=s.cache;if(h.has(f))return h.get(f);var b=e.apply(this,u);return s.cache=h.set(f,b)||h,b};return s.cache=new($i.Cache||Ht),s}$i.Cache=Ht;function zi(e){if(typeof e!="function")throw new wt(d);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function ax(e){return Gu(2,e)}var ox=Km(function(e,t){t=t.length==1&&ie(t[0])?Re(t[0],ft(Y())):Re(He(t,1),ft(Y()));var s=t.length;return le(function(u){for(var f=-1,h=Ze(u.length,s);++f=t}),Ln=Bl(function(){return arguments}())?Bl:function(e){return Ie(e)&&xe.call(e,"callee")&&!Al.call(e,"callee")},ie=A.isArray,Sx=cl?ft(cl):Im;function at(e){return e!=null&&Vi(e.length)&&!Xt(e)}function Me(e){return Ie(e)&&at(e)}function jx(e){return e===!0||e===!1||Ie(e)&&nt(e)==br}var gn=Pg||Oa,Cx=dl?ft(dl):Fm;function yx(e){return Ie(e)&&e.nodeType===1&&!zr(e)}function Nx(e){if(e==null)return!0;if(at(e)&&(ie(e)||typeof e=="string"||typeof e.splice=="function"||gn(e)||er(e)||Ln(e)))return!e.length;var t=Je(e);if(t==At||t==It)return!e.size;if(kr(e))return!ea(e).length;for(var s in e)if(xe.call(e,s))return!1;return!0}function Rx(e,t){return Or(e,t)}function Ex(e,t,s){s=typeof s=="function"?s:r;var u=s?s(e,t):r;return u===r?Or(e,t,r,s):!!u}function Na(e){if(!Ie(e))return!1;var t=nt(e);return t==ei||t==Qd||typeof e.message=="string"&&typeof e.name=="string"&&!zr(e)}function Ax(e){return typeof e=="number"&&Fl(e)}function Xt(e){if(!Ae(e))return!1;var t=nt(e);return t==ti||t==qo||t==Yd||t==Zd}function Xu(e){return typeof e=="number"&&e==ae(e)}function Vi(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=de}function Ae(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function Ie(e){return e!=null&&typeof e=="object"}var Zu=fl?ft(fl):Dm;function Ix(e,t){return e===t||Js(e,t,pa(t))}function Fx(e,t,s){return s=typeof s=="function"?s:r,Js(e,t,pa(t),s)}function Mx(e){return Ju(e)&&e!=+e}function Dx(e){if(ph(e))throw new re(c);return Ul(e)}function Lx(e){return e===null}function Tx(e){return e==null}function Ju(e){return typeof e=="number"||Ie(e)&&nt(e)==Sr}function zr(e){if(!Ie(e)||nt(e)!=Ut)return!1;var t=hi(e);if(t===null)return!0;var s=xe.call(t,"constructor")&&t.constructor;return typeof s=="function"&&s instanceof s&&di.call(s)==Fg}var Ra=gl?ft(gl):Lm;function Ox(e){return Xu(e)&&e>=-9007199254740991&&e<=de}var ec=ml?ft(ml):Tm;function Bi(e){return typeof e=="string"||!ie(e)&&Ie(e)&&nt(e)==Cr}function mt(e){return typeof e=="symbol"||Ie(e)&&nt(e)==ni}var er=hl?ft(hl):Om;function Px(e){return e===r}function qx(e){return Ie(e)&&Je(e)==yr}function kx(e){return Ie(e)&&nt(e)==ef}var $x=Di(ta),zx=Di(function(e,t){return e<=t});function tc(e){if(!e)return[];if(at(e))return Bi(e)?Ft(e):st(e);if(Er&&e[Er])return _g(e[Er]());var t=Je(e),s=t==At?Vs:t==It?li:tr;return s(e)}function Zt(e){if(!e)return e===0?e:0;if(e=Nt(e),e===Oe||e===-1/0){var t=e<0?-1:1;return t*$e}return e===e?e:0}function ae(e){var t=Zt(e),s=t%1;return t===t?s?t-s:t:0}function nc(e){return e?In(ae(e),0,Ce):0}function Nt(e){if(typeof e=="number")return e;if(mt(e))return ne;if(Ae(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ae(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=wl(e);var s=Sf.test(e);return s||Cf.test(e)?ng(e.slice(2),s?2:8):wf.test(e)?ne:+e}function rc(e){return kt(e,ot(e))}function Vx(e){return e?In(ae(e),-9007199254740991,de):e===0?e:0}function pe(e){return e==null?"":gt(e)}var Bx=Xn(function(e,t){if(kr(t)||at(t)){kt(t,Be(t),e);return}for(var s in t)xe.call(t,s)&&Dr(e,s,t[s])}),ic=Xn(function(e,t){kt(t,ot(t),e)}),Ui=Xn(function(e,t,s,u){kt(t,ot(t),e,u)}),Ux=Xn(function(e,t,s,u){kt(t,Be(t),e,u)}),Gx=Yt(Ws);function Hx(e,t){var s=Qn(e);return t==null?s:Ol(s,t)}var Kx=le(function(e,t){e=we(e);var s=-1,u=t.length,f=u>2?t[2]:r;for(f&&rt(t[0],t[1],f)&&(u=1);++s1),h}),kt(e,ma(e),s),u&&(s=jt(s,j|y|_,ih));for(var f=t.length;f--;)aa(s,t[f]);return s});function dv(e,t){return ac(e,zi(Y(t)))}var fv=Yt(function(e,t){return e==null?{}:km(e,t)});function ac(e,t){if(e==null)return{};var s=Re(ma(e),function(u){return[u]});return t=Y(t),Xl(e,s,function(u,f){return t(u,f[0])})}function gv(e,t,s){t=dn(t,e);var u=-1,f=t.length;for(f||(f=1,e=r);++ut){var u=e;e=t,t=u}if(s||e%1||t%1){var f=Ml();return Ze(e+f*(t-e+tg("1e-"+((f+"").length-1))),t)}return ra(e,t)}var Cv=Zn(function(e,t,s){return t=t.toLowerCase(),e+(s?uc(t):t)});function uc(e){return Ia(pe(e).toLowerCase())}function cc(e){return e=pe(e),e&&e.replace(Nf,mg).replace(Gf,"")}function yv(e,t,s){e=pe(e),t=gt(t);var u=e.length;s=s===r?u:In(ae(s),0,u);var f=s;return s-=t.length,s>=0&&e.slice(s,f)==t}function Nv(e){return e=pe(e),e&&af.test(e)?e.replace(zo,hg):e}function Rv(e){return e=pe(e),e&&ff.test(e)?e.replace(ys,"\\$&"):e}var Ev=Zn(function(e,t,s){return e+(s?"-":"")+t.toLowerCase()}),Av=Zn(function(e,t,s){return e+(s?" ":"")+t.toLowerCase()}),Iv=gu("toLowerCase");function Fv(e,t,s){e=pe(e),t=ae(t);var u=t?Gn(e):0;if(!t||u>=t)return e;var f=(t-u)/2;return Mi(_i(f),s)+e+Mi(vi(f),s)}function Mv(e,t,s){e=pe(e),t=ae(t);var u=t?Gn(e):0;return t&&u>>0,s?(e=pe(e),e&&(typeof t=="string"||t!=null&&!Ra(t))&&(t=gt(t),!t&&Un(e))?fn(Ft(e),0,s):e.split(t,s)):[]}var kv=Zn(function(e,t,s){return e+(s?" ":"")+Ia(t)});function $v(e,t,s){return e=pe(e),s=s==null?0:In(ae(s),0,e.length),t=gt(t),e.slice(s,s+t.length)==t}function zv(e,t,s){var u=g.templateSettings;s&&rt(e,t,s)&&(t=r),e=pe(e),t=Ui({},t,u,bu);var f=Ui({},t.imports,u.imports,bu),h=Be(f),b=zs(f,h),S,N,F=0,D=t.interpolate||ri,P="__p += '",z=Bs((t.escape||ri).source+"|"+D.source+"|"+(D===Vo?bf:ri).source+"|"+(t.evaluate||ri).source+"|$","g"),H="//# sourceURL="+(xe.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Qf+"]")+` -`;e.replace(z,function(ee,ue,fe,ht,it,pt){return fe||(fe=ht),P+=e.slice(F,pt).replace(Rf,pg),ue&&(S=!0,P+=`' + +`)}function gh(e){return ie(e)||On(e)||!!(Il&&e&&e[Il])}function Yt(e,t){var s=typeof e;return t=t??de,!!t&&(s=="number"||s!="symbol"&&yf.test(e))&&e>-1&&e%1==0&&e0){if(++t>=K)return arguments[0]}else t=0;return e.apply(r,arguments)}}function Li(e,t){var s=-1,u=e.length,f=u-1;for(t=t===r?u:t;++s1?e[t-1]:r;return s=typeof s=="function"?(e.pop(),s):r,$u(e,s)});function Bu(e){var t=g(e);return t.__chain__=!0,t}function Cp(e,t){return t(e),e}function Pi(e,t){return t(e)}var yp=Qt(function(e){var t=e.length,s=t?e[0]:0,u=this.__wrapped__,f=function(h){return Ws(h,e)};return t>1||this.__actions__.length||!(u instanceof ce)||!Yt(s)?this.thru(f):(u=u.slice(s,+s+(t?1:0)),u.__actions__.push({func:Pi,args:[f],thisArg:r}),new St(u,this.__chain__).thru(function(h){return t&&!h.length&&h.push(r),h}))});function Np(){return Bu(this)}function Rp(){return new St(this.value(),this.__chain__)}function Ep(){this.__values__===r&&(this.__values__=tc(this.value()));var e=this.__index__>=this.__values__.length,t=e?r:this.__values__[this.__index__++];return{done:e,value:t}}function Ap(){return this}function Ip(e){for(var t,s=this;s instanceof Si;){var u=Ou(s);u.__index__=0,u.__values__=r,t?f.__wrapped__=u:t=u;var f=u;s=s.__wrapped__}return f.__wrapped__=e,t}function Fp(){var e=this.__wrapped__;if(e instanceof ce){var t=e;return this.__actions__.length&&(t=new ce(this)),t=t.reverse(),t.__actions__.push({func:Pi,args:[Sa],thisArg:r}),new St(t,this.__chain__)}return this.thru(Sa)}function Mp(){return ru(this.__wrapped__,this.__actions__)}var Tp=Ai(function(e,t,s){xe.call(e,s)?++e[s]:Kt(e,s,1)});function Op(e,t,s){var u=ie(e)?pl:Cm;return s&&rt(e,t,s)&&(t=r),u(e,Q(t,3))}function Dp(e,t){var s=ie(e)?sn:$l;return s(e,Q(t,3))}var Lp=mu(Du),Pp=mu(Lu);function qp(e,t){return Ge(qi(e,t),1)}function kp(e,t){return Ge(qi(e,t),Le)}function $p(e,t,s){return s=s===r?1:ae(s),Ge(qi(e,t),s)}function Uu(e,t){var s=ie(e)?bt:un;return s(e,Q(t,3))}function zu(e,t){var s=ie(e)?sg:kl;return s(e,Q(t,3))}var Bp=Ai(function(e,t,s){xe.call(e,s)?e[s].push(t):Kt(e,s,[t])});function Up(e,t,s,u){e=at(e)?e:tr(e),s=s&&!u?ae(s):0;var f=e.length;return s<0&&(s=Ue(f+s,0)),zi(e)?s<=f&&e.indexOf(t,s)>-1:!!f&&zn(e,t,s)>-1}var zp=le(function(e,t,s){var u=-1,f=typeof t=="function",h=at(e)?A(e.length):[];return un(e,function(b){h[++u]=f?dt(t,b,s):Dr(b,t,s)}),h}),Vp=Ai(function(e,t,s){Kt(e,s,t)});function qi(e,t){var s=ie(e)?Re:Gl;return s(e,Q(t,3))}function Hp(e,t,s,u){return e==null?[]:(ie(t)||(t=t==null?[]:[t]),s=u?r:s,ie(s)||(s=s==null?[]:[s]),Yl(e,t,s))}var Gp=Ai(function(e,t,s){e[s?0:1].push(t)},function(){return[[],[]]});function Kp(e,t,s){var u=ie(e)?Ds:bl,f=arguments.length<3;return u(e,Q(t,4),s,f,un)}function Wp(e,t,s){var u=ie(e)?ag:bl,f=arguments.length<3;return u(e,Q(t,4),s,f,kl)}function Qp(e,t){var s=ie(e)?sn:$l;return s(e,Bi(Q(t,3)))}function Yp(e){var t=ie(e)?Dl:Um;return t(e)}function Zp(e,t,s){(s?rt(e,t,s):t===r)?t=1:t=ae(t);var u=ie(e)?_m:zm;return u(e,t)}function Xp(e){var t=ie(e)?bm:Hm;return t(e)}function Jp(e){if(e==null)return 0;if(at(e))return zi(e)?Hn(e):e.length;var t=Je(e);return t==At||t==It?e.size:ea(e).length}function ex(e,t,s){var u=ie(e)?Ls:Gm;return s&&rt(e,t,s)&&(t=r),u(e,Q(t,3))}var tx=le(function(e,t){if(e==null)return[];var s=t.length;return s>1&&rt(e,t[0],t[1])?t=[]:s>2&&rt(t[0],t[1],t[2])&&(t=[t[0]]),Yl(e,Ge(t,1),[])}),ki=Dg||function(){return He.Date.now()};function nx(e,t){if(typeof t!="function")throw new wt(d);return e=ae(e),function(){if(--e<1)return t.apply(this,arguments)}}function Vu(e,t,s){return t=s?r:t,t=e&&t==null?e.length:t,Wt(e,W,r,r,r,r,t)}function Hu(e,t){var s;if(typeof t!="function")throw new wt(d);return e=ae(e),function(){return--e>0&&(s=t.apply(this,arguments)),e<=1&&(t=r),s}}var Ca=le(function(e,t,s){var u=L;if(s.length){var f=on(s,Jn(Ca));u|=D}return Wt(e,u,t,s,f)}),Gu=le(function(e,t,s){var u=L|M;if(s.length){var f=on(s,Jn(Gu));u|=D}return Wt(t,u,e,s,f)});function Ku(e,t,s){t=s?r:t;var u=Wt(e,q,r,r,r,r,r,t);return u.placeholder=Ku.placeholder,u}function Wu(e,t,s){t=s?r:t;var u=Wt(e,V,r,r,r,r,r,t);return u.placeholder=Wu.placeholder,u}function Qu(e,t,s){var u,f,h,b,S,N,F=0,T=!1,P=!1,B=!0;if(typeof e!="function")throw new wt(d);t=Nt(t)||0,Ae(s)&&(T=!!s.leading,P="maxWait"in s,h=P?Ue(Nt(s.maxWait)||0,t):h,B="trailing"in s?!!s.trailing:B);function G(Te){var Ot=u,Jt=f;return u=f=r,F=Te,b=e.apply(Jt,Ot),b}function J(Te){return F=Te,S=$r(ue,t),T?G(Te):b}function oe(Te){var Ot=Te-N,Jt=Te-F,mc=t-Ot;return P?Xe(mc,h-Jt):mc}function ee(Te){var Ot=Te-N,Jt=Te-F;return N===r||Ot>=t||Ot<0||P&&Jt>=h}function ue(){var Te=ki();if(ee(Te))return fe(Te);S=$r(ue,oe(Te))}function fe(Te){return S=r,B&&u?G(Te):(u=f=r,b)}function ht(){S!==r&&su(S),F=0,u=N=f=S=r}function it(){return S===r?b:fe(ki())}function pt(){var Te=ki(),Ot=ee(Te);if(u=arguments,f=this,N=Te,Ot){if(S===r)return J(N);if(P)return su(S),S=$r(ue,t),G(N)}return S===r&&(S=$r(ue,t)),b}return pt.cancel=ht,pt.flush=it,pt}var rx=le(function(e,t){return ql(e,1,t)}),ix=le(function(e,t,s){return ql(e,Nt(t)||0,s)});function sx(e){return Wt(e,U)}function $i(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new wt(d);var s=function(){var u=arguments,f=t?t.apply(this,u):u[0],h=s.cache;if(h.has(f))return h.get(f);var b=e.apply(this,u);return s.cache=h.set(f,b)||h,b};return s.cache=new($i.Cache||Gt),s}$i.Cache=Gt;function Bi(e){if(typeof e!="function")throw new wt(d);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function ax(e){return Hu(2,e)}var ox=Km(function(e,t){t=t.length==1&&ie(t[0])?Re(t[0],ft(Q())):Re(Ge(t,1),ft(Q()));var s=t.length;return le(function(u){for(var f=-1,h=Xe(u.length,s);++f=t}),On=zl(function(){return arguments}())?zl:function(e){return Ie(e)&&xe.call(e,"callee")&&!Al.call(e,"callee")},ie=A.isArray,Sx=cl?ft(cl):Im;function at(e){return e!=null&&Ui(e.length)&&!Zt(e)}function Me(e){return Ie(e)&&at(e)}function jx(e){return e===!0||e===!1||Ie(e)&&nt(e)==br}var gn=Pg||La,Cx=dl?ft(dl):Fm;function yx(e){return Ie(e)&&e.nodeType===1&&!Br(e)}function Nx(e){if(e==null)return!0;if(at(e)&&(ie(e)||typeof e=="string"||typeof e.splice=="function"||gn(e)||er(e)||On(e)))return!e.length;var t=Je(e);if(t==At||t==It)return!e.size;if(kr(e))return!ea(e).length;for(var s in e)if(xe.call(e,s))return!1;return!0}function Rx(e,t){return Lr(e,t)}function Ex(e,t,s){s=typeof s=="function"?s:r;var u=s?s(e,t):r;return u===r?Lr(e,t,r,s):!!u}function Na(e){if(!Ie(e))return!1;var t=nt(e);return t==ei||t==Yd||typeof e.message=="string"&&typeof e.name=="string"&&!Br(e)}function Ax(e){return typeof e=="number"&&Fl(e)}function Zt(e){if(!Ae(e))return!1;var t=nt(e);return t==ti||t==qo||t==Qd||t==Xd}function Zu(e){return typeof e=="number"&&e==ae(e)}function Ui(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=de}function Ae(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function Ie(e){return e!=null&&typeof e=="object"}var Xu=fl?ft(fl):Tm;function Ix(e,t){return e===t||Js(e,t,pa(t))}function Fx(e,t,s){return s=typeof s=="function"?s:r,Js(e,t,pa(t),s)}function Mx(e){return Ju(e)&&e!=+e}function Tx(e){if(ph(e))throw new re(c);return Vl(e)}function Ox(e){return e===null}function Dx(e){return e==null}function Ju(e){return typeof e=="number"||Ie(e)&&nt(e)==Sr}function Br(e){if(!Ie(e)||nt(e)!=Vt)return!1;var t=hi(e);if(t===null)return!0;var s=xe.call(t,"constructor")&&t.constructor;return typeof s=="function"&&s instanceof s&&di.call(s)==Fg}var Ra=gl?ft(gl):Om;function Lx(e){return Zu(e)&&e>=-9007199254740991&&e<=de}var ec=ml?ft(ml):Dm;function zi(e){return typeof e=="string"||!ie(e)&&Ie(e)&&nt(e)==Cr}function mt(e){return typeof e=="symbol"||Ie(e)&&nt(e)==ni}var er=hl?ft(hl):Lm;function Px(e){return e===r}function qx(e){return Ie(e)&&Je(e)==yr}function kx(e){return Ie(e)&&nt(e)==ef}var $x=Ti(ta),Bx=Ti(function(e,t){return e<=t});function tc(e){if(!e)return[];if(at(e))return zi(e)?Ft(e):st(e);if(Er&&e[Er])return _g(e[Er]());var t=Je(e),s=t==At?Us:t==It?li:tr;return s(e)}function Xt(e){if(!e)return e===0?e:0;if(e=Nt(e),e===Le||e===-1/0){var t=e<0?-1:1;return t*$e}return e===e?e:0}function ae(e){var t=Xt(e),s=t%1;return t===t?s?t-s:t:0}function nc(e){return e?In(ae(e),0,Ce):0}function Nt(e){if(typeof e=="number")return e;if(mt(e))return ne;if(Ae(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ae(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=wl(e);var s=Sf.test(e);return s||Cf.test(e)?ng(e.slice(2),s?2:8):wf.test(e)?ne:+e}function rc(e){return kt(e,ot(e))}function Ux(e){return e?In(ae(e),-9007199254740991,de):e===0?e:0}function pe(e){return e==null?"":gt(e)}var zx=Zn(function(e,t){if(kr(t)||at(t)){kt(t,ze(t),e);return}for(var s in t)xe.call(t,s)&&Tr(e,s,t[s])}),ic=Zn(function(e,t){kt(t,ot(t),e)}),Vi=Zn(function(e,t,s,u){kt(t,ot(t),e,u)}),Vx=Zn(function(e,t,s,u){kt(t,ze(t),e,u)}),Hx=Qt(Ws);function Gx(e,t){var s=Yn(e);return t==null?s:Ll(s,t)}var Kx=le(function(e,t){e=we(e);var s=-1,u=t.length,f=u>2?t[2]:r;for(f&&rt(t[0],t[1],f)&&(u=1);++s1),h}),kt(e,ma(e),s),u&&(s=jt(s,j|y|_,ih));for(var f=t.length;f--;)aa(s,t[f]);return s});function dv(e,t){return ac(e,Bi(Q(t)))}var fv=Qt(function(e,t){return e==null?{}:km(e,t)});function ac(e,t){if(e==null)return{};var s=Re(ma(e),function(u){return[u]});return t=Q(t),Zl(e,s,function(u,f){return t(u,f[0])})}function gv(e,t,s){t=dn(t,e);var u=-1,f=t.length;for(f||(f=1,e=r);++ut){var u=e;e=t,t=u}if(s||e%1||t%1){var f=Ml();return Xe(e+f*(t-e+tg("1e-"+((f+"").length-1))),t)}return ra(e,t)}var Cv=Xn(function(e,t,s){return t=t.toLowerCase(),e+(s?uc(t):t)});function uc(e){return Ia(pe(e).toLowerCase())}function cc(e){return e=pe(e),e&&e.replace(Nf,mg).replace(Hf,"")}function yv(e,t,s){e=pe(e),t=gt(t);var u=e.length;s=s===r?u:In(ae(s),0,u);var f=s;return s-=t.length,s>=0&&e.slice(s,f)==t}function Nv(e){return e=pe(e),e&&af.test(e)?e.replace(Bo,hg):e}function Rv(e){return e=pe(e),e&&ff.test(e)?e.replace(ys,"\\$&"):e}var Ev=Xn(function(e,t,s){return e+(s?"-":"")+t.toLowerCase()}),Av=Xn(function(e,t,s){return e+(s?" ":"")+t.toLowerCase()}),Iv=gu("toLowerCase");function Fv(e,t,s){e=pe(e),t=ae(t);var u=t?Hn(e):0;if(!t||u>=t)return e;var f=(t-u)/2;return Mi(_i(f),s)+e+Mi(vi(f),s)}function Mv(e,t,s){e=pe(e),t=ae(t);var u=t?Hn(e):0;return t&&u>>0,s?(e=pe(e),e&&(typeof t=="string"||t!=null&&!Ra(t))&&(t=gt(t),!t&&Vn(e))?fn(Ft(e),0,s):e.split(t,s)):[]}var kv=Xn(function(e,t,s){return e+(s?" ":"")+Ia(t)});function $v(e,t,s){return e=pe(e),s=s==null?0:In(ae(s),0,e.length),t=gt(t),e.slice(s,s+t.length)==t}function Bv(e,t,s){var u=g.templateSettings;s&&rt(e,t,s)&&(t=r),e=pe(e),t=Vi({},t,u,bu);var f=Vi({},t.imports,u.imports,bu),h=ze(f),b=Bs(f,h),S,N,F=0,T=t.interpolate||ri,P="__p += '",B=zs((t.escape||ri).source+"|"+T.source+"|"+(T===Uo?bf:ri).source+"|"+(t.evaluate||ri).source+"|$","g"),G="//# sourceURL="+(xe.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Yf+"]")+` +`;e.replace(B,function(ee,ue,fe,ht,it,pt){return fe||(fe=ht),P+=e.slice(F,pt).replace(Rf,pg),ue&&(S=!0,P+=`' + __e(`+ue+`) + '`),it&&(N=!0,P+=`'; `+it+`; @@ -170,7 +170,49 @@ __p += '`),fe&&(P+=`' + function print() { __p += __j.call(arguments, '') } `:`; `)+P+`return __p -}`;var oe=fc(function(){return me(h,H+"return "+P).apply(r,b)});if(oe.source=P,Na(oe))throw oe;return oe}function Vv(e){return pe(e).toLowerCase()}function Bv(e){return pe(e).toUpperCase()}function Uv(e,t,s){if(e=pe(e),e&&(s||t===r))return wl(e);if(!e||!(t=gt(t)))return e;var u=Ft(e),f=Ft(t),h=Sl(u,f),b=jl(u,f)+1;return fn(u,h,b).join("")}function Gv(e,t,s){if(e=pe(e),e&&(s||t===r))return e.slice(0,yl(e)+1);if(!e||!(t=gt(t)))return e;var u=Ft(e),f=jl(u,Ft(t))+1;return fn(u,0,f).join("")}function Hv(e,t,s){if(e=pe(e),e&&(s||t===r))return e.replace(Ns,"");if(!e||!(t=gt(t)))return e;var u=Ft(e),f=Sl(u,Ft(t));return fn(u,f).join("")}function Kv(e,t){var s=ge,u=_e;if(Ae(t)){var f="separator"in t?t.separator:f;s="length"in t?ae(t.length):s,u="omission"in t?gt(t.omission):u}e=pe(e);var h=e.length;if(Un(e)){var b=Ft(e);h=b.length}if(s>=h)return e;var S=s-Gn(u);if(S<1)return u;var N=b?fn(b,0,S).join(""):e.slice(0,S);if(f===r)return N+u;if(b&&(S+=N.length-S),Ra(f)){if(e.slice(S).search(f)){var F,D=N;for(f.global||(f=Bs(f.source,pe(Bo.exec(f))+"g")),f.lastIndex=0;F=f.exec(D);)var P=F.index;N=N.slice(0,P===r?S:P)}}else if(e.indexOf(gt(f),S)!=S){var z=N.lastIndexOf(f);z>-1&&(N=N.slice(0,z))}return N+u}function Wv(e){return e=pe(e),e&&sf.test(e)?e.replace($o,jg):e}var Yv=Zn(function(e,t,s){return e+(s?" ":"")+t.toUpperCase()}),Ia=gu("toUpperCase");function dc(e,t,s){return e=pe(e),t=s?r:t,t===r?vg(e)?Ng(e):ug(e):e.match(t)||[]}var fc=le(function(e,t){try{return dt(e,r,t)}catch(s){return Na(s)?s:new re(s)}}),Qv=Yt(function(e,t){return bt(t,function(s){s=$t(s),Kt(e,s,Ca(e[s],e))}),e});function Xv(e){var t=e==null?0:e.length,s=Y();return e=t?Re(e,function(u){if(typeof u[1]!="function")throw new wt(d);return[s(u[0]),u[1]]}):[],le(function(u){for(var f=-1;++fde)return[];var s=Ce,u=Ze(e,Ce);t=Y(t),e-=Ce;for(var f=$s(u,t);++s0||t<0)?new ce(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)},ce.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},ce.prototype.toArray=function(){return this.take(Ce)},qt(ce.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],h=u||/^find/.test(t);f&&(g.prototype[t]=function(){var b=this.__wrapped__,S=u?[1]:arguments,N=b instanceof ce,F=S[0],D=N||ie(b),P=function(ue){var fe=f.apply(g,an([ue],S));return u&&z?fe[0]:fe};D&&s&&typeof F=="function"&&F.length!=1&&(N=D=!1);var z=this.__chain__,H=!!this.__actions__.length,J=h&&!z,oe=N&&!H;if(!h&&D){b=oe?b:new ce(this);var ee=e.apply(b,S);return ee.__actions__.push({func:Pi,args:[P],thisArg:r}),new St(ee,z)}return J&&oe?e.apply(this,S):(ee=this.thru(P),J?u?ee.value()[0]:ee.value():ee)})}),bt(["pop","push","shift","sort","splice","unshift"],function(e){var t=ui[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 h=this.value();return t.apply(ie(h)?h:[],f)}return this[s](function(b){return t.apply(ie(b)?b:[],f)})}}),qt(ce.prototype,function(e,t){var s=g[t];if(s){var u=s.name+"";xe.call(Yn,u)||(Yn[u]=[]),Yn[u].push({name:t,func:s})}}),Yn[Ii(r,M).name]=[{name:"wrapper",func:r}],ce.prototype.clone=Wg,ce.prototype.reverse=Yg,ce.prototype.value=Qg,g.prototype.at=yp,g.prototype.chain=Np,g.prototype.commit=Rp,g.prototype.next=Ep,g.prototype.plant=Ip,g.prototype.reverse=Fp,g.prototype.toJSON=g.prototype.valueOf=g.prototype.value=Mp,g.prototype.first=g.prototype.head,Er&&(g.prototype[Er]=Ap),g},Hn=Rg();Nn?((Nn.exports=Hn)._=Hn,Ms._=Hn):Ge._=Hn}).call(nr)})(ts,ts.exports);var Fe=ts.exports;const jw=n=>{const o=Vt.create(n[1]||{amount:null,scale:2});if(o.isFailure)throw o.error;const r=o.object,a=Vt.create(n[2]||{amount:null,scale:2});if(a.isFailure)throw a.error;const l=a.object,c=Tt.create(n[0]||{amount:null,scale:2});if(c.isFailure)throw c.error;const d=c.object,m=d.percentage(r.toNumber()).convertScale(2),p=d.subtract(m).convertScale(2),x=p.percentage(l.toNumber()).convertScale(2),v=p.add(x).convertScale(2);return{subtotalPrice:d.toObject(),discount:r.toObject(),discountPrice:m.toObject(),priceBeforeTaxes:p.toObject(),tax:l.toObject(),taxesPrice:x.toObject(),totalPrice:v.toObject()}},Cw=({currency:n})=>{const{formState:o,control:r}=xr(),{formatNumber:a}=aw(),l=xc({control:r,name:["subtotal_price","discount","tax"]}),c=xc({control:r,name:"tax_label"})||w("quotes.form_fields.tax.label"),d=jw(l),m=a(d.subtotalPrice),p=a(d.discountPrice),x=a(d.taxesPrice),v=a(d.totalPrice),j=L.useMemo(()=>n.symbol||"",[n]);return i.jsx(Le,{className:"w-full bg-muted",children:i.jsxs(Te,{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(We,{className:"text-sm",children:w("quotes.form_fields.subtotal_price.label")}),i.jsxs(Ue,{className:"flex items-baseline justify-end text-2xl tabular-nums",children:[m,i.jsx("span",{className:"ml-1 text-lg tracking-normal",children:j})]})]})}),i.jsx(_n,{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(We,{className:"text-sm",children:w("quotes.form_fields.discount.label")}),i.jsx(es,{scale:2,disabled:o.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(We,{className:"text-sm text-right",children:w("quotes.form_fields.discount_price.label")}),i.jsxs(Ue,{className:"flex items-baseline justify-end text-2xl tabular-nums",children:[p,i.jsx("span",{className:"ml-1 text-lg tracking-normal",children:j})]})]})]}),i.jsx(_n,{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(We,{className:"text-sm",children:c}),i.jsx(es,{scale:2,disabled:o.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(We,{className:"text-sm text-right",children:w("quotes.form_fields.tax_price.label",{label:""})}),i.jsxs(Ue,{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:j})]})]})]})," ",i.jsx(_n,{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(We,{className:"text-sm font-semibold text-right text-foreground",children:w("quotes.form_fields.total_price.label")}),i.jsxs(Ue,{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:j})]})]})})]})})},Gd=n=>{const{percentage:o,cancel:r,error:a,isInProgress:l,onFinishDownload:c}=n,d=L.useId();return L.useEffect(()=>{l&&!a&&o===100&&c&&c()},[o,l,a,c]),i.jsx(fr,{open:l,children:i.jsxs(gr,{className:"sm:max-w-md",children:[i.jsxs(mr,{children:[i.jsx(hr,{children:w("quotes.downloading_dialog.title")}),i.jsx(cs,{children:w("quotes.downloading_dialog.description")})]}),i.jsxs("div",{className:"mb-4 space-y-2",id:d,children:[i.jsx(wn,{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:o,max:100,getValueLabel:()=>w("quotes.downloading_dialog.progress.label",{})}),a&&i.jsxs("p",{children:["Error: ",JSON.stringify(a)]})]}),i.jsx(pr,{className:"sm:justify-end",children:i.jsx(Qi,{asChild:!0,children:i.jsx(G,{type:"button",variant:"secondary",onClick:()=>r(),children:w("quotes.downloading_dialog.cancel_button")})})})]})})},yw=({isInProgress:n,percentage:o,elapsed:r,cancel:a,error:l,className:c})=>{const[d,m]=L.useState(10);return L.useEffect(()=>{if(n&&o>0){const p=r/o*100;m(Math.max(0,Math.round(p-r)))}},[n,o,r]),!n&&!(l!=null&&l.errorMessage)?null:i.jsxs(Le,{className:he("overflow-hidden",c),children:[i.jsx(ct,{children:i.jsxs(Ue,{className:"flex items-center justify-between",children:[l!=null&&l.errorMessage?w("quotes.pdf_generation.error"):w("quotes.pdf_generation.title"),n&&i.jsx(q0,{className:"w-4 h-4 animate-spin"}),(l==null?void 0:l.errorMessage)&&i.jsx(D0,{className:"w-4 h-4 text-destructive"})]})}),i.jsx(Te,{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:`${o}%`}}),i.jsx(P0,{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:o,className:"w-full"}),i.jsxs("div",{className:"text-sm text-center text-muted-foreground",children:[i.jsx("p",{children:w("quotes.pdf_generation.progress",{percentage:o})}),i.jsxs("div",{className:"hidden",children:[i.jsx("p",{children:w("quotes.pdf_generation.elapsed",{elapsed:r})}),d>0&&i.jsx("p",{children:w("quotes.pdf_generation.remaining",{estimatedTime:d})})]})]}),i.jsx(G,{variant:"destructive",onClick:a,className:"hidden",children:w("quotes.pdf_generation.cancel")})]})})]})},Hd=({quote:n,className:o})=>{const{useReport:r,getQuotePDFFilename:a,useDownloader:l}=Zr(),{download:c}=l(),{report:d,preview:m,isInProgress:p,...x}=r(),[v,j]=L.useState(void 0),y=L.useCallback(()=>{n&&c(n.id,a(n))},[n]);return L.useEffect(()=>{const _=setTimeout(()=>{n&&n.id&&m(n.id)},200);return()=>clearTimeout(_)},[n]),L.useEffect(()=>{if(!p&&d){const _=window.URL&&window.URL.createObjectURL?window.URL.createObjectURL(d):window.webkitURL.createObjectURL(d);return j(_),()=>{j(void 0),window.URL.revokeObjectURL(_)}}},[d,p]),n?p?i.jsx(yw,{isInProgress:p,...x}):i.jsx(o0,{file:v,className:"object-contain",onThumbnailClick:y}):i.jsx(Le,{className:he("overflow-hidden",o),children:i.jsx(Te,{className:"px-4 py-6 text-center",children:i.jsx("p",{className:"mx-auto",children:w("quotes.list.resume.select_quote")})})})};Hd.whyDidYouRender=!0;const Br=tb();function Nw({row:n,table:o}){var l;const r=(l=o.options.meta)==null?void 0:l.catalogPicker;if(!r)return null;const a=r.quantities[n.index]??1;return i.jsx(as,{type:"number",name:"quantity",min:1,className:"w-24",value:a,onChange:c=>{const d=c.target.value;r.setQuantity(n.index,d===""?"":Number(d))}})}function Rw({row:n,table:o}){var a;const r=(a=o.options.meta)==null?void 0:a.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(Ro,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"sr-only xl:not-sr-only xl:whitespace-nowrap",children:r==null?void 0:r.t("common.add")})]})}const lo=({onSelect:n})=>{const o=Bt(),{t:r,i18n:a}=Pt(),{pagination:l,globalFilter:c,isFiltered:d}=kn(),[m,p]=L.useState([]),x=L.useCallback(($,q)=>{p(U=>{const T=[...U];return T[$]=q,T})},[]),v=()=>{p([])},{data:j,isPending:y,isError:_,error:E}=$d({pagination:{pageIndex:l.pageIndex,pageSize:l.pageSize},searchTerm:c});L.useEffect(()=>{v()},[l,c,d]);const R=L.useMemo(()=>({catalogPicker:{quantities:m,t:r,setQuantity:x,selectArticle:($,q)=>n($,m[q]===""?1:m[q]??1)}}),[x,n,m,r]),O=L.useMemo(()=>[Br.accessor("description",{id:"description",header:()=>i.jsx(i.Fragment,{children:r("catalog.list.columns.description")})}),Br.accessor("points",{id:"points",header:()=>i.jsx("div",{className:"text-right",children:r("catalog.list.columns.points")}),cell:({renderValue:$})=>i.jsx("div",{className:"text-right",children:$()})}),Br.accessor("retail_price",{id:"retail_price",header:()=>i.jsx("div",{className:"text-right",children:r("catalog.list.columns.retail_price")}),cell:({row:$})=>{const q=Tt.create($.original.retail_price).object;return i.jsx("div",{className:"text-right",children:q.toFormat()})}}),Br.display({id:"quantity",header:()=>i.jsx("div",{className:"font-medium text-right text-foreground",children:r("catalog.list.columns.quantity")}),cell:Nw}),Br.display({id:"row-actions",header:()=>null,cell:Rw})],[r,a.resolvedLanguage]),{table:M}=hs({data:[...(j==null?void 0:j.items)||[]],columns:O,pageCount:(j==null?void 0:j.total_pages)??-1,meta:R});return _?i.jsx(vr,{subtitle:E.message}):y?i.jsx(gs,{columnCount:6,searchableColumnCount:1,filterableColumnCount:2,shrinkZero:!0}):(j==null?void 0:j.total_items)===0&&!d?i.jsx(ms,{subtitle:r("catalog.list.empty_state.subtitle"),buttonText:"",onButtonClick:()=>o("/catalog/add")}):i.jsx(fs,{className:"bg-transparent border-0 shadow-none",table:M,paginationOptions:{visible:!0,enablePageSizeSelector:!1},footerClassName:"px-10 pt-2 border-t",children:i.jsx(zd,{table:M})})},To=L.forwardRef(({label:n=w("common.append_block"),className:o,...r},a)=>i.jsxs(G,{type:"button",variant:"outline",ref:a,...r,children:[" ",i.jsx(Ro,{className:n?"w-4 h-4 mr-2":"w-4 h-4"}),n&&i.jsx(i.Fragment,{children:n})]}));To.displayName="AppendBlockRowButton";const Oo=L.forwardRef(({label:n=w("common.append_article"),className:o,...r},a)=>i.jsxs(G,{type:"button",variant:"outline",ref:a,...r,children:[" ",i.jsx(Ro,{className:n?"w-4 h-4 mr-2":"w-4 h-4"}),n&&i.jsx(i.Fragment,{children:n})]}));Oo.displayName="AppendCatalogArticleRowButton";const Po=L.forwardRef(({label:n=w("common.append_empty_row"),className:o,...r},a)=>i.jsxs(G,{type:"button",variant:"outline",ref:a,...r,children:[i.jsx(M0,{className:n?"w-4 h-4 mr-2":"w-4 h-4"}),n&&i.jsx(i.Fragment,{children:n})]}));Po.displayName="AppendEmptyRowButton";const Ew=({table:n,showLineDiscountColumn:o,hasLineDiscounts:r,onShowLineDiscountColumnChange:a})=>{const l=n.getSelectedRowModel().rows.length,[c,d]=L.useState(!1),m=x=>{if(!x&&o&&r){d(!0);return}a(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(wn,{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(yo,{id:"show-line-discount-column",checked:o,onCheckedChange:m})]}),i.jsx(fr,{open:c,onOpenChange:d,children:i.jsxs(gr,{children:[i.jsxs(mr,{children:[i.jsx(hr,{children:w("quotes.discount_column.confirmation.title")}),i.jsx(cs,{children:w("quotes.discount_column.confirmation.description")})]}),i.jsxs(pr,{children:[i.jsx(G,{type:"button",variant:"secondary",onClick:()=>d(!1),children:w("common.cancel")}),i.jsx(G,{type:"button",onClick:()=>{a(!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(Ye,{children:[i.jsx(Qe,{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(L0,{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(Xe,{children:w("common.duplicate_selected_rows_tooltip")})]}),i.jsxs(Ye,{children:[i.jsx(Qe,{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(Xe,{children:w("common.remove_selected_rows_tooltip")})]}),i.jsxs(Ye,{children:[i.jsx(Qe,{asChild:!0,children:i.jsxs(G,{type:"button",variant:"link",disabled:!n.getSelectedRowModel().rows.length,onClick:()=>n.resetRowSelection(),children:[i.jsx(k0,{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(Xe,{children:w("common.reset_selected_rows_tooltip")})]}),i.jsx(_n,{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(Ye,{children:[i.jsx(Qe,{asChild:!0,children:i.jsx(Po,{variant:"link",onClick:()=>{var x;return(x=n.options.meta)==null?void 0:x.appendItem()}})}),i.jsx(Xe,{children:w("common.append_empty_row_tooltip")})]}),i.jsxs(Ye,{children:[i.jsx(Qe,{asChild:!0,children:i.jsx(Oo,{variant:"link",onClick:()=>{var x;n.options.meta&&n.options.meta.pickCatalogArticle&&((x=n.options.meta)==null||x.pickCatalogArticle())}})}),i.jsx(Xe,{children:w("common.append_article_tooltip")})]}),i.jsxs(Ye,{children:[i.jsx(Qe,{asChild:!0,children:i.jsx(To,{variant:"link",onClick:()=>{var x;n.options.meta&&n.options.meta.pickBlock&&((x=n.options.meta)==null||x.pickBlock())}})}),i.jsx(Xe,{children:w("common.append_block_tooltip")})]})]}),p]})},Aw=({row:n,table:o,onDelete:r})=>{const a=()=>{var l;(l=o.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=o.options.meta)==null?void 0:l.insertItem(n.index)},children:[i.jsx(l0,{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=o.options.meta)==null?void 0:l.insertItem(n.index+1)},children:[i.jsx(qc,{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=o.options.meta)==null?void 0:l.duplicateItems(n.index)},children:[i.jsx(No,{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:a,children:w("quotes.inline_row_actions.delete_confirmation.confirm")})})]})]})]})]})},Iw={droppable:{strategy:f0.Always}},Fw={keyframes({transform:n}){return[{opacity:1,transform:Za.Transform.toString(n.initial)},{opacity:0,transform:Za.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:vc.duration,easing:vc.easing})}};function Ec({columns:n,data:o,defaultValues:r,initialState:a,actions:l,showLineDiscountColumn:c,hasLineDiscounts:d,onShowLineDiscountColumnChange:m}){const[p,x]=L.useState({}),[v,j]=L.useState(),[y,_]=L.useState(null),E=L.useMemo(()=>o.map(T=>T.id),[o]),R=Dd({data:o,columns:n,enableColumnResizing:!1,columnResizeMode:"onChange",autoResetAll:!1,initialState:a,state:{rowSelection:p,columnVisibility:{...a==null?void 0:a.columnVisibility,discount:c}},enableRowSelection:!0,enableMultiRowSelection:!0,enableSorting:!1,enableHiding:!0,onRowSelectionChange:x,getCoreRowModel:Fd(),getRowId:T=>T==null?void 0:T.id,debugTable:!1,debugHeaders:!1,debugColumns:!1,defaultColumn:{minSize:0,size:Number.MAX_SAFE_INTEGER,maxSize:Number.MAX_SAFE_INTEGER},meta:{insertItem:(T,k)=>{l.insert(T,k||(r==null?void 0:r.items[0]),{shouldFocus:!0})},appendItem:T=>{l.append(T||(r==null?void 0:r.items[0]),{shouldFocus:!0})},pickCatalogArticle:()=>{l.pickCatalogArticle&&(l==null||l.pickCatalogArticle())},pickBlock:()=>{l.pickBlock&&(l==null||l.pickBlock())},duplicateItems:T=>{var k;if(T!=null){const W=((k=l.getItem)==null?void 0:k.call(l,T))??R.getRowModel().rows[T].original;l.insert(T+1,{...W,id:void 0},{shouldFocus:!0})}else if(R.getSelectedRowModel().rows.length){const W=R.getSelectedRowModel().rows[R.getSelectedRowModel().rows.length-1].index,te=R.getSelectedRowModel().rows.map(V=>({...V.original,id:void 0}));R.getRowModel().rows.length{if(T!=null)l.remove(T);else if(R.getSelectedRowModel().rows.length>0){let k=R.getSelectedRowModel().rows.length-1;for(;k>=0;k--){const W=E.indexOf(String(R.getSelectedRowModel().rows[k].id));l.remove(W),E.splice(W,1)}R.resetRowSelection()}else l.remove()},updateItem:(T,k,W,te)=>{l.update(T,{...k,[`${W}`]:te})}}}),O=u0(Gi(b0,{}),Gi(_0,{}),Gi(v0,{}),Gi(x0,{}));function M(T){var te;let k=T.active.id,W=(te=T.over)==null?void 0:te.id;if(W!==void 0&&k!==W){let V=E.indexOf(String(W));if(R.getSelectedRowModel().rows.length>1)R.getSelectedRowModel().rows.forEach((ge,_e)=>{const K=E.indexOf(String(ge.id));_e>0&&(k=ge.id,V=E.indexOf(String(W)),V{const W=typeof k=="string"?k:k.id;return W===v||!R.getSelectedRowModel().rowsById[W]}):T}return i.jsx(c0,{measuring:Iw,sensors:O,onDragEnd:M,onDragStart:$,onDragCancel:q,collisionDetection:d0,children:i.jsxs(Le,{children:[i.jsx(ct,{className:"sticky z-10 top-16 bg-card/90",children:i.jsx(Ue,{children:i.jsx(Ew,{table:R,showLineDiscountColumn:c,hasLineDiscounts:d,onShowLineDiscountColumnChange:m})})}),i.jsxs(Te,{children:[i.jsxs(go,{className:"table-fixed",children:[i.jsx(mo,{className:"sticky top-0 z-10 bg-background",children:R.getHeaderGroups().map(T=>i.jsx(bn,{className:"hover:bg-transparent",children:T.headers.map(k=>i.jsx(ho,{className:"px-2 py-1",style:{width:k.getSize()===Number.MAX_SAFE_INTEGER?"auto":k.getSize()},children:k.isPlaceholder?null:i.jsx(Td,{table:R,header:k})},k.id))},T.id))}),i.jsx(po,{children:i.jsx(m0,{items:U(E),strategy:h0,children:U(R.getRowModel().rows).map(T=>{const k=T,W=k.id===y;return i.jsxs(L.Fragment,{children:[i.jsx(pw,{id:k.id,isActive:W,onActivate:()=>_(k.id),children:k.getVisibleCells().map(te=>i.jsx(Kr,{className:"px-2 py-2 align-top",style:{width:te.column.getSize()===Number.MAX_SAFE_INTEGER?"auto":te.column.getSize()},children:Ji(te.column.columnDef.cell,te.getContext())},te.id))}),W&&i.jsx(bn,{className:"border border-t-0 border-destructive/30 border-l-4 border-l-destructive bg-destructive/5 hover:bg-destructive/5",children:i.jsx(Kr,{colSpan:k.getVisibleCells().length,className:"px-2 py-2",children:i.jsx(Aw,{row:k,table:R,onDelete:()=>_(null)})})})]},k.id)})})})]}),g0.createPortal(i.jsx(p0,{dropAnimation:Fw,className:"z-40 opacity-100",children:v&&i.jsx("div",{className:"relative flex flex-wrap",children:R.getSelectedRowModel().rows.length?i.jsx(co,{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:R.getSelectedRowModel().rows.length}):null})}),document.body),!1]}),i.jsx(Rt,{children:i.jsxs(cr,{children:[i.jsx(Po,{onClick:()=>{var T;return(T=R.options.meta)==null?void 0:T.appendItem()}}),i.jsx(Oo,{onClick:()=>{var T;R.options.meta&&R.options.meta.pickCatalogArticle&&((T=R.options.meta)==null||T.pickCatalogArticle())}}),i.jsx(To,{onClick:()=>{var T;R.options.meta&&R.options.meta.pickBlock&&((T=R.options.meta)==null||T.pickBlock())}})]})})]})})}const Ac={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=fc(function(){return me(h,G+"return "+P).apply(r,b)});if(oe.source=P,Na(oe))throw oe;return oe}function Uv(e){return pe(e).toLowerCase()}function zv(e){return pe(e).toUpperCase()}function Vv(e,t,s){if(e=pe(e),e&&(s||t===r))return wl(e);if(!e||!(t=gt(t)))return e;var u=Ft(e),f=Ft(t),h=Sl(u,f),b=jl(u,f)+1;return fn(u,h,b).join("")}function Hv(e,t,s){if(e=pe(e),e&&(s||t===r))return e.slice(0,yl(e)+1);if(!e||!(t=gt(t)))return e;var u=Ft(e),f=jl(u,Ft(t))+1;return fn(u,0,f).join("")}function Gv(e,t,s){if(e=pe(e),e&&(s||t===r))return e.replace(Ns,"");if(!e||!(t=gt(t)))return e;var u=Ft(e),f=Sl(u,Ft(t));return fn(u,f).join("")}function Kv(e,t){var s=ge,u=_e;if(Ae(t)){var f="separator"in t?t.separator:f;s="length"in t?ae(t.length):s,u="omission"in t?gt(t.omission):u}e=pe(e);var h=e.length;if(Vn(e)){var b=Ft(e);h=b.length}if(s>=h)return e;var S=s-Hn(u);if(S<1)return u;var N=b?fn(b,0,S).join(""):e.slice(0,S);if(f===r)return N+u;if(b&&(S+=N.length-S),Ra(f)){if(e.slice(S).search(f)){var F,T=N;for(f.global||(f=zs(f.source,pe(zo.exec(f))+"g")),f.lastIndex=0;F=f.exec(T);)var P=F.index;N=N.slice(0,P===r?S:P)}}else if(e.indexOf(gt(f),S)!=S){var B=N.lastIndexOf(f);B>-1&&(N=N.slice(0,B))}return N+u}function Wv(e){return e=pe(e),e&&sf.test(e)?e.replace($o,jg):e}var Qv=Xn(function(e,t,s){return e+(s?" ":"")+t.toUpperCase()}),Ia=gu("toUpperCase");function dc(e,t,s){return e=pe(e),t=s?r:t,t===r?vg(e)?Ng(e):ug(e):e.match(t)||[]}var fc=le(function(e,t){try{return dt(e,r,t)}catch(s){return Na(s)?s:new re(s)}}),Yv=Qt(function(e,t){return bt(t,function(s){s=$t(s),Kt(e,s,Ca(e[s],e))}),e});function Zv(e){var t=e==null?0:e.length,s=Q();return e=t?Re(e,function(u){if(typeof u[1]!="function")throw new wt(d);return[s(u[0]),u[1]]}):[],le(function(u){for(var f=-1;++fde)return[];var s=Ce,u=Xe(e,Ce);t=Q(t),e-=Ce;for(var f=$s(u,t);++s0||t<0)?new ce(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)},ce.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},ce.prototype.toArray=function(){return this.take(Ce)},qt(ce.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],h=u||/^find/.test(t);f&&(g.prototype[t]=function(){var b=this.__wrapped__,S=u?[1]:arguments,N=b instanceof ce,F=S[0],T=N||ie(b),P=function(ue){var fe=f.apply(g,an([ue],S));return u&&B?fe[0]:fe};T&&s&&typeof F=="function"&&F.length!=1&&(N=T=!1);var B=this.__chain__,G=!!this.__actions__.length,J=h&&!B,oe=N&&!G;if(!h&&T){b=oe?b:new ce(this);var ee=e.apply(b,S);return ee.__actions__.push({func:Pi,args:[P],thisArg:r}),new St(ee,B)}return J&&oe?e.apply(this,S):(ee=this.thru(P),J?u?ee.value()[0]:ee.value():ee)})}),bt(["pop","push","shift","sort","splice","unshift"],function(e){var t=ui[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 h=this.value();return t.apply(ie(h)?h:[],f)}return this[s](function(b){return t.apply(ie(b)?b:[],f)})}}),qt(ce.prototype,function(e,t){var s=g[t];if(s){var u=s.name+"";xe.call(Qn,u)||(Qn[u]=[]),Qn[u].push({name:t,func:s})}}),Qn[Ii(r,M).name]=[{name:"wrapper",func:r}],ce.prototype.clone=Wg,ce.prototype.reverse=Qg,ce.prototype.value=Yg,g.prototype.at=yp,g.prototype.chain=Np,g.prototype.commit=Rp,g.prototype.next=Ep,g.prototype.plant=Ip,g.prototype.reverse=Fp,g.prototype.toJSON=g.prototype.valueOf=g.prototype.value=Mp,g.prototype.first=g.prototype.head,Er&&(g.prototype[Er]=Ap),g},Gn=Rg();Nn?((Nn.exports=Gn)._=Gn,Ms._=Gn):He._=Gn}).call(nr)})(ts,ts.exports);var Fe=ts.exports;const jw=n=>{const o=Ut.create(n[1]||{amount:null,scale:2});if(o.isFailure)throw o.error;const r=o.object,a=Ut.create(n[2]||{amount:null,scale:2});if(a.isFailure)throw a.error;const l=a.object,c=Dt.create(n[0]||{amount:null,scale:2});if(c.isFailure)throw c.error;const d=c.object,m=d.percentage(r.toNumber()).convertScale(2),p=d.subtract(m).convertScale(2),x=p.percentage(l.toNumber()).convertScale(2),v=p.add(x).convertScale(2);return{subtotalPrice:d.toObject(),discount:r.toObject(),discountPrice:m.toObject(),priceBeforeTaxes:p.toObject(),tax:l.toObject(),taxesPrice:x.toObject(),totalPrice:v.toObject()}},Cw=({currency:n})=>{const{formState:o,control:r}=xr(),{formatNumber:a}=aw(),l=xc({control:r,name:["subtotal_price","discount","tax"]}),c=xc({control:r,name:"tax_label"})||w("quotes.form_fields.tax.label"),d=jw(l),m=a(d.subtotalPrice),p=a(d.discountPrice),x=a(d.taxesPrice),v=a(d.totalPrice),j=O.useMemo(()=>n.symbol||"",[n]);return i.jsx(Oe,{className:"w-full bg-muted",children:i.jsxs(De,{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(We,{className:"text-sm",children:w("quotes.form_fields.subtotal_price.label")}),i.jsxs(Ve,{className:"flex items-baseline justify-end text-2xl tabular-nums",children:[m,i.jsx("span",{className:"ml-1 text-lg tracking-normal",children:j})]})]})}),i.jsx(_n,{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(We,{className:"text-sm",children:w("quotes.form_fields.discount.label")}),i.jsx(es,{scale:2,disabled:o.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(We,{className:"text-sm text-right",children:w("quotes.form_fields.discount_price.label")}),i.jsxs(Ve,{className:"flex items-baseline justify-end text-2xl tabular-nums",children:[p,i.jsx("span",{className:"ml-1 text-lg tracking-normal",children:j})]})]})]}),i.jsx(_n,{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(We,{className:"text-sm",children:c}),i.jsx(es,{scale:2,disabled:o.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(We,{className:"text-sm text-right",children:w("quotes.form_fields.tax_price.label",{label:""})}),i.jsxs(Ve,{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:j})]})]})]})," ",i.jsx(_n,{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(We,{className:"text-sm font-semibold text-right text-foreground",children:w("quotes.form_fields.total_price.label")}),i.jsxs(Ve,{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:j})]})]})})]})})},Hd=n=>{const{percentage:o,cancel:r,error:a,isInProgress:l,onFinishDownload:c}=n,d=O.useId();return O.useEffect(()=>{l&&!a&&o===100&&c&&c()},[o,l,a,c]),i.jsx(fr,{open:l,children:i.jsxs(gr,{className:"sm:max-w-md",children:[i.jsxs(mr,{children:[i.jsx(hr,{children:w("quotes.downloading_dialog.title")}),i.jsx(cs,{children:w("quotes.downloading_dialog.description")})]}),i.jsxs("div",{className:"mb-4 space-y-2",id:d,children:[i.jsx(wn,{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(Gc,{value:o,max:100,getValueLabel:()=>w("quotes.downloading_dialog.progress.label",{})}),a&&i.jsxs("p",{children:["Error: ",JSON.stringify(a)]})]}),i.jsx(pr,{className:"sm:justify-end",children:i.jsx(Yi,{asChild:!0,children:i.jsx(H,{type:"button",variant:"secondary",onClick:()=>r(),children:w("quotes.downloading_dialog.cancel_button")})})})]})})},yw=({isInProgress:n,percentage:o,elapsed:r,cancel:a,error:l,className:c})=>{const[d,m]=O.useState(10);return O.useEffect(()=>{if(n&&o>0){const p=r/o*100;m(Math.max(0,Math.round(p-r)))}},[n,o,r]),!n&&!(l!=null&&l.errorMessage)?null:i.jsxs(Oe,{className:he("overflow-hidden",c),children:[i.jsx(ct,{children:i.jsxs(Ve,{className:"flex items-center justify-between",children:[l!=null&&l.errorMessage?w("quotes.pdf_generation.error"):w("quotes.pdf_generation.title"),n&&i.jsx(q0,{className:"w-4 h-4 animate-spin"}),(l==null?void 0:l.errorMessage)&&i.jsx(T0,{className:"w-4 h-4 text-destructive"})]})}),i.jsx(De,{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:`${o}%`}}),i.jsx(P0,{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(Gc,{value:o,className:"w-full"}),i.jsxs("div",{className:"text-sm text-center text-muted-foreground",children:[i.jsx("p",{children:w("quotes.pdf_generation.progress",{percentage:o})}),i.jsxs("div",{className:"hidden",children:[i.jsx("p",{children:w("quotes.pdf_generation.elapsed",{elapsed:r})}),d>0&&i.jsx("p",{children:w("quotes.pdf_generation.remaining",{estimatedTime:d})})]})]}),i.jsx(H,{variant:"destructive",onClick:a,className:"hidden",children:w("quotes.pdf_generation.cancel")})]})})]})},Gd=({quote:n,className:o})=>{const{useReport:r,getQuotePDFFilename:a,useDownloader:l}=Xr(),{download:c}=l(),{report:d,preview:m,isInProgress:p,...x}=r(),[v,j]=O.useState(void 0),y=O.useCallback(()=>{n&&c(n.id,a(n))},[n]);return O.useEffect(()=>{const _=setTimeout(()=>{n&&n.id&&m(n.id)},200);return()=>clearTimeout(_)},[n]),O.useEffect(()=>{if(!p&&d){const _=window.URL&&window.URL.createObjectURL?window.URL.createObjectURL(d):window.webkitURL.createObjectURL(d);return j(_),()=>{j(void 0),window.URL.revokeObjectURL(_)}}},[d,p]),n?p?i.jsx(yw,{isInProgress:p,...x}):i.jsx(o0,{file:v,className:"object-contain",onThumbnailClick:y}):i.jsx(Oe,{className:he("overflow-hidden",o),children:i.jsx(De,{className:"px-4 py-6 text-center",children:i.jsx("p",{className:"mx-auto",children:w("quotes.list.resume.select_quote")})})})};Gd.whyDidYouRender=!0;const zr=tb();function Nw({row:n,table:o}){var l;const r=(l=o.options.meta)==null?void 0:l.catalogPicker;if(!r)return null;const a=r.quantities[n.index]??1;return i.jsx(as,{type:"number",name:"quantity",min:1,className:"w-24",value:a,onChange:c=>{const d=c.target.value;r.setQuantity(n.index,d===""?"":Number(d))}})}function Rw({row:n,table:o}){var a;const r=(a=o.options.meta)==null?void 0:a.catalogPicker;return i.jsxs(H,{size:"sm",variant:"outline",className:"h-8 gap-1",onClick:l=>{l.preventDefault(),r==null||r.selectArticle(n.original,n.index)},children:[i.jsx(Ro,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"sr-only xl:not-sr-only xl:whitespace-nowrap",children:r==null?void 0:r.t("common.add")})]})}const lo=({onSelect:n})=>{const o=zt(),{t:r,i18n:a}=Pt(),{pagination:l,globalFilter:c,isFiltered:d}=kn(),[m,p]=O.useState([]),x=O.useCallback(($,q)=>{p(V=>{const D=[...V];return D[$]=q,D})},[]),v=()=>{p([])},{data:j,isPending:y,isError:_,error:E}=$d({pagination:{pageIndex:l.pageIndex,pageSize:l.pageSize},searchTerm:c});O.useEffect(()=>{v()},[l,c,d]);const R=O.useMemo(()=>({catalogPicker:{quantities:m,t:r,setQuantity:x,selectArticle:($,q)=>n($,m[q]===""?1:m[q]??1)}}),[x,n,m,r]),L=O.useMemo(()=>[zr.accessor("description",{id:"description",header:()=>i.jsx(i.Fragment,{children:r("catalog.list.columns.description")})}),zr.accessor("points",{id:"points",header:()=>i.jsx("div",{className:"text-right",children:r("catalog.list.columns.points")}),cell:({renderValue:$})=>i.jsx("div",{className:"text-right",children:$()})}),zr.accessor("retail_price",{id:"retail_price",header:()=>i.jsx("div",{className:"text-right",children:r("catalog.list.columns.retail_price")}),cell:({row:$})=>{const q=Dt.create($.original.retail_price).object;return i.jsx("div",{className:"text-right",children:q.toFormat()})}}),zr.display({id:"quantity",header:()=>i.jsx("div",{className:"font-medium text-right text-foreground",children:r("catalog.list.columns.quantity")}),cell:Nw}),zr.display({id:"row-actions",header:()=>null,cell:Rw})],[r,a.resolvedLanguage]),{table:M}=hs({data:[...(j==null?void 0:j.items)||[]],columns:L,pageCount:(j==null?void 0:j.total_pages)??-1,meta:R});return _?i.jsx(vr,{subtitle:E.message}):y?i.jsx(gs,{columnCount:6,searchableColumnCount:1,filterableColumnCount:2,shrinkZero:!0}):(j==null?void 0:j.total_items)===0&&!d?i.jsx(ms,{subtitle:r("catalog.list.empty_state.subtitle"),buttonText:"",onButtonClick:()=>o("/catalog/add")}):i.jsx(fs,{className:"bg-transparent border-0 shadow-none",table:M,paginationOptions:{visible:!0,enablePageSizeSelector:!1},footerClassName:"px-10 pt-2 border-t",children:i.jsx(Bd,{table:M})})},Do=O.forwardRef(({label:n=w("common.append_block"),className:o,...r},a)=>i.jsxs(H,{type:"button",variant:"outline",ref:a,...r,children:[" ",i.jsx(Ro,{className:n?"w-4 h-4 mr-2":"w-4 h-4"}),n&&i.jsx(i.Fragment,{children:n})]}));Do.displayName="AppendBlockRowButton";const Lo=O.forwardRef(({label:n=w("common.append_article"),className:o,...r},a)=>i.jsxs(H,{type:"button",variant:"outline",ref:a,...r,children:[" ",i.jsx(Ro,{className:n?"w-4 h-4 mr-2":"w-4 h-4"}),n&&i.jsx(i.Fragment,{children:n})]}));Lo.displayName="AppendCatalogArticleRowButton";const Po=O.forwardRef(({label:n=w("common.append_empty_row"),className:o,...r},a)=>i.jsxs(H,{type:"button",variant:"outline",ref:a,...r,children:[i.jsx(M0,{className:n?"w-4 h-4 mr-2":"w-4 h-4"}),n&&i.jsx(i.Fragment,{children:n})]}));Po.displayName="AppendEmptyRowButton";const Ew=({table:n,showLineDiscountColumn:o,hasLineDiscounts:r,onShowLineDiscountColumnChange:a})=>{const l=n.getSelectedRowModel().rows.length,[c,d]=O.useState(!1),m=x=>{if(!x&&o&&r){d(!0);return}a(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(wn,{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(yo,{id:"show-line-discount-column",checked:o,onCheckedChange:m})]}),i.jsx(fr,{open:c,onOpenChange:d,children:i.jsxs(gr,{children:[i.jsxs(mr,{children:[i.jsx(hr,{children:w("quotes.discount_column.confirmation.title")}),i.jsx(cs,{children:w("quotes.discount_column.confirmation.description")})]}),i.jsxs(pr,{children:[i.jsx(H,{type:"button",variant:"secondary",onClick:()=>d(!1),children:w("common.cancel")}),i.jsx(H,{type:"button",onClick:()=>{a(!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(Qe,{children:[i.jsx(Ye,{asChild:!0,children:i.jsxs(H,{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(O0,{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(Ze,{children:w("common.duplicate_selected_rows_tooltip")})]}),i.jsxs(Qe,{children:[i.jsx(Ye,{asChild:!0,children:i.jsxs(H,{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(Ze,{children:w("common.remove_selected_rows_tooltip")})]}),i.jsxs(Qe,{children:[i.jsx(Ye,{asChild:!0,children:i.jsxs(H,{type:"button",variant:"link",disabled:!n.getSelectedRowModel().rows.length,onClick:()=>n.resetRowSelection(),children:[i.jsx(k0,{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(Ze,{children:w("common.reset_selected_rows_tooltip")})]}),i.jsx(_n,{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(Qe,{children:[i.jsx(Ye,{asChild:!0,children:i.jsx(Po,{variant:"link",onClick:()=>{var x;return(x=n.options.meta)==null?void 0:x.appendItem()}})}),i.jsx(Ze,{children:w("common.append_empty_row_tooltip")})]}),i.jsxs(Qe,{children:[i.jsx(Ye,{asChild:!0,children:i.jsx(Lo,{variant:"link",onClick:()=>{var x;n.options.meta&&n.options.meta.pickCatalogArticle&&((x=n.options.meta)==null||x.pickCatalogArticle())}})}),i.jsx(Ze,{children:w("common.append_article_tooltip")})]}),i.jsxs(Qe,{children:[i.jsx(Ye,{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(Ze,{children:w("common.append_block_tooltip")})]})]}),p]})},Aw=({row:n,table:o,onDelete:r})=>{const a=()=>{var l;(l=o.options.meta)==null||l.deleteItems(n.index),r()};return i.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[i.jsxs(H,{type:"button",variant:"outline",size:"sm",onClick:()=>{var l;return(l=o.options.meta)==null?void 0:l.insertItem(n.index)},children:[i.jsx(l0,{className:"w-4 h-4 mr-2"}),w("common.insert_row_above")]}),i.jsxs(H,{type:"button",variant:"outline",size:"sm",onClick:()=>{var l;return(l=o.options.meta)==null?void 0:l.insertItem(n.index+1)},children:[i.jsx(qc,{className:"w-4 h-4 mr-2"}),w("common.insert_row_below")]}),i.jsxs(H,{type:"button",variant:"outline",size:"sm",onClick:()=>{var l;return(l=o.options.meta)==null?void 0:l.duplicateItems(n.index)},children:[i.jsx(No,{className:"w-4 h-4 mr-2"}),w("common.duplicate_row")]}),i.jsxs(Kc,{children:[i.jsx(Wc,{asChild:!0,children:i.jsxs(H,{type:"button",variant:"destructive",size:"sm",children:[i.jsx(xd,{className:"w-4 h-4 mr-2"}),w("common.remove_row")]})}),i.jsxs(Qc,{children:[i.jsxs(Yc,{children:[i.jsx(Zc,{children:w("quotes.inline_row_actions.delete_confirmation.title")}),i.jsx(Xc,{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(H,{type:"button",variant:"destructive",onClick:a,children:w("quotes.inline_row_actions.delete_confirmation.confirm")})})]})]})]})]})},Iw={droppable:{strategy:f0.Always}},Fw={keyframes({transform:n}){return[{opacity:1,transform:Xa.Transform.toString(n.initial)},{opacity:0,transform:Xa.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:vc.duration,easing:vc.easing})}};function Ec({columns:n,data:o,defaultValues:r,initialState:a,actions:l,showLineDiscountColumn:c,hasLineDiscounts:d,onShowLineDiscountColumnChange:m}){const[p,x]=O.useState({}),[v,j]=O.useState(),[y,_]=O.useState(null),E=O.useMemo(()=>o.map(D=>D.id),[o]),R=Td({data:o,columns:n,enableColumnResizing:!1,columnResizeMode:"onChange",autoResetAll:!1,initialState:a,state:{rowSelection:p,columnVisibility:{...a==null?void 0:a.columnVisibility,discount:c}},enableRowSelection:!0,enableMultiRowSelection:!0,enableSorting:!1,enableHiding:!0,onRowSelectionChange:x,getCoreRowModel:Fd(),getRowId:D=>D==null?void 0:D.id,debugTable:!1,debugHeaders:!1,debugColumns:!1,defaultColumn:{minSize:0,size:Number.MAX_SAFE_INTEGER,maxSize:Number.MAX_SAFE_INTEGER},meta:{insertItem:(D,k)=>{l.insert(D,k||(r==null?void 0:r.items[0]),{shouldFocus:!0})},appendItem:D=>{l.append(D||(r==null?void 0:r.items[0]),{shouldFocus:!0})},pickCatalogArticle:()=>{l.pickCatalogArticle&&(l==null||l.pickCatalogArticle())},pickBlock:()=>{l.pickBlock&&(l==null||l.pickBlock())},duplicateItems:D=>{var k;if(D!=null){const W=((k=l.getItem)==null?void 0:k.call(l,D))??R.getRowModel().rows[D].original;l.insert(D+1,{...W,id:void 0},{shouldFocus:!0})}else if(R.getSelectedRowModel().rows.length){const W=R.getSelectedRowModel().rows[R.getSelectedRowModel().rows.length-1].index,te=R.getSelectedRowModel().rows.map(U=>({...U.original,id:void 0}));R.getRowModel().rows.length{if(D!=null)l.remove(D);else if(R.getSelectedRowModel().rows.length>0){let k=R.getSelectedRowModel().rows.length-1;for(;k>=0;k--){const W=E.indexOf(String(R.getSelectedRowModel().rows[k].id));l.remove(W),E.splice(W,1)}R.resetRowSelection()}else l.remove()},updateItem:(D,k,W,te)=>{l.update(D,{...k,[`${W}`]:te})}}}),L=u0(Hi(b0,{}),Hi(_0,{}),Hi(v0,{}),Hi(x0,{}));function M(D){var te;let k=D.active.id,W=(te=D.over)==null?void 0:te.id;if(W!==void 0&&k!==W){let U=E.indexOf(String(W));if(R.getSelectedRowModel().rows.length>1)R.getSelectedRowModel().rows.forEach((ge,_e)=>{const K=E.indexOf(String(ge.id));_e>0&&(k=ge.id,U=E.indexOf(String(W)),U{const W=typeof k=="string"?k:k.id;return W===v||!R.getSelectedRowModel().rowsById[W]}):D}return i.jsx(c0,{measuring:Iw,sensors:L,onDragEnd:M,onDragStart:$,onDragCancel:q,collisionDetection:d0,children:i.jsxs(Oe,{children:[i.jsx(ct,{className:"sticky z-10 top-16 bg-card/90",children:i.jsx(Ve,{children:i.jsx(Ew,{table:R,showLineDiscountColumn:c,hasLineDiscounts:d,onShowLineDiscountColumnChange:m})})}),i.jsxs(De,{children:[i.jsxs(go,{className:"table-fixed",children:[i.jsx(mo,{className:"sticky top-0 z-10 bg-background",children:R.getHeaderGroups().map(D=>i.jsx(bn,{className:"hover:bg-transparent",children:D.headers.map(k=>i.jsx(ho,{className:"px-2 py-1",style:{width:k.getSize()===Number.MAX_SAFE_INTEGER?"auto":k.getSize()},children:k.isPlaceholder?null:i.jsx(Dd,{table:R,header:k})},k.id))},D.id))}),i.jsx(po,{children:i.jsx(m0,{items:V(E),strategy:h0,children:V(R.getRowModel().rows).map(D=>{const k=D,W=k.id===y;return i.jsxs(O.Fragment,{children:[i.jsx(pw,{id:k.id,isActive:W,onActivate:()=>_(k.id),children:k.getVisibleCells().map(te=>i.jsx(Kr,{className:"px-2 py-2 align-top",style:{width:te.column.getSize()===Number.MAX_SAFE_INTEGER?"auto":te.column.getSize()},children:Ji(te.column.columnDef.cell,te.getContext())},te.id))}),W&&i.jsx(bn,{className:"border border-t-0 border-destructive/30 border-l-4 border-l-destructive bg-destructive/5 hover:bg-destructive/5",children:i.jsx(Kr,{colSpan:k.getVisibleCells().length,className:"px-2 py-2",children:i.jsx(Aw,{row:k,table:R,onDelete:()=>_(null)})})})]},k.id)})})})]}),g0.createPortal(i.jsx(p0,{dropAnimation:Fw,className:"z-40 opacity-100",children:v&&i.jsx("div",{className:"relative flex flex-wrap",children:R.getSelectedRowModel().rows.length?i.jsx(co,{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:R.getSelectedRowModel().rows.length}):null})}),document.body),!1]}),i.jsx(Rt,{children:i.jsxs(cr,{children:[i.jsx(Po,{onClick:()=>{var D;return(D=R.options.meta)==null?void 0:D.appendItem()}}),i.jsx(Lo,{onClick:()=>{var D;R.options.meta&&R.options.meta.pickCatalogArticle&&((D=R.options.meta)==null||D.pickCatalogArticle())}}),i.jsx(Do,{onClick:()=>{var D;R.options.meta&&R.options.meta.pickBlock&&((D=R.options.meta)==null||D.pickBlock())}})]})})]})})}const Ac={es:[{id:50,code:"CAP_SEP_AMBIENTES_ES",title:"CARACTERISTICAS SEPARACIÓN DE AMBIENTES",body:`Medida de Hueco: 2450x3000 mm.\r +Modelo: LYN / Acabado: ANODIZADO / Color: NEGRO\r +Nº de travesaños: 2 TRAVESAÑOS HORIZONTALES\r +Acabado paneles: TRANSPARENTE TEMPLADO \r +Tirador: DOBLE POR PUERTA\r +Freno: DOBLE POR PUERTA (APERTURA Y CIERRE)\r +Guía: VISTA (DOBLE EMBELLECEDOR)\r +Nº de hojas: 2 CORREDERAS + 2 FIJOS`},{id:51,code:"CAP_FRE_ARM_CORREDERA_ES",title:"CARACTERISTICAS FRENTE DE ARMARIO CORREDERA",body:`Medida de Hueco:2440x5180mm.\r +Modelo: PANORAMIC P.O. / Acabado: LACADO / Color: BLANCO\r +Nº de lístelos: SIN LISTELOS / Acabado paneles: PANEL LACADO\r +Tirador:\r +Cerco perimetral: \r +Nº de hojas:\r +FRENO HIDRAULICO INCORPORADO O FRENO MAGNETICO INCORPORADO\r +Compuesto por:`},{id:52,code:"CAP_FRE_ARM_ABATIBLE_ES",title:"CARACTERISTICAS FRENTE DE ARMARIO",body:`Medida de hueco: 2275x1390 mm.\r +Modelo: ARGO / Acabado: LACADO / Color: A DETERMINAR\r +Grosor hoja: 22 o 19 mm\r +Acabado de hojas: LISAS\r +Tirador: UÑERO A DETERMINAR\r +Acabado herrajes: CROMADO O ANTRACITA\r +Jambas perimetrales: VISTAS, REMETIDAS O COMBI A DETERMINAR.\r +Nº de hojas: 2\r +Compuesto por:`},{id:53,code:"CAP_INT_ARM_FORRADO_ES",title:"CARACTERISTICAS INTERIOR DE ARMARIO",body:`Acabado: MELAMINA / color: A DETERMINAR\r +Espesor bloque: 19 mm. / Espesor complementos: 19 mm.\r +Barras de colgar: CROMO/ NEGRA/ BRONCE\r +Frentes cristal cajones: RECTO / “U” – FLOAT BRONCE C-424\r +Tirador cajones: FRENTE BAJO / Cajones: 4 DE 180 MM. A DETERMINAR\r +Baldas deslizantes: X DE 145 MM. A DETERMINAR\r +Compuesto por:`},{id:54,code:"CAP_CLA_SEMI_SUSPENDIDO_ES",title:"Acabado: MELAMINA / color: A DETERMINAR",body:`Medida de Hueco: 2450x3000 mm.\r +Espesor bloque: 25 mm. / Espesor complementos: 25 mm.\r +Barras de colgar: CROMO/ NEGRA/ BRONCE\r +Frentes cristal cajones: RECTO / “U” – FLOAT BRONCE C-424\r +Tirador cajones: FRENTE BAJO / Cajones: 4 DE 180 MM. A DETERMINAR\r +Baldas deslizantes: X DE 145 MM. A DETERMINAR\r +Compuesto por:`},{id:2000000108,code:"CAP_INT_EST_CRISTAL_ES",title:"Acabado bastidores: ANODIZADO NEGRO",body:`Acabado panel bastidores laterales: CRISTAL TEMPLADO FLOAT BRONCE C-424\r +Acabado trasera: CRISTAL TEMPLADO FLOAT BRONCE C-424\r +Acabado complementos: MELAMINA / Color: ROBLE DENBER M-242\r +Espesor complementos: 25 mm.\r +Barras de colgar: NEGRA\r +Frentes cristal cajones: RECTO / “U” – FLOAT BRONCE C-424 \r +Tirador cajones: xxxxx / Cajones: 4 DE 180 MM.\r +Compuesto por:`}],en:[{id:2000000098,code:"CAP_CLA_SEMI_SUSPENDIDO_EN",title:"Finish: MELAMINE / colour: TO BE DETERMINED",body:`Size of opening: 2450x3000 mm.\r +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 @@ -208,47 +250,42 @@ Panel finish: TRANSPARENT TEMPLARED \r Handle: DOUBLE PER DOOR\r Brake: DOUBLE PER DOOR (OPENING AND CLOSING)\r Guide: VISTA (DOUBLE EMBELLECEDOR)\r -Number of panels: 2 SLIDING + 2 FIXED`}],es:[{id:54,code:"CAP_CLA_SEMI_SUSPENDIDO_ES",title:"Acabado vestidor: MELAMINA / color: A DETERMINAR",body:`Espesor bloque: 25 mm. / Espesor complementos: 25 mm.\r -Barras de colgar: CROMO/ NEGRA/ BRONCE\r -Frentes cristal cajones: RECTO / “U” – FLOAT BRONCE C-424\r -Tirador cajones: FRENTE BAJO / Cajones: 4 DE 180 MM. A DETERMINAR\r -Baldas deslizantes: X DE 145 MM. A DETERMINAR\r -Compuesto por:`},{id:52,code:"CAP_FRE_ARM_ABATIBLE_ES",title:"CARACTERISTICAS FRENTE DE ARMARIO",body:`Medida de hueco: 2275x1390 mm.\r -Modelo: ARGO / Acabado: LACADO / Color: A DETERMINAR\r -Grosor hoja: 22 o 19 mm\r -Acabado de hojas: LISAS\r -Tirador: UÑERO A DETERMINAR\r -Acabado herrajes: CROMADO O ANTRACITA\r -Jambas perimetrales: VISTAS, REMETIDAS O COMBI A DETERMINAR.\r -Nº de hojas: 2\r -Compuesto por:`},{id:51,code:"CAP_FRE_ARM_CORREDERA_ES",title:"CARACTERISTICAS FRENTE DE ARMARIO CORREDERA",body:`Medida de Hueco:2440x5180mm.\r -Modelo: PANORAMIC P.O. / Acabado: LACADO / Color: BLANCO\r -Nº de lístelos: SIN LISTELOS / Acabado paneles: PANEL LACADO\r -Tirador:\r -Cerco perimetral: \r -Nº de hojas:\r -FRENO HIDRAULICO INCORPORADO O FRENO MAGNETICO INCORPORADO\r -Compuesto por:`},{id:53,code:"CAP_INT_ARM_FORRADO_ES",title:"CARACTERISTICAS INTERIOR DE ARMARIO",body:`Acabado: MELAMINA / color: A DETERMINAR\r -Espesor bloque: 19 mm. / Espesor complementos: 19 mm.\r -Barras de colgar: CROMO/ NEGRA/ BRONCE\r -Frentes cristal cajones: RECTO / “U” – FLOAT BRONCE C-424\r -Tirador cajones: FRENTE BAJO / Cajones: 4 DE 180 MM. A DETERMINAR\r -Baldas deslizantes: X DE 145 MM. A DETERMINAR\r -Compuesto por:`},{id:2000000108,code:"CAP_INT_EST_CRISTAL_ES",title:"Acabado bastidores: ANODIZADO NEGRO",body:`Acabado panel bastidores laterales: CRISTAL TEMPLADO FLOAT BRONCE C-424\r -Acabado trasera: CRISTAL TEMPLADO FLOAT BRONCE C-424\r -Acabado complementos: MELAMINA / Color: ROBLE DENBER M-242\r -Espesor complementos: 25 mm.\r -Barras de colgar: NEGRA\r -Frentes cristal cajones: RECTO / “U” – FLOAT BRONCE C-424 \r -Tirador cajones: xxxxx / Cajones: 4 DE 180 MM.\r -Compuesto por:`},{id:50,code:"CAP_SEP_AMBIENTES_ES",title:"CARACTERISTICAS SEPARACIÓN DE AMBIENTES",body:`Medida de Hueco: 2450x3000 mm.\r -Modelo: LYN / Acabado: ANODIZADO / Color: NEGRO\r -Nº de travesaños: 2 TRAVESAÑOS HORIZONTALES\r -Acabado paneles: TRANSPARENTE TEMPLADO \r -Tirador: DOBLE POR PUERTA\r -Freno: DOBLE POR PUERTA (APERTURA Y CIERRE)\r -Guía: VISTA (DOBLE EMBELLECEDOR)\r -Nº de hojas: 2 CORREDERAS + 2 FIJOS`}]},Ic=({onSelect:n})=>{const{i18n:o}=Pt(),r=o.resolvedLanguage||"es",a=Ac[r.toLowerCase()]??Ac.es;return i.jsx(uo,{className:"h-96",children:i.jsx("div",{className:"flex flex-col gap-2 p-4 pt-0",children:a&&a.sort((l,c)=>l.title.localeCompare(c.title)).map((l,c)=>i.jsx("button",{className:"flex flex-col items-start gap-2 p-3 text-sm text-left transition-all border rounded-lg hover:bg-accent",onClick:()=>n&&n(l,1),children:i.jsxs("div",{className:"flex flex-col w-full gap-1",children:[i.jsx("div",{className:"flex items-center",children:i.jsx("div",{className:"flex items-center gap-2",children:i.jsx("div",{className:"font-semibold",children:l.title})})}),i.jsx("div",{className:"text-xs line-clamp-2 text-muted-foreground",children:i.jsx("p",{dangerouslySetInnerHTML:{__html:l.body.substring(0,300).replace(`\r -`,"
")}})})]})},l.id))})})},Mw=({isOpen:n,onOpenChange:o,onSelect:r})=>Pd("(min-width: 768px)")?i.jsx(fr,{modal:!0,open:n,onOpenChange:o,children:i.jsxs(gr,{className:"w-full max-w-full md:w-9/12 lg:w-10/12",children:[i.jsxs(mr,{children:[i.jsx(hr,{children:w("quotes.blocks_picker_dialog.title")}),i.jsx(cs,{children:w("quotes.blocks_picker_dialog.description")})]}),i.jsx(Ic,{onSelect:r}),i.jsx(pr,{children:i.jsx(G,{type:"submit",onClick:()=>o(!1),children:w("common.close")})})]})}):i.jsx(nd,{open:n,onOpenChange:o,children:i.jsxs(rd,{children:[i.jsxs(id,{className:"text-left",children:[i.jsx(sd,{children:w("quotes.blocks_picker_dialog.title")}),i.jsx(ad,{children:w("quotes.blocks_picker_dialog.description")})]}),i.jsx(Ic,{onSelect:r}),i.jsx(od,{className:"pt-2",children:i.jsx(ld,{asChild:!0,children:i.jsx(G,{variant:"outline",children:w("common.close")})})})]})}),Dw=({isOpen:n,onOpenChange:o,onSelect:r})=>Pd("(min-width: 768px)")?i.jsx(fr,{modal:!0,open:n,onOpenChange:o,children:i.jsxs(gr,{className:"w-full max-w-full md:w-9/12 lg:w-10/12",children:[i.jsxs(mr,{children:[i.jsx(hr,{children:w("quotes.catalog_picker_dialog.title")}),i.jsx(cs,{children:w("quotes.catalog_picker_dialog.description")})]}),i.jsx(dr,{syncWithLocation:!1,initialPageSize:5,children:i.jsx(lo,{onSelect:r})}),i.jsx(pr,{children:i.jsx(G,{type:"submit",onClick:()=>o(!1),children:w("common.close")})})]})}):i.jsx(nd,{open:n,onOpenChange:o,children:i.jsxs(rd,{children:[i.jsxs(id,{className:"text-left",children:[i.jsx(sd,{children:w("quotes.catalog_picker_dialog.title")}),i.jsx(ad,{children:w("quotes.catalog_picker_dialog.description")})]}),i.jsx(dr,{syncWithLocation:!1,initialPageSize:5,children:i.jsx(lo,{onSelect:r})}),i.jsx(od,{className:"pt-2",children:i.jsx(ld,{asChild:!0,children:i.jsx(G,{variant:"outline",children:w("common.close")})})})]})}),Lw=({currency:n,language:o,defaultValues:r})=>{var te;const{toast:a}=Cn(),{control:l,getValues:c,setValue:d,watch:m}=xr(),p=m("show_line_discount_column")??!0,x=!!((te=c("items"))!=null&&te.some(V=>{var ge;return Number((ge=V.discount)==null?void 0:ge.amount)>0})),[v]=L.useState("dialog"),[j,y]=L.useState(!1),[_,E]=L.useState(!1),{fields:R,...O}=w0({control:l,name:"items"}),M=vw([{id:"description",accessorKey:"description",header:w("quotes.form_fields.items.description.label"),cell:({row:{index:V,original:ge}})=>ge!=null&&ge.id_article?i.jsx("div",{className:"min-h-10 whitespace-pre-wrap px-3 py-2 text-sm",children:ge.localized_description??ge.description}):i.jsx(zt,{autoSize:!0,name:`items.${V}.description`}),minSize:200,size:400},{id:"quantity",accessorKey:"quantity",header:()=>i.jsx("div",{className:"text-right",children:w("quotes.form_fields.items.quantity.label")}),cell:({row:{index:V}})=>i.jsx(nw,{scale:0,className:"text-right",name:`items.${V}.quantity`}),size:75},{id:"unit_price",accessorKey:"unit_price",header:()=>i.jsx("div",{className:"text-right",children:w("quotes.form_fields.items.unit_price.label")}),cell:({row:{index:V}})=>i.jsx(qa,{currency:n,language:o,scale:2,className:"text-right",name:`items.${V}.unit_price`}),size:125},{id:"subtotal_price",accessorKey:"subtotal_price",header:()=>i.jsx("div",{className:"text-right",children:w("quotes.form_fields.items.subtotal_price.label")}),cell:({row:{index:V}})=>i.jsx(qa,{variant:"ghost",currency:n,language:o,scale:2,readOnly:!0,className:"text-right",name:`items.${V}.subtotal_price`}),size:150},{id:"discount",accessorKey:"discount",header:()=>i.jsx("div",{className:"text-right",children:w("quotes.form_fields.items.discount.label")}),cell:({row:{index:V}})=>i.jsx(es,{scale:2,className:"text-right",name:`items.${V}.discount`}),size:100},{id:"total_price",accessorKey:"total_price",header:()=>i.jsx("div",{className:"text-right",children:w("quotes.form_fields.items.total_price.label")}),cell:({row:{index:V}})=>i.jsx(qa,{variant:"ghost",currency:n,language:o,scale:2,readOnly:!0,className:"font-semibold text-right",name:`items.${V}.total_price`}),size:150}],{enableDragHandleColumn:!0,enableSelectionColumn:!0}),$=L.useCallback((V,ge=1)=>{O.append({...V,quantity:{amount:100*ge,scale:Sn.DEFAULT_SCALE},unit_price:V.retail_price,discount:{amount:null,scale:2}}),a({title:w("quotes.catalog_picker_dialog.toast_article_added"),description:V.description})},[O]),q=L.useCallback(V=>{O.append({description:`${V.title} -${V.body}`,quantity:{amount:null,scale:Sn.DEFAULT_SCALE},unit_price:{amount:null,scale:Q0.DEFAULT_SCALE},discount:{amount:null,scale:2}}),a({title:w("quotes.blocks_picker_dialog.toast_article_added"),description:V.title})},[O]),[U,T]=L.useState(!1),k=[265,440,655],W=4;return v==="dialog"?i.jsxs("div",{className:"relative",children:[i.jsx(Ec,{actions:{...O,getItem:V=>c(`items.${V}`),pickCatalogArticle:()=>y(!0),pickBlock:()=>E(!0)},columns:M,data:R,defaultValues:r,showLineDiscountColumn:p,hasLineDiscounts:x,onShowLineDiscountColumnChange:V=>d("show_line_discount_column",V,{shouldDirty:!0})}),i.jsx(Dw,{onSelect:$,isOpen:j,onOpenChange:y}),i.jsx(Mw,{onSelect:q,isOpen:_,onOpenChange:E})]}):i.jsxs(V0,{direction:"horizontal",autoSaveId:"uecko.quotes.details_layout",className:"items-stretch h-full",children:[i.jsx(wc,{defaultSize:k[0],collapsedSize:W,collapsible:!0,minSize:50,maxSize:90,onCollapse:()=>{T(!0)},onExpand:()=>{T(!1)},className:he(U&&"min-w-[50px] transition-all duration-300 ease-in-out"),children:i.jsx(Ec,{actions:{...O,getItem:V=>c(`items.${V}`)},columns:M,data:R,defaultValues:r,showLineDiscountColumn:p,hasLineDiscounts:x,onShowLineDiscountColumnChange:V=>d("show_line_discount_column",V,{shouldDirty:!0})})}),i.jsx(B0,{withHandle:!0,className:"mx-3"}),i.jsx(wc,{defaultSize:k[1],minSize:10,children:i.jsx(dr,{syncWithLocation:!1,children:i.jsx(lo,{onSelect:$})})})]})},Tw=()=>{const{formState:n,control:o}=xr();return i.jsxs("div",{className:"grid gap-6 md:grid-cols-6",children:[i.jsxs(Ja,{className:"md:col-span-6",title:w("quotes.create.form_groups.general.title"),description:w("quotes.create.form_groups.general.desc"),actions:i.jsxs("div",{className:"grid min-w-48 gap-1",children:[i.jsx(wn,{htmlFor:"lang_code",className:"text-xs text-muted-foreground",children:w("quotes.form_fields.lang_code.label")}),i.jsx(Zi,{control:o,name:"lang_code",render:({field:r})=>i.jsxs(ar,{value:r.value||"es",onValueChange:r.onChange,children:[i.jsx(or,{id:"lang_code","aria-label":w("quotes.form_fields.lang_code.label"),children:i.jsx(lr,{placeholder:w("quotes.form_fields.lang_code.placeholder")})}),i.jsx(ur,{children:rn.map(a=>i.jsxs(xn,{value:a.code,children:[i.jsx("span",{"aria-hidden":"true",className:`mr-2 ${a.flagClassName}`}),a.name]},a.code))})]})})]}),children:[i.jsxs("div",{className:"grid grid-cols-6 gap-6",children:[i.jsx(On,{required:!0,className:"col-span-2",label:w("quotes.form_fields.customer_reference.label"),description:w("quotes.form_fields.customer_reference.desc"),disabled:n.disabled,placeholder:w("quotes.form_fields.customer_reference.placeholder"),name:"customer_reference"}),i.jsx(Gc,{required:!0,label:w("quotes.form_fields.date.label"),description:w("quotes.form_fields.date.desc"),disabled:n.disabled,placeholder:w("quotes.form_fields.date.placeholder"),name:"date"}),i.jsx(On,{label:w("quotes.form_fields.validity.label"),description:w("quotes.form_fields.validity.desc"),disabled:n.disabled,placeholder:w("quotes.form_fields.validity.placeholder"),name:"validity"}),i.jsx(zt,{className:"col-span-2",label:w("quotes.form_fields.payment_method.label"),description:w("quotes.form_fields.payment_method.desc"),disabled:n.disabled,placeholder:w("quotes.form_fields.payment_method.placeholder"),name:"payment_method"})]}),i.jsxs("div",{className:"grid grid-cols-6 gap-6",children:[i.jsx(zt,{className:"col-span-3",required:!0,label:w("quotes.form_fields.customer_information.label"),description:w("quotes.form_fields.customer_information.desc"),disabled:n.disabled,placeholder:w("quotes.form_fields.customer_information.placeholder"),name:"customer_information",errors:n.errors}),i.jsx(zt,{className:"col-span-3",label:w("quotes.form_fields.notes.label"),description:w("quotes.form_fields.notes.desc"),disabled:n.disabled,placeholder:w("quotes.form_fields.notes.placeholder"),name:"notes"})]})]}),i.jsx(Ja,{className:"hidden md:col-span-2",title:w("quotes.create.form_groups.status.title"),description:w("quotes.create.form_groups.status.desc"),children:i.jsxs("div",{className:"grid gap-6",children:[i.jsxs("div",{className:"grid gap-3",children:[i.jsx(wn,{htmlFor:"status",children:w("quotes.create.form_groups.status.title")}),i.jsxs(ar,{children:[i.jsx(or,{id:"status","aria-label":w("quotes.list.select_status"),children:i.jsx(lr,{placeholder:w("quotes.list.select_status")})}),i.jsxs(ur,{children:[i.jsx(xn,{value:"draft",children:w("quotes.status.draft")}),i.jsx(xn,{value:"published",children:w("quotes.status.ready")}),i.jsx(xn,{value:"archived",children:w("quotes.status.archived")})]})]})]}),i.jsx(On,{required:!0,label:w("quotes.form_fields.currency_code.label"),description:w("quotes.form_fields.currency_code.desc"),placeholder:w("quotes.form_fields.currency_code.placeholder"),name:"currency_code"})]})})]})},Kd=({id:n,onSentTo:o,disabled:r})=>{const a=()=>{o(n)};return i.jsxs(Kc,{children:[i.jsx(Wc,{asChild:!0,disabled:r,children:i.jsxs(G,{variant:"ghost",className:"h-10 gap-1 text-primary disabled:text-secondary-foreground",children:[i.jsx($0,{className:"w-4 h-4"}),w("quotes.quote_sent_to_editor.trigger_button")]})}),i.jsxs(Yc,{children:[i.jsxs(Qc,{children:[i.jsx(Xc,{children:w("quotes.quote_sent_to_editor.title")}),i.jsx(Zc,{children:w("quotes.quote_sent_to_editor.description")})]}),i.jsxs(Jc,{children:[i.jsx(ed,{children:w("common.cancel")}),i.jsx(td,{asChild:!0,children:i.jsx(G,{onClick:a,children:w("common.continue")})})]})]})]})},Ow=["draft","ready","delivered","accepted","rejected","archived"],Pw={draft:["draft","ready","archived"],ready:["ready","delivered","archived"],delivered:["delivered","accepted","rejected","archived"],accepted:["accepted","rejected","archived"],rejected:["rejected","accepted","archived"],archived:["archived","draft","ready","delivered","accepted","rejected"]},Wd=({type:n="button",status:o,onChangeStatus:r})=>{const[a,l]=L.useState(o),c=m=>l(m);L.useEffect(()=>{o&&l(o)},[o]);const d=()=>{a!==o&&r(a,o)};return i.jsxs(fr,{children:[i.jsx(Lc,{asChild:!0,children:n==="button"?i.jsxs(G,{size:"sm",variant:"outline",className:"h-8 gap-1",children:[i.jsx(S0,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"sr-only md:not-sr-only md:whitespace-nowrap",children:w("quotes.quote_status_editor.trigger_button")})]}):i.jsx(j0,{status:o,isEditable:!0})}),i.jsxs(gr,{children:[i.jsx(mr,{children:i.jsx(hr,{children:w("quotes.quote_status_editor.title")})}),i.jsx(C0,{}),i.jsx("div",{className:"grid gap-4 py-4",children:Ow.map(m=>{const p=!Pw[o].includes(m);return i.jsxs("div",{className:"flex items-start space-x-4",children:[i.jsx(yo,{id:m,checked:a===m,onCheckedChange:()=>c(m),disabled:p}),i.jsxs("div",{className:"grid gap-1.5 leading-none",children:[i.jsx(wn,{htmlFor:m,className:he("font-medium",p?"text-input":"text-foreground"),children:w(`quotes.quote_status_editor.status.${m}.title`)}),i.jsx("p",{className:he("text-sm",p?"text-input":"text-muted-foreground"),children:w(`quotes.quote_status_editor.status.${m}.description`)})]})]},m)})}),i.jsxs(pr,{className:"pt-6 border-t",children:[i.jsx(Qi,{asChild:!0,children:i.jsx(G,{type:"button",variant:"secondary",children:w("common.cancel")})}),i.jsx(Qi,{asChild:!0,children:i.jsx(G,{onClick:d,disabled:a===o,children:w("quotes.quote_status_editor.submit_button")})})]})]})]})},qw=({quoteId:n,className:o})=>{const r=Bt(),{toast:a}=Cn(),{useOne:l,useSetStatus:c,useSentTo:d,useDownloader:m,useDuplicate:p,getQuotePDFFilename:x}=Zr(),{data:v,status:j}=l(n),{mutate:y}=c(),{mutate:_}=d(n),{mutate:E}=p(),{download:R,...O}=m(),{formatCurrency:M,formatNumber:$}=Od({locale:(v==null?void 0:v.lang_code)||"ES"}),q=L.useMemo(()=>v?{subtotal_price:M(v.subtotal_price),discount:$(v.discount),discount_price:M(v.discount_price),tax:$(v.tax),tax_price:M(v.tax_price),total_price:M(v.total_price)}:{subtotal_price:"0,00 €",discount:"0",discount_price:"0,00 €",tax:"0",tax_price:"0,00 €",total_price:"0,00 €"},[v]),U=L.useMemo(()=>(v==null?void 0:v.status)==="accepted"&&!(v!=null&&v.date_sent),[v]),T=L.useMemo(()=>(v==null?void 0:v.status)==="accepted"&&!!(v!=null&&v.date_sent),[v]),k=K=>{y({id:v.id,newStatus:K},{onSuccess:()=>{a({description:w("quotes.quote_status_editor.toast_status_changed"),variant:"success"})}})},W=K=>{_({sent_date:y0(new Date)},{onSuccess:()=>{a({description:w("quotes.quote_sent_to_editor.toast_status_changed"),variant:"success"})}})},te=L.useCallback(()=>{a({description:w("quotes.downloading_dialog.toast_success"),variant:"success"})},[a]),V=L.useCallback(()=>{v&&R(v.id,x(v))},[v]);if(j==="error"||j!=="success")return null;if(!v)return i.jsx(Le,{className:he("overflow-hidden",o),children:i.jsx(Te,{className:"px-4 py-6 text-center",children:i.jsx("p",{className:"mx-auto",children:w("quotes.list.resume.select_quote")})})});const ge=K=>{E({id:K},{onSuccess(Ee){a({description:w("quotes.duplicate_action.toast_success"),variant:"success"}),r(`/quotes/edit/${Ee.id}`,{relative:"path"})}})},_e=K=>{y({id:K,newStatus:"archived"},{onSuccess:()=>{a({description:w("quotes.quote_status_editor.toast_status_changed",{newStatus:w("quotes.status.archived")}),variant:"success"})}})};return i.jsxs(i.Fragment,{children:[i.jsx(Gd,{...O,onFinishDownload:te}),i.jsx(ud,{defaultValue:"resume",children:i.jsxs(Le,{className:"w-[390px] overflow-hidden",children:[i.jsxs(ct,{className:"gap-3 border-b bg-accent",children:[i.jsxs(Ue,{className:"flex items-center justify-between text-lg",children:[i.jsx("span",{children:w("quotes.list.resume.title")}),i.jsx(Wd,{status:v.status,onChangeStatus:k,type:"badge"})]}),i.jsx("div",{className:"flex w-full mr-auto text-foreground",children:i.jsxs("div",{className:"flex justify-between w-full",children:[i.jsxs(cr,{className:"gap-0",children:[i.jsxs(Ye,{children:[i.jsx(Qe,{asChild:!0,children:i.jsxs(G,{variant:"outline",size:"icon",disabled:T,onClick:K=>{K.preventDefault(),r(`/quotes/edit/${v.id}`,{relative:"path"})},children:[i.jsx(pd,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:w("common.edit")})]})}),i.jsx(Xe,{children:i.jsx("p",{children:w("common.edit")})})]}),i.jsxs(Ye,{children:[i.jsx(Qe,{asChild:!0,children:i.jsxs(G,{variant:"outline",size:"icon",onClick:K=>{K.preventDefault(),ge(v.id)},children:[i.jsx(No,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:w("common.duplicate")})]})}),i.jsx(Xe,{children:i.jsx("p",{children:w("common.duplicate")})})]}),i.jsxs(Ye,{children:[i.jsx(Qe,{asChild:!0,children:i.jsxs(G,{variant:"outline",size:"icon",onClick:V,children:[i.jsx(gd,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:w("common.download")})]})}),i.jsx(Xe,{children:i.jsx("p",{children:w("common.download")})})]}),i.jsxs(Ye,{children:[i.jsx(Qe,{asChild:!0,children:i.jsxs(G,{variant:"outline",size:"icon",disabled:T,onClick:K=>{K.preventDefault(),_e(v.id)},children:[i.jsx(dd,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:w("common.archive")})]})}),i.jsx(Xe,{children:i.jsx("p",{children:w("common.archive")})})]})]}),i.jsx(cr,{children:i.jsx(Kd,{disabled:T||!U,id:v.id,onSentTo:W})})]})})]}),i.jsxs(Te,{className:"p-6 text-sm",children:[i.jsxs(cd,{className:"grid w-full grid-cols-2",children:[i.jsx(eo,{value:"resume",children:w("quotes.list.resume.tabs.resume")}),i.jsx(eo,{value:"preview",children:w("quotes.list.resume.tabs.preview")})]}),i.jsx(to,{value:"resume",className:"pt-4",children:i.jsxs("div",{className:"grid gap-3",children:[i.jsxs("div",{className:"grid gap-3",children:[i.jsx("div",{className:"font-semibold",children:w("quotes.list.resume.quote_information")}),i.jsxs("dl",{className:"grid gap-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("dt",{className:"text-muted-foreground",children:w("quotes.form_fields.reference.label")}),i.jsx("dd",{className:"font-medium",children:v.reference})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("dt",{className:"text-muted-foreground",children:w("quotes.form_fields.date.label")}),i.jsx("dd",{className:"font-medium",children:new Date(v.date).toLocaleDateString()})]}),i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsx("dt",{className:"text-muted-foreground whitespace-nowrap",children:w("quotes.form_fields.customer_reference.label")}),i.jsx("dd",{className:"font-medium text-right whitespace-break-spaces",children:v.customer_reference})]})]})]}),i.jsx(_n,{className:"my-4"}),i.jsxs("div",{className:"grid gap-3",children:[i.jsx("div",{className:"font-semibold",children:w("quotes.list.resume.customer_information")}),i.jsx("div",{children:v.customer_information})]}),i.jsx(_n,{className:"my-4"}),i.jsx("div",{className:"font-semibold",children:w("quotes.list.resume.price_information")}),i.jsxs("ul",{className:"grid gap-3",children:[i.jsxs("li",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-muted-foreground",children:w("quotes.form_fields.subtotal_price.label")}),i.jsx("span",{children:q.subtotal_price})]}),i.jsxs("li",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-muted-foreground",children:w("quotes.form_fields.discount_value.label",{value:q.discount})}),i.jsx("span",{children:q.discount_price})]}),i.jsxs("li",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-muted-foreground",children:w("quotes.form_fields.tax_value.label",{label:v.tax_label,value:q.tax})}),i.jsx("span",{children:q.tax_price})]}),i.jsxs("li",{className:"flex items-center justify-between font-semibold",children:[i.jsx("span",{className:"text-muted-foreground",children:w("quotes.form_fields.total_price.label")}),i.jsx("span",{children:q.total_price})]})]})]})}),i.jsx(to,{value:"preview",children:i.jsx(Hd,{quote:v})})]}),i.jsx(Rt,{className:"flex flex-row items-center px-6 py-3 border-t bg-accent",children:i.jsx("div",{className:"text-xs text-muted-foreground"})})]})})]})},kw=({status:n="all",preview:o=!1})=>{const r=Bt(),{toast:a}=Cn(),{t:l,i18n:c}=Pt(),d=L.useId(),m=L.useId(),{pagination:p,globalFilter:x,isFiltered:v}=kn(),[j,y]=L.useState(void 0),{useList:_,useDownloader:E,useSetStatus:R,useDuplicate:O,getQuotePDFFilename:M}=Zr(),{mutate:$}=R(),{mutate:q}=O(),{data:U,isPending:T,isError:k,error:W}=_({pagination:{pageIndex:p.pageIndex,pageSize:p.pageSize},status:n,quickSearchTerm:x}),{download:te,...V}=E(),ge=de=>{y(de)},_e=L.useCallback(()=>{a({description:l("quotes.downloading_dialog.toast_success")})},[a]),K=L.useCallback(de=>{r(`/quotes/edit/${de.id}`,{relative:"path"})},[r,a]),Ee=de=>{q({id:de},{onSuccess($e){a({description:l("quotes.duplicate_action.toast_success"),variant:"success"}),r(`/quotes/edit/${$e.id}`,{relative:"path"})}})},ke=de=>{$({id:de,newStatus:"archived"},{onSuccess:()=>{a({description:l("quotes.quote_status_editor.toast_status_changed",{newStatus:l("quotes.status.archived")}),variant:"success"})}})},Z=(de,$e)=>{$({id:de,newStatus:$e},{onSuccess:()=>{a({description:l("quotes.quote_status_editor.toast_status_changed",{newStatus:l(`quotes.status.${$e}`)}),variant:"success"})}})},tt=L.useMemo(()=>{const de=[{id:"reference",accessorKey:"reference",header:()=>i.jsx(i.Fragment,{children:l("quotes.list.columns.reference")}),cell:({row:{original:ne},renderValue:Ce})=>{const vt=!!((ne==null?void 0:ne.status)==="accepted"&&(ne!=null&&ne.date_sent));return i.jsx(G,{size:"sm",variant:"link",disabled:vt,className:"h-8 gap-1 px-0 text-left text-ellipsis",onClick:_r=>{_r.preventDefault(),K(ne)},children:i.jsx("div",{className:"",children:Ce()})})}},{id:"status",accessorKey:"status",header:()=>i.jsx(i.Fragment,{children:l("quotes.list.columns.status")}),cell:({row:{original:ne}})=>i.jsx(Wd,{type:"badge",status:ne.status,onChangeStatus:Ce=>Z(ne.id,Ce)})},{id:"date_sent",accessor:"date_sent",header:()=>i.jsx("div",{className:"text-left text-ellipsis",children:l("quotes.list.columns.date_sent")}),cell:({row:{original:ne}})=>{const Ce=rr.create(ne.date_sent),vt=Ce.isSuccess&&!Ce.object.isEmpty();return i.jsx("div",{className:"text-left text-ellipsis",children:vt?i.jsx(Ld,{label:Ce.object.toLocaleDateString("es-ES"),className:"text-green-800 bg-green-100 hover:text-green-800 hover:bg-green-100"}):i.jsx(i.Fragment,{})})}},{id:"date",accessor:"date",header:()=>i.jsx("div",{className:"text-left text-ellipsis",children:l("quotes.list.columns.date")}),cell:({row:{original:ne}})=>{const Ce=rr.create(ne.date);return i.jsx("div",{className:"text-left text-ellipsis",children:Ce.isSuccess?Ce.object.toLocaleDateString("es-ES"):"-"})}},{id:"customer_reference",accessorKey:"customer_reference",header:()=>i.jsx(i.Fragment,{children:l("quotes.list.columns.customer_reference")}),cell:({renderValue:ne})=>i.jsx("div",{className:"text-left text-ellipsis",children:ne()})},{id:"customer_information",accessorKey:"customer_information",header:()=>i.jsx(i.Fragment,{children:l("quotes.list.columns.customer_information")}),cell:({row:{original:ne}})=>i.jsx("div",{className:"text-left text-ellipsis",children:ne.customer_information.split(` -`).map((Ce,vt)=>i.jsxs("span",{className:vt===0?"font-medium":"hidden text-sm text-muted-foreground md:inline",children:[Ce,i.jsx("br",{})]},vt))}),size:500}],$e=[{id:"row-actions",header:()=>null,cell:({row:{original:ne}})=>{const Ce=(ne==null?void 0:ne.status)==="accepted"&&!(ne!=null&&ne.date_sent),vt=(ne==null?void 0:ne.status)==="accepted"&&!!(ne!=null&&ne.date_sent),_r=(ne==null?void 0:ne.status)==="archived";return i.jsxs("div",{className:"flex gap-1",children:[i.jsxs(cr,{className:"gap-0",children:[i.jsxs(Ye,{children:[i.jsx(Qe,{asChild:!0,children:i.jsxs(G,{variant:"ghost",size:"icon",disabled:vt,onClick:yn=>{yn.preventDefault(),K(ne)},children:[i.jsx(pd,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:l("common.edit")})]})}),i.jsx(Xe,{children:i.jsx("p",{children:l("common.edit")})})]}),i.jsxs(Ye,{children:[i.jsx(Qe,{asChild:!0,children:i.jsxs(G,{variant:"ghost",size:"icon",onClick:yn=>{yn.preventDefault(),Ee(ne.id)},children:[i.jsx(No,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:l("common.duplicate")})]})}),i.jsx(Xe,{children:i.jsx("p",{children:l("common.duplicate")})})]}),i.jsxs(Ye,{children:[i.jsx(Qe,{asChild:!0,children:i.jsxs(G,{variant:"ghost",size:"icon",onClick:()=>{te(ne.id,M(ne))},children:[i.jsx(gd,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:l("common.download")})]})}),i.jsx(Xe,{children:i.jsx("p",{children:l("common.download")})})]}),i.jsxs(Ye,{children:[i.jsx(Qe,{asChild:!0,children:i.jsxs(G,{variant:"ghost",size:"icon",disabled:_r||vt,onClick:yn=>{yn.preventDefault(),ke(ne.id)},children:[i.jsx(dd,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:l("common.archive")})]})}),i.jsx(Xe,{children:i.jsx("p",{children:l("common.archive")})})]})]}),i.jsx(cr,{children:i.jsx(Kd,{id:ne.id,onSentTo:()=>null,disabled:vt||!Ce})})]})}}];return o?de:[...de,...$e]},[o,l,c.resolvedLanguage]),{table:Oe}=hs({data:(U==null?void 0:U.items)??[],columns:tt,pageCount:(U==null?void 0:U.total_pages)??-1});return L.useEffect(()=>{Oe&&U&&(U==null?void 0:U.total_pages)>0&&y(Oe.getRowModel().rows[0])},[U,Oe]),k?i.jsx(vr,{subtitle:W.message}):T?i.jsxs("div",{className:"grid items-start flex-1 gap-4 sm:py-0 md:gap-8 lg:grid-cols-3 xl:grid-cols-3",children:[i.jsx(Le,{className:"grid items-start gap-4 auto-rows-max md:gap-8 lg:col-span-2",children:i.jsx(Te,{children:i.jsx(gs,{columnCount:6,searchableColumnCount:1,filterableColumnCount:2,shrinkZero:!0})})}),i.jsx("div",{})]}):(U==null?void 0:U.total_items)===0&&!v?i.jsx(Le,{children:i.jsx(Te,{children:i.jsx(ms,{subtitle:l("quotes.list.empty_state.subtitle"),buttonText:l("quotes.create.title"),onButtonClick:()=>r("add",{relative:"path"})})})}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex flex-col items-stretch flex-1 gap-4 xl:flex-row",children:[i.jsx("div",{id:d,className:"flex items-stretch flex-1",children:i.jsx(fs,{table:Oe,paginationOptions:{visible:!0},className:"grid items-start flex-1 gap-4 auto-rows-max md:gap-8 lg:col-span-2",onRowClick:ge,activeRowIndex:j==null?void 0:j.index,children:i.jsx(Vd,{table:Oe})})}),o&&i.jsx("div",{id:m,className:"flex items-stretch ",children:i.jsx(qw,{quoteId:j==null?void 0:j.original.id})})]}),i.jsx(Gd,{...V,onFinishDownload:_e})]})},rS=()=>{const n=Bt(),o=Sw(),{toast:r}=Cn(),[a,l]=L.useState(ka.createDefaultCode().object),[c,d]=L.useState(Gr.createDefaultCode().object),m=L.useMemo(()=>({date:"",reference:"",customer_reference:"",customer_information:"",lang_code:"",currency_code:"",payment_method:"",notes:"",validity:"",show_line_discount_column:!0,subtotal_price:{amount:void 0,scale:2,currency_code:""},discount:{amount:0,scale:0},discount_price:{amount:0,scale:0,currency_code:""},before_tax_price:{amount:void 0,scale:2,currency_code:""},tax:{amount:void 0,scale:0},tax_label:"% IVA",tax_price:{amount:void 0,scale:2,currency_code:""},total_price:{amount:void 0,scale:2,currency_code:""},items:[{id_article:"",description:"",quantity:{amount:null,scale:2},unit_price:{amount:null,scale:2,currency_code:a.code},subtotal_price:{amount:null,scale:2,currency_code:a.code},discount:{amount:null,scale:2},total_price:{amount:null,scale:2,currency_code:a.code}}]}),[a.code]),{useOne:p,useUpdate:x}=Zr(),{data:v,status:j,error:y}=p(o),{mutate:_,isPending:E}=x(String(o)),R=os({mode:"onBlur",defaultValues:m}),{getValues:O,reset:M,handleSubmit:$,formState:q,control:U,watch:T,setValue:k}=R,{isSubmitting:W,isDirty:te}=q;Lo({isDirty:te}),L.useEffect(()=>{if(!te)return;const{unsubscribe:_e}=T((K,{name:Ee,type:ke})=>{if(Ee==="items"){K.items&&K.items.map((tt,Oe)=>{if(tt){const de=oo(tt);Fe.isEqual(de.subtotal_price.toObject(),tt.subtotal_price)||k(`items.${Oe}.subtotal_price`,de.subtotal_price.toObject()),Fe.isEqual(de.total_price.toObject(),tt.total_price)||k(`items.${Oe}.total_price`,de.total_price.toObject())}});const Z=Qa(K,!0);Fe.isEqual(Z.subtotal_price.toObject(),K.total_price)||k("subtotal_price",Z.subtotal_price.toObject()),Fe.isEqual(Z.discount_price.toObject(),K.total_price)||k("discount_price",Z.discount_price.toObject()),Fe.isEqual(Z.before_tax_price.toObject(),K.before_tax_price)||k("before_tax_price",Z.before_tax_price.toObject()),Fe.isEqual(Z.tax_price.toObject(),K.tax_price)||k("tax_price",Z.tax_price.toObject()),Fe.isEqual(Z.total_price.toObject(),K.total_price)||k("total_price",Z.total_price.toObject())}else if(Ee&&ke==="change"){if(Ee==="currency_code"){const Z=ka.createFromCode(K.currency_code??ka.DEFAULT_CURRENCY_CODE);if(Z.isFailure)throw console.error(Z.error),Z.error;l(Z.object)}if(Ee==="lang_code"){const Z=Gr.createFromCode(K.lang_code??Gr.DEFAULT_LANGUAGE_CODE);if(Z.isFailure)throw console.error(Z.error),Z.error;d(Z.object)}if(["discount","tax"].includes(Ee)){const Z=Qa(K,!0);Fe.isEqual(Z.subtotal_price.toObject(),K.total_price)||k("subtotal_price",Z.subtotal_price.toObject()),Fe.isEqual(Z.discount_price.toObject(),K.total_price)||k("discount_price",Z.discount_price.toObject()),Fe.isEqual(Z.before_tax_price.toObject(),K.before_tax_price)||k("before_tax_price",Z.before_tax_price.toObject()),Fe.isEqual(Z.tax_price.toObject(),K.tax_price)||k("tax_price",Z.tax_price.toObject()),Fe.isEqual(Z.total_price.toObject(),K.total_price)||k("total_price",Z.total_price.toObject())}if(Ee!=null&&Ee.startsWith("items")){const Z=Number(Ee.split(".")[1]),tt=Ee.split(".")[2];if(["quantity","unit_price","discount"].includes(tt)&&K.items&&K.items[Z]){const Oe=K.items[Z],de=oo(Oe);Fe.isEqual(de.quantity.toObject(),Oe.quantity)||k(`items.${Z}.quantity`,de.quantity.toObject()),Fe.isEqual(de.unit_price.toObject(),Oe.unit_price)||k(`items.${Z}.unit_price`,de.unit_price.toObject()),Fe.isEqual(de.discount.toObject(),Oe.discount)||k(`items.${Z}.discount`,de.discount.toObject()),Fe.isEqual(de.subtotal_price.toObject(),Oe.subtotal_price)||k(`items.${Z}.subtotal_price`,de.subtotal_price.toObject()),Fe.isEqual(de.total_price.toObject(),Oe.total_price)||k(`items.${Z}.total_price`,de.total_price.toObject());const $e=Qa(K,!0);Fe.isEqual($e.subtotal_price.toObject(),K.total_price)||k("subtotal_price",$e.subtotal_price.toObject()),Fe.isEqual($e.discount_price.toObject(),K.total_price)||k("discount_price",$e.discount_price.toObject()),Fe.isEqual($e.before_tax_price.toObject(),K.before_tax_price)||k("before_tax_price",$e.before_tax_price.toObject()),Fe.isEqual($e.tax_price.toObject(),K.tax_price)||k("tax_price",$e.tax_price.toObject()),Fe.isEqual($e.total_price.toObject(),K.total_price)||k("total_price",$e.total_price.toObject())}}}});return()=>_e()},[T,te,k]);const V=async(_e,K)=>{const Ee={..._e,items:_e.items.map(({localized_description:ke,...Z})=>Z)};_(Ee,{onError:ke=>{console.error(ke),r({title:w("common.error"),description:ke.message,variant:"destructive"})},onSuccess:()=>{M(O()),r({title:w("quotes.notifications.saved"),variant:"success"}),K&&n("/quotes")}})},ge=L.useCallback(()=>{n("/quotes",{state:{id:o}})},[n,o]);return L.useEffect(()=>{j==="success"&&v&&M(v)},[j,v,M]),j==="error"?i.jsx(vr,{errorMessage:y.message}):j!=="success"?i.jsx(qn,{}):i.jsxs(i.Fragment,{children:[(W||E)&&i.jsx(qn,{title:w("quotes.notifications.saving")}),i.jsx(ls,{...R,children:i.jsx("form",{onSubmit:$(_e=>V(_e,!1)),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.jsxs("h1",{className:"flex-1 text-xl font-semibold tracking-tight shrink-0 whitespace-nowrap sm:grow-0",children:[w("quotes.edit.title")," ",v.reference]}),i.jsx(Ld,{label:w(`quotes.status.${v.status}`),className:"ml-auto sm:ml-0"}),i.jsxs("div",{className:"items-center hidden gap-2 md:ml-auto md:flex",children:[i.jsx(N0,{label:w("common.close"),variant:"secondary",size:"sm",onClick:ge}),i.jsx(Co,{label:w("common.save"),size:"sm",disabled:q.isSubmitting||q.isLoading||q.isValidating}),i.jsx(G,{size:"sm",disabled:q.isSubmitting||q.isLoading||q.isValidating,onClick:$(_e=>V(_e,!0)),children:w("common.save_close")})]})]}),i.jsx(Tw,{}),i.jsx(Cw,{currency:a}),i.jsx(Lw,{currency:a,language:c,defaultValues:m}),i.jsxs("div",{className:"flex items-center justify-center gap-2 md:hidden",children:[i.jsx(G,{variant:"outline",size:"sm",children:w("common.discard")}),i.jsx(G,{onClick:$(_e=>V(_e,!1)),size:"sm",children:w("quotes.edit.buttons.save_quote")})]})]})})}),!1]})},$w=L.createContext(null),zw=({children:n})=>{const[o,r]=Vc();return i.jsx($w.Provider,{value:{pagination:o,setPagination:r},children:n})},iS=({children:n})=>i.jsx(us,{children:i.jsx(zw,{children:i.jsxs(Yr,{className:"quotes-layout",children:[i.jsx(Qr,{}),i.jsx(Xr,{children:n})]})})}),sS=()=>{const{t:n}=Pt(),o=Bt(),[r,a]=L.useState("all"),[l,c]=iw(!0),d=[{value:"all",label:n("quotes.list.tabs.all")},{value:"draft",label:n("quotes.list.tabs.draft")},{value:"ready",label:n("quotes.list.tabs.ready")},{value:"delivered",label:n("quotes.list.tabs.delivered")},{value:"accepted",label:n("quotes.list.tabs.accepted")},{value:"rejected",label:n("quotes.list.tabs.rejected")},{value:"archived",label:n("quotes.list.tabs.archived")}];return i.jsxs(dr,{children:[i.jsxs("div",{className:"flex items-center justify-between space-y-2",children:[i.jsxs("div",{children:[i.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:i.jsx(se,{i18nKey:"quotes.list.title"})}),i.jsx("p",{className:"text-muted-foreground",children:i.jsx(se,{i18nKey:"quotes.list.subtitle"})})]}),i.jsx("div",{className:"flex items-center space-x-2",children:i.jsxs(G,{onClick:()=>o("/quotes/add"),children:[i.jsx(Eo,{className:"w-4 h-4 mr-2"}),n("quotes.create.title")]})})]}),i.jsxs(ud,{value:r,onValueChange:a,children:[i.jsxs("div",{className:"flex flex-col items-start justify-between mb-4 sm:flex-row sm:items-center",children:[i.jsxs("div",{className:"w-full mb-4 sm:w-auto sm:mb-0",children:[i.jsx(cd,{className:"hidden sm:flex",children:d.map(m=>i.jsx(eo,{value:m.value,children:m.label},m.value))}),i.jsxs("div",{className:"flex items-center w-full space-x-2 sm:hidden",children:[i.jsx(wn,{children:n("quotes.list.tabs_title")}),i.jsxs(ar,{value:r,onValueChange:a,children:[i.jsx(or,{children:i.jsx(lr,{placeholder:n("quotes.list.select_status")})}),i.jsx(ur,{children:d.map(m=>i.jsx(xn,{value:m.value,children:m.label},m.value))})]})]})]}),i.jsx("div",{className:"flex items-baseline justify-center mr-4 font-medium",children:i.jsx(Yb,{buttonText:n("common.help"),title:n("quotes.list.status_help.title"),content:i.jsx(Vw,{})})}),i.jsx("div",{className:"flex items-center gap-2 ml-auto",children:i.jsx(R0,{"aria-label":n("quotes.list.preview_aria"),variant:"outline",defaultPressed:!1,pressed:l,onPressedChange:c,children:l?i.jsxs(i.Fragment,{children:[i.jsx(md,{className:"w-4 h-4 mr-2"}),n("common.disable_preview")]}):i.jsxs(i.Fragment,{children:[i.jsx(O0,{className:"w-4 h-4 mr-2"}),n("common.enable_preview")]})})})]}),d.map(m=>i.jsx(to,{value:m.value,children:i.jsx(kw,{status:m.value,preview:l})},m.value))]})]})},Vw=()=>{const{t:n}=Pt();return i.jsxs(uo,{className:"grid gap-4 py-4",children:[i.jsx("p",{children:n("quotes.list.status_help.intro")}),i.jsx("p",{children:n("quotes.list.status_help.possible")}),i.jsxs("ul",{className:"pl-6 space-y-2 list-disc",children:[i.jsxs("li",{children:[i.jsxs("strong",{children:[n("quotes.status.draft"),":"]})," ",n("quotes.quote_status_editor.status.draft.description")]}),i.jsxs("li",{children:[i.jsxs("strong",{children:[n("quotes.status.ready"),":"]})," ",n("quotes.quote_status_editor.status.ready.description")]}),i.jsxs("li",{children:[i.jsxs("strong",{children:[n("quotes.status.delivered"),":"]})," ",n("quotes.quote_status_editor.status.delivered.description")]}),i.jsxs("li",{children:[i.jsxs("strong",{children:[n("quotes.status.accepted"),":"]})," ",n("quotes.quote_status_editor.status.accepted.description")]}),i.jsxs("li",{children:[i.jsxs("strong",{children:[n("quotes.status.rejected"),":"]})," ",n("quotes.quote_status_editor.status.rejected.description")]}),i.jsxs("li",{children:[i.jsxs("strong",{children:[n("quotes.status.archived"),":"]})," ",n("quotes.quote_status_editor.status.archived.description")]})]}),i.jsx("p",{children:n("quotes.list.status_help.outro")})]})},Bw=n=>{const o=Wr(),r=Pn(),a=r().data().resource("settings").action("one").id("me").params().get(),l=r().auth().action("profile").get();return{useOne:()=>wd({queryKey:a,queryFn:()=>o.getOne({resource:"profile",id:""}),...n}),useUpdate:()=>{const c=tn();return nn({mutationKey:a,mutationFn:d=>o.updateOne({resource:"profile",data:d,id:""}),onSuccess:(d,m)=>{const p=x=>x&&{...x,lang_code:m.lang_code??x.lang_code,dealer:{...x.dealer,...d}};return c.setQueryData(a,p),c.setQueryData(l,p),Promise.all([c.invalidateQueries({queryKey:a}),c.invalidateQueries({queryKey:l})])}})},useUploadLogo:()=>{const c=tn(),{mutate:d,mutateAsync:m,...p}=nn({mutationKey:["data","default","settings"],mutationFn:x=>o.uploadFile({path:"profile/logo",file:x,key:"logo"}),onError:()=>c.invalidateQueries({queryKey:["data","default","settings"]}),onSuccess:()=>{c.invalidateQueries({queryKey:["data","default","settings"]})}});return{upload:d,uploadAsync:m,...p}}}},aS=()=>{var k,W;const[n,o]=L.useState("profile"),{useOne:r,useUpdate:a,useUploadLogo:l}=Bw(),{toast:c}=Cn(),{i18n:d}=Pt(),{data:m,status:p,error:x}=r(),v=L.useMemo(()=>({lang_code:"es",contact_information:"",default_payment_method:"",default_notes:"",default_legal_terms:"",default_quote_validity:"",default_show_line_discount_column:!0,default_tax:{amount:void 0,scale:2},default_tax_label:"% IVA"}),[]),{mutate:j}=a(),{upload:y}=l(),_=os({mode:"onBlur",values:m?{...m.dealer,lang_code:m.lang_code}:void 0,defaultValues:v}),{formState:E,reset:R,getValues:O,handleSubmit:M}=_,{isSubmitting:$,isDirty:q}=E,U=te=>{var ge;const V=(ge=te.target.files)==null?void 0:ge[0];if(V){if(V.type!=="image/png"&&V.type!=="image/jpeg"){alert(w("settings.form_fields.logo.invalid_format"));return}const _e=new FileReader;_e.onloadend=()=>{const K=new Image;K.onload=()=>{const Ee=K.width,ke=K.height,Z=Ee/ke===2;Ee<200||ke<100||!Z?alert(w("settings.form_fields.logo.invalid_dimensions")):y(V)},K.src=_e.result},_e.readAsDataURL(V)}};Lo({isDirty:q});const T=async te=>{j(te,{onError:V=>{console.debug(V),c({title:w("common.error"),description:V.message,variant:"destructive"})},onSuccess:()=>{d.language!==te.lang_code&&d.changeLanguage(te.lang_code??"es"),R(O()),c({description:w("settings.notifications.saved"),variant:"success"})}})};return $?i.jsx(qn,{title:w("settings.notifications.saving")}):p==="error"?i.jsx(vr,{errorMessage:x.message}):p!=="success"?i.jsx(qn,{}):i.jsx(ls,{..._,children:i.jsx("form",{onSubmit:M(T),children:i.jsxs("div",{className:"mx-auto grid w-full max-w-6xl items-start gap-6 md:grid-cols-[180px_1fr] lg:grid-cols-[250px_1fr]",children:[((k=_.formState.errors.root)==null?void 0:k.message)&&i.jsxs(kc,{variant:"destructive",children:[i.jsx(fd,{className:"w-4 h-4"}),i.jsx($c,{children:i.jsx(se,{i18nKey:"common.error"})}),i.jsx(zc,{children:(W=_.formState.errors.root)==null?void 0:W.message})]}),i.jsxs("nav",{className:"grid gap-4 text-sm text-muted-foreground",children:[i.jsx("a",{onClick:()=>o("profile"),className:n==="profile"?"font-semibold text-primary":"cursor-pointer",children:i.jsx(se,{i18nKey:"settings.edit.tabs.profile"})}),i.jsx("a",{onClick:()=>o("quotes"),className:n==="quotes"?"font-semibold text-primary":"cursor-pointer ",children:i.jsx(se,{i18nKey:"settings.edit.tabs.quotes"})}),i.jsx("a",{onClick:()=>o("legal"),className:n==="legal"?"font-semibold text-primary":"cursor-pointer ",children:i.jsx(se,{i18nKey:"settings.edit.tabs.legal"})})]}),i.jsxs("div",{className:he("grid gap-6",n==="profile"?"visible":"hidden"),children:[i.jsxs(Le,{children:[i.jsxs(ct,{children:[i.jsx(Ue,{children:i.jsx(se,{i18nKey:"settings.form_fields.language.label"})}),i.jsx(We,{children:i.jsx(se,{i18nKey:"settings.form_fields.language.desc"})})]}),i.jsx(Te,{children:i.jsx(Zi,{control:_.control,name:"lang_code",render:({field:te})=>i.jsxs(ar,{value:te.value,onValueChange:te.onChange,children:[i.jsx(or,{"aria-label":w("settings.form_fields.language.label"),children:i.jsx(lr,{placeholder:w("settings.form_fields.language.placeholder")})}),i.jsx(ur,{children:rn.map(V=>i.jsxs(xn,{value:V.code,children:[i.jsx("span",{"aria-hidden":"true",className:`mr-2 ${V.flagClassName}`}),V.name]},V.code))})]})})}),i.jsx(Rt,{className:"px-6 py-4 border-t",children:i.jsx(G,{children:i.jsx(se,{i18nKey:"common.save"})})})]}),i.jsxs(Le,{children:[i.jsxs(ct,{children:[i.jsx(Ue,{children:i.jsx(se,{i18nKey:"settings.form_fields.contact_information.label"})}),i.jsx(We,{children:i.jsx(se,{i18nKey:"settings.form_fields.contact_information.desc"})})]}),i.jsx(Te,{children:i.jsx(zt,{rows:8,placeholder:w("settings.form_fields.contact_information.placeholder"),name:"contact_information",required:!0})}),i.jsx(Rt,{className:"px-6 py-4 border-t",children:i.jsx(G,{children:i.jsx(se,{i18nKey:"common.save"})})})]}),i.jsxs(Le,{children:[i.jsxs(ct,{children:[i.jsx(Ue,{children:i.jsx(se,{i18nKey:"settings.form_fields.logo.label"})}),i.jsx(We,{children:i.jsx(se,{i18nKey:"settings.form_fields.logo.desc"})})]}),i.jsx(Te,{children:i.jsxs("div",{className:"flex items-center space-x-4",children:[i.jsx("div",{className:"w-[400px] h-[200px] border border-gray-300 flex items-center justify-center overflow-hidden",children:i.jsx("img",{src:m.dealer.logo?m.dealer.logo:"https://via.placeholder.com/200x100",width:400,height:200,style:{objectFit:"contain"}})}),i.jsx("div",{children:i.jsx("p",{className:"mt-2 text-sm text-gray-500",children:i.jsx(se,{i18nKey:"settings.form_fields.logo.requirements"})})})]})}),i.jsxs(Rt,{className:"px-6 py-4 border-t",children:[i.jsx(wn,{htmlFor:"logo-upload",className:"inline-flex items-center justify-center h-10 px-4 py-2 text-sm font-medium transition-colors rounded-md cursor-pointer bg-primary text-primary-foreground hover:bg-primary/90 whitespace-nowrap ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",children:i.jsx(se,{i18nKey:"settings.form_fields.logo.upload"})}),i.jsx(as,{id:"logo-upload",type:"file",accept:".png,.jpg,.jpeg",onChange:U,className:"hidden"})]})]})]}),i.jsxs("div",{className:he("grid gap-6",n==="quotes"?"visible":"hidden"),children:[i.jsxs(Le,{children:[i.jsxs(ct,{children:[i.jsx(Ue,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_show_line_discount_column.label"})}),i.jsx(We,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_show_line_discount_column.desc"})})]}),i.jsx(Te,{children:i.jsx(Zi,{control:_.control,name:"default_show_line_discount_column",render:({field:te})=>i.jsx(yo,{checked:te.value??!0,onCheckedChange:te.onChange})})}),i.jsx(Rt,{className:"px-6 py-4 border-t",children:i.jsx(G,{children:i.jsx(se,{i18nKey:"common.save"})})})]}),i.jsxs(Le,{children:[i.jsxs(ct,{children:[i.jsx(Ue,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_tax.label"})}),i.jsx(We,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_tax.desc"})})]}),i.jsxs(Te,{children:[i.jsx(On,{maxLength:32,placeholder:w("settings.form_fields.default_tax_label.placeholder"),name:"default_tax_label",required:!0,description:w("settings.form_fields.default_tax_label.desc")}),i.jsx("br",{}),i.jsx(es,{scale:2,disabled:E.disabled,placeholder:w("settings.form_fields.default_tax.desc"),name:"default_tax",required:!0,description:w("settings.form_fields.default_tax.desc")})]}),i.jsx(Rt,{className:"px-6 py-4 border-t",children:i.jsx(G,{children:i.jsx(se,{i18nKey:"common.save"})})})]}),i.jsxs(Le,{children:[i.jsxs(ct,{children:[i.jsx(Ue,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_payment_method.label"})}),i.jsx(We,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_payment_method.desc"})})]}),i.jsx(Te,{children:i.jsx(zt,{autoSize:!0,placeholder:w("settings.form_fields.default_payment_method.placeholder"),name:"default_payment_method",required:!0,errors:_.formState.errors})}),i.jsx(Rt,{className:"px-6 py-4 border-t",children:i.jsx(G,{children:i.jsx(se,{i18nKey:"common.save"})})})]}),i.jsxs(Le,{children:[i.jsxs(ct,{children:[i.jsx(Ue,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_quote_validity.label"})}),i.jsx(We,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_quote_validity.desc"})})]}),i.jsx(Te,{children:i.jsx(zt,{autoSize:!0,placeholder:w("settings.form_fields.default_quote_validity.placeholder"),name:"default_quote_validity",required:!0})}),i.jsx(Rt,{className:"px-6 py-4 border-t",children:i.jsx(G,{children:i.jsx(se,{i18nKey:"common.save"})})})]}),i.jsxs(Le,{children:[i.jsxs(ct,{children:[i.jsx(Ue,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_notes.label"})}),i.jsx(We,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_notes.desc"})})]}),i.jsx(Te,{children:i.jsx(zt,{autoSize:!0,placeholder:w("settings.form_fields.default_notes.placeholder"),name:"default_notes"})}),i.jsx(Rt,{className:"px-6 py-4 border-t",children:i.jsx(G,{children:i.jsx(se,{i18nKey:"common.save"})})})]})]}),i.jsx("div",{className:he("grid gap-6",n==="legal"?"visible":"hidden"),children:i.jsxs(Le,{className:"h-",children:[i.jsxs(ct,{children:[i.jsx(Ue,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_legal_terms.label"})}),i.jsx(We,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_legal_terms.desc"})})]}),i.jsx(Te,{children:i.jsx(zt,{rows:25,placeholder:w("settings.form_fields.default_legal_terms.placeholder"),name:"default_legal_terms"})}),i.jsx(Rt,{className:"px-6 py-4 border-t",children:i.jsx(G,{children:i.jsx(se,{i18nKey:"common.save"})})})]})})]})})})},Uw=L.createContext(null),Gw=({children:n})=>i.jsx(Uw.Provider,{value:{},children:n}),oS=({children:n})=>i.jsx(us,{children:i.jsx(Gw,{children:i.jsxs(Yr,{className:"settings-layout",children:[i.jsx(Qr,{}),i.jsxs(Xr,{children:[i.jsx("div",{className:"grid w-full max-w-6xl gap-2 mx-auto",children:i.jsx("h1",{className:"text-2xl font-semibold md:text-3xl",children:i.jsx(se,{i18nKey:"settings.edit.title"})})}),n]})]})})});export{Qw as CatalogLayout,Xw as CatalogList,Zw as DashboardPage,Jw as DealerLayout,eS as DealersList,tS as ErrorPage,Ww as LoginPageWithLanguageSelector,Yw as LogoutPage,nS as QuoteCreate,rS as QuoteEdit,iS as QuotesLayout,sS as QuotesList,aS as SettingsEditor,oS as SettingsLayout}; +Number of panels: 2 SLIDING + 2 FIXED`}],fr:[{id:2000000121,code:"CAP_CLA_SEMI_SUSPENDIDO_FR",title:"Finition : MÉLAMINE / Couleur : À DÉTERMINER",body:`Épaisseur du bloc : 19 mm / Épaisseur des accessoires : 19 mm\r +Barres de penderie : CHROME / NOIR\r +Façades des tiroirs en verre : DROITE / “U” – FLOAT BRONZE C-424\r +Poignée des tiroirs : xxxxx\r +Tiroirs : 4 DE 180 MM\r +Porte de chaussures : OUI / NON\r +Finition du profil : LAQUÉ NOIR / ARGENT MAT\r +Finition du verre de la porte de chaussures : FLOAT BRONZE C-424\r +Composé de :`},{id:2000000123,code:"CAP_FRE_ARM_ABATIBLE_FR",title:"Dimension de l’ouverture : 2275x1390 mm",body:`Modèle : ARGO / Finition : LAQUÉE / Couleur : À DÉTERMINER\r +Épaisseur des vantaux : 22 ou 19 mm\r +Finition des vantaux : LISSES\r +Poignée : PRISE DE MAIN À DÉTERMINER\r +Finition des ferrures : CHROMÉ OU ANTHRACITE\r +Jambages périmétraux : APPARENTS, ENCASTRÉS OU COMBINÉS À DÉTERMINER\r +Nombre de vantaux : 2\r +Composé de :`},{id:2000000125,code:"CAP_FRE_ARM_CORREDERA_FR",title:"Dimension de l’ouverture : 2440x5180mm",body:`Modèle : PANORAMIC P.O. / Finition : LAQUÉE / Couleur : BLANC\r +Nombre de listels : SANS LISTELS\r +Finition des panneaux : PANNEAU LAQUÉ\r +Poignée :\r +Encadrement périmétral :\r +Nombre de vantaux :\r +FREIN HYDRAULIQUE INTÉGRÉ (non disponible pour les portes inférieures à 650 mm) OU FREIN MAGNÉTIQUE INTÉGRÉ\r +Composé de :`},{id:2000000129,code:"CAP_INT_ARM_FORRADO_FR",title:"Finition : MÉLAMINE / Couleur : À DÉTERMINER",body:`Épaisseur du bloc : 19 mm / Épaisseur des accessoires : 19 mm\r +Barres de penderie : CHROME / NOIR\r +Façades des tiroirs en verre : DROITE / “U” – FLOAT BRONZE C-424\r +Poignée des tiroirs : xxxxx\r +Tiroirs : 4 DE 180 MM\r +Composé de :`},{id:2000000131,code:"CAP_INT_EST_CRISTAL_FR",title:"Finition des cadres : ANODISÉ NOIR",body:`Finition des panneaux des cadres latéraux : VERRE TREMPÉ FLOAT BRONZE C-424\r +Finition du dos : VERRE TREMPÉ FLOAT BRONZE C-424\r +Finition des accessoires : MÉLAMINE / Couleur : CHÊNE DENBER M-242\r +Épaisseur des accessoires : 25 mm\r +Barres de penderie : NOIRES\r +Façades des tiroirs en verre : DROITE / “U” – FLOAT BRONZE C-424\r +Poignée des tiroirs : xxxxx\r +Tiroirs : 4 DE 180 MM\r +Composé de :`}]},Ic=({onSelect:n})=>{const{i18n:o}=Pt(),r=o.resolvedLanguage||"es",a=Ac[r.toLowerCase()]??Ac.es;return i.jsx(uo,{className:"h-96",children:i.jsx("div",{className:"flex flex-col gap-2 p-4 pt-0",children:a&&a.filter(({title:l,body:c})=>l||c).sort((l,c)=>l.title.localeCompare(c.title)).map((l,c)=>i.jsx("button",{className:"flex flex-col items-start gap-2 p-3 text-sm text-left transition-all border rounded-lg hover:bg-accent",onClick:()=>n&&n(l,1),children:i.jsxs("div",{className:"flex flex-col w-full gap-1",children:[i.jsx("div",{className:"flex items-center",children:i.jsx("div",{className:"flex items-center gap-2",children:i.jsx("div",{className:"font-semibold",children:l.title})})}),i.jsx("div",{className:"text-xs line-clamp-2 text-muted-foreground",children:i.jsx("p",{dangerouslySetInnerHTML:{__html:l.body.substring(0,300).replace(`\r +`,"
")}})})]})},l.id))})})},Mw=({isOpen:n,onOpenChange:o,onSelect:r})=>Pd("(min-width: 768px)")?i.jsx(fr,{modal:!0,open:n,onOpenChange:o,children:i.jsxs(gr,{className:"w-full max-w-full md:w-9/12 lg:w-10/12",children:[i.jsxs(mr,{children:[i.jsx(hr,{children:w("quotes.blocks_picker_dialog.title")}),i.jsx(cs,{children:w("quotes.blocks_picker_dialog.description")})]}),i.jsx(Ic,{onSelect:r}),i.jsx(pr,{children:i.jsx(H,{type:"submit",onClick:()=>o(!1),children:w("common.close")})})]})}):i.jsx(nd,{open:n,onOpenChange:o,children:i.jsxs(rd,{children:[i.jsxs(id,{className:"text-left",children:[i.jsx(sd,{children:w("quotes.blocks_picker_dialog.title")}),i.jsx(ad,{children:w("quotes.blocks_picker_dialog.description")})]}),i.jsx(Ic,{onSelect:r}),i.jsx(od,{className:"pt-2",children:i.jsx(ld,{asChild:!0,children:i.jsx(H,{variant:"outline",children:w("common.close")})})})]})}),Tw=({isOpen:n,onOpenChange:o,onSelect:r})=>Pd("(min-width: 768px)")?i.jsx(fr,{modal:!0,open:n,onOpenChange:o,children:i.jsxs(gr,{className:"w-full max-w-full md:w-9/12 lg:w-10/12",children:[i.jsxs(mr,{children:[i.jsx(hr,{children:w("quotes.catalog_picker_dialog.title")}),i.jsx(cs,{children:w("quotes.catalog_picker_dialog.description")})]}),i.jsx(dr,{syncWithLocation:!1,initialPageSize:5,children:i.jsx(lo,{onSelect:r})}),i.jsx(pr,{children:i.jsx(H,{type:"submit",onClick:()=>o(!1),children:w("common.close")})})]})}):i.jsx(nd,{open:n,onOpenChange:o,children:i.jsxs(rd,{children:[i.jsxs(id,{className:"text-left",children:[i.jsx(sd,{children:w("quotes.catalog_picker_dialog.title")}),i.jsx(ad,{children:w("quotes.catalog_picker_dialog.description")})]}),i.jsx(dr,{syncWithLocation:!1,initialPageSize:5,children:i.jsx(lo,{onSelect:r})}),i.jsx(od,{className:"pt-2",children:i.jsx(ld,{asChild:!0,children:i.jsx(H,{variant:"outline",children:w("common.close")})})})]})}),Ow=({currency:n,language:o,defaultValues:r})=>{var te;const{toast:a}=Cn(),{control:l,getValues:c,setValue:d,watch:m}=xr(),p=m("show_line_discount_column")??!0,x=!!((te=c("items"))!=null&&te.some(U=>{var ge;return Number((ge=U.discount)==null?void 0:ge.amount)>0})),[v]=O.useState("dialog"),[j,y]=O.useState(!1),[_,E]=O.useState(!1),{fields:R,...L}=w0({control:l,name:"items"}),M=vw([{id:"description",accessorKey:"description",header:w("quotes.form_fields.items.description.label"),cell:({row:{index:U,original:ge}})=>ge!=null&&ge.id_article?i.jsx("div",{className:"min-h-10 whitespace-pre-wrap px-3 py-2 text-sm",children:ge.localized_description??ge.description}):i.jsx(Bt,{autoSize:!0,name:`items.${U}.description`}),minSize:200,size:400},{id:"quantity",accessorKey:"quantity",header:()=>i.jsx("div",{className:"text-right",children:w("quotes.form_fields.items.quantity.label")}),cell:({row:{index:U}})=>i.jsx(nw,{scale:0,className:"text-right",name:`items.${U}.quantity`}),size:75},{id:"unit_price",accessorKey:"unit_price",header:()=>i.jsx("div",{className:"text-right",children:w("quotes.form_fields.items.unit_price.label")}),cell:({row:{index:U}})=>i.jsx(qa,{currency:n,language:o,scale:2,className:"text-right",name:`items.${U}.unit_price`}),size:125},{id:"subtotal_price",accessorKey:"subtotal_price",header:()=>i.jsx("div",{className:"text-right",children:w("quotes.form_fields.items.subtotal_price.label")}),cell:({row:{index:U}})=>i.jsx(qa,{variant:"ghost",currency:n,language:o,scale:2,readOnly:!0,className:"text-right",name:`items.${U}.subtotal_price`}),size:150},{id:"discount",accessorKey:"discount",header:()=>i.jsx("div",{className:"text-right",children:w("quotes.form_fields.items.discount.label")}),cell:({row:{index:U}})=>i.jsx(es,{scale:2,className:"text-right",name:`items.${U}.discount`}),size:100},{id:"total_price",accessorKey:"total_price",header:()=>i.jsx("div",{className:"text-right",children:w("quotes.form_fields.items.total_price.label")}),cell:({row:{index:U}})=>i.jsx(qa,{variant:"ghost",currency:n,language:o,scale:2,readOnly:!0,className:"font-semibold text-right",name:`items.${U}.total_price`}),size:150}],{enableDragHandleColumn:!0,enableSelectionColumn:!0}),$=O.useCallback((U,ge=1)=>{L.append({...U,quantity:{amount:100*ge,scale:Sn.DEFAULT_SCALE},unit_price:U.retail_price,discount:{amount:null,scale:2}}),a({title:w("quotes.catalog_picker_dialog.toast_article_added"),description:U.description})},[L]),q=O.useCallback(U=>{L.append({description:`${U.title} +${U.body}`,quantity:{amount:null,scale:Sn.DEFAULT_SCALE},unit_price:{amount:null,scale:Y0.DEFAULT_SCALE},discount:{amount:null,scale:2}}),a({title:w("quotes.blocks_picker_dialog.toast_article_added"),description:U.title})},[L]),[V,D]=O.useState(!1),k=[265,440,655],W=4;return v==="dialog"?i.jsxs("div",{className:"relative",children:[i.jsx(Ec,{actions:{...L,getItem:U=>c(`items.${U}`),pickCatalogArticle:()=>y(!0),pickBlock:()=>E(!0)},columns:M,data:R,defaultValues:r,showLineDiscountColumn:p,hasLineDiscounts:x,onShowLineDiscountColumnChange:U=>d("show_line_discount_column",U,{shouldDirty:!0})}),i.jsx(Tw,{onSelect:$,isOpen:j,onOpenChange:y}),i.jsx(Mw,{onSelect:q,isOpen:_,onOpenChange:E})]}):i.jsxs(U0,{direction:"horizontal",autoSaveId:"uecko.quotes.details_layout",className:"items-stretch h-full",children:[i.jsx(wc,{defaultSize:k[0],collapsedSize:W,collapsible:!0,minSize:50,maxSize:90,onCollapse:()=>{D(!0)},onExpand:()=>{D(!1)},className:he(V&&"min-w-[50px] transition-all duration-300 ease-in-out"),children:i.jsx(Ec,{actions:{...L,getItem:U=>c(`items.${U}`)},columns:M,data:R,defaultValues:r,showLineDiscountColumn:p,hasLineDiscounts:x,onShowLineDiscountColumnChange:U=>d("show_line_discount_column",U,{shouldDirty:!0})})}),i.jsx(z0,{withHandle:!0,className:"mx-3"}),i.jsx(wc,{defaultSize:k[1],minSize:10,children:i.jsx(dr,{syncWithLocation:!1,children:i.jsx(lo,{onSelect:$})})})]})},Dw=()=>{const{formState:n,control:o}=xr();return i.jsxs("div",{className:"grid gap-6 md:grid-cols-6",children:[i.jsxs(Ja,{className:"md:col-span-6",title:w("quotes.create.form_groups.general.title"),description:w("quotes.create.form_groups.general.desc"),actions:i.jsxs("div",{className:"grid min-w-48 gap-1",children:[i.jsx(wn,{htmlFor:"lang_code",className:"text-xs text-muted-foreground",children:w("quotes.form_fields.lang_code.label")}),i.jsx(Xi,{control:o,name:"lang_code",render:({field:r})=>i.jsxs(ar,{value:r.value||"es",onValueChange:r.onChange,children:[i.jsx(or,{id:"lang_code","aria-label":w("quotes.form_fields.lang_code.label"),children:i.jsx(lr,{placeholder:w("quotes.form_fields.lang_code.placeholder")})}),i.jsx(ur,{children:rn.map(a=>i.jsxs(xn,{value:a.code,children:[i.jsx("span",{"aria-hidden":"true",className:`mr-2 ${a.flagClassName}`}),a.name]},a.code))})]})})]}),children:[i.jsxs("div",{className:"grid grid-cols-6 gap-6",children:[i.jsx(Ln,{required:!0,className:"col-span-2",label:w("quotes.form_fields.customer_reference.label"),description:w("quotes.form_fields.customer_reference.desc"),disabled:n.disabled,placeholder:w("quotes.form_fields.customer_reference.placeholder"),name:"customer_reference"}),i.jsx(Hc,{required:!0,label:w("quotes.form_fields.date.label"),description:w("quotes.form_fields.date.desc"),disabled:n.disabled,placeholder:w("quotes.form_fields.date.placeholder"),name:"date"}),i.jsx(Ln,{label:w("quotes.form_fields.validity.label"),description:w("quotes.form_fields.validity.desc"),disabled:n.disabled,placeholder:w("quotes.form_fields.validity.placeholder"),name:"validity"}),i.jsx(Bt,{className:"col-span-2",label:w("quotes.form_fields.payment_method.label"),description:w("quotes.form_fields.payment_method.desc"),disabled:n.disabled,placeholder:w("quotes.form_fields.payment_method.placeholder"),name:"payment_method"})]}),i.jsxs("div",{className:"grid grid-cols-6 gap-6",children:[i.jsx(Bt,{className:"col-span-3",required:!0,label:w("quotes.form_fields.customer_information.label"),description:w("quotes.form_fields.customer_information.desc"),disabled:n.disabled,placeholder:w("quotes.form_fields.customer_information.placeholder"),name:"customer_information",errors:n.errors}),i.jsx(Bt,{className:"col-span-3",label:w("quotes.form_fields.notes.label"),description:w("quotes.form_fields.notes.desc"),disabled:n.disabled,placeholder:w("quotes.form_fields.notes.placeholder"),name:"notes"})]})]}),i.jsx(Ja,{className:"hidden md:col-span-2",title:w("quotes.create.form_groups.status.title"),description:w("quotes.create.form_groups.status.desc"),children:i.jsxs("div",{className:"grid gap-6",children:[i.jsxs("div",{className:"grid gap-3",children:[i.jsx(wn,{htmlFor:"status",children:w("quotes.create.form_groups.status.title")}),i.jsxs(ar,{children:[i.jsx(or,{id:"status","aria-label":w("quotes.list.select_status"),children:i.jsx(lr,{placeholder:w("quotes.list.select_status")})}),i.jsxs(ur,{children:[i.jsx(xn,{value:"draft",children:w("quotes.status.draft")}),i.jsx(xn,{value:"published",children:w("quotes.status.ready")}),i.jsx(xn,{value:"archived",children:w("quotes.status.archived")})]})]})]}),i.jsx(Ln,{required:!0,label:w("quotes.form_fields.currency_code.label"),description:w("quotes.form_fields.currency_code.desc"),placeholder:w("quotes.form_fields.currency_code.placeholder"),name:"currency_code"})]})})]})},Kd=({id:n,onSentTo:o,disabled:r})=>{const a=()=>{o(n)};return i.jsxs(Kc,{children:[i.jsx(Wc,{asChild:!0,disabled:r,children:i.jsxs(H,{variant:"ghost",className:"h-10 gap-1 text-primary disabled:text-secondary-foreground",children:[i.jsx($0,{className:"w-4 h-4"}),w("quotes.quote_sent_to_editor.trigger_button")]})}),i.jsxs(Qc,{children:[i.jsxs(Yc,{children:[i.jsx(Zc,{children:w("quotes.quote_sent_to_editor.title")}),i.jsx(Xc,{children:w("quotes.quote_sent_to_editor.description")})]}),i.jsxs(Jc,{children:[i.jsx(ed,{children:w("common.cancel")}),i.jsx(td,{asChild:!0,children:i.jsx(H,{onClick:a,children:w("common.continue")})})]})]})]})},Lw=["draft","ready","delivered","accepted","rejected","archived"],Pw={draft:["draft","ready","archived"],ready:["ready","delivered","archived"],delivered:["delivered","accepted","rejected","archived"],accepted:["accepted","rejected","archived"],rejected:["rejected","accepted","archived"],archived:["archived","draft","ready","delivered","accepted","rejected"]},Wd=({type:n="button",status:o,onChangeStatus:r})=>{const[a,l]=O.useState(o),c=m=>l(m);O.useEffect(()=>{o&&l(o)},[o]);const d=()=>{a!==o&&r(a,o)};return i.jsxs(fr,{children:[i.jsx(Oc,{asChild:!0,children:n==="button"?i.jsxs(H,{size:"sm",variant:"outline",className:"h-8 gap-1",children:[i.jsx(S0,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"sr-only md:not-sr-only md:whitespace-nowrap",children:w("quotes.quote_status_editor.trigger_button")})]}):i.jsx(j0,{status:o,isEditable:!0})}),i.jsxs(gr,{children:[i.jsx(mr,{children:i.jsx(hr,{children:w("quotes.quote_status_editor.title")})}),i.jsx(C0,{}),i.jsx("div",{className:"grid gap-4 py-4",children:Lw.map(m=>{const p=!Pw[o].includes(m);return i.jsxs("div",{className:"flex items-start space-x-4",children:[i.jsx(yo,{id:m,checked:a===m,onCheckedChange:()=>c(m),disabled:p}),i.jsxs("div",{className:"grid gap-1.5 leading-none",children:[i.jsx(wn,{htmlFor:m,className:he("font-medium",p?"text-input":"text-foreground"),children:w(`quotes.quote_status_editor.status.${m}.title`)}),i.jsx("p",{className:he("text-sm",p?"text-input":"text-muted-foreground"),children:w(`quotes.quote_status_editor.status.${m}.description`)})]})]},m)})}),i.jsxs(pr,{className:"pt-6 border-t",children:[i.jsx(Yi,{asChild:!0,children:i.jsx(H,{type:"button",variant:"secondary",children:w("common.cancel")})}),i.jsx(Yi,{asChild:!0,children:i.jsx(H,{onClick:d,disabled:a===o,children:w("quotes.quote_status_editor.submit_button")})})]})]})]})},qw=({quoteId:n,className:o})=>{const r=zt(),{toast:a}=Cn(),{useOne:l,useSetStatus:c,useSentTo:d,useDownloader:m,useDuplicate:p,getQuotePDFFilename:x}=Xr(),{data:v,status:j}=l(n),{mutate:y}=c(),{mutate:_}=d(n),{mutate:E}=p(),{download:R,...L}=m(),{formatCurrency:M,formatNumber:$}=Ld({locale:(v==null?void 0:v.lang_code)||"ES"}),q=O.useMemo(()=>v?{subtotal_price:M(v.subtotal_price),discount:$(v.discount),discount_price:M(v.discount_price),tax:$(v.tax),tax_price:M(v.tax_price),total_price:M(v.total_price)}:{subtotal_price:"0,00 €",discount:"0",discount_price:"0,00 €",tax:"0",tax_price:"0,00 €",total_price:"0,00 €"},[v]),V=O.useMemo(()=>(v==null?void 0:v.status)==="accepted"&&!(v!=null&&v.date_sent),[v]),D=O.useMemo(()=>(v==null?void 0:v.status)==="accepted"&&!!(v!=null&&v.date_sent),[v]),k=K=>{y({id:v.id,newStatus:K},{onSuccess:()=>{a({description:w("quotes.quote_status_editor.toast_status_changed"),variant:"success"})}})},W=K=>{_({sent_date:y0(new Date)},{onSuccess:()=>{a({description:w("quotes.quote_sent_to_editor.toast_status_changed"),variant:"success"})}})},te=O.useCallback(()=>{a({description:w("quotes.downloading_dialog.toast_success"),variant:"success"})},[a]),U=O.useCallback(()=>{v&&R(v.id,x(v))},[v]);if(j==="error"||j!=="success")return null;if(!v)return i.jsx(Oe,{className:he("overflow-hidden",o),children:i.jsx(De,{className:"px-4 py-6 text-center",children:i.jsx("p",{className:"mx-auto",children:w("quotes.list.resume.select_quote")})})});const ge=K=>{E({id:K},{onSuccess(Ee){a({description:w("quotes.duplicate_action.toast_success"),variant:"success"}),r(`/quotes/edit/${Ee.id}`,{relative:"path"})}})},_e=K=>{y({id:K,newStatus:"archived"},{onSuccess:()=>{a({description:w("quotes.quote_status_editor.toast_status_changed",{newStatus:w("quotes.status.archived")}),variant:"success"})}})};return i.jsxs(i.Fragment,{children:[i.jsx(Hd,{...L,onFinishDownload:te}),i.jsx(ud,{defaultValue:"resume",children:i.jsxs(Oe,{className:"w-[390px] overflow-hidden",children:[i.jsxs(ct,{className:"gap-3 border-b bg-accent",children:[i.jsxs(Ve,{className:"flex items-center justify-between text-lg",children:[i.jsx("span",{children:w("quotes.list.resume.title")}),i.jsx(Wd,{status:v.status,onChangeStatus:k,type:"badge"})]}),i.jsx("div",{className:"flex w-full mr-auto text-foreground",children:i.jsxs("div",{className:"flex justify-between w-full",children:[i.jsxs(cr,{className:"gap-0",children:[i.jsxs(Qe,{children:[i.jsx(Ye,{asChild:!0,children:i.jsxs(H,{variant:"outline",size:"icon",disabled:D,onClick:K=>{K.preventDefault(),r(`/quotes/edit/${v.id}`,{relative:"path"})},children:[i.jsx(pd,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:w("common.edit")})]})}),i.jsx(Ze,{children:i.jsx("p",{children:w("common.edit")})})]}),i.jsxs(Qe,{children:[i.jsx(Ye,{asChild:!0,children:i.jsxs(H,{variant:"outline",size:"icon",onClick:K=>{K.preventDefault(),ge(v.id)},children:[i.jsx(No,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:w("common.duplicate")})]})}),i.jsx(Ze,{children:i.jsx("p",{children:w("common.duplicate")})})]}),i.jsxs(Qe,{children:[i.jsx(Ye,{asChild:!0,children:i.jsxs(H,{variant:"outline",size:"icon",onClick:U,children:[i.jsx(gd,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:w("common.download")})]})}),i.jsx(Ze,{children:i.jsx("p",{children:w("common.download")})})]}),i.jsxs(Qe,{children:[i.jsx(Ye,{asChild:!0,children:i.jsxs(H,{variant:"outline",size:"icon",disabled:D,onClick:K=>{K.preventDefault(),_e(v.id)},children:[i.jsx(dd,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:w("common.archive")})]})}),i.jsx(Ze,{children:i.jsx("p",{children:w("common.archive")})})]})]}),i.jsx(cr,{children:i.jsx(Kd,{disabled:D||!V,id:v.id,onSentTo:W})})]})})]}),i.jsxs(De,{className:"p-6 text-sm",children:[i.jsxs(cd,{className:"grid w-full grid-cols-2",children:[i.jsx(eo,{value:"resume",children:w("quotes.list.resume.tabs.resume")}),i.jsx(eo,{value:"preview",children:w("quotes.list.resume.tabs.preview")})]}),i.jsx(to,{value:"resume",className:"pt-4",children:i.jsxs("div",{className:"grid gap-3",children:[i.jsxs("div",{className:"grid gap-3",children:[i.jsx("div",{className:"font-semibold",children:w("quotes.list.resume.quote_information")}),i.jsxs("dl",{className:"grid gap-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("dt",{className:"text-muted-foreground",children:w("quotes.form_fields.reference.label")}),i.jsx("dd",{className:"font-medium",children:v.reference})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("dt",{className:"text-muted-foreground",children:w("quotes.form_fields.date.label")}),i.jsx("dd",{className:"font-medium",children:new Date(v.date).toLocaleDateString()})]}),i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsx("dt",{className:"text-muted-foreground whitespace-nowrap",children:w("quotes.form_fields.customer_reference.label")}),i.jsx("dd",{className:"font-medium text-right whitespace-break-spaces",children:v.customer_reference})]})]})]}),i.jsx(_n,{className:"my-4"}),i.jsxs("div",{className:"grid gap-3",children:[i.jsx("div",{className:"font-semibold",children:w("quotes.list.resume.customer_information")}),i.jsx("div",{children:v.customer_information})]}),i.jsx(_n,{className:"my-4"}),i.jsx("div",{className:"font-semibold",children:w("quotes.list.resume.price_information")}),i.jsxs("ul",{className:"grid gap-3",children:[i.jsxs("li",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-muted-foreground",children:w("quotes.form_fields.subtotal_price.label")}),i.jsx("span",{children:q.subtotal_price})]}),i.jsxs("li",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-muted-foreground",children:w("quotes.form_fields.discount_value.label",{value:q.discount})}),i.jsx("span",{children:q.discount_price})]}),i.jsxs("li",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-muted-foreground",children:w("quotes.form_fields.tax_value.label",{label:v.tax_label,value:q.tax})}),i.jsx("span",{children:q.tax_price})]}),i.jsxs("li",{className:"flex items-center justify-between font-semibold",children:[i.jsx("span",{className:"text-muted-foreground",children:w("quotes.form_fields.total_price.label")}),i.jsx("span",{children:q.total_price})]})]})]})}),i.jsx(to,{value:"preview",children:i.jsx(Gd,{quote:v})})]}),i.jsx(Rt,{className:"flex flex-row items-center px-6 py-3 border-t bg-accent",children:i.jsx("div",{className:"text-xs text-muted-foreground"})})]})})]})},kw=({status:n="all",preview:o=!1})=>{const r=zt(),{toast:a}=Cn(),{t:l,i18n:c}=Pt(),d=O.useId(),m=O.useId(),{pagination:p,globalFilter:x,isFiltered:v}=kn(),[j,y]=O.useState(void 0),{useList:_,useDownloader:E,useSetStatus:R,useDuplicate:L,getQuotePDFFilename:M}=Xr(),{mutate:$}=R(),{mutate:q}=L(),{data:V,isPending:D,isError:k,error:W}=_({pagination:{pageIndex:p.pageIndex,pageSize:p.pageSize},status:n,quickSearchTerm:x}),{download:te,...U}=E(),ge=de=>{y(de)},_e=O.useCallback(()=>{a({description:l("quotes.downloading_dialog.toast_success")})},[a]),K=O.useCallback(de=>{r(`/quotes/edit/${de.id}`,{relative:"path"})},[r,a]),Ee=de=>{q({id:de},{onSuccess($e){a({description:l("quotes.duplicate_action.toast_success"),variant:"success"}),r(`/quotes/edit/${$e.id}`,{relative:"path"})}})},ke=de=>{$({id:de,newStatus:"archived"},{onSuccess:()=>{a({description:l("quotes.quote_status_editor.toast_status_changed",{newStatus:l("quotes.status.archived")}),variant:"success"})}})},X=(de,$e)=>{$({id:de,newStatus:$e},{onSuccess:()=>{a({description:l("quotes.quote_status_editor.toast_status_changed",{newStatus:l(`quotes.status.${$e}`)}),variant:"success"})}})},tt=O.useMemo(()=>{const de=[{id:"reference",accessorKey:"reference",header:()=>i.jsx(i.Fragment,{children:l("quotes.list.columns.reference")}),cell:({row:{original:ne},renderValue:Ce})=>{const vt=!!((ne==null?void 0:ne.status)==="accepted"&&(ne!=null&&ne.date_sent));return i.jsx(H,{size:"sm",variant:"link",disabled:vt,className:"h-8 gap-1 px-0 text-left text-ellipsis",onClick:_r=>{_r.preventDefault(),K(ne)},children:i.jsx("div",{className:"",children:Ce()})})}},{id:"status",accessorKey:"status",header:()=>i.jsx(i.Fragment,{children:l("quotes.list.columns.status")}),cell:({row:{original:ne}})=>i.jsx(Wd,{type:"badge",status:ne.status,onChangeStatus:Ce=>X(ne.id,Ce)})},{id:"date_sent",accessor:"date_sent",header:()=>i.jsx("div",{className:"text-left text-ellipsis",children:l("quotes.list.columns.date_sent")}),cell:({row:{original:ne}})=>{const Ce=rr.create(ne.date_sent),vt=Ce.isSuccess&&!Ce.object.isEmpty();return i.jsx("div",{className:"text-left text-ellipsis",children:vt?i.jsx(Od,{label:Ce.object.toLocaleDateString("es-ES"),className:"text-green-800 bg-green-100 hover:text-green-800 hover:bg-green-100"}):i.jsx(i.Fragment,{})})}},{id:"date",accessor:"date",header:()=>i.jsx("div",{className:"text-left text-ellipsis",children:l("quotes.list.columns.date")}),cell:({row:{original:ne}})=>{const Ce=rr.create(ne.date);return i.jsx("div",{className:"text-left text-ellipsis",children:Ce.isSuccess?Ce.object.toLocaleDateString("es-ES"):"-"})}},{id:"customer_reference",accessorKey:"customer_reference",header:()=>i.jsx(i.Fragment,{children:l("quotes.list.columns.customer_reference")}),cell:({renderValue:ne})=>i.jsx("div",{className:"text-left text-ellipsis",children:ne()})},{id:"customer_information",accessorKey:"customer_information",header:()=>i.jsx(i.Fragment,{children:l("quotes.list.columns.customer_information")}),cell:({row:{original:ne}})=>i.jsx("div",{className:"text-left text-ellipsis",children:ne.customer_information.split(` +`).map((Ce,vt)=>i.jsxs("span",{className:vt===0?"font-medium":"hidden text-sm text-muted-foreground md:inline",children:[Ce,i.jsx("br",{})]},vt))}),size:500}],$e=[{id:"row-actions",header:()=>null,cell:({row:{original:ne}})=>{const Ce=(ne==null?void 0:ne.status)==="accepted"&&!(ne!=null&&ne.date_sent),vt=(ne==null?void 0:ne.status)==="accepted"&&!!(ne!=null&&ne.date_sent),_r=(ne==null?void 0:ne.status)==="archived";return i.jsxs("div",{className:"flex gap-1",children:[i.jsxs(cr,{className:"gap-0",children:[i.jsxs(Qe,{children:[i.jsx(Ye,{asChild:!0,children:i.jsxs(H,{variant:"ghost",size:"icon",disabled:vt,onClick:yn=>{yn.preventDefault(),K(ne)},children:[i.jsx(pd,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:l("common.edit")})]})}),i.jsx(Ze,{children:i.jsx("p",{children:l("common.edit")})})]}),i.jsxs(Qe,{children:[i.jsx(Ye,{asChild:!0,children:i.jsxs(H,{variant:"ghost",size:"icon",onClick:yn=>{yn.preventDefault(),Ee(ne.id)},children:[i.jsx(No,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:l("common.duplicate")})]})}),i.jsx(Ze,{children:i.jsx("p",{children:l("common.duplicate")})})]}),i.jsxs(Qe,{children:[i.jsx(Ye,{asChild:!0,children:i.jsxs(H,{variant:"ghost",size:"icon",onClick:()=>{te(ne.id,M(ne))},children:[i.jsx(gd,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:l("common.download")})]})}),i.jsx(Ze,{children:i.jsx("p",{children:l("common.download")})})]}),i.jsxs(Qe,{children:[i.jsx(Ye,{asChild:!0,children:i.jsxs(H,{variant:"ghost",size:"icon",disabled:_r||vt,onClick:yn=>{yn.preventDefault(),ke(ne.id)},children:[i.jsx(dd,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:l("common.archive")})]})}),i.jsx(Ze,{children:i.jsx("p",{children:l("common.archive")})})]})]}),i.jsx(cr,{children:i.jsx(Kd,{id:ne.id,onSentTo:()=>null,disabled:vt||!Ce})})]})}}];return o?de:[...de,...$e]},[o,l,c.resolvedLanguage]),{table:Le}=hs({data:(V==null?void 0:V.items)??[],columns:tt,pageCount:(V==null?void 0:V.total_pages)??-1});return O.useEffect(()=>{Le&&V&&(V==null?void 0:V.total_pages)>0&&y(Le.getRowModel().rows[0])},[V,Le]),k?i.jsx(vr,{subtitle:W.message}):D?i.jsxs("div",{className:"grid items-start flex-1 gap-4 sm:py-0 md:gap-8 lg:grid-cols-3 xl:grid-cols-3",children:[i.jsx(Oe,{className:"grid items-start gap-4 auto-rows-max md:gap-8 lg:col-span-2",children:i.jsx(De,{children:i.jsx(gs,{columnCount:6,searchableColumnCount:1,filterableColumnCount:2,shrinkZero:!0})})}),i.jsx("div",{})]}):(V==null?void 0:V.total_items)===0&&!v?i.jsx(Oe,{children:i.jsx(De,{children:i.jsx(ms,{subtitle:l("quotes.list.empty_state.subtitle"),buttonText:l("quotes.create.title"),onButtonClick:()=>r("add",{relative:"path"})})})}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex flex-col items-stretch flex-1 gap-4 xl:flex-row",children:[i.jsx("div",{id:d,className:"flex items-stretch flex-1",children:i.jsx(fs,{table:Le,paginationOptions:{visible:!0},className:"grid items-start flex-1 gap-4 auto-rows-max md:gap-8 lg:col-span-2",onRowClick:ge,activeRowIndex:j==null?void 0:j.index,children:i.jsx(Ud,{table:Le})})}),o&&i.jsx("div",{id:m,className:"flex items-stretch ",children:i.jsx(qw,{quoteId:j==null?void 0:j.original.id})})]}),i.jsx(Hd,{...U,onFinishDownload:_e})]})},rS=()=>{const n=zt(),o=Sw(),{toast:r}=Cn(),[a,l]=O.useState(ka.createDefaultCode().object),[c,d]=O.useState(Hr.createDefaultCode().object),m=O.useMemo(()=>({date:"",reference:"",customer_reference:"",customer_information:"",lang_code:"",currency_code:"",payment_method:"",notes:"",validity:"",show_line_discount_column:!0,subtotal_price:{amount:void 0,scale:2,currency_code:""},discount:{amount:0,scale:0},discount_price:{amount:0,scale:0,currency_code:""},before_tax_price:{amount:void 0,scale:2,currency_code:""},tax:{amount:void 0,scale:0},tax_label:"% IVA",tax_price:{amount:void 0,scale:2,currency_code:""},total_price:{amount:void 0,scale:2,currency_code:""},items:[{id_article:"",description:"",quantity:{amount:null,scale:2},unit_price:{amount:null,scale:2,currency_code:a.code},subtotal_price:{amount:null,scale:2,currency_code:a.code},discount:{amount:null,scale:2},total_price:{amount:null,scale:2,currency_code:a.code}}]}),[a.code]),{useOne:p,useUpdate:x}=Xr(),{data:v,status:j,error:y}=p(o),{mutate:_,isPending:E}=x(String(o)),R=os({mode:"onBlur",defaultValues:m}),{getValues:L,reset:M,handleSubmit:$,formState:q,control:V,watch:D,setValue:k}=R,{isSubmitting:W,isDirty:te}=q;Oo({isDirty:te}),O.useEffect(()=>{if(!te)return;const{unsubscribe:_e}=D((K,{name:Ee,type:ke})=>{if(Ee==="items"){K.items&&K.items.map((tt,Le)=>{if(tt){const de=oo(tt);Fe.isEqual(de.subtotal_price.toObject(),tt.subtotal_price)||k(`items.${Le}.subtotal_price`,de.subtotal_price.toObject()),Fe.isEqual(de.total_price.toObject(),tt.total_price)||k(`items.${Le}.total_price`,de.total_price.toObject())}});const X=Ya(K,!0);Fe.isEqual(X.subtotal_price.toObject(),K.total_price)||k("subtotal_price",X.subtotal_price.toObject()),Fe.isEqual(X.discount_price.toObject(),K.total_price)||k("discount_price",X.discount_price.toObject()),Fe.isEqual(X.before_tax_price.toObject(),K.before_tax_price)||k("before_tax_price",X.before_tax_price.toObject()),Fe.isEqual(X.tax_price.toObject(),K.tax_price)||k("tax_price",X.tax_price.toObject()),Fe.isEqual(X.total_price.toObject(),K.total_price)||k("total_price",X.total_price.toObject())}else if(Ee&&ke==="change"){if(Ee==="currency_code"){const X=ka.createFromCode(K.currency_code??ka.DEFAULT_CURRENCY_CODE);if(X.isFailure)throw console.error(X.error),X.error;l(X.object)}if(Ee==="lang_code"){const X=Hr.createFromCode(K.lang_code??Hr.DEFAULT_LANGUAGE_CODE);if(X.isFailure)throw console.error(X.error),X.error;d(X.object)}if(["discount","tax"].includes(Ee)){const X=Ya(K,!0);Fe.isEqual(X.subtotal_price.toObject(),K.total_price)||k("subtotal_price",X.subtotal_price.toObject()),Fe.isEqual(X.discount_price.toObject(),K.total_price)||k("discount_price",X.discount_price.toObject()),Fe.isEqual(X.before_tax_price.toObject(),K.before_tax_price)||k("before_tax_price",X.before_tax_price.toObject()),Fe.isEqual(X.tax_price.toObject(),K.tax_price)||k("tax_price",X.tax_price.toObject()),Fe.isEqual(X.total_price.toObject(),K.total_price)||k("total_price",X.total_price.toObject())}if(Ee!=null&&Ee.startsWith("items")){const X=Number(Ee.split(".")[1]),tt=Ee.split(".")[2];if(["quantity","unit_price","discount"].includes(tt)&&K.items&&K.items[X]){const Le=K.items[X],de=oo(Le);Fe.isEqual(de.quantity.toObject(),Le.quantity)||k(`items.${X}.quantity`,de.quantity.toObject()),Fe.isEqual(de.unit_price.toObject(),Le.unit_price)||k(`items.${X}.unit_price`,de.unit_price.toObject()),Fe.isEqual(de.discount.toObject(),Le.discount)||k(`items.${X}.discount`,de.discount.toObject()),Fe.isEqual(de.subtotal_price.toObject(),Le.subtotal_price)||k(`items.${X}.subtotal_price`,de.subtotal_price.toObject()),Fe.isEqual(de.total_price.toObject(),Le.total_price)||k(`items.${X}.total_price`,de.total_price.toObject());const $e=Ya(K,!0);Fe.isEqual($e.subtotal_price.toObject(),K.total_price)||k("subtotal_price",$e.subtotal_price.toObject()),Fe.isEqual($e.discount_price.toObject(),K.total_price)||k("discount_price",$e.discount_price.toObject()),Fe.isEqual($e.before_tax_price.toObject(),K.before_tax_price)||k("before_tax_price",$e.before_tax_price.toObject()),Fe.isEqual($e.tax_price.toObject(),K.tax_price)||k("tax_price",$e.tax_price.toObject()),Fe.isEqual($e.total_price.toObject(),K.total_price)||k("total_price",$e.total_price.toObject())}}}});return()=>_e()},[D,te,k]);const U=async(_e,K)=>{const Ee={..._e,items:_e.items.map(({localized_description:ke,...X})=>X)};_(Ee,{onError:ke=>{console.error(ke),r({title:w("common.error"),description:ke.message,variant:"destructive"})},onSuccess:()=>{M(L()),r({title:w("quotes.notifications.saved"),variant:"success"}),K&&n("/quotes")}})},ge=O.useCallback(()=>{n("/quotes",{state:{id:o}})},[n,o]);return O.useEffect(()=>{j==="success"&&v&&M(v)},[j,v,M]),j==="error"?i.jsx(vr,{errorMessage:y.message}):j!=="success"?i.jsx(qn,{}):i.jsxs(i.Fragment,{children:[(W||E)&&i.jsx(qn,{title:w("quotes.notifications.saving")}),i.jsx(ls,{...R,children:i.jsx("form",{onSubmit:$(_e=>U(_e,!1)),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(Vc,{}),i.jsxs("h1",{className:"flex-1 text-xl font-semibold tracking-tight shrink-0 whitespace-nowrap sm:grow-0",children:[w("quotes.edit.title")," ",v.reference]}),i.jsx(Od,{label:w(`quotes.status.${v.status}`),className:"ml-auto sm:ml-0"}),i.jsxs("div",{className:"items-center hidden gap-2 md:ml-auto md:flex",children:[i.jsx(N0,{label:w("common.close"),variant:"secondary",size:"sm",onClick:ge}),i.jsx(Co,{label:w("common.save"),size:"sm",disabled:q.isSubmitting||q.isLoading||q.isValidating}),i.jsx(H,{size:"sm",disabled:q.isSubmitting||q.isLoading||q.isValidating,onClick:$(_e=>U(_e,!0)),children:w("common.save_close")})]})]}),i.jsx(Dw,{}),i.jsx(Cw,{currency:a}),i.jsx(Ow,{currency:a,language:c,defaultValues:m}),i.jsxs("div",{className:"flex items-center justify-center gap-2 md:hidden",children:[i.jsx(H,{variant:"outline",size:"sm",children:w("common.discard")}),i.jsx(H,{onClick:$(_e=>U(_e,!1)),size:"sm",children:w("quotes.edit.buttons.save_quote")})]})]})})}),!1]})},$w=O.createContext(null),Bw=({children:n})=>{const[o,r]=Uc();return i.jsx($w.Provider,{value:{pagination:o,setPagination:r},children:n})},iS=({children:n})=>i.jsx(us,{children:i.jsx(Bw,{children:i.jsxs(Qr,{className:"quotes-layout",children:[i.jsx(Yr,{}),i.jsx(Zr,{children:n})]})})}),sS=()=>{const{t:n}=Pt(),o=zt(),[r,a]=O.useState("all"),[l,c]=iw(!0),d=[{value:"all",label:n("quotes.list.tabs.all")},{value:"draft",label:n("quotes.list.tabs.draft")},{value:"ready",label:n("quotes.list.tabs.ready")},{value:"delivered",label:n("quotes.list.tabs.delivered")},{value:"accepted",label:n("quotes.list.tabs.accepted")},{value:"rejected",label:n("quotes.list.tabs.rejected")},{value:"archived",label:n("quotes.list.tabs.archived")}];return i.jsxs(dr,{children:[i.jsxs("div",{className:"flex items-center justify-between space-y-2",children:[i.jsxs("div",{children:[i.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:i.jsx(se,{i18nKey:"quotes.list.title"})}),i.jsx("p",{className:"text-muted-foreground",children:i.jsx(se,{i18nKey:"quotes.list.subtitle"})})]}),i.jsx("div",{className:"flex items-center space-x-2",children:i.jsxs(H,{onClick:()=>o("/quotes/add"),children:[i.jsx(Eo,{className:"w-4 h-4 mr-2"}),n("quotes.create.title")]})})]}),i.jsxs(ud,{value:r,onValueChange:a,children:[i.jsxs("div",{className:"flex flex-col items-start justify-between mb-4 sm:flex-row sm:items-center",children:[i.jsxs("div",{className:"w-full mb-4 sm:w-auto sm:mb-0",children:[i.jsx(cd,{className:"hidden sm:flex",children:d.map(m=>i.jsx(eo,{value:m.value,children:m.label},m.value))}),i.jsxs("div",{className:"flex items-center w-full space-x-2 sm:hidden",children:[i.jsx(wn,{children:n("quotes.list.tabs_title")}),i.jsxs(ar,{value:r,onValueChange:a,children:[i.jsx(or,{children:i.jsx(lr,{placeholder:n("quotes.list.select_status")})}),i.jsx(ur,{children:d.map(m=>i.jsx(xn,{value:m.value,children:m.label},m.value))})]})]})]}),i.jsx("div",{className:"flex items-baseline justify-center mr-4 font-medium",children:i.jsx(Qb,{buttonText:n("common.help"),title:n("quotes.list.status_help.title"),content:i.jsx(Uw,{})})}),i.jsx("div",{className:"flex items-center gap-2 ml-auto",children:i.jsx(R0,{"aria-label":n("quotes.list.preview_aria"),variant:"outline",defaultPressed:!1,pressed:l,onPressedChange:c,children:l?i.jsxs(i.Fragment,{children:[i.jsx(md,{className:"w-4 h-4 mr-2"}),n("common.disable_preview")]}):i.jsxs(i.Fragment,{children:[i.jsx(L0,{className:"w-4 h-4 mr-2"}),n("common.enable_preview")]})})})]}),d.map(m=>i.jsx(to,{value:m.value,children:i.jsx(kw,{status:m.value,preview:l})},m.value))]})]})},Uw=()=>{const{t:n}=Pt();return i.jsxs(uo,{className:"grid gap-4 py-4",children:[i.jsx("p",{children:n("quotes.list.status_help.intro")}),i.jsx("p",{children:n("quotes.list.status_help.possible")}),i.jsxs("ul",{className:"pl-6 space-y-2 list-disc",children:[i.jsxs("li",{children:[i.jsxs("strong",{children:[n("quotes.status.draft"),":"]})," ",n("quotes.quote_status_editor.status.draft.description")]}),i.jsxs("li",{children:[i.jsxs("strong",{children:[n("quotes.status.ready"),":"]})," ",n("quotes.quote_status_editor.status.ready.description")]}),i.jsxs("li",{children:[i.jsxs("strong",{children:[n("quotes.status.delivered"),":"]})," ",n("quotes.quote_status_editor.status.delivered.description")]}),i.jsxs("li",{children:[i.jsxs("strong",{children:[n("quotes.status.accepted"),":"]})," ",n("quotes.quote_status_editor.status.accepted.description")]}),i.jsxs("li",{children:[i.jsxs("strong",{children:[n("quotes.status.rejected"),":"]})," ",n("quotes.quote_status_editor.status.rejected.description")]}),i.jsxs("li",{children:[i.jsxs("strong",{children:[n("quotes.status.archived"),":"]})," ",n("quotes.quote_status_editor.status.archived.description")]})]}),i.jsx("p",{children:n("quotes.list.status_help.outro")})]})},zw=n=>{const o=Wr(),r=Pn(),a=r().data().resource("settings").action("one").id("me").params().get(),l=r().auth().action("profile").get();return{useOne:()=>wd({queryKey:a,queryFn:()=>o.getOne({resource:"profile",id:""}),...n}),useUpdate:()=>{const c=tn();return nn({mutationKey:a,mutationFn:d=>o.updateOne({resource:"profile",data:d,id:""}),onSuccess:(d,m)=>{const p=x=>x&&{...x,lang_code:m.lang_code??x.lang_code,dealer:{...x.dealer,...d}};return c.setQueryData(a,p),c.setQueryData(l,p),Promise.all([c.invalidateQueries({queryKey:a}),c.invalidateQueries({queryKey:l})])}})},useUploadLogo:()=>{const c=tn(),{mutate:d,mutateAsync:m,...p}=nn({mutationKey:["data","default","settings"],mutationFn:x=>o.uploadFile({path:"profile/logo",file:x,key:"logo"}),onError:()=>c.invalidateQueries({queryKey:["data","default","settings"]}),onSuccess:()=>{c.invalidateQueries({queryKey:["data","default","settings"]})}});return{upload:d,uploadAsync:m,...p}}}},aS=()=>{var k,W;const[n,o]=O.useState("profile"),{useOne:r,useUpdate:a,useUploadLogo:l}=zw(),{toast:c}=Cn(),{i18n:d}=Pt(),{data:m,status:p,error:x}=r(),v=O.useMemo(()=>({lang_code:"es",contact_information:"",default_payment_method:"",default_notes:"",default_legal_terms:"",default_quote_validity:"",default_show_line_discount_column:!0,default_tax:{amount:void 0,scale:2},default_tax_label:"% IVA"}),[]),{mutate:j}=a(),{upload:y}=l(),_=os({mode:"onBlur",values:m?{...m.dealer,lang_code:m.lang_code}:void 0,defaultValues:v}),{formState:E,reset:R,getValues:L,handleSubmit:M}=_,{isSubmitting:$,isDirty:q}=E,V=te=>{var ge;const U=(ge=te.target.files)==null?void 0:ge[0];if(U){if(U.type!=="image/png"&&U.type!=="image/jpeg"){alert(w("settings.form_fields.logo.invalid_format"));return}const _e=new FileReader;_e.onloadend=()=>{const K=new Image;K.onload=()=>{const Ee=K.width,ke=K.height,X=Ee/ke===2;Ee<200||ke<100||!X?alert(w("settings.form_fields.logo.invalid_dimensions")):y(U)},K.src=_e.result},_e.readAsDataURL(U)}};Oo({isDirty:q});const D=async te=>{j(te,{onError:U=>{console.debug(U),c({title:w("common.error"),description:U.message,variant:"destructive"})},onSuccess:()=>{d.language!==te.lang_code&&d.changeLanguage(te.lang_code??"es"),R(L()),c({description:w("settings.notifications.saved"),variant:"success"})}})};return $?i.jsx(qn,{title:w("settings.notifications.saving")}):p==="error"?i.jsx(vr,{errorMessage:x.message}):p!=="success"?i.jsx(qn,{}):i.jsx(ls,{..._,children:i.jsx("form",{onSubmit:M(D),children:i.jsxs("div",{className:"mx-auto grid w-full max-w-6xl items-start gap-6 md:grid-cols-[180px_1fr] lg:grid-cols-[250px_1fr]",children:[((k=_.formState.errors.root)==null?void 0:k.message)&&i.jsxs(kc,{variant:"destructive",children:[i.jsx(fd,{className:"w-4 h-4"}),i.jsx($c,{children:i.jsx(se,{i18nKey:"common.error"})}),i.jsx(Bc,{children:(W=_.formState.errors.root)==null?void 0:W.message})]}),i.jsxs("nav",{className:"grid gap-4 text-sm text-muted-foreground",children:[i.jsx("a",{onClick:()=>o("profile"),className:n==="profile"?"font-semibold text-primary":"cursor-pointer",children:i.jsx(se,{i18nKey:"settings.edit.tabs.profile"})}),i.jsx("a",{onClick:()=>o("quotes"),className:n==="quotes"?"font-semibold text-primary":"cursor-pointer ",children:i.jsx(se,{i18nKey:"settings.edit.tabs.quotes"})}),i.jsx("a",{onClick:()=>o("legal"),className:n==="legal"?"font-semibold text-primary":"cursor-pointer ",children:i.jsx(se,{i18nKey:"settings.edit.tabs.legal"})})]}),i.jsxs("div",{className:he("grid gap-6",n==="profile"?"visible":"hidden"),children:[i.jsxs(Oe,{children:[i.jsxs(ct,{children:[i.jsx(Ve,{children:i.jsx(se,{i18nKey:"settings.form_fields.language.label"})}),i.jsx(We,{children:i.jsx(se,{i18nKey:"settings.form_fields.language.desc"})})]}),i.jsx(De,{children:i.jsx(Xi,{control:_.control,name:"lang_code",render:({field:te})=>i.jsxs(ar,{value:te.value,onValueChange:te.onChange,children:[i.jsx(or,{"aria-label":w("settings.form_fields.language.label"),children:i.jsx(lr,{placeholder:w("settings.form_fields.language.placeholder")})}),i.jsx(ur,{children:rn.map(U=>i.jsxs(xn,{value:U.code,children:[i.jsx("span",{"aria-hidden":"true",className:`mr-2 ${U.flagClassName}`}),U.name]},U.code))})]})})}),i.jsx(Rt,{className:"px-6 py-4 border-t",children:i.jsx(H,{children:i.jsx(se,{i18nKey:"common.save"})})})]}),i.jsxs(Oe,{children:[i.jsxs(ct,{children:[i.jsx(Ve,{children:i.jsx(se,{i18nKey:"settings.form_fields.contact_information.label"})}),i.jsx(We,{children:i.jsx(se,{i18nKey:"settings.form_fields.contact_information.desc"})})]}),i.jsx(De,{children:i.jsx(Bt,{rows:8,placeholder:w("settings.form_fields.contact_information.placeholder"),name:"contact_information",required:!0})}),i.jsx(Rt,{className:"px-6 py-4 border-t",children:i.jsx(H,{children:i.jsx(se,{i18nKey:"common.save"})})})]}),i.jsxs(Oe,{children:[i.jsxs(ct,{children:[i.jsx(Ve,{children:i.jsx(se,{i18nKey:"settings.form_fields.logo.label"})}),i.jsx(We,{children:i.jsx(se,{i18nKey:"settings.form_fields.logo.desc"})})]}),i.jsx(De,{children:i.jsxs("div",{className:"flex items-center space-x-4",children:[i.jsx("div",{className:"w-[400px] h-[200px] border border-gray-300 flex items-center justify-center overflow-hidden",children:i.jsx("img",{src:m.dealer.logo?m.dealer.logo:"https://via.placeholder.com/200x100",width:400,height:200,style:{objectFit:"contain"}})}),i.jsx("div",{children:i.jsx("p",{className:"mt-2 text-sm text-gray-500",children:i.jsx(se,{i18nKey:"settings.form_fields.logo.requirements"})})})]})}),i.jsxs(Rt,{className:"px-6 py-4 border-t",children:[i.jsx(wn,{htmlFor:"logo-upload",className:"inline-flex items-center justify-center h-10 px-4 py-2 text-sm font-medium transition-colors rounded-md cursor-pointer bg-primary text-primary-foreground hover:bg-primary/90 whitespace-nowrap ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",children:i.jsx(se,{i18nKey:"settings.form_fields.logo.upload"})}),i.jsx(as,{id:"logo-upload",type:"file",accept:".png,.jpg,.jpeg",onChange:V,className:"hidden"})]})]})]}),i.jsxs("div",{className:he("grid gap-6",n==="quotes"?"visible":"hidden"),children:[i.jsxs(Oe,{children:[i.jsxs(ct,{children:[i.jsx(Ve,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_show_line_discount_column.label"})}),i.jsx(We,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_show_line_discount_column.desc"})})]}),i.jsx(De,{children:i.jsx(Xi,{control:_.control,name:"default_show_line_discount_column",render:({field:te})=>i.jsx(yo,{checked:te.value??!0,onCheckedChange:te.onChange})})}),i.jsx(Rt,{className:"px-6 py-4 border-t",children:i.jsx(H,{children:i.jsx(se,{i18nKey:"common.save"})})})]}),i.jsxs(Oe,{children:[i.jsxs(ct,{children:[i.jsx(Ve,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_tax.label"})}),i.jsx(We,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_tax.desc"})})]}),i.jsxs(De,{children:[i.jsx(Ln,{maxLength:32,placeholder:w("settings.form_fields.default_tax_label.placeholder"),name:"default_tax_label",required:!0,description:w("settings.form_fields.default_tax_label.desc")}),i.jsx("br",{}),i.jsx(es,{scale:2,disabled:E.disabled,placeholder:w("settings.form_fields.default_tax.desc"),name:"default_tax",required:!0,description:w("settings.form_fields.default_tax.desc")})]}),i.jsx(Rt,{className:"px-6 py-4 border-t",children:i.jsx(H,{children:i.jsx(se,{i18nKey:"common.save"})})})]}),i.jsxs(Oe,{children:[i.jsxs(ct,{children:[i.jsx(Ve,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_payment_method.label"})}),i.jsx(We,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_payment_method.desc"})})]}),i.jsx(De,{children:i.jsx(Bt,{autoSize:!0,placeholder:w("settings.form_fields.default_payment_method.placeholder"),name:"default_payment_method",required:!0,errors:_.formState.errors})}),i.jsx(Rt,{className:"px-6 py-4 border-t",children:i.jsx(H,{children:i.jsx(se,{i18nKey:"common.save"})})})]}),i.jsxs(Oe,{children:[i.jsxs(ct,{children:[i.jsx(Ve,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_quote_validity.label"})}),i.jsx(We,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_quote_validity.desc"})})]}),i.jsx(De,{children:i.jsx(Bt,{autoSize:!0,placeholder:w("settings.form_fields.default_quote_validity.placeholder"),name:"default_quote_validity",required:!0})}),i.jsx(Rt,{className:"px-6 py-4 border-t",children:i.jsx(H,{children:i.jsx(se,{i18nKey:"common.save"})})})]}),i.jsxs(Oe,{children:[i.jsxs(ct,{children:[i.jsx(Ve,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_notes.label"})}),i.jsx(We,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_notes.desc"})})]}),i.jsx(De,{children:i.jsx(Bt,{autoSize:!0,placeholder:w("settings.form_fields.default_notes.placeholder"),name:"default_notes"})}),i.jsx(Rt,{className:"px-6 py-4 border-t",children:i.jsx(H,{children:i.jsx(se,{i18nKey:"common.save"})})})]})]}),i.jsx("div",{className:he("grid gap-6",n==="legal"?"visible":"hidden"),children:i.jsxs(Oe,{className:"h-",children:[i.jsxs(ct,{children:[i.jsx(Ve,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_legal_terms.label"})}),i.jsx(We,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_legal_terms.desc"})})]}),i.jsx(De,{children:i.jsx(Bt,{rows:25,placeholder:w("settings.form_fields.default_legal_terms.placeholder"),name:"default_legal_terms"})}),i.jsx(Rt,{className:"px-6 py-4 border-t",children:i.jsx(H,{children:i.jsx(se,{i18nKey:"common.save"})})})]})})]})})})},Vw=O.createContext(null),Hw=({children:n})=>i.jsx(Vw.Provider,{value:{},children:n}),oS=({children:n})=>i.jsx(us,{children:i.jsx(Hw,{children:i.jsxs(Qr,{className:"settings-layout",children:[i.jsx(Yr,{}),i.jsxs(Zr,{children:[i.jsx("div",{className:"grid w-full max-w-6xl gap-2 mx-auto",children:i.jsx("h1",{className:"text-2xl font-semibold md:text-3xl",children:i.jsx(se,{i18nKey:"settings.edit.title"})})}),n]})]})})});export{Yw as CatalogLayout,Zw as CatalogList,Xw as DashboardPage,Jw as DealerLayout,eS as DealersList,tS as ErrorPage,Ww as LoginPageWithLanguageSelector,Qw as LogoutPage,nS as QuoteCreate,rS as QuoteEdit,iS as QuotesLayout,sS as QuotesList,aS as SettingsEditor,oS as SettingsLayout}; diff --git a/dist/client/index.html b/dist/client/index.html index 6aa8760..32d0713 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 0deb993..075bd1b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "uecko-presupuestador", - "version": "1.1.9", + "version": "1.2.0", "author": "Rodax Software ", "license": "ISC", "private": true, diff --git a/server/package.json b/server/package.json index 3664602..e3c7a28 100644 --- a/server/package.json +++ b/server/package.json @@ -1,7 +1,7 @@ { "name": "@uecko-presupuestador/server", "private": true, - "version": "1.1.9", + "version": "1.2.0", "author": "Rodax Software ", "main": "./src/index.ts", "scripts": { diff --git a/shared/package.json b/shared/package.json index aa7a936..92f9a18 100644 --- a/shared/package.json +++ b/shared/package.json @@ -1,7 +1,7 @@ { "name": "@uecko-presupuestador/shared", "private": false, - "version": "1.1.9", + "version": "1.2.0", "main": "./index.ts", "author": "Rodax Software ", "license": "ISC",