@accounter/client 0.0.9-alpha-20260104192330-5023f4398b22d4c0c52b68b62c7a290e03de417e → 0.0.9-alpha-20260104194509-1bbd863eb3e889196f321663613c729992d236b4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -1
- package/dist/assets/{Checkbox-D1EYx-2R.js → Checkbox-Bqh8Rs3Y.js} +1 -1
- package/dist/assets/{MultiSelect-BYC23mXC.js → MultiSelect-BLtBUfDG.js} +1 -1
- package/dist/assets/{Progress-Bgh_hdHE.js → Progress-zdcZiq7-.js} +1 -1
- package/dist/assets/{Table-BPmZ5ljQ.js → Table-LzLjpZeA.js} +1 -1
- package/dist/assets/{Typography-IFt-aKsY.js → Typography-DemEN63p.js} +1 -1
- package/dist/assets/{YearPickerInput-DXpznBXd.js → YearPickerInput-wefUMrNX.js} +1 -1
- package/dist/assets/{accordion-DjXOBlUF.js → accordion-DY8sNVhh.js} +1 -1
- package/dist/assets/{accountant-approvals-Ddg6bDMn.js → accountant-approvals-DtBIRZC5.js} +1 -1
- package/dist/assets/{accounter-table-Cg2u2Bcd.js → accounter-table-pB9Clv36.js} +1 -1
- package/dist/assets/{addDays-CIRVLi_y.js → addDays-z7yxKvSG.js} +1 -1
- package/dist/assets/{all-charges-B53ChbBw.js → all-charges-BqRr5A4S.js} +1 -1
- package/dist/assets/{arrow-up-down-BMWCHusr.js → arrow-up-down-DB7wmydC.js} +1 -1
- package/dist/assets/{building-2-DvOC_0Kc.js → building-2-BUBxSuvf.js} +1 -1
- package/dist/assets/{business-C6EHWbDo.js → business-B33OdXng.js} +1 -1
- package/dist/assets/{business-extended-info-zo9fuTOe.js → business-extended-info-C3BaFkvQ.js} +1 -1
- package/dist/assets/{business-header-KFCqFju_.js → business-header-DH34C-UW.js} +1 -1
- package/dist/assets/{business-ledger-filters-CmCpp7PJ.js → business-ledger-filters-C_W4Kia6.js} +1 -1
- package/dist/assets/{business-ledger-single-DZyFn40E.js → business-ledger-single-CLw2fXXF.js} +1 -1
- package/dist/assets/{business-trip-Beo5bB1g.js → business-trip-BDIbjeVM.js} +1 -1
- package/dist/assets/{charge-Cvrsuvam.js → charge-BZqb4exj.js} +1 -1
- package/dist/assets/{charges-filters-BcdlXxSE.js → charges-filters-f-jBUxw-.js} +1 -1
- package/dist/assets/{charges-ledger-validation-K5bGVbfd.js → charges-ledger-validation-vQXFL31X.js} +1 -1
- package/dist/assets/{charges-table-BE8zAChh.js → charges-table-CYqBhSR-.js} +3 -3
- package/dist/assets/{chart-DyrsWjc9.js → chart-D-802gvL.js} +1 -1
- package/dist/assets/{contracts-CjRjQCRY.js → contracts-40v4c5wb.js} +1 -1
- package/dist/assets/{data-table-column-header-BN5-dHgb.js → data-table-column-header-RVA6DnfK.js} +1 -1
- package/dist/assets/{data-table-pagination-Dncu-pMI.js → data-table-pagination-UNpJ4XY4.js} +1 -1
- package/dist/assets/{deposits-transactions-table-D3Sw0OgH.js → deposits-transactions-table-CcCuygQV.js} +1 -1
- package/dist/assets/{download-csv-button-BzrwomIw.js → download-csv-button-C_FDbZVI.js} +1 -1
- package/dist/assets/{editable-business-trip-TNouMmtc.js → editable-business-trip-D7udcq6I.js} +1 -1
- package/dist/assets/{eye-off-Ct63cJU6.js → eye-off-A1glr3Lh.js} +1 -1
- package/dist/assets/{funnel-BpdROO69.js → funnel-BFG62oJX.js} +1 -1
- package/dist/assets/{index-B3P9rJGf.js → index-BANZ4FYC.js} +1 -1
- package/dist/assets/{index-CNNawG6D.js → index-BWAOW53d.js} +4 -4
- package/dist/assets/{index-CAoIWd0f.js → index-BXi4oDGN.js} +1 -1
- package/dist/assets/{index-fvfqfHgx.js → index-BhoUb_ON.js} +1 -1
- package/dist/assets/{index-VOgo1b_w.js → index-Bk6qb18g.js} +1 -1
- package/dist/assets/{index-DfyBVta3.js → index-BlXqh5bw.js} +1 -1
- package/dist/assets/{index-D0OFipbT.js → index-Bps1VY5w.js} +1 -1
- package/dist/assets/{index-BvqzqML_.js → index-CR08bGyj.js} +1 -1
- package/dist/assets/{index-i7Yf0n3Q.js → index-CV3eOseE.js} +1 -1
- package/dist/assets/{index-B4XWvHSY.js → index-C_D1SRFk.js} +1 -1
- package/dist/assets/{index-DDqBw1FZ.js → index-CcCOZohd.js} +1 -1
- package/dist/assets/{index-BgpzfaeJ.js → index-Clz8I9dK.js} +1 -1
- package/dist/assets/{index-CJ5SOHQ0.js → index-Cwq6ofsb.js} +1 -1
- package/dist/assets/{index-sl9J9RIm.js → index-DJDErZF_.js} +1 -1
- package/dist/assets/{index-1q5Bty_H.js → index-DLnIlpCq.js} +1 -1
- package/dist/assets/{index-DCrzzRDf.js → index-DhMdXJus.js} +1 -1
- package/dist/assets/{index-DWeUM89g.js → index-Djgjvx0H.js} +1 -1
- package/dist/assets/{index-C6PQh6Al.js → index-DqYn-i8w.js} +1 -1
- package/dist/assets/{index-lbcY8WB_.js → index-HOYMUDFE.js} +1 -1
- package/dist/assets/{index-LWqbIc1T.js → index-_JHX2B8O.js} +1 -1
- package/dist/assets/{index-CIRmhdDG.js → index-_kREhIPr.js} +1 -1
- package/dist/assets/{index-ComDmMDN.js → index-b-MiIoC6.js} +1 -1
- package/dist/assets/{index-Bpv_EQpT.js → index-hOl2Gwvk.js} +1 -1
- package/dist/assets/{index-CIoirABN.js → index-iu4sjTwc.js} +1 -1
- package/dist/assets/{index-Cs_wIQni.js → index-nugs82ok.js} +1 -1
- package/dist/assets/{index-D4AHtEfm.js → index-qqIdqRd-.js} +1 -1
- package/dist/assets/{index.es-BB65ERNg.js → index.es-DTX7vrgg.js} +1 -1
- package/dist/assets/{insert-business-trip-modal-CLVLw7m4.js → insert-business-trip-modal-C4MiJk_g.js} +1 -1
- package/dist/assets/issue-document-DlLf2ULj.js +1 -0
- package/dist/assets/{list-plus-wSEH8ky8.js → list-plus-C0XPnNVe.js} +1 -1
- package/dist/assets/{login-page-CQJsxqwG.js → login-page-Ck5nqn-L.js} +1 -1
- package/dist/assets/{match-document-modal-BVyNTaxu.js → match-document-modal-B8E3M5F6.js} +1 -1
- package/dist/assets/{missing-info-charges-DJbVpU3F.js → missing-info-charges-DGgTFt-D.js} +1 -1
- package/dist/assets/{modal-BghEq_eS.js → modal-DGBtDZun.js} +1 -1
- package/dist/assets/{modify-contract-dialog-DP5g5ngT.js → modify-contract-dialog-BoLoZhIr.js} +1 -1
- package/dist/assets/{page-layout-Dne17xLZ.js → page-layout-Ck_xKyt0.js} +1 -1
- package/dist/assets/{page-not-found-BoSNUBMS.js → page-not-found-BTbs3XmD.js} +1 -1
- package/dist/assets/{panel-top-open-muCAuRMw.js → panel-top-open-EMjzc-ww.js} +1 -1
- package/dist/assets/{report-commentary-row-Ch8YqjGk.js → report-commentary-row-C0J-6IpH.js} +1 -1
- package/dist/assets/{save-CY8EeuE7.js → save-BMNpevK9.js} +1 -1
- package/dist/assets/{similar-transactions-modal-vucNNAQ7.js → similar-transactions-modal--yMHokZr.js} +1 -1
- package/dist/assets/{sub-CjP3ABDx.js → sub-B9GwcGJi.js} +1 -1
- package/dist/assets/subMonths-KzuARV4a.js +1 -0
- package/dist/assets/{summary-CoPnqTel.js → summary-BU7IrLve.js} +1 -1
- package/dist/assets/{toggle-expansion-button-wmsjVpKZ.js → toggle-expansion-button-wXVsrHLI.js} +1 -1
- package/dist/assets/{use-issue-monthly-documents-CP0FLnjj.js → use-issue-monthly-documents-DEVr0ix_.js} +1 -1
- package/dist/assets/{use-url-query-D4K72DMD.js → use-url-query-DG-wQ19o.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/src/components/charges/charge-extended-info.tsx +11 -14
- package/src/components/documents-table/cells/creditor.tsx +1 -1
- package/src/components/documents-table/cells/debtor.tsx +1 -1
- package/src/components/documents-table/cells/description.tsx +1 -1
- package/src/components/documents-table/cells/remarks.tsx +1 -1
- package/src/components/documents-table/cells/type.tsx +1 -1
- package/dist/assets/issue-document-8tNe2T1W.js +0 -1
- package/dist/assets/subMonths-I2NCK3sY.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/all-charges-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/all-charges-BqRr5A4S.js","assets/use-url-query-DG-wQ19o.js","assets/charges-filters-f-jBUxw-.js","assets/modal-DGBtDZun.js","assets/funnel-BFG62oJX.js","assets/sub-B9GwcGJi.js","assets/addDays-z7yxKvSG.js","assets/subMonths-KzuARV4a.js","assets/MultiSelect-BLtBUfDG.js","assets/charges-table-CYqBhSR-.js","assets/toggle-expansion-button-wXVsrHLI.js","assets/panel-top-open-EMjzc-ww.js","assets/index-DLnIlpCq.js","assets/similar-transactions-modal--yMHokZr.js","assets/list-plus-C0XPnNVe.js","assets/Table-LzLjpZeA.js","assets/summary-BU7IrLve.js","assets/deposits-transactions-table-CcCuygQV.js","assets/Checkbox-Bqh8Rs3Y.js","assets/accordion-DY8sNVhh.js","assets/data-table-column-header-RVA6DnfK.js","assets/eye-off-A1glr3Lh.js","assets/match-document-modal-B8E3M5F6.js","assets/YearPickerInput-wefUMrNX.js","assets/insert-business-trip-modal-C4MiJk_g.js","assets/accounter-table-pB9Clv36.js","assets/page-layout-Ck_xKyt0.js","assets/missing-info-charges-DGgTFt-D.js","assets/charge-BZqb4exj.js","assets/charges-ledger-validation-vQXFL31X.js","assets/Progress-zdcZiq7-.js","assets/index-BhoUb_ON.js","assets/business-header-DH34C-UW.js","assets/building-2-BUBxSuvf.js","assets/business-B33OdXng.js","assets/save-BMNpevK9.js","assets/business-extended-info-C3BaFkvQ.js","assets/download-csv-button-C_FDbZVI.js","assets/chart-D-802gvL.js","assets/sequential-CAnleQny.js","assets/modify-contract-dialog-BoLoZhIr.js","assets/use-issue-monthly-documents-DEVr0ix_.js","assets/index-Clz8I9dK.js","assets/business-ledger-filters-C_W4Kia6.js","assets/business-ledger-single-CLw2fXXF.js","assets/contracts-40v4c5wb.js","assets/index-Bk6qb18g.js","assets/editable-business-trip-D7udcq6I.js","assets/business-trip-BDIbjeVM.js","assets/index-DJDErZF_.js","assets/index-C_D1SRFk.js","assets/Typography-DemEN63p.js","assets/index-CR08bGyj.js","assets/data-table-pagination-UNpJ4XY4.js","assets/arrow-up-down-DB7wmydC.js","assets/issue-document-DlLf2ULj.js","assets/index-BXi4oDGN.js","assets/index-BANZ4FYC.js","assets/index-b-MiIoC6.js","assets/index-iu4sjTwc.js","assets/graphql-document-dedupe-fragments-ByT8-wlV.js","assets/index-_JHX2B8O.js","assets/report-commentary-row-C0J-6IpH.js","assets/index-_kREhIPr.js","assets/index-CV3eOseE.js","assets/index-DqYn-i8w.js","assets/index-Bps1VY5w.js","assets/index-DhMdXJus.js","assets/index-Djgjvx0H.js","assets/index-CcCOZohd.js","assets/index-Cwq6ofsb.js","assets/accountant-approvals-DtBIRZC5.js","assets/index-BlXqh5bw.js","assets/index-HOYMUDFE.js","assets/index-hOl2Gwvk.js","assets/index-qqIdqRd-.js","assets/index-nugs82ok.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
var i$=t=>{throw TypeError(t)};var gB=(t,e,n)=>e.has(t)||i$("Cannot "+n);var jr=(t,e,n)=>(gB(t,e,"read from private field"),n?n.call(t):e.get(t)),Kd=(t,e,n)=>e.has(t)?i$("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Qs=(t,e,n,i)=>(gB(t,e,"write to private field"),i?i.call(t,n):e.set(t,n),n),Wd=(t,e,n)=>(gB(t,e,"access private method"),n);var r$=(t,e,n,i)=>({set _(r){Qs(t,e,r,n)},get _(){return jr(t,e,i)}});function O0e(t,e){for(var n=0;n<e.length;n++){const i=e[n];if(typeof i!="string"&&!Array.isArray(i)){for(const r in i)if(r!=="default"&&!(r in t)){const a=Object.getOwnPropertyDescriptor(i,r);a&&Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:()=>i[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const a of r)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const a={};return r.integrity&&(a.integrity=r.integrity),r.referrerPolicy&&(a.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?a.credentials="include":r.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function i(r){if(r.ep)return;r.ep=!0;const a=n(r);fetch(r.href,a)}})();var bc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Jk(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function R0e(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var n=function i(){var r=!1;try{r=this instanceof i}catch{}return r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(i){var r=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(n,i,r.get?r:{enumerable:!0,get:function(){return t[i]}})}),n}var vB={exports:{}},Y0={};var a$;function P0e(){if(a$)return Y0;a$=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(i,r,a){var o=null;if(a!==void 0&&(o=""+a),r.key!==void 0&&(o=""+r.key),"key"in r){a={};for(var s in r)s!=="key"&&(a[s]=r[s])}else a=r;return r=a.ref,{$$typeof:t,type:i,key:o,ref:r!==void 0?r:null,props:a}}return Y0.Fragment=e,Y0.jsx=n,Y0.jsxs=n,Y0}var o$;function L0e(){return o$||(o$=1,vB.exports=P0e()),vB.exports}var y=L0e(),yB={exports:{}};function U0e(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var AX={exports:{}},Da=AX.exports={},su,lu;function AI(){throw new Error("setTimeout has not been defined")}function mI(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?su=setTimeout:su=AI}catch{su=AI}try{typeof clearTimeout=="function"?lu=clearTimeout:lu=mI}catch{lu=mI}})();function mX(t){if(su===setTimeout)return setTimeout(t,0);if((su===AI||!su)&&setTimeout)return su=setTimeout,setTimeout(t,0);try{return su(t,0)}catch{try{return su.call(null,t,0)}catch{return su.call(this,t,0)}}}function M0e(t){if(lu===clearTimeout)return clearTimeout(t);if((lu===mI||!lu)&&clearTimeout)return lu=clearTimeout,clearTimeout(t);try{return lu(t)}catch{try{return lu.call(null,t)}catch{return lu.call(this,t)}}}var Ef=[],Zg=!1,dh,Yw=-1;function $0e(){!Zg||!dh||(Zg=!1,dh.length?Ef=dh.concat(Ef):Yw=-1,Ef.length&&hX())}function hX(){if(!Zg){var t=mX($0e);Zg=!0;for(var e=Ef.length;e;){for(dh=Ef,Ef=[];++Yw<e;)dh&&dh[Yw].run();Yw=-1,e=Ef.length}dh=null,Zg=!1,M0e(t)}}Da.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];Ef.push(new pX(t,e)),Ef.length===1&&!Zg&&mX(hX)};function pX(t,e){this.fun=t,this.array=e}pX.prototype.run=function(){this.fun.apply(null,this.array)};Da.title="browser";Da.browser=!0;Da.env={};Da.argv=[];Da.version="";Da.versions={};function Mf(){}Da.on=Mf;Da.addListener=Mf;Da.once=Mf;Da.off=Mf;Da.removeListener=Mf;Da.removeAllListeners=Mf;Da.emit=Mf;Da.prependListener=Mf;Da.prependOnceListener=Mf;Da.listeners=function(t){return[]};Da.binding=function(t){throw new Error("process.binding is not supported")};Da.cwd=function(){return"/"};Da.chdir=function(t){throw new Error("process.chdir is not supported")};Da.umask=function(){return 0};var j0e=AX.exports;const bn=U0e(j0e);var qn={},s$;function Q0e(){if(s$)return qn;s$=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),o=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),f=Symbol.for("react.activity"),h=Symbol.iterator;function m(re){return re===null||typeof re!="object"?null:(re=h&&re[h]||re["@@iterator"],typeof re=="function"?re:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,b={};function k(re,L,j){this.props=re,this.context=L,this.refs=b,this.updater=j||g}k.prototype.isReactComponent={},k.prototype.setState=function(re,L){if(typeof re!="object"&&typeof re!="function"&&re!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,re,L,"setState")},k.prototype.forceUpdate=function(re){this.updater.enqueueForceUpdate(this,re,"forceUpdate")};function w(){}w.prototype=k.prototype;function x(re,L,j){this.props=re,this.context=L,this.refs=b,this.updater=j||g}var F=x.prototype=new w;F.constructor=x,v(F,k.prototype),F.isPureReactComponent=!0;var _=Array.isArray;function T(){}var B={H:null,A:null,T:null,S:null},O=Object.prototype.hasOwnProperty;function P(re,L,j){var $=j.ref;return{$$typeof:t,type:re,key:L,ref:$!==void 0?$:null,props:j}}function G(re,L){return P(re.type,L,re.props)}function U(re){return typeof re=="object"&&re!==null&&re.$$typeof===t}function R(re){var L={"=":"=0",":":"=2"};return"$"+re.replace(/[=:]/g,function(j){return L[j]})}var ee=/\/+/g;function K(re,L){return typeof re=="object"&&re!==null&&re.key!=null?R(""+re.key):L.toString(36)}function le(re){switch(re.status){case"fulfilled":return re.value;case"rejected":throw re.reason;default:switch(typeof re.status=="string"?re.then(T,T):(re.status="pending",re.then(function(L){re.status==="pending"&&(re.status="fulfilled",re.value=L)},function(L){re.status==="pending"&&(re.status="rejected",re.reason=L)})),re.status){case"fulfilled":return re.value;case"rejected":throw re.reason}}throw re}function H(re,L,j,$,Y){var Z=typeof re;(Z==="undefined"||Z==="boolean")&&(re=null);var W=!1;if(re===null)W=!0;else switch(Z){case"bigint":case"string":case"number":W=!0;break;case"object":switch(re.$$typeof){case t:case e:W=!0;break;case d:return W=re._init,H(W(re._payload),L,j,$,Y)}}if(W)return Y=Y(re),W=$===""?"."+K(re,0):$,_(Y)?(j="",W!=null&&(j=W.replace(ee,"$&/")+"/"),H(Y,L,j,"",function(Se){return Se})):Y!=null&&(U(Y)&&(Y=G(Y,j+(Y.key==null||re&&re.key===Y.key?"":(""+Y.key).replace(ee,"$&/")+"/")+W)),L.push(Y)),1;W=0;var fe=$===""?".":$+":";if(_(re))for(var ve=0;ve<re.length;ve++)$=re[ve],Z=fe+K($,ve),W+=H($,L,j,Z,Y);else if(ve=m(re),typeof ve=="function")for(re=ve.call(re),ve=0;!($=re.next()).done;)$=$.value,Z=fe+K($,ve++),W+=H($,L,j,Z,Y);else if(Z==="object"){if(typeof re.then=="function")return H(le(re),L,j,$,Y);throw L=String(re),Error("Objects are not valid as a React child (found: "+(L==="[object Object]"?"object with keys {"+Object.keys(re).join(", ")+"}":L)+"). If you meant to render a collection of children, use an array instead.")}return W}function te(re,L,j){if(re==null)return re;var $=[],Y=0;return H(re,$,"","",function(Z){return L.call(j,Z,Y++)}),$}function X(re){if(re._status===-1){var L=re._result;L=L(),L.then(function(j){(re._status===0||re._status===-1)&&(re._status=1,re._result=j)},function(j){(re._status===0||re._status===-1)&&(re._status=2,re._result=j)}),re._status===-1&&(re._status=0,re._result=L)}if(re._status===1)return re._result.default;throw re._result}var de=typeof reportError=="function"?reportError:function(re){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var L=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof re=="object"&&re!==null&&typeof re.message=="string"?String(re.message):String(re),error:re});if(!window.dispatchEvent(L))return}else if(typeof bn=="object"&&typeof bn.emit=="function"){bn.emit("uncaughtException",re);return}console.error(re)},xe={map:te,forEach:function(re,L,j){te(re,function(){L.apply(this,arguments)},j)},count:function(re){var L=0;return te(re,function(){L++}),L},toArray:function(re){return te(re,function(L){return L})||[]},only:function(re){if(!U(re))throw Error("React.Children.only expected to receive a single React element child.");return re}};return qn.Activity=f,qn.Children=xe,qn.Component=k,qn.Fragment=n,qn.Profiler=r,qn.PureComponent=x,qn.StrictMode=i,qn.Suspense=l,qn.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=B,qn.__COMPILER_RUNTIME={__proto__:null,c:function(re){return B.H.useMemoCache(re)}},qn.cache=function(re){return function(){return re.apply(null,arguments)}},qn.cacheSignal=function(){return null},qn.cloneElement=function(re,L,j){if(re==null)throw Error("The argument must be a React element, but you passed "+re+".");var $=v({},re.props),Y=re.key;if(L!=null)for(Z in L.key!==void 0&&(Y=""+L.key),L)!O.call(L,Z)||Z==="key"||Z==="__self"||Z==="__source"||Z==="ref"&&L.ref===void 0||($[Z]=L[Z]);var Z=arguments.length-2;if(Z===1)$.children=j;else if(1<Z){for(var W=Array(Z),fe=0;fe<Z;fe++)W[fe]=arguments[fe+2];$.children=W}return P(re.type,Y,$)},qn.createContext=function(re){return re={$$typeof:o,_currentValue:re,_currentValue2:re,_threadCount:0,Provider:null,Consumer:null},re.Provider=re,re.Consumer={$$typeof:a,_context:re},re},qn.createElement=function(re,L,j){var $,Y={},Z=null;if(L!=null)for($ in L.key!==void 0&&(Z=""+L.key),L)O.call(L,$)&&$!=="key"&&$!=="__self"&&$!=="__source"&&(Y[$]=L[$]);var W=arguments.length-2;if(W===1)Y.children=j;else if(1<W){for(var fe=Array(W),ve=0;ve<W;ve++)fe[ve]=arguments[ve+2];Y.children=fe}if(re&&re.defaultProps)for($ in W=re.defaultProps,W)Y[$]===void 0&&(Y[$]=W[$]);return P(re,Z,Y)},qn.createRef=function(){return{current:null}},qn.forwardRef=function(re){return{$$typeof:s,render:re}},qn.isValidElement=U,qn.lazy=function(re){return{$$typeof:d,_payload:{_status:-1,_result:re},_init:X}},qn.memo=function(re,L){return{$$typeof:c,type:re,compare:L===void 0?null:L}},qn.startTransition=function(re){var L=B.T,j={};B.T=j;try{var $=re(),Y=B.S;Y!==null&&Y(j,$),typeof $=="object"&&$!==null&&typeof $.then=="function"&&$.then(T,de)}catch(Z){de(Z)}finally{L!==null&&j.types!==null&&(L.types=j.types),B.T=L}},qn.unstable_useCacheRefresh=function(){return B.H.useCacheRefresh()},qn.use=function(re){return B.H.use(re)},qn.useActionState=function(re,L,j){return B.H.useActionState(re,L,j)},qn.useCallback=function(re,L){return B.H.useCallback(re,L)},qn.useContext=function(re){return B.H.useContext(re)},qn.useDebugValue=function(){},qn.useDeferredValue=function(re,L){return B.H.useDeferredValue(re,L)},qn.useEffect=function(re,L){return B.H.useEffect(re,L)},qn.useEffectEvent=function(re){return B.H.useEffectEvent(re)},qn.useId=function(){return B.H.useId()},qn.useImperativeHandle=function(re,L,j){return B.H.useImperativeHandle(re,L,j)},qn.useInsertionEffect=function(re,L){return B.H.useInsertionEffect(re,L)},qn.useLayoutEffect=function(re,L){return B.H.useLayoutEffect(re,L)},qn.useMemo=function(re,L){return B.H.useMemo(re,L)},qn.useOptimistic=function(re,L){return B.H.useOptimistic(re,L)},qn.useReducer=function(re,L,j){return B.H.useReducer(re,L,j)},qn.useRef=function(re){return B.H.useRef(re)},qn.useState=function(re){return B.H.useState(re)},qn.useSyncExternalStore=function(re,L,j){return B.H.useSyncExternalStore(re,L,j)},qn.useTransition=function(){return B.H.useTransition()},qn.version="19.2.3",qn}var l$;function m2(){return l$||(l$=1,yB.exports=Q0e()),yB.exports}var N=m2();const se=Jk(N),If=O0e({__proto__:null,default:se},[N]);var kB={exports:{}},X0={},bB={exports:{}},SB={};var c$;function H0e(){return c$||(c$=1,(function(t){function e(H,te){var X=H.length;H.push(te);e:for(;0<X;){var de=X-1>>>1,xe=H[de];if(0<r(xe,te))H[de]=te,H[X]=xe,X=de;else break e}}function n(H){return H.length===0?null:H[0]}function i(H){if(H.length===0)return null;var te=H[0],X=H.pop();if(X!==te){H[0]=X;e:for(var de=0,xe=H.length,re=xe>>>1;de<re;){var L=2*(de+1)-1,j=H[L],$=L+1,Y=H[$];if(0>r(j,X))$<xe&&0>r(Y,j)?(H[de]=Y,H[$]=X,de=$):(H[de]=j,H[L]=X,de=L);else if($<xe&&0>r(Y,X))H[de]=Y,H[$]=X,de=$;else break e}}return te}function r(H,te){var X=H.sortIndex-te.sortIndex;return X!==0?X:H.id-te.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;t.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();t.unstable_now=function(){return o.now()-s}}var l=[],c=[],d=1,f=null,h=3,m=!1,g=!1,v=!1,b=!1,k=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;function F(H){for(var te=n(c);te!==null;){if(te.callback===null)i(c);else if(te.startTime<=H)i(c),te.sortIndex=te.expirationTime,e(l,te);else break;te=n(c)}}function _(H){if(v=!1,F(H),!g)if(n(l)!==null)g=!0,T||(T=!0,R());else{var te=n(c);te!==null&&le(_,te.startTime-H)}}var T=!1,B=-1,O=5,P=-1;function G(){return b?!0:!(t.unstable_now()-P<O)}function U(){if(b=!1,T){var H=t.unstable_now();P=H;var te=!0;try{e:{g=!1,v&&(v=!1,w(B),B=-1),m=!0;var X=h;try{t:{for(F(H),f=n(l);f!==null&&!(f.expirationTime>H&&G());){var de=f.callback;if(typeof de=="function"){f.callback=null,h=f.priorityLevel;var xe=de(f.expirationTime<=H);if(H=t.unstable_now(),typeof xe=="function"){f.callback=xe,F(H),te=!0;break t}f===n(l)&&i(l),F(H)}else i(l);f=n(l)}if(f!==null)te=!0;else{var re=n(c);re!==null&&le(_,re.startTime-H),te=!1}}break e}finally{f=null,h=X,m=!1}te=void 0}}finally{te?R():T=!1}}}var R;if(typeof x=="function")R=function(){x(U)};else if(typeof MessageChannel<"u"){var ee=new MessageChannel,K=ee.port2;ee.port1.onmessage=U,R=function(){K.postMessage(null)}}else R=function(){k(U,0)};function le(H,te){B=k(function(){H(t.unstable_now())},te)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(H){H.callback=null},t.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<H?Math.floor(1e3/H):5},t.unstable_getCurrentPriorityLevel=function(){return h},t.unstable_next=function(H){switch(h){case 1:case 2:case 3:var te=3;break;default:te=h}var X=h;h=te;try{return H()}finally{h=X}},t.unstable_requestPaint=function(){b=!0},t.unstable_runWithPriority=function(H,te){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var X=h;h=H;try{return te()}finally{h=X}},t.unstable_scheduleCallback=function(H,te,X){var de=t.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?de+X:de):X=de,H){case 1:var xe=-1;break;case 2:xe=250;break;case 5:xe=1073741823;break;case 4:xe=1e4;break;default:xe=5e3}return xe=X+xe,H={id:d++,callback:te,priorityLevel:H,startTime:X,expirationTime:xe,sortIndex:-1},X>de?(H.sortIndex=X,e(c,H),n(l)===null&&H===n(c)&&(v?(w(B),B=-1):v=!0,le(_,X-de))):(H.sortIndex=xe,e(l,H),g||m||(g=!0,T||(T=!0,R()))),H},t.unstable_shouldYield=G,t.unstable_wrapCallback=function(H){var te=h;return function(){var X=h;h=te;try{return H.apply(this,arguments)}finally{h=X}}}})(SB)),SB}var d$;function z0e(){return d$||(d$=1,bB.exports=H0e()),bB.exports}var wB={exports:{}},zo={};var u$;function V0e(){if(u$)return zo;u$=1;var t=m2();function e(l){var c="https://react.dev/errors/"+l;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)c+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+l+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var i={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},r=Symbol.for("react.portal");function a(l,c,d){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:f==null?null:""+f,children:l,containerInfo:c,implementation:d}}var o=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function s(l,c){if(l==="font")return"";if(typeof c=="string")return c==="use-credentials"?c:""}return zo.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,zo.createPortal=function(l,c){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11)throw Error(e(299));return a(l,c,null,d)},zo.flushSync=function(l){var c=o.T,d=i.p;try{if(o.T=null,i.p=2,l)return l()}finally{o.T=c,i.p=d,i.d.f()}},zo.preconnect=function(l,c){typeof l=="string"&&(c?(c=c.crossOrigin,c=typeof c=="string"?c==="use-credentials"?c:"":void 0):c=null,i.d.C(l,c))},zo.prefetchDNS=function(l){typeof l=="string"&&i.d.D(l)},zo.preinit=function(l,c){if(typeof l=="string"&&c&&typeof c.as=="string"){var d=c.as,f=s(d,c.crossOrigin),h=typeof c.integrity=="string"?c.integrity:void 0,m=typeof c.fetchPriority=="string"?c.fetchPriority:void 0;d==="style"?i.d.S(l,typeof c.precedence=="string"?c.precedence:void 0,{crossOrigin:f,integrity:h,fetchPriority:m}):d==="script"&&i.d.X(l,{crossOrigin:f,integrity:h,fetchPriority:m,nonce:typeof c.nonce=="string"?c.nonce:void 0})}},zo.preinitModule=function(l,c){if(typeof l=="string")if(typeof c=="object"&&c!==null){if(c.as==null||c.as==="script"){var d=s(c.as,c.crossOrigin);i.d.M(l,{crossOrigin:d,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0})}}else c==null&&i.d.M(l)},zo.preload=function(l,c){if(typeof l=="string"&&typeof c=="object"&&c!==null&&typeof c.as=="string"){var d=c.as,f=s(d,c.crossOrigin);i.d.L(l,d,{crossOrigin:f,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0,type:typeof c.type=="string"?c.type:void 0,fetchPriority:typeof c.fetchPriority=="string"?c.fetchPriority:void 0,referrerPolicy:typeof c.referrerPolicy=="string"?c.referrerPolicy:void 0,imageSrcSet:typeof c.imageSrcSet=="string"?c.imageSrcSet:void 0,imageSizes:typeof c.imageSizes=="string"?c.imageSizes:void 0,media:typeof c.media=="string"?c.media:void 0})}},zo.preloadModule=function(l,c){if(typeof l=="string")if(c){var d=s(c.as,c.crossOrigin);i.d.m(l,{as:typeof c.as=="string"&&c.as!=="script"?c.as:void 0,crossOrigin:d,integrity:typeof c.integrity=="string"?c.integrity:void 0})}else i.d.m(l)},zo.requestFormReset=function(l){i.d.r(l)},zo.unstable_batchedUpdates=function(l,c){return l(c)},zo.useFormState=function(l,c,d){return o.H.useFormState(l,c,d)},zo.useFormStatus=function(){return o.H.useHostTransitionStatus()},zo.version="19.2.3",zo}var f$;function gX(){if(f$)return wB.exports;f$=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),wB.exports=V0e(),wB.exports}var A$;function G0e(){if(A$)return X0;A$=1;var t=z0e(),e=m2(),n=gX();function i(u){var A="https://react.dev/errors/"+u;if(1<arguments.length){A+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)A+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+u+"; visit "+A+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(u){return!(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11)}function a(u){var A=u,p=u;if(u.alternate)for(;A.return;)A=A.return;else{u=A;do A=u,(A.flags&4098)!==0&&(p=A.return),u=A.return;while(u)}return A.tag===3?p:null}function o(u){if(u.tag===13){var A=u.memoizedState;if(A===null&&(u=u.alternate,u!==null&&(A=u.memoizedState)),A!==null)return A.dehydrated}return null}function s(u){if(u.tag===31){var A=u.memoizedState;if(A===null&&(u=u.alternate,u!==null&&(A=u.memoizedState)),A!==null)return A.dehydrated}return null}function l(u){if(a(u)!==u)throw Error(i(188))}function c(u){var A=u.alternate;if(!A){if(A=a(u),A===null)throw Error(i(188));return A!==u?null:u}for(var p=u,S=A;;){var E=p.return;if(E===null)break;var I=E.alternate;if(I===null){if(S=E.return,S!==null){p=S;continue}break}if(E.child===I.child){for(I=E.child;I;){if(I===p)return l(E),u;if(I===S)return l(E),A;I=I.sibling}throw Error(i(188))}if(p.return!==S.return)p=E,S=I;else{for(var ce=!1,we=E.child;we;){if(we===p){ce=!0,p=E,S=I;break}if(we===S){ce=!0,S=E,p=I;break}we=we.sibling}if(!ce){for(we=I.child;we;){if(we===p){ce=!0,p=I,S=E;break}if(we===S){ce=!0,S=I,p=E;break}we=we.sibling}if(!ce)throw Error(i(189))}}if(p.alternate!==S)throw Error(i(190))}if(p.tag!==3)throw Error(i(188));return p.stateNode.current===p?u:A}function d(u){var A=u.tag;if(A===5||A===26||A===27||A===6)return u;for(u=u.child;u!==null;){if(A=d(u),A!==null)return A;u=u.sibling}return null}var f=Object.assign,h=Symbol.for("react.element"),m=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),x=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),G=Symbol.for("react.memo_cache_sentinel"),U=Symbol.iterator;function R(u){return u===null||typeof u!="object"?null:(u=U&&u[U]||u["@@iterator"],typeof u=="function"?u:null)}var ee=Symbol.for("react.client.reference");function K(u){if(u==null)return null;if(typeof u=="function")return u.$$typeof===ee?null:u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case v:return"Fragment";case k:return"Profiler";case b:return"StrictMode";case _:return"Suspense";case T:return"SuspenseList";case P:return"Activity"}if(typeof u=="object")switch(u.$$typeof){case g:return"Portal";case x:return u.displayName||"Context";case w:return(u._context.displayName||"Context")+".Consumer";case F:var A=u.render;return u=u.displayName,u||(u=A.displayName||A.name||"",u=u!==""?"ForwardRef("+u+")":"ForwardRef"),u;case B:return A=u.displayName||null,A!==null?A:K(u.type)||"Memo";case O:A=u._payload,u=u._init;try{return K(u(A))}catch{}}return null}var le=Array.isArray,H=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X={pending:!1,data:null,method:null,action:null},de=[],xe=-1;function re(u){return{current:u}}function L(u){0>xe||(u.current=de[xe],de[xe]=null,xe--)}function j(u,A){xe++,de[xe]=u.current,u.current=A}var $=re(null),Y=re(null),Z=re(null),W=re(null);function fe(u,A){switch(j(Z,A),j(Y,u),j($,null),A.nodeType){case 9:case 11:u=(u=A.documentElement)&&(u=u.namespaceURI)?FM(u):0;break;default:if(u=A.tagName,A=A.namespaceURI)A=FM(A),u=_M(A,u);else switch(u){case"svg":u=1;break;case"math":u=2;break;default:u=0}}L($),j($,u)}function ve(){L($),L(Y),L(Z)}function Se(u){u.memoizedState!==null&&j(W,u);var A=$.current,p=_M(A,u.type);A!==p&&(j(Y,u),j($,p))}function ae(u){Y.current===u&&(L($),L(Y)),W.current===u&&(L(W),G0._currentValue=X)}var oe,Ee;function Me(u){if(oe===void 0)try{throw Error()}catch(p){var A=p.stack.trim().match(/\n( *(at )?)/);oe=A&&A[1]||"",Ee=-1<p.stack.indexOf(`
|
|
3
3
|
at`)?" (<anonymous>)":-1<p.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
4
|
`+oe+u+Ee}var ge=!1;function ue(u,A){if(!u||ge)return"";ge=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var S={DetermineComponentFrameRoot:function(){try{if(A){var wt=function(){throw Error()};if(Object.defineProperty(wt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(wt,[])}catch(ft){var st=ft}Reflect.construct(u,[],wt)}else{try{wt.call()}catch(ft){st=ft}u.call(wt.prototype)}}else{try{throw Error()}catch(ft){st=ft}(wt=u())&&typeof wt.catch=="function"&&wt.catch(function(){})}}catch(ft){if(ft&&st&&typeof ft.stack=="string")return[ft.stack,st.stack]}return[null,null]}};S.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var E=Object.getOwnPropertyDescriptor(S.DetermineComponentFrameRoot,"name");E&&E.configurable&&Object.defineProperty(S.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var I=S.DetermineComponentFrameRoot(),ce=I[0],we=I[1];if(ce&&we){var $e=ce.split(`
|
|
@@ -141,7 +141,7 @@ T* `):M.join(` Tj
|
|
|
141
141
|
endobj\r
|
|
142
142
|
`},n.outline.count_r=function(i,r){for(var a=0;a<r.children.length;a++)i.count++,this.count_r(i,r.children[a]);return i.count}}])})(gn.API),(function(t){var e=[192,193,194,195,196,197,198,199];t.processJPEG=function(n,i,r,a,o,s){var l,c=this.decode.DCT_DECODE,d=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),g=f.length,v={width:0,height:0,numcomponents:1},b=4;b<g;b+=2){if(b+=m,e.indexOf(f.charCodeAt(b+1))!==-1){h=256*f.charCodeAt(b+5)+f.charCodeAt(b+6),v={width:256*f.charCodeAt(b+7)+f.charCodeAt(b+8),height:h,numcomponents:f.charCodeAt(b+9)};break}m=256*f.charCodeAt(b+2)+f.charCodeAt(b+3)}return v})(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}d={data:n,width:l.width,height:l.height,colorSpace:s,bitsPerComponent:8,filter:c,index:i,alias:r}}return d}})(gn.API),gn.API.processPNG=function(t,e,n,i){if(this.__addimage__.isArrayBuffer(t)&&(t=new Uint8Array(t)),this.__addimage__.isArrayBufferView(t)){var r,a=dGe(t,{checkCrc:!0}),o=a.width,s=a.height,l=a.channels,c=a.palette,d=a.depth;r=c&&l===1?(function(O){for(var P=O.width,G=O.height,U=O.data,R=O.palette,ee=O.depth,K=!1,le=[],H=[],te=void 0,X=!1,de=0,xe=0;xe<R.length;xe++){var re=XG(R[xe],4),L=re[0],j=re[1],$=re[2],Y=re[3];le.push(L,j,$),Y!=null&&(Y===0?(de++,H.length<1&&H.push(xe)):Y<255&&(X=!0))}if(X||de>1){K=!0,H=void 0;var Z=P*G;te=new Uint8Array(Z);for(var W=new DataView(U.buffer),fe=0;fe<Z;fe++){var ve=m4(W,fe,ee),Se=XG(R[ve],4)[3];te[fe]=Se}}else de===0&&(H=void 0);return{colorSpace:"Indexed",colorsPerPixel:1,sMaskBitsPerComponent:K?8:void 0,colorBytes:U,alphaBytes:te,needSMask:K,palette:le,mask:H}})(a):l===2||l===4?(function(O){for(var P=O.data,G=O.width,U=O.height,R=O.channels,ee=O.depth,K=R===2?"DeviceGray":"DeviceRGB",le=R-1,H=G*U,te=le,X=H*te,de=1*H,xe=Math.ceil(X*ee/8),re=Math.ceil(de*ee/8),L=new Uint8Array(xe),j=new Uint8Array(re),$=new DataView(P.buffer),Y=new DataView(L.buffer),Z=new DataView(j.buffer),W=!1,fe=0;fe<H;fe++){for(var ve=fe*R,Se=0;Se<te;Se++)nK(Y,m4($,ve+Se,ee),fe*te+Se,ee);var ae=m4($,ve+te,ee);ae<(1<<ee)-1&&(W=!0),nK(Z,ae,1*fe,ee)}return{colorSpace:K,colorsPerPixel:le,sMaskBitsPerComponent:W?ee:void 0,colorBytes:L,alphaBytes:j,needSMask:W}})(a):(function(O){var P=O.data,G=O.channels===1?"DeviceGray":"DeviceRGB";return{colorSpace:G,colorsPerPixel:G==="DeviceGray"?1:3,colorBytes:P instanceof Uint16Array?(function(U){for(var R=U.length,ee=new Uint8Array(2*R),K=new DataView(ee.buffer,ee.byteOffset,ee.byteLength),le=0;le<R;le++)K.setUint16(2*le,U[le],!1);return ee})(P):P,needSMask:!1}})(a);var f,h,m,g=r,v=g.colorSpace,b=g.colorsPerPixel,k=g.sMaskBitsPerComponent,w=g.colorBytes,x=g.alphaBytes,F=g.needSMask,_=g.palette,T=g.mask,B=null;return i!==gn.API.image_compression.NONE&&typeof xO=="function"?(B=(function(O){var P;switch(O){case gn.API.image_compression.FAST:P=11;break;case gn.API.image_compression.MEDIUM:P=13;break;case gn.API.image_compression.SLOW:P=14;break;default:P=12}return P})(i),f=this.decode.FLATE_DECODE,h="/Predictor ".concat(B," /Colors ").concat(b," /BitsPerComponent ").concat(d," /Columns ").concat(o),t=Xq(w,Math.ceil(o*b*d/8),b,d,i),F&&(m=Xq(x,Math.ceil(o*k/8),1,k,i))):(f=void 0,h=void 0,t=w,F&&(m=x)),(this.__addimage__.isArrayBuffer(t)||this.__addimage__.isArrayBufferView(t))&&(t=this.__addimage__.arrayBufferToBinaryString(t)),(m&&this.__addimage__.isArrayBuffer(m)||this.__addimage__.isArrayBufferView(m))&&(m=this.__addimage__.arrayBufferToBinaryString(m)),{alias:n,data:t,index:e,filter:f,decodeParameters:h,transparency:T,palette:_,sMask:m,predictor:B,width:o,height:s,bitsPerComponent:d,sMaskBitsPerComponent:k,colorSpace:v}}},(function(t){t.processGIF89A=function(e,n,i,r){var a=new DGe(e),o=a.width,s=a.height,l=[];a.decodeAndBlitFrameRGBA(0,l);var c={data:l,width:o,height:s},d=new h4(100).encode(c,100);return t.processJPEG.call(this,d,n,i,r)},t.processGIF87A=t.processGIF89A})(gn.API),rd.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 t=this.colors===0?1<<this.bitPP:this.colors;this.palette=new Array(t);for(var e=0;e<t;e++){var n=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),r=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0);this.palette[e]={red:r,green:i,blue:n,quad:a}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)},rd.prototype.parseBGR=function(){this.pos=this.offset;try{var t="bit"+this.bitPP,e=this.width*this.height*4;this.data=new Uint8Array(e),this[t]()}catch(n){wr.log("bit decode error:"+n)}},rd.prototype.bit1=function(){var t,e=Math.ceil(this.width/8),n=e%4;for(t=this.height-1;t>=0;t--){for(var i=this.bottom_up?t:this.height-1-t,r=0;r<e;r++)for(var a=this.datav.getUint8(this.pos++,!0),o=i*this.width*4+8*r*4,s=0;s<8&&8*r+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)}},rd.prototype.bit4=function(){for(var t=Math.ceil(this.width/2),e=t%4,n=this.height-1;n>=0;n--){for(var i=this.bottom_up?n:this.height-1-n,r=0;r<t;r++){var a=this.datav.getUint8(this.pos++,!0),o=i*this.width*4+2*r*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*r+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}e!==0&&(this.pos+=4-e)}},rd.prototype.bit8=function(){for(var t=this.width%4,e=this.height-1;e>=0;e--){for(var n=this.bottom_up?e:this.height-1-e,i=0;i<this.width;i++){var r=this.datav.getUint8(this.pos++,!0),a=n*this.width*4+4*i;if(r<this.palette.length){var o=this.palette[r];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}t!==0&&(this.pos+=4-t)}},rd.prototype.bit15=function(){for(var t=this.width%3,e=parseInt("11111",2),n=this.height-1;n>=0;n--){for(var i=this.bottom_up?n:this.height-1-n,r=0;r<this.width;r++){var a=this.datav.getUint16(this.pos,!0);this.pos+=2;var o=(a&e)/e*255|0,s=(a>>5&e)/e*255|0,l=(a>>10&e)/e*255|0,c=a>>15?255:0,d=i*this.width*4+4*r;this.data[d]=l,this.data[d+1]=s,this.data[d+2]=o,this.data[d+3]=c}this.pos+=t}},rd.prototype.bit16=function(){for(var t=this.width%3,e=parseInt("11111",2),n=parseInt("111111",2),i=this.height-1;i>=0;i--){for(var r=this.bottom_up?i:this.height-1-i,a=0;a<this.width;a++){var o=this.datav.getUint16(this.pos,!0);this.pos+=2;var s=(o&e)/e*255|0,l=(o>>5&n)/n*255|0,c=(o>>11)/e*255|0,d=r*this.width*4+4*a;this.data[d]=c,this.data[d+1]=l,this.data[d+2]=s,this.data[d+3]=255}this.pos+=t}},rd.prototype.bit24=function(){for(var t=this.height-1;t>=0;t--){for(var e=this.bottom_up?t:this.height-1-t,n=0;n<this.width;n++){var i=this.datav.getUint8(this.pos++,!0),r=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),o=e*this.width*4+4*n;this.data[o]=a,this.data[o+1]=r,this.data[o+2]=i,this.data[o+3]=255}this.pos+=this.width%4}},rd.prototype.bit32=function(){for(var t=this.height-1;t>=0;t--)for(var e=this.bottom_up?t:this.height-1-t,n=0;n<this.width;n++){var i=this.datav.getUint8(this.pos++,!0),r=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),o=this.datav.getUint8(this.pos++,!0),s=e*this.width*4+4*n;this.data[s]=a,this.data[s+1]=r,this.data[s+2]=i,this.data[s+3]=o}},rd.prototype.getData=function(){return this.data},(function(t){t.processBMP=function(e,n,i,r){var a=new rd(e,!1),o=a.width,s=a.height,l={data:a.getData(),width:o,height:s},c=new h4(100).encode(l,100);return t.processJPEG.call(this,c,n,i,r)}})(gn.API),rK.prototype.getData=function(){return this.data},(function(t){t.processWEBP=function(e,n,i,r){var a=new rK(e),o=a.width,s=a.height,l={data:a.getData(),width:o,height:s},c=new h4(100).encode(l,100);return t.processJPEG.call(this,c,n,i,r)}})(gn.API),gn.API.processRGBA=function(t,e,n){for(var i=t.data,r=i.length,a=new Uint8Array(r/4*3),o=new Uint8Array(r/4),s=0,l=0,c=0;c<r;c+=4){var d=i[c],f=i[c+1],h=i[c+2],m=i[c+3];a[s++]=d,a[s++]=f,a[s++]=h,o[l++]=m}var g=this.__addimage__.arrayBufferToBinaryString(a);return{alpha:this.__addimage__.arrayBufferToBinaryString(o),data:g,index:e,alias:n,colorSpace:"DeviceRGB",bitsPerComponent:8,width:t.width,height:t.height}},gn.API.setLanguage=function(t){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"}[t]!==void 0&&(this.internal.languageSettings.languageCode=t,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},kg=gn.API,yw=kg.getCharWidthsArray=function(t,e){var n,i,r=(e=e||{}).font||this.internal.getFont(),a=e.fontSize||this.internal.getFontSize(),o=e.charSpace||this.internal.getCharSpace(),s=e.widths?e.widths:r.metadata.Unicode.widths,l=s.fof?s.fof:1,c=e.kerning?e.kerning:r.metadata.Unicode.kerning,d=c.fof?c.fof:1,f=e.doKerning!==!1,h=0,m=t.length,g=0,v=s[0]||l,b=[];for(n=0;n<m;n++)i=t.charCodeAt(n),typeof r.metadata.widthOfString=="function"?b.push((r.metadata.widthOfGlyph(r.metadata.characterToGlyph(i))+o*(1e3/a)||0)/1e3):(h=f&&lr(c[i])==="object"&&!isNaN(parseInt(c[i][g],10))?c[i][g]/d:0,b.push((s[i]||v)/l+h)),g=i;return b},Kq=kg.getStringUnitWidth=function(t,e){var n=(e=e||{}).fontSize||this.internal.getFontSize(),i=e.font||this.internal.getFont(),r=e.charSpace||this.internal.getCharSpace();return kg.processArabic&&(t=kg.processArabic(t)),typeof i.metadata.widthOfString=="function"?i.metadata.widthOfString(t,n,r)/n:yw.apply(this,arguments).reduce(function(a,o){return a+o},0)},Wq=function(t,e,n,i){for(var r=[],a=0,o=t.length,s=0;a!==o&&s+e[a]<n;)s+=e[a],a++;r.push(t.slice(0,a));var l=a;for(s=0;a!==o;)s+e[a]>i&&(r.push(t.slice(l,a)),s=0,l=a),s+=e[a],a++;return l!==a&&r.push(t.slice(l,a)),r},Yq=function(t,e,n){n||(n={});var i,r,a,o,s,l,c,d=[],f=[d],h=n.textIndent||0,m=0,g=0,v=t.split(" "),b=yw.apply(this,[" ",n])[0];if(l=n.lineIndent===-1?v[0].length+2:n.lineIndent||0){var k=Array(l).join(" "),w=[];v.map(function(F){(F=F.split(/\s*\n/)).length>1?w=w.concat(F.map(function(_,T){return(T&&_.length?`
|
|
143
143
|
`:"")+_})):w.push(F[0])}),v=w,l=Kq.apply(this,[k,n])}for(a=0,o=v.length;a<o;a++){var x=0;if(i=v[a],l&&i[0]==`
|
|
144
|
-
`&&(i=i.substr(1),x=1),h+m+(g=(r=yw.apply(this,[i,n])).reduce(function(F,_){return F+_},0))>e||x){if(g>e){for(s=Wq.apply(this,[i,r,e-(h+m),e]),d.push(s.shift()),d=[s.pop()];s.length;)f.push([s.shift()]);g=r.slice(i.length-(d[0]?d[0].length:0)).reduce(function(F,_){return F+_},0)}else d=[i];f.push(d),h=g+l,m=b}else d.push(i),h+=m+g,m=b}return c=l?function(F,_){return(_?k:"")+F.join(" ")}:function(F){return F.join(" ")},f.map(c)},kg.splitTextToSize=function(t,e,n){var i,r=(n=n||{}).fontSize||this.internal.getFontSize(),a=(function(d){if(d.widths&&d.kerning)return{widths:d.widths,kerning:d.kerning};var f=this.internal.getFont(d.fontName,d.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);i=Array.isArray(t)?t:String(t).split(/\r?\n/);var o=1*this.internal.scaleFactor*e/r;a.textIndent=n.textIndent?1*n.textIndent*this.internal.scaleFactor/r:0,a.lineIndent=n.lineIndent;var s,l,c=[];for(s=0,l=i.length;s<l;s++)c=c.concat(Yq.apply(this,[i[s],o,a]));return c},(function(t){t.__fontmetrics__=t.__fontmetrics__||{};for(var e="0123456789abcdef",n="klmnopqrstuvwxyz",i={},r={},a=0;a<16;a++)i[n[a]]=e[a],r[e[a]]=n[a];var o=function(h){return"0x"+parseInt(h,10).toString(16)},s=t.__fontmetrics__.compress=function(h){var m,g,v,b,k=["{"];for(var w in h){if(m=h[w],isNaN(parseInt(w,10))?g="'"+w+"'":(w=parseInt(w,10),g=(g=o(w).slice(2)).slice(0,-1)+r[g.slice(-1)]),typeof m=="number")m<0?(v=o(m).slice(3),b="-"):(v=o(m).slice(2),b=""),v=b+v.slice(0,-1)+r[v.slice(-1)];else{if(lr(m)!=="object")throw new Error("Don't know what to do with value type "+lr(m)+".");v=s(m)}k.push(g+v)}return k.push("}"),k.join("")},l=t.__fontmetrics__.uncompress=function(h){if(typeof h!="string")throw new Error("Invalid argument passed to uncompress.");for(var m,g,v,b,k={},w=1,x=k,F=[],_="",T="",B=h.length-1,O=1;O<B;O+=1)(b=h[O])=="'"?m?(v=m.join(""),m=void 0):m=[]:m?m.push(b):b=="{"?(F.push([x,v]),x={},v=void 0):b=="}"?((g=F.pop())[0][g[1]]=x,v=void 0,x=g[0]):b=="-"?w=-1:v===void 0?i.hasOwnProperty(b)?(_+=i[b],v=parseInt(_,16)*w,w=1,_=""):_+=b:i.hasOwnProperty(b)?(T+=i[b],x[v]=parseInt(T,16)*w,w=1,v=void 0,T=""):T+=b;return k},c={codePages:["WinAnsiEncoding"],WinAnsiEncoding:l("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")},d={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}}}")}};t.events.push(["addFont",function(h){var m=h.font,g=f.Unicode[m.postScriptName];g&&(m.metadata.Unicode={},m.metadata.Unicode.widths=g.widths,m.metadata.Unicode.kerning=g.kerning);var v=d.Unicode[m.postScriptName];v&&(m.metadata.Unicode.encoding=v,m.encoding=v.codePages[0])}])})(gn.API),(function(t){var e=function(n){for(var i=n.length,r=new Uint8Array(i),a=0;a<i;a++)r[a]=n.charCodeAt(a);return r};t.API.events.push(["addFont",function(n){var i=void 0,r=n.font,a=n.instance;if(!r.isStandardFont){if(a===void 0)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+r.postScriptName+"').");if(typeof(i=a.existsFileInVFS(r.postScriptName)===!1?a.loadFile(r.postScriptName):a.getFileFromVFS(r.postScriptName))!="string")throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+r.postScriptName+"').");(function(o,s){s=/^\x00\x01\x00\x00/.test(s)?e(s):e(bN(s)),o.metadata=t.API.TTFFont.open(s),o.metadata.Unicode=o.metadata.Unicode||{encoding:{},kerning:{},widths:[]},o.metadata.glyIdsUsed=[0]})(r,i)}}])})(gn),gn.API.addSvgAsImage=function(t,e,n,i,r,a,o,s){if(isNaN(e)||isNaN(n))throw wr.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(i)||isNaN(r))throw wr.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=i,l.height=r;var c=l.getContext("2d");c.fillStyle="#fff",c.fillRect(0,0,l.width,l.height);var d={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},f=this;return(Qn.canvg?Promise.resolve(Qn.canvg):Ai(()=>import("./index.es-BB65ERNg.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,t,d)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(h){return h.render(d)}).then(function(){f.addImage(l.toDataURL("image/jpeg",1),e,n,i,r,o,s)})},gn.API.putTotalPages=function(t){var e,n=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(e=new RegExp(t,"g"),n=this.internal.getNumberOfPages()):(e=new RegExp(this.pdfEscape16(t,this.internal.getFont()),"g"),n=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var i=1;i<=this.internal.getNumberOfPages();i++)for(var r=0;r<this.internal.pages[i].length;r++)this.internal.pages[i][r]=this.internal.pages[i][r].replace(e,n);return this},gn.API.viewerPreferences=function(t,e){var n;t=t||{},e=e||!1;var i,r,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,d=0,f=0;function h(g,v){var b,k=!1;for(b=0;b<g.length;b+=1)g[b]===v&&(k=!0);return k}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,t==="reset"||e===!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(lr(t)==="object"){for(r in t)if(a=t[r],h(s,r)&&a!==void 0){if(n[r].type==="boolean"&&typeof a=="boolean")n[r].value=a;else if(n[r].type==="name"&&h(n[r].valueSet,a))n[r].value=a;else if(n[r].type==="integer"&&Number.isInteger(a))n[r].value=a;else if(n[r].type==="array"){for(c=0;c<a.length;c+=1)if(i=!0,a[c].length===1&&typeof a[c][0]=="number")l.push(String(a[c]-1));else if(a[c].length>1){for(d=0;d<a[c].length;d+=1)typeof a[c][d]!="number"&&(i=!1);i===!0&&l.push([a[c][0]-1,a[c][1]-1].join(" "))}n[r].value="["+l.join(" ")+"]"}else n[r].value=n[r].defaultValue;n[r].explicitSet=!0}}return this.internal.viewerpreferences.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){var g,v=[];for(g in n)n[g].explicitSet===!0&&(n[g].type==="name"?v.push("/"+g+" /"+n[g].value):v.push("/"+g+" "+n[g].value));v.length!==0&&this.internal.write(`/ViewerPreferences
|
|
144
|
+
`&&(i=i.substr(1),x=1),h+m+(g=(r=yw.apply(this,[i,n])).reduce(function(F,_){return F+_},0))>e||x){if(g>e){for(s=Wq.apply(this,[i,r,e-(h+m),e]),d.push(s.shift()),d=[s.pop()];s.length;)f.push([s.shift()]);g=r.slice(i.length-(d[0]?d[0].length:0)).reduce(function(F,_){return F+_},0)}else d=[i];f.push(d),h=g+l,m=b}else d.push(i),h+=m+g,m=b}return c=l?function(F,_){return(_?k:"")+F.join(" ")}:function(F){return F.join(" ")},f.map(c)},kg.splitTextToSize=function(t,e,n){var i,r=(n=n||{}).fontSize||this.internal.getFontSize(),a=(function(d){if(d.widths&&d.kerning)return{widths:d.widths,kerning:d.kerning};var f=this.internal.getFont(d.fontName,d.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);i=Array.isArray(t)?t:String(t).split(/\r?\n/);var o=1*this.internal.scaleFactor*e/r;a.textIndent=n.textIndent?1*n.textIndent*this.internal.scaleFactor/r:0,a.lineIndent=n.lineIndent;var s,l,c=[];for(s=0,l=i.length;s<l;s++)c=c.concat(Yq.apply(this,[i[s],o,a]));return c},(function(t){t.__fontmetrics__=t.__fontmetrics__||{};for(var e="0123456789abcdef",n="klmnopqrstuvwxyz",i={},r={},a=0;a<16;a++)i[n[a]]=e[a],r[e[a]]=n[a];var o=function(h){return"0x"+parseInt(h,10).toString(16)},s=t.__fontmetrics__.compress=function(h){var m,g,v,b,k=["{"];for(var w in h){if(m=h[w],isNaN(parseInt(w,10))?g="'"+w+"'":(w=parseInt(w,10),g=(g=o(w).slice(2)).slice(0,-1)+r[g.slice(-1)]),typeof m=="number")m<0?(v=o(m).slice(3),b="-"):(v=o(m).slice(2),b=""),v=b+v.slice(0,-1)+r[v.slice(-1)];else{if(lr(m)!=="object")throw new Error("Don't know what to do with value type "+lr(m)+".");v=s(m)}k.push(g+v)}return k.push("}"),k.join("")},l=t.__fontmetrics__.uncompress=function(h){if(typeof h!="string")throw new Error("Invalid argument passed to uncompress.");for(var m,g,v,b,k={},w=1,x=k,F=[],_="",T="",B=h.length-1,O=1;O<B;O+=1)(b=h[O])=="'"?m?(v=m.join(""),m=void 0):m=[]:m?m.push(b):b=="{"?(F.push([x,v]),x={},v=void 0):b=="}"?((g=F.pop())[0][g[1]]=x,v=void 0,x=g[0]):b=="-"?w=-1:v===void 0?i.hasOwnProperty(b)?(_+=i[b],v=parseInt(_,16)*w,w=1,_=""):_+=b:i.hasOwnProperty(b)?(T+=i[b],x[v]=parseInt(T,16)*w,w=1,v=void 0,T=""):T+=b;return k},c={codePages:["WinAnsiEncoding"],WinAnsiEncoding:l("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")},d={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}}}")}};t.events.push(["addFont",function(h){var m=h.font,g=f.Unicode[m.postScriptName];g&&(m.metadata.Unicode={},m.metadata.Unicode.widths=g.widths,m.metadata.Unicode.kerning=g.kerning);var v=d.Unicode[m.postScriptName];v&&(m.metadata.Unicode.encoding=v,m.encoding=v.codePages[0])}])})(gn.API),(function(t){var e=function(n){for(var i=n.length,r=new Uint8Array(i),a=0;a<i;a++)r[a]=n.charCodeAt(a);return r};t.API.events.push(["addFont",function(n){var i=void 0,r=n.font,a=n.instance;if(!r.isStandardFont){if(a===void 0)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+r.postScriptName+"').");if(typeof(i=a.existsFileInVFS(r.postScriptName)===!1?a.loadFile(r.postScriptName):a.getFileFromVFS(r.postScriptName))!="string")throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+r.postScriptName+"').");(function(o,s){s=/^\x00\x01\x00\x00/.test(s)?e(s):e(bN(s)),o.metadata=t.API.TTFFont.open(s),o.metadata.Unicode=o.metadata.Unicode||{encoding:{},kerning:{},widths:[]},o.metadata.glyIdsUsed=[0]})(r,i)}}])})(gn),gn.API.addSvgAsImage=function(t,e,n,i,r,a,o,s){if(isNaN(e)||isNaN(n))throw wr.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(i)||isNaN(r))throw wr.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=i,l.height=r;var c=l.getContext("2d");c.fillStyle="#fff",c.fillRect(0,0,l.width,l.height);var d={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},f=this;return(Qn.canvg?Promise.resolve(Qn.canvg):Ai(()=>import("./index.es-DTX7vrgg.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,t,d)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(h){return h.render(d)}).then(function(){f.addImage(l.toDataURL("image/jpeg",1),e,n,i,r,o,s)})},gn.API.putTotalPages=function(t){var e,n=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(e=new RegExp(t,"g"),n=this.internal.getNumberOfPages()):(e=new RegExp(this.pdfEscape16(t,this.internal.getFont()),"g"),n=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var i=1;i<=this.internal.getNumberOfPages();i++)for(var r=0;r<this.internal.pages[i].length;r++)this.internal.pages[i][r]=this.internal.pages[i][r].replace(e,n);return this},gn.API.viewerPreferences=function(t,e){var n;t=t||{},e=e||!1;var i,r,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,d=0,f=0;function h(g,v){var b,k=!1;for(b=0;b<g.length;b+=1)g[b]===v&&(k=!0);return k}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,t==="reset"||e===!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(lr(t)==="object"){for(r in t)if(a=t[r],h(s,r)&&a!==void 0){if(n[r].type==="boolean"&&typeof a=="boolean")n[r].value=a;else if(n[r].type==="name"&&h(n[r].valueSet,a))n[r].value=a;else if(n[r].type==="integer"&&Number.isInteger(a))n[r].value=a;else if(n[r].type==="array"){for(c=0;c<a.length;c+=1)if(i=!0,a[c].length===1&&typeof a[c][0]=="number")l.push(String(a[c]-1));else if(a[c].length>1){for(d=0;d<a[c].length;d+=1)typeof a[c][d]!="number"&&(i=!1);i===!0&&l.push([a[c][0]-1,a[c][1]-1].join(" "))}n[r].value="["+l.join(" ")+"]"}else n[r].value=n[r].defaultValue;n[r].explicitSet=!0}}return this.internal.viewerpreferences.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){var g,v=[];for(g in n)n[g].explicitSet===!0&&(n[g].type==="name"?v.push("/"+g+" /"+n[g].value):v.push("/"+g+" "+n[g].value));v.length!==0&&this.internal.write(`/ViewerPreferences
|
|
145
145
|
<<
|
|
146
146
|
`+v.join(`
|
|
147
147
|
`)+`
|
|
@@ -244,7 +244,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
244
244
|
`)){const a=document.createElement("div");a.append(r?document.createTextNode(r):document.createElement("br")),n.append(a)}return e.updateEdited({rect:this.getPDFRect(),popup:this._uiManager.hasCommentManager()||this.hasEditedComment?this.comment:{text:this.#e}}),n}resetAnnotationElement(e){super.resetAnnotationElement(e),e.resetEdited()}}class nn{static PRECISION=1e-4;toSVGPath(){Nr("Abstract method `toSVGPath` must be implemented.")}get box(){Nr("Abstract getter `box` must be implemented.")}serialize(e,n){Nr("Abstract method `serialize` must be implemented.")}static _rescale(e,n,i,r,a,o){o||=new Float32Array(e.length);for(let s=0,l=e.length;s<l;s+=2)o[s]=n+e[s]*r,o[s+1]=i+e[s+1]*a;return o}static _rescaleAndSwap(e,n,i,r,a,o){o||=new Float32Array(e.length);for(let s=0,l=e.length;s<l;s+=2)o[s]=n+e[s+1]*r,o[s+1]=i+e[s]*a;return o}static _translate(e,n,i,r){r||=new Float32Array(e.length);for(let a=0,o=e.length;a<o;a+=2)r[a]=n+e[a],r[a+1]=i+e[a+1];return r}static svgRound(e){return Math.round(e*1e4)}static _normalizePoint(e,n,i,r,a){switch(a){case 90:return[1-n/i,e/r];case 180:return[1-e/i,1-n/r];case 270:return[n/i,1-e/r];default:return[e/i,n/r]}}static _normalizePagePoint(e,n,i){switch(i){case 90:return[1-n,e];case 180:return[1-e,1-n];case 270:return[n,1-e];default:return[e,n]}}static createBezierPoints(e,n,i,r,a,o){return[(e+5*i)/6,(n+5*r)/6,(5*i+a)/6,(5*r+o)/6,(i+a)/2,(r+o)/2]}}class hh{#e;#t=[];#n;#i;#r=[];#o=new Float32Array(18);#a;#s;#c;#l;#f;#u;#A=[];static#p=8;static#h=2;static#d=hh.#p+hh.#h;constructor({x:e,y:n},i,r,a,o,s=0){this.#e=i,this.#u=a*r,this.#i=o,this.#o.set([NaN,NaN,NaN,NaN,e,n],6),this.#n=s,this.#l=hh.#p*r,this.#c=hh.#d*r,this.#f=r,this.#A.push(e,n)}isEmpty(){return isNaN(this.#o[8])}#m(){const e=this.#o.subarray(4,6),n=this.#o.subarray(16,18),[i,r,a,o]=this.#e;return[(this.#a+(e[0]-n[0])/2-i)/a,(this.#s+(e[1]-n[1])/2-r)/o,(this.#a+(n[0]-e[0])/2-i)/a,(this.#s+(n[1]-e[1])/2-r)/o]}add({x:e,y:n}){this.#a=e,this.#s=n;const[i,r,a,o]=this.#e;let[s,l,c,d]=this.#o.subarray(8,12);const f=e-c,h=n-d,m=Math.hypot(f,h);if(m<this.#c)return!1;const g=m-this.#l,v=g/m,b=v*f,k=v*h;let w=s,x=l;s=c,l=d,c+=b,d+=k,this.#A?.push(e,n);const F=-k/g,_=b/g,T=F*this.#u,B=_*this.#u;return this.#o.set(this.#o.subarray(2,8),0),this.#o.set([c+T,d+B],4),this.#o.set(this.#o.subarray(14,18),12),this.#o.set([c-T,d-B],16),isNaN(this.#o[6])?(this.#r.length===0&&(this.#o.set([s+T,l+B],2),this.#r.push(NaN,NaN,NaN,NaN,(s+T-i)/a,(l+B-r)/o),this.#o.set([s-T,l-B],14),this.#t.push(NaN,NaN,NaN,NaN,(s-T-i)/a,(l-B-r)/o)),this.#o.set([w,x,s,l,c,d],6),!this.isEmpty()):(this.#o.set([w,x,s,l,c,d],6),Math.abs(Math.atan2(x-l,w-s)-Math.atan2(k,b))<Math.PI/2?([s,l,c,d]=this.#o.subarray(2,6),this.#r.push(NaN,NaN,NaN,NaN,((s+c)/2-i)/a,((l+d)/2-r)/o),[s,l,w,x]=this.#o.subarray(14,18),this.#t.push(NaN,NaN,NaN,NaN,((w+s)/2-i)/a,((x+l)/2-r)/o),!0):([w,x,s,l,c,d]=this.#o.subarray(0,6),this.#r.push(((w+5*s)/6-i)/a,((x+5*l)/6-r)/o,((5*s+c)/6-i)/a,((5*l+d)/6-r)/o,((s+c)/2-i)/a,((l+d)/2-r)/o),[c,d,s,l,w,x]=this.#o.subarray(12,18),this.#t.push(((w+5*s)/6-i)/a,((x+5*l)/6-r)/o,((5*s+c)/6-i)/a,((5*l+d)/6-r)/o,((s+c)/2-i)/a,((l+d)/2-r)/o),!0))}toSVGPath(){if(this.isEmpty())return"";const e=this.#r,n=this.#t;if(isNaN(this.#o[6])&&!this.isEmpty())return this.#g();const i=[];i.push(`M${e[4]} ${e[5]}`);for(let r=6;r<e.length;r+=6)isNaN(e[r])?i.push(`L${e[r+4]} ${e[r+5]}`):i.push(`C${e[r]} ${e[r+1]} ${e[r+2]} ${e[r+3]} ${e[r+4]} ${e[r+5]}`);this.#v(i);for(let r=n.length-6;r>=6;r-=6)isNaN(n[r])?i.push(`L${n[r+4]} ${n[r+5]}`):i.push(`C${n[r]} ${n[r+1]} ${n[r+2]} ${n[r+3]} ${n[r+4]} ${n[r+5]}`);return this.#y(i),i.join(" ")}#g(){const[e,n,i,r]=this.#e,[a,o,s,l]=this.#m();return`M${(this.#o[2]-e)/i} ${(this.#o[3]-n)/r} L${(this.#o[4]-e)/i} ${(this.#o[5]-n)/r} L${a} ${o} L${s} ${l} L${(this.#o[16]-e)/i} ${(this.#o[17]-n)/r} L${(this.#o[14]-e)/i} ${(this.#o[15]-n)/r} Z`}#y(e){const n=this.#t;e.push(`L${n[4]} ${n[5]} Z`)}#v(e){const[n,i,r,a]=this.#e,o=this.#o.subarray(4,6),s=this.#o.subarray(16,18),[l,c,d,f]=this.#m();e.push(`L${(o[0]-n)/r} ${(o[1]-i)/a} L${l} ${c} L${d} ${f} L${(s[0]-n)/r} ${(s[1]-i)/a}`)}newFreeDrawOutline(e,n,i,r,a,o){return new tge(e,n,i,r,a,o)}getOutlines(){const e=this.#r,n=this.#t,i=this.#o,[r,a,o,s]=this.#e,l=new Float32Array((this.#A?.length??0)+2);for(let f=0,h=l.length-2;f<h;f+=2)l[f]=(this.#A[f]-r)/o,l[f+1]=(this.#A[f+1]-a)/s;if(l[l.length-2]=(this.#a-r)/o,l[l.length-1]=(this.#s-a)/s,isNaN(i[6])&&!this.isEmpty())return this.#x(l);const c=new Float32Array(this.#r.length+24+this.#t.length);let d=e.length;for(let f=0;f<d;f+=2){if(isNaN(e[f])){c[f]=c[f+1]=NaN;continue}c[f]=e[f],c[f+1]=e[f+1]}d=this.#b(c,d);for(let f=n.length-6;f>=6;f-=6)for(let h=0;h<6;h+=2){if(isNaN(n[f+h])){c[d]=c[d+1]=NaN,d+=2;continue}c[d]=n[f+h],c[d+1]=n[f+h+1],d+=2}return this.#w(c,d),this.newFreeDrawOutline(c,l,this.#e,this.#f,this.#n,this.#i)}#x(e){const n=this.#o,[i,r,a,o]=this.#e,[s,l,c,d]=this.#m(),f=new Float32Array(36);return f.set([NaN,NaN,NaN,NaN,(n[2]-i)/a,(n[3]-r)/o,NaN,NaN,NaN,NaN,(n[4]-i)/a,(n[5]-r)/o,NaN,NaN,NaN,NaN,s,l,NaN,NaN,NaN,NaN,c,d,NaN,NaN,NaN,NaN,(n[16]-i)/a,(n[17]-r)/o,NaN,NaN,NaN,NaN,(n[14]-i)/a,(n[15]-r)/o],0),this.newFreeDrawOutline(f,e,this.#e,this.#f,this.#n,this.#i)}#w(e,n){const i=this.#t;return e.set([NaN,NaN,NaN,NaN,i[4],i[5]],n),n+=6}#b(e,n){const i=this.#o.subarray(4,6),r=this.#o.subarray(16,18),[a,o,s,l]=this.#e,[c,d,f,h]=this.#m();return e.set([NaN,NaN,NaN,NaN,(i[0]-a)/s,(i[1]-o)/l,NaN,NaN,NaN,NaN,c,d,NaN,NaN,NaN,NaN,f,h,NaN,NaN,NaN,NaN,(r[0]-a)/s,(r[1]-o)/l],n),n+=24}}class tge extends nn{#e;#t=new Float32Array(4);#n;#i;#r;#o;#a;constructor(e,n,i,r,a,o){super(),this.#a=e,this.#r=n,this.#e=i,this.#o=r,this.#n=a,this.#i=o,this.firstPoint=[NaN,NaN],this.lastPoint=[NaN,NaN],this.#s(o);const[s,l,c,d]=this.#t;for(let f=0,h=e.length;f<h;f+=2)e[f]=(e[f]-s)/c,e[f+1]=(e[f+1]-l)/d;for(let f=0,h=n.length;f<h;f+=2)n[f]=(n[f]-s)/c,n[f+1]=(n[f+1]-l)/d}toSVGPath(){const e=[`M${this.#a[4]} ${this.#a[5]}`];for(let n=6,i=this.#a.length;n<i;n+=6){if(isNaN(this.#a[n])){e.push(`L${this.#a[n+4]} ${this.#a[n+5]}`);continue}e.push(`C${this.#a[n]} ${this.#a[n+1]} ${this.#a[n+2]} ${this.#a[n+3]} ${this.#a[n+4]} ${this.#a[n+5]}`)}return e.push("Z"),e.join(" ")}serialize([e,n,i,r],a){const o=i-e,s=r-n;let l,c;switch(a){case 0:l=nn._rescale(this.#a,e,r,o,-s),c=nn._rescale(this.#r,e,r,o,-s);break;case 90:l=nn._rescaleAndSwap(this.#a,e,n,o,s),c=nn._rescaleAndSwap(this.#r,e,n,o,s);break;case 180:l=nn._rescale(this.#a,i,n,-o,s),c=nn._rescale(this.#r,i,n,-o,s);break;case 270:l=nn._rescaleAndSwap(this.#a,i,r,-o,-s),c=nn._rescaleAndSwap(this.#r,i,r,-o,-s);break}return{outline:Array.from(l),points:[Array.from(c)]}}#s(e){const n=this.#a;let i=n[4],r=n[5];const a=[i,r,i,r];let o=i,s=r,l=i,c=r;const d=e?Math.max:Math.min,f=new Float32Array(4);for(let m=6,g=n.length;m<g;m+=6){const v=n[m+4],b=n[m+5];isNaN(n[m])?(Xt.pointBoundingBox(v,b,a),s>b?(o=v,s=b):s===b&&(o=d(o,v)),c<b?(l=v,c=b):c===b&&(l=d(l,v))):(f[0]=f[1]=1/0,f[2]=f[3]=-1/0,Xt.bezierBoundingBox(i,r,...n.slice(m,m+6),f),Xt.rectBoundingBox(f[0],f[1],f[2],f[3],a),s>f[1]?(o=f[0],s=f[1]):s===f[1]&&(o=d(o,f[0])),c<f[3]?(l=f[2],c=f[3]):c===f[3]&&(l=d(l,f[2]))),i=v,r=b}const h=this.#t;h[0]=a[0]-this.#n,h[1]=a[1]-this.#n,h[2]=a[2]-a[0]+2*this.#n,h[3]=a[3]-a[1]+2*this.#n,this.firstPoint=[o,s],this.lastPoint=[l,c]}get box(){return this.#t}newOutliner(e,n,i,r,a,o=0){return new hh(e,n,i,r,a,o)}getNewOutline(e,n){const[i,r,a,o]=this.#t,[s,l,c,d]=this.#e,f=a*c,h=o*d,m=i*c+s,g=r*d+l,v=this.newOutliner({x:this.#r[0]*f+m,y:this.#r[1]*h+g},this.#e,this.#o,e,this.#i,n??this.#n);for(let b=2;b<this.#r.length;b+=2)v.add({x:this.#r[b]*f+m,y:this.#r[b+1]*h+g});return v.getOutlines()}}class AR{#e;#t;#n;#i=[];#r=[];constructor(e,n=0,i=0,r=!0){const a=[1/0,1/0,-1/0,-1/0],o=10**-4;for(const{x:v,y:b,width:k,height:w}of e){const x=Math.floor((v-n)/o)*o,F=Math.ceil((v+k+n)/o)*o,_=Math.floor((b-n)/o)*o,T=Math.ceil((b+w+n)/o)*o,B=[x,_,T,!0],O=[F,_,T,!1];this.#i.push(B,O),Xt.rectBoundingBox(x,_,F,T,a)}const s=a[2]-a[0]+2*i,l=a[3]-a[1]+2*i,c=a[0]-i,d=a[1]-i;let f=r?-1/0:1/0,h=1/0;const m=this.#i.at(r?-1:-2),g=[m[0],m[2]];for(const v of this.#i){const[b,k,w,x]=v;!x&&r?k<h?(h=k,f=b):k===h&&(f=Math.max(f,b)):x&&!r&&(k<h?(h=k,f=b):k===h&&(f=Math.min(f,b))),v[0]=(b-c)/s,v[1]=(k-d)/l,v[2]=(w-d)/l}this.#e=new Float32Array([c,d,s,l]),this.#t=[f,h],this.#n=g}getOutlines(){this.#i.sort((n,i)=>n[0]-i[0]||n[1]-i[1]||n[2]-i[2]);const e=[];for(const n of this.#i)n[3]?(e.push(...this.#l(n)),this.#s(n)):(this.#c(n),e.push(...this.#l(n)));return this.#o(e)}#o(e){const n=[],i=new Set;for(const o of e){const[s,l,c]=o;n.push([s,l,o],[s,c,o])}n.sort((o,s)=>o[1]-s[1]||o[0]-s[0]);for(let o=0,s=n.length;o<s;o+=2){const l=n[o][2],c=n[o+1][2];l.push(c),c.push(l),i.add(l),i.add(c)}const r=[];let a;for(;i.size>0;){const o=i.values().next().value;let[s,l,c,d,f]=o;i.delete(o);let h=s,m=l;for(a=[s,c],r.push(a);;){let g;if(i.has(d))g=d;else if(i.has(f))g=f;else break;i.delete(g),[s,l,c,d,f]=g,h!==s&&(a.push(h,m,s,m===l?l:c),h=s),m=m===l?c:l}a.push(h,m)}return new not(r,this.#e,this.#t,this.#n)}#a(e){const n=this.#r;let i=0,r=n.length-1;for(;i<=r;){const a=i+r>>1,o=n[a][0];if(o===e)return a;o<e?i=a+1:r=a-1}return r+1}#s([,e,n]){const i=this.#a(e);this.#r.splice(i,0,[e,n])}#c([,e,n]){const i=this.#a(e);for(let r=i;r<this.#r.length;r++){const[a,o]=this.#r[r];if(a!==e)break;if(a===e&&o===n){this.#r.splice(r,1);return}}for(let r=i-1;r>=0;r--){const[a,o]=this.#r[r];if(a!==e)break;if(a===e&&o===n){this.#r.splice(r,1);return}}}#l(e){const[n,i,r]=e,a=[[n,i,r]],o=this.#a(r);for(let s=0;s<o;s++){const[l,c]=this.#r[s];for(let d=0,f=a.length;d<f;d++){const[,h,m]=a[d];if(!(c<=h||m<=l)){if(h>=l){if(m>c)a[d][1]=c;else{if(f===1)return[];a.splice(d,1),d--,f--}continue}a[d][2]=l,m>c&&a.push([n,c,m])}}}return a}}class not extends nn{#e;#t;constructor(e,n,i,r){super(),this.#t=e,this.#e=n,this.firstPoint=i,this.lastPoint=r}toSVGPath(){const e=[];for(const n of this.#t){let[i,r]=n;e.push(`M${i} ${r}`);for(let a=2;a<n.length;a+=2){const o=n[a],s=n[a+1];o===i?(e.push(`V${s}`),r=s):s===r&&(e.push(`H${o}`),i=o)}e.push("Z")}return e.join(" ")}serialize([e,n,i,r],a){const o=[],s=i-e,l=r-n;for(const c of this.#t){const d=new Array(c.length);for(let f=0;f<c.length;f+=2)d[f]=e+c[f]*s,d[f+1]=r-c[f+1]*l;o.push(d)}return o}get box(){return this.#e}get classNamesForOutlining(){return["highlightOutline"]}}class mR extends hh{newFreeDrawOutline(e,n,i,r,a,o){return new iot(e,n,i,r,a,o)}}class iot extends tge{newOutliner(e,n,i,r,a,o=0){return new mR(e,n,i,r,a,o)}}class xa extends Nn{#e=null;#t=0;#n;#i=null;#r=null;#o=null;#a=null;#s=0;#c=null;#l=null;#f=null;#u=!1;#A=null;#p=null;#h=null;#d="";#m;#g="";static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=12;static _type="highlight";static _editorType=Jn.HIGHLIGHT;static _freeHighlightId=-1;static _freeHighlight=null;static _freeHighlightClipId="";static get _keyboardManager(){const e=xa.prototype;return Yn(this,"_keyboardManager",new d1([[["ArrowLeft","mac+ArrowLeft"],e._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],e._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],e._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],e._moveCaret,{args:[3]}]]))}constructor(e){super({...e,name:"highlightEditor"}),this.color=e.color||xa._defaultColor,this.#m=e.thickness||xa._defaultThickness,this.opacity=e.opacity||xa._defaultOpacity,this.#n=e.boxes||null,this.#g=e.methodOfCreation||"",this.#d=e.text||"",this._isDraggable=!1,this.defaultL10nId="pdfjs-editor-highlight-editor",e.highlightId>-1?(this.#u=!0,this.#v(e),this.#k()):this.#n&&(this.#e=e.anchorNode,this.#t=e.anchorOffset,this.#a=e.focusNode,this.#s=e.focusOffset,this.#y(),this.#k(),this.rotate(this.rotation)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-highlight-added-alert")}get telemetryInitialData(){return{action:"added",type:this.#u?"free_highlight":"highlight",color:this._uiManager.getNonHCMColorName(this.color),thickness:this.#m,methodOfCreation:this.#g}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.getNonHCMColorName(this.color)}}static computeTelemetryFinalData(e){return{numberOfColors:e.get("color").size}}#y(){const e=new AR(this.#n,.001);this.#l=e.getOutlines(),[this.x,this.y,this.width,this.height]=this.#l.box;const n=new AR(this.#n,.0025,.001,this._uiManager.direction==="ltr");this.#o=n.getOutlines();const{firstPoint:i}=this.#l;this.#A=[(i[0]-this.x)/this.width,(i[1]-this.y)/this.height];const{lastPoint:r}=this.#o;this.#p=[(r[0]-this.x)/this.width,(r[1]-this.y)/this.height]}#v({highlightOutlines:e,highlightId:n,clipPathId:i}){this.#l=e;const r=1.5;if(this.#o=e.getNewOutline(this.#m/2+r,.0025),n>=0)this.#f=n,this.#i=i,this.parent.drawLayer.finalizeDraw(n,{bbox:e.box,path:{d:e.toSVGPath()}}),this.#h=this.parent.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:!0},bbox:this.#o.box,path:{d:this.#o.toSVGPath()}},!0);else if(this.parent){const f=this.parent.viewport.rotation;this.parent.drawLayer.updateProperties(this.#f,{bbox:xa.#N(this.#l.box,(f-this.rotation+360)%360),path:{d:e.toSVGPath()}}),this.parent.drawLayer.updateProperties(this.#h,{bbox:xa.#N(this.#o.box,f),path:{d:this.#o.toSVGPath()}})}const[a,o,s,l]=e.box;switch(this.rotation){case 0:this.x=a,this.y=o,this.width=s,this.height=l;break;case 90:{const[f,h]=this.parentDimensions;this.x=o,this.y=1-a,this.width=s*h/f,this.height=l*f/h;break}case 180:this.x=1-a,this.y=1-o,this.width=s,this.height=l;break;case 270:{const[f,h]=this.parentDimensions;this.x=1-o,this.y=a,this.width=s*h/f,this.height=l*f/h;break}}const{firstPoint:c}=e;this.#A=[(c[0]-a)/s,(c[1]-o)/l];const{lastPoint:d}=this.#o;this.#p=[(d[0]-a)/s,(d[1]-o)/l]}static initialize(e,n){Nn.initialize(e,n),xa._defaultColor||=n.highlightColors?.values().next().value||"#fff066"}static updateDefaultParams(e,n){switch(e){case Ci.HIGHLIGHT_COLOR:xa._defaultColor=n;break;case Ci.HIGHLIGHT_THICKNESS:xa._defaultThickness=n;break}}translateInPage(e,n){}get toolbarPosition(){return this.#p}get commentButtonPosition(){return this.#A}updateParams(e,n){switch(e){case Ci.HIGHLIGHT_COLOR:this.#x(n);break;case Ci.HIGHLIGHT_THICKNESS:this.#w(n);break}}static get defaultPropertiesToUpdate(){return[[Ci.HIGHLIGHT_COLOR,xa._defaultColor],[Ci.HIGHLIGHT_THICKNESS,xa._defaultThickness]]}get propertiesToUpdate(){return[[Ci.HIGHLIGHT_COLOR,this.color||xa._defaultColor],[Ci.HIGHLIGHT_THICKNESS,this.#m||xa._defaultThickness],[Ci.HIGHLIGHT_FREE,this.#u]]}onUpdatedColor(){this.parent?.drawLayer.updateProperties(this.#f,{root:{fill:this.color,"fill-opacity":this.opacity}}),this.#r?.updateColor(this.color),super.onUpdatedColor()}#x(e){const n=(a,o)=>{this.color=a,this.opacity=o,this.onUpdatedColor()},i=this.color,r=this.opacity;this.addCommands({cmd:n.bind(this,e,xa._defaultOpacity),undo:n.bind(this,i,r),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Ci.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.getNonHCMColorName(e)},!0)}#w(e){const n=this.#m,i=r=>{this.#m=r,this.#b(r)};this.addCommands({cmd:i.bind(this,e),undo:i.bind(this,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Ci.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:e},!0)}get toolbarButtons(){return this._uiManager.highlightColors?[["colorPicker",this.#r=new dc({editor:this})]]:super.toolbarButtons}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(this.#E())}getBaseTranslation(){return[0,0]}getRect(e,n){return super.getRect(e,n,this.#E())}onceAdded(e){this.annotationElementId||this.parent.addUndoableEditor(this),e&&this.div.focus()}remove(){this.#_(),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.#k(),this.isAttachedToDOM||this.parent.add(this)))}setParent(e){let n=!1;this.parent&&!e?this.#_():e&&(this.#k(e),n=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(e),this.show(this._isVisible),n&&this.select()}#b(e){this.#u&&(this.#v({highlightOutlines:this.#l.getNewOutline(e/2)}),this.fixAndSetPosition(),this.setDims())}#_(){this.#f===null||!this.parent||(this.parent.drawLayer.remove(this.#f),this.#f=null,this.parent.drawLayer.remove(this.#h),this.#h=null)}#k(e=this.parent){this.#f===null&&({id:this.#f,clipPathId:this.#i}=e.drawLayer.draw({bbox:this.#l.box,root:{viewBox:"0 0 1 1",fill:this.color,"fill-opacity":this.opacity},rootClass:{highlight:!0,free:this.#u},path:{d:this.#l.toSVGPath()}},!1,!0),this.#h=e.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:this.#u},bbox:this.#o.box,path:{d:this.#o.toSVGPath()}},this.#u),this.#c&&(this.#c.style.clipPath=this.#i))}static#N([e,n,i,r],a){switch(a){case 90:return[1-n-r,e,r,i];case 180:return[1-e-i,1-n-r,i,r];case 270:return[n,1-e-i,r,i]}return[e,n,i,r]}rotate(e){const{drawLayer:n}=this.parent;let i;this.#u?(e=(e-this.rotation+360)%360,i=xa.#N(this.#l.box,e)):i=xa.#N([this.x,this.y,this.width,this.height],e),n.updateProperties(this.#f,{bbox:i,root:{"data-main-rotation":e}}),n.updateProperties(this.#h,{bbox:xa.#N(this.#o.box,e),root:{"data-main-rotation":e}})}render(){if(this.div)return this.div;const e=super.render();this.#d&&(e.setAttribute("aria-label",this.#d),e.setAttribute("role","mark")),this.#u?e.classList.add("free"):this.div.addEventListener("keydown",this.#B.bind(this),{signal:this._uiManager._signal});const n=this.#c=document.createElement("div");return e.append(n),n.setAttribute("aria-hidden","true"),n.className="internal",n.style.clipPath=this.#i,this.setDims(),Bpe(this,this.#c,["pointerover","pointerleave"]),this.enableEditing(),e}pointerover(){this.isSelected||this.parent?.drawLayer.updateProperties(this.#h,{rootClass:{hovered:!0}})}pointerleave(){this.isSelected||this.parent?.drawLayer.updateProperties(this.#h,{rootClass:{hovered:!1}})}#B(e){xa._keyboardManager.exec(this,e)}_moveCaret(e){switch(this.parent.unselect(this),e){case 0:case 2:this.#C(!0);break;case 1:case 3:this.#C(!1);break}}#C(e){if(!this.#e)return;const n=window.getSelection();e?n.setPosition(this.#e,this.#t):n.setPosition(this.#a,this.#s)}select(){super.select(),this.#h&&this.parent?.drawLayer.updateProperties(this.#h,{rootClass:{hovered:!1,selected:!0}})}unselect(){super.unselect(),this.#h&&(this.parent?.drawLayer.updateProperties(this.#h,{rootClass:{selected:!1}}),this.#u||this.#C(!1))}get _mustFixPosition(){return!this.#u}show(e=this._isVisible){super.show(e),this.parent&&(this.parent.drawLayer.updateProperties(this.#f,{rootClass:{hidden:!e}}),this.parent.drawLayer.updateProperties(this.#h,{rootClass:{hidden:!e}}))}#E(){return this.#u?this.rotation:0}#L(){if(this.#u)return null;const[e,n]=this.pageDimensions,[i,r]=this.pageTranslation,a=this.#n,o=new Float32Array(a.length*8);let s=0;for(const{x:l,y:c,width:d,height:f}of a){const h=l*e+i,m=(1-c)*n+r;o[s]=o[s+4]=h,o[s+1]=o[s+3]=m,o[s+2]=o[s+6]=h+d*e,o[s+5]=o[s+7]=m-f*n,s+=8}return o}#T(e){return this.#l.serialize(e,this.#E())}static startHighlighting(e,n,{target:i,x:r,y:a}){const{x:o,y:s,width:l,height:c}=i.getBoundingClientRect(),d=new AbortController,f=e.combinedSignal(d),h=m=>{d.abort(),this.#U(e,m)};window.addEventListener("blur",h,{signal:f}),window.addEventListener("pointerup",h,{signal:f}),window.addEventListener("pointerdown",pa,{capture:!0,passive:!1,signal:f}),window.addEventListener("contextmenu",xc,{signal:f}),i.addEventListener("pointermove",this.#O.bind(this,e),{signal:f}),this._freeHighlight=new mR({x:r,y:a},[o,s,l,c],e.scale,this._defaultThickness/2,n,.001),{id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=e.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:this._defaultColor,"fill-opacity":this._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:this._freeHighlight.toSVGPath()}},!0,!0)}static#O(e,n){this._freeHighlight.add(n)&&e.drawLayer.updateProperties(this._freeHighlightId,{path:{d:this._freeHighlight.toSVGPath()}})}static#U(e,n){this._freeHighlight.isEmpty()?e.drawLayer.remove(this._freeHighlightId):e.createAndAddNewEditor(n,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""}static async deserialize(e,n,i){let r=null;if(e instanceof Jpe){const{data:{quadPoints:g,rect:v,rotation:b,id:k,color:w,opacity:x,popupRef:F,richText:_,contentsObj:T,creationDate:B,modificationDate:O},parent:{page:{pageNumber:P}}}=e;r=e={annotationType:Jn.HIGHLIGHT,color:Array.from(w),opacity:x,quadPoints:g,boxes:null,pageIndex:P-1,rect:v.slice(0),rotation:b,annotationElementId:k,id:k,deleted:!1,popupRef:F,richText:_,comment:T?.str||null,creationDate:B,modificationDate:O}}else if(e instanceof mU){const{data:{inkLists:g,rect:v,rotation:b,id:k,color:w,borderStyle:{rawWidth:x},popupRef:F,richText:_,contentsObj:T,creationDate:B,modificationDate:O},parent:{page:{pageNumber:P}}}=e;r=e={annotationType:Jn.HIGHLIGHT,color:Array.from(w),thickness:x,inkLists:g,boxes:null,pageIndex:P-1,rect:v.slice(0),rotation:b,annotationElementId:k,id:k,deleted:!1,popupRef:F,richText:_,comment:T?.str||null,creationDate:B,modificationDate:O}}const{color:a,quadPoints:o,inkLists:s,opacity:l}=e,c=await super.deserialize(e,n,i);c.color=Xt.makeHexColor(...a),c.opacity=l||1,s&&(c.#m=e.thickness),c._initialData=r,e.comment&&c.setCommentData(e);const[d,f]=c.pageDimensions,[h,m]=c.pageTranslation;if(o){const g=c.#n=[];for(let v=0;v<o.length;v+=8)g.push({x:(o[v]-h)/d,y:1-(o[v+1]-m)/f,width:(o[v+2]-o[v])/d,height:(o[v+1]-o[v+5])/f});c.#y(),c.#k(),c.rotate(c.rotation)}else if(s){c.#u=!0;const g=s[0],v={x:g[0]-h,y:f-(g[1]-m)},b=new mR(v,[0,0,d,f],1,c.#m/2,!0,.001);for(let x=0,F=g.length;x<F;x+=2)v.x=g[x]-h,v.y=f-(g[x+1]-m),b.add(v);const{id:k,clipPathId:w}=n.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:c.color,"fill-opacity":c._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:b.toSVGPath()}},!0,!0);c.#v({highlightOutlines:b.getOutlines(),highlightId:k,clipPathId:w}),c.#k(),c.rotate(c.parentRotation)}return c}serialize(e=!1){if(this.isEmpty()||e)return null;if(this.deleted)return this.serializeDeleted();const n=Nn._colorManager.convert(this._uiManager.getNonHCMColor(this.color)),i=super.serialize(e);return Object.assign(i,{color:n,opacity:this.opacity,thickness:this.#m,quadPoints:this.#L(),outlines:this.#T(i.rect)}),this.addComment(i),this.annotationElementId&&!this.#R(i)?null:(i.id=this.annotationElementId,i)}#R(e){const{color:n}=this._initialData;return this.hasEditedComment||e.color.some((i,r)=>i!==n[r])}renderAnnotationElement(e){return this.deleted?(e.hide(),null):(e.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}static canCreateNewEmptyEditor(){return!1}}class nge{#e=Object.create(null);updateProperty(e,n){this[e]=n,this.updateSVGProperty(e,n)}updateProperties(e){if(e)for(const[n,i]of Object.entries(e))n.startsWith("_")||this.updateProperty(n,i)}updateSVGProperty(e,n){this.#e[e]=n}toSVGProperties(){const e=this.#e;return this.#e=Object.create(null),{root:e}}reset(){this.#e=Object.create(null)}updateAll(e=this){this.updateProperties(e)}clone(){Nr("Not implemented")}}class Ki extends Nn{#e=null;#t;_colorPicker=null;_drawId=null;static _currentDrawId=-1;static _currentParent=null;static#n=null;static#i=null;static#r=null;static _INNER_MARGIN=3;constructor(e){super(e),this.#t=e.mustBeCommitted||!1,this._addOutlines(e)}onUpdatedColor(){this._colorPicker?.update(this.color),super.onUpdatedColor()}_addOutlines(e){e.drawOutlines&&(this.#o(e),this.#c())}#o({drawOutlines:e,drawId:n,drawingOptions:i}){this.#e=e,this._drawingOptions||=i,this.annotationElementId||this._uiManager.a11yAlert(`pdfjs-editor-${this.editorType}-added-alert`),n>=0?(this._drawId=n,this.parent.drawLayer.finalizeDraw(n,e.defaultProperties)):this._drawId=this.#a(e,this.parent),this.#u(e.box)}#a(e,n){const{id:i}=n.drawLayer.draw(Ki._mergeSVGProperties(this._drawingOptions.toSVGProperties(),e.defaultSVGProperties),!1,!1);return i}static _mergeSVGProperties(e,n){const i=new Set(Object.keys(e));for(const[r,a]of Object.entries(n))i.has(r)?Object.assign(e[r],a):e[r]=a;return e}static getDefaultDrawingOptions(e){Nr("Not implemented")}static get typesMap(){Nr("Not implemented")}static get isDrawer(){return!0}static get supportMultipleDrawings(){return!1}static updateDefaultParams(e,n){const i=this.typesMap.get(e);i&&this._defaultDrawingOptions.updateProperty(i,n),this._currentParent&&(Ki.#n.updateProperty(i,n),this._currentParent.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}updateParams(e,n){const i=this.constructor.typesMap.get(e);i&&this._updateProperty(e,i,n)}static get defaultPropertiesToUpdate(){const e=[],n=this._defaultDrawingOptions;for(const[i,r]of this.typesMap)e.push([i,n[r]]);return e}get propertiesToUpdate(){const e=[],{_drawingOptions:n}=this;for(const[i,r]of this.constructor.typesMap)e.push([i,n[r]]);return e}_updateProperty(e,n,i){const r=this._drawingOptions,a=r[n],o=s=>{r.updateProperty(n,s);const l=this.#e.updateProperty(n,s);l&&this.#u(l),this.parent?.drawLayer.updateProperties(this._drawId,r.toSVGProperties()),e===this.colorType&&this.onUpdatedColor()};this.addCommands({cmd:o.bind(this,i),undo:o.bind(this,a),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:e,overwriteIfSameType:!0,keepUndo:!0})}_onResizing(){this.parent?.drawLayer.updateProperties(this._drawId,Ki._mergeSVGProperties(this.#e.getPathResizingSVGProperties(this.#f()),{bbox:this.#A()}))}_onResized(){this.parent?.drawLayer.updateProperties(this._drawId,Ki._mergeSVGProperties(this.#e.getPathResizedSVGProperties(this.#f()),{bbox:this.#A()}))}_onTranslating(e,n){this.parent?.drawLayer.updateProperties(this._drawId,{bbox:this.#A()})}_onTranslated(){this.parent?.drawLayer.updateProperties(this._drawId,Ki._mergeSVGProperties(this.#e.getPathTranslatedSVGProperties(this.#f(),this.parentDimensions),{bbox:this.#A()}))}_onStartDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!0}})}_onStopDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!1}})}commit(){super.commit(),this.disableEditMode(),this.disableEditing()}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}getBaseTranslation(){return[0,0]}get isResizable(){return!0}onceAdded(e){this.annotationElementId||this.parent.addUndoableEditor(this),this._isDraggable=!0,this.#t&&(this.#t=!1,this.commit(),this.parent.setSelected(this),e&&this.isOnScreen&&this.div.focus())}remove(){this.#s(),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.#c(),this.#u(this.#e.box),this.isAttachedToDOM||this.parent.add(this)))}setParent(e){let n=!1;this.parent&&!e?(this._uiManager.removeShouldRescale(this),this.#s()):e&&(this._uiManager.addShouldRescale(this),this.#c(e),n=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(e),n&&this.select()}#s(){this._drawId===null||!this.parent||(this.parent.drawLayer.remove(this._drawId),this._drawId=null,this._drawingOptions.reset())}#c(e=this.parent){if(!(this._drawId!==null&&this.parent===e)){if(this._drawId!==null){this.parent.drawLayer.updateParent(this._drawId,e.drawLayer);return}this._drawingOptions.updateAll(),this._drawId=this.#a(this.#e,e)}}#l([e,n,i,r]){const{parentDimensions:[a,o],rotation:s}=this;switch(s){case 90:return[n,1-e,i*(o/a),r*(a/o)];case 180:return[1-e,1-n,i,r];case 270:return[1-n,e,i*(o/a),r*(a/o)];default:return[e,n,i,r]}}#f(){const{x:e,y:n,width:i,height:r,parentDimensions:[a,o],rotation:s}=this;switch(s){case 90:return[1-n,e,i*(a/o),r*(o/a)];case 180:return[1-e,1-n,i,r];case 270:return[n,1-e,i*(a/o),r*(o/a)];default:return[e,n,i,r]}}#u(e){[this.x,this.y,this.width,this.height]=this.#l(e),this.div&&(this.fixAndSetPosition(),this.setDims()),this._onResized()}#A(){const{x:e,y:n,width:i,height:r,rotation:a,parentRotation:o,parentDimensions:[s,l]}=this;switch((a*4+o)/90){case 1:return[1-n-r,e,r,i];case 2:return[1-e-i,1-n-r,i,r];case 3:return[n,1-e-i,r,i];case 4:return[e,n-i*(s/l),r*(l/s),i*(s/l)];case 5:return[1-n,e,i*(s/l),r*(l/s)];case 6:return[1-e-r*(l/s),1-n,r*(l/s),i*(s/l)];case 7:return[n-i*(s/l),1-e-r*(l/s),i*(s/l),r*(l/s)];case 8:return[e-i,n-r,i,r];case 9:return[1-n,e-i,r,i];case 10:return[1-e,1-n,i,r];case 11:return[n-r,1-e,r,i];case 12:return[e-r*(l/s),n,r*(l/s),i*(s/l)];case 13:return[1-n-i*(s/l),e-r*(l/s),i*(s/l),r*(l/s)];case 14:return[1-e,1-n-i*(s/l),r*(l/s),i*(s/l)];case 15:return[n,1-e,i*(s/l),r*(l/s)];default:return[e,n,i,r]}}rotate(){this.parent&&this.parent.drawLayer.updateProperties(this._drawId,Ki._mergeSVGProperties({bbox:this.#A()},this.#e.updateRotation((this.parentRotation-this.rotation+360)%360)))}onScaleChanging(){this.parent&&this.#u(this.#e.updateParentDimensions(this.parentDimensions,this.parent.scale))}static onScaleChangingWhenDrawing(){}render(){if(this.div)return this.div;let e,n;this._isCopy&&(e=this.x,n=this.y);const i=super.render();i.classList.add("draw");const r=document.createElement("div");return i.append(r),r.setAttribute("aria-hidden","true"),r.className="internal",this.setDims(),this._uiManager.addShouldRescale(this),this.disableEditing(),this._isCopy&&this._moveAfterPaste(e,n),i}static createDrawerInstance(e,n,i,r,a){Nr("Not implemented")}static startDrawing(e,n,i,r){const{target:a,offsetX:o,offsetY:s,pointerId:l,pointerType:c}=r;if(Xi.isInitializedAndDifferentPointerType(c))return;const{viewport:{rotation:d}}=e,{width:f,height:h}=a.getBoundingClientRect(),m=Ki.#i=new AbortController,g=e.combinedSignal(m);if(Xi.setPointer(c,l),window.addEventListener("pointerup",v=>{Xi.isSamePointerIdOrRemove(v.pointerId)&&this._endDraw(v)},{signal:g}),window.addEventListener("pointercancel",v=>{Xi.isSamePointerIdOrRemove(v.pointerId)&&this._currentParent.endDrawingSession()},{signal:g}),window.addEventListener("pointerdown",v=>{Xi.isSamePointerType(v.pointerType)&&(Xi.initializeAndAddPointerId(v.pointerId),Ki.#n.isCancellable()&&(Ki.#n.removeLastElement(),Ki.#n.isEmpty()?this._currentParent.endDrawingSession(!0):this._endDraw(null)))},{capture:!0,passive:!1,signal:g}),window.addEventListener("contextmenu",xc,{signal:g}),a.addEventListener("pointermove",this._drawMove.bind(this),{signal:g}),a.addEventListener("touchmove",v=>{Xi.isSameTimeStamp(v.timeStamp)&&pa(v)},{signal:g}),e.toggleDrawing(),n._editorUndoBar?.hide(),Ki.#n){e.drawLayer.updateProperties(this._currentDrawId,Ki.#n.startNew(o,s,f,h,d));return}n.updateUIForDefaultProperties(this),Ki.#n=this.createDrawerInstance(o,s,f,h,d),Ki.#r=this.getDefaultDrawingOptions(),this._currentParent=e,{id:this._currentDrawId}=e.drawLayer.draw(this._mergeSVGProperties(Ki.#r.toSVGProperties(),Ki.#n.defaultSVGProperties),!0,!1)}static _drawMove(e){if(Xi.isSameTimeStamp(e.timeStamp),!Ki.#n)return;const{offsetX:n,offsetY:i,pointerId:r}=e;if(Xi.isSamePointerId(r)){if(Xi.isUsingMultiplePointers()){this._endDraw(e);return}this._currentParent.drawLayer.updateProperties(this._currentDrawId,Ki.#n.add(n,i)),Xi.setTimeStamp(e.timeStamp),pa(e)}}static _cleanup(e){e&&(this._currentDrawId=-1,this._currentParent=null,Ki.#n=null,Ki.#r=null,Xi.clearTimeStamp()),Ki.#i&&(Ki.#i.abort(),Ki.#i=null,Xi.clearPointerIds())}static _endDraw(e){const n=this._currentParent;if(n){if(n.toggleDrawing(!0),this._cleanup(!1),e?.target===n.div&&n.drawLayer.updateProperties(this._currentDrawId,Ki.#n.end(e.offsetX,e.offsetY)),this.supportMultipleDrawings){const i=Ki.#n,r=this._currentDrawId,a=i.getLastElement();n.addCommands({cmd:()=>{n.drawLayer.updateProperties(r,i.setLastElement(a))},undo:()=>{n.drawLayer.updateProperties(r,i.removeLastElement())},mustExec:!1,type:Ci.DRAW_STEP});return}this.endDrawing(!1)}}static endDrawing(e){const n=this._currentParent;if(!n)return null;if(n.toggleDrawing(!0),n.cleanUndoStack(Ci.DRAW_STEP),!Ki.#n.isEmpty()){const{pageDimensions:[i,r],scale:a}=n,o=n.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,drawOutlines:Ki.#n.getOutlines(i*a,r*a,a,this._INNER_MARGIN),drawingOptions:Ki.#r,mustBeCommitted:!e});return this._cleanup(!0),o}return n.drawLayer.remove(this._currentDrawId),this._cleanup(!0),null}createDrawingOptions(e){}static deserializeDraw(e,n,i,r,a,o){Nr("Not implemented")}static async deserialize(e,n,i){const{rawDims:{pageWidth:r,pageHeight:a,pageX:o,pageY:s}}=n.viewport,l=this.deserializeDraw(o,s,r,a,this._INNER_MARGIN,e),c=await super.deserialize(e,n,i);return c.createDrawingOptions(e),c.#o({drawOutlines:l}),c.#c(),c.onScaleChanging(),c.rotate(),c}serializeDraw(e){const[n,i]=this.pageTranslation,[r,a]=this.pageDimensions;return this.#e.serialize([n,i,r,a],e)}renderAnnotationElement(e){return e.updateEdited({rect:this.getPDFRect()}),null}static canCreateNewEmptyEditor(){return!1}}class rot{#e=new Float64Array(6);#t;#n;#i;#r;#o;#a="";#s=0;#c=new f1;#l;#f;constructor(e,n,i,r,a,o){this.#l=i,this.#f=r,this.#i=a,this.#r=o,[e,n]=this.#u(e,n);const s=this.#t=[NaN,NaN,NaN,NaN,e,n];this.#o=[e,n],this.#n=[{line:s,points:this.#o}],this.#e.set(s,0)}updateProperty(e,n){e==="stroke-width"&&(this.#r=n)}#u(e,n){return nn._normalizePoint(e,n,this.#l,this.#f,this.#i)}isEmpty(){return!this.#n||this.#n.length===0}isCancellable(){return this.#o.length<=10}add(e,n){[e,n]=this.#u(e,n);const[i,r,a,o]=this.#e.subarray(2,6),s=e-a,l=n-o;return Math.hypot(this.#l*s,this.#f*l)<=2?null:(this.#o.push(e,n),isNaN(i)?(this.#e.set([a,o,e,n],2),this.#t.push(NaN,NaN,NaN,NaN,e,n),{path:{d:this.toSVGPath()}}):(isNaN(this.#e[0])&&this.#t.splice(6,6),this.#e.set([i,r,a,o,e,n],0),this.#t.push(...nn.createBezierPoints(i,r,a,o,e,n)),{path:{d:this.toSVGPath()}}))}end(e,n){const i=this.add(e,n);return i||(this.#o.length===2?{path:{d:this.toSVGPath()}}:null)}startNew(e,n,i,r,a){this.#l=i,this.#f=r,this.#i=a,[e,n]=this.#u(e,n);const o=this.#t=[NaN,NaN,NaN,NaN,e,n];this.#o=[e,n];const s=this.#n.at(-1);return s&&(s.line=new Float32Array(s.line),s.points=new Float32Array(s.points)),this.#n.push({line:o,points:this.#o}),this.#e.set(o,0),this.#s=0,this.toSVGPath(),null}getLastElement(){return this.#n.at(-1)}setLastElement(e){return this.#n?(this.#n.push(e),this.#t=e.line,this.#o=e.points,this.#s=0,{path:{d:this.toSVGPath()}}):this.#c.setLastElement(e)}removeLastElement(){if(!this.#n)return this.#c.removeLastElement();this.#n.pop(),this.#a="";for(let e=0,n=this.#n.length;e<n;e++){const{line:i,points:r}=this.#n[e];this.#t=i,this.#o=r,this.#s=0,this.toSVGPath()}return{path:{d:this.#a}}}toSVGPath(){const e=nn.svgRound(this.#t[4]),n=nn.svgRound(this.#t[5]);if(this.#o.length===2)return this.#a=`${this.#a} M ${e} ${n} Z`,this.#a;if(this.#o.length<=6){const r=this.#a.lastIndexOf("M");this.#a=`${this.#a.slice(0,r)} M ${e} ${n}`,this.#s=6}if(this.#o.length===4){const r=nn.svgRound(this.#t[10]),a=nn.svgRound(this.#t[11]);return this.#a=`${this.#a} L ${r} ${a}`,this.#s=12,this.#a}const i=[];this.#s===0&&(i.push(`M ${e} ${n}`),this.#s=6);for(let r=this.#s,a=this.#t.length;r<a;r+=6){const[o,s,l,c,d,f]=this.#t.slice(r,r+6).map(nn.svgRound);i.push(`C${o} ${s} ${l} ${c} ${d} ${f}`)}return this.#a+=i.join(" "),this.#s=this.#t.length,this.#a}getOutlines(e,n,i,r){const a=this.#n.at(-1);return a.line=new Float32Array(a.line),a.points=new Float32Array(a.points),this.#c.build(this.#n,e,n,i,this.#i,this.#r,r),this.#e=null,this.#t=null,this.#n=null,this.#a=null,this.#c}get defaultSVGProperties(){return{root:{viewBox:"0 0 10000 10000"},rootClass:{draw:!0},bbox:[0,0,1,1]}}}class f1 extends nn{#e;#t=0;#n;#i;#r;#o;#a;#s;#c;build(e,n,i,r,a,o,s){this.#r=n,this.#o=i,this.#a=r,this.#s=a,this.#c=o,this.#n=s??0,this.#i=e,this.#u()}get thickness(){return this.#c}setLastElement(e){return this.#i.push(e),{path:{d:this.toSVGPath()}}}removeLastElement(){return this.#i.pop(),{path:{d:this.toSVGPath()}}}toSVGPath(){const e=[];for(const{line:n}of this.#i){if(e.push(`M${nn.svgRound(n[4])} ${nn.svgRound(n[5])}`),n.length===6){e.push("Z");continue}if(n.length===12&&isNaN(n[6])){e.push(`L${nn.svgRound(n[10])} ${nn.svgRound(n[11])}`);continue}for(let i=6,r=n.length;i<r;i+=6){const[a,o,s,l,c,d]=n.subarray(i,i+6).map(nn.svgRound);e.push(`C${a} ${o} ${s} ${l} ${c} ${d}`)}}return e.join("")}serialize([e,n,i,r],a){const o=[],s=[],[l,c,d,f]=this.#f();let h,m,g,v,b,k,w,x,F;switch(this.#s){case 0:F=nn._rescale,h=e,m=n+r,g=i,v=-r,b=e+l*i,k=n+(1-c-f)*r,w=e+(l+d)*i,x=n+(1-c)*r;break;case 90:F=nn._rescaleAndSwap,h=e,m=n,g=i,v=r,b=e+c*i,k=n+l*r,w=e+(c+f)*i,x=n+(l+d)*r;break;case 180:F=nn._rescale,h=e+i,m=n,g=-i,v=r,b=e+(1-l-d)*i,k=n+c*r,w=e+(1-l)*i,x=n+(c+f)*r;break;case 270:F=nn._rescaleAndSwap,h=e+i,m=n+r,g=-i,v=-r,b=e+(1-c-f)*i,k=n+(1-l-d)*r,w=e+(1-c)*i,x=n+(1-l)*r;break}for(const{line:_,points:T}of this.#i)o.push(F(_,h,m,g,v,a?new Array(_.length):null)),s.push(F(T,h,m,g,v,a?new Array(T.length):null));return{lines:o,points:s,rect:[b,k,w,x]}}static deserialize(e,n,i,r,a,{paths:{lines:o,points:s},rotation:l,thickness:c}){const d=[];let f,h,m,g,v;switch(l){case 0:v=nn._rescale,f=-e/i,h=n/r+1,m=1/i,g=-1/r;break;case 90:v=nn._rescaleAndSwap,f=-n/r,h=-e/i,m=1/r,g=1/i;break;case 180:v=nn._rescale,f=e/i+1,h=-n/r,m=-1/i,g=1/r;break;case 270:v=nn._rescaleAndSwap,f=n/r+1,h=e/i+1,m=-1/r,g=-1/i;break}if(!o){o=[];for(const k of s){const w=k.length;if(w===2){o.push(new Float32Array([NaN,NaN,NaN,NaN,k[0],k[1]]));continue}if(w===4){o.push(new Float32Array([NaN,NaN,NaN,NaN,k[0],k[1],NaN,NaN,NaN,NaN,k[2],k[3]]));continue}const x=new Float32Array(3*(w-2));o.push(x);let[F,_,T,B]=k.subarray(0,4);x.set([NaN,NaN,NaN,NaN,F,_],0);for(let O=4;O<w;O+=2){const P=k[O],G=k[O+1];x.set(nn.createBezierPoints(F,_,T,B,P,G),(O-2)*3),[F,_,T,B]=[T,B,P,G]}}}for(let k=0,w=o.length;k<w;k++)d.push({line:v(o[k].map(x=>x??NaN),f,h,m,g),points:v(s[k].map(x=>x??NaN),f,h,m,g)});const b=new this.prototype.constructor;return b.build(d,i,r,1,l,c,a),b}#l(e=this.#c){const n=this.#n+e/2*this.#a;return this.#s%180===0?[n/this.#r,n/this.#o]:[n/this.#o,n/this.#r]}#f(){const[e,n,i,r]=this.#e,[a,o]=this.#l(0);return[e+a,n+o,i-2*a,r-2*o]}#u(){const e=this.#e=new Float32Array([1/0,1/0,-1/0,-1/0]);for(const{line:r}of this.#i){if(r.length<=12){for(let s=4,l=r.length;s<l;s+=6)Xt.pointBoundingBox(r[s],r[s+1],e);continue}let a=r[4],o=r[5];for(let s=6,l=r.length;s<l;s+=6){const[c,d,f,h,m,g]=r.subarray(s,s+6);Xt.bezierBoundingBox(a,o,c,d,f,h,m,g,e),a=m,o=g}}const[n,i]=this.#l();e[0]=hs(e[0]-n,0,1),e[1]=hs(e[1]-i,0,1),e[2]=hs(e[2]+n,0,1),e[3]=hs(e[3]+i,0,1),e[2]-=e[0],e[3]-=e[1]}get box(){return this.#e}updateProperty(e,n){return e==="stroke-width"?this.#A(n):null}#A(e){const[n,i]=this.#l();this.#c=e;const[r,a]=this.#l(),[o,s]=[r-n,a-i],l=this.#e;return l[0]-=o,l[1]-=s,l[2]+=2*o,l[3]+=2*s,l}updateParentDimensions([e,n],i){const[r,a]=this.#l();this.#r=e,this.#o=n,this.#a=i;const[o,s]=this.#l(),l=o-r,c=s-a,d=this.#e;return d[0]-=l,d[1]-=c,d[2]+=2*l,d[3]+=2*c,d}updateRotation(e){return this.#t=e,{path:{transform:this.rotationTransform}}}get viewBox(){return this.#e.map(nn.svgRound).join(" ")}get defaultProperties(){const[e,n]=this.#e;return{root:{viewBox:this.viewBox},path:{"transform-origin":`${nn.svgRound(e)} ${nn.svgRound(n)}`}}}get rotationTransform(){const[,,e,n]=this.#e;let i=0,r=0,a=0,o=0,s=0,l=0;switch(this.#t){case 90:r=n/e,a=-e/n,s=e;break;case 180:i=-1,o=-1,s=e,l=n;break;case 270:r=-n/e,a=e/n,l=n;break;default:return""}return`matrix(${i} ${r} ${a} ${o} ${nn.svgRound(s)} ${nn.svgRound(l)})`}getPathResizingSVGProperties([e,n,i,r]){const[a,o]=this.#l(),[s,l,c,d]=this.#e;if(Math.abs(c-a)<=nn.PRECISION||Math.abs(d-o)<=nn.PRECISION){const v=e+i/2-(s+c/2),b=n+r/2-(l+d/2);return{path:{"transform-origin":`${nn.svgRound(e)} ${nn.svgRound(n)}`,transform:`${this.rotationTransform} translate(${v} ${b})`}}}const f=(i-2*a)/(c-2*a),h=(r-2*o)/(d-2*o),m=c/i,g=d/r;return{path:{"transform-origin":`${nn.svgRound(s)} ${nn.svgRound(l)}`,transform:`${this.rotationTransform} scale(${m} ${g}) translate(${nn.svgRound(a)} ${nn.svgRound(o)}) scale(${f} ${h}) translate(${nn.svgRound(-a)} ${nn.svgRound(-o)})`}}}getPathResizedSVGProperties([e,n,i,r]){const[a,o]=this.#l(),s=this.#e,[l,c,d,f]=s;if(s[0]=e,s[1]=n,s[2]=i,s[3]=r,Math.abs(d-a)<=nn.PRECISION||Math.abs(f-o)<=nn.PRECISION){const b=e+i/2-(l+d/2),k=n+r/2-(c+f/2);for(const{line:w,points:x}of this.#i)nn._translate(w,b,k,w),nn._translate(x,b,k,x);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${nn.svgRound(e)} ${nn.svgRound(n)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}const h=(i-2*a)/(d-2*a),m=(r-2*o)/(f-2*o),g=-h*(l+a)+e+a,v=-m*(c+o)+n+o;if(h!==1||m!==1||g!==0||v!==0)for(const{line:b,points:k}of this.#i)nn._rescale(b,g,v,h,m,b),nn._rescale(k,g,v,h,m,k);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${nn.svgRound(e)} ${nn.svgRound(n)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}getPathTranslatedSVGProperties([e,n],i){const[r,a]=i,o=this.#e,s=e-o[0],l=n-o[1];if(this.#r===r&&this.#o===a)for(const{line:c,points:d}of this.#i)nn._translate(c,s,l,c),nn._translate(d,s,l,d);else{const c=this.#r/r,d=this.#o/a;this.#r=r,this.#o=a;for(const{line:f,points:h}of this.#i)nn._rescale(f,s,l,c,d,f),nn._rescale(h,s,l,c,d,h);o[2]*=c,o[3]*=d}return o[0]=e,o[1]=n,{root:{viewBox:this.viewBox},path:{d:this.toSVGPath(),"transform-origin":`${nn.svgRound(e)} ${nn.svgRound(n)}`}}}get defaultSVGProperties(){const e=this.#e;return{root:{viewBox:this.viewBox},rootClass:{draw:!0},path:{d:this.toSVGPath(),"transform-origin":`${nn.svgRound(e[0])} ${nn.svgRound(e[1])}`,transform:this.rotationTransform||null},bbox:e}}}class zC extends nge{constructor(e){super(),this._viewParameters=e,super.updateProperties({fill:"none",stroke:Nn._defaultLineColor,"stroke-opacity":1,"stroke-width":1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-miterlimit":10})}updateSVGProperty(e,n){e==="stroke-width"&&(n??=this["stroke-width"],n*=this._viewParameters.realScale),super.updateSVGProperty(e,n)}clone(){const e=new zC(this._viewParameters);return e.updateAll(this),e}}class pU extends Ki{static _type="ink";static _editorType=Jn.INK;static _defaultDrawingOptions=null;constructor(e){super({...e,name:"inkEditor"}),this._willKeepAspectRatio=!0,this.defaultL10nId="pdfjs-editor-ink-editor"}static initialize(e,n){Nn.initialize(e,n),this._defaultDrawingOptions=new zC(n.viewParameters)}static getDefaultDrawingOptions(e){const n=this._defaultDrawingOptions.clone();return n.updateProperties(e),n}static get supportMultipleDrawings(){return!0}static get typesMap(){return Yn(this,"typesMap",new Map([[Ci.INK_THICKNESS,"stroke-width"],[Ci.INK_COLOR,"stroke"],[Ci.INK_OPACITY,"stroke-opacity"]]))}static createDrawerInstance(e,n,i,r,a){return new rot(e,n,i,r,a,this._defaultDrawingOptions["stroke-width"])}static deserializeDraw(e,n,i,r,a,o){return f1.deserialize(e,n,i,r,a,o)}static async deserialize(e,n,i){let r=null;if(e instanceof mU){const{data:{inkLists:o,rect:s,rotation:l,id:c,color:d,opacity:f,borderStyle:{rawWidth:h},popupRef:m,richText:g,contentsObj:v,creationDate:b,modificationDate:k},parent:{page:{pageNumber:w}}}=e;r=e={annotationType:Jn.INK,color:Array.from(d),thickness:h,opacity:f,paths:{points:o},boxes:null,pageIndex:w-1,rect:s.slice(0),rotation:l,annotationElementId:c,id:c,deleted:!1,popupRef:m,richText:g,comment:v?.str||null,creationDate:b,modificationDate:k}}const a=await super.deserialize(e,n,i);return a._initialData=r,e.comment&&a.setCommentData(e),a}get toolbarButtons(){return this._colorPicker||=new Wk(this),[["colorPicker",this._colorPicker]]}get colorType(){return Ci.INK_COLOR}get color(){return this._drawingOptions.stroke}get opacity(){return this._drawingOptions["stroke-opacity"]}onScaleChanging(){if(!this.parent)return;super.onScaleChanging();const{_drawId:e,_drawingOptions:n,parent:i}=this;n.updateSVGProperty("stroke-width"),i.drawLayer.updateProperties(e,n.toSVGProperties())}static onScaleChangingWhenDrawing(){const e=this._currentParent;e&&(super.onScaleChangingWhenDrawing(),this._defaultDrawingOptions.updateSVGProperty("stroke-width"),e.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}createDrawingOptions({color:e,thickness:n,opacity:i}){this._drawingOptions=pU.getDefaultDrawingOptions({stroke:Xt.makeHexColor(...e),"stroke-width":n,"stroke-opacity":i})}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const{lines:n,points:i}=this.serializeDraw(e),{_drawingOptions:{stroke:r,"stroke-opacity":a,"stroke-width":o}}=this,s=Object.assign(super.serialize(e),{color:Nn._colorManager.convert(r),opacity:a,thickness:o,paths:{lines:n,points:i}});return this.addComment(s),e?(s.isCopy=!0,s):this.annotationElementId&&!this.#e(s)?null:(s.id=this.annotationElementId,s)}#e(e){const{color:n,thickness:i,opacity:r,pageIndex:a}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized||e.color.some((o,s)=>o!==n[s])||e.thickness!==i||e.opacity!==r||e.pageIndex!==a}renderAnnotationElement(e){if(this.deleted)return e.hide(),null;const{points:n,rect:i}=this.serializeDraw(!1);return e.updateEdited({rect:i,thickness:this._drawingOptions["stroke-width"],points:n,popup:this.comment}),null}}class hR extends f1{toSVGPath(){let e=super.toSVGPath();return e.endsWith("Z")||(e+="Z"),e}}const jw=8,Ty=3;class Hg{static#e={maxDim:512,sigmaSFactor:.02,sigmaR:25,kernelSize:16};static#t(e,n,i,r){return i-=e,r-=n,i===0?r>0?0:4:i===1?r+6:2-r}static#n=new Int32Array([0,1,-1,1,-1,0,-1,-1,0,-1,1,-1,1,0,1,1]);static#i(e,n,i,r,a,o,s){const l=this.#t(i,r,a,o);for(let c=0;c<8;c++){const d=(-c+l-s+16)%8,f=this.#n[2*d],h=this.#n[2*d+1];if(e[(i+f)*n+(r+h)]!==0)return d}return-1}static#r(e,n,i,r,a,o,s){const l=this.#t(i,r,a,o);for(let c=0;c<8;c++){const d=(c+l+s+16)%8,f=this.#n[2*d],h=this.#n[2*d+1];if(e[(i+f)*n+(r+h)]!==0)return d}return-1}static#o(e,n,i,r){const a=e.length,o=new Int32Array(a);for(let d=0;d<a;d++)o[d]=e[d]<=r?1:0;for(let d=1;d<i-1;d++)o[d*n]=o[d*n+n-1]=0;for(let d=0;d<n;d++)o[d]=o[n*i-1-d]=0;let s=1,l;const c=[];for(let d=1;d<i-1;d++){l=1;for(let f=1;f<n-1;f++){const h=d*n+f,m=o[h];if(m===0)continue;let g=d,v=f;if(m===1&&o[h-1]===0)s+=1,v-=1;else if(m>=1&&o[h+1]===0)s+=1,v+=1,m>1&&(l=m);else{m!==1&&(l=Math.abs(m));continue}const b=[f,d],k=v===f+1,w={isHole:k,points:b,id:s,parent:0};c.push(w);let x;for(const U of c)if(U.id===l){x=U;break}x?x.isHole?w.parent=k?x.parent:l:w.parent=k?l:x.parent:w.parent=k?l:0;const F=this.#i(o,n,d,f,g,v,0);if(F===-1){o[h]=-s,o[h]!==1&&(l=Math.abs(o[h]));continue}let _=this.#n[2*F],T=this.#n[2*F+1];const B=d+_,O=f+T;g=B,v=O;let P=d,G=f;for(;;){const U=this.#r(o,n,P,G,g,v,1);_=this.#n[2*U],T=this.#n[2*U+1];const R=P+_,ee=G+T;b.push(ee,R);const K=P*n+G;if(o[K+1]===0?o[K]=-s:o[K]===1&&(o[K]=s),R===d&&ee===f&&P===B&&G===O){o[h]!==1&&(l=Math.abs(o[h]));break}else g=P,v=G,P=R,G=ee}}}return c}static#a(e,n,i,r){if(i-n<=4){for(let B=n;B<i-2;B+=2)r.push(e[B],e[B+1]);return}const a=e[n],o=e[n+1],s=e[i-4]-a,l=e[i-3]-o,c=Math.hypot(s,l),d=s/c,f=l/c,h=d*o-f*a,m=l/s,g=1/c,v=Math.atan(m),b=Math.cos(v),k=Math.sin(v),w=g*(Math.abs(b)+Math.abs(k)),x=g*(1-w+w**2),F=Math.max(Math.atan(Math.abs(k+b)*x),Math.atan(Math.abs(k-b)*x));let _=0,T=n;for(let B=n+2;B<i-2;B+=2){const O=Math.abs(h-d*e[B+1]+f*e[B]);O>_&&(T=B,_=O)}_>(c*F)**2?(this.#a(e,n,T+2,r),this.#a(e,T,i,r)):r.push(a,o)}static#s(e){const n=[],i=e.length;return this.#a(e,0,i,n),n.push(e[i-2],e[i-1]),n.length<=4?null:n}static#c(e,n,i,r,a,o){const s=new Float32Array(o**2),l=-2*r**2,c=o>>1;for(let v=0;v<o;v++){const b=(v-c)**2;for(let k=0;k<o;k++)s[v*o+k]=Math.exp((b+(k-c)**2)/l)}const d=new Float32Array(256),f=-2*a**2;for(let v=0;v<256;v++)d[v]=Math.exp(v**2/f);const h=e.length,m=new Uint8Array(h),g=new Uint32Array(256);for(let v=0;v<i;v++)for(let b=0;b<n;b++){const k=v*n+b,w=e[k];let x=0,F=0;for(let T=0;T<o;T++){const B=v+T-c;if(!(B<0||B>=i))for(let O=0;O<o;O++){const P=b+O-c;if(P<0||P>=n)continue;const G=e[B*n+P],U=s[T*o+O]*d[Math.abs(G-w)];x+=G*U,F+=U}}const _=m[k]=Math.round(x/F);g[_]++}return[m,g]}static#l(e){const n=new Uint32Array(256);for(const i of e)n[i]++;return n}static#f(e){const n=e.length,i=new Uint8ClampedArray(n>>2);let r=-1/0,a=1/0;for(let s=0,l=i.length;s<l;s++){const c=i[s]=e[s<<2];r=Math.max(r,c),a=Math.min(a,c)}const o=255/(r-a);for(let s=0,l=i.length;s<l;s++)i[s]=(i[s]-a)*o;return i}static#u(e){let n,i=-1/0,r=-1/0;const a=e.findIndex(l=>l!==0);let o=a,s=a;for(n=a;n<256;n++){const l=e[n];l>i&&(n-o>r&&(r=n-o,s=n-1),i=l,o=n)}for(n=s-1;n>=0&&!(e[n]>e[n+1]);n--);return n}static#A(e){const n=e,{width:i,height:r}=e,{maxDim:a}=this.#e;let o=i,s=r;if(i>a||r>a){let h=i,m=r,g=Math.log2(Math.max(i,r)/a);const v=Math.floor(g);g=g===v?v-1:v;for(let k=0;k<g;k++){o=Math.ceil(h/2),s=Math.ceil(m/2);const w=new OffscreenCanvas(o,s);w.getContext("2d").drawImage(e,0,0,h,m,0,0,o,s),h=o,m=s,e!==n&&e.close(),e=w.transferToImageBitmap()}const b=Math.min(a/o,a/s);o=Math.round(o*b),s=Math.round(s*b)}const c=new OffscreenCanvas(o,s).getContext("2d",{willReadFrequently:!0});c.fillStyle="white",c.fillRect(0,0,o,s),c.filter="grayscale(1)",c.drawImage(e,0,0,e.width,e.height,0,0,o,s);const d=c.getImageData(0,0,o,s).data;return[this.#f(d),o,s]}static extractContoursFromText(e,{fontFamily:n,fontStyle:i,fontWeight:r},a,o,s,l){let c=new OffscreenCanvas(1,1),d=c.getContext("2d",{alpha:!1});const f=200,h=d.font=`${i} ${r} ${f}px ${n}`,{actualBoundingBoxLeft:m,actualBoundingBoxRight:g,actualBoundingBoxAscent:v,actualBoundingBoxDescent:b,fontBoundingBoxAscent:k,fontBoundingBoxDescent:w,width:x}=d.measureText(e),F=1.5,_=Math.ceil(Math.max(Math.abs(m)+Math.abs(g)||0,x)*F),T=Math.ceil(Math.max(Math.abs(v)+Math.abs(b)||f,Math.abs(k)+Math.abs(w)||f)*F);c=new OffscreenCanvas(_,T),d=c.getContext("2d",{alpha:!0,willReadFrequently:!0}),d.font=h,d.filter="grayscale(1)",d.fillStyle="white",d.fillRect(0,0,_,T),d.fillStyle="black",d.fillText(e,_*(F-1)/2,T*(3-F)/2);const B=this.#f(d.getImageData(0,0,_,T).data),O=this.#l(B),P=this.#u(O),G=this.#o(B,_,T,P);return this.processDrawnLines({lines:{curves:G,width:_,height:T},pageWidth:a,pageHeight:o,rotation:s,innerMargin:l,mustSmooth:!0,areContours:!0})}static process(e,n,i,r,a){const[o,s,l]=this.#A(e),[c,d]=this.#c(o,s,l,Math.hypot(s,l)*this.#e.sigmaSFactor,this.#e.sigmaR,this.#e.kernelSize),f=this.#u(d),h=this.#o(c,s,l,f);return this.processDrawnLines({lines:{curves:h,width:s,height:l},pageWidth:n,pageHeight:i,rotation:r,innerMargin:a,mustSmooth:!0,areContours:!0})}static processDrawnLines({lines:e,pageWidth:n,pageHeight:i,rotation:r,innerMargin:a,mustSmooth:o,areContours:s}){r%180!==0&&([n,i]=[i,n]);const{curves:l,width:c,height:d}=e,f=e.thickness??0,h=[],m=Math.min(n/c,i/d),g=m/n,v=m/i,b=[];for(const{points:w}of l){const x=o?this.#s(w):w;if(!x)continue;b.push(x);const F=x.length,_=new Float32Array(F),T=new Float32Array(3*(F===2?2:F-2));if(h.push({line:T,points:_}),F===2){_[0]=x[0]*g,_[1]=x[1]*v,T.set([NaN,NaN,NaN,NaN,_[0],_[1]],0);continue}let[B,O,P,G]=x;B*=g,O*=v,P*=g,G*=v,_.set([B,O,P,G],0),T.set([NaN,NaN,NaN,NaN,B,O],0);for(let U=4;U<F;U+=2){const R=_[U]=x[U]*g,ee=_[U+1]=x[U+1]*v;T.set(nn.createBezierPoints(B,O,P,G,R,ee),(U-2)*3),[B,O,P,G]=[P,G,R,ee]}}if(h.length===0)return null;const k=s?new hR:new f1;return k.build(h,n,i,1,r,s?0:f,a),{outline:k,newCurves:b,areContours:s,thickness:f,width:c,height:d}}static async compressSignature({outlines:e,areContours:n,thickness:i,width:r,height:a}){let o=1/0,s=-1/0,l=0;for(const x of e){l+=x.length;for(let F=2,_=x.length;F<_;F++){const T=x[F]-x[F-2];o=Math.min(o,T),s=Math.max(s,T)}}let c;o>=-128&&s<=127?c=Int8Array:o>=-32768&&s<=32767?c=Int16Array:c=Int32Array;const d=e.length,f=jw+Ty*d,h=new Uint32Array(f);let m=0;h[m++]=f*Uint32Array.BYTES_PER_ELEMENT+(l-2*d)*c.BYTES_PER_ELEMENT,h[m++]=0,h[m++]=r,h[m++]=a,h[m++]=n?0:1,h[m++]=Math.max(0,Math.floor(i??0)),h[m++]=d,h[m++]=c.BYTES_PER_ELEMENT;for(const x of e)h[m++]=x.length-2,h[m++]=x[0],h[m++]=x[1];const g=new CompressionStream("deflate-raw"),v=g.writable.getWriter();await v.ready,v.write(h);const b=c.prototype.constructor;for(const x of e){const F=new b(x.length-2);for(let _=2,T=x.length;_<T;_++)F[_-2]=x[_]-x[_-2];v.write(F)}v.close();const k=await new Response(g.readable).arrayBuffer(),w=new Uint8Array(k);return Fpe(w)}static async decompressSignature(e){try{const n=krt(e),{readable:i,writable:r}=new DecompressionStream("deflate-raw"),a=r.getWriter();await a.ready,a.write(n).then(async()=>{await a.ready,await a.close()}).catch(()=>{});let o=null,s=0;for await(const x of i)o||=new Uint8Array(new Uint32Array(x.buffer,0,4)[0]),o.set(x,s),s+=x.length;const l=new Uint32Array(o.buffer,0,o.length>>2),c=l[1];if(c!==0)throw new Error(`Invalid version: ${c}`);const d=l[2],f=l[3],h=l[4]===0,m=l[5],g=l[6],v=l[7],b=[],k=(jw+Ty*g)*Uint32Array.BYTES_PER_ELEMENT;let w;switch(v){case Int8Array.BYTES_PER_ELEMENT:w=new Int8Array(o.buffer,k);break;case Int16Array.BYTES_PER_ELEMENT:w=new Int16Array(o.buffer,k);break;case Int32Array.BYTES_PER_ELEMENT:w=new Int32Array(o.buffer,k);break}s=0;for(let x=0;x<g;x++){const F=l[Ty*x+jw],_=new Float32Array(F+2);b.push(_);for(let T=0;T<Ty-1;T++)_[T]=l[Ty*x+jw+T+1];for(let T=0;T<F;T++)_[T+2]=_[T]+w[s++]}return{areContours:h,thickness:m,outlines:b,width:d,height:f}}catch(n){return Wn(`decompressSignature: ${n}`),null}}}class gU extends nge{constructor(){super(),super.updateProperties({fill:Nn._defaultLineColor,"stroke-width":0})}clone(){const e=new gU;return e.updateAll(this),e}}class vU extends zC{constructor(e){super(e),super.updateProperties({stroke:Nn._defaultLineColor,"stroke-width":1})}clone(){const e=new vU(this._viewParameters);return e.updateAll(this),e}}class ou extends Ki{#e=!1;#t=null;#n=null;#i=null;static _type="signature";static _editorType=Jn.SIGNATURE;static _defaultDrawingOptions=null;constructor(e){super({...e,mustBeCommitted:!0,name:"signatureEditor"}),this._willKeepAspectRatio=!0,this.#n=e.signatureData||null,this.#t=null,this.defaultL10nId="pdfjs-editor-signature-editor1"}static initialize(e,n){Nn.initialize(e,n),this._defaultDrawingOptions=new gU,this._defaultDrawnSignatureOptions=new vU(n.viewParameters)}static getDefaultDrawingOptions(e){const n=this._defaultDrawingOptions.clone();return n.updateProperties(e),n}static get supportMultipleDrawings(){return!1}static get typesMap(){return Yn(this,"typesMap",new Map)}static get isDrawer(){return!1}get telemetryFinalData(){return{type:"signature",hasDescription:!!this.#t}}static computeTelemetryFinalData(e){const n=e.get("hasDescription");return{hasAltText:n.get(!0)??0,hasNoAltText:n.get(!1)??0}}get isResizable(){return!0}onScaleChanging(){this._drawId!==null&&super.onScaleChanging()}render(){if(this.div)return this.div;let e,n;const{_isCopy:i}=this;if(i&&(this._isCopy=!1,e=this.x,n=this.y),super.render(),this._drawId===null)if(this.#n){const{lines:r,mustSmooth:a,areContours:o,description:s,uuid:l,heightInPage:c}=this.#n,{rawDims:{pageWidth:d,pageHeight:f},rotation:h}=this.parent.viewport,m=Hg.processDrawnLines({lines:r,pageWidth:d,pageHeight:f,rotation:h,innerMargin:ou._INNER_MARGIN,mustSmooth:a,areContours:o});this.addSignature(m,c,s,l)}else this.div.setAttribute("data-l10n-args",JSON.stringify({description:""})),this.div.hidden=!0,this._uiManager.getSignature(this);else this.div.setAttribute("data-l10n-args",JSON.stringify({description:this.#t||""}));return i&&(this._isCopy=!0,this._moveAfterPaste(e,n)),this.div}setUuid(e){this.#i=e,this.addEditToolbar()}getUuid(){return this.#i}get description(){return this.#t}set description(e){this.#t=e,this.div&&(this.div.setAttribute("data-l10n-args",JSON.stringify({description:e})),super.addEditToolbar().then(n=>{n?.updateEditSignatureButton(e)}))}getSignaturePreview(){const{newCurves:e,areContours:n,thickness:i,width:r,height:a}=this.#n,o=Math.max(r,a),s=Hg.processDrawnLines({lines:{curves:e.map(l=>({points:l})),thickness:i,width:r,height:a},pageWidth:o,pageHeight:o,rotation:0,innerMargin:0,mustSmooth:!1,areContours:n});return{areContours:n,outline:s.outline}}get toolbarButtons(){return this._uiManager.signatureManager?[["editSignature",this._uiManager.signatureManager]]:super.toolbarButtons}addSignature(e,n,i,r){const{x:a,y:o}=this,{outline:s}=this.#n=e;this.#e=s instanceof hR,this.description=i;let l;this.#e?l=ou.getDefaultDrawingOptions():(l=ou._defaultDrawnSignatureOptions.clone(),l.updateProperties({"stroke-width":s.thickness})),this._addOutlines({drawOutlines:s,drawingOptions:l});const[,c]=this.pageDimensions;let d=n/c;d=d>=1?.5:d,this.width*=d/this.height,this.width>=1&&(d*=.9/this.width,this.width=.9),this.height=d,this.setDims(),this.x=a,this.y=o,this.center(),this._onResized(),this.onScaleChanging(),this.rotate(),this._uiManager.addToAnnotationStorage(this),this.setUuid(r),this._reportTelemetry({action:"pdfjs.signature.inserted",data:{hasBeenSaved:!!r,hasDescription:!!i}}),this.div.hidden=!1}getFromImage(e){const{rawDims:{pageWidth:n,pageHeight:i},rotation:r}=this.parent.viewport;return Hg.process(e,n,i,r,ou._INNER_MARGIN)}getFromText(e,n){const{rawDims:{pageWidth:i,pageHeight:r},rotation:a}=this.parent.viewport;return Hg.extractContoursFromText(e,n,i,r,a,ou._INNER_MARGIN)}getDrawnSignature(e){const{rawDims:{pageWidth:n,pageHeight:i},rotation:r}=this.parent.viewport;return Hg.processDrawnLines({lines:e,pageWidth:n,pageHeight:i,rotation:r,innerMargin:ou._INNER_MARGIN,mustSmooth:!1,areContours:!1})}createDrawingOptions({areContours:e,thickness:n}){e?this._drawingOptions=ou.getDefaultDrawingOptions():(this._drawingOptions=ou._defaultDrawnSignatureOptions.clone(),this._drawingOptions.updateProperties({"stroke-width":n}))}serialize(e=!1){if(this.isEmpty())return null;const{lines:n,points:i}=this.serializeDraw(e),{_drawingOptions:{"stroke-width":r}}=this,a=Object.assign(super.serialize(e),{isSignature:!0,areContours:this.#e,color:[0,0,0],thickness:this.#e?0:r});return this.addComment(a),e?(a.paths={lines:n,points:i},a.uuid=this.#i,a.isCopy=!0):a.lines=n,this.#t&&(a.accessibilityData={type:"Figure",alt:this.#t}),a}static deserializeDraw(e,n,i,r,a,o){return o.areContours?hR.deserialize(e,n,i,r,a,o):f1.deserialize(e,n,i,r,a,o)}static async deserialize(e,n,i){const r=await super.deserialize(e,n,i);return r.#e=e.areContours,r.description=e.accessibilityData?.alt||"",r.#i=e.uuid,r}}class aot extends Nn{#e=null;#t=null;#n=null;#i=null;#r=null;#o="";#a=null;#s=!1;#c=null;#l=!1;#f=!1;static _type="stamp";static _editorType=Jn.STAMP;constructor(e){super({...e,name:"stampEditor"}),this.#i=e.bitmapUrl,this.#r=e.bitmapFile,this.defaultL10nId="pdfjs-editor-stamp-editor"}static initialize(e,n){Nn.initialize(e,n)}static isHandlingMimeForPasting(e){return oR.includes(e)}static paste(e,n){n.pasteEditor({mode:Jn.STAMP},{bitmapFile:e.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){return{type:"stamp",hasAltText:!!this.altTextData?.altText}}static computeTelemetryFinalData(e){const n=e.get("hasAltText");return{hasAltText:n.get(!0)??0,hasNoAltText:n.get(!1)??0}}#u(e,n=!1){if(!e){this.remove();return}this.#e=e.bitmap,n||(this.#t=e.id,this.#l=e.isSvg),e.file&&(this.#o=e.file.name),this.#h()}#A(){if(this.#n=null,this._uiManager.enableWaiting(!1),!!this.#a){if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#e){this.addEditToolbar().then(()=>{this._editToolbar.hide(),this._uiManager.editAltText(this,!0)});return}if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#e){this._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!1,alt_text_type:"empty"}});try{this.mlGuessAltText()}catch{}}this.div.focus()}}async mlGuessAltText(e=null,n=!0){if(this.hasAltTextData())return null;const{mlManager:i}=this._uiManager;if(!i)throw new Error("No ML.");if(!await i.isEnabledFor("altText"))throw new Error("ML isn't enabled for alt text.");const{data:r,width:a,height:o}=e||this.copyCanvas(null,null,!0).imageData,s=await i.guess({name:"altText",request:{data:r,width:a,height:o,channels:r.length/(a*o)}});if(!s)throw new Error("No response from the AI service.");if(s.error)throw new Error("Error from the AI service.");if(s.cancel)return null;if(!s.output)throw new Error("No valid response from the AI service.");const l=s.output;return await this.setGuessedAltText(l),n&&!this.hasAltTextData()&&(this.altTextData={alt:l,decorative:!1}),l}#p(){if(this.#t){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(this.#t).then(i=>this.#u(i,!0)).finally(()=>this.#A());return}if(this.#i){const i=this.#i;this.#i=null,this._uiManager.enableWaiting(!0),this.#n=this._uiManager.imageManager.getFromUrl(i).then(r=>this.#u(r)).finally(()=>this.#A());return}if(this.#r){const i=this.#r;this.#r=null,this._uiManager.enableWaiting(!0),this.#n=this._uiManager.imageManager.getFromFile(i).then(r=>this.#u(r)).finally(()=>this.#A());return}const e=document.createElement("input");e.type="file",e.accept=oR.join(",");const n=this._uiManager._signal;this.#n=new Promise(i=>{e.addEventListener("change",async()=>{if(!e.files||e.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);const r=await this._uiManager.imageManager.getFromFile(e.files[0]);this._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),this.#u(r)}i()},{signal:n}),e.addEventListener("cancel",()=>{this.remove(),i()},{signal:n})}).finally(()=>this.#A()),e.click()}remove(){this.#t&&(this.#e=null,this._uiManager.imageManager.deleteId(this.#t),this.#a?.remove(),this.#a=null,this.#c&&(clearTimeout(this.#c),this.#c=null)),super.remove()}rebuild(){if(!this.parent){this.#t&&this.#p();return}super.rebuild(),this.div!==null&&(this.#t&&this.#a===null&&this.#p(),this.isAttachedToDOM||this.parent.add(this))}onceAdded(e){this._isDraggable=!0,e&&this.div.focus()}isEmpty(){return!(this.#n||this.#e||this.#i||this.#r||this.#t||this.#s)}get toolbarButtons(){return[["altText",this.createAltText()]]}get isResizable(){return!0}render(){if(this.div)return this.div;let e,n;return this._isCopy&&(e=this.x,n=this.y),super.render(),this.div.hidden=!0,this.createAltText(),this.#s||(this.#e?this.#h():this.#p()),this._isCopy&&this._moveAfterPaste(e,n),this._uiManager.addShouldRescale(this),this.div}setCanvas(e,n){const{id:i,bitmap:r}=this._uiManager.imageManager.getFromCanvas(e,n);n.remove(),i&&this._uiManager.imageManager.isValidId(i)&&(this.#t=i,r&&(this.#e=r),this.#s=!1,this.#h())}_onResized(){this.onScaleChanging()}onScaleChanging(){if(!this.parent)return;this.#c!==null&&clearTimeout(this.#c);const e=200;this.#c=setTimeout(()=>{this.#c=null,this.#m()},e)}#h(){const{div:e}=this;let{width:n,height:i}=this.#e;const[r,a]=this.pageDimensions,o=.75;if(this.width)n=this.width*r,i=this.height*a;else if(n>o*r||i>o*a){const l=Math.min(o*r/n,o*a/i);n*=l,i*=l}this._uiManager.enableWaiting(!1);const s=this.#a=document.createElement("canvas");s.setAttribute("role","img"),this.addContainer(s),this.width=n/r,this.height=i/a,this.setDims(),this._initialOptions?.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,(!this._uiManager.useNewAltTextWhenAddingImage||!this._uiManager.useNewAltTextFlow||this.annotationElementId)&&(e.hidden=!1),this.#m(),this.#f||(this.parent.addUndoableEditor(this),this.#f=!0),this._reportTelemetry({action:"inserted_image"}),this.#o&&this.div.setAttribute("aria-description",this.#o),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-stamp-added-alert")}copyCanvas(e,n,i=!1){e||(e=224);const{width:r,height:a}=this.#e,o=new Bu;let s=this.#e,l=r,c=a,d=null;if(n){if(r>n||a>n){const T=Math.min(n/r,n/a);l=Math.floor(r*T),c=Math.floor(a*T)}d=document.createElement("canvas");const h=d.width=Math.ceil(l*o.sx),m=d.height=Math.ceil(c*o.sy);this.#l||(s=this.#d(h,m));const g=d.getContext("2d");g.filter=this._uiManager.hcmFilter;let v="white",b="#cfcfd8";this._uiManager.hcmFilter!=="none"?b="black":Frt.isDarkMode&&(v="#8f8f9d",b="#42414d");const k=15,w=k*o.sx,x=k*o.sy,F=new OffscreenCanvas(w*2,x*2),_=F.getContext("2d");_.fillStyle=v,_.fillRect(0,0,w*2,x*2),_.fillStyle=b,_.fillRect(0,0,w,x),_.fillRect(w,x,w,x),g.fillStyle=g.createPattern(F,"repeat"),g.fillRect(0,0,h,m),g.drawImage(s,0,0,s.width,s.height,0,0,h,m)}let f=null;if(i){let h,m;if(o.symmetric&&s.width<e&&s.height<e)h=s.width,m=s.height;else if(s=this.#e,r>e||a>e){const b=Math.min(e/r,e/a);h=Math.floor(r*b),m=Math.floor(a*b),this.#l||(s=this.#d(h,m))}const v=new OffscreenCanvas(h,m).getContext("2d",{willReadFrequently:!0});v.drawImage(s,0,0,s.width,s.height,0,0,h,m),f={width:h,height:m,data:v.getImageData(0,0,h,m).data}}return{canvas:d,width:l,height:c,imageData:f}}#d(e,n){const{width:i,height:r}=this.#e;let a=i,o=r,s=this.#e;for(;a>2*e||o>2*n;){const l=a,c=o;a>2*e&&(a=a>=16384?Math.floor(a/2)-1:Math.ceil(a/2)),o>2*n&&(o=o>=16384?Math.floor(o/2)-1:Math.ceil(o/2));const d=new OffscreenCanvas(a,o);d.getContext("2d").drawImage(s,0,0,l,c,0,0,a,o),s=d.transferToImageBitmap()}return s}#m(){const[e,n]=this.parentDimensions,{width:i,height:r}=this,a=new Bu,o=Math.ceil(i*e*a.sx),s=Math.ceil(r*n*a.sy),l=this.#a;if(!l||l.width===o&&l.height===s)return;l.width=o,l.height=s;const c=this.#l?this.#e:this.#d(o,s),d=l.getContext("2d");d.filter=this._uiManager.hcmFilter,d.drawImage(c,0,0,c.width,c.height,0,0,o,s)}#g(e){if(e){if(this.#l){const r=this._uiManager.imageManager.getSvgUrl(this.#t);if(r)return r}const n=document.createElement("canvas");return{width:n.width,height:n.height}=this.#e,n.getContext("2d").drawImage(this.#e,0,0),n.toDataURL()}if(this.#l){const[n,i]=this.pageDimensions,r=Math.round(this.width*n*Vv.PDF_TO_CSS_UNITS),a=Math.round(this.height*i*Vv.PDF_TO_CSS_UNITS),o=new OffscreenCanvas(r,a);return o.getContext("2d").drawImage(this.#e,0,0,this.#e.width,this.#e.height,0,0,r,a),o.transferToImageBitmap()}return structuredClone(this.#e)}static async deserialize(e,n,i){let r=null,a=!1;if(e instanceof ege){const{data:{rect:v,rotation:b,id:k,structParent:w,popupRef:x,richText:F,contentsObj:_,creationDate:T,modificationDate:B},container:O,parent:{page:{pageNumber:P}},canvas:G}=e;let U,R;G?(delete e.canvas,{id:U,bitmap:R}=i.imageManager.getFromCanvas(O.id,G),G.remove()):(a=!0,e._hasNoCanvas=!0);const ee=(await n._structTree.getAriaAttributes(`${Wg}${k}`))?.get("aria-label")||"";r=e={annotationType:Jn.STAMP,bitmapId:U,bitmap:R,pageIndex:P-1,rect:v.slice(0),rotation:b,annotationElementId:k,id:k,deleted:!1,accessibilityData:{decorative:!1,altText:ee},isSvg:!1,structParent:w,popupRef:x,richText:F,comment:_?.str||null,creationDate:T,modificationDate:B}}const o=await super.deserialize(e,n,i),{rect:s,bitmap:l,bitmapUrl:c,bitmapId:d,isSvg:f,accessibilityData:h}=e;a?(i.addMissingCanvas(e.id,o),o.#s=!0):d&&i.imageManager.isValidId(d)?(o.#t=d,l&&(o.#e=l)):o.#i=c,o.#l=f;const[m,g]=o.pageDimensions;return o.width=(s[2]-s[0])/m,o.height=(s[3]-s[1])/g,h&&(o.altTextData=h),o._initialData=r,e.comment&&o.setCommentData(e),o.#f=!!r,o}serialize(e=!1,n=null){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const i=Object.assign(super.serialize(e),{bitmapId:this.#t,isSvg:this.#l});if(this.addComment(i),e)return i.bitmapUrl=this.#g(!0),i.accessibilityData=this.serializeAltText(!0),i.isCopy=!0,i;const{decorative:r,altText:a}=this.serializeAltText(!1);if(!r&&a&&(i.accessibilityData={type:"Figure",alt:a}),this.annotationElementId){const s=this.#y(i);return s.isSame?null:(s.isSameAltText?delete i.accessibilityData:i.accessibilityData.structParent=this._initialData.structParent??-1,i.id=this.annotationElementId,delete i.bitmapId,i)}if(n===null)return i;n.stamps||=new Map;const o=this.#l?(i.rect[2]-i.rect[0])*(i.rect[3]-i.rect[1]):null;if(!n.stamps.has(this.#t))n.stamps.set(this.#t,{area:o,serialized:i}),i.bitmap=this.#g(!1);else if(this.#l){const s=n.stamps.get(this.#t);o>s.area&&(s.area=o,s.serialized.bitmap.close(),s.serialized.bitmap=this.#g(!1))}return i}#y(e){const{pageIndex:n,accessibilityData:{altText:i}}=this._initialData,r=e.pageIndex===n,a=(e.accessibilityData?.alt||"")===i;return{isSame:!this.hasEditedComment&&!this._hasBeenMoved&&!this._hasBeenResized&&r&&a,isSameAltText:a}}renderAnnotationElement(e){return this.deleted?(e.hide(),null):(e.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}}class Nf{#e;#t=!1;#n=null;#i=null;#r=null;#o=new Map;#a=!1;#s=!1;#c=!1;#l=null;#f=null;#u=null;#A=null;#p=null;#h=-1;#d;static _initialized=!1;static#m=new Map([yo,pU,aot,xa,ou].map(e=>[e._editorType,e]));constructor({uiManager:e,pageIndex:n,div:i,structTreeLayer:r,accessibilityManager:a,annotationLayer:o,drawLayer:s,textLayer:l,viewport:c,l10n:d}){const f=[...Nf.#m.values()];if(!Nf._initialized){Nf._initialized=!0;for(const h of f)h.initialize(d,e)}e.registerEditorTypes(f),this.#d=e,this.pageIndex=n,this.div=i,this.#e=a,this.#n=o,this.viewport=c,this.#u=l,this.drawLayer=s,this._structTree=r,this.#d.addLayer(this)}get isEmpty(){return this.#o.size===0}get isInvisible(){return this.isEmpty&&this.#d.getMode()===Jn.NONE}updateToolbar(e){this.#d.updateToolbar(e)}updateMode(e=this.#d.getMode()){switch(this.#b(),e){case Jn.NONE:this.div.classList.toggle("nonEditing",!0),this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),this.disableClick();return;case Jn.INK:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick();break;case Jn.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:n}=this.div;if(n.toggle("nonEditing",!1),e===Jn.POPUP)n.toggle("commentEditing",!0);else{n.toggle("commentEditing",!1);for(const i of Nf.#m.values())n.toggle(`${i._type}Editing`,e===i._editorType)}this.div.hidden=!1}hasTextLayer(e){return e===this.#u?.div}setEditingState(e){this.#d.setEditingState(e)}addCommands(e){this.#d.addCommands(e)}cleanUndoStack(e){this.#d.cleanUndoStack(e)}toggleDrawing(e=!1){this.div.classList.toggle("drawing",!e)}togglePointerEvents(e=!1){this.div.classList.toggle("disabled",!e)}toggleAnnotationLayerPointerEvents(e=!1){this.#n?.togglePointerEvents(e)}get#g(){return this.#o.size!==0?this.#o.values():this.#d.getEditors(this.pageIndex)}async enable(){this.#c=!0,this.div.tabIndex=0,this.togglePointerEvents(!0),this.div.classList.toggle("nonEditing",!1),this.#p?.abort(),this.#p=null;const e=new Set;for(const i of this.#g)i.enableEditing(),i.show(!0),i.annotationElementId&&(this.#d.removeChangedExistingAnnotation(i),e.add(i.annotationElementId));const n=this.#n;if(n)for(const i of n.getEditableAnnotations()){if(i.hide(),this.#d.isDeletedAnnotationElement(i.data.id)||e.has(i.data.id))continue;const r=await this.deserialize(i);r&&(this.addOrRebuild(r),r.enableEditing())}this.#c=!1,this.#d._eventBus.dispatch("editorsrendered",{source:this,pageNumber:this.pageIndex+1})}disable(){if(this.#s=!0,this.div.tabIndex=-1,this.togglePointerEvents(!1),this.div.classList.toggle("nonEditing",!0),this.#u&&!this.#p){this.#p=new AbortController;const r=this.#d.combinedSignal(this.#p);this.#u.div.addEventListener("pointerdown",a=>{const{clientX:s,clientY:l,timeStamp:c}=a,d=this.#h;if(c-d>500){this.#h=c;return}this.#h=-1;const{classList:f}=this.div;f.toggle("getElements",!0);const h=document.elementsFromPoint(s,l);if(f.toggle("getElements",!1),!this.div.contains(h[0]))return;let m;const g=new RegExp(`^${Vk}[0-9]+$`);for(const b of h)if(g.test(b.id)){m=b.id;break}if(!m)return;const v=this.#o.get(m);v?.annotationElementId===null&&(a.stopPropagation(),a.preventDefault(),v.dblclick(a))},{signal:r,capture:!0})}const e=this.#n,n=[];if(e){const r=new Map,a=new Map;for(const s of this.#g){if(s.disableEditing(),!s.annotationElementId){n.push(s);continue}if(s.serialize()!==null){r.set(s.annotationElementId,s);continue}else a.set(s.annotationElementId,s);this.getEditableAnnotation(s.annotationElementId)?.show(),s.remove()}const o=e.getEditableAnnotations();for(const s of o){const{id:l}=s.data;if(this.#d.isDeletedAnnotationElement(l)){s.updateEdited({deleted:!0});continue}let c=a.get(l);if(c){c.resetAnnotationElement(s),c.show(!1),s.show();continue}c=r.get(l),c&&(this.#d.addChangedExistingAnnotation(c),c.renderAnnotationElement(s)&&c.show(!1)),s.show()}}this.#b(),this.isEmpty&&(this.div.hidden=!0);const{classList:i}=this.div;for(const r of Nf.#m.values())i.remove(`${r._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),e?.updateFakeAnnotations(n),this.#s=!1}getEditableAnnotation(e){return this.#n?.getEditableAnnotation(e)||null}setActiveEditor(e){this.#d.getActive()!==e&&this.#d.setActiveEditor(e)}enableTextSelection(){if(this.div.tabIndex=-1,this.#u?.div&&!this.#A){this.#A=new AbortController;const e=this.#d.combinedSignal(this.#A);this.#u.div.addEventListener("pointerdown",this.#y.bind(this),{signal:e}),this.#u.div.classList.add("highlighting")}}disableTextSelection(){this.div.tabIndex=0,this.#u?.div&&this.#A&&(this.#A.abort(),this.#A=null,this.#u.div.classList.remove("highlighting"))}#y(e){this.#d.unselectAll();const{target:n}=e;if(n===this.#u.div||(n.getAttribute("role")==="img"||n.classList.contains("endOfContent"))&&this.#u.div.contains(n)){const{isMac:i}=lo.platform;if(e.button!==0||e.ctrlKey&&i)return;this.#d.showAllEditors("highlight",!0,!0),this.#u.div.classList.add("free"),this.toggleDrawing(),xa.startHighlighting(this,this.#d.direction==="ltr",{target:this.#u.div,x:e.x,y:e.y}),this.#u.div.addEventListener("pointerup",()=>{this.#u.div.classList.remove("free"),this.toggleDrawing(!0)},{once:!0,signal:this.#d._signal}),e.preventDefault()}}enableClick(){if(this.#i)return;this.#i=new AbortController;const e=this.#d.combinedSignal(this.#i);this.div.addEventListener("pointerdown",this.pointerdown.bind(this),{signal:e});const n=this.pointerup.bind(this);this.div.addEventListener("pointerup",n,{signal:e}),this.div.addEventListener("pointercancel",n,{signal:e})}disableClick(){this.#i?.abort(),this.#i=null}attach(e){this.#o.set(e.id,e);const{annotationElementId:n}=e;n&&this.#d.isDeletedAnnotationElement(n)&&this.#d.removeDeletedAnnotationElement(e)}detach(e){this.#o.delete(e.id),this.#e?.removePointerInTextLayer(e.contentDiv),!this.#s&&e.annotationElementId&&this.#d.addDeletedAnnotationElement(e)}remove(e){this.detach(e),this.#d.removeEditor(e),e.div.remove(),e.isAttachedToDOM=!1}changeParent(e){e.parent!==this&&(e.parent&&e.annotationElementId&&(this.#d.addDeletedAnnotationElement(e),Nn.deleteAnnotationElement(e),e.annotationElementId=null),this.attach(e),e.parent?.detach(e),e.setParent(this),e.div&&e.isAttachedToDOM&&(e.div.remove(),this.div.append(e.div)))}add(e){if(!(e.parent===this&&e.isAttachedToDOM)){if(this.changeParent(e),this.#d.addEditor(e),this.attach(e),!e.isAttachedToDOM){const n=e.render();this.div.append(n),e.isAttachedToDOM=!0}e.fixAndSetPosition(),e.onceAdded(!this.#c),this.#d.addToAnnotationStorage(e),e._reportTelemetry(e.telemetryInitialData)}}moveEditorInDOM(e){if(!e.isAttachedToDOM)return;const{activeElement:n}=document;e.div.contains(n)&&!this.#r&&(e._focusEventsAllowed=!1,this.#r=setTimeout(()=>{this.#r=null,e.div.contains(document.activeElement)?e._focusEventsAllowed=!0:(e.div.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:this.#d._signal}),n.focus())},0)),e._structTreeParentId=this.#e?.moveElementInDOM(this.div,e.div,e.contentDiv,!0)}addOrRebuild(e){e.needsToBeRebuilt()?(e.parent||=this,e.rebuild(),e.show()):this.add(e)}addUndoableEditor(e){const n=()=>e._uiManager.rebuild(e),i=()=>{e.remove()};this.addCommands({cmd:n,undo:i,mustExec:!1})}getEditorByUID(e){for(const n of this.#o.values())if(n.uid===e)return n;return null}getNextId(){return this.#d.getId()}get#v(){return Nf.#m.get(this.#d.getMode())}combinedSignal(e){return this.#d.combinedSignal(e)}#x(e){const n=this.#v;return n?new n.prototype.constructor(e):null}canCreateNewEmptyEditor(){return this.#v?.canCreateNewEmptyEditor()}async pasteEditor(e,n){this.updateToolbar(e),await this.#d.updateMode(e.mode);const{offsetX:i,offsetY:r}=this.#w(),a=this.getNextId(),o=this.#x({parent:this,id:a,x:i,y:r,uiManager:this.#d,isCentered:!0,...n});o&&this.add(o)}async deserialize(e){return await Nf.#m.get(e.annotationType??e.annotationEditorType)?.deserialize(e,this,this.#d)||null}createAndAddNewEditor(e,n,i={}){const r=this.getNextId(),a=this.#x({parent:this,id:r,x:e.offsetX,y:e.offsetY,uiManager:this.#d,isCentered:n,...i});return a&&this.add(a),a}get boundingClientRect(){return this.div.getBoundingClientRect()}#w(){const{x:e,y:n,width:i,height:r}=this.boundingClientRect,a=Math.max(0,e),o=Math.max(0,n),s=Math.min(window.innerWidth,e+i),l=Math.min(window.innerHeight,n+r),c=(a+s)/2-e,d=(o+l)/2-n,[f,h]=this.viewport.rotation%180===0?[c,d]:[d,c];return{offsetX:f,offsetY:h}}addNewEditor(e={}){this.createAndAddNewEditor(this.#w(),!0,e)}setSelected(e){this.#d.setSelected(e)}toggleSelected(e){this.#d.toggleSelected(e)}unselect(e){this.#d.unselect(e)}pointerup(e){const{isMac:n}=lo.platform;if(e.button!==0||e.ctrlKey&&n||e.target!==this.div||!this.#a||(this.#a=!1,this.#v?.isDrawer&&this.#v.supportMultipleDrawings))return;if(!this.#t){this.#t=!0;return}const i=this.#d.getMode();if(i===Jn.STAMP||i===Jn.SIGNATURE){this.#d.unselectAll();return}this.createAndAddNewEditor(e,!1)}pointerdown(e){if(this.#d.getMode()===Jn.HIGHLIGHT&&this.enableTextSelection(),this.#a){this.#a=!1;return}const{isMac:n}=lo.platform;if(e.button!==0||e.ctrlKey&&n||e.target!==this.div)return;if(this.#a=!0,this.#v?.isDrawer){this.startDrawingSession(e);return}const i=this.#d.getActive();this.#t=!i||i.isEmpty()}startDrawingSession(e){if(this.div.focus({preventScroll:!0}),this.#l){this.#v.startDrawing(this,this.#d,!1,e);return}this.#d.setCurrentDrawingSession(this),this.#l=new AbortController;const n=this.#d.combinedSignal(this.#l);this.div.addEventListener("blur",({relatedTarget:i})=>{i&&!this.div.contains(i)&&(this.#f=null,this.commitOrRemove())},{signal:n}),this.#v.startDrawing(this,this.#d,!1,e)}pause(e){if(e){const{activeElement:n}=document;this.div.contains(n)&&(this.#f=n);return}this.#f&&setTimeout(()=>{this.#f?.focus(),this.#f=null},0)}endDrawingSession(e=!1){return this.#l?(this.#d.setCurrentDrawingSession(null),this.#l.abort(),this.#l=null,this.#f=null,this.#v.endDrawing(e)):null}findNewParent(e,n,i){const r=this.#d.findParent(n,i);return r===null||r===this?!1:(r.changeParent(e),!0)}commitOrRemove(){return this.#l?(this.endDrawingSession(),!0):!1}onScaleChanging(){this.#l&&this.#v.onScaleChangingWhenDrawing(this)}destroy(){this.commitOrRemove(),this.#d.getActive()?.parent===this&&(this.#d.commitOrRemove(),this.#d.setActiveEditor(null)),this.#r&&(clearTimeout(this.#r),this.#r=null);for(const e of this.#o.values())this.#e?.removePointerInTextLayer(e.contentDiv),e.setParent(null),e.isAttachedToDOM=!1,e.div.remove();this.div=null,this.#o.clear(),this.#d.removeLayer(this)}#b(){for(const e of this.#o.values())e.isEmpty()&&e.remove()}render({viewport:e}){this.viewport=e,Gh(this.div,e);for(const n of this.#d.getEditors(this.pageIndex))this.add(n),n.rebuild();this.updateMode()}update({viewport:e}){this.#d.commitOrRemove(),this.#b();const n=this.viewport.rotation,i=e.rotation;if(this.viewport=e,Gh(this.div,{rotation:i}),n!==i)for(const r of this.#o.values())r.rotate(i)}get pageDimensions(){const{pageWidth:e,pageHeight:n}=this.viewport.rawDims;return[e,n]}get scale(){return this.#d.viewParameters.realScale}}class To{#e=null;#t=new Map;#n=new Map;static#i=0;constructor({pageIndex:e}){this.pageIndex=e}setParent(e){if(!this.#e){this.#e=e;return}if(this.#e!==e){if(this.#t.size>0)for(const n of this.#t.values())n.remove(),e.append(n);this.#e=e}}static get _svgFactory(){return Yn(this,"_svgFactory",new s2)}static#r(e,[n,i,r,a]){const{style:o}=e;o.top=`${100*i}%`,o.left=`${100*n}%`,o.width=`${100*r}%`,o.height=`${100*a}%`}#o(){const e=To._svgFactory.create(1,1,!0);return this.#e.append(e),e.setAttribute("aria-hidden",!0),e}#a(e,n){const i=To._svgFactory.createElement("clipPath");e.append(i);const r=`clip_${n}`;i.setAttribute("id",r),i.setAttribute("clipPathUnits","objectBoundingBox");const a=To._svgFactory.createElement("use");return i.append(a),a.setAttribute("href",`#${n}`),a.classList.add("clip"),r}#s(e,n){for(const[i,r]of Object.entries(n))r===null?e.removeAttribute(i):e.setAttribute(i,r)}draw(e,n=!1,i=!1){const r=To.#i++,a=this.#o(),o=To._svgFactory.createElement("defs");a.append(o);const s=To._svgFactory.createElement("path");o.append(s);const l=`path_p${this.pageIndex}_${r}`;s.setAttribute("id",l),s.setAttribute("vector-effect","non-scaling-stroke"),n&&this.#n.set(r,s);const c=i?this.#a(o,l):null,d=To._svgFactory.createElement("use");return a.append(d),d.setAttribute("href",`#${l}`),this.updateProperties(a,e),this.#t.set(r,a),{id:r,clipPathId:`url(#${c})`}}drawOutline(e,n){const i=To.#i++,r=this.#o(),a=To._svgFactory.createElement("defs");r.append(a);const o=To._svgFactory.createElement("path");a.append(o);const s=`path_p${this.pageIndex}_${i}`;o.setAttribute("id",s),o.setAttribute("vector-effect","non-scaling-stroke");let l;if(n){const f=To._svgFactory.createElement("mask");a.append(f),l=`mask_p${this.pageIndex}_${i}`,f.setAttribute("id",l),f.setAttribute("maskUnits","objectBoundingBox");const h=To._svgFactory.createElement("rect");f.append(h),h.setAttribute("width","1"),h.setAttribute("height","1"),h.setAttribute("fill","white");const m=To._svgFactory.createElement("use");f.append(m),m.setAttribute("href",`#${s}`),m.setAttribute("stroke","none"),m.setAttribute("fill","black"),m.setAttribute("fill-rule","nonzero"),m.classList.add("mask")}const c=To._svgFactory.createElement("use");r.append(c),c.setAttribute("href",`#${s}`),l&&c.setAttribute("mask",`url(#${l})`);const d=c.cloneNode();return r.append(d),c.classList.add("mainOutline"),d.classList.add("secondaryOutline"),this.updateProperties(r,e),this.#t.set(i,r),i}finalizeDraw(e,n){this.#n.delete(e),this.updateProperties(e,n)}updateProperties(e,n){if(!n)return;const{root:i,bbox:r,rootClass:a,path:o}=n,s=typeof e=="number"?this.#t.get(e):e;if(s){if(i&&this.#s(s,i),r&&To.#r(s,r),a){const{classList:l}=s;for(const[c,d]of Object.entries(a))l.toggle(c,d)}if(o){const c=s.firstElementChild.firstElementChild;this.#s(c,o)}}}updateParent(e,n){if(n===this)return;const i=this.#t.get(e);i&&(n.#e.append(i),this.#t.delete(e),n.#t.set(e,i))}remove(e){this.#n.delete(e),this.#e!==null&&(this.#t.get(e).remove(),this.#t.delete(e))}destroy(){this.#e=null;for(const e of this.#t.values())e.remove();this.#t.clear(),this.#n.clear()}}globalThis._pdfjsTestingUtils={HighlightOutliner:AR};globalThis.pdfjsLib={AbortException:dm,AnnotationEditorLayer:Nf,AnnotationEditorParamsType:Ci,AnnotationEditorType:Jn,AnnotationEditorUIManager:um,AnnotationLayer:hU,AnnotationMode:zA,AnnotationType:$a,applyOpacity:Crt,build:Rat,ColorPicker:dc,createValidAbsoluteUrl:Spe,CSSConstants:_rt,DOMSVGFactory:s2,DrawLayer:To,FeatureTest:lo,fetchData:s1,findContrastColor:Ert,getDocument:Vpe,getFilenameFromUrl:brt,getPdfFilenameFromUrl:Srt,getRGB:c1,getUuid:xpe,getXfaPageViewport:Nrt,GlobalWorkerOptions:gv,ImageKind:CN,InvalidPDFException:rR,isDataScheme:jC,isPdfFile:aU,isValidExplicitDest:$rt,MathClamp:hs,noContextMenu:xc,normalizeUnicode:vrt,OPS:Gk,OutputScale:Bu,PasswordResponses:crt,PDFDataRangeTransport:Gpe,PDFDateString:aR,PDFWorker:Kk,PermissionFlag:lrt,PixelsPerInch:Vv,RenderingCancelledException:rU,renderRichText:Cpe,ResponseException:a2,setLayerDimensions:Gh,shadow:Yn,SignatureExtractor:Hg,stopEvent:pa,SupportedImageMimeTypes:oR,TextLayer:yl,TouchManager:QC,updateUrlHash:wpe,Util:Xt,VerbosityLevel:UC,version:Wpe,XfaLayer:_pe};function oot(t){const e=atob(t),{length:n}=e,i=new Uint8Array(n);for(let r=0;r<n;r++)i[r]=e.charCodeAt(r);return i.buffer}function sot(t){gv.workerSrc=`https://unpkg.com/pdfjs-dist@${Wpe}/build/pdf.worker.min.mjs`;const{src:e}=t,n=N.useRef(null),i=N.useRef(null),[r,a]=N.useState(!1),[o,s]=N.useState(),[l,c]=N.useState(1),d=N.useRef(null),f=N.useCallback((g,v,b=o,k=1)=>{const w=g.current;!w||!b||(w.height=0,w.width=0,b.getPage(v).then(x=>{const F=x.getViewport({scale:k});w.height=F.height,w.width=F.width;const _={canvasContext:w.getContext("2d"),viewport:F,canvas:w};try{return d.current&&d.current.cancel(),d.current=x.render(_),d.current.promise}catch(T){console.error("Error rendering page:",T);return}}).catch(x=>console.error(x)))},[o]);N.useEffect(()=>{f(n,l,o)},[o,l,f]),N.useEffect(()=>{r&&new Promise(g=>setTimeout(g,100)).then(()=>{f(i,l,o,2)})},[r,o,l,f]),N.useEffect(()=>{Vpe(oot(e)).promise.then(v=>{s(v)},v=>{console.error(v)})},[e]);const h=()=>o&&l<o.numPages&&c(l+1),m=()=>l>1&&c(l-1);return y.jsxs("div",{children:[y.jsx(jt,{onClick:m,disabled:l<=1,children:"Previous"}),y.jsx(jt,{onClick:h,disabled:l>=(o?.numPages??-1),children:"Next"}),y.jsx("canvas",{ref:n,onClick:()=>a(!0)}),y.jsx(J6,{open:r,onOpenChange:a,children:y.jsxs(e3,{children:[y.jsx(Du,{children:y.jsx(Tu,{})}),y.jsx(gte,{className:"h-100 w-full rounded-md border p-4",children:y.jsx("canvas",{ref:i})})]})})]})}function XA(t,e){return typeof t=="function"?t(e):t}function Rl(t,e){return n=>{e.setState(i=>({...i,[t]:XA(n,i[t])}))}}function VC(t){return t instanceof Function}function lot(t){return Array.isArray(t)&&t.every(e=>typeof e=="number")}function cot(t,e){const n=[],i=r=>{r.forEach(a=>{n.push(a);const o=e(a);o!=null&&o.length&&i(o)})};return i(t),n}function Tn(t,e,n){let i=[],r;return a=>{let o;n.key&&n.debug&&(o=Date.now());const s=t(a);if(!(s.length!==i.length||s.some((d,f)=>i[f]!==d)))return r;i=s;let c;if(n.key&&n.debug&&(c=Date.now()),r=e(...s),n==null||n.onChange==null||n.onChange(r),n.key&&n.debug&&n!=null&&n.debug()){const d=Math.round((Date.now()-o)*100)/100,f=Math.round((Date.now()-c)*100)/100,h=f/16,m=(g,v)=>{for(g=String(g);g.length<v;)g=" "+g;return g};console.info(`%c⏱ ${m(f,5)} /${m(d,5)} ms`,`
|
|
245
245
|
font-size: .6rem;
|
|
246
246
|
font-weight: bold;
|
|
247
|
-
color: hsl(${Math.max(0,Math.min(120-120*h,120))}deg 100% 31%);`,n?.key)}return r}}function In(t,e,n,i){return{debug:()=>{var r;return(r=t?.debugAll)!=null?r:t[e]},key:!1,onChange:i}}function dot(t,e,n,i){const r=()=>{var o;return(o=a.getValue())!=null?o:t.options.renderFallbackValue},a={id:`${e.id}_${n.id}`,row:e,column:n,getValue:()=>e.getValue(i),renderValue:r,getContext:Tn(()=>[t,n,e,a],(o,s,l,c)=>({table:o,column:s,row:l,cell:c,getValue:c.getValue,renderValue:c.renderValue}),In(t.options,"debugCells"))};return t._features.forEach(o=>{o.createCell==null||o.createCell(a,n,e,t)},{}),a}function uot(t,e,n,i){var r,a;const s={...t._getDefaultColumnDef(),...e},l=s.accessorKey;let c=(r=(a=s.id)!=null?a:l?typeof String.prototype.replaceAll=="function"?l.replaceAll(".","_"):l.replace(/\./g,"_"):void 0)!=null?r:typeof s.header=="string"?s.header:void 0,d;if(s.accessorFn?d=s.accessorFn:l&&(l.includes(".")?d=h=>{let m=h;for(const v of l.split(".")){var g;m=(g=m)==null?void 0:g[v]}return m}:d=h=>h[s.accessorKey]),!c)throw new Error;let f={id:`${String(c)}`,accessorFn:d,parent:i,depth:n,columnDef:s,columns:[],getFlatColumns:Tn(()=>[!0],()=>{var h;return[f,...(h=f.columns)==null?void 0:h.flatMap(m=>m.getFlatColumns())]},In(t.options,"debugColumns")),getLeafColumns:Tn(()=>[t._getOrderColumnsFn()],h=>{var m;if((m=f.columns)!=null&&m.length){let g=f.columns.flatMap(v=>v.getLeafColumns());return h(g)}return[f]},In(t.options,"debugColumns"))};for(const h of t._features)h.createColumn==null||h.createColumn(f,t);return f}const Wo="debugHeaders";function bY(t,e,n){var i;let a={id:(i=n.id)!=null?i:e.id,column:e,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const o=[],s=l=>{l.subHeaders&&l.subHeaders.length&&l.subHeaders.map(s),o.push(l)};return s(a),o},getContext:()=>({table:t,header:a,column:e})};return t._features.forEach(o=>{o.createHeader==null||o.createHeader(a,t)}),a}const fot={createTable:t=>{t.getHeaderGroups=Tn(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,i,r)=>{var a,o;const s=(a=i?.map(f=>n.find(h=>h.id===f)).filter(Boolean))!=null?a:[],l=(o=r?.map(f=>n.find(h=>h.id===f)).filter(Boolean))!=null?o:[],c=n.filter(f=>!(i!=null&&i.includes(f.id))&&!(r!=null&&r.includes(f.id)));return Qw(e,[...s,...c,...l],t)},In(t.options,Wo)),t.getCenterHeaderGroups=Tn(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,i,r)=>(n=n.filter(a=>!(i!=null&&i.includes(a.id))&&!(r!=null&&r.includes(a.id))),Qw(e,n,t,"center")),In(t.options,Wo)),t.getLeftHeaderGroups=Tn(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left],(e,n,i)=>{var r;const a=(r=i?.map(o=>n.find(s=>s.id===o)).filter(Boolean))!=null?r:[];return Qw(e,a,t,"left")},In(t.options,Wo)),t.getRightHeaderGroups=Tn(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.right],(e,n,i)=>{var r;const a=(r=i?.map(o=>n.find(s=>s.id===o)).filter(Boolean))!=null?r:[];return Qw(e,a,t,"right")},In(t.options,Wo)),t.getFooterGroups=Tn(()=>[t.getHeaderGroups()],e=>[...e].reverse(),In(t.options,Wo)),t.getLeftFooterGroups=Tn(()=>[t.getLeftHeaderGroups()],e=>[...e].reverse(),In(t.options,Wo)),t.getCenterFooterGroups=Tn(()=>[t.getCenterHeaderGroups()],e=>[...e].reverse(),In(t.options,Wo)),t.getRightFooterGroups=Tn(()=>[t.getRightHeaderGroups()],e=>[...e].reverse(),In(t.options,Wo)),t.getFlatHeaders=Tn(()=>[t.getHeaderGroups()],e=>e.map(n=>n.headers).flat(),In(t.options,Wo)),t.getLeftFlatHeaders=Tn(()=>[t.getLeftHeaderGroups()],e=>e.map(n=>n.headers).flat(),In(t.options,Wo)),t.getCenterFlatHeaders=Tn(()=>[t.getCenterHeaderGroups()],e=>e.map(n=>n.headers).flat(),In(t.options,Wo)),t.getRightFlatHeaders=Tn(()=>[t.getRightHeaderGroups()],e=>e.map(n=>n.headers).flat(),In(t.options,Wo)),t.getCenterLeafHeaders=Tn(()=>[t.getCenterFlatHeaders()],e=>e.filter(n=>{var i;return!((i=n.subHeaders)!=null&&i.length)}),In(t.options,Wo)),t.getLeftLeafHeaders=Tn(()=>[t.getLeftFlatHeaders()],e=>e.filter(n=>{var i;return!((i=n.subHeaders)!=null&&i.length)}),In(t.options,Wo)),t.getRightLeafHeaders=Tn(()=>[t.getRightFlatHeaders()],e=>e.filter(n=>{var i;return!((i=n.subHeaders)!=null&&i.length)}),In(t.options,Wo)),t.getLeafHeaders=Tn(()=>[t.getLeftHeaderGroups(),t.getCenterHeaderGroups(),t.getRightHeaderGroups()],(e,n,i)=>{var r,a,o,s,l,c;return[...(r=(a=e[0])==null?void 0:a.headers)!=null?r:[],...(o=(s=n[0])==null?void 0:s.headers)!=null?o:[],...(l=(c=i[0])==null?void 0:c.headers)!=null?l:[]].map(d=>d.getLeafHeaders()).flat()},In(t.options,Wo))}};function Qw(t,e,n,i){var r,a;let o=0;const s=function(h,m){m===void 0&&(m=1),o=Math.max(o,m),h.filter(g=>g.getIsVisible()).forEach(g=>{var v;(v=g.columns)!=null&&v.length&&s(g.columns,m+1)},0)};s(t);let l=[];const c=(h,m)=>{const g={depth:m,id:[i,`${m}`].filter(Boolean).join("_"),headers:[]},v=[];h.forEach(b=>{const k=[...v].reverse()[0],w=b.column.depth===g.depth;let x,F=!1;if(w&&b.column.parent?x=b.column.parent:(x=b.column,F=!0),k&&k?.column===x)k.subHeaders.push(b);else{const _=bY(n,x,{id:[i,m,x.id,b?.id].filter(Boolean).join("_"),isPlaceholder:F,placeholderId:F?`${v.filter(T=>T.column===x).length}`:void 0,depth:m,index:v.length});_.subHeaders.push(b),v.push(_)}g.headers.push(b),b.headerGroup=g}),l.push(g),m>0&&c(v,m-1)},d=e.map((h,m)=>bY(n,h,{depth:o,index:m}));c(d,o-1),l.reverse();const f=h=>h.filter(g=>g.column.getIsVisible()).map(g=>{let v=0,b=0,k=[0];g.subHeaders&&g.subHeaders.length?(k=[],f(g.subHeaders).forEach(x=>{let{colSpan:F,rowSpan:_}=x;v+=F,k.push(_)})):v=1;const w=Math.min(...k);return b=b+w,g.colSpan=v,g.rowSpan=b,{colSpan:v,rowSpan:b}});return f((r=(a=l[0])==null?void 0:a.headers)!=null?r:[]),l}const yU=(t,e,n,i,r,a,o)=>{let s={id:e,index:i,original:n,depth:r,parentId:o,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(s._valuesCache.hasOwnProperty(l))return s._valuesCache[l];const c=t.getColumn(l);if(c!=null&&c.accessorFn)return s._valuesCache[l]=c.accessorFn(s.original,i),s._valuesCache[l]},getUniqueValues:l=>{if(s._uniqueValuesCache.hasOwnProperty(l))return s._uniqueValuesCache[l];const c=t.getColumn(l);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(s._uniqueValuesCache[l]=c.columnDef.getUniqueValues(s.original,i),s._uniqueValuesCache[l]):(s._uniqueValuesCache[l]=[s.getValue(l)],s._uniqueValuesCache[l])},renderValue:l=>{var c;return(c=s.getValue(l))!=null?c:t.options.renderFallbackValue},subRows:[],getLeafRows:()=>cot(s.subRows,l=>l.subRows),getParentRow:()=>s.parentId?t.getRow(s.parentId,!0):void 0,getParentRows:()=>{let l=[],c=s;for(;;){const d=c.getParentRow();if(!d)break;l.push(d),c=d}return l.reverse()},getAllCells:Tn(()=>[t.getAllLeafColumns()],l=>l.map(c=>dot(t,s,c,c.id)),In(t.options,"debugRows")),_getAllCellsByColumnId:Tn(()=>[s.getAllCells()],l=>l.reduce((c,d)=>(c[d.column.id]=d,c),{}),In(t.options,"debugRows"))};for(let l=0;l<t._features.length;l++){const c=t._features[l];c==null||c.createRow==null||c.createRow(s,t)}return s},Aot={createColumn:(t,e)=>{t._getFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,t.id),t.getFacetedRowModel=()=>t._getFacetedRowModel?t._getFacetedRowModel():e.getPreFilteredRowModel(),t._getFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,t.id),t.getFacetedUniqueValues=()=>t._getFacetedUniqueValues?t._getFacetedUniqueValues():new Map,t._getFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,t.id),t.getFacetedMinMaxValues=()=>{if(t._getFacetedMinMaxValues)return t._getFacetedMinMaxValues()}}},ige=(t,e,n)=>{var i,r;const a=n==null||(i=n.toString())==null?void 0:i.toLowerCase();return!!(!((r=t.getValue(e))==null||(r=r.toString())==null||(r=r.toLowerCase())==null)&&r.includes(a))};ige.autoRemove=t=>gd(t);const rge=(t,e,n)=>{var i;return!!(!((i=t.getValue(e))==null||(i=i.toString())==null)&&i.includes(n))};rge.autoRemove=t=>gd(t);const age=(t,e,n)=>{var i;return((i=t.getValue(e))==null||(i=i.toString())==null?void 0:i.toLowerCase())===n?.toLowerCase()};age.autoRemove=t=>gd(t);const oge=(t,e,n)=>{var i;return(i=t.getValue(e))==null?void 0:i.includes(n)};oge.autoRemove=t=>gd(t);const sge=(t,e,n)=>!n.some(i=>{var r;return!((r=t.getValue(e))!=null&&r.includes(i))});sge.autoRemove=t=>gd(t)||!(t!=null&&t.length);const lge=(t,e,n)=>n.some(i=>{var r;return(r=t.getValue(e))==null?void 0:r.includes(i)});lge.autoRemove=t=>gd(t)||!(t!=null&&t.length);const cge=(t,e,n)=>t.getValue(e)===n;cge.autoRemove=t=>gd(t);const dge=(t,e,n)=>t.getValue(e)==n;dge.autoRemove=t=>gd(t);const kU=(t,e,n)=>{let[i,r]=n;const a=t.getValue(e);return a>=i&&a<=r};kU.resolveFilterValue=t=>{let[e,n]=t,i=typeof e!="number"?parseFloat(e):e,r=typeof n!="number"?parseFloat(n):n,a=e===null||Number.isNaN(i)?-1/0:i,o=n===null||Number.isNaN(r)?1/0:r;if(a>o){const s=a;a=o,o=s}return[a,o]};kU.autoRemove=t=>gd(t)||gd(t[0])&&gd(t[1]);const xf={includesString:ige,includesStringSensitive:rge,equalsString:age,arrIncludes:oge,arrIncludesAll:sge,arrIncludesSome:lge,equals:cge,weakEquals:dge,inNumberRange:kU};function gd(t){return t==null||t===""}const mot={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:t=>({columnFilters:[],...t}),getDefaultOptions:t=>({onColumnFiltersChange:Rl("columnFilters",t),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(t,e)=>{t.getAutoFilterFn=()=>{const n=e.getCoreRowModel().flatRows[0],i=n?.getValue(t.id);return typeof i=="string"?xf.includesString:typeof i=="number"?xf.inNumberRange:typeof i=="boolean"||i!==null&&typeof i=="object"?xf.equals:Array.isArray(i)?xf.arrIncludes:xf.weakEquals},t.getFilterFn=()=>{var n,i;return VC(t.columnDef.filterFn)?t.columnDef.filterFn:t.columnDef.filterFn==="auto"?t.getAutoFilterFn():(n=(i=e.options.filterFns)==null?void 0:i[t.columnDef.filterFn])!=null?n:xf[t.columnDef.filterFn]},t.getCanFilter=()=>{var n,i,r;return((n=t.columnDef.enableColumnFilter)!=null?n:!0)&&((i=e.options.enableColumnFilters)!=null?i:!0)&&((r=e.options.enableFilters)!=null?r:!0)&&!!t.accessorFn},t.getIsFiltered=()=>t.getFilterIndex()>-1,t.getFilterValue=()=>{var n;return(n=e.getState().columnFilters)==null||(n=n.find(i=>i.id===t.id))==null?void 0:n.value},t.getFilterIndex=()=>{var n,i;return(n=(i=e.getState().columnFilters)==null?void 0:i.findIndex(r=>r.id===t.id))!=null?n:-1},t.setFilterValue=n=>{e.setColumnFilters(i=>{const r=t.getFilterFn(),a=i?.find(d=>d.id===t.id),o=XA(n,a?a.value:void 0);if(SY(r,o,t)){var s;return(s=i?.filter(d=>d.id!==t.id))!=null?s:[]}const l={id:t.id,value:o};if(a){var c;return(c=i?.map(d=>d.id===t.id?l:d))!=null?c:[]}return i!=null&&i.length?[...i,l]:[l]})}},createRow:(t,e)=>{t.columnFilters={},t.columnFiltersMeta={}},createTable:t=>{t.setColumnFilters=e=>{const n=t.getAllLeafColumns(),i=r=>{var a;return(a=XA(e,r))==null?void 0:a.filter(o=>{const s=n.find(l=>l.id===o.id);if(s){const l=s.getFilterFn();if(SY(l,o.value,s))return!1}return!0})};t.options.onColumnFiltersChange==null||t.options.onColumnFiltersChange(i)},t.resetColumnFilters=e=>{var n,i;t.setColumnFilters(e?[]:(n=(i=t.initialState)==null?void 0:i.columnFilters)!=null?n:[])},t.getPreFilteredRowModel=()=>t.getCoreRowModel(),t.getFilteredRowModel=()=>(!t._getFilteredRowModel&&t.options.getFilteredRowModel&&(t._getFilteredRowModel=t.options.getFilteredRowModel(t)),t.options.manualFiltering||!t._getFilteredRowModel?t.getPreFilteredRowModel():t._getFilteredRowModel())}};function SY(t,e,n){return(t&&t.autoRemove?t.autoRemove(e,n):!1)||typeof e>"u"||typeof e=="string"&&!e}const hot=(t,e,n)=>n.reduce((i,r)=>{const a=r.getValue(t);return i+(typeof a=="number"?a:0)},0),pot=(t,e,n)=>{let i;return n.forEach(r=>{const a=r.getValue(t);a!=null&&(i>a||i===void 0&&a>=a)&&(i=a)}),i},got=(t,e,n)=>{let i;return n.forEach(r=>{const a=r.getValue(t);a!=null&&(i<a||i===void 0&&a>=a)&&(i=a)}),i},vot=(t,e,n)=>{let i,r;return n.forEach(a=>{const o=a.getValue(t);o!=null&&(i===void 0?o>=o&&(i=r=o):(i>o&&(i=o),r<o&&(r=o)))}),[i,r]},yot=(t,e)=>{let n=0,i=0;if(e.forEach(r=>{let a=r.getValue(t);a!=null&&(a=+a)>=a&&(++n,i+=a)}),n)return i/n},kot=(t,e)=>{if(!e.length)return;const n=e.map(a=>a.getValue(t));if(!lot(n))return;if(n.length===1)return n[0];const i=Math.floor(n.length/2),r=n.sort((a,o)=>a-o);return n.length%2!==0?r[i]:(r[i-1]+r[i])/2},bot=(t,e)=>Array.from(new Set(e.map(n=>n.getValue(t))).values()),Sot=(t,e)=>new Set(e.map(n=>n.getValue(t))).size,wot=(t,e)=>e.length,X4={sum:hot,min:pot,max:got,extent:vot,mean:yot,median:kot,unique:bot,uniqueCount:Sot,count:wot},Not={getDefaultColumnDef:()=>({aggregatedCell:t=>{var e,n;return(e=(n=t.getValue())==null||n.toString==null?void 0:n.toString())!=null?e:null},aggregationFn:"auto"}),getInitialState:t=>({grouping:[],...t}),getDefaultOptions:t=>({onGroupingChange:Rl("grouping",t),groupedColumnMode:"reorder"}),createColumn:(t,e)=>{t.toggleGrouping=()=>{e.setGrouping(n=>n!=null&&n.includes(t.id)?n.filter(i=>i!==t.id):[...n??[],t.id])},t.getCanGroup=()=>{var n,i;return((n=t.columnDef.enableGrouping)!=null?n:!0)&&((i=e.options.enableGrouping)!=null?i:!0)&&(!!t.accessorFn||!!t.columnDef.getGroupingValue)},t.getIsGrouped=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.includes(t.id)},t.getGroupedIndex=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.indexOf(t.id)},t.getToggleGroupingHandler=()=>{const n=t.getCanGroup();return()=>{n&&t.toggleGrouping()}},t.getAutoAggregationFn=()=>{const n=e.getCoreRowModel().flatRows[0],i=n?.getValue(t.id);if(typeof i=="number")return X4.sum;if(Object.prototype.toString.call(i)==="[object Date]")return X4.extent},t.getAggregationFn=()=>{var n,i;if(!t)throw new Error;return VC(t.columnDef.aggregationFn)?t.columnDef.aggregationFn:t.columnDef.aggregationFn==="auto"?t.getAutoAggregationFn():(n=(i=e.options.aggregationFns)==null?void 0:i[t.columnDef.aggregationFn])!=null?n:X4[t.columnDef.aggregationFn]}},createTable:t=>{t.setGrouping=e=>t.options.onGroupingChange==null?void 0:t.options.onGroupingChange(e),t.resetGrouping=e=>{var n,i;t.setGrouping(e?[]:(n=(i=t.initialState)==null?void 0:i.grouping)!=null?n:[])},t.getPreGroupedRowModel=()=>t.getFilteredRowModel(),t.getGroupedRowModel=()=>(!t._getGroupedRowModel&&t.options.getGroupedRowModel&&(t._getGroupedRowModel=t.options.getGroupedRowModel(t)),t.options.manualGrouping||!t._getGroupedRowModel?t.getPreGroupedRowModel():t._getGroupedRowModel())},createRow:(t,e)=>{t.getIsGrouped=()=>!!t.groupingColumnId,t.getGroupingValue=n=>{if(t._groupingValuesCache.hasOwnProperty(n))return t._groupingValuesCache[n];const i=e.getColumn(n);return i!=null&&i.columnDef.getGroupingValue?(t._groupingValuesCache[n]=i.columnDef.getGroupingValue(t.original),t._groupingValuesCache[n]):t.getValue(n)},t._groupingValuesCache={}},createCell:(t,e,n,i)=>{t.getIsGrouped=()=>e.getIsGrouped()&&e.id===n.groupingColumnId,t.getIsPlaceholder=()=>!t.getIsGrouped()&&e.getIsGrouped(),t.getIsAggregated=()=>{var r;return!t.getIsGrouped()&&!t.getIsPlaceholder()&&!!((r=n.subRows)!=null&&r.length)}}};function xot(t,e,n){if(!(e!=null&&e.length)||!n)return t;const i=t.filter(a=>!e.includes(a.id));return n==="remove"?i:[...e.map(a=>t.find(o=>o.id===a)).filter(Boolean),...i]}const Fot={getInitialState:t=>({columnOrder:[],...t}),getDefaultOptions:t=>({onColumnOrderChange:Rl("columnOrder",t)}),createColumn:(t,e)=>{t.getIndex=Tn(n=>[mk(e,n)],n=>n.findIndex(i=>i.id===t.id),In(e.options,"debugColumns")),t.getIsFirstColumn=n=>{var i;return((i=mk(e,n)[0])==null?void 0:i.id)===t.id},t.getIsLastColumn=n=>{var i;const r=mk(e,n);return((i=r[r.length-1])==null?void 0:i.id)===t.id}},createTable:t=>{t.setColumnOrder=e=>t.options.onColumnOrderChange==null?void 0:t.options.onColumnOrderChange(e),t.resetColumnOrder=e=>{var n;t.setColumnOrder(e?[]:(n=t.initialState.columnOrder)!=null?n:[])},t._getOrderColumnsFn=Tn(()=>[t.getState().columnOrder,t.getState().grouping,t.options.groupedColumnMode],(e,n,i)=>r=>{let a=[];if(!(e!=null&&e.length))a=r;else{const o=[...e],s=[...r];for(;s.length&&o.length;){const l=o.shift(),c=s.findIndex(d=>d.id===l);c>-1&&a.push(s.splice(c,1)[0])}a=[...a,...s]}return xot(a,n,i)},In(t.options,"debugTable"))}},Z4=()=>({left:[],right:[]}),_ot={getInitialState:t=>({columnPinning:Z4(),...t}),getDefaultOptions:t=>({onColumnPinningChange:Rl("columnPinning",t)}),createColumn:(t,e)=>{t.pin=n=>{const i=t.getLeafColumns().map(r=>r.id).filter(Boolean);e.setColumnPinning(r=>{var a,o;if(n==="right"){var s,l;return{left:((s=r?.left)!=null?s:[]).filter(f=>!(i!=null&&i.includes(f))),right:[...((l=r?.right)!=null?l:[]).filter(f=>!(i!=null&&i.includes(f))),...i]}}if(n==="left"){var c,d;return{left:[...((c=r?.left)!=null?c:[]).filter(f=>!(i!=null&&i.includes(f))),...i],right:((d=r?.right)!=null?d:[]).filter(f=>!(i!=null&&i.includes(f)))}}return{left:((a=r?.left)!=null?a:[]).filter(f=>!(i!=null&&i.includes(f))),right:((o=r?.right)!=null?o:[]).filter(f=>!(i!=null&&i.includes(f)))}})},t.getCanPin=()=>t.getLeafColumns().some(i=>{var r,a,o;return((r=i.columnDef.enablePinning)!=null?r:!0)&&((a=(o=e.options.enableColumnPinning)!=null?o:e.options.enablePinning)!=null?a:!0)}),t.getIsPinned=()=>{const n=t.getLeafColumns().map(s=>s.id),{left:i,right:r}=e.getState().columnPinning,a=n.some(s=>i?.includes(s)),o=n.some(s=>r?.includes(s));return a?"left":o?"right":!1},t.getPinnedIndex=()=>{var n,i;const r=t.getIsPinned();return r?(n=(i=e.getState().columnPinning)==null||(i=i[r])==null?void 0:i.indexOf(t.id))!=null?n:-1:0}},createRow:(t,e)=>{t.getCenterVisibleCells=Tn(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,i,r)=>{const a=[...i??[],...r??[]];return n.filter(o=>!a.includes(o.column.id))},In(e.options,"debugRows")),t.getLeftVisibleCells=Tn(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left],(n,i)=>(i??[]).map(a=>n.find(o=>o.column.id===a)).filter(Boolean).map(a=>({...a,position:"left"})),In(e.options,"debugRows")),t.getRightVisibleCells=Tn(()=>[t._getAllVisibleCells(),e.getState().columnPinning.right],(n,i)=>(i??[]).map(a=>n.find(o=>o.column.id===a)).filter(Boolean).map(a=>({...a,position:"right"})),In(e.options,"debugRows"))},createTable:t=>{t.setColumnPinning=e=>t.options.onColumnPinningChange==null?void 0:t.options.onColumnPinningChange(e),t.resetColumnPinning=e=>{var n,i;return t.setColumnPinning(e?Z4():(n=(i=t.initialState)==null?void 0:i.columnPinning)!=null?n:Z4())},t.getIsSomeColumnsPinned=e=>{var n;const i=t.getState().columnPinning;if(!e){var r,a;return!!((r=i.left)!=null&&r.length||(a=i.right)!=null&&a.length)}return!!((n=i[e])!=null&&n.length)},t.getLeftLeafColumns=Tn(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left],(e,n)=>(n??[]).map(i=>e.find(r=>r.id===i)).filter(Boolean),In(t.options,"debugColumns")),t.getRightLeafColumns=Tn(()=>[t.getAllLeafColumns(),t.getState().columnPinning.right],(e,n)=>(n??[]).map(i=>e.find(r=>r.id===i)).filter(Boolean),In(t.options,"debugColumns")),t.getCenterLeafColumns=Tn(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,i)=>{const r=[...n??[],...i??[]];return e.filter(a=>!r.includes(a.id))},In(t.options,"debugColumns"))}};function Cot(t){return t||(typeof document<"u"?document:null)}const Hw={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},J4=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Eot={getDefaultColumnDef:()=>Hw,getInitialState:t=>({columnSizing:{},columnSizingInfo:J4(),...t}),getDefaultOptions:t=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Rl("columnSizing",t),onColumnSizingInfoChange:Rl("columnSizingInfo",t)}),createColumn:(t,e)=>{t.getSize=()=>{var n,i,r;const a=e.getState().columnSizing[t.id];return Math.min(Math.max((n=t.columnDef.minSize)!=null?n:Hw.minSize,(i=a??t.columnDef.size)!=null?i:Hw.size),(r=t.columnDef.maxSize)!=null?r:Hw.maxSize)},t.getStart=Tn(n=>[n,mk(e,n),e.getState().columnSizing],(n,i)=>i.slice(0,t.getIndex(n)).reduce((r,a)=>r+a.getSize(),0),In(e.options,"debugColumns")),t.getAfter=Tn(n=>[n,mk(e,n),e.getState().columnSizing],(n,i)=>i.slice(t.getIndex(n)+1).reduce((r,a)=>r+a.getSize(),0),In(e.options,"debugColumns")),t.resetSize=()=>{e.setColumnSizing(n=>{let{[t.id]:i,...r}=n;return r})},t.getCanResize=()=>{var n,i;return((n=t.columnDef.enableResizing)!=null?n:!0)&&((i=e.options.enableColumnResizing)!=null?i:!0)},t.getIsResizing=()=>e.getState().columnSizingInfo.isResizingColumn===t.id},createHeader:(t,e)=>{t.getSize=()=>{let n=0;const i=r=>{if(r.subHeaders.length)r.subHeaders.forEach(i);else{var a;n+=(a=r.column.getSize())!=null?a:0}};return i(t),n},t.getStart=()=>{if(t.index>0){const n=t.headerGroup.headers[t.index-1];return n.getStart()+n.getSize()}return 0},t.getResizeHandler=n=>{const i=e.getColumn(t.column.id),r=i?.getCanResize();return a=>{if(!i||!r||(a.persist==null||a.persist(),eI(a)&&a.touches&&a.touches.length>1))return;const o=t.getSize(),s=t?t.getLeafHeaders().map(k=>[k.column.id,k.column.getSize()]):[[i.id,i.getSize()]],l=eI(a)?Math.round(a.touches[0].clientX):a.clientX,c={},d=(k,w)=>{typeof w=="number"&&(e.setColumnSizingInfo(x=>{var F,_;const T=e.options.columnResizeDirection==="rtl"?-1:1,B=(w-((F=x?.startOffset)!=null?F:0))*T,O=Math.max(B/((_=x?.startSize)!=null?_:0),-.999999);return x.columnSizingStart.forEach(P=>{let[G,U]=P;c[G]=Math.round(Math.max(U+U*O,0)*100)/100}),{...x,deltaOffset:B,deltaPercentage:O}}),(e.options.columnResizeMode==="onChange"||k==="end")&&e.setColumnSizing(x=>({...x,...c})))},f=k=>d("move",k),h=k=>{d("end",k),e.setColumnSizingInfo(w=>({...w,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},m=Cot(n),g={moveHandler:k=>f(k.clientX),upHandler:k=>{m?.removeEventListener("mousemove",g.moveHandler),m?.removeEventListener("mouseup",g.upHandler),h(k.clientX)}},v={moveHandler:k=>(k.cancelable&&(k.preventDefault(),k.stopPropagation()),f(k.touches[0].clientX),!1),upHandler:k=>{var w;m?.removeEventListener("touchmove",v.moveHandler),m?.removeEventListener("touchend",v.upHandler),k.cancelable&&(k.preventDefault(),k.stopPropagation()),h((w=k.touches[0])==null?void 0:w.clientX)}},b=Bot()?{passive:!1}:!1;eI(a)?(m?.addEventListener("touchmove",v.moveHandler,b),m?.addEventListener("touchend",v.upHandler,b)):(m?.addEventListener("mousemove",g.moveHandler,b),m?.addEventListener("mouseup",g.upHandler,b)),e.setColumnSizingInfo(k=>({...k,startOffset:l,startSize:o,deltaOffset:0,deltaPercentage:0,columnSizingStart:s,isResizingColumn:i.id}))}}},createTable:t=>{t.setColumnSizing=e=>t.options.onColumnSizingChange==null?void 0:t.options.onColumnSizingChange(e),t.setColumnSizingInfo=e=>t.options.onColumnSizingInfoChange==null?void 0:t.options.onColumnSizingInfoChange(e),t.resetColumnSizing=e=>{var n;t.setColumnSizing(e?{}:(n=t.initialState.columnSizing)!=null?n:{})},t.resetHeaderSizeInfo=e=>{var n;t.setColumnSizingInfo(e?J4():(n=t.initialState.columnSizingInfo)!=null?n:J4())},t.getTotalSize=()=>{var e,n;return(e=(n=t.getHeaderGroups()[0])==null?void 0:n.headers.reduce((i,r)=>i+r.getSize(),0))!=null?e:0},t.getLeftTotalSize=()=>{var e,n;return(e=(n=t.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((i,r)=>i+r.getSize(),0))!=null?e:0},t.getCenterTotalSize=()=>{var e,n;return(e=(n=t.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((i,r)=>i+r.getSize(),0))!=null?e:0},t.getRightTotalSize=()=>{var e,n;return(e=(n=t.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((i,r)=>i+r.getSize(),0))!=null?e:0}}};let zw=null;function Bot(){if(typeof zw=="boolean")return zw;let t=!1;try{const e={get passive(){return t=!0,!1}},n=()=>{};window.addEventListener("test",n,e),window.removeEventListener("test",n)}catch{t=!1}return zw=t,zw}function eI(t){return t.type==="touchstart"}const Dot={getInitialState:t=>({columnVisibility:{},...t}),getDefaultOptions:t=>({onColumnVisibilityChange:Rl("columnVisibility",t)}),createColumn:(t,e)=>{t.toggleVisibility=n=>{t.getCanHide()&&e.setColumnVisibility(i=>({...i,[t.id]:n??!t.getIsVisible()}))},t.getIsVisible=()=>{var n,i;const r=t.columns;return(n=r.length?r.some(a=>a.getIsVisible()):(i=e.getState().columnVisibility)==null?void 0:i[t.id])!=null?n:!0},t.getCanHide=()=>{var n,i;return((n=t.columnDef.enableHiding)!=null?n:!0)&&((i=e.options.enableHiding)!=null?i:!0)},t.getToggleVisibilityHandler=()=>n=>{t.toggleVisibility==null||t.toggleVisibility(n.target.checked)}},createRow:(t,e)=>{t._getAllVisibleCells=Tn(()=>[t.getAllCells(),e.getState().columnVisibility],n=>n.filter(i=>i.column.getIsVisible()),In(e.options,"debugRows")),t.getVisibleCells=Tn(()=>[t.getLeftVisibleCells(),t.getCenterVisibleCells(),t.getRightVisibleCells()],(n,i,r)=>[...n,...i,...r],In(e.options,"debugRows"))},createTable:t=>{const e=(n,i)=>Tn(()=>[i(),i().filter(r=>r.getIsVisible()).map(r=>r.id).join("_")],r=>r.filter(a=>a.getIsVisible==null?void 0:a.getIsVisible()),In(t.options,"debugColumns"));t.getVisibleFlatColumns=e("getVisibleFlatColumns",()=>t.getAllFlatColumns()),t.getVisibleLeafColumns=e("getVisibleLeafColumns",()=>t.getAllLeafColumns()),t.getLeftVisibleLeafColumns=e("getLeftVisibleLeafColumns",()=>t.getLeftLeafColumns()),t.getRightVisibleLeafColumns=e("getRightVisibleLeafColumns",()=>t.getRightLeafColumns()),t.getCenterVisibleLeafColumns=e("getCenterVisibleLeafColumns",()=>t.getCenterLeafColumns()),t.setColumnVisibility=n=>t.options.onColumnVisibilityChange==null?void 0:t.options.onColumnVisibilityChange(n),t.resetColumnVisibility=n=>{var i;t.setColumnVisibility(n?{}:(i=t.initialState.columnVisibility)!=null?i:{})},t.toggleAllColumnsVisible=n=>{var i;n=(i=n)!=null?i:!t.getIsAllColumnsVisible(),t.setColumnVisibility(t.getAllLeafColumns().reduce((r,a)=>({...r,[a.id]:n||!(a.getCanHide!=null&&a.getCanHide())}),{}))},t.getIsAllColumnsVisible=()=>!t.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),t.getIsSomeColumnsVisible=()=>t.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),t.getToggleAllColumnsVisibilityHandler=()=>n=>{var i;t.toggleAllColumnsVisible((i=n.target)==null?void 0:i.checked)}}};function mk(t,e){return e?e==="center"?t.getCenterVisibleLeafColumns():e==="left"?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns()}const Tot={createTable:t=>{t._getGlobalFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,"__global__"),t.getGlobalFacetedRowModel=()=>t.options.manualFiltering||!t._getGlobalFacetedRowModel?t.getPreFilteredRowModel():t._getGlobalFacetedRowModel(),t._getGlobalFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,"__global__"),t.getGlobalFacetedUniqueValues=()=>t._getGlobalFacetedUniqueValues?t._getGlobalFacetedUniqueValues():new Map,t._getGlobalFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,"__global__"),t.getGlobalFacetedMinMaxValues=()=>{if(t._getGlobalFacetedMinMaxValues)return t._getGlobalFacetedMinMaxValues()}}},Iot={getInitialState:t=>({globalFilter:void 0,...t}),getDefaultOptions:t=>({onGlobalFilterChange:Rl("globalFilter",t),globalFilterFn:"auto",getColumnCanGlobalFilter:e=>{var n;const i=(n=t.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[e.id])==null?void 0:n.getValue();return typeof i=="string"||typeof i=="number"}}),createColumn:(t,e)=>{t.getCanGlobalFilter=()=>{var n,i,r,a;return((n=t.columnDef.enableGlobalFilter)!=null?n:!0)&&((i=e.options.enableGlobalFilter)!=null?i:!0)&&((r=e.options.enableFilters)!=null?r:!0)&&((a=e.options.getColumnCanGlobalFilter==null?void 0:e.options.getColumnCanGlobalFilter(t))!=null?a:!0)&&!!t.accessorFn}},createTable:t=>{t.getGlobalAutoFilterFn=()=>xf.includesString,t.getGlobalFilterFn=()=>{var e,n;const{globalFilterFn:i}=t.options;return VC(i)?i:i==="auto"?t.getGlobalAutoFilterFn():(e=(n=t.options.filterFns)==null?void 0:n[i])!=null?e:xf[i]},t.setGlobalFilter=e=>{t.options.onGlobalFilterChange==null||t.options.onGlobalFilterChange(e)},t.resetGlobalFilter=e=>{t.setGlobalFilter(e?void 0:t.initialState.globalFilter)}}},Oot={getInitialState:t=>({expanded:{},...t}),getDefaultOptions:t=>({onExpandedChange:Rl("expanded",t),paginateExpandedRows:!0}),createTable:t=>{let e=!1,n=!1;t._autoResetExpanded=()=>{var i,r;if(!e){t._queue(()=>{e=!0});return}if((i=(r=t.options.autoResetAll)!=null?r:t.options.autoResetExpanded)!=null?i:!t.options.manualExpanding){if(n)return;n=!0,t._queue(()=>{t.resetExpanded(),n=!1})}},t.setExpanded=i=>t.options.onExpandedChange==null?void 0:t.options.onExpandedChange(i),t.toggleAllRowsExpanded=i=>{i??!t.getIsAllRowsExpanded()?t.setExpanded(!0):t.setExpanded({})},t.resetExpanded=i=>{var r,a;t.setExpanded(i?{}:(r=(a=t.initialState)==null?void 0:a.expanded)!=null?r:{})},t.getCanSomeRowsExpand=()=>t.getPrePaginationRowModel().flatRows.some(i=>i.getCanExpand()),t.getToggleAllRowsExpandedHandler=()=>i=>{i.persist==null||i.persist(),t.toggleAllRowsExpanded()},t.getIsSomeRowsExpanded=()=>{const i=t.getState().expanded;return i===!0||Object.values(i).some(Boolean)},t.getIsAllRowsExpanded=()=>{const i=t.getState().expanded;return typeof i=="boolean"?i===!0:!(!Object.keys(i).length||t.getRowModel().flatRows.some(r=>!r.getIsExpanded()))},t.getExpandedDepth=()=>{let i=0;return(t.getState().expanded===!0?Object.keys(t.getRowModel().rowsById):Object.keys(t.getState().expanded)).forEach(a=>{const o=a.split(".");i=Math.max(i,o.length)}),i},t.getPreExpandedRowModel=()=>t.getSortedRowModel(),t.getExpandedRowModel=()=>(!t._getExpandedRowModel&&t.options.getExpandedRowModel&&(t._getExpandedRowModel=t.options.getExpandedRowModel(t)),t.options.manualExpanding||!t._getExpandedRowModel?t.getPreExpandedRowModel():t._getExpandedRowModel())},createRow:(t,e)=>{t.toggleExpanded=n=>{e.setExpanded(i=>{var r;const a=i===!0?!0:!!(i!=null&&i[t.id]);let o={};if(i===!0?Object.keys(e.getRowModel().rowsById).forEach(s=>{o[s]=!0}):o=i,n=(r=n)!=null?r:!a,!a&&n)return{...o,[t.id]:!0};if(a&&!n){const{[t.id]:s,...l}=o;return l}return i})},t.getIsExpanded=()=>{var n;const i=e.getState().expanded;return!!((n=e.options.getIsRowExpanded==null?void 0:e.options.getIsRowExpanded(t))!=null?n:i===!0||i?.[t.id])},t.getCanExpand=()=>{var n,i,r;return(n=e.options.getRowCanExpand==null?void 0:e.options.getRowCanExpand(t))!=null?n:((i=e.options.enableExpanding)!=null?i:!0)&&!!((r=t.subRows)!=null&&r.length)},t.getIsAllParentsExpanded=()=>{let n=!0,i=t;for(;n&&i.parentId;)i=e.getRow(i.parentId,!0),n=i.getIsExpanded();return n},t.getToggleExpandedHandler=()=>{const n=t.getCanExpand();return()=>{n&&t.toggleExpanded()}}}},pR=0,gR=10,tI=()=>({pageIndex:pR,pageSize:gR}),Rot={getInitialState:t=>({...t,pagination:{...tI(),...t?.pagination}}),getDefaultOptions:t=>({onPaginationChange:Rl("pagination",t)}),createTable:t=>{let e=!1,n=!1;t._autoResetPageIndex=()=>{var i,r;if(!e){t._queue(()=>{e=!0});return}if((i=(r=t.options.autoResetAll)!=null?r:t.options.autoResetPageIndex)!=null?i:!t.options.manualPagination){if(n)return;n=!0,t._queue(()=>{t.resetPageIndex(),n=!1})}},t.setPagination=i=>{const r=a=>XA(i,a);return t.options.onPaginationChange==null?void 0:t.options.onPaginationChange(r)},t.resetPagination=i=>{var r;t.setPagination(i?tI():(r=t.initialState.pagination)!=null?r:tI())},t.setPageIndex=i=>{t.setPagination(r=>{let a=XA(i,r.pageIndex);const o=typeof t.options.pageCount>"u"||t.options.pageCount===-1?Number.MAX_SAFE_INTEGER:t.options.pageCount-1;return a=Math.max(0,Math.min(a,o)),{...r,pageIndex:a}})},t.resetPageIndex=i=>{var r,a;t.setPageIndex(i?pR:(r=(a=t.initialState)==null||(a=a.pagination)==null?void 0:a.pageIndex)!=null?r:pR)},t.resetPageSize=i=>{var r,a;t.setPageSize(i?gR:(r=(a=t.initialState)==null||(a=a.pagination)==null?void 0:a.pageSize)!=null?r:gR)},t.setPageSize=i=>{t.setPagination(r=>{const a=Math.max(1,XA(i,r.pageSize)),o=r.pageSize*r.pageIndex,s=Math.floor(o/a);return{...r,pageIndex:s,pageSize:a}})},t.setPageCount=i=>t.setPagination(r=>{var a;let o=XA(i,(a=t.options.pageCount)!=null?a:-1);return typeof o=="number"&&(o=Math.max(-1,o)),{...r,pageCount:o}}),t.getPageOptions=Tn(()=>[t.getPageCount()],i=>{let r=[];return i&&i>0&&(r=[...new Array(i)].fill(null).map((a,o)=>o)),r},In(t.options,"debugTable")),t.getCanPreviousPage=()=>t.getState().pagination.pageIndex>0,t.getCanNextPage=()=>{const{pageIndex:i}=t.getState().pagination,r=t.getPageCount();return r===-1?!0:r===0?!1:i<r-1},t.previousPage=()=>t.setPageIndex(i=>i-1),t.nextPage=()=>t.setPageIndex(i=>i+1),t.firstPage=()=>t.setPageIndex(0),t.lastPage=()=>t.setPageIndex(t.getPageCount()-1),t.getPrePaginationRowModel=()=>t.getExpandedRowModel(),t.getPaginationRowModel=()=>(!t._getPaginationRowModel&&t.options.getPaginationRowModel&&(t._getPaginationRowModel=t.options.getPaginationRowModel(t)),t.options.manualPagination||!t._getPaginationRowModel?t.getPrePaginationRowModel():t._getPaginationRowModel()),t.getPageCount=()=>{var i;return(i=t.options.pageCount)!=null?i:Math.ceil(t.getRowCount()/t.getState().pagination.pageSize)},t.getRowCount=()=>{var i;return(i=t.options.rowCount)!=null?i:t.getPrePaginationRowModel().rows.length}}},nI=()=>({top:[],bottom:[]}),Pot={getInitialState:t=>({rowPinning:nI(),...t}),getDefaultOptions:t=>({onRowPinningChange:Rl("rowPinning",t)}),createRow:(t,e)=>{t.pin=(n,i,r)=>{const a=i?t.getLeafRows().map(l=>{let{id:c}=l;return c}):[],o=r?t.getParentRows().map(l=>{let{id:c}=l;return c}):[],s=new Set([...o,t.id,...a]);e.setRowPinning(l=>{var c,d;if(n==="bottom"){var f,h;return{top:((f=l?.top)!=null?f:[]).filter(v=>!(s!=null&&s.has(v))),bottom:[...((h=l?.bottom)!=null?h:[]).filter(v=>!(s!=null&&s.has(v))),...Array.from(s)]}}if(n==="top"){var m,g;return{top:[...((m=l?.top)!=null?m:[]).filter(v=>!(s!=null&&s.has(v))),...Array.from(s)],bottom:((g=l?.bottom)!=null?g:[]).filter(v=>!(s!=null&&s.has(v)))}}return{top:((c=l?.top)!=null?c:[]).filter(v=>!(s!=null&&s.has(v))),bottom:((d=l?.bottom)!=null?d:[]).filter(v=>!(s!=null&&s.has(v)))}})},t.getCanPin=()=>{var n;const{enableRowPinning:i,enablePinning:r}=e.options;return typeof i=="function"?i(t):(n=i??r)!=null?n:!0},t.getIsPinned=()=>{const n=[t.id],{top:i,bottom:r}=e.getState().rowPinning,a=n.some(s=>i?.includes(s)),o=n.some(s=>r?.includes(s));return a?"top":o?"bottom":!1},t.getPinnedIndex=()=>{var n,i;const r=t.getIsPinned();if(!r)return-1;const a=(n=r==="top"?e.getTopRows():e.getBottomRows())==null?void 0:n.map(o=>{let{id:s}=o;return s});return(i=a?.indexOf(t.id))!=null?i:-1}},createTable:t=>{t.setRowPinning=e=>t.options.onRowPinningChange==null?void 0:t.options.onRowPinningChange(e),t.resetRowPinning=e=>{var n,i;return t.setRowPinning(e?nI():(n=(i=t.initialState)==null?void 0:i.rowPinning)!=null?n:nI())},t.getIsSomeRowsPinned=e=>{var n;const i=t.getState().rowPinning;if(!e){var r,a;return!!((r=i.top)!=null&&r.length||(a=i.bottom)!=null&&a.length)}return!!((n=i[e])!=null&&n.length)},t._getPinnedRows=(e,n,i)=>{var r;return((r=t.options.keepPinnedRows)==null||r?(n??[]).map(o=>{const s=t.getRow(o,!0);return s.getIsAllParentsExpanded()?s:null}):(n??[]).map(o=>e.find(s=>s.id===o))).filter(Boolean).map(o=>({...o,position:i}))},t.getTopRows=Tn(()=>[t.getRowModel().rows,t.getState().rowPinning.top],(e,n)=>t._getPinnedRows(e,n,"top"),In(t.options,"debugRows")),t.getBottomRows=Tn(()=>[t.getRowModel().rows,t.getState().rowPinning.bottom],(e,n)=>t._getPinnedRows(e,n,"bottom"),In(t.options,"debugRows")),t.getCenterRows=Tn(()=>[t.getRowModel().rows,t.getState().rowPinning.top,t.getState().rowPinning.bottom],(e,n,i)=>{const r=new Set([...n??[],...i??[]]);return e.filter(a=>!r.has(a.id))},In(t.options,"debugRows"))}},Lot={getInitialState:t=>({rowSelection:{},...t}),getDefaultOptions:t=>({onRowSelectionChange:Rl("rowSelection",t),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:t=>{t.setRowSelection=e=>t.options.onRowSelectionChange==null?void 0:t.options.onRowSelectionChange(e),t.resetRowSelection=e=>{var n;return t.setRowSelection(e?{}:(n=t.initialState.rowSelection)!=null?n:{})},t.toggleAllRowsSelected=e=>{t.setRowSelection(n=>{e=typeof e<"u"?e:!t.getIsAllRowsSelected();const i={...n},r=t.getPreGroupedRowModel().flatRows;return e?r.forEach(a=>{a.getCanSelect()&&(i[a.id]=!0)}):r.forEach(a=>{delete i[a.id]}),i})},t.toggleAllPageRowsSelected=e=>t.setRowSelection(n=>{const i=typeof e<"u"?e:!t.getIsAllPageRowsSelected(),r={...n};return t.getRowModel().rows.forEach(a=>{vR(r,a.id,i,!0,t)}),r}),t.getPreSelectedRowModel=()=>t.getCoreRowModel(),t.getSelectedRowModel=Tn(()=>[t.getState().rowSelection,t.getCoreRowModel()],(e,n)=>Object.keys(e).length?iI(t,n):{rows:[],flatRows:[],rowsById:{}},In(t.options,"debugTable")),t.getFilteredSelectedRowModel=Tn(()=>[t.getState().rowSelection,t.getFilteredRowModel()],(e,n)=>Object.keys(e).length?iI(t,n):{rows:[],flatRows:[],rowsById:{}},In(t.options,"debugTable")),t.getGroupedSelectedRowModel=Tn(()=>[t.getState().rowSelection,t.getSortedRowModel()],(e,n)=>Object.keys(e).length?iI(t,n):{rows:[],flatRows:[],rowsById:{}},In(t.options,"debugTable")),t.getIsAllRowsSelected=()=>{const e=t.getFilteredRowModel().flatRows,{rowSelection:n}=t.getState();let i=!!(e.length&&Object.keys(n).length);return i&&e.some(r=>r.getCanSelect()&&!n[r.id])&&(i=!1),i},t.getIsAllPageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows.filter(r=>r.getCanSelect()),{rowSelection:n}=t.getState();let i=!!e.length;return i&&e.some(r=>!n[r.id])&&(i=!1),i},t.getIsSomeRowsSelected=()=>{var e;const n=Object.keys((e=t.getState().rowSelection)!=null?e:{}).length;return n>0&&n<t.getFilteredRowModel().flatRows.length},t.getIsSomePageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows;return t.getIsAllPageRowsSelected()?!1:e.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},t.getToggleAllRowsSelectedHandler=()=>e=>{t.toggleAllRowsSelected(e.target.checked)},t.getToggleAllPageRowsSelectedHandler=()=>e=>{t.toggleAllPageRowsSelected(e.target.checked)}},createRow:(t,e)=>{t.toggleSelected=(n,i)=>{const r=t.getIsSelected();e.setRowSelection(a=>{var o;if(n=typeof n<"u"?n:!r,t.getCanSelect()&&r===n)return a;const s={...a};return vR(s,t.id,n,(o=i?.selectChildren)!=null?o:!0,e),s})},t.getIsSelected=()=>{const{rowSelection:n}=e.getState();return bU(t,n)},t.getIsSomeSelected=()=>{const{rowSelection:n}=e.getState();return yR(t,n)==="some"},t.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=e.getState();return yR(t,n)==="all"},t.getCanSelect=()=>{var n;return typeof e.options.enableRowSelection=="function"?e.options.enableRowSelection(t):(n=e.options.enableRowSelection)!=null?n:!0},t.getCanSelectSubRows=()=>{var n;return typeof e.options.enableSubRowSelection=="function"?e.options.enableSubRowSelection(t):(n=e.options.enableSubRowSelection)!=null?n:!0},t.getCanMultiSelect=()=>{var n;return typeof e.options.enableMultiRowSelection=="function"?e.options.enableMultiRowSelection(t):(n=e.options.enableMultiRowSelection)!=null?n:!0},t.getToggleSelectedHandler=()=>{const n=t.getCanSelect();return i=>{var r;n&&t.toggleSelected((r=i.target)==null?void 0:r.checked)}}}},vR=(t,e,n,i,r)=>{var a;const o=r.getRow(e,!0);n?(o.getCanMultiSelect()||Object.keys(t).forEach(s=>delete t[s]),o.getCanSelect()&&(t[e]=!0)):delete t[e],i&&(a=o.subRows)!=null&&a.length&&o.getCanSelectSubRows()&&o.subRows.forEach(s=>vR(t,s.id,n,i,r))};function iI(t,e){const n=t.getState().rowSelection,i=[],r={},a=function(o,s){return o.map(l=>{var c;const d=bU(l,n);if(d&&(i.push(l),r[l.id]=l),(c=l.subRows)!=null&&c.length&&(l={...l,subRows:a(l.subRows)}),d)return l}).filter(Boolean)};return{rows:a(e.rows),flatRows:i,rowsById:r}}function bU(t,e){var n;return(n=e[t.id])!=null?n:!1}function yR(t,e,n){var i;if(!((i=t.subRows)!=null&&i.length))return!1;let r=!0,a=!1;return t.subRows.forEach(o=>{if(!(a&&!r)&&(o.getCanSelect()&&(bU(o,e)?a=!0:r=!1),o.subRows&&o.subRows.length)){const s=yR(o,e);s==="all"?a=!0:(s==="some"&&(a=!0),r=!1)}}),r?"all":a?"some":!1}const kR=/([0-9]+)/gm,Uot=(t,e,n)=>uge(fm(t.getValue(n)).toLowerCase(),fm(e.getValue(n)).toLowerCase()),Mot=(t,e,n)=>uge(fm(t.getValue(n)),fm(e.getValue(n))),$ot=(t,e,n)=>SU(fm(t.getValue(n)).toLowerCase(),fm(e.getValue(n)).toLowerCase()),jot=(t,e,n)=>SU(fm(t.getValue(n)),fm(e.getValue(n))),Qot=(t,e,n)=>{const i=t.getValue(n),r=e.getValue(n);return i>r?1:i<r?-1:0},Hot=(t,e,n)=>SU(t.getValue(n),e.getValue(n));function SU(t,e){return t===e?0:t>e?1:-1}function fm(t){return typeof t=="number"?isNaN(t)||t===1/0||t===-1/0?"":String(t):typeof t=="string"?t:""}function uge(t,e){const n=t.split(kR).filter(Boolean),i=e.split(kR).filter(Boolean);for(;n.length&&i.length;){const r=n.shift(),a=i.shift(),o=parseInt(r,10),s=parseInt(a,10),l=[o,s].sort();if(isNaN(l[0])){if(r>a)return 1;if(a>r)return-1;continue}if(isNaN(l[1]))return isNaN(o)?-1:1;if(o>s)return 1;if(s>o)return-1}return n.length-i.length}const Iy={alphanumeric:Uot,alphanumericCaseSensitive:Mot,text:$ot,textCaseSensitive:jot,datetime:Qot,basic:Hot},zot={getInitialState:t=>({sorting:[],...t}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:t=>({onSortingChange:Rl("sorting",t),isMultiSortEvent:e=>e.shiftKey}),createColumn:(t,e)=>{t.getAutoSortingFn=()=>{const n=e.getFilteredRowModel().flatRows.slice(10);let i=!1;for(const r of n){const a=r?.getValue(t.id);if(Object.prototype.toString.call(a)==="[object Date]")return Iy.datetime;if(typeof a=="string"&&(i=!0,a.split(kR).length>1))return Iy.alphanumeric}return i?Iy.text:Iy.basic},t.getAutoSortDir=()=>{const n=e.getFilteredRowModel().flatRows[0];return typeof n?.getValue(t.id)=="string"?"asc":"desc"},t.getSortingFn=()=>{var n,i;if(!t)throw new Error;return VC(t.columnDef.sortingFn)?t.columnDef.sortingFn:t.columnDef.sortingFn==="auto"?t.getAutoSortingFn():(n=(i=e.options.sortingFns)==null?void 0:i[t.columnDef.sortingFn])!=null?n:Iy[t.columnDef.sortingFn]},t.toggleSorting=(n,i)=>{const r=t.getNextSortingOrder(),a=typeof n<"u"&&n!==null;e.setSorting(o=>{const s=o?.find(m=>m.id===t.id),l=o?.findIndex(m=>m.id===t.id);let c=[],d,f=a?n:r==="desc";if(o!=null&&o.length&&t.getCanMultiSort()&&i?s?d="toggle":d="add":o!=null&&o.length&&l!==o.length-1?d="replace":s?d="toggle":d="replace",d==="toggle"&&(a||r||(d="remove")),d==="add"){var h;c=[...o,{id:t.id,desc:f}],c.splice(0,c.length-((h=e.options.maxMultiSortColCount)!=null?h:Number.MAX_SAFE_INTEGER))}else d==="toggle"?c=o.map(m=>m.id===t.id?{...m,desc:f}:m):d==="remove"?c=o.filter(m=>m.id!==t.id):c=[{id:t.id,desc:f}];return c})},t.getFirstSortDir=()=>{var n,i;return((n=(i=t.columnDef.sortDescFirst)!=null?i:e.options.sortDescFirst)!=null?n:t.getAutoSortDir()==="desc")?"desc":"asc"},t.getNextSortingOrder=n=>{var i,r;const a=t.getFirstSortDir(),o=t.getIsSorted();return o?o!==a&&((i=e.options.enableSortingRemoval)==null||i)&&(!(n&&(r=e.options.enableMultiRemove)!=null)||r)?!1:o==="desc"?"asc":"desc":a},t.getCanSort=()=>{var n,i;return((n=t.columnDef.enableSorting)!=null?n:!0)&&((i=e.options.enableSorting)!=null?i:!0)&&!!t.accessorFn},t.getCanMultiSort=()=>{var n,i;return(n=(i=t.columnDef.enableMultiSort)!=null?i:e.options.enableMultiSort)!=null?n:!!t.accessorFn},t.getIsSorted=()=>{var n;const i=(n=e.getState().sorting)==null?void 0:n.find(r=>r.id===t.id);return i?i.desc?"desc":"asc":!1},t.getSortIndex=()=>{var n,i;return(n=(i=e.getState().sorting)==null?void 0:i.findIndex(r=>r.id===t.id))!=null?n:-1},t.clearSorting=()=>{e.setSorting(n=>n!=null&&n.length?n.filter(i=>i.id!==t.id):[])},t.getToggleSortingHandler=()=>{const n=t.getCanSort();return i=>{n&&(i.persist==null||i.persist(),t.toggleSorting==null||t.toggleSorting(void 0,t.getCanMultiSort()?e.options.isMultiSortEvent==null?void 0:e.options.isMultiSortEvent(i):!1))}}},createTable:t=>{t.setSorting=e=>t.options.onSortingChange==null?void 0:t.options.onSortingChange(e),t.resetSorting=e=>{var n,i;t.setSorting(e?[]:(n=(i=t.initialState)==null?void 0:i.sorting)!=null?n:[])},t.getPreSortedRowModel=()=>t.getGroupedRowModel(),t.getSortedRowModel=()=>(!t._getSortedRowModel&&t.options.getSortedRowModel&&(t._getSortedRowModel=t.options.getSortedRowModel(t)),t.options.manualSorting||!t._getSortedRowModel?t.getPreSortedRowModel():t._getSortedRowModel())}},Vot=[fot,Dot,Fot,_ot,Aot,mot,Tot,Iot,zot,Not,Oot,Rot,Pot,Lot,Eot];function Got(t){var e,n;const i=[...Vot,...(e=t._features)!=null?e:[]];let r={_features:i};const a=r._features.reduce((h,m)=>Object.assign(h,m.getDefaultOptions==null?void 0:m.getDefaultOptions(r)),{}),o=h=>r.options.mergeOptions?r.options.mergeOptions(a,h):{...a,...h};let l={...{},...(n=t.initialState)!=null?n:{}};r._features.forEach(h=>{var m;l=(m=h.getInitialState==null?void 0:h.getInitialState(l))!=null?m:l});const c=[];let d=!1;const f={_features:i,options:{...a,...t},initialState:l,_queue:h=>{c.push(h),d||(d=!0,Promise.resolve().then(()=>{for(;c.length;)c.shift()();d=!1}).catch(m=>setTimeout(()=>{throw m})))},reset:()=>{r.setState(r.initialState)},setOptions:h=>{const m=XA(h,r.options);r.options=o(m)},getState:()=>r.options.state,setState:h=>{r.options.onStateChange==null||r.options.onStateChange(h)},_getRowId:(h,m,g)=>{var v;return(v=r.options.getRowId==null?void 0:r.options.getRowId(h,m,g))!=null?v:`${g?[g.id,m].join("."):m}`},getCoreRowModel:()=>(r._getCoreRowModel||(r._getCoreRowModel=r.options.getCoreRowModel(r)),r._getCoreRowModel()),getRowModel:()=>r.getPaginationRowModel(),getRow:(h,m)=>{let g=(m?r.getPrePaginationRowModel():r.getRowModel()).rowsById[h];if(!g&&(g=r.getCoreRowModel().rowsById[h],!g))throw new Error;return g},_getDefaultColumnDef:Tn(()=>[r.options.defaultColumn],h=>{var m;return h=(m=h)!=null?m:{},{header:g=>{const v=g.header.column.columnDef;return v.accessorKey?v.accessorKey:v.accessorFn?v.id:null},cell:g=>{var v,b;return(v=(b=g.renderValue())==null||b.toString==null?void 0:b.toString())!=null?v:null},...r._features.reduce((g,v)=>Object.assign(g,v.getDefaultColumnDef==null?void 0:v.getDefaultColumnDef()),{}),...h}},In(t,"debugColumns")),_getColumnDefs:()=>r.options.columns,getAllColumns:Tn(()=>[r._getColumnDefs()],h=>{const m=function(g,v,b){return b===void 0&&(b=0),g.map(k=>{const w=uot(r,k,b,v),x=k;return w.columns=x.columns?m(x.columns,w,b+1):[],w})};return m(h)},In(t,"debugColumns")),getAllFlatColumns:Tn(()=>[r.getAllColumns()],h=>h.flatMap(m=>m.getFlatColumns()),In(t,"debugColumns")),_getAllFlatColumnsById:Tn(()=>[r.getAllFlatColumns()],h=>h.reduce((m,g)=>(m[g.id]=g,m),{}),In(t,"debugColumns")),getAllLeafColumns:Tn(()=>[r.getAllColumns(),r._getOrderColumnsFn()],(h,m)=>{let g=h.flatMap(v=>v.getLeafColumns());return m(g)},In(t,"debugColumns")),getColumn:h=>r._getAllFlatColumnsById()[h]};Object.assign(r,f);for(let h=0;h<r._features.length;h++){const m=r._features[h];m==null||m.createTable==null||m.createTable(r)}return r}function fge(){return t=>Tn(()=>[t.options.data],e=>{const n={rows:[],flatRows:[],rowsById:{}},i=function(r,a,o){a===void 0&&(a=0);const s=[];for(let c=0;c<r.length;c++){const d=yU(t,t._getRowId(r[c],c,o),r[c],c,a,void 0,o?.id);if(n.flatRows.push(d),n.rowsById[d.id]=d,s.push(d),t.options.getSubRows){var l;d.originalSubRows=t.options.getSubRows(r[c],c),(l=d.originalSubRows)!=null&&l.length&&(d.subRows=i(d.originalSubRows,a+1,d))}}return s};return n.rows=i(e),n},In(t.options,"debugTable","getRowModel",()=>t._autoResetPageIndex()))}function $gt(){return t=>Tn(()=>[t.getState().expanded,t.getPreExpandedRowModel(),t.options.paginateExpandedRows],(e,n,i)=>!n.rows.length||e!==!0&&!Object.keys(e??{}).length||!i?n:Age(n),In(t.options,"debugTable"))}function Age(t){const e=[],n=i=>{var r;e.push(i),(r=i.subRows)!=null&&r.length&&i.getIsExpanded()&&i.subRows.forEach(n)};return t.rows.forEach(n),{rows:e,flatRows:t.flatRows,rowsById:t.rowsById}}function qot(t,e,n){return n.options.filterFromLeafRows?Kot(t,e,n):Wot(t,e,n)}function Kot(t,e,n){var i;const r=[],a={},o=(i=n.options.maxLeafRowFilterDepth)!=null?i:100,s=function(l,c){c===void 0&&(c=0);const d=[];for(let h=0;h<l.length;h++){var f;let m=l[h];const g=yU(n,m.id,m.original,m.index,m.depth,void 0,m.parentId);if(g.columnFilters=m.columnFilters,(f=m.subRows)!=null&&f.length&&c<o){if(g.subRows=s(m.subRows,c+1),m=g,e(m)&&!g.subRows.length){d.push(m),a[m.id]=m,r.push(m);continue}if(e(m)||g.subRows.length){d.push(m),a[m.id]=m,r.push(m);continue}}else m=g,e(m)&&(d.push(m),a[m.id]=m,r.push(m))}return d};return{rows:s(t),flatRows:r,rowsById:a}}function Wot(t,e,n){var i;const r=[],a={},o=(i=n.options.maxLeafRowFilterDepth)!=null?i:100,s=function(l,c){c===void 0&&(c=0);const d=[];for(let h=0;h<l.length;h++){let m=l[h];if(e(m)){var f;if((f=m.subRows)!=null&&f.length&&c<o){const v=yU(n,m.id,m.original,m.index,m.depth,void 0,m.parentId);v.subRows=s(m.subRows,c+1),m=v}d.push(m),r.push(m),a[m.id]=m}}return d};return{rows:s(t),flatRows:r,rowsById:a}}function jgt(){return t=>Tn(()=>[t.getPreFilteredRowModel(),t.getState().columnFilters,t.getState().globalFilter],(e,n,i)=>{if(!e.rows.length||!(n!=null&&n.length)&&!i){for(let h=0;h<e.flatRows.length;h++)e.flatRows[h].columnFilters={},e.flatRows[h].columnFiltersMeta={};return e}const r=[],a=[];(n??[]).forEach(h=>{var m;const g=t.getColumn(h.id);if(!g)return;const v=g.getFilterFn();v&&r.push({id:h.id,filterFn:v,resolvedValue:(m=v.resolveFilterValue==null?void 0:v.resolveFilterValue(h.value))!=null?m:h.value})});const o=(n??[]).map(h=>h.id),s=t.getGlobalFilterFn(),l=t.getAllLeafColumns().filter(h=>h.getCanGlobalFilter());i&&s&&l.length&&(o.push("__global__"),l.forEach(h=>{var m;a.push({id:h.id,filterFn:s,resolvedValue:(m=s.resolveFilterValue==null?void 0:s.resolveFilterValue(i))!=null?m:i})}));let c,d;for(let h=0;h<e.flatRows.length;h++){const m=e.flatRows[h];if(m.columnFilters={},r.length)for(let g=0;g<r.length;g++){c=r[g];const v=c.id;m.columnFilters[v]=c.filterFn(m,v,c.resolvedValue,b=>{m.columnFiltersMeta[v]=b})}if(a.length){for(let g=0;g<a.length;g++){d=a[g];const v=d.id;if(d.filterFn(m,v,d.resolvedValue,b=>{m.columnFiltersMeta[v]=b})){m.columnFilters.__global__=!0;break}}m.columnFilters.__global__!==!0&&(m.columnFilters.__global__=!1)}}const f=h=>{for(let m=0;m<o.length;m++)if(h.columnFilters[o[m]]===!1)return!1;return!0};return qot(e.rows,f,t)},In(t.options,"debugTable","getFilteredRowModel",()=>t._autoResetPageIndex()))}function Qgt(t){return e=>Tn(()=>[e.getState().pagination,e.getPrePaginationRowModel(),e.options.paginateExpandedRows?void 0:e.getState().expanded],(n,i)=>{if(!i.rows.length)return i;const{pageSize:r,pageIndex:a}=n;let{rows:o,flatRows:s,rowsById:l}=i;const c=r*a,d=c+r;o=o.slice(c,d);let f;e.options.paginateExpandedRows?f={rows:o,flatRows:s,rowsById:l}:f=Age({rows:o,flatRows:s,rowsById:l}),f.flatRows=[];const h=m=>{f.flatRows.push(m),m.subRows.length&&m.subRows.forEach(h)};return f.rows.forEach(h),f},In(e.options,"debugTable"))}function Yot(){return t=>Tn(()=>[t.getState().sorting,t.getPreSortedRowModel()],(e,n)=>{if(!n.rows.length||!(e!=null&&e.length))return n;const i=t.getState().sorting,r=[],a=i.filter(l=>{var c;return(c=t.getColumn(l.id))==null?void 0:c.getCanSort()}),o={};a.forEach(l=>{const c=t.getColumn(l.id);c&&(o[l.id]={sortUndefined:c.columnDef.sortUndefined,invertSorting:c.columnDef.invertSorting,sortingFn:c.getSortingFn()})});const s=l=>{const c=l.map(d=>({...d}));return c.sort((d,f)=>{for(let m=0;m<a.length;m+=1){var h;const g=a[m],v=o[g.id],b=v.sortUndefined,k=(h=g?.desc)!=null?h:!1;let w=0;if(b){const x=d.getValue(g.id),F=f.getValue(g.id),_=x===void 0,T=F===void 0;if(_||T){if(b==="first")return _?-1:1;if(b==="last")return _?1:-1;w=_&&T?0:_?b:-b}}if(w===0&&(w=v.sortingFn(d,f,g.id)),w!==0)return k&&(w*=-1),v.invertSorting&&(w*=-1),w}return d.index-f.index}),c.forEach(d=>{var f;r.push(d),(f=d.subRows)!=null&&f.length&&(d.subRows=s(d.subRows))}),c};return{rows:s(n.rows),flatRows:r,rowsById:n.rowsById}},In(t.options,"debugTable","getSortedRowModel",()=>t._autoResetPageIndex()))}function l2(t,e){return t?Xot(t)?N.createElement(t,e):t:null}function Xot(t){return Zot(t)||typeof t=="function"||Jot(t)}function Zot(t){return typeof t=="function"&&(()=>{const e=Object.getPrototypeOf(t);return e.prototype&&e.prototype.isReactComponent})()}function Jot(t){return typeof t=="object"&&typeof t.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(t.$$typeof.description)}function mge(t){const e={state:{},onStateChange:()=>{},renderFallbackValue:null,...t},[n]=N.useState(()=>({current:Got(e)})),[i,r]=N.useState(()=>n.current.initialState);return n.current.setOptions(a=>({...a,...t,state:{...i,...t.state},onStateChange:o=>{r(o),t.onStateChange==null||t.onStateChange(o)}})),n.current}const hge=[Ln.Unprocessed,Ln.Other],est=({document:t,onChange:e})=>{const n="creditor"in t?t.creditor:void 0,i=!t.documentType||!hge.includes(t.documentType),r=i&&!n?.id||Ln.Unprocessed===t.documentType,{selectableBusinesses:a,refresh:o}=ale(),s=N.useMemo(()=>{if(n||!("missingInfoSuggestions"in t)||!t.missingInfoSuggestions)return;const w=t.missingInfoSuggestions.owner,x=t.missingInfoSuggestions.counterparty;if(t.missingInfoSuggestions?.isIncome==null){if(t.debtor?.id){const F=t.debtor.id;if(w?.id===F&&x)return x;if(x?.id===F&&w)return w}}else{if(t.missingInfoSuggestions.isIncome&&w)return w;if(!t.missingInfoSuggestions.isIncome&&x)return x}},[t,n]),l=!n&&!!s,c=n??s,{name:d="Missing",id:f}=c||{},{updateDocument:h,fetching:m}=_b(),g=N.useCallback(w=>{w!==void 0&&h({documentId:t.id,fields:{creditorId:w}}).then(t.onUpdate)},[t.id,h,t.onUpdate]),[v,b]=N.useState(null),k=N.useCallback(async w=>{await g(w),o(),e?.()},[g,e,o]);return y.jsxs("div",{className:"flex flex-wrap",children:[y.jsx("div",{className:"flex flex-col justify-center",children:y.jsx(Eu,{inline:!0,size:12,disabled:!r,color:"red",zIndex:"auto",children:i&&(f?y.jsx(oo,{to:jn.BUSINESSES.DETAIL(f),target:"_blank",rel:"noreferrer",onClick:w=>w.stopPropagation(),className:"inline-flex items-center font-semibold",children:d}):y.jsx(yde,{options:a,value:f??null,onChange:w=>w&&g(w),search:v,onSearchChange:b,placeholder:"Choose or create a business",empty:v?y.jsx(upe,{description:v,onAdd:k}):null}))})}),l&&y.jsx(g6,{onClick:()=>g(s.id),disabled:m})]})},tst=({document:t})=>{const e="amount"in t?t.amount:void 0,n="missingInfoSuggestions"in t?t.missingInfoSuggestions?.amount:void 0,i=!e&&!!n,r=e??n,{updateDocument:a,fetching:o}=_b(),s=N.useCallback(d=>{d!==void 0&&a({documentId:t.id,fields:{amount:{raw:d.raw,currency:d.currency}}}).then(t.onUpdate)},[t.id,a,t.onUpdate]),c=Ln.Other!==t.documentType&&r?.formatted==null;return y.jsxs("div",{className:"flex flex-wrap",children:[y.jsx("div",{className:"flex flex-col justify-center",children:y.jsx(Eu,{inline:!0,size:12,disabled:!c,color:"red",zIndex:"auto",children:y.jsx("p",{className:["whitespace-nowrap",i?"bg-yellow-400":"",Number(r?.raw)>0?"text-green-700":"text-red-500"].join(" "),children:r?.formatted})})}),i&&y.jsx(g6,{onClick:()=>s(n),disabled:o})]})},nst=({document:t})=>{const e="date"in t?t.date:void 0,n=Ln.Other!==t.documentType,i=n&&!e,r=e?Ch(new Date(e),"dd/MM/yy"):"Missing Data",a=n?r:null;return y.jsx(Eu,{inline:!0,size:12,disabled:!i,color:"red",zIndex:"auto",children:y.jsx("div",{children:a})})},ist=({document:t,onChange:e})=>{const n="debtor"in t?t.debtor:void 0,i=!t.documentType||!hge.includes(t.documentType),r=i&&!n?.id||Ln.Unprocessed===t.documentType,{selectableBusinesses:a,refresh:o}=ale(),s=N.useMemo(()=>{if(n||!("missingInfoSuggestions"in t)||!t.missingInfoSuggestions)return;const w=t.missingInfoSuggestions.owner,x=t.missingInfoSuggestions.counterparty;if(t.missingInfoSuggestions?.isIncome==null){if(t.creditor?.id){const F=t.creditor.id;if(w?.id===F&&x)return x;if(x?.id===F&&w)return w}}else{if(t.missingInfoSuggestions.isIncome&&x)return x;if(!t.missingInfoSuggestions.isIncome&&w)return w}},[t,n]),l=!n&&!!s,c=n??s,{name:d="Missing",id:f}=c||{},{updateDocument:h,fetching:m}=_b(),g=N.useCallback(w=>{w!==void 0&&h({documentId:t.id,fields:{debtorId:w}}).then(t.onUpdate)},[t.id,h,t.onUpdate]),[v,b]=N.useState(null),k=N.useCallback(async w=>{await g(w),o(),e?.()},[g,e,o]);return y.jsxs("div",{className:"flex flex-wrap",children:[y.jsx("div",{className:"flex flex-col justify-center",children:y.jsx(Eu,{inline:!0,size:12,disabled:!r,color:"red",zIndex:"auto",children:i&&(f?y.jsx(oo,{to:jn.BUSINESSES.DETAIL(f),target:"_blank",rel:"noreferrer",onClick:w=>w.stopPropagation(),className:"inline-flex items-center font-semibold",children:d}):y.jsx(yde,{options:a,value:f??null,onChange:w=>w&&g(w),search:v,onSearchChange:b,placeholder:"Choose or create a business",empty:v?y.jsx(upe,{description:v,onAdd:k}):null}))})}),l&&y.jsx(g6,{onClick:()=>g(s.id),disabled:m})]})},rst=({document:t})=>{let e="";if(t.description)e=t.description;else if("issuedDocumentInfo"in t&&t.issuedDocumentInfo?.originalDocument?.income){const{income:n}=t.issuedDocumentInfo.originalDocument;e=n.map(i=>i.description).join(", ")}return y.jsx("div",{className:"flex flex-col align-center justify-center flex-wrap",children:y.jsx("p",{children:e})})},ast=({document:{image:t,file:e}})=>{const[n,i]=N.useState(!1);return y.jsxs(y.Fragment,{children:[y.jsx("div",{className:"flex flex-wrap",children:y.jsx("div",{className:"flex flex-col justify-center",children:y.jsxs(p6,{cols:1,children:[y.jsx(gu,{disabled:!t,content:"Open Image",children:y.jsx(Eu,{inline:!0,size:12,disabled:!!t,color:"red",zIndex:"auto",children:y.jsx(jt,{variant:"ghost",size:"icon",className:"size-7.5",disabled:!t,onClick:()=>i(!!t),children:y.jsx(C1e,{className:"size-5"})})})}),y.jsx(gu,{disabled:!e,content:"Open File",children:y.jsx(Eu,{inline:!0,size:12,disabled:!!e,color:"red",zIndex:"auto",children:e?y.jsx("a",{href:typeof e=="string"?e:e.href,target:"_blank",rel:"noreferrer",children:y.jsx(jt,{variant:"ghost",size:"icon",className:"size-7.5",children:y.jsx(K$,{className:"size-5"})})}):y.jsx(jt,{variant:"ghost",size:"icon",className:"size-7.5",disabled:!0,children:y.jsx(K$,{className:"size-5"})})})})]})})}),t&&y.jsx(Ru,{classNames:{content:"overflow-y-auto drop-shadow-lg"},withCloseButton:!0,withOverlay:!1,position:"right",opened:n,onClose:()=>i(!1),size:"30%",children:y.jsx("div",{className:"m-2",children:y.jsx(Ice,{src:t.toString(),zoomLevel:3,magnifierHeight:300,magnifierWidth:300})})})]})},ost=({document:t})=>y.jsx("div",{className:"flex flex-col items-center justify-center flex-wrap",children:y.jsx("p",{children:t.remarks})}),sst=({document:t})=>{const e="serialNumber"in t?t.serialNumber:void 0,n="allocationNumber"in t?t.allocationNumber:void 0,r=Ln.Other!==t.documentType&&!e;return y.jsxs("div",{className:"flex flex-col align-center justify-center flex-wrap",children:[y.jsx(Eu,{inline:!0,size:12,disabled:!r,color:"red",zIndex:"auto",children:y.jsx("p",{children:e})}),n&&y.jsxs("p",{className:"text-xs",children:["(",n,")"]})]})},lst=({document:{documentType:t},isOpen:e})=>{const n=!t||t===Ln.Unprocessed,i=t??Ln.Unprocessed,r=n?"red":e?"orange":"blue";return y.jsx("div",{className:"flex flex-wrap",children:y.jsx("div",{className:"flex flex-col justify-center",children:y.jsx(Eu,{inline:!0,size:12,disabled:!n&&!e,color:r,zIndex:"auto",children:y.jsx("p",{children:Fv(i)})})})})},cst=({document:t})=>{const e="vat"in t?t.vat:void 0,i=Ln.Other!==t.documentType&&e?.formatted==null;return y.jsx(Eu,{inline:!0,size:12,disabled:!i,color:"red",zIndex:"auto",children:y.jsx("div",{style:{color:Number(e?.raw)>0?"green":"red",whiteSpace:"nowrap"},children:e?.formatted})})},DN=[{id:"date",accessorKey:"date",sortingFn:t=>"date"in t.original&&t.original.date?new Date(t.original.date).getTime():0,header:({column:t})=>y.jsxs(jt,{variant:"ghost",onClick:()=>t.toggleSorting(t.getIsSorted()==="asc"),children:["Date",t.getIsSorted()&&(t.getIsSorted()==="asc"?y.jsx(au,{className:"ml-2 h-4 w-4"}):y.jsx(Oo,{className:"ml-2 h-4 w-4"}))]}),cell:({row:t})=>y.jsx(nst,{document:t.original})},{id:"amount",accessorKey:"amount.raw",header:({column:t})=>y.jsxs(jt,{variant:"ghost",onClick:()=>t.toggleSorting(t.getIsSorted()==="asc"),children:["Amount",t.getIsSorted()&&(t.getIsSorted()==="asc"?y.jsx(au,{className:"ml-2 h-4 w-4"}):y.jsx(Oo,{className:"ml-2 h-4 w-4"}))]}),cell:({row:t})=>y.jsx(tst,{document:t.original})},{id:"vat",accessorKey:"vat.raw",header:({column:t})=>y.jsxs(jt,{variant:"ghost",onClick:()=>t.toggleSorting(t.getIsSorted()==="asc"),children:["VAT",t.getIsSorted()&&(t.getIsSorted()==="asc"?y.jsx(au,{className:"ml-2 h-4 w-4"}):y.jsx(Oo,{className:"ml-2 h-4 w-4"}))]}),cell:({row:t})=>y.jsx(cst,{document:t.original})},{id:"type",accessorKey:"documentType",header:({column:t})=>y.jsxs(jt,{variant:"ghost",onClick:()=>t.toggleSorting(t.getIsSorted()==="asc"),children:["Type",t.getIsSorted()&&(t.getIsSorted()==="asc"?y.jsx(au,{className:"ml-2 h-4 w-4"}):y.jsx(Oo,{className:"ml-2 h-4 w-4"}))]}),cell:({row:t})=>y.jsx(lst,{document:t.original,isOpen:"issuedDocumentInfo"in t.original&&t.original.issuedDocumentInfo?.status==="OPEN"})},{id:"serial",accessorKey:"serialNumber",header:({column:t})=>y.jsxs(jt,{variant:"ghost",onClick:()=>t.toggleSorting(t.getIsSorted()==="asc"),children:["Serial",t.getIsSorted()&&(t.getIsSorted()==="asc"?y.jsx(au,{className:"ml-2 h-4 w-4"}):y.jsx(Oo,{className:"ml-2 h-4 w-4"}))]}),cell:({row:t})=>y.jsx(sst,{document:t.original})},{id:"description",accessorKey:"description",header:"Description",cell:({row:t})=>y.jsx(rst,{document:t.original})},{id:"remarks",accessorKey:"remarks",header:"Remarks",cell:({row:t})=>y.jsx(ost,{document:t.original})},{id:"creditor",accessorKey:"creditor.name",header:({column:t})=>y.jsxs(jt,{variant:"ghost",onClick:()=>t.toggleSorting(t.getIsSorted()==="asc"),children:["Creditor",t.getIsSorted()&&(t.getIsSorted()==="asc"?y.jsx(au,{className:"ml-2 h-4 w-4"}):y.jsx(Oo,{className:"ml-2 h-4 w-4"}))]}),cell:({row:t})=>y.jsx(est,{document:t.original,onChange:t.original.onUpdate})},{id:"debtor",accessorKey:"debtor.name",header:({column:t})=>y.jsxs(jt,{variant:"ghost",onClick:()=>t.toggleSorting(t.getIsSorted()==="asc"),children:["Debtor",t.getIsSorted()&&(t.getIsSorted()==="asc"?y.jsx(au,{className:"ml-2 h-4 w-4"}):y.jsx(Oo,{className:"ml-2 h-4 w-4"}))]}),cell:({row:t})=>y.jsx(ist,{document:t.original,onChange:t.original.onUpdate})},{id:"file",accessorKey:"file",header:({column:t})=>y.jsxs(jt,{variant:"ghost",onClick:()=>t.toggleSorting(t.getIsSorted()==="asc"),children:["files",t.getIsSorted()&&(t.getIsSorted()==="asc"?y.jsx(au,{className:"ml-2 h-4 w-4"}):y.jsx(Oo,{className:"ml-2 h-4 w-4"}))]}),cell:({row:t})=>y.jsx(ast,{document:t.original})},{id:"edit",accessorKey:"id",header:"Edit",cell:({row:t})=>y.jsxs("div",{className:"flex flex-col items-center gap-2",children:[y.jsx(OMe,{onClick:t.original.editDocument,tooltip:"Edit Document"}),"issuedDocumentInfo"in t.original&&t.original.issuedDocumentInfo?.status==="OPEN"&&y.jsxs(y.Fragment,{children:[y.jsx(EMe,{documentId:t.original.id,couldIssueCreditInvoice:t.original.documentType===Ln.Invoice||t.original.documentType===Ln.InvoiceReceipt}),y.jsx(bge,{documentId:t.original.id,tooltip:"Issue Document out of This Document"})]})]})}];function pge({className:t,...e}){return y.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:y.jsx("table",{"data-slot":"table",className:Lt("w-full caption-bottom text-sm",t),...e})})}function gge({className:t,...e}){return y.jsx("thead",{"data-slot":"table-header",className:Lt("[&_tr]:border-b",t),...e})}function vge({className:t,...e}){return y.jsx("tbody",{"data-slot":"table-body",className:Lt("[&_tr:last-child]:border-0",t),...e})}function vv({className:t,...e}){return y.jsx("tr",{"data-slot":"table-row",className:Lt("hover:bg-gray-100/50 data-[state=selected]:bg-gray-100 border-b transition-colors dark:hover:bg-gray-800/50 dark:data-[state=selected]:bg-gray-800",t),...e})}function yge({className:t,...e}){return y.jsx("th",{"data-slot":"table-head",className:Lt("text-gray-950 h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] dark:text-gray-50",t),...e})}function c2({className:t,...e}){return y.jsx("td",{"data-slot":"table-cell",className:Lt("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...e})}function dst({businessId:t,linkedDocumentIds:e,limit:n}){const[i,r]=N.useState(void 0),[{data:a,fetching:o}]=is({query:RFe,variables:{businessId:t,limit:n}}),s=N.useMemo(()=>a?.recentDocumentsByBusiness?.map(d=>{const f=Ph(ZZ,d);return f?{...f,onUpdate:()=>{},editDocument:()=>r(f.id)}:null}).filter(d=>!!d)??[],[a?.recentDocumentsByBusiness]),l=["date","amount","vat","type","serial","description","remarks","file","edit"],c=mge({data:s,columns:DN.filter(d=>d.id&&l.includes(d.id)),getCoreRowModel:fge(),state:{}});return y.jsxs(vd,{children:[y.jsx(Nu,{children:y.jsx(xu,{children:"Recent Client Documents"})}),y.jsx(yd,{children:o?y.jsx("div",{children:"Loading..."}):y.jsxs(pge,{children:[y.jsx(gge,{children:c.getHeaderGroups().map(d=>y.jsx(vv,{children:d.headers.map(f=>y.jsx(yge,{colSpan:f.colSpan,children:f.isPlaceholder?null:l2(f.column.columnDef.header,f.getContext())},f.id))},d.id))}),y.jsx(vge,{children:c.getRowModel().rows?.length?c.getRowModel().rows.map(d=>y.jsx(vv,{"data-state":d.getIsSelected()&&"selected",className:d.original.issuedDocumentInfo?.externalId&&e.includes(d.original.issuedDocumentInfo.externalId)?"bg-blue-100":"",children:d.getVisibleCells().map(f=>y.jsx(c2,{children:l2(f.column.columnDef.cell,f.getContext())},f.id))},d.id)):y.jsx(vv,{children:y.jsx(c2,{colSpan:c.options.columns.length,className:"h-24 text-center",children:"No results."})})})]})}),y.jsx(bde,{documentId:i,onDone:()=>r(void 0),onChange:()=>{}})]})}const ust=({documentsProps:t,onChange:e,limited:n=!1})=>{const[i,r]=N.useState(void 0),[a,o]=N.useState([]),s=N.useMemo(()=>t?.map(h=>{const m=Ph(ZZ,h);return{...m,editDocument:()=>r(m.id),onUpdate:e??(()=>{})}}),[t,e]),[l,c]=N.useState({}),d=["date","amount","vat","type","serial","file"],f=mge({data:s,columns:n?DN.filter(h=>h.id&&d.includes(h.id)):DN,getCoreRowModel:fge(),onSortingChange:o,getSortedRowModel:Yot(),onColumnVisibilityChange:c,state:{sorting:a,columnVisibility:l}});return y.jsxs(y.Fragment,{children:[y.jsxs(pge,{children:[y.jsx(gge,{children:f.getHeaderGroups().map(h=>y.jsx(vv,{children:h.headers.map(m=>y.jsx(yge,{colSpan:m.colSpan,children:m.isPlaceholder?null:l2(m.column.columnDef.header,m.getContext())},m.id))},h.id))}),y.jsx(vge,{children:f.getRowModel().rows?.length?f.getRowModel().rows.map(h=>y.jsx(vv,{"data-state":h.getIsSelected()&&"selected",children:h.getVisibleCells().map(m=>y.jsx(c2,{children:l2(m.column.columnDef.cell,m.getContext())},m.id))},h.id)):y.jsx(vv,{children:y.jsx(c2,{colSpan:DN.length,className:"h-24 text-center",children:"No results."})})})]}),y.jsx(bde,{documentId:i,onDone:()=>r(void 0),onChange:()=>e?.()})]})};function fst({documentType:t}){const[{data:e,fetching:n}]=is({query:PFe,variables:{documentType:t}}),i=e?.recentIssuedDocumentsByType??[];return y.jsxs(vd,{children:[y.jsx(Nu,{children:y.jsx(xu,{children:"Recent Documents of the Same Type"})}),y.jsx(yd,{children:n?y.jsx("div",{children:"Loading..."}):y.jsx(ust,{documentsProps:i})})]})}const Ast=Tce(),wY={type:Ln.Invoice,language:CI.English,currency:vr.Usd,vatType:nk.Default,date:Ch(new Date,"yyyy-MM-dd"),rounding:!1,signed:!0,income:[],payment:[]};function mst({initialFormData:t,onDone:e,chargeId:n}){const[i,r]=N.useState({...wY,...t}),[a,o]=N.useState(null),[s,l]=N.useState(!1),[c,d]=N.useState(!1),{previewDocument:f,fetching:h}=Kit(),{issueDocument:m}=Git(),[g,v]=N.useState(!1),b=N.useCallback((B,O)=>{r(P=>({...P,[B]:O}))},[]);N.useEffect(()=>{d(!0),l(!1)},[i]);const k=N.useMemo(()=>JSON.stringify(t||{}),[t]);N.useEffect(()=>{r({...wY,...t})},[k]);const w=N.useCallback(async()=>{try{const B=await f({input:i});if(!B)throw new Error("No preview data returned");o(B),l(!0),d(!1)}catch(B){console.error("Failed to generate preview:",B)}},[i,f]),x=N.useCallback(()=>{e?e(i):v(!0)},[e,i]),F=N.useCallback(async B=>{await m({input:i,chargeId:n,...B})},[i,n,m]),_=!s||h||c,T=N.useMemo(()=>i.income?.reduce((B,O)=>{const P=O.price*O.quantity,G=P*((O.vatRate||0)/100);return B+P+G},0)||0,[i.income]);return y.jsx("div",{className:"min-h-screen bg-gray-50 p-4",children:y.jsxs("div",{className:"max-w-7xl mx-auto",children:[y.jsxs("div",{className:"mb-6",children:[y.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"Generate Document"}),y.jsx("p",{className:"text-gray-600 mt-2",children:"Create and preview your accounting document before issuing"})]}),y.jsxs("div",{className:"grid lg:grid-cols-2 gap-6",children:[y.jsxs("div",{className:"space-y-6",children:[y.jsx(OXe,{formData:i,updateFormData:b}),y.jsx(vd,{children:y.jsxs(yd,{className:"pt-6",children:[y.jsxs("div",{className:"flex gap-3",children:[y.jsx(jt,{onClick:w,disabled:h||s,variant:"outline",className:"flex-1 bg-transparent",children:h?y.jsxs(y.Fragment,{children:[y.jsx(vk,{className:"w-4 h-4 mr-2 animate-spin"}),"Generating..."]}):y.jsxs(y.Fragment,{children:[y.jsx(u1e,{className:"w-4 h-4 mr-2"}),"Preview"]})}),y.jsxs(jt,{onClick:x,disabled:_,className:"flex-1",children:[y.jsx(iZ,{className:"w-4 h-4 mr-2"}),e?"Accept Changes":"Issue Document"]})]}),c&&!h&&y.jsx("p",{className:"text-sm text-amber-600 bg-amber-50 p-2 rounded mt-3",children:"Form has been modified. Click Preview to update the document before issuing."}),T>0&&y.jsx("div",{className:"mt-4 p-3 bg-blue-50 rounded-lg",children:y.jsxs("div",{className:"flex justify-between items-center font-medium text-blue-900",children:[y.jsx("span",{children:"Total Document Amount:"}),y.jsxs("span",{children:[T.toFixed(2)," ",i.currency]})]})})]})})]}),y.jsxs("div",{className:"space-y-6",children:[y.jsxs(vd,{className:"h-fit",children:[y.jsx(Nu,{children:y.jsx(xu,{children:"Document Preview"})}),y.jsx(yd,{children:y.jsx("div",{className:"border-2 border-dashed border-gray-200 rounded-lg min-h-[600px] flex items-center justify-center bg-gray-50",children:h?y.jsxs("div",{className:"text-center",children:[y.jsx(vk,{className:"w-8 h-8 animate-spin mx-auto mb-4 text-gray-400"}),y.jsx("p",{className:"text-gray-500",children:"Generating document preview..."})]}):a?y.jsx("div",{className:"w-full",children:y.jsx("div",{className:"bg-white shadow-lg rounded-lg overflow-hidden",children:y.jsx("div",{className:"aspect-[8.5/11] bg-white border",children:y.jsx("div",{className:"h-full flex items-center justify-center",children:y.jsxs("div",{className:"text-center p-6",children:[y.jsx(sot,{src:a}),!s&&y.jsx("p",{className:"text-xs text-amber-600 mt-3 bg-amber-50 px-2 py-1 rounded",children:"Preview may be outdated"})]})})})})}):y.jsxs("div",{className:"text-center",children:[y.jsx(v1e,{className:"w-16 h-16 mx-auto mb-4 text-gray-300"}),y.jsx("p",{className:"text-gray-500 mb-2",children:"No preview available"}),y.jsx("p",{className:"text-sm text-gray-400",children:"Click Preview to generate document"})]})})})]}),i.client?.id&&y.jsx(dst,{businessId:i.client?.id,linkedDocumentIds:i.linkedDocumentIds??[]}),y.jsx(fst,{documentType:i.type})]})]}),y.jsx(Jit,{isOpen:g,onClose:()=>v(!1),onIssue:F,clientName:i.client?.name,clientEmails:i.client?.emails,documentType:Ast.find(B=>B.value===i.type)?.value})]})})}function kge(t){return{address:t.originalBusiness.address??void 0,city:t.originalBusiness.city??void 0,country:t.originalBusiness.country.code,emails:t.emails,id:t.id,name:t.originalBusiness.name,phone:t.originalBusiness.phoneNumber??void 0,taxId:t.originalBusiness.governmentId??void 0,zipCode:t.originalBusiness.zipCode??void 0}}function hst(t,e){let n;t.remarks&&(n=t.remarks,e===Ln.CreditInvoice&&(n=n.replace(Fv(Ln.Receipt),Fv(Ln.CreditInvoice))));let{currency:i}=t;return e===Ln.CreditInvoice&&(i=t.income?.[0]?.currency||i),{...t,currency:i,description:t.description||void 0,remarks:n,footer:t.footer||void 0,date:t.date||void 0,dueDate:t.dueDate||void 0,discount:t.discount||void 0,rounding:t.rounding||void 0,signed:t.signed||void 0,maxPayments:t.maxPayments||void 0,client:t.client?kge(Ph(JZ,t.client)):void 0,income:t.income?.map(r=>({...r,currencyRate:r.currencyRate??void 0,itemId:r.itemId||void 0,vatRate:r.vatRate??void 0})),payment:t.payment?.map(r=>({...r,currencyRate:r.currencyRate||void 0,date:r.date||void 0,bankName:r.bankName||void 0,bankBranch:r.bankBranch||void 0,bankAccount:r.bankAccount||void 0,chequeNum:r.chequeNum||void 0,accountId:r.accountId||void 0,transactionId:r.transactionId||void 0,cardType:r.cardType||void 0,cardNum:r.cardNum||void 0,numPayments:r.numPayments||void 0,firstPayment:r.firstPayment||void 0})),linkedDocumentIds:t.linkedDocumentIds||void 0,linkedPaymentId:t.linkedPaymentId||void 0,type:e||t.type}}function bge({open:t=!1,setOpen:e,tooltip:n,chargeId:i,documentId:r,documentType:a,onDone:o,trigger:s,...l}){const[c,d]=N.useState(!1),[f,h]=N.useState("initialFormData"in l&&l.initialFormData?l.initialFormData:void 0),m=N.useMemo(()=>e?t:c,[t,c,e]),g=N.useCallback(B=>{e?e(B):d(B)},[e]),[{data:v,fetching:b,error:k},w]=is({query:MFe,pause:!i||!m,variables:{chargeId:i||""}}),[{data:x,fetching:F,error:_},T]=is({query:$Fe,pause:!r||!m,variables:{documentId:r||""}});return N.useEffect(()=>{m&&(i&&!v&&!b&&!k?w():r&&!x&&!F&&!_&&T())},[i,v,b,k,w,r,x,F,_,T,m]),N.useEffect(()=>{let B;if(v?.newDocumentDraftByCharge?B=Ph(wQ,v.newDocumentDraftByCharge):x?.newDocumentDraftByDocument&&(B=Ph(wQ,x.newDocumentDraftByDocument)),B){const O=hst(B,a);h(O)}},[v,x,a]),y.jsxs(Hf,{open:m,onOpenChange:g,children:[(!e||!!s)&&y.jsx(P2,{children:y.jsxs(Dh,{children:[y.jsx(Th,{children:s??y.jsx(jt,{className:"size-7.5",variant:"ghost",children:y.jsx(ek,{className:"size-5"})})}),y.jsx(Ih,{children:y.jsx("p",{children:n||"Issue new document"})})]})}),y.jsxs(zf,{className:"w-[90vw] sm:max-w-[95%] max-h-[90vh] overflow-y-auto",children:[y.jsx(Du,{children:y.jsx(Tu,{children:"Issue New Document"})}),b||F?y.jsx(vk,{className:"h-10 w-10 animate-spin"}):y.jsx(mst,{initialFormData:f,onDone:o?B=>{o(B),g(!1)}:void 0,chargeId:i})]})]})}const pst=()=>{const[{data:t,fetching:e,error:n},i]=is({query:YFe});N.useEffect(()=>{n&&(console.error(`Error fetching admin businesses: ${n}`),un.error("Error",{description:"Unable to fetch admin businesses"}))},[n]);const r=N.useMemo(()=>t?.allAdminBusinesses?.slice().sort((o,s)=>o.name.localeCompare(s.name))??[],[t]),a=N.useMemo(()=>r.map(o=>({value:o.id,label:o.name})),[r]);return{fetching:e,refresh:()=>i(),adminBusinesses:r,selectableAdminBusinesses:a}},Vw="sync-green-invoice-documents",gst=()=>{const[{fetching:t},e]=bs(l2e),n=N.useCallback(async i=>{const r=`Error syncing documents owned by [${i.ownerId}]`;un.loading("Syncing Documents",{id:Vw});try{const a=await e(i),o=Ss(a,r,Vw);if(o)return un.success("Success",{id:Vw,description:o.syncGreenInvoiceDocuments.length>0?G6({data:o.syncGreenInvoiceDocuments}):"No new documents found",duration:o.syncGreenInvoiceDocuments.length>0?1/0:5e3,closeButton:o.syncGreenInvoiceDocuments.length>0}),o.syncGreenInvoiceDocuments}catch(a){console.error(`${r}: ${a}`),un.error("Error",{id:Vw,description:r,duration:1e5,closeButton:!0})}},[e]);return{fetching:t,syncGreenInvoiceDocuments:n}};function vst({opened:t,close:e,setIsLoading:n}){const{selectableAdminBusinesses:i,fetching:r}=pst(),{control:a,handleSubmit:o}=u0({defaultValues:{ownerId:"6a20aa69-57ff-446e-8d6a-1e96d095e988"}}),{syncGreenInvoiceDocuments:s,fetching:l}=gst();N.useEffect(()=>{n?.(r||l)},[r,l,n]);const c=d=>{s(d),e()};return y.jsxs(yc,{opened:t,onClose:e,size:"auto",centered:!0,children:[y.jsx(yc.Title,{children:"Sync Green Invoice Documents"}),y.jsxs(yc.Body,{children:[r?y.jsx("div",{children:"Loading..."}):y.jsx("div",{}),y.jsxs("form",{onSubmit:o(c),children:[y.jsx(sd,{name:"ownerId",control:a,render:({field:d,fieldState:f})=>y.jsx(Ov,{...d,data:i,value:d.value,disabled:r,label:"Owner:",placeholder:"Scroll to see all options",maxDropdownHeight:160,searchable:!0,error:f.error?.message})}),y.jsx("div",{className:"flex justify-center mt-5 gap-3",children:y.jsx("button",{type:"submit",className:"text-white bg-indigo-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-indigo-600 rounded-sm text-lg",children:"Sync"})})]})]})]})}const yst=N.createContext(null),rI={didCatch:!1,error:null};class kst extends N.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=rI}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(...e){const{error:n}=this.state;n!==null&&(this.props.onReset?.({args:e,reason:"imperative-api"}),this.setState(rI))}componentDidCatch(e,n){this.props.onError?.(e,n)}componentDidUpdate(e,n){const{didCatch:i}=this.state,{resetKeys:r}=this.props;i&&n.error!==null&&bst(e.resetKeys,r)&&(this.props.onReset?.({next:r,prev:e.resetKeys,reason:"keys"}),this.setState(rI))}render(){const{children:e,fallbackRender:n,FallbackComponent:i,fallback:r}=this.props,{didCatch:a,error:o}=this.state;let s=e;if(a){const l={error:o,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")s=n(l);else if(i)s=N.createElement(i,l);else if(r!==void 0)s=r;else throw o}return N.createElement(yst.Provider,{value:{didCatch:a,error:o,resetErrorBoundary:this.resetErrorBoundary}},s)}}function bst(t=[],e=[]){return t.length!==e.length||t.some((n,i)=>!Object.is(n,e[i]))}const Sst="uploadDocumentsFromGoogleDrive",wst=()=>{const[{fetching:t},e]=bs(u2e),n=N.useCallback(async i=>{const r="Error uploading documents",a=`${Sst}-${i.chargeId}`;un.loading("Uploading Documents",{id:a});try{const o=await e(i),s=Ss(o,r,a,"batchUploadDocumentsFromGoogleDrive");if(s){let l=!1;const c=s.batchUploadDocumentsFromGoogleDrive.filter(d=>"message"in d?(console.error(`Error uploading document: ${d.message}`),l=!0,!1):"document"in d).map(({document:d})=>d);return un.success("Upload Successful",{id:a,description:c.length>0?G6({data:c}):"No successful document uploads",duration:c.length>0?1/0:5e3,dismissible:!0,closeButton:!0}),l&&un.error("Some files failed to upload",{duration:1e5,closeButton:!0}),c}}catch(o){console.error(`${r}: ${o}`),un.error("Error",{id:a,description:r,duration:1/0,closeButton:!0})}},[e]);return{uploading:t,uploadDocumentsFromGoogleDrive:n}};var GC="Tabs",[Nst]=nl(GC,[G2]),Sge=G2(),[xst,wU]=Nst(GC),wge=N.forwardRef((t,e)=>{const{__scopeTabs:n,value:i,onValueChange:r,defaultValue:a,orientation:o="horizontal",dir:s,activationMode:l="automatic",...c}=t,d=lb(s),[f,h]=kd({prop:i,onChange:r,defaultProp:a??"",caller:GC});return y.jsx(xst,{scope:n,baseId:so(),value:f,onValueChange:h,orientation:o,dir:d,activationMode:l,children:y.jsx(Fn.div,{dir:d,"data-orientation":o,...c,ref:e})})});wge.displayName=GC;var Nge="TabsList",xge=N.forwardRef((t,e)=>{const{__scopeTabs:n,loop:i=!0,...r}=t,a=wU(Nge,n),o=Sge(n);return y.jsx(hee,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:i,children:y.jsx(Fn.div,{role:"tablist","aria-orientation":a.orientation,...r,ref:e})})});xge.displayName=Nge;var Fge="TabsTrigger",_ge=N.forwardRef((t,e)=>{const{__scopeTabs:n,value:i,disabled:r=!1,...a}=t,o=wU(Fge,n),s=Sge(n),l=Bge(o.baseId,i),c=Dge(o.baseId,i),d=i===o.value;return y.jsx(pee,{asChild:!0,...s,focusable:!r,active:d,children:y.jsx(Fn.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":c,"data-state":d?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:l,...a,ref:e,onMouseDown:Ht(t.onMouseDown,f=>{!r&&f.button===0&&f.ctrlKey===!1?o.onValueChange(i):f.preventDefault()}),onKeyDown:Ht(t.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&o.onValueChange(i)}),onFocus:Ht(t.onFocus,()=>{const f=o.activationMode!=="manual";!d&&!r&&f&&o.onValueChange(i)})})})});_ge.displayName=Fge;var Cge="TabsContent",Ege=N.forwardRef((t,e)=>{const{__scopeTabs:n,value:i,forceMount:r,children:a,...o}=t,s=wU(Cge,n),l=Bge(s.baseId,i),c=Dge(s.baseId,i),d=i===s.value,f=N.useRef(d);return N.useEffect(()=>{const h=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(h)},[]),y.jsx(co,{present:r||d,children:({present:h})=>y.jsx(Fn.div,{"data-state":d?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":l,hidden:!h,id:c,tabIndex:0,...o,ref:e,style:{...t.style,animationDuration:f.current?"0s":void 0},children:h&&a})})});Ege.displayName=Cge;function Bge(t,e){return`${t}-trigger-${e}`}function Dge(t,e){return`${t}-content-${e}`}var Fst=wge,_st=xge,Cst=_ge,Est=Ege;function Bst({className:t,...e}){return y.jsx(Fst,{"data-slot":"tabs",className:Lt("flex flex-col gap-2",t),...e})}function Dst({className:t,...e}){return y.jsx(_st,{"data-slot":"tabs-list",className:Lt("bg-gray-100 text-gray-500 inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px] dark:bg-gray-800 dark:text-gray-400",t),...e})}function NY({className:t,...e}){return y.jsx(Cst,{"data-slot":"tabs-trigger",className:Lt("data-[state=active]:bg-white dark:data-[state=active]:text-gray-950 focus-visible:border-gray-950 focus-visible:ring-gray-950/50 focus-visible:outline-ring dark:data-[state=active]:border-gray-200 dark:data-[state=active]:bg-gray-200/30 text-gray-950 dark:text-gray-500 inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-gray-200 border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 dark:data-[state=active]:bg-gray-950 dark:dark:data-[state=active]:text-gray-50 dark:focus-visible:border-gray-300 dark:focus-visible:ring-gray-300/50 dark:dark:data-[state=active]:border-gray-800 dark:dark:data-[state=active]:bg-gray-800/30 dark:text-gray-50 dark:dark:text-gray-400 dark:border-gray-800",t),...e})}function xY({className:t,...e}){return y.jsx(Est,{"data-slot":"tabs-content",className:Lt("flex-1 outline-none",t),...e})}const Tst=10*1024*1024,Ist=tU(File).refine(t=>["application/pdf","image/png","image/jpeg","image/jpg","image/svg+xml","image/gif"].includes(t.type),{message:"Invalid document file type"}).refine(t=>t.size<=Tst,{message:"File size should not exceed 5MB"}),Ost=n1({googleDriveUrl:ao().url({message:"Invalid url"}).includes("drive.google.com",{message:'Invalid url: origin must be "drive.google.com"'}).includes("/folders/",{message:"Invalid url: is this a folder link?"}).optional(),documents:hd(Ist).optional(),method:m0(["local-files","google-drive"]),isSensitive:Jb().optional()}).superRefine((t,e)=>{t.method==="local-files"&&(t.documents===void 0||t.documents.length===0)&&e.addIssue({code:ZO.custom,message:"At least one document is required"}),t.method==="google-drive"&&t.googleDriveUrl===void 0&&e.addIssue({code:ZO.custom,message:"The Google Drive URL is required"})});function Hgt({open:t,onOpenChange:e,chargeId:n,onChange:i}){const[r,a]=N.useState("local-files"),{uploading:o,uploadDocumentsFromGoogleDrive:s}=wst(),{uploading:l,uploadMultipleDocuments:c}=PXe(),d=u0({resolver:RC(Ost),defaultValues:{method:"local-files",isSensitive:!1}}),f=g=>{d.setValue("method",g),g==="google-drive"?(d.clearErrors("documents"),d.setValue("documents",void 0)):(d.clearErrors("googleDriveUrl"),d.setValue("googleDriveUrl",void 0)),a(g)},h=N.useCallback(async g=>{let v=Promise.resolve();switch(g.method){case"local-files":g.documents?v=c({documents:g.documents,chargeId:n,isSensitive:g.isSensitive}):d.setError("documents",{message:"At least one document is required"});break;case"google-drive":g.googleDriveUrl?v=s({sharedFolderUrl:g.googleDriveUrl,chargeId:n,isSensitive:g.isSensitive}):d.setError("googleDriveUrl",{message:"The Google Drive URL is required"});break}try{await v,i?.(),e(!1)}catch(b){d.setError("root",{message:b instanceof Error?b.message:"Failed to upload documents"})}},[n,d,i,e,s,c]),m=N.useMemo(()=>o||l,[o,l]);return y.jsx(Hf,{open:t,onOpenChange:e,children:y.jsx(zf,{onClick:g=>g.stopPropagation(),className:"overflow-scroll max-h-screen",children:y.jsxs(kst,{fallback:y.jsx("div",{children:"Error uploading files"}),children:[y.jsx(Du,{className:"flex flex-row items-center justify-between",children:y.jsx(Tu,{children:"Upload Documents"})}),y.jsx(Bb,{...d,children:y.jsxs("form",{onSubmit:d.handleSubmit(h),children:[y.jsxs(Bst,{value:r,onValueChange:g=>f(g),className:"my-4",children:[y.jsxs(Dst,{className:"grid w-full grid-cols-2",children:[y.jsx(NY,{disabled:m,value:"local-files",children:"Local Files"}),y.jsx(NY,{disabled:m,value:"google-drive",children:"Google Drive"})]}),y.jsx(xY,{value:"local-files",children:y.jsxs(vd,{children:[y.jsxs(Nu,{children:[y.jsx(xu,{children:"Local Files"}),y.jsx(bI,{children:"Upload documents from your computer"})]}),y.jsx(yd,{className:"space-y-2",children:y.jsx(ti,{control:d.control,name:"documents",render:({field:{value:g,onChange:v,...b}})=>y.jsxs(ni,{children:[y.jsx(Ri,{children:"Files"}),y.jsx(vi,{children:y.jsx(Pn,{...b,required:!0,type:"file",multiple:!0,accept:".jpg, .jpeg, .gif, .png, .pdf",onChange:k=>{v(k.target.files?Object.values(k.target.files):null)}})}),y.jsx(oi,{})]})})})]})}),y.jsx(xY,{value:"google-drive",children:y.jsxs(vd,{children:[y.jsxs(Nu,{children:[y.jsx(xu,{children:"Google Shared Folder"}),y.jsx(bI,{children:"Upload documents from Google Drive shared folder"})]}),y.jsx(yd,{className:"space-y-2",children:y.jsx(ti,{control:d.control,name:"googleDriveUrl",render:({field:g})=>y.jsxs(ni,{children:[y.jsx(Ri,{children:"URL"}),y.jsx(vi,{children:y.jsx(Pn,{...g,required:!0,placeholder:"Folder URL"})}),y.jsx(oi,{})]})})})]})})]}),y.jsx(oi,{}),y.jsx(Zh,{children:y.jsxs("div",{className:"flex w-full flex-row justify-between items-center",children:[y.jsx(ti,{control:d.control,name:"isSensitive",render:({field:{value:g,onChange:v,...b}})=>y.jsx(e_,{delayDuration:0,children:y.jsxs(Dh,{children:[y.jsx(Th,{asChild:!0,children:y.jsxs(ni,{className:"flex flex-row gap-2 items-center",children:[y.jsx(vi,{children:y.jsx(tR,{...b,checked:g,onCheckedChange:k=>v(!!k),className:"mt-2"})}),y.jsx(Ri,{children:"Is sensitive"})]})}),y.jsx(Ih,{side:"right",children:y.jsxs("div",{className:"flex flex-col items-center",children:[y.jsx("p",{children:"Sensitive content will not be processed"}),y.jsx("p",{children:"by OCR to protect confidential data"})]})})]})})}),y.jsx(jt,{disabled:m,type:"submit",children:"Upload"})]})})]})})]})})})}const Tge=({className:t,...e})=>y.jsx("nav",{role:"navigation","aria-label":"pagination",className:Lt("mx-auto flex w-full justify-center",t),...e});Tge.displayName="Pagination";const Ige=se.forwardRef(({className:t,...e},n)=>y.jsx("ul",{ref:n,className:Lt("flex flex-row items-center gap-1",t),...e}));Ige.displayName="PaginationContent";const Yy=se.forwardRef(({className:t,...e},n)=>y.jsx("li",{ref:n,className:Lt("",t),...e}));Yy.displayName="PaginationItem";const qC=({className:t,isActive:e,size:n="icon",children:i,...r})=>y.jsx(jt,{"aria-current":e?"page":void 0,variant:e?"outline":"ghost",size:n,className:t,...r,children:i});qC.displayName="PaginationLink";const Oge=({className:t,...e})=>y.jsx(qC,{"aria-label":"Go to previous page",size:"default",className:Lt("gap-1 pl-2.5",t),...e,children:y.jsx(VJe,{className:"h-4 w-4"})});Oge.displayName="PaginationPrevious";const Rge=({className:t,...e})=>y.jsx(qC,{"aria-label":"Go to next page",size:"default",className:Lt("gap-1 pr-2.5",t),...e,children:y.jsx(qJe,{className:"h-4 w-4"})});Rge.displayName="PaginationNext";const Pge=({className:t,...e})=>y.jsxs("span",{"aria-hidden":!0,className:Lt("flex h-9 w-9 items-center justify-center",t),...e,children:[y.jsx(WJe,{className:"h-4 w-4"}),y.jsx("span",{className:"sr-only",children:"More pages"})]});Pge.displayName="PaginationEllipsis";const Rst=(t,e)=>{const n=t-1;if(n<=0)return[];const i=[];return i.push(0),e>2&&i.push("..."),e>1&&i.push(e-1),e>0&&e<n&&i.push(e),e<n-1&&i.push(e+1),e<n-2&&i.push("..."),i.push(n),i},Pst=({onChange:t,totalPages:e,currentPageIndex:n,...i})=>{const r=Rst(e,n);return r.length?y.jsx(Tge,{...i,children:y.jsxs(Ige,{children:[y.jsx(Yy,{children:y.jsx(Oge,{disabled:n<1,onClick:()=>t(n-1)})}),r.map((a,o)=>{if(a==="...")return y.jsx(Yy,{children:y.jsx(Pge,{})},`ellipsis-${o}`);const s=a===n;return y.jsx(Yy,{children:y.jsx(qC,{onClick:()=>t(a),isActive:s,children:a+1})},`page-${a}`)}),y.jsx(Yy,{children:y.jsx(Rge,{disabled:n>=e-1,onClick:()=>t(n+1)})})]})}):null};Pst.displayName="Pagination";const Lst=({cols:t,spacing:e,children:n})=>y.jsx(p6,{cols:t,spacing:e,breakpoints:[{maxWidth:980,cols:3,spacing:"md"},{maxWidth:900,cols:2,spacing:"sm"},{maxWidth:755,cols:2,spacing:"sm"},{maxWidth:600,cols:1,spacing:"sm"}],children:n}),NU=N.createContext({userContext:null,setUserContext:()=>{}});function Ust({children:t}){const{authService:e}=N.useContext(t_),[n,i]=N.useState(null),[r,a]=N.useState(null),[o,s]=N.useState(null),[{data:l,fetching:c},d]=is({query:A2e,variables:{},pause:!0});return N.useEffect(()=>{const f=e.currentUser();$Te(f,r)||(a(f),d())},[r]),N.useEffect(()=>{l&&!c&&s(l.userContext)},[l,c]),N.useEffect(()=>{if(r&&o){const f=r&&o?{...r,context:o}:null;i(f)}},[o,r]),c?y.jsx(eet,{}):y.jsx(NU.Provider,{value:{userContext:n,setUserContext:i},children:t})}const Mst=N.createContext({filtersContext:null,setFiltersContext:()=>{}}),aI="mergeChargesByTransactionReference",$st=()=>{const[{fetching:t},e]=bs(GFe),[{fetching:n},i]=bs(qFe),[{fetching:r},a]=bs(KFe),o=N.useCallback(async()=>{let s="Error flagging foreign fee transactions";const l=`${aI}-fees`,c=`${aI}-merge`,d=`${aI}-debit-date`;un.loading("Flagging Fees",{id:l});try{const f=await e({}),h=Ss(f,s,l);if(!h)return;if(!h.flagForeignFeeTransactions.success){console.error(`${s} ${h.flagForeignFeeTransactions.errors?`:
|
|
247
|
+
color: hsl(${Math.max(0,Math.min(120-120*h,120))}deg 100% 31%);`,n?.key)}return r}}function In(t,e,n,i){return{debug:()=>{var r;return(r=t?.debugAll)!=null?r:t[e]},key:!1,onChange:i}}function dot(t,e,n,i){const r=()=>{var o;return(o=a.getValue())!=null?o:t.options.renderFallbackValue},a={id:`${e.id}_${n.id}`,row:e,column:n,getValue:()=>e.getValue(i),renderValue:r,getContext:Tn(()=>[t,n,e,a],(o,s,l,c)=>({table:o,column:s,row:l,cell:c,getValue:c.getValue,renderValue:c.renderValue}),In(t.options,"debugCells"))};return t._features.forEach(o=>{o.createCell==null||o.createCell(a,n,e,t)},{}),a}function uot(t,e,n,i){var r,a;const s={...t._getDefaultColumnDef(),...e},l=s.accessorKey;let c=(r=(a=s.id)!=null?a:l?typeof String.prototype.replaceAll=="function"?l.replaceAll(".","_"):l.replace(/\./g,"_"):void 0)!=null?r:typeof s.header=="string"?s.header:void 0,d;if(s.accessorFn?d=s.accessorFn:l&&(l.includes(".")?d=h=>{let m=h;for(const v of l.split(".")){var g;m=(g=m)==null?void 0:g[v]}return m}:d=h=>h[s.accessorKey]),!c)throw new Error;let f={id:`${String(c)}`,accessorFn:d,parent:i,depth:n,columnDef:s,columns:[],getFlatColumns:Tn(()=>[!0],()=>{var h;return[f,...(h=f.columns)==null?void 0:h.flatMap(m=>m.getFlatColumns())]},In(t.options,"debugColumns")),getLeafColumns:Tn(()=>[t._getOrderColumnsFn()],h=>{var m;if((m=f.columns)!=null&&m.length){let g=f.columns.flatMap(v=>v.getLeafColumns());return h(g)}return[f]},In(t.options,"debugColumns"))};for(const h of t._features)h.createColumn==null||h.createColumn(f,t);return f}const Wo="debugHeaders";function bY(t,e,n){var i;let a={id:(i=n.id)!=null?i:e.id,column:e,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const o=[],s=l=>{l.subHeaders&&l.subHeaders.length&&l.subHeaders.map(s),o.push(l)};return s(a),o},getContext:()=>({table:t,header:a,column:e})};return t._features.forEach(o=>{o.createHeader==null||o.createHeader(a,t)}),a}const fot={createTable:t=>{t.getHeaderGroups=Tn(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,i,r)=>{var a,o;const s=(a=i?.map(f=>n.find(h=>h.id===f)).filter(Boolean))!=null?a:[],l=(o=r?.map(f=>n.find(h=>h.id===f)).filter(Boolean))!=null?o:[],c=n.filter(f=>!(i!=null&&i.includes(f.id))&&!(r!=null&&r.includes(f.id)));return Qw(e,[...s,...c,...l],t)},In(t.options,Wo)),t.getCenterHeaderGroups=Tn(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,i,r)=>(n=n.filter(a=>!(i!=null&&i.includes(a.id))&&!(r!=null&&r.includes(a.id))),Qw(e,n,t,"center")),In(t.options,Wo)),t.getLeftHeaderGroups=Tn(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left],(e,n,i)=>{var r;const a=(r=i?.map(o=>n.find(s=>s.id===o)).filter(Boolean))!=null?r:[];return Qw(e,a,t,"left")},In(t.options,Wo)),t.getRightHeaderGroups=Tn(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.right],(e,n,i)=>{var r;const a=(r=i?.map(o=>n.find(s=>s.id===o)).filter(Boolean))!=null?r:[];return Qw(e,a,t,"right")},In(t.options,Wo)),t.getFooterGroups=Tn(()=>[t.getHeaderGroups()],e=>[...e].reverse(),In(t.options,Wo)),t.getLeftFooterGroups=Tn(()=>[t.getLeftHeaderGroups()],e=>[...e].reverse(),In(t.options,Wo)),t.getCenterFooterGroups=Tn(()=>[t.getCenterHeaderGroups()],e=>[...e].reverse(),In(t.options,Wo)),t.getRightFooterGroups=Tn(()=>[t.getRightHeaderGroups()],e=>[...e].reverse(),In(t.options,Wo)),t.getFlatHeaders=Tn(()=>[t.getHeaderGroups()],e=>e.map(n=>n.headers).flat(),In(t.options,Wo)),t.getLeftFlatHeaders=Tn(()=>[t.getLeftHeaderGroups()],e=>e.map(n=>n.headers).flat(),In(t.options,Wo)),t.getCenterFlatHeaders=Tn(()=>[t.getCenterHeaderGroups()],e=>e.map(n=>n.headers).flat(),In(t.options,Wo)),t.getRightFlatHeaders=Tn(()=>[t.getRightHeaderGroups()],e=>e.map(n=>n.headers).flat(),In(t.options,Wo)),t.getCenterLeafHeaders=Tn(()=>[t.getCenterFlatHeaders()],e=>e.filter(n=>{var i;return!((i=n.subHeaders)!=null&&i.length)}),In(t.options,Wo)),t.getLeftLeafHeaders=Tn(()=>[t.getLeftFlatHeaders()],e=>e.filter(n=>{var i;return!((i=n.subHeaders)!=null&&i.length)}),In(t.options,Wo)),t.getRightLeafHeaders=Tn(()=>[t.getRightFlatHeaders()],e=>e.filter(n=>{var i;return!((i=n.subHeaders)!=null&&i.length)}),In(t.options,Wo)),t.getLeafHeaders=Tn(()=>[t.getLeftHeaderGroups(),t.getCenterHeaderGroups(),t.getRightHeaderGroups()],(e,n,i)=>{var r,a,o,s,l,c;return[...(r=(a=e[0])==null?void 0:a.headers)!=null?r:[],...(o=(s=n[0])==null?void 0:s.headers)!=null?o:[],...(l=(c=i[0])==null?void 0:c.headers)!=null?l:[]].map(d=>d.getLeafHeaders()).flat()},In(t.options,Wo))}};function Qw(t,e,n,i){var r,a;let o=0;const s=function(h,m){m===void 0&&(m=1),o=Math.max(o,m),h.filter(g=>g.getIsVisible()).forEach(g=>{var v;(v=g.columns)!=null&&v.length&&s(g.columns,m+1)},0)};s(t);let l=[];const c=(h,m)=>{const g={depth:m,id:[i,`${m}`].filter(Boolean).join("_"),headers:[]},v=[];h.forEach(b=>{const k=[...v].reverse()[0],w=b.column.depth===g.depth;let x,F=!1;if(w&&b.column.parent?x=b.column.parent:(x=b.column,F=!0),k&&k?.column===x)k.subHeaders.push(b);else{const _=bY(n,x,{id:[i,m,x.id,b?.id].filter(Boolean).join("_"),isPlaceholder:F,placeholderId:F?`${v.filter(T=>T.column===x).length}`:void 0,depth:m,index:v.length});_.subHeaders.push(b),v.push(_)}g.headers.push(b),b.headerGroup=g}),l.push(g),m>0&&c(v,m-1)},d=e.map((h,m)=>bY(n,h,{depth:o,index:m}));c(d,o-1),l.reverse();const f=h=>h.filter(g=>g.column.getIsVisible()).map(g=>{let v=0,b=0,k=[0];g.subHeaders&&g.subHeaders.length?(k=[],f(g.subHeaders).forEach(x=>{let{colSpan:F,rowSpan:_}=x;v+=F,k.push(_)})):v=1;const w=Math.min(...k);return b=b+w,g.colSpan=v,g.rowSpan=b,{colSpan:v,rowSpan:b}});return f((r=(a=l[0])==null?void 0:a.headers)!=null?r:[]),l}const yU=(t,e,n,i,r,a,o)=>{let s={id:e,index:i,original:n,depth:r,parentId:o,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(s._valuesCache.hasOwnProperty(l))return s._valuesCache[l];const c=t.getColumn(l);if(c!=null&&c.accessorFn)return s._valuesCache[l]=c.accessorFn(s.original,i),s._valuesCache[l]},getUniqueValues:l=>{if(s._uniqueValuesCache.hasOwnProperty(l))return s._uniqueValuesCache[l];const c=t.getColumn(l);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(s._uniqueValuesCache[l]=c.columnDef.getUniqueValues(s.original,i),s._uniqueValuesCache[l]):(s._uniqueValuesCache[l]=[s.getValue(l)],s._uniqueValuesCache[l])},renderValue:l=>{var c;return(c=s.getValue(l))!=null?c:t.options.renderFallbackValue},subRows:[],getLeafRows:()=>cot(s.subRows,l=>l.subRows),getParentRow:()=>s.parentId?t.getRow(s.parentId,!0):void 0,getParentRows:()=>{let l=[],c=s;for(;;){const d=c.getParentRow();if(!d)break;l.push(d),c=d}return l.reverse()},getAllCells:Tn(()=>[t.getAllLeafColumns()],l=>l.map(c=>dot(t,s,c,c.id)),In(t.options,"debugRows")),_getAllCellsByColumnId:Tn(()=>[s.getAllCells()],l=>l.reduce((c,d)=>(c[d.column.id]=d,c),{}),In(t.options,"debugRows"))};for(let l=0;l<t._features.length;l++){const c=t._features[l];c==null||c.createRow==null||c.createRow(s,t)}return s},Aot={createColumn:(t,e)=>{t._getFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,t.id),t.getFacetedRowModel=()=>t._getFacetedRowModel?t._getFacetedRowModel():e.getPreFilteredRowModel(),t._getFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,t.id),t.getFacetedUniqueValues=()=>t._getFacetedUniqueValues?t._getFacetedUniqueValues():new Map,t._getFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,t.id),t.getFacetedMinMaxValues=()=>{if(t._getFacetedMinMaxValues)return t._getFacetedMinMaxValues()}}},ige=(t,e,n)=>{var i,r;const a=n==null||(i=n.toString())==null?void 0:i.toLowerCase();return!!(!((r=t.getValue(e))==null||(r=r.toString())==null||(r=r.toLowerCase())==null)&&r.includes(a))};ige.autoRemove=t=>gd(t);const rge=(t,e,n)=>{var i;return!!(!((i=t.getValue(e))==null||(i=i.toString())==null)&&i.includes(n))};rge.autoRemove=t=>gd(t);const age=(t,e,n)=>{var i;return((i=t.getValue(e))==null||(i=i.toString())==null?void 0:i.toLowerCase())===n?.toLowerCase()};age.autoRemove=t=>gd(t);const oge=(t,e,n)=>{var i;return(i=t.getValue(e))==null?void 0:i.includes(n)};oge.autoRemove=t=>gd(t);const sge=(t,e,n)=>!n.some(i=>{var r;return!((r=t.getValue(e))!=null&&r.includes(i))});sge.autoRemove=t=>gd(t)||!(t!=null&&t.length);const lge=(t,e,n)=>n.some(i=>{var r;return(r=t.getValue(e))==null?void 0:r.includes(i)});lge.autoRemove=t=>gd(t)||!(t!=null&&t.length);const cge=(t,e,n)=>t.getValue(e)===n;cge.autoRemove=t=>gd(t);const dge=(t,e,n)=>t.getValue(e)==n;dge.autoRemove=t=>gd(t);const kU=(t,e,n)=>{let[i,r]=n;const a=t.getValue(e);return a>=i&&a<=r};kU.resolveFilterValue=t=>{let[e,n]=t,i=typeof e!="number"?parseFloat(e):e,r=typeof n!="number"?parseFloat(n):n,a=e===null||Number.isNaN(i)?-1/0:i,o=n===null||Number.isNaN(r)?1/0:r;if(a>o){const s=a;a=o,o=s}return[a,o]};kU.autoRemove=t=>gd(t)||gd(t[0])&&gd(t[1]);const xf={includesString:ige,includesStringSensitive:rge,equalsString:age,arrIncludes:oge,arrIncludesAll:sge,arrIncludesSome:lge,equals:cge,weakEquals:dge,inNumberRange:kU};function gd(t){return t==null||t===""}const mot={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:t=>({columnFilters:[],...t}),getDefaultOptions:t=>({onColumnFiltersChange:Rl("columnFilters",t),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(t,e)=>{t.getAutoFilterFn=()=>{const n=e.getCoreRowModel().flatRows[0],i=n?.getValue(t.id);return typeof i=="string"?xf.includesString:typeof i=="number"?xf.inNumberRange:typeof i=="boolean"||i!==null&&typeof i=="object"?xf.equals:Array.isArray(i)?xf.arrIncludes:xf.weakEquals},t.getFilterFn=()=>{var n,i;return VC(t.columnDef.filterFn)?t.columnDef.filterFn:t.columnDef.filterFn==="auto"?t.getAutoFilterFn():(n=(i=e.options.filterFns)==null?void 0:i[t.columnDef.filterFn])!=null?n:xf[t.columnDef.filterFn]},t.getCanFilter=()=>{var n,i,r;return((n=t.columnDef.enableColumnFilter)!=null?n:!0)&&((i=e.options.enableColumnFilters)!=null?i:!0)&&((r=e.options.enableFilters)!=null?r:!0)&&!!t.accessorFn},t.getIsFiltered=()=>t.getFilterIndex()>-1,t.getFilterValue=()=>{var n;return(n=e.getState().columnFilters)==null||(n=n.find(i=>i.id===t.id))==null?void 0:n.value},t.getFilterIndex=()=>{var n,i;return(n=(i=e.getState().columnFilters)==null?void 0:i.findIndex(r=>r.id===t.id))!=null?n:-1},t.setFilterValue=n=>{e.setColumnFilters(i=>{const r=t.getFilterFn(),a=i?.find(d=>d.id===t.id),o=XA(n,a?a.value:void 0);if(SY(r,o,t)){var s;return(s=i?.filter(d=>d.id!==t.id))!=null?s:[]}const l={id:t.id,value:o};if(a){var c;return(c=i?.map(d=>d.id===t.id?l:d))!=null?c:[]}return i!=null&&i.length?[...i,l]:[l]})}},createRow:(t,e)=>{t.columnFilters={},t.columnFiltersMeta={}},createTable:t=>{t.setColumnFilters=e=>{const n=t.getAllLeafColumns(),i=r=>{var a;return(a=XA(e,r))==null?void 0:a.filter(o=>{const s=n.find(l=>l.id===o.id);if(s){const l=s.getFilterFn();if(SY(l,o.value,s))return!1}return!0})};t.options.onColumnFiltersChange==null||t.options.onColumnFiltersChange(i)},t.resetColumnFilters=e=>{var n,i;t.setColumnFilters(e?[]:(n=(i=t.initialState)==null?void 0:i.columnFilters)!=null?n:[])},t.getPreFilteredRowModel=()=>t.getCoreRowModel(),t.getFilteredRowModel=()=>(!t._getFilteredRowModel&&t.options.getFilteredRowModel&&(t._getFilteredRowModel=t.options.getFilteredRowModel(t)),t.options.manualFiltering||!t._getFilteredRowModel?t.getPreFilteredRowModel():t._getFilteredRowModel())}};function SY(t,e,n){return(t&&t.autoRemove?t.autoRemove(e,n):!1)||typeof e>"u"||typeof e=="string"&&!e}const hot=(t,e,n)=>n.reduce((i,r)=>{const a=r.getValue(t);return i+(typeof a=="number"?a:0)},0),pot=(t,e,n)=>{let i;return n.forEach(r=>{const a=r.getValue(t);a!=null&&(i>a||i===void 0&&a>=a)&&(i=a)}),i},got=(t,e,n)=>{let i;return n.forEach(r=>{const a=r.getValue(t);a!=null&&(i<a||i===void 0&&a>=a)&&(i=a)}),i},vot=(t,e,n)=>{let i,r;return n.forEach(a=>{const o=a.getValue(t);o!=null&&(i===void 0?o>=o&&(i=r=o):(i>o&&(i=o),r<o&&(r=o)))}),[i,r]},yot=(t,e)=>{let n=0,i=0;if(e.forEach(r=>{let a=r.getValue(t);a!=null&&(a=+a)>=a&&(++n,i+=a)}),n)return i/n},kot=(t,e)=>{if(!e.length)return;const n=e.map(a=>a.getValue(t));if(!lot(n))return;if(n.length===1)return n[0];const i=Math.floor(n.length/2),r=n.sort((a,o)=>a-o);return n.length%2!==0?r[i]:(r[i-1]+r[i])/2},bot=(t,e)=>Array.from(new Set(e.map(n=>n.getValue(t))).values()),Sot=(t,e)=>new Set(e.map(n=>n.getValue(t))).size,wot=(t,e)=>e.length,X4={sum:hot,min:pot,max:got,extent:vot,mean:yot,median:kot,unique:bot,uniqueCount:Sot,count:wot},Not={getDefaultColumnDef:()=>({aggregatedCell:t=>{var e,n;return(e=(n=t.getValue())==null||n.toString==null?void 0:n.toString())!=null?e:null},aggregationFn:"auto"}),getInitialState:t=>({grouping:[],...t}),getDefaultOptions:t=>({onGroupingChange:Rl("grouping",t),groupedColumnMode:"reorder"}),createColumn:(t,e)=>{t.toggleGrouping=()=>{e.setGrouping(n=>n!=null&&n.includes(t.id)?n.filter(i=>i!==t.id):[...n??[],t.id])},t.getCanGroup=()=>{var n,i;return((n=t.columnDef.enableGrouping)!=null?n:!0)&&((i=e.options.enableGrouping)!=null?i:!0)&&(!!t.accessorFn||!!t.columnDef.getGroupingValue)},t.getIsGrouped=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.includes(t.id)},t.getGroupedIndex=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.indexOf(t.id)},t.getToggleGroupingHandler=()=>{const n=t.getCanGroup();return()=>{n&&t.toggleGrouping()}},t.getAutoAggregationFn=()=>{const n=e.getCoreRowModel().flatRows[0],i=n?.getValue(t.id);if(typeof i=="number")return X4.sum;if(Object.prototype.toString.call(i)==="[object Date]")return X4.extent},t.getAggregationFn=()=>{var n,i;if(!t)throw new Error;return VC(t.columnDef.aggregationFn)?t.columnDef.aggregationFn:t.columnDef.aggregationFn==="auto"?t.getAutoAggregationFn():(n=(i=e.options.aggregationFns)==null?void 0:i[t.columnDef.aggregationFn])!=null?n:X4[t.columnDef.aggregationFn]}},createTable:t=>{t.setGrouping=e=>t.options.onGroupingChange==null?void 0:t.options.onGroupingChange(e),t.resetGrouping=e=>{var n,i;t.setGrouping(e?[]:(n=(i=t.initialState)==null?void 0:i.grouping)!=null?n:[])},t.getPreGroupedRowModel=()=>t.getFilteredRowModel(),t.getGroupedRowModel=()=>(!t._getGroupedRowModel&&t.options.getGroupedRowModel&&(t._getGroupedRowModel=t.options.getGroupedRowModel(t)),t.options.manualGrouping||!t._getGroupedRowModel?t.getPreGroupedRowModel():t._getGroupedRowModel())},createRow:(t,e)=>{t.getIsGrouped=()=>!!t.groupingColumnId,t.getGroupingValue=n=>{if(t._groupingValuesCache.hasOwnProperty(n))return t._groupingValuesCache[n];const i=e.getColumn(n);return i!=null&&i.columnDef.getGroupingValue?(t._groupingValuesCache[n]=i.columnDef.getGroupingValue(t.original),t._groupingValuesCache[n]):t.getValue(n)},t._groupingValuesCache={}},createCell:(t,e,n,i)=>{t.getIsGrouped=()=>e.getIsGrouped()&&e.id===n.groupingColumnId,t.getIsPlaceholder=()=>!t.getIsGrouped()&&e.getIsGrouped(),t.getIsAggregated=()=>{var r;return!t.getIsGrouped()&&!t.getIsPlaceholder()&&!!((r=n.subRows)!=null&&r.length)}}};function xot(t,e,n){if(!(e!=null&&e.length)||!n)return t;const i=t.filter(a=>!e.includes(a.id));return n==="remove"?i:[...e.map(a=>t.find(o=>o.id===a)).filter(Boolean),...i]}const Fot={getInitialState:t=>({columnOrder:[],...t}),getDefaultOptions:t=>({onColumnOrderChange:Rl("columnOrder",t)}),createColumn:(t,e)=>{t.getIndex=Tn(n=>[mk(e,n)],n=>n.findIndex(i=>i.id===t.id),In(e.options,"debugColumns")),t.getIsFirstColumn=n=>{var i;return((i=mk(e,n)[0])==null?void 0:i.id)===t.id},t.getIsLastColumn=n=>{var i;const r=mk(e,n);return((i=r[r.length-1])==null?void 0:i.id)===t.id}},createTable:t=>{t.setColumnOrder=e=>t.options.onColumnOrderChange==null?void 0:t.options.onColumnOrderChange(e),t.resetColumnOrder=e=>{var n;t.setColumnOrder(e?[]:(n=t.initialState.columnOrder)!=null?n:[])},t._getOrderColumnsFn=Tn(()=>[t.getState().columnOrder,t.getState().grouping,t.options.groupedColumnMode],(e,n,i)=>r=>{let a=[];if(!(e!=null&&e.length))a=r;else{const o=[...e],s=[...r];for(;s.length&&o.length;){const l=o.shift(),c=s.findIndex(d=>d.id===l);c>-1&&a.push(s.splice(c,1)[0])}a=[...a,...s]}return xot(a,n,i)},In(t.options,"debugTable"))}},Z4=()=>({left:[],right:[]}),_ot={getInitialState:t=>({columnPinning:Z4(),...t}),getDefaultOptions:t=>({onColumnPinningChange:Rl("columnPinning",t)}),createColumn:(t,e)=>{t.pin=n=>{const i=t.getLeafColumns().map(r=>r.id).filter(Boolean);e.setColumnPinning(r=>{var a,o;if(n==="right"){var s,l;return{left:((s=r?.left)!=null?s:[]).filter(f=>!(i!=null&&i.includes(f))),right:[...((l=r?.right)!=null?l:[]).filter(f=>!(i!=null&&i.includes(f))),...i]}}if(n==="left"){var c,d;return{left:[...((c=r?.left)!=null?c:[]).filter(f=>!(i!=null&&i.includes(f))),...i],right:((d=r?.right)!=null?d:[]).filter(f=>!(i!=null&&i.includes(f)))}}return{left:((a=r?.left)!=null?a:[]).filter(f=>!(i!=null&&i.includes(f))),right:((o=r?.right)!=null?o:[]).filter(f=>!(i!=null&&i.includes(f)))}})},t.getCanPin=()=>t.getLeafColumns().some(i=>{var r,a,o;return((r=i.columnDef.enablePinning)!=null?r:!0)&&((a=(o=e.options.enableColumnPinning)!=null?o:e.options.enablePinning)!=null?a:!0)}),t.getIsPinned=()=>{const n=t.getLeafColumns().map(s=>s.id),{left:i,right:r}=e.getState().columnPinning,a=n.some(s=>i?.includes(s)),o=n.some(s=>r?.includes(s));return a?"left":o?"right":!1},t.getPinnedIndex=()=>{var n,i;const r=t.getIsPinned();return r?(n=(i=e.getState().columnPinning)==null||(i=i[r])==null?void 0:i.indexOf(t.id))!=null?n:-1:0}},createRow:(t,e)=>{t.getCenterVisibleCells=Tn(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,i,r)=>{const a=[...i??[],...r??[]];return n.filter(o=>!a.includes(o.column.id))},In(e.options,"debugRows")),t.getLeftVisibleCells=Tn(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left],(n,i)=>(i??[]).map(a=>n.find(o=>o.column.id===a)).filter(Boolean).map(a=>({...a,position:"left"})),In(e.options,"debugRows")),t.getRightVisibleCells=Tn(()=>[t._getAllVisibleCells(),e.getState().columnPinning.right],(n,i)=>(i??[]).map(a=>n.find(o=>o.column.id===a)).filter(Boolean).map(a=>({...a,position:"right"})),In(e.options,"debugRows"))},createTable:t=>{t.setColumnPinning=e=>t.options.onColumnPinningChange==null?void 0:t.options.onColumnPinningChange(e),t.resetColumnPinning=e=>{var n,i;return t.setColumnPinning(e?Z4():(n=(i=t.initialState)==null?void 0:i.columnPinning)!=null?n:Z4())},t.getIsSomeColumnsPinned=e=>{var n;const i=t.getState().columnPinning;if(!e){var r,a;return!!((r=i.left)!=null&&r.length||(a=i.right)!=null&&a.length)}return!!((n=i[e])!=null&&n.length)},t.getLeftLeafColumns=Tn(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left],(e,n)=>(n??[]).map(i=>e.find(r=>r.id===i)).filter(Boolean),In(t.options,"debugColumns")),t.getRightLeafColumns=Tn(()=>[t.getAllLeafColumns(),t.getState().columnPinning.right],(e,n)=>(n??[]).map(i=>e.find(r=>r.id===i)).filter(Boolean),In(t.options,"debugColumns")),t.getCenterLeafColumns=Tn(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,i)=>{const r=[...n??[],...i??[]];return e.filter(a=>!r.includes(a.id))},In(t.options,"debugColumns"))}};function Cot(t){return t||(typeof document<"u"?document:null)}const Hw={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},J4=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Eot={getDefaultColumnDef:()=>Hw,getInitialState:t=>({columnSizing:{},columnSizingInfo:J4(),...t}),getDefaultOptions:t=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Rl("columnSizing",t),onColumnSizingInfoChange:Rl("columnSizingInfo",t)}),createColumn:(t,e)=>{t.getSize=()=>{var n,i,r;const a=e.getState().columnSizing[t.id];return Math.min(Math.max((n=t.columnDef.minSize)!=null?n:Hw.minSize,(i=a??t.columnDef.size)!=null?i:Hw.size),(r=t.columnDef.maxSize)!=null?r:Hw.maxSize)},t.getStart=Tn(n=>[n,mk(e,n),e.getState().columnSizing],(n,i)=>i.slice(0,t.getIndex(n)).reduce((r,a)=>r+a.getSize(),0),In(e.options,"debugColumns")),t.getAfter=Tn(n=>[n,mk(e,n),e.getState().columnSizing],(n,i)=>i.slice(t.getIndex(n)+1).reduce((r,a)=>r+a.getSize(),0),In(e.options,"debugColumns")),t.resetSize=()=>{e.setColumnSizing(n=>{let{[t.id]:i,...r}=n;return r})},t.getCanResize=()=>{var n,i;return((n=t.columnDef.enableResizing)!=null?n:!0)&&((i=e.options.enableColumnResizing)!=null?i:!0)},t.getIsResizing=()=>e.getState().columnSizingInfo.isResizingColumn===t.id},createHeader:(t,e)=>{t.getSize=()=>{let n=0;const i=r=>{if(r.subHeaders.length)r.subHeaders.forEach(i);else{var a;n+=(a=r.column.getSize())!=null?a:0}};return i(t),n},t.getStart=()=>{if(t.index>0){const n=t.headerGroup.headers[t.index-1];return n.getStart()+n.getSize()}return 0},t.getResizeHandler=n=>{const i=e.getColumn(t.column.id),r=i?.getCanResize();return a=>{if(!i||!r||(a.persist==null||a.persist(),eI(a)&&a.touches&&a.touches.length>1))return;const o=t.getSize(),s=t?t.getLeafHeaders().map(k=>[k.column.id,k.column.getSize()]):[[i.id,i.getSize()]],l=eI(a)?Math.round(a.touches[0].clientX):a.clientX,c={},d=(k,w)=>{typeof w=="number"&&(e.setColumnSizingInfo(x=>{var F,_;const T=e.options.columnResizeDirection==="rtl"?-1:1,B=(w-((F=x?.startOffset)!=null?F:0))*T,O=Math.max(B/((_=x?.startSize)!=null?_:0),-.999999);return x.columnSizingStart.forEach(P=>{let[G,U]=P;c[G]=Math.round(Math.max(U+U*O,0)*100)/100}),{...x,deltaOffset:B,deltaPercentage:O}}),(e.options.columnResizeMode==="onChange"||k==="end")&&e.setColumnSizing(x=>({...x,...c})))},f=k=>d("move",k),h=k=>{d("end",k),e.setColumnSizingInfo(w=>({...w,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},m=Cot(n),g={moveHandler:k=>f(k.clientX),upHandler:k=>{m?.removeEventListener("mousemove",g.moveHandler),m?.removeEventListener("mouseup",g.upHandler),h(k.clientX)}},v={moveHandler:k=>(k.cancelable&&(k.preventDefault(),k.stopPropagation()),f(k.touches[0].clientX),!1),upHandler:k=>{var w;m?.removeEventListener("touchmove",v.moveHandler),m?.removeEventListener("touchend",v.upHandler),k.cancelable&&(k.preventDefault(),k.stopPropagation()),h((w=k.touches[0])==null?void 0:w.clientX)}},b=Bot()?{passive:!1}:!1;eI(a)?(m?.addEventListener("touchmove",v.moveHandler,b),m?.addEventListener("touchend",v.upHandler,b)):(m?.addEventListener("mousemove",g.moveHandler,b),m?.addEventListener("mouseup",g.upHandler,b)),e.setColumnSizingInfo(k=>({...k,startOffset:l,startSize:o,deltaOffset:0,deltaPercentage:0,columnSizingStart:s,isResizingColumn:i.id}))}}},createTable:t=>{t.setColumnSizing=e=>t.options.onColumnSizingChange==null?void 0:t.options.onColumnSizingChange(e),t.setColumnSizingInfo=e=>t.options.onColumnSizingInfoChange==null?void 0:t.options.onColumnSizingInfoChange(e),t.resetColumnSizing=e=>{var n;t.setColumnSizing(e?{}:(n=t.initialState.columnSizing)!=null?n:{})},t.resetHeaderSizeInfo=e=>{var n;t.setColumnSizingInfo(e?J4():(n=t.initialState.columnSizingInfo)!=null?n:J4())},t.getTotalSize=()=>{var e,n;return(e=(n=t.getHeaderGroups()[0])==null?void 0:n.headers.reduce((i,r)=>i+r.getSize(),0))!=null?e:0},t.getLeftTotalSize=()=>{var e,n;return(e=(n=t.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((i,r)=>i+r.getSize(),0))!=null?e:0},t.getCenterTotalSize=()=>{var e,n;return(e=(n=t.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((i,r)=>i+r.getSize(),0))!=null?e:0},t.getRightTotalSize=()=>{var e,n;return(e=(n=t.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((i,r)=>i+r.getSize(),0))!=null?e:0}}};let zw=null;function Bot(){if(typeof zw=="boolean")return zw;let t=!1;try{const e={get passive(){return t=!0,!1}},n=()=>{};window.addEventListener("test",n,e),window.removeEventListener("test",n)}catch{t=!1}return zw=t,zw}function eI(t){return t.type==="touchstart"}const Dot={getInitialState:t=>({columnVisibility:{},...t}),getDefaultOptions:t=>({onColumnVisibilityChange:Rl("columnVisibility",t)}),createColumn:(t,e)=>{t.toggleVisibility=n=>{t.getCanHide()&&e.setColumnVisibility(i=>({...i,[t.id]:n??!t.getIsVisible()}))},t.getIsVisible=()=>{var n,i;const r=t.columns;return(n=r.length?r.some(a=>a.getIsVisible()):(i=e.getState().columnVisibility)==null?void 0:i[t.id])!=null?n:!0},t.getCanHide=()=>{var n,i;return((n=t.columnDef.enableHiding)!=null?n:!0)&&((i=e.options.enableHiding)!=null?i:!0)},t.getToggleVisibilityHandler=()=>n=>{t.toggleVisibility==null||t.toggleVisibility(n.target.checked)}},createRow:(t,e)=>{t._getAllVisibleCells=Tn(()=>[t.getAllCells(),e.getState().columnVisibility],n=>n.filter(i=>i.column.getIsVisible()),In(e.options,"debugRows")),t.getVisibleCells=Tn(()=>[t.getLeftVisibleCells(),t.getCenterVisibleCells(),t.getRightVisibleCells()],(n,i,r)=>[...n,...i,...r],In(e.options,"debugRows"))},createTable:t=>{const e=(n,i)=>Tn(()=>[i(),i().filter(r=>r.getIsVisible()).map(r=>r.id).join("_")],r=>r.filter(a=>a.getIsVisible==null?void 0:a.getIsVisible()),In(t.options,"debugColumns"));t.getVisibleFlatColumns=e("getVisibleFlatColumns",()=>t.getAllFlatColumns()),t.getVisibleLeafColumns=e("getVisibleLeafColumns",()=>t.getAllLeafColumns()),t.getLeftVisibleLeafColumns=e("getLeftVisibleLeafColumns",()=>t.getLeftLeafColumns()),t.getRightVisibleLeafColumns=e("getRightVisibleLeafColumns",()=>t.getRightLeafColumns()),t.getCenterVisibleLeafColumns=e("getCenterVisibleLeafColumns",()=>t.getCenterLeafColumns()),t.setColumnVisibility=n=>t.options.onColumnVisibilityChange==null?void 0:t.options.onColumnVisibilityChange(n),t.resetColumnVisibility=n=>{var i;t.setColumnVisibility(n?{}:(i=t.initialState.columnVisibility)!=null?i:{})},t.toggleAllColumnsVisible=n=>{var i;n=(i=n)!=null?i:!t.getIsAllColumnsVisible(),t.setColumnVisibility(t.getAllLeafColumns().reduce((r,a)=>({...r,[a.id]:n||!(a.getCanHide!=null&&a.getCanHide())}),{}))},t.getIsAllColumnsVisible=()=>!t.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),t.getIsSomeColumnsVisible=()=>t.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),t.getToggleAllColumnsVisibilityHandler=()=>n=>{var i;t.toggleAllColumnsVisible((i=n.target)==null?void 0:i.checked)}}};function mk(t,e){return e?e==="center"?t.getCenterVisibleLeafColumns():e==="left"?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns()}const Tot={createTable:t=>{t._getGlobalFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,"__global__"),t.getGlobalFacetedRowModel=()=>t.options.manualFiltering||!t._getGlobalFacetedRowModel?t.getPreFilteredRowModel():t._getGlobalFacetedRowModel(),t._getGlobalFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,"__global__"),t.getGlobalFacetedUniqueValues=()=>t._getGlobalFacetedUniqueValues?t._getGlobalFacetedUniqueValues():new Map,t._getGlobalFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,"__global__"),t.getGlobalFacetedMinMaxValues=()=>{if(t._getGlobalFacetedMinMaxValues)return t._getGlobalFacetedMinMaxValues()}}},Iot={getInitialState:t=>({globalFilter:void 0,...t}),getDefaultOptions:t=>({onGlobalFilterChange:Rl("globalFilter",t),globalFilterFn:"auto",getColumnCanGlobalFilter:e=>{var n;const i=(n=t.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[e.id])==null?void 0:n.getValue();return typeof i=="string"||typeof i=="number"}}),createColumn:(t,e)=>{t.getCanGlobalFilter=()=>{var n,i,r,a;return((n=t.columnDef.enableGlobalFilter)!=null?n:!0)&&((i=e.options.enableGlobalFilter)!=null?i:!0)&&((r=e.options.enableFilters)!=null?r:!0)&&((a=e.options.getColumnCanGlobalFilter==null?void 0:e.options.getColumnCanGlobalFilter(t))!=null?a:!0)&&!!t.accessorFn}},createTable:t=>{t.getGlobalAutoFilterFn=()=>xf.includesString,t.getGlobalFilterFn=()=>{var e,n;const{globalFilterFn:i}=t.options;return VC(i)?i:i==="auto"?t.getGlobalAutoFilterFn():(e=(n=t.options.filterFns)==null?void 0:n[i])!=null?e:xf[i]},t.setGlobalFilter=e=>{t.options.onGlobalFilterChange==null||t.options.onGlobalFilterChange(e)},t.resetGlobalFilter=e=>{t.setGlobalFilter(e?void 0:t.initialState.globalFilter)}}},Oot={getInitialState:t=>({expanded:{},...t}),getDefaultOptions:t=>({onExpandedChange:Rl("expanded",t),paginateExpandedRows:!0}),createTable:t=>{let e=!1,n=!1;t._autoResetExpanded=()=>{var i,r;if(!e){t._queue(()=>{e=!0});return}if((i=(r=t.options.autoResetAll)!=null?r:t.options.autoResetExpanded)!=null?i:!t.options.manualExpanding){if(n)return;n=!0,t._queue(()=>{t.resetExpanded(),n=!1})}},t.setExpanded=i=>t.options.onExpandedChange==null?void 0:t.options.onExpandedChange(i),t.toggleAllRowsExpanded=i=>{i??!t.getIsAllRowsExpanded()?t.setExpanded(!0):t.setExpanded({})},t.resetExpanded=i=>{var r,a;t.setExpanded(i?{}:(r=(a=t.initialState)==null?void 0:a.expanded)!=null?r:{})},t.getCanSomeRowsExpand=()=>t.getPrePaginationRowModel().flatRows.some(i=>i.getCanExpand()),t.getToggleAllRowsExpandedHandler=()=>i=>{i.persist==null||i.persist(),t.toggleAllRowsExpanded()},t.getIsSomeRowsExpanded=()=>{const i=t.getState().expanded;return i===!0||Object.values(i).some(Boolean)},t.getIsAllRowsExpanded=()=>{const i=t.getState().expanded;return typeof i=="boolean"?i===!0:!(!Object.keys(i).length||t.getRowModel().flatRows.some(r=>!r.getIsExpanded()))},t.getExpandedDepth=()=>{let i=0;return(t.getState().expanded===!0?Object.keys(t.getRowModel().rowsById):Object.keys(t.getState().expanded)).forEach(a=>{const o=a.split(".");i=Math.max(i,o.length)}),i},t.getPreExpandedRowModel=()=>t.getSortedRowModel(),t.getExpandedRowModel=()=>(!t._getExpandedRowModel&&t.options.getExpandedRowModel&&(t._getExpandedRowModel=t.options.getExpandedRowModel(t)),t.options.manualExpanding||!t._getExpandedRowModel?t.getPreExpandedRowModel():t._getExpandedRowModel())},createRow:(t,e)=>{t.toggleExpanded=n=>{e.setExpanded(i=>{var r;const a=i===!0?!0:!!(i!=null&&i[t.id]);let o={};if(i===!0?Object.keys(e.getRowModel().rowsById).forEach(s=>{o[s]=!0}):o=i,n=(r=n)!=null?r:!a,!a&&n)return{...o,[t.id]:!0};if(a&&!n){const{[t.id]:s,...l}=o;return l}return i})},t.getIsExpanded=()=>{var n;const i=e.getState().expanded;return!!((n=e.options.getIsRowExpanded==null?void 0:e.options.getIsRowExpanded(t))!=null?n:i===!0||i?.[t.id])},t.getCanExpand=()=>{var n,i,r;return(n=e.options.getRowCanExpand==null?void 0:e.options.getRowCanExpand(t))!=null?n:((i=e.options.enableExpanding)!=null?i:!0)&&!!((r=t.subRows)!=null&&r.length)},t.getIsAllParentsExpanded=()=>{let n=!0,i=t;for(;n&&i.parentId;)i=e.getRow(i.parentId,!0),n=i.getIsExpanded();return n},t.getToggleExpandedHandler=()=>{const n=t.getCanExpand();return()=>{n&&t.toggleExpanded()}}}},pR=0,gR=10,tI=()=>({pageIndex:pR,pageSize:gR}),Rot={getInitialState:t=>({...t,pagination:{...tI(),...t?.pagination}}),getDefaultOptions:t=>({onPaginationChange:Rl("pagination",t)}),createTable:t=>{let e=!1,n=!1;t._autoResetPageIndex=()=>{var i,r;if(!e){t._queue(()=>{e=!0});return}if((i=(r=t.options.autoResetAll)!=null?r:t.options.autoResetPageIndex)!=null?i:!t.options.manualPagination){if(n)return;n=!0,t._queue(()=>{t.resetPageIndex(),n=!1})}},t.setPagination=i=>{const r=a=>XA(i,a);return t.options.onPaginationChange==null?void 0:t.options.onPaginationChange(r)},t.resetPagination=i=>{var r;t.setPagination(i?tI():(r=t.initialState.pagination)!=null?r:tI())},t.setPageIndex=i=>{t.setPagination(r=>{let a=XA(i,r.pageIndex);const o=typeof t.options.pageCount>"u"||t.options.pageCount===-1?Number.MAX_SAFE_INTEGER:t.options.pageCount-1;return a=Math.max(0,Math.min(a,o)),{...r,pageIndex:a}})},t.resetPageIndex=i=>{var r,a;t.setPageIndex(i?pR:(r=(a=t.initialState)==null||(a=a.pagination)==null?void 0:a.pageIndex)!=null?r:pR)},t.resetPageSize=i=>{var r,a;t.setPageSize(i?gR:(r=(a=t.initialState)==null||(a=a.pagination)==null?void 0:a.pageSize)!=null?r:gR)},t.setPageSize=i=>{t.setPagination(r=>{const a=Math.max(1,XA(i,r.pageSize)),o=r.pageSize*r.pageIndex,s=Math.floor(o/a);return{...r,pageIndex:s,pageSize:a}})},t.setPageCount=i=>t.setPagination(r=>{var a;let o=XA(i,(a=t.options.pageCount)!=null?a:-1);return typeof o=="number"&&(o=Math.max(-1,o)),{...r,pageCount:o}}),t.getPageOptions=Tn(()=>[t.getPageCount()],i=>{let r=[];return i&&i>0&&(r=[...new Array(i)].fill(null).map((a,o)=>o)),r},In(t.options,"debugTable")),t.getCanPreviousPage=()=>t.getState().pagination.pageIndex>0,t.getCanNextPage=()=>{const{pageIndex:i}=t.getState().pagination,r=t.getPageCount();return r===-1?!0:r===0?!1:i<r-1},t.previousPage=()=>t.setPageIndex(i=>i-1),t.nextPage=()=>t.setPageIndex(i=>i+1),t.firstPage=()=>t.setPageIndex(0),t.lastPage=()=>t.setPageIndex(t.getPageCount()-1),t.getPrePaginationRowModel=()=>t.getExpandedRowModel(),t.getPaginationRowModel=()=>(!t._getPaginationRowModel&&t.options.getPaginationRowModel&&(t._getPaginationRowModel=t.options.getPaginationRowModel(t)),t.options.manualPagination||!t._getPaginationRowModel?t.getPrePaginationRowModel():t._getPaginationRowModel()),t.getPageCount=()=>{var i;return(i=t.options.pageCount)!=null?i:Math.ceil(t.getRowCount()/t.getState().pagination.pageSize)},t.getRowCount=()=>{var i;return(i=t.options.rowCount)!=null?i:t.getPrePaginationRowModel().rows.length}}},nI=()=>({top:[],bottom:[]}),Pot={getInitialState:t=>({rowPinning:nI(),...t}),getDefaultOptions:t=>({onRowPinningChange:Rl("rowPinning",t)}),createRow:(t,e)=>{t.pin=(n,i,r)=>{const a=i?t.getLeafRows().map(l=>{let{id:c}=l;return c}):[],o=r?t.getParentRows().map(l=>{let{id:c}=l;return c}):[],s=new Set([...o,t.id,...a]);e.setRowPinning(l=>{var c,d;if(n==="bottom"){var f,h;return{top:((f=l?.top)!=null?f:[]).filter(v=>!(s!=null&&s.has(v))),bottom:[...((h=l?.bottom)!=null?h:[]).filter(v=>!(s!=null&&s.has(v))),...Array.from(s)]}}if(n==="top"){var m,g;return{top:[...((m=l?.top)!=null?m:[]).filter(v=>!(s!=null&&s.has(v))),...Array.from(s)],bottom:((g=l?.bottom)!=null?g:[]).filter(v=>!(s!=null&&s.has(v)))}}return{top:((c=l?.top)!=null?c:[]).filter(v=>!(s!=null&&s.has(v))),bottom:((d=l?.bottom)!=null?d:[]).filter(v=>!(s!=null&&s.has(v)))}})},t.getCanPin=()=>{var n;const{enableRowPinning:i,enablePinning:r}=e.options;return typeof i=="function"?i(t):(n=i??r)!=null?n:!0},t.getIsPinned=()=>{const n=[t.id],{top:i,bottom:r}=e.getState().rowPinning,a=n.some(s=>i?.includes(s)),o=n.some(s=>r?.includes(s));return a?"top":o?"bottom":!1},t.getPinnedIndex=()=>{var n,i;const r=t.getIsPinned();if(!r)return-1;const a=(n=r==="top"?e.getTopRows():e.getBottomRows())==null?void 0:n.map(o=>{let{id:s}=o;return s});return(i=a?.indexOf(t.id))!=null?i:-1}},createTable:t=>{t.setRowPinning=e=>t.options.onRowPinningChange==null?void 0:t.options.onRowPinningChange(e),t.resetRowPinning=e=>{var n,i;return t.setRowPinning(e?nI():(n=(i=t.initialState)==null?void 0:i.rowPinning)!=null?n:nI())},t.getIsSomeRowsPinned=e=>{var n;const i=t.getState().rowPinning;if(!e){var r,a;return!!((r=i.top)!=null&&r.length||(a=i.bottom)!=null&&a.length)}return!!((n=i[e])!=null&&n.length)},t._getPinnedRows=(e,n,i)=>{var r;return((r=t.options.keepPinnedRows)==null||r?(n??[]).map(o=>{const s=t.getRow(o,!0);return s.getIsAllParentsExpanded()?s:null}):(n??[]).map(o=>e.find(s=>s.id===o))).filter(Boolean).map(o=>({...o,position:i}))},t.getTopRows=Tn(()=>[t.getRowModel().rows,t.getState().rowPinning.top],(e,n)=>t._getPinnedRows(e,n,"top"),In(t.options,"debugRows")),t.getBottomRows=Tn(()=>[t.getRowModel().rows,t.getState().rowPinning.bottom],(e,n)=>t._getPinnedRows(e,n,"bottom"),In(t.options,"debugRows")),t.getCenterRows=Tn(()=>[t.getRowModel().rows,t.getState().rowPinning.top,t.getState().rowPinning.bottom],(e,n,i)=>{const r=new Set([...n??[],...i??[]]);return e.filter(a=>!r.has(a.id))},In(t.options,"debugRows"))}},Lot={getInitialState:t=>({rowSelection:{},...t}),getDefaultOptions:t=>({onRowSelectionChange:Rl("rowSelection",t),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:t=>{t.setRowSelection=e=>t.options.onRowSelectionChange==null?void 0:t.options.onRowSelectionChange(e),t.resetRowSelection=e=>{var n;return t.setRowSelection(e?{}:(n=t.initialState.rowSelection)!=null?n:{})},t.toggleAllRowsSelected=e=>{t.setRowSelection(n=>{e=typeof e<"u"?e:!t.getIsAllRowsSelected();const i={...n},r=t.getPreGroupedRowModel().flatRows;return e?r.forEach(a=>{a.getCanSelect()&&(i[a.id]=!0)}):r.forEach(a=>{delete i[a.id]}),i})},t.toggleAllPageRowsSelected=e=>t.setRowSelection(n=>{const i=typeof e<"u"?e:!t.getIsAllPageRowsSelected(),r={...n};return t.getRowModel().rows.forEach(a=>{vR(r,a.id,i,!0,t)}),r}),t.getPreSelectedRowModel=()=>t.getCoreRowModel(),t.getSelectedRowModel=Tn(()=>[t.getState().rowSelection,t.getCoreRowModel()],(e,n)=>Object.keys(e).length?iI(t,n):{rows:[],flatRows:[],rowsById:{}},In(t.options,"debugTable")),t.getFilteredSelectedRowModel=Tn(()=>[t.getState().rowSelection,t.getFilteredRowModel()],(e,n)=>Object.keys(e).length?iI(t,n):{rows:[],flatRows:[],rowsById:{}},In(t.options,"debugTable")),t.getGroupedSelectedRowModel=Tn(()=>[t.getState().rowSelection,t.getSortedRowModel()],(e,n)=>Object.keys(e).length?iI(t,n):{rows:[],flatRows:[],rowsById:{}},In(t.options,"debugTable")),t.getIsAllRowsSelected=()=>{const e=t.getFilteredRowModel().flatRows,{rowSelection:n}=t.getState();let i=!!(e.length&&Object.keys(n).length);return i&&e.some(r=>r.getCanSelect()&&!n[r.id])&&(i=!1),i},t.getIsAllPageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows.filter(r=>r.getCanSelect()),{rowSelection:n}=t.getState();let i=!!e.length;return i&&e.some(r=>!n[r.id])&&(i=!1),i},t.getIsSomeRowsSelected=()=>{var e;const n=Object.keys((e=t.getState().rowSelection)!=null?e:{}).length;return n>0&&n<t.getFilteredRowModel().flatRows.length},t.getIsSomePageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows;return t.getIsAllPageRowsSelected()?!1:e.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},t.getToggleAllRowsSelectedHandler=()=>e=>{t.toggleAllRowsSelected(e.target.checked)},t.getToggleAllPageRowsSelectedHandler=()=>e=>{t.toggleAllPageRowsSelected(e.target.checked)}},createRow:(t,e)=>{t.toggleSelected=(n,i)=>{const r=t.getIsSelected();e.setRowSelection(a=>{var o;if(n=typeof n<"u"?n:!r,t.getCanSelect()&&r===n)return a;const s={...a};return vR(s,t.id,n,(o=i?.selectChildren)!=null?o:!0,e),s})},t.getIsSelected=()=>{const{rowSelection:n}=e.getState();return bU(t,n)},t.getIsSomeSelected=()=>{const{rowSelection:n}=e.getState();return yR(t,n)==="some"},t.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=e.getState();return yR(t,n)==="all"},t.getCanSelect=()=>{var n;return typeof e.options.enableRowSelection=="function"?e.options.enableRowSelection(t):(n=e.options.enableRowSelection)!=null?n:!0},t.getCanSelectSubRows=()=>{var n;return typeof e.options.enableSubRowSelection=="function"?e.options.enableSubRowSelection(t):(n=e.options.enableSubRowSelection)!=null?n:!0},t.getCanMultiSelect=()=>{var n;return typeof e.options.enableMultiRowSelection=="function"?e.options.enableMultiRowSelection(t):(n=e.options.enableMultiRowSelection)!=null?n:!0},t.getToggleSelectedHandler=()=>{const n=t.getCanSelect();return i=>{var r;n&&t.toggleSelected((r=i.target)==null?void 0:r.checked)}}}},vR=(t,e,n,i,r)=>{var a;const o=r.getRow(e,!0);n?(o.getCanMultiSelect()||Object.keys(t).forEach(s=>delete t[s]),o.getCanSelect()&&(t[e]=!0)):delete t[e],i&&(a=o.subRows)!=null&&a.length&&o.getCanSelectSubRows()&&o.subRows.forEach(s=>vR(t,s.id,n,i,r))};function iI(t,e){const n=t.getState().rowSelection,i=[],r={},a=function(o,s){return o.map(l=>{var c;const d=bU(l,n);if(d&&(i.push(l),r[l.id]=l),(c=l.subRows)!=null&&c.length&&(l={...l,subRows:a(l.subRows)}),d)return l}).filter(Boolean)};return{rows:a(e.rows),flatRows:i,rowsById:r}}function bU(t,e){var n;return(n=e[t.id])!=null?n:!1}function yR(t,e,n){var i;if(!((i=t.subRows)!=null&&i.length))return!1;let r=!0,a=!1;return t.subRows.forEach(o=>{if(!(a&&!r)&&(o.getCanSelect()&&(bU(o,e)?a=!0:r=!1),o.subRows&&o.subRows.length)){const s=yR(o,e);s==="all"?a=!0:(s==="some"&&(a=!0),r=!1)}}),r?"all":a?"some":!1}const kR=/([0-9]+)/gm,Uot=(t,e,n)=>uge(fm(t.getValue(n)).toLowerCase(),fm(e.getValue(n)).toLowerCase()),Mot=(t,e,n)=>uge(fm(t.getValue(n)),fm(e.getValue(n))),$ot=(t,e,n)=>SU(fm(t.getValue(n)).toLowerCase(),fm(e.getValue(n)).toLowerCase()),jot=(t,e,n)=>SU(fm(t.getValue(n)),fm(e.getValue(n))),Qot=(t,e,n)=>{const i=t.getValue(n),r=e.getValue(n);return i>r?1:i<r?-1:0},Hot=(t,e,n)=>SU(t.getValue(n),e.getValue(n));function SU(t,e){return t===e?0:t>e?1:-1}function fm(t){return typeof t=="number"?isNaN(t)||t===1/0||t===-1/0?"":String(t):typeof t=="string"?t:""}function uge(t,e){const n=t.split(kR).filter(Boolean),i=e.split(kR).filter(Boolean);for(;n.length&&i.length;){const r=n.shift(),a=i.shift(),o=parseInt(r,10),s=parseInt(a,10),l=[o,s].sort();if(isNaN(l[0])){if(r>a)return 1;if(a>r)return-1;continue}if(isNaN(l[1]))return isNaN(o)?-1:1;if(o>s)return 1;if(s>o)return-1}return n.length-i.length}const Iy={alphanumeric:Uot,alphanumericCaseSensitive:Mot,text:$ot,textCaseSensitive:jot,datetime:Qot,basic:Hot},zot={getInitialState:t=>({sorting:[],...t}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:t=>({onSortingChange:Rl("sorting",t),isMultiSortEvent:e=>e.shiftKey}),createColumn:(t,e)=>{t.getAutoSortingFn=()=>{const n=e.getFilteredRowModel().flatRows.slice(10);let i=!1;for(const r of n){const a=r?.getValue(t.id);if(Object.prototype.toString.call(a)==="[object Date]")return Iy.datetime;if(typeof a=="string"&&(i=!0,a.split(kR).length>1))return Iy.alphanumeric}return i?Iy.text:Iy.basic},t.getAutoSortDir=()=>{const n=e.getFilteredRowModel().flatRows[0];return typeof n?.getValue(t.id)=="string"?"asc":"desc"},t.getSortingFn=()=>{var n,i;if(!t)throw new Error;return VC(t.columnDef.sortingFn)?t.columnDef.sortingFn:t.columnDef.sortingFn==="auto"?t.getAutoSortingFn():(n=(i=e.options.sortingFns)==null?void 0:i[t.columnDef.sortingFn])!=null?n:Iy[t.columnDef.sortingFn]},t.toggleSorting=(n,i)=>{const r=t.getNextSortingOrder(),a=typeof n<"u"&&n!==null;e.setSorting(o=>{const s=o?.find(m=>m.id===t.id),l=o?.findIndex(m=>m.id===t.id);let c=[],d,f=a?n:r==="desc";if(o!=null&&o.length&&t.getCanMultiSort()&&i?s?d="toggle":d="add":o!=null&&o.length&&l!==o.length-1?d="replace":s?d="toggle":d="replace",d==="toggle"&&(a||r||(d="remove")),d==="add"){var h;c=[...o,{id:t.id,desc:f}],c.splice(0,c.length-((h=e.options.maxMultiSortColCount)!=null?h:Number.MAX_SAFE_INTEGER))}else d==="toggle"?c=o.map(m=>m.id===t.id?{...m,desc:f}:m):d==="remove"?c=o.filter(m=>m.id!==t.id):c=[{id:t.id,desc:f}];return c})},t.getFirstSortDir=()=>{var n,i;return((n=(i=t.columnDef.sortDescFirst)!=null?i:e.options.sortDescFirst)!=null?n:t.getAutoSortDir()==="desc")?"desc":"asc"},t.getNextSortingOrder=n=>{var i,r;const a=t.getFirstSortDir(),o=t.getIsSorted();return o?o!==a&&((i=e.options.enableSortingRemoval)==null||i)&&(!(n&&(r=e.options.enableMultiRemove)!=null)||r)?!1:o==="desc"?"asc":"desc":a},t.getCanSort=()=>{var n,i;return((n=t.columnDef.enableSorting)!=null?n:!0)&&((i=e.options.enableSorting)!=null?i:!0)&&!!t.accessorFn},t.getCanMultiSort=()=>{var n,i;return(n=(i=t.columnDef.enableMultiSort)!=null?i:e.options.enableMultiSort)!=null?n:!!t.accessorFn},t.getIsSorted=()=>{var n;const i=(n=e.getState().sorting)==null?void 0:n.find(r=>r.id===t.id);return i?i.desc?"desc":"asc":!1},t.getSortIndex=()=>{var n,i;return(n=(i=e.getState().sorting)==null?void 0:i.findIndex(r=>r.id===t.id))!=null?n:-1},t.clearSorting=()=>{e.setSorting(n=>n!=null&&n.length?n.filter(i=>i.id!==t.id):[])},t.getToggleSortingHandler=()=>{const n=t.getCanSort();return i=>{n&&(i.persist==null||i.persist(),t.toggleSorting==null||t.toggleSorting(void 0,t.getCanMultiSort()?e.options.isMultiSortEvent==null?void 0:e.options.isMultiSortEvent(i):!1))}}},createTable:t=>{t.setSorting=e=>t.options.onSortingChange==null?void 0:t.options.onSortingChange(e),t.resetSorting=e=>{var n,i;t.setSorting(e?[]:(n=(i=t.initialState)==null?void 0:i.sorting)!=null?n:[])},t.getPreSortedRowModel=()=>t.getGroupedRowModel(),t.getSortedRowModel=()=>(!t._getSortedRowModel&&t.options.getSortedRowModel&&(t._getSortedRowModel=t.options.getSortedRowModel(t)),t.options.manualSorting||!t._getSortedRowModel?t.getPreSortedRowModel():t._getSortedRowModel())}},Vot=[fot,Dot,Fot,_ot,Aot,mot,Tot,Iot,zot,Not,Oot,Rot,Pot,Lot,Eot];function Got(t){var e,n;const i=[...Vot,...(e=t._features)!=null?e:[]];let r={_features:i};const a=r._features.reduce((h,m)=>Object.assign(h,m.getDefaultOptions==null?void 0:m.getDefaultOptions(r)),{}),o=h=>r.options.mergeOptions?r.options.mergeOptions(a,h):{...a,...h};let l={...{},...(n=t.initialState)!=null?n:{}};r._features.forEach(h=>{var m;l=(m=h.getInitialState==null?void 0:h.getInitialState(l))!=null?m:l});const c=[];let d=!1;const f={_features:i,options:{...a,...t},initialState:l,_queue:h=>{c.push(h),d||(d=!0,Promise.resolve().then(()=>{for(;c.length;)c.shift()();d=!1}).catch(m=>setTimeout(()=>{throw m})))},reset:()=>{r.setState(r.initialState)},setOptions:h=>{const m=XA(h,r.options);r.options=o(m)},getState:()=>r.options.state,setState:h=>{r.options.onStateChange==null||r.options.onStateChange(h)},_getRowId:(h,m,g)=>{var v;return(v=r.options.getRowId==null?void 0:r.options.getRowId(h,m,g))!=null?v:`${g?[g.id,m].join("."):m}`},getCoreRowModel:()=>(r._getCoreRowModel||(r._getCoreRowModel=r.options.getCoreRowModel(r)),r._getCoreRowModel()),getRowModel:()=>r.getPaginationRowModel(),getRow:(h,m)=>{let g=(m?r.getPrePaginationRowModel():r.getRowModel()).rowsById[h];if(!g&&(g=r.getCoreRowModel().rowsById[h],!g))throw new Error;return g},_getDefaultColumnDef:Tn(()=>[r.options.defaultColumn],h=>{var m;return h=(m=h)!=null?m:{},{header:g=>{const v=g.header.column.columnDef;return v.accessorKey?v.accessorKey:v.accessorFn?v.id:null},cell:g=>{var v,b;return(v=(b=g.renderValue())==null||b.toString==null?void 0:b.toString())!=null?v:null},...r._features.reduce((g,v)=>Object.assign(g,v.getDefaultColumnDef==null?void 0:v.getDefaultColumnDef()),{}),...h}},In(t,"debugColumns")),_getColumnDefs:()=>r.options.columns,getAllColumns:Tn(()=>[r._getColumnDefs()],h=>{const m=function(g,v,b){return b===void 0&&(b=0),g.map(k=>{const w=uot(r,k,b,v),x=k;return w.columns=x.columns?m(x.columns,w,b+1):[],w})};return m(h)},In(t,"debugColumns")),getAllFlatColumns:Tn(()=>[r.getAllColumns()],h=>h.flatMap(m=>m.getFlatColumns()),In(t,"debugColumns")),_getAllFlatColumnsById:Tn(()=>[r.getAllFlatColumns()],h=>h.reduce((m,g)=>(m[g.id]=g,m),{}),In(t,"debugColumns")),getAllLeafColumns:Tn(()=>[r.getAllColumns(),r._getOrderColumnsFn()],(h,m)=>{let g=h.flatMap(v=>v.getLeafColumns());return m(g)},In(t,"debugColumns")),getColumn:h=>r._getAllFlatColumnsById()[h]};Object.assign(r,f);for(let h=0;h<r._features.length;h++){const m=r._features[h];m==null||m.createTable==null||m.createTable(r)}return r}function fge(){return t=>Tn(()=>[t.options.data],e=>{const n={rows:[],flatRows:[],rowsById:{}},i=function(r,a,o){a===void 0&&(a=0);const s=[];for(let c=0;c<r.length;c++){const d=yU(t,t._getRowId(r[c],c,o),r[c],c,a,void 0,o?.id);if(n.flatRows.push(d),n.rowsById[d.id]=d,s.push(d),t.options.getSubRows){var l;d.originalSubRows=t.options.getSubRows(r[c],c),(l=d.originalSubRows)!=null&&l.length&&(d.subRows=i(d.originalSubRows,a+1,d))}}return s};return n.rows=i(e),n},In(t.options,"debugTable","getRowModel",()=>t._autoResetPageIndex()))}function $gt(){return t=>Tn(()=>[t.getState().expanded,t.getPreExpandedRowModel(),t.options.paginateExpandedRows],(e,n,i)=>!n.rows.length||e!==!0&&!Object.keys(e??{}).length||!i?n:Age(n),In(t.options,"debugTable"))}function Age(t){const e=[],n=i=>{var r;e.push(i),(r=i.subRows)!=null&&r.length&&i.getIsExpanded()&&i.subRows.forEach(n)};return t.rows.forEach(n),{rows:e,flatRows:t.flatRows,rowsById:t.rowsById}}function qot(t,e,n){return n.options.filterFromLeafRows?Kot(t,e,n):Wot(t,e,n)}function Kot(t,e,n){var i;const r=[],a={},o=(i=n.options.maxLeafRowFilterDepth)!=null?i:100,s=function(l,c){c===void 0&&(c=0);const d=[];for(let h=0;h<l.length;h++){var f;let m=l[h];const g=yU(n,m.id,m.original,m.index,m.depth,void 0,m.parentId);if(g.columnFilters=m.columnFilters,(f=m.subRows)!=null&&f.length&&c<o){if(g.subRows=s(m.subRows,c+1),m=g,e(m)&&!g.subRows.length){d.push(m),a[m.id]=m,r.push(m);continue}if(e(m)||g.subRows.length){d.push(m),a[m.id]=m,r.push(m);continue}}else m=g,e(m)&&(d.push(m),a[m.id]=m,r.push(m))}return d};return{rows:s(t),flatRows:r,rowsById:a}}function Wot(t,e,n){var i;const r=[],a={},o=(i=n.options.maxLeafRowFilterDepth)!=null?i:100,s=function(l,c){c===void 0&&(c=0);const d=[];for(let h=0;h<l.length;h++){let m=l[h];if(e(m)){var f;if((f=m.subRows)!=null&&f.length&&c<o){const v=yU(n,m.id,m.original,m.index,m.depth,void 0,m.parentId);v.subRows=s(m.subRows,c+1),m=v}d.push(m),r.push(m),a[m.id]=m}}return d};return{rows:s(t),flatRows:r,rowsById:a}}function jgt(){return t=>Tn(()=>[t.getPreFilteredRowModel(),t.getState().columnFilters,t.getState().globalFilter],(e,n,i)=>{if(!e.rows.length||!(n!=null&&n.length)&&!i){for(let h=0;h<e.flatRows.length;h++)e.flatRows[h].columnFilters={},e.flatRows[h].columnFiltersMeta={};return e}const r=[],a=[];(n??[]).forEach(h=>{var m;const g=t.getColumn(h.id);if(!g)return;const v=g.getFilterFn();v&&r.push({id:h.id,filterFn:v,resolvedValue:(m=v.resolveFilterValue==null?void 0:v.resolveFilterValue(h.value))!=null?m:h.value})});const o=(n??[]).map(h=>h.id),s=t.getGlobalFilterFn(),l=t.getAllLeafColumns().filter(h=>h.getCanGlobalFilter());i&&s&&l.length&&(o.push("__global__"),l.forEach(h=>{var m;a.push({id:h.id,filterFn:s,resolvedValue:(m=s.resolveFilterValue==null?void 0:s.resolveFilterValue(i))!=null?m:i})}));let c,d;for(let h=0;h<e.flatRows.length;h++){const m=e.flatRows[h];if(m.columnFilters={},r.length)for(let g=0;g<r.length;g++){c=r[g];const v=c.id;m.columnFilters[v]=c.filterFn(m,v,c.resolvedValue,b=>{m.columnFiltersMeta[v]=b})}if(a.length){for(let g=0;g<a.length;g++){d=a[g];const v=d.id;if(d.filterFn(m,v,d.resolvedValue,b=>{m.columnFiltersMeta[v]=b})){m.columnFilters.__global__=!0;break}}m.columnFilters.__global__!==!0&&(m.columnFilters.__global__=!1)}}const f=h=>{for(let m=0;m<o.length;m++)if(h.columnFilters[o[m]]===!1)return!1;return!0};return qot(e.rows,f,t)},In(t.options,"debugTable","getFilteredRowModel",()=>t._autoResetPageIndex()))}function Qgt(t){return e=>Tn(()=>[e.getState().pagination,e.getPrePaginationRowModel(),e.options.paginateExpandedRows?void 0:e.getState().expanded],(n,i)=>{if(!i.rows.length)return i;const{pageSize:r,pageIndex:a}=n;let{rows:o,flatRows:s,rowsById:l}=i;const c=r*a,d=c+r;o=o.slice(c,d);let f;e.options.paginateExpandedRows?f={rows:o,flatRows:s,rowsById:l}:f=Age({rows:o,flatRows:s,rowsById:l}),f.flatRows=[];const h=m=>{f.flatRows.push(m),m.subRows.length&&m.subRows.forEach(h)};return f.rows.forEach(h),f},In(e.options,"debugTable"))}function Yot(){return t=>Tn(()=>[t.getState().sorting,t.getPreSortedRowModel()],(e,n)=>{if(!n.rows.length||!(e!=null&&e.length))return n;const i=t.getState().sorting,r=[],a=i.filter(l=>{var c;return(c=t.getColumn(l.id))==null?void 0:c.getCanSort()}),o={};a.forEach(l=>{const c=t.getColumn(l.id);c&&(o[l.id]={sortUndefined:c.columnDef.sortUndefined,invertSorting:c.columnDef.invertSorting,sortingFn:c.getSortingFn()})});const s=l=>{const c=l.map(d=>({...d}));return c.sort((d,f)=>{for(let m=0;m<a.length;m+=1){var h;const g=a[m],v=o[g.id],b=v.sortUndefined,k=(h=g?.desc)!=null?h:!1;let w=0;if(b){const x=d.getValue(g.id),F=f.getValue(g.id),_=x===void 0,T=F===void 0;if(_||T){if(b==="first")return _?-1:1;if(b==="last")return _?1:-1;w=_&&T?0:_?b:-b}}if(w===0&&(w=v.sortingFn(d,f,g.id)),w!==0)return k&&(w*=-1),v.invertSorting&&(w*=-1),w}return d.index-f.index}),c.forEach(d=>{var f;r.push(d),(f=d.subRows)!=null&&f.length&&(d.subRows=s(d.subRows))}),c};return{rows:s(n.rows),flatRows:r,rowsById:n.rowsById}},In(t.options,"debugTable","getSortedRowModel",()=>t._autoResetPageIndex()))}function l2(t,e){return t?Xot(t)?N.createElement(t,e):t:null}function Xot(t){return Zot(t)||typeof t=="function"||Jot(t)}function Zot(t){return typeof t=="function"&&(()=>{const e=Object.getPrototypeOf(t);return e.prototype&&e.prototype.isReactComponent})()}function Jot(t){return typeof t=="object"&&typeof t.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(t.$$typeof.description)}function mge(t){const e={state:{},onStateChange:()=>{},renderFallbackValue:null,...t},[n]=N.useState(()=>({current:Got(e)})),[i,r]=N.useState(()=>n.current.initialState);return n.current.setOptions(a=>({...a,...t,state:{...i,...t.state},onStateChange:o=>{r(o),t.onStateChange==null||t.onStateChange(o)}})),n.current}const hge=[Ln.Unprocessed,Ln.Other],est=({document:t,onChange:e})=>{const n="creditor"in t?t.creditor:void 0,i=!t.documentType||!hge.includes(t.documentType),r=i&&!n?.id||Ln.Unprocessed===t.documentType,{selectableBusinesses:a,refresh:o}=ale(),s=N.useMemo(()=>{if(n||!("missingInfoSuggestions"in t)||!t.missingInfoSuggestions)return;const w=t.missingInfoSuggestions.owner,x=t.missingInfoSuggestions.counterparty;if(t.missingInfoSuggestions?.isIncome==null){if(t.debtor?.id){const F=t.debtor.id;if(w?.id===F&&x)return x;if(x?.id===F&&w)return w}}else{if(t.missingInfoSuggestions.isIncome&&w)return w;if(!t.missingInfoSuggestions.isIncome&&x)return x}},[t,n]),l=!n&&!!s,c=n??s,{name:d="Missing",id:f}=c||{},{updateDocument:h,fetching:m}=_b(),g=N.useCallback(w=>{w!==void 0&&h({documentId:t.id,fields:{creditorId:w}}).then(t.onUpdate)},[t.id,h,t.onUpdate]),[v,b]=N.useState(null),k=N.useCallback(async w=>{await g(w),o(),e?.()},[g,e,o]);return y.jsxs("div",{className:"flex flex-wrap",children:[y.jsx("div",{className:"flex flex-col justify-center whitespace-normal",children:y.jsx(Eu,{inline:!0,size:12,disabled:!r,color:"red",zIndex:"auto",children:i&&(f?y.jsx(oo,{to:jn.BUSINESSES.DETAIL(f),target:"_blank",rel:"noreferrer",onClick:w=>w.stopPropagation(),className:"inline-flex items-center font-semibold",children:d}):y.jsx(yde,{options:a,value:f??null,onChange:w=>w&&g(w),search:v,onSearchChange:b,placeholder:"Choose or create a business",empty:v?y.jsx(upe,{description:v,onAdd:k}):null}))})}),l&&y.jsx(g6,{onClick:()=>g(s.id),disabled:m})]})},tst=({document:t})=>{const e="amount"in t?t.amount:void 0,n="missingInfoSuggestions"in t?t.missingInfoSuggestions?.amount:void 0,i=!e&&!!n,r=e??n,{updateDocument:a,fetching:o}=_b(),s=N.useCallback(d=>{d!==void 0&&a({documentId:t.id,fields:{amount:{raw:d.raw,currency:d.currency}}}).then(t.onUpdate)},[t.id,a,t.onUpdate]),c=Ln.Other!==t.documentType&&r?.formatted==null;return y.jsxs("div",{className:"flex flex-wrap",children:[y.jsx("div",{className:"flex flex-col justify-center",children:y.jsx(Eu,{inline:!0,size:12,disabled:!c,color:"red",zIndex:"auto",children:y.jsx("p",{className:["whitespace-nowrap",i?"bg-yellow-400":"",Number(r?.raw)>0?"text-green-700":"text-red-500"].join(" "),children:r?.formatted})})}),i&&y.jsx(g6,{onClick:()=>s(n),disabled:o})]})},nst=({document:t})=>{const e="date"in t?t.date:void 0,n=Ln.Other!==t.documentType,i=n&&!e,r=e?Ch(new Date(e),"dd/MM/yy"):"Missing Data",a=n?r:null;return y.jsx(Eu,{inline:!0,size:12,disabled:!i,color:"red",zIndex:"auto",children:y.jsx("div",{children:a})})},ist=({document:t,onChange:e})=>{const n="debtor"in t?t.debtor:void 0,i=!t.documentType||!hge.includes(t.documentType),r=i&&!n?.id||Ln.Unprocessed===t.documentType,{selectableBusinesses:a,refresh:o}=ale(),s=N.useMemo(()=>{if(n||!("missingInfoSuggestions"in t)||!t.missingInfoSuggestions)return;const w=t.missingInfoSuggestions.owner,x=t.missingInfoSuggestions.counterparty;if(t.missingInfoSuggestions?.isIncome==null){if(t.creditor?.id){const F=t.creditor.id;if(w?.id===F&&x)return x;if(x?.id===F&&w)return w}}else{if(t.missingInfoSuggestions.isIncome&&x)return x;if(!t.missingInfoSuggestions.isIncome&&w)return w}},[t,n]),l=!n&&!!s,c=n??s,{name:d="Missing",id:f}=c||{},{updateDocument:h,fetching:m}=_b(),g=N.useCallback(w=>{w!==void 0&&h({documentId:t.id,fields:{debtorId:w}}).then(t.onUpdate)},[t.id,h,t.onUpdate]),[v,b]=N.useState(null),k=N.useCallback(async w=>{await g(w),o(),e?.()},[g,e,o]);return y.jsxs("div",{className:"flex flex-wrap",children:[y.jsx("div",{className:"flex flex-col justify-center whitespace-normal",children:y.jsx(Eu,{inline:!0,size:12,disabled:!r,color:"red",zIndex:"auto",children:i&&(f?y.jsx(oo,{to:jn.BUSINESSES.DETAIL(f),target:"_blank",rel:"noreferrer",onClick:w=>w.stopPropagation(),className:"inline-flex items-center font-semibold",children:d}):y.jsx(yde,{options:a,value:f??null,onChange:w=>w&&g(w),search:v,onSearchChange:b,placeholder:"Choose or create a business",empty:v?y.jsx(upe,{description:v,onAdd:k}):null}))})}),l&&y.jsx(g6,{onClick:()=>g(s.id),disabled:m})]})},rst=({document:t})=>{let e="";if(t.description)e=t.description;else if("issuedDocumentInfo"in t&&t.issuedDocumentInfo?.originalDocument?.income){const{income:n}=t.issuedDocumentInfo.originalDocument;e=n.map(i=>i.description).join(", ")}return y.jsx("div",{className:"flex flex-col justify-center whitespace-normal",children:y.jsx("p",{children:e})})},ast=({document:{image:t,file:e}})=>{const[n,i]=N.useState(!1);return y.jsxs(y.Fragment,{children:[y.jsx("div",{className:"flex flex-wrap",children:y.jsx("div",{className:"flex flex-col justify-center",children:y.jsxs(p6,{cols:1,children:[y.jsx(gu,{disabled:!t,content:"Open Image",children:y.jsx(Eu,{inline:!0,size:12,disabled:!!t,color:"red",zIndex:"auto",children:y.jsx(jt,{variant:"ghost",size:"icon",className:"size-7.5",disabled:!t,onClick:()=>i(!!t),children:y.jsx(C1e,{className:"size-5"})})})}),y.jsx(gu,{disabled:!e,content:"Open File",children:y.jsx(Eu,{inline:!0,size:12,disabled:!!e,color:"red",zIndex:"auto",children:e?y.jsx("a",{href:typeof e=="string"?e:e.href,target:"_blank",rel:"noreferrer",children:y.jsx(jt,{variant:"ghost",size:"icon",className:"size-7.5",children:y.jsx(K$,{className:"size-5"})})}):y.jsx(jt,{variant:"ghost",size:"icon",className:"size-7.5",disabled:!0,children:y.jsx(K$,{className:"size-5"})})})})]})})}),t&&y.jsx(Ru,{classNames:{content:"overflow-y-auto drop-shadow-lg"},withCloseButton:!0,withOverlay:!1,position:"right",opened:n,onClose:()=>i(!1),size:"30%",children:y.jsx("div",{className:"m-2",children:y.jsx(Ice,{src:t.toString(),zoomLevel:3,magnifierHeight:300,magnifierWidth:300})})})]})},ost=({document:t})=>y.jsx("div",{className:"flex flex-col justify-center whitespace-normal",children:y.jsx("p",{children:t.remarks})}),sst=({document:t})=>{const e="serialNumber"in t?t.serialNumber:void 0,n="allocationNumber"in t?t.allocationNumber:void 0,r=Ln.Other!==t.documentType&&!e;return y.jsxs("div",{className:"flex flex-col align-center justify-center flex-wrap",children:[y.jsx(Eu,{inline:!0,size:12,disabled:!r,color:"red",zIndex:"auto",children:y.jsx("p",{children:e})}),n&&y.jsxs("p",{className:"text-xs",children:["(",n,")"]})]})},lst=({document:{documentType:t},isOpen:e})=>{const n=!t||t===Ln.Unprocessed,i=t??Ln.Unprocessed,r=n?"red":e?"orange":"blue";return y.jsx("div",{className:"flex flex-wrap",children:y.jsx("div",{className:"flex flex-col justify-center whitespace-normal",children:y.jsx(Eu,{inline:!0,size:12,disabled:!n&&!e,color:r,zIndex:"auto",children:y.jsx("p",{children:Fv(i)})})})})},cst=({document:t})=>{const e="vat"in t?t.vat:void 0,i=Ln.Other!==t.documentType&&e?.formatted==null;return y.jsx(Eu,{inline:!0,size:12,disabled:!i,color:"red",zIndex:"auto",children:y.jsx("div",{style:{color:Number(e?.raw)>0?"green":"red",whiteSpace:"nowrap"},children:e?.formatted})})},DN=[{id:"date",accessorKey:"date",sortingFn:t=>"date"in t.original&&t.original.date?new Date(t.original.date).getTime():0,header:({column:t})=>y.jsxs(jt,{variant:"ghost",onClick:()=>t.toggleSorting(t.getIsSorted()==="asc"),children:["Date",t.getIsSorted()&&(t.getIsSorted()==="asc"?y.jsx(au,{className:"ml-2 h-4 w-4"}):y.jsx(Oo,{className:"ml-2 h-4 w-4"}))]}),cell:({row:t})=>y.jsx(nst,{document:t.original})},{id:"amount",accessorKey:"amount.raw",header:({column:t})=>y.jsxs(jt,{variant:"ghost",onClick:()=>t.toggleSorting(t.getIsSorted()==="asc"),children:["Amount",t.getIsSorted()&&(t.getIsSorted()==="asc"?y.jsx(au,{className:"ml-2 h-4 w-4"}):y.jsx(Oo,{className:"ml-2 h-4 w-4"}))]}),cell:({row:t})=>y.jsx(tst,{document:t.original})},{id:"vat",accessorKey:"vat.raw",header:({column:t})=>y.jsxs(jt,{variant:"ghost",onClick:()=>t.toggleSorting(t.getIsSorted()==="asc"),children:["VAT",t.getIsSorted()&&(t.getIsSorted()==="asc"?y.jsx(au,{className:"ml-2 h-4 w-4"}):y.jsx(Oo,{className:"ml-2 h-4 w-4"}))]}),cell:({row:t})=>y.jsx(cst,{document:t.original})},{id:"type",accessorKey:"documentType",header:({column:t})=>y.jsxs(jt,{variant:"ghost",onClick:()=>t.toggleSorting(t.getIsSorted()==="asc"),children:["Type",t.getIsSorted()&&(t.getIsSorted()==="asc"?y.jsx(au,{className:"ml-2 h-4 w-4"}):y.jsx(Oo,{className:"ml-2 h-4 w-4"}))]}),cell:({row:t})=>y.jsx(lst,{document:t.original,isOpen:"issuedDocumentInfo"in t.original&&t.original.issuedDocumentInfo?.status==="OPEN"})},{id:"serial",accessorKey:"serialNumber",header:({column:t})=>y.jsxs(jt,{variant:"ghost",onClick:()=>t.toggleSorting(t.getIsSorted()==="asc"),children:["Serial",t.getIsSorted()&&(t.getIsSorted()==="asc"?y.jsx(au,{className:"ml-2 h-4 w-4"}):y.jsx(Oo,{className:"ml-2 h-4 w-4"}))]}),cell:({row:t})=>y.jsx(sst,{document:t.original})},{id:"description",accessorKey:"description",header:"Description",cell:({row:t})=>y.jsx(rst,{document:t.original})},{id:"remarks",accessorKey:"remarks",header:"Remarks",cell:({row:t})=>y.jsx(ost,{document:t.original})},{id:"creditor",accessorKey:"creditor.name",header:({column:t})=>y.jsxs(jt,{variant:"ghost",onClick:()=>t.toggleSorting(t.getIsSorted()==="asc"),children:["Creditor",t.getIsSorted()&&(t.getIsSorted()==="asc"?y.jsx(au,{className:"ml-2 h-4 w-4"}):y.jsx(Oo,{className:"ml-2 h-4 w-4"}))]}),cell:({row:t})=>y.jsx(est,{document:t.original,onChange:t.original.onUpdate})},{id:"debtor",accessorKey:"debtor.name",header:({column:t})=>y.jsxs(jt,{variant:"ghost",onClick:()=>t.toggleSorting(t.getIsSorted()==="asc"),children:["Debtor",t.getIsSorted()&&(t.getIsSorted()==="asc"?y.jsx(au,{className:"ml-2 h-4 w-4"}):y.jsx(Oo,{className:"ml-2 h-4 w-4"}))]}),cell:({row:t})=>y.jsx(ist,{document:t.original,onChange:t.original.onUpdate})},{id:"file",accessorKey:"file",header:({column:t})=>y.jsxs(jt,{variant:"ghost",onClick:()=>t.toggleSorting(t.getIsSorted()==="asc"),children:["files",t.getIsSorted()&&(t.getIsSorted()==="asc"?y.jsx(au,{className:"ml-2 h-4 w-4"}):y.jsx(Oo,{className:"ml-2 h-4 w-4"}))]}),cell:({row:t})=>y.jsx(ast,{document:t.original})},{id:"edit",accessorKey:"id",header:"Edit",cell:({row:t})=>y.jsxs("div",{className:"flex flex-col items-center gap-2",children:[y.jsx(OMe,{onClick:t.original.editDocument,tooltip:"Edit Document"}),"issuedDocumentInfo"in t.original&&t.original.issuedDocumentInfo?.status==="OPEN"&&y.jsxs(y.Fragment,{children:[y.jsx(EMe,{documentId:t.original.id,couldIssueCreditInvoice:t.original.documentType===Ln.Invoice||t.original.documentType===Ln.InvoiceReceipt}),y.jsx(bge,{documentId:t.original.id,tooltip:"Issue Document out of This Document"})]})]})}];function pge({className:t,...e}){return y.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:y.jsx("table",{"data-slot":"table",className:Lt("w-full caption-bottom text-sm",t),...e})})}function gge({className:t,...e}){return y.jsx("thead",{"data-slot":"table-header",className:Lt("[&_tr]:border-b",t),...e})}function vge({className:t,...e}){return y.jsx("tbody",{"data-slot":"table-body",className:Lt("[&_tr:last-child]:border-0",t),...e})}function vv({className:t,...e}){return y.jsx("tr",{"data-slot":"table-row",className:Lt("hover:bg-gray-100/50 data-[state=selected]:bg-gray-100 border-b transition-colors dark:hover:bg-gray-800/50 dark:data-[state=selected]:bg-gray-800",t),...e})}function yge({className:t,...e}){return y.jsx("th",{"data-slot":"table-head",className:Lt("text-gray-950 h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] dark:text-gray-50",t),...e})}function c2({className:t,...e}){return y.jsx("td",{"data-slot":"table-cell",className:Lt("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...e})}function dst({businessId:t,linkedDocumentIds:e,limit:n}){const[i,r]=N.useState(void 0),[{data:a,fetching:o}]=is({query:RFe,variables:{businessId:t,limit:n}}),s=N.useMemo(()=>a?.recentDocumentsByBusiness?.map(d=>{const f=Ph(ZZ,d);return f?{...f,onUpdate:()=>{},editDocument:()=>r(f.id)}:null}).filter(d=>!!d)??[],[a?.recentDocumentsByBusiness]),l=["date","amount","vat","type","serial","description","remarks","file","edit"],c=mge({data:s,columns:DN.filter(d=>d.id&&l.includes(d.id)),getCoreRowModel:fge(),state:{}});return y.jsxs(vd,{children:[y.jsx(Nu,{children:y.jsx(xu,{children:"Recent Client Documents"})}),y.jsx(yd,{children:o?y.jsx("div",{children:"Loading..."}):y.jsxs(pge,{children:[y.jsx(gge,{children:c.getHeaderGroups().map(d=>y.jsx(vv,{children:d.headers.map(f=>y.jsx(yge,{colSpan:f.colSpan,children:f.isPlaceholder?null:l2(f.column.columnDef.header,f.getContext())},f.id))},d.id))}),y.jsx(vge,{children:c.getRowModel().rows?.length?c.getRowModel().rows.map(d=>y.jsx(vv,{"data-state":d.getIsSelected()&&"selected",className:d.original.issuedDocumentInfo?.externalId&&e.includes(d.original.issuedDocumentInfo.externalId)?"bg-blue-100":"",children:d.getVisibleCells().map(f=>y.jsx(c2,{children:l2(f.column.columnDef.cell,f.getContext())},f.id))},d.id)):y.jsx(vv,{children:y.jsx(c2,{colSpan:c.options.columns.length,className:"h-24 text-center",children:"No results."})})})]})}),y.jsx(bde,{documentId:i,onDone:()=>r(void 0),onChange:()=>{}})]})}const ust=({documentsProps:t,onChange:e,limited:n=!1})=>{const[i,r]=N.useState(void 0),[a,o]=N.useState([]),s=N.useMemo(()=>t?.map(h=>{const m=Ph(ZZ,h);return{...m,editDocument:()=>r(m.id),onUpdate:e??(()=>{})}}),[t,e]),[l,c]=N.useState({}),d=["date","amount","vat","type","serial","file"],f=mge({data:s,columns:n?DN.filter(h=>h.id&&d.includes(h.id)):DN,getCoreRowModel:fge(),onSortingChange:o,getSortedRowModel:Yot(),onColumnVisibilityChange:c,state:{sorting:a,columnVisibility:l}});return y.jsxs(y.Fragment,{children:[y.jsxs(pge,{children:[y.jsx(gge,{children:f.getHeaderGroups().map(h=>y.jsx(vv,{children:h.headers.map(m=>y.jsx(yge,{colSpan:m.colSpan,children:m.isPlaceholder?null:l2(m.column.columnDef.header,m.getContext())},m.id))},h.id))}),y.jsx(vge,{children:f.getRowModel().rows?.length?f.getRowModel().rows.map(h=>y.jsx(vv,{"data-state":h.getIsSelected()&&"selected",children:h.getVisibleCells().map(m=>y.jsx(c2,{children:l2(m.column.columnDef.cell,m.getContext())},m.id))},h.id)):y.jsx(vv,{children:y.jsx(c2,{colSpan:DN.length,className:"h-24 text-center",children:"No results."})})})]}),y.jsx(bde,{documentId:i,onDone:()=>r(void 0),onChange:()=>e?.()})]})};function fst({documentType:t}){const[{data:e,fetching:n}]=is({query:PFe,variables:{documentType:t}}),i=e?.recentIssuedDocumentsByType??[];return y.jsxs(vd,{children:[y.jsx(Nu,{children:y.jsx(xu,{children:"Recent Documents of the Same Type"})}),y.jsx(yd,{children:n?y.jsx("div",{children:"Loading..."}):y.jsx(ust,{documentsProps:i})})]})}const Ast=Tce(),wY={type:Ln.Invoice,language:CI.English,currency:vr.Usd,vatType:nk.Default,date:Ch(new Date,"yyyy-MM-dd"),rounding:!1,signed:!0,income:[],payment:[]};function mst({initialFormData:t,onDone:e,chargeId:n}){const[i,r]=N.useState({...wY,...t}),[a,o]=N.useState(null),[s,l]=N.useState(!1),[c,d]=N.useState(!1),{previewDocument:f,fetching:h}=Kit(),{issueDocument:m}=Git(),[g,v]=N.useState(!1),b=N.useCallback((B,O)=>{r(P=>({...P,[B]:O}))},[]);N.useEffect(()=>{d(!0),l(!1)},[i]);const k=N.useMemo(()=>JSON.stringify(t||{}),[t]);N.useEffect(()=>{r({...wY,...t})},[k]);const w=N.useCallback(async()=>{try{const B=await f({input:i});if(!B)throw new Error("No preview data returned");o(B),l(!0),d(!1)}catch(B){console.error("Failed to generate preview:",B)}},[i,f]),x=N.useCallback(()=>{e?e(i):v(!0)},[e,i]),F=N.useCallback(async B=>{await m({input:i,chargeId:n,...B})},[i,n,m]),_=!s||h||c,T=N.useMemo(()=>i.income?.reduce((B,O)=>{const P=O.price*O.quantity,G=P*((O.vatRate||0)/100);return B+P+G},0)||0,[i.income]);return y.jsx("div",{className:"min-h-screen bg-gray-50 p-4",children:y.jsxs("div",{className:"max-w-7xl mx-auto",children:[y.jsxs("div",{className:"mb-6",children:[y.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"Generate Document"}),y.jsx("p",{className:"text-gray-600 mt-2",children:"Create and preview your accounting document before issuing"})]}),y.jsxs("div",{className:"grid lg:grid-cols-2 gap-6",children:[y.jsxs("div",{className:"space-y-6",children:[y.jsx(OXe,{formData:i,updateFormData:b}),y.jsx(vd,{children:y.jsxs(yd,{className:"pt-6",children:[y.jsxs("div",{className:"flex gap-3",children:[y.jsx(jt,{onClick:w,disabled:h||s,variant:"outline",className:"flex-1 bg-transparent",children:h?y.jsxs(y.Fragment,{children:[y.jsx(vk,{className:"w-4 h-4 mr-2 animate-spin"}),"Generating..."]}):y.jsxs(y.Fragment,{children:[y.jsx(u1e,{className:"w-4 h-4 mr-2"}),"Preview"]})}),y.jsxs(jt,{onClick:x,disabled:_,className:"flex-1",children:[y.jsx(iZ,{className:"w-4 h-4 mr-2"}),e?"Accept Changes":"Issue Document"]})]}),c&&!h&&y.jsx("p",{className:"text-sm text-amber-600 bg-amber-50 p-2 rounded mt-3",children:"Form has been modified. Click Preview to update the document before issuing."}),T>0&&y.jsx("div",{className:"mt-4 p-3 bg-blue-50 rounded-lg",children:y.jsxs("div",{className:"flex justify-between items-center font-medium text-blue-900",children:[y.jsx("span",{children:"Total Document Amount:"}),y.jsxs("span",{children:[T.toFixed(2)," ",i.currency]})]})})]})})]}),y.jsxs("div",{className:"space-y-6",children:[y.jsxs(vd,{className:"h-fit",children:[y.jsx(Nu,{children:y.jsx(xu,{children:"Document Preview"})}),y.jsx(yd,{children:y.jsx("div",{className:"border-2 border-dashed border-gray-200 rounded-lg min-h-[600px] flex items-center justify-center bg-gray-50",children:h?y.jsxs("div",{className:"text-center",children:[y.jsx(vk,{className:"w-8 h-8 animate-spin mx-auto mb-4 text-gray-400"}),y.jsx("p",{className:"text-gray-500",children:"Generating document preview..."})]}):a?y.jsx("div",{className:"w-full",children:y.jsx("div",{className:"bg-white shadow-lg rounded-lg overflow-hidden",children:y.jsx("div",{className:"aspect-[8.5/11] bg-white border",children:y.jsx("div",{className:"h-full flex items-center justify-center",children:y.jsxs("div",{className:"text-center p-6",children:[y.jsx(sot,{src:a}),!s&&y.jsx("p",{className:"text-xs text-amber-600 mt-3 bg-amber-50 px-2 py-1 rounded",children:"Preview may be outdated"})]})})})})}):y.jsxs("div",{className:"text-center",children:[y.jsx(v1e,{className:"w-16 h-16 mx-auto mb-4 text-gray-300"}),y.jsx("p",{className:"text-gray-500 mb-2",children:"No preview available"}),y.jsx("p",{className:"text-sm text-gray-400",children:"Click Preview to generate document"})]})})})]}),i.client?.id&&y.jsx(dst,{businessId:i.client?.id,linkedDocumentIds:i.linkedDocumentIds??[]}),y.jsx(fst,{documentType:i.type})]})]}),y.jsx(Jit,{isOpen:g,onClose:()=>v(!1),onIssue:F,clientName:i.client?.name,clientEmails:i.client?.emails,documentType:Ast.find(B=>B.value===i.type)?.value})]})})}function kge(t){return{address:t.originalBusiness.address??void 0,city:t.originalBusiness.city??void 0,country:t.originalBusiness.country.code,emails:t.emails,id:t.id,name:t.originalBusiness.name,phone:t.originalBusiness.phoneNumber??void 0,taxId:t.originalBusiness.governmentId??void 0,zipCode:t.originalBusiness.zipCode??void 0}}function hst(t,e){let n;t.remarks&&(n=t.remarks,e===Ln.CreditInvoice&&(n=n.replace(Fv(Ln.Receipt),Fv(Ln.CreditInvoice))));let{currency:i}=t;return e===Ln.CreditInvoice&&(i=t.income?.[0]?.currency||i),{...t,currency:i,description:t.description||void 0,remarks:n,footer:t.footer||void 0,date:t.date||void 0,dueDate:t.dueDate||void 0,discount:t.discount||void 0,rounding:t.rounding||void 0,signed:t.signed||void 0,maxPayments:t.maxPayments||void 0,client:t.client?kge(Ph(JZ,t.client)):void 0,income:t.income?.map(r=>({...r,currencyRate:r.currencyRate??void 0,itemId:r.itemId||void 0,vatRate:r.vatRate??void 0})),payment:t.payment?.map(r=>({...r,currencyRate:r.currencyRate||void 0,date:r.date||void 0,bankName:r.bankName||void 0,bankBranch:r.bankBranch||void 0,bankAccount:r.bankAccount||void 0,chequeNum:r.chequeNum||void 0,accountId:r.accountId||void 0,transactionId:r.transactionId||void 0,cardType:r.cardType||void 0,cardNum:r.cardNum||void 0,numPayments:r.numPayments||void 0,firstPayment:r.firstPayment||void 0})),linkedDocumentIds:t.linkedDocumentIds||void 0,linkedPaymentId:t.linkedPaymentId||void 0,type:e||t.type}}function bge({open:t=!1,setOpen:e,tooltip:n,chargeId:i,documentId:r,documentType:a,onDone:o,trigger:s,...l}){const[c,d]=N.useState(!1),[f,h]=N.useState("initialFormData"in l&&l.initialFormData?l.initialFormData:void 0),m=N.useMemo(()=>e?t:c,[t,c,e]),g=N.useCallback(B=>{e?e(B):d(B)},[e]),[{data:v,fetching:b,error:k},w]=is({query:MFe,pause:!i||!m,variables:{chargeId:i||""}}),[{data:x,fetching:F,error:_},T]=is({query:$Fe,pause:!r||!m,variables:{documentId:r||""}});return N.useEffect(()=>{m&&(i&&!v&&!b&&!k?w():r&&!x&&!F&&!_&&T())},[i,v,b,k,w,r,x,F,_,T,m]),N.useEffect(()=>{let B;if(v?.newDocumentDraftByCharge?B=Ph(wQ,v.newDocumentDraftByCharge):x?.newDocumentDraftByDocument&&(B=Ph(wQ,x.newDocumentDraftByDocument)),B){const O=hst(B,a);h(O)}},[v,x,a]),y.jsxs(Hf,{open:m,onOpenChange:g,children:[(!e||!!s)&&y.jsx(P2,{children:y.jsxs(Dh,{children:[y.jsx(Th,{children:s??y.jsx(jt,{className:"size-7.5",variant:"ghost",children:y.jsx(ek,{className:"size-5"})})}),y.jsx(Ih,{children:y.jsx("p",{children:n||"Issue new document"})})]})}),y.jsxs(zf,{className:"w-[90vw] sm:max-w-[95%] max-h-[90vh] overflow-y-auto",children:[y.jsx(Du,{children:y.jsx(Tu,{children:"Issue New Document"})}),b||F?y.jsx(vk,{className:"h-10 w-10 animate-spin"}):y.jsx(mst,{initialFormData:f,onDone:o?B=>{o(B),g(!1)}:void 0,chargeId:i})]})]})}const pst=()=>{const[{data:t,fetching:e,error:n},i]=is({query:YFe});N.useEffect(()=>{n&&(console.error(`Error fetching admin businesses: ${n}`),un.error("Error",{description:"Unable to fetch admin businesses"}))},[n]);const r=N.useMemo(()=>t?.allAdminBusinesses?.slice().sort((o,s)=>o.name.localeCompare(s.name))??[],[t]),a=N.useMemo(()=>r.map(o=>({value:o.id,label:o.name})),[r]);return{fetching:e,refresh:()=>i(),adminBusinesses:r,selectableAdminBusinesses:a}},Vw="sync-green-invoice-documents",gst=()=>{const[{fetching:t},e]=bs(l2e),n=N.useCallback(async i=>{const r=`Error syncing documents owned by [${i.ownerId}]`;un.loading("Syncing Documents",{id:Vw});try{const a=await e(i),o=Ss(a,r,Vw);if(o)return un.success("Success",{id:Vw,description:o.syncGreenInvoiceDocuments.length>0?G6({data:o.syncGreenInvoiceDocuments}):"No new documents found",duration:o.syncGreenInvoiceDocuments.length>0?1/0:5e3,closeButton:o.syncGreenInvoiceDocuments.length>0}),o.syncGreenInvoiceDocuments}catch(a){console.error(`${r}: ${a}`),un.error("Error",{id:Vw,description:r,duration:1e5,closeButton:!0})}},[e]);return{fetching:t,syncGreenInvoiceDocuments:n}};function vst({opened:t,close:e,setIsLoading:n}){const{selectableAdminBusinesses:i,fetching:r}=pst(),{control:a,handleSubmit:o}=u0({defaultValues:{ownerId:"6a20aa69-57ff-446e-8d6a-1e96d095e988"}}),{syncGreenInvoiceDocuments:s,fetching:l}=gst();N.useEffect(()=>{n?.(r||l)},[r,l,n]);const c=d=>{s(d),e()};return y.jsxs(yc,{opened:t,onClose:e,size:"auto",centered:!0,children:[y.jsx(yc.Title,{children:"Sync Green Invoice Documents"}),y.jsxs(yc.Body,{children:[r?y.jsx("div",{children:"Loading..."}):y.jsx("div",{}),y.jsxs("form",{onSubmit:o(c),children:[y.jsx(sd,{name:"ownerId",control:a,render:({field:d,fieldState:f})=>y.jsx(Ov,{...d,data:i,value:d.value,disabled:r,label:"Owner:",placeholder:"Scroll to see all options",maxDropdownHeight:160,searchable:!0,error:f.error?.message})}),y.jsx("div",{className:"flex justify-center mt-5 gap-3",children:y.jsx("button",{type:"submit",className:"text-white bg-indigo-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-indigo-600 rounded-sm text-lg",children:"Sync"})})]})]})]})}const yst=N.createContext(null),rI={didCatch:!1,error:null};class kst extends N.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=rI}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(...e){const{error:n}=this.state;n!==null&&(this.props.onReset?.({args:e,reason:"imperative-api"}),this.setState(rI))}componentDidCatch(e,n){this.props.onError?.(e,n)}componentDidUpdate(e,n){const{didCatch:i}=this.state,{resetKeys:r}=this.props;i&&n.error!==null&&bst(e.resetKeys,r)&&(this.props.onReset?.({next:r,prev:e.resetKeys,reason:"keys"}),this.setState(rI))}render(){const{children:e,fallbackRender:n,FallbackComponent:i,fallback:r}=this.props,{didCatch:a,error:o}=this.state;let s=e;if(a){const l={error:o,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")s=n(l);else if(i)s=N.createElement(i,l);else if(r!==void 0)s=r;else throw o}return N.createElement(yst.Provider,{value:{didCatch:a,error:o,resetErrorBoundary:this.resetErrorBoundary}},s)}}function bst(t=[],e=[]){return t.length!==e.length||t.some((n,i)=>!Object.is(n,e[i]))}const Sst="uploadDocumentsFromGoogleDrive",wst=()=>{const[{fetching:t},e]=bs(u2e),n=N.useCallback(async i=>{const r="Error uploading documents",a=`${Sst}-${i.chargeId}`;un.loading("Uploading Documents",{id:a});try{const o=await e(i),s=Ss(o,r,a,"batchUploadDocumentsFromGoogleDrive");if(s){let l=!1;const c=s.batchUploadDocumentsFromGoogleDrive.filter(d=>"message"in d?(console.error(`Error uploading document: ${d.message}`),l=!0,!1):"document"in d).map(({document:d})=>d);return un.success("Upload Successful",{id:a,description:c.length>0?G6({data:c}):"No successful document uploads",duration:c.length>0?1/0:5e3,dismissible:!0,closeButton:!0}),l&&un.error("Some files failed to upload",{duration:1e5,closeButton:!0}),c}}catch(o){console.error(`${r}: ${o}`),un.error("Error",{id:a,description:r,duration:1/0,closeButton:!0})}},[e]);return{uploading:t,uploadDocumentsFromGoogleDrive:n}};var GC="Tabs",[Nst]=nl(GC,[G2]),Sge=G2(),[xst,wU]=Nst(GC),wge=N.forwardRef((t,e)=>{const{__scopeTabs:n,value:i,onValueChange:r,defaultValue:a,orientation:o="horizontal",dir:s,activationMode:l="automatic",...c}=t,d=lb(s),[f,h]=kd({prop:i,onChange:r,defaultProp:a??"",caller:GC});return y.jsx(xst,{scope:n,baseId:so(),value:f,onValueChange:h,orientation:o,dir:d,activationMode:l,children:y.jsx(Fn.div,{dir:d,"data-orientation":o,...c,ref:e})})});wge.displayName=GC;var Nge="TabsList",xge=N.forwardRef((t,e)=>{const{__scopeTabs:n,loop:i=!0,...r}=t,a=wU(Nge,n),o=Sge(n);return y.jsx(hee,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:i,children:y.jsx(Fn.div,{role:"tablist","aria-orientation":a.orientation,...r,ref:e})})});xge.displayName=Nge;var Fge="TabsTrigger",_ge=N.forwardRef((t,e)=>{const{__scopeTabs:n,value:i,disabled:r=!1,...a}=t,o=wU(Fge,n),s=Sge(n),l=Bge(o.baseId,i),c=Dge(o.baseId,i),d=i===o.value;return y.jsx(pee,{asChild:!0,...s,focusable:!r,active:d,children:y.jsx(Fn.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":c,"data-state":d?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:l,...a,ref:e,onMouseDown:Ht(t.onMouseDown,f=>{!r&&f.button===0&&f.ctrlKey===!1?o.onValueChange(i):f.preventDefault()}),onKeyDown:Ht(t.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&o.onValueChange(i)}),onFocus:Ht(t.onFocus,()=>{const f=o.activationMode!=="manual";!d&&!r&&f&&o.onValueChange(i)})})})});_ge.displayName=Fge;var Cge="TabsContent",Ege=N.forwardRef((t,e)=>{const{__scopeTabs:n,value:i,forceMount:r,children:a,...o}=t,s=wU(Cge,n),l=Bge(s.baseId,i),c=Dge(s.baseId,i),d=i===s.value,f=N.useRef(d);return N.useEffect(()=>{const h=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(h)},[]),y.jsx(co,{present:r||d,children:({present:h})=>y.jsx(Fn.div,{"data-state":d?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":l,hidden:!h,id:c,tabIndex:0,...o,ref:e,style:{...t.style,animationDuration:f.current?"0s":void 0},children:h&&a})})});Ege.displayName=Cge;function Bge(t,e){return`${t}-trigger-${e}`}function Dge(t,e){return`${t}-content-${e}`}var Fst=wge,_st=xge,Cst=_ge,Est=Ege;function Bst({className:t,...e}){return y.jsx(Fst,{"data-slot":"tabs",className:Lt("flex flex-col gap-2",t),...e})}function Dst({className:t,...e}){return y.jsx(_st,{"data-slot":"tabs-list",className:Lt("bg-gray-100 text-gray-500 inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px] dark:bg-gray-800 dark:text-gray-400",t),...e})}function NY({className:t,...e}){return y.jsx(Cst,{"data-slot":"tabs-trigger",className:Lt("data-[state=active]:bg-white dark:data-[state=active]:text-gray-950 focus-visible:border-gray-950 focus-visible:ring-gray-950/50 focus-visible:outline-ring dark:data-[state=active]:border-gray-200 dark:data-[state=active]:bg-gray-200/30 text-gray-950 dark:text-gray-500 inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-gray-200 border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 dark:data-[state=active]:bg-gray-950 dark:dark:data-[state=active]:text-gray-50 dark:focus-visible:border-gray-300 dark:focus-visible:ring-gray-300/50 dark:dark:data-[state=active]:border-gray-800 dark:dark:data-[state=active]:bg-gray-800/30 dark:text-gray-50 dark:dark:text-gray-400 dark:border-gray-800",t),...e})}function xY({className:t,...e}){return y.jsx(Est,{"data-slot":"tabs-content",className:Lt("flex-1 outline-none",t),...e})}const Tst=10*1024*1024,Ist=tU(File).refine(t=>["application/pdf","image/png","image/jpeg","image/jpg","image/svg+xml","image/gif"].includes(t.type),{message:"Invalid document file type"}).refine(t=>t.size<=Tst,{message:"File size should not exceed 5MB"}),Ost=n1({googleDriveUrl:ao().url({message:"Invalid url"}).includes("drive.google.com",{message:'Invalid url: origin must be "drive.google.com"'}).includes("/folders/",{message:"Invalid url: is this a folder link?"}).optional(),documents:hd(Ist).optional(),method:m0(["local-files","google-drive"]),isSensitive:Jb().optional()}).superRefine((t,e)=>{t.method==="local-files"&&(t.documents===void 0||t.documents.length===0)&&e.addIssue({code:ZO.custom,message:"At least one document is required"}),t.method==="google-drive"&&t.googleDriveUrl===void 0&&e.addIssue({code:ZO.custom,message:"The Google Drive URL is required"})});function Hgt({open:t,onOpenChange:e,chargeId:n,onChange:i}){const[r,a]=N.useState("local-files"),{uploading:o,uploadDocumentsFromGoogleDrive:s}=wst(),{uploading:l,uploadMultipleDocuments:c}=PXe(),d=u0({resolver:RC(Ost),defaultValues:{method:"local-files",isSensitive:!1}}),f=g=>{d.setValue("method",g),g==="google-drive"?(d.clearErrors("documents"),d.setValue("documents",void 0)):(d.clearErrors("googleDriveUrl"),d.setValue("googleDriveUrl",void 0)),a(g)},h=N.useCallback(async g=>{let v=Promise.resolve();switch(g.method){case"local-files":g.documents?v=c({documents:g.documents,chargeId:n,isSensitive:g.isSensitive}):d.setError("documents",{message:"At least one document is required"});break;case"google-drive":g.googleDriveUrl?v=s({sharedFolderUrl:g.googleDriveUrl,chargeId:n,isSensitive:g.isSensitive}):d.setError("googleDriveUrl",{message:"The Google Drive URL is required"});break}try{await v,i?.(),e(!1)}catch(b){d.setError("root",{message:b instanceof Error?b.message:"Failed to upload documents"})}},[n,d,i,e,s,c]),m=N.useMemo(()=>o||l,[o,l]);return y.jsx(Hf,{open:t,onOpenChange:e,children:y.jsx(zf,{onClick:g=>g.stopPropagation(),className:"overflow-scroll max-h-screen",children:y.jsxs(kst,{fallback:y.jsx("div",{children:"Error uploading files"}),children:[y.jsx(Du,{className:"flex flex-row items-center justify-between",children:y.jsx(Tu,{children:"Upload Documents"})}),y.jsx(Bb,{...d,children:y.jsxs("form",{onSubmit:d.handleSubmit(h),children:[y.jsxs(Bst,{value:r,onValueChange:g=>f(g),className:"my-4",children:[y.jsxs(Dst,{className:"grid w-full grid-cols-2",children:[y.jsx(NY,{disabled:m,value:"local-files",children:"Local Files"}),y.jsx(NY,{disabled:m,value:"google-drive",children:"Google Drive"})]}),y.jsx(xY,{value:"local-files",children:y.jsxs(vd,{children:[y.jsxs(Nu,{children:[y.jsx(xu,{children:"Local Files"}),y.jsx(bI,{children:"Upload documents from your computer"})]}),y.jsx(yd,{className:"space-y-2",children:y.jsx(ti,{control:d.control,name:"documents",render:({field:{value:g,onChange:v,...b}})=>y.jsxs(ni,{children:[y.jsx(Ri,{children:"Files"}),y.jsx(vi,{children:y.jsx(Pn,{...b,required:!0,type:"file",multiple:!0,accept:".jpg, .jpeg, .gif, .png, .pdf",onChange:k=>{v(k.target.files?Object.values(k.target.files):null)}})}),y.jsx(oi,{})]})})})]})}),y.jsx(xY,{value:"google-drive",children:y.jsxs(vd,{children:[y.jsxs(Nu,{children:[y.jsx(xu,{children:"Google Shared Folder"}),y.jsx(bI,{children:"Upload documents from Google Drive shared folder"})]}),y.jsx(yd,{className:"space-y-2",children:y.jsx(ti,{control:d.control,name:"googleDriveUrl",render:({field:g})=>y.jsxs(ni,{children:[y.jsx(Ri,{children:"URL"}),y.jsx(vi,{children:y.jsx(Pn,{...g,required:!0,placeholder:"Folder URL"})}),y.jsx(oi,{})]})})})]})})]}),y.jsx(oi,{}),y.jsx(Zh,{children:y.jsxs("div",{className:"flex w-full flex-row justify-between items-center",children:[y.jsx(ti,{control:d.control,name:"isSensitive",render:({field:{value:g,onChange:v,...b}})=>y.jsx(e_,{delayDuration:0,children:y.jsxs(Dh,{children:[y.jsx(Th,{asChild:!0,children:y.jsxs(ni,{className:"flex flex-row gap-2 items-center",children:[y.jsx(vi,{children:y.jsx(tR,{...b,checked:g,onCheckedChange:k=>v(!!k),className:"mt-2"})}),y.jsx(Ri,{children:"Is sensitive"})]})}),y.jsx(Ih,{side:"right",children:y.jsxs("div",{className:"flex flex-col items-center",children:[y.jsx("p",{children:"Sensitive content will not be processed"}),y.jsx("p",{children:"by OCR to protect confidential data"})]})})]})})}),y.jsx(jt,{disabled:m,type:"submit",children:"Upload"})]})})]})})]})})})}const Tge=({className:t,...e})=>y.jsx("nav",{role:"navigation","aria-label":"pagination",className:Lt("mx-auto flex w-full justify-center",t),...e});Tge.displayName="Pagination";const Ige=se.forwardRef(({className:t,...e},n)=>y.jsx("ul",{ref:n,className:Lt("flex flex-row items-center gap-1",t),...e}));Ige.displayName="PaginationContent";const Yy=se.forwardRef(({className:t,...e},n)=>y.jsx("li",{ref:n,className:Lt("",t),...e}));Yy.displayName="PaginationItem";const qC=({className:t,isActive:e,size:n="icon",children:i,...r})=>y.jsx(jt,{"aria-current":e?"page":void 0,variant:e?"outline":"ghost",size:n,className:t,...r,children:i});qC.displayName="PaginationLink";const Oge=({className:t,...e})=>y.jsx(qC,{"aria-label":"Go to previous page",size:"default",className:Lt("gap-1 pl-2.5",t),...e,children:y.jsx(VJe,{className:"h-4 w-4"})});Oge.displayName="PaginationPrevious";const Rge=({className:t,...e})=>y.jsx(qC,{"aria-label":"Go to next page",size:"default",className:Lt("gap-1 pr-2.5",t),...e,children:y.jsx(qJe,{className:"h-4 w-4"})});Rge.displayName="PaginationNext";const Pge=({className:t,...e})=>y.jsxs("span",{"aria-hidden":!0,className:Lt("flex h-9 w-9 items-center justify-center",t),...e,children:[y.jsx(WJe,{className:"h-4 w-4"}),y.jsx("span",{className:"sr-only",children:"More pages"})]});Pge.displayName="PaginationEllipsis";const Rst=(t,e)=>{const n=t-1;if(n<=0)return[];const i=[];return i.push(0),e>2&&i.push("..."),e>1&&i.push(e-1),e>0&&e<n&&i.push(e),e<n-1&&i.push(e+1),e<n-2&&i.push("..."),i.push(n),i},Pst=({onChange:t,totalPages:e,currentPageIndex:n,...i})=>{const r=Rst(e,n);return r.length?y.jsx(Tge,{...i,children:y.jsxs(Ige,{children:[y.jsx(Yy,{children:y.jsx(Oge,{disabled:n<1,onClick:()=>t(n-1)})}),r.map((a,o)=>{if(a==="...")return y.jsx(Yy,{children:y.jsx(Pge,{})},`ellipsis-${o}`);const s=a===n;return y.jsx(Yy,{children:y.jsx(qC,{onClick:()=>t(a),isActive:s,children:a+1})},`page-${a}`)}),y.jsx(Yy,{children:y.jsx(Rge,{disabled:n>=e-1,onClick:()=>t(n+1)})})]})}):null};Pst.displayName="Pagination";const Lst=({cols:t,spacing:e,children:n})=>y.jsx(p6,{cols:t,spacing:e,breakpoints:[{maxWidth:980,cols:3,spacing:"md"},{maxWidth:900,cols:2,spacing:"sm"},{maxWidth:755,cols:2,spacing:"sm"},{maxWidth:600,cols:1,spacing:"sm"}],children:n}),NU=N.createContext({userContext:null,setUserContext:()=>{}});function Ust({children:t}){const{authService:e}=N.useContext(t_),[n,i]=N.useState(null),[r,a]=N.useState(null),[o,s]=N.useState(null),[{data:l,fetching:c},d]=is({query:A2e,variables:{},pause:!0});return N.useEffect(()=>{const f=e.currentUser();$Te(f,r)||(a(f),d())},[r]),N.useEffect(()=>{l&&!c&&s(l.userContext)},[l,c]),N.useEffect(()=>{if(r&&o){const f=r&&o?{...r,context:o}:null;i(f)}},[o,r]),c?y.jsx(eet,{}):y.jsx(NU.Provider,{value:{userContext:n,setUserContext:i},children:t})}const Mst=N.createContext({filtersContext:null,setFiltersContext:()=>{}}),aI="mergeChargesByTransactionReference",$st=()=>{const[{fetching:t},e]=bs(GFe),[{fetching:n},i]=bs(qFe),[{fetching:r},a]=bs(KFe),o=N.useCallback(async()=>{let s="Error flagging foreign fee transactions";const l=`${aI}-fees`,c=`${aI}-merge`,d=`${aI}-debit-date`;un.loading("Flagging Fees",{id:l});try{const f=await e({}),h=Ss(f,s,l);if(!h)return;if(!h.flagForeignFeeTransactions.success){console.error(`${s} ${h.flagForeignFeeTransactions.errors?`:
|
|
248
248
|
`+h.flagForeignFeeTransactions.errors?.join(`
|
|
249
249
|
`):""}`),un.error("Error",{id:l,description:s});return}un.success("Success",{id:l,description:"Foreign fee transactions were successfully tagged"}),s="Error auto-merging charges",un.loading("Merging Charges",{id:c});const m=await i({}),g=Ss(m,s,c);if(!g)return;if(!g.mergeChargesByTransactionReference.success){console.error(`${s} ${g.mergeChargesByTransactionReference.errors?`:
|
|
250
250
|
`+g.mergeChargesByTransactionReference.errors?.join(`
|
|
@@ -287,7 +287,7 @@ const theme = ${JSON.stringify(e,null,2)};
|
|
|
287
287
|
theme.breakpoints = createBreakpoints(theme.breakpoints || {});
|
|
288
288
|
theme.transitions = createTransitions(theme.transitions || {});
|
|
289
289
|
|
|
290
|
-
export default theme;`}function XY(t){return typeof t=="number"?`${(t*100).toFixed(0)}%`:`calc((${t}) * 100%)`}const Bdt=t=>{if(!Number.isNaN(+t))return+t;const e=t.match(/\d*\.?\d+/g);if(!e)return 0;let n=0;for(let i=0;i<e.length;i+=1)n+=+e[i];return n};function Ddt(t){Object.assign(t,{alpha(e,n){const i=this||t;return i.colorSpace?`oklch(from ${e} l c h / ${typeof n=="string"?`calc(${n})`:n})`:i.vars?`rgba(${e.replace(/var\(--([^,\s)]+)(?:,[^)]+)?\)+/g,"var(--$1Channel)")} / ${typeof n=="string"?`calc(${n})`:n})`:ave(e,Bdt(n))},lighten(e,n){const i=this||t;return i.colorSpace?`color-mix(in ${i.colorSpace}, ${e}, #fff ${XY(n)})`:iE(e,n)},darken(e,n){const i=this||t;return i.colorSpace?`color-mix(in ${i.colorSpace}, ${e}, #000 ${XY(n)})`:nE(e,n)}})}function xR(t={},...e){const{breakpoints:n,mixins:i={},spacing:r,palette:a={},transitions:o={},typography:s={},shape:l,colorSpace:c,...d}=t;if(t.vars&&t.generateThemeVars===void 0)throw new Error(Kh(20));const f=UU({...a,colorSpace:c}),h=tve(t);let m=Ol(h,{mixins:vdt(h.breakpoints,i),palette:f,shadows:wdt.slice(),typography:mve(f,s),transitions:_dt(o),zIndex:{...Cdt}});return m=Ol(m,d),m=e.reduce((g,v)=>Ol(g,v),m),m.unstable_sxConfig={...h1,...d?.unstable_sxConfig},m.unstable_sx=function(v){return p1({sx:v,theme:this})},m.toRuntimeSource=hve,Ddt(m),m}function Tdt(t){let e;return t<1?e=5.11916*t**2:e=4.5*Math.log(t+1)+2,Math.round(e*10)/1e3}const Idt=[...Array(25)].map((t,e)=>{if(e===0)return"none";const n=Tdt(e);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function pve(t){return{inputPlaceholder:t==="dark"?.5:.42,inputUnderline:t==="dark"?.7:.42,switchTrackDisabled:t==="dark"?.2:.12,switchTrack:t==="dark"?.3:.38}}function gve(t){return t==="dark"?Idt:[]}function Odt(t){const{palette:e={mode:"light"},opacity:n,overlays:i,colorSpace:r,...a}=t,o=UU({...e,colorSpace:r});return{palette:o,opacity:{...pve(o.mode),...n},overlays:i||gve(o.mode),...a}}function Rdt(t){return!!t[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!t[0].match(/sxConfig$/)||t[0]==="palette"&&!!t[1]?.match(/(mode|contrastThreshold|tonalOffset)/)}const Pdt=t=>[...[...Array(25)].map((e,n)=>`--${t?`${t}-`:""}overlays-${n}`),`--${t?`${t}-`:""}palette-AppBar-darkBg`,`--${t?`${t}-`:""}palette-AppBar-darkColor`],Ldt=t=>(e,n)=>{const i=t.rootSelector||":root",r=t.colorSchemeSelector;let a=r;if(r==="class"&&(a=".%s"),r==="data"&&(a="[data-%s]"),r?.startsWith("data-")&&!r.includes("%s")&&(a=`[${r}="%s"]`),t.defaultColorScheme===e){if(e==="dark"){const o={};return Pdt(t.cssVarPrefix).forEach(s=>{o[s]=n[s],delete n[s]}),a==="media"?{[i]:n,"@media (prefers-color-scheme: dark)":{[i]:o}}:a?{[a.replace("%s",e)]:o,[`${i}, ${a.replace("%s",e)}`]:n}:{[i]:{...n,...o}}}if(a&&a!=="media")return`${i}, ${a.replace("%s",String(e))}`}else if(e){if(a==="media")return{[`@media (prefers-color-scheme: ${String(e)})`]:{[i]:n}};if(a)return a.replace("%s",String(e))}return i};function Udt(t,e){e.forEach(n=>{t[n]||(t[n]={})})}function vt(t,e,n){!t[e]&&n&&(t[e]=n)}function Zy(t){return typeof t!="string"||!t.startsWith("hsl")?t:rve(t)}function bf(t,e){`${e}Channel`in t||(t[`${e}Channel`]=Xy(Zy(t[e])))}function Mdt(t){return typeof t=="number"?`${t}px`:typeof t=="string"||typeof t=="function"||Array.isArray(t)?t:"8px"}const nu=t=>{try{return t()}catch{}},$dt=(t="mui")=>adt(t);function fI(t,e,n,i,r){if(!n)return;n=n===!0?{}:n;const a=r==="dark"?"dark":"light";if(!i){e[r]=Odt({...n,palette:{mode:a,...n?.palette},colorSpace:t});return}const{palette:o,...s}=xR({...i,palette:{mode:a,...n?.palette},colorSpace:t});return e[r]={...n,palette:o,opacity:{...pve(a),...n?.opacity},overlays:n?.overlays||gve(a)},s}function jdt(t={},...e){const{colorSchemes:n={light:!0},defaultColorScheme:i,disableCssColorScheme:r=!1,cssVarPrefix:a="mui",nativeColor:o=!1,shouldSkipGeneratingVar:s=Rdt,colorSchemeSelector:l=n.light&&n.dark?"media":void 0,rootSelector:c=":root",...d}=t,f=Object.keys(n)[0],h=i||(n.light&&f!=="light"?"light":f),m=$dt(a),{[h]:g,light:v,dark:b,...k}=n,w={...k};let x=g;if((h==="dark"&&!("dark"in n)||h==="light"&&!("light"in n))&&(x=!0),!x)throw new Error(Kh(21,h));let F;o&&(F="oklch");const _=fI(F,w,x,d,h);v&&!w.light&&fI(F,w,v,void 0,"light"),b&&!w.dark&&fI(F,w,b,void 0,"dark");let T={defaultColorScheme:h,..._,cssVarPrefix:a,colorSchemeSelector:l,rootSelector:c,getCssVar:m,colorSchemes:w,font:{...gdt(_.typography),..._.font},spacing:Mdt(d.spacing)};Object.keys(T.colorSchemes).forEach(U=>{const R=T.colorSchemes[U].palette,ee=le=>{const H=le.split("-"),te=H[1],X=H[2];return m(le,R[te][X])};R.mode==="light"&&(vt(R.common,"background","#fff"),vt(R.common,"onBackground","#000")),R.mode==="dark"&&(vt(R.common,"background","#000"),vt(R.common,"onBackground","#fff"));function K(le,H,te){if(F){let X;return le===nh&&(X=`transparent ${((1-te)*100).toFixed(0)}%`),le===ar&&(X=`#000 ${(te*100).toFixed(0)}%`),le===or&&(X=`#fff ${(te*100).toFixed(0)}%`),`color-mix(in ${F}, ${H}, ${X})`}return le(H,te)}if(Udt(R,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),R.mode==="light"){vt(R.Alert,"errorColor",K(ar,R.error.light,.6)),vt(R.Alert,"infoColor",K(ar,R.info.light,.6)),vt(R.Alert,"successColor",K(ar,R.success.light,.6)),vt(R.Alert,"warningColor",K(ar,R.warning.light,.6)),vt(R.Alert,"errorFilledBg",ee("palette-error-main")),vt(R.Alert,"infoFilledBg",ee("palette-info-main")),vt(R.Alert,"successFilledBg",ee("palette-success-main")),vt(R.Alert,"warningFilledBg",ee("palette-warning-main")),vt(R.Alert,"errorFilledColor",nu(()=>R.getContrastText(R.error.main))),vt(R.Alert,"infoFilledColor",nu(()=>R.getContrastText(R.info.main))),vt(R.Alert,"successFilledColor",nu(()=>R.getContrastText(R.success.main))),vt(R.Alert,"warningFilledColor",nu(()=>R.getContrastText(R.warning.main))),vt(R.Alert,"errorStandardBg",K(or,R.error.light,.9)),vt(R.Alert,"infoStandardBg",K(or,R.info.light,.9)),vt(R.Alert,"successStandardBg",K(or,R.success.light,.9)),vt(R.Alert,"warningStandardBg",K(or,R.warning.light,.9)),vt(R.Alert,"errorIconColor",ee("palette-error-main")),vt(R.Alert,"infoIconColor",ee("palette-info-main")),vt(R.Alert,"successIconColor",ee("palette-success-main")),vt(R.Alert,"warningIconColor",ee("palette-warning-main")),vt(R.AppBar,"defaultBg",ee("palette-grey-100")),vt(R.Avatar,"defaultBg",ee("palette-grey-400")),vt(R.Button,"inheritContainedBg",ee("palette-grey-300")),vt(R.Button,"inheritContainedHoverBg",ee("palette-grey-A100")),vt(R.Chip,"defaultBorder",ee("palette-grey-400")),vt(R.Chip,"defaultAvatarColor",ee("palette-grey-700")),vt(R.Chip,"defaultIconColor",ee("palette-grey-700")),vt(R.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),vt(R.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),vt(R.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),vt(R.LinearProgress,"primaryBg",K(or,R.primary.main,.62)),vt(R.LinearProgress,"secondaryBg",K(or,R.secondary.main,.62)),vt(R.LinearProgress,"errorBg",K(or,R.error.main,.62)),vt(R.LinearProgress,"infoBg",K(or,R.info.main,.62)),vt(R.LinearProgress,"successBg",K(or,R.success.main,.62)),vt(R.LinearProgress,"warningBg",K(or,R.warning.main,.62)),vt(R.Skeleton,"bg",F?K(nh,R.text.primary,.11):`rgba(${ee("palette-text-primaryChannel")} / 0.11)`),vt(R.Slider,"primaryTrack",K(or,R.primary.main,.62)),vt(R.Slider,"secondaryTrack",K(or,R.secondary.main,.62)),vt(R.Slider,"errorTrack",K(or,R.error.main,.62)),vt(R.Slider,"infoTrack",K(or,R.info.main,.62)),vt(R.Slider,"successTrack",K(or,R.success.main,.62)),vt(R.Slider,"warningTrack",K(or,R.warning.main,.62));const le=F?K(ar,R.background.default,.6825):Gw(R.background.default,.8);vt(R.SnackbarContent,"bg",le),vt(R.SnackbarContent,"color",nu(()=>F?NR.text.primary:R.getContrastText(le))),vt(R.SpeedDialAction,"fabHoverBg",Gw(R.background.paper,.15)),vt(R.StepConnector,"border",ee("palette-grey-400")),vt(R.StepContent,"border",ee("palette-grey-400")),vt(R.Switch,"defaultColor",ee("palette-common-white")),vt(R.Switch,"defaultDisabledColor",ee("palette-grey-100")),vt(R.Switch,"primaryDisabledColor",K(or,R.primary.main,.62)),vt(R.Switch,"secondaryDisabledColor",K(or,R.secondary.main,.62)),vt(R.Switch,"errorDisabledColor",K(or,R.error.main,.62)),vt(R.Switch,"infoDisabledColor",K(or,R.info.main,.62)),vt(R.Switch,"successDisabledColor",K(or,R.success.main,.62)),vt(R.Switch,"warningDisabledColor",K(or,R.warning.main,.62)),vt(R.TableCell,"border",K(or,K(nh,R.divider,1),.88)),vt(R.Tooltip,"bg",K(nh,R.grey[700],.92))}if(R.mode==="dark"){vt(R.Alert,"errorColor",K(or,R.error.light,.6)),vt(R.Alert,"infoColor",K(or,R.info.light,.6)),vt(R.Alert,"successColor",K(or,R.success.light,.6)),vt(R.Alert,"warningColor",K(or,R.warning.light,.6)),vt(R.Alert,"errorFilledBg",ee("palette-error-dark")),vt(R.Alert,"infoFilledBg",ee("palette-info-dark")),vt(R.Alert,"successFilledBg",ee("palette-success-dark")),vt(R.Alert,"warningFilledBg",ee("palette-warning-dark")),vt(R.Alert,"errorFilledColor",nu(()=>R.getContrastText(R.error.dark))),vt(R.Alert,"infoFilledColor",nu(()=>R.getContrastText(R.info.dark))),vt(R.Alert,"successFilledColor",nu(()=>R.getContrastText(R.success.dark))),vt(R.Alert,"warningFilledColor",nu(()=>R.getContrastText(R.warning.dark))),vt(R.Alert,"errorStandardBg",K(ar,R.error.light,.9)),vt(R.Alert,"infoStandardBg",K(ar,R.info.light,.9)),vt(R.Alert,"successStandardBg",K(ar,R.success.light,.9)),vt(R.Alert,"warningStandardBg",K(ar,R.warning.light,.9)),vt(R.Alert,"errorIconColor",ee("palette-error-main")),vt(R.Alert,"infoIconColor",ee("palette-info-main")),vt(R.Alert,"successIconColor",ee("palette-success-main")),vt(R.Alert,"warningIconColor",ee("palette-warning-main")),vt(R.AppBar,"defaultBg",ee("palette-grey-900")),vt(R.AppBar,"darkBg",ee("palette-background-paper")),vt(R.AppBar,"darkColor",ee("palette-text-primary")),vt(R.Avatar,"defaultBg",ee("palette-grey-600")),vt(R.Button,"inheritContainedBg",ee("palette-grey-800")),vt(R.Button,"inheritContainedHoverBg",ee("palette-grey-700")),vt(R.Chip,"defaultBorder",ee("palette-grey-700")),vt(R.Chip,"defaultAvatarColor",ee("palette-grey-300")),vt(R.Chip,"defaultIconColor",ee("palette-grey-300")),vt(R.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),vt(R.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),vt(R.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),vt(R.LinearProgress,"primaryBg",K(ar,R.primary.main,.5)),vt(R.LinearProgress,"secondaryBg",K(ar,R.secondary.main,.5)),vt(R.LinearProgress,"errorBg",K(ar,R.error.main,.5)),vt(R.LinearProgress,"infoBg",K(ar,R.info.main,.5)),vt(R.LinearProgress,"successBg",K(ar,R.success.main,.5)),vt(R.LinearProgress,"warningBg",K(ar,R.warning.main,.5)),vt(R.Skeleton,"bg",F?K(nh,R.text.primary,.13):`rgba(${ee("palette-text-primaryChannel")} / 0.13)`),vt(R.Slider,"primaryTrack",K(ar,R.primary.main,.5)),vt(R.Slider,"secondaryTrack",K(ar,R.secondary.main,.5)),vt(R.Slider,"errorTrack",K(ar,R.error.main,.5)),vt(R.Slider,"infoTrack",K(ar,R.info.main,.5)),vt(R.Slider,"successTrack",K(ar,R.success.main,.5)),vt(R.Slider,"warningTrack",K(ar,R.warning.main,.5));const le=F?K(or,R.background.default,.985):Gw(R.background.default,.98);vt(R.SnackbarContent,"bg",le),vt(R.SnackbarContent,"color",nu(()=>F?fve.text.primary:R.getContrastText(le))),vt(R.SpeedDialAction,"fabHoverBg",Gw(R.background.paper,.15)),vt(R.StepConnector,"border",ee("palette-grey-600")),vt(R.StepContent,"border",ee("palette-grey-600")),vt(R.Switch,"defaultColor",ee("palette-grey-300")),vt(R.Switch,"defaultDisabledColor",ee("palette-grey-600")),vt(R.Switch,"primaryDisabledColor",K(ar,R.primary.main,.55)),vt(R.Switch,"secondaryDisabledColor",K(ar,R.secondary.main,.55)),vt(R.Switch,"errorDisabledColor",K(ar,R.error.main,.55)),vt(R.Switch,"infoDisabledColor",K(ar,R.info.main,.55)),vt(R.Switch,"successDisabledColor",K(ar,R.success.main,.55)),vt(R.Switch,"warningDisabledColor",K(ar,R.warning.main,.55)),vt(R.TableCell,"border",K(ar,K(nh,R.divider,1),.68)),vt(R.Tooltip,"bg",K(nh,R.grey[700],.92))}bf(R.background,"default"),bf(R.background,"paper"),bf(R.common,"background"),bf(R.common,"onBackground"),bf(R,"divider"),Object.keys(R).forEach(le=>{const H=R[le];le!=="tonalOffset"&&H&&typeof H=="object"&&(H.main&&vt(R[le],"mainChannel",Xy(Zy(H.main))),H.light&&vt(R[le],"lightChannel",Xy(Zy(H.light))),H.dark&&vt(R[le],"darkChannel",Xy(Zy(H.dark))),H.contrastText&&vt(R[le],"contrastTextChannel",Xy(Zy(H.contrastText))),le==="text"&&(bf(R[le],"primary"),bf(R[le],"secondary")),le==="action"&&(H.active&&bf(R[le],"active"),H.selected&&bf(R[le],"selected")))})}),T=e.reduce((U,R)=>Ol(U,R),T);const B={prefix:a,disableCssColorScheme:r,shouldSkipGeneratingVar:s,getSelector:Ldt(T),enableContrastVars:o},{vars:O,generateThemeVars:P,generateStyleSheets:G}=ldt(T,B);return T.vars=O,Object.entries(T.colorSchemes[T.defaultColorScheme]).forEach(([U,R])=>{T[U]=R}),T.generateThemeVars=P,T.generateStyleSheets=G,T.generateSpacing=function(){return eve(d.spacing,DU(this))},T.getColorSchemeSelector=cdt(l),T.spacing=T.generateSpacing(),T.shouldSkipGeneratingVar=s,T.unstable_sxConfig={...h1,...d?.unstable_sxConfig},T.unstable_sx=function(R){return p1({sx:R,theme:this})},T.toRuntimeSource=hve,T}function ZY(t,e,n){t.colorSchemes&&n&&(t.colorSchemes[e]={...n!==!0&&n,palette:UU({...n===!0?{}:n.palette,mode:e})})}function MU(t={},...e){const{palette:n,cssVariables:i=!1,colorSchemes:r=n?void 0:{light:!0},defaultColorScheme:a=n?.mode,...o}=t,s=a||"light",l=r?.[s],c={...r,...n?{[s]:{...typeof l!="boolean"&&l,palette:n}}:void 0};if(i===!1){if(!("colorSchemes"in t))return xR(t,...e);let d=n;"palette"in t||c[s]&&(c[s]!==!0?d=c[s].palette:s==="dark"&&(d={mode:"dark"}));const f=xR({...t,palette:d},...e);return f.defaultColorScheme=s,f.colorSchemes=c,f.palette.mode==="light"&&(f.colorSchemes.light={...c.light!==!0&&c.light,palette:f.palette},ZY(f,"dark",c.dark)),f.palette.mode==="dark"&&(f.colorSchemes.dark={...c.dark!==!0&&c.dark,palette:f.palette},ZY(f,"light",c.light)),f}return!n&&!("light"in c)&&s==="light"&&(c.light=!0),jdt({...o,colorSchemes:c,defaultColorScheme:s,...typeof i!="boolean"&&i},...e)}const Qdt=MU();function Hdt({theme:t,...e}){const n=xh in t?t[xh]:void 0;return y.jsx(cve,{...e,themeId:n?xh:void 0,theme:n||t})}const qw={colorSchemeStorageKey:"mui-color-scheme",defaultLightColorScheme:"light",defaultDarkColorScheme:"dark",modeStorageKey:"mui-mode"},{CssVarsProvider:zdt}=rdt({themeId:xh,theme:()=>MU({cssVariables:!0}),colorSchemeStorageKey:qw.colorSchemeStorageKey,modeStorageKey:qw.modeStorageKey,defaultColorScheme:{light:qw.defaultLightColorScheme,dark:qw.defaultDarkColorScheme},resolveTheme:t=>{const e={...t,typography:mve(t.palette,t.typography)};return e.unstable_sx=function(i){return p1({sx:i,theme:this})},e}}),Vdt=zdt;function Gdt({theme:t,...e}){const n=N.useMemo(()=>{if(typeof t=="function")return t;const i=xh in t?t[xh]:t;return"colorSchemes"in i?null:"vars"in i?t:{...t,vars:null}},[t]);return n?y.jsx(Hdt,{theme:n,...e}):y.jsx(Vdt,{theme:t,...e})}function qdt(t){return y.jsx(nve,{...t,defaultTheme:Qdt,themeId:xh})}function vve(t){return function(n){return y.jsx(qdt,{styles:typeof t=="function"?i=>t({theme:i,...n}):t})}}function qgt(){return Ict}function Kdt(t){return Gct(t)}const FR=typeof vve({})=="function",Wdt=(t,e)=>({WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%",...e&&!t.vars&&{colorScheme:t.palette.mode}}),Ydt=t=>({color:(t.vars||t).palette.text.primary,...t.typography.body1,backgroundColor:(t.vars||t).palette.background.default,"@media print":{backgroundColor:(t.vars||t).palette.common.white}}),yve=(t,e=!1)=>{const n={};e&&t.colorSchemes&&typeof t.getColorSchemeSelector=="function"&&Object.entries(t.colorSchemes).forEach(([a,o])=>{const s=t.getColorSchemeSelector(a);s.startsWith("@")?n[s]={":root":{colorScheme:o.palette?.mode}}:n[s.replace(/\s*&/,"")]={colorScheme:o.palette?.mode}});let i={html:Wdt(t,e),"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:t.typography.fontWeightBold},body:{margin:0,...Ydt(t),"&::backdrop":{backgroundColor:(t.vars||t).palette.background.default}},...n};const r=t.components?.MuiCssBaseline?.styleOverrides;return r&&(i=[i,r]),i},TN="mui-ecs",Xdt=t=>{const e=yve(t,!1),n=Array.isArray(e)?e[0]:e;return!t.vars&&n&&(n.html[`:root:has(${TN})`]={colorScheme:t.palette.mode}),t.colorSchemes&&Object.entries(t.colorSchemes).forEach(([i,r])=>{const a=t.getColorSchemeSelector(i);a.startsWith("@")?n[a]={[`:root:not(:has(.${TN}))`]:{colorScheme:r.palette?.mode}}:n[a.replace(/\s*&/,"")]={[`&:not(:has(.${TN}))`]:{colorScheme:r.palette?.mode}}}),e},Zdt=vve(FR?({theme:t,enableColorScheme:e})=>yve(t,e):({theme:t})=>Xdt(t));function Jdt(t){const e=Kdt({props:t,name:"MuiCssBaseline"}),{children:n,enableColorScheme:i=!1}=e;return y.jsxs(N.Fragment,{children:[FR&&y.jsx(Zdt,{enableColorScheme:i}),!FR&&!i&&y.jsx("span",{className:TN,style:{display:"none"}}),n]})}var rE=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},eut={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},tut=class{#e=eut;#t=!1;setTimeoutProvider(t){this.#e=t}setTimeout(t,e){return this.#e.setTimeout(t,e)}clearTimeout(t){this.#e.clearTimeout(t)}setInterval(t,e){return this.#e.setInterval(t,e)}clearInterval(t){this.#e.clearInterval(t)}},_R=new tut;function nut(t){setTimeout(t,0)}var aE=typeof window>"u"||"Deno"in globalThis;function cd(){}function iut(t,e){return typeof t=="function"?t(e):t}function rut(t){return typeof t=="number"&&t>=0&&t!==1/0}function aut(t,e){return Math.max(t+(e||0)-Date.now(),0)}function CR(t,e){return typeof t=="function"?t(e):t}function out(t,e){return typeof t=="function"?t(e):t}function JY(t,e){const{type:n="all",exact:i,fetchStatus:r,predicate:a,queryKey:o,stale:s}=t;if(o){if(i){if(e.queryHash!==$U(o,e.options))return!1}else if(!Zk(e.queryKey,o))return!1}if(n!=="all"){const l=e.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof s=="boolean"&&e.isStale()!==s||r&&r!==e.state.fetchStatus||a&&!a(e))}function eX(t,e){const{exact:n,status:i,predicate:r,mutationKey:a}=t;if(a){if(!e.options.mutationKey)return!1;if(n){if(Xk(e.options.mutationKey)!==Xk(a))return!1}else if(!Zk(e.options.mutationKey,a))return!1}return!(i&&e.state.status!==i||r&&!r(e))}function $U(t,e){return(e?.queryKeyHashFn||Xk)(t)}function Xk(t){return JSON.stringify(t,(e,n)=>ER(n)?Object.keys(n).sort().reduce((i,r)=>(i[r]=n[r],i),{}):n)}function Zk(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>Zk(t[n],e[n])):!1}var sut=Object.prototype.hasOwnProperty;function kve(t,e){if(t===e)return t;const n=tX(t)&&tX(e);if(!n&&!(ER(t)&&ER(e)))return e;const r=(n?t:Object.keys(t)).length,a=n?e:Object.keys(e),o=a.length,s=n?new Array(o):{};let l=0;for(let c=0;c<o;c++){const d=n?c:a[c],f=t[d],h=e[d];if(f===h){s[d]=f,(n?c<r:sut.call(t,d))&&l++;continue}if(f===null||h===null||typeof f!="object"||typeof h!="object"){s[d]=h;continue}const m=kve(f,h);s[d]=m,m===f&&l++}return r===o&&l===r?t:s}function tX(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function ER(t){if(!nX(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!nX(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function nX(t){return Object.prototype.toString.call(t)==="[object Object]"}function lut(t){return new Promise(e=>{_R.setTimeout(e,t)})}function cut(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?kve(t,e):e}function dut(t,e,n=0){const i=[...t,e];return n&&i.length>n?i.slice(1):i}function uut(t,e,n=0){const i=[e,...t];return n&&i.length>n?i.slice(0,-1):i}var jU=Symbol();function bve(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:!t.queryFn||t.queryFn===jU?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function fut(t,e,n){let i=!1,r;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(r??=e(),i||(i=!0,r.aborted?n():r.addEventListener("abort",n,{once:!0})),r)}),t}var Aut=class extends rE{#e;#t;#n;constructor(){super(),this.#n=t=>{if(!aE&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#n=t,this.#t?.(),this.#t=t(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(t){this.#e!==t&&(this.#e=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Sve=new Aut;function mut(){let t,e;const n=new Promise((r,a)=>{t=r,e=a});n.status="pending",n.catch(()=>{});function i(r){Object.assign(n,r),delete n.resolve,delete n.reject}return n.resolve=r=>{i({status:"fulfilled",value:r}),t(r)},n.reject=r=>{i({status:"rejected",reason:r}),e(r)},n}var hut=nut;function put(){let t=[],e=0,n=s=>{s()},i=s=>{s()},r=hut;const a=s=>{e?t.push(s):r(()=>{n(s)})},o=()=>{const s=t;t=[],s.length&&r(()=>{i(()=>{s.forEach(l=>{n(l)})})})};return{batch:s=>{let l;e++;try{l=s()}finally{e--,e||o()}return l},batchCalls:s=>(...l)=>{a(()=>{s(...l)})},schedule:a,setNotifyFunction:s=>{n=s},setBatchNotifyFunction:s=>{i=s},setScheduler:s=>{r=s}}}var gs=put(),gut=class extends rE{#e=!0;#t;#n;constructor(){super(),this.#n=t=>{if(!aE&&window.addEventListener){const e=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#n=t,this.#t?.(),this.#t=t(this.setOnline.bind(this))}setOnline(t){this.#e!==t&&(this.#e=t,this.listeners.forEach(n=>{n(t)}))}isOnline(){return this.#e}},f2=new gut;function vut(t){return Math.min(1e3*2**t,3e4)}function wve(t){return(t??"online")==="online"?f2.isOnline():!0}var BR=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function Nve(t){let e=!1,n=0,i;const r=mut(),a=()=>r.status!=="pending",o=v=>{if(!a()){const b=new BR(v);h(b),t.onCancel?.(b)}},s=()=>{e=!0},l=()=>{e=!1},c=()=>Sve.isFocused()&&(t.networkMode==="always"||f2.isOnline())&&t.canRun(),d=()=>wve(t.networkMode)&&t.canRun(),f=v=>{a()||(i?.(),r.resolve(v))},h=v=>{a()||(i?.(),r.reject(v))},m=()=>new Promise(v=>{i=b=>{(a()||c())&&v(b)},t.onPause?.()}).then(()=>{i=void 0,a()||t.onContinue?.()}),g=()=>{if(a())return;let v;const b=n===0?t.initialPromise:void 0;try{v=b??t.fn()}catch(k){v=Promise.reject(k)}Promise.resolve(v).then(f).catch(k=>{if(a())return;const w=t.retry??(aE?0:3),x=t.retryDelay??vut,F=typeof x=="function"?x(n,k):x,_=w===!0||typeof w=="number"&&n<w||typeof w=="function"&&w(n,k);if(e||!_){h(k);return}n++,t.onFail?.(n,k),lut(F).then(()=>c()?void 0:m()).then(()=>{e?h(k):g()})})};return{promise:r,status:()=>r.status,cancel:o,continue:()=>(i?.(),r),cancelRetry:s,continueRetry:l,canStart:d,start:()=>(d()?g():m().then(g),r)}}var xve=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),rut(this.gcTime)&&(this.#e=_R.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(aE?1/0:300*1e3))}clearGcTimeout(){this.#e&&(_R.clearTimeout(this.#e),this.#e=void 0)}},yut=class extends xve{#e;#t;#n;#i;#r;#o;#a;constructor(t){super(),this.#a=!1,this.#o=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#i=t.client,this.#n=this.#i.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#e=rX(this.options),this.state=t.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(t){if(this.options={...this.#o,...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const e=rX(this.options);e.data!==void 0&&(this.setState(iX(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(t,e){const n=cut(this.state.data,t,this.options);return this.#s({data:n,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),n}setState(t,e){this.#s({type:"setState",state:t,setStateOptions:e})}cancel(t){const e=this.#r?.promise;return this.#r?.cancel(t),e?e.then(cd).catch(cd):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(t=>out(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===jU||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>CR(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!aut(this.state.dataUpdatedAt,t)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(this.#r&&(this.#a?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(t,e){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(t&&this.setOptions(t),!this.options.queryFn){const s=this.observers.find(l=>l.options.queryFn);s&&this.setOptions(s.options)}const n=new AbortController,i=s=>{Object.defineProperty(s,"signal",{enumerable:!0,get:()=>(this.#a=!0,n.signal)})},r=()=>{const s=bve(this.options,e),c=(()=>{const d={client:this.#i,queryKey:this.queryKey,meta:this.meta};return i(d),d})();return this.#a=!1,this.options.persister?this.options.persister(s,c,this):s(c)},o=(()=>{const s={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:r};return i(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.#r=Nve({initialPromise:e?.initialPromise,fn:o.fetchFn,onCancel:s=>{s instanceof BR&&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.#r.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 BR){if(s.silent)return this.#r.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(t){const e=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...kut(n.data,this.options),fetchMeta:t.meta??null};case"success":const i={...n,...iX(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=t.manual?i:void 0,i;case"error":const r=t.error;return{...n,error:r,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=e(this.state),gs.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:t})})}};function kut(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:wve(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function iX(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function rX(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,i=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}function aX(t){return{onFetch:(e,n)=>{const i=e.options,r=e.fetchOptions?.meta?.fetchMore?.direction,a=e.state.data?.pages||[],o=e.state.data?.pageParams||[];let s={pages:[],pageParams:[]},l=0;const c=async()=>{let d=!1;const f=g=>{fut(g,()=>e.signal,()=>d=!0)},h=bve(e.options,e.fetchOptions),m=async(g,v,b)=>{if(d)return Promise.reject();if(v==null&&g.pages.length)return Promise.resolve(g);const w=(()=>{const T={client:e.client,queryKey:e.queryKey,pageParam:v,direction:b?"backward":"forward",meta:e.options.meta};return f(T),T})(),x=await h(w),{maxPages:F}=e.options,_=b?uut:dut;return{pages:_(g.pages,x,F),pageParams:_(g.pageParams,v,F)}};if(r&&a.length){const g=r==="backward",v=g?but:oX,b={pages:a,pageParams:o},k=v(i,b);s=await m(b,k,g)}else{const g=t??a.length;do{const v=l===0?o[0]??i.initialPageParam:oX(i,s);if(l>0&&v==null)break;s=await m(s,v),l++}while(l<g)}return s};e.options.persister?e.fetchFn=()=>e.options.persister?.(c,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n):e.fetchFn=c}}}function oX(t,{pages:e,pageParams:n}){const i=e.length-1;return e.length>0?t.getNextPageParam(e[i],e,n[i],n):void 0}function but(t,{pages:e,pageParams:n}){return e.length>0?t.getPreviousPageParam?.(e[0],e,n[0],n):void 0}var Sut=class extends xve{#e;#t;#n;#i;constructor(t){super(),this.#e=t.client,this.mutationId=t.mutationId,this.#n=t.mutationCache,this.#t=[],this.state=t.state||wut(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#t.includes(t)||(this.#t.push(t),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#t=this.#t.filter(e=>e!==t),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(t){const e=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=Nve({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(a,o)=>{this.#r({type:"failed",failureCount:a,error:o})},onPause:()=>{this.#r({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const i=this.state.status==="pending",r=!this.#i.canStart();try{if(i)e();else{this.#r({type:"pending",variables:t,isPaused:r}),await this.#n.config.onMutate?.(t,this,n);const o=await this.options.onMutate?.(t,n);o!==this.state.context&&this.#r({type:"pending",context:o,variables:t,isPaused:r})}const a=await this.#i.start();return await this.#n.config.onSuccess?.(a,t,this.state.context,this,n),await this.options.onSuccess?.(a,t,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,t,this.state.context,n),this.#r({type:"success",data:a}),a}catch(a){try{await this.#n.config.onError?.(a,t,this.state.context,this,n)}catch(o){Promise.reject(o)}try{await this.options.onError?.(a,t,this.state.context,n)}catch(o){Promise.reject(o)}try{await this.#n.config.onSettled?.(void 0,a,this.state.variables,this.state.context,this,n)}catch(o){Promise.reject(o)}try{await this.options.onSettled?.(void 0,a,t,this.state.context,n)}catch(o){Promise.reject(o)}throw this.#r({type:"error",error:a}),a}finally{this.#n.runNext(this)}}#r(t){const e=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=e(this.state),gs.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(t)}),this.#n.notify({mutation:this,type:"updated",action:t})})}};function wut(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Nut=class extends rE{constructor(t={}){super(),this.config=t,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(t,e,n){const i=new Sut({client:t,mutationCache:this,mutationId:++this.#n,options:t.defaultMutationOptions(e),state:n});return this.add(i),i}add(t){this.#e.add(t);const e=Kw(t);if(typeof e=="string"){const n=this.#t.get(e);n?n.push(t):this.#t.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#e.delete(t)){const e=Kw(t);if(typeof e=="string"){const n=this.#t.get(e);if(n)if(n.length>1){const i=n.indexOf(t);i!==-1&&n.splice(i,1)}else n[0]===t&&this.#t.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=Kw(t);if(typeof e=="string"){const i=this.#t.get(e)?.find(r=>r.state.status==="pending");return!i||i===t}else return!0}runNext(t){const e=Kw(t);return typeof e=="string"?this.#t.get(e)?.find(i=>i!==t&&i.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){gs.batch(()=>{this.#e.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(t){const e={exact:!0,...t};return this.getAll().find(n=>eX(e,n))}findAll(t={}){return this.getAll().filter(e=>eX(t,e))}notify(t){gs.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(e=>e.state.isPaused);return gs.batch(()=>Promise.all(t.map(e=>e.continue().catch(cd))))}};function Kw(t){return t.options.scope?.id}var xut=class extends rE{constructor(t={}){super(),this.config=t,this.#e=new Map}#e;build(t,e,n){const i=e.queryKey,r=e.queryHash??$U(i,e);let a=this.get(r);return a||(a=new yut({client:t,queryKey:i,queryHash:r,options:t.defaultQueryOptions(e),state:n,defaultOptions:t.getQueryDefaults(i)}),this.add(a)),a}add(t){this.#e.has(t.queryHash)||(this.#e.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=this.#e.get(t.queryHash);e&&(t.destroy(),e===t&&this.#e.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){gs.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#e.get(t)}getAll(){return[...this.#e.values()]}find(t){const e={exact:!0,...t};return this.getAll().find(n=>JY(e,n))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(n=>JY(t,n)):e}notify(t){gs.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){gs.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){gs.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Fut=class{#e;#t;#n;#i;#r;#o;#a;#s;constructor(t={}){this.#e=t.queryCache||new xut,this.#t=t.mutationCache||new Nut,this.#n=t.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#a=Sve.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=f2.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#o--,this.#o===0&&(this.#a?.(),this.#a=void 0,this.#s?.(),this.#s=void 0)}isFetching(t){return this.#e.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#t.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#e.get(e.queryHash)?.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=this.#e.build(this,e),i=n.state.data;return i===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(CR(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(i))}getQueriesData(t){return this.#e.findAll(t).map(({queryKey:e,state:n})=>{const i=n.data;return[e,i]})}setQueryData(t,e,n){const i=this.defaultQueryOptions({queryKey:t}),a=this.#e.get(i.queryHash)?.state.data,o=iut(e,a);if(o!==void 0)return this.#e.build(this,i).setData(o,{...n,manual:!0})}setQueriesData(t,e,n){return gs.batch(()=>this.#e.findAll(t).map(({queryKey:i})=>[i,this.setQueryData(i,e,n)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#e.get(e.queryHash)?.state}removeQueries(t){const e=this.#e;gs.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=this.#e;return gs.batch(()=>(n.findAll(t).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},i=gs.batch(()=>this.#e.findAll(t).map(r=>r.cancel(n)));return Promise.all(i).then(cd).catch(cd)}invalidateQueries(t,e={}){return gs.batch(()=>(this.#e.findAll(t).forEach(n=>{n.invalidate()}),t?.refetchType==="none"?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},i=gs.batch(()=>this.#e.findAll(t).filter(r=>!r.isDisabled()&&!r.isStatic()).map(r=>{let a=r.fetch(void 0,n);return n.throwOnError||(a=a.catch(cd)),r.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(i).then(cd)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=this.#e.build(this,e);return n.isStaleByTime(CR(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(cd).catch(cd)}fetchInfiniteQuery(t){return t.behavior=aX(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(cd).catch(cd)}ensureInfiniteQueryData(t){return t.behavior=aX(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return f2.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(t){this.#n=t}setQueryDefaults(t,e){this.#i.set(Xk(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...this.#i.values()],n={};return e.forEach(i=>{Zk(t,i.queryKey)&&Object.assign(n,i.defaultOptions)}),n}setMutationDefaults(t,e){this.#r.set(Xk(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...this.#r.values()],n={};return e.forEach(i=>{Zk(t,i.mutationKey)&&Object.assign(n,i.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...this.#n.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=$U(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===jU&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#n.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},_ut=N.createContext(void 0),Cut=({client:t,children:e})=>(N.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),y.jsx(_ut.Provider,{value:t,children:e}));function Eut(){const t=VX();return N.useEffect(()=>{const e=t[t.length-1],n=e?.handle;if(n?.title){const i=typeof n.title=="function"?n.title(e.data):n.title;document.title=`${i} - Accounter`}else document.title="Accounter"},[t]),y.jsx("div",{style:{display:"none"}})}var But=(t,e,n,i,r,a,o,s)=>{let l=document.documentElement,c=["light","dark"];function d(m){(Array.isArray(t)?t:[t]).forEach(g=>{let v=g==="class",b=v&&a?r.map(k=>a[k]||k):r;v?(l.classList.remove(...b),l.classList.add(a&&a[m]?a[m]:m)):l.setAttribute(g,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(i)d(i);else try{let m=localStorage.getItem(e)||n,g=o&&m==="system"?h():m;d(g)}catch{}},Dut=N.createContext(void 0),Tut={setTheme:t=>{},themes:[]},Iut=()=>{var t;return(t=N.useContext(Dut))!=null?t:Tut};N.memo(({forcedTheme:t,storageKey:e,attribute:n,enableSystem:i,enableColorScheme:r,defaultTheme:a,value:o,themes:s,nonce:l,scriptProps:c})=>{let d=JSON.stringify([n,e,a,t,s,o,i,r]).slice(1,-1);return N.createElement("script",{...c,suppressHydrationWarning:!0,nonce:typeof window>"u"?l:"",dangerouslySetInnerHTML:{__html:`(${But.toString()})(${d})`}})});const Out=({...t})=>{const{theme:e="system"}=Iut();return y.jsx(sTe,{theme:e,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"}},...t})},Rut=new Fut({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}}),Put=MU({palette:{primary:{main:"#556cd6"},secondary:{main:"#19857b"},error:{main:ah.A400}}});function Lut(){return y.jsx(Sne,{withGlobalStyles:!0,theme:{fontFamily:"Roboto, sans-serif",fontSizes:{md:"14"}},children:y.jsxs(Gdt,{theme:Put,children:[y.jsx(Jdt,{}),y.jsxs(ODe,{children:[y.jsx(Out,{}),y.jsx(lTe,{children:y.jsx(Cut,{client:Rut,children:y.jsxs(Ust,{children:[y.jsx(Eut,{}),y.jsx(Kge,{}),y.jsx(KX,{})]})})})]})]})})}function Uut(){if(!new pb().isLoggedIn())throw xX(jn.LOGIN);return null}function Mut(){if(new pb().isLoggedIn())throw xX(jn.HOME);return null}let Ww=null;function Fve(){if(Ww)return Ww;const t=new pb;let e;return e="https://accounter.onrender.com/graphql",Ww=YZ({url:e,exchanges:[WZ({onResult(n){Lte(n)}}),Pte(async n=>({addAuthToOperation(i){const r=t.authToken();return r?n.appendHeaders(i,{Authorization:r}):i},didAuthError(i,r){return i?.response?.status===401||i?.graphQLErrors?.some(a=>a.extensions?.code==="FORBIDDEN")},async refreshAuth(){t.logout()}})),KZ]}),Ww}function $ut(t){if(!t.chargeId)throw new Response("Charge ID is required",{status:400});return{chargeId:t.chargeId}}function jut(t){if(!t.businessId)throw new Response("Business ID is required",{status:400});return{businessId:t.businessId}}async function Qut({params:t}){const{chargeId:e}=$ut(t),i=await Fve().query(HFe,{chargeId:e}).toPromise();if(!i.data?.charge)throw new Response("Charge not found",{status:404});return i.data}async function Hut({params:t}){const{businessId:e}=jut(t),i=await Fve().query(QFe,{businessId:e}).toPromise();if(!i.data?.business)throw new Response("Business not found",{status:404});return i.data}const sX=N.lazy(()=>Ai(()=>import("./all-charges-B53ChbBw.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26])).then(t=>({default:t.AllCharges}))),zut=N.lazy(()=>Ai(()=>import("./missing-info-charges-DJbVpU3F.js"),__vite__mapDeps([27,1,9,10,11,12,13,6,14,15,16,17,18,19,20,21,22,23,24,25,3,26])).then(t=>({default:t.MissingInfoCharges}))),Vut=N.lazy(()=>Ai(()=>import("./charge-Cvrsuvam.js"),__vite__mapDeps([28,9,10,11,12,13,6,14,15,16,17,18,19,20,21,22,23,24,25,3])).then(t=>({default:t.Charge}))),Gut=N.lazy(()=>Ai(()=>import("./charges-ledger-validation-K5bGVbfd.js"),__vite__mapDeps([29,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,30])).then(t=>({default:t.ChargesLedgerValidation}))),qut=N.lazy(()=>Ai(()=>import("./index-fvfqfHgx.js"),__vite__mapDeps([31,1,32,33,18,26])).then(t=>({default:t.Businesses}))),Kut=N.lazy(()=>Ai(()=>import("./business-C6EHWbDo.js"),__vite__mapDeps([34,35,33,36,20,21,37,32,9,10,11,12,13,6,14,15,16,17,18,19,38,39,40,41,7])).then(t=>({default:t.BusinessScreen}))),Wut=N.lazy(()=>Ai(()=>import("./index-BgpzfaeJ.js"),__vite__mapDeps([42,1,25,15,26,36,20,21,37,43,3,4,8,11])).then(t=>({default:t.BusinessLedgerRecordsSummery}))),Yut=N.lazy(()=>Ai(()=>import("./business-ledger-single-DZyFn40E.js"),__vite__mapDeps([44,1,25,15,36,20,21,37,43,3,4,8])).then(t=>({default:t.BusinessLedgerRecordsSingle}))),Xut=N.lazy(()=>Ai(()=>import("./contracts-CjRjQCRY.js"),__vite__mapDeps([45,40,20,21,4,41,7])).then(t=>({default:t.ContractsScreen}))),Zut=N.lazy(()=>Ai(()=>import("./index-VOgo1b_w.js"),__vite__mapDeps([46,47,14,16,15,10,11,8,13,24,26])).then(t=>({default:t.BusinessTrips}))),Jut=N.lazy(()=>Ai(()=>import("./business-trip-Beo5bB1g.js"),__vite__mapDeps([48,47,14,16,15,10,11,8,13,26])).then(t=>({default:t.BusinessTrip}))),eft=N.lazy(()=>Ai(()=>import("./index-sl9J9RIm.js"),__vite__mapDeps([49,1,26,3,4])).then(t=>({default:t.ChartPage}))),tft=N.lazy(()=>Ai(()=>import("./index-B4XWvHSY.js"),__vite__mapDeps([50,1,26,3,4,51,39,5,6,7])).then(t=>({default:t.MonthlyIncomeExpenseChart}))),nft=N.lazy(()=>Ai(()=>import("./index-BvqzqML_.js"),__vite__mapDeps([52,1,25,15,53,3,26,4,8,5,6,7,54])).then(t=>({default:t.DocumentsReport}))),ift=N.lazy(()=>Ai(()=>import("./issue-document-8tNe2T1W.js"),__vite__mapDeps([55,26])).then(t=>({default:t.IssueDocumentScreen}))),rft=N.lazy(()=>Ai(()=>import("./index-CAoIWd0f.js"),__vite__mapDeps([56,41,7])).then(t=>({default:t.IssueDocuments}))),aft=N.lazy(()=>Ai(()=>import("./index-B3P9rJGf.js"),__vite__mapDeps([57,1,26,3,4,8,37,36,20,21,11,15])).then(t=>({default:t.TrialBalanceReport}))),oft=N.lazy(()=>Ai(()=>import("./index-ComDmMDN.js"),__vite__mapDeps([58,1,54,37,36,20,21,51,11,4,8])).then(t=>({default:t.ContoReport}))),sft=N.lazy(()=>Ai(()=>import("./index-CIoirABN.js"),__vite__mapDeps([59,60,1,9,10,11,12,13,6,14,15,16,17,18,19,20,21,22,23,24,25,3,26,2,4,5,7,8])).then(t=>({default:t.VatMonthlyReport}))),lX=N.lazy(()=>Ai(()=>import("./index-LWqbIc1T.js"),__vite__mapDeps([61,60,26,62,10,11,15,3,23,4])).then(t=>({default:t.ProfitAndLossReport}))),cX=N.lazy(()=>Ai(()=>import("./index-CIRmhdDG.js"),__vite__mapDeps([63,60,26,62,10,11,15,3,23,4])).then(t=>({default:t.TaxReport}))),lft=N.lazy(()=>Ai(()=>import("./index-i7Yf0n3Q.js"),__vite__mapDeps([64,1,26,4])).then(t=>({default:t.DepreciationReport}))),cft=N.lazy(()=>Ai(()=>import("./index-C6PQh6Al.js"),__vite__mapDeps([65,26,23])).then(t=>({default:t.AnnualRevenueReport}))),dft=N.lazy(()=>Ai(()=>import("./index-D0OFipbT.js"),__vite__mapDeps([66,4,33,21,35])).then(t=>({default:t.Shaam6111Report}))),uft=N.lazy(()=>Ai(()=>import("./index-DCrzzRDf.js"),__vite__mapDeps([67,53,26,37,23])).then(t=>({default:t.YearlyLedgerReport}))),dX=N.lazy(()=>Ai(()=>import("./index-DWeUM89g.js"),__vite__mapDeps([68,60,26,3,23,4,15])).then(t=>({default:t.CorporateTaxRulingComplianceReport}))),fft=N.lazy(()=>Ai(()=>import("./index-DDqBw1FZ.js"),__vite__mapDeps([69,1,26,38,12,13,6,14,39,3,4,8,5,7])).then(t=>({default:t.BalanceReport}))),Aft=N.lazy(()=>Ai(()=>import("./index-CJ5SOHQ0.js"),__vite__mapDeps([70,1,26,19,3,4])).then(t=>({default:t.ValidateReportsScreen}))),mft=N.lazy(()=>Ai(()=>import("./accountant-approvals-Ddg6bDMn.js"),__vite__mapDeps([71,1,2,3,4,5,6,7,8,26,30])).then(t=>({default:t.AccountantApprovals}))),hft=N.lazy(()=>Ai(()=>import("./index-DfyBVta3.js"),__vite__mapDeps([72,1,26,3,4,8])).then(t=>({default:t.Salaries}))),pft=N.lazy(()=>Ai(()=>import("./index-lbcY8WB_.js"),__vite__mapDeps([73,26,14])).then(t=>({default:t.TagsManager}))),gft=N.lazy(()=>Ai(()=>import("./index-Bpv_EQpT.js"),__vite__mapDeps([74,53,26,54])).then(t=>({default:t.TaxCategories}))),vft=N.lazy(()=>Ai(()=>import("./index-D4AHtEfm.js"),__vite__mapDeps([75,53,26,54])).then(t=>({default:t.SortCodes}))),yft=N.lazy(()=>Ai(()=>import("./index-Cs_wIQni.js"),__vite__mapDeps([76,17])).then(t=>({default:t.DepositsScreen}))),kft=N.lazy(()=>Ai(()=>import("./page-not-found-BoSNUBMS.js"),[]).then(t=>({default:t.PageNotFound}))),bft=N.lazy(()=>Ai(()=>import("./login-page-CQJsxqwG.js"),[]).then(t=>({default:t.LoginPage})));function ci(t,e){return y.jsx(N.Suspense,{fallback:e||y.jsx(Nwe,{}),children:y.jsx(t,{})})}const Sft=[{path:"/",element:y.jsx(Lut,{}),errorElement:y.jsx(dj,{}),children:[{path:jn.LOGIN,loader:Mut,element:ci(bft),handle:{title:"Login"}},{path:"/",loader:Uut,element:y.jsx(Slt,{}),errorElement:y.jsx(dj,{}),children:[{index:!0,element:ci(sX,y.jsx(hl,{})),handle:{title:"All Charges",breadcrumb:"Charges"}},{path:"charges",handle:{breadcrumb:"Charges"},children:[{index:!0,element:ci(sX,y.jsx(hl,{})),handle:{title:"All Charges"}},{path:"missing-info",element:ci(zut,y.jsx(hl,{})),handle:{title:"Missing Info Charges",breadcrumb:"Missing Info"}},{path:"ledger-validation",element:ci(Gut,y.jsx(hl,{})),handle:{title:"Ledger Validation",breadcrumb:"Ledger Validation"}},{path:":chargeId",loader:Qut,element:ci(Vut),handle:{title:"Charge Details",breadcrumb:"Details"}}]},{path:"businesses",handle:{breadcrumb:"Businesses"},children:[{index:!0,element:ci(qut,y.jsx(hl,{})),handle:{title:"All Businesses"}},{path:"ledger",element:ci(Wut,y.jsx(hl,{})),handle:{title:"Business Ledger Records Summary",breadcrumb:"Ledger"}},{path:":businessId",loader:Hut,element:ci(Kut),handle:{title:"Business Details",breadcrumb:"Details"}},{path:":businessId/ledger",element:ci(Yut,y.jsx(hl,{})),handle:{title:"Business Ledger",breadcrumb:"Ledger"}},{path:"contracts",element:ci(Xut,y.jsx(hl,{})),handle:{title:"Clients Contracts",breadcrumb:"Contracts"}}]},{path:"business-trips",handle:{breadcrumb:"Business Trips"},children:[{index:!0,element:ci(Zut,y.jsx(hl,{})),handle:{title:"Business Trips"}},{path:":businessTripId",element:ci(Jut),handle:{title:"Business Trip Details",breadcrumb:"Details"}}]},{path:"charts",handle:{breadcrumb:"Charts"},children:[{index:!0,element:ci(eft),handle:{title:"Charts"}},{path:"monthly-income-expense",element:ci(tft),handle:{title:"Monthly Income/Expense",breadcrumb:"Income/Expense"}}]},{path:"documents",handle:{breadcrumb:"Documents"},children:[{index:!0,element:ci(nft,y.jsx(hl,{})),handle:{title:"All Documents"}},{path:"issue-document",element:ci(ift),handle:{title:"Issue Document",breadcrumb:"Issue Document"}},{path:"issue-documents",element:ci(rft),handle:{title:"Issue Documents",breadcrumb:"Issue Documents"}}]},{path:"reports",handle:{breadcrumb:"Reports"},children:[{path:"trial-balance",element:ci(aft,y.jsx(Hs,{})),handle:{title:"Trial Balance Report",breadcrumb:"Trial Balance"}},{path:"conto",element:ci(oft,y.jsx(Hs,{})),handle:{title:"Conto Report",breadcrumb:"Conto"}},{path:"vat-monthly",element:ci(sft,y.jsx(Hs,{})),handle:{title:"VAT Monthly Report",breadcrumb:"VAT Monthly"}},{path:"profit-and-loss",handle:{breadcrumb:"Profit & Loss"},children:[{index:!0,element:ci(lX,y.jsx(Hs,{})),handle:{title:"Profit & Loss Report"}},{path:":year",element:ci(lX,y.jsx(Hs,{})),handle:{title:"Profit & Loss Report",breadcrumb:t=>t?.year||"Year"}}]},{path:"tax",handle:{breadcrumb:"Tax"},children:[{index:!0,element:ci(cX,y.jsx(Hs,{})),handle:{title:"Tax Report"}},{path:":year",element:ci(cX,y.jsx(Hs,{})),handle:{title:"Tax Report",breadcrumb:t=>t?.year||"Year"}}]},{path:"depreciation",element:ci(lft,y.jsx(Hs,{})),handle:{title:"Depreciation Report",breadcrumb:"Depreciation"}},{path:"annual-revenue",element:ci(cft,y.jsx(Hs,{})),handle:{title:"Annual Revenue Report",breadcrumb:"Annual Revenue"}},{path:"shaam-6111",element:ci(dft,y.jsx(Hs,{})),handle:{title:"Shaam 6111 Report",breadcrumb:"Shaam 6111"}},{path:"yearly-ledger",element:ci(uft,y.jsx(Hs,{})),handle:{title:"Yearly Ledger Report",breadcrumb:"Yearly Ledger"}},{path:"corporate-tax-ruling-compliance",handle:{breadcrumb:"Tax Ruling"},children:[{index:!0,element:ci(dX,y.jsx(Hs,{})),handle:{title:"Corporate Tax Ruling Compliance Report"}},{path:":year",element:ci(dX,y.jsx(Hs,{})),handle:{title:"Corporate Tax Ruling Compliance Report",breadcrumb:t=>t?.year||"Year"}}]},{path:"balance",element:ci(fft,y.jsx(Hs,{})),handle:{title:"Balance Report",breadcrumb:"Balance"}},{path:"validate-reports",element:ci(Aft),handle:{title:"Validate Reports",breadcrumb:"Validate"}}]},{path:"bank-deposits",element:ci(yft,y.jsx(hl,{})),handle:{title:"Bank Deposits",breadcrumb:"Bank Deposits"}},{path:"accountant-approvals",element:ci(mft,y.jsx(hl,{})),handle:{title:"Accountant Approvals",breadcrumb:"Accountant Approvals"}},{path:"salaries",element:ci(hft,y.jsx(hl,{})),handle:{title:"Salaries",breadcrumb:"Salaries"}},{path:"tags",element:ci(pft),handle:{title:"Tags",breadcrumb:"Tags"}},{path:"tax-categories",element:ci(gft),handle:{title:"Tax Categories",breadcrumb:"Tax Categories"}},{path:"sort-codes",element:ci(vft),handle:{title:"Sort Codes",breadcrumb:"Sort Codes"}},{path:"*",element:ci(kft),handle:{title:"Page Not Found"}}]}]}];var uX={},fX;function wft(){if(fX)return uX;fX=1;var t={};const e=(...r)=>t.stringify(...r);(function(){var r=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,a,o,s={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},l;function c(f){return r.lastIndex=0,r.test(f)?'"'+f.replace(r,function(h){var m=s[h];return typeof m=="string"?m:"\\u"+("0000"+h.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+f+'"'}function d(f,h){var m,g,v,b,k=a,w,x=h[f];switch(x&&typeof x=="object"&&typeof x.toJSON=="function"&&(x=x.toJSON(f)),typeof l=="function"&&(x=l.call(h,f,x)),typeof x){case"string":return c(x);case"number":return isFinite(x)?String(x):"null";case"bigint":case"boolean":case"null":return String(x);case"object":if(!x)return"null";if(a+=o,w=[],Object.prototype.toString.apply(x)==="[object Array]"){for(b=x.length,m=0;m<b;m+=1)w[m]=d(m,x)||"null";return v=w.length===0?"[]":a?`[
|
|
290
|
+
export default theme;`}function XY(t){return typeof t=="number"?`${(t*100).toFixed(0)}%`:`calc((${t}) * 100%)`}const Bdt=t=>{if(!Number.isNaN(+t))return+t;const e=t.match(/\d*\.?\d+/g);if(!e)return 0;let n=0;for(let i=0;i<e.length;i+=1)n+=+e[i];return n};function Ddt(t){Object.assign(t,{alpha(e,n){const i=this||t;return i.colorSpace?`oklch(from ${e} l c h / ${typeof n=="string"?`calc(${n})`:n})`:i.vars?`rgba(${e.replace(/var\(--([^,\s)]+)(?:,[^)]+)?\)+/g,"var(--$1Channel)")} / ${typeof n=="string"?`calc(${n})`:n})`:ave(e,Bdt(n))},lighten(e,n){const i=this||t;return i.colorSpace?`color-mix(in ${i.colorSpace}, ${e}, #fff ${XY(n)})`:iE(e,n)},darken(e,n){const i=this||t;return i.colorSpace?`color-mix(in ${i.colorSpace}, ${e}, #000 ${XY(n)})`:nE(e,n)}})}function xR(t={},...e){const{breakpoints:n,mixins:i={},spacing:r,palette:a={},transitions:o={},typography:s={},shape:l,colorSpace:c,...d}=t;if(t.vars&&t.generateThemeVars===void 0)throw new Error(Kh(20));const f=UU({...a,colorSpace:c}),h=tve(t);let m=Ol(h,{mixins:vdt(h.breakpoints,i),palette:f,shadows:wdt.slice(),typography:mve(f,s),transitions:_dt(o),zIndex:{...Cdt}});return m=Ol(m,d),m=e.reduce((g,v)=>Ol(g,v),m),m.unstable_sxConfig={...h1,...d?.unstable_sxConfig},m.unstable_sx=function(v){return p1({sx:v,theme:this})},m.toRuntimeSource=hve,Ddt(m),m}function Tdt(t){let e;return t<1?e=5.11916*t**2:e=4.5*Math.log(t+1)+2,Math.round(e*10)/1e3}const Idt=[...Array(25)].map((t,e)=>{if(e===0)return"none";const n=Tdt(e);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function pve(t){return{inputPlaceholder:t==="dark"?.5:.42,inputUnderline:t==="dark"?.7:.42,switchTrackDisabled:t==="dark"?.2:.12,switchTrack:t==="dark"?.3:.38}}function gve(t){return t==="dark"?Idt:[]}function Odt(t){const{palette:e={mode:"light"},opacity:n,overlays:i,colorSpace:r,...a}=t,o=UU({...e,colorSpace:r});return{palette:o,opacity:{...pve(o.mode),...n},overlays:i||gve(o.mode),...a}}function Rdt(t){return!!t[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!t[0].match(/sxConfig$/)||t[0]==="palette"&&!!t[1]?.match(/(mode|contrastThreshold|tonalOffset)/)}const Pdt=t=>[...[...Array(25)].map((e,n)=>`--${t?`${t}-`:""}overlays-${n}`),`--${t?`${t}-`:""}palette-AppBar-darkBg`,`--${t?`${t}-`:""}palette-AppBar-darkColor`],Ldt=t=>(e,n)=>{const i=t.rootSelector||":root",r=t.colorSchemeSelector;let a=r;if(r==="class"&&(a=".%s"),r==="data"&&(a="[data-%s]"),r?.startsWith("data-")&&!r.includes("%s")&&(a=`[${r}="%s"]`),t.defaultColorScheme===e){if(e==="dark"){const o={};return Pdt(t.cssVarPrefix).forEach(s=>{o[s]=n[s],delete n[s]}),a==="media"?{[i]:n,"@media (prefers-color-scheme: dark)":{[i]:o}}:a?{[a.replace("%s",e)]:o,[`${i}, ${a.replace("%s",e)}`]:n}:{[i]:{...n,...o}}}if(a&&a!=="media")return`${i}, ${a.replace("%s",String(e))}`}else if(e){if(a==="media")return{[`@media (prefers-color-scheme: ${String(e)})`]:{[i]:n}};if(a)return a.replace("%s",String(e))}return i};function Udt(t,e){e.forEach(n=>{t[n]||(t[n]={})})}function vt(t,e,n){!t[e]&&n&&(t[e]=n)}function Zy(t){return typeof t!="string"||!t.startsWith("hsl")?t:rve(t)}function bf(t,e){`${e}Channel`in t||(t[`${e}Channel`]=Xy(Zy(t[e])))}function Mdt(t){return typeof t=="number"?`${t}px`:typeof t=="string"||typeof t=="function"||Array.isArray(t)?t:"8px"}const nu=t=>{try{return t()}catch{}},$dt=(t="mui")=>adt(t);function fI(t,e,n,i,r){if(!n)return;n=n===!0?{}:n;const a=r==="dark"?"dark":"light";if(!i){e[r]=Odt({...n,palette:{mode:a,...n?.palette},colorSpace:t});return}const{palette:o,...s}=xR({...i,palette:{mode:a,...n?.palette},colorSpace:t});return e[r]={...n,palette:o,opacity:{...pve(a),...n?.opacity},overlays:n?.overlays||gve(a)},s}function jdt(t={},...e){const{colorSchemes:n={light:!0},defaultColorScheme:i,disableCssColorScheme:r=!1,cssVarPrefix:a="mui",nativeColor:o=!1,shouldSkipGeneratingVar:s=Rdt,colorSchemeSelector:l=n.light&&n.dark?"media":void 0,rootSelector:c=":root",...d}=t,f=Object.keys(n)[0],h=i||(n.light&&f!=="light"?"light":f),m=$dt(a),{[h]:g,light:v,dark:b,...k}=n,w={...k};let x=g;if((h==="dark"&&!("dark"in n)||h==="light"&&!("light"in n))&&(x=!0),!x)throw new Error(Kh(21,h));let F;o&&(F="oklch");const _=fI(F,w,x,d,h);v&&!w.light&&fI(F,w,v,void 0,"light"),b&&!w.dark&&fI(F,w,b,void 0,"dark");let T={defaultColorScheme:h,..._,cssVarPrefix:a,colorSchemeSelector:l,rootSelector:c,getCssVar:m,colorSchemes:w,font:{...gdt(_.typography),..._.font},spacing:Mdt(d.spacing)};Object.keys(T.colorSchemes).forEach(U=>{const R=T.colorSchemes[U].palette,ee=le=>{const H=le.split("-"),te=H[1],X=H[2];return m(le,R[te][X])};R.mode==="light"&&(vt(R.common,"background","#fff"),vt(R.common,"onBackground","#000")),R.mode==="dark"&&(vt(R.common,"background","#000"),vt(R.common,"onBackground","#fff"));function K(le,H,te){if(F){let X;return le===nh&&(X=`transparent ${((1-te)*100).toFixed(0)}%`),le===ar&&(X=`#000 ${(te*100).toFixed(0)}%`),le===or&&(X=`#fff ${(te*100).toFixed(0)}%`),`color-mix(in ${F}, ${H}, ${X})`}return le(H,te)}if(Udt(R,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),R.mode==="light"){vt(R.Alert,"errorColor",K(ar,R.error.light,.6)),vt(R.Alert,"infoColor",K(ar,R.info.light,.6)),vt(R.Alert,"successColor",K(ar,R.success.light,.6)),vt(R.Alert,"warningColor",K(ar,R.warning.light,.6)),vt(R.Alert,"errorFilledBg",ee("palette-error-main")),vt(R.Alert,"infoFilledBg",ee("palette-info-main")),vt(R.Alert,"successFilledBg",ee("palette-success-main")),vt(R.Alert,"warningFilledBg",ee("palette-warning-main")),vt(R.Alert,"errorFilledColor",nu(()=>R.getContrastText(R.error.main))),vt(R.Alert,"infoFilledColor",nu(()=>R.getContrastText(R.info.main))),vt(R.Alert,"successFilledColor",nu(()=>R.getContrastText(R.success.main))),vt(R.Alert,"warningFilledColor",nu(()=>R.getContrastText(R.warning.main))),vt(R.Alert,"errorStandardBg",K(or,R.error.light,.9)),vt(R.Alert,"infoStandardBg",K(or,R.info.light,.9)),vt(R.Alert,"successStandardBg",K(or,R.success.light,.9)),vt(R.Alert,"warningStandardBg",K(or,R.warning.light,.9)),vt(R.Alert,"errorIconColor",ee("palette-error-main")),vt(R.Alert,"infoIconColor",ee("palette-info-main")),vt(R.Alert,"successIconColor",ee("palette-success-main")),vt(R.Alert,"warningIconColor",ee("palette-warning-main")),vt(R.AppBar,"defaultBg",ee("palette-grey-100")),vt(R.Avatar,"defaultBg",ee("palette-grey-400")),vt(R.Button,"inheritContainedBg",ee("palette-grey-300")),vt(R.Button,"inheritContainedHoverBg",ee("palette-grey-A100")),vt(R.Chip,"defaultBorder",ee("palette-grey-400")),vt(R.Chip,"defaultAvatarColor",ee("palette-grey-700")),vt(R.Chip,"defaultIconColor",ee("palette-grey-700")),vt(R.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),vt(R.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),vt(R.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),vt(R.LinearProgress,"primaryBg",K(or,R.primary.main,.62)),vt(R.LinearProgress,"secondaryBg",K(or,R.secondary.main,.62)),vt(R.LinearProgress,"errorBg",K(or,R.error.main,.62)),vt(R.LinearProgress,"infoBg",K(or,R.info.main,.62)),vt(R.LinearProgress,"successBg",K(or,R.success.main,.62)),vt(R.LinearProgress,"warningBg",K(or,R.warning.main,.62)),vt(R.Skeleton,"bg",F?K(nh,R.text.primary,.11):`rgba(${ee("palette-text-primaryChannel")} / 0.11)`),vt(R.Slider,"primaryTrack",K(or,R.primary.main,.62)),vt(R.Slider,"secondaryTrack",K(or,R.secondary.main,.62)),vt(R.Slider,"errorTrack",K(or,R.error.main,.62)),vt(R.Slider,"infoTrack",K(or,R.info.main,.62)),vt(R.Slider,"successTrack",K(or,R.success.main,.62)),vt(R.Slider,"warningTrack",K(or,R.warning.main,.62));const le=F?K(ar,R.background.default,.6825):Gw(R.background.default,.8);vt(R.SnackbarContent,"bg",le),vt(R.SnackbarContent,"color",nu(()=>F?NR.text.primary:R.getContrastText(le))),vt(R.SpeedDialAction,"fabHoverBg",Gw(R.background.paper,.15)),vt(R.StepConnector,"border",ee("palette-grey-400")),vt(R.StepContent,"border",ee("palette-grey-400")),vt(R.Switch,"defaultColor",ee("palette-common-white")),vt(R.Switch,"defaultDisabledColor",ee("palette-grey-100")),vt(R.Switch,"primaryDisabledColor",K(or,R.primary.main,.62)),vt(R.Switch,"secondaryDisabledColor",K(or,R.secondary.main,.62)),vt(R.Switch,"errorDisabledColor",K(or,R.error.main,.62)),vt(R.Switch,"infoDisabledColor",K(or,R.info.main,.62)),vt(R.Switch,"successDisabledColor",K(or,R.success.main,.62)),vt(R.Switch,"warningDisabledColor",K(or,R.warning.main,.62)),vt(R.TableCell,"border",K(or,K(nh,R.divider,1),.88)),vt(R.Tooltip,"bg",K(nh,R.grey[700],.92))}if(R.mode==="dark"){vt(R.Alert,"errorColor",K(or,R.error.light,.6)),vt(R.Alert,"infoColor",K(or,R.info.light,.6)),vt(R.Alert,"successColor",K(or,R.success.light,.6)),vt(R.Alert,"warningColor",K(or,R.warning.light,.6)),vt(R.Alert,"errorFilledBg",ee("palette-error-dark")),vt(R.Alert,"infoFilledBg",ee("palette-info-dark")),vt(R.Alert,"successFilledBg",ee("palette-success-dark")),vt(R.Alert,"warningFilledBg",ee("palette-warning-dark")),vt(R.Alert,"errorFilledColor",nu(()=>R.getContrastText(R.error.dark))),vt(R.Alert,"infoFilledColor",nu(()=>R.getContrastText(R.info.dark))),vt(R.Alert,"successFilledColor",nu(()=>R.getContrastText(R.success.dark))),vt(R.Alert,"warningFilledColor",nu(()=>R.getContrastText(R.warning.dark))),vt(R.Alert,"errorStandardBg",K(ar,R.error.light,.9)),vt(R.Alert,"infoStandardBg",K(ar,R.info.light,.9)),vt(R.Alert,"successStandardBg",K(ar,R.success.light,.9)),vt(R.Alert,"warningStandardBg",K(ar,R.warning.light,.9)),vt(R.Alert,"errorIconColor",ee("palette-error-main")),vt(R.Alert,"infoIconColor",ee("palette-info-main")),vt(R.Alert,"successIconColor",ee("palette-success-main")),vt(R.Alert,"warningIconColor",ee("palette-warning-main")),vt(R.AppBar,"defaultBg",ee("palette-grey-900")),vt(R.AppBar,"darkBg",ee("palette-background-paper")),vt(R.AppBar,"darkColor",ee("palette-text-primary")),vt(R.Avatar,"defaultBg",ee("palette-grey-600")),vt(R.Button,"inheritContainedBg",ee("palette-grey-800")),vt(R.Button,"inheritContainedHoverBg",ee("palette-grey-700")),vt(R.Chip,"defaultBorder",ee("palette-grey-700")),vt(R.Chip,"defaultAvatarColor",ee("palette-grey-300")),vt(R.Chip,"defaultIconColor",ee("palette-grey-300")),vt(R.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),vt(R.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),vt(R.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),vt(R.LinearProgress,"primaryBg",K(ar,R.primary.main,.5)),vt(R.LinearProgress,"secondaryBg",K(ar,R.secondary.main,.5)),vt(R.LinearProgress,"errorBg",K(ar,R.error.main,.5)),vt(R.LinearProgress,"infoBg",K(ar,R.info.main,.5)),vt(R.LinearProgress,"successBg",K(ar,R.success.main,.5)),vt(R.LinearProgress,"warningBg",K(ar,R.warning.main,.5)),vt(R.Skeleton,"bg",F?K(nh,R.text.primary,.13):`rgba(${ee("palette-text-primaryChannel")} / 0.13)`),vt(R.Slider,"primaryTrack",K(ar,R.primary.main,.5)),vt(R.Slider,"secondaryTrack",K(ar,R.secondary.main,.5)),vt(R.Slider,"errorTrack",K(ar,R.error.main,.5)),vt(R.Slider,"infoTrack",K(ar,R.info.main,.5)),vt(R.Slider,"successTrack",K(ar,R.success.main,.5)),vt(R.Slider,"warningTrack",K(ar,R.warning.main,.5));const le=F?K(or,R.background.default,.985):Gw(R.background.default,.98);vt(R.SnackbarContent,"bg",le),vt(R.SnackbarContent,"color",nu(()=>F?fve.text.primary:R.getContrastText(le))),vt(R.SpeedDialAction,"fabHoverBg",Gw(R.background.paper,.15)),vt(R.StepConnector,"border",ee("palette-grey-600")),vt(R.StepContent,"border",ee("palette-grey-600")),vt(R.Switch,"defaultColor",ee("palette-grey-300")),vt(R.Switch,"defaultDisabledColor",ee("palette-grey-600")),vt(R.Switch,"primaryDisabledColor",K(ar,R.primary.main,.55)),vt(R.Switch,"secondaryDisabledColor",K(ar,R.secondary.main,.55)),vt(R.Switch,"errorDisabledColor",K(ar,R.error.main,.55)),vt(R.Switch,"infoDisabledColor",K(ar,R.info.main,.55)),vt(R.Switch,"successDisabledColor",K(ar,R.success.main,.55)),vt(R.Switch,"warningDisabledColor",K(ar,R.warning.main,.55)),vt(R.TableCell,"border",K(ar,K(nh,R.divider,1),.68)),vt(R.Tooltip,"bg",K(nh,R.grey[700],.92))}bf(R.background,"default"),bf(R.background,"paper"),bf(R.common,"background"),bf(R.common,"onBackground"),bf(R,"divider"),Object.keys(R).forEach(le=>{const H=R[le];le!=="tonalOffset"&&H&&typeof H=="object"&&(H.main&&vt(R[le],"mainChannel",Xy(Zy(H.main))),H.light&&vt(R[le],"lightChannel",Xy(Zy(H.light))),H.dark&&vt(R[le],"darkChannel",Xy(Zy(H.dark))),H.contrastText&&vt(R[le],"contrastTextChannel",Xy(Zy(H.contrastText))),le==="text"&&(bf(R[le],"primary"),bf(R[le],"secondary")),le==="action"&&(H.active&&bf(R[le],"active"),H.selected&&bf(R[le],"selected")))})}),T=e.reduce((U,R)=>Ol(U,R),T);const B={prefix:a,disableCssColorScheme:r,shouldSkipGeneratingVar:s,getSelector:Ldt(T),enableContrastVars:o},{vars:O,generateThemeVars:P,generateStyleSheets:G}=ldt(T,B);return T.vars=O,Object.entries(T.colorSchemes[T.defaultColorScheme]).forEach(([U,R])=>{T[U]=R}),T.generateThemeVars=P,T.generateStyleSheets=G,T.generateSpacing=function(){return eve(d.spacing,DU(this))},T.getColorSchemeSelector=cdt(l),T.spacing=T.generateSpacing(),T.shouldSkipGeneratingVar=s,T.unstable_sxConfig={...h1,...d?.unstable_sxConfig},T.unstable_sx=function(R){return p1({sx:R,theme:this})},T.toRuntimeSource=hve,T}function ZY(t,e,n){t.colorSchemes&&n&&(t.colorSchemes[e]={...n!==!0&&n,palette:UU({...n===!0?{}:n.palette,mode:e})})}function MU(t={},...e){const{palette:n,cssVariables:i=!1,colorSchemes:r=n?void 0:{light:!0},defaultColorScheme:a=n?.mode,...o}=t,s=a||"light",l=r?.[s],c={...r,...n?{[s]:{...typeof l!="boolean"&&l,palette:n}}:void 0};if(i===!1){if(!("colorSchemes"in t))return xR(t,...e);let d=n;"palette"in t||c[s]&&(c[s]!==!0?d=c[s].palette:s==="dark"&&(d={mode:"dark"}));const f=xR({...t,palette:d},...e);return f.defaultColorScheme=s,f.colorSchemes=c,f.palette.mode==="light"&&(f.colorSchemes.light={...c.light!==!0&&c.light,palette:f.palette},ZY(f,"dark",c.dark)),f.palette.mode==="dark"&&(f.colorSchemes.dark={...c.dark!==!0&&c.dark,palette:f.palette},ZY(f,"light",c.light)),f}return!n&&!("light"in c)&&s==="light"&&(c.light=!0),jdt({...o,colorSchemes:c,defaultColorScheme:s,...typeof i!="boolean"&&i},...e)}const Qdt=MU();function Hdt({theme:t,...e}){const n=xh in t?t[xh]:void 0;return y.jsx(cve,{...e,themeId:n?xh:void 0,theme:n||t})}const qw={colorSchemeStorageKey:"mui-color-scheme",defaultLightColorScheme:"light",defaultDarkColorScheme:"dark",modeStorageKey:"mui-mode"},{CssVarsProvider:zdt}=rdt({themeId:xh,theme:()=>MU({cssVariables:!0}),colorSchemeStorageKey:qw.colorSchemeStorageKey,modeStorageKey:qw.modeStorageKey,defaultColorScheme:{light:qw.defaultLightColorScheme,dark:qw.defaultDarkColorScheme},resolveTheme:t=>{const e={...t,typography:mve(t.palette,t.typography)};return e.unstable_sx=function(i){return p1({sx:i,theme:this})},e}}),Vdt=zdt;function Gdt({theme:t,...e}){const n=N.useMemo(()=>{if(typeof t=="function")return t;const i=xh in t?t[xh]:t;return"colorSchemes"in i?null:"vars"in i?t:{...t,vars:null}},[t]);return n?y.jsx(Hdt,{theme:n,...e}):y.jsx(Vdt,{theme:t,...e})}function qdt(t){return y.jsx(nve,{...t,defaultTheme:Qdt,themeId:xh})}function vve(t){return function(n){return y.jsx(qdt,{styles:typeof t=="function"?i=>t({theme:i,...n}):t})}}function qgt(){return Ict}function Kdt(t){return Gct(t)}const FR=typeof vve({})=="function",Wdt=(t,e)=>({WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%",...e&&!t.vars&&{colorScheme:t.palette.mode}}),Ydt=t=>({color:(t.vars||t).palette.text.primary,...t.typography.body1,backgroundColor:(t.vars||t).palette.background.default,"@media print":{backgroundColor:(t.vars||t).palette.common.white}}),yve=(t,e=!1)=>{const n={};e&&t.colorSchemes&&typeof t.getColorSchemeSelector=="function"&&Object.entries(t.colorSchemes).forEach(([a,o])=>{const s=t.getColorSchemeSelector(a);s.startsWith("@")?n[s]={":root":{colorScheme:o.palette?.mode}}:n[s.replace(/\s*&/,"")]={colorScheme:o.palette?.mode}});let i={html:Wdt(t,e),"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:t.typography.fontWeightBold},body:{margin:0,...Ydt(t),"&::backdrop":{backgroundColor:(t.vars||t).palette.background.default}},...n};const r=t.components?.MuiCssBaseline?.styleOverrides;return r&&(i=[i,r]),i},TN="mui-ecs",Xdt=t=>{const e=yve(t,!1),n=Array.isArray(e)?e[0]:e;return!t.vars&&n&&(n.html[`:root:has(${TN})`]={colorScheme:t.palette.mode}),t.colorSchemes&&Object.entries(t.colorSchemes).forEach(([i,r])=>{const a=t.getColorSchemeSelector(i);a.startsWith("@")?n[a]={[`:root:not(:has(.${TN}))`]:{colorScheme:r.palette?.mode}}:n[a.replace(/\s*&/,"")]={[`&:not(:has(.${TN}))`]:{colorScheme:r.palette?.mode}}}),e},Zdt=vve(FR?({theme:t,enableColorScheme:e})=>yve(t,e):({theme:t})=>Xdt(t));function Jdt(t){const e=Kdt({props:t,name:"MuiCssBaseline"}),{children:n,enableColorScheme:i=!1}=e;return y.jsxs(N.Fragment,{children:[FR&&y.jsx(Zdt,{enableColorScheme:i}),!FR&&!i&&y.jsx("span",{className:TN,style:{display:"none"}}),n]})}var rE=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},eut={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},tut=class{#e=eut;#t=!1;setTimeoutProvider(t){this.#e=t}setTimeout(t,e){return this.#e.setTimeout(t,e)}clearTimeout(t){this.#e.clearTimeout(t)}setInterval(t,e){return this.#e.setInterval(t,e)}clearInterval(t){this.#e.clearInterval(t)}},_R=new tut;function nut(t){setTimeout(t,0)}var aE=typeof window>"u"||"Deno"in globalThis;function cd(){}function iut(t,e){return typeof t=="function"?t(e):t}function rut(t){return typeof t=="number"&&t>=0&&t!==1/0}function aut(t,e){return Math.max(t+(e||0)-Date.now(),0)}function CR(t,e){return typeof t=="function"?t(e):t}function out(t,e){return typeof t=="function"?t(e):t}function JY(t,e){const{type:n="all",exact:i,fetchStatus:r,predicate:a,queryKey:o,stale:s}=t;if(o){if(i){if(e.queryHash!==$U(o,e.options))return!1}else if(!Zk(e.queryKey,o))return!1}if(n!=="all"){const l=e.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof s=="boolean"&&e.isStale()!==s||r&&r!==e.state.fetchStatus||a&&!a(e))}function eX(t,e){const{exact:n,status:i,predicate:r,mutationKey:a}=t;if(a){if(!e.options.mutationKey)return!1;if(n){if(Xk(e.options.mutationKey)!==Xk(a))return!1}else if(!Zk(e.options.mutationKey,a))return!1}return!(i&&e.state.status!==i||r&&!r(e))}function $U(t,e){return(e?.queryKeyHashFn||Xk)(t)}function Xk(t){return JSON.stringify(t,(e,n)=>ER(n)?Object.keys(n).sort().reduce((i,r)=>(i[r]=n[r],i),{}):n)}function Zk(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>Zk(t[n],e[n])):!1}var sut=Object.prototype.hasOwnProperty;function kve(t,e){if(t===e)return t;const n=tX(t)&&tX(e);if(!n&&!(ER(t)&&ER(e)))return e;const r=(n?t:Object.keys(t)).length,a=n?e:Object.keys(e),o=a.length,s=n?new Array(o):{};let l=0;for(let c=0;c<o;c++){const d=n?c:a[c],f=t[d],h=e[d];if(f===h){s[d]=f,(n?c<r:sut.call(t,d))&&l++;continue}if(f===null||h===null||typeof f!="object"||typeof h!="object"){s[d]=h;continue}const m=kve(f,h);s[d]=m,m===f&&l++}return r===o&&l===r?t:s}function tX(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function ER(t){if(!nX(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!nX(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function nX(t){return Object.prototype.toString.call(t)==="[object Object]"}function lut(t){return new Promise(e=>{_R.setTimeout(e,t)})}function cut(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?kve(t,e):e}function dut(t,e,n=0){const i=[...t,e];return n&&i.length>n?i.slice(1):i}function uut(t,e,n=0){const i=[e,...t];return n&&i.length>n?i.slice(0,-1):i}var jU=Symbol();function bve(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:!t.queryFn||t.queryFn===jU?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function fut(t,e,n){let i=!1,r;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(r??=e(),i||(i=!0,r.aborted?n():r.addEventListener("abort",n,{once:!0})),r)}),t}var Aut=class extends rE{#e;#t;#n;constructor(){super(),this.#n=t=>{if(!aE&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#n=t,this.#t?.(),this.#t=t(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(t){this.#e!==t&&(this.#e=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Sve=new Aut;function mut(){let t,e;const n=new Promise((r,a)=>{t=r,e=a});n.status="pending",n.catch(()=>{});function i(r){Object.assign(n,r),delete n.resolve,delete n.reject}return n.resolve=r=>{i({status:"fulfilled",value:r}),t(r)},n.reject=r=>{i({status:"rejected",reason:r}),e(r)},n}var hut=nut;function put(){let t=[],e=0,n=s=>{s()},i=s=>{s()},r=hut;const a=s=>{e?t.push(s):r(()=>{n(s)})},o=()=>{const s=t;t=[],s.length&&r(()=>{i(()=>{s.forEach(l=>{n(l)})})})};return{batch:s=>{let l;e++;try{l=s()}finally{e--,e||o()}return l},batchCalls:s=>(...l)=>{a(()=>{s(...l)})},schedule:a,setNotifyFunction:s=>{n=s},setBatchNotifyFunction:s=>{i=s},setScheduler:s=>{r=s}}}var gs=put(),gut=class extends rE{#e=!0;#t;#n;constructor(){super(),this.#n=t=>{if(!aE&&window.addEventListener){const e=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#n=t,this.#t?.(),this.#t=t(this.setOnline.bind(this))}setOnline(t){this.#e!==t&&(this.#e=t,this.listeners.forEach(n=>{n(t)}))}isOnline(){return this.#e}},f2=new gut;function vut(t){return Math.min(1e3*2**t,3e4)}function wve(t){return(t??"online")==="online"?f2.isOnline():!0}var BR=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function Nve(t){let e=!1,n=0,i;const r=mut(),a=()=>r.status!=="pending",o=v=>{if(!a()){const b=new BR(v);h(b),t.onCancel?.(b)}},s=()=>{e=!0},l=()=>{e=!1},c=()=>Sve.isFocused()&&(t.networkMode==="always"||f2.isOnline())&&t.canRun(),d=()=>wve(t.networkMode)&&t.canRun(),f=v=>{a()||(i?.(),r.resolve(v))},h=v=>{a()||(i?.(),r.reject(v))},m=()=>new Promise(v=>{i=b=>{(a()||c())&&v(b)},t.onPause?.()}).then(()=>{i=void 0,a()||t.onContinue?.()}),g=()=>{if(a())return;let v;const b=n===0?t.initialPromise:void 0;try{v=b??t.fn()}catch(k){v=Promise.reject(k)}Promise.resolve(v).then(f).catch(k=>{if(a())return;const w=t.retry??(aE?0:3),x=t.retryDelay??vut,F=typeof x=="function"?x(n,k):x,_=w===!0||typeof w=="number"&&n<w||typeof w=="function"&&w(n,k);if(e||!_){h(k);return}n++,t.onFail?.(n,k),lut(F).then(()=>c()?void 0:m()).then(()=>{e?h(k):g()})})};return{promise:r,status:()=>r.status,cancel:o,continue:()=>(i?.(),r),cancelRetry:s,continueRetry:l,canStart:d,start:()=>(d()?g():m().then(g),r)}}var xve=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),rut(this.gcTime)&&(this.#e=_R.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(aE?1/0:300*1e3))}clearGcTimeout(){this.#e&&(_R.clearTimeout(this.#e),this.#e=void 0)}},yut=class extends xve{#e;#t;#n;#i;#r;#o;#a;constructor(t){super(),this.#a=!1,this.#o=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#i=t.client,this.#n=this.#i.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#e=rX(this.options),this.state=t.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(t){if(this.options={...this.#o,...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const e=rX(this.options);e.data!==void 0&&(this.setState(iX(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(t,e){const n=cut(this.state.data,t,this.options);return this.#s({data:n,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),n}setState(t,e){this.#s({type:"setState",state:t,setStateOptions:e})}cancel(t){const e=this.#r?.promise;return this.#r?.cancel(t),e?e.then(cd).catch(cd):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(t=>out(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===jU||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>CR(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!aut(this.state.dataUpdatedAt,t)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(this.#r&&(this.#a?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(t,e){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(t&&this.setOptions(t),!this.options.queryFn){const s=this.observers.find(l=>l.options.queryFn);s&&this.setOptions(s.options)}const n=new AbortController,i=s=>{Object.defineProperty(s,"signal",{enumerable:!0,get:()=>(this.#a=!0,n.signal)})},r=()=>{const s=bve(this.options,e),c=(()=>{const d={client:this.#i,queryKey:this.queryKey,meta:this.meta};return i(d),d})();return this.#a=!1,this.options.persister?this.options.persister(s,c,this):s(c)},o=(()=>{const s={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:r};return i(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.#r=Nve({initialPromise:e?.initialPromise,fn:o.fetchFn,onCancel:s=>{s instanceof BR&&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.#r.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 BR){if(s.silent)return this.#r.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(t){const e=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...kut(n.data,this.options),fetchMeta:t.meta??null};case"success":const i={...n,...iX(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=t.manual?i:void 0,i;case"error":const r=t.error;return{...n,error:r,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=e(this.state),gs.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:t})})}};function kut(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:wve(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function iX(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function rX(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,i=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}function aX(t){return{onFetch:(e,n)=>{const i=e.options,r=e.fetchOptions?.meta?.fetchMore?.direction,a=e.state.data?.pages||[],o=e.state.data?.pageParams||[];let s={pages:[],pageParams:[]},l=0;const c=async()=>{let d=!1;const f=g=>{fut(g,()=>e.signal,()=>d=!0)},h=bve(e.options,e.fetchOptions),m=async(g,v,b)=>{if(d)return Promise.reject();if(v==null&&g.pages.length)return Promise.resolve(g);const w=(()=>{const T={client:e.client,queryKey:e.queryKey,pageParam:v,direction:b?"backward":"forward",meta:e.options.meta};return f(T),T})(),x=await h(w),{maxPages:F}=e.options,_=b?uut:dut;return{pages:_(g.pages,x,F),pageParams:_(g.pageParams,v,F)}};if(r&&a.length){const g=r==="backward",v=g?but:oX,b={pages:a,pageParams:o},k=v(i,b);s=await m(b,k,g)}else{const g=t??a.length;do{const v=l===0?o[0]??i.initialPageParam:oX(i,s);if(l>0&&v==null)break;s=await m(s,v),l++}while(l<g)}return s};e.options.persister?e.fetchFn=()=>e.options.persister?.(c,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n):e.fetchFn=c}}}function oX(t,{pages:e,pageParams:n}){const i=e.length-1;return e.length>0?t.getNextPageParam(e[i],e,n[i],n):void 0}function but(t,{pages:e,pageParams:n}){return e.length>0?t.getPreviousPageParam?.(e[0],e,n[0],n):void 0}var Sut=class extends xve{#e;#t;#n;#i;constructor(t){super(),this.#e=t.client,this.mutationId=t.mutationId,this.#n=t.mutationCache,this.#t=[],this.state=t.state||wut(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#t.includes(t)||(this.#t.push(t),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#t=this.#t.filter(e=>e!==t),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(t){const e=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=Nve({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(a,o)=>{this.#r({type:"failed",failureCount:a,error:o})},onPause:()=>{this.#r({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const i=this.state.status==="pending",r=!this.#i.canStart();try{if(i)e();else{this.#r({type:"pending",variables:t,isPaused:r}),await this.#n.config.onMutate?.(t,this,n);const o=await this.options.onMutate?.(t,n);o!==this.state.context&&this.#r({type:"pending",context:o,variables:t,isPaused:r})}const a=await this.#i.start();return await this.#n.config.onSuccess?.(a,t,this.state.context,this,n),await this.options.onSuccess?.(a,t,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,t,this.state.context,n),this.#r({type:"success",data:a}),a}catch(a){try{await this.#n.config.onError?.(a,t,this.state.context,this,n)}catch(o){Promise.reject(o)}try{await this.options.onError?.(a,t,this.state.context,n)}catch(o){Promise.reject(o)}try{await this.#n.config.onSettled?.(void 0,a,this.state.variables,this.state.context,this,n)}catch(o){Promise.reject(o)}try{await this.options.onSettled?.(void 0,a,t,this.state.context,n)}catch(o){Promise.reject(o)}throw this.#r({type:"error",error:a}),a}finally{this.#n.runNext(this)}}#r(t){const e=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=e(this.state),gs.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(t)}),this.#n.notify({mutation:this,type:"updated",action:t})})}};function wut(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Nut=class extends rE{constructor(t={}){super(),this.config=t,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(t,e,n){const i=new Sut({client:t,mutationCache:this,mutationId:++this.#n,options:t.defaultMutationOptions(e),state:n});return this.add(i),i}add(t){this.#e.add(t);const e=Kw(t);if(typeof e=="string"){const n=this.#t.get(e);n?n.push(t):this.#t.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#e.delete(t)){const e=Kw(t);if(typeof e=="string"){const n=this.#t.get(e);if(n)if(n.length>1){const i=n.indexOf(t);i!==-1&&n.splice(i,1)}else n[0]===t&&this.#t.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=Kw(t);if(typeof e=="string"){const i=this.#t.get(e)?.find(r=>r.state.status==="pending");return!i||i===t}else return!0}runNext(t){const e=Kw(t);return typeof e=="string"?this.#t.get(e)?.find(i=>i!==t&&i.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){gs.batch(()=>{this.#e.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(t){const e={exact:!0,...t};return this.getAll().find(n=>eX(e,n))}findAll(t={}){return this.getAll().filter(e=>eX(t,e))}notify(t){gs.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(e=>e.state.isPaused);return gs.batch(()=>Promise.all(t.map(e=>e.continue().catch(cd))))}};function Kw(t){return t.options.scope?.id}var xut=class extends rE{constructor(t={}){super(),this.config=t,this.#e=new Map}#e;build(t,e,n){const i=e.queryKey,r=e.queryHash??$U(i,e);let a=this.get(r);return a||(a=new yut({client:t,queryKey:i,queryHash:r,options:t.defaultQueryOptions(e),state:n,defaultOptions:t.getQueryDefaults(i)}),this.add(a)),a}add(t){this.#e.has(t.queryHash)||(this.#e.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=this.#e.get(t.queryHash);e&&(t.destroy(),e===t&&this.#e.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){gs.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#e.get(t)}getAll(){return[...this.#e.values()]}find(t){const e={exact:!0,...t};return this.getAll().find(n=>JY(e,n))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(n=>JY(t,n)):e}notify(t){gs.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){gs.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){gs.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Fut=class{#e;#t;#n;#i;#r;#o;#a;#s;constructor(t={}){this.#e=t.queryCache||new xut,this.#t=t.mutationCache||new Nut,this.#n=t.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#a=Sve.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=f2.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#o--,this.#o===0&&(this.#a?.(),this.#a=void 0,this.#s?.(),this.#s=void 0)}isFetching(t){return this.#e.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#t.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#e.get(e.queryHash)?.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=this.#e.build(this,e),i=n.state.data;return i===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(CR(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(i))}getQueriesData(t){return this.#e.findAll(t).map(({queryKey:e,state:n})=>{const i=n.data;return[e,i]})}setQueryData(t,e,n){const i=this.defaultQueryOptions({queryKey:t}),a=this.#e.get(i.queryHash)?.state.data,o=iut(e,a);if(o!==void 0)return this.#e.build(this,i).setData(o,{...n,manual:!0})}setQueriesData(t,e,n){return gs.batch(()=>this.#e.findAll(t).map(({queryKey:i})=>[i,this.setQueryData(i,e,n)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#e.get(e.queryHash)?.state}removeQueries(t){const e=this.#e;gs.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=this.#e;return gs.batch(()=>(n.findAll(t).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},i=gs.batch(()=>this.#e.findAll(t).map(r=>r.cancel(n)));return Promise.all(i).then(cd).catch(cd)}invalidateQueries(t,e={}){return gs.batch(()=>(this.#e.findAll(t).forEach(n=>{n.invalidate()}),t?.refetchType==="none"?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},i=gs.batch(()=>this.#e.findAll(t).filter(r=>!r.isDisabled()&&!r.isStatic()).map(r=>{let a=r.fetch(void 0,n);return n.throwOnError||(a=a.catch(cd)),r.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(i).then(cd)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=this.#e.build(this,e);return n.isStaleByTime(CR(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(cd).catch(cd)}fetchInfiniteQuery(t){return t.behavior=aX(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(cd).catch(cd)}ensureInfiniteQueryData(t){return t.behavior=aX(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return f2.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(t){this.#n=t}setQueryDefaults(t,e){this.#i.set(Xk(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...this.#i.values()],n={};return e.forEach(i=>{Zk(t,i.queryKey)&&Object.assign(n,i.defaultOptions)}),n}setMutationDefaults(t,e){this.#r.set(Xk(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...this.#r.values()],n={};return e.forEach(i=>{Zk(t,i.mutationKey)&&Object.assign(n,i.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...this.#n.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=$U(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===jU&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#n.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},_ut=N.createContext(void 0),Cut=({client:t,children:e})=>(N.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),y.jsx(_ut.Provider,{value:t,children:e}));function Eut(){const t=VX();return N.useEffect(()=>{const e=t[t.length-1],n=e?.handle;if(n?.title){const i=typeof n.title=="function"?n.title(e.data):n.title;document.title=`${i} - Accounter`}else document.title="Accounter"},[t]),y.jsx("div",{style:{display:"none"}})}var But=(t,e,n,i,r,a,o,s)=>{let l=document.documentElement,c=["light","dark"];function d(m){(Array.isArray(t)?t:[t]).forEach(g=>{let v=g==="class",b=v&&a?r.map(k=>a[k]||k):r;v?(l.classList.remove(...b),l.classList.add(a&&a[m]?a[m]:m)):l.setAttribute(g,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(i)d(i);else try{let m=localStorage.getItem(e)||n,g=o&&m==="system"?h():m;d(g)}catch{}},Dut=N.createContext(void 0),Tut={setTheme:t=>{},themes:[]},Iut=()=>{var t;return(t=N.useContext(Dut))!=null?t:Tut};N.memo(({forcedTheme:t,storageKey:e,attribute:n,enableSystem:i,enableColorScheme:r,defaultTheme:a,value:o,themes:s,nonce:l,scriptProps:c})=>{let d=JSON.stringify([n,e,a,t,s,o,i,r]).slice(1,-1);return N.createElement("script",{...c,suppressHydrationWarning:!0,nonce:typeof window>"u"?l:"",dangerouslySetInnerHTML:{__html:`(${But.toString()})(${d})`}})});const Out=({...t})=>{const{theme:e="system"}=Iut();return y.jsx(sTe,{theme:e,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"}},...t})},Rut=new Fut({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}}),Put=MU({palette:{primary:{main:"#556cd6"},secondary:{main:"#19857b"},error:{main:ah.A400}}});function Lut(){return y.jsx(Sne,{withGlobalStyles:!0,theme:{fontFamily:"Roboto, sans-serif",fontSizes:{md:"14"}},children:y.jsxs(Gdt,{theme:Put,children:[y.jsx(Jdt,{}),y.jsxs(ODe,{children:[y.jsx(Out,{}),y.jsx(lTe,{children:y.jsx(Cut,{client:Rut,children:y.jsxs(Ust,{children:[y.jsx(Eut,{}),y.jsx(Kge,{}),y.jsx(KX,{})]})})})]})]})})}function Uut(){if(!new pb().isLoggedIn())throw xX(jn.LOGIN);return null}function Mut(){if(new pb().isLoggedIn())throw xX(jn.HOME);return null}let Ww=null;function Fve(){if(Ww)return Ww;const t=new pb;let e;return e="https://accounter.onrender.com/graphql",Ww=YZ({url:e,exchanges:[WZ({onResult(n){Lte(n)}}),Pte(async n=>({addAuthToOperation(i){const r=t.authToken();return r?n.appendHeaders(i,{Authorization:r}):i},didAuthError(i,r){return i?.response?.status===401||i?.graphQLErrors?.some(a=>a.extensions?.code==="FORBIDDEN")},async refreshAuth(){t.logout()}})),KZ]}),Ww}function $ut(t){if(!t.chargeId)throw new Response("Charge ID is required",{status:400});return{chargeId:t.chargeId}}function jut(t){if(!t.businessId)throw new Response("Business ID is required",{status:400});return{businessId:t.businessId}}async function Qut({params:t}){const{chargeId:e}=$ut(t),i=await Fve().query(HFe,{chargeId:e}).toPromise();if(!i.data?.charge)throw new Response("Charge not found",{status:404});return i.data}async function Hut({params:t}){const{businessId:e}=jut(t),i=await Fve().query(QFe,{businessId:e}).toPromise();if(!i.data?.business)throw new Response("Business not found",{status:404});return i.data}const sX=N.lazy(()=>Ai(()=>import("./all-charges-BqRr5A4S.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26])).then(t=>({default:t.AllCharges}))),zut=N.lazy(()=>Ai(()=>import("./missing-info-charges-DGgTFt-D.js"),__vite__mapDeps([27,1,9,10,11,12,13,6,14,15,16,17,18,19,20,21,22,23,24,25,3,26])).then(t=>({default:t.MissingInfoCharges}))),Vut=N.lazy(()=>Ai(()=>import("./charge-BZqb4exj.js"),__vite__mapDeps([28,9,10,11,12,13,6,14,15,16,17,18,19,20,21,22,23,24,25,3])).then(t=>({default:t.Charge}))),Gut=N.lazy(()=>Ai(()=>import("./charges-ledger-validation-vQXFL31X.js"),__vite__mapDeps([29,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,30])).then(t=>({default:t.ChargesLedgerValidation}))),qut=N.lazy(()=>Ai(()=>import("./index-BhoUb_ON.js"),__vite__mapDeps([31,1,32,33,18,26])).then(t=>({default:t.Businesses}))),Kut=N.lazy(()=>Ai(()=>import("./business-B33OdXng.js"),__vite__mapDeps([34,35,33,36,20,21,37,32,9,10,11,12,13,6,14,15,16,17,18,19,38,39,40,41,7])).then(t=>({default:t.BusinessScreen}))),Wut=N.lazy(()=>Ai(()=>import("./index-Clz8I9dK.js"),__vite__mapDeps([42,1,25,15,26,36,20,21,37,43,3,4,8,11])).then(t=>({default:t.BusinessLedgerRecordsSummery}))),Yut=N.lazy(()=>Ai(()=>import("./business-ledger-single-CLw2fXXF.js"),__vite__mapDeps([44,1,25,15,36,20,21,37,43,3,4,8])).then(t=>({default:t.BusinessLedgerRecordsSingle}))),Xut=N.lazy(()=>Ai(()=>import("./contracts-40v4c5wb.js"),__vite__mapDeps([45,40,20,21,4,41,7])).then(t=>({default:t.ContractsScreen}))),Zut=N.lazy(()=>Ai(()=>import("./index-Bk6qb18g.js"),__vite__mapDeps([46,47,14,16,15,10,11,8,13,24,26])).then(t=>({default:t.BusinessTrips}))),Jut=N.lazy(()=>Ai(()=>import("./business-trip-BDIbjeVM.js"),__vite__mapDeps([48,47,14,16,15,10,11,8,13,26])).then(t=>({default:t.BusinessTrip}))),eft=N.lazy(()=>Ai(()=>import("./index-DJDErZF_.js"),__vite__mapDeps([49,1,26,3,4])).then(t=>({default:t.ChartPage}))),tft=N.lazy(()=>Ai(()=>import("./index-C_D1SRFk.js"),__vite__mapDeps([50,1,26,3,4,51,39,5,6,7])).then(t=>({default:t.MonthlyIncomeExpenseChart}))),nft=N.lazy(()=>Ai(()=>import("./index-CR08bGyj.js"),__vite__mapDeps([52,1,25,15,53,3,26,4,8,5,6,7,54])).then(t=>({default:t.DocumentsReport}))),ift=N.lazy(()=>Ai(()=>import("./issue-document-DlLf2ULj.js"),__vite__mapDeps([55,26])).then(t=>({default:t.IssueDocumentScreen}))),rft=N.lazy(()=>Ai(()=>import("./index-BXi4oDGN.js"),__vite__mapDeps([56,41,7])).then(t=>({default:t.IssueDocuments}))),aft=N.lazy(()=>Ai(()=>import("./index-BANZ4FYC.js"),__vite__mapDeps([57,1,26,3,4,8,37,36,20,21,11,15])).then(t=>({default:t.TrialBalanceReport}))),oft=N.lazy(()=>Ai(()=>import("./index-b-MiIoC6.js"),__vite__mapDeps([58,1,54,37,36,20,21,51,11,4,8])).then(t=>({default:t.ContoReport}))),sft=N.lazy(()=>Ai(()=>import("./index-iu4sjTwc.js"),__vite__mapDeps([59,60,1,9,10,11,12,13,6,14,15,16,17,18,19,20,21,22,23,24,25,3,26,2,4,5,7,8])).then(t=>({default:t.VatMonthlyReport}))),lX=N.lazy(()=>Ai(()=>import("./index-_JHX2B8O.js"),__vite__mapDeps([61,60,26,62,10,11,15,3,23,4])).then(t=>({default:t.ProfitAndLossReport}))),cX=N.lazy(()=>Ai(()=>import("./index-_kREhIPr.js"),__vite__mapDeps([63,60,26,62,10,11,15,3,23,4])).then(t=>({default:t.TaxReport}))),lft=N.lazy(()=>Ai(()=>import("./index-CV3eOseE.js"),__vite__mapDeps([64,1,26,4])).then(t=>({default:t.DepreciationReport}))),cft=N.lazy(()=>Ai(()=>import("./index-DqYn-i8w.js"),__vite__mapDeps([65,26,23])).then(t=>({default:t.AnnualRevenueReport}))),dft=N.lazy(()=>Ai(()=>import("./index-Bps1VY5w.js"),__vite__mapDeps([66,4,33,21,35])).then(t=>({default:t.Shaam6111Report}))),uft=N.lazy(()=>Ai(()=>import("./index-DhMdXJus.js"),__vite__mapDeps([67,53,26,37,23])).then(t=>({default:t.YearlyLedgerReport}))),dX=N.lazy(()=>Ai(()=>import("./index-Djgjvx0H.js"),__vite__mapDeps([68,60,26,3,23,4,15])).then(t=>({default:t.CorporateTaxRulingComplianceReport}))),fft=N.lazy(()=>Ai(()=>import("./index-CcCOZohd.js"),__vite__mapDeps([69,1,26,38,12,13,6,14,39,3,4,8,5,7])).then(t=>({default:t.BalanceReport}))),Aft=N.lazy(()=>Ai(()=>import("./index-Cwq6ofsb.js"),__vite__mapDeps([70,1,26,19,3,4])).then(t=>({default:t.ValidateReportsScreen}))),mft=N.lazy(()=>Ai(()=>import("./accountant-approvals-DtBIRZC5.js"),__vite__mapDeps([71,1,2,3,4,5,6,7,8,26,30])).then(t=>({default:t.AccountantApprovals}))),hft=N.lazy(()=>Ai(()=>import("./index-BlXqh5bw.js"),__vite__mapDeps([72,1,26,3,4,8])).then(t=>({default:t.Salaries}))),pft=N.lazy(()=>Ai(()=>import("./index-HOYMUDFE.js"),__vite__mapDeps([73,26,14])).then(t=>({default:t.TagsManager}))),gft=N.lazy(()=>Ai(()=>import("./index-hOl2Gwvk.js"),__vite__mapDeps([74,53,26,54])).then(t=>({default:t.TaxCategories}))),vft=N.lazy(()=>Ai(()=>import("./index-qqIdqRd-.js"),__vite__mapDeps([75,53,26,54])).then(t=>({default:t.SortCodes}))),yft=N.lazy(()=>Ai(()=>import("./index-nugs82ok.js"),__vite__mapDeps([76,17])).then(t=>({default:t.DepositsScreen}))),kft=N.lazy(()=>Ai(()=>import("./page-not-found-BTbs3XmD.js"),[]).then(t=>({default:t.PageNotFound}))),bft=N.lazy(()=>Ai(()=>import("./login-page-Ck5nqn-L.js"),[]).then(t=>({default:t.LoginPage})));function ci(t,e){return y.jsx(N.Suspense,{fallback:e||y.jsx(Nwe,{}),children:y.jsx(t,{})})}const Sft=[{path:"/",element:y.jsx(Lut,{}),errorElement:y.jsx(dj,{}),children:[{path:jn.LOGIN,loader:Mut,element:ci(bft),handle:{title:"Login"}},{path:"/",loader:Uut,element:y.jsx(Slt,{}),errorElement:y.jsx(dj,{}),children:[{index:!0,element:ci(sX,y.jsx(hl,{})),handle:{title:"All Charges",breadcrumb:"Charges"}},{path:"charges",handle:{breadcrumb:"Charges"},children:[{index:!0,element:ci(sX,y.jsx(hl,{})),handle:{title:"All Charges"}},{path:"missing-info",element:ci(zut,y.jsx(hl,{})),handle:{title:"Missing Info Charges",breadcrumb:"Missing Info"}},{path:"ledger-validation",element:ci(Gut,y.jsx(hl,{})),handle:{title:"Ledger Validation",breadcrumb:"Ledger Validation"}},{path:":chargeId",loader:Qut,element:ci(Vut),handle:{title:"Charge Details",breadcrumb:"Details"}}]},{path:"businesses",handle:{breadcrumb:"Businesses"},children:[{index:!0,element:ci(qut,y.jsx(hl,{})),handle:{title:"All Businesses"}},{path:"ledger",element:ci(Wut,y.jsx(hl,{})),handle:{title:"Business Ledger Records Summary",breadcrumb:"Ledger"}},{path:":businessId",loader:Hut,element:ci(Kut),handle:{title:"Business Details",breadcrumb:"Details"}},{path:":businessId/ledger",element:ci(Yut,y.jsx(hl,{})),handle:{title:"Business Ledger",breadcrumb:"Ledger"}},{path:"contracts",element:ci(Xut,y.jsx(hl,{})),handle:{title:"Clients Contracts",breadcrumb:"Contracts"}}]},{path:"business-trips",handle:{breadcrumb:"Business Trips"},children:[{index:!0,element:ci(Zut,y.jsx(hl,{})),handle:{title:"Business Trips"}},{path:":businessTripId",element:ci(Jut),handle:{title:"Business Trip Details",breadcrumb:"Details"}}]},{path:"charts",handle:{breadcrumb:"Charts"},children:[{index:!0,element:ci(eft),handle:{title:"Charts"}},{path:"monthly-income-expense",element:ci(tft),handle:{title:"Monthly Income/Expense",breadcrumb:"Income/Expense"}}]},{path:"documents",handle:{breadcrumb:"Documents"},children:[{index:!0,element:ci(nft,y.jsx(hl,{})),handle:{title:"All Documents"}},{path:"issue-document",element:ci(ift),handle:{title:"Issue Document",breadcrumb:"Issue Document"}},{path:"issue-documents",element:ci(rft),handle:{title:"Issue Documents",breadcrumb:"Issue Documents"}}]},{path:"reports",handle:{breadcrumb:"Reports"},children:[{path:"trial-balance",element:ci(aft,y.jsx(Hs,{})),handle:{title:"Trial Balance Report",breadcrumb:"Trial Balance"}},{path:"conto",element:ci(oft,y.jsx(Hs,{})),handle:{title:"Conto Report",breadcrumb:"Conto"}},{path:"vat-monthly",element:ci(sft,y.jsx(Hs,{})),handle:{title:"VAT Monthly Report",breadcrumb:"VAT Monthly"}},{path:"profit-and-loss",handle:{breadcrumb:"Profit & Loss"},children:[{index:!0,element:ci(lX,y.jsx(Hs,{})),handle:{title:"Profit & Loss Report"}},{path:":year",element:ci(lX,y.jsx(Hs,{})),handle:{title:"Profit & Loss Report",breadcrumb:t=>t?.year||"Year"}}]},{path:"tax",handle:{breadcrumb:"Tax"},children:[{index:!0,element:ci(cX,y.jsx(Hs,{})),handle:{title:"Tax Report"}},{path:":year",element:ci(cX,y.jsx(Hs,{})),handle:{title:"Tax Report",breadcrumb:t=>t?.year||"Year"}}]},{path:"depreciation",element:ci(lft,y.jsx(Hs,{})),handle:{title:"Depreciation Report",breadcrumb:"Depreciation"}},{path:"annual-revenue",element:ci(cft,y.jsx(Hs,{})),handle:{title:"Annual Revenue Report",breadcrumb:"Annual Revenue"}},{path:"shaam-6111",element:ci(dft,y.jsx(Hs,{})),handle:{title:"Shaam 6111 Report",breadcrumb:"Shaam 6111"}},{path:"yearly-ledger",element:ci(uft,y.jsx(Hs,{})),handle:{title:"Yearly Ledger Report",breadcrumb:"Yearly Ledger"}},{path:"corporate-tax-ruling-compliance",handle:{breadcrumb:"Tax Ruling"},children:[{index:!0,element:ci(dX,y.jsx(Hs,{})),handle:{title:"Corporate Tax Ruling Compliance Report"}},{path:":year",element:ci(dX,y.jsx(Hs,{})),handle:{title:"Corporate Tax Ruling Compliance Report",breadcrumb:t=>t?.year||"Year"}}]},{path:"balance",element:ci(fft,y.jsx(Hs,{})),handle:{title:"Balance Report",breadcrumb:"Balance"}},{path:"validate-reports",element:ci(Aft),handle:{title:"Validate Reports",breadcrumb:"Validate"}}]},{path:"bank-deposits",element:ci(yft,y.jsx(hl,{})),handle:{title:"Bank Deposits",breadcrumb:"Bank Deposits"}},{path:"accountant-approvals",element:ci(mft,y.jsx(hl,{})),handle:{title:"Accountant Approvals",breadcrumb:"Accountant Approvals"}},{path:"salaries",element:ci(hft,y.jsx(hl,{})),handle:{title:"Salaries",breadcrumb:"Salaries"}},{path:"tags",element:ci(pft),handle:{title:"Tags",breadcrumb:"Tags"}},{path:"tax-categories",element:ci(gft),handle:{title:"Tax Categories",breadcrumb:"Tax Categories"}},{path:"sort-codes",element:ci(vft),handle:{title:"Sort Codes",breadcrumb:"Sort Codes"}},{path:"*",element:ci(kft),handle:{title:"Page Not Found"}}]}]}];var uX={},fX;function wft(){if(fX)return uX;fX=1;var t={};const e=(...r)=>t.stringify(...r);(function(){var r=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,a,o,s={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},l;function c(f){return r.lastIndex=0,r.test(f)?'"'+f.replace(r,function(h){var m=s[h];return typeof m=="string"?m:"\\u"+("0000"+h.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+f+'"'}function d(f,h){var m,g,v,b,k=a,w,x=h[f];switch(x&&typeof x=="object"&&typeof x.toJSON=="function"&&(x=x.toJSON(f)),typeof l=="function"&&(x=l.call(h,f,x)),typeof x){case"string":return c(x);case"number":return isFinite(x)?String(x):"null";case"bigint":case"boolean":case"null":return String(x);case"object":if(!x)return"null";if(a+=o,w=[],Object.prototype.toString.apply(x)==="[object Array]"){for(b=x.length,m=0;m<b;m+=1)w[m]=d(m,x)||"null";return v=w.length===0?"[]":a?`[
|
|
291
291
|
`+a+w.join(`,
|
|
292
292
|
`+a)+`
|
|
293
293
|
`+k+"]":"["+w.join(",")+"]",a=k,v}if(l&&typeof l=="object")for(b=l.length,m=0;m<b;m+=1)typeof l[m]=="string"&&(g=l[m],v=d(g,x),v&&w.push(c(g)+(a?": ":":")+v));else Object.keys(x).forEach(function(F){var _=d(F,x);_&&w.push(c(F)+(a?": ":":")+_)});return v=w.length===0?"{}":a?`{
|