@accounter/client 0.0.7-alpha-20250918074123-69e6bc93eefd0d03b8b9ef0d3ba961fd16c94b99 → 0.0.7-alpha-20250918074155-11e13b936e7ade13c8c711762b598f32497843e4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -645,7 +645,7 @@ Please change the parent <Route path="${x}"> to <Route path="${x==="/"?"*":`${x}
645
645
  `+Pe.prev}function Ue(Te,Pe){var st=ne(Te),Xe=[];if(st){Xe.length=Te.length;for(var it=0;it<Te.length;it++)Xe[it]=K(Te,it)?Pe(Te[it],Te):""}var lt=typeof B=="function"?B(Te):[],Pt;if($){Pt={};for(var Ft=0;Ft<lt.length;Ft++)Pt["$"+lt[Ft]]=lt[Ft]}for(var St in Te)K(Te,St)&&(st&&String(Number(St))===St&&St<Te.length||$&&Pt["$"+St]instanceof Symbol||(N.call(/[^\w$]/,St)?Xe.push(Pe(St,Te)+": "+Pe(Te[St],Te)):Xe.push(St+": "+Pe(Te[St],Te))));if(typeof B=="function")for(var cn=0;cn<lt.length;cn++)j.call(Te,lt[cn])&&Xe.push("["+Pe(lt[cn])+"]: "+Pe(Te[lt[cn]],Te));return Xe}return Xz}var Zz,mye;function EPt(){if(mye)return Zz;mye=1;var e=T3(),t=Wf(),n=function(s,l,c){for(var u=s,f;(f=u.next)!=null;u=f)if(f.key===l)return u.next=f.next,c||(f.next=s.next,s.next=f),f},r=function(s,l){if(s){var c=n(s,l);return c&&c.value}},i=function(s,l,c){var u=n(s,l);u?u.value=c:s.next={key:l,next:s.next,value:c}},a=function(s,l){return s?!!n(s,l):!1},o=function(s,l){if(s)return n(s,l,!0)};return Zz=function(){var l,c={assert:function(u){if(!c.has(u))throw new t("Side channel does not contain "+e(u))},delete:function(u){var f=l&&l.next,h=o(l,u);return h&&f&&f===h&&(l=void 0),!!h},get:function(u){return r(l,u)},has:function(u){return a(l,u)},set:function(u,f){l||(l={next:void 0}),i(l,u,f)}};return c},Zz}var Jz,pye;function ULe(){if(pye)return Jz;pye=1;var e=kg(),t=Ul(),n=T3(),r=Wf(),i=e("%Map%",!0),a=t("Map.prototype.get",!0),o=t("Map.prototype.set",!0),s=t("Map.prototype.has",!0),l=t("Map.prototype.delete",!0),c=t("Map.prototype.size",!0);return Jz=!!i&&function(){var f,h={assert:function(m){if(!h.has(m))throw new r("Side channel does not contain "+n(m))},delete:function(m){if(f){var p=l(f,m);return c(f)===0&&(f=void 0),p}return!1},get:function(m){if(f)return a(f,m)},has:function(m){return f?s(f,m):!1},set:function(m,p){f||(f=new i),o(f,m,p)}};return h},Jz}var e9,Aye;function FPt(){if(Aye)return e9;Aye=1;var e=kg(),t=Ul(),n=T3(),r=ULe(),i=Wf(),a=e("%WeakMap%",!0),o=t("WeakMap.prototype.get",!0),s=t("WeakMap.prototype.set",!0),l=t("WeakMap.prototype.has",!0),c=t("WeakMap.prototype.delete",!0);return e9=a?function(){var f,h,m={assert:function(p){if(!m.has(p))throw new i("Side channel does not contain "+n(p))},delete:function(p){if(a&&p&&(typeof p=="object"||typeof p=="function")){if(f)return c(f,p)}else if(r&&h)return h.delete(p);return!1},get:function(p){return a&&p&&(typeof p=="object"||typeof p=="function")&&f?o(f,p):h&&h.get(p)},has:function(p){return a&&p&&(typeof p=="object"||typeof p=="function")&&f?l(f,p):!!h&&h.has(p)},set:function(p,A){a&&p&&(typeof p=="object"||typeof p=="function")?(f||(f=new a),s(f,p,A)):r&&(h||(h=r()),h.set(p,A))}};return m}:r,e9}var t9,gye;function zLe(){if(gye)return t9;gye=1;var e=Wf(),t=T3(),n=EPt(),r=ULe(),i=FPt(),a=i||r||n;return t9=function(){var s,l={assert:function(c){if(!l.has(c))throw new e("Side channel does not contain "+t(c))},delete:function(c){return!!s&&s.delete(c)},get:function(c){return s&&s.get(c)},has:function(c){return!!s&&s.has(c)},set:function(c,u){s||(s=a()),s.set(c,u)}};return l},t9}var n9,vye;function DPt(){if(vye)return n9;vye=1;var e=Hne(),t=zLe()(),n=Wf(),r={assert:function(i,a){if(!i||typeof i!="object"&&typeof i!="function")throw new n("`O` is not an object");if(typeof a!="string")throw new n("`slot` must be a string");if(t.assert(i),!r.has(i,a))throw new n("`"+a+"` is not present on `O`")},get:function(i,a){if(!i||typeof i!="object"&&typeof i!="function")throw new n("`O` is not an object");if(typeof a!="string")throw new n("`slot` must be a string");var o=t.get(i);return o&&o["$"+a]},has:function(i,a){if(!i||typeof i!="object"&&typeof i!="function")throw new n("`O` is not an object");if(typeof a!="string")throw new n("`slot` must be a string");var o=t.get(i);return!!o&&e(o,"$"+a)},set:function(i,a,o){if(!i||typeof i!="object"&&typeof i!="function")throw new n("`O` is not an object");if(typeof a!="string")throw new n("`slot` must be a string");var s=t.get(i);s||(s={},t.set(i,s)),s["$"+a]=o}};return Object.freeze&&Object.freeze(r),n9=r,n9}var r9,yye;function TPt(){if(yye)return r9;yye=1;var e=DPt(),t=jne(),n=typeof StopIteration=="object"?StopIteration:null;return r9=function(i){if(!n)throw new t("this environment lacks StopIteration");e.set(i,"[[Done]]",!1);var a={next:function(){var s=e.get(this,"[[Iterator]]"),l=!!e.get(s,"[[Done]]");try{return{done:l,value:l?void 0:s.next()}}catch(c){if(e.set(s,"[[Done]]",!0),c!==n)throw c;return{done:!0,value:void 0}}}};return e.set(a,"[[Iterator]]",i),a},r9}var i9,bye;function HLe(){if(bye)return i9;bye=1;var e={}.toString;return i9=Array.isArray||function(t){return e.call(t)=="[object Array]"},i9}var a9,xye;function VLe(){if(xye)return a9;xye=1;var e=Ul(),t=e("String.prototype.valueOf"),n=function(s){try{return t(s),!0}catch{return!1}},r=e("Object.prototype.toString"),i="[object String]",a=$y()();return a9=function(s){return typeof s=="string"?!0:!s||typeof s!="object"?!1:a?n(s):r(s)===i},a9}var o9,wye;function QLe(){if(wye)return o9;wye=1;var e=typeof Map=="function"&&Map.prototype?Map:null,t=typeof Set=="function"&&Set.prototype?Set:null,n;e||(n=function(o){return!1});var r=e?Map.prototype.has:null,i=t?Set.prototype.has:null;return!n&&!r&&(n=function(o){return!1}),o9=n||function(o){if(!o||typeof o!="object")return!1;try{if(r.call(o),i)try{i.call(o)}catch{return!0}return o instanceof e}catch{}return!1},o9}var s9,kye;function qLe(){if(kye)return s9;kye=1;var e=typeof Map=="function"&&Map.prototype?Map:null,t=typeof Set=="function"&&Set.prototype?Set:null,n;t||(n=function(o){return!1});var r=e?Map.prototype.has:null,i=t?Set.prototype.has:null;return!n&&!i&&(n=function(o){return!1}),s9=n||function(o){if(!o||typeof o!="object")return!1;try{if(i.call(o),r)try{r.call(o)}catch{return!0}return o instanceof t}catch{}return!1},s9}var Sye;function OPt(){if(Sye)return G_.exports;Sye=1;var e=Vne(),t=TPt();if($ne()()||F3()()){var n=Symbol.iterator;G_.exports=function(T){if(T!=null&&typeof T[n]<"u")return T[n]();if(e(T))return Array.prototype[n].call(T)}}else{var r=HLe(),i=VLe(),a=kg(),o=a("%Map%",!0),s=a("%Set%",!0),l=RLe(),c=l("Array.prototype.push"),u=l("String.prototype.charCodeAt"),f=l("String.prototype.slice"),h=function(T,P){var O=T.length;if(P+1>=O)return P+1;var B=u(T,P);if(B<55296||B>56319)return P+1;var M=u(T,P+1);return M<56320||M>57343?P+1:P+2},m=function(T){var P=0;return{next:function(){var B=P>=T.length,M;return B||(M=T[P],P+=1),{done:B,value:M}}}},p=function(T,P){if(r(T)||e(T))return m(T);if(i(T)){var O=0;return{next:function(){var M=h(T,O),$=f(T,O,M);return O=M,{done:M>T.length,value:$}}}}if(P&&typeof T["_es6-shim iterator_"]<"u")return T["_es6-shim iterator_"]()};if(!o&&!s)G_.exports=function(T){if(T!=null)return p(T,!0)};else{var A=QLe(),v=qLe(),y=l("Map.prototype.forEach",!0),x=l("Set.prototype.forEach",!0);if(typeof Xn>"u"||!Xn.versions||!Xn.versions.node)var k=l("Map.prototype.iterator",!0),S=l("Set.prototype.iterator",!0);var C=l("Map.prototype.@@iterator",!0)||l("Map.prototype._es6-shim iterator_",!0),N=l("Set.prototype.@@iterator",!0)||l("Set.prototype._es6-shim iterator_",!0),E=function(T){if(A(T)){if(k)return t(k(T));if(C)return C(T);if(y){var P=[];return y(T,function(B,M){c(P,[M,B])}),m(P)}}if(v(T)){if(S)return t(S(T));if(N)return N(T);if(x){var O=[];return x(T,function(B){c(O,B)}),m(O)}}};G_.exports=function(T){return E(T)||p(T)}}}return G_.exports}var l9,Cye;function GLe(){if(Cye)return l9;Cye=1;var e=function(t){return t!==t};return l9=function(n,r){return n===0&&r===0?1/n===1/r:!!(n===r||e(n)&&e(r))},l9}var c9,_ye;function WLe(){if(_ye)return c9;_ye=1;var e=GLe();return c9=function(){return typeof Object.is=="function"?Object.is:e},c9}var u9,Nye;function BPt(){if(Nye)return u9;Nye=1;var e=WLe(),t=qx();return u9=function(){var r=e();return t(Object,{is:r},{is:function(){return Object.is!==r}}),r},u9}var d9,Eye;function IPt(){if(Eye)return d9;Eye=1;var e=qx(),t=uC(),n=GLe(),r=WLe(),i=BPt(),a=t(r(),Object);return e(a,{getPolyfill:r,implementation:n,shim:i}),d9=a,d9}var f9,Fye;function KLe(){if(Fye)return f9;Fye=1;var e=uC(),t=Ul(),n=kg(),r=n("%ArrayBuffer%",!0),i=t("ArrayBuffer.prototype.byteLength",!0),a=t("Object.prototype.toString"),o=!!r&&!i&&new r(0).slice,s=!!o&&e(o);return f9=i||s?function(c){if(!c||typeof c!="object")return!1;try{return i?i(c):s(c,0),!0}catch{return!1}}:r?function(c){return a(c)==="[object ArrayBuffer]"}:function(c){return!1},f9}var h9,Dye;function jPt(){if(Dye)return h9;Dye=1;var e=Ul(),t=e("Date.prototype.getDay"),n=function(s){try{return t(s),!0}catch{return!1}},r=e("Object.prototype.toString"),i="[object Date]",a=$y()();return h9=function(s){return typeof s!="object"||s===null?!1:a?n(s):r(s)===i},h9}var m9,Tye;function YLe(){if(Tye)return m9;Tye=1;var e=Ul(),t=$y()(),n=Hne(),r=Qx(),i;if(t){var a=e("RegExp.prototype.exec"),o={},s=function(){throw o},l={toString:s,valueOf:s};typeof Symbol.toPrimitive=="symbol"&&(l[Symbol.toPrimitive]=s),i=function(h){if(!h||typeof h!="object")return!1;var m=r(h,"lastIndex"),p=m&&n(m,"value");if(!p)return!1;try{a(h,l)}catch(A){return A===o}}}else{var c=e("Object.prototype.toString"),u="[object RegExp]";i=function(h){return!h||typeof h!="object"&&typeof h!="function"?!1:c(h)===u}}return m9=i,m9}var p9,Oye;function PPt(){if(Oye)return p9;Oye=1;var e=Ul(),t=e("SharedArrayBuffer.prototype.byteLength",!0);return p9=t?function(r){if(!r||typeof r!="object")return!1;try{return t(r),!0}catch{return!1}}:function(r){return!1},p9}var A9,Bye;function MPt(){if(Bye)return A9;Bye=1;var e=Ul(),t=e("Number.prototype.toString"),n=function(s){try{return t(s),!0}catch{return!1}},r=e("Object.prototype.toString"),i="[object Number]",a=$y()();return A9=function(s){return typeof s=="number"?!0:!s||typeof s!="object"?!1:a?n(s):r(s)===i},A9}var g9,Iye;function RPt(){if(Iye)return g9;Iye=1;var e=Ul(),t=e("Boolean.prototype.toString"),n=e("Object.prototype.toString"),r=function(s){try{return t(s),!0}catch{return!1}},i="[object Boolean]",a=$y()();return g9=function(s){return typeof s=="boolean"?!0:s===null||typeof s!="object"?!1:a?r(s):n(s)===i},g9}var b5={exports:{}},v9,jye;function XLe(){if(jye)return v9;jye=1;var e=Ul(),t=YLe(),n=e("RegExp.prototype.exec"),r=Wf();return v9=function(a){if(!t(a))throw new r("`regex` must be a RegExp");return function(s){return n(a,s)!==null}},v9}var Pye;function $Pt(){if(Pye)return b5.exports;Pye=1;var e=Ul(),t=e("Object.prototype.toString"),n=$ne()(),r=XLe();if(n){var i=e("Symbol.prototype.toString"),a=r(/^Symbol\(.*\)$/),o=function(l){return typeof l.valueOf()!="symbol"?!1:a(i(l))};b5.exports=function(l){if(typeof l=="symbol")return!0;if(!l||typeof l!="object"||t(l)!=="[object Symbol]")return!1;try{return o(l)}catch{return!1}}}else b5.exports=function(l){return!1};return b5.exports}var x5={exports:{}},y9,Mye;function LPt(){if(Mye)return y9;Mye=1;var e=typeof BigInt<"u"&&BigInt;return y9=function(){return typeof e=="function"&&typeof BigInt=="function"&&typeof e(42)=="bigint"&&typeof BigInt(42)=="bigint"},y9}var Rye;function UPt(){if(Rye)return x5.exports;Rye=1;var e=LPt()();if(e){var t=BigInt.prototype.valueOf,n=function(i){try{return t.call(i),!0}catch{}return!1};x5.exports=function(i){return i===null||typeof i>"u"||typeof i=="boolean"||typeof i=="string"||typeof i=="number"||typeof i=="symbol"||typeof i=="function"?!1:typeof i=="bigint"?!0:n(i)}}else x5.exports=function(i){return!1};return x5.exports}var b9,$ye;function zPt(){if($ye)return b9;$ye=1;var e=VLe(),t=MPt(),n=RPt(),r=$Pt(),i=UPt();return b9=function(o){if(o==null||typeof o!="object"&&typeof o!="function")return null;if(e(o))return"String";if(t(o))return"Number";if(n(o))return"Boolean";if(r(o))return"Symbol";if(i(o))return"BigInt"},b9}var x9,Lye;function HPt(){if(Lye)return x9;Lye=1;var e=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,t=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,n;e||(n=function(o){return!1});var r=e?e.prototype.has:null,i=t?t.prototype.has:null;return!n&&!r&&(n=function(o){return!1}),x9=n||function(o){if(!o||typeof o!="object")return!1;try{if(r.call(o,r),i)try{i.call(o,i)}catch{return!0}return o instanceof e}catch{}return!1},x9}var w5={exports:{}},Uye;function VPt(){if(Uye)return w5.exports;Uye=1;var e=kg(),t=Ul(),n=e("%WeakSet%",!0),r=t("WeakSet.prototype.has",!0);if(r){var i=t("WeakMap.prototype.has",!0);w5.exports=function(o){if(!o||typeof o!="object")return!1;try{if(r(o,r),i)try{i(o,i)}catch{return!0}return o instanceof n}catch{}return!1}}else w5.exports=function(o){return!1};return w5.exports}var w9,zye;function QPt(){if(zye)return w9;zye=1;var e=QLe(),t=qLe(),n=HPt(),r=VPt();return w9=function(a){if(a&&typeof a=="object"){if(e(a))return"Map";if(t(a))return"Set";if(n(a))return"WeakMap";if(r(a))return"WeakSet"}return!1},w9}var k9,Hye;function qPt(){if(Hye)return k9;Hye=1;var e=Function.prototype.toString,t=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,n,r;if(typeof t=="function"&&typeof Object.defineProperty=="function")try{n=Object.defineProperty({},"length",{get:function(){throw r}}),r={},t(function(){throw 42},null,n)}catch(x){x!==r&&(t=null)}else t=null;var i=/^\s*class\b/,a=function(k){try{var S=e.call(k);return i.test(S)}catch{return!1}},o=function(k){try{return a(k)?!1:(e.call(k),!0)}catch{return!1}},s=Object.prototype.toString,l="[object Object]",c="[object Function]",u="[object GeneratorFunction]",f="[object HTMLAllCollection]",h="[object HTML document.all class]",m="[object HTMLCollection]",p=typeof Symbol=="function"&&!!Symbol.toStringTag,A=!(0 in[,]),v=function(){return!1};if(typeof document=="object"){var y=document.all;s.call(y)===s.call(document.all)&&(v=function(k){if((A||!k)&&(typeof k>"u"||typeof k=="object"))try{var S=s.call(k);return(S===f||S===h||S===m||S===l)&&k("")==null}catch{}return!1})}return k9=t?function(k){if(v(k))return!0;if(!k||typeof k!="function"&&typeof k!="object")return!1;try{t(k,null,n)}catch(S){if(S!==r)return!1}return!a(k)&&o(k)}:function(k){if(v(k))return!0;if(!k||typeof k!="function"&&typeof k!="object")return!1;if(p)return o(k);if(a(k))return!1;var S=s.call(k);return S!==c&&S!==u&&!/^\[object HTML/.test(S)?!1:o(k)},k9}var S9,Vye;function GPt(){if(Vye)return S9;Vye=1;var e=qPt(),t=Object.prototype.toString,n=Object.prototype.hasOwnProperty,r=function(l,c,u){for(var f=0,h=l.length;f<h;f++)n.call(l,f)&&(u==null?c(l[f],f,l):c.call(u,l[f],f,l))},i=function(l,c,u){for(var f=0,h=l.length;f<h;f++)u==null?c(l.charAt(f),f,l):c.call(u,l.charAt(f),f,l)},a=function(l,c,u){for(var f in l)n.call(l,f)&&(u==null?c(l[f],f,l):c.call(u,l[f],f,l))};function o(s){return t.call(s)==="[object Array]"}return S9=function(l,c,u){if(!e(c))throw new TypeError("iterator must be a function");var f;arguments.length>=3&&(f=u),o(l)?r(l,c,f):typeof l=="string"?i(l,c,f):a(l,c,f)},S9}var C9,Qye;function WPt(){return Qye||(Qye=1,C9=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),C9}var _9,qye;function KPt(){if(qye)return _9;qye=1;var e=WPt(),t=typeof globalThis>"u"?yu:globalThis;return _9=function(){for(var r=[],i=0;i<e.length;i++)typeof t[e[i]]=="function"&&(r[r.length]=e[i]);return r},_9}var N9,Gye;function Qne(){if(Gye)return N9;Gye=1;var e=GPt(),t=KPt(),n=uC(),r=Ul(),i=Qx(),a=D3(),o=r("Object.prototype.toString"),s=$y()(),l=typeof globalThis>"u"?yu:globalThis,c=t(),u=r("String.prototype.slice"),f=r("Array.prototype.indexOf",!0)||function(v,y){for(var x=0;x<v.length;x+=1)if(v[x]===y)return x;return-1},h={__proto__:null};s&&i&&a?e(c,function(A){var v=new l[A];if(Symbol.toStringTag in v&&a){var y=a(v),x=i(y,Symbol.toStringTag);if(!x&&y){var k=a(y);x=i(k,Symbol.toStringTag)}h["$"+A]=n(x.get)}}):e(c,function(A){var v=new l[A],y=v.slice||v.set;y&&(h["$"+A]=n(y))});var m=function(v){var y=!1;return e(h,function(x,k){if(!y)try{"$"+x(v)===k&&(y=u(k,1))}catch{}}),y},p=function(v){var y=!1;return e(h,function(x,k){if(!y)try{x(v),y=u(k,1)}catch{}}),y};return N9=function(v){if(!v||typeof v!="object")return!1;if(!s){var y=u(o(v),8,-1);return f(c,y)>-1?y:y!=="Object"?!1:p(v)}return i?m(v):null},N9}var E9,Wye;function YPt(){if(Wye)return E9;Wye=1;var e=Ul(),t=e("ArrayBuffer.prototype.byteLength",!0),n=KLe();return E9=function(i){return n(i)?t?t(i):i.byteLength:NaN},E9}var F9,Kye;function XPt(){if(Kye)return F9;Kye=1;var e=bPt(),t=RLe(),n=SPt(),r=kg(),i=OPt(),a=zLe(),o=IPt(),s=Vne(),l=HLe(),c=KLe(),u=jPt(),f=YLe(),h=PPt(),m=Ine(),p=zPt(),A=QPt(),v=Qne(),y=YPt(),x=t("SharedArrayBuffer.prototype.byteLength",!0),k=t("Date.prototype.getTime"),S=Object.getPrototypeOf,C=t("Object.prototype.toString"),N=r("%Set%",!0),E=t("Map.prototype.has",!0),D=t("Map.prototype.get",!0),T=t("Map.prototype.size",!0),P=t("Set.prototype.add",!0),O=t("Set.prototype.delete",!0),B=t("Set.prototype.has",!0),M=t("Set.prototype.size",!0);function $(W,te,re,ne){for(var de=i(W),he;(he=de.next())&&!he.done;)if(X(te,he.value,re,ne))return O(W,he.value),!0;return!1}function U(W){if(typeof W>"u")return null;if(typeof W!="object")return typeof W=="symbol"?!1:typeof W=="string"||typeof W=="number"?+W==+W:!0}function j(W,te,re,ne,de,he){var pe=U(re);if(pe!=null)return pe;var oe=D(te,pe),J=e({},de,{strict:!1});return typeof oe>"u"&&!E(te,pe)||!X(ne,oe,J,he)?!1:!E(W,pe)&&X(ne,oe,J,he)}function V(W,te,re){var ne=U(re);return ne??(B(te,ne)&&!B(W,ne))}function Q(W,te,re,ne,de,he){for(var pe=i(W),oe,J;(oe=pe.next())&&!oe.done;)if(J=oe.value,X(re,J,de,he)&&X(ne,D(te,J),de,he))return O(W,J),!0;return!1}function X(W,te,re,ne){var de=re||{};if(de.strict?o(W,te):W===te)return!0;var he=p(W),pe=p(te);if(he!==pe)return!1;if(!W||!te||typeof W!="object"&&typeof te!="object")return de.strict?o(W,te):W==te;var oe=ne.has(W),J=ne.has(te),Se;if(oe&&J){if(ne.get(W)===ne.get(te))return!0}else Se={};return oe||ne.set(W,Se),J||ne.set(te,Se),G(W,te,de,ne)}function Z(W){return!W||typeof W!="object"||typeof W.length!="number"||typeof W.copy!="function"||typeof W.slice!="function"||W.length>0&&typeof W[0]!="number"?!1:!!(W.constructor&&W.constructor.isBuffer&&W.constructor.isBuffer(W))}function le(W,te,re,ne){if(M(W)!==M(te))return!1;for(var de=i(W),he=i(te),pe,oe,J;(pe=de.next())&&!pe.done;)if(pe.value&&typeof pe.value=="object")J||(J=new N),P(J,pe.value);else if(!B(te,pe.value)){if(re.strict||!V(W,te,pe.value))return!1;J||(J=new N),P(J,pe.value)}if(J){for(;(oe=he.next())&&!oe.done;)if(oe.value&&typeof oe.value=="object"){if(!$(J,oe.value,re.strict,ne))return!1}else if(!re.strict&&!B(W,oe.value)&&!$(J,oe.value,re.strict,ne))return!1;return M(J)===0}return!0}function H(W,te,re,ne){if(T(W)!==T(te))return!1;for(var de=i(W),he=i(te),pe,oe,J,Se,be,we;(pe=de.next())&&!pe.done;)if(Se=pe.value[0],be=pe.value[1],Se&&typeof Se=="object")J||(J=new N),P(J,Se);else if(we=D(te,Se),typeof we>"u"&&!E(te,Se)||!X(be,we,re,ne)){if(re.strict||!j(W,te,Se,be,re,ne))return!1;J||(J=new N),P(J,Se)}if(J){for(;(oe=he.next())&&!oe.done;)if(Se=oe.value[0],we=oe.value[1],Se&&typeof Se=="object"){if(!Q(J,W,Se,we,re,ne))return!1}else if(!re.strict&&(!W.has(Se)||!X(D(W,Se),we,re,ne))&&!Q(J,W,Se,we,e({},re,{strict:!1}),ne))return!1;return M(J)===0}return!0}function G(W,te,re,ne){var de,he;if(typeof W!=typeof te||W==null||te==null||C(W)!==C(te)||s(W)!==s(te))return!1;var pe=l(W),oe=l(te);if(pe!==oe)return!1;var J=W instanceof Error,Se=te instanceof Error;if(J!==Se||(J||Se)&&(W.name!==te.name||W.message!==te.message))return!1;var be=f(W),we=f(te);if(be!==we||(be||we)&&(W.source!==te.source||n(W)!==n(te)))return!1;var me=u(W),K=u(te);if(me!==K||(me||K)&&k(W)!==k(te)||re.strict&&S&&S(W)!==S(te))return!1;var ie=v(W),ce=v(te);if(ie!==ce)return!1;if(ie||ce){if(W.length!==te.length)return!1;for(de=0;de<W.length;de++)if(W[de]!==te[de])return!1;return!0}var ue=Z(W),ve=Z(te);if(ue!==ve)return!1;if(ue||ve){if(W.length!==te.length)return!1;for(de=0;de<W.length;de++)if(W[de]!==te[de])return!1;return!0}var ke=c(W),Re=c(te);if(ke!==Re)return!1;if(ke||Re)return y(W)!==y(te)?!1:typeof Uint8Array=="function"&&X(new Uint8Array(W),new Uint8Array(te),re,ne);var Me=h(W),$e=h(te);if(Me!==$e)return!1;if(Me||$e)return x(W)!==x(te)?!1:typeof Uint8Array=="function"&&X(new Uint8Array(W),new Uint8Array(te),re,ne);if(typeof W!=typeof te)return!1;var We=m(W),tt=m(te);if(We.length!==tt.length)return!1;for(We.sort(),tt.sort(),de=We.length-1;de>=0;de--)if(We[de]!=tt[de])return!1;for(de=We.length-1;de>=0;de--)if(he=We[de],!X(W[he],te[he],re,ne))return!1;var ot=A(W),vt=A(te);return ot!==vt?!1:ot==="Set"||vt==="Set"?le(W,te,re,ne):ot==="Map"?H(W,te,re,ne):!0}return F9=function(te,re,ne){return X(te,re,ne,a())},F9}var ZPt=XPt();const Ed=Ni(ZPt);var fD=e=>e.type==="checkbox",bb=e=>e instanceof Date,Tc=e=>e==null;const ZLe=e=>typeof e=="object";var is=e=>!Tc(e)&&!Array.isArray(e)&&ZLe(e)&&!bb(e),JLe=e=>is(e)&&e.target?fD(e.target)?e.target.checked:e.target.value:e,JPt=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,e6e=(e,t)=>e.has(JPt(t)),e4t=e=>{const t=e.constructor&&e.constructor.prototype;return is(t)&&t.hasOwnProperty("isPrototypeOf")},qne=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Ea(e){let t;const n=Array.isArray(e),r=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(qne&&(e instanceof Blob||r))&&(n||is(e)))if(t=n?[]:Object.create(Object.getPrototypeOf(e)),!n&&!e4t(e))t=e;else for(const i in e)e.hasOwnProperty(i)&&(t[i]=Ea(e[i]));else return e;return t}var O3=e=>/^\w*$/.test(e),Da=e=>e===void 0,B3=e=>Array.isArray(e)?e.filter(Boolean):[],Gne=e=>B3(e.replace(/["|']|\]/g,"").split(/\.|\[/)),nn=(e,t,n)=>{if(!t||!is(e))return n;const r=(O3(t)?[t]:Gne(t)).reduce((i,a)=>Tc(i)?i:i[a],e);return Da(r)||r===e?Da(e[t])?n:e[t]:r},ud=e=>typeof e=="boolean",Ii=(e,t,n)=>{let r=-1;const i=O3(t)?[t]:Gne(t),a=i.length,o=a-1;for(;++r<a;){const s=i[r];let l=n;if(r!==o){const c=e[s];l=is(c)||Array.isArray(c)?c:isNaN(+i[r+1])?{}:[]}if(s==="__proto__"||s==="constructor"||s==="prototype")return;e[s]=l,e=e[s]}};const Z4={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Nf={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},wA={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Wne=L.createContext(null);Wne.displayName="HookFormContext";const hD=()=>L.useContext(Wne),t4t=e=>{const{children:t,...n}=e;return L.createElement(Wne.Provider,{value:n},t)};var t6e=(e,t,n,r=!0)=>{const i={defaultValues:t._defaultValues};for(const a in e)Object.defineProperty(i,a,{get:()=>{const o=a;return t._proxyFormState[o]!==Nf.all&&(t._proxyFormState[o]=!r||Nf.all),n&&(n[o]=!0),e[o]}});return i};const I3=typeof window<"u"?L.useLayoutEffect:L.useEffect;function n6e(e){const t=hD(),{control:n=t.control,disabled:r,name:i,exact:a}=e||{},[o,s]=L.useState(n._formState),l=L.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return I3(()=>n._subscribe({name:i,formState:l.current,exact:a,callback:c=>{!r&&s({...n._formState,...c})}}),[i,r,a]),L.useEffect(()=>{l.current.isValid&&n._setValid(!0)},[n]),L.useMemo(()=>t6e(o,n,l.current,!1),[o,n])}var cp=e=>typeof e=="string",r6e=(e,t,n,r,i)=>cp(e)?(r&&t.watch.add(e),nn(n,e,i)):Array.isArray(e)?e.map(a=>(r&&t.watch.add(a),nn(n,a))):(r&&(t.watchAll=!0),n),KY=e=>Tc(e)||!ZLe(e);function zA(e,t,n=new WeakSet){if(KY(e)||KY(t))return e===t;if(bb(e)&&bb(t))return e.getTime()===t.getTime();const r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const a of r){const o=e[a];if(!i.includes(a))return!1;if(a!=="ref"){const s=t[a];if(bb(o)&&bb(s)||is(o)&&is(s)||Array.isArray(o)&&Array.isArray(s)?!zA(o,s,n):o!==s)return!1}}return!0}function n4t(e){const t=hD(),{control:n=t.control,name:r,defaultValue:i,disabled:a,exact:o,compute:s}=e||{},l=L.useRef(i),c=L.useRef(s),u=L.useRef(void 0);c.current=s;const f=L.useMemo(()=>n._getWatch(r,l.current),[n,r]),[h,m]=L.useState(c.current?c.current(f):f);return I3(()=>n._subscribe({name:r,formState:{values:!0},exact:o,callback:p=>{if(!a){const A=r6e(r,n._names,p.values||n._formValues,!1,l.current);if(c.current){const v=c.current(A);zA(v,u.current)||(m(v),u.current=v)}else m(A)}}}),[n,a,r,o]),L.useEffect(()=>n._removeUnmounted()),h}function r4t(e){const t=hD(),{name:n,disabled:r,control:i=t.control,shouldUnregister:a,defaultValue:o}=e,s=e6e(i._names.array,n),l=L.useMemo(()=>nn(i._formValues,n,nn(i._defaultValues,n,o)),[i,n,o]),c=n4t({control:i,name:n,defaultValue:l,exact:!0}),u=n6e({control:i,name:n,exact:!0}),f=L.useRef(e),h=L.useRef(i.register(n,{...e.rules,value:c,...ud(e.disabled)?{disabled:e.disabled}:{}}));f.current=e;const m=L.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!nn(u.errors,n)},isDirty:{enumerable:!0,get:()=>!!nn(u.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!nn(u.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!nn(u.validatingFields,n)},error:{enumerable:!0,get:()=>nn(u.errors,n)}}),[u,n]),p=L.useCallback(x=>h.current.onChange({target:{value:JLe(x),name:n},type:Z4.CHANGE}),[n]),A=L.useCallback(()=>h.current.onBlur({target:{value:nn(i._formValues,n),name:n},type:Z4.BLUR}),[n,i._formValues]),v=L.useCallback(x=>{const k=nn(i._fields,n);k&&x&&(k._f.ref={focus:()=>x.focus&&x.focus(),select:()=>x.select&&x.select(),setCustomValidity:S=>x.setCustomValidity(S),reportValidity:()=>x.reportValidity()})},[i._fields,n]),y=L.useMemo(()=>({name:n,value:c,...ud(r)||u.disabled?{disabled:u.disabled||r}:{},onChange:p,onBlur:A,ref:v}),[n,r,u.disabled,p,A,v,c]);return L.useEffect(()=>{const x=i._options.shouldUnregister||a;i.register(n,{...f.current.rules,...ud(f.current.disabled)?{disabled:f.current.disabled}:{}});const k=(S,C)=>{const N=nn(i._fields,S);N&&N._f&&(N._f.mount=C)};if(k(n,!0),x){const S=Ea(nn(i._options.defaultValues,n));Ii(i._defaultValues,n,S),Da(nn(i._formValues,n))&&Ii(i._formValues,n,S)}return!s&&i.register(n),()=>{(s?x&&!i._state.action:x)?i.unregister(n):k(n,!1)}},[n,i,s,a]),L.useEffect(()=>{i._setDisabledField({disabled:r,name:n})},[r,n,i]),L.useMemo(()=>({field:y,formState:u,fieldState:m}),[y,u,m])}const wt=e=>e.render(r4t(e));var Kne=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},xu=e=>Array.isArray(e)?e:[e],Yye=()=>{let e=[];return{get observers(){return e},next:i=>{for(const a of e)a.next&&a.next(i)},subscribe:i=>(e.push(i),{unsubscribe:()=>{e=e.filter(a=>a!==i)}}),unsubscribe:()=>{e=[]}}},Ec=e=>is(e)&&!Object.keys(e).length,Yne=e=>e.type==="file",Th=e=>typeof e=="function",J4=e=>{if(!qne)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},i6e=e=>e.type==="select-multiple",Xne=e=>e.type==="radio",i4t=e=>Xne(e)||fD(e),D9=e=>J4(e)&&e.isConnected;function a4t(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=Da(e)?r++:e[t[r++]];return e}function o4t(e){for(const t in e)if(e.hasOwnProperty(t)&&!Da(e[t]))return!1;return!0}function qo(e,t){const n=Array.isArray(t)?t:O3(t)?[t]:Gne(t),r=n.length===1?e:a4t(e,n),i=n.length-1,a=n[i];return r&&delete r[a],i!==0&&(is(r)&&Ec(r)||Array.isArray(r)&&o4t(r))&&qo(e,n.slice(0,-1)),e}var a6e=e=>{for(const t in e)if(Th(e[t]))return!0;return!1};function eM(e,t={}){const n=Array.isArray(e);if(is(e)||n)for(const r in e)Array.isArray(e[r])||is(e[r])&&!a6e(e[r])?(t[r]=Array.isArray(e[r])?[]:{},eM(e[r],t[r])):Tc(e[r])||(t[r]=!0);return t}function o6e(e,t,n){const r=Array.isArray(e);if(is(e)||r)for(const i in e)Array.isArray(e[i])||is(e[i])&&!a6e(e[i])?Da(t)||KY(n[i])?n[i]=Array.isArray(e[i])?eM(e[i],[]):{...eM(e[i])}:o6e(e[i],Tc(t)?{}:t[i],n[i]):n[i]=!zA(e[i],t[i]);return n}var W_=(e,t)=>o6e(e,t,eM(t));const Xye={value:!1,isValid:!1},Zye={value:!0,isValid:!0};var s6e=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Da(e[0].attributes.value)?Da(e[0].value)||e[0].value===""?Zye:{value:e[0].value,isValid:!0}:Zye:Xye}return Xye},l6e=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Da(e)?e:t?e===""?NaN:e&&+e:n&&cp(e)?new Date(e):r?r(e):e;const Jye={isValid:!1,value:null};var c6e=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,Jye):Jye;function e0e(e){const t=e.ref;return Yne(t)?t.files:Xne(t)?c6e(e.refs).value:i6e(t)?[...t.selectedOptions].map(({value:n})=>n):fD(t)?s6e(e.refs).value:l6e(Da(t.value)?e.ref.value:t.value,e)}var s4t=(e,t,n,r)=>{const i={};for(const a of e){const o=nn(t,a);o&&Ii(i,a,o._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},tM=e=>e instanceof RegExp,K_=e=>Da(e)?e:tM(e)?e.source:is(e)?tM(e.value)?e.value.source:e.value:e,Gw=e=>({isOnSubmit:!e||e===Nf.onSubmit,isOnBlur:e===Nf.onBlur,isOnChange:e===Nf.onChange,isOnAll:e===Nf.all,isOnTouch:e===Nf.onTouched});const t0e="AsyncFunction";var l4t=e=>!!e&&!!e.validate&&!!(Th(e.validate)&&e.validate.constructor.name===t0e||is(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===t0e)),c4t=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),YY=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const vk=(e,t,n,r)=>{for(const i of n||Object.keys(e)){const a=nn(e,i);if(a){const{_f:o,...s}=a;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],i)&&!r)return!0;if(o.ref&&t(o.ref,o.name)&&!r)return!0;if(vk(s,t))break}else if(is(s)&&vk(s,t))break}}};function n0e(e,t,n){const r=nn(e,n);if(r||O3(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const a=i.join("."),o=nn(t,a),s=nn(e,a);if(o&&!Array.isArray(o)&&n!==a)return{name:n};if(s&&s.type)return{name:a,error:s};if(s&&s.root&&s.root.type)return{name:`${a}.root`,error:s.root};i.pop()}return{name:n}}var u4t=(e,t,n,r)=>{n(e);const{name:i,...a}=e;return Ec(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(o=>t[o]===(!r||Nf.all))},d4t=(e,t,n)=>!e||!t||e===t||xu(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),f4t=(e,t,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:(n?r.isOnChange:i.isOnChange)?e:!0,h4t=(e,t)=>!B3(nn(e,t)).length&&qo(e,t),u6e=(e,t,n)=>{const r=xu(nn(e,n));return Ii(r,"root",t[n]),Ii(e,n,r),e},nj=e=>cp(e);function r0e(e,t,n="validate"){if(nj(e)||Array.isArray(e)&&e.every(nj)||ud(e)&&!e)return{type:n,message:nj(e)?e:"",ref:t}}var lw=e=>is(e)&&!tM(e)?e:{value:e,message:""},XY=async(e,t,n,r,i,a)=>{const{ref:o,refs:s,required:l,maxLength:c,minLength:u,min:f,max:h,pattern:m,validate:p,name:A,valueAsNumber:v,mount:y}=e._f,x=nn(n,A);if(!y||t.has(A))return{};const k=s?s[0]:o,S=B=>{i&&k.reportValidity&&(k.setCustomValidity(ud(B)?"":B||""),k.reportValidity())},C={},N=Xne(o),E=fD(o),D=N||E,T=(v||Yne(o))&&Da(o.value)&&Da(x)||J4(o)&&o.value===""||x===""||Array.isArray(x)&&!x.length,P=Kne.bind(null,A,r,C),O=(B,M,$,U=wA.maxLength,j=wA.minLength)=>{const V=B?M:$;C[A]={type:B?U:j,message:V,ref:o,...P(B?U:j,V)}};if(a?!Array.isArray(x)||!x.length:l&&(!D&&(T||Tc(x))||ud(x)&&!x||E&&!s6e(s).isValid||N&&!c6e(s).isValid)){const{value:B,message:M}=nj(l)?{value:!!l,message:l}:lw(l);if(B&&(C[A]={type:wA.required,message:M,ref:k,...P(wA.required,M)},!r))return S(M),C}if(!T&&(!Tc(f)||!Tc(h))){let B,M;const $=lw(h),U=lw(f);if(!Tc(x)&&!isNaN(x)){const j=o.valueAsNumber||x&&+x;Tc($.value)||(B=j>$.value),Tc(U.value)||(M=j<U.value)}else{const j=o.valueAsDate||new Date(x),V=Z=>new Date(new Date().toDateString()+" "+Z),Q=o.type=="time",X=o.type=="week";cp($.value)&&x&&(B=Q?V(x)>V($.value):X?x>$.value:j>new Date($.value)),cp(U.value)&&x&&(M=Q?V(x)<V(U.value):X?x<U.value:j<new Date(U.value))}if((B||M)&&(O(!!B,$.message,U.message,wA.max,wA.min),!r))return S(C[A].message),C}if((c||u)&&!T&&(cp(x)||a&&Array.isArray(x))){const B=lw(c),M=lw(u),$=!Tc(B.value)&&x.length>+B.value,U=!Tc(M.value)&&x.length<+M.value;if(($||U)&&(O($,B.message,M.message),!r))return S(C[A].message),C}if(m&&!T&&cp(x)){const{value:B,message:M}=lw(m);if(tM(B)&&!x.match(B)&&(C[A]={type:wA.pattern,message:M,ref:o,...P(wA.pattern,M)},!r))return S(M),C}if(p){if(Th(p)){const B=await p(x,n),M=r0e(B,k);if(M&&(C[A]={...M,...P(wA.validate,M.message)},!r))return S(M.message),C}else if(is(p)){let B={};for(const M in p){if(!Ec(B)&&!r)break;const $=r0e(await p[M](x,n),k,M);$&&(B={...$,...P(M,$.message)},S($.message),r&&(C[A]=B))}if(!Ec(B)&&(C[A]={ref:k,...B},!r))return C}}return S(!0),C};const m4t={mode:Nf.onSubmit,reValidateMode:Nf.onChange,shouldFocusError:!0};function p4t(e={}){let t={...m4t,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Th(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},i=is(t.defaultValues)||is(t.values)?Ea(t.defaultValues||t.values)||{}:{},a=t.shouldUnregister?{}:Ea(i),o={action:!1,mount:!1,watch:!1},s={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},l,c=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let f={...u};const h={array:Yye(),state:Yye()},m=t.criteriaMode===Nf.all,p=ue=>ve=>{clearTimeout(c),c=setTimeout(ue,ve)},A=async ue=>{if(!t.disabled&&(u.isValid||f.isValid||ue)){const ve=t.resolver?Ec((await E()).errors):await T(r,!0);ve!==n.isValid&&h.state.next({isValid:ve})}},v=(ue,ve)=>{!t.disabled&&(u.isValidating||u.validatingFields||f.isValidating||f.validatingFields)&&((ue||Array.from(s.mount)).forEach(ke=>{ke&&(ve?Ii(n.validatingFields,ke,ve):qo(n.validatingFields,ke))}),h.state.next({validatingFields:n.validatingFields,isValidating:!Ec(n.validatingFields)}))},y=(ue,ve=[],ke,Re,Me=!0,$e=!0)=>{if(Re&&ke&&!t.disabled){if(o.action=!0,$e&&Array.isArray(nn(r,ue))){const We=ke(nn(r,ue),Re.argA,Re.argB);Me&&Ii(r,ue,We)}if($e&&Array.isArray(nn(n.errors,ue))){const We=ke(nn(n.errors,ue),Re.argA,Re.argB);Me&&Ii(n.errors,ue,We),h4t(n.errors,ue)}if((u.touchedFields||f.touchedFields)&&$e&&Array.isArray(nn(n.touchedFields,ue))){const We=ke(nn(n.touchedFields,ue),Re.argA,Re.argB);Me&&Ii(n.touchedFields,ue,We)}(u.dirtyFields||f.dirtyFields)&&(n.dirtyFields=W_(i,a)),h.state.next({name:ue,isDirty:O(ue,ve),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Ii(a,ue,ve)},x=(ue,ve)=>{Ii(n.errors,ue,ve),h.state.next({errors:n.errors})},k=ue=>{n.errors=ue,h.state.next({errors:n.errors,isValid:!1})},S=(ue,ve,ke,Re)=>{const Me=nn(r,ue);if(Me){const $e=nn(a,ue,Da(ke)?nn(i,ue):ke);Da($e)||Re&&Re.defaultChecked||ve?Ii(a,ue,ve?$e:e0e(Me._f)):$(ue,$e),o.mount&&A()}},C=(ue,ve,ke,Re,Me)=>{let $e=!1,We=!1;const tt={name:ue};if(!t.disabled){if(!ke||Re){(u.isDirty||f.isDirty)&&(We=n.isDirty,n.isDirty=tt.isDirty=O(),$e=We!==tt.isDirty);const ot=zA(nn(i,ue),ve);We=!!nn(n.dirtyFields,ue),ot?qo(n.dirtyFields,ue):Ii(n.dirtyFields,ue,!0),tt.dirtyFields=n.dirtyFields,$e=$e||(u.dirtyFields||f.dirtyFields)&&We!==!ot}if(ke){const ot=nn(n.touchedFields,ue);ot||(Ii(n.touchedFields,ue,ke),tt.touchedFields=n.touchedFields,$e=$e||(u.touchedFields||f.touchedFields)&&ot!==ke)}$e&&Me&&h.state.next(tt)}return $e?tt:{}},N=(ue,ve,ke,Re)=>{const Me=nn(n.errors,ue),$e=(u.isValid||f.isValid)&&ud(ve)&&n.isValid!==ve;if(t.delayError&&ke?(l=p(()=>x(ue,ke)),l(t.delayError)):(clearTimeout(c),l=null,ke?Ii(n.errors,ue,ke):qo(n.errors,ue)),(ke?!zA(Me,ke):Me)||!Ec(Re)||$e){const We={...Re,...$e&&ud(ve)?{isValid:ve}:{},errors:n.errors,name:ue};n={...n,...We},h.state.next(We)}},E=async ue=>{v(ue,!0);const ve=await t.resolver(a,t.context,s4t(ue||s.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return v(ue),ve},D=async ue=>{const{errors:ve}=await E(ue);if(ue)for(const ke of ue){const Re=nn(ve,ke);Re?Ii(n.errors,ke,Re):qo(n.errors,ke)}else n.errors=ve;return ve},T=async(ue,ve,ke={valid:!0})=>{for(const Re in ue){const Me=ue[Re];if(Me){const{_f:$e,...We}=Me;if($e){const tt=s.array.has($e.name),ot=Me._f&&l4t(Me._f);ot&&u.validatingFields&&v([Re],!0);const vt=await XY(Me,s.disabled,a,m,t.shouldUseNativeValidation&&!ve,tt);if(ot&&u.validatingFields&&v([Re]),vt[$e.name]&&(ke.valid=!1,ve))break;!ve&&(nn(vt,$e.name)?tt?u6e(n.errors,vt,$e.name):Ii(n.errors,$e.name,vt[$e.name]):qo(n.errors,$e.name))}!Ec(We)&&await T(We,ve,ke)}}return ke.valid},P=()=>{for(const ue of s.unMount){const ve=nn(r,ue);ve&&(ve._f.refs?ve._f.refs.every(ke=>!D9(ke)):!D9(ve._f.ref))&&ne(ue)}s.unMount=new Set},O=(ue,ve)=>!t.disabled&&(ue&&ve&&Ii(a,ue,ve),!zA(Z(),i)),B=(ue,ve,ke)=>r6e(ue,s,{...o.mount?a:Da(ve)?i:cp(ue)?{[ue]:ve}:ve},ke,ve),M=ue=>B3(nn(o.mount?a:i,ue,t.shouldUnregister?nn(i,ue,[]):[])),$=(ue,ve,ke={})=>{const Re=nn(r,ue);let Me=ve;if(Re){const $e=Re._f;$e&&(!$e.disabled&&Ii(a,ue,l6e(ve,$e)),Me=J4($e.ref)&&Tc(ve)?"":ve,i6e($e.ref)?[...$e.ref.options].forEach(We=>We.selected=Me.includes(We.value)):$e.refs?fD($e.ref)?$e.refs.forEach(We=>{(!We.defaultChecked||!We.disabled)&&(Array.isArray(Me)?We.checked=!!Me.find(tt=>tt===We.value):We.checked=Me===We.value||!!Me)}):$e.refs.forEach(We=>We.checked=We.value===Me):Yne($e.ref)?$e.ref.value="":($e.ref.value=Me,$e.ref.type||h.state.next({name:ue,values:Ea(a)})))}(ke.shouldDirty||ke.shouldTouch)&&C(ue,Me,ke.shouldTouch,ke.shouldDirty,!0),ke.shouldValidate&&X(ue)},U=(ue,ve,ke)=>{for(const Re in ve){if(!ve.hasOwnProperty(Re))return;const Me=ve[Re],$e=ue+"."+Re,We=nn(r,$e);(s.array.has(ue)||is(Me)||We&&!We._f)&&!bb(Me)?U($e,Me,ke):$($e,Me,ke)}},j=(ue,ve,ke={})=>{const Re=nn(r,ue),Me=s.array.has(ue),$e=Ea(ve);Ii(a,ue,$e),Me?(h.array.next({name:ue,values:Ea(a)}),(u.isDirty||u.dirtyFields||f.isDirty||f.dirtyFields)&&ke.shouldDirty&&h.state.next({name:ue,dirtyFields:W_(i,a),isDirty:O(ue,$e)})):Re&&!Re._f&&!Tc($e)?U(ue,$e,ke):$(ue,$e,ke),YY(ue,s)&&h.state.next({...n,name:ue}),h.state.next({name:o.mount?ue:void 0,values:Ea(a)})},V=async ue=>{o.mount=!0;const ve=ue.target;let ke=ve.name,Re=!0;const Me=nn(r,ke),$e=ot=>{Re=Number.isNaN(ot)||bb(ot)&&isNaN(ot.getTime())||zA(ot,nn(a,ke,ot))},We=Gw(t.mode),tt=Gw(t.reValidateMode);if(Me){let ot,vt;const Ae=ve.type?e0e(Me._f):JLe(ue),ee=ue.type===Z4.BLUR||ue.type===Z4.FOCUS_OUT,se=!c4t(Me._f)&&!t.resolver&&!nn(n.errors,ke)&&!Me._f.deps||f4t(ee,nn(n.touchedFields,ke),n.isSubmitted,tt,We),_e=YY(ke,s,ee);Ii(a,ke,Ae),ee?(!ve||!ve.readOnly)&&(Me._f.onBlur&&Me._f.onBlur(ue),l&&l(0)):Me._f.onChange&&Me._f.onChange(ue);const Fe=C(ke,Ae,ee),Ue=!Ec(Fe)||_e;if(!ee&&h.state.next({name:ke,type:ue.type,values:Ea(a)}),se)return(u.isValid||f.isValid)&&(t.mode==="onBlur"?ee&&A():ee||A()),Ue&&h.state.next({name:ke,..._e?{}:Fe});if(!ee&&_e&&h.state.next({...n}),t.resolver){const{errors:Te}=await E([ke]);if($e(Ae),Re){const Pe=n0e(n.errors,r,ke),st=n0e(Te,r,Pe.name||ke);ot=st.error,ke=st.name,vt=Ec(Te)}}else v([ke],!0),ot=(await XY(Me,s.disabled,a,m,t.shouldUseNativeValidation))[ke],v([ke]),$e(Ae),Re&&(ot?vt=!1:(u.isValid||f.isValid)&&(vt=await T(r,!0)));Re&&(Me._f.deps&&X(Me._f.deps),N(ke,vt,ot,Fe))}},Q=(ue,ve)=>{if(nn(n.errors,ve)&&ue.focus)return ue.focus(),1},X=async(ue,ve={})=>{let ke,Re;const Me=xu(ue);if(t.resolver){const $e=await D(Da(ue)?ue:Me);ke=Ec($e),Re=ue?!Me.some(We=>nn($e,We)):ke}else ue?(Re=(await Promise.all(Me.map(async $e=>{const We=nn(r,$e);return await T(We&&We._f?{[$e]:We}:We)}))).every(Boolean),!(!Re&&!n.isValid)&&A()):Re=ke=await T(r);return h.state.next({...!cp(ue)||(u.isValid||f.isValid)&&ke!==n.isValid?{}:{name:ue},...t.resolver||!ue?{isValid:ke}:{},errors:n.errors}),ve.shouldFocus&&!Re&&vk(r,Q,ue?Me:s.mount),Re},Z=ue=>{const ve={...o.mount?a:i};return Da(ue)?ve:cp(ue)?nn(ve,ue):ue.map(ke=>nn(ve,ke))},le=(ue,ve)=>({invalid:!!nn((ve||n).errors,ue),isDirty:!!nn((ve||n).dirtyFields,ue),error:nn((ve||n).errors,ue),isValidating:!!nn(n.validatingFields,ue),isTouched:!!nn((ve||n).touchedFields,ue)}),H=ue=>{ue&&xu(ue).forEach(ve=>qo(n.errors,ve)),h.state.next({errors:ue?n.errors:{}})},G=(ue,ve,ke)=>{const Re=(nn(r,ue,{_f:{}})._f||{}).ref,Me=nn(n.errors,ue)||{},{ref:$e,message:We,type:tt,...ot}=Me;Ii(n.errors,ue,{...ot,...ve,ref:Re}),h.state.next({name:ue,errors:n.errors,isValid:!1}),ke&&ke.shouldFocus&&Re&&Re.focus&&Re.focus()},W=(ue,ve)=>Th(ue)?h.state.subscribe({next:ke=>"values"in ke&&ue(B(void 0,ve),ke)}):B(ue,ve,!0),te=ue=>h.state.subscribe({next:ve=>{d4t(ue.name,ve.name,ue.exact)&&u4t(ve,ue.formState||u,K,ue.reRenderRoot)&&ue.callback({values:{...a},...n,...ve,defaultValues:i})}}).unsubscribe,re=ue=>(o.mount=!0,f={...f,...ue.formState},te({...ue,formState:f})),ne=(ue,ve={})=>{for(const ke of ue?xu(ue):s.mount)s.mount.delete(ke),s.array.delete(ke),ve.keepValue||(qo(r,ke),qo(a,ke)),!ve.keepError&&qo(n.errors,ke),!ve.keepDirty&&qo(n.dirtyFields,ke),!ve.keepTouched&&qo(n.touchedFields,ke),!ve.keepIsValidating&&qo(n.validatingFields,ke),!t.shouldUnregister&&!ve.keepDefaultValue&&qo(i,ke);h.state.next({values:Ea(a)}),h.state.next({...n,...ve.keepDirty?{isDirty:O()}:{}}),!ve.keepIsValid&&A()},de=({disabled:ue,name:ve})=>{(ud(ue)&&o.mount||ue||s.disabled.has(ve))&&(ue?s.disabled.add(ve):s.disabled.delete(ve))},he=(ue,ve={})=>{let ke=nn(r,ue);const Re=ud(ve.disabled)||ud(t.disabled);return Ii(r,ue,{...ke||{},_f:{...ke&&ke._f?ke._f:{ref:{name:ue}},name:ue,mount:!0,...ve}}),s.mount.add(ue),ke?de({disabled:ud(ve.disabled)?ve.disabled:t.disabled,name:ue}):S(ue,!0,ve.value),{...Re?{disabled:ve.disabled||t.disabled}:{},...t.progressive?{required:!!ve.required,min:K_(ve.min),max:K_(ve.max),minLength:K_(ve.minLength),maxLength:K_(ve.maxLength),pattern:K_(ve.pattern)}:{},name:ue,onChange:V,onBlur:V,ref:Me=>{if(Me){he(ue,ve),ke=nn(r,ue);const $e=Da(Me.value)&&Me.querySelectorAll&&Me.querySelectorAll("input,select,textarea")[0]||Me,We=i4t($e),tt=ke._f.refs||[];if(We?tt.find(ot=>ot===$e):$e===ke._f.ref)return;Ii(r,ue,{_f:{...ke._f,...We?{refs:[...tt.filter(D9),$e,...Array.isArray(nn(i,ue))?[{}]:[]],ref:{type:$e.type,name:ue}}:{ref:$e}}}),S(ue,!1,void 0,$e)}else ke=nn(r,ue,{}),ke._f&&(ke._f.mount=!1),(t.shouldUnregister||ve.shouldUnregister)&&!(e6e(s.array,ue)&&o.action)&&s.unMount.add(ue)}}},pe=()=>t.shouldFocusError&&vk(r,Q,s.mount),oe=ue=>{ud(ue)&&(h.state.next({disabled:ue}),vk(r,(ve,ke)=>{const Re=nn(r,ke);Re&&(ve.disabled=Re._f.disabled||ue,Array.isArray(Re._f.refs)&&Re._f.refs.forEach(Me=>{Me.disabled=Re._f.disabled||ue}))},0,!1))},J=(ue,ve)=>async ke=>{let Re;ke&&(ke.preventDefault&&ke.preventDefault(),ke.persist&&ke.persist());let Me=Ea(a);if(h.state.next({isSubmitting:!0}),t.resolver){const{errors:$e,values:We}=await E();n.errors=$e,Me=Ea(We)}else await T(r);if(s.disabled.size)for(const $e of s.disabled)qo(Me,$e);if(qo(n.errors,"root"),Ec(n.errors)){h.state.next({errors:{}});try{await ue(Me,ke)}catch($e){Re=$e}}else ve&&await ve({...n.errors},ke),pe(),setTimeout(pe);if(h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Ec(n.errors)&&!Re,submitCount:n.submitCount+1,errors:n.errors}),Re)throw Re},Se=(ue,ve={})=>{nn(r,ue)&&(Da(ve.defaultValue)?j(ue,Ea(nn(i,ue))):(j(ue,ve.defaultValue),Ii(i,ue,Ea(ve.defaultValue))),ve.keepTouched||qo(n.touchedFields,ue),ve.keepDirty||(qo(n.dirtyFields,ue),n.isDirty=ve.defaultValue?O(ue,Ea(nn(i,ue))):O()),ve.keepError||(qo(n.errors,ue),u.isValid&&A()),h.state.next({...n}))},be=(ue,ve={})=>{const ke=ue?Ea(ue):i,Re=Ea(ke),Me=Ec(ue),$e=Me?i:Re;if(ve.keepDefaultValues||(i=ke),!ve.keepValues){if(ve.keepDirtyValues){const We=new Set([...s.mount,...Object.keys(W_(i,a))]);for(const tt of Array.from(We))nn(n.dirtyFields,tt)?Ii($e,tt,nn(a,tt)):j(tt,nn($e,tt))}else{if(qne&&Da(ue))for(const We of s.mount){const tt=nn(r,We);if(tt&&tt._f){const ot=Array.isArray(tt._f.refs)?tt._f.refs[0]:tt._f.ref;if(J4(ot)){const vt=ot.closest("form");if(vt){vt.reset();break}}}}if(ve.keepFieldsRef)for(const We of s.mount)j(We,nn($e,We));else r={}}a=t.shouldUnregister?ve.keepDefaultValues?Ea(i):{}:Ea($e),h.array.next({values:{...$e}}),h.state.next({values:{...$e}})}s={mount:ve.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!u.isValid||!!ve.keepIsValid||!!ve.keepDirtyValues,o.watch=!!t.shouldUnregister,h.state.next({submitCount:ve.keepSubmitCount?n.submitCount:0,isDirty:Me?!1:ve.keepDirty?n.isDirty:!!(ve.keepDefaultValues&&!zA(ue,i)),isSubmitted:ve.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:Me?{}:ve.keepDirtyValues?ve.keepDefaultValues&&a?W_(i,a):n.dirtyFields:ve.keepDefaultValues&&ue?W_(i,ue):ve.keepDirty?n.dirtyFields:{},touchedFields:ve.keepTouched?n.touchedFields:{},errors:ve.keepErrors?n.errors:{},isSubmitSuccessful:ve.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:i})},we=(ue,ve)=>be(Th(ue)?ue(a):ue,ve),me=(ue,ve={})=>{const ke=nn(r,ue),Re=ke&&ke._f;if(Re){const Me=Re.refs?Re.refs[0]:Re.ref;Me.focus&&(Me.focus(),ve.shouldSelect&&Th(Me.select)&&Me.select())}},K=ue=>{n={...n,...ue}},ce={control:{register:he,unregister:ne,getFieldState:le,handleSubmit:J,setError:G,_subscribe:te,_runSchema:E,_focusError:pe,_getWatch:B,_getDirty:O,_setValid:A,_setFieldArray:y,_setDisabledField:de,_setErrors:k,_getFieldArray:M,_reset:be,_resetDefaultValues:()=>Th(t.defaultValues)&&t.defaultValues().then(ue=>{we(ue,t.resetOptions),h.state.next({isLoading:!1})}),_removeUnmounted:P,_disableForm:oe,_subjects:h,_proxyFormState:u,get _fields(){return r},get _formValues(){return a},get _state(){return o},set _state(ue){o=ue},get _defaultValues(){return i},get _names(){return s},set _names(ue){s=ue},get _formState(){return n},get _options(){return t},set _options(ue){t={...t,...ue}}},subscribe:re,trigger:X,register:he,handleSubmit:J,watch:W,setValue:j,getValues:Z,reset:we,resetField:Se,clearErrors:H,unregister:ne,setError:G,setFocus:me,getFieldState:le};return{...ce,formControl:ce}}var kv=()=>{if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=(Math.random()*16+e)%16|0;return(t=="x"?n:n&3|8).toString(16)})},T9=(e,t,n={})=>n.shouldFocus||Da(n.shouldFocus)?n.focusName||`${e}.${Da(n.focusIndex)?t:n.focusIndex}.`:"",O9=(e,t)=>[...e,...xu(t)],B9=e=>Array.isArray(e)?e.map(()=>{}):void 0;function I9(e,t,n){return[...e.slice(0,t),...xu(n),...e.slice(t)]}var j9=(e,t,n)=>Array.isArray(e)?(Da(e[n])&&(e[n]=void 0),e.splice(n,0,e.splice(t,1)[0]),e):[],P9=(e,t)=>[...xu(t),...xu(e)];function A4t(e,t){let n=0;const r=[...e];for(const i of t)r.splice(i-n,1),n++;return B3(r).length?r:[]}var M9=(e,t)=>Da(t)?[]:A4t(e,xu(t).sort((n,r)=>n-r)),R9=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]},i0e=(e,t,n)=>(e[t]=n,e);function Gx(e){const t=hD(),{control:n=t.control,name:r,keyName:i="id",shouldUnregister:a,rules:o}=e,[s,l]=L.useState(n._getFieldArray(r)),c=L.useRef(n._getFieldArray(r).map(kv)),u=L.useRef(s),f=L.useRef(!1);u.current=s,n._names.array.add(r),L.useMemo(()=>o&&n.register(r,o),[n,o,r]),I3(()=>n._subjects.array.subscribe({next:({values:C,name:N})=>{if(N===r||!N){const E=nn(C,r);Array.isArray(E)&&(l(E),c.current=E.map(kv))}}}).unsubscribe,[n,r]);const h=L.useCallback(C=>{f.current=!0,n._setFieldArray(r,C)},[n,r]),m=(C,N)=>{const E=xu(Ea(C)),D=O9(n._getFieldArray(r),E);n._names.focus=T9(r,D.length-1,N),c.current=O9(c.current,E.map(kv)),h(D),l(D),n._setFieldArray(r,D,O9,{argA:B9(C)})},p=(C,N)=>{const E=xu(Ea(C)),D=P9(n._getFieldArray(r),E);n._names.focus=T9(r,0,N),c.current=P9(c.current,E.map(kv)),h(D),l(D),n._setFieldArray(r,D,P9,{argA:B9(C)})},A=C=>{const N=M9(n._getFieldArray(r),C);c.current=M9(c.current,C),h(N),l(N),!Array.isArray(nn(n._fields,r))&&Ii(n._fields,r,void 0),n._setFieldArray(r,N,M9,{argA:C})},v=(C,N,E)=>{const D=xu(Ea(N)),T=I9(n._getFieldArray(r),C,D);n._names.focus=T9(r,C,E),c.current=I9(c.current,C,D.map(kv)),h(T),l(T),n._setFieldArray(r,T,I9,{argA:C,argB:B9(N)})},y=(C,N)=>{const E=n._getFieldArray(r);R9(E,C,N),R9(c.current,C,N),h(E),l(E),n._setFieldArray(r,E,R9,{argA:C,argB:N},!1)},x=(C,N)=>{const E=n._getFieldArray(r);j9(E,C,N),j9(c.current,C,N),h(E),l(E),n._setFieldArray(r,E,j9,{argA:C,argB:N},!1)},k=(C,N)=>{const E=Ea(N),D=i0e(n._getFieldArray(r),C,E);c.current=[...D].map((T,P)=>!T||P===C?kv():c.current[P]),h(D),l([...D]),n._setFieldArray(r,D,i0e,{argA:C,argB:E},!0,!1)},S=C=>{const N=xu(Ea(C));c.current=N.map(kv),h([...N]),l([...N]),n._setFieldArray(r,[...N],E=>E,{},!0,!1)};return L.useEffect(()=>{if(n._state.action=!1,YY(r,n._names)&&n._subjects.state.next({...n._formState}),f.current&&(!Gw(n._options.mode).isOnSubmit||n._formState.isSubmitted)&&!Gw(n._options.reValidateMode).isOnSubmit)if(n._options.resolver)n._runSchema([r]).then(C=>{const N=nn(C.errors,r),E=nn(n._formState.errors,r);(E?!N&&E.type||N&&(E.type!==N.type||E.message!==N.message):N&&N.type)&&(N?Ii(n._formState.errors,r,N):qo(n._formState.errors,r),n._subjects.state.next({errors:n._formState.errors}))});else{const C=nn(n._fields,r);C&&C._f&&!(Gw(n._options.reValidateMode).isOnSubmit&&Gw(n._options.mode).isOnSubmit)&&XY(C,n._names.disabled,n._formValues,n._options.criteriaMode===Nf.all,n._options.shouldUseNativeValidation,!0).then(N=>!Ec(N)&&n._subjects.state.next({errors:u6e(n._formState.errors,N,r)}))}n._subjects.state.next({name:r,values:Ea(n._formValues)}),n._names.focus&&vk(n._fields,(C,N)=>{if(n._names.focus&&N.startsWith(n._names.focus)&&C.focus)return C.focus(),1}),n._names.focus="",n._setValid(),f.current=!1},[s,r,n]),L.useEffect(()=>(!nn(n._formValues,r)&&n._setFieldArray(r),()=>{const C=(N,E)=>{const D=nn(n._fields,N);D&&D._f&&(D._f.mount=E)};n._options.shouldUnregister||a?n.unregister(r):C(r,!1)}),[r,n,i,a]),{swap:L.useCallback(y,[h,r,n]),move:L.useCallback(x,[h,r,n]),prepend:L.useCallback(p,[h,r,n]),append:L.useCallback(m,[h,r,n]),remove:L.useCallback(A,[h,r,n]),insert:L.useCallback(v,[h,r,n]),update:L.useCallback(k,[h,r,n]),replace:L.useCallback(S,[h,r,n]),fields:L.useMemo(()=>s.map((C,N)=>({...C,[i]:c.current[N]||kv()})),[s,i])}}function Ar(e={}){const t=L.useRef(void 0),n=L.useRef(void 0),[r,i]=L.useState({isDirty:!1,isValidating:!1,isLoading:Th(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:Th(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!Th(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:o,...s}=p4t(e);t.current={...s,formState:r}}const a=t.current.control;return a._options=e,I3(()=>{const o=a._subscribe({formState:a._proxyFormState,callback:()=>i({...a._formState}),reRenderRoot:!0});return i(s=>({...s,isReady:!0})),a._formState.isReady=!0,o},[a]),L.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),L.useEffect(()=>{e.mode&&(a._options.mode=e.mode),e.reValidateMode&&(a._options.reValidateMode=e.reValidateMode)},[a,e.mode,e.reValidateMode]),L.useEffect(()=>{e.errors&&(a._setErrors(e.errors),a._focusError())},[a,e.errors]),L.useEffect(()=>{e.shouldUnregister&&a._subjects.state.next({values:a._getWatch()})},[a,e.shouldUnregister]),L.useEffect(()=>{if(a._proxyFormState.isDirty){const o=a._getDirty();o!==r.isDirty&&a._subjects.state.next({isDirty:o})}},[a,r.isDirty]),L.useEffect(()=>{e.values&&!zA(e.values,n.current)?(a._reset(e.values,{keepFieldsRef:!0,...a._options.resetOptions}),n.current=e.values,i(o=>({...o}))):a._resetDefaultValues()},[a,e.values]),L.useEffect(()=>{a._state.mount||(a._setValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),t.current.formState=t6e(r,a),t.current}var g4t=Object.defineProperty,v4t=Object.defineProperties,y4t=Object.getOwnPropertyDescriptors,nM=Object.getOwnPropertySymbols,d6e=Object.prototype.hasOwnProperty,f6e=Object.prototype.propertyIsEnumerable,a0e=(e,t,n)=>t in e?g4t(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,o0e=(e,t)=>{for(var n in t||(t={}))d6e.call(t,n)&&a0e(e,n,t[n]);if(nM)for(var n of nM(t))f6e.call(t,n)&&a0e(e,n,t[n]);return e},s0e=(e,t)=>v4t(e,y4t(t)),b4t=(e,t)=>{var n={};for(var r in e)d6e.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&nM)for(var r of nM(e))t.indexOf(r)<0&&f6e.call(e,r)&&(n[r]=e[r]);return n};function ZY(e){var t=e,{direction:n,style:r}=t,i=b4t(t,["direction","style"]);const a=Eu();return L.createElement(sE,s0e(o0e({},i),{style:s0e(o0e({},r),{transform:n==="next"&&a.dir==="ltr"||n==="previous"&&a.dir==="rtl"?"rotate(270deg)":"rotate(90deg)"})}))}ZY.displayName="@mantine/dates/Chevron";var x4t=Object.defineProperty,w4t=Object.defineProperties,k4t=Object.getOwnPropertyDescriptors,l0e=Object.getOwnPropertySymbols,S4t=Object.prototype.hasOwnProperty,C4t=Object.prototype.propertyIsEnumerable,c0e=(e,t,n)=>t in e?x4t(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,k5=(e,t)=>{for(var n in t||(t={}))S4t.call(t,n)&&c0e(e,n,t[n]);if(l0e)for(var n of l0e(t))C4t.call(t,n)&&c0e(e,n,t[n]);return e},u0e=(e,t)=>w4t(e,k4t(t));const mE={xs:Ve(30),sm:Ve(36),md:Ve(42),lg:Ve(48),xl:Ve(54)};var _4t=ln((e,{radius:t,isStatic:n},{size:r})=>{const i=e.fn.variant({variant:"filled"}),a=e.fn.variant({variant:"light"});return{day:u0e(k5({width:Ot({size:r,sizes:mE}),height:Ot({size:r,sizes:mE}),fontSize:Ot({size:r,sizes:e.fontSizes}),display:"inline-flex",justifyContent:"center",alignItems:"center",userSelect:n?void 0:"none",cursor:n?"default":"pointer",borderRadius:e.fn.radius(t)},n?null:e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[0]})),{"&:active":n?void 0:e.activeStyles,"&[data-disabled]":u0e(k5({color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[4],cursor:"not-allowed"},e.fn.hover({backgroundColor:"transparent"})),{"&:active":{transform:"none"}}),"&[data-weekend]":{color:e.colors.red[e.fn.primaryShade()]},"&[data-outside]":{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[4]},"&[data-in-range]":k5({backgroundColor:a.background,borderRadius:0},n?null:e.fn.hover({backgroundColor:a.hover})),"&[data-first-in-range]":{borderTopLeftRadius:e.radius.sm,borderBottomLeftRadius:e.radius.sm},"&[data-last-in-range]":{borderTopRightRadius:e.radius.sm,borderBottomRightRadius:e.radius.sm},"&[data-selected]":k5({color:i.color,backgroundColor:i.background},n?null:e.fn.hover({backgroundColor:i.hover})),"&[data-hidden]":{display:"none"}})}}),N4t=Object.defineProperty,E4t=Object.defineProperties,F4t=Object.getOwnPropertyDescriptors,d0e=Object.getOwnPropertySymbols,D4t=Object.prototype.hasOwnProperty,T4t=Object.prototype.propertyIsEnumerable,f0e=(e,t,n)=>t in e?N4t(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,S5=(e,t)=>{for(var n in t||(t={}))D4t.call(t,n)&&f0e(e,n,t[n]);if(d0e)for(var n of d0e(t))T4t.call(t,n)&&f0e(e,n,t[n]);return e},C5=(e,t)=>E4t(e,F4t(t)),O4t=ln((e,t,{size:n})=>{const r=Ot({size:n,sizes:mE});return{calendarHeaderControlIcon:{},calendarHeader:{display:"flex",maxWidth:`calc(${r} * 7 + ${Ve(7)})`},calendarHeaderControl:C5(S5({width:r,height:r,borderRadius:e.fn.radius(),display:"flex",justifyContent:"center",alignItems:"center",userSelect:"none"},e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[0]})),{"&:active":e.activeStyles,"&[data-disabled]":C5(S5({opacity:.2,cursor:"not-allowed"},e.fn.hover({backgroundColor:"transparent"})),{"&:active":{transform:"none"}})}),calendarHeaderLevel:C5(S5({height:r,borderRadius:e.fn.radius(),display:"flex",justifyContent:"center",alignItems:"center",userSelect:"none",flex:1,fontSize:Ot({size:n,sizes:e.fontSizes}),fontWeight:500,textTransform:"capitalize"},e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[0]})),{"&:active":e.activeStyles,"&[data-static]":C5(S5({cursor:"default",userSelect:"unset"},e.fn.hover({backgroundColor:"transparent"})),{"&:active":{transform:"none"}})})}}),B4t=Object.defineProperty,rM=Object.getOwnPropertySymbols,h6e=Object.prototype.hasOwnProperty,m6e=Object.prototype.propertyIsEnumerable,h0e=(e,t,n)=>t in e?B4t(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,I4t=(e,t)=>{for(var n in t||(t={}))h6e.call(t,n)&&h0e(e,n,t[n]);if(rM)for(var n of rM(t))m6e.call(t,n)&&h0e(e,n,t[n]);return e},j4t=(e,t)=>{var n={};for(var r in e)h6e.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&rM)for(var r of rM(e))t.indexOf(r)<0&&m6e.call(e,r)&&(n[r]=e[r]);return n};const P4t={nextDisabled:!1,previousDisabled:!1,hasNextLevel:!0,withNext:!0,withPrevious:!0,size:"sm"},j3=w.forwardRef((e,t)=>{const n=Qt("CalendarHeader",P4t,e),{className:r,nextIcon:i,previousIcon:a,nextLabel:o,previousLabel:s,onNext:l,onPrevious:c,onLevelClick:u,label:f,classNames:h,styles:m,unstyled:p,nextDisabled:A,previousDisabled:v,hasNextLevel:y,levelControlAriaLabel:x,withNext:k,withPrevious:S,__staticSelector:C,__preventFocus:N,__stopPropagation:E,size:D,variant:T}=n,P=j4t(n,["className","nextIcon","previousIcon","nextLabel","previousLabel","onNext","onPrevious","onLevelClick","label","classNames","styles","unstyled","nextDisabled","previousDisabled","hasNextLevel","levelControlAriaLabel","withNext","withPrevious","__staticSelector","__preventFocus","__stopPropagation","size","variant"]),{classes:O,cx:B}=O4t(null,{name:["CalendarHeader",C],classNames:h,styles:m,unstyled:p,size:D,variant:T}),M=N?$=>$.preventDefault():void 0;return L.createElement(Fn,I4t({className:B(O.calendarHeader,r),ref:t},P),S&&L.createElement(bd,{className:O.calendarHeaderControl,"data-previous":!0,"aria-label":s,onClick:c,unstyled:p,onMouseDown:M,disabled:v,"data-disabled":v||void 0,tabIndex:N?-1:0,"data-mantine-stop-propagation":E||void 0},a||L.createElement(ZY,{className:O.calendarHeaderControlIcon,direction:"previous","data-previous":!0})),L.createElement(bd,{component:y?"button":"div",className:O.calendarHeaderLevel,onClick:y?u:void 0,unstyled:p,onMouseDown:y?M:void 0,disabled:!y,"data-static":!y||void 0,"aria-label":x,tabIndex:N||!y?-1:0,"data-mantine-stop-propagation":E||void 0},f),k&&L.createElement(bd,{className:O.calendarHeaderControl,"data-next":!0,"aria-label":o,onClick:l,unstyled:p,onMouseDown:M,disabled:A,"data-disabled":A||void 0,tabIndex:N?-1:0,"data-mantine-stop-propagation":E||void 0},i||L.createElement(ZY,{className:O.calendarHeaderControlIcon,direction:"next","data-next":!0})))});j3.displayName="@mantine/dates/CalendarHeader";var rj={exports:{}},M4t=rj.exports,m0e;function R4t(){return m0e||(m0e=1,(function(e,t){(function(n,r){e.exports=r()})(M4t,(function(){var n=1e3,r=6e4,i=36e5,a="millisecond",o="second",s="minute",l="hour",c="day",u="week",f="month",h="quarter",m="year",p="date",A="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,x={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function($){var U=["th","st","nd","rd"],j=$%100;return"["+$+(U[(j-20)%10]||U[j]||U[0])+"]"}},k=function($,U,j){var V=String($);return!V||V.length>=U?$:""+Array(U+1-V.length).join(j)+$},S={s:k,z:function($){var U=-$.utcOffset(),j=Math.abs(U),V=Math.floor(j/60),Q=j%60;return(U<=0?"+":"-")+k(V,2,"0")+":"+k(Q,2,"0")},m:function $(U,j){if(U.date()<j.date())return-$(j,U);var V=12*(j.year()-U.year())+(j.month()-U.month()),Q=U.clone().add(V,f),X=j-Q<0,Z=U.clone().add(V+(X?-1:1),f);return+(-(V+(j-Q)/(X?Q-Z:Z-Q))||0)},a:function($){return $<0?Math.ceil($)||0:Math.floor($)},p:function($){return{M:f,y:m,w:u,d:c,D:p,h:l,m:s,s:o,ms:a,Q:h}[$]||String($||"").toLowerCase().replace(/s$/,"")},u:function($){return $===void 0}},C="en",N={};N[C]=x;var E="$isDayjsObject",D=function($){return $ instanceof B||!(!$||!$[E])},T=function $(U,j,V){var Q;if(!U)return C;if(typeof U=="string"){var X=U.toLowerCase();N[X]&&(Q=X),j&&(N[X]=j,Q=X);var Z=U.split("-");if(!Q&&Z.length>1)return $(Z[0])}else{var le=U.name;N[le]=U,Q=le}return!V&&Q&&(C=Q),Q||!V&&C},P=function($,U){if(D($))return $.clone();var j=typeof U=="object"?U:{};return j.date=$,j.args=arguments,new B(j)},O=S;O.l=T,O.i=D,O.w=function($,U){return P($,{locale:U.$L,utc:U.$u,x:U.$x,$offset:U.$offset})};var B=(function(){function $(j){this.$L=T(j.locale,null,!0),this.parse(j),this.$x=this.$x||j.x||{},this[E]=!0}var U=$.prototype;return U.parse=function(j){this.$d=(function(V){var Q=V.date,X=V.utc;if(Q===null)return new Date(NaN);if(O.u(Q))return new Date;if(Q instanceof Date)return new Date(Q);if(typeof Q=="string"&&!/Z$/i.test(Q)){var Z=Q.match(v);if(Z){var le=Z[2]-1||0,H=(Z[7]||"0").substring(0,3);return X?new Date(Date.UTC(Z[1],le,Z[3]||1,Z[4]||0,Z[5]||0,Z[6]||0,H)):new Date(Z[1],le,Z[3]||1,Z[4]||0,Z[5]||0,Z[6]||0,H)}}return new Date(Q)})(j),this.init()},U.init=function(){var j=this.$d;this.$y=j.getFullYear(),this.$M=j.getMonth(),this.$D=j.getDate(),this.$W=j.getDay(),this.$H=j.getHours(),this.$m=j.getMinutes(),this.$s=j.getSeconds(),this.$ms=j.getMilliseconds()},U.$utils=function(){return O},U.isValid=function(){return this.$d.toString()!==A},U.isSame=function(j,V){var Q=P(j);return this.startOf(V)<=Q&&Q<=this.endOf(V)},U.isAfter=function(j,V){return P(j)<this.startOf(V)},U.isBefore=function(j,V){return this.endOf(V)<P(j)},U.$g=function(j,V,Q){return O.u(j)?this[V]:this.set(Q,j)},U.unix=function(){return Math.floor(this.valueOf()/1e3)},U.valueOf=function(){return this.$d.getTime()},U.startOf=function(j,V){var Q=this,X=!!O.u(V)||V,Z=O.p(j),le=function(he,pe){var oe=O.w(Q.$u?Date.UTC(Q.$y,pe,he):new Date(Q.$y,pe,he),Q);return X?oe:oe.endOf(c)},H=function(he,pe){return O.w(Q.toDate()[he].apply(Q.toDate("s"),(X?[0,0,0,0]:[23,59,59,999]).slice(pe)),Q)},G=this.$W,W=this.$M,te=this.$D,re="set"+(this.$u?"UTC":"");switch(Z){case m:return X?le(1,0):le(31,11);case f:return X?le(1,W):le(0,W+1);case u:var ne=this.$locale().weekStart||0,de=(G<ne?G+7:G)-ne;return le(X?te-de:te+(6-de),W);case c:case p:return H(re+"Hours",0);case l:return H(re+"Minutes",1);case s:return H(re+"Seconds",2);case o:return H(re+"Milliseconds",3);default:return this.clone()}},U.endOf=function(j){return this.startOf(j,!1)},U.$set=function(j,V){var Q,X=O.p(j),Z="set"+(this.$u?"UTC":""),le=(Q={},Q[c]=Z+"Date",Q[p]=Z+"Date",Q[f]=Z+"Month",Q[m]=Z+"FullYear",Q[l]=Z+"Hours",Q[s]=Z+"Minutes",Q[o]=Z+"Seconds",Q[a]=Z+"Milliseconds",Q)[X],H=X===c?this.$D+(V-this.$W):V;if(X===f||X===m){var G=this.clone().set(p,1);G.$d[le](H),G.init(),this.$d=G.set(p,Math.min(this.$D,G.daysInMonth())).$d}else le&&this.$d[le](H);return this.init(),this},U.set=function(j,V){return this.clone().$set(j,V)},U.get=function(j){return this[O.p(j)]()},U.add=function(j,V){var Q,X=this;j=Number(j);var Z=O.p(V),le=function(W){var te=P(X);return O.w(te.date(te.date()+Math.round(W*j)),X)};if(Z===f)return this.set(f,this.$M+j);if(Z===m)return this.set(m,this.$y+j);if(Z===c)return le(1);if(Z===u)return le(7);var H=(Q={},Q[s]=r,Q[l]=i,Q[o]=n,Q)[Z]||1,G=this.$d.getTime()+j*H;return O.w(G,this)},U.subtract=function(j,V){return this.add(-1*j,V)},U.format=function(j){var V=this,Q=this.$locale();if(!this.isValid())return Q.invalidDate||A;var X=j||"YYYY-MM-DDTHH:mm:ssZ",Z=O.z(this),le=this.$H,H=this.$m,G=this.$M,W=Q.weekdays,te=Q.months,re=Q.meridiem,ne=function(pe,oe,J,Se){return pe&&(pe[oe]||pe(V,X))||J[oe].slice(0,Se)},de=function(pe){return O.s(le%12||12,pe,"0")},he=re||function(pe,oe,J){var Se=pe<12?"AM":"PM";return J?Se.toLowerCase():Se};return X.replace(y,(function(pe,oe){return oe||(function(J){switch(J){case"YY":return String(V.$y).slice(-2);case"YYYY":return O.s(V.$y,4,"0");case"M":return G+1;case"MM":return O.s(G+1,2,"0");case"MMM":return ne(Q.monthsShort,G,te,3);case"MMMM":return ne(te,G);case"D":return V.$D;case"DD":return O.s(V.$D,2,"0");case"d":return String(V.$W);case"dd":return ne(Q.weekdaysMin,V.$W,W,2);case"ddd":return ne(Q.weekdaysShort,V.$W,W,3);case"dddd":return W[V.$W];case"H":return String(le);case"HH":return O.s(le,2,"0");case"h":return de(1);case"hh":return de(2);case"a":return he(le,H,!0);case"A":return he(le,H,!1);case"m":return String(H);case"mm":return O.s(H,2,"0");case"s":return String(V.$s);case"ss":return O.s(V.$s,2,"0");case"SSS":return O.s(V.$ms,3,"0");case"Z":return Z}return null})(pe)||Z.replace(":","")}))},U.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},U.diff=function(j,V,Q){var X,Z=this,le=O.p(V),H=P(j),G=(H.utcOffset()-this.utcOffset())*r,W=this-H,te=function(){return O.m(Z,H)};switch(le){case m:X=te()/12;break;case f:X=te();break;case h:X=te()/3;break;case u:X=(W-G)/6048e5;break;case c:X=(W-G)/864e5;break;case l:X=W/i;break;case s:X=W/r;break;case o:X=W/n;break;default:X=W}return Q?X:O.a(X)},U.daysInMonth=function(){return this.endOf(f).$D},U.$locale=function(){return N[this.$L]},U.locale=function(j,V){if(!j)return this.$L;var Q=this.clone(),X=T(j,V,!0);return X&&(Q.$L=X),Q},U.clone=function(){return O.w(this.$d,this)},U.toDate=function(){return new Date(this.valueOf())},U.toJSON=function(){return this.isValid()?this.toISOString():null},U.toISOString=function(){return this.$d.toISOString()},U.toString=function(){return this.$d.toUTCString()},$})(),M=B.prototype;return P.prototype=M,[["$ms",a],["$s",o],["$m",s],["$H",l],["$W",c],["$M",f],["$y",m],["$D",p]].forEach((function($){M[$[1]]=function(U){return this.$g(U,$[0],$[1])}})),P.extend=function($,U){return $.$i||($(U,B,P),$.$i=!0),P},P.locale=T,P.isDayjs=D,P.unix=function($){return P(1e3*$)},P.en=N[C],P.Ls=N,P.p={},P}))})(rj)),rj.exports}var $4t=R4t();const Un=Ni($4t);function $9(e,t){return e?e==="month"?0:e==="year"?1:2:t}function L4t(e){return e===0?"month":e===1?"year":"decade"}function Y_(e,t,n){return L4t(y2($9(e,0),$9(t,0),$9(n,2)))}var U4t=ln(()=>({calendar:{}})),z4t=ln((e,t,{size:n})=>({monthLevelGroup:{display:"flex","& [data-month-level]:not(:last-of-type)":{marginRight:Ot({size:n,sizes:e.spacing})}}})),H4t=ln(e=>({monthLevel:{},calendarHeader:{marginBottom:e.spacing.xs}}));const V4t={locale:"en",firstDayOfWeek:1,weekendDays:[0,6],labelSeparator:"–"},Q4t=w.createContext(V4t);var q4t=Object.defineProperty,G4t=Object.defineProperties,W4t=Object.getOwnPropertyDescriptors,p0e=Object.getOwnPropertySymbols,K4t=Object.prototype.hasOwnProperty,Y4t=Object.prototype.propertyIsEnumerable,A0e=(e,t,n)=>t in e?q4t(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,X4t=(e,t)=>{for(var n in t||(t={}))K4t.call(t,n)&&A0e(e,n,t[n]);if(p0e)for(var n of p0e(t))Y4t.call(t,n)&&A0e(e,n,t[n]);return e},Z4t=(e,t)=>G4t(e,W4t(t));function Sg(){const e=w.useContext(Q4t),t=w.useCallback(a=>a||e.locale,[e.locale]),n=w.useCallback(a=>typeof a=="number"?a:e.firstDayOfWeek,[e.firstDayOfWeek]),r=w.useCallback(a=>Array.isArray(a)?a:e.weekendDays,[e.weekendDays]),i=w.useCallback(a=>typeof a=="string"?a:e.labelSeparator,[e.labelSeparator]);return Z4t(X4t({},e),{getLocale:t,getFirstDayOfWeek:n,getWeekendDays:r,getLabelSeparator:i})}function J4t(e,t=1){const n=new Date(e);for(;n.getDay()!==t;)n.setDate(n.getDate()-1);return n}function eMt(e,t=1){const n=new Date(e),r=t===0?6:t-1;for(;n.getDay()!==r;)n.setDate(n.getDate()+1);return n}function tMt(e,t=1){const n=e.getMonth(),r=new Date(e.getFullYear(),n,1),i=new Date(e.getFullYear(),e.getMonth()+1,0),a=eMt(i,t),o=J4t(r,t),s=[];for(;o<=a;){const l=[];for(let c=0;c<7;c+=1)l.push(new Date(o)),o.setDate(o.getDate()+1);s.push(l)}return s}function p6e(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()}function A6e(e,t){return t instanceof Date?Un(e).isBefore(Un(t).add(1,"day"),"day"):!0}function g6e(e,t){return t instanceof Date?Un(e).isAfter(Un(t).subtract(1,"day"),"day"):!0}var nMt=Object.defineProperty,rMt=Object.defineProperties,iMt=Object.getOwnPropertyDescriptors,g0e=Object.getOwnPropertySymbols,aMt=Object.prototype.hasOwnProperty,oMt=Object.prototype.propertyIsEnumerable,v0e=(e,t,n)=>t in e?nMt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,sMt=(e,t)=>{for(var n in t||(t={}))aMt.call(t,n)&&v0e(e,n,t[n]);if(g0e)for(var n of g0e(t))oMt.call(t,n)&&v0e(e,n,t[n]);return e},lMt=(e,t)=>rMt(e,iMt(t)),cMt=ln(e=>({monthThead:{},monthRow:{},monthTbody:{},monthCell:{padding:0,"&[data-with-spacing]":{padding:Ve(.5)}},month:lMt(sMt({},e.fn.fontStyles()),{borderCollapse:"collapse",tableLayout:"fixed","& *":{boxSizing:"border-box"}})}));function uMt(e,t,n,r,i,a,o){const s=e.flat().filter(u=>{var f;return A6e(u,n)&&g6e(u,t)&&!i?.(u)&&!((f=r?.(u))!=null&&f.disabled)&&(!a||p6e(u,o))}),l=s.find(u=>{var f;return(f=r?.(u))==null?void 0:f.selected});if(l)return l;const c=s.find(u=>Un().isSame(u,"date"));return c||s[0]}var dMt=Object.defineProperty,iM=Object.getOwnPropertySymbols,v6e=Object.prototype.hasOwnProperty,y6e=Object.prototype.propertyIsEnumerable,y0e=(e,t,n)=>t in e?dMt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fMt=(e,t)=>{for(var n in t||(t={}))v6e.call(t,n)&&y0e(e,n,t[n]);if(iM)for(var n of iM(t))y6e.call(t,n)&&y0e(e,n,t[n]);return e},hMt=(e,t)=>{var n={};for(var r in e)v6e.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&iM)for(var r of iM(e))t.indexOf(r)<0&&y6e.call(e,r)&&(n[r]=e[r]);return n};const mMt={tabIndex:0,size:"sm"},b6e=w.forwardRef((e,t)=>{const n=Qt("Day",mMt,e),{className:r,date:i,radius:a,disabled:o,styles:s,classNames:l,unstyled:c,__staticSelector:u,weekend:f,outside:h,selected:m,renderDay:p,inRange:A,firstInRange:v,lastInRange:y,hidden:x,static:k,variant:S,size:C}=n,N=hMt(n,["className","date","radius","disabled","styles","classNames","unstyled","__staticSelector","weekend","outside","selected","renderDay","inRange","firstInRange","lastInRange","hidden","static","variant","size"]),{classes:E,cx:D}=_4t({radius:a,isStatic:k},{name:["Day",u],classNames:l,styles:s,unstyled:c,variant:S,size:C});return L.createElement(bd,fMt({component:k?"div":"button",ref:t,className:D(E.day,r),disabled:o,"data-today":Un(i).isSame(new Date,"day")||void 0,"data-hidden":x||void 0,"data-disabled":o||void 0,"data-weekend":!o&&!h&&f||void 0,"data-outside":!o&&h||void 0,"data-selected":!o&&m||void 0,"data-in-range":A&&!o||void 0,"data-first-in-range":v&&!o||void 0,"data-last-in-range":y&&!o||void 0,unstyled:c},N),p?.(i)||i.getDate())});b6e.displayName="@mantine/dates/Day";function pMt({locale:e,format:t="dd",firstDayOfWeek:n=1}){const r=Un().day(n),i=[];for(let a=0;a<7;a+=1)typeof t=="string"?i.push(Un(r).add(a,"days").locale(e).format(t)):i.push(t(Un(r).add(a,"days").toDate()));return i}var AMt=ln((e,t,{size:n})=>({weekdaysRow:{},weekday:{color:e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[5],fontWeight:400,fontSize:Ot({size:n,sizes:e.fontSizes}),textTransform:"capitalize",paddingBottom:`calc(${Ot({size:n,sizes:e.spacing})} / 2)`}})),gMt=Object.defineProperty,aM=Object.getOwnPropertySymbols,x6e=Object.prototype.hasOwnProperty,w6e=Object.prototype.propertyIsEnumerable,b0e=(e,t,n)=>t in e?gMt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vMt=(e,t)=>{for(var n in t||(t={}))x6e.call(t,n)&&b0e(e,n,t[n]);if(aM)for(var n of aM(t))w6e.call(t,n)&&b0e(e,n,t[n]);return e},yMt=(e,t)=>{var n={};for(var r in e)x6e.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&aM)for(var r of aM(e))t.indexOf(r)<0&&w6e.call(e,r)&&(n[r]=e[r]);return n};const bMt={weekdayFormat:"dd",cellComponent:"th",size:"sm"},k6e=w.forwardRef((e,t)=>{const n=Qt("WeekdaysRow",bMt,e),{className:r,locale:i,firstDayOfWeek:a,weekdayFormat:o,cellComponent:s,__staticSelector:l,classNames:c,styles:u,unstyled:f,variant:h,size:m}=n,p=yMt(n,["className","locale","firstDayOfWeek","weekdayFormat","cellComponent","__staticSelector","classNames","styles","unstyled","variant","size"]),A=Sg(),{classes:v,cx:y}=AMt(null,{name:["WeekdaysRow",l],classNames:c,styles:u,unstyled:f,variant:h,size:m}),x=pMt({locale:A.getLocale(i),format:o,firstDayOfWeek:A.getFirstDayOfWeek(a)}).map((k,S)=>L.createElement(s,{key:S,className:v.weekday},k));return L.createElement(Fn,vMt({component:"tr",ref:t,className:y(v.weekdaysRow,r)},p),x)});k6e.displayName="@mantine/dates/WeekdaysRow";var xMt=Object.defineProperty,wMt=Object.defineProperties,kMt=Object.getOwnPropertyDescriptors,oM=Object.getOwnPropertySymbols,S6e=Object.prototype.hasOwnProperty,C6e=Object.prototype.propertyIsEnumerable,x0e=(e,t,n)=>t in e?xMt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_5=(e,t)=>{for(var n in t||(t={}))S6e.call(t,n)&&x0e(e,n,t[n]);if(oM)for(var n of oM(t))C6e.call(t,n)&&x0e(e,n,t[n]);return e},L9=(e,t)=>wMt(e,kMt(t)),SMt=(e,t)=>{var n={};for(var r in e)S6e.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&oM)for(var r of oM(e))t.indexOf(r)<0&&C6e.call(e,r)&&(n[r]=e[r]);return n};const CMt={size:"sm",withCellSpacing:!0},_6e=w.forwardRef((e,t)=>{const n=Qt("Month",CMt,e),{className:r,classNames:i,styles:a,unstyled:o,__staticSelector:s,locale:l,firstDayOfWeek:c,weekdayFormat:u,month:f,weekendDays:h,getDayProps:m,excludeDate:p,minDate:A,maxDate:v,renderDay:y,hideOutsideDates:x,hideWeekdays:k,getDayAriaLabel:S,static:C,__getDayRef:N,__onDayKeyDown:E,__onDayClick:D,__onDayMouseEnter:T,__preventFocus:P,__stopPropagation:O,withCellSpacing:B,size:M,variant:$}=n,U=SMt(n,["className","classNames","styles","unstyled","__staticSelector","locale","firstDayOfWeek","weekdayFormat","month","weekendDays","getDayProps","excludeDate","minDate","maxDate","renderDay","hideOutsideDates","hideWeekdays","getDayAriaLabel","static","__getDayRef","__onDayKeyDown","__onDayClick","__onDayMouseEnter","__preventFocus","__stopPropagation","withCellSpacing","size","variant"]),j=Sg(),{classes:V,cx:Q}=cMt(null,{name:["Month",s],classNames:i,styles:a,unstyled:o,variant:$,size:M}),X={__staticSelector:s||"Month",classNames:i,styles:a,unstyled:o,variant:$,size:M},Z=tMt(f,j.getFirstDayOfWeek(c)),le=uMt(Z,A,v,m,p,x,f),H=Z.map((G,W)=>{const te=G.map((re,ne)=>{const de=!p6e(re,f),he=S?.(re)||Un(re).locale(l||j.locale).format("D MMMM YYYY"),pe=m?.(re),oe=Un(re).isSame(le,"date");return L.createElement("td",{key:re.toString(),className:V.monthCell,"data-with-spacing":B||void 0},L.createElement(b6e,L9(_5(L9(_5({},X),{"data-mantine-stop-propagation":O||void 0,renderDay:y,date:re,weekend:j.getWeekendDays(h).includes(re.getDay()),outside:de,hidden:x?de:!1,"aria-label":he,static:C,disabled:p?.(re)||!A6e(re,v)||!g6e(re,A),ref:J=>N?.(W,ne,J)}),pe),{onKeyDown:J=>{var Se;(Se=pe?.onKeyDown)==null||Se.call(pe,J),E?.(J,{rowIndex:W,cellIndex:ne,date:re})},onMouseEnter:J=>{var Se;(Se=pe?.onMouseEnter)==null||Se.call(pe,J),T?.(J,re)},onClick:J=>{var Se;(Se=pe?.onClick)==null||Se.call(pe,J),D?.(J,re)},onMouseDown:J=>{var Se;(Se=pe?.onMouseDown)==null||Se.call(pe,J),P&&J.preventDefault()},tabIndex:P||!oe?-1:0})))});return L.createElement("tr",{key:W,className:V.monthRow},te)});return L.createElement(Fn,_5({component:"table",className:Q(V.month,r),ref:t},U),!k&&L.createElement("thead",{className:V.monthThead},L.createElement(k6e,L9(_5({},X),{locale:l,firstDayOfWeek:c,weekdayFormat:u}))),L.createElement("tbody",{className:V.monthTbody},H))});_6e.displayName="@mantine/dates/Month";var _Mt=Object.defineProperty,sM=Object.getOwnPropertySymbols,N6e=Object.prototype.hasOwnProperty,E6e=Object.prototype.propertyIsEnumerable,w0e=(e,t,n)=>t in e?_Mt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,U9=(e,t)=>{for(var n in t||(t={}))N6e.call(t,n)&&w0e(e,n,t[n]);if(sM)for(var n of sM(t))E6e.call(t,n)&&w0e(e,n,t[n]);return e},NMt=(e,t)=>{var n={};for(var r in e)N6e.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&sM)for(var r of sM(e))t.indexOf(r)<0&&E6e.call(e,r)&&(n[r]=e[r]);return n};const EMt={monthLabelFormat:"MMMM YYYY"},F6e=w.forwardRef((e,t)=>{const n=Qt("MonthLevel",EMt,e),{month:r,locale:i,firstDayOfWeek:a,weekdayFormat:o,weekendDays:s,getDayProps:l,excludeDate:c,minDate:u,maxDate:f,renderDay:h,hideOutsideDates:m,hideWeekdays:p,getDayAriaLabel:A,__getDayRef:v,__onDayKeyDown:y,__onDayClick:x,__onDayMouseEnter:k,withCellSpacing:S,__preventFocus:C,__stopPropagation:N,nextIcon:E,previousIcon:D,nextLabel:T,previousLabel:P,onNext:O,onPrevious:B,onLevelClick:M,nextDisabled:$,previousDisabled:U,hasNextLevel:j,levelControlAriaLabel:V,withNext:Q,withPrevious:X,className:Z,monthLabelFormat:le,classNames:H,styles:G,unstyled:W,__staticSelector:te,size:re,variant:ne,static:de}=n,he=NMt(n,["month","locale","firstDayOfWeek","weekdayFormat","weekendDays","getDayProps","excludeDate","minDate","maxDate","renderDay","hideOutsideDates","hideWeekdays","getDayAriaLabel","__getDayRef","__onDayKeyDown","__onDayClick","__onDayMouseEnter","withCellSpacing","__preventFocus","__stopPropagation","nextIcon","previousIcon","nextLabel","previousLabel","onNext","onPrevious","onLevelClick","nextDisabled","previousDisabled","hasNextLevel","levelControlAriaLabel","withNext","withPrevious","className","monthLabelFormat","classNames","styles","unstyled","__staticSelector","size","variant","static"]),{classes:pe,cx:oe}=H4t(null,{name:["MonthLevel",te],classNames:H,styles:G,unstyled:W,variant:ne,size:re}),J=Sg(),Se={__staticSelector:te||"MonthLevel",classNames:H,styles:G,unstyled:W,variant:ne,size:re},be=typeof $=="boolean"?$:f?!Un(r).endOf("month").isBefore(f):!1,we=typeof U=="boolean"?U:u?!Un(r).startOf("month").isAfter(u):!1;return L.createElement(Fn,U9({className:oe(pe.monthLevel,Z),"data-month-level":!0,ref:t},he),L.createElement(j3,U9({label:typeof le=="function"?le(r):Un(r).locale(i||J.locale).format(le),className:pe.calendarHeader,__preventFocus:C,__stopPropagation:N,nextIcon:E,previousIcon:D,nextLabel:T,previousLabel:P,onNext:O,onPrevious:B,onLevelClick:M,nextDisabled:be,previousDisabled:we,hasNextLevel:j,levelControlAriaLabel:V,withNext:Q,withPrevious:X},Se)),L.createElement(_6e,U9({month:r,locale:i,firstDayOfWeek:a,weekdayFormat:o,weekendDays:s,getDayProps:l,excludeDate:c,minDate:u,maxDate:f,renderDay:h,hideOutsideDates:m,hideWeekdays:p,getDayAriaLabel:A,__getDayRef:v,__onDayKeyDown:y,__onDayClick:x,__onDayMouseEnter:k,__preventFocus:C,__stopPropagation:N,static:de,withCellSpacing:S},Se)))});F6e.displayName="@mantine/dates/MonthLevel";function FMt({direction:e,levelIndex:t,rowIndex:n,cellIndex:r,size:i}){switch(e){case"up":return t===0&&n===0?null:n===0?{levelIndex:t-1,rowIndex:r<=i[t-1][i[t-1].length-1]-1?i[t-1].length-1:i[t-1].length-2,cellIndex:r}:{levelIndex:t,rowIndex:n-1,cellIndex:r};case"down":return n===i[t].length-1?{levelIndex:t+1,rowIndex:0,cellIndex:r}:n===i[t].length-2&&r>=i[t][i[t].length-1]?{levelIndex:t+1,rowIndex:0,cellIndex:r}:{levelIndex:t,rowIndex:n+1,cellIndex:r};case"left":return t===0&&n===0&&r===0?null:n===0&&r===0?{levelIndex:t-1,rowIndex:i[t-1].length-1,cellIndex:i[t-1][i[t-1].length-1]-1}:r===0?{levelIndex:t,rowIndex:n-1,cellIndex:i[t][n-1]-1}:{levelIndex:t,rowIndex:n,cellIndex:r-1};case"right":return n===i[t].length-1&&r===i[t][n]-1?{levelIndex:t+1,rowIndex:0,cellIndex:0}:r===i[t][n]-1?{levelIndex:t,rowIndex:n+1,cellIndex:0}:{levelIndex:t,rowIndex:n,cellIndex:r+1};default:return{levelIndex:t,rowIndex:n,cellIndex:r}}}function D6e({controlsRef:e,direction:t,levelIndex:n,rowIndex:r,cellIndex:i,size:a}){var o,s;const l=FMt({direction:t,size:a,rowIndex:r,cellIndex:i,levelIndex:n});if(!l)return;const c=(s=(o=e.current[l.levelIndex])==null?void 0:o[l.rowIndex])==null?void 0:s[l.cellIndex];c&&(c.disabled||c.getAttribute("data-hidden")||c.getAttribute("data-outside")?D6e({controlsRef:e,direction:t,levelIndex:l.levelIndex,cellIndex:l.cellIndex,rowIndex:l.rowIndex,size:a}):c.focus())}function DMt(e){switch(e){case"ArrowDown":return"down";case"ArrowUp":return"up";case"ArrowRight":return"right";case"ArrowLeft":return"left";default:return null}}function TMt(e){return e.current.map(t=>t.map(n=>n.length))}function Zne({controlsRef:e,levelIndex:t,rowIndex:n,cellIndex:r,event:i}){const a=DMt(i.key);if(a){i.preventDefault();const o=TMt(e);D6e({controlsRef:e,direction:a,levelIndex:t,rowIndex:n,cellIndex:r,size:o})}}var OMt=Object.defineProperty,lM=Object.getOwnPropertySymbols,T6e=Object.prototype.hasOwnProperty,O6e=Object.prototype.propertyIsEnumerable,k0e=(e,t,n)=>t in e?OMt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,BMt=(e,t)=>{for(var n in t||(t={}))T6e.call(t,n)&&k0e(e,n,t[n]);if(lM)for(var n of lM(t))O6e.call(t,n)&&k0e(e,n,t[n]);return e},IMt=(e,t)=>{var n={};for(var r in e)T6e.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&lM)for(var r of lM(e))t.indexOf(r)<0&&O6e.call(e,r)&&(n[r]=e[r]);return n};const jMt={numberOfColumns:1},B6e=w.forwardRef((e,t)=>{const n=Qt("MonthLevelGroup",jMt,e),{month:r,locale:i,firstDayOfWeek:a,weekdayFormat:o,weekendDays:s,getDayProps:l,excludeDate:c,minDate:u,maxDate:f,renderDay:h,hideOutsideDates:m,hideWeekdays:p,getDayAriaLabel:A,__onDayClick:v,__onDayMouseEnter:y,withCellSpacing:x,__preventFocus:k,nextIcon:S,previousIcon:C,nextLabel:N,previousLabel:E,onNext:D,onPrevious:T,onLevelClick:P,nextDisabled:O,previousDisabled:B,hasNextLevel:M,className:$,classNames:U,styles:j,unstyled:V,numberOfColumns:Q,levelControlAriaLabel:X,monthLabelFormat:Z,__staticSelector:le,__stopPropagation:H,size:G,variant:W,static:te}=n,re=IMt(n,["month","locale","firstDayOfWeek","weekdayFormat","weekendDays","getDayProps","excludeDate","minDate","maxDate","renderDay","hideOutsideDates","hideWeekdays","getDayAriaLabel","__onDayClick","__onDayMouseEnter","withCellSpacing","__preventFocus","nextIcon","previousIcon","nextLabel","previousLabel","onNext","onPrevious","onLevelClick","nextDisabled","previousDisabled","hasNextLevel","className","classNames","styles","unstyled","numberOfColumns","levelControlAriaLabel","monthLabelFormat","__staticSelector","__stopPropagation","size","variant","static"]),{classes:ne,cx:de}=z4t(null,{name:["MonthLevelGroup",le],classNames:U,styles:j,unstyled:V,variant:W,size:G}),he=w.useRef([]),pe=Array(Q).fill(0).map((oe,J)=>{const Se=Un(r).add(J,"months").toDate();return L.createElement(F6e,{key:J,month:Se,withNext:J===Q-1,withPrevious:J===0,monthLabelFormat:Z,__stopPropagation:H,__onDayClick:v,__onDayMouseEnter:y,__onDayKeyDown:(be,we)=>Zne({levelIndex:J,rowIndex:we.rowIndex,cellIndex:we.cellIndex,event:be,controlsRef:he}),__getDayRef:(be,we,me)=>{Array.isArray(he.current[J])||(he.current[J]=[]),Array.isArray(he.current[J][be])||(he.current[J][be]=[]),he.current[J][be][we]=me},levelControlAriaLabel:typeof X=="function"?X(Se):X,locale:i,firstDayOfWeek:a,weekdayFormat:o,weekendDays:s,getDayProps:l,excludeDate:c,minDate:u,maxDate:f,renderDay:h,hideOutsideDates:m,hideWeekdays:p,getDayAriaLabel:A,__preventFocus:k,nextIcon:S,previousIcon:C,nextLabel:N,previousLabel:E,onNext:D,onPrevious:T,onLevelClick:P,nextDisabled:O,previousDisabled:B,hasNextLevel:M,classNames:U,styles:j,unstyled:V,__staticSelector:le||"MonthLevelGroup",size:G,variant:W,static:te,withCellSpacing:x})});return L.createElement(Fn,BMt({className:de(ne.monthLevelGroup,$),ref:t},re),pe)});B6e.displayName="@mantine/dates/MonthLevelGroup";var PMt=ln((e,t,{size:n})=>({yearLevelGroup:{display:"flex","& [data-year-level]:not(:last-of-type)":{marginRight:Ot({size:n,sizes:e.spacing})}}})),MMt=ln(e=>({yearLevel:{},calendarHeader:{marginBottom:e.spacing.xs}}));function RMt(e){const t=Un(e).startOf("year").toDate(),n=[[],[],[],[]];let r=0;for(let i=0;i<4;i+=1)for(let a=0;a<3;a+=1)n[i].push(Un(t).add(r,"months").toDate()),r+=1;return n}function I6e(e,t,n){return!t&&!n?!1:!!(t&&Un(e).isBefore(t,"month")||n&&Un(e).isAfter(n,"month"))}var $Mt=ln(()=>({monthsList:{borderCollapse:"collapse",borderWidth:0,cursor:"pointer"},monthsListCell:{padding:0,"&[data-with-spacing]":{padding:Ve(.5)}},monthsListRow:{}}));function LMt(e,t,n,r){const i=e.flat().filter(s=>{var l;return!I6e(s,t,n)&&!((l=r?.(s))!=null&&l.disabled)}),a=i.find(s=>{var l;return(l=r?.(s))==null?void 0:l.selected});if(a)return a;const o=i.find(s=>Un().isSame(s,"month"));return o||i[0]}var UMt=Object.defineProperty,zMt=Object.defineProperties,HMt=Object.getOwnPropertyDescriptors,S0e=Object.getOwnPropertySymbols,VMt=Object.prototype.hasOwnProperty,QMt=Object.prototype.propertyIsEnumerable,C0e=(e,t,n)=>t in e?UMt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,N5=(e,t)=>{for(var n in t||(t={}))VMt.call(t,n)&&C0e(e,n,t[n]);if(S0e)for(var n of S0e(t))QMt.call(t,n)&&C0e(e,n,t[n]);return e},_0e=(e,t)=>zMt(e,HMt(t)),qMt=ln((e,t,{size:n})=>{const r=e.fn.variant({variant:"filled"}),i=e.fn.variant({variant:"light"});return{pickerControl:_0e(N5({fontSize:Ot({size:n,sizes:e.fontSizes}),height:Ot({size:n,sizes:mE}),width:`calc((${Ot({size:n,sizes:mE})} * 7) / 3 + ${Ve(1.5)})`,display:"flex",justifyContent:"center",alignItems:"center",userSelect:"none",borderRadius:e.fn.radius()},e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[0]})),{"&:active":e.activeStyles,"&[data-in-range]":N5({backgroundColor:i.background,borderRadius:0},e.fn.hover({backgroundColor:i.hover})),"&[data-first-in-range]":{borderRadius:0,borderTopLeftRadius:e.radius.sm,borderBottomLeftRadius:e.radius.sm},"&[data-last-in-range]":{borderRadius:0,borderTopRightRadius:e.radius.sm,borderBottomRightRadius:e.radius.sm},"&[data-last-in-range][data-first-in-range]":{borderRadius:e.radius.sm},"&[data-selected]":N5({color:r.color,backgroundColor:r.background},e.fn.hover({backgroundColor:r.hover})),"&[data-disabled]":_0e(N5({color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[4],cursor:"not-allowed"},e.fn.hover({backgroundColor:"transparent"})),{"&:active":{transform:"none"}})})}}),GMt=Object.defineProperty,cM=Object.getOwnPropertySymbols,j6e=Object.prototype.hasOwnProperty,P6e=Object.prototype.propertyIsEnumerable,N0e=(e,t,n)=>t in e?GMt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,WMt=(e,t)=>{for(var n in t||(t={}))j6e.call(t,n)&&N0e(e,n,t[n]);if(cM)for(var n of cM(t))P6e.call(t,n)&&N0e(e,n,t[n]);return e},KMt=(e,t)=>{var n={};for(var r in e)j6e.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&cM)for(var r of cM(e))t.indexOf(r)<0&&P6e.call(e,r)&&(n[r]=e[r]);return n};const YMt={size:"sm"},Jne=w.forwardRef((e,t)=>{const n=Qt("PickerControl",YMt,e),{className:r,children:i,disabled:a,selected:o,classNames:s,styles:l,unstyled:c,firstInRange:u,lastInRange:f,inRange:h,__staticSelector:m,size:p,variant:A}=n,v=KMt(n,["className","children","disabled","selected","classNames","styles","unstyled","firstInRange","lastInRange","inRange","__staticSelector","size","variant"]),{classes:y,cx:x}=qMt(null,{name:["PickerControl",m],classNames:s,styles:l,unstyled:c,variant:A,size:p});return L.createElement(bd,WMt({className:x(y.pickerControl,r),ref:t,unstyled:c,"data-picker-control":!0,"data-selected":o&&!a||void 0,"data-disabled":a||void 0,"data-in-range":h&&!a&&!o||void 0,"data-first-in-range":u&&!a||void 0,"data-last-in-range":f&&!a||void 0,disabled:a},v),i)});Jne.displayName="@mantine/dates/PickerControl";var XMt=Object.defineProperty,ZMt=Object.defineProperties,JMt=Object.getOwnPropertyDescriptors,uM=Object.getOwnPropertySymbols,M6e=Object.prototype.hasOwnProperty,R6e=Object.prototype.propertyIsEnumerable,E0e=(e,t,n)=>t in e?XMt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,F0e=(e,t)=>{for(var n in t||(t={}))M6e.call(t,n)&&E0e(e,n,t[n]);if(uM)for(var n of uM(t))R6e.call(t,n)&&E0e(e,n,t[n]);return e},eRt=(e,t)=>ZMt(e,JMt(t)),tRt=(e,t)=>{var n={};for(var r in e)M6e.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&uM)for(var r of uM(e))t.indexOf(r)<0&&R6e.call(e,r)&&(n[r]=e[r]);return n};const nRt={monthsListFormat:"MMM",size:"sm",withCellSpacing:!0},$6e=w.forwardRef((e,t)=>{const n=Qt("MonthsList",nRt,e),{year:r,className:i,monthsListFormat:a,locale:o,minDate:s,maxDate:l,getMonthControlProps:c,classNames:u,styles:f,unstyled:h,__staticSelector:m,__getControlRef:p,__onControlKeyDown:A,__onControlClick:v,__onControlMouseEnter:y,__preventFocus:x,size:k,variant:S,__stopPropagation:C,withCellSpacing:N}=n,E=tRt(n,["year","className","monthsListFormat","locale","minDate","maxDate","getMonthControlProps","classNames","styles","unstyled","__staticSelector","__getControlRef","__onControlKeyDown","__onControlClick","__onControlMouseEnter","__preventFocus","size","variant","__stopPropagation","withCellSpacing"]),{classes:D,cx:T}=$Mt(null,{name:["MonthsList",m],classNames:u,styles:f,unstyled:h,variant:S,size:k}),P=Sg(),O=RMt(r),B=LMt(O,s,l,c),M=O.map(($,U)=>{const j=$.map((V,Q)=>{const X=c?.(V),Z=Un(V).isSame(B,"month");return L.createElement("td",{key:Q,className:D.monthsListCell,"data-with-spacing":N||void 0},L.createElement(Jne,eRt(F0e({variant:S,size:k,classNames:u,styles:f,unstyled:h,__staticSelector:m||"MonthsList","data-mantine-stop-propagation":C||void 0,disabled:I6e(V,s,l),ref:le=>p?.(U,Q,le)},X),{onKeyDown:le=>{var H;(H=X?.onKeyDown)==null||H.call(X,le),A?.(le,{rowIndex:U,cellIndex:Q,date:V})},onClick:le=>{var H;(H=X?.onClick)==null||H.call(X,le),v?.(le,V)},onMouseEnter:le=>{var H;(H=X?.onMouseEnter)==null||H.call(X,le),y?.(le,V)},onMouseDown:le=>{var H;(H=X?.onMouseDown)==null||H.call(X,le),x&&le.preventDefault()},tabIndex:x||!Z?-1:0}),Un(V).locale(P.getLocale(o)).format(a)))});return L.createElement("tr",{key:U,className:D.monthsListRow},j)});return L.createElement(Fn,F0e({component:"table",ref:t,className:T(D.monthsList,i)},E),L.createElement("tbody",null,M))});$6e.displayName="@mantine/dates/MonthsList";var rRt=Object.defineProperty,dM=Object.getOwnPropertySymbols,L6e=Object.prototype.hasOwnProperty,U6e=Object.prototype.propertyIsEnumerable,D0e=(e,t,n)=>t in e?rRt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,z9=(e,t)=>{for(var n in t||(t={}))L6e.call(t,n)&&D0e(e,n,t[n]);if(dM)for(var n of dM(t))U6e.call(t,n)&&D0e(e,n,t[n]);return e},iRt=(e,t)=>{var n={};for(var r in e)L6e.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&dM)for(var r of dM(e))t.indexOf(r)<0&&U6e.call(e,r)&&(n[r]=e[r]);return n};const aRt={yearLabelFormat:"YYYY",size:"sm"},z6e=w.forwardRef((e,t)=>{const n=Qt("YearLevel",aRt,e),{year:r,locale:i,minDate:a,maxDate:o,monthsListFormat:s,getMonthControlProps:l,__getControlRef:c,__onControlKeyDown:u,__onControlClick:f,__onControlMouseEnter:h,withCellSpacing:m,__preventFocus:p,nextIcon:A,previousIcon:v,nextLabel:y,previousLabel:x,onNext:k,onPrevious:S,onLevelClick:C,nextDisabled:N,previousDisabled:E,hasNextLevel:D,levelControlAriaLabel:T,withNext:P,withPrevious:O,className:B,yearLabelFormat:M,classNames:$,styles:U,unstyled:j,__staticSelector:V,__stopPropagation:Q,size:X,variant:Z}=n,le=iRt(n,["year","locale","minDate","maxDate","monthsListFormat","getMonthControlProps","__getControlRef","__onControlKeyDown","__onControlClick","__onControlMouseEnter","withCellSpacing","__preventFocus","nextIcon","previousIcon","nextLabel","previousLabel","onNext","onPrevious","onLevelClick","nextDisabled","previousDisabled","hasNextLevel","levelControlAriaLabel","withNext","withPrevious","className","yearLabelFormat","classNames","styles","unstyled","__staticSelector","__stopPropagation","size","variant"]),{classes:H,cx:G}=MMt(null,{name:["YearLevel",V],classNames:$,styles:U,unstyled:j,size:X,variant:Z}),W=Sg(),te={__staticSelector:V||"YearLevel",classNames:$,styles:U,unstyled:j,size:X,variant:Z},re=typeof N=="boolean"?N:o?!Un(r).endOf("year").isBefore(o):!1,ne=typeof E=="boolean"?E:a?!Un(r).startOf("year").isAfter(a):!1;return L.createElement(Fn,z9({className:G(H.yearLevel,B),"data-year-level":!0,ref:t},le),L.createElement(j3,z9({label:typeof M=="function"?M(r):Un(r).locale(i||W.locale).format(M),className:H.calendarHeader,__preventFocus:p,__stopPropagation:Q,nextIcon:A,previousIcon:v,nextLabel:y,previousLabel:x,onNext:k,onPrevious:S,onLevelClick:C,nextDisabled:re,previousDisabled:ne,hasNextLevel:D,levelControlAriaLabel:T,withNext:P,withPrevious:O},te)),L.createElement($6e,z9({year:r,locale:i,minDate:a,maxDate:o,monthsListFormat:s,getMonthControlProps:l,__getControlRef:c,__onControlKeyDown:u,__onControlClick:f,__onControlMouseEnter:h,__preventFocus:p,__stopPropagation:Q,withCellSpacing:m},te)))});z6e.displayName="@mantine/dates/YearLevel";var oRt=Object.defineProperty,fM=Object.getOwnPropertySymbols,H6e=Object.prototype.hasOwnProperty,V6e=Object.prototype.propertyIsEnumerable,T0e=(e,t,n)=>t in e?oRt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,sRt=(e,t)=>{for(var n in t||(t={}))H6e.call(t,n)&&T0e(e,n,t[n]);if(fM)for(var n of fM(t))V6e.call(t,n)&&T0e(e,n,t[n]);return e},lRt=(e,t)=>{var n={};for(var r in e)H6e.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&fM)for(var r of fM(e))t.indexOf(r)<0&&V6e.call(e,r)&&(n[r]=e[r]);return n};const cRt={numberOfColumns:1,size:"sm"},Q6e=w.forwardRef((e,t)=>{const n=Qt("YearLevelGroup",cRt,e),{year:r,locale:i,minDate:a,maxDate:o,monthsListFormat:s,getMonthControlProps:l,__onControlClick:c,__onControlMouseEnter:u,withCellSpacing:f,__preventFocus:h,nextIcon:m,previousIcon:p,nextLabel:A,previousLabel:v,onNext:y,onPrevious:x,onLevelClick:k,nextDisabled:S,previousDisabled:C,hasNextLevel:N,className:E,classNames:D,styles:T,unstyled:P,__staticSelector:O,__stopPropagation:B,numberOfColumns:M,levelControlAriaLabel:$,yearLabelFormat:U,variant:j,size:V}=n,Q=lRt(n,["year","locale","minDate","maxDate","monthsListFormat","getMonthControlProps","__onControlClick","__onControlMouseEnter","withCellSpacing","__preventFocus","nextIcon","previousIcon","nextLabel","previousLabel","onNext","onPrevious","onLevelClick","nextDisabled","previousDisabled","hasNextLevel","className","classNames","styles","unstyled","__staticSelector","__stopPropagation","numberOfColumns","levelControlAriaLabel","yearLabelFormat","variant","size"]),{classes:X,cx:Z}=PMt(null,{name:["YearLevelGroup",O],styles:T,classNames:D,unstyled:P,variant:j,size:V}),le=w.useRef([]),H=Array(M).fill(0).map((G,W)=>{const te=Un(r).add(W,"years").toDate();return L.createElement(z6e,{key:W,variant:j,size:V,monthsListFormat:s,year:te,withNext:W===M-1,withPrevious:W===0,yearLabelFormat:U,__stopPropagation:B,__onControlClick:c,__onControlMouseEnter:u,__onControlKeyDown:(re,ne)=>Zne({levelIndex:W,rowIndex:ne.rowIndex,cellIndex:ne.cellIndex,event:re,controlsRef:le}),__getControlRef:(re,ne,de)=>{Array.isArray(le.current[W])||(le.current[W]=[]),Array.isArray(le.current[W][re])||(le.current[W][re]=[]),le.current[W][re][ne]=de},levelControlAriaLabel:typeof $=="function"?$(te):$,locale:i,minDate:a,maxDate:o,__preventFocus:h,nextIcon:m,previousIcon:p,nextLabel:A,previousLabel:v,onNext:y,onPrevious:x,onLevelClick:k,nextDisabled:S,previousDisabled:C,hasNextLevel:N,getMonthControlProps:l,classNames:D,styles:T,unstyled:P,__staticSelector:O||"YearLevelGroup",withCellSpacing:f})});return L.createElement(Fn,sRt({className:Z(X.yearLevelGroup,E),ref:t},Q),H)});Q6e.displayName="@mantine/dates/YearLevelGroup";var uRt=ln(e=>({decadeLevelGroup:{display:"flex",gap:e.spacing.md}}));function q6e(e){const t=e.getFullYear(),n=t-t%10;let r=0;const i=[[],[],[],[]];for(let a=0;a<4;a+=1){const o=a===3?1:3;for(let s=0;s<o;s+=1)i[a].push(new Date(n+r,0)),r+=1}return i}function dRt(e){const t=q6e(e);return[t[0][0],t[3][0]]}var fRt=ln(e=>({decadeLevel:{},calendarHeader:{marginBottom:e.spacing.xs}}));function G6e(e,t,n){return!t&&!n?!1:!!(t&&Un(e).isBefore(t,"year")||n&&Un(e).isAfter(n,"year"))}var hRt=ln(()=>({yearsList:{borderCollapse:"collapse",borderWidth:0},yearsListCell:{padding:0,"&[data-with-spacing]":{padding:Ve(.5)}},yearsListRow:{}}));function mRt(e,t,n,r){const i=e.flat().filter(s=>{var l;return!G6e(s,t,n)&&!((l=r?.(s))!=null&&l.disabled)}),a=i.find(s=>{var l;return(l=r?.(s))==null?void 0:l.selected});if(a)return a;const o=i.find(s=>Un().isSame(s,"year"));return o||i[0]}var pRt=Object.defineProperty,ARt=Object.defineProperties,gRt=Object.getOwnPropertyDescriptors,hM=Object.getOwnPropertySymbols,W6e=Object.prototype.hasOwnProperty,K6e=Object.prototype.propertyIsEnumerable,O0e=(e,t,n)=>t in e?pRt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,B0e=(e,t)=>{for(var n in t||(t={}))W6e.call(t,n)&&O0e(e,n,t[n]);if(hM)for(var n of hM(t))K6e.call(t,n)&&O0e(e,n,t[n]);return e},vRt=(e,t)=>ARt(e,gRt(t)),yRt=(e,t)=>{var n={};for(var r in e)W6e.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&hM)for(var r of hM(e))t.indexOf(r)<0&&K6e.call(e,r)&&(n[r]=e[r]);return n};const bRt={yearsListFormat:"YYYY",size:"sm",withCellSpacing:!0},Y6e=w.forwardRef((e,t)=>{const n=Qt("YearsList",bRt,e),{decade:r,className:i,yearsListFormat:a,locale:o,minDate:s,maxDate:l,getYearControlProps:c,classNames:u,styles:f,unstyled:h,__staticSelector:m,__getControlRef:p,__onControlKeyDown:A,__onControlClick:v,__onControlMouseEnter:y,__preventFocus:x,__stopPropagation:k,size:S,variant:C,withCellSpacing:N}=n,E=yRt(n,["decade","className","yearsListFormat","locale","minDate","maxDate","getYearControlProps","classNames","styles","unstyled","__staticSelector","__getControlRef","__onControlKeyDown","__onControlClick","__onControlMouseEnter","__preventFocus","__stopPropagation","size","variant","withCellSpacing"]),{classes:D,cx:T}=hRt(null,{name:["YearsList",m],classNames:u,styles:f,unstyled:h,variant:C,size:S}),P=Sg(),O=q6e(r),B=mRt(O,s,l,c),M=O.map(($,U)=>{const j=$.map((V,Q)=>{const X=c?.(V),Z=Un(V).isSame(B,"year");return L.createElement("td",{key:Q,className:D.yearsListCell,"data-with-spacing":N||void 0},L.createElement(Jne,vRt(B0e({size:S,variant:C,classNames:u,styles:f,unstyled:h,__staticSelector:m||"YearsList","data-mantine-stop-propagation":k||void 0,disabled:G6e(V,s,l),ref:le=>p?.(U,Q,le)},X),{onKeyDown:le=>{var H;(H=X?.onKeyDown)==null||H.call(X,le),A?.(le,{rowIndex:U,cellIndex:Q,date:V})},onClick:le=>{var H;(H=X?.onClick)==null||H.call(X,le),v?.(le,V)},onMouseEnter:le=>{var H;(H=X?.onMouseEnter)==null||H.call(X,le),y?.(le,V)},onMouseDown:le=>{var H;(H=X?.onMouseDown)==null||H.call(X,le),x&&le.preventDefault()},tabIndex:x||!Z?-1:0}),Un(V).locale(P.getLocale(o)).format(a)))});return L.createElement("tr",{key:U,className:D.yearsListRow},j)});return L.createElement(Fn,B0e({component:"table",ref:t,className:T(D.yearsList,i)},E),L.createElement("tbody",null,M))});Y6e.displayName="@mantine/dates/YearsList";var xRt=Object.defineProperty,mM=Object.getOwnPropertySymbols,X6e=Object.prototype.hasOwnProperty,Z6e=Object.prototype.propertyIsEnumerable,I0e=(e,t,n)=>t in e?xRt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,H9=(e,t)=>{for(var n in t||(t={}))X6e.call(t,n)&&I0e(e,n,t[n]);if(mM)for(var n of mM(t))Z6e.call(t,n)&&I0e(e,n,t[n]);return e},wRt=(e,t)=>{var n={};for(var r in e)X6e.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&mM)for(var r of mM(e))t.indexOf(r)<0&&Z6e.call(e,r)&&(n[r]=e[r]);return n};const kRt={decadeLabelFormat:"YYYY"},J6e=w.forwardRef((e,t)=>{const n=Qt("DecadeLevel",kRt,e),{decade:r,locale:i,minDate:a,maxDate:o,yearsListFormat:s,getYearControlProps:l,__getControlRef:c,__onControlKeyDown:u,__onControlClick:f,__onControlMouseEnter:h,withCellSpacing:m,__preventFocus:p,nextIcon:A,previousIcon:v,nextLabel:y,previousLabel:x,onNext:k,onPrevious:S,nextDisabled:C,previousDisabled:N,levelControlAriaLabel:E,withNext:D,withPrevious:T,className:P,decadeLabelFormat:O,classNames:B,styles:M,unstyled:$,__staticSelector:U,__stopPropagation:j,variant:V,size:Q}=n,X=wRt(n,["decade","locale","minDate","maxDate","yearsListFormat","getYearControlProps","__getControlRef","__onControlKeyDown","__onControlClick","__onControlMouseEnter","withCellSpacing","__preventFocus","nextIcon","previousIcon","nextLabel","previousLabel","onNext","onPrevious","nextDisabled","previousDisabled","levelControlAriaLabel","withNext","withPrevious","className","decadeLabelFormat","classNames","styles","unstyled","__staticSelector","__stopPropagation","variant","size"]),{classes:Z,cx:le}=fRt(null,{name:["DecadeLevel",U],classNames:B,styles:M,unstyled:$,variant:V,size:Q}),H=Sg(),[G,W]=dRt(r),te={__staticSelector:U||"DecadeLevel",classNames:B,styles:M,unstyled:$,variant:V,size:Q},re=typeof C=="boolean"?C:o?!Un(W).endOf("year").isBefore(o):!1,ne=typeof N=="boolean"?N:a?!Un(G).startOf("year").isAfter(a):!1,de=(he,pe)=>Un(he).locale(i||H.locale).format(pe);return L.createElement(Fn,H9({className:le(Z.decadeLevel,P),"data-decade-level":!0,ref:t},X),L.createElement(j3,H9({label:typeof O=="function"?O(G,W):`${de(G,O)} – ${de(W,O)}`,className:Z.calendarHeader,__preventFocus:p,__stopPropagation:j,nextIcon:A,previousIcon:v,nextLabel:y,previousLabel:x,onNext:k,onPrevious:S,nextDisabled:re,previousDisabled:ne,hasNextLevel:!1,levelControlAriaLabel:E,withNext:D,withPrevious:T},te)),L.createElement(Y6e,H9({decade:r,locale:i,minDate:a,maxDate:o,yearsListFormat:s,getYearControlProps:l,__getControlRef:c,__onControlKeyDown:u,__onControlClick:f,__onControlMouseEnter:h,__preventFocus:p,__stopPropagation:j,withCellSpacing:m},te)))});J6e.displayName="@mantine/dates/DecadeLevel";var SRt=Object.defineProperty,pM=Object.getOwnPropertySymbols,e8e=Object.prototype.hasOwnProperty,t8e=Object.prototype.propertyIsEnumerable,j0e=(e,t,n)=>t in e?SRt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,CRt=(e,t)=>{for(var n in t||(t={}))e8e.call(t,n)&&j0e(e,n,t[n]);if(pM)for(var n of pM(t))t8e.call(t,n)&&j0e(e,n,t[n]);return e},_Rt=(e,t)=>{var n={};for(var r in e)e8e.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&pM)for(var r of pM(e))t.indexOf(r)<0&&t8e.call(e,r)&&(n[r]=e[r]);return n};const NRt={numberOfColumns:1},n8e=w.forwardRef((e,t)=>{const n=Qt("DecadeLevelGroup",NRt,e),{decade:r,locale:i,minDate:a,maxDate:o,yearsListFormat:s,getYearControlProps:l,__onControlClick:c,__onControlMouseEnter:u,withCellSpacing:f,__preventFocus:h,nextIcon:m,previousIcon:p,nextLabel:A,previousLabel:v,onNext:y,onPrevious:x,nextDisabled:k,previousDisabled:S,className:C,classNames:N,styles:E,unstyled:D,__staticSelector:T,__stopPropagation:P,numberOfColumns:O,levelControlAriaLabel:B,decadeLabelFormat:M,variant:$,size:U}=n,j=_Rt(n,["decade","locale","minDate","maxDate","yearsListFormat","getYearControlProps","__onControlClick","__onControlMouseEnter","withCellSpacing","__preventFocus","nextIcon","previousIcon","nextLabel","previousLabel","onNext","onPrevious","nextDisabled","previousDisabled","className","classNames","styles","unstyled","__staticSelector","__stopPropagation","numberOfColumns","levelControlAriaLabel","decadeLabelFormat","variant","size"]),{classes:V,cx:Q}=uRt(null,{name:["DecadeLevelGroup",T],styles:E,classNames:N,unstyled:D,variant:$,size:U}),X=w.useRef([]),Z=Array(O).fill(0).map((le,H)=>{const G=Un(r).add(H*10,"years").toDate();return L.createElement(J6e,{key:H,variant:$,size:U,yearsListFormat:s,decade:G,withNext:H===O-1,withPrevious:H===0,decadeLabelFormat:M,__onControlClick:c,__onControlMouseEnter:u,__onControlKeyDown:(W,te)=>Zne({levelIndex:H,rowIndex:te.rowIndex,cellIndex:te.cellIndex,event:W,controlsRef:X}),__getControlRef:(W,te,re)=>{Array.isArray(X.current[H])||(X.current[H]=[]),Array.isArray(X.current[H][W])||(X.current[H][W]=[]),X.current[H][W][te]=re},levelControlAriaLabel:typeof B=="function"?B(G):B,locale:i,minDate:a,maxDate:o,__preventFocus:h,__stopPropagation:P,nextIcon:m,previousIcon:p,nextLabel:A,previousLabel:v,onNext:y,onPrevious:x,nextDisabled:k,previousDisabled:S,getYearControlProps:l,__staticSelector:T||"DecadeLevelGroup",classNames:N,styles:E,unstyled:D,withCellSpacing:f})});return L.createElement(Fn,CRt({className:Q(V.decadeLevelGroup,C),ref:t},j),Z)});n8e.displayName="@mantine/dates/DecadeLevelGroup";var ERt=Object.defineProperty,AM=Object.getOwnPropertySymbols,r8e=Object.prototype.hasOwnProperty,i8e=Object.prototype.propertyIsEnumerable,P0e=(e,t,n)=>t in e?ERt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,E5=(e,t)=>{for(var n in t||(t={}))r8e.call(t,n)&&P0e(e,n,t[n]);if(AM)for(var n of AM(t))i8e.call(t,n)&&P0e(e,n,t[n]);return e},FRt=(e,t)=>{var n={};for(var r in e)r8e.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&AM)for(var r of AM(e))t.indexOf(r)<0&&i8e.call(e,r)&&(n[r]=e[r]);return n};const DRt={maxLevel:"decade",minLevel:"month",__updateDateOnYearSelect:!0,__updateDateOnMonthSelect:!0},P3=w.forwardRef((e,t)=>{const n=Qt("Calendar",DRt,e),{maxLevel:r,minLevel:i,defaultLevel:a,level:o,onLevelChange:s,date:l,defaultDate:c,onDateChange:u,numberOfColumns:f,columnsToScroll:h,ariaLabels:m,onYearSelect:p,onMonthSelect:A,onYearMouseEnter:v,onMonthMouseEnter:y,__updateDateOnYearSelect:x,__updateDateOnMonthSelect:k,firstDayOfWeek:S,weekdayFormat:C,weekendDays:N,getDayProps:E,excludeDate:D,renderDay:T,hideOutsideDates:P,hideWeekdays:O,getDayAriaLabel:B,monthLabelFormat:M,nextIcon:$,previousIcon:U,__onDayClick:j,__onDayMouseEnter:V,withCellSpacing:Q,monthsListFormat:X,getMonthControlProps:Z,yearLabelFormat:le,yearsListFormat:H,getYearControlProps:G,decadeLabelFormat:W,minDate:te,maxDate:re,locale:ne,className:de,classNames:he,styles:pe,__staticSelector:oe,unstyled:J,variant:Se,size:be,__preventFocus:we,__stopPropagation:me,onNextDecade:K,onPreviousDecade:ie,onNextYear:ce,onPreviousYear:ue,onNextMonth:ve,onPreviousMonth:ke,static:Re}=n,Me=FRt(n,["maxLevel","minLevel","defaultLevel","level","onLevelChange","date","defaultDate","onDateChange","numberOfColumns","columnsToScroll","ariaLabels","onYearSelect","onMonthSelect","onYearMouseEnter","onMonthMouseEnter","__updateDateOnYearSelect","__updateDateOnMonthSelect","firstDayOfWeek","weekdayFormat","weekendDays","getDayProps","excludeDate","renderDay","hideOutsideDates","hideWeekdays","getDayAriaLabel","monthLabelFormat","nextIcon","previousIcon","__onDayClick","__onDayMouseEnter","withCellSpacing","monthsListFormat","getMonthControlProps","yearLabelFormat","yearsListFormat","getYearControlProps","decadeLabelFormat","minDate","maxDate","locale","className","classNames","styles","__staticSelector","unstyled","variant","size","__preventFocus","__stopPropagation","onNextDecade","onPreviousDecade","onNextYear","onPreviousYear","onNextMonth","onPreviousMonth","static"]),{classes:$e,cx:We}=U4t(null,{name:["Calendar",oe],classNames:he,styles:pe,unstyled:J,variant:Se,size:be}),[tt,ot]=$c({value:o?Y_(o,i,r):void 0,defaultValue:a?Y_(a,i,r):void 0,finalValue:Y_(void 0,i,r),onChange:s}),[vt,Ae]=$c({value:l,defaultValue:c,finalValue:null,onChange:u}),ee={__staticSelector:oe||"Calendar",styles:pe,classNames:he,unstyled:J,variant:Se,size:be},se=h||f||1,_e=vt||new Date,Fe=()=>{const it=Un(_e).add(se,"month").toDate();ve?.(it),Ae(it)},Ue=()=>{const it=Un(_e).subtract(se,"month").toDate();ke?.(it),Ae(it)},Te=()=>{const it=Un(_e).add(se,"year").toDate();ce?.(it),Ae(it)},Pe=()=>{const it=Un(_e).subtract(se,"year").toDate();ue?.(it),Ae(it)},st=()=>{const it=Un(_e).add(10*se,"year").toDate();K?.(it),Ae(it)},Xe=()=>{const it=Un(_e).subtract(10*se,"year").toDate();ie?.(it),Ae(it)};return L.createElement(Fn,E5({className:We($e.calendar,de),ref:t},Me),tt==="month"&&L.createElement(B6e,E5({month:_e,minDate:te,maxDate:re,firstDayOfWeek:S,weekdayFormat:C,weekendDays:N,getDayProps:E,excludeDate:D,renderDay:T,hideOutsideDates:P,hideWeekdays:O,getDayAriaLabel:B,onNext:Fe,onPrevious:Ue,hasNextLevel:r!=="month",onLevelClick:()=>ot("year"),numberOfColumns:f,locale:ne,levelControlAriaLabel:m?.monthLevelControl,nextLabel:m?.nextMonth,nextIcon:$,previousLabel:m?.previousMonth,previousIcon:U,monthLabelFormat:M,__onDayClick:j,__onDayMouseEnter:V,__preventFocus:we,__stopPropagation:me,static:Re,withCellSpacing:Q},ee)),tt==="year"&&L.createElement(Q6e,E5({year:_e,numberOfColumns:f,minDate:te,maxDate:re,monthsListFormat:X,getMonthControlProps:Z,locale:ne,onNext:Te,onPrevious:Pe,hasNextLevel:r!=="month"&&r!=="year",onLevelClick:()=>ot("decade"),levelControlAriaLabel:m?.yearLevelControl,nextLabel:m?.nextYear,nextIcon:$,previousLabel:m?.previousYear,previousIcon:U,yearLabelFormat:le,__onControlMouseEnter:y,__onControlClick:(it,lt)=>{k&&Ae(lt),ot(Y_("month",i,r)),A?.(lt)},__preventFocus:we,__stopPropagation:me,withCellSpacing:Q},ee)),tt==="decade"&&L.createElement(n8e,E5({decade:_e,minDate:te,maxDate:re,yearsListFormat:H,getYearControlProps:G,locale:ne,onNext:st,onPrevious:Xe,numberOfColumns:f,nextLabel:m?.nextDecade,nextIcon:$,previousLabel:m?.previousDecade,previousIcon:U,decadeLabelFormat:W,__onControlMouseEnter:v,__onControlClick:(it,lt)=>{x&&Ae(lt),ot(Y_("year",i,r)),p?.(lt)},__preventFocus:we,__stopPropagation:me,withCellSpacing:Q},ee)))});P3.displayName="@mantine/dates/Calendar";var M0e=Object.getOwnPropertySymbols,TRt=Object.prototype.hasOwnProperty,ORt=Object.prototype.propertyIsEnumerable,BRt=(e,t)=>{var n={};for(var r in e)TRt.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&M0e)for(var r of M0e(e))t.indexOf(r)<0&&ORt.call(e,r)&&(n[r]=e[r]);return n};function M3(e){const t=e,{maxLevel:n,minLevel:r,defaultLevel:i,level:a,onLevelChange:o,nextIcon:s,previousIcon:l,date:c,defaultDate:u,onDateChange:f,numberOfColumns:h,columnsToScroll:m,ariaLabels:p,onYearSelect:A,onMonthSelect:v,onYearMouseEnter:y,onMonthMouseEnter:x,onNextMonth:k,onPreviousMonth:S,onNextYear:C,onPreviousYear:N,onNextDecade:E,onPreviousDecade:D,withCellSpacing:T,__updateDateOnYearSelect:P,__updateDateOnMonthSelect:O,firstDayOfWeek:B,weekdayFormat:M,weekendDays:$,getDayProps:U,excludeDate:j,renderDay:V,hideOutsideDates:Q,hideWeekdays:X,getDayAriaLabel:Z,monthLabelFormat:le,monthsListFormat:H,getMonthControlProps:G,yearLabelFormat:W,yearsListFormat:te,getYearControlProps:re,decadeLabelFormat:ne,allowSingleDateInRange:de,allowDeselect:he,minDate:pe,maxDate:oe,locale:J}=t,Se=BRt(t,["maxLevel","minLevel","defaultLevel","level","onLevelChange","nextIcon","previousIcon","date","defaultDate","onDateChange","numberOfColumns","columnsToScroll","ariaLabels","onYearSelect","onMonthSelect","onYearMouseEnter","onMonthMouseEnter","onNextMonth","onPreviousMonth","onNextYear","onPreviousYear","onNextDecade","onPreviousDecade","withCellSpacing","__updateDateOnYearSelect","__updateDateOnMonthSelect","firstDayOfWeek","weekdayFormat","weekendDays","getDayProps","excludeDate","renderDay","hideOutsideDates","hideWeekdays","getDayAriaLabel","monthLabelFormat","monthsListFormat","getMonthControlProps","yearLabelFormat","yearsListFormat","getYearControlProps","decadeLabelFormat","allowSingleDateInRange","allowDeselect","minDate","maxDate","locale"]);return{calendarProps:{maxLevel:n,minLevel:r,defaultLevel:i,level:a,onLevelChange:o,nextIcon:s,previousIcon:l,date:c,defaultDate:u,onDateChange:f,numberOfColumns:h,columnsToScroll:m,ariaLabels:p,onYearSelect:A,onMonthSelect:v,onYearMouseEnter:y,onMonthMouseEnter:x,onNextMonth:k,onPreviousMonth:S,onNextYear:C,onPreviousYear:N,onNextDecade:E,onPreviousDecade:D,withCellSpacing:T,__updateDateOnYearSelect:P,__updateDateOnMonthSelect:O,firstDayOfWeek:B,weekdayFormat:M,weekendDays:$,getDayProps:U,excludeDate:j,renderDay:V,hideOutsideDates:Q,hideWeekdays:X,getDayAriaLabel:Z,monthLabelFormat:le,monthsListFormat:H,getMonthControlProps:G,yearLabelFormat:W,yearsListFormat:te,getYearControlProps:re,decadeLabelFormat:ne,allowSingleDateInRange:de,allowDeselect:he,minDate:pe,maxDate:oe,locale:J},others:Se}}function IRt(e,t){if(t==="range"&&Array.isArray(e)){const[n,r]=e;return n?r?`${n.toISOString()} – ${r.toISOString()}`:`${n.toISOString()} –`:""}return t==="multiple"&&Array.isArray(e)?e.map(n=>n.toISOString()).join(", "):!Array.isArray(e)&&e?e.toISOString():""}function a8e({value:e,type:t,name:n,form:r}){return L.createElement("input",{type:"hidden",value:IRt(e,t),name:n,form:r})}a8e.displayName="@mantine/dates/HiddenDatesInput";function R0e(e,t){if(!e||!t)return t;const n=e.getHours(),r=e.getMinutes(),i=e.getSeconds(),a=e.getMilliseconds(),o=new Date(t);return o.setHours(n),o.setMinutes(r),o.setSeconds(i),o.setMilliseconds(a),o}const $0e=e=>e==="range"?[null,null]:e==="multiple"?[]:null;function o8e({type:e,value:t,defaultValue:n,onChange:r}){const i=w.useRef(e),[a,o]=$c({value:t,defaultValue:n,onChange:r,finalValue:$0e(e)});let s=a;return i.current!==e&&(i.current=e,t===void 0&&(s=n!==void 0?n:$0e(e),o(s))),[s,o]}function L0e(e,t){const n=[...t].sort((r,i)=>r.getTime()-i.getTime());return Un(n[0]).startOf("day").subtract(1,"ms").isBefore(e)&&Un(n[1]).endOf("day").add(1,"ms").isAfter(e)}function ere({type:e,level:t,value:n,defaultValue:r,onChange:i,allowSingleDateInRange:a,allowDeselect:o,onMouseLeave:s}){const[l,c]=o8e({type:e,value:n,defaultValue:r,onChange:i}),[u,f]=w.useState(e==="range"&&l[0]&&!l[1]?l[0]:null),[h,m]=w.useState(null),p=C=>{if(e==="range"){if(u instanceof Date&&!l[1]){if(Un(C).isSame(u,t)&&!a){f(null),m(null),c([null,null]);return}const N=[C,u];N.sort((E,D)=>E.getTime()-D.getTime()),c(N),m(null),f(null);return}if(l[0]&&!l[1]&&Un(C).isSame(l[0],t)&&!a){f(null),m(null),c([null,null]);return}c([C,null]),m(null),f(C);return}if(e==="multiple"){l.some(N=>Un(N).isSame(C,t))?c(l.filter(N=>!Un(N).isSame(C,t))):c([...l,C]);return}l&&o&&Un(C).isSame(l,t)?c(null):c(C)},A=C=>u instanceof Date&&h instanceof Date?L0e(C,[h,u]):l[0]instanceof Date&&l[1]instanceof Date?L0e(C,l):!1,v=e==="range"?C=>{s?.(C),m(null)}:s,y=C=>l[0]instanceof Date&&Un(C).isSame(l[0],t)?!(h&&Un(h).isBefore(l[0])):!1,x=C=>l[1]instanceof Date?Un(C).isSame(l[1],t):!(l[0]instanceof Date)||!h?!1:Un(h).isBefore(l[0])&&Un(C).isSame(l[0],t);return{onDateChange:p,onRootMouseLeave:v,onHoveredDateChange:e==="range"&&u?m:()=>{},getControlProps:C=>{if(e==="range")return{selected:l.some(E=>E&&Un(E).isSame(C,t)),inRange:A(C),firstInRange:y(C),lastInRange:x(C),"data-autofocus":!!l[0]&&Un(l[0]).isSame(C,t)||void 0};if(e==="multiple")return{selected:l.some(E=>E&&Un(E).isSame(C,t)),"data-autofocus":!!l[0]&&Un(l[0]).isSame(C,t)||void 0};const N=Un(l).isSame(C,t);return{selected:N,"data-autofocus":N||void 0}},_value:l,setValue:c}}var jRt=Object.defineProperty,gM=Object.getOwnPropertySymbols,s8e=Object.prototype.hasOwnProperty,l8e=Object.prototype.propertyIsEnumerable,U0e=(e,t,n)=>t in e?jRt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,V9=(e,t)=>{for(var n in t||(t={}))s8e.call(t,n)&&U0e(e,n,t[n]);if(gM)for(var n of gM(t))l8e.call(t,n)&&U0e(e,n,t[n]);return e},PRt=(e,t)=>{var n={};for(var r in e)s8e.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&gM)for(var r of gM(e))t.indexOf(r)<0&&l8e.call(e,r)&&(n[r]=e[r]);return n};const MRt={type:"default",numberOfColumns:1},tre=w.forwardRef((e,t)=>{const n=Qt("DatePicker",MRt,e),{type:r,defaultValue:i,value:a,onChange:o,__staticSelector:s,getDayProps:l,allowSingleDateInRange:c,allowDeselect:u,onMouseLeave:f,numberOfColumns:h}=n,m=PRt(n,["type","defaultValue","value","onChange","__staticSelector","getDayProps","allowSingleDateInRange","allowDeselect","onMouseLeave","numberOfColumns"]),{onDateChange:p,onRootMouseLeave:A,onHoveredDateChange:v,getControlProps:y}=ere({type:r,level:"day",allowDeselect:u,allowSingleDateInRange:c,value:a,defaultValue:i,onChange:o,onMouseLeave:f});return L.createElement(P3,V9({ref:t,minLevel:"month",__staticSelector:s||"DatePicker",onMouseLeave:A,hideOutsideDates:h!==1,numberOfColumns:h,__onDayMouseEnter:(x,k)=>v(k),__onDayClick:(x,k)=>p(k),getDayProps:x=>V9(V9({},y(x)),l?.(x))},m))});tre.displayName="@mantine/dates/DatePicker";function RRt({type:e,date:t,locale:n,format:r,labelSeparator:i}){const a=o=>Un(o).locale(n).format(r);return e==="default"?t===null?"":a(t):e==="multiple"?t.map(a).join(", "):e==="range"?t[0]&&t[1]?`${a(t[0])} ${i} ${a(t[1])}`:t[0]?`${a(t[0])} ${i} `:"":""}function nre({type:e,value:t,defaultValue:n,onChange:r,locale:i,format:a,closeOnChange:o,sortDates:s,labelSeparator:l}){const c=Sg(),[u,f]=as(!1),[h,m]=o8e({type:e,value:t,defaultValue:n,onChange:r}),p=RRt({type:e,date:h,locale:c.getLocale(i),format:a,labelSeparator:c.getLabelSeparator(l)}),A=x=>{o&&(e==="default"&&f.close(),e==="range"&&x[0]&&x[1]&&f.close()),m(s&&e==="multiple"?[...x].sort((k,S)=>k.getTime()-S.getTime()):x)},v=()=>A(e==="range"?[null,null]:e==="multiple"?[]:null),y=e==="range"?!!h[0]:e==="multiple"?h.length>0:h!==null;return{_value:h,setValue:A,onClear:v,shouldClear:y,formattedValue:p,dropdownOpened:u,dropdownHandlers:f}}function pE({minDate:e,maxDate:t}){const n=new Date;return!e&&!t?n:Un(n).isBefore(e)?e:Un(n).isAfter(t)?t:n}var $Rt=ln(()=>({placeholder:{},input:{cursor:"pointer",lineHeight:"unset","&[data-read-only]":{cursor:"default"}}})),LRt=Object.defineProperty,URt=Object.defineProperties,zRt=Object.getOwnPropertyDescriptors,vM=Object.getOwnPropertySymbols,c8e=Object.prototype.hasOwnProperty,u8e=Object.prototype.propertyIsEnumerable,z0e=(e,t,n)=>t in e?LRt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,V0=(e,t)=>{for(var n in t||(t={}))c8e.call(t,n)&&z0e(e,n,t[n]);if(vM)for(var n of vM(t))u8e.call(t,n)&&z0e(e,n,t[n]);return e},H0e=(e,t)=>URt(e,zRt(t)),HRt=(e,t)=>{var n={};for(var r in e)c8e.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&vM)for(var r of vM(e))t.indexOf(r)<0&&u8e.call(e,r)&&(n[r]=e[r]);return n};const VRt={},mD=w.forwardRef((e,t)=>{const n=v3("PickerInputBase",VRt,e),{inputProps:r,wrapperProps:i,placeholder:a,classNames:o,styles:s,unstyled:l,popoverProps:c,modalProps:u,dropdownType:f,children:h,formattedValue:m,dropdownHandlers:p,dropdownOpened:A,onClick:v,clearable:y,onClear:x,clearButtonProps:k,rightSection:S,shouldClear:C,readOnly:N,disabled:E,value:D,name:T,form:P,type:O}=n,B=HRt(n,["inputProps","wrapperProps","placeholder","classNames","styles","unstyled","popoverProps","modalProps","dropdownType","children","formattedValue","dropdownHandlers","dropdownOpened","onClick","clearable","onClear","clearButtonProps","rightSection","shouldClear","readOnly","disabled","value","name","form","type"]),{classes:M,cx:$}=$Rt(null,{name:r.__staticSelector,classNames:o,styles:s,unstyled:l,variant:r.variant,size:r.size}),U=S||(y&&C&&!N&&!E?L.createElement(JF,V0({variant:"transparent",onClick:x,unstyled:l,size:r.size},k)):null),j=()=>{O==="range"&&D[0]&&!D[1]&&x(),p.close()},V=i.label;return L.createElement(L.Fragment,null,f==="modal"&&!N&&L.createElement(_r,V0({opened:A,onClose:j,withCloseButton:!1,size:"auto","data-dates-modal":!0,unstyled:l},u),h),L.createElement(Ml.Wrapper,V0({},i),L.createElement(Mc,V0({position:"bottom-start",opened:A,onClose:j,disabled:f==="modal"||N,trapFocus:!0,returnFocus:!0,unstyled:l},c),L.createElement(Mc.Target,{shouldOverrideDefaultTargetId:!V},L.createElement(Ml,V0(H0e(V0({"aria-label":m,"data-dates-input":!0,"data-read-only":N||void 0,disabled:E,component:"button",type:"button",multiline:!0,onClick:Q=>{v?.(Q),p.toggle()},rightSection:U},r),{ref:t,classNames:H0e(V0({},o),{input:$(M.input,o?.input)})}),B),m||L.createElement(Ml.Placeholder,{className:M.placeholder,sx:{color:r.error?"inherit":void 0}},a))),L.createElement(Mc.Dropdown,{"data-dates-dropdown":!0},h))),L.createElement(a8e,{value:D,name:T,form:P,type:O}))});mD.displayName="@mantine/dates/PickerInputBase";var QRt=Object.defineProperty,qRt=Object.defineProperties,GRt=Object.getOwnPropertyDescriptors,yM=Object.getOwnPropertySymbols,d8e=Object.prototype.hasOwnProperty,f8e=Object.prototype.propertyIsEnumerable,V0e=(e,t,n)=>t in e?QRt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Q0e=(e,t)=>{for(var n in t||(t={}))d8e.call(t,n)&&V0e(e,n,t[n]);if(yM)for(var n of yM(t))f8e.call(t,n)&&V0e(e,n,t[n]);return e},WRt=(e,t)=>qRt(e,GRt(t)),KRt=(e,t)=>{var n={};for(var r in e)d8e.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&yM)for(var r of yM(e))t.indexOf(r)<0&&f8e.call(e,r)&&(n[r]=e[r]);return n};const YRt={type:"default",valueFormat:"MMMM D, YYYY",closeOnChange:!0,sortDates:!0,dropdownType:"popover"},Vi=w.forwardRef((e,t)=>{const n=Qt("DatePickerInput",YRt,e),{type:r,value:i,defaultValue:a,onChange:o,valueFormat:s,labelSeparator:l,locale:c,classNames:u,styles:f,unstyled:h,closeOnChange:m,size:p,variant:A,dropdownType:v,sortDates:y,maxDate:x,minDate:k,defaultDate:S}=n,C=KRt(n,["type","value","defaultValue","onChange","valueFormat","labelSeparator","locale","classNames","styles","unstyled","closeOnChange","size","variant","dropdownType","sortDates","maxDate","minDate","defaultDate"]),{calendarProps:N,others:E}=M3(C),{_value:D,setValue:T,formattedValue:P,dropdownHandlers:O,dropdownOpened:B,onClear:M,shouldClear:$}=nre({type:r,value:i,defaultValue:a,onChange:o,locale:c,format:s,labelSeparator:l,closeOnChange:m,sortDates:y}),U=S||pE({maxDate:x,minDate:k});return L.createElement(mD,Q0e({formattedValue:P,dropdownOpened:B,dropdownHandlers:O,classNames:u,styles:f,unstyled:h,__staticSelector:"DatePickerInput",ref:t,onClear:M,shouldClear:$,value:D,type:r,size:p,variant:A,dropdownType:v},E),L.createElement(tre,WRt(Q0e({},N),{size:p,variant:A,type:r,value:D,defaultDate:Array.isArray(D)?D[0]||U:D||U,onChange:T,locale:c,classNames:u,styles:f,unstyled:h,__staticSelector:"DatePickerInput",__stopPropagation:v==="popover",maxDate:x,minDate:k})))});Vi.displayName="@mantine/dates/DatePickerInput";var XRt=ln(e=>({timeWrapper:{display:"flex",marginTop:e.spacing.md},timeInput:{flex:1,marginRight:e.spacing.md}})),ZRt=ln(e=>({input:{paddingTop:0,paddingBottom:0,appearance:"none","&::-webkit-calendar-picker-indicator":{display:"none"},"&::-webkit-clear-button":{display:"none"},"&::-webkit-datetime-edit-hour-field, &::-webkit-datetime-edit-minute-field, &::-webkit-datetime-edit-second-field":{paddingTop:0,maxHeight:Ve(30),display:"inline","&:focus":{backgroundColor:e.fn.variant({variant:"filled"}).background,color:e.white}}}})),JRt=Object.defineProperty,e$t=Object.defineProperties,t$t=Object.getOwnPropertyDescriptors,bM=Object.getOwnPropertySymbols,h8e=Object.prototype.hasOwnProperty,m8e=Object.prototype.propertyIsEnumerable,q0e=(e,t,n)=>t in e?JRt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,G0e=(e,t)=>{for(var n in t||(t={}))h8e.call(t,n)&&q0e(e,n,t[n]);if(bM)for(var n of bM(t))m8e.call(t,n)&&q0e(e,n,t[n]);return e},n$t=(e,t)=>e$t(e,t$t(t)),r$t=(e,t)=>{var n={};for(var r in e)h8e.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&bM)for(var r of bM(e))t.indexOf(r)<0&&m8e.call(e,r)&&(n[r]=e[r]);return n};const i$t={},p8e=w.forwardRef((e,t)=>{const n=Qt("TimeInput",i$t,e),{classNames:r,withSeconds:i,variant:a,size:o,styles:s,unstyled:l}=n,c=r$t(n,["classNames","withSeconds","variant","size","styles","unstyled"]),{classes:u,cx:f}=ZRt(null,{name:"TimeInput",classNames:r,styles:s,unstyled:l,variant:a,size:o});return L.createElement(hne,G0e({type:"time",step:i?1:60,classNames:n$t(G0e({},r),{input:f(u.input,r?.input)}),styles:s,unstyled:l,variant:a,size:o,ref:t,__staticSelector:"TimeInput"},c))});p8e.displayName="@mantine/dates/TimeInput";var a$t=Object.defineProperty,o$t=Object.defineProperties,s$t=Object.getOwnPropertyDescriptors,xM=Object.getOwnPropertySymbols,A8e=Object.prototype.hasOwnProperty,g8e=Object.prototype.propertyIsEnumerable,W0e=(e,t,n)=>t in e?a$t(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,F5=(e,t)=>{for(var n in t||(t={}))A8e.call(t,n)&&W0e(e,n,t[n]);if(xM)for(var n of xM(t))g8e.call(t,n)&&W0e(e,n,t[n]);return e},Q9=(e,t)=>o$t(e,s$t(t)),K0e=(e,t)=>{var n={};for(var r in e)A8e.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&xM)for(var r of xM(e))t.indexOf(r)<0&&g8e.call(e,r)&&(n[r]=e[r]);return n};const l$t={size:"sm",dropdownType:"popover"},rre=w.forwardRef((e,t)=>{const n=Qt("DateTimePicker",l$t,e),{value:r,defaultValue:i,onChange:a,valueFormat:o,locale:s,classNames:l,styles:c,unstyled:u,timeInputProps:f,submitButtonProps:h,withSeconds:m,level:p,defaultLevel:A,size:v,variant:y,dropdownType:x}=n,k=K0e(n,["value","defaultValue","onChange","valueFormat","locale","classNames","styles","unstyled","timeInputProps","submitButtonProps","withSeconds","level","defaultLevel","size","variant","dropdownType"]),S=o||(m?"DD/MM/YYYY HH:mm:ss":"DD/MM/YYYY HH:mm"),{classes:C,cx:N}=XRt(null,{name:"DateTimePicker",classNames:l,styles:c,unstyled:u,variant:y,size:v}),E=w.useRef(),D=Lp(E,f?.ref),T=M3(k),{calendarProps:P}=T,O=P,B=K0e(O,["allowSingleDateInRange"]),{others:M}=T,$=Sg(),[U,j]=$c({value:r,defaultValue:i,finalValue:null,onChange:a}),V=he=>he?Un(he).format(m?"HH:mm:ss":"HH:mm"):"",[Q,X]=w.useState(V(U)),[Z,le]=w.useState(p||A||"month"),[H,G]=as(!1),W=U?Un(U).locale($.getLocale(s)).format(S):"",te=he=>{var pe;(pe=f?.onChange)==null||pe.call(f,he);const oe=he.currentTarget.value;if(X(oe),oe){const[J,Se,be]=oe.split(":").map(Number),we=new Date;we.setHours(J),we.setMinutes(Se),be!==void 0&&we.setSeconds(be),j(R0e(we,U||new Date))}},re=he=>{var pe;j(R0e(U,he)),(pe=E.current)==null||pe.focus()},ne=he=>{var pe;(pe=f?.onKeyDown)==null||pe.call(f,he),he.key==="Enter"&&(he.preventDefault(),G.close())};Pl(()=>{H||X(V(U))},[U,H]),Pl(()=>{H&&le("month")},[H]);const de=x==="popover";return L.createElement(mD,F5({formattedValue:W,dropdownOpened:H,dropdownHandlers:G,classNames:l,styles:c,unstyled:u,__staticSelector:"DateTimePicker",ref:t,onClear:()=>j(null),shouldClear:!!U,value:U,type:"default",size:v,variant:y,dropdownType:x},M),L.createElement(tre,Q9(F5({},B),{size:v,variant:y,type:"default",value:U,defaultDate:U,onChange:re,locale:s,classNames:l,styles:c,unstyled:u,__staticSelector:"DateTimePicker",__stopPropagation:de,level:p,defaultLevel:A,onLevelChange:he=>{var pe;le(he),(pe=B.onLevelChange)==null||pe.call(B,he)}})),Z==="month"&&L.createElement("div",{className:C.timeWrapper},L.createElement(p8e,Q9(F5({value:Q,withSeconds:m,ref:D,unstyled:u},f),{className:N(C.timeInput,f?.className),onChange:te,onKeyDown:ne,size:v,"data-mantine-stop-propagation":de||void 0})),L.createElement(xPe,Q9(F5({variant:"default",size:lu[v],unstyled:u,"data-mantine-stop-propagation":de||void 0,children:L.createElement(NMe,{width:`calc(${lu[v]} / 3)`})},h),{onClick:he=>{var pe;(pe=h?.onClick)==null||pe.call(h,he),G.close()}}))))});rre.displayName="@mantine/dates/DateTimePicker";var c$t=Object.defineProperty,wM=Object.getOwnPropertySymbols,v8e=Object.prototype.hasOwnProperty,y8e=Object.prototype.propertyIsEnumerable,Y0e=(e,t,n)=>t in e?c$t(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,q9=(e,t)=>{for(var n in t||(t={}))v8e.call(t,n)&&Y0e(e,n,t[n]);if(wM)for(var n of wM(t))y8e.call(t,n)&&Y0e(e,n,t[n]);return e},u$t=(e,t)=>{var n={};for(var r in e)v8e.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&wM)for(var r of wM(e))t.indexOf(r)<0&&y8e.call(e,r)&&(n[r]=e[r]);return n};const d$t={type:"default"},b8e=w.forwardRef((e,t)=>{const n=Qt("MonthPicker",d$t,e),{type:r,defaultValue:i,value:a,onChange:o,__staticSelector:s,getMonthControlProps:l,allowSingleDateInRange:c,allowDeselect:u,onMouseLeave:f,onMonthSelect:h}=n,m=u$t(n,["type","defaultValue","value","onChange","__staticSelector","getMonthControlProps","allowSingleDateInRange","allowDeselect","onMouseLeave","onMonthSelect"]),{onDateChange:p,onRootMouseLeave:A,onHoveredDateChange:v,getControlProps:y}=ere({type:r,level:"month",allowDeselect:u,allowSingleDateInRange:c,value:a,defaultValue:i,onChange:o,onMouseLeave:f});return L.createElement(P3,q9({ref:t,minLevel:"year",__updateDateOnMonthSelect:!1,__staticSelector:s||"MonthPicker",onMouseLeave:A,onMonthMouseEnter:(x,k)=>v(k),onMonthSelect:x=>{p(x),h?.(x)},getMonthControlProps:x=>q9(q9({},y(x)),l?.(x))},m))});b8e.displayName="@mantine/dates/MonthPicker";var f$t=Object.defineProperty,h$t=Object.defineProperties,m$t=Object.getOwnPropertyDescriptors,kM=Object.getOwnPropertySymbols,x8e=Object.prototype.hasOwnProperty,w8e=Object.prototype.propertyIsEnumerable,X0e=(e,t,n)=>t in e?f$t(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Z0e=(e,t)=>{for(var n in t||(t={}))x8e.call(t,n)&&X0e(e,n,t[n]);if(kM)for(var n of kM(t))w8e.call(t,n)&&X0e(e,n,t[n]);return e},p$t=(e,t)=>h$t(e,m$t(t)),A$t=(e,t)=>{var n={};for(var r in e)x8e.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&kM)for(var r of kM(e))t.indexOf(r)<0&&w8e.call(e,r)&&(n[r]=e[r]);return n};const g$t={type:"default",valueFormat:"MMMM YYYY",closeOnChange:!0,sortDates:!0,dropdownType:"popover"},Fp=w.forwardRef((e,t)=>{const n=Qt("MonthPickerInput",g$t,e),{type:r,value:i,defaultValue:a,onChange:o,valueFormat:s,labelSeparator:l,locale:c,classNames:u,styles:f,unstyled:h,closeOnChange:m,variant:p,size:A,dropdownType:v,sortDates:y,minDate:x,maxDate:k}=n,S=A$t(n,["type","value","defaultValue","onChange","valueFormat","labelSeparator","locale","classNames","styles","unstyled","closeOnChange","variant","size","dropdownType","sortDates","minDate","maxDate"]),{calendarProps:C,others:N}=M3(S),{_value:E,setValue:D,formattedValue:T,dropdownHandlers:P,dropdownOpened:O,onClear:B,shouldClear:M}=nre({type:r,value:i,defaultValue:a,onChange:o,locale:c,format:s,labelSeparator:l,closeOnChange:m,sortDates:y});return L.createElement(mD,Z0e({formattedValue:T,dropdownOpened:O,dropdownHandlers:P,classNames:u,styles:f,unstyled:h,__staticSelector:"MonthPickerInput",ref:t,onClear:B,shouldClear:M,value:E,type:r,variant:p,size:A,dropdownType:v},N),L.createElement(b8e,p$t(Z0e({},C),{type:r,value:E,defaultDate:Array.isArray(E)?E[0]||pE({maxDate:k,minDate:x}):E||pE({maxDate:k,minDate:x}),onChange:D,locale:c,classNames:u,styles:f,unstyled:h,__staticSelector:"MonthPickerInput",__stopPropagation:v==="popover",variant:p,size:A,minDate:x,maxDate:k})))});Fp.displayName="@mantine/dates/MonthPickerInput";var v$t=Object.defineProperty,SM=Object.getOwnPropertySymbols,k8e=Object.prototype.hasOwnProperty,S8e=Object.prototype.propertyIsEnumerable,J0e=(e,t,n)=>t in e?v$t(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,G9=(e,t)=>{for(var n in t||(t={}))k8e.call(t,n)&&J0e(e,n,t[n]);if(SM)for(var n of SM(t))S8e.call(t,n)&&J0e(e,n,t[n]);return e},y$t=(e,t)=>{var n={};for(var r in e)k8e.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&SM)for(var r of SM(e))t.indexOf(r)<0&&S8e.call(e,r)&&(n[r]=e[r]);return n};const b$t={type:"default"},C8e=w.forwardRef((e,t)=>{const n=Qt("YearPicker",b$t,e),{type:r,defaultValue:i,value:a,onChange:o,__staticSelector:s,getYearControlProps:l,allowSingleDateInRange:c,allowDeselect:u,onMouseLeave:f,onYearSelect:h}=n,m=y$t(n,["type","defaultValue","value","onChange","__staticSelector","getYearControlProps","allowSingleDateInRange","allowDeselect","onMouseLeave","onYearSelect"]),{onDateChange:p,onRootMouseLeave:A,onHoveredDateChange:v,getControlProps:y}=ere({type:r,level:"year",allowDeselect:u,allowSingleDateInRange:c,value:a,defaultValue:i,onChange:o,onMouseLeave:f});return L.createElement(P3,G9({ref:t,minLevel:"decade",__updateDateOnYearSelect:!1,__staticSelector:s||"YearPicker",onMouseLeave:A,onYearMouseEnter:(x,k)=>v(k),onYearSelect:x=>{p(x),h?.(x)},getYearControlProps:x=>G9(G9({},y(x)),l?.(x))},m))});C8e.displayName="@mantine/dates/YearPicker";var x$t=Object.defineProperty,w$t=Object.defineProperties,k$t=Object.getOwnPropertyDescriptors,CM=Object.getOwnPropertySymbols,_8e=Object.prototype.hasOwnProperty,N8e=Object.prototype.propertyIsEnumerable,ebe=(e,t,n)=>t in e?x$t(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,tbe=(e,t)=>{for(var n in t||(t={}))_8e.call(t,n)&&ebe(e,n,t[n]);if(CM)for(var n of CM(t))N8e.call(t,n)&&ebe(e,n,t[n]);return e},S$t=(e,t)=>w$t(e,k$t(t)),C$t=(e,t)=>{var n={};for(var r in e)_8e.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&CM)for(var r of CM(e))t.indexOf(r)<0&&N8e.call(e,r)&&(n[r]=e[r]);return n};const _$t={type:"default",valueFormat:"YYYY",closeOnChange:!0,sortDates:!0,dropdownType:"popover"},yy=w.forwardRef((e,t)=>{const n=Qt("YearPickerInput",_$t,e),{type:r,value:i,defaultValue:a,onChange:o,valueFormat:s,labelSeparator:l,locale:c,classNames:u,styles:f,unstyled:h,closeOnChange:m,size:p,variant:A,dropdownType:v,sortDates:y,minDate:x,maxDate:k}=n,S=C$t(n,["type","value","defaultValue","onChange","valueFormat","labelSeparator","locale","classNames","styles","unstyled","closeOnChange","size","variant","dropdownType","sortDates","minDate","maxDate"]),{calendarProps:C,others:N}=M3(S),{_value:E,setValue:D,formattedValue:T,dropdownHandlers:P,dropdownOpened:O,onClear:B,shouldClear:M}=nre({type:r,value:i,defaultValue:a,onChange:o,locale:c,format:s,labelSeparator:l,closeOnChange:m,sortDates:y});return L.createElement(mD,tbe({formattedValue:T,dropdownOpened:O,dropdownHandlers:P,classNames:u,styles:f,unstyled:h,__staticSelector:"YearPickerInput",ref:t,onClear:B,shouldClear:M,value:E,type:r,size:p,variant:A,dropdownType:v},N),L.createElement(C8e,S$t(tbe({},C),{size:p,variant:A,type:r,value:E,defaultDate:Array.isArray(E)?E[0]||pE({maxDate:k,minDate:x}):E||pE({maxDate:k,minDate:x}),onChange:D,locale:c,classNames:u,styles:f,unstyled:h,__staticSelector:"YearPickerInput",__stopPropagation:v==="popover",minDate:x,maxDate:k})))});yy.displayName="@mantine/dates/YearPickerInput";const Ou=()=>{const[{data:e,fetching:t,error:n},r]=rn({query:JFt});n&&(console.error(`Error fetching businesses: ${n}`),qe.error("Error",{description:"Unable to fetch businesses"}));const i=w.useMemo(()=>e?.allBusinesses?.nodes.sort((o,s)=>o.name>s.name?1:-1)??[],[e]),a=w.useMemo(()=>i.map(o=>({value:o.id,label:o.name})),[i]);return{fetching:t,refresh:()=>r(),businesses:i,selectableBusinesses:a}};class E8e{user=null;constructor(){try{const t=JSON.parse(localStorage.getItem("user"));this.user=t}catch(t){console.error(t)}}authToken(){const t=this.currentUser();return t?.authdata?`Basic ${t.authdata}`:null}async login(t,n){if(t&&n){const r=btoa(`${t}:${n}`),i={username:t,authdata:r};return localStorage.setItem("user",JSON.stringify(i)),this.user=i,i}throw new Error("Username or password is incorrect")}logout(){localStorage.removeItem("user"),this.user=null}isLoggedIn(){return!!this.user}currentUser(){if(!this.user)try{const t=JSON.parse(localStorage.getItem("user"));this.user=t}catch(t){console.error(t)}return this.user}}function os({className:e,...t}){return d.jsx("div",{"data-slot":"card",className:_t("bg-white text-gray-950 flex flex-col gap-6 rounded-xl border border-gray-200 py-6 shadow-sm dark:bg-gray-950 dark:text-gray-50 dark:border-gray-800",e),...t})}function Lc({className:e,...t}){return d.jsx("div",{"data-slot":"card-header",className:_t("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-[data-slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function Uc({className:e,...t}){return d.jsx("div",{"data-slot":"card-title",className:_t("leading-none font-semibold",e),...t})}function JY({className:e,...t}){return d.jsx("div",{"data-slot":"card-description",className:_t("text-gray-500 text-sm dark:text-gray-400",e),...t})}function Gs({className:e,...t}){return d.jsx("div",{"data-slot":"card-content",className:_t("px-6",e),...t})}const N$t=()=>d.jsxs(os,{className:"m-5",children:[d.jsx(Lc,{children:d.jsx(Uc,{children:"Network Error"})}),d.jsx(Gs,{children:d.jsx("p",{children:"There seems to be an issue with the connection to the server. Please check your internet connection and try again."})})]}),F8e=Object.freeze({status:"aborted"});function ut(e,t,n){function r(s,l){var c;Object.defineProperty(s,"_zod",{value:s._zod??{},enumerable:!1}),(c=s._zod).traits??(c.traits=new Set),s._zod.traits.add(e),t(s,l);for(const u in o.prototype)u in s||Object.defineProperty(s,u,{value:o.prototype[u].bind(s)});s._zod.constr=o,s._zod.def=l}const i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(s){var l;const c=n?.Parent?new a:this;r(c,s),(l=c._zod).deferred??(l.deferred=[]);for(const u of c._zod.deferred)u();return c}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:s=>n?.Parent&&s instanceof n.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}const D8e=Symbol("zod_brand");class zb extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class R3 extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const _M={};function zc(e){return e&&Object.assign(_M,e),_M}function E$t(e){return e}function F$t(e){return e}function D$t(e){}function T$t(e){throw new Error}function O$t(e){}function ire(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,i])=>t.indexOf(+r)===-1).map(([r,i])=>i)}function Zt(e,t="|"){return e.map(n=>Er(n)).join(t)}function NM(e,t){return typeof t=="bigint"?t.toString():t}function pD(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Wx(e){return e==null}function $3(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function T8e(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let i=(r.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(r)){const l=r.match(/\d?e-(\d?)/);l?.[1]&&(i=Number.parseInt(l[1]))}const a=n>i?n:i,o=Number.parseInt(e.toFixed(a).replace(".","")),s=Number.parseInt(t.toFixed(a).replace(".",""));return o%s/10**a}const nbe=Symbol("evaluating");function li(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==nbe)return r===void 0&&(r=nbe,r=n()),r},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function L3(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function rm(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ly(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function B$t(e){return Ly(e._zod.def)}function I$t(e,t){return t?t.reduce((n,r)=>n?.[r],e):e}function j$t(e){const t=Object.keys(e),n=t.map(r=>e[r]);return Promise.all(n).then(r=>{const i={};for(let a=0;a<t.length;a++)i[t[a]]=r[a];return i})}function P$t(e=10){const t="abcdefghijklmnopqrstuvwxyz";let n="";for(let r=0;r<e;r++)n+=t[Math.floor(Math.random()*t.length)];return n}function eX(e){return JSON.stringify(e)}const are="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Xk(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const O8e=pD(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function sx(e){if(Xk(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(Xk(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function U3(e){return sx(e)?{...e}:Array.isArray(e)?[...e]:e}function M$t(e){let t=0;for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}const R$t=e=>{const t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},EM=new Set(["string","number","symbol"]),B8e=new Set(["string","number","bigint","boolean","symbol","undefined"]);function by(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Kf(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function Ut(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function $$t(e){let t;return new Proxy({},{get(n,r,i){return t??(t=e()),Reflect.get(t,r,i)},set(n,r,i,a){return t??(t=e()),Reflect.set(t,r,i,a)},has(n,r){return t??(t=e()),Reflect.has(t,r)},deleteProperty(n,r){return t??(t=e()),Reflect.deleteProperty(t,r)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,i){return t??(t=e()),Reflect.defineProperty(t,r,i)}})}function Er(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function I8e(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const j8e={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},P8e={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function M8e(e,t){const n=e._zod.def,r=Ly(e._zod.def,{get shape(){const i={};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(i[a]=n.shape[a])}return rm(this,"shape",i),i},checks:[]});return Kf(e,r)}function R8e(e,t){const n=e._zod.def,r=Ly(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete i[a]}return rm(this,"shape",i),i},checks:[]});return Kf(e,r)}function $8e(e,t){if(!sx(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const i=Ly(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return rm(this,"shape",a),a},checks:[]});return Kf(e,i)}function L8e(e,t){if(!sx(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n={...e._zod.def,get shape(){const r={...e._zod.def.shape,...t};return rm(this,"shape",r),r},checks:e._zod.def.checks};return Kf(e,n)}function U8e(e,t){const n=Ly(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return rm(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return Kf(e,n)}function z8e(e,t,n){const r=Ly(t._zod.def,{get shape(){const i=t._zod.def.shape,a={...i};if(n)for(const o in n){if(!(o in i))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(a[o]=e?new e({type:"optional",innerType:i[o]}):i[o])}else for(const o in i)a[o]=e?new e({type:"optional",innerType:i[o]}):i[o];return rm(this,"shape",a),a},checks:[]});return Kf(t,r)}function H8e(e,t,n){const r=Ly(t._zod.def,{get shape(){const i=t._zod.def.shape,a={...i};if(n)for(const o in n){if(!(o in a))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(a[o]=new e({type:"nonoptional",innerType:i[o]}))}else for(const o in i)a[o]=new e({type:"nonoptional",innerType:i[o]});return rm(this,"shape",a),a},checks:[]});return Kf(t,r)}function xb(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Ih(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function LN(e){return typeof e=="string"?e:e?.message}function Yh(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const i=LN(e.inst?._zod.def?.error?.(e))??LN(t?.error?.(e))??LN(n.customError?.(e))??LN(n.localeError?.(e))??"Invalid input";r.message=i}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function z3(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function H3(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Zk(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}function L$t(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function V8e(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}function Q8e(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function U$t(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return V8e(t+n)}function z$t(e){return Q8e(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function H$t(e){const t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");const n=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2)n[r/2]=Number.parseInt(t.slice(r,r+2),16);return n}function V$t(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}class Q$t{constructor(...t){}}const q8e=Object.freeze(Object.defineProperty({__proto__:null,BIGINT_FORMAT_RANGES:P8e,Class:Q$t,NUMBER_FORMAT_RANGES:j8e,aborted:xb,allowsEval:O8e,assert:O$t,assertEqual:E$t,assertIs:D$t,assertNever:T$t,assertNotEqual:F$t,assignProp:rm,base64ToUint8Array:V8e,base64urlToUint8Array:U$t,cached:pD,captureStackTrace:are,cleanEnum:L$t,cleanRegex:$3,clone:Kf,cloneDef:B$t,createTransparentProxy:$$t,defineLazy:li,esc:eX,escapeRegex:by,extend:$8e,finalizeIssue:Yh,floatSafeRemainder:T8e,getElementAtPath:I$t,getEnumValues:ire,getLengthableOrigin:H3,getParsedType:R$t,getSizableOrigin:z3,hexToUint8Array:H$t,isObject:Xk,isPlainObject:sx,issue:Zk,joinValues:Zt,jsonStringifyReplacer:NM,merge:U8e,mergeDefs:Ly,normalizeParams:Ut,nullish:Wx,numKeys:M$t,objectClone:L3,omit:R8e,optionalKeys:I8e,partial:z8e,pick:M8e,prefixIssues:Ih,primitiveTypes:B8e,promiseAllObject:j$t,propertyKeyTypes:EM,randomString:P$t,required:H8e,safeExtend:L8e,shallowClone:U3,stringifyPrimitive:Er,uint8ArrayToBase64:Q8e,uint8ArrayToBase64url:z$t,uint8ArrayToHex:V$t,unwrapMessage:LN},Symbol.toStringTag,{value:"Module"})),G8e=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,NM,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},V3=ut("$ZodError",G8e),Fd=ut("$ZodError",G8e,{Parent:Error});function ore(e,t=n=>n.message){const n={},r=[];for(const i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function sre(e,t){const n=t||function(a){return a.message},r={_errors:[]},i=a=>{for(const o of a.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(s=>i({issues:s}));else if(o.code==="invalid_key")i({issues:o.issues});else if(o.code==="invalid_element")i({issues:o.issues});else if(o.path.length===0)r._errors.push(n(o));else{let s=r,l=0;for(;l<o.path.length;){const c=o.path[l];l===o.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(n(o))):s[c]=s[c]||{_errors:[]},s=s[c],l++}}};return i(e),r}function W8e(e,t){const n=t||function(a){return a.message},r={errors:[]},i=(a,o=[])=>{var s,l;for(const c of a.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(u=>i({issues:u},c.path));else if(c.code==="invalid_key")i({issues:c.issues},c.path);else if(c.code==="invalid_element")i({issues:c.issues},c.path);else{const u=[...o,...c.path];if(u.length===0){r.errors.push(n(c));continue}let f=r,h=0;for(;h<u.length;){const m=u[h],p=h===u.length-1;typeof m=="string"?(f.properties??(f.properties={}),(s=f.properties)[m]??(s[m]={errors:[]}),f=f.properties[m]):(f.items??(f.items=[]),(l=f.items)[m]??(l[m]={errors:[]}),f=f.items[m]),p&&f.errors.push(n(c)),h++}}};return i(e),r}function K8e(e){const t=[],n=e.map(r=>typeof r=="object"?r.key:r);for(const r of n)typeof r=="number"?t.push(`[${r}]`):typeof r=="symbol"?t.push(`[${JSON.stringify(String(r))}]`):/[^\w$]/.test(r)?t.push(`[${JSON.stringify(r)}]`):(t.length&&t.push("."),t.push(r));return t.join("")}function Y8e(e){const t=[],n=[...e.issues].sort((r,i)=>(r.path??[]).length-(i.path??[]).length);for(const r of n)t.push(`✖ ${r.message}`),r.path?.length&&t.push(` → at ${K8e(r.path)}`);return t.join(`
646
646
  `)}const AD=e=>(t,n,r,i)=>{const a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new zb;if(o.issues.length){const s=new(i?.Err??e)(o.issues.map(l=>Yh(l,a,zc())));throw are(s,i?.callee),s}return o.value},FM=AD(Fd),gD=e=>async(t,n,r,i)=>{const a=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){const s=new(i?.Err??e)(o.issues.map(l=>Yh(l,a,zc())));throw are(s,i?.callee),s}return o.value},DM=gD(Fd),vD=e=>(t,n,r)=>{const i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new zb;return a.issues.length?{success:!1,error:new(e??V3)(a.issues.map(o=>Yh(o,i,zc())))}:{success:!0,data:a.value}},X8e=vD(Fd),yD=e=>async(t,n,r)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(o=>Yh(o,i,zc())))}:{success:!0,data:a.value}},Z8e=yD(Fd),lre=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return AD(e)(t,n,i)},q$t=lre(Fd),cre=e=>(t,n,r)=>AD(e)(t,n,r),G$t=cre(Fd),ure=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return gD(e)(t,n,i)},W$t=ure(Fd),dre=e=>async(t,n,r)=>gD(e)(t,n,r),K$t=dre(Fd),fre=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return vD(e)(t,n,i)},Y$t=fre(Fd),hre=e=>(t,n,r)=>vD(e)(t,n,r),X$t=hre(Fd),mre=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return yD(e)(t,n,i)},Z$t=mre(Fd),pre=e=>async(t,n,r)=>yD(e)(t,n,r),J$t=pre(Fd),J8e=/^[cC][^\s-]{8,}$/,eUe=/^[0-9a-z]+$/,tUe=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,nUe=/^[0-9a-vA-V]{20}$/,rUe=/^[A-Za-z0-9]{27}$/,iUe=/^[a-zA-Z0-9_-]{21}$/,aUe=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,e3t=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,oUe=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Jk=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,t3t=Jk(4),n3t=Jk(6),r3t=Jk(7),sUe=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,i3t=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,a3t=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,lUe=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,o3t=lUe,s3t=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,l3t="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function cUe(){return new RegExp(l3t,"u")}const uUe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,dUe=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,fUe=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,hUe=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,mUe=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Are=/^[A-Za-z0-9_-]*$/,gre=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,pUe=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,AUe=/^\+(?:[0-9]){6,14}[0-9]$/,gUe="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",vUe=new RegExp(`^${gUe}$`);function yUe(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function bUe(e){return new RegExp(`^${yUe(e)}$`)}function xUe(e){const t=yUe({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${gUe}T(?:${r})$`)}const wUe=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},kUe=/^-?\d+n?$/,SUe=/^-?\d+$/,CUe=/^-?\d+(?:\.\d+)?/,_Ue=/^(?:true|false)$/i,NUe=/^null$/i,EUe=/^undefined$/i,FUe=/^[^A-Z]*$/,DUe=/^[^a-z]*$/,TUe=/^[0-9a-fA-F]*$/;function bD(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function xD(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}const c3t=/^[0-9a-fA-F]{32}$/,u3t=bD(22,"=="),d3t=xD(22),f3t=/^[0-9a-fA-F]{40}$/,h3t=bD(27,"="),m3t=xD(27),p3t=/^[0-9a-fA-F]{64}$/,A3t=bD(43,"="),g3t=xD(43),v3t=/^[0-9a-fA-F]{96}$/,y3t=bD(64,""),b3t=xD(64),x3t=/^[0-9a-fA-F]{128}$/,w3t=bD(86,"=="),k3t=xD(86),vre=Object.freeze(Object.defineProperty({__proto__:null,base64:mUe,base64url:Are,bigint:kUe,boolean:_Ue,browserEmail:s3t,cidrv4:fUe,cidrv6:hUe,cuid:J8e,cuid2:eUe,date:vUe,datetime:xUe,domain:pUe,duration:aUe,e164:AUe,email:sUe,emoji:cUe,extendedDuration:e3t,guid:oUe,hex:TUe,hostname:gre,html5Email:i3t,idnEmail:o3t,integer:SUe,ipv4:uUe,ipv6:dUe,ksuid:rUe,lowercase:FUe,md5_base64:u3t,md5_base64url:d3t,md5_hex:c3t,nanoid:iUe,null:NUe,number:CUe,rfc5322Email:a3t,sha1_base64:h3t,sha1_base64url:m3t,sha1_hex:f3t,sha256_base64:A3t,sha256_base64url:g3t,sha256_hex:p3t,sha384_base64:y3t,sha384_base64url:b3t,sha384_hex:v3t,sha512_base64:w3t,sha512_base64url:k3t,sha512_hex:x3t,string:wUe,time:bUe,ulid:tUe,undefined:EUe,unicodeEmail:lUe,uppercase:DUe,uuid:Jk,uuid4:t3t,uuid6:n3t,uuid7:r3t,xid:nUe},Symbol.toStringTag,{value:"Module"})),Po=ut("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),OUe={number:"number",bigint:"bigint",object:"date"},yre=ut("$ZodCheckLessThan",(e,t)=>{Po.init(e,t);const n=OUe[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,a=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<a&&(t.inclusive?i.maximum=t.value:i.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),bre=ut("$ZodCheckGreaterThan",(e,t)=>{Po.init(e,t);const n=OUe[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,a=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>a&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),BUe=ut("$ZodCheckMultipleOf",(e,t)=>{Po.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):T8e(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),IUe=ut("$ZodCheckNumberFormat",(e,t)=>{Po.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[i,a]=j8e[t.format];e._zod.onattach.push(o=>{const s=o._zod.bag;s.format=t.format,s.minimum=i,s.maximum=a,n&&(s.pattern=SUe)}),e._zod.check=o=>{const s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort}):o.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort});return}}s<i&&o.issues.push({origin:"number",input:s,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:"number",input:s,code:"too_big",maximum:a,inst:e})}}),jUe=ut("$ZodCheckBigIntFormat",(e,t)=>{Po.init(e,t);const[n,r]=P8e[t.format];e._zod.onattach.push(i=>{const a=i._zod.bag;a.format=t.format,a.minimum=n,a.maximum=r}),e._zod.check=i=>{const a=i.value;a<n&&i.issues.push({origin:"bigint",input:a,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),a>r&&i.issues.push({origin:"bigint",input:a,code:"too_big",maximum:r,inst:e})}}),PUe=ut("$ZodCheckMaxSize",(e,t)=>{var n;Po.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!Wx(i)&&i.size!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const i=r.value;i.size<=t.maximum||r.issues.push({origin:z3(i),code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),MUe=ut("$ZodCheckMinSize",(e,t)=>{var n;Po.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!Wx(i)&&i.size!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const i=r.value;i.size>=t.minimum||r.issues.push({origin:z3(i),code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),RUe=ut("$ZodCheckSizeEquals",(e,t)=>{var n;Po.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!Wx(i)&&i.size!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=t.size,i.maximum=t.size,i.size=t.size}),e._zod.check=r=>{const i=r.value,a=i.size;if(a===t.size)return;const o=a>t.size;r.issues.push({origin:z3(i),...o?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),$Ue=ut("$ZodCheckMaxLength",(e,t)=>{var n;Po.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!Wx(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const i=r.value;if(i.length<=t.maximum)return;const o=H3(i);r.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),LUe=ut("$ZodCheckMinLength",(e,t)=>{var n;Po.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!Wx(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const i=r.value;if(i.length>=t.minimum)return;const o=H3(i);r.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),UUe=ut("$ZodCheckLengthEquals",(e,t)=>{var n;Po.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!Wx(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=r=>{const i=r.value,a=i.length;if(a===t.length)return;const o=H3(i),s=a>t.length;r.issues.push({origin:o,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),wD=ut("$ZodCheckStringFormat",(e,t)=>{var n,r;Po.init(e,t),e._zod.onattach.push(i=>{const a=i._zod.bag;a.format=t.format,t.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),zUe=ut("$ZodCheckRegex",(e,t)=>{wD.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),HUe=ut("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=FUe),wD.init(e,t)}),VUe=ut("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=DUe),wD.init(e,t)}),QUe=ut("$ZodCheckIncludes",(e,t)=>{Po.init(e,t);const n=by(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(i=>{const a=i._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(r)}),e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),qUe=ut("$ZodCheckStartsWith",(e,t)=>{Po.init(e,t);const n=new RegExp(`^${by(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),GUe=ut("$ZodCheckEndsWith",(e,t)=>{Po.init(e,t);const n=new RegExp(`.*${by(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});function rbe(e,t,n){e.issues.length&&t.issues.push(...Ih(n,e.issues))}const WUe=ut("$ZodCheckProperty",(e,t)=>{Po.init(e,t),e._zod.check=n=>{const r=t.schema._zod.run({value:n.value[t.property],issues:[]},{});if(r instanceof Promise)return r.then(i=>rbe(i,n,t.property));rbe(r,n,t.property)}}),KUe=ut("$ZodCheckMimeType",(e,t)=>{Po.init(e,t);const n=new Set(t.mime);e._zod.onattach.push(r=>{r._zod.bag.mime=t.mime}),e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:"invalid_value",values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),YUe=ut("$ZodCheckOverwrite",(e,t)=>{Po.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class XUe{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
647
647
  `).filter(o=>o),i=Math.min(...r.map(o=>o.length-o.trimStart().length)),a=r.map(o=>o.slice(i)).map(o=>" ".repeat(this.indent*2)+o);for(const o of a)this.content.push(o)}compile(){const t=Function,n=this?.args,i=[...(this?.content??[""]).map(a=>` ${a}`)];return new t(...n,i.join(`
648
- `))}}const ZUe={major:4,minor:1,patch:9},Pr=ut("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ZUe;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const i of r)for(const a of i._zod.onattach)a(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const i=(o,s,l)=>{let c=xb(o),u;for(const f of s){if(f._zod.def.when){if(!f._zod.def.when(o))continue}else if(c)continue;const h=o.issues.length,m=f._zod.check(o);if(m instanceof Promise&&l?.async===!1)throw new zb;if(u||m instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await m,o.issues.length!==h&&(c||(c=xb(o,h)))});else{if(o.issues.length===h)continue;c||(c=xb(o,h))}}return u?u.then(()=>o):o},a=(o,s,l)=>{if(xb(o))return o.aborted=!0,o;const c=i(s,r,l);if(c instanceof Promise){if(l.async===!1)throw new zb;return c.then(u=>e._zod.parse(u,l))}return e._zod.parse(c,l)};e._zod.run=(o,s)=>{if(s.skipChecks)return e._zod.parse(o,s);if(s.direction==="backward"){const c=e._zod.parse({value:o.value,issues:[]},{...s,skipChecks:!0});return c instanceof Promise?c.then(u=>a(u,o,s)):a(c,o,s)}const l=e._zod.parse(o,s);if(l instanceof Promise){if(s.async===!1)throw new zb;return l.then(c=>i(c,r,s))}return i(l,r,s)}}e["~standard"]={validate:i=>{try{const a=X8e(e,i);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return Z8e(e,i).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}}),kD=ut("$ZodString",(e,t)=>{Pr.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??wUe(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),ka=ut("$ZodStringFormat",(e,t)=>{wD.init(e,t),kD.init(e,t)}),JUe=ut("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=oUe),ka.init(e,t)}),e7e=ut("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Jk(r))}else t.pattern??(t.pattern=Jk());ka.init(e,t)}),t7e=ut("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=sUe),ka.init(e,t)}),n7e=ut("$ZodURL",(e,t)=>{ka.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:gre.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),r7e=ut("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=cUe()),ka.init(e,t)}),i7e=ut("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=iUe),ka.init(e,t)}),a7e=ut("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=J8e),ka.init(e,t)}),o7e=ut("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=eUe),ka.init(e,t)}),s7e=ut("$ZodULID",(e,t)=>{t.pattern??(t.pattern=tUe),ka.init(e,t)}),l7e=ut("$ZodXID",(e,t)=>{t.pattern??(t.pattern=nUe),ka.init(e,t)}),c7e=ut("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=rUe),ka.init(e,t)}),u7e=ut("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=xUe(t)),ka.init(e,t)}),d7e=ut("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=vUe),ka.init(e,t)}),f7e=ut("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=bUe(t)),ka.init(e,t)}),h7e=ut("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=aUe),ka.init(e,t)}),m7e=ut("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=uUe),ka.init(e,t),e._zod.onattach.push(n=>{const r=n._zod.bag;r.format="ipv4"})}),p7e=ut("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=dUe),ka.init(e,t),e._zod.onattach.push(n=>{const r=n._zod.bag;r.format="ipv6"}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),A7e=ut("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=fUe),ka.init(e,t)}),g7e=ut("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=hUe),ka.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[i,a]=r;if(!a)throw new Error;const o=Number(a);if(`${o}`!==a)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function xre(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const v7e=ut("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=mUe),ka.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64"}),e._zod.check=n=>{xre(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function y7e(e){if(!Are.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return xre(n)}const b7e=ut("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Are),ka.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64url"}),e._zod.check=n=>{y7e(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),x7e=ut("$ZodE164",(e,t)=>{t.pattern??(t.pattern=AUe),ka.init(e,t)});function w7e(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const i=JSON.parse(atob(r));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}const k7e=ut("$ZodJWT",(e,t)=>{ka.init(e,t),e._zod.check=n=>{w7e(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),S7e=ut("$ZodCustomStringFormat",(e,t)=>{ka.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}}),wre=ut("$ZodNumber",(e,t)=>{Pr.init(e,t),e._zod.pattern=e._zod.bag.pattern??CUe,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const i=n.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return n;const a=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...a?{received:a}:{}}),n}}),C7e=ut("$ZodNumber",(e,t)=>{IUe.init(e,t),wre.init(e,t)}),kre=ut("$ZodBoolean",(e,t)=>{Pr.init(e,t),e._zod.pattern=_Ue,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const i=n.value;return typeof i=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),Sre=ut("$ZodBigInt",(e,t)=>{Pr.init(e,t),e._zod.pattern=kUe,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value=="bigint"||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),_7e=ut("$ZodBigInt",(e,t)=>{jUe.init(e,t),Sre.init(e,t)}),N7e=ut("$ZodSymbol",(e,t)=>{Pr.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;return typeof i=="symbol"||n.issues.push({expected:"symbol",code:"invalid_type",input:i,inst:e}),n}}),E7e=ut("$ZodUndefined",(e,t)=>{Pr.init(e,t),e._zod.pattern=EUe,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(n,r)=>{const i=n.value;return typeof i>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:i,inst:e}),n}}),F7e=ut("$ZodNull",(e,t)=>{Pr.init(e,t),e._zod.pattern=NUe,e._zod.values=new Set([null]),e._zod.parse=(n,r)=>{const i=n.value;return i===null||n.issues.push({expected:"null",code:"invalid_type",input:i,inst:e}),n}}),D7e=ut("$ZodAny",(e,t)=>{Pr.init(e,t),e._zod.parse=n=>n}),T7e=ut("$ZodUnknown",(e,t)=>{Pr.init(e,t),e._zod.parse=n=>n}),O7e=ut("$ZodNever",(e,t)=>{Pr.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),B7e=ut("$ZodVoid",(e,t)=>{Pr.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;return typeof i>"u"||n.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),n}}),I7e=ut("$ZodDate",(e,t)=>{Pr.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}const i=n.value,a=i instanceof Date;return a&&!Number.isNaN(i.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:i,...a?{received:"Invalid Date"}:{},inst:e}),n}});function ibe(e,t,n){e.issues.length&&t.issues.push(...Ih(n,e.issues)),t.value[n]=e.value}const j7e=ut("$ZodArray",(e,t)=>{Pr.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);const a=[];for(let o=0;o<i.length;o++){const s=i[o],l=t.element._zod.run({value:s,issues:[]},r);l instanceof Promise?a.push(l.then(c=>ibe(c,n,o))):ibe(l,n,o)}return a.length?Promise.all(a).then(()=>n):n}});function TM(e,t,n,r){e.issues.length&&t.issues.push(...Ih(n,e.issues)),e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function P7e(e){const t=Object.keys(e.shape);for(const r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const n=I8e(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function M7e(e,t,n,r,i,a){const o=[],s=i.keySet,l=i.catchall._zod,c=l.def.type;for(const u of Object.keys(t)){if(s.has(u))continue;if(c==="never"){o.push(u);continue}const f=l.run({value:t[u],issues:[]},r);f instanceof Promise?e.push(f.then(h=>TM(h,n,u,t))):TM(f,n,u,t)}return o.length&&n.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const R7e=ut("$ZodObject",(e,t)=>{Pr.init(e,t);const n=pD(()=>P7e(t));li(e._zod,"propValues",()=>{const o=t.shape,s={};for(const l in o){const c=o[l]._zod;if(c.values){s[l]??(s[l]=new Set);for(const u of c.values)s[l].add(u)}}return s});const r=Xk,i=t.catchall;let a;e._zod.parse=(o,s)=>{a??(a=n.value);const l=o.value;if(!r(l))return o.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),o;o.value={};const c=[],u=a.shape;for(const f of a.keys){const m=u[f]._zod.run({value:l[f],issues:[]},s);m instanceof Promise?c.push(m.then(p=>TM(p,o,f,l))):TM(m,o,f,l)}return i?M7e(c,l,o,s,n.value,e):c.length?Promise.all(c).then(()=>o):o}}),$7e=ut("$ZodObjectJIT",(e,t)=>{R7e.init(e,t);const n=e._zod.parse,r=pD(()=>P7e(t)),i=h=>{const m=new XUe(["shape","payload","ctx"]),p=r.value,A=k=>{const S=eX(k);return`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`};m.write("const input = payload.value;");const v=Object.create(null);let y=0;for(const k of p.keys)v[k]=`key_${y++}`;m.write("const newResult = {};");for(const k of p.keys){const S=v[k],C=eX(k);m.write(`const ${S} = ${A(k)};`),m.write(`
648
+ `))}}const ZUe={major:4,minor:1,patch:8},Pr=ut("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ZUe;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const i of r)for(const a of i._zod.onattach)a(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const i=(o,s,l)=>{let c=xb(o),u;for(const f of s){if(f._zod.def.when){if(!f._zod.def.when(o))continue}else if(c)continue;const h=o.issues.length,m=f._zod.check(o);if(m instanceof Promise&&l?.async===!1)throw new zb;if(u||m instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await m,o.issues.length!==h&&(c||(c=xb(o,h)))});else{if(o.issues.length===h)continue;c||(c=xb(o,h))}}return u?u.then(()=>o):o},a=(o,s,l)=>{if(xb(o))return o.aborted=!0,o;const c=i(s,r,l);if(c instanceof Promise){if(l.async===!1)throw new zb;return c.then(u=>e._zod.parse(u,l))}return e._zod.parse(c,l)};e._zod.run=(o,s)=>{if(s.skipChecks)return e._zod.parse(o,s);if(s.direction==="backward"){const c=e._zod.parse({value:o.value,issues:[]},{...s,skipChecks:!0});return c instanceof Promise?c.then(u=>a(u,o,s)):a(c,o,s)}const l=e._zod.parse(o,s);if(l instanceof Promise){if(s.async===!1)throw new zb;return l.then(c=>i(c,r,s))}return i(l,r,s)}}e["~standard"]={validate:i=>{try{const a=X8e(e,i);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return Z8e(e,i).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}}),kD=ut("$ZodString",(e,t)=>{Pr.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??wUe(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),ka=ut("$ZodStringFormat",(e,t)=>{wD.init(e,t),kD.init(e,t)}),JUe=ut("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=oUe),ka.init(e,t)}),e7e=ut("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Jk(r))}else t.pattern??(t.pattern=Jk());ka.init(e,t)}),t7e=ut("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=sUe),ka.init(e,t)}),n7e=ut("$ZodURL",(e,t)=>{ka.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:gre.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),r7e=ut("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=cUe()),ka.init(e,t)}),i7e=ut("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=iUe),ka.init(e,t)}),a7e=ut("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=J8e),ka.init(e,t)}),o7e=ut("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=eUe),ka.init(e,t)}),s7e=ut("$ZodULID",(e,t)=>{t.pattern??(t.pattern=tUe),ka.init(e,t)}),l7e=ut("$ZodXID",(e,t)=>{t.pattern??(t.pattern=nUe),ka.init(e,t)}),c7e=ut("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=rUe),ka.init(e,t)}),u7e=ut("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=xUe(t)),ka.init(e,t)}),d7e=ut("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=vUe),ka.init(e,t)}),f7e=ut("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=bUe(t)),ka.init(e,t)}),h7e=ut("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=aUe),ka.init(e,t)}),m7e=ut("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=uUe),ka.init(e,t),e._zod.onattach.push(n=>{const r=n._zod.bag;r.format="ipv4"})}),p7e=ut("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=dUe),ka.init(e,t),e._zod.onattach.push(n=>{const r=n._zod.bag;r.format="ipv6"}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),A7e=ut("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=fUe),ka.init(e,t)}),g7e=ut("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=hUe),ka.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[i,a]=r;if(!a)throw new Error;const o=Number(a);if(`${o}`!==a)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function xre(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const v7e=ut("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=mUe),ka.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64"}),e._zod.check=n=>{xre(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function y7e(e){if(!Are.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return xre(n)}const b7e=ut("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Are),ka.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64url"}),e._zod.check=n=>{y7e(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),x7e=ut("$ZodE164",(e,t)=>{t.pattern??(t.pattern=AUe),ka.init(e,t)});function w7e(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const i=JSON.parse(atob(r));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}const k7e=ut("$ZodJWT",(e,t)=>{ka.init(e,t),e._zod.check=n=>{w7e(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),S7e=ut("$ZodCustomStringFormat",(e,t)=>{ka.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}}),wre=ut("$ZodNumber",(e,t)=>{Pr.init(e,t),e._zod.pattern=e._zod.bag.pattern??CUe,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const i=n.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return n;const a=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...a?{received:a}:{}}),n}}),C7e=ut("$ZodNumber",(e,t)=>{IUe.init(e,t),wre.init(e,t)}),kre=ut("$ZodBoolean",(e,t)=>{Pr.init(e,t),e._zod.pattern=_Ue,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const i=n.value;return typeof i=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),Sre=ut("$ZodBigInt",(e,t)=>{Pr.init(e,t),e._zod.pattern=kUe,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value=="bigint"||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),_7e=ut("$ZodBigInt",(e,t)=>{jUe.init(e,t),Sre.init(e,t)}),N7e=ut("$ZodSymbol",(e,t)=>{Pr.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;return typeof i=="symbol"||n.issues.push({expected:"symbol",code:"invalid_type",input:i,inst:e}),n}}),E7e=ut("$ZodUndefined",(e,t)=>{Pr.init(e,t),e._zod.pattern=EUe,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(n,r)=>{const i=n.value;return typeof i>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:i,inst:e}),n}}),F7e=ut("$ZodNull",(e,t)=>{Pr.init(e,t),e._zod.pattern=NUe,e._zod.values=new Set([null]),e._zod.parse=(n,r)=>{const i=n.value;return i===null||n.issues.push({expected:"null",code:"invalid_type",input:i,inst:e}),n}}),D7e=ut("$ZodAny",(e,t)=>{Pr.init(e,t),e._zod.parse=n=>n}),T7e=ut("$ZodUnknown",(e,t)=>{Pr.init(e,t),e._zod.parse=n=>n}),O7e=ut("$ZodNever",(e,t)=>{Pr.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),B7e=ut("$ZodVoid",(e,t)=>{Pr.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;return typeof i>"u"||n.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),n}}),I7e=ut("$ZodDate",(e,t)=>{Pr.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}const i=n.value,a=i instanceof Date;return a&&!Number.isNaN(i.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:i,...a?{received:"Invalid Date"}:{},inst:e}),n}});function ibe(e,t,n){e.issues.length&&t.issues.push(...Ih(n,e.issues)),t.value[n]=e.value}const j7e=ut("$ZodArray",(e,t)=>{Pr.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);const a=[];for(let o=0;o<i.length;o++){const s=i[o],l=t.element._zod.run({value:s,issues:[]},r);l instanceof Promise?a.push(l.then(c=>ibe(c,n,o))):ibe(l,n,o)}return a.length?Promise.all(a).then(()=>n):n}});function TM(e,t,n,r){e.issues.length&&t.issues.push(...Ih(n,e.issues)),e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function P7e(e){const t=Object.keys(e.shape);for(const r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const n=I8e(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function M7e(e,t,n,r,i,a){const o=[],s=i.keySet,l=i.catchall._zod,c=l.def.type;for(const u of Object.keys(t)){if(s.has(u))continue;if(c==="never"){o.push(u);continue}const f=l.run({value:t[u],issues:[]},r);f instanceof Promise?e.push(f.then(h=>TM(h,n,u,t))):TM(f,n,u,t)}return o.length&&n.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const R7e=ut("$ZodObject",(e,t)=>{Pr.init(e,t);const n=pD(()=>P7e(t));li(e._zod,"propValues",()=>{const o=t.shape,s={};for(const l in o){const c=o[l]._zod;if(c.values){s[l]??(s[l]=new Set);for(const u of c.values)s[l].add(u)}}return s});const r=Xk,i=t.catchall;let a;e._zod.parse=(o,s)=>{a??(a=n.value);const l=o.value;if(!r(l))return o.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),o;o.value={};const c=[],u=a.shape;for(const f of a.keys){const m=u[f]._zod.run({value:l[f],issues:[]},s);m instanceof Promise?c.push(m.then(p=>TM(p,o,f,l))):TM(m,o,f,l)}return i?M7e(c,l,o,s,n.value,e):c.length?Promise.all(c).then(()=>o):o}}),$7e=ut("$ZodObjectJIT",(e,t)=>{R7e.init(e,t);const n=e._zod.parse,r=pD(()=>P7e(t)),i=h=>{const m=new XUe(["shape","payload","ctx"]),p=r.value,A=k=>{const S=eX(k);return`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`};m.write("const input = payload.value;");const v=Object.create(null);let y=0;for(const k of p.keys)v[k]=`key_${y++}`;m.write("const newResult = {};");for(const k of p.keys){const S=v[k],C=eX(k);m.write(`const ${S} = ${A(k)};`),m.write(`
649
649
  if (${S}.issues.length) {
650
650
  payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
651
651
  ...iss,
@@ -812,7 +812,7 @@ T* `):Y.join(` Tj
812
812
  endobj\r
813
813
  `},n.outline.count_r=function(r,i){for(var a=0;a<i.children.length;a++)r.count++,this.count_r(r,i.children[a]);return r.count}}])})(Wn.API),(function(e){var t=[192,193,194,195,196,197,198,199];e.processJPEG=function(n,r,i,a,o,s){var l,c=this.decode.DCT_DECODE,u=null;if(typeof n=="string"||this.__addimage__.isArrayBuffer(n)||this.__addimage__.isArrayBufferView(n)){switch(n=o||n,n=this.__addimage__.isArrayBuffer(n)?new Uint8Array(n):n,l=(function(f){for(var h,m=256*f.charCodeAt(4)+f.charCodeAt(5),p=f.length,A={width:0,height:0,numcomponents:1},v=4;v<p;v+=2){if(v+=m,t.indexOf(f.charCodeAt(v+1))!==-1){h=256*f.charCodeAt(v+5)+f.charCodeAt(v+6),A={width:256*f.charCodeAt(v+7)+f.charCodeAt(v+8),height:h,numcomponents:f.charCodeAt(v+9)};break}m=256*f.charCodeAt(v+2)+f.charCodeAt(v+3)}return A})(n=this.__addimage__.isArrayBufferView(n)?this.__addimage__.arrayBufferToBinaryString(n):n),l.numcomponents){case 1:s=this.color_spaces.DEVICE_GRAY;break;case 4:s=this.color_spaces.DEVICE_CMYK;break;case 3:s=this.color_spaces.DEVICE_RGB}u={data:n,width:l.width,height:l.height,colorSpace:s,bitsPerComponent:8,filter:c,index:r,alias:i}}return u}})(Wn.API),Wn.API.processPNG=function(e,t,n,r){if(this.__addimage__.isArrayBuffer(e)&&(e=new Uint8Array(e)),this.__addimage__.isArrayBufferView(e)){var i,a=gZt(e,{checkCrc:!0}),o=a.width,s=a.height,l=a.channels,c=a.palette,u=a.depth;i=c&&l===1?(function(E){for(var D=E.width,T=E.height,P=E.data,O=E.palette,B=E.depth,M=!1,$=[],U=[],j=void 0,V=!1,Q=0,X=0;X<O.length;X++){var Z=t1e(O[X],4),le=Z[0],H=Z[1],G=Z[2],W=Z[3];$.push(le,H,G),W!=null&&(W===0?(Q++,U.length<1&&U.push(X)):W<255&&(V=!0))}if(V||Q>1){M=!0,U=void 0;var te=D*T;j=new Uint8Array(te);for(var re=new DataView(P.buffer),ne=0;ne<te;ne++){var de=KH(re,ne,B),he=t1e(O[de],4)[3];j[ne]=he}}return{colorSpace:"Indexed",colorsPerPixel:1,colorBytes:P,alphaBytes:j,needSMask:M,palette:$,mask:U}})(a):l===2||l===4?(function(E){for(var D=E.data,T=E.width,P=E.height,O=E.channels,B=E.depth,M=O===2?"DeviceGray":"DeviceRGB",$=O-1,U=T*P,j=$,V=U*j,Q=1*U,X=Math.ceil(V*B/8),Z=Math.ceil(Q*B/8),le=new Uint8Array(X),H=new Uint8Array(Z),G=new DataView(D.buffer),W=new DataView(le.buffer),te=new DataView(H.buffer),re=!1,ne=0;ne<U;ne++){for(var de=ne*O,he=0;he<j;he++)owe(W,KH(G,de+he,B),ne*j+he,B);var pe=KH(G,de+j,B);pe<(1<<B)-1&&(re=!0),owe(te,pe,1*ne,B)}return{colorSpace:M,colorsPerPixel:$,colorBytes:le,alphaBytes:H,needSMask:re}})(a):(function(E){var D=E.data,T=E.channels===1?"DeviceGray":"DeviceRGB";return{colorSpace:T,colorsPerPixel:T==="DeviceGray"?1:3,colorBytes:D instanceof Uint8Array?D:new Uint8Array(D.buffer),needSMask:!1}})(a);var f,h,m,p=i,A=p.colorSpace,v=p.colorsPerPixel,y=p.colorBytes,x=p.alphaBytes,k=p.needSMask,S=p.palette,C=p.mask,N=null;return r!==Wn.API.image_compression.NONE&&typeof qX=="function"?(N=(function(E){var D;switch(E){case Wn.API.image_compression.FAST:D=11;break;case Wn.API.image_compression.MEDIUM:D=13;break;case Wn.API.image_compression.SLOW:D=14;break;default:D=12}return D})(r),f=this.decode.FLATE_DECODE,h="/Predictor ".concat(N," "),e=twe(y,o*v,v,r),k&&(m=twe(x,o,1,r))):(f=void 0,h="",e=y,k&&(m=x)),h+="/Colors ".concat(v," /BitsPerComponent ").concat(u," /Columns ").concat(o),(this.__addimage__.isArrayBuffer(e)||this.__addimage__.isArrayBufferView(e))&&(e=this.__addimage__.arrayBufferToBinaryString(e)),(m&&this.__addimage__.isArrayBuffer(m)||this.__addimage__.isArrayBufferView(m))&&(m=this.__addimage__.arrayBufferToBinaryString(m)),{alias:n,data:e,index:t,filter:f,decodeParameters:h,transparency:C,palette:S,sMask:m,predictor:N,width:o,height:s,bitsPerComponent:u,colorSpace:A}}},(function(e){e.processGIF89A=function(t,n,r,i){var a=new RZt(t),o=a.width,s=a.height,l=[];a.decodeAndBlitFrameRGBA(0,l);var c={data:l,width:o,height:s},u=new YH(100).encode(c,100);return e.processJPEG.call(this,u,n,r,i)},e.processGIF87A=e.processGIF89A})(Wn.API),xh.prototype.parseHeader=function(){if(this.fileSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.reserved=this.datav.getUint32(this.pos,!0),this.pos+=4,this.offset=this.datav.getUint32(this.pos,!0),this.pos+=4,this.headerSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.width=this.datav.getUint32(this.pos,!0),this.pos+=4,this.height=this.datav.getInt32(this.pos,!0),this.pos+=4,this.planes=this.datav.getUint16(this.pos,!0),this.pos+=2,this.bitPP=this.datav.getUint16(this.pos,!0),this.pos+=2,this.compress=this.datav.getUint32(this.pos,!0),this.pos+=4,this.rawSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.hr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.vr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.colors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.importantColors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.bitPP===16&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var e=this.colors===0?1<<this.bitPP:this.colors;this.palette=new Array(e);for(var t=0;t<e;t++){var n=this.datav.getUint8(this.pos++,!0),r=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0);this.palette[t]={red:i,green:r,blue:n,quad:a}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)},xh.prototype.parseBGR=function(){this.pos=this.offset;try{var e="bit"+this.bitPP,t=this.width*this.height*4;this.data=new Uint8Array(t),this[e]()}catch(n){ma.log("bit decode error:"+n)}},xh.prototype.bit1=function(){var e,t=Math.ceil(this.width/8),n=t%4;for(e=this.height-1;e>=0;e--){for(var r=this.bottom_up?e:this.height-1-e,i=0;i<t;i++)for(var a=this.datav.getUint8(this.pos++,!0),o=r*this.width*4+8*i*4,s=0;s<8&&8*i+s<this.width;s++){var l=this.palette[a>>7-s&1];this.data[o+4*s]=l.blue,this.data[o+4*s+1]=l.green,this.data[o+4*s+2]=l.red,this.data[o+4*s+3]=255}n!==0&&(this.pos+=4-n)}},xh.prototype.bit4=function(){for(var e=Math.ceil(this.width/2),t=e%4,n=this.height-1;n>=0;n--){for(var r=this.bottom_up?n:this.height-1-n,i=0;i<e;i++){var a=this.datav.getUint8(this.pos++,!0),o=r*this.width*4+2*i*4,s=a>>4,l=15&a,c=this.palette[s];if(this.data[o]=c.blue,this.data[o+1]=c.green,this.data[o+2]=c.red,this.data[o+3]=255,2*i+1>=this.width)break;c=this.palette[l],this.data[o+4]=c.blue,this.data[o+4+1]=c.green,this.data[o+4+2]=c.red,this.data[o+4+3]=255}t!==0&&(this.pos+=4-t)}},xh.prototype.bit8=function(){for(var e=this.width%4,t=this.height-1;t>=0;t--){for(var n=this.bottom_up?t:this.height-1-t,r=0;r<this.width;r++){var i=this.datav.getUint8(this.pos++,!0),a=n*this.width*4+4*r;if(i<this.palette.length){var o=this.palette[i];this.data[a]=o.red,this.data[a+1]=o.green,this.data[a+2]=o.blue,this.data[a+3]=255}else this.data[a]=255,this.data[a+1]=255,this.data[a+2]=255,this.data[a+3]=255}e!==0&&(this.pos+=4-e)}},xh.prototype.bit15=function(){for(var e=this.width%3,t=parseInt("11111",2),n=this.height-1;n>=0;n--){for(var r=this.bottom_up?n:this.height-1-n,i=0;i<this.width;i++){var a=this.datav.getUint16(this.pos,!0);this.pos+=2;var o=(a&t)/t*255|0,s=(a>>5&t)/t*255|0,l=(a>>10&t)/t*255|0,c=a>>15?255:0,u=r*this.width*4+4*i;this.data[u]=l,this.data[u+1]=s,this.data[u+2]=o,this.data[u+3]=c}this.pos+=e}},xh.prototype.bit16=function(){for(var e=this.width%3,t=parseInt("11111",2),n=parseInt("111111",2),r=this.height-1;r>=0;r--){for(var i=this.bottom_up?r:this.height-1-r,a=0;a<this.width;a++){var o=this.datav.getUint16(this.pos,!0);this.pos+=2;var s=(o&t)/t*255|0,l=(o>>5&n)/n*255|0,c=(o>>11)/t*255|0,u=i*this.width*4+4*a;this.data[u]=c,this.data[u+1]=l,this.data[u+2]=s,this.data[u+3]=255}this.pos+=e}},xh.prototype.bit24=function(){for(var e=this.height-1;e>=0;e--){for(var t=this.bottom_up?e:this.height-1-e,n=0;n<this.width;n++){var r=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),o=t*this.width*4+4*n;this.data[o]=a,this.data[o+1]=i,this.data[o+2]=r,this.data[o+3]=255}this.pos+=this.width%4}},xh.prototype.bit32=function(){for(var e=this.height-1;e>=0;e--)for(var t=this.bottom_up?e:this.height-1-e,n=0;n<this.width;n++){var r=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),o=this.datav.getUint8(this.pos++,!0),s=t*this.width*4+4*n;this.data[s]=a,this.data[s+1]=i,this.data[s+2]=r,this.data[s+3]=o}},xh.prototype.getData=function(){return this.data},(function(e){e.processBMP=function(t,n,r,i){var a=new xh(t,!1),o=a.width,s=a.height,l={data:a.getData(),width:o,height:s},c=new YH(100).encode(l,100);return e.processJPEG.call(this,c,n,r,i)}})(Wn.API),lwe.prototype.getData=function(){return this.data},(function(e){e.processWEBP=function(t,n,r,i){var a=new lwe(t),o=a.width,s=a.height,l={data:a.getData(),width:o,height:s},c=new YH(100).encode(l,100);return e.processJPEG.call(this,c,n,r,i)}})(Wn.API),Wn.API.processRGBA=function(e,t,n){for(var r=e.data,i=r.length,a=new Uint8Array(i/4*3),o=new Uint8Array(i/4),s=0,l=0,c=0;c<i;c+=4){var u=r[c],f=r[c+1],h=r[c+2],m=r[c+3];a[s++]=u,a[s++]=f,a[s++]=h,o[l++]=m}var p=this.__addimage__.arrayBufferToBinaryString(a);return{alpha:this.__addimage__.arrayBufferToBinaryString(o),data:p,index:t,alias:n,colorSpace:"DeviceRGB",bitsPerComponent:8,width:e.width,height:e.height}},Wn.API.setLanguage=function(e){return this.internal.languageSettings===void 0&&(this.internal.languageSettings={},this.internal.languageSettings.isSubscribed=!1),{af:"Afrikaans",sq:"Albanian",ar:"Arabic (Standard)","ar-DZ":"Arabic (Algeria)","ar-BH":"Arabic (Bahrain)","ar-EG":"Arabic (Egypt)","ar-IQ":"Arabic (Iraq)","ar-JO":"Arabic (Jordan)","ar-KW":"Arabic (Kuwait)","ar-LB":"Arabic (Lebanon)","ar-LY":"Arabic (Libya)","ar-MA":"Arabic (Morocco)","ar-OM":"Arabic (Oman)","ar-QA":"Arabic (Qatar)","ar-SA":"Arabic (Saudi Arabia)","ar-SY":"Arabic (Syria)","ar-TN":"Arabic (Tunisia)","ar-AE":"Arabic (U.A.E.)","ar-YE":"Arabic (Yemen)",an:"Aragonese",hy:"Armenian",as:"Assamese",ast:"Asturian",az:"Azerbaijani",eu:"Basque",be:"Belarusian",bn:"Bengali",bs:"Bosnian",br:"Breton",bg:"Bulgarian",my:"Burmese",ca:"Catalan",ch:"Chamorro",ce:"Chechen",zh:"Chinese","zh-HK":"Chinese (Hong Kong)","zh-CN":"Chinese (PRC)","zh-SG":"Chinese (Singapore)","zh-TW":"Chinese (Taiwan)",cv:"Chuvash",co:"Corsican",cr:"Cree",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch (Standard)","nl-BE":"Dutch (Belgian)",en:"English","en-AU":"English (Australia)","en-BZ":"English (Belize)","en-CA":"English (Canada)","en-IE":"English (Ireland)","en-JM":"English (Jamaica)","en-NZ":"English (New Zealand)","en-PH":"English (Philippines)","en-ZA":"English (South Africa)","en-TT":"English (Trinidad & Tobago)","en-GB":"English (United Kingdom)","en-US":"English (United States)","en-ZW":"English (Zimbabwe)",eo:"Esperanto",et:"Estonian",fo:"Faeroese",fj:"Fijian",fi:"Finnish",fr:"French (Standard)","fr-BE":"French (Belgium)","fr-CA":"French (Canada)","fr-FR":"French (France)","fr-LU":"French (Luxembourg)","fr-MC":"French (Monaco)","fr-CH":"French (Switzerland)",fy:"Frisian",fur:"Friulian",gd:"Gaelic (Scots)","gd-IE":"Gaelic (Irish)",gl:"Galacian",ka:"Georgian",de:"German (Standard)","de-AT":"German (Austria)","de-DE":"German (Germany)","de-LI":"German (Liechtenstein)","de-LU":"German (Luxembourg)","de-CH":"German (Switzerland)",el:"Greek",gu:"Gujurati",ht:"Haitian",he:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",iu:"Inuktitut",ga:"Irish",it:"Italian (Standard)","it-CH":"Italian (Switzerland)",ja:"Japanese",kn:"Kannada",ks:"Kashmiri",kk:"Kazakh",km:"Khmer",ky:"Kirghiz",tlh:"Klingon",ko:"Korean","ko-KP":"Korean (North Korea)","ko-KR":"Korean (South Korea)",la:"Latin",lv:"Latvian",lt:"Lithuanian",lb:"Luxembourgish",mk:"North Macedonia",ms:"Malay",ml:"Malayalam",mt:"Maltese",mi:"Maori",mr:"Marathi",mo:"Moldavian",nv:"Navajo",ng:"Ndonga",ne:"Nepali",no:"Norwegian",nb:"Norwegian (Bokmal)",nn:"Norwegian (Nynorsk)",oc:"Occitan",or:"Oriya",om:"Oromo",fa:"Persian","fa-IR":"Persian/Iran",pl:"Polish",pt:"Portuguese","pt-BR":"Portuguese (Brazil)",pa:"Punjabi","pa-IN":"Punjabi (India)","pa-PK":"Punjabi (Pakistan)",qu:"Quechua",rm:"Rhaeto-Romanic",ro:"Romanian","ro-MO":"Romanian (Moldavia)",ru:"Russian","ru-MO":"Russian (Moldavia)",sz:"Sami (Lappish)",sg:"Sango",sa:"Sanskrit",sc:"Sardinian",sd:"Sindhi",si:"Singhalese",sr:"Serbian",sk:"Slovak",sl:"Slovenian",so:"Somani",sb:"Sorbian",es:"Spanish","es-AR":"Spanish (Argentina)","es-BO":"Spanish (Bolivia)","es-CL":"Spanish (Chile)","es-CO":"Spanish (Colombia)","es-CR":"Spanish (Costa Rica)","es-DO":"Spanish (Dominican Republic)","es-EC":"Spanish (Ecuador)","es-SV":"Spanish (El Salvador)","es-GT":"Spanish (Guatemala)","es-HN":"Spanish (Honduras)","es-MX":"Spanish (Mexico)","es-NI":"Spanish (Nicaragua)","es-PA":"Spanish (Panama)","es-PY":"Spanish (Paraguay)","es-PE":"Spanish (Peru)","es-PR":"Spanish (Puerto Rico)","es-ES":"Spanish (Spain)","es-UY":"Spanish (Uruguay)","es-VE":"Spanish (Venezuela)",sx:"Sutu",sw:"Swahili",sv:"Swedish","sv-FI":"Swedish (Finland)","sv-SV":"Swedish (Sweden)",ta:"Tamil",tt:"Tatar",te:"Teluga",th:"Thai",tig:"Tigre",ts:"Tsonga",tn:"Tswana",tr:"Turkish",tk:"Turkmen",uk:"Ukrainian",hsb:"Upper Sorbian",ur:"Urdu",ve:"Venda",vi:"Vietnamese",vo:"Volapuk",wa:"Walloon",cy:"Welsh",xh:"Xhosa",ji:"Yiddish",zu:"Zulu"}[e]!==void 0&&(this.internal.languageSettings.languageCode=e,this.internal.languageSettings.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){this.internal.write("/Lang ("+this.internal.languageSettings.languageCode+")")}),this.internal.languageSettings.isSubscribed=!0)),this},gw=Wn.API,gB=gw.getCharWidthsArray=function(e,t){var n,r,i=(t=t||{}).font||this.internal.getFont(),a=t.fontSize||this.internal.getFontSize(),o=t.charSpace||this.internal.getCharSpace(),s=t.widths?t.widths:i.metadata.Unicode.widths,l=s.fof?s.fof:1,c=t.kerning?t.kerning:i.metadata.Unicode.kerning,u=c.fof?c.fof:1,f=t.doKerning!==!1,h=0,m=e.length,p=0,A=s[0]||l,v=[];for(n=0;n<m;n++)r=e.charCodeAt(n),typeof i.metadata.widthOfString=="function"?v.push((i.metadata.widthOfGlyph(i.metadata.characterToGlyph(r))+o*(1e3/a)||0)/1e3):(h=f&&Zi(c[r])==="object"&&!isNaN(parseInt(c[r][p],10))?c[r][p]/u:0,v.push((s[r]||A)/l+h)),p=r;return v},Z1e=gw.getStringUnitWidth=function(e,t){var n=(t=t||{}).fontSize||this.internal.getFontSize(),r=t.font||this.internal.getFont(),i=t.charSpace||this.internal.getCharSpace();return gw.processArabic&&(e=gw.processArabic(e)),typeof r.metadata.widthOfString=="function"?r.metadata.widthOfString(e,n,i)/n:gB.apply(this,arguments).reduce(function(a,o){return a+o},0)},J1e=function(e,t,n,r){for(var i=[],a=0,o=e.length,s=0;a!==o&&s+t[a]<n;)s+=t[a],a++;i.push(e.slice(0,a));var l=a;for(s=0;a!==o;)s+t[a]>r&&(i.push(e.slice(l,a)),s=0,l=a),s+=t[a],a++;return l!==a&&i.push(e.slice(l,a)),i},ewe=function(e,t,n){n||(n={});var r,i,a,o,s,l,c,u=[],f=[u],h=n.textIndent||0,m=0,p=0,A=e.split(" "),v=gB.apply(this,[" ",n])[0];if(l=n.lineIndent===-1?A[0].length+2:n.lineIndent||0){var y=Array(l).join(" "),x=[];A.map(function(S){(S=S.split(/\s*\n/)).length>1?x=x.concat(S.map(function(C,N){return(N&&C.length?`
814
814
  `:"")+C})):x.push(S[0])}),A=x,l=Z1e.apply(this,[y,n])}for(a=0,o=A.length;a<o;a++){var k=0;if(r=A[a],l&&r[0]==`
815
- `&&(r=r.substr(1),k=1),h+m+(p=(i=gB.apply(this,[r,n])).reduce(function(S,C){return S+C},0))>t||k){if(p>t){for(s=J1e.apply(this,[r,i,t-(h+m),t]),u.push(s.shift()),u=[s.pop()];s.length;)f.push([s.shift()]);p=i.slice(r.length-(u[0]?u[0].length:0)).reduce(function(S,C){return S+C},0)}else u=[r];f.push(u),h=p+l,m=v}else u.push(r),h+=m+p,m=v}return c=l?function(S,C){return(C?y:"")+S.join(" ")}:function(S){return S.join(" ")},f.map(c)},gw.splitTextToSize=function(e,t,n){var r,i=(n=n||{}).fontSize||this.internal.getFontSize(),a=(function(u){if(u.widths&&u.kerning)return{widths:u.widths,kerning:u.kerning};var f=this.internal.getFont(u.fontName,u.fontStyle),h="Unicode";return f.metadata[h]?{widths:f.metadata[h].widths||{0:1},kerning:f.metadata[h].kerning||{}}:{font:f.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}).call(this,n);r=Array.isArray(e)?e:String(e).split(/\r?\n/);var o=1*this.internal.scaleFactor*t/i;a.textIndent=n.textIndent?1*n.textIndent*this.internal.scaleFactor/i:0,a.lineIndent=n.lineIndent;var s,l,c=[];for(s=0,l=r.length;s<l;s++)c=c.concat(ewe.apply(this,[r[s],o,a]));return c},(function(e){e.__fontmetrics__=e.__fontmetrics__||{};for(var t="0123456789abcdef",n="klmnopqrstuvwxyz",r={},i={},a=0;a<16;a++)r[n[a]]=t[a],i[t[a]]=n[a];var o=function(h){return"0x"+parseInt(h,10).toString(16)},s=e.__fontmetrics__.compress=function(h){var m,p,A,v,y=["{"];for(var x in h){if(m=h[x],isNaN(parseInt(x,10))?p="'"+x+"'":(x=parseInt(x,10),p=(p=o(x).slice(2)).slice(0,-1)+i[p.slice(-1)]),typeof m=="number")m<0?(A=o(m).slice(3),v="-"):(A=o(m).slice(2),v=""),A=v+A.slice(0,-1)+i[A.slice(-1)];else{if(Zi(m)!=="object")throw new Error("Don't know what to do with value type "+Zi(m)+".");A=s(m)}y.push(p+A)}return y.push("}"),y.join("")},l=e.__fontmetrics__.uncompress=function(h){if(typeof h!="string")throw new Error("Invalid argument passed to uncompress.");for(var m,p,A,v,y={},x=1,k=y,S=[],C="",N="",E=h.length-1,D=1;D<E;D+=1)(v=h[D])=="'"?m?(A=m.join(""),m=void 0):m=[]:m?m.push(v):v=="{"?(S.push([k,A]),k={},A=void 0):v=="}"?((p=S.pop())[0][p[1]]=k,A=void 0,k=p[0]):v=="-"?x=-1:A===void 0?r.hasOwnProperty(v)?(C+=r[v],A=parseInt(C,16)*x,x=1,C=""):C+=v:r.hasOwnProperty(v)?(N+=r[v],k[A]=parseInt(N,16)*x,x=1,A=void 0,N=""):N+=v;return y},c={codePages:["WinAnsiEncoding"],WinAnsiEncoding:l("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")},u={Unicode:{Courier:c,"Courier-Bold":c,"Courier-BoldOblique":c,"Courier-Oblique":c,Helvetica:c,"Helvetica-Bold":c,"Helvetica-BoldOblique":c,"Helvetica-Oblique":c,"Times-Roman":c,"Times-Bold":c,"Times-BoldItalic":c,"Times-Italic":c}},f={Unicode:{"Courier-Oblique":l("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-BoldItalic":l("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"),"Helvetica-Bold":l("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),Courier:l("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-BoldOblique":l("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Bold":l("{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}"),Symbol:l("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"),Helvetica:l("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}"),"Helvetica-BoldOblique":l("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),ZapfDingbats:l("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-Bold":l("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Italic":l("{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}fv{17su5tu5qs}fw{17su5tu5qs}}}"),"Times-Roman":l("{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}"),"Helvetica-Oblique":l("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}")}};e.events.push(["addFont",function(h){var m=h.font,p=f.Unicode[m.postScriptName];p&&(m.metadata.Unicode={},m.metadata.Unicode.widths=p.widths,m.metadata.Unicode.kerning=p.kerning);var A=u.Unicode[m.postScriptName];A&&(m.metadata.Unicode.encoding=A,m.encoding=A.codePages[0])}])})(Wn.API),(function(e){var t=function(n){for(var r=n.length,i=new Uint8Array(r),a=0;a<r;a++)i[a]=n.charCodeAt(a);return i};e.API.events.push(["addFont",function(n){var r=void 0,i=n.font,a=n.instance;if(!i.isStandardFont){if(a===void 0)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+i.postScriptName+"').");if(typeof(r=a.existsFileInVFS(i.postScriptName)===!1?a.loadFile(i.postScriptName):a.getFileFromVFS(i.postScriptName))!="string")throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+i.postScriptName+"').");(function(o,s){s=/^\x00\x01\x00\x00/.test(s)?t(s):t(dj(s)),o.metadata=e.API.TTFFont.open(s),o.metadata.Unicode=o.metadata.Unicode||{encoding:{},kerning:{},widths:[]},o.metadata.glyIdsUsed=[0]})(i,r)}}])})(Wn),Wn.API.addSvgAsImage=function(e,t,n,r,i,a,o,s){if(isNaN(t)||isNaN(n))throw ma.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(r)||isNaN(i))throw ma.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var l=document.createElement("canvas");l.width=r,l.height=i;var c=l.getContext("2d");c.fillStyle="#fff",c.fillRect(0,0,l.width,l.height);var u={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},f=this;return(wr.canvg?Promise.resolve(wr.canvg):FH(()=>import("./index.es-V5CGLR91.js"),[])).catch(function(h){return Promise.reject(new Error("Could not load canvg: "+h))}).then(function(h){return h.default?h.default:h}).then(function(h){return h.fromString(c,e,u)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(h){return h.render(u)}).then(function(){f.addImage(l.toDataURL("image/jpeg",1),t,n,r,i,o,s)})},Wn.API.putTotalPages=function(e){var t,n=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(t=new RegExp(e,"g"),n=this.internal.getNumberOfPages()):(t=new RegExp(this.pdfEscape16(e,this.internal.getFont()),"g"),n=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var r=1;r<=this.internal.getNumberOfPages();r++)for(var i=0;i<this.internal.pages[r].length;i++)this.internal.pages[r][i]=this.internal.pages[r][i].replace(t,n);return this},Wn.API.viewerPreferences=function(e,t){var n;e=e||{},t=t||!1;var r,i,a,o={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},s=Object.keys(o),l=[],c=0,u=0,f=0;function h(p,A){var v,y=!1;for(v=0;v<p.length;v+=1)p[v]===A&&(y=!0);return y}if(this.internal.viewerpreferences===void 0&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(o)),this.internal.viewerpreferences.isSubscribed=!1),n=this.internal.viewerpreferences.configuration,e==="reset"||t===!0){var m=s.length;for(f=0;f<m;f+=1)n[s[f]].value=n[s[f]].defaultValue,n[s[f]].explicitSet=!1}if(Zi(e)==="object"){for(i in e)if(a=e[i],h(s,i)&&a!==void 0){if(n[i].type==="boolean"&&typeof a=="boolean")n[i].value=a;else if(n[i].type==="name"&&h(n[i].valueSet,a))n[i].value=a;else if(n[i].type==="integer"&&Number.isInteger(a))n[i].value=a;else if(n[i].type==="array"){for(c=0;c<a.length;c+=1)if(r=!0,a[c].length===1&&typeof a[c][0]=="number")l.push(String(a[c]-1));else if(a[c].length>1){for(u=0;u<a[c].length;u+=1)typeof a[c][u]!="number"&&(r=!1);r===!0&&l.push([a[c][0]-1,a[c][1]-1].join(" "))}n[i].value="["+l.join(" ")+"]"}else n[i].value=n[i].defaultValue;n[i].explicitSet=!0}}return this.internal.viewerpreferences.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){var p,A=[];for(p in n)n[p].explicitSet===!0&&(n[p].type==="name"?A.push("/"+p+" /"+n[p].value):A.push("/"+p+" "+n[p].value));A.length!==0&&this.internal.write(`/ViewerPreferences
815
+ `&&(r=r.substr(1),k=1),h+m+(p=(i=gB.apply(this,[r,n])).reduce(function(S,C){return S+C},0))>t||k){if(p>t){for(s=J1e.apply(this,[r,i,t-(h+m),t]),u.push(s.shift()),u=[s.pop()];s.length;)f.push([s.shift()]);p=i.slice(r.length-(u[0]?u[0].length:0)).reduce(function(S,C){return S+C},0)}else u=[r];f.push(u),h=p+l,m=v}else u.push(r),h+=m+p,m=v}return c=l?function(S,C){return(C?y:"")+S.join(" ")}:function(S){return S.join(" ")},f.map(c)},gw.splitTextToSize=function(e,t,n){var r,i=(n=n||{}).fontSize||this.internal.getFontSize(),a=(function(u){if(u.widths&&u.kerning)return{widths:u.widths,kerning:u.kerning};var f=this.internal.getFont(u.fontName,u.fontStyle),h="Unicode";return f.metadata[h]?{widths:f.metadata[h].widths||{0:1},kerning:f.metadata[h].kerning||{}}:{font:f.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}).call(this,n);r=Array.isArray(e)?e:String(e).split(/\r?\n/);var o=1*this.internal.scaleFactor*t/i;a.textIndent=n.textIndent?1*n.textIndent*this.internal.scaleFactor/i:0,a.lineIndent=n.lineIndent;var s,l,c=[];for(s=0,l=r.length;s<l;s++)c=c.concat(ewe.apply(this,[r[s],o,a]));return c},(function(e){e.__fontmetrics__=e.__fontmetrics__||{};for(var t="0123456789abcdef",n="klmnopqrstuvwxyz",r={},i={},a=0;a<16;a++)r[n[a]]=t[a],i[t[a]]=n[a];var o=function(h){return"0x"+parseInt(h,10).toString(16)},s=e.__fontmetrics__.compress=function(h){var m,p,A,v,y=["{"];for(var x in h){if(m=h[x],isNaN(parseInt(x,10))?p="'"+x+"'":(x=parseInt(x,10),p=(p=o(x).slice(2)).slice(0,-1)+i[p.slice(-1)]),typeof m=="number")m<0?(A=o(m).slice(3),v="-"):(A=o(m).slice(2),v=""),A=v+A.slice(0,-1)+i[A.slice(-1)];else{if(Zi(m)!=="object")throw new Error("Don't know what to do with value type "+Zi(m)+".");A=s(m)}y.push(p+A)}return y.push("}"),y.join("")},l=e.__fontmetrics__.uncompress=function(h){if(typeof h!="string")throw new Error("Invalid argument passed to uncompress.");for(var m,p,A,v,y={},x=1,k=y,S=[],C="",N="",E=h.length-1,D=1;D<E;D+=1)(v=h[D])=="'"?m?(A=m.join(""),m=void 0):m=[]:m?m.push(v):v=="{"?(S.push([k,A]),k={},A=void 0):v=="}"?((p=S.pop())[0][p[1]]=k,A=void 0,k=p[0]):v=="-"?x=-1:A===void 0?r.hasOwnProperty(v)?(C+=r[v],A=parseInt(C,16)*x,x=1,C=""):C+=v:r.hasOwnProperty(v)?(N+=r[v],k[A]=parseInt(N,16)*x,x=1,A=void 0,N=""):N+=v;return y},c={codePages:["WinAnsiEncoding"],WinAnsiEncoding:l("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")},u={Unicode:{Courier:c,"Courier-Bold":c,"Courier-BoldOblique":c,"Courier-Oblique":c,Helvetica:c,"Helvetica-Bold":c,"Helvetica-BoldOblique":c,"Helvetica-Oblique":c,"Times-Roman":c,"Times-Bold":c,"Times-BoldItalic":c,"Times-Italic":c}},f={Unicode:{"Courier-Oblique":l("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-BoldItalic":l("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"),"Helvetica-Bold":l("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),Courier:l("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-BoldOblique":l("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Bold":l("{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}"),Symbol:l("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"),Helvetica:l("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}"),"Helvetica-BoldOblique":l("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),ZapfDingbats:l("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-Bold":l("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Italic":l("{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}fv{17su5tu5qs}fw{17su5tu5qs}}}"),"Times-Roman":l("{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}"),"Helvetica-Oblique":l("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}")}};e.events.push(["addFont",function(h){var m=h.font,p=f.Unicode[m.postScriptName];p&&(m.metadata.Unicode={},m.metadata.Unicode.widths=p.widths,m.metadata.Unicode.kerning=p.kerning);var A=u.Unicode[m.postScriptName];A&&(m.metadata.Unicode.encoding=A,m.encoding=A.codePages[0])}])})(Wn.API),(function(e){var t=function(n){for(var r=n.length,i=new Uint8Array(r),a=0;a<r;a++)i[a]=n.charCodeAt(a);return i};e.API.events.push(["addFont",function(n){var r=void 0,i=n.font,a=n.instance;if(!i.isStandardFont){if(a===void 0)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+i.postScriptName+"').");if(typeof(r=a.existsFileInVFS(i.postScriptName)===!1?a.loadFile(i.postScriptName):a.getFileFromVFS(i.postScriptName))!="string")throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+i.postScriptName+"').");(function(o,s){s=/^\x00\x01\x00\x00/.test(s)?t(s):t(dj(s)),o.metadata=e.API.TTFFont.open(s),o.metadata.Unicode=o.metadata.Unicode||{encoding:{},kerning:{},widths:[]},o.metadata.glyIdsUsed=[0]})(i,r)}}])})(Wn),Wn.API.addSvgAsImage=function(e,t,n,r,i,a,o,s){if(isNaN(t)||isNaN(n))throw ma.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(r)||isNaN(i))throw ma.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var l=document.createElement("canvas");l.width=r,l.height=i;var c=l.getContext("2d");c.fillStyle="#fff",c.fillRect(0,0,l.width,l.height);var u={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},f=this;return(wr.canvg?Promise.resolve(wr.canvg):FH(()=>import("./index.es-X3GYTYe1.js"),[])).catch(function(h){return Promise.reject(new Error("Could not load canvg: "+h))}).then(function(h){return h.default?h.default:h}).then(function(h){return h.fromString(c,e,u)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(h){return h.render(u)}).then(function(){f.addImage(l.toDataURL("image/jpeg",1),t,n,r,i,o,s)})},Wn.API.putTotalPages=function(e){var t,n=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(t=new RegExp(e,"g"),n=this.internal.getNumberOfPages()):(t=new RegExp(this.pdfEscape16(e,this.internal.getFont()),"g"),n=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var r=1;r<=this.internal.getNumberOfPages();r++)for(var i=0;i<this.internal.pages[r].length;i++)this.internal.pages[r][i]=this.internal.pages[r][i].replace(t,n);return this},Wn.API.viewerPreferences=function(e,t){var n;e=e||{},t=t||!1;var r,i,a,o={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},s=Object.keys(o),l=[],c=0,u=0,f=0;function h(p,A){var v,y=!1;for(v=0;v<p.length;v+=1)p[v]===A&&(y=!0);return y}if(this.internal.viewerpreferences===void 0&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(o)),this.internal.viewerpreferences.isSubscribed=!1),n=this.internal.viewerpreferences.configuration,e==="reset"||t===!0){var m=s.length;for(f=0;f<m;f+=1)n[s[f]].value=n[s[f]].defaultValue,n[s[f]].explicitSet=!1}if(Zi(e)==="object"){for(i in e)if(a=e[i],h(s,i)&&a!==void 0){if(n[i].type==="boolean"&&typeof a=="boolean")n[i].value=a;else if(n[i].type==="name"&&h(n[i].valueSet,a))n[i].value=a;else if(n[i].type==="integer"&&Number.isInteger(a))n[i].value=a;else if(n[i].type==="array"){for(c=0;c<a.length;c+=1)if(r=!0,a[c].length===1&&typeof a[c][0]=="number")l.push(String(a[c]-1));else if(a[c].length>1){for(u=0;u<a[c].length;u+=1)typeof a[c][u]!="number"&&(r=!1);r===!0&&l.push([a[c][0]-1,a[c][1]-1].join(" "))}n[i].value="["+l.join(" ")+"]"}else n[i].value=n[i].defaultValue;n[i].explicitSet=!0}}return this.internal.viewerpreferences.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){var p,A=[];for(p in n)n[p].explicitSet===!0&&(n[p].type==="name"?A.push("/"+p+" /"+n[p].value):A.push("/"+p+" "+n[p].value));A.length!==0&&this.internal.write(`/ViewerPreferences
816
816
  <<
817
817
  `+A.join(`
818
818
  `)+`
@@ -1185,4 +1185,4 @@ ${n.map(([a,o])=>{const s=o.theme?.[r]||o.color;return s?` --color-${a}: ${s};`
1185
1185
  `)}
1186
1186
  }
1187
1187
  `).join(`
1188
- `)}}):null},sGn=np;function lGn({active:e,payload:t,className:n,indicator:r="dot",hideLabel:i=!1,hideIndicator:a=!1,label:o,labelFormatter:s,labelClassName:l,formatter:c,color:u,nameKey:f,labelKey:h}){const{config:m}=uot(),p=L.useMemo(()=>{if(i||!t?.length)return null;const[v]=t,y=String(h||v?.dataKey||v?.name||"value"),x=cte(m,v,y),k=!h&&typeof o=="string"?m[o]?.label||o:x?.label;return s?d.jsx("div",{className:_t("font-medium",l),children:s(k,t)}):k?d.jsx("div",{className:_t("font-medium",l),children:k}):null},[o,s,t,i,l,m,h]);if(!e||!t?.length)return null;const A=t.length===1&&r!=="dot";return d.jsxs("div",{className:_t("border-gray-200/50 bg-white grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-gray-200 px-2.5 py-1.5 text-xs shadow-xl dark:border-gray-800/50 dark:bg-gray-950 dark:border-gray-800",n),children:[A?null:p,d.jsx("div",{className:"grid gap-1.5",children:t.map((v,y)=>{const x=String(f||v.name||v.dataKey||"value"),k=cte(m,v,x),S=u||v.payload.fill||v.color;return d.jsx("div",{className:_t("[&>svg]:text-gray-500 flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 dark:[&>svg]:text-gray-400",r==="dot"&&"items-center"),children:c&&v?.value!==void 0&&v.name?c(v.value,v.name,v,y,v.payload):d.jsxs(d.Fragment,{children:[k?.icon?d.jsx(k.icon,{}):!a&&d.jsx("div",{className:_t("shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)",{"h-2.5 w-2.5":r==="dot","w-1":r==="line","w-0 border-[1.5px] border-dashed bg-transparent":r==="dashed","my-0.5":A&&r==="dashed"}),style:{"--color-bg":S,"--color-border":S}}),d.jsxs("div",{className:_t("flex flex-1 justify-between leading-none",A?"items-end":"items-center"),children:[d.jsxs("div",{className:"grid gap-1.5",children:[A?p:null,d.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:k?.label||v.name})]}),v.value&&d.jsx("span",{className:"text-gray-950 font-mono font-medium tabular-nums dark:text-gray-50",children:v.value.toLocaleString()})]})]})},v.dataKey)})})]})}const cGn=ex;function uGn({className:e,hideIcon:t=!1,payload:n,verticalAlign:r="bottom",nameKey:i}){const{config:a}=uot();return n?.length?d.jsx("div",{className:_t("flex items-center justify-center gap-4",r==="top"?"pb-3":"pt-3",e),children:n.map(o=>{const s=String(i||o.dataKey||"value"),l=cte(a,o,s);return d.jsxs("div",{className:_t("[&>svg]:text-gray-500 flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 dark:[&>svg]:text-gray-400"),children:[l?.icon&&!t?d.jsx(l.icon,{}):d.jsx("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:o.color}}),l?.label]},o.value)})}):null}function cte(e,t,n){if(typeof t!="object"||t===null)return;const r="payload"in t&&typeof t.payload=="object"&&t.payload!==null?t.payload:void 0;let i=n;return n in t&&typeof t[n]=="string"?i=t[n]:r&&n in r&&typeof r[n]=="string"&&(i=r[n]),i in e?e[i]:e[n]}function dGn(e){return!e||rs(e)?null:encodeURIComponent(JSON.stringify(e))}const ute="balanceReportFilters",pd={MONTHLY:"Monthly",BI_MONTHLY:"Bi-monthly",QUARTERLY:"Quarterly",SEMI_ANNUALLY:"Semi-Annually",ANNUALLY:"Annually"};function fGn({filter:e,setFilter:t,closeModal:n}){const{control:r,handleSubmit:i,watch:a}=Ar({defaultValues:{...e}}),{selectableBusinesses:o,fetching:s}=Ou(),{selectableFinancialEntities:l,fetching:c}=Fg(),{selectableTags:u,fetching:f}=t6(),h=y=>{t(y),n()},m=a("excludedTags"),p=w.useMemo(()=>u.filter(y=>!m.includes(y.value)),[m,u]),A=a("includedTags"),v=w.useMemo(()=>u.filter(y=>!A.includes(y.value)),[A,u]);return d.jsxs("form",{onSubmit:i(h),children:[d.jsxs(sC,{cols:2,children:[d.jsx(wt,{name:"ownerId",control:r,defaultValue:e?.ownerId,render:({field:y,fieldState:x})=>d.jsx(ri,{...y,data:o,value:y.value,disabled:s,label:"Owners",placeholder:"Scroll to see all options",maxDropdownHeight:160,searchable:!0,error:x.error?.message,withinPortal:!0})}),d.jsx(wt,{name:"fromDate",control:r,defaultValue:e?.fromDate,rules:{pattern:{value:ki,message:"Date must be im format yyyy-mm-dd"}},render:({field:y,fieldState:x})=>d.jsx(Vi,{...y,onChange:k=>{const S=k?typeof k=="string"?k:Rt(k,"yyyy-MM-dd"):void 0;S!==y.value&&y.onChange(S)},value:y.value?new Date(y.value):void 0,error:x.error?.message,label:"From Date",popoverProps:{withinPortal:!0}})}),d.jsx(wt,{name:"toDate",control:r,defaultValue:e?.toDate,rules:{pattern:{value:ki,message:"Date must be im format yyyy-mm-dd"}},render:({field:y,fieldState:x})=>d.jsx(Vi,{...y,onChange:k=>{const S=k?typeof k=="string"?k:Rt(k,"yyyy-MM-dd"):void 0;S!==y.value&&y.onChange(S)},value:y.value?new Date(y.value):void 0,error:x.error?.message,label:"To Date",popoverProps:{withinPortal:!0}})}),d.jsx(wt,{name:"period",control:r,defaultValue:pd.MONTHLY,render:({field:y,fieldState:x})=>d.jsx(ri,{...y,data:Object.values(pd).map(k=>({value:k,label:k})),value:y.value,label:"Period",maxDropdownHeight:160,error:x.error?.message,withinPortal:!0})}),d.jsx(wt,{name:"excludedCounterparties",control:r,defaultValue:e.excludedCounterparties,render:({field:y,fieldState:x})=>d.jsx(ul,{...y,data:l,value:y.value??[],disabled:c,label:"Excluded Counterparties",placeholder:"Scroll to see all options",maxDropdownHeight:160,searchable:!0,error:x.error?.message,withinPortal:!0})}),d.jsx(wt,{name:"includedTags",control:r,defaultValue:e.includedTags,render:({field:y,fieldState:x})=>d.jsx(ul,{...y,data:p,value:y.value??[],disabled:f,label:"Included Tags",placeholder:"Scroll to see all options",maxDropdownHeight:160,searchable:!0,error:x.error?.message,withinPortal:!0})}),d.jsx(wt,{name:"excludedTags",control:r,defaultValue:e.excludedTags,render:({field:y,fieldState:x})=>d.jsx(ul,{...y,data:v,value:y.value??[],disabled:f,label:"Excluded Tags",placeholder:"Scroll to see all options",maxDropdownHeight:160,searchable:!0,error:x.error?.message,withinPortal:!0})})]}),d.jsxs("div",{className:"flex justify-center mt-5 gap-3",children:[d.jsx("button",{type:"submit",disabled:s,className:"text-white bg-indigo-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-indigo-600 rounded-sm text-lg",children:"Filter"}),d.jsx("button",{type:"button",className:"text-white bg-rose-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-rose-600 rounded-sm text-lg",onClick:n,children:"Cancel"})]})]})}function hGn({filter:e,setFilter:t,initiallyOpened:n=!1}){const[r,i]=w.useState(n),[a,o]=w.useState(!!e),{get:s,set:l}=mi();w.useEffect(()=>{const u=dGn(e),f=s(ute);u!==f&&l(ute,u)},[e,s,l]);const c=w.useCallback(u=>{Ed(u,e)||(t(u),o(!!u))},[e,t]);return d.jsxs("div",{className:"flex flex-row gap-5 items-center",children:[d.jsx(Vc,{opened:r,onClose:()=>i(!1),content:d.jsx(fGn,{filter:e,setFilter:c,closeModal:()=>i(!1)}),modalSize:"xl"}),d.jsx(ya,{inline:!0,size:16,disabled:!a,children:d.jsx(Ge,{variant:"outline",size:"icon",className:"size-7.5",onClick:()=>i(!0),children:d.jsx(Ll,{className:"size-5"})})})]})}const mGn=({period:e,transactionIDs:t,onCloseExtendedTransactions:n})=>{const[{data:r,fetching:i}]=rn({query:vFt,variables:{transactionIDs:t}}),a=w.useMemo(()=>r?.transactionsByIDs?t.map(o=>r?.transactionsByIDs.find(s=>s.id===o)).filter(Boolean):[],[r,t]);return d.jsx(os,{className:"mt-5 w-full",children:i?d.jsx(Hc,{}):d.jsxs(d.Fragment,{children:[d.jsx(Lc,{children:d.jsxs(Uc,{className:"flex justify-between",children:[d.jsxs("span",{children:[e," Transactions"]}),d.jsx(Ge,{variant:"link",onClick:n,children:d.jsx(Vx,{className:"h-4 w-4"})})]})}),d.jsx(Gs,{children:d.jsx(oae,{transactionsProps:a})})]})})},RN={income:{label:"Income",color:"rgba(0, 255, 50, 0.5)"},expense:{label:"Expense",color:"rgba(255, 0, 0, 0.5)"},delta:{label:"Delta",color:"rgba(0, 30, 255, 0.5)"},cumulative:{label:"Cumulative Balance",color:"rgba(100, 0, 255, 0.5)"}};function pGn(e,t,n){switch(n){case pd.MONTHLY:{const r=String(t).padStart(2,"0");return`${e}-${r}`}case pd.BI_MONTHLY:{const r=t%2===0?t-1:t,i=String(r).padStart(2,"0");return`${e}-${i}`}case pd.QUARTERLY:{const r=Math.ceil(t/3);return`${e}-Q${r}`}case pd.SEMI_ANNUALLY:{const r=t>6?2:1;return`${e}-H${r}`}case pd.ANNUALLY:return String(e)}}function AGn(e,t){switch(t){case pd.MONTHLY:{const[n,r]=e.split("-");return`${r}/${n}`}case pd.BI_MONTHLY:{const[n,r]=e.split("-"),i=Number(r)+1,a=String(i).padStart(2,"0");return`${r}-${a}/${n}`}case pd.QUARTERLY:{const[n,r]=e.split("-");return`${r}, ${n}`}case pd.SEMI_ANNUALLY:{const[n,r]=e.split("-");return`${r}, ${n}`}case pd.ANNUALLY:return e}}const eIe=_3(Vt.Usd),gGn=()=>{const{setFiltersContext:e}=w.useContext(ta),{userContext:t}=w.useContext(mc),{get:n}=mi(),r=w.useMemo(()=>{const p={ownerId:t?.context.adminBusinessId,toDate:Rt(new Date,"yyyy-MM-dd"),period:pd.MONTHLY,fromDate:Rt(lD(new Date,{years:1}),"yyyy-MM-dd"),excludedCounterparties:[],includedTags:[],excludedTags:[]},A=n(ute);if(A)try{return JSON.parse(decodeURIComponent(A))}catch(v){console.log("Error parsing balance report filters from URL:",v)}return p},[t?.context.adminBusinessId]),[i,a]=w.useState(r),[o,s]=w.useState(void 0),[l,c]=w.useState(Object.keys(RN)),u=w.useMemo(()=>{const{ownerId:p,fromDate:A,toDate:v}=i;return{ownerId:p,fromDate:A,toDate:v}},[i]),[{data:f,fetching:h}]=rn({query:yFt,variables:u,pause:!i});w.useEffect(()=>{e(d.jsxs("div",{className:"flex flex-row gap-x-5",children:[d.jsx(hGn,{filter:i,setFilter:a,initiallyOpened:!i}),d.jsx(UWe,{options:Object.entries(RN).map(([p,A])=>({label:A.label,value:p})),onValueChange:c,defaultValue:l,placeholder:"Select Data Sets",variant:"default",maxCount:1})]})),s(void 0)},[f,h,i,e,a,l]),w.useEffect(()=>{a(p=>({...p,ownerId:t?.context.adminBusinessId}))},[t]);const m=w.useMemo(()=>{if(!f?.transactionsForBalanceReport)return[];const p=new Map;f.transactionsForBalanceReport.map(v=>{if(v.counterparty?.id&&(!v.isFee&&t?.context.financialAccountsBusinessesIds?.includes(v.counterparty.id)||i.excludedCounterparties?.includes(v.counterparty.id))||i.includedTags.length>0&&(!v.charge?.tags||v.charge.tags.length===0||!v.charge.tags.some(k=>i.includedTags.includes(k.id)))||i.excludedTags.length>0&&v.charge?.tags.length&&v.charge.tags.some(k=>i.excludedTags.includes(k.id)))return;const y=pGn(v.year,v.month,i.period);p.has(y)||p.set(y,{income:0,expense:0,delta:0,transactions:[]});const x=p.get(y);v.amountUsd.raw>0?x.income+=v.amountUsd.raw:x.expense+=v.amountUsd.raw,x.delta+=v.amountUsd.raw,x.transactions.push(v)});let A=0;return Array.from(p.entries()).sort((v,y)=>v[0].localeCompare(y[0])).map(([v,y])=>(A+=y.delta,{period:v,income:y.income,expense:y.expense,delta:y.delta,cumulative:A,transactions:y.transactions.sort((x,k)=>Math.abs(k.amountUsd.raw)-Math.abs(x.amountUsd.raw))}))},[f,i.period,i.excludedCounterparties,t?.context.financialAccountsBusinessesIds,i.includedTags,i.excludedTags]);return d.jsx(Pa,{title:"Balance Report",description:"Accounts periodical balance",children:h?d.jsx(Hc,{}):d.jsxs(d.Fragment,{children:[d.jsxs(os,{className:"w-full",children:[d.jsx(Lc,{children:d.jsx(JY,{children:"Click specific period to expand it's transactions data"})}),d.jsx(Gs,{children:d.jsx(aGn,{config:RN,className:"h-150 w-full",children:d.jsxs(rGn,{accessibilityLayer:!0,data:m,onClick:p=>s(p.activeLabel),children:[d.jsx(Kat,{vertical:!1}),d.jsx(G8,{dataKey:"period",tickLine:!1,tickMargin:10,axisLine:!1,tickFormatter:p=>AGn(p,i.period)}),d.jsx(sGn,{content:d.jsx(lGn,{formatter:(p,A,v,y)=>{const x=`bg-[var(--color-${A})]`;return y<2?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:`${x} h-2.5 w-2.5 shrink-0 rounded-[2px]`}),RN[A]?.label||A,d.jsx("div",{className:"ml-auto flex items-baseline gap-0.5 font-mono font-medium tabular-nums text-foreground",children:eIe.format(Number(p))})]}):d.jsxs("div",{className:"mt-1.5 flex basis-full items-center border-t pt-1.5 text-xs font-medium text-foreground",children:[d.jsx("div",{className:`h-2.5 w-2.5 shrink-0 rounded-[2px] mr-2 ${x}`}),RN[A]?.label||A,d.jsx("div",{className:"ml-auto flex items-baseline gap-0.5 font-mono font-medium tabular-nums text-foreground",children:eIe.format(Number(p))})]})}})}),d.jsx(cGn,{content:d.jsx(uGn,{})}),l.includes("income")&&d.jsx(mp,{dataKey:"income",fill:"var(--color-income)",radius:4}),l.includes("expense")&&d.jsx(mp,{dataKey:"expense",fill:"var(--color-expense)",radius:4}),l.includes("delta")&&d.jsx(mp,{dataKey:"delta",fill:"var(--color-delta)",radius:4}),l.includes("cumulative")&&d.jsx(mp,{dataKey:"cumulative",fill:"var(--color-cumulative)",radius:4})]})})})]}),o&&d.jsx(mGn,{period:o,onCloseExtendedTransactions:()=>s(void 0),transactionIDs:m.find(p=>p.period===o)?.transactions.map(p=>p.id)??[]})]})})},vGn=({record:e})=>{const t=$t(O3e,e);return d.jsxs(Dr,{children:[d.jsx(Mt,{children:e.description}),d.jsx(Mt,{children:Rt(new Date(e.purchaseDate),"dd/MM/yyyy")}),d.jsx(Mt,{children:e.activationDate?Rt(new Date(e.activationDate),"dd/MM/yyyy"):void 0}),d.jsx(Mt,{children:t.originalCost?ti(t.originalCost,0):void 0}),d.jsx(Mt,{children:t.reportYearDelta?ti(t.reportYearDelta,0):void 0}),d.jsx(Mt,{children:ti(t.totalDepreciableCosts,0)}),d.jsxs(Mt,{children:[ti(e.statutoryDepreciationRate,0),"%"]}),d.jsx(Mt,{children:e.claimedDepreciationRate?`${ti(e.claimedDepreciationRate,1)}%`:"-"}),d.jsx(Mt,{children:t.reportYearClaimedDepreciation?ti(t.reportYearClaimedDepreciation,0):"-"}),d.jsx(Mt,{children:t.pastYearsAccumulatedDepreciation?ti(t.pastYearsAccumulatedDepreciation,0):"-"}),d.jsx(Mt,{children:t.totalDepreciation?ti(t.totalDepreciation,0):"-"}),d.jsx(Mt,{children:t.netValue?ti(t.netValue,0):"-"})]})};function yGn(e){return!e||rs(e)?null:encodeURIComponent(JSON.stringify(e))}const dte="depreciationReportFilters";function bGn({filter:e,setFilter:t,close:n}){const r=Ar({defaultValues:{...e}}),{control:i,handleSubmit:a}=r,{selectableFinancialEntities:o,fetching:s}=Fg(),l=c=>{t({...c,year:Number(c.year)}),n()};return d.jsx(ii,{...r,children:d.jsxs("form",{onSubmit:a(l),className:"space-y-4",children:[d.jsx(Jt,{name:"year",control:i,rules:{required:"Year is required",validate:c=>{const u=Number(c);return Number.isNaN(u)||u<2e3||u>2100?"Invalid year":!0}},render:({field:c})=>d.jsxs(en,{children:[d.jsx(gn,{children:"Year"}),d.jsx(dn,{children:d.jsx(Ny,{...c,hideControls:!0,decimalScale:0})}),d.jsx(Bn,{})]})}),d.jsx(Jt,{name:"financialEntityId",defaultValue:e?.financialEntityId,control:i,render:({field:c})=>d.jsxs(en,{children:[d.jsx(gn,{children:"Owner"}),d.jsx(_y,{...c,data:o,value:c.value??void 0,disabled:s,placeholder:"Select a financial entity",formPart:!0}),d.jsx(Bn,{})]})}),d.jsx(Uy,{children:d.jsx(Ge,{type:"submit",disabled:s,children:"Filter"})})]})})}function xGn({filter:e,setFilter:t}){const[n,r]=w.useState(!1),{get:i,set:a}=mi();w.useEffect(()=>{const s=yGn(e),l=i(dte);s!==l&&a(dte,s)},[e,i,a]);const o=w.useCallback(s=>{Ed(s,e)||t(s)},[e,t]);return d.jsxs(Ra,{open:n,onOpenChange:r,children:[d.jsx(Ac,{asChild:!0,children:d.jsx(Ge,{variant:"outline",size:"icon",children:d.jsx(Ll,{size:20})})}),d.jsx($a,{className:"sm:max-w-[425px]",children:d.jsx(bGn,{filter:e,setFilter:o,close:()=>r(!1)})})]})}const tIe=({data:e,groupName:t})=>{const n=$t(O3e,e);return d.jsxs(Dr,{className:"font-bold border-b border-black",children:[d.jsx(Mt,{children:t?"Group Total":"Overall Total"}),d.jsx(Mt,{colSpan:2,children:t}),d.jsx(Mt,{children:n.originalCost?ti(n.originalCost,0):void 0}),d.jsx(Mt,{children:n.reportYearDelta?ti(n.reportYearDelta,0):void 0}),d.jsx(Mt,{children:n.totalDepreciableCosts?ti(n.totalDepreciableCosts,0):void 0}),d.jsx(Mt,{}),d.jsx(Mt,{}),d.jsx(Mt,{children:n.reportYearClaimedDepreciation?ti(n.reportYearClaimedDepreciation,0):void 0}),d.jsx(Mt,{children:n.pastYearsAccumulatedDepreciation?ti(n.pastYearsAccumulatedDepreciation,0):void 0}),d.jsx(Mt,{children:n.totalDepreciation?ti(n.totalDepreciation,0):void 0}),d.jsx(Mt,{children:n.netValue?ti(n.netValue,0):void 0})]})},wGn=()=>{const{setFiltersContext:e}=w.useContext(ta),{userContext:t}=w.useContext(mc),{get:n}=mi(),r=w.useMemo(()=>{const c={financialEntityId:t?.context.adminBusinessId,year:new Date().getFullYear()},u=n(dte);if(u)try{return JSON.parse(decodeURIComponent(u))}catch(f){console.error("Failed to parse depreciation report filters from URL",f)}return c},[t?.context.adminBusinessId]),[i,a]=w.useState(r),[{data:o,fetching:s}]=rn({query:bFt,variables:{filters:i}});w.useEffect(()=>{e(d.jsx("div",{className:"flex flex-row gap-x-5",children:d.jsx(xGn,{filter:i,setFilter:a})}))},[i,e,a]);const l=w.useMemo(()=>`Depreciation Report for ${i.year}`,[i.year]);return d.jsx(Pa,{title:"Depreciation Report",description:l,children:s?d.jsx(Hc,{}):d.jsxs(Bu,{children:[d.jsxs(Iu,{children:[d.jsxs(Dr,{className:"font-bold text-xl",children:[d.jsx(Gr,{colSpan:6,className:"text-center border-x",children:"List of Assets and Costs"}),d.jsx(Gr,{colSpan:5,className:"text-center border-x",children:"Depreciation"}),d.jsx(Gr,{className:"text-center border-x",children:"Remaining"})]}),d.jsxs(Dr,{className:"border-b border-black",children:[d.jsx(Gr,{className:"whitespace-normal",children:"Assets List and Descriptions"}),d.jsx(Gr,{className:"whitespace-normal",children:"Date of Purchase"}),d.jsx(Gr,{className:"whitespace-normal",children:"Activation Date"}),d.jsx(Gr,{className:"whitespace-normal",children:"Original Cost"}),d.jsx(Gr,{className:"whitespace-normal",children:"Changes During the Year"}),d.jsx(Gr,{className:"whitespace-normal",children:"Total Depreciable Assets"}),d.jsx(Gr,{className:"whitespace-normal",children:"Statutory Depreciation Rate"}),d.jsx(Gr,{className:"whitespace-normal",children:"Claimed Depreciation Rate"}),d.jsx(Gr,{className:"whitespace-normal",children:"Depreciation Claimed This Year"}),d.jsx(Gr,{className:"whitespace-normal",children:"Previous Tax Years Accumulated Depreciation"}),d.jsx(Gr,{className:"whitespace-normal",children:"Total Depreciation"}),d.jsx(Gr,{className:"whitespace-normal",children:"Net Book Value"})]})]}),d.jsx(ju,{children:o?.depreciationReport&&d.jsxs(d.Fragment,{children:[o.depreciationReport.categories.map((c,u)=>d.jsxs(w.Fragment,{children:[d.jsxs(Dr,{className:"font-bold",children:[d.jsx(Mt,{children:`Category ${u+1}`}),d.jsx(Mt,{colSpan:2,children:c.category.name}),d.jsx(Mt,{colSpan:3}),d.jsxs(Mt,{children:[ti(c.category.percentage,0),"%"]}),d.jsx(Mt,{colSpan:5})]}),c.records.sort((f,h)=>f.purchaseDate.localeCompare(h.purchaseDate)).map(f=>d.jsx(vGn,{record:f},f.id)),d.jsx(tIe,{data:c.summary,groupName:c.category.name})]},c.id)),d.jsx(tIe,{data:o.depreciationReport.summary})]})})]})})},BI=["2020","2021","2022","2023"];function kGn({selectedBusiness:e,setSelectedBusiness:t,selectedYear:n,setSelectedYear:r,referenceYear:i,setReferenceYear:a}){const[o,s]=w.useState(!n||!e),{selectableBusinesses:l,fetching:c}=Ou(),u=w.useMemo(()=>e?l.find(h=>h.value===e)?.label??"":"",[l,e]);return d.jsxs(Ra,{open:o,onOpenChange:s,children:[d.jsx(Ac,{asChild:!0,children:d.jsxs(Ge,{variant:"outline",className:"flex items-center gap-2",children:[d.jsx(Ll,{className:"h-4 w-4"}),"מסננים",d.jsxs("span",{className:"text-xs bg-blue-100 text-blue-800 px-2 py-0.5 rounded-full",children:[u," • ",n]})]})}),d.jsxs($a,{className:"sm:max-w-md",dir:"rtl",children:[d.jsx(us,{children:d.jsxs(ds,{className:"flex items-center gap-2",children:[d.jsx(Ll,{className:"h-5 w-5"}),"מסנני דוח"]})}),d.jsxs("div",{className:"space-y-6 py-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsxs($n,{htmlFor:"business-select",className:"flex items-center gap-2",children:[d.jsx(o5t,{className:"h-4 w-4"}),"בחירת עסק"]}),d.jsx(_y,{onChange:f=>t(f??void 0),data:l,value:e,disabled:c,placeholder:"Scroll to see all options",triggerProps:{className:"w-full"}})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs($n,{htmlFor:"year-select",className:"flex items-center gap-2",children:[d.jsx(Yk,{className:"h-4 w-4"}),"שנת דיווח"]}),d.jsxs(Fo,{value:n,onValueChange:r,children:[d.jsx(To,{id:"year-select",children:d.jsx(Do,{})}),d.jsx(Oo,{children:BI.map(f=>d.jsx(Ja,{value:f,children:f},f))})]}),d.jsxs("p",{className:"text-xs text-gray-500",children:["זמינות נתונים: ",BI.join(", ")]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs($n,{htmlFor:"reference-year-select",className:"flex items-center gap-2",children:[d.jsx(Yk,{className:"h-4 w-4"}),"שנת השוואה"]}),d.jsxs(Fo,{value:i,onValueChange:f=>a(f==="none"?void 0:f),children:[d.jsx(To,{id:"reference-year-select",children:d.jsx(Do,{})}),d.jsxs(Oo,{children:[d.jsx(Ja,{value:"none",children:"ללא"},"none"),BI.map(f=>d.jsx(Ja,{value:f,children:f},f))]})]}),d.jsxs("p",{className:"text-xs text-gray-500",children:["זמינות נתונים: ",BI.join(", ")]})]}),d.jsxs("div",{className:"flex justify-end gap-2 pt-4",children:[d.jsx(Ge,{variant:"outline",onClick:()=>s(!1),children:"ביטול"}),d.jsx(Ge,{onClick:()=>s(!1),children:"אישור"})]})]})]})]})}const co=({label:e,value:t,code:n,referenceValue:r,showEmptyFields:i,showChange:a=!1})=>{const o=u=>i?!0:!s(u),s=u=>!u||u.trim()===""||u==="0"||u==="0.00",l=(u,f)=>{if(!f)return null;const h=v=>Number.parseFloat(v.replace(/[,\s₪]/g,""))||0,m=h(u),p=h(f);return p===0?null:(m-p)/p*100};if(!o(t))return null;const c=a?l(t,r):null;return d.jsxs("div",{className:"flex justify-between items-center py-2 border-b border-gray-200",dir:"rtl",children:[d.jsxs("span",{className:"text-sm text-gray-600",children:[e," ",n&&`(${n})`]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:`font-medium ${s(t)?"text-gray-400":""}`,children:s(t)?"0":t}),c!==null&&d.jsxs("span",{className:`text-xs px-1 py-0.5 rounded ${c>0?"text-green-700 bg-green-100":c<0?"text-red-700 bg-red-100":"text-gray-700 bg-gray-100"}`,children:[c>0?"+":"",c.toFixed(1),"%"]})]})]})},Yo=({codes:e,referenceCodes:t,code:n,showEmptyFields:r})=>{const{value:i,label:a}=w.useMemo(()=>{const s=e.find(l=>l.code===n);return{value:s?.amount||0,label:s?.label||"לא זוהה קוד"}},[e,n]),o=w.useMemo(()=>t?.find(s=>s.code===n)?.amount.toString()||"",[t,n]);return d.jsx(co,{label:a,value:ti(i,0),code:String(n),showChange:!0,showEmptyFields:r,referenceValue:o})},SGn=[{title:"מזומנים ושווי מזומנים",codes:[7110,7120,7150],sumCode:7100},{title:"ניירות ערך",codes:[7215,7225,7230,7290,7295],sumCode:7200},{title:"לקוחות",codes:[7310,7320,7330,7350,7360,7380,7390],sumCode:7300},{title:"חייבים ויתרות חובה",codes:[7410,7420,7430,7440,7450,7461,7462,7470,7490],sumCode:7400},{title:"מסים נדחים לזמן קצר",codes:[7610,7620,7690],sumCode:7600},{title:"הלוואות לזמן קצר",codes:[7711,7712,7720],sumCode:7700},{title:"מלאי",codes:[7805,7810,7815,7820,7825,7830,7840,7850,7860,7870,7890],sumCode:7800}],CGn=[{title:"רכוש קבוע",codes:[8010,8020,8025,8030,8040,8050,8060,8080,8090,8095,8100,8105,8110,8120,8130,8140,8150,8160,8170,8180,8190],sumCode:8e3},{title:"נכסים לא שוטפים מוחזקים למכירה",codes:[8710],sumCode:8700},{title:"הוצאות מראש לזמן ארוך",codes:[8210,8220,8290],sumCode:8200},{title:"השקעות בחברות מוחזקות כלולות ומאוחדות",codes:[8315,8325,8335,8340,8350],sumCode:8300},{title:'השקעות בחברות אחרות כולל ני"ע סחירים מוחזקים לזמן ארוך',codes:[8410,8420,8440,8450,8460,8490],sumCode:8400},{title:"מסים נדחים לזמן ארוך",codes:[8510,8520,8590],sumCode:8500},{title:"הוצאות נדחות ורכוש אחר",codes:[8610,8620,8630,8640,8690],sumCode:8600}],_Gn=[{title:"בנקים והלואות לזמן קצר",codes:[9110,9120,9130,9140,9151,9152,9190],sumCode:9100},{title:"ספקים ונותני שירותים",codes:[9210,9220,9230,9290],sumCode:9200},{title:"זכאים ויתרות זכות",codes:[9310,9320,9330,9340,9350,9360,9370,9410,9420,9431,9432,9435,9440,9450,9460,9470,9480,9490],sumCode:9400},{title:"עתודה למסים נדחים לזמן קצר",codes:[9510,9520,9530],sumCode:9500}],NGn=[{title:"התחייבויות לזמן ארוך",codes:[9605,9610,9620,9631,9632,9640,9650,9660,9670,9690],sumCode:9600},{title:"התחייבויות בשל סיום יחסי עובד-מעביד",codes:[9710,9720,9790],sumCode:9700},{title:"עתודה למסים נדחים לזמן ארוך",codes:[9810,9820,9890],sumCode:9800}],EGn=[{title:"הון עצמי",codes:[9910,9920,9930,9940,9950,9960,9980],sumCode:9900}];function FGn({data:e,referenceData:t,showEmptyFields:n=!1}){const i=$t(Tge,e).balanceSheet||[],o=$t(Tge,t)?.balanceSheet||[];return d.jsx(sS,{value:"balanceSheet",className:"border rounded-md p-4",children:d.jsxs("div",{className:"space-y-6",dir:"rtl",children:[d.jsx("h3",{className:"text-lg font-bold border-b pb-2",children:"נתוני המאזן"}),d.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[d.jsxs("div",{className:"space-y-4",children:[d.jsx("h4",{className:"text-lg font-bold text-blue-800 border-b pb-2",children:"נכסים"}),d.jsx("div",{className:"bg-blue-100 p-4 rounded-md border-2 border-blue-300",children:d.jsx("h5",{className:"font-bold",children:"רכוש שוטף"})}),SGn.map(s=>d.jsxs("div",{className:"bg-blue-50 p-4 rounded-md",children:[d.jsx("h6",{className:"font-bold mb-3",children:s.title}),d.jsxs("div",{className:"space-y-2",children:[s.codes.map(l=>d.jsx(Yo,{codes:i,referenceCodes:o,code:l,showEmptyFields:n},l)),d.jsx("div",{className:"border-2 rounded-md border-gray-300",children:d.jsx(Yo,{codes:i,referenceCodes:o,code:s.sumCode,showEmptyFields:n})})]})]},s.title)),d.jsx("div",{className:"bg-blue-100 p-4 rounded-md border-2 border-blue-300",children:d.jsx(Yo,{codes:i,code:7e3,showEmptyFields:n})}),CGn.map(s=>d.jsxs("div",{className:"bg-blue-50 p-4 rounded-md",children:[d.jsx("h6",{className:"font-bold mb-3",children:s.title}),d.jsxs("div",{className:"space-y-2",children:[s.codes.map(l=>d.jsx(Yo,{codes:i,referenceCodes:o,code:l,showEmptyFields:n},l)),d.jsx("div",{className:"border-2 rounded-md border-gray-300",children:d.jsx(Yo,{codes:i,referenceCodes:o,code:s.sumCode,showEmptyFields:n})})]})]},s.title)),d.jsx("div",{className:"bg-blue-100 p-4 rounded-md border-2 border-blue-300",children:d.jsx(Yo,{codes:i,code:8888,showEmptyFields:n})})]}),d.jsxs("div",{className:"space-y-4",children:[d.jsx("h4",{className:"text-lg font-bold text-red-800 border-b pb-2",children:"התחייבויות והון"}),d.jsx("div",{className:"bg-red-100 p-4 rounded-md border-2 border-red-300",children:d.jsx("h5",{className:"font-bold",children:"התחייבויות שוטפות"})}),_Gn.map(s=>d.jsxs("div",{className:"bg-red-50 p-4 rounded-md",children:[d.jsx("h6",{className:"font-bold mb-3",children:s.title}),d.jsxs("div",{className:"space-y-2",children:[s.codes.map(l=>d.jsx(Yo,{codes:i,referenceCodes:o,code:l,showEmptyFields:n},l)),d.jsx("div",{className:"border-2 rounded-md border-gray-300",children:d.jsx(Yo,{codes:i,referenceCodes:o,code:s.sumCode,showEmptyFields:n})})]})]},s.title)),d.jsx("div",{className:"bg-red-100 p-4 rounded-md border-2 border-red-300",children:d.jsx(Yo,{codes:i,code:9e3,showEmptyFields:n})}),NGn.map(s=>d.jsxs("div",{className:"bg-red-50 p-4 rounded-md",children:[d.jsx("h6",{className:"font-bold mb-3",children:s.title}),d.jsxs("div",{className:"space-y-2",children:[s.codes.map(l=>d.jsx(Yo,{codes:i,referenceCodes:o,code:l,showEmptyFields:n},l)),d.jsx("div",{className:"border-2 rounded-md border-gray-300",children:d.jsx(Yo,{codes:i,referenceCodes:o,code:s.sumCode,showEmptyFields:n})})]})]},s.title)),EGn.map(s=>d.jsxs("div",{className:"bg-green-50 p-4 rounded-md",children:[d.jsx("h5",{className:"font-bold mb-3",children:s.title}),d.jsx("div",{className:"space-y-2",children:s.codes.map(l=>d.jsx(Yo,{codes:i,referenceCodes:o,code:l,showEmptyFields:n},l))})]},s.title)),d.jsx("div",{className:"bg-red-100 p-4 rounded-md border-2 border-red-300",children:d.jsx(Yo,{codes:i,code:9999,showEmptyFields:n})})]})]})]})})}const DGn=e=>{switch(e){case"1":return"תעשייתי";case"2":return"מסחרי";case"3":return"נותני שירותים";case"99":return"הדיווח כולל יותר מעסק אחד";default:return""}},TGn=e=>{switch(e){case tj.Cash:return"מזומן";case tj.Accrual:return"מצטבר";case tj.DollarRegulations:return"לפי תקנות דולריות";default:return""}},OGn=e=>{switch(e){case _ge.Shekels:return"שקלים";case _ge.Dollars:return"דולרים";default:return""}},BGn=e=>{switch(e){case Sge.DoubleEntry:return"כפולה";case Sge.SingleEntry:return"חד-צידית";default:return""}},IGn=e=>{switch(e){case Cge.Computerized:return"ממוחשב";case Cge.Manual:return"ידני";default:return""}},jGn=e=>{switch(e){case A5.Option_1:return"חלופה 1";case A5.Option_2Adjustments:return"התאמות חשבונאיות למי שיישם את חלופה 2 בהוראת ביצוע 7/2010";case A5.Option_3Adjustments:return"התאמות חשבונאיות למי שיישם את חלופה 3 בהוראת ביצוע 7/2010";case A5.None:return"ללא חלופה";default:return""}},PGn=e=>{switch(e){case U0.Unqualified:return"נוסח אחיד (בלתי מסוייג)";case U0.UnqualifiedWithGoingConcern:return"בנוסח אחיד עם הפניית תשומת לב להערת עסק חי";case U0.UnqualifiedWithOtherEmphases:return"בנוסח אחיד עם הפניות תשומת לב אחרת";case U0.Qualified:return"הסתייגות";case U0.Adverse:return"שלילית";case U0.Disclaimer:return"המנעות";case U0.None:return"אין חוות דעת";default:return""}},II=e=>e==null?"":e?"כן":"לא";function MGn({data:e,businessInfo:t}){const{header:n}=$t(gEt,e),r=$t(AEt,t);return d.jsx(sS,{value:"header",className:"border rounded-md p-4",children:d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",dir:"rtl",children:[d.jsxs("div",{className:"space-y-4",children:[d.jsx("h3",{className:"text-lg font-bold border-b pb-2",children:"פרטים מזהים"}),d.jsx(co,{label:"השם הרשום",value:r.name,showEmptyFields:!0}),d.jsx(co,{label:"תיאור העיסוק המדווח",value:n.businessDescription??"",showEmptyFields:!0}),d.jsx(co,{label:"מספר זהות",value:n.idNumber,showEmptyFields:!0}),d.jsx(co,{label:"מספר תיק",value:n.taxFileNumber,showEmptyFields:!0}),d.jsx(co,{label:'תיק מדווח למע"מ',value:n.vatFileNumber??"",showEmptyFields:!0}),d.jsx(co,{label:"מספר תיק ניכויים",value:n.withholdingTaxFileNumber??"",showEmptyFields:!0})]}),d.jsxs("div",{className:"space-y-4",children:[d.jsx("h3",{className:"text-lg font-bold border-b pb-2",children:"פרטי העסק"}),d.jsx(co,{value:DGn(n.businessType),label:"סוג העסק המדווח",showEmptyFields:!0}),d.jsx(co,{label:"שיטת דיווח",value:TGn(n.reportingMethod),showEmptyFields:!0}),n.reportingMethod===tj.DollarRegulations&&d.jsx(co,{label:"מטבע הסכומים",value:OGn(n.currencyType),showEmptyFields:!0}),d.jsx(co,{label:"הסכום באלפים",value:II(n.amountsInThousands),showEmptyFields:!0}),d.jsx(co,{label:"שיטת חשבונאות",value:BGn(n.accountingMethod),showEmptyFields:!0}),d.jsx(co,{label:"הנהלת חשבונות",value:IGn(n.accountingSystem),showEmptyFields:!0}),d.jsx(co,{label:"חייב ברישום תוכנה",value:II(!!n.softwareRegistrationNumber),showEmptyFields:!0}),n.softwareRegistrationNumber&&d.jsx(co,{label:"מספר תעודת רישום",value:n.softwareRegistrationNumber,showEmptyFields:!0}),d.jsx(co,{label:"דוח בגין שותפות",value:II(!!n.isPartnership),showEmptyFields:!0}),n.isPartnership&&d.jsxs(d.Fragment,{children:[d.jsx(co,{label:"מספר שותפים",value:n.partnershipCount?.toString()??"",showEmptyFields:!0}),d.jsx(co,{label:"חלקי ברווחי השותפות",value:`${n.partnershipProfitShare}%`,showEmptyFields:!0})]}),d.jsx(co,{label:"יישום תקני חשבונאות (IFRS)",value:II(!!n.ifrsImplementationYear||!!n.ifrsReportingOption),showEmptyFields:!0}),(!!n.ifrsImplementationYear||!!n.ifrsReportingOption)&&d.jsxs(d.Fragment,{children:[d.jsx(co,{label:"החל משנת המס",value:n.ifrsImplementationYear??"",showEmptyFields:!0}),d.jsx(co,{label:"דווח בחלופה",value:jGn(n.ifrsReportingOption),showEmptyFields:!0})]}),d.jsx(co,{label:"מספר ענף כלכלי של המדווח",value:n.industryCode,showEmptyFields:!0}),d.jsx(co,{label:"חוות דעת המבקר",value:PGn(n.auditOpinionType),showEmptyFields:!0})]})]})})}const RGn=[{title:"הכנסות ממכירות ומתן שירותים",color:"text-blue-700",codes:[1010,1015,1020,1025,1030,1040,1051,1052,1090],sumCode:1e3},{title:"עלות המכירות ומתן השירותים וביצוע עבודות",color:"text-purple-700",codes:[1306,1308,1307,1310,1320,1330,1340,1350,1360,1371,1372,1390,1400,1450],sumCode:1300},{title:"עלויות ייצור ועלויות אצל קבלן בונה",color:"text-rose-700",codes:[2005,2006,2011,2012,2015,2020,2025,2030,2035,2040,2045,2050,2060,2066,2067,2068,2070,2075,2080,2085,2090,2095],sumCode:2e3},{title:"הוצאות מחקר ופיתוח",color:"text-amber-700",codes:[2510,2520,2530,2540,2550,2560,2570,2590],sumCode:2500},{title:"הוצאות מכירה",color:"text-green-700",codes:[3011,3013,3012,3015,3020,3025,3030,3040,3045,3050,3060,3066,3067,3068,3070,3075,3080,3085,3090,3100,3120,3190],sumCode:3e3},{title:"הוצאות הנהלה וכלליות",color:"text-cyan-700",codes:[3511,3513,3512,3515,3520,3530,3535,3540,3545,3550,3560,3566,3567,3568,3570,3575,3580,3590,3595,3600,3610,3620,3625,3631,3632,3640,3650,3660,3665,3680,3685,3690],sumCode:3500},{title:"הוצאות מימון",color:"text-indigo-700",codes:[5010,5020,5025,5030,5040,5050,5051,5090],sumCode:5e3},{title:"הכנסות מימון",color:"text-fuchsia-700",codes:[5110,5121,5122,5130,5150,5160,5190],sumCode:5100},{title:"הכנסות אחרות",color:"text-red-700",codes:[5210,5220,5230,5236,5237,5240,5250,5260,5270,5290],sumCode:5200},{title:"הוצאות אחרות",color:"text-yellow-700",codes:[5310,5320,5330,5390],sumCode:5300}],$Gn=[{title:"מסים על הכנסה",color:"text-sky-700",codes:[5610,5620,5630],sumCode:5600},{title:"ייעוד הרווחים",color:"text-violet-700",codes:[5710],sumCode:5700},{title:"רווח/הפסד אקויטי",color:"text-pink-700",codes:[5810],sumCode:5800}];function LGn({selectedYear:e,referenceYear:t,data:n,referenceData:r,showEmptyFields:i=!1}){const{profitAndLoss:a}=$t(Fge,n),s=$t(Fge,r)?.profitAndLoss||[];return d.jsx(sS,{value:"profitLoss",className:"border rounded-md p-4",children:d.jsxs("div",{className:"space-y-6",dir:"rtl",children:[d.jsxs("div",{className:"flex justify-between items-center",children:[d.jsx("h3",{className:"text-lg font-bold border-b pb-2",children:"נתוני רווח והפסד"}),t&&e!==t&&d.jsxs("span",{className:"text-sm text-blue-600 bg-blue-50 px-2 py-1 rounded",children:["מציג שינויים לעומת ",t]})]}),RGn.map(l=>d.jsxs("div",{className:"bg-gray-50 p-4 rounded-md",children:[d.jsx("h4",{className:`font-bold mb-4 ${l.color}`,children:l.title}),d.jsxs("div",{className:"space-y-2",children:[l.codes.map(c=>d.jsx(Yo,{codes:a,referenceCodes:s,code:c,showEmptyFields:i},c)),d.jsx("div",{className:"border-2 rounded-md border-gray-300",children:d.jsx(Yo,{codes:a,referenceCodes:s,code:l.sumCode,showEmptyFields:i})})]})]},l.title)),d.jsx("div",{className:"bg-emerald-50 p-4 rounded-md border-2 border-emerald-200",children:d.jsx(Yo,{codes:a,referenceCodes:s,code:6666,showEmptyFields:i})}),$Gn.map(l=>d.jsxs("div",{className:"bg-gray-50 p-4 rounded-md",children:[d.jsx("h4",{className:`font-bold mb-4 ${l.color}`,children:l.title}),d.jsxs("div",{className:"space-y-2",children:[l.codes.map(c=>d.jsx(Yo,{codes:a,referenceCodes:s,code:c,showEmptyFields:i},c)),d.jsx("div",{className:"border-2 rounded-md border-gray-300",children:d.jsx(Yo,{codes:a,referenceCodes:s,code:l.sumCode,showEmptyFields:i})})]})]},l.title))]})})}const UGn=[{title:"התאמות חשבונאיות למי שיישם את חלופה 2 בהוראת ביצוע 7/2010 בנושא IFRS",color:"red",codes:[103,104]},{title:"התאמות נדרשות לצרכי מס (הוסף/הפחת)",color:"yellow",codes:[110,120,130,135,140,150,160,170,180,181,182,183,184,190,200,300,310,320,330,350,360],sumCode:370},{title:"התאמות חשבונאיות למי שיישם את חלופה 3 בהוראת ביצוע 7/2010 בנושא IFRS שלא מצאו את ביטויין בהתאמות הנדרשות לצרכי מס",color:"emerald",codes:[383],sumCode:400},{title:"יישום הוראות חוקי מס נוספים",color:"sky",codes:[430,480,490],sumCode:500},{title:"נתונים נוספים",color:"violet",codes:[510,520,530,540,550,570,575,580,585,590]},{title:"בשותפות",color:"pink",codes:[600]}],nIe={red:{header:"text-red-700",sum:"bg-red-50 border-red-200"},yellow:{header:"text-yellow-700",sum:"bg-yellow-50 border-yellow-200"},emerald:{header:"text-emerald-700",sum:"bg-emerald-50 border-emerald-200"},sky:{header:"text-sky-700",sum:"bg-sky-50 border-sky-200"},violet:{header:"text-violet-700",sum:"bg-violet-50 border-violet-200"},pink:{header:"text-pink-700",sum:"bg-pink-50 border-pink-200"}};function zGn({data:e,referenceData:t,showEmptyFields:n=!1}){const{taxAdjustment:r}=$t(Dge,e),a=$t(Dge,t)?.taxAdjustment||[];return d.jsx(sS,{value:"taxAdjustment",className:"border rounded-md p-4",children:d.jsxs("div",{className:"space-y-6",dir:"rtl",children:[d.jsx("h3",{className:"text-lg font-bold border-b pb-2",children:'נתוני דו"ח התאמה למס'}),d.jsx("div",{className:"bg-emerald-50 p-4 rounded-md border-2 border-emerald-200",children:d.jsx(Yo,{codes:r,referenceCodes:a,code:100,showEmptyFields:n})}),UGn.map(o=>{const{header:s,sum:l}=nIe[o.color]||nIe.red;return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"bg-gray-50 p-4 rounded-md",children:[d.jsx("h4",{className:"font-bold mb-4 "+s,children:o.title}),d.jsx("div",{className:"space-y-2",children:o.codes.map(c=>d.jsx(Yo,{codes:r,referenceCodes:a,code:c,showEmptyFields:n},c))})]}),o.sumCode&&d.jsx("div",{className:"p-4 rounded-md border-2 "+l,children:d.jsx(Yo,{codes:r,referenceCodes:a,code:o.sumCode,showEmptyFields:n})})]},o.title)})]})})}function HGn({data:e,referenceData:t,businessInfo:n,selectedYear:r,referenceYear:i}){const a=$t(Oge,e),o=$t(Oge,t),[s,l]=w.useState("header"),[c,u]=w.useState(!0);return d.jsxs("div",{className:"p-4 border-gray-300",dir:"rtl",children:[d.jsxs("div",{className:"flex justify-between items-center mb-4",children:[d.jsx("div",{className:"flex items-center gap-4",children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs(Ge,{variant:c?"outline":"default",size:"sm",onClick:()=>u(!c),className:"flex items-center gap-2",children:[c?d.jsx(Y5t,{className:"h-4 w-4"}):d.jsx(Ene,{className:"h-4 w-4"}),c?"הסתר שדות ריקים":"הצג שדות ריקים"]}),d.jsx("span",{className:"text-sm text-gray-500",children:c?"מציג את כל השדות":"מציג רק שדות עם נתונים"})]})}),d.jsxs("div",{className:"flex gap-2",children:[d.jsxs(Ge,{variant:"outline",className:"flex items-center gap-2",children:[d.jsx(Nne,{className:"h-4 w-4"}),"הורד"]}),d.jsxs(Ge,{variant:"outline",className:"flex items-center gap-2",children:[d.jsx(lIt,{className:"h-4 w-4"}),"שמור"]})]})]}),d.jsxs(xYe,{value:s,onValueChange:l,className:"w-full",children:[d.jsxs(wYe,{className:"grid grid-cols-4 w-full",dir:"rtl",children:[d.jsx(Jw,{value:"header",children:"פרטים מזהים"}),d.jsx(Jw,{value:"profitLoss",children:"רווח והפסד"}),d.jsx(Jw,{value:"taxAdjustment",children:"התאמה למס"}),d.jsx(Jw,{value:"balanceSheet",children:"מאזן"})]}),d.jsx(MGn,{data:a,businessInfo:n}),d.jsx(LGn,{selectedYear:r,referenceYear:i,data:a,referenceData:o,showEmptyFields:c}),d.jsx(zGn,{data:a,referenceData:o,showEmptyFields:c}),d.jsx(FGn,{data:a,referenceData:o,showEmptyFields:c})]})]})}function VGn(){const{setFiltersContext:e}=w.useContext(ta),[t,n]=w.useState(void 0),[r,i]=w.useState(void 0),[a,o]=w.useState(void 0),[{data:s,fetching:l}]=rn({query:xFt,variables:{year:r?Number.parseInt(r,10):0,businessId:t},pause:!r||!t});return w.useEffect(()=>{e(d.jsx("div",{className:"flex flex-row gap-x-5",dir:"rtl",children:d.jsx(kGn,{selectedBusiness:t,setSelectedBusiness:n,selectedYear:r,setSelectedYear:i,referenceYear:a,setReferenceYear:o})}))},[e,t,r,a]),d.jsx("div",{className:"container mx-auto",dir:"rtl",children:d.jsxs(os,{className:"border-2 border-gray-300",children:[d.jsx(Lc,{className:"bg-gray-100 border-b-2 border-gray-300 flex flex-row justify-between items-center",children:d.jsxs("div",{className:"text-center w-full",children:[d.jsx("h1",{className:"text-2xl font-bold",children:'נספח לטופס הדו"ח השנתי ליחיד ולחבר בני אדם'}),d.jsxs("h2",{className:"text-xl",children:["לשנת המס ",r]}),d.jsx("p",{className:"text-sm",children:'נתוני הדוחות הכספיים, מאזן, רווח והפסד ודו"ח ההתאמה למס'})]})}),d.jsx(Gs,{className:"p-0",children:d.jsx(QGn,{fetching:l,data:s,selectedBusiness:t,selectedYear:r,referenceYear:a})})]})})}function QGn({fetching:e,data:t,selectedBusiness:n,selectedYear:r,referenceYear:i}){if(e)return d.jsx("div",{className:"container mx-auto p-8 text-center",dir:"rtl",children:d.jsx("p",{className:"text-lg text-gray-600",children:"טוען נתונים..."})});if(!r||!n)return d.jsx("div",{className:"container mx-auto p-8 text-center",dir:"rtl",children:d.jsx("p",{className:"text-lg text-gray-600",children:"יש לבחור עסק ושנת דיווח"})});const a=t?.shaam6111.data;return a?d.jsx(HGn,{data:a,businessInfo:t.shaam6111.business,selectedBusiness:n,selectedYear:r,referenceYear:i}):d.jsx("div",{className:"container mx-auto p-8 text-center",dir:"rtl",children:d.jsx("p",{className:"text-lg text-gray-600",children:"אין נתונים זמינים עבור העסק והשנה שנבחרו"})})}const rIe=[{id:"key",accessorKey:"key",cell:({row:e})=>d.jsx(Mt,{children:e.original.key}),header:({column:e})=>d.jsxs(Ge,{variant:"ghost",onClick:()=>e.toggleSorting(e.getIsSorted()==="asc"),children:["Key",d.jsx(cd,{})]})},{id:"name",accessorKey:"name",cell:({row:e})=>d.jsx(Mt,{children:e.original.name}),header:({column:e})=>d.jsxs(Ge,{variant:"ghost",onClick:()=>e.toggleSorting(e.getIsSorted()==="asc"),children:["Name",d.jsx(cd,{})]})},{id:"defaultIrsCode",accessorKey:"defaultIrsCode",cell:({row:e})=>d.jsx(Mt,{className:"flex flex-wrap gap-1 p-1",children:e.original.defaultIrsCode&&d.jsx(Ge,{variant:"outline",disabled:!0,className:"p-1 w-15",children:e.original.defaultIrsCode})}),header:"Default IRS Code"},{id:"edit",cell:({row:e})=>d.jsx(Oon,{sortCodeKey:e.original.key,onAdd:e.original.refetchSortCodes})}],qGn=()=>{const[{data:e,fetching:t,error:n},r]=rn({query:wFt}),{setFiltersContext:i}=w.useContext(ta),a=w.useMemo(()=>e?.allSortCodes?.map(l=>({...l,refetchSortCodes:r}))??[],[e?.allSortCodes,r]),o=om({data:a,columns:rIe,getCoreRowModel:am(),getPaginationRowModel:TD(),getSortedRowModel:Cg(),initialState:{pagination:{pageSize:100}}}),s=o.getPageOptions();return w.useEffect(()=>{i(d.jsx("div",{className:"flex items-center justify-end gap-10 space-x-2 py-4",children:d.jsx(QL,{table:o})}))},[i,o,s]),w.useEffect(()=>{n&&(console.error("Error fetching sort codes",n),qe.error("Error",{description:"Error fetching sort codes"}))},[n]),d.jsx(Pa,{title:`Sort Codes (${a.length})`,description:"All sort codes",headerActions:d.jsx(Hon,{onAdd:()=>r()}),children:t?d.jsx("div",{className:"flex flex-row justify-center",children:d.jsx(ai,{className:"h-10 w-10 animate-spin mr-2"})}):d.jsx("div",{className:"flex flex-col gap-4 rounded-md border",children:d.jsxs(Bu,{children:[d.jsx(Iu,{children:o.getHeaderGroups().map(l=>d.jsx(Dr,{children:l.headers.map(c=>d.jsx(Gr,{children:c.isPlaceholder?null:jo(c.column.columnDef.header,c.getContext())},c.id))},l.id))}),d.jsx(ju,{children:o.getRowModel().rows.length===0?d.jsx(Dr,{children:d.jsx(Mt,{colSpan:rIe.length,className:"text-center py-8",children:"No sort codes found"})}):o.getRowModel().rows.map(l=>d.jsx(Dr,{children:l.getVisibleCells().map(c=>d.jsx(Mt,{children:jo(c.column.columnDef.cell,c.getContext())},c.id))},l.id))})]})})})},GGn="addTag",WGn=()=>{const[{fetching:e},t]=qn(OFt),n=w.useCallback(async r=>{const i=`Error adding new tag [${r.tagName}]`,a=`${GGn}-${r.tagName}`;qe.loading("Adding tag",{id:a});try{const o=await t(r);Gn(o,i,a)&&qe.success("Success",{id:a,description:`"${r.tagName}" tag was successfully added`})}catch(o){console.error(`${i}: ${o}`),qe.error("Error",{id:a,description:i,duration:1e5,closeButton:!0})}},[t]);return{fetching:e,addTag:n}},KGn="deleteTag",YGn=()=>{const[{fetching:e},t]=qn(KFt),n=w.useCallback(async r=>{const i=`Error deleting new tag [${r.name}]`,a=`${KGn}-${r.tagId}`;qe.loading(`Deleting tag [${r.name}]`,{id:a});try{const o=await t(r);Gn(o,i,a)&&qe.success("Tag Deleted",{id:a,description:`[${r.name}] tag was successfully removed`})}catch(o){console.error(`${i}: ${o}`),qe.error("Error",{id:a,description:i,duration:1e5,closeButton:!0})}},[t]);return{fetching:e,deleteTag:n}},XGn=()=>{const{setFiltersContext:e}=w.useContext(ta),[t,n]=w.useState(""),[{data:r,fetching:i},a]=rn({query:kFt}),{addTag:o}=WGn(),{deleteTag:s}=YGn();e(null);const l=_Le(r?.allTags??[]),c=w.useCallback(f=>{f.length>2&&o({tagName:f}).then(()=>{a()})},[o,a]),u=w.useCallback((f,h)=>{s({tagId:f,name:h}).then(()=>{a()})},[s,a]);return d.jsx(Pa,{title:"Tags",description:"Manage tags for your bookmarks.",children:i?d.jsx(ai,{className:"h-10 w-10 animate-spin mr-2 self-center"}):d.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[l?.map(f=>d.jsxs("div",{className:"flex items-center gap-2 text-gray-600 mb-2",children:[d.jsxs("div",{className:"w-full mt-1 relative rounded-md shadow-xs",children:[f.namePath?.map((h,m)=>d.jsx("span",{className:"ms-2"},m)),f.name]}),d.jsx(jon,{data:f}),d.jsx(Ge,{variant:"ghost",size:"icon",className:"size-7.5",onClick:()=>u(f.id,f.name),children:d.jsx(Ry,{className:"size-5"})})]},f.id)),d.jsxs("div",{className:"flex justify-start items-center gap-2 text-gray-600 mb-2",children:[d.jsx(kn,{className:"w-80",value:t,onChange:f=>n(f.currentTarget.value),placeholder:"Add new tag",required:!0}),d.jsx(Ge,{variant:"ghost",size:"icon",className:"size-7.5",disabled:t.length<2,onClick:()=>c(t),children:d.jsx(lg,{className:"size-5"})})]})]})})},ZGn="updateTaxCategory",JGn=()=>{const[{fetching:e},t]=qn(jDt),n=w.useCallback(async r=>{const i="Error updating tax category",a=`${ZGn}-${r.taxCategoryId}`;qe.loading("Uploading Tax Category",{id:a});try{const o=await t(r),s=Gn(o,i,a,"updateTaxCategory");if(s)return qe.success("Success",{id:a,description:`${s.updateTaxCategory.name} was updated`}),s.updateTaxCategory}catch(o){console.error(`${i}: ${o}`),qe.error("Error",{id:a,description:i,duration:1e5,closeButton:!0})}},[t]);return{fetching:e,updateTaxCategory:n}};function eWn({taxCategoryId:e,onAdd:t}){const[n,r]=w.useState(!1);return d.jsxs(Ra,{open:n,onOpenChange:r,children:[d.jsx(Ac,{asChild:!0,children:d.jsx(Ge,{variant:"outline",size:"icon",children:d.jsx(Tu,{})})}),d.jsxs($a,{className:"w-[400px] max-w-screen-md",children:[d.jsx(us,{children:d.jsx(ds,{children:"Edit Tax Category"})}),d.jsx(tWn,{taxCategoryId:e,close:()=>r(!1),onAdd:t})]})]})}function tWn({taxCategoryId:e,close:t,onAdd:n}){const[{data:r,fetching:i}]=rn({query:qEt,variables:{id:e}}),a=r?.taxCategory;return!a&&!i&&qe.error("Error",{description:"Couldn'nt find tax category"}),i?d.jsx(ai,{className:"h-10 w-10 animate-spin"}):d.jsx(nWn,{taxCategory:a,close:t,onAdd:n})}function nWn({taxCategory:e,close:t,onAdd:n}){const r=Ar({defaultValues:{sortCode:e.sortCode?.key,name:e.name,irsCode:e.irsCode}}),{handleSubmit:i}=r,[a,o]=w.useState(!1),{updateTaxCategory:s,fetching:l}=JGn(),c=u=>{u.sortCode&&=parseInt(u.sortCode.toString()),s({fields:u,taxCategoryId:e.id}).then(f=>{f?.id&&(n?.(f.id),t())})};return d.jsx(ii,{...r,children:d.jsxs("form",{onSubmit:i(c),children:[d.jsx("div",{className:"flex flex-col gap-4 my-4",children:d.jsx(eKe,{isInsert:!1,formManager:r,setFetching:o})}),d.jsx("div",{className:"flex justify-end mt-4",children:d.jsx(Ge,{type:"submit",disabled:l||a,children:"Update"})})]})})}const rWn=({data:e})=>d.jsx("td",{children:e.name}),iWn=({data:e})=>d.jsx("td",{children:e.sortCode?d.jsxs("span",{children:[e.sortCode?.name," (",e.sortCode?.id,")"]}):"N/A"}),iIe=[{id:"name",accessorKey:"name",cell:({row:e})=>d.jsx(rWn,{data:e.original}),header:({column:e})=>d.jsxs(Ge,{variant:"ghost",onClick:()=>e.toggleSorting(e.getIsSorted()==="asc"),children:["Name",d.jsx(cd,{})]})},{id:"sortCode",accessorKey:"sortCode.key",cell:({row:e})=>d.jsx(iWn,{data:e.original}),header:({column:e})=>d.jsxs(Ge,{variant:"ghost",onClick:()=>e.toggleSorting(e.getIsSorted()==="asc"),children:["Sort Code",d.jsx(cd,{})]})},{id:"edit",cell:({row:e})=>d.jsx(eWn,{taxCategoryId:e.original.id})}],aWn=()=>{const[{data:e,fetching:t,error:n},r]=rn({query:SFt}),{setFiltersContext:i}=w.useContext(ta),a=e?.taxCategories??[],o=om({data:a,columns:iIe,getCoreRowModel:am(),getPaginationRowModel:TD(),getSortedRowModel:Cg(),initialState:{pagination:{pageSize:30}}}),s=o.getPageOptions();return w.useEffect(()=>{i(d.jsx("div",{className:"flex items-center justify-end gap-10 space-x-2 py-4",children:d.jsx("div",{className:"flex items-center justify-between px-2",children:d.jsx(QL,{table:o})})}))},[i,o,s]),w.useEffect(()=>{n&&qe.error("Error",{description:"Error fetching tax categories"})},[n]),d.jsx(Pa,{title:`Tax Categories (${a.length})`,description:"All tax categories",headerActions:d.jsx(Gon,{onAdd:()=>r()}),children:t?d.jsx("div",{className:"flex flex-row justify-center",children:d.jsx(ai,{className:"h-10 w-10 animate-spin mr-2"})}):d.jsx("div",{className:"flex flex-col gap-4 rounded-md border",children:d.jsxs(Bu,{children:[d.jsx(Iu,{children:o.getHeaderGroups().map(l=>d.jsx(Dr,{children:l.headers.map(c=>d.jsx(Gr,{children:c.isPlaceholder?null:jo(c.column.columnDef.header,c.getContext())},c.id))},l.id))}),d.jsx(ju,{children:o.getRowModel().rows.length===0?d.jsx(Dr,{children:d.jsx(Mt,{colSpan:iIe.length,className:"text-center py-8",children:"No tax categories found"})}):o.getRowModel().rows.map(l=>d.jsx(Dr,{children:l.getVisibleCells().map(c=>d.jsx(Mt,{children:jo(c.column.columnDef.cell,c.getContext())},c.id))},l.id))})]})})})};function oWn(){const[e,t]=w.useState(null);return d.jsx(ta.Provider,{value:{filtersContext:e,setFiltersContext:t},children:d.jsx(GFn,{filtersContext:e,children:d.jsxs(RIe,{children:[d.jsx(Lr,{path:"/",element:d.jsx(aFe,{})}),d.jsx(Lr,{path:"charges",element:d.jsx(aFe,{})}),d.jsx(Lr,{path:"missing-info-charges",element:d.jsx(xRn,{})}),d.jsx(Lr,{path:"charges-ledger-validation",element:d.jsx(Adn,{})}),d.jsx(Lr,{path:"charges/:chargeId",element:d.jsx(G9t,{})}),d.jsx(Lr,{path:"businesses",element:d.jsx(fdn,{})}),d.jsx(Lr,{path:"business-trips",element:d.jsx(sdn,{})}),d.jsx(Lr,{path:"business-trips/:businessTripId",element:d.jsx(adn,{})}),d.jsx(Lr,{path:"business-transactions",element:d.jsx(oUt,{})}),d.jsx(Lr,{path:"business-transactions/:businessId",element:d.jsx(qcn,{})}),d.jsxs(Lr,{path:"charts",children:[d.jsx(Lr,{path:"",element:d.jsx(Rgn,{})}),d.jsx(Lr,{path:"monthly-income-expense",element:d.jsx(t2n,{})})]}),d.jsxs(Lr,{path:"documents",children:[d.jsx(Lr,{path:"",element:d.jsx(SRn,{})}),d.jsx(Lr,{path:"issue-documents",element:d.jsx(ORn,{})}),d.jsx(Lr,{path:"issue-document",element:d.jsx(CRn,{})})]}),d.jsx(Lr,{path:"accountant-approvals",element:d.jsx(WFn,{})}),d.jsxs(Lr,{path:"reports",children:[d.jsx(Lr,{path:"trial-balance",element:d.jsx(vMn,{})}),d.jsx(Lr,{path:"conto",element:d.jsx(tMn,{})}),d.jsx(Lr,{path:"vat-monthly",element:d.jsx(nRn,{})}),d.jsx(Lr,{path:"profit-and-loss",element:d.jsx(eFe,{})}),d.jsx(Lr,{path:"profit-and-loss/:year",element:d.jsx(eFe,{})}),d.jsx(Lr,{path:"tax",element:d.jsx(tFe,{})}),d.jsx(Lr,{path:"tax/:year",element:d.jsx(tFe,{})}),d.jsx(Lr,{path:"depreciation",element:d.jsx(wGn,{})}),d.jsx(Lr,{path:"shaam6111",element:d.jsx(VGn,{})}),d.jsx(Lr,{path:"yearly-ledger",element:d.jsx(oRn,{})}),d.jsx(Lr,{path:"corporate-tax-ruling-compliance",element:d.jsx(JEe,{})}),d.jsx(Lr,{path:"corporate-tax-ruling-compliance/:year",element:d.jsx(JEe,{})}),d.jsx(Lr,{path:"balance",element:d.jsx(gGn,{})}),d.jsx(Lr,{path:"validate-reports",element:d.jsx(QMn,{})})]}),d.jsx(Lr,{path:"salaries",element:d.jsx(bRn,{})}),d.jsx(Lr,{path:"tags",element:d.jsx(XGn,{})}),d.jsx(Lr,{path:"tax-categories",element:d.jsx(aWn,{})}),d.jsx(Lr,{path:"sort-codes",element:d.jsx(qGn,{})}),d.jsx(Lr,{path:"*",element:d.jsx(BRn,{})})]})})})}var K8=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},sWn={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},lWn=class{#e=sWn;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},fte=new lWn;function cWn(e){setTimeout(e,0)}var Y8=typeof window>"u"||"Deno"in globalThis;function Nh(){}function uWn(e,t){return typeof e=="function"?e(t):e}function dWn(e){return typeof e=="number"&&e>=0&&e!==1/0}function fWn(e,t){return Math.max(e+(t||0)-Date.now(),0)}function hte(e,t){return typeof e=="function"?e(t):e}function hWn(e,t){return typeof e=="function"?e(t):e}function aIe(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Uce(o,t.options))return!1}else if(!qF(t.queryKey,o))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function oIe(e,t){const{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(QF(t.options.mutationKey)!==QF(a))return!1}else if(!qF(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Uce(e,t){return(t?.queryKeyHashFn||QF)(e)}function QF(e){return JSON.stringify(e,(t,n)=>mte(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function qF(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>qF(e[n],t[n])):!1}var mWn=Object.prototype.hasOwnProperty;function dot(e,t){if(e===t)return e;const n=sIe(e)&&sIe(t);if(!n&&!(mte(e)&&mte(t)))return t;const i=(n?e:Object.keys(e)).length,a=n?t:Object.keys(t),o=a.length,s=n?new Array(o):{};let l=0;for(let c=0;c<o;c++){const u=n?c:a[c],f=e[u],h=t[u];if(f===h){s[u]=f,(n?c<i:mWn.call(e,u))&&l++;continue}if(f===null||h===null||typeof f!="object"||typeof h!="object"){s[u]=h;continue}const m=dot(f,h);s[u]=m,m===f&&l++}return i===o&&l===i?e:s}function sIe(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function mte(e){if(!lIe(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!lIe(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function lIe(e){return Object.prototype.toString.call(e)==="[object Object]"}function pWn(e){return new Promise(t=>{fte.setTimeout(t,e)})}function AWn(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?dot(e,t):t}function gWn(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function vWn(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var zce=Symbol();function fot(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===zce?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var yWn=class extends K8{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!Y8&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},hot=new yWn;function bWn(){let e,t;const n=new Promise((i,a)=>{e=i,t=a});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var xWn=cWn;function wWn(){let e=[],t=0,n=s=>{s()},r=s=>{s()},i=xWn;const a=s=>{t?e.push(s):i(()=>{n(s)})},o=()=>{const s=e;e=[],s.length&&i(()=>{r(()=>{s.forEach(l=>{n(l)})})})};return{batch:s=>{let l;t++;try{l=s()}finally{t--,t||o()}return l},batchCalls:s=>(...l)=>{a(()=>{s(...l)})},schedule:a,setNotifyFunction:s=>{n=s},setBatchNotifyFunction:s=>{r=s},setScheduler:s=>{i=s}}}var Oc=wWn(),kWn=class extends K8{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!Y8&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},q$=new kWn;function SWn(e){return Math.min(1e3*2**e,3e4)}function mot(e){return(e??"online")==="online"?q$.isOnline():!0}var pte=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function pot(e){let t=!1,n=0,r;const i=bWn(),a=()=>i.status!=="pending",o=A=>{if(!a()){const v=new pte(A);h(v),e.onCancel?.(v)}},s=()=>{t=!0},l=()=>{t=!1},c=()=>hot.isFocused()&&(e.networkMode==="always"||q$.isOnline())&&e.canRun(),u=()=>mot(e.networkMode)&&e.canRun(),f=A=>{a()||(r?.(),i.resolve(A))},h=A=>{a()||(r?.(),i.reject(A))},m=()=>new Promise(A=>{r=v=>{(a()||c())&&A(v)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),p=()=>{if(a())return;let A;const v=n===0?e.initialPromise:void 0;try{A=v??e.fn()}catch(y){A=Promise.reject(y)}Promise.resolve(A).then(f).catch(y=>{if(a())return;const x=e.retry??(Y8?0:3),k=e.retryDelay??SWn,S=typeof k=="function"?k(n,y):k,C=x===!0||typeof x=="number"&&n<x||typeof x=="function"&&x(n,y);if(t||!C){h(y);return}n++,e.onFail?.(n,y),pWn(S).then(()=>c()?void 0:m()).then(()=>{t?h(y):p()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:l,canStart:u,start:()=>(u()?p():m().then(p),i)}}var Aot=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),dWn(this.gcTime)&&(this.#e=fte.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Y8?1/0:300*1e3))}clearGcTimeout(){this.#e&&(fte.clearTimeout(this.#e),this.#e=void 0)}},CWn=class extends Aot{#e;#t;#n;#r;#a;#i;#o;constructor(e){super(),this.#o=!1,this.#i=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=cIe(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#i,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=cIe(this.options);t.data!==void 0&&(this.setData(t.data,{updatedAt:t.dataUpdatedAt,manual:!0}),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=AWn(this.state.data,e,this.options);return this.#s({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(Nh).catch(Nh):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>hWn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===zce||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>hte(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!fWn(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#o?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#a?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){const s=this.observers.find(l=>l.options.queryFn);s&&this.setOptions(s.options)}const n=new AbortController,r=s=>{Object.defineProperty(s,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{const s=fot(this.options,t),c=(()=>{const u={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(u),u})();return this.#o=!1,this.options.persister?this.options.persister(s,c,this):s(c)},o=(()=>{const s={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};return r(s),s})();this.options.behavior?.onFetch(o,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#s({type:"fetch",meta:o.fetchOptions?.meta}),this.#a=pot({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:s=>{s instanceof pte&&s.revert&&this.setState({...this.#t,fetchStatus:"idle"}),n.abort()},onFail:(s,l)=>{this.#s({type:"failed",failureCount:s,error:l})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{const s=await this.#a.start();if(s===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(s),this.#n.config.onSuccess?.(s,this),this.#n.config.onSettled?.(s,this.state.error,this),s}catch(s){if(s instanceof pte){if(s.silent)return this.#a.promise;if(s.revert){if(this.state.data===void 0)throw s;return this.state.data}}throw this.#s({type:"error",error:s}),this.#n.config.onError?.(s,this),this.#n.config.onSettled?.(this.state.data,s,this),s}finally{this.scheduleGc()}}#s(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,..._Wn(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,data:e.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?r:void 0,r;case"error":const i=e.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),Oc.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function _Wn(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:mot(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function cIe(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}function uIe(e){return{onFetch:(t,n)=>{const r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[];let s={pages:[],pageParams:[]},l=0;const c=async()=>{let u=!1;const f=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(t.signal.aborted?u=!0:t.signal.addEventListener("abort",()=>{u=!0}),t.signal)})},h=fot(t.options,t.fetchOptions),m=async(p,A,v)=>{if(u)return Promise.reject();if(A==null&&p.pages.length)return Promise.resolve(p);const x=(()=>{const N={client:t.client,queryKey:t.queryKey,pageParam:A,direction:v?"backward":"forward",meta:t.options.meta};return f(N),N})(),k=await h(x),{maxPages:S}=t.options,C=v?vWn:gWn;return{pages:C(p.pages,k,S),pageParams:C(p.pageParams,A,S)}};if(i&&a.length){const p=i==="backward",A=p?NWn:dIe,v={pages:a,pageParams:o},y=A(r,v);s=await m(v,y,p)}else{const p=e??a.length;do{const A=l===0?o[0]??r.initialPageParam:dIe(r,s);if(l>0&&A==null)break;s=await m(s,A),l++}while(l<p)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=c}}}function dIe(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function NWn(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var EWn=class extends Aot{#e;#t;#n;constructor(e){super(),this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#e=[],this.state=e.state||FWn(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(t=>t!==e),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})};this.#n=pot({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(i,a)=>{this.#r({type:"failed",failureCount:i,error:a})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});const n=this.state.status==="pending",r=!this.#n.canStart();try{if(n)t();else{this.#r({type:"pending",variables:e,isPaused:r}),await this.#t.config.onMutate?.(e,this);const a=await this.options.onMutate?.(e);a!==this.state.context&&this.#r({type:"pending",context:a,variables:e,isPaused:r})}const i=await this.#n.start();return await this.#t.config.onSuccess?.(i,e,this.state.context,this),await this.options.onSuccess?.(i,e,this.state.context),await this.#t.config.onSettled?.(i,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(i,null,e,this.state.context),this.#r({type:"success",data:i}),i}catch(i){try{throw await this.#t.config.onError?.(i,e,this.state.context,this),await this.options.onError?.(i,e,this.state.context),await this.#t.config.onSettled?.(void 0,i,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,i,e,this.state.context),i}finally{this.#r({type:"error",error:i})}}finally{this.#t.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Oc.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function FWn(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var DWn=class extends K8{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const r=new EWn({mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=jI(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=jI(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=jI(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(i=>i.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=jI(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Oc.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>oIe(t,n))}findAll(e={}){return this.getAll().filter(t=>oIe(e,t))}notify(e){Oc.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Oc.batch(()=>Promise.all(e.map(t=>t.continue().catch(Nh))))}};function jI(e){return e.options.scope?.id}var TWn=class extends K8{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,i=t.queryHash??Uce(r,t);let a=this.get(i);return a||(a=new CWn({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Oc.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>aIe(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>aIe(e,n)):t}notify(e){Oc.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Oc.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Oc.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},OWn=class{#e;#t;#n;#r;#a;#i;#o;#s;constructor(e={}){this.#e=e.queryCache||new TWn,this.#t=e.mutationCache||new DWn,this.#n=e.defaultOptions||{},this.#r=new Map,this.#a=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#o=hot.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=q$.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(hte(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),a=this.#e.get(r.queryHash)?.state.data,o=uWn(t,a);if(o!==void 0)return this.#e.build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return Oc.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Oc.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return Oc.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Oc.batch(()=>this.#e.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Nh).catch(Nh)}invalidateQueries(e,t={}){return Oc.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Oc.batch(()=>this.#e.findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let a=i.fetch(void 0,n);return n.throwOnError||(a=a.catch(Nh)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(Nh)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(hte(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Nh).catch(Nh)}fetchInfiniteQuery(e){return e.behavior=uIe(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Nh).catch(Nh)}ensureInfiniteQueryData(e){return e.behavior=uIe(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return q$.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(QF(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{qF(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#a.set(QF(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#a.values()],n={};return t.forEach(r=>{qF(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Uce(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===zce&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},BWn=w.createContext(void 0),IWn=({client:e,children:t})=>(w.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),d.jsx(BWn.Provider,{value:e,children:t})),jWn=(e,t,n,r,i,a,o,s)=>{let l=document.documentElement,c=["light","dark"];function u(m){(Array.isArray(e)?e:[e]).forEach(p=>{let A=p==="class",v=A&&a?i.map(y=>a[y]||y):i;A?(l.classList.remove(...v),l.classList.add(a&&a[m]?a[m]:m)):l.setAttribute(p,m)}),f(m)}function f(m){s&&c.includes(m)&&(l.style.colorScheme=m)}function h(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)u(r);else try{let m=localStorage.getItem(t)||n,p=o&&m==="system"?h():m;u(p)}catch{}},PWn=w.createContext(void 0),MWn={setTheme:e=>{},themes:[]},RWn=()=>{var e;return(e=w.useContext(PWn))!=null?e:MWn};w.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:a,value:o,themes:s,nonce:l,scriptProps:c})=>{let u=JSON.stringify([n,t,a,e,s,o,r,i]).slice(1,-1);return w.createElement("script",{...c,suppressHydrationWarning:!0,nonce:typeof window>"u"?l:"",dangerouslySetInnerHTML:{__html:`(${jWn.toString()})(${u})`}})});const $Wn=({...e})=>{const{theme:t="system"}=RWn();return d.jsx(BOt,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-white group-[.toaster]:text-gray-950 group-[.toaster]:border-gray-200 group-[.toaster]:shadow-lg dark:group-[.toaster]:bg-gray-950 dark:group-[.toaster]:text-gray-50 dark:group-[.toaster]:border-gray-800",description:"group-[.toast]:text-gray-500 dark:group-[.toast]:text-gray-400",actionButton:"group-[.toast]:bg-gray-900 group-[.toast]:text-gray-50 font-medium dark:group-[.toast]:bg-gray-50 dark:group-[.toast]:text-gray-900",cancelButton:"group-[.toast]:bg-gray-100 group-[.toast]:text-gray-500 font-medium dark:group-[.toast]:bg-gray-800 dark:group-[.toast]:text-gray-400"}},...e})};var lY=(e,t)=>Xj(e.kind,e,{...e.context,authAttempt:t});function LWn(e){return({client:t,forward:n})=>{var r=new Set,i=gY(),a=gY(),o=new Map;function s(){c=void 0;var f=o;o=new Map,f.forEach(i.next)}function l(f){c=void 0;var h=o;o=new Map,h.forEach((m=>{a.next(ZIe(m,f))}))}var c,u=null;return f=>{function h(){c=Promise.resolve().then((()=>e({mutate(y,x,k){var S=t.createRequestOperation("mutation",fk(y,x),k);return Nte(Z$(1)(bu((C=>C.operation.key===S.key&&S.context._instance===C.operation.context._instance))(AY((()=>{var C=p(S);r.add(C.context._instance),i.next(C)}))(v))))},appendHeaders(y,x){var k=typeof y.context.fetchOptions=="function"?y.context.fetchOptions():y.context.fetchOptions||{};return Xj(y.kind,y,{...y.context,fetchOptions:{...k,headers:{...k.headers,...x}}})}}))).then((y=>{y&&(u=y),s()})).catch((y=>{l(y)}))}h();function m(y){o.set(y.key,lY(y,!0)),u&&!c&&(c=u.refreshAuth().then(s).catch(l))}function p(y){return u?u.addAuthToOperation(y):y}var A=bu(Boolean)(qIe((y=>y.kind==="teardown"?(o.delete(y.key),y):y.context._instance&&r.has(y.context._instance)?y:y.context.authAttempt?p(y):c||!u?(c||h(),o.has(y.key)||o.set(y.key,lY(y,!1)),null):(function(k){return!k.context.authAttempt&&u&&u.willAuthError&&u.willAuthError(k)})(y)?(m(y),null):p(lY(y,!1))))(nE([i.source,f]))),v=n(A);return nE([a.source,bu((y=>!r.has(y.operation.context._instance)&&y.error&&(function(k){return u&&u.didAuthError&&u.didAuthError(k.error,k.operation)})(y)&&!y.operation.context.authAttempt?(m(y.operation),!1):(r.has(y.operation.context._instance)&&r.delete(y.operation.context._instance),!0)))(v)])}}}function UWn({children:e}){const{authService:t}=w.useContext(ND),n=VS(),r=t.isLoggedIn(),i=w.useMemo(()=>t.authToken(),[t]),a=w.useMemo(()=>{if(!r)return null;let o;return o="https://accounter.onrender.com/graphql",Eut({url:o,exchanges:[Cut({onResult(s){if(s.error?.networkError){console.error("Network Error:",s.error.networkError),n("/network-error");return}(s?.error?.graphQLErrors.some(c=>c.extensions?.code==="FORBIDDEN")||s?.error?.response?.status===401)&&n("/login",{state:{message:"You are not authorized to access this page"}})}}),LWn(async s=>({addAuthToOperation(l){return i?s.appendHeaders(l,{Authorization:i}):l},didAuthError(l,c){return l?.response?.status===401||l?.graphQLErrors?.some(u=>u.extensions?.code==="FORBIDDEN")},async refreshAuth(){t.logout()}})),kut]})},[r,n,i,t]);return w.useEffect(()=>{a||n("/login")},[a,n]),a?d.jsx(Dut,{value:a,children:e}):d.jsx(oct,{to:"/login",state:{prevPath:window.location.pathname}})}const zWn=new OWn;function HWn({children:e}){const t=Zoe({palette:{primary:{main:"#556cd6"},secondary:{main:"#19857b"},error:{main:ob.A400}}});return d.jsx(Oje,{withGlobalStyles:!0,theme:{fontFamily:"Roboto, sans-serif",fontSizes:{md:"14"}},children:d.jsxs(T0n,{theme:t,children:[d.jsx(O4n,{}),d.jsx($Wn,{}),d.jsx(nUt,{children:d.jsx(UWn,{children:d.jsx(IWn,{client:zWn,children:d.jsx(rUt,{children:e})})})})]})})}const VWn=document.getElementById("root"),QWn=Bst.createRoot(VWn),qWn=Tct(lct(d.jsx(Lr,{path:"*",element:d.jsx(HWn,{children:d.jsx(oWn,{})}),errorElement:d.jsx("p",{children:"error"})})));QWn.render(d.jsx(w.StrictMode,{children:d.jsx(Hct,{router:qWn})}));export{Zi as _,yu as c,Ni as g,Xn as p};
1188
+ `)}}):null},sGn=np;function lGn({active:e,payload:t,className:n,indicator:r="dot",hideLabel:i=!1,hideIndicator:a=!1,label:o,labelFormatter:s,labelClassName:l,formatter:c,color:u,nameKey:f,labelKey:h}){const{config:m}=uot(),p=L.useMemo(()=>{if(i||!t?.length)return null;const[v]=t,y=String(h||v?.dataKey||v?.name||"value"),x=cte(m,v,y),k=!h&&typeof o=="string"?m[o]?.label||o:x?.label;return s?d.jsx("div",{className:_t("font-medium",l),children:s(k,t)}):k?d.jsx("div",{className:_t("font-medium",l),children:k}):null},[o,s,t,i,l,m,h]);if(!e||!t?.length)return null;const A=t.length===1&&r!=="dot";return d.jsxs("div",{className:_t("border-gray-200/50 bg-white grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-gray-200 px-2.5 py-1.5 text-xs shadow-xl dark:border-gray-800/50 dark:bg-gray-950 dark:border-gray-800",n),children:[A?null:p,d.jsx("div",{className:"grid gap-1.5",children:t.map((v,y)=>{const x=String(f||v.name||v.dataKey||"value"),k=cte(m,v,x),S=u||v.payload.fill||v.color;return d.jsx("div",{className:_t("[&>svg]:text-gray-500 flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 dark:[&>svg]:text-gray-400",r==="dot"&&"items-center"),children:c&&v?.value!==void 0&&v.name?c(v.value,v.name,v,y,v.payload):d.jsxs(d.Fragment,{children:[k?.icon?d.jsx(k.icon,{}):!a&&d.jsx("div",{className:_t("shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)",{"h-2.5 w-2.5":r==="dot","w-1":r==="line","w-0 border-[1.5px] border-dashed bg-transparent":r==="dashed","my-0.5":A&&r==="dashed"}),style:{"--color-bg":S,"--color-border":S}}),d.jsxs("div",{className:_t("flex flex-1 justify-between leading-none",A?"items-end":"items-center"),children:[d.jsxs("div",{className:"grid gap-1.5",children:[A?p:null,d.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:k?.label||v.name})]}),v.value&&d.jsx("span",{className:"text-gray-950 font-mono font-medium tabular-nums dark:text-gray-50",children:v.value.toLocaleString()})]})]})},v.dataKey)})})]})}const cGn=ex;function uGn({className:e,hideIcon:t=!1,payload:n,verticalAlign:r="bottom",nameKey:i}){const{config:a}=uot();return n?.length?d.jsx("div",{className:_t("flex items-center justify-center gap-4",r==="top"?"pb-3":"pt-3",e),children:n.map(o=>{const s=String(i||o.dataKey||"value"),l=cte(a,o,s);return d.jsxs("div",{className:_t("[&>svg]:text-gray-500 flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 dark:[&>svg]:text-gray-400"),children:[l?.icon&&!t?d.jsx(l.icon,{}):d.jsx("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:o.color}}),l?.label]},o.value)})}):null}function cte(e,t,n){if(typeof t!="object"||t===null)return;const r="payload"in t&&typeof t.payload=="object"&&t.payload!==null?t.payload:void 0;let i=n;return n in t&&typeof t[n]=="string"?i=t[n]:r&&n in r&&typeof r[n]=="string"&&(i=r[n]),i in e?e[i]:e[n]}function dGn(e){return!e||rs(e)?null:encodeURIComponent(JSON.stringify(e))}const ute="balanceReportFilters",pd={MONTHLY:"Monthly",BI_MONTHLY:"Bi-monthly",QUARTERLY:"Quarterly",SEMI_ANNUALLY:"Semi-Annually",ANNUALLY:"Annually"};function fGn({filter:e,setFilter:t,closeModal:n}){const{control:r,handleSubmit:i,watch:a}=Ar({defaultValues:{...e}}),{selectableBusinesses:o,fetching:s}=Ou(),{selectableFinancialEntities:l,fetching:c}=Fg(),{selectableTags:u,fetching:f}=t6(),h=y=>{t(y),n()},m=a("excludedTags"),p=w.useMemo(()=>u.filter(y=>!m.includes(y.value)),[m,u]),A=a("includedTags"),v=w.useMemo(()=>u.filter(y=>!A.includes(y.value)),[A,u]);return d.jsxs("form",{onSubmit:i(h),children:[d.jsxs(sC,{cols:2,children:[d.jsx(wt,{name:"ownerId",control:r,defaultValue:e?.ownerId,render:({field:y,fieldState:x})=>d.jsx(ri,{...y,data:o,value:y.value,disabled:s,label:"Owners",placeholder:"Scroll to see all options",maxDropdownHeight:160,searchable:!0,error:x.error?.message,withinPortal:!0})}),d.jsx(wt,{name:"fromDate",control:r,defaultValue:e?.fromDate,rules:{pattern:{value:ki,message:"Date must be im format yyyy-mm-dd"}},render:({field:y,fieldState:x})=>d.jsx(Vi,{...y,onChange:k=>{const S=k?typeof k=="string"?k:Rt(k,"yyyy-MM-dd"):void 0;S!==y.value&&y.onChange(S)},value:y.value?new Date(y.value):void 0,error:x.error?.message,label:"From Date",popoverProps:{withinPortal:!0}})}),d.jsx(wt,{name:"toDate",control:r,defaultValue:e?.toDate,rules:{pattern:{value:ki,message:"Date must be im format yyyy-mm-dd"}},render:({field:y,fieldState:x})=>d.jsx(Vi,{...y,onChange:k=>{const S=k?typeof k=="string"?k:Rt(k,"yyyy-MM-dd"):void 0;S!==y.value&&y.onChange(S)},value:y.value?new Date(y.value):void 0,error:x.error?.message,label:"To Date",popoverProps:{withinPortal:!0}})}),d.jsx(wt,{name:"period",control:r,defaultValue:pd.MONTHLY,render:({field:y,fieldState:x})=>d.jsx(ri,{...y,data:Object.values(pd).map(k=>({value:k,label:k})),value:y.value,label:"Period",maxDropdownHeight:160,error:x.error?.message,withinPortal:!0})}),d.jsx(wt,{name:"excludedCounterparties",control:r,defaultValue:e.excludedCounterparties,render:({field:y,fieldState:x})=>d.jsx(ul,{...y,data:l,value:y.value??[],disabled:c,label:"Excluded Counterparties",placeholder:"Scroll to see all options",maxDropdownHeight:160,searchable:!0,error:x.error?.message,withinPortal:!0})}),d.jsx(wt,{name:"includedTags",control:r,defaultValue:e.includedTags,render:({field:y,fieldState:x})=>d.jsx(ul,{...y,data:p,value:y.value??[],disabled:f,label:"Included Tags",placeholder:"Scroll to see all options",maxDropdownHeight:160,searchable:!0,error:x.error?.message,withinPortal:!0})}),d.jsx(wt,{name:"excludedTags",control:r,defaultValue:e.excludedTags,render:({field:y,fieldState:x})=>d.jsx(ul,{...y,data:v,value:y.value??[],disabled:f,label:"Excluded Tags",placeholder:"Scroll to see all options",maxDropdownHeight:160,searchable:!0,error:x.error?.message,withinPortal:!0})})]}),d.jsxs("div",{className:"flex justify-center mt-5 gap-3",children:[d.jsx("button",{type:"submit",disabled:s,className:"text-white bg-indigo-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-indigo-600 rounded-sm text-lg",children:"Filter"}),d.jsx("button",{type:"button",className:"text-white bg-rose-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-rose-600 rounded-sm text-lg",onClick:n,children:"Cancel"})]})]})}function hGn({filter:e,setFilter:t,initiallyOpened:n=!1}){const[r,i]=w.useState(n),[a,o]=w.useState(!!e),{get:s,set:l}=mi();w.useEffect(()=>{const u=dGn(e),f=s(ute);u!==f&&l(ute,u)},[e,s,l]);const c=w.useCallback(u=>{Ed(u,e)||(t(u),o(!!u))},[e,t]);return d.jsxs("div",{className:"flex flex-row gap-5 items-center",children:[d.jsx(Vc,{opened:r,onClose:()=>i(!1),content:d.jsx(fGn,{filter:e,setFilter:c,closeModal:()=>i(!1)}),modalSize:"xl"}),d.jsx(ya,{inline:!0,size:16,disabled:!a,children:d.jsx(Ge,{variant:"outline",size:"icon",className:"size-7.5",onClick:()=>i(!0),children:d.jsx(Ll,{className:"size-5"})})})]})}const mGn=({period:e,transactionIDs:t,onCloseExtendedTransactions:n})=>{const[{data:r,fetching:i}]=rn({query:vFt,variables:{transactionIDs:t}}),a=w.useMemo(()=>r?.transactionsByIDs?t.map(o=>r?.transactionsByIDs.find(s=>s.id===o)).filter(Boolean):[],[r,t]);return d.jsx(os,{className:"mt-5 w-full",children:i?d.jsx(Hc,{}):d.jsxs(d.Fragment,{children:[d.jsx(Lc,{children:d.jsxs(Uc,{className:"flex justify-between",children:[d.jsxs("span",{children:[e," Transactions"]}),d.jsx(Ge,{variant:"link",onClick:n,children:d.jsx(Vx,{className:"h-4 w-4"})})]})}),d.jsx(Gs,{children:d.jsx(oae,{transactionsProps:a})})]})})},RN={income:{label:"Income",color:"rgba(0, 255, 50, 0.5)"},expense:{label:"Expense",color:"rgba(255, 0, 0, 0.5)"},delta:{label:"Delta",color:"rgba(0, 30, 255, 0.5)"},cumulative:{label:"Cumulative Balance",color:"rgba(100, 0, 255, 0.5)"}};function pGn(e,t,n){switch(n){case pd.MONTHLY:{const r=String(t).padStart(2,"0");return`${e}-${r}`}case pd.BI_MONTHLY:{const r=t%2===0?t-1:t,i=String(r).padStart(2,"0");return`${e}-${i}`}case pd.QUARTERLY:{const r=Math.ceil(t/3);return`${e}-Q${r}`}case pd.SEMI_ANNUALLY:{const r=t>6?2:1;return`${e}-H${r}`}case pd.ANNUALLY:return String(e)}}function AGn(e,t){switch(t){case pd.MONTHLY:{const[n,r]=e.split("-");return`${r}/${n}`}case pd.BI_MONTHLY:{const[n,r]=e.split("-"),i=Number(r)+1,a=String(i).padStart(2,"0");return`${r}-${a}/${n}`}case pd.QUARTERLY:{const[n,r]=e.split("-");return`${r}, ${n}`}case pd.SEMI_ANNUALLY:{const[n,r]=e.split("-");return`${r}, ${n}`}case pd.ANNUALLY:return e}}const eIe=_3(Vt.Usd),gGn=()=>{const{setFiltersContext:e}=w.useContext(ta),{userContext:t}=w.useContext(mc),{get:n}=mi(),r=w.useMemo(()=>{const p={ownerId:t?.context.adminBusinessId,toDate:Rt(new Date,"yyyy-MM-dd"),period:pd.MONTHLY,fromDate:Rt(lD(new Date,{years:1}),"yyyy-MM-dd"),excludedCounterparties:[],includedTags:[],excludedTags:[]},A=n(ute);if(A)try{return JSON.parse(decodeURIComponent(A))}catch(v){console.log("Error parsing balance report filters from URL:",v)}return p},[t?.context.adminBusinessId]),[i,a]=w.useState(r),[o,s]=w.useState(void 0),[l,c]=w.useState(Object.keys(RN)),u=w.useMemo(()=>{const{ownerId:p,fromDate:A,toDate:v}=i;return{ownerId:p,fromDate:A,toDate:v}},[i]),[{data:f,fetching:h}]=rn({query:yFt,variables:u,pause:!i});w.useEffect(()=>{e(d.jsxs("div",{className:"flex flex-row gap-x-5",children:[d.jsx(hGn,{filter:i,setFilter:a,initiallyOpened:!i}),d.jsx(UWe,{options:Object.entries(RN).map(([p,A])=>({label:A.label,value:p})),onValueChange:c,defaultValue:l,placeholder:"Select Data Sets",variant:"default",maxCount:1})]})),s(void 0)},[f,h,i,e,a,l]),w.useEffect(()=>{a(p=>({...p,ownerId:t?.context.adminBusinessId}))},[t]);const m=w.useMemo(()=>{if(!f?.transactionsForBalanceReport)return[];const p=new Map;f.transactionsForBalanceReport.map(v=>{if(v.counterparty?.id&&(!v.isFee&&t?.context.financialAccountsBusinessesIds?.includes(v.counterparty.id)||i.excludedCounterparties?.includes(v.counterparty.id))||i.includedTags.length>0&&(!v.charge?.tags||v.charge.tags.length===0||!v.charge.tags.some(k=>i.includedTags.includes(k.id)))||i.excludedTags.length>0&&v.charge?.tags.length&&v.charge.tags.some(k=>i.excludedTags.includes(k.id)))return;const y=pGn(v.year,v.month,i.period);p.has(y)||p.set(y,{income:0,expense:0,delta:0,transactions:[]});const x=p.get(y);v.amountUsd.raw>0?x.income+=v.amountUsd.raw:x.expense+=v.amountUsd.raw,x.delta+=v.amountUsd.raw,x.transactions.push(v)});let A=0;return Array.from(p.entries()).sort((v,y)=>v[0].localeCompare(y[0])).map(([v,y])=>(A+=y.delta,{period:v,income:y.income,expense:y.expense,delta:y.delta,cumulative:A,transactions:y.transactions.sort((x,k)=>Math.abs(k.amountUsd.raw)-Math.abs(x.amountUsd.raw))}))},[f,i.period,i.excludedCounterparties,t?.context.financialAccountsBusinessesIds,i.includedTags,i.excludedTags]);return d.jsx(Pa,{title:"Balance Report",description:"Accounts periodical balance",children:h?d.jsx(Hc,{}):d.jsxs(d.Fragment,{children:[d.jsxs(os,{className:"w-full",children:[d.jsx(Lc,{children:d.jsx(JY,{children:"Click specific period to expand it's transactions data"})}),d.jsx(Gs,{children:d.jsx(aGn,{config:RN,className:"h-150 w-full",children:d.jsxs(rGn,{accessibilityLayer:!0,data:m,onClick:p=>s(p.activeLabel),children:[d.jsx(Kat,{vertical:!1}),d.jsx(G8,{dataKey:"period",tickLine:!1,tickMargin:10,axisLine:!1,tickFormatter:p=>AGn(p,i.period)}),d.jsx(sGn,{content:d.jsx(lGn,{formatter:(p,A,v,y)=>{const x=`bg-[var(--color-${A})]`;return y<2?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:`${x} h-2.5 w-2.5 shrink-0 rounded-[2px]`}),RN[A]?.label||A,d.jsx("div",{className:"ml-auto flex items-baseline gap-0.5 font-mono font-medium tabular-nums text-foreground",children:eIe.format(Number(p))})]}):d.jsxs("div",{className:"mt-1.5 flex basis-full items-center border-t pt-1.5 text-xs font-medium text-foreground",children:[d.jsx("div",{className:`h-2.5 w-2.5 shrink-0 rounded-[2px] mr-2 ${x}`}),RN[A]?.label||A,d.jsx("div",{className:"ml-auto flex items-baseline gap-0.5 font-mono font-medium tabular-nums text-foreground",children:eIe.format(Number(p))})]})}})}),d.jsx(cGn,{content:d.jsx(uGn,{})}),l.includes("income")&&d.jsx(mp,{dataKey:"income",fill:"var(--color-income)",radius:4}),l.includes("expense")&&d.jsx(mp,{dataKey:"expense",fill:"var(--color-expense)",radius:4}),l.includes("delta")&&d.jsx(mp,{dataKey:"delta",fill:"var(--color-delta)",radius:4}),l.includes("cumulative")&&d.jsx(mp,{dataKey:"cumulative",fill:"var(--color-cumulative)",radius:4})]})})})]}),o&&d.jsx(mGn,{period:o,onCloseExtendedTransactions:()=>s(void 0),transactionIDs:m.find(p=>p.period===o)?.transactions.map(p=>p.id)??[]})]})})},vGn=({record:e})=>{const t=$t(O3e,e);return d.jsxs(Dr,{children:[d.jsx(Mt,{children:e.description}),d.jsx(Mt,{children:Rt(new Date(e.purchaseDate),"dd/MM/yyyy")}),d.jsx(Mt,{children:e.activationDate?Rt(new Date(e.activationDate),"dd/MM/yyyy"):void 0}),d.jsx(Mt,{children:t.originalCost?ti(t.originalCost,0):void 0}),d.jsx(Mt,{children:t.reportYearDelta?ti(t.reportYearDelta,0):void 0}),d.jsx(Mt,{children:ti(t.totalDepreciableCosts,0)}),d.jsxs(Mt,{children:[ti(e.statutoryDepreciationRate,0),"%"]}),d.jsx(Mt,{children:e.claimedDepreciationRate?`${ti(e.claimedDepreciationRate,1)}%`:"-"}),d.jsx(Mt,{children:t.reportYearClaimedDepreciation?ti(t.reportYearClaimedDepreciation,0):"-"}),d.jsx(Mt,{children:t.pastYearsAccumulatedDepreciation?ti(t.pastYearsAccumulatedDepreciation,0):"-"}),d.jsx(Mt,{children:t.totalDepreciation?ti(t.totalDepreciation,0):"-"}),d.jsx(Mt,{children:t.netValue?ti(t.netValue,0):"-"})]})};function yGn(e){return!e||rs(e)?null:encodeURIComponent(JSON.stringify(e))}const dte="depreciationReportFilters";function bGn({filter:e,setFilter:t,close:n}){const r=Ar({defaultValues:{...e}}),{control:i,handleSubmit:a}=r,{selectableFinancialEntities:o,fetching:s}=Fg(),l=c=>{t({...c,year:Number(c.year)}),n()};return d.jsx(ii,{...r,children:d.jsxs("form",{onSubmit:a(l),className:"space-y-4",children:[d.jsx(Jt,{name:"year",control:i,rules:{required:"Year is required",validate:c=>{const u=Number(c);return Number.isNaN(u)||u<2e3||u>2100?"Invalid year":!0}},render:({field:c})=>d.jsxs(en,{children:[d.jsx(gn,{children:"Year"}),d.jsx(dn,{children:d.jsx(Ny,{...c,hideControls:!0,decimalScale:0})}),d.jsx(Bn,{})]})}),d.jsx(Jt,{name:"financialEntityId",defaultValue:e?.financialEntityId,control:i,render:({field:c})=>d.jsxs(en,{children:[d.jsx(gn,{children:"Owner"}),d.jsx(_y,{...c,data:o,value:c.value??void 0,disabled:s,placeholder:"Select a financial entity",formPart:!0}),d.jsx(Bn,{})]})}),d.jsx(Uy,{children:d.jsx(Ge,{type:"submit",disabled:s,children:"Filter"})})]})})}function xGn({filter:e,setFilter:t}){const[n,r]=w.useState(!1),{get:i,set:a}=mi();w.useEffect(()=>{const s=yGn(e),l=i(dte);s!==l&&a(dte,s)},[e,i,a]);const o=w.useCallback(s=>{Ed(s,e)||t(s)},[e,t]);return d.jsxs(Ra,{open:n,onOpenChange:r,children:[d.jsx(Ac,{asChild:!0,children:d.jsx(Ge,{variant:"outline",size:"icon",children:d.jsx(Ll,{size:20})})}),d.jsx($a,{className:"sm:max-w-[425px]",children:d.jsx(bGn,{filter:e,setFilter:o,close:()=>r(!1)})})]})}const tIe=({data:e,groupName:t})=>{const n=$t(O3e,e);return d.jsxs(Dr,{className:"font-bold border-b border-black",children:[d.jsx(Mt,{children:t?"Group Total":"Overall Total"}),d.jsx(Mt,{colSpan:2,children:t}),d.jsx(Mt,{children:n.originalCost?ti(n.originalCost,0):void 0}),d.jsx(Mt,{children:n.reportYearDelta?ti(n.reportYearDelta,0):void 0}),d.jsx(Mt,{children:n.totalDepreciableCosts?ti(n.totalDepreciableCosts,0):void 0}),d.jsx(Mt,{}),d.jsx(Mt,{}),d.jsx(Mt,{children:n.reportYearClaimedDepreciation?ti(n.reportYearClaimedDepreciation,0):void 0}),d.jsx(Mt,{children:n.pastYearsAccumulatedDepreciation?ti(n.pastYearsAccumulatedDepreciation,0):void 0}),d.jsx(Mt,{children:n.totalDepreciation?ti(n.totalDepreciation,0):void 0}),d.jsx(Mt,{children:n.netValue?ti(n.netValue,0):void 0})]})},wGn=()=>{const{setFiltersContext:e}=w.useContext(ta),{userContext:t}=w.useContext(mc),{get:n}=mi(),r=w.useMemo(()=>{const c={financialEntityId:t?.context.adminBusinessId,year:new Date().getFullYear()},u=n(dte);if(u)try{return JSON.parse(decodeURIComponent(u))}catch(f){console.error("Failed to parse depreciation report filters from URL",f)}return c},[t?.context.adminBusinessId]),[i,a]=w.useState(r),[{data:o,fetching:s}]=rn({query:bFt,variables:{filters:i}});w.useEffect(()=>{e(d.jsx("div",{className:"flex flex-row gap-x-5",children:d.jsx(xGn,{filter:i,setFilter:a})}))},[i,e,a]);const l=w.useMemo(()=>`Depreciation Report for ${i.year}`,[i.year]);return d.jsx(Pa,{title:"Depreciation Report",description:l,children:s?d.jsx(Hc,{}):d.jsxs(Bu,{children:[d.jsxs(Iu,{children:[d.jsxs(Dr,{className:"font-bold text-xl",children:[d.jsx(Gr,{colSpan:6,className:"text-center border-x",children:"List of Assets and Costs"}),d.jsx(Gr,{colSpan:5,className:"text-center border-x",children:"Depreciation"}),d.jsx(Gr,{className:"text-center border-x",children:"Remaining"})]}),d.jsxs(Dr,{className:"border-b border-black",children:[d.jsx(Gr,{className:"whitespace-normal",children:"Assets List and Descriptions"}),d.jsx(Gr,{className:"whitespace-normal",children:"Date of Purchase"}),d.jsx(Gr,{className:"whitespace-normal",children:"Activation Date"}),d.jsx(Gr,{className:"whitespace-normal",children:"Original Cost"}),d.jsx(Gr,{className:"whitespace-normal",children:"Changes During the Year"}),d.jsx(Gr,{className:"whitespace-normal",children:"Total Depreciable Assets"}),d.jsx(Gr,{className:"whitespace-normal",children:"Statutory Depreciation Rate"}),d.jsx(Gr,{className:"whitespace-normal",children:"Claimed Depreciation Rate"}),d.jsx(Gr,{className:"whitespace-normal",children:"Depreciation Claimed This Year"}),d.jsx(Gr,{className:"whitespace-normal",children:"Previous Tax Years Accumulated Depreciation"}),d.jsx(Gr,{className:"whitespace-normal",children:"Total Depreciation"}),d.jsx(Gr,{className:"whitespace-normal",children:"Net Book Value"})]})]}),d.jsx(ju,{children:o?.depreciationReport&&d.jsxs(d.Fragment,{children:[o.depreciationReport.categories.map((c,u)=>d.jsxs(w.Fragment,{children:[d.jsxs(Dr,{className:"font-bold",children:[d.jsx(Mt,{children:`Category ${u+1}`}),d.jsx(Mt,{colSpan:2,children:c.category.name}),d.jsx(Mt,{colSpan:3}),d.jsxs(Mt,{children:[ti(c.category.percentage,0),"%"]}),d.jsx(Mt,{colSpan:5})]}),c.records.sort((f,h)=>f.purchaseDate.localeCompare(h.purchaseDate)).map(f=>d.jsx(vGn,{record:f},f.id)),d.jsx(tIe,{data:c.summary,groupName:c.category.name})]},c.id)),d.jsx(tIe,{data:o.depreciationReport.summary})]})})]})})},BI=["2020","2021","2022","2023"];function kGn({selectedBusiness:e,setSelectedBusiness:t,selectedYear:n,setSelectedYear:r,referenceYear:i,setReferenceYear:a}){const[o,s]=w.useState(!n||!e),{selectableBusinesses:l,fetching:c}=Ou(),u=w.useMemo(()=>e?l.find(h=>h.value===e)?.label??"":"",[l,e]);return d.jsxs(Ra,{open:o,onOpenChange:s,children:[d.jsx(Ac,{asChild:!0,children:d.jsxs(Ge,{variant:"outline",className:"flex items-center gap-2",children:[d.jsx(Ll,{className:"h-4 w-4"}),"מסננים",d.jsxs("span",{className:"text-xs bg-blue-100 text-blue-800 px-2 py-0.5 rounded-full",children:[u," • ",n]})]})}),d.jsxs($a,{className:"sm:max-w-md",dir:"rtl",children:[d.jsx(us,{children:d.jsxs(ds,{className:"flex items-center gap-2",children:[d.jsx(Ll,{className:"h-5 w-5"}),"מסנני דוח"]})}),d.jsxs("div",{className:"space-y-6 py-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsxs($n,{htmlFor:"business-select",className:"flex items-center gap-2",children:[d.jsx(o5t,{className:"h-4 w-4"}),"בחירת עסק"]}),d.jsx(_y,{onChange:f=>t(f??void 0),data:l,value:e,disabled:c,placeholder:"Scroll to see all options",triggerProps:{className:"w-full"}})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs($n,{htmlFor:"year-select",className:"flex items-center gap-2",children:[d.jsx(Yk,{className:"h-4 w-4"}),"שנת דיווח"]}),d.jsxs(Fo,{value:n,onValueChange:r,children:[d.jsx(To,{id:"year-select",children:d.jsx(Do,{})}),d.jsx(Oo,{children:BI.map(f=>d.jsx(Ja,{value:f,children:f},f))})]}),d.jsxs("p",{className:"text-xs text-gray-500",children:["זמינות נתונים: ",BI.join(", ")]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs($n,{htmlFor:"reference-year-select",className:"flex items-center gap-2",children:[d.jsx(Yk,{className:"h-4 w-4"}),"שנת השוואה"]}),d.jsxs(Fo,{value:i,onValueChange:f=>a(f==="none"?void 0:f),children:[d.jsx(To,{id:"reference-year-select",children:d.jsx(Do,{})}),d.jsxs(Oo,{children:[d.jsx(Ja,{value:"none",children:"ללא"},"none"),BI.map(f=>d.jsx(Ja,{value:f,children:f},f))]})]}),d.jsxs("p",{className:"text-xs text-gray-500",children:["זמינות נתונים: ",BI.join(", ")]})]}),d.jsxs("div",{className:"flex justify-end gap-2 pt-4",children:[d.jsx(Ge,{variant:"outline",onClick:()=>s(!1),children:"ביטול"}),d.jsx(Ge,{onClick:()=>s(!1),children:"אישור"})]})]})]})]})}const co=({label:e,value:t,code:n,referenceValue:r,showEmptyFields:i,showChange:a=!1})=>{const o=u=>i?!0:!s(u),s=u=>!u||u.trim()===""||u==="0"||u==="0.00",l=(u,f)=>{if(!f)return null;const h=v=>Number.parseFloat(v.replace(/[,\s₪]/g,""))||0,m=h(u),p=h(f);return p===0?null:(m-p)/p*100};if(!o(t))return null;const c=a?l(t,r):null;return d.jsxs("div",{className:"flex justify-between items-center py-2 border-b border-gray-200",dir:"rtl",children:[d.jsxs("span",{className:"text-sm text-gray-600",children:[e," ",n&&`(${n})`]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:`font-medium ${s(t)?"text-gray-400":""}`,children:s(t)?"0":t}),c!==null&&d.jsxs("span",{className:`text-xs px-1 py-0.5 rounded ${c>0?"text-green-700 bg-green-100":c<0?"text-red-700 bg-red-100":"text-gray-700 bg-gray-100"}`,children:[c>0?"+":"",c.toFixed(1),"%"]})]})]})},Yo=({codes:e,referenceCodes:t,code:n,showEmptyFields:r})=>{const{value:i,label:a}=w.useMemo(()=>{const s=e.find(l=>l.code===n);return{value:s?.amount||0,label:s?.label||"לא זוהה קוד"}},[e,n]),o=w.useMemo(()=>t?.find(s=>s.code===n)?.amount.toString()||"",[t,n]);return d.jsx(co,{label:a,value:ti(i,0),code:String(n),showChange:!0,showEmptyFields:r,referenceValue:o})},SGn=[{title:"מזומנים ושווי מזומנים",codes:[7110,7120,7150],sumCode:7100},{title:"ניירות ערך",codes:[7215,7225,7230,7290,7295],sumCode:7200},{title:"לקוחות",codes:[7310,7320,7330,7350,7360,7380,7390],sumCode:7300},{title:"חייבים ויתרות חובה",codes:[7410,7420,7430,7440,7450,7461,7462,7470,7490],sumCode:7400},{title:"מסים נדחים לזמן קצר",codes:[7610,7620,7690],sumCode:7600},{title:"הלוואות לזמן קצר",codes:[7711,7712,7720],sumCode:7700},{title:"מלאי",codes:[7805,7810,7815,7820,7825,7830,7840,7850,7860,7870,7890],sumCode:7800}],CGn=[{title:"רכוש קבוע",codes:[8010,8020,8025,8030,8040,8050,8060,8080,8090,8095,8100,8105,8110,8120,8130,8140,8150,8160,8170,8180,8190],sumCode:8e3},{title:"נכסים לא שוטפים מוחזקים למכירה",codes:[8710],sumCode:8700},{title:"הוצאות מראש לזמן ארוך",codes:[8210,8220,8290],sumCode:8200},{title:"השקעות בחברות מוחזקות כלולות ומאוחדות",codes:[8315,8325,8335,8340,8350],sumCode:8300},{title:'השקעות בחברות אחרות כולל ני"ע סחירים מוחזקים לזמן ארוך',codes:[8410,8420,8440,8450,8460,8490],sumCode:8400},{title:"מסים נדחים לזמן ארוך",codes:[8510,8520,8590],sumCode:8500},{title:"הוצאות נדחות ורכוש אחר",codes:[8610,8620,8630,8640,8690],sumCode:8600}],_Gn=[{title:"בנקים והלואות לזמן קצר",codes:[9110,9120,9130,9140,9151,9152,9190],sumCode:9100},{title:"ספקים ונותני שירותים",codes:[9210,9220,9230,9290],sumCode:9200},{title:"זכאים ויתרות זכות",codes:[9310,9320,9330,9340,9350,9360,9370,9410,9420,9431,9432,9435,9440,9450,9460,9470,9480,9490],sumCode:9400},{title:"עתודה למסים נדחים לזמן קצר",codes:[9510,9520,9530],sumCode:9500}],NGn=[{title:"התחייבויות לזמן ארוך",codes:[9605,9610,9620,9631,9632,9640,9650,9660,9670,9690],sumCode:9600},{title:"התחייבויות בשל סיום יחסי עובד-מעביד",codes:[9710,9720,9790],sumCode:9700},{title:"עתודה למסים נדחים לזמן ארוך",codes:[9810,9820,9890],sumCode:9800}],EGn=[{title:"הון עצמי",codes:[9910,9920,9930,9940,9950,9960,9980],sumCode:9900}];function FGn({data:e,referenceData:t,showEmptyFields:n=!1}){const i=$t(Tge,e).balanceSheet||[],o=$t(Tge,t)?.balanceSheet||[];return d.jsx(sS,{value:"balanceSheet",className:"border rounded-md p-4",children:d.jsxs("div",{className:"space-y-6",dir:"rtl",children:[d.jsx("h3",{className:"text-lg font-bold border-b pb-2",children:"נתוני המאזן"}),d.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[d.jsxs("div",{className:"space-y-4",children:[d.jsx("h4",{className:"text-lg font-bold text-blue-800 border-b pb-2",children:"נכסים"}),d.jsx("div",{className:"bg-blue-100 p-4 rounded-md border-2 border-blue-300",children:d.jsx("h5",{className:"font-bold",children:"רכוש שוטף"})}),SGn.map(s=>d.jsxs("div",{className:"bg-blue-50 p-4 rounded-md",children:[d.jsx("h6",{className:"font-bold mb-3",children:s.title}),d.jsxs("div",{className:"space-y-2",children:[s.codes.map(l=>d.jsx(Yo,{codes:i,referenceCodes:o,code:l,showEmptyFields:n},l)),d.jsx("div",{className:"border-2 rounded-md border-gray-300",children:d.jsx(Yo,{codes:i,referenceCodes:o,code:s.sumCode,showEmptyFields:n})})]})]},s.title)),d.jsx("div",{className:"bg-blue-100 p-4 rounded-md border-2 border-blue-300",children:d.jsx(Yo,{codes:i,code:7e3,showEmptyFields:n})}),CGn.map(s=>d.jsxs("div",{className:"bg-blue-50 p-4 rounded-md",children:[d.jsx("h6",{className:"font-bold mb-3",children:s.title}),d.jsxs("div",{className:"space-y-2",children:[s.codes.map(l=>d.jsx(Yo,{codes:i,referenceCodes:o,code:l,showEmptyFields:n},l)),d.jsx("div",{className:"border-2 rounded-md border-gray-300",children:d.jsx(Yo,{codes:i,referenceCodes:o,code:s.sumCode,showEmptyFields:n})})]})]},s.title)),d.jsx("div",{className:"bg-blue-100 p-4 rounded-md border-2 border-blue-300",children:d.jsx(Yo,{codes:i,code:8888,showEmptyFields:n})})]}),d.jsxs("div",{className:"space-y-4",children:[d.jsx("h4",{className:"text-lg font-bold text-red-800 border-b pb-2",children:"התחייבויות והון"}),d.jsx("div",{className:"bg-red-100 p-4 rounded-md border-2 border-red-300",children:d.jsx("h5",{className:"font-bold",children:"התחייבויות שוטפות"})}),_Gn.map(s=>d.jsxs("div",{className:"bg-red-50 p-4 rounded-md",children:[d.jsx("h6",{className:"font-bold mb-3",children:s.title}),d.jsxs("div",{className:"space-y-2",children:[s.codes.map(l=>d.jsx(Yo,{codes:i,referenceCodes:o,code:l,showEmptyFields:n},l)),d.jsx("div",{className:"border-2 rounded-md border-gray-300",children:d.jsx(Yo,{codes:i,referenceCodes:o,code:s.sumCode,showEmptyFields:n})})]})]},s.title)),d.jsx("div",{className:"bg-red-100 p-4 rounded-md border-2 border-red-300",children:d.jsx(Yo,{codes:i,code:9e3,showEmptyFields:n})}),NGn.map(s=>d.jsxs("div",{className:"bg-red-50 p-4 rounded-md",children:[d.jsx("h6",{className:"font-bold mb-3",children:s.title}),d.jsxs("div",{className:"space-y-2",children:[s.codes.map(l=>d.jsx(Yo,{codes:i,referenceCodes:o,code:l,showEmptyFields:n},l)),d.jsx("div",{className:"border-2 rounded-md border-gray-300",children:d.jsx(Yo,{codes:i,referenceCodes:o,code:s.sumCode,showEmptyFields:n})})]})]},s.title)),EGn.map(s=>d.jsxs("div",{className:"bg-green-50 p-4 rounded-md",children:[d.jsx("h5",{className:"font-bold mb-3",children:s.title}),d.jsx("div",{className:"space-y-2",children:s.codes.map(l=>d.jsx(Yo,{codes:i,referenceCodes:o,code:l,showEmptyFields:n},l))})]},s.title)),d.jsx("div",{className:"bg-red-100 p-4 rounded-md border-2 border-red-300",children:d.jsx(Yo,{codes:i,code:9999,showEmptyFields:n})})]})]})]})})}const DGn=e=>{switch(e){case"1":return"תעשייתי";case"2":return"מסחרי";case"3":return"נותני שירותים";case"99":return"הדיווח כולל יותר מעסק אחד";default:return""}},TGn=e=>{switch(e){case tj.Cash:return"מזומן";case tj.Accrual:return"מצטבר";case tj.DollarRegulations:return"לפי תקנות דולריות";default:return""}},OGn=e=>{switch(e){case _ge.Shekels:return"שקלים";case _ge.Dollars:return"דולרים";default:return""}},BGn=e=>{switch(e){case Sge.DoubleEntry:return"כפולה";case Sge.SingleEntry:return"חד-צידית";default:return""}},IGn=e=>{switch(e){case Cge.Computerized:return"ממוחשב";case Cge.Manual:return"ידני";default:return""}},jGn=e=>{switch(e){case A5.Option_1:return"חלופה 1";case A5.Option_2Adjustments:return"התאמות חשבונאיות למי שיישם את חלופה 2 בהוראת ביצוע 7/2010";case A5.Option_3Adjustments:return"התאמות חשבונאיות למי שיישם את חלופה 3 בהוראת ביצוע 7/2010";case A5.None:return"ללא חלופה";default:return""}},PGn=e=>{switch(e){case U0.Unqualified:return"נוסח אחיד (בלתי מסוייג)";case U0.UnqualifiedWithGoingConcern:return"בנוסח אחיד עם הפניית תשומת לב להערת עסק חי";case U0.UnqualifiedWithOtherEmphases:return"בנוסח אחיד עם הפניות תשומת לב אחרת";case U0.Qualified:return"הסתייגות";case U0.Adverse:return"שלילית";case U0.Disclaimer:return"המנעות";case U0.None:return"אין חוות דעת";default:return""}},II=e=>e==null?"":e?"כן":"לא";function MGn({data:e,businessInfo:t}){const{header:n}=$t(gEt,e),r=$t(AEt,t);return d.jsx(sS,{value:"header",className:"border rounded-md p-4",children:d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",dir:"rtl",children:[d.jsxs("div",{className:"space-y-4",children:[d.jsx("h3",{className:"text-lg font-bold border-b pb-2",children:"פרטים מזהים"}),d.jsx(co,{label:"השם הרשום",value:r.name,showEmptyFields:!0}),d.jsx(co,{label:"תיאור העיסוק המדווח",value:n.businessDescription??"",showEmptyFields:!0}),d.jsx(co,{label:"מספר זהות",value:n.idNumber,showEmptyFields:!0}),d.jsx(co,{label:"מספר תיק",value:n.taxFileNumber,showEmptyFields:!0}),d.jsx(co,{label:'תיק מדווח למע"מ',value:n.vatFileNumber??"",showEmptyFields:!0}),d.jsx(co,{label:"מספר תיק ניכויים",value:n.withholdingTaxFileNumber??"",showEmptyFields:!0})]}),d.jsxs("div",{className:"space-y-4",children:[d.jsx("h3",{className:"text-lg font-bold border-b pb-2",children:"פרטי העסק"}),d.jsx(co,{value:DGn(n.businessType),label:"סוג העסק המדווח",showEmptyFields:!0}),d.jsx(co,{label:"שיטת דיווח",value:TGn(n.reportingMethod),showEmptyFields:!0}),n.reportingMethod===tj.DollarRegulations&&d.jsx(co,{label:"מטבע הסכומים",value:OGn(n.currencyType),showEmptyFields:!0}),d.jsx(co,{label:"הסכום באלפים",value:II(n.amountsInThousands),showEmptyFields:!0}),d.jsx(co,{label:"שיטת חשבונאות",value:BGn(n.accountingMethod),showEmptyFields:!0}),d.jsx(co,{label:"הנהלת חשבונות",value:IGn(n.accountingSystem),showEmptyFields:!0}),d.jsx(co,{label:"חייב ברישום תוכנה",value:II(!!n.softwareRegistrationNumber),showEmptyFields:!0}),n.softwareRegistrationNumber&&d.jsx(co,{label:"מספר תעודת רישום",value:n.softwareRegistrationNumber,showEmptyFields:!0}),d.jsx(co,{label:"דוח בגין שותפות",value:II(!!n.isPartnership),showEmptyFields:!0}),n.isPartnership&&d.jsxs(d.Fragment,{children:[d.jsx(co,{label:"מספר שותפים",value:n.partnershipCount?.toString()??"",showEmptyFields:!0}),d.jsx(co,{label:"חלקי ברווחי השותפות",value:`${n.partnershipProfitShare}%`,showEmptyFields:!0})]}),d.jsx(co,{label:"יישום תקני חשבונאות (IFRS)",value:II(!!n.ifrsImplementationYear||!!n.ifrsReportingOption),showEmptyFields:!0}),(!!n.ifrsImplementationYear||!!n.ifrsReportingOption)&&d.jsxs(d.Fragment,{children:[d.jsx(co,{label:"החל משנת המס",value:n.ifrsImplementationYear??"",showEmptyFields:!0}),d.jsx(co,{label:"דווח בחלופה",value:jGn(n.ifrsReportingOption),showEmptyFields:!0})]}),d.jsx(co,{label:"מספר ענף כלכלי של המדווח",value:n.industryCode,showEmptyFields:!0}),d.jsx(co,{label:"חוות דעת המבקר",value:PGn(n.auditOpinionType),showEmptyFields:!0})]})]})})}const RGn=[{title:"הכנסות ממכירות ומתן שירותים",color:"text-blue-700",codes:[1010,1015,1020,1025,1030,1040,1051,1052,1090],sumCode:1e3},{title:"עלות המכירות ומתן השירותים וביצוע עבודות",color:"text-purple-700",codes:[1306,1308,1307,1310,1320,1330,1340,1350,1360,1371,1372,1390,1400,1450],sumCode:1300},{title:"עלויות ייצור ועלויות אצל קבלן בונה",color:"text-rose-700",codes:[2005,2006,2011,2012,2015,2020,2025,2030,2035,2040,2045,2050,2060,2066,2067,2068,2070,2075,2080,2085,2090,2095],sumCode:2e3},{title:"הוצאות מחקר ופיתוח",color:"text-amber-700",codes:[2510,2520,2530,2540,2550,2560,2570,2590],sumCode:2500},{title:"הוצאות מכירה",color:"text-green-700",codes:[3011,3013,3012,3015,3020,3025,3030,3040,3045,3050,3060,3066,3067,3068,3070,3075,3080,3085,3090,3100,3120,3190],sumCode:3e3},{title:"הוצאות הנהלה וכלליות",color:"text-cyan-700",codes:[3511,3513,3512,3515,3520,3530,3535,3540,3545,3550,3560,3566,3567,3568,3570,3575,3580,3590,3595,3600,3610,3620,3625,3631,3632,3640,3650,3660,3665,3680,3685,3690],sumCode:3500},{title:"הוצאות מימון",color:"text-indigo-700",codes:[5010,5020,5025,5030,5040,5050,5051,5090],sumCode:5e3},{title:"הכנסות מימון",color:"text-fuchsia-700",codes:[5110,5121,5122,5130,5150,5160,5190],sumCode:5100},{title:"הכנסות אחרות",color:"text-red-700",codes:[5210,5220,5230,5236,5237,5240,5250,5260,5270,5290],sumCode:5200},{title:"הוצאות אחרות",color:"text-yellow-700",codes:[5310,5320,5330,5390],sumCode:5300}],$Gn=[{title:"מסים על הכנסה",color:"text-sky-700",codes:[5610,5620,5630],sumCode:5600},{title:"ייעוד הרווחים",color:"text-violet-700",codes:[5710],sumCode:5700},{title:"רווח/הפסד אקויטי",color:"text-pink-700",codes:[5810],sumCode:5800}];function LGn({selectedYear:e,referenceYear:t,data:n,referenceData:r,showEmptyFields:i=!1}){const{profitAndLoss:a}=$t(Fge,n),s=$t(Fge,r)?.profitAndLoss||[];return d.jsx(sS,{value:"profitLoss",className:"border rounded-md p-4",children:d.jsxs("div",{className:"space-y-6",dir:"rtl",children:[d.jsxs("div",{className:"flex justify-between items-center",children:[d.jsx("h3",{className:"text-lg font-bold border-b pb-2",children:"נתוני רווח והפסד"}),t&&e!==t&&d.jsxs("span",{className:"text-sm text-blue-600 bg-blue-50 px-2 py-1 rounded",children:["מציג שינויים לעומת ",t]})]}),RGn.map(l=>d.jsxs("div",{className:"bg-gray-50 p-4 rounded-md",children:[d.jsx("h4",{className:`font-bold mb-4 ${l.color}`,children:l.title}),d.jsxs("div",{className:"space-y-2",children:[l.codes.map(c=>d.jsx(Yo,{codes:a,referenceCodes:s,code:c,showEmptyFields:i},c)),d.jsx("div",{className:"border-2 rounded-md border-gray-300",children:d.jsx(Yo,{codes:a,referenceCodes:s,code:l.sumCode,showEmptyFields:i})})]})]},l.title)),d.jsx("div",{className:"bg-emerald-50 p-4 rounded-md border-2 border-emerald-200",children:d.jsx(Yo,{codes:a,referenceCodes:s,code:6666,showEmptyFields:i})}),$Gn.map(l=>d.jsxs("div",{className:"bg-gray-50 p-4 rounded-md",children:[d.jsx("h4",{className:`font-bold mb-4 ${l.color}`,children:l.title}),d.jsxs("div",{className:"space-y-2",children:[l.codes.map(c=>d.jsx(Yo,{codes:a,referenceCodes:s,code:c,showEmptyFields:i},c)),d.jsx("div",{className:"border-2 rounded-md border-gray-300",children:d.jsx(Yo,{codes:a,referenceCodes:s,code:l.sumCode,showEmptyFields:i})})]})]},l.title))]})})}const UGn=[{title:"התאמות חשבונאיות למי שיישם את חלופה 2 בהוראת ביצוע 7/2010 בנושא IFRS",color:"red",codes:[103,104]},{title:"התאמות נדרשות לצרכי מס (הוסף/הפחת)",color:"yellow",codes:[110,120,130,135,140,150,160,170,180,181,182,183,184,190,200,300,310,320,330,350,360],sumCode:370},{title:"התאמות חשבונאיות למי שיישם את חלופה 3 בהוראת ביצוע 7/2010 בנושא IFRS שלא מצאו את ביטויין בהתאמות הנדרשות לצרכי מס",color:"emerald",codes:[383],sumCode:400},{title:"יישום הוראות חוקי מס נוספים",color:"sky",codes:[430,480,490],sumCode:500},{title:"נתונים נוספים",color:"violet",codes:[510,520,530,540,550,570,575,580,585,590]},{title:"בשותפות",color:"pink",codes:[600]}],nIe={red:{header:"text-red-700",sum:"bg-red-50 border-red-200"},yellow:{header:"text-yellow-700",sum:"bg-yellow-50 border-yellow-200"},emerald:{header:"text-emerald-700",sum:"bg-emerald-50 border-emerald-200"},sky:{header:"text-sky-700",sum:"bg-sky-50 border-sky-200"},violet:{header:"text-violet-700",sum:"bg-violet-50 border-violet-200"},pink:{header:"text-pink-700",sum:"bg-pink-50 border-pink-200"}};function zGn({data:e,referenceData:t,showEmptyFields:n=!1}){const{taxAdjustment:r}=$t(Dge,e),a=$t(Dge,t)?.taxAdjustment||[];return d.jsx(sS,{value:"taxAdjustment",className:"border rounded-md p-4",children:d.jsxs("div",{className:"space-y-6",dir:"rtl",children:[d.jsx("h3",{className:"text-lg font-bold border-b pb-2",children:'נתוני דו"ח התאמה למס'}),d.jsx("div",{className:"bg-emerald-50 p-4 rounded-md border-2 border-emerald-200",children:d.jsx(Yo,{codes:r,referenceCodes:a,code:100,showEmptyFields:n})}),UGn.map(o=>{const{header:s,sum:l}=nIe[o.color]||nIe.red;return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"bg-gray-50 p-4 rounded-md",children:[d.jsx("h4",{className:"font-bold mb-4 "+s,children:o.title}),d.jsx("div",{className:"space-y-2",children:o.codes.map(c=>d.jsx(Yo,{codes:r,referenceCodes:a,code:c,showEmptyFields:n},c))})]}),o.sumCode&&d.jsx("div",{className:"p-4 rounded-md border-2 "+l,children:d.jsx(Yo,{codes:r,referenceCodes:a,code:o.sumCode,showEmptyFields:n})})]},o.title)})]})})}function HGn({data:e,referenceData:t,businessInfo:n,selectedYear:r,referenceYear:i}){const a=$t(Oge,e),o=$t(Oge,t),[s,l]=w.useState("header"),[c,u]=w.useState(!0);return d.jsxs("div",{className:"p-4 border-gray-300",dir:"rtl",children:[d.jsxs("div",{className:"flex justify-between items-center mb-4",children:[d.jsx("div",{className:"flex items-center gap-4",children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs(Ge,{variant:c?"outline":"default",size:"sm",onClick:()=>u(!c),className:"flex items-center gap-2",children:[c?d.jsx(Y5t,{className:"h-4 w-4"}):d.jsx(Ene,{className:"h-4 w-4"}),c?"הסתר שדות ריקים":"הצג שדות ריקים"]}),d.jsx("span",{className:"text-sm text-gray-500",children:c?"מציג את כל השדות":"מציג רק שדות עם נתונים"})]})}),d.jsxs("div",{className:"flex gap-2",children:[d.jsxs(Ge,{variant:"outline",className:"flex items-center gap-2",children:[d.jsx(Nne,{className:"h-4 w-4"}),"הורד"]}),d.jsxs(Ge,{variant:"outline",className:"flex items-center gap-2",children:[d.jsx(lIt,{className:"h-4 w-4"}),"שמור"]})]})]}),d.jsxs(xYe,{value:s,onValueChange:l,className:"w-full",children:[d.jsxs(wYe,{className:"grid grid-cols-4 w-full",dir:"rtl",children:[d.jsx(Jw,{value:"header",children:"פרטים מזהים"}),d.jsx(Jw,{value:"profitLoss",children:"רווח והפסד"}),d.jsx(Jw,{value:"taxAdjustment",children:"התאמה למס"}),d.jsx(Jw,{value:"balanceSheet",children:"מאזן"})]}),d.jsx(MGn,{data:a,businessInfo:n}),d.jsx(LGn,{selectedYear:r,referenceYear:i,data:a,referenceData:o,showEmptyFields:c}),d.jsx(zGn,{data:a,referenceData:o,showEmptyFields:c}),d.jsx(FGn,{data:a,referenceData:o,showEmptyFields:c})]})]})}function VGn(){const{setFiltersContext:e}=w.useContext(ta),[t,n]=w.useState(void 0),[r,i]=w.useState(void 0),[a,o]=w.useState(void 0),[{data:s,fetching:l}]=rn({query:xFt,variables:{year:r?Number.parseInt(r,10):0,businessId:t},pause:!r||!t});return w.useEffect(()=>{e(d.jsx("div",{className:"flex flex-row gap-x-5",dir:"rtl",children:d.jsx(kGn,{selectedBusiness:t,setSelectedBusiness:n,selectedYear:r,setSelectedYear:i,referenceYear:a,setReferenceYear:o})}))},[e,t,r,a]),d.jsx("div",{className:"container mx-auto",dir:"rtl",children:d.jsxs(os,{className:"border-2 border-gray-300",children:[d.jsx(Lc,{className:"bg-gray-100 border-b-2 border-gray-300 flex flex-row justify-between items-center",children:d.jsxs("div",{className:"text-center w-full",children:[d.jsx("h1",{className:"text-2xl font-bold",children:'נספח לטופס הדו"ח השנתי ליחיד ולחבר בני אדם'}),d.jsxs("h2",{className:"text-xl",children:["לשנת המס ",r]}),d.jsx("p",{className:"text-sm",children:'נתוני הדוחות הכספיים, מאזן, רווח והפסד ודו"ח ההתאמה למס'})]})}),d.jsx(Gs,{className:"p-0",children:d.jsx(QGn,{fetching:l,data:s,selectedBusiness:t,selectedYear:r,referenceYear:a})})]})})}function QGn({fetching:e,data:t,selectedBusiness:n,selectedYear:r,referenceYear:i}){if(e)return d.jsx("div",{className:"container mx-auto p-8 text-center",dir:"rtl",children:d.jsx("p",{className:"text-lg text-gray-600",children:"טוען נתונים..."})});if(!r||!n)return d.jsx("div",{className:"container mx-auto p-8 text-center",dir:"rtl",children:d.jsx("p",{className:"text-lg text-gray-600",children:"יש לבחור עסק ושנת דיווח"})});const a=t?.shaam6111.data;return a?d.jsx(HGn,{data:a,businessInfo:t.shaam6111.business,selectedBusiness:n,selectedYear:r,referenceYear:i}):d.jsx("div",{className:"container mx-auto p-8 text-center",dir:"rtl",children:d.jsx("p",{className:"text-lg text-gray-600",children:"אין נתונים זמינים עבור העסק והשנה שנבחרו"})})}const rIe=[{id:"key",accessorKey:"key",cell:({row:e})=>d.jsx(Mt,{children:e.original.key}),header:({column:e})=>d.jsxs(Ge,{variant:"ghost",onClick:()=>e.toggleSorting(e.getIsSorted()==="asc"),children:["Key",d.jsx(cd,{})]})},{id:"name",accessorKey:"name",cell:({row:e})=>d.jsx(Mt,{children:e.original.name}),header:({column:e})=>d.jsxs(Ge,{variant:"ghost",onClick:()=>e.toggleSorting(e.getIsSorted()==="asc"),children:["Name",d.jsx(cd,{})]})},{id:"defaultIrsCode",accessorKey:"defaultIrsCode",cell:({row:e})=>d.jsx(Mt,{className:"flex flex-wrap gap-1 p-1",children:e.original.defaultIrsCode&&d.jsx(Ge,{variant:"outline",disabled:!0,className:"p-1 w-15",children:e.original.defaultIrsCode})}),header:"Default IRS Code"},{id:"edit",cell:({row:e})=>d.jsx(Oon,{sortCodeKey:e.original.key,onAdd:e.original.refetchSortCodes})}],qGn=()=>{const[{data:e,fetching:t,error:n},r]=rn({query:wFt}),{setFiltersContext:i}=w.useContext(ta),a=w.useMemo(()=>e?.allSortCodes?.map(l=>({...l,refetchSortCodes:r}))??[],[e?.allSortCodes,r]),o=om({data:a,columns:rIe,getCoreRowModel:am(),getPaginationRowModel:TD(),getSortedRowModel:Cg(),initialState:{pagination:{pageSize:100}}}),s=o.getPageOptions();return w.useEffect(()=>{i(d.jsx("div",{className:"flex items-center justify-end gap-10 space-x-2 py-4",children:d.jsx(QL,{table:o})}))},[i,o,s]),w.useEffect(()=>{n&&(console.error("Error fetching sort codes",n),qe.error("Error",{description:"Error fetching sort codes"}))},[n]),d.jsx(Pa,{title:`Sort Codes (${a.length})`,description:"All sort codes",headerActions:d.jsx(Hon,{onAdd:()=>r()}),children:t?d.jsx("div",{className:"flex flex-row justify-center",children:d.jsx(ai,{className:"h-10 w-10 animate-spin mr-2"})}):d.jsx("div",{className:"flex flex-col gap-4 rounded-md border",children:d.jsxs(Bu,{children:[d.jsx(Iu,{children:o.getHeaderGroups().map(l=>d.jsx(Dr,{children:l.headers.map(c=>d.jsx(Gr,{children:c.isPlaceholder?null:jo(c.column.columnDef.header,c.getContext())},c.id))},l.id))}),d.jsx(ju,{children:o.getRowModel().rows.length===0?d.jsx(Dr,{children:d.jsx(Mt,{colSpan:rIe.length,className:"text-center py-8",children:"No sort codes found"})}):o.getRowModel().rows.map(l=>d.jsx(Dr,{children:l.getVisibleCells().map(c=>d.jsx(Mt,{children:jo(c.column.columnDef.cell,c.getContext())},c.id))},l.id))})]})})})},GGn="addTag",WGn=()=>{const[{fetching:e},t]=qn(OFt),n=w.useCallback(async r=>{const i=`Error adding new tag [${r.tagName}]`,a=`${GGn}-${r.tagName}`;qe.loading("Adding tag",{id:a});try{const o=await t(r);Gn(o,i,a)&&qe.success("Success",{id:a,description:`"${r.tagName}" tag was successfully added`})}catch(o){console.error(`${i}: ${o}`),qe.error("Error",{id:a,description:i,duration:1e5,closeButton:!0})}},[t]);return{fetching:e,addTag:n}},KGn="deleteTag",YGn=()=>{const[{fetching:e},t]=qn(KFt),n=w.useCallback(async r=>{const i=`Error deleting new tag [${r.name}]`,a=`${KGn}-${r.tagId}`;qe.loading(`Deleting tag [${r.name}]`,{id:a});try{const o=await t(r);Gn(o,i,a)&&qe.success("Tag Deleted",{id:a,description:`[${r.name}] tag was successfully removed`})}catch(o){console.error(`${i}: ${o}`),qe.error("Error",{id:a,description:i,duration:1e5,closeButton:!0})}},[t]);return{fetching:e,deleteTag:n}},XGn=()=>{const{setFiltersContext:e}=w.useContext(ta),[t,n]=w.useState(""),[{data:r,fetching:i},a]=rn({query:kFt}),{addTag:o}=WGn(),{deleteTag:s}=YGn();e(null);const l=_Le(r?.allTags??[]),c=w.useCallback(f=>{f.length>2&&o({tagName:f}).then(()=>{a()})},[o,a]),u=w.useCallback((f,h)=>{s({tagId:f,name:h}).then(()=>{a()})},[s,a]);return d.jsx(Pa,{title:"Tags",description:"Manage tags for your bookmarks.",children:i?d.jsx(ai,{className:"h-10 w-10 animate-spin mr-2 self-center"}):d.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[l?.map(f=>d.jsxs("div",{className:"flex items-center gap-2 text-gray-600 mb-2",children:[d.jsxs("div",{className:"w-full mt-1 relative rounded-md shadow-xs",children:[f.namePath?.map((h,m)=>d.jsx("span",{className:"ms-2"},m)),f.name]}),d.jsx(jon,{data:f}),d.jsx(Ge,{variant:"ghost",size:"icon",className:"size-7.5",onClick:()=>u(f.id,f.name),children:d.jsx(Ry,{className:"size-5"})})]},f.id)),d.jsxs("div",{className:"flex justify-start items-center gap-2 text-gray-600 mb-2",children:[d.jsx(kn,{className:"w-80",value:t,onChange:f=>n(f.currentTarget.value),placeholder:"Add new tag",required:!0}),d.jsx(Ge,{variant:"ghost",size:"icon",className:"size-7.5",disabled:t.length<2,onClick:()=>c(t),children:d.jsx(lg,{className:"size-5"})})]})]})})},ZGn="updateTaxCategory",JGn=()=>{const[{fetching:e},t]=qn(jDt),n=w.useCallback(async r=>{const i="Error updating tax category",a=`${ZGn}-${r.taxCategoryId}`;qe.loading("Uploading Tax Category",{id:a});try{const o=await t(r),s=Gn(o,i,a,"updateTaxCategory");if(s)return qe.success("Success",{id:a,description:`${s.updateTaxCategory.name} was updated`}),s.updateTaxCategory}catch(o){console.error(`${i}: ${o}`),qe.error("Error",{id:a,description:i,duration:1e5,closeButton:!0})}},[t]);return{fetching:e,updateTaxCategory:n}};function eWn({taxCategoryId:e,onAdd:t}){const[n,r]=w.useState(!1);return d.jsxs(Ra,{open:n,onOpenChange:r,children:[d.jsx(Ac,{asChild:!0,children:d.jsx(Ge,{variant:"outline",size:"icon",children:d.jsx(Tu,{})})}),d.jsxs($a,{className:"w-[400px] max-w-screen-md",children:[d.jsx(us,{children:d.jsx(ds,{children:"Edit Tax Category"})}),d.jsx(tWn,{taxCategoryId:e,close:()=>r(!1),onAdd:t})]})]})}function tWn({taxCategoryId:e,close:t,onAdd:n}){const[{data:r,fetching:i}]=rn({query:qEt,variables:{id:e}}),a=r?.taxCategory;return!a&&!i&&qe.error("Error",{description:"Couldn'nt find tax category"}),i?d.jsx(ai,{className:"h-10 w-10 animate-spin"}):d.jsx(nWn,{taxCategory:a,close:t,onAdd:n})}function nWn({taxCategory:e,close:t,onAdd:n}){const r=Ar({defaultValues:{sortCode:e.sortCode?.key,name:e.name,irsCode:e.irsCode}}),{handleSubmit:i}=r,[a,o]=w.useState(!1),{updateTaxCategory:s,fetching:l}=JGn(),c=u=>{u.sortCode&&=parseInt(u.sortCode.toString()),s({fields:u,taxCategoryId:e.id}).then(f=>{f?.id&&(n?.(f.id),t())})};return d.jsx(ii,{...r,children:d.jsxs("form",{onSubmit:i(c),children:[d.jsx("div",{className:"flex flex-col gap-4 my-4",children:d.jsx(eKe,{isInsert:!1,formManager:r,setFetching:o})}),d.jsx("div",{className:"flex justify-end mt-4",children:d.jsx(Ge,{type:"submit",disabled:l||a,children:"Update"})})]})})}const rWn=({data:e})=>d.jsx("td",{children:e.name}),iWn=({data:e})=>d.jsx("td",{children:e.sortCode?d.jsxs("span",{children:[e.sortCode?.name," (",e.sortCode?.id,")"]}):"N/A"}),iIe=[{id:"name",accessorKey:"name",cell:({row:e})=>d.jsx(rWn,{data:e.original}),header:({column:e})=>d.jsxs(Ge,{variant:"ghost",onClick:()=>e.toggleSorting(e.getIsSorted()==="asc"),children:["Name",d.jsx(cd,{})]})},{id:"sortCode",accessorKey:"sortCode.key",cell:({row:e})=>d.jsx(iWn,{data:e.original}),header:({column:e})=>d.jsxs(Ge,{variant:"ghost",onClick:()=>e.toggleSorting(e.getIsSorted()==="asc"),children:["Sort Code",d.jsx(cd,{})]})},{id:"edit",cell:({row:e})=>d.jsx(eWn,{taxCategoryId:e.original.id})}],aWn=()=>{const[{data:e,fetching:t,error:n},r]=rn({query:SFt}),{setFiltersContext:i}=w.useContext(ta),a=e?.taxCategories??[],o=om({data:a,columns:iIe,getCoreRowModel:am(),getPaginationRowModel:TD(),getSortedRowModel:Cg(),initialState:{pagination:{pageSize:30}}}),s=o.getPageOptions();return w.useEffect(()=>{i(d.jsx("div",{className:"flex items-center justify-end gap-10 space-x-2 py-4",children:d.jsx("div",{className:"flex items-center justify-between px-2",children:d.jsx(QL,{table:o})})}))},[i,o,s]),w.useEffect(()=>{n&&qe.error("Error",{description:"Error fetching tax categories"})},[n]),d.jsx(Pa,{title:`Tax Categories (${a.length})`,description:"All tax categories",headerActions:d.jsx(Gon,{onAdd:()=>r()}),children:t?d.jsx("div",{className:"flex flex-row justify-center",children:d.jsx(ai,{className:"h-10 w-10 animate-spin mr-2"})}):d.jsx("div",{className:"flex flex-col gap-4 rounded-md border",children:d.jsxs(Bu,{children:[d.jsx(Iu,{children:o.getHeaderGroups().map(l=>d.jsx(Dr,{children:l.headers.map(c=>d.jsx(Gr,{children:c.isPlaceholder?null:jo(c.column.columnDef.header,c.getContext())},c.id))},l.id))}),d.jsx(ju,{children:o.getRowModel().rows.length===0?d.jsx(Dr,{children:d.jsx(Mt,{colSpan:iIe.length,className:"text-center py-8",children:"No tax categories found"})}):o.getRowModel().rows.map(l=>d.jsx(Dr,{children:l.getVisibleCells().map(c=>d.jsx(Mt,{children:jo(c.column.columnDef.cell,c.getContext())},c.id))},l.id))})]})})})};function oWn(){const[e,t]=w.useState(null);return d.jsx(ta.Provider,{value:{filtersContext:e,setFiltersContext:t},children:d.jsx(GFn,{filtersContext:e,children:d.jsxs(RIe,{children:[d.jsx(Lr,{path:"/",element:d.jsx(aFe,{})}),d.jsx(Lr,{path:"charges",element:d.jsx(aFe,{})}),d.jsx(Lr,{path:"missing-info-charges",element:d.jsx(xRn,{})}),d.jsx(Lr,{path:"charges-ledger-validation",element:d.jsx(Adn,{})}),d.jsx(Lr,{path:"charges/:chargeId",element:d.jsx(G9t,{})}),d.jsx(Lr,{path:"businesses",element:d.jsx(fdn,{})}),d.jsx(Lr,{path:"business-trips",element:d.jsx(sdn,{})}),d.jsx(Lr,{path:"business-trips/:businessTripId",element:d.jsx(adn,{})}),d.jsx(Lr,{path:"business-transactions",element:d.jsx(oUt,{})}),d.jsx(Lr,{path:"business-transactions/:businessId",element:d.jsx(qcn,{})}),d.jsxs(Lr,{path:"charts",children:[d.jsx(Lr,{path:"",element:d.jsx(Rgn,{})}),d.jsx(Lr,{path:"monthly-income-expense",element:d.jsx(t2n,{})})]}),d.jsxs(Lr,{path:"documents",children:[d.jsx(Lr,{path:"",element:d.jsx(SRn,{})}),d.jsx(Lr,{path:"issue-documents",element:d.jsx(ORn,{})}),d.jsx(Lr,{path:"issue-document",element:d.jsx(CRn,{})})]}),d.jsx(Lr,{path:"accountant-approvals",element:d.jsx(WFn,{})}),d.jsxs(Lr,{path:"reports",children:[d.jsx(Lr,{path:"trial-balance",element:d.jsx(vMn,{})}),d.jsx(Lr,{path:"conto",element:d.jsx(tMn,{})}),d.jsx(Lr,{path:"vat-monthly",element:d.jsx(nRn,{})}),d.jsx(Lr,{path:"profit-and-loss",element:d.jsx(eFe,{})}),d.jsx(Lr,{path:"profit-and-loss/:year",element:d.jsx(eFe,{})}),d.jsx(Lr,{path:"tax",element:d.jsx(tFe,{})}),d.jsx(Lr,{path:"tax/:year",element:d.jsx(tFe,{})}),d.jsx(Lr,{path:"depreciation",element:d.jsx(wGn,{})}),d.jsx(Lr,{path:"shaam6111",element:d.jsx(VGn,{})}),d.jsx(Lr,{path:"yearly-ledger",element:d.jsx(oRn,{})}),d.jsx(Lr,{path:"corporate-tax-ruling-compliance",element:d.jsx(JEe,{})}),d.jsx(Lr,{path:"corporate-tax-ruling-compliance/:year",element:d.jsx(JEe,{})}),d.jsx(Lr,{path:"balance",element:d.jsx(gGn,{})}),d.jsx(Lr,{path:"validate-reports",element:d.jsx(QMn,{})})]}),d.jsx(Lr,{path:"salaries",element:d.jsx(bRn,{})}),d.jsx(Lr,{path:"tags",element:d.jsx(XGn,{})}),d.jsx(Lr,{path:"tax-categories",element:d.jsx(aWn,{})}),d.jsx(Lr,{path:"sort-codes",element:d.jsx(qGn,{})}),d.jsx(Lr,{path:"*",element:d.jsx(BRn,{})})]})})})}var K8=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},sWn={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},lWn=class{#e=sWn;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},fte=new lWn;function cWn(e){setTimeout(e,0)}var Y8=typeof window>"u"||"Deno"in globalThis;function Nh(){}function uWn(e,t){return typeof e=="function"?e(t):e}function dWn(e){return typeof e=="number"&&e>=0&&e!==1/0}function fWn(e,t){return Math.max(e+(t||0)-Date.now(),0)}function hte(e,t){return typeof e=="function"?e(t):e}function hWn(e,t){return typeof e=="function"?e(t):e}function aIe(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Uce(o,t.options))return!1}else if(!qF(t.queryKey,o))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function oIe(e,t){const{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(QF(t.options.mutationKey)!==QF(a))return!1}else if(!qF(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Uce(e,t){return(t?.queryKeyHashFn||QF)(e)}function QF(e){return JSON.stringify(e,(t,n)=>mte(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function qF(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>qF(e[n],t[n])):!1}var mWn=Object.prototype.hasOwnProperty;function dot(e,t){if(e===t)return e;const n=sIe(e)&&sIe(t);if(!n&&!(mte(e)&&mte(t)))return t;const i=(n?e:Object.keys(e)).length,a=n?t:Object.keys(t),o=a.length,s=n?new Array(o):{};let l=0;for(let c=0;c<o;c++){const u=n?c:a[c],f=e[u],h=t[u];if(f===h){s[u]=f,(n?c<i:mWn.call(e,u))&&l++;continue}if(f===null||h===null||typeof f!="object"||typeof h!="object"){s[u]=h;continue}const m=dot(f,h);s[u]=m,m===f&&l++}return i===o&&l===i?e:s}function sIe(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function mte(e){if(!lIe(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!lIe(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function lIe(e){return Object.prototype.toString.call(e)==="[object Object]"}function pWn(e){return new Promise(t=>{fte.setTimeout(t,e)})}function AWn(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?dot(e,t):t}function gWn(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function vWn(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var zce=Symbol();function fot(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===zce?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var yWn=class extends K8{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!Y8&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},hot=new yWn;function bWn(){let e,t;const n=new Promise((i,a)=>{e=i,t=a});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var xWn=cWn;function wWn(){let e=[],t=0,n=s=>{s()},r=s=>{s()},i=xWn;const a=s=>{t?e.push(s):i(()=>{n(s)})},o=()=>{const s=e;e=[],s.length&&i(()=>{r(()=>{s.forEach(l=>{n(l)})})})};return{batch:s=>{let l;t++;try{l=s()}finally{t--,t||o()}return l},batchCalls:s=>(...l)=>{a(()=>{s(...l)})},schedule:a,setNotifyFunction:s=>{n=s},setBatchNotifyFunction:s=>{r=s},setScheduler:s=>{i=s}}}var Oc=wWn(),kWn=class extends K8{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!Y8&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},q$=new kWn;function SWn(e){return Math.min(1e3*2**e,3e4)}function mot(e){return(e??"online")==="online"?q$.isOnline():!0}var pte=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function pot(e){let t=!1,n=0,r;const i=bWn(),a=()=>i.status!=="pending",o=A=>{if(!a()){const v=new pte(A);h(v),e.onCancel?.(v)}},s=()=>{t=!0},l=()=>{t=!1},c=()=>hot.isFocused()&&(e.networkMode==="always"||q$.isOnline())&&e.canRun(),u=()=>mot(e.networkMode)&&e.canRun(),f=A=>{a()||(r?.(),i.resolve(A))},h=A=>{a()||(r?.(),i.reject(A))},m=()=>new Promise(A=>{r=v=>{(a()||c())&&A(v)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),p=()=>{if(a())return;let A;const v=n===0?e.initialPromise:void 0;try{A=v??e.fn()}catch(y){A=Promise.reject(y)}Promise.resolve(A).then(f).catch(y=>{if(a())return;const x=e.retry??(Y8?0:3),k=e.retryDelay??SWn,S=typeof k=="function"?k(n,y):k,C=x===!0||typeof x=="number"&&n<x||typeof x=="function"&&x(n,y);if(t||!C){h(y);return}n++,e.onFail?.(n,y),pWn(S).then(()=>c()?void 0:m()).then(()=>{t?h(y):p()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:l,canStart:u,start:()=>(u()?p():m().then(p),i)}}var Aot=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),dWn(this.gcTime)&&(this.#e=fte.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Y8?1/0:300*1e3))}clearGcTimeout(){this.#e&&(fte.clearTimeout(this.#e),this.#e=void 0)}},CWn=class extends Aot{#e;#t;#n;#r;#a;#i;#o;constructor(e){super(),this.#o=!1,this.#i=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=cIe(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#i,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=cIe(this.options);t.data!==void 0&&(this.setData(t.data,{updatedAt:t.dataUpdatedAt,manual:!0}),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=AWn(this.state.data,e,this.options);return this.#s({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(Nh).catch(Nh):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>hWn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===zce||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>hte(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!fWn(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#o?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#a?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){const s=this.observers.find(l=>l.options.queryFn);s&&this.setOptions(s.options)}const n=new AbortController,r=s=>{Object.defineProperty(s,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{const s=fot(this.options,t),c=(()=>{const u={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(u),u})();return this.#o=!1,this.options.persister?this.options.persister(s,c,this):s(c)},o=(()=>{const s={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};return r(s),s})();this.options.behavior?.onFetch(o,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#s({type:"fetch",meta:o.fetchOptions?.meta}),this.#a=pot({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:s=>{s instanceof pte&&s.revert&&this.setState({...this.#t,fetchStatus:"idle"}),n.abort()},onFail:(s,l)=>{this.#s({type:"failed",failureCount:s,error:l})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{const s=await this.#a.start();if(s===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(s),this.#n.config.onSuccess?.(s,this),this.#n.config.onSettled?.(s,this.state.error,this),s}catch(s){if(s instanceof pte){if(s.silent)return this.#a.promise;if(s.revert){if(this.state.data===void 0)throw s;return this.state.data}}throw this.#s({type:"error",error:s}),this.#n.config.onError?.(s,this),this.#n.config.onSettled?.(this.state.data,s,this),s}finally{this.scheduleGc()}}#s(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,..._Wn(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,data:e.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?r:void 0,r;case"error":const i=e.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),Oc.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function _Wn(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:mot(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function cIe(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}function uIe(e){return{onFetch:(t,n)=>{const r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[];let s={pages:[],pageParams:[]},l=0;const c=async()=>{let u=!1;const f=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(t.signal.aborted?u=!0:t.signal.addEventListener("abort",()=>{u=!0}),t.signal)})},h=fot(t.options,t.fetchOptions),m=async(p,A,v)=>{if(u)return Promise.reject();if(A==null&&p.pages.length)return Promise.resolve(p);const x=(()=>{const N={client:t.client,queryKey:t.queryKey,pageParam:A,direction:v?"backward":"forward",meta:t.options.meta};return f(N),N})(),k=await h(x),{maxPages:S}=t.options,C=v?vWn:gWn;return{pages:C(p.pages,k,S),pageParams:C(p.pageParams,A,S)}};if(i&&a.length){const p=i==="backward",A=p?NWn:dIe,v={pages:a,pageParams:o},y=A(r,v);s=await m(v,y,p)}else{const p=e??a.length;do{const A=l===0?o[0]??r.initialPageParam:dIe(r,s);if(l>0&&A==null)break;s=await m(s,A),l++}while(l<p)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=c}}}function dIe(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function NWn(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var EWn=class extends Aot{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||FWn(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#a({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=pot({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(a,o)=>{this.#a({type:"failed",failureCount:a,error:o})},onPause:()=>{this.#a({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",i=!this.#r.canStart();try{if(r)t();else{this.#a({type:"pending",variables:e,isPaused:i}),await this.#n.config.onMutate?.(e,this,n);const o=await this.options.onMutate?.(e,n);o!==this.state.context&&this.#a({type:"pending",context:o,variables:e,isPaused:i})}const a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#a({type:"success",data:a}),a}catch(a){try{throw await this.#n.config.onError?.(a,e,this.state.context,this,n),await this.options.onError?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(void 0,a,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(void 0,a,e,this.state.context,n),a}finally{this.#a({type:"error",error:a})}}finally{this.#n.runNext(this)}}#a(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Oc.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function FWn(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var DWn=class extends K8{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const r=new EWn({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=jI(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=jI(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=jI(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(i=>i.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=jI(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Oc.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>oIe(t,n))}findAll(e={}){return this.getAll().filter(t=>oIe(e,t))}notify(e){Oc.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Oc.batch(()=>Promise.all(e.map(t=>t.continue().catch(Nh))))}};function jI(e){return e.options.scope?.id}var TWn=class extends K8{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,i=t.queryHash??Uce(r,t);let a=this.get(i);return a||(a=new CWn({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Oc.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>aIe(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>aIe(e,n)):t}notify(e){Oc.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Oc.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Oc.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},OWn=class{#e;#t;#n;#r;#a;#i;#o;#s;constructor(e={}){this.#e=e.queryCache||new TWn,this.#t=e.mutationCache||new DWn,this.#n=e.defaultOptions||{},this.#r=new Map,this.#a=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#o=hot.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=q$.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(hte(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),a=this.#e.get(r.queryHash)?.state.data,o=uWn(t,a);if(o!==void 0)return this.#e.build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return Oc.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Oc.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return Oc.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Oc.batch(()=>this.#e.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Nh).catch(Nh)}invalidateQueries(e,t={}){return Oc.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Oc.batch(()=>this.#e.findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let a=i.fetch(void 0,n);return n.throwOnError||(a=a.catch(Nh)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(Nh)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(hte(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Nh).catch(Nh)}fetchInfiniteQuery(e){return e.behavior=uIe(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Nh).catch(Nh)}ensureInfiniteQueryData(e){return e.behavior=uIe(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return q$.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(QF(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{qF(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#a.set(QF(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#a.values()],n={};return t.forEach(r=>{qF(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Uce(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===zce&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},BWn=w.createContext(void 0),IWn=({client:e,children:t})=>(w.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),d.jsx(BWn.Provider,{value:e,children:t})),jWn=(e,t,n,r,i,a,o,s)=>{let l=document.documentElement,c=["light","dark"];function u(m){(Array.isArray(e)?e:[e]).forEach(p=>{let A=p==="class",v=A&&a?i.map(y=>a[y]||y):i;A?(l.classList.remove(...v),l.classList.add(a&&a[m]?a[m]:m)):l.setAttribute(p,m)}),f(m)}function f(m){s&&c.includes(m)&&(l.style.colorScheme=m)}function h(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)u(r);else try{let m=localStorage.getItem(t)||n,p=o&&m==="system"?h():m;u(p)}catch{}},PWn=w.createContext(void 0),MWn={setTheme:e=>{},themes:[]},RWn=()=>{var e;return(e=w.useContext(PWn))!=null?e:MWn};w.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:a,value:o,themes:s,nonce:l,scriptProps:c})=>{let u=JSON.stringify([n,t,a,e,s,o,r,i]).slice(1,-1);return w.createElement("script",{...c,suppressHydrationWarning:!0,nonce:typeof window>"u"?l:"",dangerouslySetInnerHTML:{__html:`(${jWn.toString()})(${u})`}})});const $Wn=({...e})=>{const{theme:t="system"}=RWn();return d.jsx(BOt,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-white group-[.toaster]:text-gray-950 group-[.toaster]:border-gray-200 group-[.toaster]:shadow-lg dark:group-[.toaster]:bg-gray-950 dark:group-[.toaster]:text-gray-50 dark:group-[.toaster]:border-gray-800",description:"group-[.toast]:text-gray-500 dark:group-[.toast]:text-gray-400",actionButton:"group-[.toast]:bg-gray-900 group-[.toast]:text-gray-50 font-medium dark:group-[.toast]:bg-gray-50 dark:group-[.toast]:text-gray-900",cancelButton:"group-[.toast]:bg-gray-100 group-[.toast]:text-gray-500 font-medium dark:group-[.toast]:bg-gray-800 dark:group-[.toast]:text-gray-400"}},...e})};var lY=(e,t)=>Xj(e.kind,e,{...e.context,authAttempt:t});function LWn(e){return({client:t,forward:n})=>{var r=new Set,i=gY(),a=gY(),o=new Map;function s(){c=void 0;var f=o;o=new Map,f.forEach(i.next)}function l(f){c=void 0;var h=o;o=new Map,h.forEach((m=>{a.next(ZIe(m,f))}))}var c,u=null;return f=>{function h(){c=Promise.resolve().then((()=>e({mutate(y,x,k){var S=t.createRequestOperation("mutation",fk(y,x),k);return Nte(Z$(1)(bu((C=>C.operation.key===S.key&&S.context._instance===C.operation.context._instance))(AY((()=>{var C=p(S);r.add(C.context._instance),i.next(C)}))(v))))},appendHeaders(y,x){var k=typeof y.context.fetchOptions=="function"?y.context.fetchOptions():y.context.fetchOptions||{};return Xj(y.kind,y,{...y.context,fetchOptions:{...k,headers:{...k.headers,...x}}})}}))).then((y=>{y&&(u=y),s()})).catch((y=>{l(y)}))}h();function m(y){o.set(y.key,lY(y,!0)),u&&!c&&(c=u.refreshAuth().then(s).catch(l))}function p(y){return u?u.addAuthToOperation(y):y}var A=bu(Boolean)(qIe((y=>y.kind==="teardown"?(o.delete(y.key),y):y.context._instance&&r.has(y.context._instance)?y:y.context.authAttempt?p(y):c||!u?(c||h(),o.has(y.key)||o.set(y.key,lY(y,!1)),null):(function(k){return!k.context.authAttempt&&u&&u.willAuthError&&u.willAuthError(k)})(y)?(m(y),null):p(lY(y,!1))))(nE([i.source,f]))),v=n(A);return nE([a.source,bu((y=>!r.has(y.operation.context._instance)&&y.error&&(function(k){return u&&u.didAuthError&&u.didAuthError(k.error,k.operation)})(y)&&!y.operation.context.authAttempt?(m(y.operation),!1):(r.has(y.operation.context._instance)&&r.delete(y.operation.context._instance),!0)))(v)])}}}function UWn({children:e}){const{authService:t}=w.useContext(ND),n=VS(),r=t.isLoggedIn(),i=w.useMemo(()=>t.authToken(),[t]),a=w.useMemo(()=>{if(!r)return null;let o;return o="https://accounter.onrender.com/graphql",Eut({url:o,exchanges:[Cut({onResult(s){if(s.error?.networkError){console.error("Network Error:",s.error.networkError),n("/network-error");return}(s?.error?.graphQLErrors.some(c=>c.extensions?.code==="FORBIDDEN")||s?.error?.response?.status===401)&&n("/login",{state:{message:"You are not authorized to access this page"}})}}),LWn(async s=>({addAuthToOperation(l){return i?s.appendHeaders(l,{Authorization:i}):l},didAuthError(l,c){return l?.response?.status===401||l?.graphQLErrors?.some(u=>u.extensions?.code==="FORBIDDEN")},async refreshAuth(){t.logout()}})),kut]})},[r,n,i,t]);return w.useEffect(()=>{a||n("/login")},[a,n]),a?d.jsx(Dut,{value:a,children:e}):d.jsx(oct,{to:"/login",state:{prevPath:window.location.pathname}})}const zWn=new OWn;function HWn({children:e}){const t=Zoe({palette:{primary:{main:"#556cd6"},secondary:{main:"#19857b"},error:{main:ob.A400}}});return d.jsx(Oje,{withGlobalStyles:!0,theme:{fontFamily:"Roboto, sans-serif",fontSizes:{md:"14"}},children:d.jsxs(T0n,{theme:t,children:[d.jsx(O4n,{}),d.jsx($Wn,{}),d.jsx(nUt,{children:d.jsx(UWn,{children:d.jsx(IWn,{client:zWn,children:d.jsx(rUt,{children:e})})})})]})})}const VWn=document.getElementById("root"),QWn=Bst.createRoot(VWn),qWn=Tct(lct(d.jsx(Lr,{path:"*",element:d.jsx(HWn,{children:d.jsx(oWn,{})}),errorElement:d.jsx("p",{children:"error"})})));QWn.render(d.jsx(w.StrictMode,{children:d.jsx(Hct,{router:qWn})}));export{Zi as _,yu as c,Ni as g,Xn as p};