@sachahjkl/backoffice 0.2.6 → 0.2.8
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/README.md +4 -2
- package/dist/demo-reset.cjs +14 -12
- package/dist/main.cjs +14 -12
- package/dist/migrate.cjs +8 -6
- package/dist/web/chunk-3MmwmyDh.js +1 -0
- package/dist/web/{chunk-DhkjPUn4.js → chunk-6-OG9zy0.js} +1 -1
- package/dist/web/chunk-6twPawwh.js +1 -0
- package/dist/web/{chunk-Bck0-DJt2.js → chunk-AE7J7wcH2.js} +1 -1
- package/dist/web/chunk-AZB0sMq_.js +1 -0
- package/dist/web/{chunk-CGfyD3XX2.js → chunk-B-2b7DJP.js} +1 -1
- package/dist/web/{chunk-BYjxXKZ4.js → chunk-B-XrDECw.js} +1 -1
- package/dist/web/chunk-B0Pr-tNT.js +1 -0
- package/dist/web/chunk-B1Kpw1um.js +1 -0
- package/dist/web/chunk-B2X87TB92.js +1 -0
- package/dist/web/chunk-B3fBH9Bt2.js +1 -0
- package/dist/web/chunk-B4KnJ14M2.js +1 -0
- package/dist/web/{chunk-DZgf7AIe.js → chunk-B4Vcwa9l.js} +1 -1
- package/dist/web/chunk-B4cAnuMM2.js +1 -0
- package/dist/web/chunk-B6mYbErA2.js +1 -0
- package/dist/web/chunk-B6trGhNK2.js +3 -0
- package/dist/web/chunk-B89j6ppg2.js +1 -0
- package/dist/web/chunk-B8tEtjeZ2.js +1 -0
- package/dist/web/chunk-BAYVC6mO2.js +1 -0
- package/dist/web/{chunk-MpUdRrak2.js → chunk-BCN3uL5S.js} +1 -1
- package/dist/web/chunk-BDmE_ZEe2.js +1 -0
- package/dist/web/{chunk-aW8Vltn22.js → chunk-BEYQDr-4.js} +1 -1
- package/dist/web/{chunk-CLHj5Ycx2.js → chunk-BEqSiNum.js} +1 -1
- package/dist/web/chunk-BHnrX0WJ.js +1 -0
- package/dist/web/chunk-BJ0yZa2G.js +1 -0
- package/dist/web/{chunk-Fc120Hsi2.js → chunk-BL3upDtA.js} +1 -1
- package/dist/web/{chunk-POMKwNf_.js → chunk-BMiFx1ci.js} +1 -1
- package/dist/web/{chunk--RuvStn6.js → chunk-BNS7t55s2.js} +1 -1
- package/dist/web/{chunk-D1wrPwB5.js → chunk-BO6tYuf8.js} +1 -1
- package/dist/web/{chunk-HmRGBt692.js → chunk-BPA6_4Vt.js} +1 -1
- package/dist/web/chunk-BRp_hGNk.js +1 -0
- package/dist/web/chunk-BSDpuA332.js +1 -0
- package/dist/web/chunk-BSKQUQGn.js +1 -0
- package/dist/web/{chunk-C0Ceu-vg.js → chunk-BTsDF4C6.js} +1 -1
- package/dist/web/{chunk-CDK48Khc.js → chunk-BVXF-FYe2.js} +1 -1
- package/dist/web/{chunk-BkvskoFt2.js → chunk-BWBbQ7HE2.js} +1 -1
- package/dist/web/{chunk-DTPC4JtI2.js → chunk-BYRTViky2.js} +1 -1
- package/dist/web/chunk-BZe5DpAa.js +1 -0
- package/dist/web/chunk-B_7K7EHr.js +1 -0
- package/dist/web/{chunk-D8xHm8jb2.js → chunk-B_pcpccF.js} +1 -1
- package/dist/web/{chunk-xTX16tt2.js → chunk-B_xlO55a2.js} +1 -1
- package/dist/web/{chunk-BKufCOYq.js → chunk-BfKP2Lf9.js} +1 -1
- package/dist/web/chunk-Bfm6z5eI2.js +1 -0
- package/dist/web/chunk-Bgl7kJgO2.js +1 -0
- package/dist/web/{chunk-enci06qG.js → chunk-Bh2Diab5.js} +1 -1
- package/dist/web/chunk-Bi9TDDm92.js +1 -0
- package/dist/web/chunk-Bit8ybhq.js +1 -0
- package/dist/web/chunk-BmfZmUis.js +1 -0
- package/dist/web/chunk-BpkPnQ2K.js +1 -0
- package/dist/web/chunk-Bq24rsxm2.js +1 -0
- package/dist/web/{chunk-C_QyIKvy.js → chunk-BqXhvdC0.js} +1 -1
- package/dist/web/{chunk-CCkaRRSy.js → chunk-Brog8aBK.js} +1 -1
- package/dist/web/{chunk-C-O6GrQC2.js → chunk-Bu0zsnWO.js} +1 -1
- package/dist/web/chunk-BurkPLm-2.js +1 -0
- package/dist/web/chunk-BuyEsqZU2.js +1 -0
- package/dist/web/{chunk-AJOoJgZJ.js → chunk-BwFjLr9D2.js} +1 -1
- package/dist/web/chunk-BwGtxWvC.js +1 -0
- package/dist/web/chunk-Bxrld4562.js +1 -0
- package/dist/web/{chunk-Bq2zV2_3.js → chunk-C01EdpX9.js} +1 -1
- package/dist/web/{chunk-Dl4EbYnM2.js → chunk-C0dwIYf0.js} +1 -1
- package/dist/web/{chunk-CfcCxe_k.js → chunk-C1BibNrz.js} +1 -1
- package/dist/web/{chunk-Dns8uMf32.js → chunk-C1gYDta1.js} +1 -1
- package/dist/web/{chunk-CubfQf-X2.js → chunk-C2i4N9dz.js} +1 -1
- package/dist/web/{chunk-DpLF2wJ62.js → chunk-C6M6lCrw2.js} +1 -1
- package/dist/web/{chunk-CK6Sjqig.js → chunk-C94w9Yq2.js} +1 -1
- package/dist/web/chunk-CA-xctoQ2.js +1 -0
- package/dist/web/chunk-CBcFgY8f2.js +1 -0
- package/dist/web/{chunk-DGbo0App2.js → chunk-CCItYukO.js} +1 -1
- package/dist/web/chunk-CGLHod2X2.js +1 -0
- package/dist/web/{chunk-Bfx7EEIR.js → chunk-CHUNlDss2.js} +1 -1
- package/dist/web/chunk-CJ10tvOm.js +1 -0
- package/dist/web/chunk-CJE3VBx5.js +1 -0
- package/dist/web/chunk-CL9McPWU.js +1 -0
- package/dist/web/chunk-CLzfpBlo2.js +1 -0
- package/dist/web/chunk-CM29tQ7z.js +1 -0
- package/dist/web/{chunk-Ck6cItVE2.js → chunk-CMC_2rEW.js} +1 -1
- package/dist/web/chunk-CMFGRRh02.js +1 -0
- package/dist/web/chunk-CO_ECkiv.js +1 -0
- package/dist/web/{chunk-D97UUzIx.js → chunk-CQvxhLmC2.js} +1 -1
- package/dist/web/chunk-CRDadWvH2.js +1 -0
- package/dist/web/chunk-CS69nNvh.js +1 -0
- package/dist/web/chunk-CXb1THnv2.js +1 -0
- package/dist/web/chunk-CZM1REvY.js +1 -0
- package/dist/web/chunk-C_4qOSvi2.js +1 -0
- package/dist/web/chunk-C_wLUbPJ2.js +1 -0
- package/dist/web/chunk-CdvoW0GI.js +1 -0
- package/dist/web/{chunk-CE9WzUCM.js → chunk-CecoTW2V.js} +1 -1
- package/dist/web/chunk-Cg6D1SkX2.js +1 -0
- package/dist/web/chunk-ChMWeKtk2.js +1 -0
- package/dist/web/chunk-CiQcqWHR.js +1 -0
- package/dist/web/chunk-Cjj8GJIb2.js +1 -0
- package/dist/web/{chunk-niXXbm7H.js → chunk-CkRw7h0_.js} +1 -1
- package/dist/web/{chunk-nC_XlFOG.js → chunk-Ckk2HUrT.js} +1 -1
- package/dist/web/chunk-Cl9ktebj.js +1 -0
- package/dist/web/chunk-ClviGHGr.js +1 -0
- package/dist/web/{chunk-BVszSMJC.js → chunk-Cm2UNqwE.js} +1 -1
- package/dist/web/chunk-CoUH4AfS2.js +1 -0
- package/dist/web/chunk-CpB8RIpf.js +1 -0
- package/dist/web/{chunk-BpZ7MSOP.js → chunk-CqreQVp_.js} +1 -1
- package/dist/web/{chunk-DEXzwHB0.js → chunk-CrwYH4R_2.js} +1 -1
- package/dist/web/{chunk-RIi7_iVg.js → chunk-CuVXI21d.js} +1 -1
- package/dist/web/{chunk-CvsVlcIU2.js → chunk-CwkgffnU.js} +1 -1
- package/dist/web/chunk-CxgCrZQl.js +1 -0
- package/dist/web/{chunk-DDCyjjcE.js → chunk-CyavDx9Z.js} +1 -1
- package/dist/web/{chunk-r6H-BfOd.js → chunk-D0MIkZdd2.js} +1 -1
- package/dist/web/{chunk-D5qmP2Wu.js → chunk-D8Ui_APT.js} +1 -1
- package/dist/web/{chunk-CPHUl7N2.js → chunk-D8VZRHVx.js} +1 -1
- package/dist/web/chunk-D9pT7T7E.js +1 -0
- package/dist/web/chunk-DD8ATIqT2.js +1 -0
- package/dist/web/chunk-DE4GLf5B.js +1 -0
- package/dist/web/{chunk-CkWd-yMn.js → chunk-DEYSMPA_2.js} +1 -1
- package/dist/web/chunk-DGXdMht2.js +1 -0
- package/dist/web/chunk-DJfwJBD6.js +1 -0
- package/dist/web/chunk-DJwuZjJg2.js +1 -0
- package/dist/web/chunk-DKDWoDXU.js +1 -0
- package/dist/web/chunk-DLH3RPM22.js +1 -0
- package/dist/web/{chunk-qKosqkwC.js → chunk-DQRDJtdh.js} +1 -1
- package/dist/web/chunk-DRY4w4Td.js +1 -0
- package/dist/web/chunk-DTRJLfq02.js +1 -0
- package/dist/web/{chunk-4ipZT9nT.js → chunk-DTj9NKPI.js} +1 -1
- package/dist/web/chunk-DVbkiKVh2.js +1 -0
- package/dist/web/chunk-DVu24rwt.js +1 -0
- package/dist/web/chunk-DWN606KF2.js +1 -0
- package/dist/web/chunk-DZvdrgcs2.js +1 -0
- package/dist/web/chunk-D_X9J-dz2.js +1 -0
- package/dist/web/{chunk-C0gTeWW62.js → chunk-DbL20WIB2.js} +1 -1
- package/dist/web/{chunk-Bb31fHqC2.js → chunk-DbcNGxba.js} +1 -1
- package/dist/web/chunk-Dc29tEgJ2.js +1 -0
- package/dist/web/{chunk-DboSVJMM.js → chunk-Dc8-8Og_.js} +1 -1
- package/dist/web/chunk-DdVUVFhX.js +1 -0
- package/dist/web/chunk-DeERUxjp.js +1 -0
- package/dist/web/chunk-Dfxr5EJU.js +1 -0
- package/dist/web/chunk-DgZvyF3s.js +1 -0
- package/dist/web/chunk-DgZxoBPB.js +1 -0
- package/dist/web/{chunk-DsaNNeZe.js → chunk-DhpMFMQw.js} +1 -1
- package/dist/web/{chunk-DOCau85G2.js → chunk-DlBNgzF8.js} +1 -1
- package/dist/web/{chunk-CVHqiS63.js → chunk-DlecOMbR.js} +1 -1
- package/dist/web/chunk-DnKyRGr_.js +1 -0
- package/dist/web/{chunk-DhLlQTD-2.js → chunk-DnYJfVdt.js} +1 -1
- package/dist/web/chunk-Dr_Uz6uR2.js +1 -0
- package/dist/web/{chunk-NDpjbcAr2.js → chunk-DvAE1Kdh2.js} +1 -1
- package/dist/web/chunk-DwSL7UNj.js +1 -0
- package/dist/web/{chunk-DZgMGE6C.js → chunk-Dyouu0xF.js} +1 -1
- package/dist/web/{chunk-CABvk97t2.js → chunk-DytjnC4n2.js} +1 -1
- package/dist/web/{chunk-CApvwK4D.js → chunk-Fo633neF.js} +1 -1
- package/dist/web/chunk-I2ekTEA32.js +1 -0
- package/dist/web/{chunk-D5MFwK9L.js → chunk-IrDYxRzS.js} +1 -1
- package/dist/web/chunk-JqPdfaO22.js +1 -0
- package/dist/web/chunk-LKcToPK62.js +1 -0
- package/dist/web/{chunk-CtmP6l7_2.js → chunk-Qweefwro2.js} +1 -1
- package/dist/web/chunk-U_cdbXaE2.js +1 -0
- package/dist/web/chunk-Ub2hjsmX.js +1 -0
- package/dist/web/chunk-WylMVh3d.js +1 -0
- package/dist/web/chunk-ZZuAWaLQ.js +1 -0
- package/dist/web/{chunk-C19Alcnx2.js → chunk-Zj43itle.js} +1 -1
- package/dist/web/chunk-ZoQD3eIP2.js +1 -0
- package/dist/web/chunk-ZxYSyP21.js +1 -0
- package/dist/web/{chunk-D_8jIApo.js → chunk-a58d-9ZM2.js} +1 -1
- package/dist/web/{chunk-pV57uiBu2.js → chunk-aGxrcUQJ2.js} +1 -1
- package/dist/web/chunk-bIBAi42v2.js +1 -0
- package/dist/web/{chunk-DIJSXeQC2.js → chunk-bQhJGrXj2.js} +1 -1
- package/dist/web/chunk-c57UHX0J.js +1 -0
- package/dist/web/chunk-eAm9Qkk4.js +1 -0
- package/dist/web/{chunk-WNYFaDlu2.js → chunk-f6C5Rz_B2.js} +1 -1
- package/dist/web/chunk-fLDt2Dc5.js +1 -0
- package/dist/web/{chunk-CmokTGIG.js → chunk-fY-2jgAh.js} +1 -1
- package/dist/web/{chunk-SZJG1lFa2.js → chunk-f_xeGTT7.js} +1 -1
- package/dist/web/chunk-fxkvCM0b.js +1 -0
- package/dist/web/{chunk-9X4vLcFh.js → chunk-k8jJDyGi.js} +1 -1
- package/dist/web/{chunk-DerJPaBw.js → chunk-mCmB-2Tr.js} +1 -1
- package/dist/web/{chunk-DXvlXoVT2.js → chunk-mqeSFXPY2.js} +1 -1
- package/dist/web/{chunk-D6k6pmdU.js → chunk-o83QpKCY.js} +1 -1
- package/dist/web/chunk-pffFf_PV2.js +1 -0
- package/dist/web/{chunk-XtjMOmku2.js → chunk-sAfSVia62.js} +1 -1
- package/dist/web/{chunk-CEJjSd8-2.js → chunk-xIoy5TmG2.js} +1 -1
- package/dist/web/{chunk-B8_dFe5w.js → chunk-xRsHYitB.js} +1 -1
- package/dist/web/index.csr.html +1 -1
- package/dist/web/{main-F7D3L737.js → main-LXYWXFW4.js} +2 -2
- package/package.json +1 -1
- package/dist/web/chunk-6jIo5mZ42.js +0 -1
- package/dist/web/chunk-9d_UD-MQ.js +0 -1
- package/dist/web/chunk-B0bNirg2.js +0 -1
- package/dist/web/chunk-B3OxeBLO2.js +0 -1
- package/dist/web/chunk-B5xzAYYx2.js +0 -1
- package/dist/web/chunk-B6Rml85x2.js +0 -1
- package/dist/web/chunk-B91VAo1J.js +0 -1
- package/dist/web/chunk-B9NV1rY62.js +0 -1
- package/dist/web/chunk-BAn0tBhX.js +0 -1
- package/dist/web/chunk-BGVaNZdj.js +0 -1
- package/dist/web/chunk-BHDXYrox.js +0 -1
- package/dist/web/chunk-BI9lIdFn.js +0 -1
- package/dist/web/chunk-BNksdK_D2.js +0 -1
- package/dist/web/chunk-BQ7WWH4L.js +0 -1
- package/dist/web/chunk-BQrmVphu2.js +0 -1
- package/dist/web/chunk-BR0demlX.js +0 -1
- package/dist/web/chunk-BT8KtCYG.js +0 -1
- package/dist/web/chunk-BZZJ287h.js +0 -1
- package/dist/web/chunk-BcUjdID-.js +0 -1
- package/dist/web/chunk-Bf3eV_su2.js +0 -1
- package/dist/web/chunk-BfSewUhY.js +0 -1
- package/dist/web/chunk-Bi4Jixry2.js +0 -1
- package/dist/web/chunk-BiECfDS7.js +0 -1
- package/dist/web/chunk-Bj7Oze2U2.js +0 -1
- package/dist/web/chunk-Bjo6eVnk.js +0 -1
- package/dist/web/chunk-Bn46cQyx.js +0 -1
- package/dist/web/chunk-Bn6RkvPA2.js +0 -1
- package/dist/web/chunk-Bsy3r41y2.js +0 -1
- package/dist/web/chunk-By2EFyNM.js +0 -1
- package/dist/web/chunk-CCqlW8pS2.js +0 -3
- package/dist/web/chunk-CCr_R2Cg.js +0 -1
- package/dist/web/chunk-CDS6LjBz2.js +0 -1
- package/dist/web/chunk-CG4Kbo1n2.js +0 -1
- package/dist/web/chunk-CKFB1V-p2.js +0 -1
- package/dist/web/chunk-CL02A9wI.js +0 -1
- package/dist/web/chunk-CLZ5xsSQ2.js +0 -1
- package/dist/web/chunk-CMvRZBpn.js +0 -1
- package/dist/web/chunk-CNfmNEak.js +0 -1
- package/dist/web/chunk-COTrF1xY2.js +0 -1
- package/dist/web/chunk-COXN76fu2.js +0 -1
- package/dist/web/chunk-CUqj_Bxs2.js +0 -1
- package/dist/web/chunk-CV_fLVFT.js +0 -1
- package/dist/web/chunk-CYGyIy7J.js +0 -1
- package/dist/web/chunk-CYRUKYKv2.js +0 -1
- package/dist/web/chunk-Ca3lwqEF.js +0 -1
- package/dist/web/chunk-CaJrmM9V.js +0 -1
- package/dist/web/chunk-CpXqQPuw.js +0 -1
- package/dist/web/chunk-CuepVIkm2.js +0 -1
- package/dist/web/chunk-CvMAjyvr2.js +0 -1
- package/dist/web/chunk-CwzCbuXH.js +0 -1
- package/dist/web/chunk-Cx07K71K.js +0 -1
- package/dist/web/chunk-D-VHaopx.js +0 -1
- package/dist/web/chunk-D1DvlGbP.js +0 -1
- package/dist/web/chunk-D3XjW5Cm.js +0 -1
- package/dist/web/chunk-D8kEdb5y2.js +0 -1
- package/dist/web/chunk-D8t0s8LD.js +0 -1
- package/dist/web/chunk-DB6sOjsn2.js +0 -1
- package/dist/web/chunk-DIBFSF2Z.js +0 -1
- package/dist/web/chunk-DKlxu0GP2.js +0 -1
- package/dist/web/chunk-DM4Wc9U7.js +0 -1
- package/dist/web/chunk-DM5aibnW.js +0 -1
- package/dist/web/chunk-DMXgU6Nc2.js +0 -1
- package/dist/web/chunk-DMskLhpk2.js +0 -1
- package/dist/web/chunk-DOinRyX_2.js +0 -1
- package/dist/web/chunk-DQp-2GVv.js +0 -1
- package/dist/web/chunk-DQr_9Q6T.js +0 -1
- package/dist/web/chunk-DSpA-ZPx.js +0 -1
- package/dist/web/chunk-DURq7J8U2.js +0 -1
- package/dist/web/chunk-DVJ4YZuU.js +0 -1
- package/dist/web/chunk-DVyDnsGh.js +0 -1
- package/dist/web/chunk-D_vyhgGx.js +0 -1
- package/dist/web/chunk-Db2zQ-8C.js +0 -1
- package/dist/web/chunk-DdOc1fs-.js +0 -1
- package/dist/web/chunk-DddDKWSn2.js +0 -1
- package/dist/web/chunk-Dh86w63y.js +0 -1
- package/dist/web/chunk-Di9FA_QV.js +0 -1
- package/dist/web/chunk-DjwvqY3z2.js +0 -1
- package/dist/web/chunk-Dl4V93zm2.js +0 -1
- package/dist/web/chunk-Dnzjseqf2.js +0 -1
- package/dist/web/chunk-DpI44v1z.js +0 -1
- package/dist/web/chunk-Dqhs2Pyw2.js +0 -1
- package/dist/web/chunk-DubWLqvO.js +0 -1
- package/dist/web/chunk-IlM3eTPp2.js +0 -1
- package/dist/web/chunk-IzGdqlW82.js +0 -1
- package/dist/web/chunk-P1du2kWg2.js +0 -1
- package/dist/web/chunk-PqGGk0JD.js +0 -1
- package/dist/web/chunk-XvyWOb2Q.js +0 -1
- package/dist/web/chunk-ZBDWcE362.js +0 -1
- package/dist/web/chunk-ZcJhJsoo.js +0 -1
- package/dist/web/chunk-a_Va_Nj7.js +0 -1
- package/dist/web/chunk-fYJ7OBkh.js +0 -1
- package/dist/web/chunk-k6TIcaIA.js +0 -1
- package/dist/web/chunk-owvOEsA9.js +0 -1
- package/dist/web/chunk-scbWWgLx2.js +0 -1
- package/dist/web/chunk-tDREPM-0.js +0 -1
- package/dist/web/chunk-y0Vyi0HZ.js +0 -1
- package/dist/web/chunk-yfBrkklv.js +0 -1
- /package/dist/web/{chunk-1ErswIDf.js → chunk-1ErswIDf2.js} +0 -0
- /package/dist/web/{chunk-CARNiCDb2.js → chunk-CARNiCDb.js} +0 -0
- /package/dist/web/{chunk-CGo7Fepz.js → chunk-CGo7Fepz2.js} +0 -0
- /package/dist/web/{chunk-CKxU-VJf.js → chunk-CKxU-VJf2.js} +0 -0
- /package/dist/web/{chunk-CP-AnFGa2.js → chunk-CP-AnFGa.js} +0 -0
- /package/dist/web/{chunk-CXHCUTDs.js → chunk-CXHCUTDs2.js} +0 -0
- /package/dist/web/{chunk-CczD0yXn.js → chunk-CczD0yXn2.js} +0 -0
- /package/dist/web/{chunk-CtcsJTAS2.js → chunk-CtcsJTAS.js} +0 -0
- /package/dist/web/{chunk-WJWN7A_V2.js → chunk-WJWN7A_V.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as m,t as l}from"./chunk-BwCtja5l.js";import{$t as ZC,A as Gy,D as Fy,Dn as g,E as Ft,Fn as iv,Gn as k_,Ir as wp,It as Us,Jr as zS,K as Ke$1,Nr as vd,P as Hn,Rn as jS,Sr as rv,Tn as fd,V as Iy,Wn as kS,Wr as y_,X as LS,dr as pe,ft as Ol,lt as OS,mr as qT,mt as PH,pr as qS,qn as ky,rn as Zw,rr as nv,tn as ZT,vt as Py,w as Fb,z as Ip}from"./chunk-BAHiFuUo.js";import{T as ue,h as Ne$1,m as Ie,o as U,r as N,v as Dt,y as G}from"./main-LXYWXFW4.js";import{wi as wu}from"./chunk-BAe_07VM.js";import"./chunk-Dv9sNWWK.js";import{$r as T,Ia as a,Yc as qt}from"./chunk-D8Ui_APT.js";import{t as g$1}from"./chunk-B56nz2lI.js";import{t as k}from"./chunk-IrDYxRzS.js";import"./chunk-BzUDWIzm.js";import{t as P}from"./chunk-CkRw7h0_.js";import"./chunk-DhpMFMQw.js";import{t as l$1}from"./chunk-Cm2UNqwE.js";import"./chunk-CP-AnFGa.js";import"./chunk-DwSL7UNj.js";import"./chunk-CReShp-B.js";import{a as fn,c as ir,d as nr,f as or,h as yn,n as an,o as gn,p as sr,r as cn,t as P$1,u as mn}from"./chunk-CSkyOfSg.js";import"./chunk-CczD0yXn2.js";import"./chunk-CXHCUTDs2.js";import"./chunk-BAYVC6mO2.js";import{t as B}from"./chunk-xIoy5TmG2.js";import{t as R}from"./chunk-DvAE1Kdh2.js";import{t as Ae$1}from"./chunk-C_4qOSvi2.js";import{a as u,i as m$1,r as g$2}from"./chunk-Dx1NwQCW.js";import{t as Of}from"./chunk-B_pcpccF.js";import{t as me}from"./chunk-DlecOMbR.js";import{t as d}from"./chunk-BO6tYuf8.js";var Ne=t=>[`/invoices`,t];var Ee=t=>[`/clients`,t,`profile`];var ke=(t,i)=>i.id;function we(t,i){if(t&1&&(Us(0,`a`,3),y_(1),fd()),t&2){let e=qS();Fy(`routerLink`,k_(3,Ne,i.id))(`queryParams`,e.navigation.detailQuery()),ZC(),nv(e.i18n.t(`billingWorkspace.backDetail`))}}function Te(t,i){if(t&1&&(Us(0,`a`,3),y_(1),fd()),t&2){let e=qS();Fy(`routerLink`,e.navigation.listLink())(`queryParams`,e.navigation.listQuery()),ZC(),nv(e.i18n.t(`backOffice.backToBilling`))}}function Fe(t,i){if(t&1&&(Us(0,`p`),y_(1),Us(2,`a`,10),y_(3),fd()()),t&2){let e=i,n=qS();ZC(),rv(` `,n.i18n.t(`backOffice.affair.invoice`),` `,e.invoiceNumber??e.currentRevision.title,` · `),ZC(),Fy(`routerLink`,k_(4,Ee,e.clientId)),ZC(),nv(e.currentRevision.clientDisplayName)}}function Re(t,i){if(t&1&&(Us(0,`p`,5),y_(1),fd()),t&2){let e=qS();ZC(),nv(e.i18n.t(`backOffice.invoices.loading`))}}function qe(t,i){if(t&1&&(Us(0,`p`,7),y_(1),fd()),t&2){let e=qS();ZC(),nv(e.i18n.t(`billingWorkspace.stale`))}}function Le(t,i){if(t&1&&(Us(0,`p`,8),y_(1),fd()),t&2){let e=qS();ZC(),nv(e.i18n.t(i))}}function Ve(t,i){if(t&1&&(Us(0,`div`,12)(1,`a`,13),y_(2),fd()()),t&2){let e=qS(2);ZC(),Fy(`routerLink`,k_(3,Ne,i.id))(`queryParams`,e.navigation.detailQuery()),ZC(),nv(e.i18n.t(`billingWorkspace.backDetail`))}}function Ue(t,i){if(t&1&&(Us(0,`p`,11),y_(1),fd(),OS(2,Ve,3,5,`div`,12)),t&2){let e,n=qS();ZC(),nv(n.i18n.t(`billingWorkspace.completed`)),ZC(),kS((e=n.detail())?2:-1,e)}}function Be(t,i){if(t&1&&(Us(0,`p`,14),y_(1),fd()),t&2){let e=qS(2);ZC(),nv(e.i18n.t(`billingWorkspace.readonly`))}}function ze(t,i){if(t&1&&(Us(0,`option`,31),y_(1),fd()),t&2){let e=i.$implicit,n=qS(5);Fy(`value`,e.id),ZC(),iv(` `,e.reference,` · `,e.clientDisplayName,` · `,e.title,` · `,n.money(e.totalCents),` `)}}function Ae(t,i){if(t&1&&y_(0),t&2)vd(` `,qS(5).i18n.t(`backOffice.invoice.fieldRequired`),` `)}function Ke(t,i){if(t&1&&(Us(0,`p`,14),y_(1),fd()),t&2){let e=qS(5);ZC(),nv(e.i18n.t(`backOffice.invoice.noOrder`))}}function We(t,i){if(t&1&&(Us(0,`label`,20),y_(1),Us(2,`select`,29)(3,`option`,30),y_(4),fd(),LS(5,ze,2,5,`option`,31,ke),fd(),qT(),Us(7,`span`,32),OS(8,Ae,1,1),fd()(),OS(9,Ke,2,1,`p`,14)),t&2){let e=qS(4);ZC(),nv(e.i18n.t(`backOffice.invoice.order`)),ZC(),Fy(`formField`,e.invoiceForm.orderId),ky(`aria-invalid`,e.invoiceForm.orderId().invalid()&&e.invoiceForm.orderId().touched()),ZT(),ZC(2),nv(e.i18n.t(`backOffice.invoice.orderPlaceholder`)),ZC(),jS(e.orders()),ZC(3),kS(e.invoiceForm.orderId().invalid()&&e.invoiceForm.orderId().touched()?8:-1),ZC(),kS(e.orders().length===0?9:-1)}}function Qe(t,i){if(t&1&&y_(0),t&2)vd(` `,qS(5).i18n.t(`backOffice.invoice.fieldInvalid`),` `)}function He(t,i){if(t&1&&(Us(0,`label`,20),y_(1),Py(2,`input`,33),qT(),Us(3,`span`,34),OS(4,Qe,1,1),fd()()),t&2){let e=qS(4);ZC(),nv(e.i18n.t(`backOffice.invoice.title`)),ZC(),Fy(`formField`,e.invoiceForm.title),ky(`aria-invalid`,e.invoiceForm.title().invalid()&&e.invoiceForm.title().touched()),ZT(),ZC(2),kS(e.invoiceForm.title().invalid()&&e.invoiceForm.title().touched()?4:-1)}}function je(t,i){if(t&1&&y_(0),t&2)vd(` `,qS(4).i18n.t(`backOffice.invoice.dateInvalid`),` `)}function Je(t,i){if(t&1&&y_(0),t&2)vd(` `,qS(4).i18n.t(`backOffice.invoice.dueDateInvalid`),` `)}function $e(t,i){if(t&1&&y_(0),t&2)vd(` `,qS(4).i18n.t(`backOffice.invoice.fieldInvalid`),` `)}function Ge(t,i){if(t&1){let e=zS();Us(0,`section`,35)(1,`div`,36)(2,`h2`,37),y_(3),fd()(),Us(4,`app-document-line-editor`,38),Gy(`linesChange`,function(l){Ip(e);return wp(qS(4).setLines(l))}),fd()(),Us(5,`label`,39),Py(6,`input`,40),qT(),y_(7),fd()}if(t&2){let e=qS(4);ZC(3),nv(e.i18n.t(`backOffice.invoice.lines`)),ZC(),Fy(`lines`,e.invoiceForm.lines().value())(`currency`,e.detail()?.currentRevision?.currency??`EUR`)(`disabled`,e.saveDisabled()),ZC(2),Fy(`formField`,e.invoiceForm.refreshParties),ZT(),ZC(),vd(` `,e.i18n.t(`document.refreshParties`))}}function Xe(t,i){if(t&1&&(Us(0,`p`,8),y_(1),fd()),t&2){let e=qS(4);ZC(),nv(e.i18n.t(`backOffice.invoice.validation`))}}function Ye(t,i){if(t&1){let e=zS();Us(0,`form`,18),Gy(`submit`,function(l){Ip(e);return wp(qS(3).save(l))}),Us(1,`div`,19),OS(2,We,10,6)(3,He,5,4,`label`,20),Us(4,`div`,21)(5,`label`,20),y_(6),Py(7,`input`,22),qT(),Us(8,`span`,23),OS(9,je,1,1),fd()(),Us(10,`label`,20),y_(11),Py(12,`input`,24),qT(),Us(13,`span`,25),OS(14,Je,1,1),fd()()(),Us(15,`app-document-text-editor`,26),Gy(`presentationChange`,function(l){Ip(e);return wp(qS(3).setPaymentTermsPresentation(l))}),fd(),qT(),Us(16,`span`,27),OS(17,$e,1,1),fd()(),OS(18,Ge,8,6),OS(19,Xe,2,1,`p`,8),Us(20,`button`,28),y_(21),fd()()}if(t&2){let e=qS(3);ZC(2),kS(e.isNew()?2:3),ZC(4),nv(e.i18n.t(`backOffice.invoice.serviceDate`)),ZC(),Fy(`formField`,e.invoiceForm.serviceDate),ky(`aria-invalid`,e.invoiceForm.serviceDate().invalid()&&e.invoiceForm.serviceDate().touched()),ZT(),ZC(2),kS(e.invoiceForm.serviceDate().invalid()&&e.invoiceForm.serviceDate().touched()?9:-1),ZC(2),nv(e.i18n.t(`backOffice.invoice.dueDate`)),ZC(),Fy(`formField`,e.invoiceForm.dueDate),ky(`aria-invalid`,e.invoiceForm.dueDate().invalid()&&e.invoiceForm.dueDate().touched()),ZT(),ZC(2),kS(e.invoiceForm.dueDate().invalid()&&e.invoiceForm.dueDate().touched()?14:-1),ZC(),Fy(`label`,e.i18n.t(`backOffice.invoice.paymentTerms`))(`formField`,e.invoiceForm.paymentTerms)(`presentation`,e.paymentTermsPresentation()),ZT(),ZC(2),kS(e.invoiceForm.paymentTerms().invalid()&&e.invoiceForm.paymentTerms().touched()?17:-1),ZC(),kS(e.isNew()?-1:18),ZC(),kS(e.invoiceForm().invalid()&&e.invoiceForm().touched()?19:-1),ZC(),Fy(`disabled`,e.saveDisabled()||e.completed()&&!e.hasUnsavedChanges()),ZC(),vd(` `,e.i18n.t(e.saveKey()),` `)}}function Ze(t,i){if(t&1&&Iy(0,Ye,22,17,`form`,17),t&2)Fy(`appCan`,qS(2).writePermission())}function et(t,i){if(t&1&&(Us(0,`p`,14),y_(1),fd()),t&2){let e=qS(3);ZC(),nv(e.i18n.t(`backOffice.invoice.dirtyTotals`))}}function tt(t,i){if(t&1&&(Us(0,`section`,16)(1,`h2`),y_(2),fd(),OS(3,et,2,1,`p`,14),Us(4,`dl`)(5,`div`)(6,`dt`),y_(7),fd(),Us(8,`dd`),y_(9),fd()(),Us(10,`div`)(11,`dt`),y_(12),fd(),Us(13,`dd`),y_(14),fd()(),Us(15,`div`)(16,`dt`),y_(17),fd(),Us(18,`dd`),y_(19),fd()()()()),t&2){let e=i,n=qS(2);ZC(2),nv(n.i18n.t(`backOffice.invoice.total`)),ZC(),kS(n.totalsAreStale()?3:-1),ZC(4),nv(n.i18n.t(`backOffice.invoice.subtotal`)),ZC(2),nv(n.money(e.currentRevision.netTotalCents)),ZC(3),nv(n.i18n.t(`backOffice.invoice.tax`)),ZC(2),nv(n.money(e.currentRevision.vatTotalCents)),ZC(3),nv(n.i18n.t(`backOffice.invoice.total`)),ZC(2),nv(n.money(e.currentRevision.totalCents))}}function it(t,i){if(t&1&&(OS(0,Be,2,1,`p`,14)(1,Ze,1,1,`form`,15),OS(2,tt,20,8,`section`,16)),t&2){let e,n=qS();kS(n.editable()?1:0),ZC(2),kS((e=n.detail())?2:-1,e)}}function nt(t,i){if(t&1){let e=zS();Us(0,`button`,41),Gy(`click`,function(){Ip(e);return wp(qS().reload())}),y_(1),fd()}if(t&2){let e=qS();Fy(`disabled`,e.saving()),ZC(),vd(` `,e.i18n.t(`listControls.reload`),` `)}}var at=()=>({description:``,quantity:`1`,unitPrice:`0.00`,vatRate:`20.00`});var Me=()=>({refreshParties:!1,orderId:``,title:``,serviceDate:``,dueDate:``,paymentTerms:``,lines:[at()]});var Se=class t{writePermission=Ft(()=>this.isNew()?`invoice.create`:`invoice.update`);i18n=g(Ie);api=g(R);ordersApi=g(d);confirmation=g(P);route=g(G);navigation=new B(this.route);router=g(ue);element=g(Hn);destroyRef=g(pe);request=0;focusInvalid=Ke$1(!1);isNew=Ke$1(!1);titleKey=Ft(()=>this.isNew()?`backOffice.invoice.title.new`:`billingWorkspace.edit`);saveKey=Ft(()=>this.saving()?`backOffice.invoice.saving`:`backOffice.invoice.save`);orders=Ke$1([]);detail=Ke$1(void 0);loading=Ke$1(!0);saving=Ke$1(!1);unavailable=Ke$1(!1);stale=Ke$1(!1);completed=Ke$1(!1);error=Ke$1(void 0);model=Ke$1(Me());paymentTermsPresentation=Ft(()=>this.model().paymentTermsPresentation);baseline=Ke$1(JSON.stringify(this.model()));editable=Ft(()=>this.isNew()||this.detail()?.status===`draft`);saveDisabled=Ft(()=>!this.editable()||this.saving()||this.loading()||this.stale()||this.isNew()&&this.completed());invoiceForm=nr(this.model,i=>{an(i,()=>this.saveDisabled()),gn(i.orderId,{when:()=>this.isNew()}),gn(i.serviceDate),P$1(i.serviceDate,({value:e})=>wu.is(T)(e())?void 0:{kind:`date`}),gn(i.dueDate),P$1(i.dueDate,({value:e,valueOf:n})=>!wu.is(T)(e())||e()<n(i.serviceDate)?{kind:`date`}:void 0),cn(i.paymentTerms,2e3),P$1(i.paymentTerms,({value:e})=>qt(e(),this.model().paymentTermsPresentation?.format??`plain`)?void 0:{kind:`format`}),sr(i.title,()=>!this.isNew(),e=>{gn(e),cn(e,120),mn(e,/\S/)}),sr(i.lines,()=>!this.isNew(),e=>{fn(e,1),cn(e,20),ir(e,n=>{gn(n.description),cn(n.description,160),mn(n.description,/\S/),P$1(n.quantity,({value:l})=>{let s=u(l(),3);return s===void 0||s===0?{kind:`quantity`}:void 0}),P$1(n.unitPrice,({value:l})=>u(l(),2)===void 0?{kind:`unitPrice`}:void 0),P$1(n.vatRate,({value:l})=>{let s=u(l(),2);return s===void 0||s>1e4?{kind:`vatRate`}:void 0})})})});hasUnsavedChanges=Ft(()=>this.stale()||JSON.stringify(this.model())!==this.baseline()||this.invoiceForm().errorSummary().some(i=>i.kind===`parse`));totalsAreStale=Ft(()=>this.detail()!==void 0&&this.hasUnsavedChanges());constructor(){Ol(()=>this.route.paramMap.pipe(U(this.destroyRef)).subscribe(i=>{this.load(i.get(`invoiceId`))})),PH(()=>{this.focusInvalid()?(this.element.nativeElement.querySelector(`[aria-invalid="true"]`)?.focus(),this.focusInvalid.set(!1)):(this.error()||this.completed())&&this.element.nativeElement.querySelector(`[data-editor-feedback]`)?.focus()})}setLines(i){this.saveDisabled()||(this.model.update(e=>m(l({},e),{lines:[...i]})),this.invoiceForm().markAsDirty(),this.completed.set(!1))}async canDeactivate(){return this.completed()&&!this.hasUnsavedChanges()?!0:this.saving()?!1:!this.hasUnsavedChanges()||this.confirmation.request(this.i18n.t(`backOffice.invoice.unsavedChanges`))}setPaymentTermsPresentation(i){this.invoiceForm.paymentTerms().disabled()||(this.model.update(e=>m(l({},e),{paymentTermsPresentation:i})),this.invoiceForm.paymentTerms().markAsDirty())}beforeUnload(i){(this.saving()||this.hasUnsavedChanges())&&(i.preventDefault(),i.returnValue=``)}save(i){i.preventDefault(),!(this.saveDisabled()||this.completed()&&!this.hasUnsavedChanges())&&or(this.invoiceForm,{action:async()=>{if(!(!this.isNew()&&!this.hasUnsavedChanges())){this.saving.set(!0),this.error.set(void 0),this.completed.set(!1);try{let e=this.model(),n=this.detail();if(this.isNew()){if(!wu.is(a)(e.orderId)){this.error.set(`invoice.order_not_found`);return}let K={orderId:e.orderId,serviceDate:e.serviceDate,dueDate:e.dueDate,paymentTerms:e.paymentTerms},De=e.paymentTermsPresentation===void 0?K:m(l({},K),{paymentTermsPresentation:e.paymentTermsPresentation}),N=await this.api.create(De);if(this.destroyRef.destroyed)return;if(!N.success){if(N.failure?._tag===`InvoiceAlreadyExists`){this.resetForm(),this.completed.set(!0),await this.router.navigate([`/invoices`,N.failure.invoiceId],{replaceUrl:!0,queryParams:this.navigation.detailQuery()});return}this.error.set(N.code);return}this.resetForm(),this.completed.set(!0),await this.router.navigate([`/invoices`,N.result.id],{replaceUrl:!0,queryParams:this.navigation.detailQuery()});return}let l$2=this.parseLines();if(!n||!l$2){this.error.set(`invoice.error`);return}let s={expectedVersion:n.version,refreshParties:e.refreshParties,title:e.title.trim(),serviceDate:e.serviceDate,dueDate:e.dueDate,paymentTerms:e.paymentTerms,lines:l$2},R=e.paymentTermsPresentation===void 0?s:m(l({},s),{paymentTermsPresentation:e.paymentTermsPresentation}),S=await this.api.createRevision(n.id,R);if(this.destroyRef.destroyed)return;if(!S.success){this.error.set(S.code),this.stale.set(S.code===`invoice.version_conflict`||S.code===`invoice.not_editable`);return}this.applyDetail(S.result),this.completed.set(!0)}catch{this.destroyRef.destroyed||this.error.set(`invoice.error`)}finally{this.destroyRef.destroyed||this.saving.set(!1)}}},onInvalid:()=>this.focusInvalid.set(!0)})}async reload(){this.saving()||this.hasUnsavedChanges()&&!await this.confirmation.request(this.i18n.t(`billingWorkspace.reloadConfirm`))||await this.load(this.route.snapshot.paramMap.get(`invoiceId`))}async load(i){let e=++this.request;if(this.isNew.set(i===null),this.detail.set(void 0),this.loading.set(!0),this.unavailable.set(!1),this.error.set(void 0),this.stale.set(!1),this.completed.set(!1),this.model.set(Me()),this.resetForm(),i!==null&&!wu.is(a)(i)){this.unavailable.set(!0),this.error.set(`invoice.not_found`),this.loading.set(!1);return}try{if(i===null){let n=await this.ordersApi.list();if(e!==this.request||this.destroyRef.destroyed)return;this.orders.set(n.filter(s=>s.invoiceId===null));let l$3=this.route.snapshot.queryParamMap.get(`orderId`);l$3&&this.orders().some(s=>s.id===l$3)&&this.model.update(s=>m(l({},s),{orderId:l$3})),this.resetForm()}else{let n=await this.api.get(i);if(e!==this.request||this.destroyRef.destroyed)return;if(!n.success){this.error.set(n.code),this.unavailable.set(!0);return}this.applyDetail(n.result)}}catch{e===this.request&&!this.destroyRef.destroyed&&(this.error.set(`invoice.error`),this.unavailable.set(!0))}finally{e===this.request&&!this.destroyRef.destroyed&&this.loading.set(!1)}}applyDetail(i){this.detail.set(i);let e=i.currentRevision,n=this.i18n.language()===`fr`?`,`:`.`;this.model.set({orderId:i.orderId,refreshParties:!1,title:e.title,serviceDate:e.serviceDate,dueDate:e.dueDate,paymentTerms:e.paymentTerms,paymentTermsPresentation:e.paymentTermsPresentation,lines:e.lines.map(l=>({description:l.description,quantity:g$2(l.quantityMilli,3,n),unitPrice:m$1(l.unitPriceCents,2,n),vatRate:m$1(l.vatRateBasisPoints,2,n)}))}),this.resetForm()}resetForm(){this.baseline.set(JSON.stringify(this.model())),this.invoiceForm().reset()}parseLines(){let i=[];for(let e of this.model().lines){let n=u(e.quantity,3),l=u(e.unitPrice,2),s=u(e.vatRate,2);if(n===void 0||n===0||l===void 0||s===void 0||s>1e4)return;i.push({description:e.description.trim(),quantityMilli:n,unitPriceCents:l,vatRateBasisPoints:s})}return i}money(i){return Ne$1(i,this.i18n.language(),`EUR`)}static ɵfac=function(e){return new(e||t)};static ɵcmp=Fb({type:t,selectors:[[`app-invoice-editor`]],hostAttrs:[1,`page-container`],hostBindings:function(e,n){e&1&&Gy(`beforeunload`,function(s){return n.beforeUnload(s)},Zw)},decls:17,vars:9,consts:[[`aria-labelledby`,`invoice-title`,1,`detail-page`,`form-page`,`document-editor`],[`layout`,`stacked`],[`pageBack`,``],[1,`back-link`,3,`routerLink`,`queryParams`],[`id`,`invoice-title`],[`role`,`status`],[`data-editor-feedback`,``,`tabindex`,`-1`],[`appNotice`,``,`variant`,`warning`,`role`,`alert`],[`appNotice`,``,`variant`,`danger`,`role`,`alert`],[`appButton`,``,3,`disabled`],[3,`routerLink`],[`appNotice`,``,`variant`,`success`,`role`,`status`],[1,`spacer-x-3`],[`appLinkButton`,``,3,`routerLink`,`queryParams`],[`appNotice`,``],[`novalidate`,``],[1,`saved-summary`,`ds-panel`],[`novalidate`,``,3,`submit`,4,`appCan`],[`novalidate`,``,3,`submit`],[1,`invoice-terms`,`ds-panel`,`form-panel`],[1,`field`],[1,`date-fields`],[`type`,`date`,`aria-describedby`,`invoice-service-date-error`,1,`input`,3,`formField`],[`id`,`invoice-service-date-error`,1,`field-error`],[`type`,`date`,`aria-describedby`,`invoice-due-date-error`,1,`input`,3,`formField`],[`id`,`invoice-due-date-error`,1,`field-error`],[`controlId`,`invoice-payment-terms`,`descriptionId`,`invoice-payment-terms-error`,3,`presentationChange`,`label`,`formField`,`presentation`],[`id`,`invoice-payment-terms-error`,1,`field-error`],[`appButton`,``,`variant`,`primary`,`type`,`submit`,3,`disabled`],[`appFilterSelect`,``,`aria-describedby`,`invoice-order-error`,1,`input`,3,`formField`],[`value`,``],[3,`value`],[`id`,`invoice-order-error`,1,`field-error`],[`type`,`text`,`aria-describedby`,`invoice-title-error`,1,`input`,3,`formField`],[`id`,`invoice-title-error`,1,`field-error`],[`aria-labelledby`,`lines-title`,1,`lines`],[1,`section-heading`],[`id`,`lines-title`],[1,`document-lines`,3,`linesChange`,`lines`,`currency`,`disabled`],[1,`choice`],[`type`,`checkbox`,3,`formField`],[`appButton`,``,3,`click`,`disabled`]],template:function(e,n){if(e&1&&(Us(0,`section`,0)(1,`app-page-header`,1)(2,`div`,2),OS(3,we,2,5,`a`,3)(4,Te,2,3,`a`,3),fd(),Us(5,`h1`,4),y_(6),fd(),OS(7,Fe,4,6,`p`),Us(8,`p`),y_(9),fd()(),OS(10,Re,2,1,`p`,5),Us(11,`div`,6),OS(12,qe,2,1,`p`,7)(13,Le,2,1,`p`,8),OS(14,Ue,3,2),fd(),OS(15,it,3,2),OS(16,nt,2,2,`button`,9),fd()),e&2){let l,s,R;ZC(3),kS((l=n.detail())?3:4,l),ZC(3),nv(n.i18n.t(n.titleKey())),ZC(),kS((s=n.detail())?7:-1,s),ZC(2),nv(n.i18n.t(`billingWorkspace.noAutosave`)),ZC(),kS(n.loading()?10:-1),ZC(2),kS(n.stale()?12:(R=n.error())?13:-1,R),ZC(2),kS(n.completed()&&!n.hasUnsavedChanges()?14:-1),ZC(),kS(!n.loading()&&!n.unavailable()?15:-1),ZC(),kS(n.unavailable()||n.stale()?16:-1)}},dependencies:[Ae$1,l$1,N,yn,k,g$1,Dt,Of,me],styles:[`.document-editor[_ngcontent-%COMP%]{align-items:start}.document-editor[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{min-width:0}form[_ngcontent-%COMP%]{container-type:inline-size;min-width:0}.document-editor[_ngcontent-%COMP%] > form[_ngcontent-%COMP%]{display:grid;gap:var(--%NS%space-5)}.document-editor[_ngcontent-%COMP%] > form[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{margin-block:0}.lines[_ngcontent-%COMP%] > *[_ngcontent-%COMP%] + *[_ngcontent-%COMP%]{margin-top:var(--%NS%space-5)}.section-heading[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:var(--%NS%space-3)}.section-heading[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{font-size:var(--%NS%text-xl)}.external-link[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:var(--%NS%space-1)}.document-line[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(0,1fr);gap:var(--%NS%space-3);min-width:0;margin:0;padding:var(--%NS%space-4)}.document-line[_ngcontent-%COMP%] > .field[_ngcontent-%COMP%]{align-content:end}.document-line[_ngcontent-%COMP%] > button[_ngcontent-%COMP%]{justify-self:start}legend[_ngcontent-%COMP%]{padding:var(--%NS%space-1) var(--%NS%space-2);color:var(--%NS%color-muted);font-family:var(--%NS%font-mono);font-size:var(--%NS%text-xs);font-weight:700;letter-spacing:var(--%NS%tracking-label);text-transform:uppercase}.line-total[_ngcontent-%COMP%]{align-self:center;color:var(--%NS%color-muted);font-size:var(--%NS%text-sm);text-align:end;font-variant-numeric:tabular-nums}textarea[_ngcontent-%COMP%]{resize:vertical}.hint[_ngcontent-%COMP%]{margin-top:var(--%NS%space-2);color:var(--%NS%color-muted);font-size:var(--%NS%text-xs)}[appOutcomePanel].ds-panel[_ngcontent-%COMP%]{border:0;background:var(--%NS%color-panel);box-shadow:none}[appOutcomePanel][_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{font-size:var(--%NS%text-xl)}[appOutcomePanel][_ngcontent-%COMP%] h2[_ngcontent-%COMP%]:not(:first-child){margin-top:var(--%NS%space-6)}[appOutcomePanel][_ngcontent-%COMP%] h2[_ngcontent-%COMP%] + *[_ngcontent-%COMP%]{margin-top:var(--%NS%space-3)}dl[_ngcontent-%COMP%]{margin:var(--%NS%space-3) 0 0}dl[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:var(--%NS%space-4);padding-block:var(--%NS%space-2);border-bottom:1px solid var(--%NS%color-line-strong)}dd[_ngcontent-%COMP%]{min-width:0;margin:0;font-weight:700;font-variant-numeric:tabular-nums;text-align:end;overflow-wrap:anywhere}dl[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:last-child{color:var(--%NS%color-ink);font-size:var(--%NS%text-lg)}ol[_ngcontent-%COMP%]{display:grid;gap:var(--%NS%space-4);padding-inline-start:var(--%NS%space-5)}ol[_ngcontent-%COMP%] li[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;overflow-wrap:anywhere}ol[_ngcontent-%COMP%] li[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(2){color:var(--%NS%color-muted);font-size:var(--%NS%text-xs)}.revision-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:var(--%NS%space-2);margin-top:var(--%NS%space-2)}.preview[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{width:100%;height:clamp(28rem,80dvh,65rem);margin-top:var(--%NS%space-4);border:1px dashed var(--%NS%color-line-strong);border-radius:var(--%NS%radius-sm);background:#fff;box-shadow:var(--%NS%shadow-panel)}@container (min-width: 28rem){.document-line[_ngcontent-%COMP%]{grid-template-columns:repeat(3,minmax(0,1fr))}.document-line[_ngcontent-%COMP%] > .description[_ngcontent-%COMP%]{grid-column:1/-1}.document-line[_ngcontent-%COMP%] > .line-total[_ngcontent-%COMP%]{grid-column:2/-1}}@media(min-width:64rem){.document-editor[_ngcontent-%COMP%]:has(>[appOutcomePanel]){grid-template-columns:minmax(0,1fr) 20rem}.document-editor[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{grid-column:1/-1}.document-editor[_ngcontent-%COMP%]:has(>[appOutcomePanel]) > form[_ngcontent-%COMP%]{grid-column:1}.document-editor[_ngcontent-%COMP%] > [appOutcomePanel][_ngcontent-%COMP%]{grid-column:2}}[_nghost-%COMP%]{display:block}.detail-page[_ngcontent-%COMP%]{display:grid;gap:var(--%NS%space-4);min-inline-size:0;inline-size:100%;max-inline-size:var(--%NS%page-width-detail);margin-inline:auto;padding:var(--%NS%page-header-y) var(--%NS%page-x)}.detail-page.form-page[_ngcontent-%COMP%]{max-inline-size:var(--%NS%page-width-form)}.detail-page.wide-page[_ngcontent-%COMP%]{max-inline-size:var(--%NS%page-width-wide)}app-page-header[data-header-layout=stacked][_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{margin:0;font-size:var(--%NS%text-2xl);overflow-wrap:anywhere}app-page-header[data-header-layout=stacked][_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;font-size:var(--%NS%text-base);color:var(--%NS%color-muted);overflow-wrap:anywhere}.detail-page[_ngcontent-%COMP%] > button[_ngcontent-%COMP%]{justify-self:start}@media print{.detail-page[_ngcontent-%COMP%], .detail-page.form-page[_ngcontent-%COMP%], .detail-page.wide-page[_ngcontent-%COMP%]{max-inline-size:none}}.invoice-terms[_ngcontent-%COMP%]{display:grid;gap:var(--%NS%space-4)}.saved-summary[_ngcontent-%COMP%]{padding:var(--%NS%space-4)}.field-error[_ngcontent-%COMP%]:empty{display:none}[data-editor-feedback][_ngcontent-%COMP%]{display:grid;gap:var(--%NS%space-3)}.date-fields[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--%NS%space-4)}@container (max-width: 24rem){.date-fields[_ngcontent-%COMP%]{grid-template-columns:minmax(0,1fr)}}`]})};export{Se as InvoiceEditor};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as m,t as l}from"./chunk-BwCtja5l.js";import{$t as ZC,A as Gy,D as Fy,Dn as g,E as Ft,Ir as wp,It as Us,Jr as zS,Jt as Xy,K as Ke,Nr as vd,Rn as jS,Tn as fd,V as Iy,Wn as kS,Wr as y_,X as LS,dr as pe,ft as Ol,j as H,lt as OS,mr as qT,o as A,pr as qS,qn as ky,rn as Zw,rr as nv,tn as ZT,vt as Py,w as Fb,z as Ip}from"./chunk-BAHiFuUo.js";import{T as ue,a as T,m as Ie$1,o as U,r as N,v as Dt,y as G}from"./main-LXYWXFW4.js";import{ct as Me$1,wi as wu}from"./chunk-BAe_07VM.js";import"./chunk-Dv9sNWWK.js";import{Ia as a,di as Ud,jr as Qd}from"./chunk-D8Ui_APT.js";import{t as g$1}from"./chunk-B56nz2lI.js";import{t as k$1}from"./chunk-IrDYxRzS.js";import"./chunk-BzUDWIzm.js";import{t as P}from"./chunk-CkRw7h0_.js";import{t as E}from"./chunk-DhpMFMQw.js";import{t as l$1}from"./chunk-Cm2UNqwE.js";import"./chunk-DjewtV43.js";import"./chunk-CReShp-B.js";import{d as nr,f as or,h as yn,n as an,o as gn,r as cn,u as mn}from"./chunk-CSkyOfSg.js";import"./chunk-DVbkiKVh2.js";import{t as y}from"./chunk-B_xlO55a2.js";import"./chunk-CP9GxcYV.js";import"./chunk-Dyouu0xF.js";import{t as b}from"./chunk-DE4GLf5B.js";var k=class n{authentication=g(E);document=g(H);async open(){let e=await this.authentication.currentAccount(),t=this.document.defaultView?.sessionStorage;if(e?.mode!==`administrator`||t===void 0)throw new Error(`client.creation_storage_error`);let i=`froment.pending.client-creation.${e.userId}`;return{read:()=>{let l=t.getItem(i);return l===null?void 0:wu.decodeUnknownSync(wu.fromJsonString(Qd))(l)},write:l=>t.setItem(i,wu.encodeSync(wu.fromJsonString(Qd))(l)),clear:()=>t.removeItem(i)}}static ɵfac=function(t){return new(t||n)};static ɵprov=A({token:n,factory:n.ɵfac,providedIn:`root`})};var we=(n,e)=>e.title;var Se=(n,e)=>e.name;function Ne(n,e){if(n&1&&(Us(0,`a`,7),y_(1),fd(),y_(2,` — `)),n&2){let t=qS();Fy(`routerLink`,t.backLink())(`queryParams`,t.returnQuery()),ZC(),nv(e.displayName)}}function Pe(n,e){if(n&1&&(Us(0,`p`,4),y_(1),fd()),n&2){let t=qS();ZC(),nv(t.i18n.t(`backOffice.clientDetail.loading`))}}function Ee(n,e){if(n&1){let t=zS();Us(0,`p`,8),y_(1),fd(),Us(2,`button`,9),Gy(`click`,function(){Ip(t);return wp(qS().load())}),y_(3),fd()}if(n&2){let t=qS();ZC(),nv(t.i18n.t(t.error())),ZC(2),vd(` `,t.i18n.t(`backOffice.dashboard.retry`),` `)}}function Oe(n,e){if(n&1&&(Us(0,`p`,5),y_(1),fd()),n&2){let t=qS();ZC(),nv(t.i18n.t(`backOffice.clientDetail.archived`))}}function Me(n,e){if(n&1&&(Us(0,`span`,21),y_(1),fd()),n&2){let t=qS().$implicit,i=qS(4);Fy(`id`,`client-`+t.name+`-error`),ZC(),nv(i.i18n.t(i.fieldError(t.name)))}}function Ie(n,e){if(n&1&&(Us(0,`label`,19),y_(1),Py(2,`input`,20),qT(),OS(3,Me,2,2,`span`,21),fd()),n&2){let t=e.$implicit,i=qS(4);Xy(`wide`,t.wide),Fy(`for`,`client-`+t.name),ZC(),vd(` `,i.i18n.t(i.fieldLabel(t.name)),` `),ZC(),Fy(`id`,`client-`+t.name)(`type`,t.type)(`autocomplete`,t.autocomplete)(`formField`,i.clientForm[t.name]),ky(`aria-invalid`,i.invalid(t.name))(`aria-describedby`,i.invalid(t.name)?`client-`+t.name+`-error`:null),ZT(),ZC(),kS(i.invalid(t.name)?3:-1)}}function Le(n,e){if(n&1&&(Us(0,`div`,12)(1,`fieldset`)(2,`legend`),y_(3),fd(),Us(4,`div`,17),LS(5,Ie,4,11,`label`,18,Se),fd()()()),n&2){let t=e.$implicit,i=qS(3);ZC(3),nv(i.i18n.t(t.title)),ZC(2),jS(t.fields)}}function De(n,e){if(n&1&&(Us(0,`p`,8),y_(1),fd()),n&2){let t=qS(3);ZC(),nv(t.i18n.t(e))}}function Te(n,e){if(n&1&&(Us(0,`p`,13),y_(1),fd()),n&2){let t=qS(3);ZC(),nv(t.i18n.t(`client.creation_pending`))}}function qe(n,e){if(n&1){let t=zS();Us(0,`form`,11),Gy(`submit`,function(l){Ip(t);return wp(qS(2).save(l))}),LS(1,Le,7,1,`div`,12,we),OS(3,De,2,1,`p`,8),OS(4,Te,2,1,`p`,13),Us(5,`div`,14)(6,`button`,15),y_(7),fd(),Us(8,`a`,16),y_(9),fd()()()}if(n&2){let t,i=qS(2);ZC(),jS(i.groups),ZC(2),kS((t=i.error())?3:-1,t),ZC(),kS(i.pendingCreation()?4:-1),ZC(2),Fy(`disabled`,i.saving()||i.completed()||i.editing()&&!i.clientForm().dirty()),ZC(),vd(` `,i.i18n.t(i.saveLabel()),` `),ZC(),Fy(`routerLink`,i.backLink())(`queryParams`,i.returnQuery()),ZC(),nv(i.i18n.t(`clientsWorkspace.cancel`))}}function Fe(n,e){if(n&1&&Iy(0,qe,10,7,`form`,10),n&2)Fy(`appCan`,qS().writePermission())}var fe=()=>({displayName:``,addressLine1:``,addressLine2:``,postalCode:``,city:``,country:``,email:``,phone:``});var ye=class n{i18n=g(Ie$1);api=g(y);creationStore=g(k);store;pendingCreation=Ke(void 0);route=g(G);router=g(ue);destroyRef=g(pe);confirmation=g(P);queryParams=T(this.route.queryParamMap,{initialValue:this.route.snapshot.queryParamMap});returnQuery=Ft(()=>b(this.queryParams()));client=Ke(void 0);state=Ke(`loading`);saving=Ke(!1);completed=Ke(!1);error=Ke(void 0);model=Ke(fe());editing=Ke(!1);saveLabel=Ft(()=>this.saving()?`backOffice.clientDetail.saving`:this.pendingCreation()?`client.creation_retry`:this.editing()?`backOffice.clientDetail.save`:`backOffice.clients.create`);writePermission=Ft(()=>this.editing()?`client.update`:`client.create`);titleLabel=Ft(()=>this.editing()?`clientsWorkspace.edit`:`backOffice.clients.create`);descriptionLabel=Ft(()=>this.editing()?`clientsWorkspace.editIntro`:`clientsWorkspace.formIntro`);backLabel=Ft(()=>this.client()?`clientsWorkspace.backToClient`:`backOffice.backToClients`);backLink=Ft(()=>{let e=this.client();return e?[`/clients`,e.id]:[`/clients`,this.returnQuery().view??`active`]});groups=[{title:`clientsWorkspace.identity`,fields:[{name:`displayName`,autocomplete:`organization`,type:`text`,wide:!0},{name:`email`,autocomplete:`email`,type:`email`,wide:!0},{name:`phone`,autocomplete:`tel`,type:`tel`,wide:!0}]},{title:`clientsWorkspace.address`,fields:[{name:`addressLine1`,autocomplete:`address-line1`,type:`text`,wide:!0},{name:`addressLine2`,autocomplete:`address-line2`,type:`text`,wide:!0},{name:`postalCode`,autocomplete:`postal-code`,type:`text`,wide:!1},{name:`city`,autocomplete:`address-level2`,type:`text`,wide:!1},{name:`country`,autocomplete:`country-name`,type:`text`,wide:!0}]}];clientForm=nr(this.model,e=>{an(e,()=>this.saving()||this.pendingCreation()!==void 0||this.completed()||this.state()!==`ready`||this.client()?.archived===!0),gn(e.displayName),mn(e.displayName,/\S/),cn(e.displayName,120),cn(e.addressLine1,160),cn(e.addressLine2,160),cn(e.postalCode,32),cn(e.city,120),cn(e.country,120),cn(e.email,254),mn(e.email,/^$|^[^\s@]+@[^\s@]+\.[^\s@]+$/),cn(e.phone,64),mn(e.phone,/^$|^\+?[0-9][0-9 ()\-./]{5,62}$/)});loadGeneration=0;constructor(){Ol(()=>this.route.paramMap.pipe(U(this.destroyRef)).subscribe(()=>{this.load()}))}async canDeactivate(){return this.saving()?!1:this.completed()?!0:this.pendingCreation()?this.confirmation.request(this.i18n.t(`client.creation_leave`)):!this.clientForm().dirty()||await this.confirmation.request(this.i18n.t(`backOffice.clientDetail.unsavedChanges`))}preventUnsavedUnload(e){(this.saving()||this.pendingCreation()||this.clientForm().dirty())&&e.preventDefault()}invalid(e){return this.clientForm[e]().touched()&&this.clientForm[e]().invalid()}fieldError(e){return e===`displayName`?`backOffice.clients.displayNameError`:e===`email`?`backOffice.clientDetail.emailInvalid`:e===`phone`?`backOffice.clientDetail.phoneInvalid`:`backOffice.clientDetail.fieldInvalid`}fieldLabel(e){return`backOffice.clients.${e}`}async load(){if(this.saving()||this.pendingCreation())return;let e=++this.loadGeneration,t=this.route.snapshot.paramMap.get(`clientId`);if(this.editing.set(t!==null),this.state.set(`loading`),this.completed.set(!1),this.error.set(void 0),t===null){try{let D=await this.creationStore.open();if(e!==this.loadGeneration||this.destroyRef.destroyed)return;let w=D.read();this.store=D,this.pendingCreation.set(w),this.client.set(void 0),this.clientForm().reset(w?wu.decodeUnknownSync(Ud)(w):fe()),this.state.set(`ready`)}catch{if(e!==this.loadGeneration||this.destroyRef.destroyed)return;this.error.set(`client.creation_storage_error`),this.state.set(`error`)}return}let i=wu.decodeUnknownOption(a)(t);if(Me$1.isNone(i)){this.error.set(`client.not_found`),this.state.set(`error`);return}let l=await this.api.get(i.value);if(e!==this.loadGeneration||this.destroyRef.destroyed)return;if(!l.success){this.error.set(l.code),this.state.set(`error`);return}let{displayName:C,addressLine1:ge,addressLine2:ve,postalCode:he,city:Ce,country:_e,email:be,phone:xe}=l.result;this.client.set(l.result),this.model.set({displayName:C,addressLine1:ge,addressLine2:ve,postalCode:he,city:Ce,country:_e,email:be,phone:xe}),this.clientForm().reset(),this.state.set(`ready`)}save(e){if(e.preventDefault(),!(this.saving()||this.completed()||this.state()!==`ready`||this.client()?.archived)){if(this.pendingCreation()){this.retryCreation();return}if(this.clientForm().markAsTouched(),this.clientForm().invalid()){this.clientForm().errorSummary()[0]?.fieldTree().focusBoundControl();return}or(this.clientForm,async()=>{this.saving.set(!0),this.error.set(void 0);try{let t=this.client();if(t)await this.acceptOutcome(await this.api.update(t.id,m(l({},this.model()),{expectedUpdatedAt:t.updatedAt})));else{let i=m(l({},this.model()),{requestId:crypto.randomUUID()});if(!this.store){this.error.set(`client.creation_storage_error`);return}try{this.store.write(i)}catch{this.error.set(`client.creation_storage_error`);return}this.pendingCreation.set(i),await this.acceptOutcome(await this.api.create(i))}}catch{this.error.set(`client.error`)}finally{this.saving.set(!1)}})}}async retryCreation(){let e=this.pendingCreation();if(!(!e||this.saving()||this.completed())){this.saving.set(!0),this.error.set(void 0);try{await this.acceptOutcome(await this.api.create(e))}catch{this.error.set(`client.error`)}finally{this.saving.set(!1)}}}async acceptOutcome(e){if(!this.destroyRef.destroyed){if(!e.success){this.error.set(e.code);return}this.pendingCreation()&&this.store?.clear(),this.pendingCreation.set(void 0),this.client.set(e.result),this.completed.set(!0),this.clientForm().reset(),this.saving.set(!1),await this.router.navigate([`/clients`,e.result.id],{queryParams:this.returnQuery(),queryParamsHandling:`replace`})}}static ɵfac=function(t){return new(t||n)};static ɵcmp=Fb({type:n,selectors:[[`app-client-editor`]],hostAttrs:[1,`page-container`],hostBindings:function(t,i){t&1&&Gy(`beforeunload`,function(C){return i.preventUnsavedUnload(C)},Zw)},decls:13,vars:7,consts:[[`aria-labelledby`,`client-editor-title`,1,`detail-page`,`form-page`,`client-editor`],[`layout`,`stacked`],[`pageBack`,``,`queryParamsHandling`,`replace`,3,`routerLink`,`queryParams`],[`id`,`client-editor-title`],[`role`,`status`],[`appNotice`,``,`role`,`status`],[`novalidate`,``,1,`profile-form`],[`queryParamsHandling`,`replace`,3,`routerLink`,`queryParams`],[`appNotice`,``,`variant`,`danger`,`role`,`alert`],[`appButton`,``,`type`,`button`,3,`click`],[`class`,`profile-form`,`novalidate`,``,3,`submit`,4,`appCan`],[`novalidate`,``,1,`profile-form`,3,`submit`],[1,`ds-panel`,`form-panel`],[`appNotice`,``,`variant`,`warning`,`role`,`status`],[1,`actions`],[`appButton`,``,`variant`,`primary`,`type`,`submit`,3,`disabled`],[`appLinkButton`,``,`queryParamsHandling`,`replace`,3,`routerLink`,`queryParams`],[1,`field-grid`],[1,`field`,3,`wide`,`for`],[1,`field`,3,`for`],[1,`input`,3,`id`,`type`,`autocomplete`,`formField`],[1,`field-error`,3,`id`]],template:function(t,i){if(t&1&&(Us(0,`section`,0)(1,`app-page-header`,1)(2,`a`,2),y_(3),fd(),Us(4,`h1`,3),y_(5),fd(),Us(6,`p`),OS(7,Ne,3,3),y_(8),fd()(),OS(9,Pe,2,1,`p`,4)(10,Ee,4,2)(11,Oe,2,1,`p`,5)(12,Fe,1,1,`form`,6),fd()),t&2){let l;ZC(2),Fy(`routerLink`,i.backLink())(`queryParams`,i.returnQuery()),ZC(),nv(i.i18n.t(i.backLabel())),ZC(2),nv(i.i18n.t(i.titleLabel())),ZC(2),kS((l=i.client())?7:-1,l),ZC(),vd(` `,i.i18n.t(i.descriptionLabel()),` `),ZC(),kS(i.state()===`loading`?9:i.state()===`error`?10:i.client()?.archived?11:12)}},dependencies:[l$1,N,yn,k$1,g$1,Dt],styles:[`[_nghost-%COMP%]{display:block}.detail-page[_ngcontent-%COMP%]{display:grid;gap:var(--%NS%space-4);min-inline-size:0;inline-size:100%;max-inline-size:var(--%NS%page-width-detail);margin-inline:auto;padding:var(--%NS%page-header-y) var(--%NS%page-x)}.detail-page.form-page[_ngcontent-%COMP%]{max-inline-size:var(--%NS%page-width-form)}.detail-page.wide-page[_ngcontent-%COMP%]{max-inline-size:var(--%NS%page-width-wide)}app-page-header[data-header-layout=stacked][_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{margin:0;font-size:var(--%NS%text-2xl);overflow-wrap:anywhere}app-page-header[data-header-layout=stacked][_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;font-size:var(--%NS%text-base);color:var(--%NS%color-muted);overflow-wrap:anywhere}.detail-page[_ngcontent-%COMP%] > button[_ngcontent-%COMP%]{justify-self:start}@media print{.detail-page[_ngcontent-%COMP%], .detail-page.form-page[_ngcontent-%COMP%], .detail-page.wide-page[_ngcontent-%COMP%]{max-inline-size:none}}form[_ngcontent-%COMP%]{display:grid;gap:var(--%NS%space-6)}fieldset[_ngcontent-%COMP%]{min-inline-size:0;margin:0;padding:0;border:0}legend[_ngcontent-%COMP%]{margin-block-end:var(--%NS%space-4);padding:0;font-weight:700}.field-error[_ngcontent-%COMP%]{color:var(--%NS%color-danger);font-size:var(--%NS%text-xs)}.actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:var(--%NS%space-3);padding-block-start:var(--%NS%space-4);border-block-start:1px solid var(--%NS%color-line)}`]})};export{ye as ClientEditor};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as m,r as n,t as l}from"./chunk-BwCtja5l.js";import{$ as MH,$t as ZC,A as Gy$1,D as Fy$1,Dn as g,Dr as t_,E as Ft$1,Ir as wp$1,It as Us$1,J as Ky$1,Jr as zS,K as Ke$1,Lt as Uy$1,Nr as vd$1,P as Hn$1,Rn as jS,S as FS,Tn as fd$1,Vr as xH,Wn as kS,Wr as y_,X as LS,b as E$1,c as AH,dr as pe$1,ft as Ol,ln as ad$1,lr as pN,lt as OS,mt as PH,nt as NH,pr as qS,qn as ky$1,rr as nv,vt as Py$1,w as Fb,wt as RH,xn as e_,z as Ip$1}from"./chunk-BAHiFuUo.js";import{i as r,m as Ie}from"./main-F7D3L737.js";import{wi as wu$1}from"./chunk-BAe_07VM.js";import{En as Kx,Q as Dp$1}from"./chunk-D5qmP2Wu.js";import{i as H$1,l as W$1}from"./chunk-BzUDWIzm.js";import{t as Ae$1}from"./chunk-DM5aibnW.js";import{t as D$1}from"./chunk-CXHCUTDs.js";import{l as y}from"./chunk-CP-AnFGa2.js";import{n as I,t as B$1}from"./chunk-scbWWgLx2.js";var Hl=Object.defineProperty;var Vl=(n,e)=>{let t={};for(var r in n)Hl(t,r,{get:n[r],enumerable:!0});return e||Hl(t,Symbol.toStringTag,{value:`Module`}),t};function te(n){this.content=n}te.prototype={constructor:te,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,i=r.find(n),o=r.content.slice();return i==-1?o.push(t||n,e):(o[i+1]=e,t&&(o[i]=t)),new te(o)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new te(t)},addToStart:function(n,e){return new te([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new te(t)},addBefore:function(n,e,t){var r=this.remove(e),i=r.content.slice(),o=r.find(n);return i.splice(o==-1?i.length:o,0,e,t),new te(i)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=te.from(n),n.size?new te(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=te.from(n),n.size?new te(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=te.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};te.from=function(n){if(n instanceof te)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new te(e)};var Yi=te;function Ql(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(r),o=e.child(r);if(i==o){t+=i.nodeSize;continue}if(!i.sameMarkup(o))return t;if(i.isText&&i.text!=o.text){let s=i.text,l=o.text,a=0;for(;s[a]==l[a];a++)t++;return a&&a<s.length&&a<l.length&&ta(s.charCodeAt(a-1))&&ea(s.charCodeAt(a))&&t--,t}if(i.content.size||o.content.size){let s=Ql(i.content,o.content,t+1);if(s!=null)return s}t+=i.nodeSize}}function Zl(n,e,t,r){for(let i=n.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:t,b:r};let s=n.child(--i),l=e.child(--o),a=s.nodeSize;if(s==l){t-=a,r-=a;continue}if(!s.sameMarkup(l))return{a:t,b:r};if(s.isText&&s.text!=l.text){let c=s.text,d=l.text,u=c.length,f=d.length;for(;u>0&&f>0&&c[u-1]==d[f-1];)u--,f--,t--,r--;return u&&f&&u<c.length&&ta(c.charCodeAt(u-1))&&ea(c.charCodeAt(u))&&(t++,r++),{a:t,b:r}}if(s.content.size||l.content.size){let c=Zl(s.content,l.content,t-1,r-1);if(c)return c}t-=a,r-=a}}function ea(n){return n>=56320&&n<57344}function ta(n){return n>=55296&&n<56320}var k=class n{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,i=0,o){for(let s=0,l=0;l<t;s++){let a=this.content[s],c=l+a.nodeSize;if(c>e&&r(a,i+l,o||null,s)!==!1&&a.content.size){let d=l+1;a.nodesBetween(Math.max(0,e-d),Math.min(a.content.size,t-d),r,i+d)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let o=``,s=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?i?typeof i==`function`?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):``:``;l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(s?s=!1:o+=r),o+=c},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new n(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],i=0;if(t>e)for(let o=0,s=0;s<t;o++){let l=this.content[o],a=s+l.nodeSize;a>e&&((s<e||a>t)&&(l.isText?l=l.cut(Math.max(0,e-s),Math.min(l.text.length,t-s)):l=l.cut(Math.max(0,e-s-1),Math.min(l.content.size,t-s-1))),r.push(l),i+=l.nodeSize),s=a}return new n(r,i)}cutByIndex(e,t){return e==t?n.empty:e==0&&t==this.content.length?this:new n(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),o=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new n(i,o)}addToStart(e){return new n([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new n(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let i=this.content[t];e(i,r,t),r+=i.nodeSize}}findDiffStart(e,t=0){return Ql(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return Zl(this,e,t,r)}findIndex(e){if(e==0)return yr(0,e);if(e==this.size)return yr(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let i=this.child(t),o=r+i.nodeSize;if(o>=e)return o==e?yr(t+1,o):yr(t,r);r=o}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return n.empty;if(!Array.isArray(t))throw new RangeError(`Invalid input for Fragment.fromJSON`);return n.fromArray(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return n.empty;let t,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(t||(t=e.slice(0,i)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new n(t||e,r)}static from(e){if(!e)return n.empty;if(e instanceof n)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new n([e],e.nodeSize);throw new RangeError(`Can not convert `+e+` to a Fragment`+(e.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};k.empty=new k([],0);var Qi={index:0,offset:0};function yr(n,e){return Qi.index=n,Qi.offset=e,Qi}function xr(n,e){if(n===e)return!0;if(!(n&&typeof n==`object`)||!(e&&typeof e==`object`))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!xr(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!xr(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}var z=(()=>{class n{constructor(t,r){this.type=t,this.attrs=r}addToSet(t){let r,i=!1;for(let o=0;o<t.length;o++){let s=t[o];if(this.eq(s))return t;if(this.type.excludes(s.type))r||(r=t.slice(0,o));else{if(s.type.excludes(this.type))return t;!i&&s.type.rank>this.type.rank&&(r||(r=t.slice(0,o)),r.push(this),i=!0),r&&r.push(s)}}return r||(r=t.slice()),i||r.push(this),r}removeFromSet(t){for(let r=0;r<t.length;r++)if(this.eq(t[r]))return t.slice(0,r).concat(t.slice(r+1));return t}isInSet(t){for(let r=0;r<t.length;r++)if(this.eq(t[r]))return!0;return!1}eq(t){return this==t||this.type==t.type&&xr(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let r in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,r){if(!r)throw new RangeError(`Invalid input for Mark.fromJSON`);let i=t.marks[r.type];if(!i)throw new RangeError(`There is no mark type ${r.type} in this schema`);let o=i.create(r.attrs);return i.checkAttrs(o.attrs),o}static sameSet(t,r){if(t==r)return!0;if(t.length!=r.length)return!1;for(let i=0;i<t.length;i++)if(!t[i].eq(r[i]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return n.none;if(t instanceof n)return[t];let r=t.slice();return r.sort((i,o)=>i.type.rank-o.type.rank),r}}return n.none=[],n})();var ot=class extends Error{};var v=class n{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=ra(this.content,e+this.openStart,t,this.openStart+1,this.openEnd+1);return r&&new n(r,this.openStart,this.openEnd)}removeBetween(e,t){return new n(na(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return n.empty;let r=t.openStart||0,i=t.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw new RangeError(`Invalid input for Slice.fromJSON`);return new n(k.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.lastChild)i++;return new n(e,r,i)}};v.empty=new v(k.empty,0,0);function na(n,e,t){let{index:r,offset:i}=n.findIndex(e),o=n.maybeChild(r),{index:s,offset:l}=n.findIndex(t);if(i==e||o.isText){if(l!=t&&!n.child(s).isText)throw new RangeError(`Removing non-flat range`);return n.cut(0,e).append(n.cut(t))}if(r!=s)throw new RangeError(`Removing non-flat range`);return n.replaceChild(r,o.copy(na(o.content,e-i-1,t-i-1)))}function ra(n,e,t,r,i,o){let{index:s,offset:l}=n.findIndex(e),a=n.maybeChild(s);if(l==e||a.isText)return o&&r<=0&&i<=0&&!o.canReplace(s,s,t)?null:n.cut(0,e).append(t).append(n.cut(e));let c=ra(a.content,e-l-1,t,s==0?r-1:0,s==n.childCount-1?i-1:0,a);return c&&n.replaceChild(s,a.copy(c))}function Df(n,e,t){if(t.openStart>n.depth)throw new ot(`Inserted content deeper than insertion position`);if(n.depth-t.openStart!=e.depth-t.openEnd)throw new ot(`Inconsistent open depths`);return ia(n,e,t,0)}function ia(n,e,t,r){let i=n.index(r),o=n.node(r);if(i==e.index(r)&&r<n.depth-t.openStart){let s=ia(n,e,t,r+1);return o.copy(o.content.replaceChild(i,s))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let s=n.parent,l=s.content;return yt(s,l.cut(0,n.parentOffset).append(t.content).append(l.cut(e.parentOffset)))}else{let{start:s,end:l}=If(t,n);return yt(o,sa(n,s,l,e,r))}else return yt(o,Sr(n,e,r))}function oa(n,e){if(!e.type.compatibleContent(n.type))throw new ot(`Cannot join `+e.type.name+` onto `+n.type.name)}function Zi(n,e,t){let r=n.node(t);return oa(r,e.node(t)),r}function gt(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function Sn(n,e,t,r){let i=(e||n).node(t),o=0,s=e?e.index(t):i.childCount;n&&(o=n.index(t),n.depth>t?o++:n.textOffset&&(gt(n.nodeAfter,r),o++));for(let l=o;l<s;l++)gt(i.child(l),r);e&&e.depth==t&&e.textOffset&>(e.nodeBefore,r)}function yt(n,e){if(!n.type.validContent(e))throw new ot(`Invalid content for node `+n.type.name);return n.copy(e)}function sa(n,e,t,r,i){let o=n.depth>i&&Zi(n,e,i+1),s=r.depth>i&&Zi(t,r,i+1),l=[];return Sn(null,n,i,l),o&&s&&e.index(i)==t.index(i)?(oa(o,s),gt(yt(o,sa(n,e,t,r,i+1)),l)):(o&>(yt(o,Sr(n,e,i+1)),l),Sn(e,t,i,l),s&>(yt(s,Sr(t,r,i+1)),l)),Sn(r,null,i,l),new k(l)}function Sr(n,e,t){let r=[];if(Sn(null,n,t,r),n.depth>t)gt(yt(Zi(n,e,t+1),Sr(n,e,t+1)),r);return Sn(e,null,t,r),new k(r)}function If(n,e){let t=e.depth-n.openStart,i=e.node(t).copy(n.content);for(let o=t-1;o>=0;o--)i=e.node(o).copy(k.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}var vr=class n{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(t);return r?e.child(t).cut(r):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return z.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),i=e.maybeChild(t);if(!r){let l=r;r=i,i=l}let o=r.marks;for(var s=0;s<o.length;s++)o[s].type.spec.inclusive===!1&&(!i||!o[s].isInSet(i.marks))&&(o=o[s--].removeFromSet(o));return o}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new bt(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError(`Position `+t+` out of range`);let r=[],i=0,o=t;for(let s=e;;){let{index:l,offset:a}=s.content.findIndex(o),c=o-a;if(r.push(s,l,i+a),!c||(s=s.child(l),s.isText))break;o=c-1,i+=a+1}return new n(t,r,o)}static resolveCached(e,t){let r=jl.get(e);if(r)for(let o=0;o<r.elts.length;o++){let s=r.elts[o];if(s.pos==t)return s}else jl.set(e,r=new eo);let i=r.elts[r.i]=n.resolve(e,t);return r.i=(r.i+1)%Rf,i}};var eo=class{constructor(){this.elts=[],this.i=0}};var Rf=12;var jl=new WeakMap;var bt=class{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}};var Pf=Object.create(null);var Te=class n{constructor(e,t,r,i=z.none){this.type=e,this.attrs=t,this.marks=i,this.content=r||k.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,i=0){this.content.nodesBetween(e,t,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,r,i){return this.content.textBetween(e,t,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&xr(this.attrs,t||e.defaultAttrs||Pf)&&z.sameSet(this.marks,r||z.none)}copy(e=null){return e==this.content?this:new n(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new n(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return v.empty;let i=this.resolve(e),o=this.resolve(t),s=r?0:i.sharedDepth(t),l=i.start(s);return new v(i.node(s).content.cut(i.pos-l,o.pos-l),i.depth-s,o.depth-s)}replace(e,t,r){return Df(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let i=this.content.child(t-1);return{node:i,index:t-1,offset:r-i.nodeSize}}resolve(e){return vr.resolveCached(this,e)}resolveNoCache(e){return vr.resolve(this,e)}rangeHasMark(e,t,r){let i=!1;return t>e&&this.nodesBetween(e,t,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),la(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,r=k.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),l=s&&s.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=i;a<o;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,t,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),s=o&&o.matchFragment(this.content,t);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=z.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!z.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError(`Invalid input for Node.fromJSON`);let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError(`Invalid mark data for Node.fromJSON`);r=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw new RangeError(`Invalid text node in JSON`);return e.text(t.text,r)}let i=k.fromJSON(e,t.content),o=e.nodeType(t.type).create(t.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};Te.prototype.text=void 0;var to=class n extends Te{constructor(e,t,r,i){if(super(e,t,null,i),!r)throw new RangeError(`Empty text nodes are not allowed`);this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):la(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new n(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new n(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function la(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+`(`+e+`)`;return e}var kt=class n{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new no(e,t);if(r.next==null)return n.empty;let i=aa(r);r.next&&r.err(`Unexpected trailing text`);let o=Hf(_f(i));return Vf(o,r),o}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let i=this;for(let o=t;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let i=[this];function o(s,l){let a=s.matchFragment(e,r);if(a&&(!t||a.validEnd))return k.from(l.map(c=>c.createAndFill()));for(let c=0;c<s.next.length;c++){let{type:d,next:u}=s.next[c];if(!(d.isText||d.hasRequiredAttrs())&&i.indexOf(u)==-1){i.push(u);let f=o(u,l.concat(d));if(f)return f}}return null}return o(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let s=[];for(let l=i;l.type;l=l.via)s.push(l.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:l,next:a}=o.next[s];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in t)&&(!i.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:i}),t[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&t(r.next[i].next)}return t(this),e.map((r,i)=>{let o=i+(r.validEnd?`*`:` `)+` `;for(let s=0;s<r.next.length;s++)o+=(s?`, `:``)+r.next[s].type.name+`->`+e.indexOf(r.next[s].next);return o}).join(`
|
|
1
|
+
import{n as m,r as n,t as l}from"./chunk-BwCtja5l.js";import{$ as MH,$t as ZC,A as Gy$1,D as Fy$1,Dn as g,Dr as t_,E as Ft$1,Ir as wp$1,It as Us$1,J as Ky$1,Jr as zS,K as Ke$1,Lt as Uy$1,Nr as vd$1,P as Hn$1,Rn as jS,S as FS,Tn as fd$1,Vr as xH,Wn as kS,Wr as y_,X as LS,b as E$1,c as AH,dr as pe$1,ft as Ol,ln as ad$1,lr as pN,lt as OS,mt as PH,nt as NH,pr as qS,qn as ky$1,rr as nv,vt as Py$1,w as Fb,wt as RH,xn as e_,z as Ip$1}from"./chunk-BAHiFuUo.js";import{i as r,m as Ie}from"./main-LXYWXFW4.js";import{wi as wu$1}from"./chunk-BAe_07VM.js";import{En as Kx,Q as Dp$1}from"./chunk-D8Ui_APT.js";import{i as H$1,l as W$1}from"./chunk-BzUDWIzm.js";import{l as y}from"./chunk-CP-AnFGa.js";import{n as I,t as B$1}from"./chunk-DwSL7UNj.js";import{t as D$1}from"./chunk-CXHCUTDs2.js";import{t as Ae$1}from"./chunk-C_4qOSvi2.js";var Hl=Object.defineProperty;var Vl=(n,e)=>{let t={};for(var r in n)Hl(t,r,{get:n[r],enumerable:!0});return e||Hl(t,Symbol.toStringTag,{value:`Module`}),t};function te(n){this.content=n}te.prototype={constructor:te,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,i=r.find(n),o=r.content.slice();return i==-1?o.push(t||n,e):(o[i+1]=e,t&&(o[i]=t)),new te(o)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new te(t)},addToStart:function(n,e){return new te([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new te(t)},addBefore:function(n,e,t){var r=this.remove(e),i=r.content.slice(),o=r.find(n);return i.splice(o==-1?i.length:o,0,e,t),new te(i)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=te.from(n),n.size?new te(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=te.from(n),n.size?new te(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=te.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};te.from=function(n){if(n instanceof te)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new te(e)};var Yi=te;function Ql(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(r),o=e.child(r);if(i==o){t+=i.nodeSize;continue}if(!i.sameMarkup(o))return t;if(i.isText&&i.text!=o.text){let s=i.text,l=o.text,a=0;for(;s[a]==l[a];a++)t++;return a&&a<s.length&&a<l.length&&ta(s.charCodeAt(a-1))&&ea(s.charCodeAt(a))&&t--,t}if(i.content.size||o.content.size){let s=Ql(i.content,o.content,t+1);if(s!=null)return s}t+=i.nodeSize}}function Zl(n,e,t,r){for(let i=n.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:t,b:r};let s=n.child(--i),l=e.child(--o),a=s.nodeSize;if(s==l){t-=a,r-=a;continue}if(!s.sameMarkup(l))return{a:t,b:r};if(s.isText&&s.text!=l.text){let c=s.text,d=l.text,u=c.length,f=d.length;for(;u>0&&f>0&&c[u-1]==d[f-1];)u--,f--,t--,r--;return u&&f&&u<c.length&&ta(c.charCodeAt(u-1))&&ea(c.charCodeAt(u))&&(t++,r++),{a:t,b:r}}if(s.content.size||l.content.size){let c=Zl(s.content,l.content,t-1,r-1);if(c)return c}t-=a,r-=a}}function ea(n){return n>=56320&&n<57344}function ta(n){return n>=55296&&n<56320}var k=class n{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,i=0,o){for(let s=0,l=0;l<t;s++){let a=this.content[s],c=l+a.nodeSize;if(c>e&&r(a,i+l,o||null,s)!==!1&&a.content.size){let d=l+1;a.nodesBetween(Math.max(0,e-d),Math.min(a.content.size,t-d),r,i+d)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let o=``,s=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?i?typeof i==`function`?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):``:``;l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(s?s=!1:o+=r),o+=c},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new n(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],i=0;if(t>e)for(let o=0,s=0;s<t;o++){let l=this.content[o],a=s+l.nodeSize;a>e&&((s<e||a>t)&&(l.isText?l=l.cut(Math.max(0,e-s),Math.min(l.text.length,t-s)):l=l.cut(Math.max(0,e-s-1),Math.min(l.content.size,t-s-1))),r.push(l),i+=l.nodeSize),s=a}return new n(r,i)}cutByIndex(e,t){return e==t?n.empty:e==0&&t==this.content.length?this:new n(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),o=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new n(i,o)}addToStart(e){return new n([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new n(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let i=this.content[t];e(i,r,t),r+=i.nodeSize}}findDiffStart(e,t=0){return Ql(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return Zl(this,e,t,r)}findIndex(e){if(e==0)return yr(0,e);if(e==this.size)return yr(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let i=this.child(t),o=r+i.nodeSize;if(o>=e)return o==e?yr(t+1,o):yr(t,r);r=o}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return n.empty;if(!Array.isArray(t))throw new RangeError(`Invalid input for Fragment.fromJSON`);return n.fromArray(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return n.empty;let t,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(t||(t=e.slice(0,i)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new n(t||e,r)}static from(e){if(!e)return n.empty;if(e instanceof n)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new n([e],e.nodeSize);throw new RangeError(`Can not convert `+e+` to a Fragment`+(e.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};k.empty=new k([],0);var Qi={index:0,offset:0};function yr(n,e){return Qi.index=n,Qi.offset=e,Qi}function xr(n,e){if(n===e)return!0;if(!(n&&typeof n==`object`)||!(e&&typeof e==`object`))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!xr(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!xr(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}var z=(()=>{class n{constructor(t,r){this.type=t,this.attrs=r}addToSet(t){let r,i=!1;for(let o=0;o<t.length;o++){let s=t[o];if(this.eq(s))return t;if(this.type.excludes(s.type))r||(r=t.slice(0,o));else{if(s.type.excludes(this.type))return t;!i&&s.type.rank>this.type.rank&&(r||(r=t.slice(0,o)),r.push(this),i=!0),r&&r.push(s)}}return r||(r=t.slice()),i||r.push(this),r}removeFromSet(t){for(let r=0;r<t.length;r++)if(this.eq(t[r]))return t.slice(0,r).concat(t.slice(r+1));return t}isInSet(t){for(let r=0;r<t.length;r++)if(this.eq(t[r]))return!0;return!1}eq(t){return this==t||this.type==t.type&&xr(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let r in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,r){if(!r)throw new RangeError(`Invalid input for Mark.fromJSON`);let i=t.marks[r.type];if(!i)throw new RangeError(`There is no mark type ${r.type} in this schema`);let o=i.create(r.attrs);return i.checkAttrs(o.attrs),o}static sameSet(t,r){if(t==r)return!0;if(t.length!=r.length)return!1;for(let i=0;i<t.length;i++)if(!t[i].eq(r[i]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return n.none;if(t instanceof n)return[t];let r=t.slice();return r.sort((i,o)=>i.type.rank-o.type.rank),r}}return n.none=[],n})();var ot=class extends Error{};var v=class n{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=ra(this.content,e+this.openStart,t,this.openStart+1,this.openEnd+1);return r&&new n(r,this.openStart,this.openEnd)}removeBetween(e,t){return new n(na(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return n.empty;let r=t.openStart||0,i=t.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw new RangeError(`Invalid input for Slice.fromJSON`);return new n(k.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.lastChild)i++;return new n(e,r,i)}};v.empty=new v(k.empty,0,0);function na(n,e,t){let{index:r,offset:i}=n.findIndex(e),o=n.maybeChild(r),{index:s,offset:l}=n.findIndex(t);if(i==e||o.isText){if(l!=t&&!n.child(s).isText)throw new RangeError(`Removing non-flat range`);return n.cut(0,e).append(n.cut(t))}if(r!=s)throw new RangeError(`Removing non-flat range`);return n.replaceChild(r,o.copy(na(o.content,e-i-1,t-i-1)))}function ra(n,e,t,r,i,o){let{index:s,offset:l}=n.findIndex(e),a=n.maybeChild(s);if(l==e||a.isText)return o&&r<=0&&i<=0&&!o.canReplace(s,s,t)?null:n.cut(0,e).append(t).append(n.cut(e));let c=ra(a.content,e-l-1,t,s==0?r-1:0,s==n.childCount-1?i-1:0,a);return c&&n.replaceChild(s,a.copy(c))}function Df(n,e,t){if(t.openStart>n.depth)throw new ot(`Inserted content deeper than insertion position`);if(n.depth-t.openStart!=e.depth-t.openEnd)throw new ot(`Inconsistent open depths`);return ia(n,e,t,0)}function ia(n,e,t,r){let i=n.index(r),o=n.node(r);if(i==e.index(r)&&r<n.depth-t.openStart){let s=ia(n,e,t,r+1);return o.copy(o.content.replaceChild(i,s))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let s=n.parent,l=s.content;return yt(s,l.cut(0,n.parentOffset).append(t.content).append(l.cut(e.parentOffset)))}else{let{start:s,end:l}=If(t,n);return yt(o,sa(n,s,l,e,r))}else return yt(o,Sr(n,e,r))}function oa(n,e){if(!e.type.compatibleContent(n.type))throw new ot(`Cannot join `+e.type.name+` onto `+n.type.name)}function Zi(n,e,t){let r=n.node(t);return oa(r,e.node(t)),r}function gt(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function Sn(n,e,t,r){let i=(e||n).node(t),o=0,s=e?e.index(t):i.childCount;n&&(o=n.index(t),n.depth>t?o++:n.textOffset&&(gt(n.nodeAfter,r),o++));for(let l=o;l<s;l++)gt(i.child(l),r);e&&e.depth==t&&e.textOffset&>(e.nodeBefore,r)}function yt(n,e){if(!n.type.validContent(e))throw new ot(`Invalid content for node `+n.type.name);return n.copy(e)}function sa(n,e,t,r,i){let o=n.depth>i&&Zi(n,e,i+1),s=r.depth>i&&Zi(t,r,i+1),l=[];return Sn(null,n,i,l),o&&s&&e.index(i)==t.index(i)?(oa(o,s),gt(yt(o,sa(n,e,t,r,i+1)),l)):(o&>(yt(o,Sr(n,e,i+1)),l),Sn(e,t,i,l),s&>(yt(s,Sr(t,r,i+1)),l)),Sn(r,null,i,l),new k(l)}function Sr(n,e,t){let r=[];if(Sn(null,n,t,r),n.depth>t)gt(yt(Zi(n,e,t+1),Sr(n,e,t+1)),r);return Sn(e,null,t,r),new k(r)}function If(n,e){let t=e.depth-n.openStart,i=e.node(t).copy(n.content);for(let o=t-1;o>=0;o--)i=e.node(o).copy(k.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}var vr=class n{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(t);return r?e.child(t).cut(r):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return z.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),i=e.maybeChild(t);if(!r){let l=r;r=i,i=l}let o=r.marks;for(var s=0;s<o.length;s++)o[s].type.spec.inclusive===!1&&(!i||!o[s].isInSet(i.marks))&&(o=o[s--].removeFromSet(o));return o}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new bt(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError(`Position `+t+` out of range`);let r=[],i=0,o=t;for(let s=e;;){let{index:l,offset:a}=s.content.findIndex(o),c=o-a;if(r.push(s,l,i+a),!c||(s=s.child(l),s.isText))break;o=c-1,i+=a+1}return new n(t,r,o)}static resolveCached(e,t){let r=jl.get(e);if(r)for(let o=0;o<r.elts.length;o++){let s=r.elts[o];if(s.pos==t)return s}else jl.set(e,r=new eo);let i=r.elts[r.i]=n.resolve(e,t);return r.i=(r.i+1)%Rf,i}};var eo=class{constructor(){this.elts=[],this.i=0}};var Rf=12;var jl=new WeakMap;var bt=class{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}};var Pf=Object.create(null);var Te=class n{constructor(e,t,r,i=z.none){this.type=e,this.attrs=t,this.marks=i,this.content=r||k.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,i=0){this.content.nodesBetween(e,t,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,r,i){return this.content.textBetween(e,t,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&xr(this.attrs,t||e.defaultAttrs||Pf)&&z.sameSet(this.marks,r||z.none)}copy(e=null){return e==this.content?this:new n(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new n(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return v.empty;let i=this.resolve(e),o=this.resolve(t),s=r?0:i.sharedDepth(t),l=i.start(s);return new v(i.node(s).content.cut(i.pos-l,o.pos-l),i.depth-s,o.depth-s)}replace(e,t,r){return Df(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let i=this.content.child(t-1);return{node:i,index:t-1,offset:r-i.nodeSize}}resolve(e){return vr.resolveCached(this,e)}resolveNoCache(e){return vr.resolve(this,e)}rangeHasMark(e,t,r){let i=!1;return t>e&&this.nodesBetween(e,t,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),la(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,r=k.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),l=s&&s.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=i;a<o;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,t,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),s=o&&o.matchFragment(this.content,t);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=z.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!z.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError(`Invalid input for Node.fromJSON`);let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError(`Invalid mark data for Node.fromJSON`);r=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw new RangeError(`Invalid text node in JSON`);return e.text(t.text,r)}let i=k.fromJSON(e,t.content),o=e.nodeType(t.type).create(t.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};Te.prototype.text=void 0;var to=class n extends Te{constructor(e,t,r,i){if(super(e,t,null,i),!r)throw new RangeError(`Empty text nodes are not allowed`);this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):la(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new n(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new n(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function la(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+`(`+e+`)`;return e}var kt=class n{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new no(e,t);if(r.next==null)return n.empty;let i=aa(r);r.next&&r.err(`Unexpected trailing text`);let o=Hf(_f(i));return Vf(o,r),o}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let i=this;for(let o=t;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let i=[this];function o(s,l){let a=s.matchFragment(e,r);if(a&&(!t||a.validEnd))return k.from(l.map(c=>c.createAndFill()));for(let c=0;c<s.next.length;c++){let{type:d,next:u}=s.next[c];if(!(d.isText||d.hasRequiredAttrs())&&i.indexOf(u)==-1){i.push(u);let f=o(u,l.concat(d));if(f)return f}}return null}return o(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let s=[];for(let l=i;l.type;l=l.via)s.push(l.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:l,next:a}=o.next[s];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in t)&&(!i.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:i}),t[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&t(r.next[i].next)}return t(this),e.map((r,i)=>{let o=i+(r.validEnd?`*`:` `)+` `;for(let s=0;s<r.next.length;s++)o+=(s?`, `:``)+r.next[s].type.name+`->`+e.indexOf(r.next[s].next);return o}).join(`
|
|
2
2
|
`)}};kt.empty=new kt(!0);var no=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==``&&this.tokens.pop(),this.tokens[0]==``&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+` (in content expression '`+this.string+`')`)}};function aa(n){let e=[];do e.push(Lf(n));while(n.eat(`|`));return e.length==1?e[0]:{type:`choice`,exprs:e}}function Lf(n){let e=[];do e.push(Bf(n));while(n.next&&n.next!=`)`&&n.next!=`|`);return e.length==1?e[0]:{type:`seq`,exprs:e}}function Bf(n){let e=Ff(n);for(;;)if(n.eat(`+`))e={type:`plus`,expr:e};else if(n.eat(`*`))e={type:`star`,expr:e};else if(n.eat(`?`))e={type:`opt`,expr:e};else if(n.eat(`{`))e=zf(n,e);else break;return e}function Wl(n){/\D/.test(n.next)&&n.err(`Expected number, got '`+n.next+`'`);let e=Number(n.next);return n.pos++,e}function zf(n,e){let t=Wl(n),r=t;return n.eat(`,`)&&(n.next!=`}`?r=Wl(n):r=-1),n.eat(`}`)||n.err(`Unclosed braced range`),{type:`range`,min:t,max:r,expr:e}}function $f(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let i=[];for(let o in t){let s=t[o];s.isInGroup(e)&&i.push(s)}return i.length==0&&n.err(`No node type or group '`+e+`' found`),i}function Ff(n){if(n.eat(`(`)){let e=aa(n);return n.eat(`)`)||n.err(`Missing closing paren`),e}else if(/\W/.test(n.next))n.err(`Unexpected token '`+n.next+`'`);else{let e=$f(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err(`Mixing inline and block content`),{type:`name`,value:t}));return n.pos++,e.length==1?e[0]:{type:`choice`,exprs:e}}}function _f(n){let e=[[]];return i(o(n,0),t()),e;function t(){return e.push([])-1}function r(s,l,a){let c={term:a,to:l};return e[s].push(c),c}function i(s,l){s.forEach(a=>a.to=l)}function o(s,l){if(s.type==`choice`)return s.exprs.reduce((a,c)=>a.concat(o(c,l)),[]);if(s.type==`seq`)for(let a=0;;a++){let c=o(s.exprs[a],l);if(a==s.exprs.length-1)return c;i(c,l=t())}else if(s.type==`star`){let a=t();return r(l,a),i(o(s.expr,a),a),[r(a)]}else if(s.type==`plus`){let a=t();return i(o(s.expr,l),a),i(o(s.expr,a),a),[r(a)]}else{if(s.type==`opt`)return[r(l)].concat(o(s.expr,l));if(s.type==`range`){let a=l;for(let c=0;c<s.min;c++){let d=t();i(o(s.expr,a),d),a=d}if(s.max==-1)i(o(s.expr,a),a);else for(let c=s.min;c<s.max;c++){let d=t();r(a,d),i(o(s.expr,a),d),a=d}return[r(a)]}else{if(s.type==`name`)return[r(l,void 0,s.value)];throw new Error(`Unknown expr type`)}}}}function ca(n,e){return e-n}function Kl(n,e){let t=[];return r(e),t.sort(ca);function r(i){let o=n[i];if(o.length==1&&!o[0].term)return r(o[0].to);t.push(i);for(let s=0;s<o.length;s++){let{term:l,to:a}=o[s];!l&&t.indexOf(a)==-1&&r(a)}}}function Hf(n){let e=Object.create(null);return t(Kl(n,0));function t(r){let i=[];r.forEach(s=>{n[s].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let d=0;d<i.length;d++)i[d][0]==l&&(c=i[d][1]);Kl(n,a).forEach(d=>{c||i.push([l,c=[]]),c.indexOf(d)==-1&&c.push(d)})})});let o=e[r.join(`,`)]=new kt(r.indexOf(n.length-1)>-1);for(let s=0;s<i.length;s++){let l=i[s][1].sort(ca);o.next.push({type:i[s][0],next:e[l.join(`,`)]||t(l)})}return o}}function Vf(n,e){for(let t=0,r=[n];t<r.length;t++){let i=r[t],o=!i.validEnd,s=[];for(let l=0;l<i.next.length;l++){let{type:a,next:c}=i.next[l];s.push(a.name),o&&!(a.isText||a.hasRequiredAttrs())&&(o=!1),r.indexOf(c)==-1&&r.push(c)}o&&e.err(`Only non-generatable nodes (`+s.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}function da(n){let e=Object.create(null);for(let t in n){let r=n[t];if(!r.hasDefault)return null;e[t]=r.default}return e}function ua(n,e){let t=Object.create(null);for(let r in n){let i=e&&e[r];if(i===void 0){let o=n[r];if(o.hasDefault)i=o.default;else throw new RangeError(`No value supplied for attribute `+r)}t[r]=i}return t}function fa(n,e,t,r){for(let i in e)if(!(i in n))throw new RangeError(`Unsupported attribute ${i} for ${t} of type ${r}`);for(let i in n)n[i].validate&&n[i].validate(e[i])}function ha(n,e){let t=Object.create(null);if(e)for(let r in e)t[r]=new ro(n,r,e[r]);return t}var wr=class n{constructor(e,t,r){this.name=e,this.schema=t,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(` `):[],this.attrs=ha(e,r.attrs),this.defaultAttrs=da(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e==`text`),this.isText=e==`text`}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==kt.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?`pre`:`normal`)}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:ua(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error(`NodeType.create can't construct text nodes`);return new Te(this,this.computeAttrs(e),k.from(t),z.setFrom(r))}createChecked(e=null,t,r){return t=k.from(t),this.checkContent(t),new Te(this,this.computeAttrs(e),t,z.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=k.from(t),t.size){let s=this.contentMatch.fillBefore(t);if(!s)return null;t=s.append(t)}let i=this.contentMatch.matchFragment(t),o=i&&i.fillBefore(k.empty,!0);return o?new Te(this,e,t.append(o),z.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){fa(this.attrs,e,`node`,this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?t&&t.push(e[r]):t||(t=e.slice(0,r));return t?t.length?t:z.none:e}static compile(e,t){let r=Object.create(null);e.forEach((o,s)=>r[o]=new n(o,t,s));let i=t.spec.topNode||`doc`;if(!r[i])throw new RangeError(`Schema is missing its top node type ('`+i+`')`);if(!r.text)throw new RangeError(`Every schema needs a 'text' type`);for(let o in r.text.attrs)throw new RangeError(`The text node type should not have attributes`);return r}};function jf(n,e,t){let r=t.split(`|`);return i=>{let o=i===null?`null`:typeof i;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${n}, got ${o}`)}}var ro=class{constructor(e,t,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,`default`),this.default=r.default,this.validate=typeof r.validate==`string`?jf(e,t,r.validate):r.validate}get isRequired(){return!this.hasDefault}};var wn=class n{constructor(e,t,r,i){this.name=e,this.rank=t,this.schema=r,this.spec=i,this.attrs=ha(e,i.attrs),this.excluded=null;let o=da(this.attrs);this.instance=o?new z(this,o):null}create(e=null){return!e&&this.instance?this.instance:new z(this,ua(this.attrs,e))}static compile(e,t){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new n(o,i++,t,s)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){fa(this.attrs,e,`mark`,this.name)}excludes(e){return this.excluded.indexOf(e)>-1}};var Mn=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=Yi.from(e.nodes),t.marks=Yi.from(e.marks||{}),this.nodes=wr.compile(this.spec.nodes,this),this.marks=wn.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+` can not be both a node and a mark`);let o=this.nodes[i],s=o.spec.content||``,l=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=kt.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError(`Multiple linebreak nodes defined`);if(!o.isInline||!o.isLeaf)throw new RangeError(`Linebreak replacement nodes must be inline leaf nodes`);this.linebreakReplacement=o}o.markSet=l==`_`?null:l?Ul(this,l.split(` `)):l==``||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==``?[]:Ul(this,s.split(` `))}this.nodeFromJSON=i=>Te.fromJSON(this,i),this.markFromJSON=i=>z.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||`doc`],this.cached.wrappings=Object.create(null)}node(e,t=null,r,i){if(typeof e==`string`)e=this.nodeType(e);else if(e instanceof wr){if(e.schema!=this)throw new RangeError(`Node type from different schema used (`+e.name+`)`)}else throw new RangeError(`Invalid node type: `+e);return e.createChecked(t,r,i)}text(e,t){let r=this.nodes.text;return new to(r,r.defaultAttrs,e,z.setFrom(t))}mark(e,t){return typeof e==`string`&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError(`Unknown node type: `+e);return t}};function Ul(n,e){let t=[];for(let r=0;r<e.length;r++){let i=e[r],o=n.marks[i],s=o;if(o)t.push(o);else for(let l in n.marks){let a=n.marks[l];(i==`_`||a.spec.group&&a.spec.group.split(` `).indexOf(i)>-1)&&t.push(s=a)}if(!s)throw new SyntaxError(`Unknown mark type: '`+e[r]+`'`)}return t}function Wf(n){return n.tag!=null}function Kf(n){return n.style!=null}var He=class n{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];t.forEach(i=>{if(Wf(i))this.tags.push(i);else if(Kf(i)){let o=/[^=]*/.exec(i.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=e.nodes[i.node];return o.contentMatch.matchType(o)})}parse(e,t={}){let r=new Mr(this,t,!1);return r.addAll(e,z.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new Mr(this,t,!0);return r.addAll(e,z.none,t.from,t.to),v.maxOpen(r.finish())}matchTag(e,t,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(qf(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||t.matchesContext(o.context))){if(o.getAttrs){let s=o.getAttrs(e);if(s===!1)continue;o.attrs=s||void 0}return o}}}matchStyle(e,t,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let s=this.styles[o],l=s.style;if(!(l.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=t))){if(s.getAttrs){let a=s.getAttrs(t);if(a===!1)continue;s.attrs=a||void 0}return s}}}static schemaRules(e){let t=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s<t.length;s++){let l=t[s];if((l.priority==null?50:l.priority)<o)break}t.splice(s,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(s=>{r(s=ql(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=ql(s)),s.node||s.ignore||s.mark||(s.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new n(e,n.schemaRules(e)))}};var pa={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0};var Uf={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0};var ma={ol:!0,ul:!0};var Cn=1;var io=2;var vn=4;function Jl(n,e,t){return e!=null?(e?Cn:0)|(e===`full`?io:0):n&&n.whitespace==`pre`?Cn|io:t&~vn}var zt=class{constructor(e,t,r,i,o,s){this.type=e,this.attrs=t,this.marks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=z.none,this.match=o||(s&vn?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(k.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Cn)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let t=k.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(k.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!pa.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}};var Mr=class{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=t.topNode,o,s=Jl(null,t.preserveWhitespace,0)|(r?vn:0);i?o=new zt(i.type,i.attrs,z.none,!0,t.topMatch||i.type.contentMatch,s):r?o=new zt(null,null,z.none,!0,null,s):o=new zt(e.schema.topNodeType,null,z.none,!0,null,s),this.nodes=[o],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let r=e.nodeValue,i=this.top,o=i.options&io?`full`:this.localPreserveWS||(i.options&Cn)>0,{schema:s}=this.parser;if(o===`full`||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(o)if(o===`full`)r=r.replace(/\r\n?/g,`
|
|
3
3
|
`);else if(s.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(s.linebreakReplacement.create())){let l=r.split(/\r?\n|\r/);for(let a=0;a<l.length;a++)a&&this.insertNode(s.linebreakReplacement.create(),t,!0),l[a]&&this.insertNode(s.text(l[a]),t,!/\S/.test(l[a]));r=``}else r=r.replace(/\r?\n|\r/g,` `);else if(r=r.replace(/[ \t\r\n\u000c]+/g,` `),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let l=i.content[i.content.length-1],a=e.previousSibling;(!l||a&&a.nodeName==`BR`||l.isText&&/[ \t\r\n\u000c]$/.test(l.text))&&(r=r.slice(1))}r&&this.insertNode(s.text(r),t,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,t,r){let i=this.localPreserveWS,o=this.top;(e.tagName==`PRE`||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),l;ma.hasOwnProperty(s)&&this.parser.normalizeLists&&Jf(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,r));e:if(a?a.ignore:Uf.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,t);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);let c,d=this.needsBlock;if(pa.hasOwnProperty(s))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),c=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let u=a&&a.skip?t:this.readStyles(e,t);u&&this.addAll(e,u),c&&this.sync(o),this.needsBlock=d}else{let c=this.readStyles(e,t);c&&this.addElementByRule(e,a,c,a.consuming===!1?l:void 0)}this.localPreserveWS=i}leafFallback(e,t){e.nodeName==`BR`&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
4
4
|
`),t)}ignoreFallback(e,t){e.nodeName==`BR`&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text(`-`),t,!0)}readStyles(e,t){let r=e.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let o=this.parser.matchedStyles[i],s=r.getPropertyValue(o);if(s)for(let l=void 0;;){let a=this.parser.matchStyle(o,s,this,l);if(!a)break;if(a.ignore)return null;if(a.clearMark?t=t.filter(c=>!a.clearMark(c)):t=t.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return t}addElementByRule(e,t,r,i){let o,s;if(t.node)if(s=this.parser.schema.nodes[t.node],s.isLeaf)this.insertNode(s.create(t.attrs),r,e.nodeName==`BR`)||this.leafFallback(e,r);else{let a=this.enter(s,t.attrs||null,r,t.preserveWhitespace);a&&(o=!0,r=a)}else{let a=this.parser.schema.marks[t.mark];r=r.concat(a.create(t.attrs))}let l=this.top;if(s&&s.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a,r,!1));else{let a=e;typeof t.contentElement==`string`?a=e.querySelector(t.contentElement):typeof t.contentElement==`function`?a=t.contentElement(e):t.contentElement&&(a=t.contentElement),this.findAround(e,a,!0),this.addAll(a,r),this.findAround(e,a,!1)}o&&this.sync(l)&&this.open--}addAll(e,t,r,i){let o=r||0;for(let s=r?e.childNodes[r]:e.firstChild,l=i==null?null:e.childNodes[i];s!=l;s=s.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(s,t);this.findAtPoint(e,o)}findPlace(e,t,r){let i,o;for(let s=this.open,l=0;s>=0;s--){let a=this.nodes[s],c=a.findWrapping(e);if(c&&(!i||i.length>c.length+l)&&(i=c,o=a,!c.length))break;if(a.solid){if(r)break;l+=2}}if(!i)return null;this.sync(o);for(let s=0;s<i.length;s++)t=this.enterInner(i[s],null,t,!1);return t}insertNode(e,t,r){if(e.isInline&&this.needsBlock&&!this.top.type){let o=this.textblockFromContext();o&&(t=this.enterInner(o,null,t))}let i=this.findPlace(e,t,r);if(i){this.closeExtra();let o=this.top;o.match&&(o.match=o.match.matchType(e.type));let s=z.none;for(let l of i.concat(e.marks))(o.type?o.type.allowsMarkType(l.type):Gl(l.type,e.type))&&(s=l.addToSet(s));return o.content.push(e.mark(s)),!0}return!1}enter(e,t,r,i){let o=this.findPlace(e.create(t),r,!1);return o&&(o=this.enterInner(e,t,r,!0,i)),o}enterInner(e,t,r,i=!1,o){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let l=Jl(e,o,s.options);s.options&vn&&s.content.length==0&&(l|=vn);let a=z.none;return r=r.filter(c=>(s.type?s.type.allowsMarkType(c.type):Gl(c.type,e))?(a=c.addToSet(a),!1):!0),this.nodes.push(new zt(e,t,a,i,null,l)),this.open++,r}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=Cn)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==t&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&t.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf(`|`)>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split(`/`),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(l,a)=>{for(;l>=0;l--){let c=t[l];if(c==``){if(l==t.length-1||l==0)continue;for(;a>=o;a--)if(s(l-1,a))return!0;return!1}else{let d=a>0||a==0&&i?this.nodes[a].type:r&&a>=o?r.node(a-o).type:null;if(!d||d.name!=c&&!d.isInGroup(c))return!1;a--}}return!0};return s(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}};function Jf(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&ma.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r==`li`?t=e:r&&(t=null)}}function qf(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function ql(n){let e={};for(let t in n)e[t]=n[t];return e}function Gl(n,e){let t=e.schema.nodes;for(let r in t){let i=t[r];if(!i.allowsMarkType(n))continue;let o=[],s=l=>{o.push(l);for(let a=0;a<l.edgeCount;a++){let{type:c,next:d}=l.edge(a);if(c==e||o.indexOf(d)<0&&s(d))return!0}};if(s(i.contentMatch))return!0}}var Ve=class n{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=br(t).createDocumentFragment());let i=r,o=[];return e.forEach(s=>{if(o.length||s.marks.length){let l=0,a=0;for(;l<o.length&&a<s.marks.length;){let c=s.marks[a];if(!this.marks[c.type.name]){a++;continue}if(!c.eq(o[l][0])||c.type.spec.spanning===!1)break;l++,a++}for(;l<o.length;)i=o.pop()[1];for(;a<s.marks.length;){let c=s.marks[a++],d=this.serializeMark(c,s.isInline,t);d&&(o.push([c,i]),i.appendChild(d.dom),i=d.contentDOM||d.dom)}}i.appendChild(this.serializeNodeInner(s,t))}),r}serializeNodeInner(e,t){if(e.isText)return br(t).createTextNode(e.text);let{dom:r,contentDOM:i}=kr(br(t),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError(`Content hole not allowed in a leaf node spec`);this.serializeFragment(e.content,t,i)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,t,r={}){let i=this.marks[e.type.name];return i&&kr(br(r),i(e,t),null,e.attrs)}static renderSpec(e,t,r=null,i){return typeof t==`string`?{dom:e.createTextNode(t)}:kr(e,t,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new n(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Xl(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return Xl(e.marks)}};function Xl(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function br(n){return n.document||window.document}var Yl=new WeakMap;function Gf(n){let e=Yl.get(n);return e===void 0&&Yl.set(n,e=Xf(n)),e}function Xf(n){let e=null;function t(r){if(r&&typeof r==`object`)if(Array.isArray(r))if(typeof r[0]==`string`)e||(e=[]),e.push(r);else for(let i=0;i<r.length;i++)t(r[i]);else for(let i in r)t(r[i])}return t(n),e}function kr(n,e,t,r){if(e.nodeType==1)return{dom:e};if(e.dom&&e.dom.nodeType==1)return e;let i=e[0],o;if(typeof i!=`string`)throw new RangeError(`Invalid array passed to renderSpec`);if(r&&(o=Gf(r))&&o.indexOf(e)>-1)throw new RangeError(`Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.`);let s=i.indexOf(` `);s>0&&(t=i.slice(0,s),i=i.slice(s+1));let l,a=t?n.createElementNS(t,i):n.createElement(i),c=e[1],d=1;if(c&&typeof c==`object`&&c.nodeType==null&&!Array.isArray(c)){d=2;for(let u in c)if(c[u]!=null){let f=u.indexOf(` `);f>0?a.setAttributeNS(u.slice(0,f),u.slice(f+1),c[u]):u==`style`&&a.style?a.style.cssText=c[u]:a.setAttribute(u,c[u])}}for(let u=d;u<e.length;u++){let f=e[u];if(f===0){if(u<e.length-1||u>d)throw new RangeError(`Content hole must be the only child of its parent node`);return{dom:a,contentDOM:a}}else if(typeof f==`string`)a.appendChild(n.createTextNode(f));else{let{dom:h,contentDOM:p}=kr(n,f,t,r);if(a.appendChild(h),p){if(l)throw new RangeError(`Multiple content holes`);l=p}}}return{dom:a,contentDOM:l}}var xa=65535;var Sa=Math.pow(2,16);function Yf(n,e){return n+e*Sa}function ga(n){return n&xa}function Qf(n){return(n-(n&xa))/Sa}var va=1;var wa=2;var Cr=4;var Ma=8;var An=class{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&Ma)>0}get deletedBefore(){return(this.delInfo&(va|Cr))>0}get deletedAfter(){return(this.delInfo&(wa|Cr))>0}get deletedAcross(){return(this.delInfo&Cr)>0}};var je=class n{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&n.empty)return n.empty}recover(e){let t=0,r=ga(e);if(!this.inverted)for(let i=0;i<r;i++)t+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+t+Qf(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let i=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?i:0);if(a>e)break;let c=this.ranges[l+o],d=this.ranges[l+s],u=a+c;if(e<=u){let f=c?e==a?-1:e==u?1:t:t,h=a+i+(f<0?0:d);if(r)return h;let p=e==(t<0?a:u)?null:Yf(l/3,e-a),m=e==a?wa:e==u?va:Cr;return(t<0?e!=a:e!=u)&&(m|=Ma),new An(h,m,p)}i+=d-c}return r?e+i:new An(e+i,0,null)}touches(e,t){let r=0,i=ga(t),o=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?r:0);if(a>e)break;let c=this.ranges[l+o];if(e<=a+c&&l==i*3)return!0;r+=this.ranges[l+s]-c}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],l=s-(this.inverted?o:0),a=s+(this.inverted?0:o),c=this.ranges[i+t],d=this.ranges[i+r];e(l,l+c,a,a+d),o+=d-c}}invert(){return new n(this.ranges,!this.inverted)}toString(){return(this.inverted?`-`:``)+JSON.stringify(this.ranges)}static offset(e){return e==0?n.empty:new n(e<0?[0,-e,0]:[0,0,e])}};je.empty=new je([]);var Nn=class n{constructor(e,t,r=0,i=e?e.length:0){this.mirror=t,this.from=r,this.to=i,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new n(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,r=this._maps.length;t<e._maps.length;t++){let i=e.getMirror(t);this.appendMap(e._maps[t],i!=null&&i<t?r+i:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this._maps.length+e._maps.length;t>=0;t--){let i=e.getMirror(t);this.appendMap(e._maps[t].invert(),i!=null&&i>t?r-i-1:void 0)}}invert(){let e=new n;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let i=0;for(let o=this.from;o<this.to;o++){let l=this._maps[o].mapResult(e,t);if(l.recover!=null){let a=this.getMirror(o);if(a!=null&&a>o&&a<this.to){o=a,e=this._maps[a].recover(l.recover);continue}}i|=l.delInfo,e=l.pos}return r?e:new An(e,i,null)}};var oo=Object.create(null);var X=class{getMap(){return je.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError(`Invalid input for Step.fromJSON`);let r=oo[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in oo)throw new RangeError(`Duplicate use of step JSON ID `+e);return oo[e]=t,t.prototype.jsonID=e,t}};var Y=class n{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new n(e,null)}static fail(e){return new n(null,e)}static fromReplace(e,t,r,i){try{return n.ok(e.replace(t,r,i))}catch(o){if(o instanceof ot)return n.fail(o.message);throw o}}};function co(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let o=n.child(i);o.content.size&&(o=o.copy(co(o.content,e,o))),o.isInline&&(o=e(o,t,i)),r.push(o)}return k.fromArray(r)}var On=class n extends X{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new v(co(t.content,(s,l)=>!s.isAtom||!l.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),t.openStart,t.openEnd);return Y.fromReplace(e,this.from,this.to,o)}invert(){return new We(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new n(t.pos,r.pos,this.mark)}merge(e){return e instanceof n&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new n(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:`addMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!=`number`||typeof t.to!=`number`)throw new RangeError(`Invalid input for AddMarkStep.fromJSON`);return new n(t.from,t.to,e.markFromJSON(t.mark))}};X.jsonID(`addMark`,On);var We=class n extends X{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new v(co(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return Y.fromReplace(e,this.from,this.to,r)}invert(){return new On(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new n(t.pos,r.pos,this.mark)}merge(e){return e instanceof n&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new n(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:`removeMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!=`number`||typeof t.to!=`number`)throw new RangeError(`Invalid input for RemoveMarkStep.fromJSON`);return new n(t.from,t.to,e.markFromJSON(t.mark))}};X.jsonID(`removeMark`,We);var Dn=class n extends X{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Y.fail(`No node at mark step's position`);let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Y.fromReplace(e,this.pos,this.pos+1,new v(k.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(r))return new n(this.pos,t.marks[i]);return new n(this.pos,this.mark)}}return new $t(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new n(t.pos,this.mark)}toJSON(){return{stepType:`addNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!=`number`)throw new RangeError(`Invalid input for AddNodeMarkStep.fromJSON`);return new n(t.pos,e.markFromJSON(t.mark))}};X.jsonID(`addNodeMark`,Dn);var $t=class n extends X{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Y.fail(`No node at mark step's position`);let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Y.fromReplace(e,this.pos,this.pos+1,new v(k.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Dn(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new n(t.pos,this.mark)}toJSON(){return{stepType:`removeNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!=`number`)throw new RangeError(`Invalid input for RemoveNodeMarkStep.fromJSON`);return new n(t.pos,e.markFromJSON(t.mark))}};X.jsonID(`removeNodeMark`,$t);var oe=(()=>{class n extends X{constructor(t,r,i,o=!1){super(),this.from=t,this.to=r,this.slice=i,this.structure=o}apply(t){return this.structure&&lo(t,this.from,this.to)?Y.fail(`Structure replace would overwrite content`):Y.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new je([this.from,this.to-this.from,this.slice.size])}invert(t){return new n(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let r=t.mapResult(this.to,-1),i=this.from==this.to&&n.MAP_BIAS<0?r:t.mapResult(this.from,1);return i.deletedAcross&&r.deletedAcross?null:new n(i.pos,Math.max(i.pos,r.pos),this.slice,this.structure)}merge(t){if(!(t instanceof n)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let r=this.slice.size+t.slice.size==0?v.empty:new v(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new n(this.from,this.to+(t.to-t.from),r,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let r=this.slice.size+t.slice.size==0?v.empty:new v(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new n(t.from,this.to,r,this.structure)}else return null}toJSON(){let t={stepType:`replace`,from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,r){if(typeof r.from!=`number`||typeof r.to!=`number`)throw new RangeError(`Invalid input for ReplaceStep.fromJSON`);return new n(r.from,r.to,v.fromJSON(t,r.slice),!!r.structure)}}return n.MAP_BIAS=1,n})();X.jsonID(`replace`,oe);var J=class n extends X{constructor(e,t,r,i,o,s,l=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=l}apply(e){if(this.structure&&(lo(e,this.from,this.gapFrom)||lo(e,this.gapTo,this.to)))return Y.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Y.fail(`Gap is not a flat range`);let r=this.slice.insertAt(this.insert,t.content);return r?Y.fromReplace(e,this.from,this.to,r):Y.fail(`Content does not fit in gap`)}getMap(){return new je([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new n(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||i<t.pos||o>r.pos?null:new n(t.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:`replaceAround`,from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!=`number`||typeof t.to!=`number`||typeof t.gapFrom!=`number`||typeof t.gapTo!=`number`||typeof t.insert!=`number`)throw new RangeError(`Invalid input for ReplaceAroundStep.fromJSON`);return new n(t.from,t.to,t.gapFrom,t.gapTo,v.fromJSON(e,t.slice),t.insert,!!t.structure)}};X.jsonID(`replaceAround`,J);function lo(n,e,t){let r=n.resolve(e),i=t-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function Zf(n,e,t,r){let i=[],o=[],s,l;n.doc.nodesBetween(e,t,(a,c,d)=>{if(!a.isInline)return;let u=a.marks;if(!r.isInSet(u)&&d.type.allowsMarkType(r.type)){let f=Math.max(c,e),h=Math.min(c+a.nodeSize,t),p=r.addToSet(u);for(let m=0;m<u.length;m++)u[m].isInSet(p)||(s&&s.to==f&&s.mark.eq(u[m])?s.to=h:i.push(s=new We(f,h,u[m])));l&&l.to==f?l.to=h:o.push(l=new On(f,h,r))}}),i.forEach(a=>n.step(a)),o.forEach(a=>n.step(a))}function eh(n,e,t,r){let i=[],o=0;n.doc.nodesBetween(e,t,(s,l)=>{if(!s.isInline)return;o++;let a=null;if(r instanceof wn){let c=s.marks,d;for(;d=r.isInSet(c);)(a||(a=[])).push(d),c=d.removeFromSet(c)}else r?r.isInSet(s.marks)&&(a=[r]):a=s.marks;if(a&&a.length){let c=Math.min(l+s.nodeSize,t);for(let d=0;d<a.length;d++){let u=a[d],f;for(let h=0;h<i.length;h++){let p=i[h];p.step==o-1&&u.eq(i[h].style)&&(f=p)}f?(f.to=c,f.step=o):i.push({style:u,from:Math.max(l,e),to:c,step:o})}}}),i.forEach(s=>n.step(new We(s.from,s.to,s.style)))}function uo(n,e,t,r=t.contentMatch,i=!0){let o=n.doc.nodeAt(e),s=[],l=e+1;for(let a=0;a<o.childCount;a++){let c=o.child(a),d=l+c.nodeSize,u=r.matchType(c.type);if(!u)s.push(new oe(l,d,v.empty));else{r=u;for(let f=0;f<c.marks.length;f++)t.allowsMarkType(c.marks[f].type)||n.step(new We(l,d,c.marks[f]));if(i&&c.isText&&t.whitespace!=`pre`){let f,h=/\r?\n|\r/g,p;for(;f=h.exec(c.text);)p||(p=new v(k.from(t.schema.text(` `,t.allowedMarks(c.marks))),0,0)),s.push(new oe(l+f.index,l+f.index+f[0].length,p))}}l=d}if(!r.validEnd){let a=r.fillBefore(k.empty,!0);n.replace(l,l,new v(a,0,0))}for(let a=s.length-1;a>=0;a--)n.step(s[a])}function th(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function Ke(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth,i=0,o=0;;--r){let s=n.$from.node(r),l=n.$from.index(r)+i,a=n.$to.indexAfter(r)-o;if(r<n.depth&&s.canReplace(l,a,t))return r;if(r==0||s.type.spec.isolating||!th(s,l,a))break;l&&(i=1),a<s.childCount&&(o=1)}return null}function nh(n,e,t){let{$from:r,$to:i,depth:o}=e,s=r.before(o+1),l=i.after(o+1),a=s,c=l,d=k.empty,u=0;for(let p=o,m=!1;p>t;p--)m||r.index(p)>0?(m=!0,d=k.from(r.node(p).copy(d)),u++):a--;let f=k.empty,h=0;for(let p=o,m=!1;p>t;p--)m||i.after(p+1)<i.end(p)?(m=!0,f=k.from(i.node(p).copy(f)),h++):c++;n.step(new J(a,c,s,l,new v(d.append(f),u,h),d.size-u,!0))}function Ht(n,e,t=null,r=n){let i=rh(n,e),o=i&&ih(r,e);return o?i.map(ya).concat({type:e,attrs:t}).concat(o.map(ya)):null}function ya(n){return{type:n,attrs:null}}function rh(n,e){let{parent:t,startIndex:r,endIndex:i}=n,o=t.contentMatchAt(r).findWrapping(e);if(!o)return null;let s=o.length?o[0]:e;return t.canReplaceWith(r,i,s)?o:null}function ih(n,e){let{parent:t,startIndex:r,endIndex:i}=n,o=t.child(r),s=e.contentMatch.findWrapping(o.type);if(!s)return null;let a=(s.length?s[s.length-1]:e).contentMatch;for(let c=r;a&&c<i;c++)a=a.matchType(t.child(c).type);return!a||!a.validEnd?null:s}function oh(n,e,t){let r=k.empty;for(let s=t.length-1;s>=0;s--){if(r.size){let l=t[s].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError(`Wrapper type given to Transform.wrap does not form valid content of its parent wrapper`)}r=k.from(t[s].type.create(t[s].attrs,r))}let i=e.start,o=e.end;n.step(new J(i,o,i,o,new v(r,0,0),t.length,!0))}function sh(n,e,t,r,i){if(!r.isTextblock)throw new RangeError(`Type given to setBlockType should be a textblock`);let o=n.steps.length;n.doc.nodesBetween(e,t,(s,l)=>{let a=typeof i==`function`?i(s):i;if(s.isTextblock&&!s.hasMarkup(r,a)&&lh(n.doc,n.mapping.slice(o).map(l),r)){let c=null;if(r.schema.linebreakReplacement){let h=r.whitespace==`pre`,p=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!p?c=!1:!h&&p&&(c=!0)}c===!1&&Ta(n,s,l,o),uo(n,n.mapping.slice(o).map(l,1),r,void 0,c===null);let d=n.mapping.slice(o),u=d.map(l,1),f=d.map(l+s.nodeSize,1);return n.step(new J(u,f,u+1,f-1,new v(k.from(r.create(a,null,s.marks)),0,0),1,!0)),c===!0&&Ca(n,s,l,o),!1}})}function Ca(n,e,t,r){e.forEach((i,o)=>{if(i.isText){let s,l=/\r?\n|\r/g;for(;s=l.exec(i.text);){let a=n.mapping.slice(r).map(t+1+o+s.index);n.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function Ta(n,e,t,r){e.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=n.mapping.slice(r).map(t+1+o);n.replaceWith(s,s+1,e.type.schema.text(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Dn as g,H as JD,o as A,ot as OD}from"./chunk-BAHiFuUo.js";import{wi as wu}from"./chunk-BAe_07VM.js";import{n as m}from"./chunk-Dv9sNWWK.js";import{Bc as qd,Ga as ar,cs as ia,ei as TC,sr as Od}from"./chunk-
|
|
1
|
+
import{Dn as g,H as JD,o as A,ot as OD}from"./chunk-BAHiFuUo.js";import{wi as wu}from"./chunk-BAe_07VM.js";import{n as m}from"./chunk-Dv9sNWWK.js";import{Bc as qd,Ga as ar,cs as ia,ei as TC,sr as Od}from"./chunk-D8Ui_APT.js";var y=class r{http=g(OD);async list(){let e=await JD(this.http.get(`/api/clients`));return wu.decodeUnknownSync(qd)(e)}async create(e){return m(this.http.post(`/api/clients`,e),ar,TC,`client.error`)}async get(e){return m(this.http.get(`/api/clients/${e}`),ar,TC,`client.error`)}async update(e,n){return m(this.http.put(`/api/clients/${e}`,n),ar,TC,`client.error`)}async archive(e){return m(this.http.post(`/api/clients/${e}/archive`,void 0),ar,TC,`client.error`)}async reactivate(e){return m(this.http.post(`/api/clients/${e}/reactivate`,void 0),ar,TC,`client.error`)}async createAccess(e,n){return m(this.http.post(`/api/clients/${e}/access`,n),ia,TC,`client.error`)}async listAccess(e){return m(this.http.get(`/api/clients/${e}/access`),Od,TC,`client.error`)}async revokeAccess(e,n){return m(this.http.delete(`/api/clients/${e}/access/${n}`),wu.Null,TC,`client.error`)}static ɵfac=function(n){return new(n||r)};static ɵprov=A({token:r,factory:r.ɵfac,providedIn:`root`})};export{y as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Dn as g,H as JD,o as A,ot as OD}from"./chunk-BAHiFuUo.js";import{ct as Me,wi as wu}from"./chunk-BAe_07VM.js";import{Cu as yl,Zo as gl,gu as xl}from"./chunk-
|
|
1
|
+
import{Dn as g,H as JD,o as A,ot as OD}from"./chunk-BAHiFuUo.js";import{ct as Me,wi as wu}from"./chunk-BAe_07VM.js";import{Cu as yl,Zo as gl,gu as xl}from"./chunk-D8Ui_APT.js";var f=class t{http=g(OD);async listQuotes(){return wu.decodeUnknownSync(gl)(await JD(this.http.get(`/api/client/quotes`)))}async listOrders(){return wu.decodeUnknownSync(yl)(await JD(this.http.get(`/api/client/orders`)))}async listInvoices(){return wu.decodeUnknownSync(xl)(await JD(this.http.get(`/api/client/invoices`)))}quotePdfUrl(n){return`/api/client/quotes/${n}/pdf`}invoicePdfUrl(n){return`/api/client/invoices/${n}/pdf`}orderPdfUrl(n){return`/api/client/orders/${n}/pdf`}static ɵfac=function(i){return new(i||t)};static ɵprov=A({token:t,factory:t.ɵfac,providedIn:`root`})};var m=wu.Literals([`all`,`quote`,`order`,`invoice`]);var y=wu.Literals([`all`,`open`,`completed`]);var k=wu.Literals([`none`,`reference-asc`,`reference-desc`,`kind-asc`,`kind-desc`,`status-asc`,`status-desc`,`date-asc`,`date-desc`,`amount-asc`,`amount-desc`]);var h=t=>({search:(t.get(`q`)??``).slice(0,120),kind:Me.getOrElse(wu.decodeUnknownOption(m)(t.get(`kind`)),()=>`all`),status:Me.getOrElse(wu.decodeUnknownOption(y)(t.get(`status`)),()=>`all`),sort:Me.getOrElse(wu.decodeUnknownOption(k)(t.get(`sort`)),()=>`none`)});var S=({search:t,kind:n,status:i,sort:s})=>({q:t||void 0,kind:n===`all`?void 0:n,status:i===`all`?void 0:i,sort:s===`none`?void 0:s});export{y as a,m as i,f as n,h as r,S as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-BAHiFuUo.js";import"./main-LXYWXFW4.js";import"./chunk-BAe_07VM.js";import"./chunk-Dv9sNWWK.js";import"./chunk-D8Ui_APT.js";import{t as E}from"./chunk-DhpMFMQw.js";export{E as Authentication};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Dn as g,H as JD,o as A,ot as OD}from"./chunk-BAHiFuUo.js";import{wi as wu}from"./chunk-BAe_07VM.js";import{n as m}from"./chunk-Dv9sNWWK.js";import{Wn as Mi,nt as E,po as da}from"./chunk-D8Ui_APT.js";var f=wu.Union([Mi,E]);var c=class t{http=g(OD);async get(){return wu.decodeUnknownSync(da)(await JD(this.http.get(`/api/issuer-settings`)))}async update(r){return m(this.http.put(`/api/issuer-settings`,r),da,f,`issuer.error`)}static ɵfac=function(l){return new(l||t)};static ɵprov=A({token:t,factory:t.ɵfac,providedIn:`root`})};export{c as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Dn as g,W as KS,en as ZS,nt as NH,qn as ky,w as Fb}from"./chunk-BAHiFuUo.js";import{m as Ie}from"./main-
|
|
1
|
+
import{Dn as g,W as KS,en as ZS,nt as NH,qn as ky,w as Fb}from"./chunk-BAHiFuUo.js";import{m as Ie}from"./main-LXYWXFW4.js";var u=[`*`];var c=class e{tableLayout=NH(`scroll`);i18n=g(Ie);static ɵfac=function(a){return new(a||e)};static ɵcmp=Fb({type:e,selectors:[[`div`,`appDataTable`,``]],hostAttrs:[`role`,`region`,`tabindex`,`0`,1,`data-table`],hostVars:2,hostBindings:function(a,t){a&2&&ky(`data-table-layout`,t.tableLayout())(`aria-label`,t.i18n.t(`table.scrollRegion`))},inputs:{tableLayout:[1,`tableLayout`]},ngContentSelectors:u,decls:1,vars:0,template:function(a,t){a&1&&(ZS(),KS(0))},styles:[`.data-table{width:100%;min-width:0;max-width:100%;margin:0;overflow-x:auto;overscroll-behavior-inline:contain;border:1px solid var(--%NS%color-line);border-radius:var(--%NS%radius-sm);background:var(--%NS%color-panel)}.data-table:focus-visible{outline:2px solid var(--%NS%color-focus);outline-offset:2px;box-shadow:var(--%NS%shadow-focus)}.data-table table{width:max-content;min-width:100%;border-collapse:collapse}.data-table th,.data-table td{padding:var(--%NS%space-2) var(--%NS%space-3);border-bottom:1px solid var(--%NS%color-line-strong);text-align:start;font-variant-numeric:tabular-nums;vertical-align:middle;white-space:nowrap;font-size:var(--%NS%text-sm)}.data-table thead th{padding-block:var(--%NS%space-1);background:var(--%NS%color-surface-sunken);color:var(--%NS%color-muted);font-size:var(--%NS%text-xs);letter-spacing:var(--%NS%tracking-label);text-transform:uppercase}.data-table[data-table-layout=fluid] table{width:100%;table-layout:fixed}.data-table[data-table-layout=fluid].wide-table table{min-width:40rem}.data-table[data-table-layout=fluid] th,.data-table[data-table-layout=fluid] td{white-space:normal;overflow-wrap:anywhere}.data-table .actions-column{text-align:right}.data-table tbody tr,.data-table tbody tr *{transition:none;animation:none}.data-table tbody tr:hover{background:color-mix(in oklab,var(--%NS%color-surface-sunken),transparent 35%)}.data-table tbody tr:last-child td,.data-table tbody tr:last-child th{border-bottom:0}
|
|
2
2
|
`],encapsulation:2})};export{c as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$t as ZC,A as Gy,D as Fy,Dn as g,E as Ft,Gn as k_,H as JD,Ir as wp,It as Us,Jr as zS,K as Ke$1,Mr as uf,Nr as vd,Rn as jS,Sr as rv,St as Qy,Tn as fd,V as Iy,W as KS,Wn as kS,Wr as y_,X as LS,dr as pe,en as ZS,ft as Ol,lt as OS,mr as qT,nt as NH,o as A,ot as OD,pr as qS,qn as ky,qt as Xg,rn as Zw,rr as nv,tn as ZT,vt as Py,w as Fb,xt as Qg,z as Ip,zr as xA}from"./chunk-BAHiFuUo.js";import{S as gr,T as ue,c as O,h as Ne$1,l as r,m as Ie$1,o as U,r as N,v as Dt,y as G}from"./main-LXYWXFW4.js";import{ct as Me,wi as wu}from"./chunk-BAe_07VM.js";import{n as m}from"./chunk-Dv9sNWWK.js";import{Ka as au,Ma as _o,Pc as pr,nt as E,ss as hu,ts as gu}from"./chunk-D8Ui_APT.js";import{t as k}from"./chunk-IrDYxRzS.js";import{n as u}from"./chunk-BHEFFEGN.js";import"./chunk-BzUDWIzm.js";import{t as P}from"./chunk-CkRw7h0_.js";import"./chunk-CReShp-B.js";import{d as nr,f as or,h as yn,n as an,o as gn,r as cn,t as P$1,u as mn}from"./chunk-CSkyOfSg.js";import{t as D}from"./chunk-BwFjLr9D2.js";import{t as g$1}from"./chunk-D8VZRHVx.js";import{t as a}from"./chunk-1ErswIDf2.js";var Ne=wu.Union([pr,_o,E]);var Q=class t{http=g(OD);async get(n){return m(this.http.post(`/api/public/quote-link`,{token:n}),hu,Ne,`publicQuote.error`)}async getPdf(n){return JD(this.http.post(`/api/public/quote-link/pdf`,{token:n},{responseType:`blob`}))}async sign(n){return m(this.http.post(`/api/public/quote-link/signature`,n),gu,Ne,`publicQuote.error`)}static ɵfac=function(e){return new(e||t)};static ɵprov=A({token:t,factory:t.ɵfac,providedIn:`root`})};var Ie=[`*`];var M=class t{variant=NH(`primary`);color(){switch(this.variant()){case`success`:return`var(--color-success)`;case`danger`:return`var(--color-danger)`;default:return`var(--color-button-primary-highlight)`}}static ɵfac=function(e){return new(e||t)};static ɵcmp=Fb({type:t,selectors:[[``,`appStatusBlock`,``]],hostVars:2,hostBindings:function(e,a){e&2&&Qy(`--%NS%status-color`,a.color())},inputs:{variant:[1,`variant`]},ngContentSelectors:Ie,decls:1,vars:0,template:function(e,a){e&1&&(ZS(),KS(0))},styles:[`[_nghost-%COMP%]{display:grid;gap:var(--%NS%space-3);padding:var(--%NS%space-5);border:1px solid var(--%NS%status-color);border-left-width:4px;background:color-mix(in oklab,var(--%NS%status-color) 8%,var(--%NS%color-surface-raised))}`]})};var Te=t=>({version:t});var we=(t,n)=>n.id;function Fe(t,n){if(t&1&&(Us(0,`section`,1)(1,`p`,4),y_(2),fd(),Us(3,`h1`,5),y_(4),fd()()),t&2){let e=qS();ZC(2),nv(e.i18n.t(`publicQuote.eyebrow`)),ZC(2),nv(e.i18n.t(`publicQuote.loading`))}}function De(t,n){if(t&1&&(Us(0,`li`)(1,`div`)(2,`strong`),y_(3),fd(),Us(4,`span`),y_(5),fd()(),Us(6,`strong`),y_(7),fd()()),t&2){let e=n.$implicit,a=qS(3);ZC(3),nv(e.description),ZC(2),rv(``,a.formatQuantity(e.quantityMilli),` × `,a.formatMoney(e.unitPriceCents)),ZC(2),nv(a.formatMoney(e.totalCents))}}function Ue(t,n){if(t&1&&(Us(0,`div`,18)(1,`h3`),y_(2),fd(),Py(3,`app-document-text-view`,20),fd()),t&2){let e=qS(2),a=qS();ZC(2),nv(a.i18n.t(`publicQuote.conditions`)),ZC(),Fy(`source`,e.snapshot.conditions)(`presentation`,e.snapshot.conditionsPresentation)}}function Re(t,n){if(t&1&&(Us(0,`section`,16)(1,`h2`,17),y_(2),fd(),Us(3,`ol`),LS(4,De,8,4,`li`,null,we),fd(),OS(6,Ue,4,3,`div`,18),Us(7,`a`,19),y_(8),fd()()),t&2){let e=qS(),a=qS();ZC(2),nv(a.i18n.t(`publicQuote.details`)),ZC(2),jS(e.snapshot.lines),ZC(2),kS(e.snapshot.conditions?6:-1),ZC(),Fy(`preserveFragment`,!0),ZC(),nv(a.i18n.t(`publicQuoteWorkspace.documentNext`))}}function Le(t,n){if(t&1&&(Us(0,`a`,24),y_(1),fd()),t&2){let e=qS(2),a=qS();Fy(`href`,n,Qg)(`download`,e.snapshot.quoteReference+`.pdf`),ZC(),vd(` `,a.i18n.t(`publicQuote.download`),` `)}}function Ve(t,n){if(t&1&&Py(0,`iframe`,25),t&2){let e=qS(3);Fy(`src`,n,Xg)(`title`,e.i18n.t(`publicQuote.frameTitle`))}}function Be(t,n){if(t&1&&(Us(0,`a`,26),y_(1),fd()),t&2){let e=qS(3);Fy(`preserveFragment`,!0),ZC(),nv(e.i18n.t(`publicQuoteWorkspace.signatureNext`))}}function Ae(t,n){if(t&1&&(Us(0,`section`,21)(1,`div`,22)(2,`div`)(3,`p`,4),y_(4,`PDF`),fd(),Us(5,`h2`,23),y_(6),fd()(),OS(7,Le,2,3,`a`,24),fd(),OS(8,Ve,1,2,`iframe`,25),OS(9,Be,2,2,`a`,26),fd()),t&2){let e,a,d=qS(),s=qS();ZC(6),nv(s.i18n.t(`publicQuote.document`)),ZC(),kS((e=s.pdfUrl())?7:-1,e),ZC(),kS((a=s.pdfFrameUrl())?8:-1,a),ZC(),kS(d.canSign&&!s.acceptance()?9:-1)}}function je(t,n){if(t&1&&(Us(0,`div`,28)(1,`p`,4),y_(2),fd(),Us(3,`h2`,30),y_(4),fd(),Us(5,`p`),y_(6),fd()()),t&2){let e=qS(3);ZC(2),nv(e.i18n.t(`publicQuote.acceptedEyebrow`)),ZC(2),nv(e.i18n.t(`publicQuote.accepted`)),ZC(2),nv(e.i18n.t(`publicQuote.acceptedDetail`))}}function ze(t,n){if(t&1&&(Us(0,`span`,35),y_(1),fd()),t&2){let e=qS(4);ZC(),nv(e.i18n.t(`publicQuote.nameInvalid`))}}function He(t,n){if(t&1&&(Us(0,`span`,39),y_(1),fd()),t&2){let e=qS(4);ZC(),nv(e.i18n.t(`publicQuote.signatureInvalid`))}}function We(t,n){if(t&1&&(Us(0,`span`,42),y_(1),fd()),t&2){let e=qS(4);ZC(),nv(e.i18n.t(`publicQuote.consentInvalid`))}}function Ke(t,n){if(t&1&&y_(0),t&2)vd(` `,qS(4).i18n.t(`publicQuote.signing`),` `)}function Ge(t,n){if(t&1&&y_(0),t&2)vd(` `,qS(4).i18n.t(`publicQuote.sign`),` `)}function $e(t,n){if(t&1){let e=zS();Us(0,`div`,31)(1,`p`,4),y_(2),fd(),Us(3,`h2`,30),y_(4),fd(),Us(5,`p`),y_(6),fd()(),Us(7,`form`,32),Gy(`submit`,function(d){Ip(e);return wp(qS(3).sign(d))}),Us(8,`label`,33),y_(9),Py(10,`input`,34),qT(),OS(11,ze,2,1,`span`,35),fd(),Us(12,`label`,36),y_(13),Py(14,`input`,37),qT(),Us(15,`span`,38),y_(16),fd(),OS(17,He,2,1,`span`,39),fd(),Us(18,`label`,40),Py(19,`input`,41),qT(),Us(20,`span`),y_(21),fd()(),OS(22,We,2,1,`span`,42),Us(23,`button`,43),OS(24,Ke,1,1)(25,Ge,1,1),fd(),Us(26,`p`,44),y_(27),fd()()}if(t&2){let e=qS(3);ZC(2),nv(e.i18n.t(`publicQuote.signatureEyebrow`)),ZC(2),nv(e.i18n.t(`publicQuote.signatureTitle`)),ZC(2),nv(e.i18n.t(`publicQuote.signatureIntro`)),ZC(3),vd(` `,e.i18n.t(`publicQuote.signerName`),` `),ZC(),Fy(`formField`,e.signatureForm.signerName),ky(`aria-invalid`,e.invalid(`signerName`)),ZT(),ZC(),kS(e.invalid(`signerName`)?11:-1),ZC(2),vd(` `,e.i18n.t(`publicQuote.typedSignature`),` `),ZC(),Fy(`formField`,e.signatureForm.signature),ky(`aria-invalid`,e.invalid(`signature`)),ZT(),ZC(2),nv(e.i18n.t(`publicQuote.typedSignatureHint`)),ZC(),kS(e.invalid(`signature`)?17:-1),ZC(2),Fy(`formField`,e.signatureForm.consent),ky(`aria-invalid`,e.invalid(`consent`)),ZT(),ZC(2),nv(e.i18n.t(`publicQuote.consent`)),ZC(),kS(e.invalid(`consent`)?22:-1),ZC(),Fy(`disabled`,e.signDisabled()),ZC(),kS(e.signing()?24:25),ZC(3),nv(e.i18n.t(`publicQuote.legal`))}}function Je(t,n){if(t&1&&(Us(0,`div`,29)(1,`h2`,30),y_(2),fd()()),t&2){let e=qS(3);Fy(`variant`,e.unavailableSignatureVariant()),ZC(2),nv(e.i18n.t(e.unavailableSignatureLabel()))}}function Xe(t,n){if(t&1&&(Us(0,`section`,27),OS(1,je,7,3,`div`,28)(2,$e,28,19)(3,Je,3,2,`div`,29),fd()),t&2){let e=qS(),a=qS();ZC(),kS(a.acceptance()?1:e.canSign?2:3)}}function Ye(t,n){if(t&1&&(Us(0,`div`,49)(1,`h2`),y_(2),fd(),Us(3,`p`),y_(4),fd()(),Us(5,`dl`)(6,`div`)(7,`dt`),y_(8),fd(),Us(9,`dd`),y_(10),fd()(),Us(11,`div`)(12,`dt`),y_(13),fd(),Us(14,`dd`),y_(15),fd()(),Us(16,`div`)(17,`dt`),y_(18),fd(),Us(19,`dd`)(20,`time`,50),y_(21),fd()()()()),t&2){let e=n,a=qS(3);ZC(2),nv(a.i18n.t(`publicQuote.accepted`)),ZC(2),nv(a.i18n.t(`publicQuote.acceptedDetail`)),ZC(4),nv(a.i18n.t(`publicQuote.reference`)),ZC(2),nv(e.quoteReference),ZC(3),nv(a.i18n.t(`publicQuoteWorkspace.order`)),ZC(2),nv(e.orderReference),ZC(3),nv(a.i18n.t(`publicQuoteWorkspace.acceptedAt`)),ZC(2),Fy(`dateTime`,e.acceptedAt),ZC(),nv(a.date(e.acceptedAt))}}function Ze(t,n){if(t&1&&(Us(0,`p`,46),y_(1),fd()),t&2){let e=qS(3);ZC(),nv(e.i18n.t(`publicQuote.alreadyAccepted`))}}function et(t,n){if(t&1&&(Us(0,`p`,47),y_(1),fd()),t&2){let e=qS(3);ZC(),nv(e.i18n.t(`publicQuoteWorkspace.confirmationPending`))}}function tt(t,n){if(t&1&&(Us(0,`a`,48),y_(1),fd()),t&2){let e=qS(2),a=qS();Fy(`href`,n,Qg)(`download`,e.snapshot.quoteReference+`.pdf`),ZC(),nv(a.i18n.t(`publicQuote.download`))}}function nt(t,n){if(t&1&&(Us(0,`section`,45),OS(1,Ye,22,9)(2,Ze,2,1,`p`,46)(3,et,2,1,`p`,47),OS(4,tt,2,3,`a`,48),fd()),t&2){let e,a,d=qS(),s=qS();ZC(),kS((e=s.acceptance())?1:d.status===`accepted`?2:3,e),ZC(3),kS((a=s.pdfUrl())?4:-1,a)}}function it(t,n){if(t&1&&(Us(0,`article`,6)(1,`header`,7)(2,`div`)(3,`p`,4),y_(4),fd(),Us(5,`h1`,5),y_(6),fd(),Us(7,`p`,8),y_(8),fd()(),Us(9,`div`,9)(10,`span`),y_(11),fd(),Us(12,`strong`),y_(13),fd(),Us(14,`small`),y_(15),fd()()(),Us(16,`section`,10)(17,`div`)(18,`span`),y_(19),fd(),Us(20,`strong`),y_(21),fd()(),Us(22,`div`)(23,`span`),y_(24),fd(),Us(25,`strong`),y_(26),fd()(),Us(27,`div`)(28,`span`),y_(29),fd(),Us(30,`strong`),y_(31),fd()(),Us(32,`div`)(33,`span`),y_(34),fd(),Us(35,`strong`),y_(36),fd()()()(),Py(37,`app-tabs`,11)(38,`router-outlet`),Iy(39,Re,9,4,`ng-template`,12)(40,Ae,10,4,`ng-template`,13)(41,Xe,4,1,`ng-template`,14)(42,nt,5,2,`ng-template`,15)),t&2){let e=n,a=qS();ZC(4),nv(a.i18n.t(`publicQuote.eyebrow`)),ZC(2),nv(e.snapshot.title),ZC(2),rv(` `,e.snapshot.issuer.displayName,` → `,e.snapshot.client.displayName,` `),ZC(3),nv(a.i18n.t(`publicQuote.total`)),ZC(2),nv(a.formatMoney(e.snapshot.totalCents)),ZC(2),nv(a.i18n.tf(`publicQuote.version`,k_(19,Te,e.snapshot.version))),ZC(),ky(`aria-label`,a.i18n.t(`publicQuote.summary`)),ZC(3),nv(a.i18n.t(`publicQuote.reference`)),ZC(2),nv(e.snapshot.quoteReference),ZC(3),nv(a.i18n.t(`publicQuote.netTotal`)),ZC(2),nv(a.formatMoney(e.snapshot.netTotalCents)),ZC(3),nv(a.i18n.t(`publicQuote.vatTotal`)),ZC(2),nv(a.formatMoney(e.snapshot.vatTotalCents)),ZC(3),nv(a.i18n.t(`publicQuote.expires`)),ZC(2),nv(a.date(e.expiresAt)),ZC(),Fy(`label`,a.i18n.t(`publicQuote.tabs`))(`tabs`,a.quoteTabs())(`preserveFragment`,!0)}}function at(t,n){if(t&1&&(Us(0,`p`),y_(1),fd()),t&2){let e=qS(2);ZC(),nv(e.i18n.t(n))}}function ot(t,n){if(t&1&&(Us(0,`section`,2)(1,`p`,4),y_(2),fd(),Us(3,`h1`,5),y_(4),fd(),OS(5,at,2,1,`p`),fd()),t&2){let e,a=qS();ZC(2),nv(a.i18n.t(`publicQuote.eyebrow`)),ZC(2),nv(a.i18n.t(`publicQuote.unavailable`)),ZC(),kS((e=a.error())?5:-1,e)}}function rt(t,n){if(t&1&&(Us(0,`p`,3),y_(1),fd()),t&2){let e=qS();ZC(),nv(e.i18n.t(n))}}var qe=class t{i18n=g(Ie$1);api=g(Q);destroyRef=g(pe);sanitizer=g(xA);confirmation=g(P);router=g(ue);route=g(G);signatureModel=Ke$1({signerName:``,signature:``,consent:!1});token;pdfObjectUrl;loadGeneration=0;loading=Ke$1(!0);signing=Ke$1(!1);quote=Ke$1(void 0);acceptance=Ke$1(void 0);signatureForm=nr(this.signatureModel,n=>{an(n,()=>this.loading()||this.signing()||this.acceptance()!==void 0||this.quote()?.canSign!==!0),gn(n.signerName),mn(n.signerName,/\S/),cn(n.signerName,160),gn(n.signature),mn(n.signature,/\S/),cn(n.signature,160),P$1(n.consent,({value:e})=>e()?void 0:{kind:`required`,message:`explicit_consent_required`})});error=Ke$1(void 0);quoteTabs=Ft(()=>[{path:`summary`,id:`quote-summary-tab`,label:this.i18n.t(`publicQuote.tab.summary`)},{path:`document`,id:`quote-document-tab`,label:this.i18n.t(`publicQuote.tab.document`)},{path:`signature`,id:`quote-signature-tab`,label:this.i18n.t(`publicQuote.tab.signature`)},{path:`confirmation`,id:`quote-confirmation-tab`,label:this.i18n.t(`publicQuoteWorkspace.confirmation`)}]);pdfUrl=Ke$1(void 0);pdfFrameUrl=Ft(()=>{let n=this.pdfUrl();return n===void 0?void 0:this.sanitizer.bypassSecurityTrustResourceUrl(n)});signDisabled=Ft(()=>this.loading()||this.signing()||this.acceptance()!==void 0||this.quote()?.canSign!==!0);unavailableSignatureVariant=Ft(()=>this.quote()?.status===`accepted`?`success`:`danger`);unavailableSignatureLabel=Ft(()=>this.quote()?.status===`accepted`?`publicQuote.alreadyAccepted`:`publicQuoteWorkspace.notSignable`);invalid(n){return this.signatureForm[n]().touched()&&this.signatureForm[n]().invalid()}constructor(){this.destroyRef.onDestroy(()=>this.releasePdf()),Ol(()=>{this.route.fragment.pipe(uf(),U(this.destroyRef)).subscribe(n=>{this.load(n)})})}async canDeactivate(){return this.signing()?!1:this.acceptance()!==void 0||!this.signatureForm().dirty()?!0:await this.confirmation.request(this.i18n.t(`backOffice.clientDetail.unsavedChanges`))&&!this.signing()}preventUnsavedUnload(n){(this.signing()||!this.acceptance()&&this.signatureForm().dirty())&&n.preventDefault()}date(n){return u(n,this.i18n.language(),{dateStyle:`medium`,timeStyle:`short`})}sign(n){if(n.preventDefault(),!this.signDisabled()){if(this.signatureForm().markAsTouched(),this.signatureForm().invalid()){this.signatureForm().errorSummary()[0]?.fieldTree().focusBoundControl();return}or(this.signatureForm,async()=>{let e=this.token,a=this.loadGeneration;if(e===void 0||e!==this.route.snapshot.fragment)return;this.signing.set(!0),this.error.set(void 0);let d=this.signatureModel();try{let s=await this.api.sign({token:e,signerName:d.signerName,consent:!0,signature:{kind:`typed`,value:d.signature}});if(!this.isCurrent(a))return;if(!s.success){this.error.set(this.errorKey(s.code));return}this.acceptance.set(s.result),this.signatureForm().reset()}catch{this.isCurrent(a)&&this.error.set(`publicQuote.error`)}finally{this.isCurrent(a)&&this.signing.set(!1)}this.isCurrent(a)&&this.acceptance()&&await this.router.navigate([`confirmation`],{relativeTo:this.route,preserveFragment:!0})})}}formatMoney(n){return Ne$1(n,this.i18n.language(),this.quote()?.snapshot.currency??`EUR`)}formatQuantity(n){return new Intl.NumberFormat(this.i18n.language(),{maximumFractionDigits:3}).format(n/1e3)}async load(n){let e=++this.loadGeneration;this.token=void 0,this.loading.set(!0),this.signing.set(!1),this.quote.set(void 0),this.acceptance.set(void 0),this.error.set(void 0),this.signatureForm().reset({signerName:``,signature:``,consent:!1}),this.releasePdf(),this.pdfUrl.set(void 0);let a=Me.getOrUndefined(wu.decodeUnknownOption(au)(n));if(a===void 0){this.error.set(`quote_link.not_found`),this.loading.set(!1);return}this.token=a;let d=await this.api.get(a);if(this.isCurrent(e)){if(!d.success){this.error.set(this.errorKey(d.code)),this.loading.set(!1);return}this.quote.set(d.result);try{let s=await this.api.getPdf(a);if(!this.isCurrent(e))return;this.pdfObjectUrl=URL.createObjectURL(s),this.pdfUrl.set(this.pdfObjectUrl)}catch{this.isCurrent(e)&&this.error.set(`publicQuote.pdfError`)}finally{this.isCurrent(e)&&this.loading.set(!1)}}}isCurrent(n){return!this.destroyRef.destroyed&&n===this.loadGeneration}errorKey(n){return n===`quote_link.not_found`||n===`quote_link.not_signable`||n===`request.rate_limited`?n:`publicQuote.error`}releasePdf(){this.pdfObjectUrl!==void 0&&URL.revokeObjectURL(this.pdfObjectUrl),this.pdfObjectUrl=void 0}static ɵfac=function(e){return new(e||t)};static ɵcmp=Fb({type:t,selectors:[[`app-public-quote`]],hostAttrs:[1,`page-container`],hostBindings:function(e,a){e&1&&Gy(`beforeunload`,function(s){return a.preventUnsavedUnload(s)},Zw)},decls:5,vars:2,consts:[[`appTabLayout`,``,`aria-labelledby`,`public-quote-title`,1,`public-quote`,`notice-flow`],[`aria-live`,`polite`,1,`state-card`],[`role`,`alert`,1,`state-card`,`danger`],[`appNotice`,``,`variant`,`danger`,`role`,`alert`],[1,`eyebrow`],[`id`,`public-quote-title`],[1,`quote-overview`],[1,`quote-heading`],[1,`recipient`],[1,`total-card`],[1,`quote-facts`],[1,`quote-steps`,3,`label`,`tabs`,`preserveFragment`],[`appTabPanel`,`summary`],[`appTabPanel`,`document`],[`appTabPanel`,`signature`],[`appTabPanel`,`confirmation`],[`id`,`quote-summary-panel`,`role`,`region`,`aria-labelledby`,`quote-summary-tab`,`tabindex`,`0`,1,`line-summary`],[`id`,`line-summary-title`],[1,`conditions`],[`appLinkButton`,``,`variant`,`primary`,`routerLink`,`document`,3,`preserveFragment`],[3,`source`,`presentation`],[`id`,`quote-document-panel`,`role`,`region`,`aria-labelledby`,`quote-document-tab`,`tabindex`,`0`,1,`document-panel`],[1,`section-heading`],[`id`,`document-title`],[3,`href`,`download`],[3,`src`,`title`],[`appLinkButton`,``,`variant`,`primary`,`routerLink`,`signature`,3,`preserveFragment`],[`id`,`quote-signature-panel`,`role`,`region`,`aria-labelledby`,`quote-signature-tab`,`tabindex`,`0`,1,`signature-panel`],[`appStatusBlock`,``,`variant`,`success`,`role`,`status`,1,`accepted`],[`appStatusBlock`,``,`role`,`status`,3,`variant`],[`id`,`signature-title`],[1,`signature-copy`],[`novalidate`,``,3,`submit`],[`for`,`public-quote-signer-name`,1,`field`],[`id`,`public-quote-signer-name`,`type`,`text`,`autocomplete`,`name`,`aria-describedby`,`public-quote-signer-name-error`,1,`input`,3,`formField`],[`id`,`public-quote-signer-name-error`,1,`field-error`],[`for`,`public-quote-signature`,1,`field`],[`id`,`public-quote-signature`,`type`,`text`,`aria-describedby`,`public-quote-signature-hint public-quote-signature-error`,1,`input`,`signature-input`,3,`formField`],[`id`,`public-quote-signature-hint`,`appFieldHint`,``],[`id`,`public-quote-signature-error`,1,`field-error`],[1,`choice`,`consent`],[`type`,`checkbox`,`aria-describedby`,`public-quote-consent-error`,3,`formField`],[`id`,`public-quote-consent-error`,1,`field-error`],[`appButton`,``,`variant`,`primary`,`type`,`submit`,3,`disabled`],[1,`legal-note`],[`id`,`quote-confirmation-panel`,`role`,`region`,`aria-labelledby`,`quote-confirmation-tab`,`tabindex`,`0`,1,`confirmation-panel`],[`appNotice`,``,`variant`,`success`],[`appNotice`,``],[`appLinkButton`,``,3,`href`,`download`],[`appStatusBlock`,``,`variant`,`success`,`role`,`status`],[3,`dateTime`]],template:function(e,a){if(e&1&&(Us(0,`section`,0),OS(1,Fe,5,2,`section`,1)(2,it,43,21)(3,ot,6,3,`section`,2),OS(4,rt,2,1,`p`,3),fd()),e&2){let d,s;ZC(),kS(a.loading()?1:(d=a.quote())?2:3,d),ZC(3),kS((s=a.quote()&&a.error())?4:-1,s)}},dependencies:[N,g$1,yn,a,k,Dt,gr,M,O,r,D],styles:[`[_nghost-%COMP%]{display:block}.confirmation-panel[_ngcontent-%COMP%]{max-inline-size:52rem;padding-block:var(--%NS%space-5)}.confirmation-panel[_ngcontent-%COMP%] dl[_ngcontent-%COMP%]{display:grid;gap:var(--%NS%space-4);margin-block:var(--%NS%space-5)}.confirmation-panel[_ngcontent-%COMP%] dt[_ngcontent-%COMP%]{color:var(--%NS%color-muted)}.confirmation-panel[_ngcontent-%COMP%] dd[_ngcontent-%COMP%]{margin:var(--%NS%space-1) 0 0}.line-summary[_ngcontent-%COMP%] > a[_ngcontent-%COMP%], .document-panel[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]{margin-block-start:var(--%NS%space-5)}.public-quote[_ngcontent-%COMP%]{padding:var(--%NS%page-header-y) var(--%NS%page-x)}.quote-overview[_ngcontent-%COMP%], .line-summary[_ngcontent-%COMP%], .document-panel[_ngcontent-%COMP%], .signature-panel[_ngcontent-%COMP%], .state-card[_ngcontent-%COMP%]{border:1px solid var(--%NS%color-line);background:var(--%NS%color-surface-raised);box-shadow:var(--%NS%shadow-panel)}.quote-overview[_ngcontent-%COMP%]{overflow:hidden;border-radius:var(--%NS%radius-sm)}.quote-heading[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:var(--%NS%space-8);padding:var(--%NS%panel-padding)}.eyebrow[_ngcontent-%COMP%]{color:var(--%NS%color-muted);font-family:var(--%NS%font-mono);font-size:var(--%NS%text-xs);font-weight:700;letter-spacing:var(--%NS%tracking-label);text-transform:uppercase}.quote-heading[_ngcontent-%COMP%] h1[_ngcontent-%COMP%], .state-card[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{margin-top:var(--%NS%space-2);font-size:clamp(1.5rem,3vw,var(--%NS%text-3xl))}.recipient[_ngcontent-%COMP%]{margin-top:var(--%NS%space-4);color:var(--%NS%color-muted)}.total-card[_ngcontent-%COMP%]{display:grid;min-width:0;gap:var(--%NS%space-1);padding-left:var(--%NS%space-6);border-left:3px solid var(--%NS%color-button-primary-highlight)}.total-card[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .total-card[_ngcontent-%COMP%] small[_ngcontent-%COMP%], .quote-facts[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .line-summary[_ngcontent-%COMP%] li[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--%NS%color-muted)}.total-card[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-family:var(--%NS%font-display);font-size:clamp(1.5rem,3vw,var(--%NS%text-3xl));font-variant-numeric:tabular-nums;overflow-wrap:anywhere}.quote-facts[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1px;border-top:1px solid var(--%NS%color-line-strong);background:var(--%NS%color-line-strong)}.quote-facts[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{display:grid;gap:var(--%NS%space-1);min-width:0;padding:var(--%NS%space-4);background:var(--%NS%color-surface-sunken);overflow-wrap:anywhere;font-variant-numeric:tabular-nums}.line-summary[_ngcontent-%COMP%], .document-panel[_ngcontent-%COMP%], .signature-panel[_ngcontent-%COMP%]{padding:var(--%NS%panel-padding);border-top:0;border-radius:0 0 var(--%NS%radius-sm) var(--%NS%radius-sm)}.line-summary[_ngcontent-%COMP%] ol[_ngcontent-%COMP%]{display:grid;gap:0;margin:var(--%NS%space-5) 0 0;padding:0;list-style:none}.line-summary[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:var(--%NS%space-5);padding-block:var(--%NS%space-3);border-bottom:1px solid var(--%NS%color-line)}.line-summary[_ngcontent-%COMP%] li[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{display:grid;min-width:0;gap:var(--%NS%space-1)}.line-summary[_ngcontent-%COMP%] li[_ngcontent-%COMP%] strong[_ngcontent-%COMP%], .recipient[_ngcontent-%COMP%], .quote-heading[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{overflow-wrap:anywhere}.conditions[_ngcontent-%COMP%]{margin-top:var(--%NS%space-6);padding:var(--%NS%space-4);border-left:3px solid var(--%NS%color-line-strong);background:var(--%NS%color-surface-sunken)}.conditions[_ngcontent-%COMP%] app-document-text-view[_ngcontent-%COMP%]{margin-top:var(--%NS%space-2)}.section-heading[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:end;justify-content:space-between;gap:var(--%NS%space-4)}.section-heading[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin-top:var(--%NS%space-1)}.document-panel[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{width:100%;min-height:min(72rem,85dvh);margin-top:var(--%NS%space-5);border:1px solid var(--%NS%color-line-strong);background:#fff}.signature-panel[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(0,.8fr) minmax(18rem,1.2fr);gap:clamp(2rem,6vw,5rem);border-top:4px solid var(--%NS%color-button-primary-highlight)}.signature-copy[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], .accepted[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin-top:var(--%NS%space-2)}.signature-copy[_ngcontent-%COMP%] p[_ngcontent-%COMP%]:last-child, .accepted[_ngcontent-%COMP%] p[_ngcontent-%COMP%]:last-child{margin-top:var(--%NS%space-3)}form[_ngcontent-%COMP%]{display:grid;min-width:0;gap:var(--%NS%space-4)}.signature-input[_ngcontent-%COMP%]{font-family:var(--%NS%font-display);font-size:var(--%NS%text-lg)}.consent[_ngcontent-%COMP%]{padding:var(--%NS%space-3);border:1px solid var(--%NS%color-line);background:var(--%NS%color-surface-sunken)}.legal-note[_ngcontent-%COMP%]{color:var(--%NS%color-muted);font-size:var(--%NS%text-xs)}.accepted[_ngcontent-%COMP%]{grid-column:1/-1}[_nghost-%COMP%] [hidden][_ngcontent-%COMP%]{display:none}.state-card[_ngcontent-%COMP%]{max-width:68ch;margin:10dvh auto;padding:clamp(2rem,6vw,4rem)}.state-card[_ngcontent-%COMP%] p[_ngcontent-%COMP%]:last-child{margin-top:var(--%NS%space-4)}.notice[_ngcontent-%COMP%]{margin-top:var(--%NS%space-5)}@media(max-width:48rem){.quote-heading[_ngcontent-%COMP%], .signature-panel[_ngcontent-%COMP%]{grid-template-columns:minmax(0,1fr)}.line-summary[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{min-width:0;flex-wrap:wrap}.total-card[_ngcontent-%COMP%]{padding-top:var(--%NS%space-4);padding-left:0;border-top:3px solid var(--%NS%color-button-primary-highlight);border-left:0}.quote-facts[_ngcontent-%COMP%]{grid-template-columns:repeat(2,minmax(0,1fr))}.document-panel[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{min-height:34rem}}`]})};export{qe as PublicQuote};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as m,t as l}from"./chunk-BwCtja5l.js";import{Dn as g,K as Ke,c as AH,d as Ar,g as Cr,ln as ad,mt as PH}from"./chunk-BAHiFuUo.js";import{t as A$1}from"./chunk-BzUDWIzm.js";import{a as b,c as u,i as _,o as f,r as S,s as l$1,t as A$2}from"./chunk-CP-AnFGa.js";var a=class{inputs;constructor(e){this.inputs=e}open(e){return!this.isExpandable(e)||e.expanded()?!1:(this.inputs.multiExpandable()||this.closeAll(),e.expanded.set(!0),!0)}close(e){return this.isExpandable(e)?(e.expanded.set(!1),!0):!1}toggle(e){return e.expanded()?this.close(e):this.open(e)}openAll(){if(this.inputs.multiExpandable())for(let e of this.inputs.items())this.open(e)}closeAll(){for(let e of this.inputs.items())this.close(e)}isExpandable(e){return!this.inputs.disabled()&&!e.disabled()&&e.expandable()}};function R(i){return i.detail===0||!i.pointerType}function E(i){return!i.isTrusted}var d=class extends l$1{options={preventDefault:!1,stopPropagation:!1};on(...e){let{handler:t,modifiers:n}=this._normalizeInputs(...e);return this.configs.push(l({handler:t,matcher:l=>this._isMatch(l,n)},this.options)),this}_normalizeInputs(...e){return e.length===2?{modifiers:e[0],handler:e[1]}:{modifiers:u.None,handler:e[0]}}_isMatch(e,t){return(E(e)||!R(e))&&A$2(e,t)}};var A=()=>`roving`;var B=class{inputs;navigationBehavior;focusBehavior;expansionBehavior;constructor(e){this.inputs=e,this.focusBehavior=new _(m(l({},e),{focusMode:A})),this.navigationBehavior=new S(m(l({},e),{focusMode:A,focusManager:this.focusBehavior})),this.expansionBehavior=new a(l({},e))}prevKey=f(()=>this.inputs.orientation()===`vertical`?`ArrowUp`:this.inputs.textDirection()===`rtl`?`ArrowRight`:`ArrowLeft`);nextKey=f(()=>this.inputs.orientation()===`vertical`?`ArrowDown`:this.inputs.textDirection()===`rtl`?`ArrowLeft`:`ArrowRight`);keydown=f(()=>new b().on(this.prevKey,()=>this.navigationBehavior.prev(),{ignoreRepeat:!1}).on(this.nextKey,()=>this.navigationBehavior.next(),{ignoreRepeat:!1}).on(`Home`,()=>this.navigationBehavior.first()).on(`End`,()=>this.navigationBehavior.last()).on(` `,()=>this.toggle()).on(`Enter`,()=>this.toggle()));click=f(()=>new d().on(e=>{let t=this._findTriggerPattern(A$1(e));t&&(this.navigationBehavior.goto(t),this.expansionBehavior.toggle(t))}));onKeydown(e){this.keydown().handle(e)}onClick(e){this.click().handle(e)}onFocus(e){let t=this._findTriggerPattern(A$1(e));t&&this.focusBehavior.isFocusable(t)&&this.focusBehavior.focus(t)}toggle(){let e=this.inputs.activeItem();e!==void 0&&this.expansionBehavior.toggle(e)}expandAll(){this.expansionBehavior.openAll()}collapseAll(){this.expansionBehavior.closeAll()}validate(){let e=[];return this.inputs.multiExpandable()||this.inputs.items().filter(n=>n.expanded()).length>1&&e.push(`ngAccordionGroup has multiExpandable set to false, but multiple ngAccordionTrigger panels are initially expanded.`),e}_findTriggerPattern(e){let t=e;for(;t;){let n=this.inputs.items().find(l=>l.element()===t);if(n)return n;t=t.parentElement?.closest(`[ngAccordionTrigger]`)}}};var D=class{inputs;id;element=()=>this.inputs.element();expandable=()=>!0;expanded;active=f(()=>this.inputs.accordionGroup().inputs.activeItem()===this);controls;tabIndex=f(()=>this.inputs.accordionGroup().focusBehavior.isFocusable(this)?0:-1);disabled=f(()=>this.inputs.disabled()||this.inputs.accordionGroup().inputs.disabled());hardDisabled=f(()=>this.disabled()&&!this.inputs.accordionGroup().inputs.softDisabled());constructor(e){this.inputs=e,this.id=e.id,this.expanded=e.expanded,this.controls=e.accordionPanelId}open(){this.inputs.accordionGroup().expansionBehavior.open(this)}close(){this.inputs.accordionGroup().expansionBehavior.close(this)}toggle(){this.inputs.accordionGroup().expansionBehavior.toggle(this)}};var M=(()=>{class i{contentVisible=Ke(!1);preserveContent=AH(!1);static ɵfac=function(n){return new(n||i)};static ɵdir=ad({type:i,inputs:{preserveContent:[1,`preserveContent`]},outputs:{preserveContent:`preserveContentChange`}})}return i})();var U=(()=>{class i{_deferredContentAware=g(M,{optional:!0});_templateRef=g(Cr);_viewContainerRef=g(Ar);_currentViewRef=null;_isRendered=!1;deferredContentAware=Ke(this._deferredContentAware);constructor(){PH({write:()=>{this.deferredContentAware()?.contentVisible()?this._isRendered||(this._destroyContent(),this._currentViewRef=this._viewContainerRef.createEmbeddedView(this._templateRef),this._isRendered=!0):this.deferredContentAware()?.preserveContent()||(this._destroyContent(),this._isRendered=!1)}})}ngOnDestroy(){this._destroyContent()}_destroyContent(){let t=this._currentViewRef;t&&!t.destroyed&&(t.destroy(),this._currentViewRef=null)}static ɵfac=function(n){return new(n||i)};static ɵdir=ad({type:i})}return i})();export{d as a,U as i,D as n,M as r,B as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as m,t as l}from"./chunk-BwCtja5l.js";import{$t as ZC,A as Gy,D as Fy,Dn as g,E as Ft$1,Ir as wp,It as Us,Jr as zS,Jt as Xy,K as Ke,Nr as vd,Rn as jS,Tn as fd,Wn as kS,Wr as y_,X as LS,dr as pe,ft as Ol,lt as OS,mr as qT,pr as qS,qn as ky,rn as Zw,rr as nv,tn as ZT,vt as Py,w as Fb,z as Ip}from"./chunk-BAHiFuUo.js";import{T as ue,m as Ie,o as U,r as N,v as Dt,y as G}from"./main-LXYWXFW4.js";import{ct as Me,wi as wu}from"./chunk-BAe_07VM.js";import{Ia as a,nr as Ni}from"./chunk-D8Ui_APT.js";import{t as g$1}from"./chunk-B56nz2lI.js";import{t as k}from"./chunk-IrDYxRzS.js";import{t as d}from"./chunk-CfwFJLFh.js";import{_ as te}from"./chunk-BzUDWIzm.js";import{t as P}from"./chunk-CkRw7h0_.js";import{d as nr,f as or,h as yn,n as an,o as gn,r as cn,t as P$1,u as mn}from"./chunk-CSkyOfSg.js";import{a as u,i as m$1,r as g$2}from"./chunk-Dx1NwQCW.js";import{i as f,o as j,r as b,t as P$2}from"./chunk-C1BibNrz.js";var ft=(e,i)=>i.field;function vt(e,i){if(e&1&&(Us(0,`a`,2),y_(1),fd()),e&2){let t=qS();Fy(`routerLink`,t.backLink())(`queryParams`,t.backQuery()),ZC(),nv(t.i18n.t(`catalogWorkspace.back`))}}function yt(e,i){if(e&1&&(Us(0,`h2`,3),y_(1),fd()),e&2){let t=qS();ZC(),nv(t.i18n.t(`catalog.create`))}}function _t(e,i){if(e&1&&(Us(0,`h1`,3),y_(1),fd()),e&2){let t=qS();ZC(),nv(t.i18n.t(t.title()))}}function ht(e,i){e&1&&(Us(0,`p`),y_(1),fd()),e&2&&(ZC(),nv(i.description))}function Ct(e,i){if(e&1&&(Us(0,`span`,4),y_(1),fd()),e&2){let t=qS();ZC(),nv(t.i18n.t(t.availability()))}}function xt(e,i){if(e&1&&(Us(0,`p`,6),y_(1),fd()),e&2){let t=qS();ZC(),nv(t.i18n.t(`catalog.loading`))}}function bt(e,i){if(e&1&&(Us(0,`p`,7),y_(1),fd()),e&2){let t=qS();ZC(),nv(t.i18n.t(i))}}function kt(e,i){if(e&1){let t=zS();Us(0,`button`,9),Gy(`click`,function(){Ip(t);return wp(qS().load())}),y_(1),fd()}if(e&2){let t=qS();ZC(),nv(t.i18n.t(`catalogWorkspace.retry`))}}function Et(e,i){if(e&1&&(Us(0,`p`,10),y_(1),fd()),e&2){let t=qS(2);ZC(),nv(t.i18n.t(`catalog.saved`))}}function Pt(e,i){if(e&1&&y_(0),e&2)vd(` `,qS(3).i18n.t(`catalog.fieldInvalid`),` `)}function St(e,i){if(e&1&&y_(0),e&2){let t=qS().$implicit;vd(` `,qS(3).i18n.t(t.error),` `)}}function Mt(e,i){if(e&1&&(Us(0,`label`,18),y_(1),Py(2,`input`,24),qT(),Us(3,`span`,25),OS(4,St,1,1),fd()()),e&2){let t=i.$implicit,n=qS(3);Fy(`for`,t.id),ZC(),vd(``,n.i18n.t(t.label),` `),ZC(),Fy(`id`,t.id)(`formField`,n.itemForm[t.field]),ky(`aria-invalid`,n.invalid(t.field))(`aria-describedby`,t.id+`-error`),ZT(),ZC(),Fy(`id`,t.id+`-error`),ZC(),kS(n.invalid(t.field)?4:-1)}}function Nt(e,i){if(e&1&&(Us(0,`div`,13)(1,`fieldset`)(2,`legend`),y_(3),fd(),Us(4,`label`,26),Py(5,`input`,27),qT(),y_(6),fd(),Us(7,`p`,28),y_(8),fd()()()),e&2){let t=qS(3);ZC(3),nv(t.i18n.t(`catalogWorkspace.availability`)),ZC(2),Fy(`formField`,t.itemForm.archived),ZT(),ZC(),nv(t.i18n.t(`catalogWorkspace.archive`)),ZC(2),nv(t.i18n.t(`catalog.archiveHint`))}}function wt(e,i){if(e&1){let t=zS();Us(0,`button`,29),Gy(`click`,function(){Ip(t);return wp(qS(3).close())}),y_(1),fd()}if(e&2){let t=qS(3);Fy(`disabled`,t.saving()),ZC(),vd(` `,t.i18n.t(`catalogWorkspace.cancel`),` `)}}function It(e,i){if(e&1&&(Us(0,`a`,23),y_(1),fd()),e&2){let t=qS(3);Fy(`routerLink`,t.backLink())(`queryParams`,t.backQuery()),ZC(),nv(t.i18n.t(`catalogWorkspace.cancel`))}}function Ot(e,i){if(e&1){let t=zS();Us(0,`form`,12),Gy(`submit`,function(c){Ip(t);return wp(qS(2).save(c))}),Us(1,`div`,13)(2,`fieldset`)(3,`legend`),y_(4),fd(),Us(5,`label`,14),y_(6),Py(7,`input`,15),qT(),Us(8,`span`,16),OS(9,Pt,1,1),fd()()()(),Us(10,`div`,13)(11,`fieldset`)(12,`legend`),y_(13),fd(),Us(14,`div`,17),LS(15,Mt,5,8,`label`,18,ft),fd(),Us(17,`p`,19),y_(18),fd()()(),OS(19,Nt,9,4,`div`,13),Us(20,`div`,20)(21,`button`,21),y_(22),fd(),OS(23,wt,2,2,`button`,22)(24,It,2,3,`a`,23),fd()()}if(e&2){let t=qS(2);ZC(4),nv(t.i18n.t(`catalogWorkspace.service`)),ZC(2),vd(``,t.i18n.t(`catalog.description`),` `),ZC(),Fy(`formField`,t.itemForm.description),ky(`aria-invalid`,t.invalid(`description`)),ZT(),ZC(2),kS(t.invalid(`description`)?9:-1),ZC(4),nv(t.i18n.t(`catalogWorkspace.defaultValues`)),ZC(2),jS(t.amounts),ZC(3),nv(t.i18n.t(`catalogWorkspace.taxHint`)),ZC(),kS(t.editing()?19:-1),ZC(2),Fy(`disabled`,t.saving()||t.uncertain()),ZC(),vd(` `,t.i18n.t(t.saving()?`catalogWorkspace.saving`:t.dialog?`referenceEditor.saveCatalog`:`catalog.save`),` `),ZC(),kS(t.dialog?23:24)}}function Ft(e,i){if(e&1&&OS(0,Et,2,1,`p`,10)(1,Ot,25,11,`form`,11),e&2)kS(qS().completed()?0:1)}var gt=()=>({description:``,quantity:`1`,unitPrice:`0.00`,vatRate:`20.00`,archived:!1});var ut=class e{dialog=g(te,{optional:!0});i18n=g(Ie);api=g(f);route=g(G);router=g(ue);destroyRef=g(pe);confirmation=g(P);state=Ke(`loading`);item=Ke(void 0);editing=Ke(!1);title=Ft$1(()=>this.editing()?`catalogWorkspace.editTitle`:`catalog.create`);availability=Ft$1(()=>this.item()?.archived?`catalog.archived`:`catalogWorkspace.available`);intro=this.dialog?`referenceEditor.catalogIntro`:`catalogWorkspace.formIntro`;saving=Ke(!1);confirming=Ke(!1);completed=Ke(!1);uncertain=Ke(!1);error=Ke(void 0);model=Ke(gt());amounts=[{field:`quantity`,label:`catalog.quantity`,error:`catalogWorkspace.quantityInvalid`,id:`catalog-quantity`},{field:`unitPrice`,label:`catalog.price`,error:`catalogWorkspace.priceInvalid`,id:`catalog-price`},{field:`vatRate`,label:`catalog.tax`,error:`catalogWorkspace.taxInvalid`,id:`catalog-tax`}];itemForm=nr(this.model,i=>{an(i,()=>this.saving()||this.completed()||this.uncertain()||this.state()!==`ready`),gn(i.description),cn(i.description,160),mn(i.description,/\S/),P$1(i.quantity,({value:t})=>wu.is(Ni.fields.quantityMilli)(u(t(),3))?void 0:{kind:`quantity`}),P$1(i.unitPrice,({value:t})=>wu.is(Ni.fields.unitPriceCents)(u(t(),2))?void 0:{kind:`price`}),P$1(i.vatRate,({value:t})=>wu.is(Ni.fields.vatRateBasisPoints)(u(t(),2))?void 0:{kind:`tax`})});loadGeneration=0;constructor(){if(this.dialog){this.state.set(`ready`),this.dialog.backdropClick.pipe(U(this.destroyRef)).subscribe(()=>{this.close()}),this.dialog.keydownEvents.pipe(U(this.destroyRef)).subscribe(i=>{i.key===`Escape`&&(i.preventDefault(),this.close())});return}Ol(()=>this.route.paramMap.pipe(U(this.destroyRef)).subscribe(()=>{this.load()}))}backLink(){return[`/catalog`,j(this.route.snapshot.queryParamMap)]}backQuery(){return b(P$2(this.route.snapshot.queryParamMap))}async canDeactivate(){if(this.saving()||this.confirming())return!1;if(!this.uncertain()&&!this.itemForm().dirty())return!0;this.confirming.set(!0);try{return await this.confirmation.request(this.i18n.t(this.uncertain()?`referenceEditor.leaveUncertain`:`catalog.unsavedChanges`))}finally{this.confirming.set(!1)}}async close(){this.dialog&&await this.canDeactivate()&&!this.destroyRef.destroyed&&this.dialog.close()}preventUnsavedUnload(i){(this.saving()||this.confirming()||this.uncertain()||this.itemForm().dirty())&&i.preventDefault()}invalid(i){return this.itemForm[i]().invalid()&&this.itemForm[i]().touched()}async load(){if(this.saving()||this.confirming()||this.uncertain())return;let i=++this.loadGeneration,t=this.route.snapshot.paramMap.get(`itemId`);if(this.editing.set(t!==null),this.state.set(`loading`),this.error.set(void 0),this.item.set(void 0),this.completed.set(!1),this.model.set(gt()),this.itemForm().reset(),t===null){this.state.set(`ready`);return}let n=wu.decodeUnknownOption(a)(t);if(Me.isNone(n)){this.state.set(`error`),this.error.set(`catalog.not_found`);return}try{let c=await this.api.list();if(this.destroyRef.destroyed||i!==this.loadGeneration)return;let s=c.find(I=>I.id===n.value);if(s===void 0){this.state.set(`error`),this.error.set(`catalog.not_found`);return}this.item.set(s),this.model.set({description:s.description,quantity:g$2(s.quantityMilli,3),unitPrice:m$1(s.unitPriceCents,2),vatRate:m$1(s.vatRateBasisPoints,2),archived:s.archived}),this.itemForm().reset(),this.state.set(`ready`)}catch{if(this.destroyRef.destroyed||i!==this.loadGeneration)return;this.state.set(`error`),this.error.set(`catalogWorkspace.loadError`)}}save(i){if(i.preventDefault(),!(this.saving()||this.confirming()||this.completed()||this.uncertain()||this.state()!==`ready`)){if(this.itemForm().markAsTouched(),this.itemForm().invalid()){for(let t of[`description`,`quantity`,`unitPrice`,`vatRate`])if(this.itemForm[t]().invalid()){this.itemForm[t]().focusBoundControl();break}return}or(this.itemForm,async()=>{let t=this.model(),n=wu.decodeUnknownOption(Ni)({description:t.description.trim(),quantityMilli:u(t.quantity,3),unitPriceCents:u(t.unitPrice,2),vatRateBasisPoints:u(t.vatRate,2),currency:`EUR`});if(Me.isNone(n)){this.error.set(`catalog.invalid`);return}let c=this.item();this.error.set(void 0);try{if(c&&c.archived!==t.archived){this.confirming.set(!0);let I=await this.confirmation.request(this.i18n.t(t.archived?`catalogWorkspace.archiveConfirmation`:`catalogWorkspace.restoreConfirmation`));if(this.confirming.set(!1),!I||this.destroyRef.destroyed)return}this.saving.set(!0);let s=c?await this.api.update(c.id,m(l({},n.value),{expectedVersion:c.version,archived:t.archived})):await this.api.create(n.value);if(this.destroyRef.destroyed)return;if(!s.success){!c&&s.code===`catalog.error`?(this.uncertain.set(!0),this.error.set(`referenceEditor.catalogUncertain`)):this.error.set(s.code);return}this.item.set(s.result),this.itemForm().reset(),this.completed.set(!0)}catch{this.destroyRef.destroyed||(this.uncertain.set(!c),this.error.set(c?`catalog.error`:`referenceEditor.catalogUncertain`))}finally{this.confirming.set(!1),this.saving.set(!1)}this.completed()&&(this.dialog?this.dialog.close(this.item()):await this.router.navigate(this.backLink(),{queryParams:this.backQuery(),state:{catalogSaved:!0}}))})}}static ɵfac=function(t){return new(t||e)};static ɵcmp=Fb({type:e,selectors:[[`app-catalog-editor`]],hostVars:4,hostBindings:function(t,n){t&1&&Gy(`beforeunload`,function(s){return n.preventUnsavedUnload(s)},Zw),t&2&&Xy(`page-container`,!n.dialog)(`editor-dialog`,!!n.dialog)},decls:13,vars:12,consts:[[`aria-labelledby`,`catalog-editor-title`,1,`catalog-editor`],[`layout`,`stacked`],[`pageBack`,``,1,`back-link`,3,`routerLink`,`queryParams`],[`id`,`catalog-editor-title`],[`appBadge`,``,`pageBadges`,``],[1,`intro`],[`role`,`status`],[`appNotice`,``,`variant`,`danger`,`role`,`alert`],[`appButton`,``,`type`,`button`],[`appButton`,``,`type`,`button`,3,`click`],[`appNotice`,``,`variant`,`success`,`role`,`status`],[`novalidate`,``,1,`catalog-form`],[`novalidate`,``,1,`catalog-form`,3,`submit`],[1,`ds-panel`,`form-panel`],[`for`,`catalog-description`,1,`field`],[`id`,`catalog-description`,`autocomplete`,`off`,`aria-describedby`,`catalog-description-error`,1,`input`,3,`formField`],[`id`,`catalog-description-error`,1,`field-error`],[1,`amounts`],[1,`field`,3,`for`],[1,`hint`],[1,`actions`],[`appButton`,``,`variant`,`primary`,`type`,`submit`,3,`disabled`],[`appButton`,``,`type`,`button`,3,`disabled`],[`appLinkButton`,``,3,`routerLink`,`queryParams`],[`inputmode`,`decimal`,1,`input`,3,`id`,`formField`],[1,`field-error`,3,`id`],[1,`choice`],[`type`,`checkbox`,`aria-describedby`,`catalog-archive-hint`,3,`formField`],[`id`,`catalog-archive-hint`,1,`hint`],[`appButton`,``,`type`,`button`,3,`click`,`disabled`]],template:function(t,n){if(t&1&&(Us(0,`section`,0)(1,`app-page-header`,1),OS(2,vt,2,3,`a`,2),OS(3,yt,2,1,`h2`,3)(4,_t,2,1,`h1`,3),OS(5,ht,2,1,`p`),OS(6,Ct,2,1,`span`,4),Us(7,`p`,5),y_(8),fd()(),OS(9,xt,2,1,`p`,6),OS(10,bt,2,1,`p`,7),OS(11,kt,2,1,`button`,8)(12,Ft,2,1),fd()),t&2){let c,s;Xy(`detail-page`,!n.dialog)(`form-page`,!n.dialog),ZC(2),kS(n.dialog?-1:2),ZC(),kS(n.dialog?3:4),ZC(2),kS((c=n.item())?5:-1,c),ZC(),kS(n.item()?6:-1),ZC(2),nv(n.i18n.t(n.intro)),ZC(),kS(n.state()===`loading`?9:-1),ZC(),kS((s=n.error())?10:-1,s),ZC(),kS(n.state()===`error`?11:n.state()===`ready`?12:-1)}},dependencies:[d,N,yn,k,g$1,Dt],styles:[`[_nghost-%COMP%]{display:block}.detail-page[_ngcontent-%COMP%]{display:grid;gap:var(--%NS%space-4);min-inline-size:0;inline-size:100%;max-inline-size:var(--%NS%page-width-detail);margin-inline:auto;padding:var(--%NS%page-header-y) var(--%NS%page-x)}.detail-page.form-page[_ngcontent-%COMP%]{max-inline-size:var(--%NS%page-width-form)}.detail-page.wide-page[_ngcontent-%COMP%]{max-inline-size:var(--%NS%page-width-wide)}app-page-header[data-header-layout=stacked][_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{margin:0;font-size:var(--%NS%text-2xl);overflow-wrap:anywhere}app-page-header[data-header-layout=stacked][_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;font-size:var(--%NS%text-base);color:var(--%NS%color-muted);overflow-wrap:anywhere}.detail-page[_ngcontent-%COMP%] > button[_ngcontent-%COMP%]{justify-self:start}@media print{.detail-page[_ngcontent-%COMP%], .detail-page.form-page[_ngcontent-%COMP%], .detail-page.wide-page[_ngcontent-%COMP%]{max-inline-size:none}}.editor-dialog[_nghost-%COMP%]{max-block-size:calc(100dvh - 2rem);overflow:auto;overscroll-behavior:contain;border-radius:var(--%NS%radius-md);background:var(--%NS%color-surface);color:var(--%NS%color-ink);box-shadow:var(--%NS%shadow-page)}.editor-dialog[_nghost-%COMP%] .catalog-editor[_ngcontent-%COMP%]{display:grid;gap:var(--%NS%space-6);padding:var(--%NS%space-6)}.editor-dialog[_nghost-%COMP%] h2[_ngcontent-%COMP%]{margin:0;font-size:var(--%NS%text-xl)}.catalog-editor[_ngcontent-%COMP%]{justify-items:start}app-page-header[_ngcontent-%COMP%]{inline-size:100%}.catalog-form[_ngcontent-%COMP%]{display:grid;gap:var(--%NS%space-8);inline-size:100%}fieldset[_ngcontent-%COMP%]{border:0;padding:0;margin:0;min-inline-size:0}legend[_ngcontent-%COMP%]{margin-block-end:var(--%NS%space-4);padding:0;font-weight:700}.field[_ngcontent-%COMP%]{display:grid;align-content:start;gap:var(--%NS%space-2);min-inline-size:0}.amounts[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--%NS%space-4)}.intro[_ngcontent-%COMP%], .hint[_ngcontent-%COMP%]{color:var(--%NS%color-muted)}.hint[_ngcontent-%COMP%]{margin-block-start:var(--%NS%space-3)}.field-error[_ngcontent-%COMP%]{color:var(--%NS%color-danger);font-size:var(--%NS%text-sm)}.field-error[_ngcontent-%COMP%]:empty{display:none}.actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:var(--%NS%space-3);border-block-start:1px solid var(--%NS%color-line);padding-block-start:var(--%NS%space-5)}@media(max-width:40rem){.amounts[_ngcontent-%COMP%]{grid-template-columns:1fr}}`]})};export{ut as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$t as ZC,A as Gy,D as Fy,Dn as g,E as Ft,Ir as wp,It as Us,Jr as zS,K as Ke,Nr as vd,Tn as fd,V as Iy,Wn as kS,Wr as y_,l as A_,lt as OS,mr as qT,pr as qS,qn as ky,rn as Zw,rr as nv,tn as ZT,vt as Py,w as Fb,z as Ip}from"./chunk-BAHiFuUo.js";import{r as N}from"./main-LXYWXFW4.js";import"./chunk-BAe_07VM.js";import"./chunk-Dv9sNWWK.js";import"./chunk-D8Ui_APT.js";import"./chunk-BMiFx1ci.js";import"./chunk-B56nz2lI.js";import{t as k}from"./chunk-IrDYxRzS.js";import"./chunk-CfwFJLFh.js";import"./chunk-BzUDWIzm.js";import"./chunk-CkRw7h0_.js";import"./chunk-DhpMFMQw.js";import{t as l}from"./chunk-Cm2UNqwE.js";import"./chunk-CReShp-B.js";import{d as nr,f as or,h as yn,n as an,t as P}from"./chunk-CSkyOfSg.js";import"./chunk-BAYVC6mO2.js";import"./chunk-xIoy5TmG2.js";import"./chunk-DvAE1Kdh2.js";import"./chunk-BL3upDtA.js";import{t as w}from"./chunk-DbcNGxba.js";import{t as v}from"./chunk-CpB8RIpf.js";import{t as S}from"./chunk-CJE3VBx5.js";import{t as S$1}from"./chunk-BEYQDr-4.js";function A(t,n){if(t&1&&(Us(0,`p`,2),y_(1),fd()),t&2){let e=qS(2);ZC(),nv(e.i18n.t(`billingWorkspace.unavailable`))}}function U(t,n){if(t&1&&Py(0,`app-document-preview`,4),t&2){let e=qS(3);Fy(`url`,n)(`title`,e.i18n.t(`backOffice.invoice.preview.frameTitle`))(`loadingLabel`,e.i18n.t(`documentPreview.loading`))(`errorLabel`,e.i18n.t(`documentPreview.error`))}}function G(t,n){if(t&1&&(Us(0,`p`,8),y_(1),fd()),t&2){let e=qS(4);ZC(),vd(` `,e.i18n.t(`billingWorkspace.confirmDocument`),` `)}}function J(t,n){if(t&1){let e=zS();Us(0,`button`,12),Gy(`click`,function(){Ip(e);return wp(qS(4).retry())}),y_(1),fd()}if(t&2){let e=qS(4);Fy(`disabled`,e.task.busy()),ZC(),vd(` `,e.i18n.t(`billingWorkspace.retrySame`),` `)}}function K(t,n){if(t&1){let e=zS();Us(0,`form`,6),Gy(`submit`,function(m){Ip(e);return wp(qS(3).save(m))}),Us(1,`label`),Py(2,`input`,7),qT(),y_(3),fd(),OS(4,G,2,1,`p`,8),Us(5,`div`,9)(6,`button`,10),y_(7),fd(),OS(8,J,2,2,`button`,11),fd()()}if(t&2){let e=qS(3);ZC(2),Fy(`formField`,e.issueForm.confirmed),ky(`aria-invalid`,e.issueForm.confirmed().touched()&&e.issueForm.confirmed().invalid()),ZT(),ZC(),vd(` `,e.i18n.t(`billingWorkspace.confirmDocument`)),ZC(),kS(e.issueForm.confirmed().touched()&&e.issueForm.confirmed().invalid()?4:-1),ZC(2),Fy(`disabled`,e.task.locked()),ZC(),vd(` `,e.i18n.t(`backOffice.invoice.issue`),` `),ZC(),kS(e.task.uncertain()?8:-1)}}function Q(t,n){if(t&1&&(OS(0,U,1,4,`app-document-preview`,4),Iy(1,K,9,7,`form`,5)),t&2){let e;kS((e=qS(2).preview())?0:-1,e),ZC(),Fy(`appCan`,`invoice.issue`)}}function R(t,n){if(t&1&&OS(0,A,2,1,`p`,2)(1,Q,2,2),t&2){let e=qS();kS(!e.eligible()&&!e.task.completed()?0:e.task.completed()?-1:1)}}function X(t,n){if(t&1){let e=zS();Us(0,`button`,13),Gy(`click`,function(){Ip(e);return wp(qS().reload())}),y_(1),fd()}if(t&2){let e=qS();Fy(`disabled`,e.task.busy()||e.task.loading()),ZC(),vd(` `,e.i18n.t(`listControls.reload`),` `)}}var $=class t{task=g(w);i18n=this.task.i18n;eligible=Ft(()=>this.task.invoice()?.status===`draft`);issueForm=nr(Ke({confirmed:!1}),n=>{an(n,()=>this.task.locked()||!this.eligible()),P(n.confirmed,({value:e})=>e()?void 0:{kind:`required`})});preview=Ft(()=>{let n=this.task.invoice();return n===void 0?void 0:`/api/invoices/${n.id}/revisions/${n.version}/preview`});attempt;save(n){n.preventDefault(),!this.task.locked()&&or(this.issueForm,{action:async()=>{let e=this.task.invoice();e?.status===`draft`&&(this.attempt={id:e.id,version:e.version},await this.retry())},onInvalid:()=>this.task.focusInvalid()})}async retry(){let n=this.attempt;n!==void 0&&await this.task.run(()=>this.task.api.issue(n.id,n.version),`backOffice.invoice.issueConfirm`,`issue`)}async reload(){this.task.uncertain()||this.task.busy()||await this.task.confirmation.request(this.i18n.t(`billingWorkspace.reloadConfirm`))&&(this.attempt=void 0,this.issueForm().reset({confirmed:!1}),await this.task.load())}canDeactivate(){return this.task.canDeactivate(this.issueForm().dirty())}static ɵfac=function(e){return new(e||t)};static ɵcmp=Fb({type:t,selectors:[[`app-invoice-issue`]],hostAttrs:[1,`page-container`],hostBindings:function(e,a){e&1&&Gy(`beforeunload`,function(y){return a.task.beforeUnload(y,a.issueForm().dirty())},Zw)},features:[A_([w])],decls:7,vars:4,consts:[[`aria-labelledby`,`issue-title`,1,`detail-page`,`form-page`],[`headingId`,`issue-title`,3,`heading`],[`appNotice`,``],[`appButton`,``,3,`disabled`],[3,`url`,`title`,`loadingLabel`,`errorLabel`],[`class`,`task-form ds-panel form-panel`,3,`submit`,4,`appCan`],[1,`task-form`,`ds-panel`,`form-panel`,3,`submit`],[`type`,`checkbox`,`aria-describedby`,`issue-confirm-error`,3,`formField`],[`id`,`issue-confirm-error`,1,`field-error`],[1,`actions`],[`appButton`,``,`variant`,`primary`,`type`,`submit`,3,`disabled`],[`appButton`,``,`type`,`button`,3,`disabled`],[`appButton`,``,`type`,`button`,3,`click`,`disabled`],[`appButton`,``,3,`click`,`disabled`]],template:function(e,a){e&1&&(Us(0,`section`,0),Py(1,`app-invoice-task-header`,1),Us(2,`p`,2),y_(3),fd(),Py(4,`app-invoice-task-feedback`),OS(5,R,2,1),OS(6,X,2,2,`button`,3),fd()),e&2&&(ZC(),Fy(`heading`,a.i18n.t(`billingWorkspace.issueTitle`)),ZC(2),nv(a.i18n.t(`billingWorkspace.issueHint`)),ZC(2),kS(a.task.invoice()?5:-1),ZC(),kS(a.task.error()&&!a.task.completed()&&!a.task.uncertain()?6:-1))},dependencies:[l,N,k,S$1,yn,v,S],styles:[`[appListWorkspace][_ngcontent-%COMP%] > p[_ngcontent-%COMP%]{margin-block:0}header[_ngcontent-%COMP%], .actions[_ngcontent-%COMP%], .filters[_ngcontent-%COMP%], .chips[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:var(--%NS%space-3)}header[_ngcontent-%COMP%]{justify-content:space-between;align-items:start}.billing-page[_ngcontent-%COMP%] > h1[_ngcontent-%COMP%]{font-size:var(--%NS%text-2xl);margin-block:var(--%NS%space-2)}h2[_ngcontent-%COMP%]{font-size:var(--%NS%text-xl)}.field[_ngcontent-%COMP%]{display:grid;gap:var(--%NS%space-2);min-inline-size:0}.filters[_ngcontent-%COMP%]{align-items:end}.filters[_ngcontent-%COMP%] .search[_ngcontent-%COMP%]{flex:1 1 22rem}.filters[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]:not(.search){flex:1 1 10rem}.amount[_ngcontent-%COMP%]{text-align:end;font-variant-numeric:tabular-nums;white-space:nowrap}td[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{display:block;color:var(--%NS%color-muted)}.muted[_ngcontent-%COMP%]{color:var(--%NS%color-muted)}.empty[_ngcontent-%COMP%], .bulk-actions[_ngcontent-%COMP%], .summary[_ngcontent-%COMP%]{padding:var(--%NS%space-4)}.task-form[_ngcontent-%COMP%]{display:grid;gap:var(--%NS%space-5);inline-size:100%}.fields[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--%NS%space-4)}.field-error[_ngcontent-%COMP%]{color:var(--%NS%color-danger);font-size:var(--%NS%text-sm)}.field-error[_ngcontent-%COMP%]:empty{display:none}dl[_ngcontent-%COMP%]{display:grid;gap:var(--%NS%space-3)}dl[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;justify-content:space-between;gap:var(--%NS%space-2) var(--%NS%space-4)}dt[_ngcontent-%COMP%]{color:var(--%NS%color-muted)}dd[_ngcontent-%COMP%]{margin:0;overflow-wrap:anywhere}ol[_ngcontent-%COMP%]{display:grid;gap:var(--%NS%space-4)}.history-entry[_ngcontent-%COMP%]{padding:var(--%NS%space-4);overflow-wrap:anywhere}@media(max-width:40rem){.fields[_ngcontent-%COMP%]{grid-template-columns:1fr}}[_nghost-%COMP%]{display:block}.detail-page[_ngcontent-%COMP%]{display:grid;gap:var(--%NS%space-4);min-inline-size:0;inline-size:100%;max-inline-size:var(--%NS%page-width-detail);margin-inline:auto;padding:var(--%NS%page-header-y) var(--%NS%page-x)}.detail-page.form-page[_ngcontent-%COMP%]{max-inline-size:var(--%NS%page-width-form)}.detail-page.wide-page[_ngcontent-%COMP%]{max-inline-size:var(--%NS%page-width-wide)}app-page-header[data-header-layout=stacked][_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{margin:0;font-size:var(--%NS%text-2xl);overflow-wrap:anywhere}app-page-header[data-header-layout=stacked][_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;font-size:var(--%NS%text-base);color:var(--%NS%color-muted);overflow-wrap:anywhere}.detail-page[_ngcontent-%COMP%] > button[_ngcontent-%COMP%]{justify-self:start}@media print{.detail-page[_ngcontent-%COMP%], .detail-page.form-page[_ngcontent-%COMP%], .detail-page.wide-page[_ngcontent-%COMP%]{max-inline-size:none}}`]})};export{$ as InvoiceIssue};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$t as ZC,A as Gy,C as F_,D as Fy,Dn as g,E as Ft,Gn as k_,Gr as yd,Ir as wp,It as Us,Jr as zS,K as Ke,Nr as vd,Rn as jS,Tn as fd,V as Iy,Vn as jt,Wn as kS,Wr as y_,X as LS,Zn as md,ft as Ol,lt as OS,pr as qS,qn as ky,rr as nv,vt as Py,w as Fb,z as Ip}from"./chunk-BAHiFuUo.js";import{E as x,S as gr,T as ue$1,a as T,c as O,h as Ne$1,i as r,l as r$1,m as Ie$1,r as N,v as Dt,y as G}from"./main-LXYWXFW4.js";import{ct as Me$1,wi as wu}from"./chunk-BAe_07VM.js";import"./chunk-Dv9sNWWK.js";import{Ia as a,Ji as Xh}from"./chunk-D8Ui_APT.js";import{t as g$1}from"./chunk-B56nz2lI.js";import{t as k}from"./chunk-IrDYxRzS.js";import{t as d}from"./chunk-CfwFJLFh.js";import{n as u}from"./chunk-BHEFFEGN.js";import"./chunk-BzUDWIzm.js";import{t as P}from"./chunk-CkRw7h0_.js";import{t as E}from"./chunk-DhpMFMQw.js";import"./chunk-CReShp-B.js";import"./chunk-CczD0yXn2.js";import"./chunk-CXHCUTDs2.js";import{t as D}from"./chunk-BwFjLr9D2.js";import"./chunk-BAYVC6mO2.js";import{t as R}from"./chunk-DvAE1Kdh2.js";import"./chunk-C_4qOSvi2.js";import{t as R$1}from"./chunk-CM29tQ7z.js";import{t as y}from"./chunk-B4Vcwa9l.js";import{t as d$1}from"./chunk-BO6tYuf8.js";import{t as m}from"./chunk-mCmB-2Tr.js";import{a as y$1,t as b}from"./chunk-CwkgffnU.js";import{t as l}from"./chunk-BVyLOSeH.js";var _e=(n,t)=>({affairId:n,clientId:t});var ge=n=>[`/clients`,n];var me=(n,t)=>t.id;function ye(n,t){if(n&1&&(Us(0,`a`,7),y_(1),fd()),n&2){let e=qS(),i=qS();Fy(`queryParams`,F_(2,_e,e.id,e.clientId)),ZC(),vd(` `,i.i18n.t(`affair.createQuote`),` `)}}function ve(n,t){if(n&1){let e=zS();Us(0,`button`,10),Gy(`click`,function(){Ip(e);return wp(qS(3).archive())}),y_(1),fd()}if(n&2){let e=qS(3);Fy(`disabled`,e.saving()),ZC(),vd(` `,e.i18n.t(`affair.archive`),` `)}}function Ce(n,t){if(n&1){let e=zS();Us(0,`button`,11),Gy(`click`,function(){Ip(e);return wp(qS(3).reopen())}),y_(1),fd()}if(n&2){let e=qS(3);Fy(`disabled`,e.saving()),ZC(),vd(` `,e.i18n.t(`affair.reopen`),` `)}}function xe(n,t){if(n&1&&OS(0,ve,2,2,`button`,8)(1,Ce,2,2,`button`,9),n&2)kS(qS().status===`open`?0:1)}function he(n,t){if(n&1&&(md(0,4),OS(1,ye,2,5,`a`,7),OS(2,xe,2,1),yd()),n&2){let e=qS();ZC(),kS(t.status===`open`&&e.canCreateQuote()?1:-1),ZC(),kS(e.canEdit()?2:-1)}}function be(n,t){if(n&1){let e=zS();Us(0,`dl`,5)(1,`div`,12)(2,`dt`,13),y_(3),fd(),Us(4,`dd`)(5,`a`,14),y_(6),fd()()(),Us(7,`div`,15),Gy(`editRequested`,function(){Ip(e);return wp(qS().editing.set(`title`))})(`cancelRequested`,function(){Ip(e);return wp(qS().editing.set(void 0))})(`saveRequested`,function(d){Ip(e);return wp(qS().save(`title`,d))}),fd(),Us(8,`div`,16),Gy(`editRequested`,function(){Ip(e);return wp(qS().editing.set(`status`))})(`cancelRequested`,function(){Ip(e);return wp(qS().editing.set(void 0))})(`saveRequested`,function(d){Ip(e);return wp(qS().save(`status`,d))}),fd()()}if(n&2){let e=t,i=qS();ZC(3),nv(i.i18n.t(`backOffice.affairs.client`)),ZC(2),Fy(`routerLink`,k_(19,ge,e.clientId)),ZC(),nv(e.clientDisplayName),ZC(),Fy(`label`,i.i18n.t(`backOffice.invoice.title`))(`value`,e.title)(`emptyValue`,i.i18n.t(`clientsWorkspace.notProvided`))(`editable`,i.canEdit())(`editing`,i.editing()===`title`)(`saving`,i.saving())(`required`,!0)(`maximumLength`,160),ZC(),Fy(`label`,i.i18n.t(`billingWorkspace.financialStatus`))(`value`,e.status)(`displayValue`,i.statusLabel())(`emptyValue`,i.i18n.t(`clientsWorkspace.notProvided`))(`editable`,i.canEdit())(`options`,i.statusOptions())(`editing`,i.editing()===`status`)(`saving`,i.saving())}}function Se(n,t){if(n&1&&(Us(0,`p`,6),y_(1),fd()),n&2){let e=qS();ZC(),nv(e.i18n.t(`backOffice.affair.loading`))}}function Me(n,t){if(n&1){let e=zS();Us(0,`p`,17),y_(1),fd(),Us(2,`button`,18),Gy(`click`,function(){Ip(e);return wp(qS().load())}),y_(3),fd()}if(n&2){let e=qS();ZC(),nv(e.i18n.t(`affair.error`)),ZC(2),nv(e.i18n.t(`listControls.reload`))}}function Oe(n,t){if(n&1&&(Us(0,`p`,24),y_(1),fd()),n&2){let e=qS(5);ZC(),nv(e.i18n.t(`affair.noDocuments`))}}function Pe(n,t){if(n&1&&(Us(0,`li`,26)(1,`div`,27),Py(2,`app-icon`,28),Us(3,`div`)(4,`p`,24),y_(5),fd(),Us(6,`h3`)(7,`a`,14),y_(8),fd()(),Us(9,`p`),y_(10),fd()()(),Us(11,`span`,29),y_(12),fd(),Us(13,`dl`,30)(14,`div`)(15,`dt`),y_(16),fd(),Us(17,`dd`,31),y_(18),fd()(),Us(19,`div`)(20,`dt`),y_(21),fd(),Us(22,`dd`)(23,`time`),y_(24),fd()()()()()),n&2){let e=t.$implicit,i=qS(6);ZC(2),Fy(`name`,e.icon),ZC(3),nv(i.i18n.t(e.kind)),ZC(2),Fy(`routerLink`,e.link),ZC(),nv(e.reference),ZC(2),nv(e.title),ZC(),Fy(`variant`,e.variant),ZC(),nv(i.i18n.t(e.status)),ZC(4),nv(i.i18n.t(`backOffice.clientDetail.total`)),ZC(2),nv(i.money(e.totalCents,e.currency)),ZC(3),nv(i.i18n.t(`clientTables.updatedAt`)),ZC(2),ky(`datetime`,e.updatedAt),ZC(),nv(i.date(e.updatedAt))}}function ke(n,t){if(n&1&&(Us(0,`ul`,25),LS(1,Pe,25,12,`li`,26,me),fd()),n&2){let e=qS(5);ZC(),jS(e.linkedDocuments())}}function Ae(n,t){if(n&1&&(Us(0,`section`,21)(1,`h2`,23),y_(2),fd(),OS(3,Oe,2,1,`p`,24)(4,ke,3,0,`ul`,25),fd()),n&2){let e=qS(4);ZC(2),nv(e.i18n.t(`affair.documents`)),ZC(),kS(e.linkedDocuments().length===0?3:4)}}function De(n,t){if(n&1&&(Us(0,`p`,6),y_(1),fd()),n&2){let e=qS(5);ZC(),nv(e.i18n.t(`backOffice.affair.loading`))}}function Ne(n,t){if(n&1){let e=zS();Us(0,`p`,17),y_(1),fd(),Us(2,`button`,18),Gy(`click`,function(){Ip(e);return wp(qS(5).history.reload())}),y_(3),fd()}if(n&2){let e=qS(5);ZC(),nv(e.i18n.t(`affair.error`)),ZC(2),vd(` `,e.i18n.t(`listControls.reload`),` `)}}function we(n,t){if(n&1&&(Us(0,`p`),y_(1),fd()),n&2){let e=qS(5);ZC(),nv(e.i18n.t(`affair.noHistory`))}}function Ie(n,t){if(n&1&&(Us(0,`li`)(1,`time`),y_(2),fd(),y_(3),fd()),n&2){let e=t.$implicit;ZC(),ky(`datetime`,e.occurredAt),ZC(),nv(e.occurredAt),ZC(),vd(` · `,e.action,` `)}}function Ee(n,t){if(n&1&&(Us(0,`ol`,33),LS(1,Ie,4,3,`li`,null,me),fd()),n&2){let e=qS(5);ZC(),jS(e.events())}}function Te(n,t){if(n&1&&(Us(0,`section`,22)(1,`h2`,32),y_(2),fd(),OS(3,De,2,1,`p`,6)(4,Ne,4,2)(5,we,2,1,`p`)(6,Ee,3,0,`ol`,33),fd()),n&2){let e=qS(4);ZC(2),nv(e.i18n.t(`billingWorkspace.history`)),ZC(),kS(e.history.isLoading()?3:e.historyFailed()?4:e.events().length===0?5:6)}}function Ve(n,t){if(n&1&&OS(0,Ae,5,2,`section`,21)(1,Te,7,2,`section`,22),n&2){let e,i=t.tab;kS((e=i)===`overview`?0:e===`history`?1:-1)}}function qe(n,t){if(n&1&&(Py(0,`app-tabs`,19)(1,`router-outlet`),Iy(2,Ve,2,1,`ng-template`,20)),n&2)Fy(`tabs`,qS(2).tabs())(`label`,t.reference)}function Re(n,t){if(n&1&&OS(0,qe,3,2),n&2){let e;kS((e=qS().affair())?0:-1,e)}}var ue=class n{i18n=g(Ie$1);authentication=g(E);confirmation=g(P);api=g(m);quotesApi=g(y);ordersApi=g(d$1);invoicesApi=g(R);route=g(G);router=g(ue$1);navigation=T(this.router.events.pipe(jt(t=>t instanceof x)),{initialValue:void 0});tab=Ft(()=>(this.navigation(),this.route.firstChild?.snapshot.data.tab===`history`?`history`:`overview`));state=Ke(`loading`);affair=Ke(void 0);quotes=Ke([]);orders=Ke([]);invoices=Ke([]);history=l({active:()=>this.tab()===`history`,params:()=>this.affair()?.id,loader:t=>this.api.events(t)});events=Ft(()=>{let t=this.history.hasValue()?this.history.value():void 0;return t?.success?t.result.toSorted((e,i)=>e.occurredAt.localeCompare(i.occurredAt)):[]});historyFailed=Ft(()=>{let t=this.history.hasValue()?this.history.value():void 0;return this.history.error()!==void 0||t!==void 0&&!t.success});editing=Ke(void 0);saving=Ke(!1);canEdit=Ft(()=>this.authentication.can(`affair.update`));canCreateQuote=Ft(()=>this.authentication.can(`quote.create`)&&this.authentication.can(`client.read`)&&this.authentication.can(`catalog.read`)&&this.authentication.can(`condition.read`)&&this.authentication.can(`issuer.read`));statusOptions=Ft(()=>[{value:`open`,label:this.i18n.t(`affair.open`)},{value:`closed`,label:this.i18n.t(`affair.closed`)}]);statusLabel=Ft(()=>{let t=this.affair()?.status;return t===void 0?``:this.i18n.t(`affair.${t}`)});linkedQuotes=Ft(()=>{let t=new Set(this.affair()?.quoteIds??[]);return this.quotes().filter(e=>t.has(e.id))});linkedOrders=Ft(()=>{let t=new Set(this.affair()?.orderIds??[]);return this.orders().filter(e=>t.has(e.id))});linkedInvoices=Ft(()=>{let t=new Set(this.affair()?.invoiceIds??[]);return this.invoices().filter(e=>t.has(e.id))});linkedDocuments=Ft(()=>[...this.linkedQuotes().map(t=>{let e=y$1(t.status);return{id:t.id,kind:`backOffice.affair.quote`,icon:`folder`,reference:t.reference,title:t.title,status:e.label,variant:e.variant,totalCents:t.totalCents,currency:t.currency,updatedAt:t.updatedAt,link:[`/quotes`,t.id]}}),...this.linkedOrders().map(t=>({id:t.id,kind:`backOffice.affair.order`,icon:`check`,reference:t.reference,title:t.title,status:`backOffice.affair.confirmed`,variant:`success`,totalCents:t.totalCents,currency:t.currency,updatedAt:t.createdAt,link:[`/orders`,t.id]})),...this.linkedInvoices().map(t=>{let e=b(t.status);return{id:t.id,kind:`backOffice.affair.invoice`,icon:`invoice`,reference:t.invoiceNumber??this.i18n.t(`commercialHeader.draftInvoice`),title:t.title,status:e.label,variant:e.variant,totalCents:t.totalCents,currency:t.currency,updatedAt:t.updatedAt,link:[`/invoices`,t.id]}})]);tabs=Ft(()=>[{path:`overview`,id:`affair-overview-tab`,label:this.i18n.t(`commercial.summary`)},{path:`history`,id:`affair-history-tab`,label:this.i18n.t(`billingWorkspace.history`)}]);constructor(){Ol(()=>{this.load()})}async load(){let t=wu.decodeUnknownOption(a)(this.route.snapshot.paramMap.get(`affairId`));if(Me$1.isNone(t)){this.state.set(`error`);return}this.state.set(`loading`);try{let[e,i,d,p]=await Promise.all([this.api.get(t.value),this.quotesApi.list(),this.ordersApi.list(),this.invoicesApi.list()]);if(!e.success){this.state.set(`error`);return}this.affair.set(e.result),this.quotes.set(i),this.orders.set(d),this.invoices.set(p),this.state.set(`ready`)}catch{this.state.set(`error`)}}async save(t,e){let i=this.affair();if(!i||this.saving()||t===`title`&&e===``)return;let d=i.status;if(t===`status`){if(e!==`open`&&e!==`closed`)return;d=e}this.saving.set(!0);try{let p=await this.api.update(i.id,Xh.make({expectedVersion:i.version,title:t===`title`?e:i.title,status:d}));p.success?(this.affair.set(p.result),this.history.invalidate(),this.editing.set(void 0)):this.state.set(`error`)}finally{this.saving.set(!1)}}async archive(){this.affair()?.status!==`open`||!this.canEdit()||!await this.confirmation.request(this.i18n.t(`affair.archiveConfirm`))||await this.save(`status`,`closed`)}async reopen(){this.affair()?.status!==`closed`||!this.canEdit()||await this.save(`status`,`open`)}money(t,e){return Ne$1(t,this.i18n.language(),e)}date(t){return u(t,this.i18n.language(),{dateStyle:`medium`})}static ɵfac=function(e){return new(e||n)};static ɵcmp=Fb({type:n,selectors:[[`app-affair-detail`]],hostAttrs:[1,`page-container`],decls:11,vars:5,consts:[[`appTabLayout`,``,`aria-labelledby`,`affair-title`,1,`detail-page`,`wide-page`],[`layout`,`stacked`],[`pageBack`,``,`routerLink`,`/affairs`],[`id`,`affair-title`],[`pageActions`,``],[1,`affair-summary`],[`role`,`status`],[`appLinkButton`,``,`icon`,`file-plus`,`variant`,`primary`,`routerLink`,`/quotes/new`,3,`queryParams`],[`appButton`,``,`icon`,`folder`,`type`,`button`,`variant`,`danger`,3,`disabled`],[`appButton`,``,`icon`,`redo`,`type`,`button`,3,`disabled`],[`appButton`,``,`icon`,`folder`,`type`,`button`,`variant`,`danger`,3,`click`,`disabled`],[`appButton`,``,`icon`,`redo`,`type`,`button`,3,`click`,`disabled`],[1,`affair-summary-client`],[1,`visually-hidden`],[3,`routerLink`],[`appInlineEdit`,``,1,`inline-edit-compact`,3,`editRequested`,`cancelRequested`,`saveRequested`,`label`,`value`,`emptyValue`,`editable`,`editing`,`saving`,`required`,`maximumLength`],[`appInlineEdit`,``,1,`inline-edit-compact`,3,`editRequested`,`cancelRequested`,`saveRequested`,`label`,`value`,`displayValue`,`emptyValue`,`editable`,`options`,`editing`,`saving`],[`appNotice`,``,`variant`,`danger`,`role`,`alert`],[`appButton`,``,`type`,`button`,3,`click`],[3,`tabs`,`label`],[`appTabPanel`,`affair-detail`],[`aria-labelledby`,`affair-documents-title`,1,`related-documents`],[`aria-labelledby`,`affair-history-title`],[`id`,`affair-documents-title`],[1,`hint`],[1,`document-list`],[1,`ds-panel`,`document-card`],[1,`document-identity`],[3,`name`],[`appBadge`,``,3,`variant`],[1,`document-facts`],[1,`amount`],[`id`,`affair-history-title`],[1,`timeline`]],template:function(e,i){if(e&1&&(Us(0,`section`,0)(1,`app-page-header`,1)(2,`a`,2),y_(3),fd(),Us(4,`h1`,3),y_(5),fd(),OS(6,he,3,2,`ng-container`,4),OS(7,be,9,21,`dl`,5),fd(),OS(8,Se,2,1,`p`,6)(9,Me,4,2)(10,Re,1,1),fd()),e&2){let d,p,S;ZC(3),nv(i.i18n.t(`backOffice.affairs.title`)),ZC(2),nv(i.affair()?.reference??i.i18n.t(`backOffice.affairs.title`)),ZC(),kS((d=i.affair())?6:-1,d),ZC(),kS((p=i.affair())?7:-1,p),ZC(),kS((S=i.state())===`loading`?8:S===`error`?9:S===`ready`?10:-1)}},dependencies:[N,d,R$1,r,k,g$1,Dt,gr,D,O,r$1],styles:[`@charset "UTF-8";[_nghost-%COMP%]{display:block}.detail-page[_ngcontent-%COMP%]{display:grid;gap:var(--%NS%space-4);min-inline-size:0;inline-size:100%;max-inline-size:var(--%NS%page-width-detail);margin-inline:auto;padding:var(--%NS%page-header-y) var(--%NS%page-x)}.detail-page.form-page[_ngcontent-%COMP%]{max-inline-size:var(--%NS%page-width-form)}.detail-page.wide-page[_ngcontent-%COMP%]{max-inline-size:var(--%NS%page-width-wide)}app-page-header[data-header-layout=stacked][_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{margin:0;font-size:var(--%NS%text-2xl);overflow-wrap:anywhere}app-page-header[data-header-layout=stacked][_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;font-size:var(--%NS%text-base);color:var(--%NS%color-muted);overflow-wrap:anywhere}.detail-page[_ngcontent-%COMP%] > button[_ngcontent-%COMP%]{justify-self:start}@media print{.detail-page[_ngcontent-%COMP%], .detail-page.form-page[_ngcontent-%COMP%], .detail-page.wide-page[_ngcontent-%COMP%]{max-inline-size:none}}.affair-panel[_ngcontent-%COMP%]{min-inline-size:0}.affair-panel[_ngcontent-%COMP%] > *[_ngcontent-%COMP%] + *[_ngcontent-%COMP%]{margin-top:var(--%NS%space-6)}.affair-summary[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:var(--%NS%space-1) var(--%NS%space-2);margin:0;color:var(--%NS%color-muted)}.affair-summary[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{display:flex;align-items:center;gap:var(--%NS%space-2);min-inline-size:0}.affair-summary[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] + div[_ngcontent-%COMP%]:before{color:var(--%NS%color-muted);content:"\\b7"}.affair-summary-client[_ngcontent-%COMP%] dd[_ngcontent-%COMP%]{margin:0}.quote-amount[_ngcontent-%COMP%]{margin:0;text-align:end;font-variant-numeric:tabular-nums}.quote-amount[_ngcontent-%COMP%] dd[_ngcontent-%COMP%]{margin:var(--%NS%space-2) 0 0;font-weight:600}.quote-amount[_ngcontent-%COMP%] dt[_ngcontent-%COMP%], .hint[_ngcontent-%COMP%]{color:var(--%NS%color-muted);font-size:var(--%NS%text-sm)}h2[_ngcontent-%COMP%]{font-size:var(--%NS%text-lg)}.next-action[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:var(--%NS%space-5);padding:var(--%NS%space-5)}.next-action[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-top:var(--%NS%space-2);color:var(--%NS%color-muted)}section[_ngcontent-%COMP%] > [appDataTable][_ngcontent-%COMP%]{margin-top:var(--%NS%space-4)}.external-link[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:var(--%NS%space-1)}.document-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:var(--%NS%space-3)}time[_ngcontent-%COMP%]{color:var(--%NS%color-muted)}.related-documents[_ngcontent-%COMP%]{display:grid;gap:var(--%NS%space-4)}.document-list[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,19rem),1fr));gap:var(--%NS%space-4);margin:0;padding:0;list-style:none}.document-card[_ngcontent-%COMP%]{display:grid;align-content:start;gap:var(--%NS%space-4);min-inline-size:0;padding:var(--%NS%space-4)}.document-identity[_ngcontent-%COMP%]{display:flex;align-items:center;gap:var(--%NS%space-3)}.document-identity[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{min-inline-size:0;overflow-wrap:anywhere}.document-identity[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin-block-end:var(--%NS%space-1);font-size:var(--%NS%text-base)}.document-facts[_ngcontent-%COMP%]{display:grid;gap:var(--%NS%space-3);margin:0}.document-facts[_ngcontent-%COMP%] dt[_ngcontent-%COMP%]{color:var(--%NS%color-muted);font-size:var(--%NS%text-sm)}.document-facts[_ngcontent-%COMP%] dd[_ngcontent-%COMP%]{margin:var(--%NS%space-1) 0 0}.document-facts[_ngcontent-%COMP%] .amount[_ngcontent-%COMP%]{font-weight:600;font-variant-numeric:tabular-nums}@media(max-width:40rem){.next-action[_ngcontent-%COMP%]{align-items:start;flex-direction:column}.quote-amount[_ngcontent-%COMP%]{text-align:start}.next-action[_ngcontent-%COMP%] .document-actions[_ngcontent-%COMP%]{justify-content:flex-start}}`]})};export{ue as AffairDetail};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$t as ZC,A as Gy,D as Fy,Dn as g,E as Ft,Ir as wp,It as Us,Jr as zS,K as Ke,Nr as vd,Tn as fd,Wn as kS,Wr as y_,lt as OS,mr as qT,pr as qS,rn as Zw,rr as nv,tn as ZT,vt as Py,w as Fb,z as Ip}from"./chunk-BAHiFuUo.js";import{m as Ie,r as N,v as Dt}from"./main-
|
|
1
|
+
import{$t as ZC,A as Gy,D as Fy,Dn as g,E as Ft,Ir as wp,It as Us,Jr as zS,K as Ke,Nr as vd,Tn as fd,Wn as kS,Wr as y_,lt as OS,mr as qT,pr as qS,rn as Zw,rr as nv,tn as ZT,vt as Py,w as Fb,z as Ip}from"./chunk-BAHiFuUo.js";import{m as Ie,r as N,v as Dt}from"./main-LXYWXFW4.js";import"./chunk-BAe_07VM.js";import"./chunk-Dv9sNWWK.js";import{Zr as Ss}from"./chunk-D8Ui_APT.js";import{t as g$1}from"./chunk-B56nz2lI.js";import{t as k}from"./chunk-IrDYxRzS.js";import"./chunk-BzUDWIzm.js";import{t as P}from"./chunk-CkRw7h0_.js";import{t as E}from"./chunk-DhpMFMQw.js";import"./chunk-CReShp-B.js";import{a as fn,d as nr,f as or,h as yn,n as an,o as gn,r as cn,t as P$1}from"./chunk-CSkyOfSg.js";import{n as r}from"./chunk-CwkCpxYQ.js";function z(c,i){if(c&1&&(Us(0,`p`,4),y_(1),fd(),Us(2,`a`,5),y_(3),fd()),c&2){let t=qS();ZC(),nv(t.i18n.t(`account.password_complete`)),ZC(2),nv(t.i18n.t(`account.password_login`))}}function G(c,i){if(c&1&&(Us(0,`p`,12),y_(1),fd()),c&2){let t=qS(2);ZC(),nv(t.i18n.t(`account.password_mismatch`))}}function J(c,i){if(c&1&&(Us(0,`p`,15),y_(1),fd(),Us(2,`p`),y_(3),fd(),Us(4,`a`,16),y_(5),fd()),c&2){let t=qS(2);ZC(),nv(t.i18n.t(i)),ZC(2),nv(t.i18n.t(`account.password_retry`)),ZC(2),nv(t.i18n.t(`account.password_login`))}}function Q(c,i){if(c&1){let t=zS();Us(0,`form`,6),Gy(`submit`,function(l){Ip(t);return wp(qS().changePassword(l))}),Us(1,`h3`),y_(2),fd(),Us(3,`p`),y_(4),fd(),Us(5,`label`,7),y_(6),Py(7,`input`,8),qT(),fd(),Us(8,`label`,7),y_(9),Py(10,`input`,9),qT(),fd(),Us(11,`p`,10),y_(12),fd(),Us(13,`label`,7),y_(14),Py(15,`input`,11),qT(),fd(),OS(16,G,2,1,`p`,12),OS(17,J,6,3),Us(18,`div`,13)(19,`button`,14),y_(20),fd()()()}if(c&2){let t,e=qS();ZC(2),nv(e.i18n.t(`account.password_title`)),ZC(2),nv(e.i18n.t(`account.password_hint`)),ZC(2),nv(e.i18n.t(`account.password_current`)),ZC(),Fy(`formField`,e.passwordForm.currentPassword),ZT(),ZC(2),nv(e.i18n.t(`account.password_new`)),ZC(),Fy(`formField`,e.passwordForm.newPassword),ZT(),ZC(2),nv(e.i18n.t(`account.password_rules`)),ZC(2),nv(e.i18n.t(`account.password_repeat`)),ZC(),Fy(`formField`,e.passwordForm.confirmation),ZT(),ZC(),kS(e.passwordForm.confirmation().touched()&&e.passwordForm.confirmation().invalid()?16:-1),ZC(),kS((t=e.errorMessage())?17:-1,t),ZC(2),Fy(`disabled`,e.pending()),ZC(),vd(` `,e.i18n.t(e.pending()?`account.password_pending`:`account.password_save`),` `)}}var R=class c{confirmation=g(P);i18n=g(Ie);authentication=g(E);pending=Ke(!1);complete=Ke(!1);error=Ke(void 0);errorMessage=Ft(()=>r(this.error(),`password`));model=Ke({currentPassword:``,newPassword:``,confirmation:``});passwordForm=nr(this.model,i=>{an(i,()=>this.pending()||this.complete()),gn(i.currentPassword),gn(i.newPassword),gn(i.confirmation),fn(i.newPassword,Ss.minLength),cn(i.newPassword,Ss.maxLength),cn(i.currentPassword,Ss.maxLength),P$1(i.confirmation,({value:t,valueOf:e})=>t()!==e(i.newPassword)?{kind:`mismatch`}:void 0)});changePassword(i){if(i.preventDefault(),!(this.pending()||this.complete())){if(this.passwordForm().invalid()){this.passwordForm().markAsTouched(),this.passwordForm().errorSummary()[0]?.fieldTree().focusBoundControl(),this.error.set(`configurationWorkspace.passwordInvalid`);return}or(this.passwordForm,async()=>{if(this.pending.set(!0),!await this.confirmation.request(this.i18n.t(`account.password_confirm`))){this.pending.set(!1);return}this.error.set(void 0);try{let{currentPassword:t,newPassword:e}=this.model(),l=await this.authentication.changePassword({currentPassword:t,newPassword:e});l.success?this.complete.set(!0):this.error.set(l.code)}catch{this.error.set(`authentication.error`)}finally{this.model.set({currentPassword:``,newPassword:``,confirmation:``}),this.passwordForm().reset(),this.pending.set(!1)}})}}async canDeactivate(){return this.pending()?!1:!this.passwordForm().dirty()||await this.confirmation.request(this.i18n.t(`account.password_discard`))}beforeUnload(i){(this.pending()||this.passwordForm().dirty())&&i.preventDefault()}static ɵfac=function(t){return new(t||c)};static ɵcmp=Fb({type:c,selectors:[[`app-account-security`]],hostBindings:function(t,e){t&1&&Gy(`beforeunload`,function(h){return e.beforeUnload(h)},Zw)},decls:8,vars:3,consts:[[`aria-labelledby`,`password-title`,1,`account-security`,`notice-flow`],[`id`,`password-title`],[1,`muted`],[`novalidate`,``],[`appNotice`,``,`variant`,`success`,`role`,`status`],[`appLinkButton`,``,`routerLink`,`/login`],[`novalidate`,``,3,`submit`],[1,`field`],[`type`,`password`,`autocomplete`,`current-password`,1,`input`,3,`formField`],[`type`,`password`,`autocomplete`,`new-password`,`aria-describedby`,`password-rules`,1,`input`,3,`formField`],[`id`,`password-rules`],[`type`,`password`,`autocomplete`,`new-password`,1,`input`,3,`formField`],[`appNotice`,``,`variant`,`danger`],[1,`spacer-x-3`],[`appButton`,``,`variant`,`primary`,`type`,`submit`,3,`disabled`],[`appNotice`,``,`variant`,`danger`,`role`,`alert`],[`routerLink`,`/login`]],template:function(t,e){t&1&&(Us(0,`section`,0)(1,`app-page-header`)(2,`h2`,1),y_(3),fd(),Us(4,`p`,2),y_(5),fd()(),OS(6,z,4,2)(7,Q,21,13,`form`,3),fd()),t&2&&(ZC(3),nv(e.i18n.t(`account.security_title`)),ZC(2),nv(e.i18n.t(`account.security_hint`)),ZC(),kS(e.complete()?6:7))},dependencies:[N,yn,k,g$1,Dt],styles:[`[_nghost-%COMP%]{display:block}.account-security[_ngcontent-%COMP%]{padding:var(--%NS%space-6) var(--%NS%page-x)}form[_ngcontent-%COMP%]{display:grid;gap:var(--%NS%space-4);margin-block-start:var(--%NS%space-6)}.field[_ngcontent-%COMP%]{display:grid;gap:var(--%NS%space-2)}input[_ngcontent-%COMP%]{width:100%;min-width:0}`]})};export{R as AccountSecurity};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as I}from"./chunk-
|
|
1
|
+
import{i as I}from"./chunk-BAYVC6mO2.js";function i(e,n,t){if(!e||!n||!t||n.cancelledAt!==null||e.status!==`issued`&&e.status!==`paid`)return!1;let l=t.refunds.reduce((d,a)=>d+(a.cancelledAt===null?a.amountCents:0),0);return I(e)-n.amountCents>=l}export{i as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$t as ZC,D as Fy,Dn as g,E as Ft,Gn as k_,Gr as yd,It as Us,Rn as jS,S as FS,Tn as fd,Wn as kS,Wr as y_,X as LS,Zn as md,lt as OS,nt as NH,pr as qS,rr as nv,w as Fb}from"./chunk-BAHiFuUo.js";import{g as bt,m as Ie,v as Dt}from"./main-
|
|
1
|
+
import{$t as ZC,D as Fy,Dn as g,E as Ft,Gn as k_,Gr as yd,It as Us,Rn as jS,S as FS,Tn as fd,Wn as kS,Wr as y_,X as LS,Zn as md,lt as OS,nt as NH,pr as qS,rr as nv,w as Fb}from"./chunk-BAHiFuUo.js";import{g as bt,m as Ie,v as Dt}from"./main-LXYWXFW4.js";var M=e=>[`/clients`,e,`profile`];function q(e,t){if(e&1&&(md(0),y_(1),yd()),e&2){let i=qS().$implicit;ZC(),nv(i.value)}}function F(e,t){if(e&1&&(Us(0,`a`,0),y_(1),fd()),e&2){let i=qS(2);Fy(`routerLink`,k_(2,M,i.clientId())),ZC(),nv(i.clientName())}}function h(e,t){if(e&1&&OS(0,q,2,1,`ng-container`)(1,F,2,4,`a`,0),e&2){let i=t.$implicit;kS(i.kind===`text`?0:i.name===`client`?1:-1)}}var H={quote:`commercialHeader.quoteDescription`,order:`commercialHeader.orderDescription`,invoice:`commercialHeader.invoiceDescription`,affair:`commercialHeader.affairDescription`};var I=class e{i18n=g(Ie);kind=NH.required();clientId=NH.required();clientName=NH.required();parts=Ft(()=>bt(this.i18n.language(),H[this.kind()]));static ɵfac=function(i){return new(i||e)};static ɵcmp=Fb({type:e,selectors:[[`p`,`appClientDescription`,``]],inputs:{kind:[1,`kind`],clientId:[1,`clientId`],clientName:[1,`clientName`]},decls:2,vars:0,consts:[[3,`routerLink`]],template:function(i,T){i&1&&LS(0,h,2,1,null,null,FS),i&2&&jS(T.parts())},dependencies:[Dt],encapsulation:2})};export{I as t};
|