@sachahjkl/backoffice 0.2.5 → 0.2.7
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 +3 -1
- package/bin/backoffice.mjs +2 -2
- package/dist/demo-reset.cjs +65895 -0
- package/dist/main.cjs +71 -39
- package/dist/migrate.cjs +17 -3
- package/dist/web/{chunk-Bans5XmP2.js → chunk--RuvStn6.js} +1 -1
- package/dist/web/{chunk-BidSGJER.js → chunk-4ipZT9nT.js} +1 -1
- package/dist/web/chunk-6jIo5mZ42.js +1 -0
- package/dist/web/{chunk-D0WfOSVe.js → chunk-9X4vLcFh.js} +1 -1
- package/dist/web/chunk-9d_UD-MQ.js +1 -0
- package/dist/web/{chunk-CuukTiS1.js → chunk-AJOoJgZJ.js} +1 -1
- package/dist/web/{chunk-2sHWWuzv2.js → chunk-B0bNirg2.js} +1 -1
- package/dist/web/chunk-B3OxeBLO2.js +1 -0
- package/dist/web/chunk-B5xzAYYx2.js +1 -0
- package/dist/web/{chunk-BQRlJCOd.js → chunk-B6Rml85x2.js} +1 -1
- package/dist/web/chunk-B8_dFe5w.js +1 -0
- package/dist/web/chunk-B91VAo1J.js +1 -0
- package/dist/web/chunk-B9NV1rY62.js +1 -0
- package/dist/web/chunk-BAn0tBhX.js +1 -0
- package/dist/web/chunk-BGVaNZdj.js +1 -0
- package/dist/web/chunk-BHDXYrox.js +1 -0
- package/dist/web/chunk-BI9lIdFn.js +1 -0
- package/dist/web/{chunk-CYB9QO85.js → chunk-BKufCOYq.js} +1 -1
- package/dist/web/chunk-BNksdK_D2.js +1 -0
- package/dist/web/chunk-BQ7WWH4L.js +1 -0
- package/dist/web/chunk-BQrmVphu2.js +1 -0
- package/dist/web/chunk-BR0demlX.js +1 -0
- package/dist/web/chunk-BT8KtCYG.js +1 -0
- package/dist/web/{chunk-Bm0a1bep.js → chunk-BVszSMJC.js} +1 -1
- package/dist/web/{chunk-CJDa7FT62.js → chunk-BYjxXKZ4.js} +1 -1
- package/dist/web/chunk-BZZJ287h.js +1 -0
- package/dist/web/chunk-Bb31fHqC2.js +1 -0
- package/dist/web/chunk-BcUjdID-.js +1 -0
- package/dist/web/{chunk-BzOWqX4m2.js → chunk-Bck0-DJt2.js} +1 -1
- package/dist/web/chunk-Bf3eV_su2.js +1 -0
- package/dist/web/chunk-BfSewUhY.js +1 -0
- package/dist/web/{chunk-osh5v_OU2.js → chunk-Bfx7EEIR.js} +1 -1
- package/dist/web/chunk-Bi4Jixry2.js +1 -0
- package/dist/web/chunk-BiECfDS7.js +1 -0
- package/dist/web/{chunk-CGgGK0-O2.js → chunk-Bj7Oze2U2.js} +1 -1
- package/dist/web/{chunk-BYalGDdQ.js → chunk-Bjo6eVnk.js} +1 -1
- package/dist/web/{chunk-BbKL19W02.js → chunk-BkvskoFt2.js} +1 -1
- package/dist/web/chunk-Bn46cQyx.js +1 -0
- package/dist/web/chunk-Bn6RkvPA2.js +1 -0
- package/dist/web/{chunk-B08xNtqD2.js → chunk-BpZ7MSOP.js} +1 -1
- package/dist/web/{chunk-DCE1ImZZ2.js → chunk-Bq2zV2_3.js} +1 -1
- package/dist/web/chunk-By2EFyNM.js +1 -0
- package/dist/web/{chunk-DQwyRMR6.js → chunk-C-O6GrQC2.js} +1 -1
- package/dist/web/{chunk-CtR8WyO5.js → chunk-C0Ceu-vg.js} +1 -1
- package/dist/web/chunk-C0gTeWW62.js +1 -0
- package/dist/web/{chunk-ClevJX5T2.js → chunk-C19Alcnx2.js} +1 -1
- package/dist/web/{chunk-BKWyrwrz.js → chunk-CABvk97t2.js} +1 -1
- package/dist/web/chunk-CApvwK4D.js +1 -0
- package/dist/web/chunk-CCkaRRSy.js +1 -0
- package/dist/web/chunk-CCqlW8pS2.js +3 -0
- package/dist/web/chunk-CCr_R2Cg.js +1 -0
- package/dist/web/chunk-CDK48Khc.js +1 -0
- package/dist/web/chunk-CDS6LjBz2.js +1 -0
- package/dist/web/chunk-CE9WzUCM.js +1 -0
- package/dist/web/chunk-CEJjSd8-2.js +1 -0
- package/dist/web/{chunk-Ce_TeGo52.js → chunk-CG4Kbo1n2.js} +1 -1
- package/dist/web/chunk-CGfyD3XX2.js +1 -0
- package/dist/web/chunk-CK6Sjqig.js +1 -0
- package/dist/web/chunk-CKFB1V-p2.js +1 -0
- package/dist/web/chunk-CL02A9wI.js +1 -0
- package/dist/web/{chunk-CrhlmMPy2.js → chunk-CLHj5Ycx2.js} +1 -1
- package/dist/web/chunk-CLZ5xsSQ2.js +1 -0
- package/dist/web/{chunk-JUTCkl5C2.js → chunk-CMvRZBpn.js} +1 -1
- package/dist/web/chunk-CNfmNEak.js +1 -0
- package/dist/web/chunk-COTrF1xY2.js +1 -0
- package/dist/web/{chunk-CC05ZHq-.js → chunk-COXN76fu2.js} +1 -1
- package/dist/web/{chunk-BkKRFLuX2.js → chunk-CPHUl7N2.js} +1 -1
- package/dist/web/chunk-CUqj_Bxs2.js +1 -0
- package/dist/web/{chunk-C2gUrdSR2.js → chunk-CVHqiS63.js} +1 -1
- package/dist/web/chunk-CV_fLVFT.js +1 -0
- package/dist/web/{chunk-CJKvPHwX.js → chunk-CYGyIy7J.js} +1 -1
- package/dist/web/chunk-CYRUKYKv2.js +1 -0
- package/dist/web/{chunk-xlLlHW0G2.js → chunk-C_QyIKvy.js} +1 -1
- package/dist/web/chunk-Ca3lwqEF.js +1 -0
- package/dist/web/chunk-CaJrmM9V.js +1 -0
- package/dist/web/{chunk-Ok502fV82.js → chunk-CfcCxe_k.js} +1 -1
- package/dist/web/chunk-Ck6cItVE2.js +2 -0
- package/dist/web/{chunk-S5Gmkpdy2.js → chunk-CkWd-yMn.js} +1 -1
- package/dist/web/{chunk-C7DvmZKC.js → chunk-CmokTGIG.js} +1 -1
- package/dist/web/chunk-CpXqQPuw.js +1 -0
- package/dist/web/{chunk-Dyia17vy.js → chunk-CtmP6l7_2.js} +1 -1
- package/dist/web/chunk-CubfQf-X2.js +1 -0
- package/dist/web/chunk-CuepVIkm2.js +1 -0
- package/dist/web/chunk-CvMAjyvr2.js +1 -0
- package/dist/web/chunk-CvsVlcIU2.js +1 -0
- package/dist/web/chunk-CwzCbuXH.js +1 -0
- package/dist/web/{chunk-BxQ7up-t.js → chunk-Cx07K71K.js} +1 -1
- package/dist/web/chunk-D-VHaopx.js +1 -0
- package/dist/web/chunk-D1DvlGbP.js +1 -0
- package/dist/web/{chunk-CfAqWkFp.js → chunk-D1wrPwB5.js} +1 -1
- package/dist/web/{chunk-BbWEBemE.js → chunk-D3XjW5Cm.js} +1 -1
- package/dist/web/{chunk-DRgIjFR6.js → chunk-D5MFwK9L.js} +1 -1
- package/dist/web/{chunk-CjtJKrza.js → chunk-D5qmP2Wu.js} +2 -2
- package/dist/web/{chunk-BbbRo5jM2.js → chunk-D6k6pmdU.js} +1 -1
- package/dist/web/chunk-D8kEdb5y2.js +1 -0
- package/dist/web/chunk-D8t0s8LD.js +1 -0
- package/dist/web/{chunk-Z9CNux5n2.js → chunk-D8xHm8jb2.js} +1 -1
- package/dist/web/{chunk-BMYHfrEK.js → chunk-D97UUzIx.js} +1 -1
- package/dist/web/chunk-DB6sOjsn2.js +1 -0
- package/dist/web/{chunk-D4J7xo6v.js → chunk-DDCyjjcE.js} +1 -1
- package/dist/web/chunk-DEXzwHB0.js +1 -0
- package/dist/web/{chunk-DODMV1QO.js → chunk-DGbo0App2.js} +1 -1
- package/dist/web/chunk-DIBFSF2Z.js +1 -0
- package/dist/web/{chunk-bP01prsY.js → chunk-DIJSXeQC2.js} +1 -1
- package/dist/web/{chunk-CvjKWUFl.js → chunk-DKlxu0GP2.js} +1 -1
- package/dist/web/{chunk-BtRCqgfa.js → chunk-DM4Wc9U7.js} +1 -1
- package/dist/web/{chunk-DUJbqlfC.js → chunk-DM5aibnW.js} +1 -1
- package/dist/web/chunk-DMXgU6Nc2.js +1 -0
- package/dist/web/chunk-DMskLhpk2.js +1 -0
- package/dist/web/{chunk-HhmMH02E.js → chunk-DOCau85G2.js} +1 -1
- package/dist/web/{chunk-B86wqImw.js → chunk-DOinRyX_2.js} +1 -1
- package/dist/web/chunk-DQp-2GVv.js +1 -0
- package/dist/web/chunk-DQr_9Q6T.js +1 -0
- package/dist/web/chunk-DSpA-ZPx.js +1 -0
- package/dist/web/chunk-DTPC4JtI2.js +1 -0
- package/dist/web/chunk-DURq7J8U2.js +1 -0
- package/dist/web/chunk-DVJ4YZuU.js +1 -0
- package/dist/web/chunk-DVyDnsGh.js +1 -0
- package/dist/web/{chunk-oS95kAu6.js → chunk-DXvlXoVT2.js} +1 -1
- package/dist/web/{chunk-CHUMIo442.js → chunk-DZgMGE6C.js} +1 -1
- package/dist/web/{chunk-BK0Mi7Tk.js → chunk-DZgf7AIe.js} +1 -1
- package/dist/web/{chunk-CBXOl0VL.js → chunk-D_8jIApo.js} +1 -1
- package/dist/web/chunk-D_vyhgGx.js +1 -0
- package/dist/web/chunk-Db2zQ-8C.js +1 -0
- package/dist/web/{chunk-BEAkjhZc2.js → chunk-DboSVJMM.js} +1 -1
- package/dist/web/chunk-DdOc1fs-.js +1 -0
- package/dist/web/chunk-DddDKWSn2.js +1 -0
- package/dist/web/{chunk-DAdKllIN.js → chunk-DerJPaBw.js} +1 -1
- package/dist/web/chunk-Dh86w63y.js +1 -0
- package/dist/web/{chunk-DXsw8_Za2.js → chunk-DhLlQTD-2.js} +1 -1
- package/dist/web/{chunk-9qDelKdu.js → chunk-DhkjPUn4.js} +1 -1
- package/dist/web/{chunk-BAKoExNF.js → chunk-Di9FA_QV.js} +1 -1
- package/dist/web/chunk-DjwvqY3z2.js +1 -0
- package/dist/web/{chunk-CH-_LXUF.js → chunk-Dl4EbYnM2.js} +1 -1
- package/dist/web/chunk-Dl4V93zm2.js +1 -0
- package/dist/web/{chunk-CsiZwjWr2.js → chunk-Dns8uMf32.js} +1 -1
- package/dist/web/chunk-Dnzjseqf2.js +1 -0
- package/dist/web/chunk-DpI44v1z.js +1 -0
- package/dist/web/{chunk-BqIPzI6E2.js → chunk-DpLF2wJ62.js} +1 -1
- package/dist/web/chunk-Dqhs2Pyw2.js +1 -0
- package/dist/web/{chunk-BWNhkOOr.js → chunk-DsaNNeZe.js} +1 -1
- package/dist/web/{chunk-GjZTRlHL.js → chunk-DubWLqvO.js} +1 -1
- package/dist/web/{chunk-DibPYvNu.js → chunk-Fc120Hsi2.js} +1 -1
- package/dist/web/{chunk-B23x0ZHj2.js → chunk-HmRGBt692.js} +1 -1
- package/dist/web/chunk-IlM3eTPp2.js +1 -0
- package/dist/web/chunk-IzGdqlW82.js +1 -0
- package/dist/web/{chunk-u_CBgBep.js → chunk-MpUdRrak2.js} +1 -1
- package/dist/web/{chunk-BlE9HnAo.js → chunk-NDpjbcAr2.js} +1 -1
- package/dist/web/chunk-P1du2kWg2.js +1 -0
- package/dist/web/{chunk-BCemdpJW.js → chunk-POMKwNf_.js} +1 -1
- package/dist/web/chunk-PqGGk0JD.js +1 -0
- package/dist/web/{chunk-BG9HC5MH2.js → chunk-RIi7_iVg.js} +1 -1
- package/dist/web/chunk-SZJG1lFa2.js +1 -0
- package/dist/web/{chunk-jEvWOBug.js → chunk-WNYFaDlu2.js} +1 -1
- package/dist/web/{chunk-Cx_tkq5a.js → chunk-XtjMOmku2.js} +1 -1
- package/dist/web/chunk-XvyWOb2Q.js +1 -0
- package/dist/web/{chunk-BPI0E5qw.js → chunk-ZcJhJsoo.js} +1 -1
- package/dist/web/{chunk-Dk7Fe34Y.js → chunk-aW8Vltn22.js} +1 -1
- package/dist/web/chunk-a_Va_Nj7.js +1 -0
- package/dist/web/{chunk-D83vXRZS2.js → chunk-enci06qG.js} +1 -1
- package/dist/web/chunk-fYJ7OBkh.js +1 -0
- package/dist/web/{chunk-THRzZN4s.js → chunk-k6TIcaIA.js} +1 -1
- package/dist/web/{chunk-BsXdvb75.js → chunk-nC_XlFOG.js} +1 -1
- package/dist/web/{chunk-DzxhjLIR.js → chunk-niXXbm7H.js} +1 -1
- package/dist/web/chunk-owvOEsA9.js +1 -0
- package/dist/web/{chunk-D8ywkT0Z2.js → chunk-pV57uiBu2.js} +1 -1
- package/dist/web/{chunk-CdEOFR_J.js → chunk-qKosqkwC.js} +1 -1
- package/dist/web/{chunk-BMsK7VjB2.js → chunk-r6H-BfOd.js} +1 -1
- package/dist/web/chunk-tDREPM-0.js +1 -0
- package/dist/web/{chunk-78yNgJiB.js → chunk-xTX16tt2.js} +1 -1
- package/dist/web/chunk-y0Vyi0HZ.js +1 -0
- package/dist/web/chunk-yfBrkklv.js +1 -0
- package/dist/web/index.csr.html +1 -1
- package/dist/web/{main-AJD2LGCE.js → main-F7D3L737.js} +4 -4
- package/package.json +1 -1
- package/dist/web/chunk-0C-62od6.js +0 -1
- package/dist/web/chunk-B1Kpw1um2.js +0 -1
- package/dist/web/chunk-B43WHzJp.js +0 -1
- package/dist/web/chunk-B6BtInzP2.js +0 -1
- package/dist/web/chunk-BAjZiy9u2.js +0 -1
- package/dist/web/chunk-BE8oALxd.js +0 -1
- package/dist/web/chunk-BIydbtyu.js +0 -1
- package/dist/web/chunk-BMU6gPN0.js +0 -1
- package/dist/web/chunk-BRUZgvLR2.js +0 -1
- package/dist/web/chunk-BSxXPdhz2.js +0 -1
- package/dist/web/chunk-BTDByxsO2.js +0 -1
- package/dist/web/chunk-BUnVNwR0.js +0 -1
- package/dist/web/chunk-BV-2_l7u2.js +0 -1
- package/dist/web/chunk-B_pX979y.js +0 -1
- package/dist/web/chunk-Ba4cFLiE2.js +0 -1
- package/dist/web/chunk-BaLdnNAA.js +0 -1
- package/dist/web/chunk-BhCP8fQA.js +0 -1
- package/dist/web/chunk-BhwbhxlY2.js +0 -1
- package/dist/web/chunk-Bjio-Q3F.js +0 -1
- package/dist/web/chunk-BjiyoDeK2.js +0 -1
- package/dist/web/chunk-BnPSwNBN.js +0 -1
- package/dist/web/chunk-BqbhE2jJ.js +0 -1
- package/dist/web/chunk-BrRhr7VS.js +0 -1
- package/dist/web/chunk-Bt1ivJuj2.js +0 -1
- package/dist/web/chunk-BtH61zrc.js +0 -1
- package/dist/web/chunk-BuKqE_YG2.js +0 -1
- package/dist/web/chunk-ByBw4qTD.js +0 -1
- package/dist/web/chunk-ByfP_6io2.js +0 -1
- package/dist/web/chunk-Bylz8GTy2.js +0 -1
- package/dist/web/chunk-C1jIGjiG.js +0 -1
- package/dist/web/chunk-C2WwmFiS.js +0 -1
- package/dist/web/chunk-C3v6o8sk.js +0 -1
- package/dist/web/chunk-C7TzEeP_2.js +0 -1
- package/dist/web/chunk-C8AJBuJL2.js +0 -1
- package/dist/web/chunk-C9_g77K0.js +0 -1
- package/dist/web/chunk-CAr--Z8G2.js +0 -1
- package/dist/web/chunk-CIIIDIUz.js +0 -1
- package/dist/web/chunk-CUvLKCob2.js +0 -1
- package/dist/web/chunk-CV-g60E82.js +0 -1
- package/dist/web/chunk-CV1Zh4JH.js +0 -1
- package/dist/web/chunk-CVZQi-q62.js +0 -1
- package/dist/web/chunk-CY4lfBdp2.js +0 -1
- package/dist/web/chunk-Cc534gtY.js +0 -1
- package/dist/web/chunk-CcvGqiZH.js +0 -1
- package/dist/web/chunk-CdDlz5SQ2.js +0 -1
- package/dist/web/chunk-CdeX3SOP.js +0 -1
- package/dist/web/chunk-CgThkMbX2.js +0 -1
- package/dist/web/chunk-Chasvinb.js +0 -1
- package/dist/web/chunk-CihZnkoG2.js +0 -1
- package/dist/web/chunk-ClYiqUra.js +0 -1
- package/dist/web/chunk-CmhHSFX72.js +0 -1
- package/dist/web/chunk-CsdHWYnL.js +0 -1
- package/dist/web/chunk-CuQMh9Mm2.js +0 -1
- package/dist/web/chunk-D2Albj_1.js +0 -1
- package/dist/web/chunk-D2P8u0ih2.js +0 -1
- package/dist/web/chunk-D2reBpeg2.js +0 -1
- package/dist/web/chunk-D6HQPG4L.js +0 -1
- package/dist/web/chunk-DFQAtlu22.js +0 -1
- package/dist/web/chunk-DIyfCN-v.js +0 -1
- package/dist/web/chunk-DK0GFIMr.js +0 -1
- package/dist/web/chunk-DMlYYeVV2.js +0 -3
- package/dist/web/chunk-DS8Gi0yV2.js +0 -1
- package/dist/web/chunk-DSIpVKzQ.js +0 -1
- package/dist/web/chunk-DT9HaYIg.js +0 -1
- package/dist/web/chunk-DU2qw7-O.js +0 -1
- package/dist/web/chunk-DZX7bq5d.js +0 -1
- package/dist/web/chunk-DiSSXeWw2.js +0 -1
- package/dist/web/chunk-DjQuCwaE.js +0 -1
- package/dist/web/chunk-DmBRHpbi2.js +0 -1
- package/dist/web/chunk-DpbG_pUL.js +0 -1
- package/dist/web/chunk-DqoyE916.js +0 -1
- package/dist/web/chunk-DsZGgyjH2.js +0 -1
- package/dist/web/chunk-DsbC92Ad2.js +0 -1
- package/dist/web/chunk-DuQk8dor2.js +0 -1
- package/dist/web/chunk-DxjwnDdp.js +0 -1
- package/dist/web/chunk-DyaBJhQt2.js +0 -1
- package/dist/web/chunk-H2FHxG4A.js +0 -1
- package/dist/web/chunk-KV_4fJOq.js +0 -2
- package/dist/web/chunk-NyAoR3GT.js +0 -1
- package/dist/web/chunk-Qhc5gzMT.js +0 -1
- package/dist/web/chunk-RRqL4AoW2.js +0 -1
- package/dist/web/chunk-THDcl3GX2.js +0 -1
- package/dist/web/chunk-TRzqZ7nT.js +0 -1
- package/dist/web/chunk-VKqyG94L.js +0 -1
- package/dist/web/chunk-cxgj3JaU2.js +0 -1
- package/dist/web/chunk-dClaCeUx.js +0 -1
- package/dist/web/chunk-kb-UZrxn2.js +0 -1
- package/dist/web/chunk-mI1TUlml.js +0 -1
- package/dist/web/chunk-tiVwZKxb.js +0 -1
- package/dist/web/chunk-uYhVCHeh2.js +0 -1
- package/dist/web/chunk-ynjMwOUq.js +0 -1
- package/dist/web/chunk-z-mghjkB.js +0 -1
- /package/dist/web/{chunk-BUoX0svL2.js → chunk-BUoX0svL.js} +0 -0
- /package/dist/web/{chunk-Bsy3r41y.js → chunk-Bsy3r41y2.js} +0 -0
- /package/dist/web/{chunk-CARNiCDb.js → chunk-CARNiCDb2.js} +0 -0
- /package/dist/web/{chunk-CGo7Fepz2.js → chunk-CGo7Fepz.js} +0 -0
- /package/dist/web/{chunk-CXHCUTDs2.js → chunk-CXHCUTDs.js} +0 -0
- /package/dist/web/{chunk-CtcsJTAS.js → chunk-CtcsJTAS2.js} +0 -0
- /package/dist/web/{chunk-WJWN7A_V.js → chunk-WJWN7A_V2.js} +0 -0
- /package/dist/web/{chunk-cTGENC4T.js → chunk-cTGENC4T2.js} +0 -0
|
@@ -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-AJD2LGCE.js";import{i as H$1,l as W$1}from"./chunk-BzUDWIzm.js";import{t as Ae$1}from"./chunk-DUJbqlfC.js";import{wi as wu$1}from"./chunk-BAe_07VM.js";import{En as Kx,Q as Dp$1}from"./chunk-CjtJKrza.js";import{t as D$1}from"./chunk-CXHCUTDs2.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-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(`
|
|
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{$ as MH,$t as ZC,A as Gy,D as Fy,It as Us,Tn as fd,Wn as kS,Wr as y_,lt as OS,nt as NH,pr as qS,qn as ky,rr as nv,w as Fb,xt as Qg}from"./chunk-BAHiFuUo.js";import{r as N}from"./main-
|
|
1
|
+
import{$ as MH,$t as ZC,A as Gy,D as Fy,It as Us,Tn as fd,Wn as kS,Wr as y_,lt as OS,nt as NH,pr as qS,qn as ky,rr as nv,w as Fb,xt as Qg}from"./chunk-BAHiFuUo.js";import{r as N}from"./main-F7D3L737.js";function S(e,n){if(e&1&&(Us(0,`h2`,3),y_(1),fd()),e&2){let t=qS();Fy(`id`,n),ZC(),nv(t)}}function I(e,n){if(e&1&&(Us(0,`strong`),y_(1),fd()),e&2){let t=qS();ZC(),nv(t)}}function D(e,n){if(e&1&&OS(0,S,2,2,`h2`,3)(1,I,2,1,`strong`),e&2){let t;kS((t=qS().headingId())?0:1,t)}}function F(e,n){if(e&1&&(Us(0,`a`,0),y_(1),fd()),e&2){let t=qS();Fy(`href`,n,Qg),ky(`target`,t.external()?`_blank`:null)(`rel`,t.external()?`noopener noreferrer`:null),ZC(),nv(t.value())}}function T(e,n){if(e&1&&(Us(0,`code`),y_(1),fd()),e&2){let t=qS();ZC(),nv(t.value())}}function E(e,n){e&1&&(Us(0,`small`),y_(1),fd()),e&2&&(ZC(),nv(n))}function L(e,n){e&1&&(Us(0,`span`,2),y_(1),fd()),e&2&&(ZC(),nv(n))}var M=class e{label=NH(``);headingId=NH(``);value=NH.required();href=NH();external=NH(!1);description=NH(``);actionLabel=NH.required();status=NH(``);copy=MH();static ɵfac=function(t){return new(t||e)};static ɵcmp=Fb({type:e,selectors:[[`app-copy-field`]],inputs:{label:[1,`label`],headingId:[1,`headingId`],value:[1,`value`],href:[1,`href`],external:[1,`external`],description:[1,`description`],actionLabel:[1,`actionLabel`],status:[1,`status`]},outputs:{copy:`copy`},decls:8,vars:5,consts:[[3,`href`],[`appButton`,``,`type`,`button`,3,`click`],[`role`,`status`],[3,`id`]],template:function(t,l){if(t&1&&(OS(0,D,2,1),OS(1,F,2,4,`a`,0)(2,T,2,1,`code`),OS(3,E,2,1,`small`),Us(4,`p`)(5,`button`,1),Gy(`click`,function(){return l.copy.emit()}),y_(6),fd(),OS(7,L,2,1,`span`,2),fd()),t&2){let m,_,g,f;kS((m=l.label())?0:-1,m),ZC(),kS((_=l.href())?1:2,_),ZC(2),kS((g=l.description())?3:-1,g),ZC(3),nv(l.actionLabel()),ZC(),kS((f=l.status())?7:-1,f)}},dependencies:[N],styles:[`[_nghost-%COMP%]{display:grid;justify-items:start;gap:var(--%NS%space-3);padding:var(--%NS%space-4);border:1px solid var(--%NS%color-line-strong);background:var(--%NS%color-surface-sunken)}a[_ngcontent-%COMP%], code[_ngcontent-%COMP%]{max-width:100%;overflow-wrap:anywhere}p[_ngcontent-%COMP%]{display:flex;align-items:center;gap:var(--%NS%space-3)}span[_ngcontent-%COMP%]{color:var(--%NS%color-success)}small[_ngcontent-%COMP%]{color:var(--%NS%color-muted)}`]})};export{M as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as m,t as l}from"./chunk-BwCtja5l.js";import{$ as MH,$t as ZC,A as Gy,D as Fy,Dn as g,Dr as t_,E as Ft,Ir as wp,It as Us,J as Ky,Jr as zS,K as Ke,N as Hb,Nn as ie,Nt as T_,On as hN,P as Hn,Rn as jS,Tn as fd,V as Iy,Vr as xH,Wn as kS,Wr as y_,X as LS,b as E,c as AH,fn as av,ft as Ol,l as A_,ln as ad,lr as pN,lt as OS,mt as PH,nt as NH,pr as qS,pt as Op,qn as ky,rr as nv,u as Ao,vt as Py,w as Fb,wn as fa,wt as RH,xn as e_,y as Dy,yn as cv,z as Ip}from"./chunk-BAHiFuUo.js";import{i as r}from"./main-F7D3L737.js";import{t as Ft$1}from"./chunk-DjewtV43.js";import{i as H,l as W$1,t as A}from"./chunk-BzUDWIzm.js";import{d as nr,n as an}from"./chunk-CSkyOfSg.js";import{a as b,c as u,l as y,n as I,o as f}from"./chunk-CP-AnFGa2.js";import{r as d}from"./chunk-scbWWgLx2.js";import{a as d$1,i as U$1,r as M}from"./chunk-Bsy3r41y2.js";var W=class{inputs;listBehavior;hasBeenInteracted=I(!1);orientation;disabled=f(()=>this.listBehavior.disabled());readonly;tabIndex=f(()=>this.listBehavior.tabIndex());activeDescendant=f(()=>this.listBehavior.activeDescendant());multi;setsize=f(()=>this.inputs.items().length);followFocus=f(()=>this.inputs.selectionMode()===`follow`);wrap=I(!0);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`);dynamicSpaceKey=f(()=>this.listBehavior.isTyping()?``:` `);typeaheadRegexp=/^.$/;keydown=f(()=>{let t=new b;return this.readonly()?t.on(this.prevKey,()=>this.listBehavior.prev(),{ignoreRepeat:!1}).on(this.nextKey,()=>this.listBehavior.next(),{ignoreRepeat:!1}).on(`Home`,()=>this.listBehavior.first()).on(`End`,()=>this.listBehavior.last()).on(this.typeaheadRegexp,e=>this.listBehavior.search(e.key)):(this.followFocus()||t.on(this.prevKey,()=>this.listBehavior.prev(),{ignoreRepeat:!1}).on(this.nextKey,()=>this.listBehavior.next(),{ignoreRepeat:!1}).on(`Home`,()=>this.listBehavior.first()).on(`End`,()=>this.listBehavior.last()).on(this.typeaheadRegexp,e=>this.listBehavior.search(e.key)),this.followFocus()&&t.on(this.prevKey,()=>this.listBehavior.prev({selectOne:!0}),{ignoreRepeat:!1}).on(this.nextKey,()=>this.listBehavior.next({selectOne:!0}),{ignoreRepeat:!1}).on(`Home`,()=>this.listBehavior.first({selectOne:!0})).on(`End`,()=>this.listBehavior.last({selectOne:!0})).on(this.typeaheadRegexp,e=>this.listBehavior.search(e.key,{selectOne:!0})),this.inputs.multi()&&t.on(u.Any,`Shift`,()=>this.listBehavior.anchor(this.listBehavior.activeIndex())).on(u.Shift,this.prevKey,()=>this.listBehavior.prev({selectRange:!0}),{ignoreRepeat:!1}).on(u.Shift,this.nextKey,()=>this.listBehavior.next({selectRange:!0}),{ignoreRepeat:!1}).on([u.Ctrl|u.Shift,u.Meta|u.Shift],`Home`,()=>this.listBehavior.first({selectRange:!0,anchor:!1})).on([u.Ctrl|u.Shift,u.Meta|u.Shift],`End`,()=>this.listBehavior.last({selectRange:!0,anchor:!1})).on(u.Shift,`Enter`,()=>this.listBehavior.updateSelection({selectRange:!0,anchor:!1})).on(u.Shift,this.dynamicSpaceKey,()=>this.listBehavior.updateSelection({selectRange:!0,anchor:!1})),!this.followFocus()&&this.inputs.multi()&&t.on(this.dynamicSpaceKey,()=>this.listBehavior.toggle()).on(`Enter`,()=>this.listBehavior.toggle()).on([u.Ctrl,u.Meta],`A`,()=>this.listBehavior.toggleAll()),!this.followFocus()&&!this.inputs.multi()&&(t.on(this.dynamicSpaceKey,()=>this.listBehavior.toggleOne()),t.on(`Enter`,()=>this.listBehavior.toggleOne())),this.inputs.multi()&&this.followFocus()&&t.on([u.Ctrl,u.Meta],this.prevKey,()=>this.listBehavior.prev(),{ignoreRepeat:!1}).on([u.Ctrl,u.Meta],this.nextKey,()=>this.listBehavior.next(),{ignoreRepeat:!1}).on([u.Ctrl,u.Meta],` `,()=>this.listBehavior.toggle()).on([u.Ctrl,u.Meta],`Enter`,()=>this.listBehavior.toggle()).on([u.Ctrl,u.Meta],`Home`,()=>this.listBehavior.first()).on([u.Ctrl,u.Meta],`End`,()=>this.listBehavior.last()).on([u.Ctrl,u.Meta],`A`,()=>{this.listBehavior.toggleAll(),this.listBehavior.select()}),t)});clickManager=f(()=>{let t=new d$1;return this.readonly()?t.on(e=>this.listBehavior.goto(this._getItem(e))):(this.multi()&&t.on(u.Shift,e=>this.listBehavior.goto(this._getItem(e),{selectRange:!0})),!this.multi()&&this.followFocus()?t.on(e=>this.listBehavior.goto(this._getItem(e),{selectOne:!0})):!this.multi()&&!this.followFocus()?t.on(e=>this.listBehavior.goto(this._getItem(e),{toggle:!0})):this.multi()&&this.followFocus()?t.on(e=>this.listBehavior.goto(this._getItem(e),{selectOne:!0})).on(u.Ctrl,e=>this.listBehavior.goto(this._getItem(e),{toggle:!0})):this.multi()&&!this.followFocus()?t.on(e=>this.listBehavior.goto(this._getItem(e),{toggle:!0})):t)});constructor(t){this.inputs=t,this.readonly=t.readonly,this.orientation=t.orientation,this.multi=t.multi,this.listBehavior=new d(t)}validate(){let t=[];!this.inputs.multi()&&this.inputs.value().length>1&&t.push(`A single-select listbox should not have multiple selected options. Selected options: ${this.inputs.value().join(`, `)}`);let e=this.inputs.items().map(r=>r.value()),n=e.filter((r,R)=>e.indexOf(r)!==R);n.length>0&&t.push(`Duplicate option value '${n[0]}' detected inside ngListbox.`);let i=this.inputs.items().map(r=>r.id()),l=i.filter((r,R)=>i.indexOf(r)!==R);return l.length>0&&t.push(`Duplicate option ID '${l[0]}' detected inside ngListbox.`),t}onKeydown(t){this.disabled()||(this.hasBeenInteracted.set(!0),this.keydown().handle(t))}onClick(t){this.disabled()||(this.hasBeenInteracted.set(!0),this.clickManager().handle(t))}onFocusIn(){this.hasBeenInteracted.set(!0)}setDefaultState(){let t=null;for(let e of this.inputs.items())if(this.listBehavior.isFocusable(e)&&(t||(t=e),e.selected())){this.inputs.activeItem.set(e);return}t&&(this.inputs.activeItem.set(t),this.followFocus()&&this.listBehavior.select())}setDefaultStateEffect(){this.hasBeenInteracted()||this.setDefaultState()}_getItem(t){let e=A(t);if(!e)return;let n=e.closest(`[role="option"]`);return this.inputs.items().find(i=>i.element()===n)}};var z=class{id;value;index=f(()=>this.listbox()?.inputs.items().indexOf(this)??-1);active=f(()=>this.listbox()?.inputs.activeItem()===this);selected=f(()=>this.listbox()?.inputs.value().includes(this.value()));selectable=()=>!0;disabled;searchTerm;listbox;tabIndex=f(()=>this.listbox()?.listBehavior.getItemTabindex(this));element;constructor(t){this.id=t.id,this.value=t.value,this.listbox=t.listbox,this.element=t.element,this.disabled=t.disabled,this.searchTerm=t.searchTerm}};function F(o){return o===void 0?void 0:hN(o)}var G=class{inputs;isExpanded=Ft(()=>this.inputs.alwaysExpanded()||this.inputs.expanded());value;element=()=>this.inputs.element();disabled=()=>this.inputs.disabled();readonly=()=>this.inputs.readonly();softDisabled=()=>this.inputs.softDisabled?.()??!0;inlineSuggestion=()=>this.inputs.inlineSuggestion();activeDescendant=Ft(()=>this.inputs.popup()?.activeDescendant());popupId=Ft(()=>this.inputs.popup()?.popupId());popupType=Ft(()=>this.inputs.popup()?.popupType());autocomplete=Ft(()=>{let t=this.popupType(),e=!!this.inputs.popup()&&t!==`dialog`,n=!!this.inlineSuggestion();return e&&n?`both`:e?`list`:n?`inline`:`none`});keyboardEventRelay=Ke(void 0);isFocused=Ke(!1);isDeleting=Ke(!1);isEditable=Ft(()=>this.element().tagName.toLowerCase()===`input`||this.element().tagName.toLowerCase()===`textarea`);ariaReadonly=Ft(()=>this.readonly()&&!this.isEditable()?`true`:null);nativeReadonly=Ft(()=>(this.readonly()||this.disabled())&&this.isEditable()?``:null);nativeDisabled=Ft(()=>this.disabled()&&!this.softDisabled()?``:null);keydown=Ft(()=>{let t=new b;return this.isExpanded()?(t.on(`ArrowLeft`,e=>{this.keyboardEventRelay.set(e)},{preventDefault:this.popupType()!==`listbox`,ignoreRepeat:!1}).on(`ArrowRight`,e=>{this.keyboardEventRelay.set(e)},{preventDefault:this.popupType()!==`listbox`,ignoreRepeat:!1}).on(`ArrowUp`,e=>this.keyboardEventRelay.set(e),{ignoreRepeat:!1}).on(`ArrowDown`,e=>this.keyboardEventRelay.set(e),{ignoreRepeat:!1}).on(u.Shift,`ArrowUp`,e=>this.keyboardEventRelay.set(e),{ignoreRepeat:!1}).on(u.Shift,`ArrowDown`,e=>this.keyboardEventRelay.set(e),{ignoreRepeat:!1}).on(`Home`,e=>this.keyboardEventRelay.set(e)).on(`End`,e=>this.keyboardEventRelay.set(e)).on(`PageUp`,e=>this.keyboardEventRelay.set(e)).on(`PageDown`,e=>this.keyboardEventRelay.set(e)).on(`Escape`,()=>{this.inputs.alwaysExpanded()||this.inputs.expanded.set(!1)}),this.readonly()||t.on(`Enter`,e=>this.keyboardEventRelay.set(e)),!this.isEditable()&&!this.readonly()&&t.on(` `,e=>this.keyboardEventRelay.set(e)).on([u.Ctrl,u.Meta],`a`,e=>this.keyboardEventRelay.set(e)).on([u.Ctrl,u.Meta],`A`,e=>this.keyboardEventRelay.set(e)).on(u.Shift,`Home`,e=>this.keyboardEventRelay.set(e)).on(u.Shift,`End`,e=>this.keyboardEventRelay.set(e)).on(/^.$/,e=>{this.keyboardEventRelay.set(e)}),t):(this.readonly()||(t.on(`ArrowDown`,()=>this.inputs.expanded.set(!0)),this.isEditable()||(t.on(`Enter`,()=>this.inputs.expanded.set(!0)),t.on(` `,()=>this.inputs.expanded.set(!0)))),t)});click=Ft(()=>{let t=new d$1;return this.isEditable()||this.readonly()||t.on(()=>this.inputs.expanded.update(e=>!e)),t});constructor(t){this.inputs=t,this.value=t.value}onKeydown(t){this.inputs.disabled()||this.keydown().handle(t)}onClick(t){this.disabled()||this.click().handle(t)}onFocusin(){this.isFocused.set(!0)}onFocusout(){this.isFocused.set(!1),this.closePopupOnFocusout()}closePopupOnFocusout(){setTimeout(()=>{let t=this.isFocused(),e=!!this.inputs.popup()?.isFocused();!this.inputs.alwaysExpanded()&&!t&&!e&&this.inputs.expanded.set(!1)})}onInput(t){let e=A(t);!(e instanceof HTMLInputElement)||this.disabled()||this.readonly()||(this.inputs.expanded.set(!0),this.value.set(e.value),this.isDeleting.set(t instanceof InputEvent&&!!t.inputType.match(/^delete/)))}highlightEffect(){let t=this.value(),e=this.inlineSuggestion(),n=ie(()=>this.isDeleting()),i=ie(()=>this.isFocused()),l=this.isExpanded();if(!e||!i||!l||n||this.readonly())return;let r=this.element();e.toLowerCase().startsWith(t.toLowerCase())&&(r.value=t+e.slice(t.length),r.setSelectionRange(t.length,e.length))}keyboardEventRelayEffect(){let t=this.keyboardEventRelay();t!==void 0&&(this.isDeleting.set(!1),ie(()=>{let e=this.inputs.popup();if(this.isExpanded()){let n=new KeyboardEvent(t.type,t);e?.controlTarget()?.dispatchEvent(n)}}))}};var q=class{inputs;popupType=()=>this.inputs.popupType();controlTarget=()=>this.inputs.controlTarget();activeDescendant=()=>this.inputs.activeDescendant();popupId=()=>this.inputs.popupId();combobox=()=>this.inputs.combobox();isFocused=Ke(!1);constructor(t){this.inputs=t}onFocusin(){this.isFocused.set(!0)}onFocusout(t){let e=t.relatedTarget;this.controlTarget()?.contains(e)||(this.isFocused.set(!1),this.combobox()?.closePopupOnFocusout())}};var U=(()=>{class o extends M{_renderer=g(Ao);_elementRef=g(Hn);element=this._elementRef.nativeElement;_popup=Ke(void 0);disabled=NH(!1,{transform:pN});readonly=NH(!1,{transform:pN});softDisabled=NH(!0,{transform:pN});alwaysExpanded=NH(!1,{transform:pN});tabIndex=NH(void 0,{alias:`tabindex`,transform:F});expanded=AH(!1);value=AH(``);inlineSuggestion=NH(void 0);_pattern=new G(m(l({},this),{readonly:()=>this.readonly(),element:()=>this.element,expandable:()=>!0,popup:Ft(()=>this._popup()?._pattern)}));constructor(){super(),PH({write:()=>this._pattern.keyboardEventRelayEffect()}),PH(()=>{this.contentVisible.set(this._pattern.isExpanded())}),this._pattern.isEditable()&&(PH(()=>{this._renderer.setProperty(this.element,`value`,this.value())}),PH(()=>{this._pattern.highlightEffect()}))}ngOnInit(){this.alwaysExpanded()&&this.expanded.set(!0)}_registerPopup(e){this._popup.set(e)}_unregisterPopup(){this._popup.set(void 0)}static ɵfac=function(n){return new(n||o)};static ɵdir=ad({type:o,selectors:[[``,`ngCombobox`,``]],hostAttrs:[`role`,`combobox`],hostVars:10,hostBindings:function(n,i){n&1&&Gy(`keydown`,function(r){return i._pattern.onKeydown(r)})(`focusin`,function(){return i._pattern.onFocusin()})(`focusout`,function(){return i._pattern.onFocusout()})(`click`,function(r){return i._pattern.onClick(r)})(`input`,function(r){return i._pattern.onInput(r)}),n&2&&ky(`aria-autocomplete`,i._pattern.autocomplete())(`aria-disabled`,i._pattern.disabled())(`aria-readonly`,i._pattern.ariaReadonly())(`aria-expanded`,i._pattern.isExpanded())(`aria-activedescendant`,i._pattern.activeDescendant())(`aria-controls`,i._pattern.popupId())(`aria-haspopup`,i._pattern.popupType())(`tabindex`,i.disabled()&&!i.softDisabled()?-1:i.tabIndex()!==void 0?i.tabIndex():0)(`disabled`,i._pattern.nativeDisabled())(`readonly`,i._pattern.nativeReadonly())},inputs:{disabled:[1,`disabled`],readonly:[1,`readonly`],softDisabled:[1,`softDisabled`],alwaysExpanded:[1,`alwaysExpanded`],tabIndex:[1,`tabindex`,`tabIndex`],expanded:[1,`expanded`],value:[1,`value`],inlineSuggestion:[1,`inlineSuggestion`]},outputs:{expanded:`expandedChange`,value:`valueChange`},exportAs:[`ngCombobox`],features:[Dy]})}return o})();var Be=new E(`COMBOBOX_POPUP`);var ke=(()=>{class o{_deferredContent=g(U$1);combobox=NH.required();_widget=Ke(void 0);controlTarget=Ft(()=>this._widget()?.element);popupId=Ft(()=>this._widget()?.popupId());activeDescendant=Ft(()=>this._widget()?.activeDescendant());popupType=NH(`listbox`);_pattern=new q(m(l({},this),{combobox:Ft(()=>this.combobox()._pattern)}));ngOnInit(){this.combobox()._registerPopup(this),this._deferredContent.deferredContentAware.set(this.combobox())}ngOnDestroy(){this.combobox()._unregisterPopup()}_registerWidget(e){this._widget.set(e)}_unregisterWidget(){this._widget.set(void 0)}static ɵfac=function(n){return new(n||o)};static ɵdir=ad({type:o,selectors:[[`ng-template`,`ngComboboxPopup`,``]],inputs:{combobox:[1,`combobox`],popupType:[1,`popupType`]},exportAs:[`ngComboboxPopup`],features:[A_([{provide:Be,useExisting:o}]),Hb([U$1])]})}return o})();var Pe=(()=>{class o{_elementRef=g(Hn);_popup=g(Be);_idGenerator=g(W$1);element=this._elementRef.nativeElement;popupId=Ke(void 0);activeDescendant=NH(void 0);_observer;constructor(){let e=this.element;this._observer=new MutationObserver(n=>{for(let i of n)i.attributeName===`id`&&this.popupId.set(e.id)}),this._observer.observe(e,{attributes:!0,attributeFilter:[`id`]}),Ol(()=>{e.id||(e.id=this._idGenerator.getId(`ng-combobox-widget-`,!0)),this.popupId.set(e.id)})}ngOnInit(){this.popupId.set(this.element.id),this._popup._registerWidget(this)}ngOnDestroy(){this._observer?.disconnect(),this._popup._unregisterWidget()}onFocusin(){this._popup._pattern.onFocusin()}onFocusout(e){this._popup._pattern.onFocusout(e)}static ɵfac=function(n){return new(n||o)};static ɵdir=ad({type:o,selectors:[[``,`ngComboboxWidget`,``]],hostBindings:function(n,i){n&1&&Gy(`focusin`,function(){return i.onFocusin()})(`focusout`,function(r){return i.onFocusout(r)})},inputs:{activeDescendant:[1,`activeDescendant`]},exportAs:[`ngComboboxWidget`]})}return o})();var Se=new E(`LISTBOX`);var j=(()=>{class o{id=NH(g(W$1).getId(`ng-listbox-`,!0));_elementRef=g(Hn);element=this._elementRef.nativeElement;_collection=new y;textDirection=g(H).valueSignal.asReadonly();orientation=NH(`vertical`);multi=NH(!1,{transform:pN});wrap=NH(!0,{transform:pN});softDisabled=NH(!0,{transform:pN});focusMode=NH(`roving`);selectionMode=NH(`follow`);typeaheadDelay=NH(500);disabled=NH(!1,{transform:pN});readonly=NH(!1,{transform:pN});tabIndex=NH(void 0,{alias:`tabindex`,transform:F});value=AH([]);_pattern;activeDescendant;_orderedItemPatterns=Ft(()=>this._collection.orderedItems().map(e=>e._pattern));constructor(){let e=m(l({},this),{id:this.id,items:this._orderedItemPatterns,activeItem:Ke(void 0),textDirection:this.textDirection,element:()=>this._elementRef.nativeElement});this._pattern=new W(e),this.activeDescendant=Ft(()=>this._pattern.activeDescendant()),Ol(()=>{this._collection.startObserving(this.element)}),PH({write:()=>this._pattern.setDefaultStateEffect()}),PH({write:()=>{let n=e.items(),i=ie(()=>e.activeItem());i&&!n.some(l=>l===i)&&(this._pattern.listBehavior.unfocus(),this._pattern.setDefaultState())}}),PH({write:()=>{let n=e.items(),i=ie(()=>this.value());n&&i.some(l=>!n.some(r=>r.value()===l))&&this.value.set(i.filter(l=>n.some(r=>r.value()===l)))}})}ngOnDestroy(){this._collection.stopObserving()}scrollActiveItemIntoView(e={block:`nearest`}){this._pattern.inputs.activeItem()?.element()?.scrollIntoView(e)}gotoFirst(){this._pattern.listBehavior.first()}gotoIndex(e){let n=this._orderedItemPatterns(),i=n[Math.min(Math.max(e,0),n.length-1)];i&&this._pattern.listBehavior.goto(i)}static ɵfac=function(n){return new(n||o)};static ɵdir=ad({type:o,selectors:[[``,`ngListbox`,``]],hostAttrs:[`role`,`listbox`],hostVars:7,hostBindings:function(n,i){n&1&&Gy(`keydown`,function(r){return i._pattern.onKeydown(r)})(`click`,function(r){return i._pattern.onClick(r)})(`focusin`,function(){return i._pattern.onFocusIn()}),n&2&&ky(`id`,i.id())(`tabindex`,i.tabIndex()!==void 0?i.tabIndex():i._pattern.tabIndex())(`aria-readonly`,i._pattern.readonly())(`aria-disabled`,i._pattern.disabled())(`aria-orientation`,i._pattern.orientation())(`aria-multiselectable`,i._pattern.multi())(`aria-activedescendant`,i._pattern.activeDescendant())},inputs:{id:[1,`id`],orientation:[1,`orientation`],multi:[1,`multi`],wrap:[1,`wrap`],softDisabled:[1,`softDisabled`],focusMode:[1,`focusMode`],selectionMode:[1,`selectionMode`],typeaheadDelay:[1,`typeaheadDelay`],disabled:[1,`disabled`],readonly:[1,`readonly`],tabIndex:[1,`tabindex`,`tabIndex`],value:[1,`value`]},outputs:{value:`valueChange`},exportAs:[`ngListbox`],features:[A_([{provide:Se,useExisting:o}])]})}return o})();var X=(()=>{class o{element=g(Hn).nativeElement;active=Ft(()=>this._pattern.active());_listbox=g(Se);id=NH(g(W$1).getId(`ng-option-`,!0));_listboxPattern=Ft(()=>this._listbox._pattern);value=NH.required();disabled=NH(!1,{transform:pN});label=NH();selected=Ft(()=>this._pattern.selected());_pattern=new z(m(l({},this),{id:this.id,value:this.value,listbox:this._listboxPattern,element:()=>this.element,searchTerm:()=>this.label()??``}));ngOnInit(){this._listbox._collection.register(this)}ngOnDestroy(){this._listbox._collection.unregister(this)}static ɵfac=function(n){return new(n||o)};static ɵdir=ad({type:o,selectors:[[``,`ngOption`,``]],hostAttrs:[`role`,`option`],hostVars:5,hostBindings:function(n,i){n&2&&ky(`data-active`,i.active())(`id`,i._pattern.id())(`tabindex`,i._pattern.tabIndex())(`aria-selected`,i._pattern.selected())(`aria-disabled`,i._pattern.disabled())},inputs:{id:[1,`id`],value:[1,`value`],disabled:[1,`disabled`],label:[1,`label`]},exportAs:[`ngOption`]})}return o})();var Ne=(o,t)=>t.value;function Oe(o,t){if(o&1&&(Us(0,`span`,10),y_(1),fd()),o&2){let e=qS().$implicit;ZC(),nv(e.count)}}function Te(o,t){if(o&1&&(Us(0,`div`,8)(1,`span`,9),y_(2),fd(),OS(3,Oe,2,1,`span`,10),Op(),Us(4,`svg`,11),Py(5,`path`,12),fd()()),o&2){let e=t.$implicit;Fy(`value`,e.value)(`label`,e.label),ZC(2),nv(e.label),ZC(),kS(e.count!==void 0?3:-1)}}function Ae(o,t){if(o&1){let e=zS();Us(0,`div`,7,1),cv(`valueChange`,function(i){Ip(e);let l=qS();return T_(l.selection,i)||(l.selection=i),wp(i)}),Gy(`click`,function(i){Ip(e);return wp(qS().commitClick(i))})(`keydown.enter`,function(){Ip(e);return wp(qS().commit())}),LS(2,Te,6,4,`div`,8,Ne),fd()}if(o&2){let e=t_(1),n=qS();Fy(`tabindex`,-1)(`activeDescendant`,e.activeDescendant())(`disabled`,n.disabled()),av(`value`,n.selection),ky(`aria-label`,n.label()),ZC(2),jS(n.matches())}}function He(o,t){if(o&1&&(Us(0,`p`,6),y_(1),fd()),o&2){let e=qS();ZC(),nv(e.emptyLabel())}}var Fe=class o{label=NH.required();emptyLabel=NH.required();options=NH.required();value=AH(``);disabled=NH(!1);committed=MH();touch=MH();search=nr(Ke(``),t=>an(t,()=>this.disabled()));results=Ft$1(this.options,this.search().value,{keys:[`label`],ignoreLocation:!0,ignoreDiacritics:!0,threshold:.3});matches=Ft(()=>this.results().map(t=>t.item));selection=fa(()=>this.matches().some(t=>t.value===this.value())?[this.value()]:[]);combobox=xH(U);listbox=xH(j);optionDirectives=RH(X);constructor(){PH(()=>this.listbox()?.scrollActiveItemIntoView())}focus(t){this.combobox()?.element.focus(t)}commitClick(t){let e=t.target;e instanceof Node&&this.optionDirectives().some(n=>n.element.contains(e))&&this.commit()}commit(){if(this.disabled())return;let t=this.listbox()?.activeDescendant(),e=this.optionDirectives().find(i=>i.id()===t);if(!e)return;let n=e.value();this.selection.set([n]),this.value.set(n),this.focus(),this.touch.emit(),this.committed.emit(n)}static ɵfac=function(e){return new(e||o)};static ɵcmp=Fb({type:o,selectors:[[`app-filter-choice`]],viewQuery:function(e,n){e&1&&Ky(n.combobox,U,5)(n.listbox,j,5)(n.optionDirectives,X,5),e&2&&e_(3)},inputs:{label:[1,`label`],emptyLabel:[1,`emptyLabel`],options:[1,`options`],value:[1,`value`],disabled:[1,`disabled`]},outputs:{value:`valueChange`,committed:`committed`,touch:`touch`},decls:6,vars:8,consts:[[`combobox`,`ngCombobox`],[`listbox`,`ngListbox`],[1,`search`],[`name`,`search`],[`ngCombobox`,``,`type`,`text`,`autocomplete`,`off`,`spellcheck`,`false`,1,`input`,3,`valueChange`,`blur`,`placeholder`,`alwaysExpanded`,`softDisabled`,`disabled`,`value`],[`ngComboboxPopup`,``,3,`combobox`],[`role`,`status`,1,`empty`],[`ngListbox`,``,`ngComboboxWidget`,``,`focusMode`,`activedescendant`,`selectionMode`,`explicit`,1,`options`,3,`valueChange`,`click`,`keydown.enter`,`tabindex`,`activeDescendant`,`disabled`,`value`],[`ngOption`,``,1,`option`,3,`value`,`label`],[1,`option-label`],[1,`count`],[`viewBox`,`0 0 24 24`,`aria-hidden`,`true`,`focusable`,`false`,1,`check`],[`d`,`m5 12 4 4L19 6`]],template:function(e,n){if(e&1){let i=zS();Us(0,`div`,2),Py(1,`app-icon`,3),Us(2,`input`,4,0),cv(`valueChange`,function(r){return Ip(i),T_(n.search().value,r)||(n.search().value=r),wp(r)}),Gy(`blur`,function(){return n.touch.emit()}),fd()(),Iy(4,Ae,4,5,`ng-template`,5),OS(5,He,2,1,`p`,6)}if(e&2){let i=t_(3);ZC(2),Fy(`placeholder`,n.label())(`alwaysExpanded`,!0)(`softDisabled`,!1)(`disabled`,n.search().disabled()),av(`value`,n.search().value),ky(`aria-label`,n.label()),ZC(2),Fy(`combobox`,i),ZC(),kS(n.matches().length===0?5:-1)}},dependencies:[U,ke,Pe,j,X,r],styles:[`[_nghost-%COMP%]{display:grid;min-inline-size:0;gap:var(--%NS%space-1)}.search[_ngcontent-%COMP%]{display:grid;align-items:center;min-inline-size:0}.search[_ngcontent-%COMP%] app-icon[_ngcontent-%COMP%], .input[_ngcontent-%COMP%]{grid-area:1/1}.search[_ngcontent-%COMP%] app-icon[_ngcontent-%COMP%]{z-index:1;margin-inline-start:var(--%NS%space-2);pointer-events:none}.input[_ngcontent-%COMP%]{inline-size:100%;padding-inline-start:calc(1rem + var(--%NS%space-4))}.options[_ngcontent-%COMP%]{max-block-size:18rem;overflow-y:auto;overscroll-behavior:contain;min-inline-size:0}.option[_ngcontent-%COMP%]{display:flex;align-items:center;gap:var(--%NS%space-2);min-inline-size:0;min-block-size:2.25rem;padding:var(--%NS%space-1) var(--%NS%space-2);border-radius:var(--%NS%radius-xs);color:var(--%NS%color-ink);font-size:var(--%NS%text-sm);cursor:pointer}.option-label[_ngcontent-%COMP%]{flex:1;min-inline-size:0;overflow-wrap:anywhere}.count[_ngcontent-%COMP%]{color:var(--%NS%color-muted);font-variant-numeric:tabular-nums}.check[_ngcontent-%COMP%]{flex:none;inline-size:1rem;block-size:1rem;fill:none;stroke:currentColor;stroke-width:2;visibility:hidden}.option[aria-selected=true][_ngcontent-%COMP%]{background:var(--%NS%color-selection)}.option[aria-selected=true][_ngcontent-%COMP%] .check[_ngcontent-%COMP%]{visibility:visible}.option[data-active=true][_ngcontent-%COMP%]{outline:2px solid var(--%NS%color-focus);outline-offset:-2px}.empty[_ngcontent-%COMP%]{margin:0;color:var(--%NS%color-muted);font-size:var(--%NS%text-sm)}.empty[_ngcontent-%COMP%]:not(:empty){padding:var(--%NS%space-2)}@media(hover:hover){.option[_ngcontent-%COMP%]:hover{background:var(--%NS%color-surface-sunken)}}@media(pointer:coarse){.option[_ngcontent-%COMP%], .input[_ngcontent-%COMP%]{min-block-size:2.75rem}.input[_ngcontent-%COMP%]{font-size:var(--%NS%text-base)}}`]})};export{Fe as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Dn as g,o as A,ot as OD}from"./chunk-BAHiFuUo.js";import{
|
|
1
|
+
import{Dn as g,o as A,ot as OD}from"./chunk-BAHiFuUo.js";import{n as m}from"./chunk-Dv9sNWWK.js";import{bi as Va,gs as iy,ta as Ya}from"./chunk-D5qmP2Wu.js";var s=class e{http=g(OD);list(){return m(this.http.get(`/api/reminders`),iy,Va,`reminder.error`)}create(r,i){return m(this.http.put(`/api/reminders/${r}`,i),Ya,Va,`reminder.error`)}cancel(r){return m(this.http.post(`/api/reminders/${r}/cancel`,{}),Ya,Va,`reminder.error`)}static ɵfac=function(i){return new(i||e)};static ɵprov=A({token:e,factory:e.ɵfac,providedIn:`root`})};function T(e,r){if(e!==`reminder.error`)return e;switch(r){case`load`:return`reminder.loadError`;case`schedule`:return`reminder.scheduleUnconfirmed`;case`cancel`:return`reminder.cancelUnconfirmed`}}export{s as n,T 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,Ir as wp,It as Us,J as Ky,Jr as zS,K as Ke,Nr as vd,P as Hn,Rn as jS,Tn as fd,Vr as xH,Wn as kS,Wr as y_,X as LS,c as AH,ft as Ol,gn as ce$1,lt as OS,mr as qT,nt as NH,pr as qS,qn as ky,rn as Zw,rr as nv,tn as ZT,vt as Py,w as Fb,xn as e_,z as Ip}from"./chunk-BAHiFuUo.js";import{m as Ie,r as N}from"./main-F7D3L737.js";import"./chunk-BAe_07VM.js";import"./chunk-Dv9sNWWK.js";import{Zr as Ss}from"./chunk-D5qmP2Wu.js";import"./chunk-BzUDWIzm.js";import"./chunk-CReShp-B.js";import{d as nr,h as yn,n as an,o as gn,r as cn}from"./chunk-CSkyOfSg.js";import{t as g$1}from"./chunk-B56nz2lI.js";import{t as k}from"./chunk-D5MFwK9L.js";import{t as P}from"./chunk-niXXbm7H.js";import{t as w}from"./chunk-y0Vyi0HZ.js";import{t as o}from"./chunk-CwkCpxYQ.js";var te=[`operationStatus`];var ie=(i,t)=>t.id;function ne(i,t){if(i&1&&(Us(0,`p`,5),y_(1),fd()),i&2){let e=qS();ZC(),nv(e.i18n.t(t))}}function ae(i,t){if(i&1&&(Us(0,`p`,6,0),y_(2),fd()),i&2){let e=qS();ZC(2),vd(` `,e.i18n.t(t),` `)}}function se(i,t){if(i&1&&(Us(0,`div`,11)(1,`button`,13),y_(2),fd()()),i&2){let e=qS();ZC(),Fy(`disabled`,e.busy()||e.disabled()||e.loading()),ZC(),vd(` `,e.i18n.t(`passkey.add`),` `)}}function oe(i,t){if(i&1&&(Us(0,`p`,4),y_(1),fd()),i&2){let e=qS();ZC(),nv(e.i18n.t(`passkey.unavailable`))}}function re(i,t){if(i&1&&(Us(0,`p`,5),y_(1),fd()),i&2){let e=qS();ZC(),vd(` `,e.i18n.t(`configurationWorkspace.passwordInvalid`),` `)}}function de(i,t){if(i&1&&(Us(0,`p`,12),y_(1),fd()),i&2){let e=qS();ZC(),nv(e.i18n.t(`passkey.loading`))}}function le(i,t){if(i&1){let e=zS();Us(0,`div`,14)(1,`span`),y_(2),fd(),Us(3,`button`,15),Gy(`click`,function(){let y=Ip(e).$implicit;return wp(qS(2).remove(y))}),y_(4),fd()()}if(i&2){let e=t.$implicit,n=qS(2);ZC(2),nv(e.name),ZC(),Fy(`disabled`,n.busy()||n.disabled()),ky(`aria-label`,n.i18n.t(`passkey.remove`)+` `+e.name),ZC(),vd(` `,n.i18n.t(`passkey.remove`),` `)}}function ce(i,t){if(i&1&&(Us(0,`p`),y_(1),fd()),i&2){let e=qS(3);ZC(),nv(e.i18n.t(`passkey.empty`))}}function pe(i,t){if(i&1&&OS(0,ce,2,1,`p`),i&2)kS(qS(2).error()?-1:0)}function ue(i,t){if(i&1&&LS(0,le,5,4,`div`,14,ie,!1,pe,1,1),i&2)jS(qS().keys())}var ee=class i{busy=AH(!1);disabled=NH(!1);i18n=g(Ie);api=g(w);confirmation=g(P);injector=g(ce$1);operationStatus=xH(`operationStatus`,{read:Hn});keys=Ke([]);loading=Ke(!0);error=Ke(void 0);errorOperation=Ke(`load`);errorMessage=Ft(()=>o(this.error(),this.errorOperation()));status=Ke(void 0);values=Ke({name:``,password:``});fields=nr(this.values,t=>{an(t,()=>this.busy()||this.disabled()),gn(t.name),cn(t.name,80),gn(t.password),cn(t.password,Ss.maxLength)});constructor(){Ol(()=>{this.reload()})}async reload(){this.loading.set(!0);let t=await this.api.list();t.success?this.keys.set(t.result):(this.errorOperation.set(`load`),this.error.set(t.code)),this.loading.set(!1)}async add(t){if(t.preventDefault(),!(this.busy()||this.disabled()||this.loading())){if(this.fields().invalid()){this.fields().markAsTouched(),this.fields().errorSummary()[0]?.fieldTree().focusBoundControl();return}this.busy.set(!0),this.error.set(void 0),this.status.set(void 0);try{let e=await this.api.register(this.values());e.success?(this.status.set(`passkey.added`),await this.reload(),Ol(()=>this.operationStatus()?.nativeElement.focus(),{injector:this.injector})):(this.errorOperation.set(`add`),this.error.set(e.code))}finally{this.values.set({name:``,password:``}),this.fields().reset(),t.target instanceof HTMLFormElement&&t.target.reset(),this.busy.set(!1)}}}async remove(t){if(!(this.busy()||this.disabled())){if(this.fields.password().invalid()){this.fields.password().markAsTouched(),this.fields.password().focusBoundControl();return}if(await this.confirmation.request(this.i18n.t(`passkey.remove_confirm`),{variant:`danger`})){this.busy.set(!0),this.error.set(void 0),this.status.set(void 0);try{let e=await this.api.remove(t.id,{password:this.values().password});e.success?(this.status.set(`passkey.removed`),await this.reload(),Ol(()=>this.operationStatus()?.nativeElement.focus(),{injector:this.injector})):(this.errorOperation.set(`remove`),this.error.set(e.code))}finally{this.values.update(e=>m(l({},e),{password:``})),this.busy.set(!1)}}}}canDeactivate(){return this.busy()?!1:!this.fields().dirty()||this.confirmation.request(this.i18n.t(`configurationWorkspace.unsaved`))}beforeUnload(t){(this.busy()||this.fields().dirty())&&t.preventDefault()}static ɵfac=function(e){return new(e||i)};static ɵcmp=Fb({type:i,selectors:[[`app-account-passkeys`]],viewQuery:function(e,n){e&1&&Ky(n.operationStatus,te,5,Hn),e&2&&e_()},hostBindings:function(e,n){e&1&&Gy(`beforeunload`,function(c){return n.beforeUnload(c)},Zw)},inputs:{busy:[1,`busy`],disabled:[1,`disabled`]},outputs:{busy:`busyChange`},decls:22,vars:12,consts:[[`operationStatus`,``],[`aria-labelledby`,`passkeys-title`,1,`passkeys`],[`id`,`passkeys-title`],[1,`muted`],[`appNotice`,``,`variant`,`info`],[`appNotice`,``,`variant`,`danger`,`role`,`alert`],[`appNotice`,``,`variant`,`success`,`role`,`status`,`tabindex`,`-1`],[`novalidate`,``,3,`submit`],[1,`field`],[`autocomplete`,`off`,1,`input`,3,`formField`],[`type`,`password`,`autocomplete`,`current-password`,1,`input`,3,`formField`],[1,`spacer-x-3`],[`role`,`status`],[`appButton`,``,`type`,`submit`,3,`disabled`],[1,`key`,`spacer-x-3`],[`appButton`,``,`type`,`button`,3,`click`,`disabled`]],template:function(e,n){if(e&1&&(Us(0,`section`,1)(1,`app-page-header`)(2,`h2`,2),y_(3),fd(),Us(4,`p`,3),y_(5),fd()(),Us(6,`p`,4),y_(7),fd(),OS(8,ne,2,1,`p`,5),OS(9,ae,3,1,`p`,6),Us(10,`form`,7),Gy(`submit`,function(c){return n.add(c)}),Us(11,`label`,8),y_(12),Py(13,`input`,9),qT(),fd(),Us(14,`label`,8),y_(15),Py(16,`input`,10),qT(),fd(),OS(17,se,3,2,`div`,11)(18,oe,2,1,`p`,4),fd(),OS(19,re,2,1,`p`,5),OS(20,de,2,1,`p`,12)(21,ue,3,1),fd()),e&2){let y,c;ZC(3),nv(n.i18n.t(`passkey.title`)),ZC(2),nv(n.i18n.t(`passkey.description`)),ZC(2),nv(n.i18n.t(`passkey.password_notice`)),ZC(),kS((y=n.errorMessage())?8:-1,y),ZC(),kS((c=n.status())?9:-1,c),ZC(3),nv(n.i18n.t(`passkey.name`)),ZC(),Fy(`formField`,n.fields.name),ZT(),ZC(2),nv(n.i18n.t(`passkey.password`)),ZC(),Fy(`formField`,n.fields.password),ZT(),ZC(),kS(n.api.supported?17:18),ZC(2),kS(n.fields().touched()&&n.fields().invalid()?19:-1),ZC(),kS(n.loading()?20:21)}},dependencies:[N,k,yn,g$1],styles:[`.passkeys[_ngcontent-%COMP%], form[_ngcontent-%COMP%]{display:grid;gap:var(--%NS%space-4)}.passkeys[_ngcontent-%COMP%]{padding:var(--%NS%space-6) var(--%NS%page-x)}.key[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between}.key[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{overflow-wrap:anywhere;min-width:0}`]})};export{ee as AccountPasskeys};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$t as ZC,Dn as g,Gn as k_,It as Us,Tn as fd,Wr as y_,nt as NH,qn as ky,rr as nv,vt as Py,w as Fb}from"./chunk-BAHiFuUo.js";import{i as r,m as Ie}from"./main-
|
|
1
|
+
import{$t as ZC,Dn as g,Gn as k_,It as Us,Tn as fd,Wr as y_,nt as NH,qn as ky,rr as nv,vt as Py,w as Fb}from"./chunk-BAHiFuUo.js";import{i as r,m as Ie}from"./main-F7D3L737.js";var v=t=>({filter:t});var h=class t{i18n=g(Ie);label=NH.required();static ɵfac=function(e){return new(e||t)};static ɵcmp=Fb({type:t,selectors:[[`button`,`appFilterChip`,``]],hostAttrs:[`type`,`button`],hostVars:3,hostBindings:function(e,n){e&2&&ky(`aria-label`,n.i18n.tf(`listControls.removeFilter`,k_(1,v,n.label())))},inputs:{label:[1,`label`]},decls:3,vars:1,consts:[[`name`,`close`]],template:function(e,n){e&1&&(Us(0,`span`),y_(1),fd(),Py(2,`app-icon`,0)),e&2&&(ZC(),nv(n.label()))},dependencies:[r],styles:[`[_nghost-%COMP%]{display:inline-flex;align-items:center;gap:var(--%NS%space-2);min-block-size:var(--%NS%control-height);max-inline-size:100%;padding:var(--%NS%space-1) var(--%NS%space-2);border:1px solid var(--%NS%color-line-strong);border-radius:var(--%NS%radius-sm);background:var(--%NS%color-surface-raised);color:var(--%NS%color-ink);font:inherit;font-size:var(--%NS%text-sm);text-align:start;cursor:pointer}span[_ngcontent-%COMP%]{overflow-wrap:anywhere;min-inline-size:0}app-icon[_ngcontent-%COMP%]{flex:none}`]})};export{h as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-BAHiFuUo.js";import"./main-F7D3L737.js";import"./chunk-BAe_07VM.js";import"./chunk-Dv9sNWWK.js";import"./chunk-D5qmP2Wu.js";import"./chunk-BzUDWIzm.js";import"./chunk-CReShp-B.js";import"./chunk-CfwFJLFh.js";import"./chunk-CSkyOfSg.js";import"./chunk-B56nz2lI.js";import"./chunk-D5MFwK9L.js";import"./chunk-niXXbm7H.js";import"./chunk-CfcCxe_k.js";import{t as ut}from"./chunk-BQ7WWH4L.js";export{ut as CatalogEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$t as ZC,A as Gy,Dn as g,Ir as wp,It as Us,Jr as zS,K as Ke,Nr as vd,Tn as fd,Wn as kS,Wr as y_,ft as Ol,lt as OS,pr as qS,rn as Zw,rr as nv,w as Fb,z as Ip}from"./chunk-BAHiFuUo.js";import{T as ue,m as Ie,r as N,v as Dt}from"./main-
|
|
1
|
+
import{$t as ZC,A as Gy,Dn as g,Ir as wp,It as Us,Jr as zS,K as Ke,Nr as vd,Tn as fd,Wn as kS,Wr as y_,ft as Ol,lt as OS,pr as qS,rn as Zw,rr as nv,w as Fb,z as Ip}from"./chunk-BAHiFuUo.js";import{T as ue,m as Ie,r as N,v as Dt}from"./main-F7D3L737.js";import"./chunk-BAe_07VM.js";import"./chunk-Dv9sNWWK.js";import"./chunk-D5qmP2Wu.js";import{t as E$1}from"./chunk-DsaNNeZe.js";import{t as k}from"./chunk-D5MFwK9L.js";function E(t,a){if(t&1&&(Us(0,`p`,2),y_(1),fd()),t&2){let e=qS();ZC(),nv(e.i18n.t(`backOfficeShell.signingOut`))}}function M(t,a){if(t&1){let e=zS();Us(0,`p`,3),y_(1),fd(),Us(2,`div`,4)(3,`button`,5),Gy(`click`,function(){Ip(e);return wp(qS().retry())}),y_(4),fd(),Us(5,`a`,6),y_(6),fd()()}if(t&2){let e=qS();ZC(),nv(e.i18n.t(`backOfficeShell.signOutError`)),ZC(3),vd(` `,e.i18n.t(`backOffice.dashboard.retry`),` `),ZC(2),nv(e.i18n.t(`backOfficeShell.openLogin`))}}var B=class t{i18n=g(Ie);auth=g(E$1);router=g(ue);pending=Ke(!0);failed=Ke(!1);constructor(){Ol(()=>{this.signOut()})}canDeactivate(){return!this.pending()}preventPendingUnload(a){this.pending()&&a.preventDefault()}async retry(){this.pending()||await this.signOut()}async signOut(){this.pending.set(!0),this.failed.set(!1);try{this.failed.set(!await this.auth.signOut())}catch{this.failed.set(!0)}this.pending.set(!1),this.failed()||await this.router.navigateByUrl(`/login`,{replaceUrl:!0})}static ɵfac=function(e){return new(e||t)};static ɵcmp=Fb({type:t,selectors:[[`app-sign-out`]],hostAttrs:[1,`page-container`],hostBindings:function(e,o){e&1&&Gy(`beforeunload`,function(D){return o.preventPendingUnload(D)},Zw)},decls:5,vars:2,consts:[[`aria-labelledby`,`sign-out-title`,1,`notice-flow`],[`id`,`sign-out-title`],[`role`,`status`],[`appNotice`,``,`variant`,`danger`,`role`,`alert`],[1,`actions`],[`appButton`,``,`type`,`button`,3,`click`],[`appLinkButton`,``,`routerLink`,`/login`]],template:function(e,o){e&1&&(Us(0,`section`,0)(1,`h1`,1),y_(2),fd(),OS(3,E,2,1,`p`,2)(4,M,7,3),fd()),e&2&&(ZC(2),nv(o.i18n.t(`backOffice.signOut`)),ZC(),kS(o.pending()?3:o.failed()?4:-1))},dependencies:[N,k,Dt],styles:[`section[_ngcontent-%COMP%]{padding:var(--%NS%page-header-y) var(--%NS%page-x)}h1[_ngcontent-%COMP%]{font-size:var(--%NS%text-2xl)}p[_ngcontent-%COMP%]{margin-block-start:var(--%NS%space-4)}.actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:var(--%NS%space-3);margin-block-start:var(--%NS%space-4)}`]})};export{B as SignOut};
|
|
@@ -1 +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,K as Ke,Nr as vd,Tn as fd,Wn as kS,Wr as y_,ft as Ol,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{T as ue,m as Ie,r as N,v as Dt,y as G}from"./main-
|
|
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,K as Ke,Nr as vd,Tn as fd,Wn as kS,Wr as y_,ft as Ol,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{T as ue,m as Ie,r as N,v as Dt,y as G}from"./main-F7D3L737.js";import"./chunk-BAe_07VM.js";import"./chunk-Dv9sNWWK.js";import{or as OA}from"./chunk-D5qmP2Wu.js";import"./chunk-DjewtV43.js";import"./chunk-BzUDWIzm.js";import"./chunk-CczD0yXn.js";import"./chunk-CReShp-B.js";import{d as nr,f as or,h as yn,o as gn,r as cn,u as mn}from"./chunk-CSkyOfSg.js";import{t as g$1}from"./chunk-B56nz2lI.js";import{t as k}from"./chunk-D5MFwK9L.js";import{t as P}from"./chunk-niXXbm7H.js";import"./chunk-cTGENC4T2.js";import"./chunk-CP-AnFGa2.js";import"./chunk-Bsy3r41y2.js";import{t as f}from"./chunk-POMKwNf_.js";import{t as n}from"./chunk-CkWd-yMn.js";import{t as ge}from"./chunk-D_vyhgGx.js";function Q(r,t){if(r&1&&(Us(0,`p`,4),y_(1),fd()),r&2){let e=qS();ZC(),nv(e.i18n.t(t))}}function X(r,t){if(r&1&&(Us(0,`p`,5),y_(1),fd()),r&2){let e=qS();ZC(),nv(e.i18n.t(`role.loading`))}}function Y(r,t){if(r&1){let e=zS();Us(0,`form`,7),Gy(`submit`,function(s){Ip(e);return wp(qS().save(s))}),Us(1,`div`,8)(2,`label`,9),y_(3),Py(4,`input`,10),qT(),fd()(),Us(5,`div`,11)(6,`app-permission-picker`,12),Gy(`selectionChange`,function(s){Ip(e);return wp(qS().changePermission(s))}),fd()(),Us(7,`div`,13)(8,`button`,14),y_(9),fd(),Us(10,`a`,15),y_(11),fd()()()}if(r&2){let e=qS();ZC(3),nv(e.i18n.t(`role.name`)),ZC(),Fy(`formField`,e.roleForm.name),ZT(),ZC(2),Fy(`options`,e.permissionOptions())(`selectedCodes`,e.roleForm.permissions().value())(`disabled`,e.saving()),ZC(2),Fy(`disabled`,e.saving()),ZC(),vd(` `,e.i18n.t(`role.save`)),ZC(2),nv(e.i18n.t(`role.cancel`))}}var J=class r{i18n=g(Ie);api=g(n);route=g(G);router=g(ue);confirmation=g(P);roleId=this.route.snapshot.paramMap.get(`roleId`);createRequestId=crypto.randomUUID();version=Ke(void 0);editing=this.roleId!==null;model=Ke({name:``,permissions:[]});roleForm=nr(this.model,t=>{gn(t.name),mn(t.name,/\S/),cn(t.name,80)});permissionOptions=Ft(()=>OA.map(t=>({code:t,description:this.i18n.t(`permission.${t}`)})));loading=Ke(this.editing);saving=Ke(!1);error=Ke(void 0);breadcrumbs=Ft(()=>[{label:this.i18n.t(`team.title`),path:`/team`},{label:this.i18n.t(`role.title`),path:`/team/roles`}]);constructor(){Ol(()=>{this.roleId&&this.load(this.roleId)})}title(){return this.i18n.t(this.editing?`role.editTitle`:`role.createTitle`)}changePermission(t){let e=OA.find(i=>i===t.code);e!==void 0&&(this.roleForm.permissions().markAsDirty(),this.model.update(i=>m(l({},i),{permissions:t.selected?[...i.permissions,e]:i.permissions.filter(s=>s!==e)})))}save(t){if(t.preventDefault(),this.saving()||this.roleForm().invalid()){this.roleForm().markAsTouched();return}or(this.roleForm,async()=>{this.saving.set(!0),this.error.set(void 0);try{let e=this.roleId?await this.api.update(this.roleId,m(l({},this.model()),{expectedVersion:this.version()??0})):await this.api.create(m(l({},this.model()),{requestId:this.createRequestId}));if(!e.success){this.error.set(e.code);return}this.roleForm().reset(this.model()),this.saving.set(!1),await this.router.navigate([`/team/roles`],{state:{roleNotice:this.editing?`role.updated`:`role.created`}})}catch{this.error.set(`role.error`)}finally{this.saving.set(!1)}})}canDeactivate(){return this.saving()?!1:!this.roleForm().dirty()||this.confirmation.request(this.i18n.t(`role.unsavedChanges`))}beforeUnload(t){(this.saving()||this.roleForm().dirty())&&t.preventDefault()}async load(t){try{let e=await this.api.get(t);if(!e.success){this.error.set(e.code);return}this.version.set(e.result.version),this.roleForm().reset({name:e.result.name,permissions:e.result.permissions})}catch{this.error.set(`role.error`)}finally{this.loading.set(!1)}}static ɵfac=function(e){return new(e||r)};static ɵcmp=Fb({type:r,selectors:[[`app-role-editor`]],hostAttrs:[1,`page-container`],hostBindings:function(e,i){e&1&&Gy(`beforeunload`,function(u){return i.beforeUnload(u)},Zw)},decls:10,vars:7,consts:[[`aria-labelledby`,`role-editor-title`,1,`detail-page`,`form-page`],[`layout`,`stacked`],[`pageBack`,``,3,`label`,`items`,`current`],[`id`,`role-editor-title`],[`appNotice`,``,`variant`,`danger`,`role`,`alert`],[`role`,`status`],[`novalidate`,``],[`novalidate`,``,3,`submit`],[1,`ds-panel`,`form-panel`],[`for`,`role-name`,1,`field`],[`id`,`role-name`,1,`input`,3,`formField`],[1,`ds-panel`,`form-panel`,`permissions`],[3,`selectionChange`,`options`,`selectedCodes`,`disabled`],[1,`spacer-x-2`],[`appButton`,``,`variant`,`primary`,`type`,`submit`,3,`disabled`],[`appLinkButton`,``,`routerLink`,`/team/roles`]],template:function(e,i){if(e&1&&(Us(0,`section`,0)(1,`app-page-header`,1),Py(2,`app-breadcrumbs`,2),Us(3,`h1`,3),y_(4),fd(),Us(5,`p`),y_(6),fd()(),OS(7,Q,2,1,`p`,4),OS(8,X,2,1,`p`,5)(9,Y,12,8,`form`,6),fd()),e&2){let s;ZC(2),Fy(`label`,i.i18n.t(`backOfficeShell.breadcrumb`))(`items`,i.breadcrumbs())(`current`,i.title()),ZC(2),nv(i.title()),ZC(2),nv(i.i18n.t(`role.editorIntro`)),ZC(),kS((s=i.error())?7:-1,s),ZC(),kS(i.loading()?8:9)}},dependencies:[f,N,yn,k,g$1,ge,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-panel[_ngcontent-%COMP%] + .form-panel[_ngcontent-%COMP%], .spacer-x-2[_ngcontent-%COMP%]{margin-block-start:var(--%NS%space-4)}`]})};export{J as RoleEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$t as ZC,A as Gy,D as Fy,Dn as g,E as Ft,Gr as yd,Ir as wp,It as Us,Jr as zS,K as Ke,M as H_,Nr as vd,Tn as fd,Wn as kS,Wr as y_,Zn as md,dr as pe,ft as Ol,lt as OS,pr as qS,rn as Zw,rr as nv,tt as Mn,ut as O_,vt as Py,w as Fb,z as Ip,zn as j_}from"./chunk-BAHiFuUo.js";import{m as Ie,o as U,r as N,v as Dt,y as G}from"./main-
|
|
1
|
+
import{$t as ZC,A as Gy,D as Fy,Dn as g,E as Ft,Gr as yd,Ir as wp,It as Us,Jr as zS,K as Ke,M as H_,Nr as vd,Tn as fd,Wn as kS,Wr as y_,Zn as md,dr as pe,ft as Ol,lt as OS,pr as qS,rn as Zw,rr as nv,tt as Mn,ut as O_,vt as Py,w as Fb,z as Ip,zn as j_}from"./chunk-BAHiFuUo.js";import{m as Ie,o as U,r as N,v as Dt,y as G}from"./main-F7D3L737.js";import"./chunk-BAe_07VM.js";import"./chunk-Dv9sNWWK.js";import"./chunk-D5qmP2Wu.js";import{t as d}from"./chunk-CfwFJLFh.js";import{t as g$1}from"./chunk-B56nz2lI.js";import{t as k}from"./chunk-D5MFwK9L.js";import{t as p}from"./chunk-BHEFFEGN.js";import{t as g$2}from"./chunk-CPHUl7N2.js";import{t as i}from"./chunk-CLHj5Ycx2.js";import{i as R,n as E,s as W}from"./chunk-Dns8uMf32.js";import{t as f}from"./chunk-DOCau85G2.js";var Z=()=>({dateStyle:`long`,timeStyle:`short`});function $(t,i){if(t&1&&(Us(0,`p`),y_(1),fd()),t&2){let e=qS();ZC(),nv(e.request.subject)}}function ee(t,i){t&1&&OS(0,$,2,1,`p`),t&2&&kS(i.request.kind===`email`?0:-1)}function te(t,i){if(t&1&&(Us(0,`span`,7),y_(1),fd()),t&2){let e=qS(),n=qS();ZC(),nv(n.i18n.t(n.status(e)))}}function ie(t,i){t&1&&OS(0,te,2,1,`span`,7),t&2&&kS(i.request.kind===`email`?0:-1)}function ne(t,i){if(t&1&&(Us(0,`p`,5),y_(1),fd()),t&2){let e=qS();ZC(),nv(e.i18n.t(`integrations.loading`))}}function ae(t,i){if(t&1&&(Us(0,`p`,6),y_(1),fd()),t&2){let e=qS();ZC(),nv(e.i18n.t(i))}}function oe(t,i){if(t&1){let e=zS();Us(0,`p`,11),y_(1),fd(),Us(2,`div`)(3,`button`,12),Gy(`click`,function(){Ip(e);return wp(qS(3).retry())}),y_(4),fd()()}if(t&2){let e=qS(2),n=qS();ZC(),nv(n.i18n.t(`integrationRetry.info`)),ZC(2),Fy(`disabled`,n.busy()||!n.simulation()||e.request.expectedMode!==`simulation`),ZC(),vd(` `,n.i18n.t(`emails.retry`),` `)}}function re(t,i){if(t&1&&(Us(0,`p`,8),y_(1),fd(),Us(2,`dl`)(3,`dt`),y_(4),fd(),Us(5,`dd`),y_(6),fd(),Us(7,`dt`),y_(8),fd(),Us(9,`dd`),y_(10),fd(),Us(11,`dt`),y_(12),fd(),Us(13,`dd`),y_(14),j_(15,`localizedDate`),fd(),Us(16,`dt`),y_(17),fd(),Us(18,`dd`),y_(19),fd()(),Us(20,`article`,9),Py(21,`app-document-text-view`,10),fd(),OS(22,oe,5,3)),t&2){let e=qS(),n=qS();ZC(),vd(` `,n.i18n.t(e.receipt?.mode===`simulation`?`emails.simulated`:`emailsWorkspace.receiptHint`),` `),ZC(3),nv(n.i18n.t(`emails.recipient`)),ZC(2),nv(e.request.recipient),ZC(2),nv(n.i18n.t(`emails.reference`)),ZC(2),nv(e.request.reference),ZC(2),nv(n.i18n.t(`emailsWorkspace.date`)),ZC(2),vd(` `,H_(15,12,e.createdAt,n.i18n.language(),O_(16,Z)),` `),ZC(3),nv(n.i18n.t(`emailsWorkspace.requestId`)),ZC(2),nv(e.request.requestId),ZC(2),Fy(`source`,e.request.body)(`presentation`,n.bodyPresentation(e.request.bodyFormat)),ZC(),kS(e.receipt===null?22:-1)}}function le(t,i){t&1&&OS(0,re,23,17),t&2&&kS(i.request.kind===`email`?0:-1)}function de(t,i){if(t&1){let e=zS();Us(0,`div`)(1,`button`,13),Gy(`click`,function(){Ip(e);return wp(qS().load())}),y_(2),fd()()}if(t&2){let e=qS();ZC(2),nv(e.i18n.t(`integrations.reload`))}}var Y=class t{bodyPresentation=i;i18n=g(Ie);api=g(f);route=g(G);destroyRef=g(pe);pendingTasks=g(Mn);operation=Ke(void 0);title=Ft(()=>{let i=this.operation()?.request;return i?.kind===`email`?i.reference:this.i18n.t(`emailsWorkspace.message`)});loading=Ke(!0);busy=Ke(!1);error=Ke(void 0);simulation=Ke(!1);status=W;backQuery(){return R(E(this.route.snapshot.queryParamMap))}generation=0;constructor(){Ol(()=>this.route.paramMap.pipe(U(this.destroyRef)).subscribe(()=>{this.pendingTasks.run(()=>this.load())}))}async load(){let i=++this.generation;this.loading.set(!0),this.error.set(void 0),this.operation.set(void 0);try{let[e,n]=await Promise.all([this.api.list(`email`),this.api.status()]);if(this.destroyRef.destroyed||i!==this.generation)return;this.simulation.set(n.find(u=>u.kind===`email`)?.mode===`simulation`);let p=e.find(u=>u.id===this.route.snapshot.paramMap.get(`operationId`)&&u.request.kind===`email`);p?this.operation.set(p):this.error.set(`emailsWorkspace.messageUnavailable`)}catch{!this.destroyRef.destroyed&&i===this.generation&&this.error.set(`emailsWorkspace.loadError`)}finally{!this.destroyRef.destroyed&&i===this.generation&&this.loading.set(!1)}}async retry(){let i=this.operation();if(!(!i||i.receipt!==null||i.request.kind!==`email`||i.request.expectedMode!==`simulation`||!this.simulation()||this.busy())){this.busy.set(!0),this.error.set(void 0);try{let e=await this.api.submit(i.request);e.success?this.operation.set(e.result):this.error.set(e.code)}catch{this.error.set(`emails.error`)}finally{this.busy.set(!1)}}}canDeactivate(){return!this.busy()}preventUnload(i){this.busy()&&i.preventDefault()}static ɵfac=function(e){return new(e||t)};static ɵcmp=Fb({type:t,selectors:[[`app-email-detail`]],hostAttrs:[1,`page-container`],hostBindings:function(e,n){e&1&&Gy(`beforeunload`,function(u){return n.preventUnload(u)},Zw)},decls:13,vars:8,consts:[[`aria-labelledby`,`email-detail-title`,1,`detail-page`,`form-page`],[`layout`,`stacked`],[`pageBack`,``,`routerLink`,`/emails/messages`,3,`queryParams`],[`id`,`email-detail-title`],[`pageBadges`,``],[`role`,`status`],[`appNotice`,``,`variant`,`danger`,`role`,`alert`],[`appBadge`,``],[`appNotice`,``],[`aria-labelledby`,`email-detail-title`],[3,`source`,`presentation`],[1,`muted`],[`appButton`,``,`type`,`button`,3,`click`,`disabled`],[`appButton`,``,`type`,`button`,3,`click`]],template:function(e,n){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,ee,1,1),md(7,4),OS(8,ie,1,1),yd(),fd(),OS(9,ne,2,1,`p`,5),OS(10,ae,2,1,`p`,6),OS(11,le,1,1)(12,de,3,1,`div`),fd()),e&2){let p,u,b,S;ZC(2),Fy(`queryParams`,n.backQuery()),ZC(),nv(n.i18n.t(`emailsWorkspace.back`)),ZC(2),nv(n.title()),ZC(),kS((p=n.operation())?6:-1,p),ZC(2),kS((u=n.operation())?8:-1,u),ZC(),kS(n.loading()?9:-1),ZC(),kS((b=n.error())?10:-1,b),ZC(),kS((S=n.operation())?11:n.loading()?-1:12,S)}},dependencies:[d,N,g$2,k,g$1,Dt,p],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}}.task-form[_ngcontent-%COMP%]{display:grid;gap:var(--%NS%space-6);inline-size:100%}.field[_ngcontent-%COMP%]{display:grid;gap:var(--%NS%space-2);min-inline-size:0}.fields[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--%NS%space-4)}.actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:var(--%NS%space-3);align-items:center}.muted[_ngcontent-%COMP%]{color:var(--%NS%color-muted)}.field-error[_ngcontent-%COMP%]{color:var(--%NS%color-danger);font-size:var(--%NS%text-sm)}.field-error[_ngcontent-%COMP%]:empty{display:none}.message-body[_ngcontent-%COMP%]{white-space:pre-wrap;overflow-wrap:anywhere}.message-preview[_ngcontent-%COMP%]{display:grid;gap:var(--%NS%space-3);padding:var(--%NS%space-4);background:var(--%NS%color-surface-raised)}dl[_ngcontent-%COMP%]{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:var(--%NS%space-3) var(--%NS%space-5)}dt[_ngcontent-%COMP%]{color:var(--%NS%color-muted)}dd[_ngcontent-%COMP%]{margin:0;overflow-wrap:anywhere}fieldset[_ngcontent-%COMP%]{border:0;padding:0;margin:0;min-inline-size:0}legend[_ngcontent-%COMP%]{padding:0;margin-block-end:var(--%NS%space-4);font-weight:700}@media(max-width:40rem){.fields[_ngcontent-%COMP%]{grid-template-columns:1fr}dl[_ngcontent-%COMP%]{grid-template-columns:1fr;gap:var(--%NS%space-2)}}article[_ngcontent-%COMP%]{display:grid;gap:var(--%NS%space-4)}`]})};export{Y as EmailDetail};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$t as ZC,A as Gy,D as Fy,Dn as g,E as Ft,Fr as we,H as JD,Hn as kE,Ir as wp,It as Us,J as Ky,Jr as zS,Jt as Xy,K as Ke,Kt as XS,Lt as Uy,Nr as vd,On as hN,P as Hn,Rn as jS,Tn as fd,U as JS,Vn as jt,Vt as Vi,Wn as kS,Wr as y_,X as LS,ar as oD,dr as pe,h as CE,jr as ue,l as A_,ln as ad,lr as pN,lt as OS,mr as qT,pn as bE,pr as qS,qn as ky,rr as nv,st as OE,tn as ZT,u as Ao,un as ae,vr as qy,vt as Py,w as Fb,wt as RH,xn as e_,yt as Qa,z as Ip}from"./chunk-BAHiFuUo.js";import{i as r,m as Ie}from"./main-AJD2LGCE.js";import{_ as te,f as b,h as pi,i as H,l as W$1,m as is,o as Po,s as St,v as xe}from"./chunk-BzUDWIzm.js";import{t as A}from"./chunk-CczD0yXn.js";import{C as vn,_ as je,g as bn,m as Z,u as Lt}from"./chunk-CReShp-B.js";var w=class{_multiple;_emitChanges;compareWith;_selection=new Set;_deselectedToEmit=[];_selectedToEmit=[];_selected=null;get selected(){return this._selected||(this._selected=Array.from(this._selection.values())),this._selected}changed=new we;bulk={select:t=>this._select(t),deselect:t=>this._deselect(t),setSelection:t=>this._setSelection(t)};constructor(t=!1,e,i=!0,n){this._multiple=t,this._emitChanges=i,this.compareWith=n,e&&e.length&&(t?e.forEach(s=>this._markSelected(s)):this._markSelected(e[0]),this._selectedToEmit.length=0)}select(...t){return this._select(t)}deselect(...t){return this._deselect(t)}setSelection(...t){return this._setSelection(t)}toggle(t){return this.isSelected(t)?this.deselect(t):this.select(t)}clear(t=!0){this._unmarkAll();let e=this._hasQueuedChanges();return t&&this._emitChangeEvent(),e}isSelected(t){return this._selection.has(this._getConcreteValue(t))}isEmpty(){return this._selection.size===0}hasValue(){return!this.isEmpty()}sort(t){this._multiple&&this.selected&&this._selected.sort(t)}isMultipleSelection(){return this._multiple}_select(t){this._verifyValueAssignment(t),t.forEach(i=>this._markSelected(i));let e=this._hasQueuedChanges();return this._emitChangeEvent(),e}_deselect(t){this._verifyValueAssignment(t),t.forEach(i=>this._unmarkSelected(i));let e=this._hasQueuedChanges();return this._emitChangeEvent(),e}_setSelection(t){this._verifyValueAssignment(t);let e=this.selected,i=new Set(t.map(s=>this._getConcreteValue(s)));t.forEach(s=>this._markSelected(s)),e.filter(s=>!i.has(this._getConcreteValue(s,i))).forEach(s=>this._unmarkSelected(s));let n=this._hasQueuedChanges();return this._emitChangeEvent(),n}_emitChangeEvent(){this._selected=null,(this._selectedToEmit.length||this._deselectedToEmit.length)&&(this.changed.next({source:this,added:this._selectedToEmit,removed:this._deselectedToEmit}),this._deselectedToEmit=[],this._selectedToEmit=[])}_markSelected(t){t=this._getConcreteValue(t),this.isSelected(t)||(this._multiple||this._unmarkAll(),this.isSelected(t)||this._selection.add(t),this._emitChanges&&this._selectedToEmit.push(t))}_unmarkSelected(t){t=this._getConcreteValue(t),this.isSelected(t)&&(this._selection.delete(t),this._emitChanges&&this._deselectedToEmit.push(t))}_unmarkAll(){this.isEmpty()||this._selection.forEach(t=>this._unmarkSelected(t))}_verifyValueAssignment(t){t.length>1&&this._multiple}_hasQueuedChanges(){return!!(this._deselectedToEmit.length||this._selectedToEmit.length)}_getConcreteValue(t,e){if(this.compareWith){e=e??this._selection;for(let i of e)if(this.compareWith(t,i))return i;return t}else return t}};var R=class extends w{multiple;constructor(t=!1,e,i=!0,n){super(!0,e,i,n),this.multiple=t}isMultipleSelection(){return this.multiple}select(...t){return this.multiple?super.select(...t):super.setSelection(...t)}};var S=(()=>{class o{get id(){return this._id||this._generatedId}set id(e){this._id=e}_id;_generatedId=g(W$1).getId(`cdk-option-`);value;typeaheadLabel=null;get disabled(){return this.listbox.disabled||this._disabled()}set disabled(e){this._disabled.set(e)}_disabled=Ke(!1);get enabledTabIndex(){return this._enabledTabIndex()===void 0?this.listbox.enabledTabIndex:this._enabledTabIndex()}set enabledTabIndex(e){this._enabledTabIndex.set(e)}_enabledTabIndex=Ke(void 0);element=g(Hn).nativeElement;listbox=g(W);destroyed=new we;_clicked=new we;ngOnDestroy(){this.destroyed.next(),this.destroyed.complete()}isSelected(){return this.listbox.isSelected(this)}isActive(){return this.listbox.isActive(this)}toggle(){this.listbox.toggle(this)}select(){this.listbox.select(this)}deselect(){this.listbox.deselect(this)}focus(){this.element.focus()}getLabel(){return(this.typeaheadLabel??this.element.textContent?.trim())||``}setActiveStyles(){this.listbox.useActiveDescendant&&this.element.scrollIntoView({block:`nearest`,inline:`nearest`})}setInactiveStyles(){}_handleFocus(){this.listbox.useActiveDescendant&&(this.listbox._setActiveOption(this),this.listbox.focus())}_getTabIndex(){return this.listbox.useActiveDescendant||this.disabled?-1:this.isActive()?this.enabledTabIndex:-1}static ɵfac=function(i){return new(i||o)};static ɵdir=ad({type:o,selectors:[[``,`cdkOption`,``]],hostAttrs:[`role`,`option`,1,`cdk-option`],hostVars:6,hostBindings:function(i,n){i&1&&Gy(`click`,function(a){return n._clicked.next(a)})(`focus`,function(){return n._handleFocus()}),i&2&&(Uy(`id`,n.id),ky(`aria-selected`,n.isSelected())(`tabindex`,n._getTabIndex())(`aria-disabled`,n.disabled),Xy(`cdk-option-active`,n.isActive()))},inputs:{id:`id`,value:[0,`cdkOption`,`value`],typeaheadLabel:[0,`cdkOptionTypeaheadLabel`,`typeaheadLabel`],disabled:[2,`cdkOptionDisabled`,`disabled`,pN],enabledTabIndex:[2,`tabindex`,`enabledTabIndex`,e=>e==null?void 0:hN(e)]},exportAs:[`cdkOption`]})}return o})();var W=(()=>{class o{_cleanupWindowBlur;get id(){return this._id||this._generatedId}set id(e){this._id=e}_id;_generatedId=g(W$1).getId(`cdk-listbox-`);get enabledTabIndex(){return this._enabledTabIndex()===void 0?0:this._enabledTabIndex()}set enabledTabIndex(e){this._enabledTabIndex.set(e)}_enabledTabIndex=Ke(void 0);get value(){return this._invalid?[]:this.selectionModel.selected}set value(e){this._setSelection(e)}get multiple(){return this.selectionModel.multiple}set multiple(e){this.selectionModel.multiple=e,this.options&&this._updateInternalValue()}get disabled(){return this._disabled()}set disabled(e){this._disabled.set(e)}_disabled=Ke(!1);get useActiveDescendant(){return this._useActiveDescendant()}set useActiveDescendant(e){this._useActiveDescendant.set(e)}_useActiveDescendant=Ke(!1);get orientation(){return this._orientation}set orientation(e){this._orientation=e===`horizontal`?`horizontal`:`vertical`,e===`horizontal`?this.listKeyManager?.withHorizontalOrientation(this._dir?.value||`ltr`):this.listKeyManager?.withVerticalOrientation()}_orientation=`vertical`;get compareWith(){return this.selectionModel.compareWith}set compareWith(e){this.selectionModel.compareWith=e}get navigationWrapDisabled(){return this._navigationWrapDisabled}set navigationWrapDisabled(e){this._navigationWrapDisabled=e,this.listKeyManager?.withWrap(!this._navigationWrapDisabled)}_navigationWrapDisabled=!1;get navigateDisabledOptions(){return this._navigateDisabledOptions}set navigateDisabledOptions(e){this._navigateDisabledOptions=e,this.listKeyManager?.skipPredicate(this._navigateDisabledOptions?this._skipNonePredicate:this._skipDisabledPredicate)}_navigateDisabledOptions=!1;valueChange=new we;options;selectionModel=new R;listKeyManager;destroyed=new we;element=g(Hn).nativeElement;ngZone=g(ue);changeDetectorRef=g(oD);_invalid=!1;_lastTriggered=null;_onTouched=()=>{};_onChange=()=>{};_optionClicked=CE(()=>this.options.changes.pipe(OE(this.options),Qa(e=>bE(...e.map(i=>i._clicked.pipe(ae(n=>({option:i,event:n}))))))));_dir=g(H,{optional:!0});_isBrowser=g(b).isBrowser;_skipDisabledPredicate=e=>e.disabled;_skipNonePredicate=()=>!1;_hasFocus=!1;_previousActiveOption=null;constructor(){if(this._isBrowser){let e=g(Ao);this._cleanupWindowBlur=this.ngZone.runOutsideAngular(()=>e.listen(`window`,`blur`,()=>{this.element.contains(document.activeElement)&&this._previousActiveOption&&(this._setActiveOption(this._previousActiveOption),this._previousActiveOption=null)}))}}ngAfterContentInit(){this._initKeyManager(),bE(this.selectionModel.changed,this.options.changes).pipe(OE(null),kE(this.destroyed)).subscribe(()=>this._updateInternalValue()),this._optionClicked.pipe(jt(({option:e})=>!e.disabled),kE(this.destroyed)).subscribe(({option:e,event:i})=>this._handleOptionClicked(e,i))}ngOnDestroy(){this._cleanupWindowBlur?.(),this.listKeyManager?.destroy(),this.destroyed.next(),this.destroyed.complete()}toggle(e){this.toggleValue(e.value)}toggleValue(e){this._invalid&&this.selectionModel.clear(!1),this.selectionModel.toggle(e)}select(e){this.selectValue(e.value)}selectValue(e){this._invalid&&this.selectionModel.clear(!1),this.selectionModel.select(e)}deselect(e){this.deselectValue(e.value)}deselectValue(e){this._invalid&&this.selectionModel.clear(!1),this.selectionModel.deselect(e)}setAllSelected(e){e?(this._invalid&&this.selectionModel.clear(!1),this.selectionModel.select(...this.options.map(i=>i.value))):this.selectionModel.clear()}isSelected(e){return this.isValueSelected(e.value)}isActive(e){return this.listKeyManager?.activeItem===e}isValueSelected(e){return this._invalid?!1:this.selectionModel.isSelected(e)}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}writeValue(e){this._setSelection(e),this._verifyOptionValues()}setDisabledState(e){this.disabled=e,this.changeDetectorRef.markForCheck()}focus(){this.element.focus()}triggerOption(e){e&&!e.disabled&&(this._lastTriggered=e,(this.multiple?this.selectionModel.toggle(e.value):this.selectionModel.select(e.value))&&(this._onChange(this.value),this.valueChange.next({value:this.value,listbox:this,option:e})))}triggerRange(e,i,n,s){if(this.disabled||e&&e.disabled)return;this._lastTriggered=e;let a=this.compareWith??Object.is,d=[...this.options].slice(Math.max(0,Math.min(i,n)),Math.min(this.options.length,Math.max(i,n)+1)).filter(_=>!_.disabled).map(_=>_.value),l=[...this.value];for(let _ of d){let A=l.findIndex(Ee=>a(Ee,_));s&&A===-1?l.push(_):!s&&A!==-1&&l.splice(A,1)}this.selectionModel.setSelection(...l)&&(this._onChange(this.value),this.valueChange.next({value:this.value,listbox:this,option:e}))}_setActiveOption(e){this.listKeyManager.setActiveItem(e)}_handleFocus(){this.useActiveDescendant||(this.selectionModel.selected.length>0?this._setNextFocusToSelectedOption():this.listKeyManager.setNextItemActive(),this._focusActiveOption())}_handleKeydown(e){if(this.disabled)return;let{keyCode:i}=e,n=this.listKeyManager.activeItemIndex,s=[`ctrlKey`,`metaKey`];if(this.multiple&&i===65&&St(e,...s)){this.triggerRange(null,0,this.options.length-1,this.options.length!==this.value.length),e.preventDefault();return}if(this.multiple&&(i===32||i===13)&&St(e,`shiftKey`)){this.listKeyManager.activeItem&&this.listKeyManager.activeItemIndex!=null&&this.triggerRange(this.listKeyManager.activeItem,this._getLastTriggeredIndex()??this.listKeyManager.activeItemIndex,this.listKeyManager.activeItemIndex,!this.listKeyManager.activeItem.isSelected()),e.preventDefault();return}if(this.multiple&&i===36&&St(e,...s)&&St(e,`shiftKey`)){let d=this.listKeyManager.activeItem;if(d){let l=this.listKeyManager.activeItemIndex;this.listKeyManager.setFirstItemActive(),this.triggerRange(d,l,this.listKeyManager.activeItemIndex,!d.isSelected())}e.preventDefault();return}if(this.multiple&&i===35&&St(e,...s)&&St(e,`shiftKey`)){let d=this.listKeyManager.activeItem;if(d){let l=this.listKeyManager.activeItemIndex;this.listKeyManager.setLastItemActive(),this.triggerRange(d,l,this.listKeyManager.activeItemIndex,!d.isSelected())}e.preventDefault();return}if(i===32||i===13){this.triggerOption(this.listKeyManager.activeItem),e.preventDefault();return}let a=i===38||i===40||i===37||i===39||i===36||i===35;this.listKeyManager.onKeydown(e),a&&e.shiftKey&&n!==this.listKeyManager.activeItemIndex&&this.triggerOption(this.listKeyManager.activeItem)}_handleFocusIn(){this._hasFocus=!0}_handleFocusOut(e){this._previousActiveOption=this.listKeyManager.activeItem;let i=e.relatedTarget;this.element!==i&&!this.element.contains(i)&&(this._onTouched(),this._hasFocus=!1,this._setNextFocusToSelectedOption())}_getAriaActiveDescendant(){return this.useActiveDescendant?this.listKeyManager?.activeItem?.id:null}_getTabIndex(){return this.disabled?-1:this.useActiveDescendant||!this.listKeyManager.activeItem?this.enabledTabIndex:-1}_initKeyManager(){this.listKeyManager=new A(this.options).withWrap(!this._navigationWrapDisabled).withTypeAhead().withHomeAndEnd().withAllowedModifierKeys([`shiftKey`]).skipPredicate(this._navigateDisabledOptions?this._skipNonePredicate:this._skipDisabledPredicate),this.orientation===`vertical`?this.listKeyManager.withVerticalOrientation():this.listKeyManager.withHorizontalOrientation(this._dir?.value||`ltr`),this.selectionModel.selected.length&&Promise.resolve().then(()=>this._setNextFocusToSelectedOption()),this.listKeyManager.change.subscribe(()=>this._focusActiveOption()),this.options.changes.pipe(kE(this.destroyed)).subscribe(()=>{let e=this.listKeyManager.activeItem;e&&!this.options.find(i=>i===e)&&(this.listKeyManager.setActiveItem(-1),this.changeDetectorRef.markForCheck())})}_focusActiveOption(){this.useActiveDescendant||this.listKeyManager.activeItem?.focus(),this.changeDetectorRef.markForCheck()}_setSelection(e){this._invalid&&this.selectionModel.clear(!1),this.selectionModel.setSelection(...this._coerceValue(e)),this._hasFocus||this._setNextFocusToSelectedOption()}_setNextFocusToSelectedOption(){let e=this.options?.find(i=>i.isSelected());e&&this.listKeyManager.updateActiveItem(e)}_updateInternalValue(){let e=new Map;this.selectionModel.sort((n,s)=>{return this._getIndexForValue(e,n)-this._getIndexForValue(e,s)});let i=this.selectionModel.selected;this._invalid=!this.multiple&&i.length>1||!!this._getInvalidOptionValues(i).length,this.changeDetectorRef.markForCheck()}_getIndexForValue(e,i){let n=this.compareWith||Object.is;if(!e.has(i)){let s=-1;for(let a=0;a<this.options.length;a++)if(n(i,this.options.get(a).value)){s=a;break}e.set(i,s)}return e.get(i)}_handleOptionClicked(e,i){i.preventDefault(),this.listKeyManager.setActiveItem(e),i.shiftKey&&this.multiple?this.triggerRange(e,this._getLastTriggeredIndex()??this.listKeyManager.activeItemIndex,this.listKeyManager.activeItemIndex,!e.isSelected()):this.triggerOption(e)}_verifyNoOptionValueCollisions(){this.options.changes.pipe(OE(this.options),kE(this.destroyed)).subscribe(()=>{let e=this.compareWith??Object.is;for(let i=0;i<this.options.length;i++){let n=this.options.get(i),s=null;for(let a=i+1;a<this.options.length;a++){let d=this.options.get(a);if(e(n.value,d.value)){s=d;break}}if(s){this.compareWith?console.warn(`Found multiple CdkOption representing the same value under the given compareWith function`,{option1:n.element,option2:s.element,compareWith:this.compareWith}):console.warn(`Found multiple CdkOption with the same value`,{option1:n.element,option2:s.element});return}}})}_verifyOptionValues(){this.options}_coerceValue(e){return e==null?[]:xe(e)}_getInvalidOptionValues(e){let i=this.compareWith||Object.is,n=(this.options||[]).map(s=>s.value);return e.filter(s=>!n.some(a=>i(s,a)))}_getLastTriggeredIndex(){let e=this.options.toArray().indexOf(this._lastTriggered);return e===-1?null:e}static ɵfac=function(i){return new(i||o)};static ɵdir=ad({type:o,selectors:[[``,`cdkListbox`,``]],contentQueries:function(i,n,s){if(i&1&&qy(s,S,5),i&2){let a;XS(a=JS())&&(n.options=a)}},hostAttrs:[`role`,`listbox`,1,`cdk-listbox`],hostVars:6,hostBindings:function(i,n){i&1&&Gy(`focus`,function(){return n._handleFocus()})(`keydown`,function(a){return n._handleKeydown(a)})(`focusout`,function(a){return n._handleFocusOut(a)})(`focusin`,function(){return n._handleFocusIn()}),i&2&&(Uy(`id`,n.id),ky(`tabindex`,n._getTabIndex())(`aria-disabled`,n.disabled)(`aria-multiselectable`,n.multiple)(`aria-activedescendant`,n._getAriaActiveDescendant())(`aria-orientation`,n.orientation))},inputs:{id:`id`,enabledTabIndex:[0,`tabindex`,`enabledTabIndex`],value:[0,`cdkListboxValue`,`value`],multiple:[2,`cdkListboxMultiple`,`multiple`,pN],disabled:[2,`cdkListboxDisabled`,`disabled`,pN],useActiveDescendant:[2,`cdkListboxUseActiveDescendant`,`useActiveDescendant`,pN],orientation:[0,`cdkListboxOrientation`,`orientation`],compareWith:[0,`cdkListboxCompareWith`,`compareWith`],navigationWrapDisabled:[2,`cdkListboxNavigationWrapDisabled`,`navigationWrapDisabled`,pN],navigateDisabledOptions:[2,`cdkListboxNavigatesDisabledOptions`,`navigateDisabledOptions`,pN]},outputs:{valueChange:`cdkListboxValueChange`},exportAs:[`cdkListbox`],features:[A_([{provide:Z,useExisting:Vi(()=>o),multi:!0}])]})}return o})();var Le=(o,t)=>t.value;function Re(o,t){if(o&1){let e=zS();Us(0,`div`,1),Py(1,`app-icon`,4),Us(2,`input`,5),Gy(`ngModelChange`,function(n){Ip(e);return wp(qS().query.set(n))})(`keydown`,function(n){Ip(e);return wp(qS().searchKeydown(n))}),fd(),qT(),fd()}if(o&2){let e=qS();ZC(2),Fy(`ngModel`,e.query()),ky(`aria-label`,e.i18n.t(`listControls.searchOptions`))(`placeholder`,e.i18n.t(`listControls.searchOptions`)),ZT()}}function We(o,t){if(o&1&&(Us(0,`li`)(1,`button`,6),y_(2),fd()()),o&2){let e=t.$implicit;ZC(),Fy(`cdkOption`,e.value)(`cdkOptionDisabled`,e.disabled),ZC(),vd(` `,e.label,` `)}}function Pe(o,t){if(o&1&&(Us(0,`li`,3),y_(1),fd()),o&2){let e=qS();ZC(),nv(e.i18n.t(`listControls.noOptions`))}}var P=class o{data=g(pi);dialog=g(te);i18n=g(Ie);query=Ke(``);selected=Ke(new Set(this.data.selected));optionControls=RH(S);options=Ft(()=>{let t=this.query().trim().toLocaleLowerCase(this.i18n.language());return t===``?this.data.options:this.data.options.filter(e=>e.label.toLocaleLowerCase(this.i18n.language()).includes(t))});visibleSelection=Ft(()=>{let t=new Set(this.options().map(e=>e.value));return[...this.selected()].filter(e=>t.has(e))});selectionChanged(t){if(!this.data.multiple){this.dialog.close(t.value);return}let e=new Set(this.options().map(n=>n.value)),i=new Set([...this.selected()].filter(n=>!e.has(n)));for(let n of t.value)i.add(n);this.selected.set(i),this.data.commit([...i])}searchKeydown(t){if(t.key!==`ArrowDown`&&t.key!==`ArrowUp`)return;let e=this.optionControls().filter(n=>!n.disabled),i=t.key===`ArrowDown`?e[0]:e.at(-1);i!==void 0&&(t.preventDefault(),i.focus())}static ɵfac=function(e){return new(e||o)};static ɵcmp=Fb({type:o,selectors:[[`app-filter-select-dialog`]],viewQuery:function(e,i){e&1&&Ky(i.optionControls,S,5),e&2&&e_()},decls:6,vars:4,consts:[[1,`filter-select-dialog`],[1,`search-row`],[`cdkListbox`,``,3,`cdkListboxValueChange`,`cdkListboxValue`,`cdkListboxMultiple`],[1,`empty`],[`name`,`search`],[`data-filter-select-search`,``,`type`,`text`,`inputmode`,`search`,`autocomplete`,`off`,3,`ngModelChange`,`keydown`,`ngModel`],[`type`,`button`,1,`option`,3,`cdkOption`,`cdkOptionDisabled`]],template:function(e,i){e&1&&(Us(0,`section`,0),OS(1,Re,3,3,`div`,1),Us(2,`ul`,2),Gy(`cdkListboxValueChange`,function(s){return i.selectionChanged(s)}),LS(3,We,3,3,`li`,null,Le,!1,Pe,2,1,`li`,3),fd()()),e&2&&(ZC(),kS(i.data.options.length>3?1:-1),ZC(),Fy(`cdkListboxValue`,i.visibleSelection())(`cdkListboxMultiple`,i.data.multiple),ZC(),jS(i.options()))},dependencies:[W,S,bn,je,vn,Lt,r],styles:[`.filter-select-dialog[_ngcontent-%COMP%]{display:grid;max-block-size:min(24rem,100dvh - 1rem);gap:var(--%NS%space-1);padding:var(--%NS%space-1);overflow:hidden;border:1px solid var(--%NS%color-line-strong);border-radius:var(--%NS%radius-sm);background:var(--%NS%color-surface-raised);color:var(--%NS%color-ink);box-shadow:var(--%NS%shadow-page)}.search-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:var(--%NS%space-1)}.search-row[_ngcontent-%COMP%]{border-radius:var(--%NS%radius-xs);background:var(--%NS%color-surface-sunken)}.search-row[_ngcontent-%COMP%]:focus-within{outline:2px solid var(--%NS%color-focus);outline-offset:-2px}.search-row[_ngcontent-%COMP%] > app-icon[_ngcontent-%COMP%]{flex:none;margin-inline-start:var(--%NS%space-2);color:var(--%NS%color-muted)}.search-row[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{flex:1;min-inline-size:0;min-block-size:2rem;padding:var(--%NS%space-1);border:0;outline:0;background:transparent;color:inherit;font:inherit;font-size:var(--%NS%text-sm)}.search-row[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus-visible{outline:none;box-shadow:none}ul[_ngcontent-%COMP%]{display:grid;margin:0;padding:0;overflow-y:auto;list-style:none}.option[_ngcontent-%COMP%]{inline-size:100%;min-block-size:1.75rem;padding:.2rem var(--%NS%space-2);border:0;border-block-end:1px solid var(--%NS%color-line);background:transparent;color:inherit;font-size:var(--%NS%text-sm);text-align:start;cursor:pointer}.option[_ngcontent-%COMP%]:hover, .option[aria-selected=true][_ngcontent-%COMP%]{background:var(--%NS%color-surface-sunken)}.option[aria-selected=true][_ngcontent-%COMP%]{font-weight:700}.option[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--%NS%color-focus);outline-offset:-2px}.empty[_ngcontent-%COMP%]{padding:var(--%NS%space-1) var(--%NS%space-2);color:var(--%NS%color-muted)}`]})};var Ae=class o{dialogs=g(is);destroyRef=g(pe);element=g(Hn);i18n=g(Ie);overlay=g(Po);dialogId=g(W$1).getId(`filter-select-`);opened=Ke(!1);active;constructor(){this.destroyRef.onDestroy(()=>this.active?.close())}pointerOpen(t){t.button===0&&(t.preventDefault(),this.open())}preventNativeOpen(t){t.preventDefault(),this.open()}keyboardOpen(t){[`Enter`,` `,`ArrowDown`,`ArrowUp`].includes(t.key)&&(t.preventDefault(),this.open())}async open(){let t=this.element.nativeElement;if(t.disabled||this.active!==void 0)return;let e=Array.from(t.options,l=>({disabled:l.disabled,label:l.label.trim()||this.i18n.t(`listControls.none`),value:l.value})),i=Array.from(t.selectedOptions,l=>l.value),n=this.label(t),s=e.length>3?`[data-filter-select-search]`:e.some(l=>!l.disabled)?`.option:not([aria-disabled="true"])`:`dialog`,a=this.overlay.position().flexibleConnectedTo(t).withPositions([{originX:`start`,originY:`bottom`,overlayX:`start`,overlayY:`top`,offsetY:8},{originX:`end`,originY:`bottom`,overlayX:`end`,overlayY:`top`,offsetY:8},{originX:`start`,originY:`top`,overlayX:`start`,overlayY:`bottom`,offsetY:-8},{originX:`end`,originY:`top`,overlayX:`end`,overlayY:`bottom`,offsetY:-8}]).withViewportMargin(8).withPush(!0),d=this.dialogs.open(P,{id:this.dialogId,data:{commit:l=>this.update(t,l),multiple:t.multiple,options:e,selected:i},role:`dialog`,ariaModal:!0,ariaLabel:n,autoFocus:s,restoreFocus:!0,hasBackdrop:!0,backdropClass:`cdk-overlay-transparent-backdrop`,disableClose:!1,disableAnimations:!0,positionStrategy:a,width:`${Math.max(320,t.getBoundingClientRect().width)}px`,maxWidth:`calc(100vw - 2rem)`});this.active=d,this.opened.set(!0);try{let l=await JD(d.closed,{defaultValue:void 0});if(l===void 0||this.destroyRef.destroyed)return;this.update(t,l)}finally{this.active=void 0,this.opened.set(!1)}}update(t,e){for(let i of t.options)i.selected=e.includes(i.value);t.dispatchEvent(new Event(`input`,{bubbles:!0})),t.dispatchEvent(new Event(`change`,{bubbles:!0}))}label(t){let e=t.getAttribute(`aria-label`);if(e)return e;let i=t.labels?.[0];if(i===void 0)return t.name;let n=document.createElement(`label`);return n.append(...Array.from(i.childNodes,s=>s.cloneNode(!0))),n.querySelector(`select`)?.remove(),n.textContent?.trim()||t.name}static ɵfac=function(e){return new(e||o)};static ɵdir=ad({type:o,selectors:[[`select`,`appFilterSelect`,``]],hostAttrs:[`aria-haspopup`,`dialog`,1,`filter-select`],hostVars:4,hostBindings:function(e,i){e&1&&Gy(`mousedown`,function(s){return i.pointerOpen(s)})(`click`,function(s){return i.preventNativeOpen(s)})(`keydown`,function(s){return i.keyboardOpen(s)}),e&2&&(ky(`aria-controls`,i.opened()?i.dialogId:null)(`aria-expanded`,i.opened()),Xy(`select`,!0))}})};export{Ae as t};
|
|
1
|
+
import{$t as ZC,A as Gy,D as Fy,Dn as g,E as Ft,Fr as we,H as JD,Hn as kE,Ir as wp,It as Us,J as Ky,Jr as zS,Jt as Xy,K as Ke,Kt as XS,Lt as Uy,Nr as vd,On as hN,P as Hn,Rn as jS,Tn as fd,U as JS,Vn as jt,Vt as Vi,Wn as kS,Wr as y_,X as LS,ar as oD,dr as pe,h as CE,jr as ue,l as A_,ln as ad,lr as pN,lt as OS,mr as qT,pn as bE,pr as qS,qn as ky,rr as nv,st as OE,tn as ZT,u as Ao,un as ae,vr as qy,vt as Py,w as Fb,wt as RH,xn as e_,yt as Qa,z as Ip}from"./chunk-BAHiFuUo.js";import{i as r,m as Ie}from"./main-F7D3L737.js";import{_ as te,f as b,h as pi,i as H,l as W$1,m as is,o as Po,s as St,v as xe}from"./chunk-BzUDWIzm.js";import{t as A}from"./chunk-CczD0yXn.js";import{C as vn,_ as je,g as bn,m as Z,u as Lt}from"./chunk-CReShp-B.js";var w=class{_multiple;_emitChanges;compareWith;_selection=new Set;_deselectedToEmit=[];_selectedToEmit=[];_selected=null;get selected(){return this._selected||(this._selected=Array.from(this._selection.values())),this._selected}changed=new we;bulk={select:t=>this._select(t),deselect:t=>this._deselect(t),setSelection:t=>this._setSelection(t)};constructor(t=!1,e,i=!0,n){this._multiple=t,this._emitChanges=i,this.compareWith=n,e&&e.length&&(t?e.forEach(s=>this._markSelected(s)):this._markSelected(e[0]),this._selectedToEmit.length=0)}select(...t){return this._select(t)}deselect(...t){return this._deselect(t)}setSelection(...t){return this._setSelection(t)}toggle(t){return this.isSelected(t)?this.deselect(t):this.select(t)}clear(t=!0){this._unmarkAll();let e=this._hasQueuedChanges();return t&&this._emitChangeEvent(),e}isSelected(t){return this._selection.has(this._getConcreteValue(t))}isEmpty(){return this._selection.size===0}hasValue(){return!this.isEmpty()}sort(t){this._multiple&&this.selected&&this._selected.sort(t)}isMultipleSelection(){return this._multiple}_select(t){this._verifyValueAssignment(t),t.forEach(i=>this._markSelected(i));let e=this._hasQueuedChanges();return this._emitChangeEvent(),e}_deselect(t){this._verifyValueAssignment(t),t.forEach(i=>this._unmarkSelected(i));let e=this._hasQueuedChanges();return this._emitChangeEvent(),e}_setSelection(t){this._verifyValueAssignment(t);let e=this.selected,i=new Set(t.map(s=>this._getConcreteValue(s)));t.forEach(s=>this._markSelected(s)),e.filter(s=>!i.has(this._getConcreteValue(s,i))).forEach(s=>this._unmarkSelected(s));let n=this._hasQueuedChanges();return this._emitChangeEvent(),n}_emitChangeEvent(){this._selected=null,(this._selectedToEmit.length||this._deselectedToEmit.length)&&(this.changed.next({source:this,added:this._selectedToEmit,removed:this._deselectedToEmit}),this._deselectedToEmit=[],this._selectedToEmit=[])}_markSelected(t){t=this._getConcreteValue(t),this.isSelected(t)||(this._multiple||this._unmarkAll(),this.isSelected(t)||this._selection.add(t),this._emitChanges&&this._selectedToEmit.push(t))}_unmarkSelected(t){t=this._getConcreteValue(t),this.isSelected(t)&&(this._selection.delete(t),this._emitChanges&&this._deselectedToEmit.push(t))}_unmarkAll(){this.isEmpty()||this._selection.forEach(t=>this._unmarkSelected(t))}_verifyValueAssignment(t){t.length>1&&this._multiple}_hasQueuedChanges(){return!!(this._deselectedToEmit.length||this._selectedToEmit.length)}_getConcreteValue(t,e){if(this.compareWith){e=e??this._selection;for(let i of e)if(this.compareWith(t,i))return i;return t}else return t}};var R=class extends w{multiple;constructor(t=!1,e,i=!0,n){super(!0,e,i,n),this.multiple=t}isMultipleSelection(){return this.multiple}select(...t){return this.multiple?super.select(...t):super.setSelection(...t)}};var S=(()=>{class o{get id(){return this._id||this._generatedId}set id(e){this._id=e}_id;_generatedId=g(W$1).getId(`cdk-option-`);value;typeaheadLabel=null;get disabled(){return this.listbox.disabled||this._disabled()}set disabled(e){this._disabled.set(e)}_disabled=Ke(!1);get enabledTabIndex(){return this._enabledTabIndex()===void 0?this.listbox.enabledTabIndex:this._enabledTabIndex()}set enabledTabIndex(e){this._enabledTabIndex.set(e)}_enabledTabIndex=Ke(void 0);element=g(Hn).nativeElement;listbox=g(W);destroyed=new we;_clicked=new we;ngOnDestroy(){this.destroyed.next(),this.destroyed.complete()}isSelected(){return this.listbox.isSelected(this)}isActive(){return this.listbox.isActive(this)}toggle(){this.listbox.toggle(this)}select(){this.listbox.select(this)}deselect(){this.listbox.deselect(this)}focus(){this.element.focus()}getLabel(){return(this.typeaheadLabel??this.element.textContent?.trim())||``}setActiveStyles(){this.listbox.useActiveDescendant&&this.element.scrollIntoView({block:`nearest`,inline:`nearest`})}setInactiveStyles(){}_handleFocus(){this.listbox.useActiveDescendant&&(this.listbox._setActiveOption(this),this.listbox.focus())}_getTabIndex(){return this.listbox.useActiveDescendant||this.disabled?-1:this.isActive()?this.enabledTabIndex:-1}static ɵfac=function(i){return new(i||o)};static ɵdir=ad({type:o,selectors:[[``,`cdkOption`,``]],hostAttrs:[`role`,`option`,1,`cdk-option`],hostVars:6,hostBindings:function(i,n){i&1&&Gy(`click`,function(a){return n._clicked.next(a)})(`focus`,function(){return n._handleFocus()}),i&2&&(Uy(`id`,n.id),ky(`aria-selected`,n.isSelected())(`tabindex`,n._getTabIndex())(`aria-disabled`,n.disabled),Xy(`cdk-option-active`,n.isActive()))},inputs:{id:`id`,value:[0,`cdkOption`,`value`],typeaheadLabel:[0,`cdkOptionTypeaheadLabel`,`typeaheadLabel`],disabled:[2,`cdkOptionDisabled`,`disabled`,pN],enabledTabIndex:[2,`tabindex`,`enabledTabIndex`,e=>e==null?void 0:hN(e)]},exportAs:[`cdkOption`]})}return o})();var W=(()=>{class o{_cleanupWindowBlur;get id(){return this._id||this._generatedId}set id(e){this._id=e}_id;_generatedId=g(W$1).getId(`cdk-listbox-`);get enabledTabIndex(){return this._enabledTabIndex()===void 0?0:this._enabledTabIndex()}set enabledTabIndex(e){this._enabledTabIndex.set(e)}_enabledTabIndex=Ke(void 0);get value(){return this._invalid?[]:this.selectionModel.selected}set value(e){this._setSelection(e)}get multiple(){return this.selectionModel.multiple}set multiple(e){this.selectionModel.multiple=e,this.options&&this._updateInternalValue()}get disabled(){return this._disabled()}set disabled(e){this._disabled.set(e)}_disabled=Ke(!1);get useActiveDescendant(){return this._useActiveDescendant()}set useActiveDescendant(e){this._useActiveDescendant.set(e)}_useActiveDescendant=Ke(!1);get orientation(){return this._orientation}set orientation(e){this._orientation=e===`horizontal`?`horizontal`:`vertical`,e===`horizontal`?this.listKeyManager?.withHorizontalOrientation(this._dir?.value||`ltr`):this.listKeyManager?.withVerticalOrientation()}_orientation=`vertical`;get compareWith(){return this.selectionModel.compareWith}set compareWith(e){this.selectionModel.compareWith=e}get navigationWrapDisabled(){return this._navigationWrapDisabled}set navigationWrapDisabled(e){this._navigationWrapDisabled=e,this.listKeyManager?.withWrap(!this._navigationWrapDisabled)}_navigationWrapDisabled=!1;get navigateDisabledOptions(){return this._navigateDisabledOptions}set navigateDisabledOptions(e){this._navigateDisabledOptions=e,this.listKeyManager?.skipPredicate(this._navigateDisabledOptions?this._skipNonePredicate:this._skipDisabledPredicate)}_navigateDisabledOptions=!1;valueChange=new we;options;selectionModel=new R;listKeyManager;destroyed=new we;element=g(Hn).nativeElement;ngZone=g(ue);changeDetectorRef=g(oD);_invalid=!1;_lastTriggered=null;_onTouched=()=>{};_onChange=()=>{};_optionClicked=CE(()=>this.options.changes.pipe(OE(this.options),Qa(e=>bE(...e.map(i=>i._clicked.pipe(ae(n=>({option:i,event:n}))))))));_dir=g(H,{optional:!0});_isBrowser=g(b).isBrowser;_skipDisabledPredicate=e=>e.disabled;_skipNonePredicate=()=>!1;_hasFocus=!1;_previousActiveOption=null;constructor(){if(this._isBrowser){let e=g(Ao);this._cleanupWindowBlur=this.ngZone.runOutsideAngular(()=>e.listen(`window`,`blur`,()=>{this.element.contains(document.activeElement)&&this._previousActiveOption&&(this._setActiveOption(this._previousActiveOption),this._previousActiveOption=null)}))}}ngAfterContentInit(){this._initKeyManager(),bE(this.selectionModel.changed,this.options.changes).pipe(OE(null),kE(this.destroyed)).subscribe(()=>this._updateInternalValue()),this._optionClicked.pipe(jt(({option:e})=>!e.disabled),kE(this.destroyed)).subscribe(({option:e,event:i})=>this._handleOptionClicked(e,i))}ngOnDestroy(){this._cleanupWindowBlur?.(),this.listKeyManager?.destroy(),this.destroyed.next(),this.destroyed.complete()}toggle(e){this.toggleValue(e.value)}toggleValue(e){this._invalid&&this.selectionModel.clear(!1),this.selectionModel.toggle(e)}select(e){this.selectValue(e.value)}selectValue(e){this._invalid&&this.selectionModel.clear(!1),this.selectionModel.select(e)}deselect(e){this.deselectValue(e.value)}deselectValue(e){this._invalid&&this.selectionModel.clear(!1),this.selectionModel.deselect(e)}setAllSelected(e){e?(this._invalid&&this.selectionModel.clear(!1),this.selectionModel.select(...this.options.map(i=>i.value))):this.selectionModel.clear()}isSelected(e){return this.isValueSelected(e.value)}isActive(e){return this.listKeyManager?.activeItem===e}isValueSelected(e){return this._invalid?!1:this.selectionModel.isSelected(e)}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}writeValue(e){this._setSelection(e),this._verifyOptionValues()}setDisabledState(e){this.disabled=e,this.changeDetectorRef.markForCheck()}focus(){this.element.focus()}triggerOption(e){e&&!e.disabled&&(this._lastTriggered=e,(this.multiple?this.selectionModel.toggle(e.value):this.selectionModel.select(e.value))&&(this._onChange(this.value),this.valueChange.next({value:this.value,listbox:this,option:e})))}triggerRange(e,i,n,s){if(this.disabled||e&&e.disabled)return;this._lastTriggered=e;let a=this.compareWith??Object.is,d=[...this.options].slice(Math.max(0,Math.min(i,n)),Math.min(this.options.length,Math.max(i,n)+1)).filter(_=>!_.disabled).map(_=>_.value),l=[...this.value];for(let _ of d){let A=l.findIndex(Ee=>a(Ee,_));s&&A===-1?l.push(_):!s&&A!==-1&&l.splice(A,1)}this.selectionModel.setSelection(...l)&&(this._onChange(this.value),this.valueChange.next({value:this.value,listbox:this,option:e}))}_setActiveOption(e){this.listKeyManager.setActiveItem(e)}_handleFocus(){this.useActiveDescendant||(this.selectionModel.selected.length>0?this._setNextFocusToSelectedOption():this.listKeyManager.setNextItemActive(),this._focusActiveOption())}_handleKeydown(e){if(this.disabled)return;let{keyCode:i}=e,n=this.listKeyManager.activeItemIndex,s=[`ctrlKey`,`metaKey`];if(this.multiple&&i===65&&St(e,...s)){this.triggerRange(null,0,this.options.length-1,this.options.length!==this.value.length),e.preventDefault();return}if(this.multiple&&(i===32||i===13)&&St(e,`shiftKey`)){this.listKeyManager.activeItem&&this.listKeyManager.activeItemIndex!=null&&this.triggerRange(this.listKeyManager.activeItem,this._getLastTriggeredIndex()??this.listKeyManager.activeItemIndex,this.listKeyManager.activeItemIndex,!this.listKeyManager.activeItem.isSelected()),e.preventDefault();return}if(this.multiple&&i===36&&St(e,...s)&&St(e,`shiftKey`)){let d=this.listKeyManager.activeItem;if(d){let l=this.listKeyManager.activeItemIndex;this.listKeyManager.setFirstItemActive(),this.triggerRange(d,l,this.listKeyManager.activeItemIndex,!d.isSelected())}e.preventDefault();return}if(this.multiple&&i===35&&St(e,...s)&&St(e,`shiftKey`)){let d=this.listKeyManager.activeItem;if(d){let l=this.listKeyManager.activeItemIndex;this.listKeyManager.setLastItemActive(),this.triggerRange(d,l,this.listKeyManager.activeItemIndex,!d.isSelected())}e.preventDefault();return}if(i===32||i===13){this.triggerOption(this.listKeyManager.activeItem),e.preventDefault();return}let a=i===38||i===40||i===37||i===39||i===36||i===35;this.listKeyManager.onKeydown(e),a&&e.shiftKey&&n!==this.listKeyManager.activeItemIndex&&this.triggerOption(this.listKeyManager.activeItem)}_handleFocusIn(){this._hasFocus=!0}_handleFocusOut(e){this._previousActiveOption=this.listKeyManager.activeItem;let i=e.relatedTarget;this.element!==i&&!this.element.contains(i)&&(this._onTouched(),this._hasFocus=!1,this._setNextFocusToSelectedOption())}_getAriaActiveDescendant(){return this.useActiveDescendant?this.listKeyManager?.activeItem?.id:null}_getTabIndex(){return this.disabled?-1:this.useActiveDescendant||!this.listKeyManager.activeItem?this.enabledTabIndex:-1}_initKeyManager(){this.listKeyManager=new A(this.options).withWrap(!this._navigationWrapDisabled).withTypeAhead().withHomeAndEnd().withAllowedModifierKeys([`shiftKey`]).skipPredicate(this._navigateDisabledOptions?this._skipNonePredicate:this._skipDisabledPredicate),this.orientation===`vertical`?this.listKeyManager.withVerticalOrientation():this.listKeyManager.withHorizontalOrientation(this._dir?.value||`ltr`),this.selectionModel.selected.length&&Promise.resolve().then(()=>this._setNextFocusToSelectedOption()),this.listKeyManager.change.subscribe(()=>this._focusActiveOption()),this.options.changes.pipe(kE(this.destroyed)).subscribe(()=>{let e=this.listKeyManager.activeItem;e&&!this.options.find(i=>i===e)&&(this.listKeyManager.setActiveItem(-1),this.changeDetectorRef.markForCheck())})}_focusActiveOption(){this.useActiveDescendant||this.listKeyManager.activeItem?.focus(),this.changeDetectorRef.markForCheck()}_setSelection(e){this._invalid&&this.selectionModel.clear(!1),this.selectionModel.setSelection(...this._coerceValue(e)),this._hasFocus||this._setNextFocusToSelectedOption()}_setNextFocusToSelectedOption(){let e=this.options?.find(i=>i.isSelected());e&&this.listKeyManager.updateActiveItem(e)}_updateInternalValue(){let e=new Map;this.selectionModel.sort((n,s)=>{return this._getIndexForValue(e,n)-this._getIndexForValue(e,s)});let i=this.selectionModel.selected;this._invalid=!this.multiple&&i.length>1||!!this._getInvalidOptionValues(i).length,this.changeDetectorRef.markForCheck()}_getIndexForValue(e,i){let n=this.compareWith||Object.is;if(!e.has(i)){let s=-1;for(let a=0;a<this.options.length;a++)if(n(i,this.options.get(a).value)){s=a;break}e.set(i,s)}return e.get(i)}_handleOptionClicked(e,i){i.preventDefault(),this.listKeyManager.setActiveItem(e),i.shiftKey&&this.multiple?this.triggerRange(e,this._getLastTriggeredIndex()??this.listKeyManager.activeItemIndex,this.listKeyManager.activeItemIndex,!e.isSelected()):this.triggerOption(e)}_verifyNoOptionValueCollisions(){this.options.changes.pipe(OE(this.options),kE(this.destroyed)).subscribe(()=>{let e=this.compareWith??Object.is;for(let i=0;i<this.options.length;i++){let n=this.options.get(i),s=null;for(let a=i+1;a<this.options.length;a++){let d=this.options.get(a);if(e(n.value,d.value)){s=d;break}}if(s){this.compareWith?console.warn(`Found multiple CdkOption representing the same value under the given compareWith function`,{option1:n.element,option2:s.element,compareWith:this.compareWith}):console.warn(`Found multiple CdkOption with the same value`,{option1:n.element,option2:s.element});return}}})}_verifyOptionValues(){this.options}_coerceValue(e){return e==null?[]:xe(e)}_getInvalidOptionValues(e){let i=this.compareWith||Object.is,n=(this.options||[]).map(s=>s.value);return e.filter(s=>!n.some(a=>i(s,a)))}_getLastTriggeredIndex(){let e=this.options.toArray().indexOf(this._lastTriggered);return e===-1?null:e}static ɵfac=function(i){return new(i||o)};static ɵdir=ad({type:o,selectors:[[``,`cdkListbox`,``]],contentQueries:function(i,n,s){if(i&1&&qy(s,S,5),i&2){let a;XS(a=JS())&&(n.options=a)}},hostAttrs:[`role`,`listbox`,1,`cdk-listbox`],hostVars:6,hostBindings:function(i,n){i&1&&Gy(`focus`,function(){return n._handleFocus()})(`keydown`,function(a){return n._handleKeydown(a)})(`focusout`,function(a){return n._handleFocusOut(a)})(`focusin`,function(){return n._handleFocusIn()}),i&2&&(Uy(`id`,n.id),ky(`tabindex`,n._getTabIndex())(`aria-disabled`,n.disabled)(`aria-multiselectable`,n.multiple)(`aria-activedescendant`,n._getAriaActiveDescendant())(`aria-orientation`,n.orientation))},inputs:{id:`id`,enabledTabIndex:[0,`tabindex`,`enabledTabIndex`],value:[0,`cdkListboxValue`,`value`],multiple:[2,`cdkListboxMultiple`,`multiple`,pN],disabled:[2,`cdkListboxDisabled`,`disabled`,pN],useActiveDescendant:[2,`cdkListboxUseActiveDescendant`,`useActiveDescendant`,pN],orientation:[0,`cdkListboxOrientation`,`orientation`],compareWith:[0,`cdkListboxCompareWith`,`compareWith`],navigationWrapDisabled:[2,`cdkListboxNavigationWrapDisabled`,`navigationWrapDisabled`,pN],navigateDisabledOptions:[2,`cdkListboxNavigatesDisabledOptions`,`navigateDisabledOptions`,pN]},outputs:{valueChange:`cdkListboxValueChange`},exportAs:[`cdkListbox`],features:[A_([{provide:Z,useExisting:Vi(()=>o),multi:!0}])]})}return o})();var Le=(o,t)=>t.value;function Re(o,t){if(o&1){let e=zS();Us(0,`div`,1),Py(1,`app-icon`,4),Us(2,`input`,5),Gy(`ngModelChange`,function(n){Ip(e);return wp(qS().query.set(n))})(`keydown`,function(n){Ip(e);return wp(qS().searchKeydown(n))}),fd(),qT(),fd()}if(o&2){let e=qS();ZC(2),Fy(`ngModel`,e.query()),ky(`aria-label`,e.i18n.t(`listControls.searchOptions`))(`placeholder`,e.i18n.t(`listControls.searchOptions`)),ZT()}}function We(o,t){if(o&1&&(Us(0,`li`)(1,`button`,6),y_(2),fd()()),o&2){let e=t.$implicit;ZC(),Fy(`cdkOption`,e.value)(`cdkOptionDisabled`,e.disabled),ZC(),vd(` `,e.label,` `)}}function Pe(o,t){if(o&1&&(Us(0,`li`,3),y_(1),fd()),o&2){let e=qS();ZC(),nv(e.i18n.t(`listControls.noOptions`))}}var P=class o{data=g(pi);dialog=g(te);i18n=g(Ie);query=Ke(``);selected=Ke(new Set(this.data.selected));optionControls=RH(S);options=Ft(()=>{let t=this.query().trim().toLocaleLowerCase(this.i18n.language());return t===``?this.data.options:this.data.options.filter(e=>e.label.toLocaleLowerCase(this.i18n.language()).includes(t))});visibleSelection=Ft(()=>{let t=new Set(this.options().map(e=>e.value));return[...this.selected()].filter(e=>t.has(e))});selectionChanged(t){if(!this.data.multiple){this.dialog.close(t.value);return}let e=new Set(this.options().map(n=>n.value)),i=new Set([...this.selected()].filter(n=>!e.has(n)));for(let n of t.value)i.add(n);this.selected.set(i),this.data.commit([...i])}searchKeydown(t){if(t.key!==`ArrowDown`&&t.key!==`ArrowUp`)return;let e=this.optionControls().filter(n=>!n.disabled),i=t.key===`ArrowDown`?e[0]:e.at(-1);i!==void 0&&(t.preventDefault(),i.focus())}static ɵfac=function(e){return new(e||o)};static ɵcmp=Fb({type:o,selectors:[[`app-filter-select-dialog`]],viewQuery:function(e,i){e&1&&Ky(i.optionControls,S,5),e&2&&e_()},decls:6,vars:4,consts:[[1,`filter-select-dialog`],[1,`search-row`],[`cdkListbox`,``,3,`cdkListboxValueChange`,`cdkListboxValue`,`cdkListboxMultiple`],[1,`empty`],[`name`,`search`],[`data-filter-select-search`,``,`type`,`text`,`inputmode`,`search`,`autocomplete`,`off`,3,`ngModelChange`,`keydown`,`ngModel`],[`type`,`button`,1,`option`,3,`cdkOption`,`cdkOptionDisabled`]],template:function(e,i){e&1&&(Us(0,`section`,0),OS(1,Re,3,3,`div`,1),Us(2,`ul`,2),Gy(`cdkListboxValueChange`,function(s){return i.selectionChanged(s)}),LS(3,We,3,3,`li`,null,Le,!1,Pe,2,1,`li`,3),fd()()),e&2&&(ZC(),kS(i.data.options.length>3?1:-1),ZC(),Fy(`cdkListboxValue`,i.visibleSelection())(`cdkListboxMultiple`,i.data.multiple),ZC(),jS(i.options()))},dependencies:[W,S,bn,je,vn,Lt,r],styles:[`.filter-select-dialog[_ngcontent-%COMP%]{display:grid;max-block-size:min(24rem,100dvh - 1rem);gap:var(--%NS%space-1);padding:var(--%NS%space-1);overflow:hidden;border:1px solid var(--%NS%color-line-strong);border-radius:var(--%NS%radius-sm);background:var(--%NS%color-surface-raised);color:var(--%NS%color-ink);box-shadow:var(--%NS%shadow-page)}.search-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:var(--%NS%space-1)}.search-row[_ngcontent-%COMP%]{border-radius:var(--%NS%radius-xs);background:var(--%NS%color-surface-sunken)}.search-row[_ngcontent-%COMP%]:focus-within{outline:2px solid var(--%NS%color-focus);outline-offset:-2px}.search-row[_ngcontent-%COMP%] > app-icon[_ngcontent-%COMP%]{flex:none;margin-inline-start:var(--%NS%space-2);color:var(--%NS%color-muted)}.search-row[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{flex:1;min-inline-size:0;min-block-size:2rem;padding:var(--%NS%space-1);border:0;outline:0;background:transparent;color:inherit;font:inherit;font-size:var(--%NS%text-sm)}.search-row[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus-visible{outline:none;box-shadow:none}ul[_ngcontent-%COMP%]{display:grid;margin:0;padding:0;overflow-y:auto;list-style:none}.option[_ngcontent-%COMP%]{inline-size:100%;min-block-size:1.75rem;padding:.2rem var(--%NS%space-2);border:0;border-block-end:1px solid var(--%NS%color-line);background:transparent;color:inherit;font-size:var(--%NS%text-sm);text-align:start;cursor:pointer}.option[_ngcontent-%COMP%]:hover, .option[aria-selected=true][_ngcontent-%COMP%]{background:var(--%NS%color-surface-sunken)}.option[aria-selected=true][_ngcontent-%COMP%]{font-weight:700}.option[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--%NS%color-focus);outline-offset:-2px}.empty[_ngcontent-%COMP%]{padding:var(--%NS%space-1) var(--%NS%space-2);color:var(--%NS%color-muted)}`]})};var Ae=class o{dialogs=g(is);destroyRef=g(pe);element=g(Hn);i18n=g(Ie);overlay=g(Po);dialogId=g(W$1).getId(`filter-select-`);opened=Ke(!1);active;constructor(){this.destroyRef.onDestroy(()=>this.active?.close())}pointerOpen(t){t.button===0&&(t.preventDefault(),this.open())}preventNativeOpen(t){t.preventDefault(),this.open()}keyboardOpen(t){[`Enter`,` `,`ArrowDown`,`ArrowUp`].includes(t.key)&&(t.preventDefault(),this.open())}async open(){let t=this.element.nativeElement;if(t.disabled||this.active!==void 0)return;let e=Array.from(t.options,l=>({disabled:l.disabled,label:l.label.trim()||this.i18n.t(`listControls.none`),value:l.value})),i=Array.from(t.selectedOptions,l=>l.value),n=this.label(t),s=e.length>3?`[data-filter-select-search]`:e.some(l=>!l.disabled)?`.option:not([aria-disabled="true"])`:`dialog`,a=this.overlay.position().flexibleConnectedTo(t).withPositions([{originX:`start`,originY:`bottom`,overlayX:`start`,overlayY:`top`,offsetY:8},{originX:`end`,originY:`bottom`,overlayX:`end`,overlayY:`top`,offsetY:8},{originX:`start`,originY:`top`,overlayX:`start`,overlayY:`bottom`,offsetY:-8},{originX:`end`,originY:`top`,overlayX:`end`,overlayY:`bottom`,offsetY:-8}]).withViewportMargin(8).withPush(!0),d=this.dialogs.open(P,{id:this.dialogId,data:{commit:l=>this.update(t,l),multiple:t.multiple,options:e,selected:i},role:`dialog`,ariaModal:!0,ariaLabel:n,autoFocus:s,restoreFocus:!0,hasBackdrop:!0,backdropClass:`cdk-overlay-transparent-backdrop`,disableClose:!1,disableAnimations:!0,positionStrategy:a,width:`${Math.max(320,t.getBoundingClientRect().width)}px`,maxWidth:`calc(100vw - 2rem)`});this.active=d,this.opened.set(!0);try{let l=await JD(d.closed,{defaultValue:void 0});if(l===void 0||this.destroyRef.destroyed)return;this.update(t,l)}finally{this.active=void 0,this.opened.set(!1)}}update(t,e){for(let i of t.options)i.selected=e.includes(i.value);t.dispatchEvent(new Event(`input`,{bubbles:!0})),t.dispatchEvent(new Event(`change`,{bubbles:!0}))}label(t){let e=t.getAttribute(`aria-label`);if(e)return e;let i=t.labels?.[0];if(i===void 0)return t.name;let n=document.createElement(`label`);return n.append(...Array.from(i.childNodes,s=>s.cloneNode(!0))),n.querySelector(`select`)?.remove(),n.textContent?.trim()||t.name}static ɵfac=function(e){return new(e||o)};static ɵdir=ad({type:o,selectors:[[`select`,`appFilterSelect`,``]],hostAttrs:[`aria-haspopup`,`dialog`,1,`filter-select`],hostVars:4,hostBindings:function(e,i){e&1&&Gy(`mousedown`,function(s){return i.pointerOpen(s)})(`click`,function(s){return i.preventNativeOpen(s)})(`keydown`,function(s){return i.keyboardOpen(s)}),e&2&&(ky(`aria-controls`,i.opened()?i.dialogId:null)(`aria-expanded`,i.opened()),Xy(`select`,!0))}})};export{Ae 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,Ir as wp,It as Us,Jr as zS,K as Ke,Nr as vd,Rn as jS,S as FS,Tn as fd,Wn as kS,Wr as y_,X as LS,ft as Ol,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{T as ue,m as Ie$1,r as N,v as Dt,y as G}from"./main-F7D3L737.js";import{wi as wu}from"./chunk-BAe_07VM.js";import"./chunk-Dv9sNWWK.js";import{$r as T,Gr as S0,On as LC,U as DC,du as x0,ht as FC,pi as Uh,vr as PC,zn as MC,zt as HC}from"./chunk-D5qmP2Wu.js";import"./chunk-BzUDWIzm.js";import"./chunk-CczD0yXn.js";import"./chunk-CReShp-B.js";import{t as Ae}from"./chunk-DM5aibnW.js";import{a as fn,c as ir,d as nr,f as or,h as yn,o as gn,r as cn,t as P,u as mn}from"./chunk-CSkyOfSg.js";import{t as g$1}from"./chunk-B56nz2lI.js";import{t as k}from"./chunk-D5MFwK9L.js";import{t as P$1}from"./chunk-niXXbm7H.js";import{t as S}from"./chunk-D6k6pmdU.js";import{t as f}from"./chunk-POMKwNf_.js";import{t as c}from"./chunk-nC_XlFOG.js";import{a as u,i as m$1}from"./chunk-Dx1NwQCW.js";var ge=(d,i)=>i.id;function ye(d,i){if(d&1&&(Us(0,`p`,4),y_(1),fd()),d&2){let e=qS();ZC(),nv(e.i18n.t(i))}}function Ie(d,i){if(d&1&&(Us(0,`p`,5),y_(1),fd()),d&2){let e=qS();ZC(),nv(e.i18n.t(`supplierInvoice.loadingDetail`))}}function xe(d,i){if(d&1&&(Us(0,`option`,13),y_(1),fd()),d&2){let e=i.$implicit;Fy(`value`,e.id),ZC(),nv(e.displayName)}}function he(d,i){if(d&1){let e=zS();Us(0,`div`,16)(1,`label`,10),y_(2),Py(3,`input`,14),qT(),fd(),Us(4,`label`,10),y_(5),Py(6,`input`,22),qT(),fd(),Us(7,`label`,10),y_(8),Py(9,`input`,22),qT(),fd(),Us(10,`button`,23),Gy(`click`,function(){let a=Ip(e).$index;return wp(qS(2).removeLine(a))}),y_(11),fd()()}if(d&2){let e=i.$implicit,t=qS(2);ZC(2),nv(t.i18n.t(`supplierInvoice.description`)),ZC(),Fy(`formField`,e.description),ZT(),ZC(2),nv(t.i18n.t(`supplierInvoice.netAmount`)),ZC(),Fy(`formField`,e.netAmount),ZT(),ZC(2),nv(t.i18n.t(`supplierInvoice.vatRate`)),ZC(),Fy(`formField`,e.vatRate),ZT(),ZC(),Fy(`disabled`,t.model().lines.length===1),ZC(),vd(` `,t.i18n.t(`supplierInvoice.removeLine`),` `)}}function _e(d,i){if(d&1){let e=zS();Us(0,`form`,7),Gy(`submit`,function(a){Ip(e);return wp(qS().save(a))}),Us(1,`div`,8)(2,`div`,9)(3,`label`,10),y_(4),Us(5,`select`,11)(6,`option`,12),y_(7),fd(),LS(8,xe,2,2,`option`,13,ge),fd(),qT(),fd(),Us(10,`label`,10),y_(11),Py(12,`input`,14),qT(),fd(),Us(13,`label`,10),y_(14),Py(15,`input`,15),qT(),fd(),Us(16,`label`,10),y_(17),Py(18,`input`,15),qT(),fd(),Us(19,`label`,10),y_(20),Py(21,`input`,14),qT(),fd()()(),Us(22,`div`,8)(23,`fieldset`)(24,`legend`),y_(25),fd(),LS(26,he,12,8,`div`,16,FS),Us(28,`button`,17),Gy(`click`,function(){Ip(e);return wp(qS().addLine())}),y_(29),fd()()(),Us(30,`div`,8)(31,`label`,10),y_(32),Py(33,`textarea`,18),qT(),fd()(),Us(34,`div`,19)(35,`button`,20),y_(36),fd(),Us(37,`a`,21),y_(38),fd()()()}if(d&2){let e=qS();ZC(4),nv(e.i18n.t(`supplierInvoice.supplier`)),ZC(),Fy(`formField`,e.invoiceForm.supplierId),ZT(),ZC(2),nv(e.i18n.t(`supplierInvoice.chooseSupplier`)),ZC(),jS(e.suppliers()),ZC(3),nv(e.i18n.t(`supplierInvoice.reference`)),ZC(),Fy(`formField`,e.invoiceForm.reference),ZT(),ZC(2),nv(e.i18n.t(`supplierInvoice.invoiceDate`)),ZC(),Fy(`formField`,e.invoiceForm.invoiceDate),ZT(),ZC(2),nv(e.i18n.t(`supplierInvoice.dueDate`)),ZC(),Fy(`formField`,e.invoiceForm.dueDate),ZT(),ZC(2),nv(e.i18n.t(`supplierInvoice.currency`)),ZC(),Fy(`formField`,e.invoiceForm.currency),ZT(),ZC(4),nv(e.i18n.t(`supplierInvoice.lines`)),ZC(),jS(e.invoiceForm.lines),ZC(3),vd(` `,e.i18n.t(`supplierInvoice.addLine`),` `),ZC(3),nv(e.i18n.t(`supplierInvoice.notes`)),ZC(),Fy(`formField`,e.invoiceForm.notes),ZT(),ZC(2),Fy(`disabled`,e.saving()),ZC(),vd(` `,e.i18n.t(`supplierInvoice.save`)),ZC(2),nv(e.i18n.t(`supplierInvoice.cancel`))}}var fe=()=>({description:``,netAmount:``,vatRate:``});var be=()=>({supplierId:``,reference:``,invoiceDate:``,dueDate:``,currency:`EUR`,notes:``,lines:[fe()]});var ve=class d{i18n=g(Ie$1);api=g(S);suppliersApi=g(c);route=g(G);router=g(ue);confirmation=g(P$1);requestId=crypto.randomUUID();invoiceId=this.route.snapshot.paramMap.get(`invoiceId`);invoice=Ke(void 0);editing=this.invoiceId!==null;suppliers=Ke([]);model=Ke(be());invoiceForm=nr(this.model,i=>{gn(i.supplierId),gn(i.reference),mn(i.reference,/\S/),cn(i.reference,80),gn(i.invoiceDate),P(i.invoiceDate,({value:e})=>wu.is(T)(e())?void 0:{kind:`date`}),gn(i.dueDate),P(i.dueDate,({value:e,valueOf:t})=>!wu.is(T)(e())||e()<t(i.invoiceDate)?{kind:`date`}:void 0),gn(i.currency),mn(i.currency,/^[A-Z]{3}$/),cn(i.notes,MC),fn(i.lines,1),ir(i.lines,e=>{gn(e.description),mn(e.description,/\S/),cn(e.description,500),P(e.netAmount,({value:t})=>{let a=u(t(),2);return a===void 0||a<0||a>4e12?{kind:`amount`}:void 0}),P(e.vatRate,({value:t})=>{let a=u(t(),2);return a===void 0||a<0||a>1e4?{kind:`rate`}:void 0})})});loading=Ke(!0);saving=Ke(!1);completed=Ke(!1);error=Ke(void 0);breadcrumbs=Ke([{label:this.i18n.t(`supplierInvoice.title`),path:`/purchases`}]);constructor(){Ol(()=>{this.load()})}title(){return this.i18n.t(this.editing?`supplierInvoice.editTitle`:`supplierInvoice.createTitle`)}addLine(){this.model().lines.length>=500||(this.model.update(i=>m(l({},i),{lines:[...i.lines,fe()]})),this.invoiceForm().markAsDirty())}removeLine(i){this.model().lines.length!==1&&(this.model.update(e=>m(l({},e),{lines:e.lines.filter((t,a)=>a!==i)})),this.invoiceForm().markAsDirty())}save(i){if(i.preventDefault(),this.saving()||this.invoiceForm().invalid()){this.invoiceForm().markAsTouched();return}let e=this.decodeLines();if(!e){this.invoiceForm().markAsTouched();return}or(this.invoiceForm,async()=>{this.saving.set(!0),this.error.set(void 0);try{let t=this.model(),a={supplierId:t.supplierId,reference:t.reference,invoiceDate:t.invoiceDate,dueDate:t.dueDate,currency:t.currency,notes:t.notes,lines:e},v=this.invoice(),k=v?await this.api.update(v.id,m(l({},a),{expectedVersion:v.version})):await this.api.create(m(l({},a),{requestId:this.requestId,source:`manual`,sourceFileName:null,externalSubmissionId:null}));if(!k.success){this.error.set(k.code);return}this.completed.set(!0),this.invoiceForm().reset(this.model()),await this.router.navigate([`/purchases`,k.result.id])}catch{this.error.set(`supplierInvoice.error`)}finally{this.saving.set(!1)}})}canDeactivate(){return this.saving()?!1:this.completed()||!this.invoiceForm().dirty()||this.confirmation.request(this.i18n.t(`supplierInvoice.unsavedChanges`))}beforeUnload(i){(this.saving()||this.invoiceForm().dirty())&&i.preventDefault()}decodeLines(){let i=this.model().lines.map(t=>({description:t.description,netTotalCents:u(t.netAmount,2),vatRateBasisPoints:u(t.vatRate,2)}));if(i.some(t=>t.netTotalCents===void 0||t.vatRateBasisPoints===void 0))return;let e=wu.Array(Uh);return wu.is(e)(i)?i:void 0}async load(){try{if(this.suppliers.set((await this.suppliersApi.list()).filter(({archived:e})=>!e)),!this.invoiceId)return;let i=await this.api.get(this.invoiceId);if(!i.success){this.error.set(i.code);return}if(i.result.status!==`draft`){this.error.set(`supplier_invoice.not_editable`);return}this.invoice.set(i.result),this.invoiceForm().reset({supplierId:i.result.supplierId,reference:i.result.reference,invoiceDate:i.result.invoiceDate,dueDate:i.result.dueDate,currency:i.result.currency,notes:i.result.notes,lines:i.result.lines.map(e=>({description:e.description,netAmount:m$1(e.netTotalCents,2),vatRate:m$1(e.vatRateBasisPoints,2)}))})}catch{this.error.set(`supplierInvoice.error`)}finally{this.loading.set(!1)}}static ɵfac=function(e){return new(e||d)};static ɵcmp=Fb({type:d,selectors:[[`app-supplier-invoice-editor`]],hostAttrs:[1,`page-container`],hostBindings:function(e,t){e&1&&Gy(`beforeunload`,function(v){return t.beforeUnload(v)},Zw)},decls:10,vars:7,consts:[[`aria-labelledby`,`supplier-invoice-editor-title`,1,`detail-page`,`form-page`],[`layout`,`stacked`],[`pageBack`,``,3,`label`,`items`,`current`],[`id`,`supplier-invoice-editor-title`],[`appNotice`,``,`variant`,`danger`,`role`,`alert`],[`role`,`status`],[`novalidate`,``],[`novalidate`,``,3,`submit`],[1,`ds-panel`,`form-panel`],[1,`field-grid`],[1,`field`],[`appFilterSelect`,``,1,`select`,3,`formField`],[`value`,``],[3,`value`],[1,`input`,3,`formField`],[`type`,`date`,1,`input`,3,`formField`],[1,`line-grid`],[`appButton`,``,`type`,`button`,3,`click`],[`rows`,`4`,1,`textarea`,3,`formField`],[1,`spacer-x-2`],[`appButton`,``,`variant`,`primary`,`type`,`submit`,3,`disabled`],[`appLinkButton`,``,`routerLink`,`/purchases`],[`inputmode`,`decimal`,1,`input`,3,`formField`],[`appButton`,``,`type`,`button`,3,`click`,`disabled`]],template:function(e,t){if(e&1&&(Us(0,`section`,0)(1,`app-page-header`,1),Py(2,`app-breadcrumbs`,2),Us(3,`h1`,3),y_(4),fd(),Us(5,`p`),y_(6),fd()(),OS(7,ye,2,1,`p`,4),OS(8,Ie,2,1,`p`,5)(9,_e,39,18,`form`,6),fd()),e&2){let a;ZC(2),Fy(`label`,t.i18n.t(`backOfficeShell.breadcrumb`))(`items`,t.breadcrumbs())(`current`,t.title()),ZC(2),nv(t.title()),ZC(2),nv(t.i18n.t(`supplierInvoice.editorIntro`)),ZC(),kS((a=t.error())?7:-1,a),ZC(),kS(t.loading()?8:9)}},dependencies:[Ae,f,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}}.form-panel[_ngcontent-%COMP%] + .form-panel[_ngcontent-%COMP%], .spacer-x-2[_ngcontent-%COMP%]{margin-block-start:var(--%NS%space-4)}.line-grid[_ngcontent-%COMP%]{display:grid;gap:var(--%NS%space-3);grid-template-columns:minmax(12rem,1fr) 9rem 7rem auto;align-items:end;margin-block-end:var(--%NS%space-3)}@media(max-width:48rem){.line-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}`]})};export{ve as SupplierInvoiceEditor};
|