deepsky-core 1.72.1 → 1.74.0
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/dist/5bf5f15d35548e30d0d2.woff2 +0 -0
- package/dist/fonts/{iconfont-6894344309e5cfb1c9c6.ttf → iconfont-4b5d6c67ba7fc21d3848.ttf} +0 -0
- package/dist/fonts/iconfont-886b64652046b0bbee9b.woff +0 -0
- package/dist/index.css +48 -34
- package/dist/index.d.ts +11 -5
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/1572564be74af39b6a14.woff2 +0 -0
- package/dist/fonts/iconfont-d439664f2799cb7c893c.woff +0 -0
- /package/dist/chunk/{1037-66a27e7af2992c3cc6c4.js → 1037-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{1066-66a27e7af2992c3cc6c4.js → 1066-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{1216-66a27e7af2992c3cc6c4.js → 1216-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{1230-66a27e7af2992c3cc6c4.js → 1230-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{1425-66a27e7af2992c3cc6c4.js → 1425-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{1432-66a27e7af2992c3cc6c4.js → 1432-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{1476-66a27e7af2992c3cc6c4.js → 1476-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{1545-66a27e7af2992c3cc6c4.js → 1545-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{16-66a27e7af2992c3cc6c4.js → 16-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{1624-66a27e7af2992c3cc6c4.js → 1624-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{1631-66a27e7af2992c3cc6c4.js → 1631-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{1655-66a27e7af2992c3cc6c4.js → 1655-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{1708-66a27e7af2992c3cc6c4.js → 1708-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{172-66a27e7af2992c3cc6c4.js → 172-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{1729-66a27e7af2992c3cc6c4.js → 1729-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{1757-66a27e7af2992c3cc6c4.js → 1757-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{1803-66a27e7af2992c3cc6c4.js → 1803-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{1839-66a27e7af2992c3cc6c4.js → 1839-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{1857-66a27e7af2992c3cc6c4.js → 1857-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{1931-66a27e7af2992c3cc6c4.js → 1931-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{2062-66a27e7af2992c3cc6c4.js → 2062-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{2068-66a27e7af2992c3cc6c4.js → 2068-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{2071-66a27e7af2992c3cc6c4.js → 2071-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{2108-66a27e7af2992c3cc6c4.js → 2108-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{212-66a27e7af2992c3cc6c4.js → 212-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{2142-66a27e7af2992c3cc6c4.js → 2142-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{2173-66a27e7af2992c3cc6c4.js → 2173-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{2184-66a27e7af2992c3cc6c4.js → 2184-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{2215-66a27e7af2992c3cc6c4.js → 2215-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{224-66a27e7af2992c3cc6c4.js → 224-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{2266-66a27e7af2992c3cc6c4.js → 2266-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{2354-66a27e7af2992c3cc6c4.js → 2354-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{2419-66a27e7af2992c3cc6c4.js → 2419-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{245-66a27e7af2992c3cc6c4.js → 245-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{2473-66a27e7af2992c3cc6c4.js → 2473-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{2492-66a27e7af2992c3cc6c4.js → 2492-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{2505-66a27e7af2992c3cc6c4.js → 2505-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{2535-66a27e7af2992c3cc6c4.js → 2535-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{2660-66a27e7af2992c3cc6c4.js → 2660-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{2691-66a27e7af2992c3cc6c4.js → 2691-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{2723-66a27e7af2992c3cc6c4.js → 2723-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{284-66a27e7af2992c3cc6c4.js → 284-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{2860-66a27e7af2992c3cc6c4.js → 2860-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{2861-66a27e7af2992c3cc6c4.js → 2861-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{2934-66a27e7af2992c3cc6c4.js → 2934-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{3032-66a27e7af2992c3cc6c4.js → 3032-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{3043-66a27e7af2992c3cc6c4.js → 3043-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{3052-66a27e7af2992c3cc6c4.js → 3052-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{3124-66a27e7af2992c3cc6c4.js → 3124-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{3170-66a27e7af2992c3cc6c4.js → 3170-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{321-66a27e7af2992c3cc6c4.js → 321-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{3227-66a27e7af2992c3cc6c4.js → 3227-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{3247-66a27e7af2992c3cc6c4.js → 3247-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{327-66a27e7af2992c3cc6c4.js → 327-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{3279-66a27e7af2992c3cc6c4.js → 3279-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{3330-66a27e7af2992c3cc6c4.js → 3330-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{3403-66a27e7af2992c3cc6c4.js → 3403-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{3454-66a27e7af2992c3cc6c4.js → 3454-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{3492-66a27e7af2992c3cc6c4.js → 3492-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{3516-66a27e7af2992c3cc6c4.js → 3516-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{3593-66a27e7af2992c3cc6c4.js → 3593-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{3646-66a27e7af2992c3cc6c4.js → 3646-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{3702-66a27e7af2992c3cc6c4.js → 3702-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{3720-66a27e7af2992c3cc6c4.js → 3720-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{3837-66a27e7af2992c3cc6c4.js → 3837-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{3874-66a27e7af2992c3cc6c4.js → 3874-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{3894-66a27e7af2992c3cc6c4.js → 3894-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{3906-66a27e7af2992c3cc6c4.js → 3906-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{3941-66a27e7af2992c3cc6c4.js → 3941-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{3947-66a27e7af2992c3cc6c4.js → 3947-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{3949-66a27e7af2992c3cc6c4.js → 3949-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{396-66a27e7af2992c3cc6c4.js → 396-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{3972-66a27e7af2992c3cc6c4.js → 3972-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{4007-66a27e7af2992c3cc6c4.js → 4007-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{4009-66a27e7af2992c3cc6c4.js → 4009-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{402-66a27e7af2992c3cc6c4.js → 402-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{4081-66a27e7af2992c3cc6c4.js → 4081-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{41-66a27e7af2992c3cc6c4.js → 41-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{4108-66a27e7af2992c3cc6c4.js → 4108-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{4112-66a27e7af2992c3cc6c4.js → 4112-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{415-66a27e7af2992c3cc6c4.js → 415-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{4199-66a27e7af2992c3cc6c4.js → 4199-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{4214-66a27e7af2992c3cc6c4.js → 4214-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{4236-66a27e7af2992c3cc6c4.js → 4236-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{4283-66a27e7af2992c3cc6c4.js → 4283-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{4292-66a27e7af2992c3cc6c4.js → 4292-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{4311-66a27e7af2992c3cc6c4.js → 4311-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{4354-66a27e7af2992c3cc6c4.js → 4354-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{4385-66a27e7af2992c3cc6c4.js → 4385-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{4408-66a27e7af2992c3cc6c4.js → 4408-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{4445-66a27e7af2992c3cc6c4.js → 4445-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{4451-66a27e7af2992c3cc6c4.js → 4451-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{4452-66a27e7af2992c3cc6c4.js → 4452-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{4465-66a27e7af2992c3cc6c4.js → 4465-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{4520-66a27e7af2992c3cc6c4.js → 4520-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{454-66a27e7af2992c3cc6c4.js → 454-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{4546-66a27e7af2992c3cc6c4.js → 4546-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{4552-66a27e7af2992c3cc6c4.js → 4552-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{4598-66a27e7af2992c3cc6c4.js → 4598-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{4614-66a27e7af2992c3cc6c4.js → 4614-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{4660-66a27e7af2992c3cc6c4.js → 4660-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{4697-66a27e7af2992c3cc6c4.js → 4697-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{4709-66a27e7af2992c3cc6c4.js → 4709-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{4714-66a27e7af2992c3cc6c4.js → 4714-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{4780-66a27e7af2992c3cc6c4.js → 4780-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{4838-66a27e7af2992c3cc6c4.js → 4838-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{4843-66a27e7af2992c3cc6c4.js → 4843-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{4862-66a27e7af2992c3cc6c4.js → 4862-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{4877-66a27e7af2992c3cc6c4.js → 4877-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{4886-66a27e7af2992c3cc6c4.js → 4886-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{489-66a27e7af2992c3cc6c4.js → 489-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{4914-66a27e7af2992c3cc6c4.js → 4914-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{4940-66a27e7af2992c3cc6c4.js → 4940-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{4962-66a27e7af2992c3cc6c4.js → 4962-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{5026-66a27e7af2992c3cc6c4.js → 5026-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{5034-66a27e7af2992c3cc6c4.js → 5034-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{5050-66a27e7af2992c3cc6c4.js → 5050-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{5099-66a27e7af2992c3cc6c4.js → 5099-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{5119-66a27e7af2992c3cc6c4.js → 5119-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{5141-66a27e7af2992c3cc6c4.js → 5141-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{5143-66a27e7af2992c3cc6c4.js → 5143-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{5177-66a27e7af2992c3cc6c4.js → 5177-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{5203-66a27e7af2992c3cc6c4.js → 5203-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{5283-66a27e7af2992c3cc6c4.js → 5283-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{5314-66a27e7af2992c3cc6c4.js → 5314-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{535-66a27e7af2992c3cc6c4.js → 535-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{5363-66a27e7af2992c3cc6c4.js → 5363-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{542-66a27e7af2992c3cc6c4.js → 542-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{5424-66a27e7af2992c3cc6c4.js → 5424-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{5443-66a27e7af2992c3cc6c4.js → 5443-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{5521-66a27e7af2992c3cc6c4.js → 5521-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{5536-66a27e7af2992c3cc6c4.js → 5536-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{5542-66a27e7af2992c3cc6c4.js → 5542-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{5585-66a27e7af2992c3cc6c4.js → 5585-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{5589-66a27e7af2992c3cc6c4.js → 5589-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{5601-66a27e7af2992c3cc6c4.js → 5601-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{5611-66a27e7af2992c3cc6c4.js → 5611-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{5628-66a27e7af2992c3cc6c4.js → 5628-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{5638-66a27e7af2992c3cc6c4.js → 5638-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{5647-66a27e7af2992c3cc6c4.js → 5647-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{5709-66a27e7af2992c3cc6c4.js → 5709-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{5728-66a27e7af2992c3cc6c4.js → 5728-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{5731-66a27e7af2992c3cc6c4.js → 5731-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{5744-66a27e7af2992c3cc6c4.js → 5744-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{5814-66a27e7af2992c3cc6c4.js → 5814-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{5827-66a27e7af2992c3cc6c4.js → 5827-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{5884-66a27e7af2992c3cc6c4.js → 5884-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{5891-66a27e7af2992c3cc6c4.js → 5891-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{5936-66a27e7af2992c3cc6c4.js → 5936-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{5954-66a27e7af2992c3cc6c4.js → 5954-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{6010-66a27e7af2992c3cc6c4.js → 6010-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{6045-66a27e7af2992c3cc6c4.js → 6045-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{6083-66a27e7af2992c3cc6c4.js → 6083-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{6124-66a27e7af2992c3cc6c4.js → 6124-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{6173-66a27e7af2992c3cc6c4.js → 6173-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{6239-66a27e7af2992c3cc6c4.js → 6239-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{6262-66a27e7af2992c3cc6c4.js → 6262-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{6283-66a27e7af2992c3cc6c4.js → 6283-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{6297-66a27e7af2992c3cc6c4.js → 6297-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{6324-66a27e7af2992c3cc6c4.js → 6324-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{6343-66a27e7af2992c3cc6c4.js → 6343-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{6356-66a27e7af2992c3cc6c4.js → 6356-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{638-66a27e7af2992c3cc6c4.js → 638-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{6405-66a27e7af2992c3cc6c4.js → 6405-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{6514-66a27e7af2992c3cc6c4.js → 6514-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{6517-66a27e7af2992c3cc6c4.js → 6517-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{6563-66a27e7af2992c3cc6c4.js → 6563-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{6577-66a27e7af2992c3cc6c4.js → 6577-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{6677-66a27e7af2992c3cc6c4.js → 6677-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{6736-66a27e7af2992c3cc6c4.js → 6736-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{6757-66a27e7af2992c3cc6c4.js → 6757-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{6865-66a27e7af2992c3cc6c4.js → 6865-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{6940-66a27e7af2992c3cc6c4.js → 6940-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{6957-66a27e7af2992c3cc6c4.js → 6957-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{6964-66a27e7af2992c3cc6c4.js → 6964-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{6967-66a27e7af2992c3cc6c4.js → 6967-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{697-66a27e7af2992c3cc6c4.js → 697-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{6980-66a27e7af2992c3cc6c4.js → 6980-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{7095-66a27e7af2992c3cc6c4.js → 7095-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{7141-66a27e7af2992c3cc6c4.js → 7141-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{7145-66a27e7af2992c3cc6c4.js → 7145-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{7148-66a27e7af2992c3cc6c4.js → 7148-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{7217-66a27e7af2992c3cc6c4.js → 7217-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{7258-66a27e7af2992c3cc6c4.js → 7258-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{7328-66a27e7af2992c3cc6c4.js → 7328-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{7374-66a27e7af2992c3cc6c4.js → 7374-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{7434-66a27e7af2992c3cc6c4.js → 7434-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{7470-66a27e7af2992c3cc6c4.js → 7470-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{7504-66a27e7af2992c3cc6c4.js → 7504-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{753-66a27e7af2992c3cc6c4.js → 753-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{7549-66a27e7af2992c3cc6c4.js → 7549-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{7561-66a27e7af2992c3cc6c4.js → 7561-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{7567-66a27e7af2992c3cc6c4.js → 7567-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{7611-66a27e7af2992c3cc6c4.js → 7611-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{7615-66a27e7af2992c3cc6c4.js → 7615-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{7625-66a27e7af2992c3cc6c4.js → 7625-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{7642-66a27e7af2992c3cc6c4.js → 7642-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{7670-66a27e7af2992c3cc6c4.js → 7670-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{7681-66a27e7af2992c3cc6c4.js → 7681-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{7688-66a27e7af2992c3cc6c4.js → 7688-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{7765-66a27e7af2992c3cc6c4.js → 7765-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{7768-66a27e7af2992c3cc6c4.js → 7768-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{7788-66a27e7af2992c3cc6c4.js → 7788-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{7789-66a27e7af2992c3cc6c4.js → 7789-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{780-66a27e7af2992c3cc6c4.js → 780-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{7817-66a27e7af2992c3cc6c4.js → 7817-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{7824-66a27e7af2992c3cc6c4.js → 7824-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{7831-66a27e7af2992c3cc6c4.js → 7831-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{7900-66a27e7af2992c3cc6c4.js → 7900-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{7922-66a27e7af2992c3cc6c4.js → 7922-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{7927-66a27e7af2992c3cc6c4.js → 7927-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{794-66a27e7af2992c3cc6c4.js → 794-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{7966-66a27e7af2992c3cc6c4.js → 7966-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{8003-66a27e7af2992c3cc6c4.js → 8003-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{8093-66a27e7af2992c3cc6c4.js → 8093-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{8107-66a27e7af2992c3cc6c4.js → 8107-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{8201-66a27e7af2992c3cc6c4.js → 8201-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{8212-66a27e7af2992c3cc6c4.js → 8212-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{8234-66a27e7af2992c3cc6c4.js → 8234-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{8235-66a27e7af2992c3cc6c4.js → 8235-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{8237-66a27e7af2992c3cc6c4.js → 8237-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{8249-66a27e7af2992c3cc6c4.js → 8249-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{8320-66a27e7af2992c3cc6c4.js → 8320-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{8389-66a27e7af2992c3cc6c4.js → 8389-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{8393-66a27e7af2992c3cc6c4.js → 8393-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{8418-66a27e7af2992c3cc6c4.js → 8418-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{8426-66a27e7af2992c3cc6c4.js → 8426-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{8436-66a27e7af2992c3cc6c4.js → 8436-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{845-66a27e7af2992c3cc6c4.js → 845-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{8485-66a27e7af2992c3cc6c4.js → 8485-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{8499-66a27e7af2992c3cc6c4.js → 8499-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{8553-66a27e7af2992c3cc6c4.js → 8553-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{8617-66a27e7af2992c3cc6c4.js → 8617-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{8684-66a27e7af2992c3cc6c4.js → 8684-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{8700-66a27e7af2992c3cc6c4.js → 8700-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{8709-66a27e7af2992c3cc6c4.js → 8709-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{8711-66a27e7af2992c3cc6c4.js → 8711-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{874-66a27e7af2992c3cc6c4.js → 874-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{8753-66a27e7af2992c3cc6c4.js → 8753-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{8849-66a27e7af2992c3cc6c4.js → 8849-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{8931-66a27e7af2992c3cc6c4.js → 8931-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{9017-66a27e7af2992c3cc6c4.js → 9017-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{9045-66a27e7af2992c3cc6c4.js → 9045-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{9057-66a27e7af2992c3cc6c4.js → 9057-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{9077-66a27e7af2992c3cc6c4.js → 9077-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{9079-66a27e7af2992c3cc6c4.js → 9079-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{9096-66a27e7af2992c3cc6c4.js → 9096-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{9104-66a27e7af2992c3cc6c4.js → 9104-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{914-66a27e7af2992c3cc6c4.js → 914-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{9175-66a27e7af2992c3cc6c4.js → 9175-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{9179-66a27e7af2992c3cc6c4.js → 9179-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{9198-66a27e7af2992c3cc6c4.js → 9198-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{9206-66a27e7af2992c3cc6c4.js → 9206-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{9225-66a27e7af2992c3cc6c4.js → 9225-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{9270-66a27e7af2992c3cc6c4.js → 9270-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{9281-66a27e7af2992c3cc6c4.js → 9281-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{9294-66a27e7af2992c3cc6c4.js → 9294-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{9478-66a27e7af2992c3cc6c4.js → 9478-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{9524-66a27e7af2992c3cc6c4.js → 9524-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{9526-66a27e7af2992c3cc6c4.js → 9526-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{9556-66a27e7af2992c3cc6c4.js → 9556-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{9641-66a27e7af2992c3cc6c4.js → 9641-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{9661-66a27e7af2992c3cc6c4.js → 9661-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{9681-66a27e7af2992c3cc6c4.js → 9681-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{9689-66a27e7af2992c3cc6c4.js → 9689-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{9692-66a27e7af2992c3cc6c4.js → 9692-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{9728-66a27e7af2992c3cc6c4.js → 9728-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{9730-66a27e7af2992c3cc6c4.js → 9730-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{9780-66a27e7af2992c3cc6c4.js → 9780-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{9788-66a27e7af2992c3cc6c4.js → 9788-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{9806-66a27e7af2992c3cc6c4.js → 9806-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{9809-66a27e7af2992c3cc6c4.js → 9809-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{9819-66a27e7af2992c3cc6c4.js → 9819-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{9831-66a27e7af2992c3cc6c4.js → 9831-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{9845-66a27e7af2992c3cc6c4.js → 9845-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{9876-66a27e7af2992c3cc6c4.js → 9876-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{9904-66a27e7af2992c3cc6c4.js → 9904-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{9910-66a27e7af2992c3cc6c4.js → 9910-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{9965-66a27e7af2992c3cc6c4.js → 9965-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{9976-66a27e7af2992c3cc6c4.js → 9976-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{9982-66a27e7af2992c3cc6c4.js → 9982-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{9983-66a27e7af2992c3cc6c4.js → 9983-e1fc4b00c638b8b704eb.js} +0 -0
- /package/dist/chunk/{9984-66a27e7af2992c3cc6c4.js → 9984-e1fc4b00c638b8b704eb.js} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.deepsky=t():e.deepsky=t()}(self,()=>(()=>{var e,t,n={539:(e,t,n)=>{"use strict";n.d(t,{Wu:()=>m,Eb:()=>p,w4:()=>h});var r=n(4743),i=n(4116),s=n(9513),o=n(3028),a=n(6753),l=n(7633),c=n(4089),d=n(2551);function u(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}const h=new Map;function p(e){return(t,n)=>{let r=t[n];h.set(e,r)}}class m extends a.K{handlers=(0,l.Kh)(new Map);data;get meta(){return m.meta}constructor(e){super(e),this.data=(0,l.Kh)(m.default_hotkeys)}listen(e){this.listen_cursor_hotkey(e),this.listen_uncursor_hotkey(e),this.listen_cvx(e)}listen_cursor_hotkey(e){const t=this;e.addEventListener("keydown",e=>{const n=t.stats.mode,o=e.key.toLowerCase(),a=document.activeElement;let l=!1;if(n===s.fv.edit&&a!==document.body){for(let[n,r]of h){let i=t.data[n];i.cursor&&t.validate(e,i)&&(console.log("🟪命中快捷键",i.name),l=!0,r.bind(t)(e))}for(let[n,r]of t.handlers){let i=t.data[n];i.cursor&&t.validate(e,i)&&(console.log("🟪命中快捷键",i.name),l=!0,r(e))}if(!l&&"tab"===o){l=!0;const{cursor:t,courier:n,history:s}=this,{cube_end:o,cube_start:a,offset_start:c,offset_end:d,has_selection:u,cube_selection:h}=t,p=n.get_recorder();if(!h||!o||!a)return;e.preventDefault(),u&&p.tell(h,i.VL.delete(h.id,"backward",a.id,o.id,c,d,!0));const m=a.text,f=m.slice(0,c)+"\t"+m.slice(c);p.tell(a,r.zl.reset(a.id,f,d,c+1)),s.record(p)}}})}listen_uncursor_hotkey(e){const t=this;document.documentElement.addEventListener("keydown",e=>{const n=t.stats.mode,r=document.activeElement,i=[s.tX.down,s.tX.left,s.tX.right,s.tX.up],o=e.key.toLowerCase();this.root;let a=!1;if(this.cursor.cube_end||r===document.body){for(let[n,r]of h){let i=t.data[n];i.cursor||t.validate(e,i)&&(console.log("🟪命中快捷键",i.name),a=!0,r.bind(t)(e))}for(let[n,r]of t.handlers){let i=t.data[n];i.cursor||t.validate(e,i)&&(console.log("🟪命中快捷键",i.name),a=!0,r(e))}}a||r!==document.body||n!==s.fv.edit||(" "===o?this.listen_map_space(e):"backspace"===o||"delete"===o?this.listen_map_delete(e):"enter"===o?this.listen_map_enter(e):"tab"===o?this.listen_map_tab(e):i.includes(o)&&this.listen_map_nav(e))})}listen_map_nav(e){const t=this.root,n=e.key.toLowerCase(),i=this.cubes.get_types_cube(s.u0.submap),o=[s.tX.down,s.tX.left,s.tX.right,s.tX.up];if(t instanceof r.EU&&t.get_nodes_selected().size>0)o.includes(n)&&t.move_select(n);else for(let[e,t]of i)t.move_select(n)}listen_map_delete(e){const{courier:t,history:n}=this,o=t.get_recorder();if(this.root instanceof r.EU){const e=[...this.root.get_nodes_selected()].map(e=>e.id);o.tell(this.root,i.yc.node_remove(this.root.id,e))}const a=this.cubes.get_types_cube(s.u0.submap);for(let[e,t]of a){const e=[...t.get_nodes_selected()].map(e=>e.id);o.tell(t,i.yc.node_remove(t.id,e))}n.record(o)}listen_map_enter(e){const{courier:t,history:n}=this,o=t.get_recorder();let a=!1;if(this.root instanceof r.EU){const t=this.root.get_nodes_selected();for(let n of t){const t=n.layout_upstream;if(!t){a=!0;continue}let r=n.id;e.shiftKey&&(r=n.prev_node?.id||null);const s=i.Sv.append_child(t.id,r);o.tell(t,s)}}const l=this.cubes.get_types_cube(s.u0.submap);for(let[t,n]of l){const t=n.get_nodes_selected();for(let n of t){const t=n.layout_upstream;if(!t){a=!0;continue}let r=n.id;e.shiftKey&&(r=n.prev_node?.id||null);const s=i.Sv.append_child(t.id,r);o.tell(t,s)}}a&&d.F.tips?.tip_warning("无法在没有布局上游的节点添加同级"),n.record(o)}listen_map_tab(e){e.preventDefault();const{courier:t,history:n}=this,o=t.get_recorder();if(this.root instanceof r.EU){const e=this.root.get_nodes_selected();for(let t of e){const e=i.Sv.append_child(t.id);o.tell(t,e)}}const a=this.cubes.get_types_cube(s.u0.submap);for(let[e,t]of a){const e=t.get_nodes_selected();for(let t of e){const e=i.Sv.append_child(t.id);o.tell(t,e)}}n.record(o)}listen_map_space(e){const t=this.root;if(e.preventDefault(),t instanceof r.EU){const e=t.get_nodes_selected();for(let t of e)t.editable=!0}const n=t.cubes.get_types_cube(s.u0.submap);for(let[e,t]of n){const e=t.get_nodes_selected();for(let t of e)t.editable=!0}}listen_cvx(e){let t=e;this.root instanceof r.EU&&(t=document.documentElement),t.addEventListener("paste",async e=>{const t=e.clipboardData,{cursor:n}=this,{cube_end:i}=n;if(i instanceof r.P6&&t){e.preventDefault();const n=await this.clipboard.paste(t);this.history.record(n)}}),t.addEventListener("copy",e=>{const t=e.clipboardData,{doc:n,hotkeys:i,cursor:s}=this;t&&(this.root.scope_count_normal>0||s.has_selection||s.cube_end instanceof r.P6)&&(e.preventDefault(),this.clipboard.copy(t))}),t.addEventListener("cut",e=>{const t=e.clipboardData,{root:n,cursor:i}=this;t&&(n.scope_count_normal>0||i.cube_end instanceof r.P6)&&(e.preventDefault(),this.clipboard.cut(t))})}register(e,t){this.data[t.name]=t,this.handlers.set(t.name,e)}reset(e){Object.assign(this.data,e)}reset_handler(e,t){this.handlers.set(e,t)}export(){return structuredClone((0,l.ux)(this.data))}update_data(...e){return{}}validate(e,t){return t.meta===e.metaKey&&t.alt===e.altKey&&t.shift===e.shiftKey&&t.ctrl===e.ctrlKey&&(0===t.key.length||t.key.includes(e.key.toLocaleLowerCase()))}which(e){for(let t of Object.values(this.data))if(this.validate(e,t))return t}validate_hotkeys(e){for(let t of Object.values(this.data))if(this.validate(e,t))return!0;return!1}get_hotkey_str(e){const t=this.data[e];if(!t)return"";let n="";return t.meta&&(n+="meta + "),t.ctrl&&(n+="ctrl + "),t.alt&&(n+="alt + "),t.shift&&(n+="shift + "),n+=t.key,n}clear_scope(e){e.preventDefault(),this.root.clear_scope(!1)}clear_css(e){e.preventDefault();const{cursor:t}=this;this.root.painter.clear()}bold(e){e.preventDefault(),this.root.painter.paint({"font-weight":"700"},!0)}unindent_line(e){e.preventDefault(),this.root.painter.unindent()}indent_line(e){e.preventDefault(),this.root.painter.indent()}undo(e){e.preventDefault(),this.root.history.undo()}redo(e){e.preventDefault(),this.root.history.redo()}cursor_navigation(e){const t=this.cursor.get_focus_line(),n=this.root.cursor;if(!t)return;if(!n.range)return;e.preventDefault();const r=[s.tX.down,s.tX.end,s.tX.home,s.tX.left,s.tX.right,s.tX.up],i=e.key.toLocaleLowerCase();r.includes(i)&&this.event.emit_cursor_nav_before(e).some(e=>!1===e)||(i===s.tX.left?n.move_left():i===s.tX.right?n.move_right():i===s.tX.up?n.move_up():i===s.tX.down?n.move_down():i===s.tX.home?n.move_home():i===s.tX.end&&n.move_end(),this.event.emit_cursor_nav_after(e))}cursor_extend_navigation(e){const t=this.cursor.get_focus_line(),n=this.root.cursor;t&&n.cube_end instanceof r.P6&&(e.preventDefault(),e.key.toLocaleLowerCase()===s.tX.left?n.extend_left():e.key.toLocaleLowerCase()===s.tX.right?n.extend_right():e.key.toLocaleLowerCase()===s.tX.up?n.extend_up():e.key.toLocaleLowerCase()===s.tX.down?n.extend_down():e.key.toLocaleLowerCase()===s.tX.home?n.extend_home():e.key.toLocaleLowerCase()===s.tX.end&&n.extend_end())}text_break(e){const{courier:t,cursor:n,history:i,doc:s}=this;if(n.has_selection)return;e.preventDefault();const a=new o.vk(t),{cube_end:l,cube_start:c,cube_selection:d,offset_end:u,offset_start:h}=n;if(l){if(l instanceof r.P6){const e=l.text.slice(0,u)+"\n"+l.text.slice(u);a.tell(l,r.zl.reset(l.id,e,u,u+2))}i.record(a)}}break(e){if(this.event.emit_enter_before(e).some(e=>"stop"===e))return;if(!this.cursor.get_focus_line())return;e.preventDefault();const{courier:t,history:n,cursor:s,doc:a}=this,{cube_end:l,cube_start:c,cube_selection:d,offset_end:u,offset_start:h}=s;if(!d||!l||!c)return;const p=new o.vk(t),m=c.id,f=l.id;s.has_selection&&p.tell(d,i.VL.delete(d.id,"backward",m,f,h,u,!0)),p.tell(c,r.zl.break(c.id,h)),n.record(p),this.event.emit_enter_after(e)}async break_root(e){const{cursor:t,courier:n,history:s}=this,{cube_end:o,offset_end:a}=t;if(!o)return;const l=o.find_upstream_target(e=>e instanceof r.HR);if(!l)return;const d=o.find_upstream_untill(l);if(!d)return;const u=[],h=d.index,p=l.children.slice(h);for(let e of p)u.push(e.export());const m=r.HR.get_default(u),f=n.get_recorder(),_=l.pcube;f.tell(_,i.VL.insert_child(_.id,[m],l.index+1)),f.tell(l,i.VL.delete_child(l.id,"backward",[h,l.child_count])),o instanceof r.P6&&(await(0,c.dY)(),o.set_cursor_in_head(a)),s.record(f)}text_partition(e){const{cursor:t,history:n,courier:s}=this,o=d.F.tips,{cube_selection:a,offset_end:l,offset_start:c}=t;if(!(a instanceof r.P6))return o?.tip_warning("选区必须在一个文本块内");const u=s.get_recorder(),h=a.id;u.tell(a,i.VL.partition(h,h,h,c,l)),n.record(u)}add_scope(e){this.root.add_scope()}underline(e){const{cursor:t,courier:n,history:r}=this,{cube_selection:s,cube_end:a,cube_start:l,offset_start:c,offset_end:d}=t,u=new o.vk(n);s&&l&&a&&(u.tell(s,i.VL.set_selection_css(s.id,{"text-decoration-line":"underline"},l.id,a.id,c,d,!0)),r.record(u))}copy_format(e){const{root:t}=this;e.preventDefault(),t.painter.copy_format()}apply_format(e){const{root:t}=this;e.preventDefault(),t.painter.apply_format_brush()}italic(e){e.preventDefault(),this.painter.paint({"font-style":"italic"},!0)}align_left(e){e.preventDefault(),this.painter.paint({"text-align":"left"},!0)}align_center(e){e.preventDefault(),this.painter.paint({"text-align":"center"},!0)}align_right(e){e.preventDefault(),this.painter.paint({"text-align":"right"},!0)}next_root(e){e.preventDefault();const{cursor:t,history:n}=this,{cube_end:s}=t;if(!s)return;const a=s.find_upstream_target(e=>e instanceof r.HR);if(!a)return;const l=a.pcube,c=new o.vk(this.courier),d=r.HR.get_default();c.tell(l,i.VL.insert_child(l.id,[d],a.index+1)),n.record(c)}prev_root(e){e.preventDefault();const{cursor:t,history:n}=this,{cube_end:s}=t;if(!s)return;const a=s.find_upstream_target(e=>e instanceof r.HR);if(!a)return;const l=a.pcube,c=new o.vk(this.courier),d=r.HR.get_default();c.tell(l,i.VL.insert_child(l.id,[d],a.index)),n.record(c)}add_annotation(e){e.preventDefault();const t=d.F.tips,{cursor:n,courier:s,history:a}=this,{cube_selection:l,cube_start:c,cube_end:u,offset_end:h,offset_start:p}=n,m=new o.vk(s);if(!l||!c||!u)return t?.tip_warning("未发现光标或选区");const f=c.id,_=u.id,g=r.vV.get_default();if(n.has_selection)if(l instanceof r.P6)if(m.tell(l,i.VL.partition(l.id,f,_,p,h)),0===p){if(l.postil?.has_annotation)return t?.tip_warning("已添加批注"),m;m.tell(l,i.VL.postil_add(l.id,[g])),m.tell(l,i.UB.in_head(l.id,h))}else{const e=l.next_cube;if(e instanceof r.P6){if(e.postil?.has_annotation)return t?.tip_warning("已添加批注"),m;m.tell(e,i.VL.postil_add(e.id,[g])),m.tell(e,i.UB.in_head(e.id,h))}}else t?.tip_warning("选区跨越多个文本块");else u instanceof r.P6&&(m.merge(u.add_annotation()),m.tell(u,i.UB.in_head(u.id,h)));a.record(m)}fold_block(e){e.preventDefault();const{cursor:t}=this,{cube_end:n,offset_end:s}=t;if(!n)return;let o,a=n;for(;!o;){let e=a.pcube;if(e instanceof r.de||e instanceof r.HR)o=e;else if(e instanceof i.MR)return;a=e}if(o){const e=o.child_first,t=n.find_upstream_untill(o)===e,r=this.courier.get_recorder(),a=!o.attrs.fold,l=i.VL.set_attr(o.id,{fold:a});r.tell(o,l),t?r.tell(n,i.UB.in_head(n.id,s)):a&&e&&r.tell(e,i.UB.in_tail(e.id,0)),this.history.record(r)}}static get meta(){return{type:s.Mu.hotkeys,version:1}}static get default_hotkeys(){return{[s.ZS["fold-block"]]:{name:s.ZS["fold-block"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["z"],cursor:!0,group:s.ec.block},[s.ZS["text-partition"]]:{name:s.ZS["text-partition"],show:!0,meta:!1,shift:!1,alt:!0,ctrl:!1,key:["x"],cursor:!0,group:s.ec.text},[s.ZS["text-add-annotation"]]:{name:s.ZS["text-add-annotation"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["a"],cursor:!0,group:s.ec.text},[s.ZS["scope-clear"]]:{name:s.ZS["scope-clear"],show:!0,meta:!1,shift:!1,alt:!0,ctrl:!1,key:["c"],group:s.ec.scope},[s.ZS["clear-css"]]:{name:s.ZS["clear-css"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["r"],cursor:!0,group:s.ec.css},[s.ZS["root-add-prev"]]:{name:s.ZS["root-add-prev"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["enter"],cursor:!0,group:s.ec.block},[s.ZS["root-add-next"]]:{name:s.ZS["root-add-next"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["enter"],cursor:!0,group:s.ec.block},[s.ZS["text-align-left"]]:{name:s.ZS["text-align-left"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["l"],cursor:!0,group:s.ec.common},[s.ZS["text-align-center"]]:{name:s.ZS["text-align-center"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["e"],cursor:!0,group:s.ec.common},[s.ZS["text-align-right"]]:{name:s.ZS["text-align-right"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["r"],cursor:!0,group:s.ec.common},[s.ZS["break-text"]]:{name:s.ZS["break-text"],show:!1,meta:!1,shift:!0,alt:!1,ctrl:!1,key:["enter"],cursor:!0,group:s.ec.text},[s.ZS["break-line"]]:{name:s.ZS["break-line"],show:!1,meta:!1,shift:!1,alt:!1,ctrl:!1,key:["enter"],cursor:!0,group:s.ec.core},[s.ZS["break-root"]]:{name:s.ZS["break-root"],show:!0,meta:!1,shift:!1,alt:!0,ctrl:!1,key:["enter"],cursor:!0,group:s.ec.block},[s.ZS["cursor-nav"]]:{name:s.ZS["cursor-nav"],show:!1,meta:!1,shift:!1,alt:!1,ctrl:!1,cursor:!0,key:[s.tX.down,s.tX.left,s.tX.right,s.tX.up,s.tX.home,s.tX.end],group:s.ec.core},[s.ZS["cursor-nav-extend"]]:{name:s.ZS["cursor-nav-extend"],show:!1,meta:!1,shift:!0,alt:!1,ctrl:!1,cursor:!0,key:[s.tX.down,s.tX.left,s.tX.right,s.tX.up,s.tX.home,s.tX.end],group:s.ec.core},[s.ZS.undo]:{name:s.ZS.undo,show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["z"],cursor:!1,group:s.ec.common},[s.ZS.redo]:{name:s.ZS.redo,show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["y"],cursor:!1,group:s.ec.common},[s.ZS["indent-line"]]:{name:s.ZS["indent-line"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["m"],cursor:!0,group:s.ec.common},[s.ZS["unindent-line"]]:{name:s.ZS["unindent-line"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["m"],cursor:!0,group:s.ec.common},[s.ZS["text-bold"]]:{name:s.ZS["text-bold"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["b"],cursor:!0,group:s.ec.text},[s.ZS["scope-add"]]:{name:s.ZS["scope-add"],show:!0,meta:!1,shift:!1,alt:!0,ctrl:!1,key:["s"],cursor:!1,group:s.ec.scope},[s.ZS["text-underline"]]:{name:s.ZS["text-underline"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["u"],cursor:!0,group:s.ec.text},[s.ZS["text-italic"]]:{name:s.ZS["text-italic"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["i"],cursor:!0,group:s.ec.text},[s.ZS["format-brush-copy"]]:{name:s.ZS["format-brush-copy"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["c"],cursor:!0,group:s.ec.common},[s.ZS["format-brush-apply"]]:{name:s.ZS["format-brush-apply"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["v"],cursor:!0,group:s.ec.common}}}}u([p(s.ZS["scope-clear"])],m.prototype,"clear_scope",null),u([p(s.ZS["clear-css"])],m.prototype,"clear_css",null),u([p(s.ZS["text-bold"])],m.prototype,"bold",null),u([p(s.ZS["unindent-line"])],m.prototype,"unindent_line",null),u([p(s.ZS["indent-line"])],m.prototype,"indent_line",null),u([p(s.ZS.undo)],m.prototype,"undo",null),u([p(s.ZS.redo)],m.prototype,"redo",null),u([p(s.ZS["cursor-nav"])],m.prototype,"cursor_navigation",null),u([p(s.ZS["cursor-nav-extend"])],m.prototype,"cursor_extend_navigation",null),u([p(s.ZS["break-text"])],m.prototype,"text_break",null),u([p(s.ZS["break-line"])],m.prototype,"break",null),u([p(s.ZS["break-root"])],m.prototype,"break_root",null),u([p(s.ZS["text-partition"])],m.prototype,"text_partition",null),u([p(s.ZS["scope-add"])],m.prototype,"add_scope",null),u([p(s.ZS["text-underline"])],m.prototype,"underline",null),u([p(s.ZS["format-brush-copy"])],m.prototype,"copy_format",null),u([p(s.ZS["format-brush-apply"])],m.prototype,"apply_format",null),u([p(s.ZS["text-italic"])],m.prototype,"italic",null),u([p(s.ZS["text-align-left"])],m.prototype,"align_left",null),u([p(s.ZS["text-align-center"])],m.prototype,"align_center",null),u([p(s.ZS["text-align-right"])],m.prototype,"align_right",null),u([p(s.ZS["root-add-next"])],m.prototype,"next_root",null),u([p(s.ZS["root-add-prev"])],m.prototype,"prev_root",null),u([p(s.ZS["text-add-annotation"])],m.prototype,"add_annotation",null),u([p(s.ZS["fold-block"])],m.prototype,"fold_block",null)},685:(e,t,n)=>{"use strict";n.d(t,{I:()=>a});var r=n(7633),i=n(3923),s=n(9513),o=n(4743);class a extends i.K{_count_word=(0,r.KR)(0);_active_root_index=(0,r.KR)(0);_anchor_root_id=(0,r.KR)("");_mode=(0,r.KR)(s.fv.read);_view=(0,r.KR)("doc");_in_composition_mode=(0,r.KR)(!1);_in_recording=(0,r.KR)(!1);_showing=(0,r.KR)(!1);view_point=(0,r.Kh)({x:0,y:0});get view(){return this._view.value}set view(e){this._view.value=e}get is_doc_view(){return"doc"===this.view}get is_map_view(){return"map"===this.view}get mode_name(){return{[s.fv.edit]:"编辑模式",[s.fv.read]:"阅读模式",[s.fv.export]:"导出模式"}[this.mode]}get showing(){return this._showing.value}set showing(e){this._showing.value=e,this.event.emit_status_update()}get is_recording(){return this._in_recording.value}set is_recording(e){this._in_recording.value=e,this.event.emit_status_update()}get len_undo(){return this.history.len_undo}get len_redo(){return this.history.len_redo}get is_read_mode(){return this._mode.value===s.fv.read}get is_edit_mode(){return this._mode.value===s.fv.edit}get in_composition_mode(){return this._in_composition_mode.value}set in_composition_mode(e){this._in_composition_mode.value=e,this.event.emit_status_update()}get mode(){return this._mode.value}set mode(e){const t=this.mode;this._mode.value=e,t!==e&&this.event.emit_status_update()}get anchor_root_id(){return this._anchor_root_id.value}set anchor_root_id(e){this._anchor_root_id.value=e,this.event.emit_status_update()}get anchor_root(){return this.root instanceof o.oY?this.root.children.find(e=>e.id===this.anchor_root_id):this.root.find_cube(this.anchor_root_id)}get count_root(){return this.root.child_count}get count_word(){return this._count_word.value}get active_root(){return this.root.children[this.active_root_index-1]}get active_root_index(){return this._active_root_index.value}set active_root_index(e){this._active_root_index.value=e,this.event.emit_status_update()}get count_scope(){return this.root.scope.size}get count_scope_freeze(){return this.root.scope_count_freeze}get count_scope_normal(){return this.root.scope_count_normal}get meta(){return a.meta}constructor(e){super(e)}update_count_word(e){this._count_word.value+=e,this.event.emit_status_update()}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:s.Mu.stats,version:1}}}},722:(e,t,n)=>{"use strict";n.d(t,{S:()=>i});var r=n(9513);class i{static layout_change(e,t){return{id:e,name:r.s1.layout_update,attrs:t}}static append_child(e,t){return{id:e,name:r.s1.append_child,previd:t}}}},1068:e=>{var t;self,t=()=>(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{ArrayTools:()=>u,DateTime:()=>c,DomAnimation:()=>d,DragDiff:()=>f,DragList:()=>p,Iteration:()=>a,MathBase:()=>_,MathLine:()=>v,MathPoint:()=>b,MathPolygon:()=>y,MathRect:()=>g,Notice:()=>o,_RectPosition:()=>s});var n,r,i,s=function(e){return e.left_mid="left-mid",e.left_top="left-top",e.left_bottom="left-bottom",e.top_mid="top-mid",e.bottom_mid="bottom-mid",e.right_top="right-top",e.right_mid="right-mid",e.right_bottom="right_bottom",e.center="center",e}({});class o{static rope(e,t){return(...n)=>{let r=Symbol();return this.scope[e]=r,t(()=>r===this.scope[e],...n)}}static throttle(e,t=100){let n;return function(...r){n||(n=setTimeout(()=>{e(...r),n=void 0},t))}}static debounce(e,t=100){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>{e(...r)},t)}}}i={},(r="scope")in(n=o)?Object.defineProperty(n,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[r]=i;class a{static*zip(...e){let t=e.map(e=>Array.isArray(e)?e:[e]),n=t.map(e=>e.length),r=Math.min(...n);for(let e=0;e<r;e++){let n=[];for(let r=0;r<t.length;r++)n.push(t[r][e]);yield n}}}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class c{static get_month_name(e){let t;return t=e||new Date,this.month_names[t.getMonth()]}static get_week_name(e){let t;return t=e||new Date,this.weeks_names[t.getDay()]}static get_date_string(e){return`${e.getFullYear()}-${e.getMonth()+1}-${e.getDate()}`}static get_week_string(e){let t;t=e||new Date;const n=t.getDate(),r=t.getDay(),i=new Date(t.getFullYear(),t.getMonth(),n-r),s=new Date(t.getFullYear(),t.getMonth(),n+(6-r));return`${this.get_date_string(i)}:${this.get_date_string(s)}`}static get_week_days(e){const t=[];let n;n=e||new Date;const r=n.getFullYear(),i=n.getMonth(),s=n.getDate(),o=n.getDay(),a=new Date(r,i,s-o),l=a.getFullYear(),c=a.getMonth(),d=a.getDate();t.push(a);for(let e=1;e<=6;e++)t.push(new Date(l,c,d+e));return t}}l(c,"month_names",["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]),l(c,"weeks_names",["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]);class d{static scroll_element(e,t,n="vertical"){let r=t;const i=()=>{if(Math.abs(r)>2){let t=r/10;r-=t,"vertical"===n?e.scrollTop+=t:e.scrollLeft+=t,requestAnimationFrame(i)}"vertical"===n?e.scrollTop+=r:e.scrollLeft+=r};i()}}class u{static swap(e,t,n){const r=e[t],i=e[n];e[t]=i,e[n]=r}}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class p{init(){const e=this.order,t=new Set;this.order=[];for(let e=0;e<this.container.children.length;e++){const n=this.container.children[e],r=n.getAttribute(this.attr);r&&n instanceof HTMLElement&&(n.setAttribute("draggable","true"),n.style.position="absolute","horizental"===this.dir?n.style.left="0px":n.style.top="0px",this.order_origin.push(r),t.add(r),this.map.has(r)||this.register(n),this.map.set(r,n))}const n=this.init_container();this.container.addEventListener("dragenter",e=>{e.preventDefault()}),this.container.addEventListener("dragover",e=>{e.preventDefault()});for(let n of e)t.has(n)?(this.order.push(n),t.delete(n)):this.map.delete(n);for(let e of t)this.order.push(e);return this.sort(),n}sort(){for(let e=0;e<this.order.length;e++){const t=this.order[e],n=this.map.get(t);if(!n)continue;const r=this.sum_translate(this.order.slice(0,e));"horizental"===this.dir?n.style.transform=`translateX(${r}px)`:n.style.transform=`translateY(${r}px)`}for(let e of this.callback)e([...this.order])}init_container(){let e=0;for(const[t,n]of this.map)"horizental"===this.dir?e+=n.getBoundingClientRect().width/this.scale_h:e+=n.getBoundingClientRect().height/this.scale_v;return"horizental"===this.dir?this.container.style.width=e+"px":this.container.style.height=e+"px",e}sum_translate(e){let t=0;for(let n of e){const e=this.map.get(n);e&&("horizental"===this.dir?t+=e.getBoundingClientRect().width/this.scale_h:t+=e.getBoundingClientRect().height/this.scale_v)}return t}register(e){this._func_start=this.on_dragstart.bind(this),this._func_over=this.on_dragover.bind(this),this._func_enter=this.on_dragenter.bind(this),this._func_end=this.on_dragend.bind(this),e.addEventListener("dragstart",this._func_start,{capture:!0}),e.addEventListener("dragover",this._func_over,{capture:!0}),e.addEventListener("dragenter",this._func_enter,{capture:!0}),e.addEventListener("dragend",this._func_end,{capture:!0}),this.realtime||e.addEventListener("drop",this.on_drop.bind(this),{capture:!0})}on_dragstart(e){e.stopPropagation();const t=e.currentTarget;if(t instanceof HTMLElement&&(this.drag_id=t.getAttribute(this.attr),this.drag_id))for(let t of this.callback_start)t(e,this.drag_id);this.container.style.setProperty(this.css_var_point_events,"none")}on_dragenter(e){if(e.stopPropagation(),e.preventDefault(),!this.realtime)return;const t=e.currentTarget;if(e.target!==t)return;if(!(t instanceof HTMLElement))return;const n=t.getAttribute(this.attr),r=this.drag_id;if(!n||!r||n===r)return;const i=this.order.indexOf(n),s=this.order.indexOf(r);i<0||s<0||("swap"===this.effect?u.swap(this.order,i,s):(this.order.splice(s,1),this.order.splice(i,0,r)),this.init_container(),this.sort())}on_dragover(e){e.preventDefault(),e.stopPropagation()}on_drop(e){e.stopPropagation();const t=e.target;if(!(t instanceof HTMLElement))return;const n=t.getAttribute(this.attr),r=this.drag_id;if(!n||!r||n===r)return;const i=this.order.indexOf(n),s=this.order.indexOf(r);i<0||s<0||("swap"===this.effect?u.swap(this.order,i,s):(this.order.splice(s,1),this.order.splice(i,0,r)),this.sort())}on_dragend(e){this.container.style.setProperty(this.css_var_point_events,"auto");for(let t of this.callback_end)t(e)}register_start(e){this.callback_start.add(e)}register_dropend(e){this.callback_end.add(e)}register_callback(e){this.callback.add(e)}off_callback(e){this.callback.delete(e)}off_callback_start(e){this.callback_start.delete(e)}off_callback_drop(e){this.callback_end.delete(e)}constructor(e,t,n,r,i=!0){h(this,"container",void 0),h(this,"drag_id",void 0),h(this,"dir","vertical"),h(this,"effect",void 0),h(this,"attr",void 0),h(this,"realtime",!0),h(this,"order_origin",[]),h(this,"order",[]),h(this,"css_var_point_events","--drag-item-point-event"),h(this,"map",new Map),h(this,"callback",new Set),h(this,"callback_start",new Set),h(this,"callback_end",new Set),h(this,"scale_h",1),h(this,"scale_v",1),h(this,"_func_start",void 0),h(this,"_func_over",void 0),h(this,"_func_enter",void 0),h(this,"_func_end",void 0),h(this,"_callback_start",void 0),this.container=e,this.dir=t,this.attr=n,this.realtime=i,this.effect=r,e.style.position="relative"}}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class f{get el(){return this._el}init(){this._handler_down=e=>this._pointdown(e),this._handler_move=e=>this._pointmove(e),this._handler_up=e=>this._pointup(e),this._handler_cancel=e=>this._pointercancel(e),this.el.addEventListener("pointerdown",this._handler_down),document.documentElement.addEventListener("pointermove",this._handler_move),document.documentElement.addEventListener("pointerup",this._handler_up),document.documentElement.addEventListener("pointercancel",this._handler_cancel)}_pointdown(e){e.stopPropagation(),e.preventDefault();const t=e.target;this.el.contains(t)&&(this._is_down=!0,this._down_point={x:e.clientX,y:e.clientY},this._func_down&&this._func_down())}_pointmove(e){if(!this._is_down||!this._down_point||e.buttons<=0)return;e.stopPropagation(),e.preventDefault(),this._is_move=!0;const t=e.clientX-this._down_point.x,n=e.clientY-this._down_point.y;this._func_move&&this._func_move(t,n)}_pointup(e){if(e.preventDefault(),e.stopPropagation(),!this._is_down||!this._is_move)return;if(this._is_down=!1,this._is_move=!1,!this._down_point)return;const t=e.clientX-this._down_point.x,n=e.clientY-this._down_point.y;this._down_point=void 0,this._func_up&&this._func_up(t,n)}_pointercancel(e){this._is_down&&this._is_move&&(this._is_down=!1,this._is_move=!1,this._down_point=void 0,this._func_cancel&&this._func_cancel())}off(){this.el.removeEventListener("pointerdown",this._handler_down),document.documentElement.removeEventListener("pointermove",this._handler_move),document.documentElement.removeEventListener("pointerup",this._handler_up),document.documentElement.removeEventListener("pointercancel",this._handler_cancel)}register_down(e){this._func_down=e}register_move(e){this._func_move=e}register_up(e){this._func_up=e}register_cancel(e){this._func_cancel=e}constructor(e){m(this,"_el",void 0),m(this,"_handler_down",void 0),m(this,"_handler_move",void 0),m(this,"_handler_up",void 0),m(this,"_handler_cancel",void 0),m(this,"_func_down",void 0),m(this,"_func_move",void 0),m(this,"_func_up",void 0),m(this,"_func_cancel",void 0),m(this,"_is_down",!1),m(this,"_is_move",!1),m(this,"_down_point",void 0),this._el=e,this.init()}}class _{static sum(e){let t=0;for(let n of e)t+=n;return t}}class g{static get_rect_point(e,t){const{x:n,y:r,width:i,height:o}=e,a=r+o,l=n+i,c=n+i/2,d=r+o/2;if(t===s.left_bottom)return{x:n,y:a};if(t===s.left_top)return{x:n,y:r};if(t===s.left_mid)return{x:n,y:d};if(t===s.right_top)return{x:l,y:r};if(t===s.right_mid)return{x:l,y:d};if(t===s.right_bottom)return{x:l,y:a};if(t===s.bottom_mid)return{x:c,y:a};if(t===s.top_mid)return{x:c,y:r};if(t===s.center)return{x:c,y:d};throw Error("MathRect: the position keyword is invalid")}static is_point_in_rect(e,t,n=!0){const r=e.x===t.x||e.x===t.x+t.width,i=e.y===t.y||e.y===t.y+t.height,s=e.x>t.x&&e.x<t.x+t.width,o=e.y>t.y&&e.y<t.y+t.height;return n?(s||r)&&(o||i):s&&o}static get_point_in_rects(e,t,n=!0){const r=[];for(let i of t)this.is_point_in_rect(e,i,n)&&r.push(i);return r}static get_point_center(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}static move_rect_to_other(e,t,n,r=5){const i={width:e.width,height:Math.abs(e.y-n.y)},s={width:e.width,height:Math.abs(e.height-(n.y+n.height))},o={width:Math.abs(n.x-e.x),height:e.height},a={width:Math.abs(e.width-(n.x+n.width)),height:e.height};if(g.can_include(s,t)){const i=t.width+n.x-e.width,s=n.y+n.height+r;return{x:i<0?n.x:n.x-i,y:s}}if(g.can_include(i,t)){const i=t.width+n.x-e.width,s=n.y-t.height-r;return{x:i<0?n.x:n.x-i,y:s}}if(g.can_include(o,t)){const i=n.y+t.height-e.height;return{x:n.x-t.width-r,y:i<0?n.y:n.y-i}}if(g.can_include(a,t)){const i=n.y+t.height-e.height;return{x:n.x+n.width+r,y:i<0?n.y:n.y-i}}if(g.can_include(e,t)){const r=e.y+e.height-t.height;let i=n.x;return a.width>=t.width?i=n.x+n.width:o.width>=t.width&&(i=n.x-t.width),{x:i,y:r}}return{x:n.x,y:0}}static move_rect_in_other(e,t){if(g.can_contain(t,e))return{dx:0,dy:0};let n=0,r=0;return e.x<t.x?n=t.x-e.x:e.x+e.width>t.x+t.width&&(n=t.x+t.width-(e.x+e.width)),e.y<t.y?r=t.y-e.y:e.y+e.height>t.y+t.height&&(r=t.y+t.height-(e.y+e.height)),{dx:n,dy:r}}static can_include(e,t){return t.width<=e.width&&t.height<=e.height}static can_contain(e,t){return!(!this.can_include(e,t)||t.x<e.x||t.x>e.x+e.width-t.width||t.y<e.y||t.y>e.y+e.height-t.height)}static check_intersection(e,t){const n=e.x+e.width/2,r=e.y+e.height/2,i=t.x+t.width/2,s=t.y+t.height/2,o=Math.abs(n-i),a=Math.abs(r-s);return o<=(e.width+t.width)/2&&a<=(e.height+t.height)/2}static limit_point_in_rect(e,t){const n=t.x,r=t.y,i=t.x+t.width,s=t.y+t.height;let o=e.x,a=e.y;return o<n&&(o=n),o>i&&(o=i),a<r&&(a=r),a>s&&(a=s),{x:o,y:a}}static point_distance_with_rect(e,t){if(this.is_point_in_rect(e,t,!0))return 0;const n=t.x+t.width/2,r=t.y+t.height/2,i=t.width/2,s=t.height/2,o=Math.abs(n-e.x),a=Math.abs(r-e.y);return o<=i&&a>s?a-s:a<=s&&o>i?o-i:Math.sqrt(Math.pow(o-i,2)+Math.pow(a-s,2))}static distance_with(e,t){const n=this.get_point_center(e),r=this.get_point_center(t),i=Math.abs(n.x-r.x),s=Math.abs(n.y-r.y),o=(e.width+t.width)/2,a=(e.height+t.height)/2;if(i<=o&&s<=a)return 0;if(i>o&&s<=a)return i-o;if(i<=o&&s>a)return s-a;{let e=Math.pow(i-o,2),t=Math.pow(s-a,2);return Math.sqrt(e+t)}}static get_nearest_rect(e,t){if(0===t.length)return;let n,r=Number.POSITIVE_INFINITY;for(let i of t){let t=this.point_distance_with_rect(e,i);t<r&&(r=t,n=i)}return n}static get_shadow_point_horizental(e,t){let n=t.x,r=t.y+t.height/2;return n=e.x<=t.x?t.x:e.x>=t.x+t.width?t.x+t.width:e.x,{x:n,y:r}}static merge(...e){const t=e[0];let n=t.x,r=t.x+t.width,i=t.y,s=t.y+t.height;for(let t of e.slice(1)){const{x:e,y:o,width:a,height:l}=t;e<n&&(n=e),e+a>r&&(r=e+a),o<i&&(i=o),o+l>s&&(s=o+l)}return{x:n,y:i,width:r-n,height:s-i}}}class b{static svg_path_sample(e,t=24){if(!e||t<2)return[];this.path.setAttribute("d",e);const n=[],r=this.path.getTotalLength()/t;for(let e=0;e<t;e++){const t=e*r,i=this.path.getPointAtLength(t);n.push({x:i.x,y:i.y})}return n}static get_line_k(e,t,n=100){const r=t.y-e.y,i=t.x-e.x;return 0===i?Number.POSITIVE_INFINITY:r/i}static distance(e,t){const n=e.x-t.x,r=e.y-t.y;return Math.sqrt(n*n+r*r)}static find_closet_point(e,t){let n=1/0,r=e[0];const{x:i,y:s}=t;for(let t of e){let e=Math.pow(i-t.x,2)+Math.pow(s-t.y,2);e<n&&(n=e,r=t)}return r}static offset_points(e,t){const n=[],{x:r,y:i}=t;for(let t of e)n.push({x:t.x+r,y:t.y+i});return n}static find_closest_points(e,t){let n=1/0,r=e[0],i=t[0];for(let s=0;s<e.length;s++){const o=e[s];for(let e=0;e<t.length;e++){const s=t[e],a=o.x-s.x,l=o.y-s.y,c=a*a+l*l;c<n&&(n=c,r=o,i=s)}}return{from:r,to:i}}}!function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(b,"path",document.createElementNS("http://www.w3.org/2000/svg","path"));class y{static polygon_center(e){let t=0,n=0,r=0;const i=e.length;for(let s=0;s<i;s++){const{x:o,y:a}=e[s],{x:l,y:c}=e[(s+1)%i],d=o*c-l*a;r+=d,t+=(o+l)*d,n+=(a+c)*d}return r*=.5,t/=6*r,n/=6*r,{x:t,y:n}}static get_polygon_area(e){let t=0;const n=e.length;for(let r=0;r<n;r++){const{x:i,y:s}=e[r],{x:o,y:a}=e[(r+1)%n];t+=i*a-o*s}return t/2}}class v{static check_intersection(e,t){const{from:n,to:r}=e,{from:i,to:s}=t;let o,a;if(o=n.x===r.x?Number.POSITIVE_INFINITY:(r.y-n.y)/(r.x-n.x),a=i.x===s.x?Number.POSITIVE_INFINITY:(s.y-i.y)/(s.x-i.x),o===a)return!1;const l=Math.min(n.x,r.x),c=Math.max(n.x,r.x),d=Math.min(n.y,r.y),u=Math.max(n.y,r.y),h=Math.min(i.x,s.x),p=Math.max(i.x,s.x),m=Math.min(i.y,s.y),f=Math.max(i.y,s.y);if(o===Number.POSITIVE_INFINITY){const e=n.x,t=a*(e-i.x)+i.y;return e>=l&&e<=c&&e>=h&&e<=p&&t>=d&&t<=u&&t>=m&&t<=f}if(a===Number.POSITIVE_INFINITY){const e=i.x,t=(r.y-n.y)/(r.x-n.x)*(e-n.x)+n.y;return e>=l&&e<=c&&e>=h&&e<=p&&t>=d&&t<=u&&t>=m&&t<=f}{const e=(i.y-n.y+o*n.x-a*i.x)/(o-a),t=o*(e-n.x)+n.y;return e>=l&&e<=c&&e>=h&&e<=p&&t>=d&&t<=u&&t>=m&&t<=f}}}return t})(),e.exports=t()},1490:(e,t,n)=>{"use strict";n.d(t,{z:()=>o});var r=n(2551),i=n(6753),s=n(9513);class o extends i.K{_listener=new Map;_updating_status=!1;get meta(){return o.meta}constructor(e){super(e),this._listen()}_listen(){document.documentElement.addEventListener("keyup",e=>{"Escape"===e.key&&this.emit_esc()}),document.addEventListener("selectionchange",e=>{this.emit_selection_change(e)})}on(e,t){const n=this._listener.get(e);n?n.add(t):this._listener.set(e,new Set([t]))}emit(e,...t){const n=this._listener.get(e);if(!n)return[];const r=[];for(let e of n)r.push(e(...t));return r}off(e){for(let[t,n]of this._listener)for(let t of n)e===t&&n.delete(t)}on_asset_save(e){const t=r.F.tips,n=this._listener.get(s.dp["asset-save"]);n?(n.clear(),t?.tip_info("唯一事件-资源保存:回调已覆盖"),n.add(e)):this._listener.set(s.dp["asset-save"],new Set([e]))}async emit_asset_save(e,t,n){const i=r.F.tips,o=this._listener.get(s.dp["asset-save"]);if(!o)return i?.tip_warning("未注册保存函数"),!1;const a=[...o][0];return!!a&&await a(e,t,n)}on_asset_download(e){const t=r.F.tips,n=this._listener.get(s.dp["asset-download"]);n?(n.clear(),t?.tip_info("唯一事件-资源下载:回调已覆盖"),n.add(e)):this._listener.set(s.dp["asset-download"],new Set([e]))}async emit_asset_download(e,t){const n=r.F.tips,i=this._listener.get(s.dp["asset-download"]);if(!i)return n?.tip_warning("未注册保存函数"),!1;const o=[...i][0];return!!o&&await o(e,t)}on_asset_copy(e){const t=r.F.tips,n=this._listener.get(s.dp["asset-copy"]);n?(n.clear(),t?.tip_info("唯一事件-资源复制:回调已覆盖"),n.add(e)):this._listener.set(s.dp["asset-copy"],new Set([e]))}async emit_asset_copy(e,t,n){const i=r.F.tips,o=this._listener.get(s.dp["asset-copy"]);if(!o)return i?.tip_warning("未注册保存函数"),!1;const a=[...o][0];return!!a&&await a(e,t,n)}emit_replace_id(e,t){const n=this._listener.get(s.dp["replace-id"]);if(!n)return!1;for(let r of n)r(e,t)}on_replace_id(e){const t=this._listener.get(s.dp["replace-id"]);t?t.add(e):this._listener.set(s.dp["replace-id"],new Set([e]))}emit_edit_before(e,t){const n=this._listener.get(s.dp["edit-before"]);if(!n)return!1;for(let r of n)r(e,t)}on_edit_before(e){const t=this._listener.get(s.dp["edit-before"]);t?t.add(e):this._listener.set(s.dp["edit-before"],new Set([e]))}emit_edit_after(e,t){const n=this._listener.get(s.dp["edit-after"]);if(!n)return!1;for(let r of n)r(e,t)}on_edit_after(e){const t=this._listener.get(s.dp["edit-after"]);t?t.add(e):this._listener.set(s.dp["edit-after"],new Set([e]))}emit_text_merge(e,t){const n=this._listener.get(s.dp["text-merge"]);if(!n)return!1;for(let r of n)r(e,t)}on_text_merge(e){const t=this._listener.get(s.dp["text-merge"]);t?t.add(e):this._listener.set(s.dp["text-merge"],new Set([e]))}on_esc(e){const t=this._listener.get(s.dp.esc);t?t.add(e):this._listener.set(s.dp.esc,new Set([e]))}emit_esc(){const e=this._listener.get(s.dp.esc);if(!e)return!1;for(let t of e)t()}on_selection_change(e){this.on(s.dp["selection-change"],e)}emit_selection_change(e){this.emit(s.dp["selection-change"],e)}emit_cursor_nav_before(e){return this.emit(s.dp["cursor-nav-before"],e)}on_cursor_nav_before(e){this.on(s.dp["cursor-nav-before"],e)}emit_cursor_nav_after(e){return this.emit(s.dp["cursor-nav-after"],e)}on_cursor_nav_after(e){this.on(s.dp["cursor-nav-after"],e)}on_enter_before(e){this.on(s.dp["enter-before"],e)}emit_enter_before(e){return this.emit(s.dp["enter-before"],e)}on_enter_after(e){this.on(s.dp["enter-after"],e)}emit_enter_after(e){return this.emit(s.dp["enter-after"],e)}on_show_cube_editor(e){this.on(s.dp["show-cube-editor"],e)}emit_show_cube_editor(e){return this.emit(s.dp["show-cube-editor"],e)}on_text_link_edit(e){this.on(s.dp["text-link-edit"],e)}emit_text_link_edit(e){return this.emit(s.dp["text-link-edit"],e)}on_doc_input_before(e){return this.on(s.dp["doc-input-before"],e)}emit_doc_input_before(e){return this.emit(s.dp["doc-input-before"],e)}on_doc_input_compositionend(e){return this.on(s.dp["doc-input-compositionend"],e)}emit_doc_input_compositionend(e){return this.emit(s.dp["doc-input-compositionend"],e)}on_status_update(e){return this.on(s.dp["status-update"],e)}emit_status_update(){this._updating_status||(this._updating_status=!0,Promise.resolve().then(()=>{const{root:e}=this,t=e,n={mode:this.stats.mode,count_word:this.stats.count_word,count_scope_normal:this.stats.count_scope_normal,count_scope_all:this.root.scope.size,count_stack_redo:this.history.len_redo,count_stack_undo:this.history.len_undo,count_root:this.stats.count_root,active_root_index:this.stats.active_root_index,anchor_root_id:this.stats.anchor_root_id,note_recording:this.stats.is_recording,note_composition_input:this.stats.in_composition_mode,note_showing:this.stats.showing,map_matrix:{...t.matrix2d}};this.emit(s.dp["status-update"],n),this._updating_status=!1}))}on_node_status_click(e){return this.on(s.dp["node-status-clicked"],e)}emit_node_status_click(e,t){return this.emit(s.dp["node-status-clicked"],e,t)}on_fig_click(e){return this.on(s.dp["fig-click"],e)}emit_fig_click(e){return this.emit(s.dp["fig-click"],e)}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:s.Mu.event,version:1}}}},1642:(e,t,n)=>{"use strict";n.d(t,{L$:()=>S,LU:()=>x,uz:()=>w});var r=n(4116),i=n(4314),s=n(1068),o=n(4743);var a=n(2551);function l(e,t=!1){const{cursor:n,courier:r,stats:i,history:s}=e,l=a.F.tips,{cube_end:c}=n,d=e.get_active_cell();if(!d)return l?.tip_info("未发现激活单元格");if(t){if(e.get_cell(d.row,d.col-1))return l?.tip_info("左侧已存在单元格");if(d.col-1<0)return l?.tip_info("左侧已达边界");{const t=r.get_recorder(),n={row:d.row,col:d.col-1,rowspan:1,colspan:1,data:o.XV.get_default()};t.tell(e,o.en.add_cell(e.id,n)),s.record(t)}}else{const t=e.get_cell_area(d);if(!e.check_orderly_col_left(t.left))return l?.tip_info("左侧不整齐");const n=r.get_recorder(),i=[];for(let t=0;t<e.size[0];t++)i.push(o.XV.get_default());n.tell(e,o.en.add_col(e.id,d.col,i)),s.record(n)}}function c(e,t=!1){const{cursor:n,courier:r,stats:i,history:s}=e,l=a.F.tips,{cube_end:c}=n,d=e.get_active_cell();if(!d)return l?.tip_info("未发现激活单元格");if(t){if(e.get_cell(d.row,d.col+1))return l?.tip_info("右侧已存在单元格");if(d.col+1>=e.size[1])return l?.tip_info("右侧已达边界");{const t=r.get_recorder(),n={row:d.row,col:d.col+1,rowspan:1,colspan:1,data:o.XV.get_default()};t.tell(e,o.en.add_cell(e.id,n)),s.record(t)}}else{const t=e.get_cell_area(d);if(!e.check_orderly_col_right(t.right))return l?.tip_info("右侧不整齐");const n=r.get_recorder(),i=[];for(let t=0;t<e.size[0];t++)i.push(o.XV.get_default());n.tell(e,o.en.add_col(e.id,d.col+d.colspan,i)),s.record(n)}}function d(e,t=!1){const{cursor:n,courier:r,stats:i,history:s}=e,l=a.F.tips,{cube_end:c}=n,d=e.get_active_cell();if(!d)return l?.tip_info("未发现激活单元格");if(t){if(e.get_cell(d.row-1,d.col))return l?.tip_info("上方已存在单元格");if(d.row-1<0)return l?.tip_info("上方已达边界");{const t=r.get_recorder(),n={row:d.row-1,col:d.col,rowspan:1,colspan:1,data:o.XV.get_default()};t.tell(e,o.en.add_cell(e.id,n)),s.record(t)}}else{const t=e.get_cell_area(d);if(!e.check_orderly_row_top(t.top))return l?.tip_info("上方不整齐");const n=r.get_recorder(),i=[];for(let t=0;t<e.size[1];t++)i.push(o.XV.get_default());n.tell(e,o.en.add_row(e.id,d.row,i)),s.record(n)}}function u(e,t=!1){const{cursor:n,courier:r,stats:i,history:s}=e,l=a.F.tips,{cube_end:c}=n,d=e.get_active_cell();if(!d)return l?.tip_info("未发现激活单元格");if(t){if(e.get_cell(d.row+1,d.col))return l?.tip_info("下方已存在单元格");if(d.row+1>=e.size[0])return l?.tip_info("下方已达边界");{const t=r.get_recorder(),n={row:d.row+1,col:d.col,rowspan:1,colspan:1,data:o.XV.get_default()};t.tell(e,o.en.add_cell(e.id,n)),s.record(t)}}else{const t=e.get_cell_area(d);if(!e.check_orderly_row_bottom(t.bottom))return l?.tip_info("下方不整齐");const n=r.get_recorder(),i=[];for(let t=0;t<e.size[1];t++)i.push(o.XV.get_default());n.tell(e,o.en.add_row(e.id,d.row+d.rowspan,i)),s.record(n)}}function h(e,t){const{cursor:n,courier:r,stats:i,history:s,id:l}=e,c=a.F.tips,{cube_end:d}=n,u=e.get_active_cell();if(!u)return c?.tip_info("未发现激活单元格");const h=r.get_recorder(),p=e.get_cell_area(u);h.tell(e,o.en.col_resize(l,[p.left,p.right],t)),s.record(h)}function p(e,t){const{courier:n,history:i}=e,s=n.get_recorder();s.tell(e,r.VL.set_attr(e.id,{column_count:t,column_width:null})),i.record(s)}function m(e,t){const{courier:n,history:i}=e,s=n.get_recorder();s.tell(e,r.VL.set_attr(e.id,{column_width:t,column_count:null})),i.record(s)}var f=n(3431);function _(e,t=!1){const n=e,{cursor:r,courier:i,history:s}=e,{cube_start:o,cube_end:a}=r;if(!o||!a)return;const l=i.get_recorder();if(t){const e=o.find_upstream_untill(n),t=a.find_upstream_untill(n);if(!e||!t)return;const r=n.items.slice(e.index,t.index+1),i=[];for(let e of r)i.push({id:e.data.id,indent:!1});l.tell(n,f.o.indent(n.id,i)),s.record(l)}else{const e=o.find_upstream_untill(n),t=a.find_upstream_untill(n);if(!e||!t)return;const r=n.items.slice(e.index,t.index+1),i=[];for(let e of r)i.push({id:e.data.id,indent:!0});l.tell(n,f.o.indent(n.id,i)),s.record(l)}}function g(e,t=!1){const n=e,{cursor:r,courier:i,history:s}=e,{cube_start:a,cube_end:l}=r;if(!a||!l)return;const c=i.get_recorder();if(t){const e=a.find_upstream_untill(n),t=l.find_upstream_untill(n);if(!e||!t)return;const r=n.items.slice(e.index,t.index+1),i=[];for(let e of r)i.push({id:e.data.id,indent:!1});c.tell(n,o.LO.indent(n.id,i)),s.record(c)}else{const e=a.find_upstream_untill(n),t=l.find_upstream_untill(n);if(!e||!t)return;const r=n.items.slice(e.index,t.index+1),i=[];for(let e of r)i.push({id:e.data.id,indent:!0});c.tell(n,o.LO.indent(n.id,i)),s.record(c)}}function b(e,t=!1){const n=e,{cursor:r,courier:i,history:s}=e,{cube_start:a,cube_end:l}=r;if(!a||!l)return;const c=i.get_recorder();if(t){const e=a.find_upstream_untill(n),t=l.find_upstream_untill(n);if(!e||!t)return;const r=n.items.slice(e.index,t.index+1),i=[];for(let e of r)i.push({id:e.data.id,indent:!1});c.tell(n,o.A6.indent(n.id,i)),s.record(c)}else{const e=a.find_upstream_untill(n),t=l.find_upstream_untill(n);if(!e||!t)return;const r=n.items.slice(e.index,t.index+1),i=[];for(let e of r)i.push({id:e.data.id,indent:!0});c.tell(n,o.A6.indent(n.id,i)),s.record(c)}}var y=n(3028);function v(e,t="tail"){const{courier:n,history:r}=e,i=new y.vk(n),s=[o.XV.get_default(),o.XV.get_default()],a=o.ry.insert_row(e.id,t,[s]);i.tell(e,a),r.record(i)}async function w(e,t){e.preventDefault(),e.stopPropagation(),i.h_.cube=t,i.h_.point={x:e.clientX,y:e.clientY},i.h_.stack_pos.length=0,i.h_.stack_rect.length=0,i.h_.stack_menus.length=0,t instanceof o.p4?i.h_.menu=function(e){const t=[...S(e,!0),{usable:!0,title:"语言",icon:["iconfont","icon-square"],has_submenu:!0,mouseenter:t=>function(e){return{title:"选择语言",active:[e.active_tab?.lang||""],menus:e.langs.map(t=>({title:t,usable:!0,icon:["iconfont","icon-square"],mouseenter(e){},click(n){const{courier:r,history:i,id:s,active_tab:a}=e;if(!a)return;const l=r.get_recorder();l.tell(e,o.DW.change_lang(s,a.id,t)),i.record(l)}}))}}(e),click(e){}},{usable:!0,title:"主题",icon:["iconfont","icon-square"],has_submenu:!0,mouseenter:t=>function(e){return{title:"选择主题",active:[e.active_tab?.theme||""],menus:e.themes.map(t=>({title:t,usable:!0,icon:["iconfont","icon-square"],mouseenter(e){},click(n){const{courier:r,history:i,id:s,active_tab:a}=e;if(!a)return;const l=r.get_recorder();l.tell(e,o.DW.change_theme(s,a.id,t)),i.record(l)}}))}}(e),click(e){}},{usable:!0,title:"添加代码块",icon:["iconfont","icon-add"],click(t){(0,i.NW)({文件名:""},t=>{const n=t["文件名"],r=n.lastIndexOf(".");let i="typescript";if(r>=0){const e=n.slice(r);i=o.UF[e]||i}const{code_theme:s}=e.config.data,a=e.create_tab(i,n,s),l=e.courier.get_recorder();l.tell(e,o.DW.add(e.id,a)),e.history.record(l)})},mouseenter(e){}},{usable:!0,title:"重命名",icon:["iconfont","icon-rename"],click(t){const n={文件名:e.active_tab?.name||""};(0,i.NW)(n,t=>{const n=e.active_tab;if(!n)return;const r=t["文件名"],i=e.courier.get_recorder();i.tell(e,o.DW.rename(e.id,n.id,r)),e.history.record(i)})},mouseenter(e){}},{usable:!0,title:"复制代码",icon:["iconfont","icon-copy"],click(t){e.copy_code()},mouseenter(e){}},{usable:!0,title:"清空代码",icon:["iconfont","icon-eraser"],click(t){const n=e.active_tab;if(!n)return;const r=e.courier.get_recorder();r.tell(e,o.DW.update(e.id,n.id,"")),e.history.record(r)},mouseenter(e){}},{usable:!0,title:"删除代码",icon:["iconfont","icon-close"],click(t){const n=e.active_tab;if(!n)return;const r=e.courier.get_recorder();r.tell(e,o.DW.remove(e.id,n.id)),e.history.record(r)},mouseenter(e){}}];return{title:e.meta.cubename,active:[],menus:t}}(t):t instanceof o.Ku?i.h_.menu=function(e){const t=e.get_active_cell(),n=[...S(e,!0),{usable:!0,title:e.title?"移除标题":"添加标题",icon:["iconfont","icon-a-Addheader2x"],has_submenu:!1,mouseenter(e){},click(t){const{history:n,courier:r,id:i}=e,s=r.get_recorder();if(e.title){const t=o.en.remove_title(i);s.tell(e,t)}else{const t=o.XV.get_default(),n=o.en.add_title(i,t);s.tell(e,n)}n.record(s)}},{usable:e.selection_cells.length>0,title:"复制子表",icon:["iconfont","icon-grid"],has_submenu:!1,mouseenter(e){},click(t){const{clipboard:n}=e,r=a.F.tips,i=e.copy_selection_table();if(!i)return a.F.tips?.tip_error("复制子表失败");const s=e.get_selection_text();n.set_clipboard_cubedata(s,[i]),r?.tip_success("复制子表成功")}},{usable:e.selection_cells.length>0,title:"合并单元格",icon:["iconfont","icon-hebingdanyuange"],has_submenu:!1,mouseenter(e){},click(t){!function(e){const{courier:t,id:n,history:r}=e,i=a.F.tips,s=t.get_recorder(),l=e.get_selection_area();if(!l)return i?.tip_info("无选中单元格");s.tell(e,o.en.merge(n,l)),r.record(s)}(e)}},{usable:!!t,title:"扩大当前列宽",icon:["iconfont","icon-expand-horizontal-1--expand-resize-bigger-horizont"],has_submenu:!1,shortcut:"",mouseenter(e){},click(t){h(e,1)}},{usable:!!t,title:"缩小当前列宽",icon:["iconfont","icon-shrink-horizontal-1--resize-shrink-bigger-horizont"],has_submenu:!1,shortcut:"",mouseenter(e){},click(t){h(e,-1)}},{usable:!!t,title:"向左插入列",icon:["iconfont","icon-cc-arrow-left-square"],has_submenu:!1,shortcut:"ctrl + shift + ⇠",mouseenter(e){},click(t){l(e)}},{usable:!!t,title:"向右插入列",icon:["iconfont","icon-cc-arrow-right-square"],has_submenu:!1,shortcut:"ctrl + shift + ⇢",mouseenter(e){},click(t){c(e)}},{usable:!!t,title:"向上插入行",icon:["iconfont","icon-cc-arrow-up-square"],has_submenu:!1,shortcut:"ctrl + shift + ↑",mouseenter(e){},click(t){d(e)}},{usable:!!t,title:"向下插入行",icon:["iconfont","icon-cc-arrow-down-square"],has_submenu:!1,shortcut:"ctrl + shift + ⇣",mouseenter(e){},click(t){u(e)}},{usable:!!t,title:"向左插入单元格",icon:["iconfont","icon-cc-arrow-left-square"],has_submenu:!1,shortcut:"ctrl + ⇠",mouseenter(e){},click(t){l(e,!0)}},{usable:!!t,title:"向右插入单元格",icon:["iconfont","icon-cc-arrow-right-square"],has_submenu:!1,shortcut:"ctrl + ⇢",mouseenter(e){},click(t){c(e,!0)}},{usable:!!t,title:"向上插入单元格",icon:["iconfont","icon-cc-arrow-up-square"],has_submenu:!1,shortcut:"ctrl + ↑",mouseenter(e){},click(t){d(e,!0)}},{usable:!!t,title:"向下插入单元格",icon:["iconfont","icon-cc-arrow-down-square"],has_submenu:!1,shortcut:"ctrl + ⇣",mouseenter(e){},click(t){u(e,!0)}},{usable:!!t,title:"删除当前行",icon:["iconfont","icon-shanchuhang"],has_submenu:!1,shortcut:"",mouseenter(e){},click(t){!function(e){const{cursor:t,courier:n,stats:r,history:i,id:s}=e,l=a.F.tips,{cube_end:c}=t,d=e.get_active_cell();if(!d)return l?.tip_info("未发现激活单元格");if(!e.check_orderly_row(d.row))return l?.tip_info("当前行不整齐");{const t=n.get_recorder();t.tell(e,o.en.remove_row(s,d.row)),i.record(t)}}(e)}},{usable:!!t,title:"删除当前列",icon:["iconfont","icon-shanchulie"],has_submenu:!1,shortcut:"",mouseenter(e){},click(t){!function(e){const{cursor:t,courier:n,stats:r,history:i,id:s}=e,l=a.F.tips,{cube_end:c}=t,d=e.get_active_cell();if(!d)return l?.tip_info("未发现激活单元格");if(!e.check_orderly_col(d.col))return l?.tip_info("当前列不整齐");{const t=n.get_recorder();t.tell(e,o.en.remove_col(s,d.col)),i.record(t)}}(e)}},{usable:!!t,title:"删除当前单元格",icon:["iconfont","icon-list-delete-cell"],has_submenu:!1,shortcut:"",mouseenter(e){},click(t){!function(e){const{cursor:t,courier:n,stats:r,history:i,id:s}=e,l=a.F.tips,{cube_end:c}=t,d=e.get_active_cell();if(!d)return l?.tip_info("未发现激活单元格");const u=n.get_recorder();u.tell(e,o.en.remove_cell(s,d.box.id)),i.record(u)}(e)}}];return{title:e.meta.cubename,active:[],menus:n}}(t):t instanceof o.HR?i.h_.menu=function(e){const t=[...S(e)];return{title:e.meta.cubename,active:[],menus:t}}(t):t instanceof o.mM?i.h_.menu=function(e){const t=[...S(e,!0),{usable:!0,title:"添加块",shortcut:"",has_submenu:!1,icon:["iconfont","icon-add"],mouseenter(){},click(){!function(e){const{courier:t,history:n}=e,i=t.get_recorder(),s=[o.XV.get_default()];i.tell(e,r.VL.insert_child(e.id,s,e.child_count)),n.record(i)}(e)}},{usable:!0,title:"布局•限定列宽",shortcut:"",has_submenu:!0,icon:["iconfont","icon-circle"],mouseenter:()=>function(e){const t=[{usable:!0,title:120,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){m(e,120)}},{usable:!0,title:140,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){m(e,140)}},{usable:!0,title:160,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){m(e,160)}},{usable:!0,title:180,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){m(e,180)}},{usable:!0,title:200,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){m(e,200)}}];return{title:"限定列宽",active:[e.attrs.column_width],menus:t}}(e),click(){}},{usable:!0,title:"布局•限定列数",shortcut:"",has_submenu:!0,icon:["iconfont","icon-circle"],mouseenter:()=>function(e){const t=[{usable:!0,title:2,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){p(e,2)}},{usable:!0,title:3,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){p(e,3)}},{usable:!0,title:4,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){p(e,4)}},{usable:!0,title:5,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){p(e,5)}},{usable:!0,title:6,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){p(e,6)}}];return{title:"限定列数",active:[e.attrs.column_count],menus:t}}(e),click(){}}];return{title:e.meta.cubename,active:[],menus:t}}(t):t instanceof o.Kw?i.h_.menu=function(e){const t=[...S(e),{usable:!0,title:"缩进",icon:["iconfont","icon-square"],shortcut:"tab",has_submenu:!1,mouseenter(){},click(t){_(e)}},{usable:!0,title:"反向缩进",icon:["iconfont","icon-square"],shortcut:"shift + tab",has_submenu:!1,mouseenter(){},click(t){_(e,!0)}}];return{title:e.meta.cubename,active:[],menus:t}}(t):t instanceof o.NQ?i.h_.menu=function(e){const t=[...S(e),{usable:!0,title:"缩进",icon:["iconfont","icon-square"],shortcut:"tab",has_submenu:!1,mouseenter(){},click(t){g(e)}},{usable:!0,title:"反向缩进",icon:["iconfont","icon-square"],shortcut:"shift + tab",has_submenu:!1,mouseenter(){},click(t){g(e,!0)}}];return{title:e.meta.cubename,active:[],menus:t}}(t):t instanceof o.k9?i.h_.menu=function(e){const t=[...S(e),{usable:!0,title:"缩进",icon:["iconfont","icon-square"],shortcut:"tab",has_submenu:!1,mouseenter(){},click(t){b(e)}},{usable:!0,title:"反向缩进",icon:["iconfont","icon-square"],shortcut:"shift + tab",has_submenu:!1,mouseenter(){},click(t){b(e,!0)}}];return{title:e.meta.cubename,active:[],menus:t}}(t):t instanceof o.fC?i.h_.menu=function(e){const t=[{usable:!0,title:"下载",icon:["iconfont","icon-download"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){e.event.emit_asset_download("image",e.info)}},{usable:!0,title:"复制到粘贴板",icon:["iconfont","icon-copy"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const n=e.dom?.querySelector("img");if(!n)return a.F.tips?.tip_error("复制失败");fetch(n.src).then(e=>e.blob()).then(async t=>{const n=new ClipboardItem({"image/png":t});await e.clipboard.set_clipboard_data(n)&&a.F.tips?.tip_success("复制成功🍊")})}},{usable:!0,title:"文字环绕",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!0,mouseenter:()=>function(e){return{title:"文字环绕",active:[],menus:[{usable:!0,title:"无环绕",icon:["iconfont","icon-close"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{history:n}=e;n.record(e.clear_float())}},{usable:!0,title:"左环绕",icon:["iconfont","icon-floatleft"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{history:n}=e;n.record(e.float("L"))}},{usable:!0,title:"右环绕",icon:["iconfont","icon-floatright"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{history:n}=e;n.record(e.float("R"))}}]}}(e),click(e){}}];return{title:e.meta.cubename,active:[],menus:t}}(t):t instanceof o.RQ&&(i.h_.menu=function(e){const t=[...S(e,!1),{usable:!0,title:"向下插入行",shortcut:"ctrl + enter",icon:["iconfont","icon-cc-arrow-down-square"],mouseenter(){},click(){const{cursor:t}=e,{cube_end:n}=t;if(!n)return;const r=n.find_upstream_untill(e);r instanceof o.XV&&v(e,Math.floor(r.index/2)+1)}},{usable:!0,title:"向上插入行",shortcut:"ctrl + shift + enter",icon:["iconfont","icon-cc-arrow-up-square"],mouseenter(){},click(){const{cursor:t}=e,{cube_end:n}=t;if(!n)return;const r=n.find_upstream_untill(e);r instanceof o.XV&&v(e,Math.floor(r.index/2))}}];return{title:e.meta.cubename,active:[],menus:t}}(t))}function x(e,t,n,r=5){e.width,Math.abs(e.y-n.y),e.width,Math.abs(e.height-(n.y+n.height)),Math.abs(n.x-e.x),e.height;const i={width:Math.abs(e.width-(n.x+n.width)),height:e.height};if(s.MathRect.can_include(i,t)){const i=n.y+t.height-e.height;return{x:n.x+n.width+r,y:i<0?n.y:n.y-i}}{const i=n.y+t.height-e.height;return{x:n.x-t.width-r,y:i<0?n.y:n.y-i}}}function k(e,t){const{courier:n,history:i}=e,s=n.get_recorder(),a=e.pcube;if("A"===t)if(e instanceof o.HR){const t=o.HR.get_default();s.tell(a,r.VL.insert_child(a.id,[t],e.index+1))}else{const t=o.gK.get_default(),n=r.VL.insert_child(a.id,[t],e.index+1);s.tell(a,n)}else if("B"===t&&e)if(e instanceof o.HR){const t=o.HR.get_default();s.tell(a,r.VL.insert_child(a.id,[t],e.index))}else{const t=o.gK.get_default(),n=r.VL.insert_child(a.id,[t],e.index);s.tell(a,n)}i.record(s)}function S(e,t=!1){const n=[{usable:!0,title:"向前插入行",icon:["iconfont","icon-circle"],has_submenu:!1,mouseenter(e){},click(t){k(e,"B")}},{usable:!0,title:"向后插入行",icon:["iconfont","icon-circle"],has_submenu:!1,mouseenter(e){},click(t){k(e,"A")}}],r={usable:!0,title:"全屏",icon:["iconfont","icon-square"],has_submenu:!1,mouseenter(e){},click(t){e.dom?.requestFullscreen()}};return t&&n.push(r),n}},2160:(e,t,n)=>{"use strict";n.d(t,{R:()=>r.R});var r=n(7977)},2332:(e,t,n)=>{"use strict";n.d(t,{M:()=>C});var r=n(7633),i=n(4743),s=n(3028),o=n(9927),a=n(9513),l=n(3097),c=n(4823),d=n(7852),u=n(2411),h=n(539),p=n(685),m=n(1490),f=n(2773),_=n(6517),g=n(9788),b=n(3347),y=n(4e3),v=n(2519),w=n(2551),x=n(3447),k=n(8304),S=n(8631);class C extends l.j{_scopes=(0,r.Gc)(new Set);_dom;_children=(0,r.Gc)([]);_courier;_history;_cursor;_config;_clipboard;_painter;_event;_stats;_hotkeys;_cubes;_listener;_isdev=!1;constructor(){super(),this._cubes=new u.h(this),this._hotkeys=new h.Wu(this),this._config=new g.B(this),this._cursor=new b.P(this),this._courier=new y.W(this),this._history=new s.PI(this),this._clipboard=new _.F(this),this._painter=new f.W(this),this._event=new m.z(this),this._stats=new p.I(this),this._listener=new d.t(this),Promise.resolve().then(()=>this._cubes.add_cube(this)),this.set_cmd_handler(a.zS.cube_reset,this.on_reset.bind(this)),this.set_cmd_handler(a.zS.cube_reorder,this.on_cube_reorder.bind(this)),this.set_cmd_handler(a.zS.cube_insert_child,this.on_insert_cube.bind(this)),this.set_cmd_handler(a.zS.cube_delete_child,this.on_delete_cube.bind(this)),this.set_cmd_handler(a.zS.cube_set_selection_css,this.on_cube_set_selection_css.bind(this)),this.set_cmd_handler(a.zS.cube_insert,this.on_cube_insert.bind(this)),this.set_cmd_handler(a.zS.cube_delete,this.on_cube_delete.bind(this)),this.set_cmd_handler(a.zS.cube_set_attr,this.on_cube_set_attr.bind(this)),this.set_cmd_handler(a.K9.cursor_in_tail,this.on_cursor_in_tail.bind(this)),v.o.init_cmd_handler(this)}get editable(){return!0}get config(){return this._config}get hotkeys(){return this._hotkeys}get stats(){return this._stats}get cubes(){return this._cubes}get cursor(){return this._cursor}get listener(){return this._listener}get courier(){return this._courier}get history(){return this._history}get clipboard(){return this._clipboard}get painter(){return this._painter}get event(){return this._event}get root(){return this}get isdev(){return this._isdev}get dom(){return document.getElementById(this.id)}get clientRect(){return this.dom?.getBoundingClientRect()}get clientRects(){return this.dom?.getClientRects()}get pid(){}get index(){return 0}get css(){return Object.assign({},this.data.css)}get attrs(){return Object.assign({},this.data.attrs)}get info(){return this.data.info}get child_count(){return this._children.length}get child_first(){return this._children[0]}get child_last(){return this._children[this._children.length-1]}get id(){return this.data.id}get pcube(){}get type(){return this.data.type}get versions(){return Object.assign({},this.data.versions)}get level(){return 0}get in_postil(){return!1}get host_postil(){return null}get next_cube_deep(){}get prev_cube_deep(){}get root_dom(){return this._dom}get is_empty(){const e=1===this.child_count,t=this.child_first.is_empty;return e&&t}get prev_cube(){}get next_cube(){}get host_node(){}get scope(){return new Set([...this._scopes])}get scope_normal(){const e=new Set;for(let t of this.scope)t.freeze||e.add(t);return e}get scope_freeze(){const e=new Set;for(let t of this.scope)t.freeze&&e.add(t);return e}get scope_count_normal(){return this._scopes.size-this.scope_count_freeze}get scope_count_freeze(){let e=0;for(let t of this.scope)t.freeze&&e++;return e}set_dev(e=!0){this._isdev=e,window.root=this}find_child_cube(e){return this._children.find(t=>t.id===e)}find_child_index(e){return this.children.findIndex(t=>t.id===e)}find_next_cube(e){const t=this.find_child_index(e);return this.children[t+1]}find_prev_cube(e){const t=this.find_child_index(e);return this.children[t-1]}is_contains_cube(e){return!!e&&e.root===this}get_valid_index(e){return"head"===e?0:"tail"===e?this.child_count:e<0?0:e>this.child_count?this.child_count:e}copy(e,t){const n=this._children.slice(e,t),r=[];for(let e of n){let t=e.export();r.push(t)}return r}find_cube(e){return this.cubes.find_cube(e)}filter(e){const t=[];for(let n of this.children)e(n)&&t.push(n),t.push(...n.filter(e));return t}each(e){for(let t of this.children)e(t),t.each(e)}find_upstream_untill(){}add_scope_by_cube(e){const t=new c.R(this,e);this._scopes.add(t),this.event.emit_status_update()}add_scope(e=!1){if(e){const e=this.cursor.cube_end;if(!e||e instanceof C)return w.F.tips?.tip_warning("光标未在有效块内");this.add_scope_by_cube(e)}else{const e=this.stats.view_point,t=this.cursor.find_cube_by_coor(e);if(!t||t instanceof C)return w.F.tips?.tip_warning("光标未在有效块内");this.add_scope_by_cube(t)}}remove_scope(e){for(let t of this._scopes)if(t.id===e){this._scopes.delete(t);break}}clear_scope(e=!0){for(let t of this._scopes)e&&t.freeze||this._scopes.delete(t)}freeze_scopes(){for(let e of this._scopes)e.freeze=!0}sort_scope(){const e=[...this._scopes];return e.sort((e,t)=>e.pos.y-t.pos.y),e}get_scope_cubes(e=!1,t=!0){if(0===this._scopes.size)return[];const n=[],r=e?this.sort_scope():this.scope;for(let e of r)t&&e.freeze||n.push(e.get_scope_info());return n}get_scope_cubes_data(){const e=this.get_scope_cubes(),t=[];for(let n of e)t.push(...n.cube.copy(n.range[0],n.range[1]));return t}delete_edge(e,t){const{courier:n}=this,r=new s.vk(n);if("backward"===t){const t=e.find_upstream_untill(this);if(t&&t.is_empty)return t.remove_self();const n=e.prev_cube_deep;if(n&&n.is_empty)return n.remove_self();const i=n?.next_cube;if(i&&n.type===i.type)return i.merge("left");if(n)return r.tell(n,k.U.in_tail(n.id))}else{const t=e.find_upstream_untill(this);if(t&&t.is_empty)return t.remove_self();const n=e.next_cube_deep;if(n&&n.is_empty)return n.remove_self();const i=n?.prev_cube;if(i&&n.type===i.type)return n.merge("left");if(n)return r.tell(n,k.U.in_tail(n.id))}}splice(e,t,...n){const r=this._children.splice(e,t,...n);for(let e of r)e.gc();const i=[];for(let e of r)i.push(e.export());return{children:r,data:i}}get_sdk_version(){return o.K.get_sdk_meta()}on_reset(e){const{courier:t}=this,{data:n}=e,r=t.get_recorder();r.add_cmd(e);const i=this.export().info,s=S.I.build_cubes(n,this);return this.splice(0,this.child_count,...s),r.add_recover(x.V.reset(this.id,i)),r}on_cube_reorder(e){const{courier:t,history:n,cursor:r}=this,{cubeid:i,index:o}=e,a=this.find_child_cube(i);if(!a||a.index===o)return;const l=new s.vk(t);let c=0,d=a.index;return"tail"===o?c=this.child_count:"number"==typeof o&&(c=o),this.splice(d,1),this.splice(c,0,a),l.add_recover(x.V.reorder(this.id,a.id,d)),l}on_insert_cube(e){const{courier:t}=this,n=t.get_recorder();n.add_cmd(e);const{pos:r,data:s}=e;if(0===s.length)return n;const o=[];for(let e of s)e.type===a.u0.box_root&&o.push(new i.HR(e,this));let l=this.get_valid_index(r);this.splice(l,0,...o);const c=o[o.length-1];return c&&n.tell(c,k.U.in_tail(c.id,0)),n.add_recover(x.V.delete_child(this.id,"backward",[l,l+o.length])),n}on_delete_cube(e){const{courier:t,pcube:n,pid:r}=this,{dir:i,range:s}=e,[o,a]=s,l=t.get_recorder();l.add_cmd(e);const c=this.children[o-1],d=this.children[a],u=a-o;if(o!==a){if(o<=0&&a>=this.child_count){const e=this.child_first;return this.child_count>1&&l.tell(this,x.V.delete_child(this.id,i,[1,this.child_count])),e.is_empty||l.tell(e,x.V.reset(e.id,[])),l}{let e=this.splice(o,u);c&&"backward"===i||!d?l.tell(c,k.U.in_tail(c.id,0)):(d&&"forward"===i||!c)&&l.tell(d,k.U.in_head(d.id,0));const t=e.data;l.add_recover(x.V.insert_child(this.id,t,o))}return l}}on_cube_set_selection_css(e){const{cursor:t,courier:n,pcube:r,pid:i}=this,{css:o,start_id:a,end_id:l,offset_end:c,offset_start:d}=e,u=new s.vk(n);if(a!==l||c!==d){if(l&&!a){const e=this.find_cube(l),t=e?.find_upstream_untill(this);if(!t)return;const n=this.children.slice(0,t.index);for(let e of n)u.tell(e,x.V.set_selection_css(e.id,o,e.id,e.id,"head","tail"));return u.tell(t,x.V.set_selection_css(t.id,o,null,l,"head",c)),u}if(a&&!l){const e=this.find_cube(a),t=e?.find_upstream_untill(this);if(!t)return;const n=this.children.slice(t.index+1);for(let e of n)u.tell(e,x.V.set_selection_css(e.id,o,e.id,e.id,"head","tail"));return u.tell(t,x.V.set_selection_css(t.id,o,a,null,d,"tail")),u}if("tail"===c&&"head"===d){for(let e of this.children)u.tell(e,x.V.set_selection_css(e.id,o,e.id,e.id,"head","tail"));return u}if(l&&a){const e=this.find_cube(a),t=this.find_cube(l),n=e?.find_upstream_untill(this),r=t?.find_upstream_untill(this);if(!n||!r)return;const i=this.children.slice(n.index+1,r.index);for(let e of i)u.tell(e,x.V.set_selection_css(e.id,o,e.id,e.id,"head","tail"));return u.tell(n,x.V.set_selection_css(n.id,o,a,null,d,"tail")),u.tell(r,x.V.set_selection_css(r.id,o,null,l,"head",c)),u}}}on_cube_insert(e){if(0===e.data.length)return;const{courier:t,cursor:n,pid:r,pcube:i}=this,o=new s.vk(t),{data:a,end_id:l,start_id:c,offset_end:d,offset_start:u}=e,h=this.find_cube(c),p=this.find_cube(l),m=h?.find_upstream_untill(this),f=p?.find_upstream_untill(this);if(!m||!f)return o;if(p!==h||u!==d)if(m&&m===f)o.tell(m,x.V.delete(m.id,"backward",c,l,u,d)),o.tell(m,x.V.insert(m.id,a,c,l,u,d));else{o.tell(f,x.V.delete(f.id,"backward",null,l,"head",d)),o.tell(this,x.V.delete_child(this.id,"backward",[m.index+1,f.index])),o.tell(this,x.V.insert_child(this.id,e.data,m.index+1)),o.tell(m,x.V.delete(m.id,"backward",c,null,u,"tail"));let t=e.data[e.data.length-1];if(t){const e=this.find_child_cube(t.id);e&&o.tell(e,k.U.in_tail(t.id,0))}}else o.tell(p,x.V.insert(l,a,c,l,u,d));return o}on_cube_delete(e){const{courier:t,cursor:n}=this,{dir:r,start_id:o,end_id:a,offset_end:l,offset_start:c,reserve:d}=e,u=new s.vk(t);if(!o&&a){const e=this.find_cube(a),t=e?.find_upstream_untill(this);if(!t||!e)return;return u.tell(this,x.V.delete_child(this.id,r,[0,t.index])),u.tell(t,x.V.delete(t.id,r,o,a,"head",l)),u}if(o&&!a){const e=this.find_cube(o),t=e?.find_upstream_untill(this);if(!t||!e)return;return u.tell(this,x.V.delete_child(this.id,r,[t.index+1,this.child_count])),u.tell(t,x.V.delete(t.id,r,o,a,c,l)),u}if("head"===c&&"tail"===l)return u.tell(this,x.V.reset(this.id,[])),u;if(o&&a){const e=this.find_cube(o),t=this.find_cube(a);if(!(e instanceof i.P6&&t instanceof i.P6))return;const n=e.find_upstream_untill(this),s=t.find_upstream_untill(this);if(!n||!s)return u;const d=n.index,h=s.index;if(o!==a||c!==l)if(n===s)u.tell(n,x.V.delete(n.id,r,o,a,c,l,!0));else{u.tell(s,x.V.delete(s.id,r,null,a,"head",l)),u.tell(this,x.V.delete_child(this.id,"backward",[d+1,h])),u.tell(n,x.V.delete(n.id,r,o,null,c,"tail",!0));let t=0;if("number"==typeof c&&(t=c),u.tell(n,x.V.merge(n.id,"right",o,t)),n.is_empty)u.tell(this,x.V.delete_child(this.id,"backward",[n.index,n.index+1]));else if(e instanceof i.P6){const n=e.pcube;u.tell(n,x.V.merge(n.id,"right",o,t))}}return u}}on_cube_set_attr(e){const{courier:t,cursor:n}=this,{attr:i}=e,s=t.get_recorder();if(s.add_cmd(e),0===Object.keys(i).length)return;const o={};for(let e in i){const t=i[e];o[e]=structuredClone((0,r.ux)(this.attrs[e]))||null,null===t?delete this.attrs[e]:this.attrs[e]=t}return s.add_recover(x.V.set_attr(this.id,o)),s}on_cursor_in_tail(e){const{offset:t}=e,{courier:n}=this,r=this.child_last,i=new s.vk(n);if(r)return i.tell(r,k.U.in_tail(r.id,t)),i}}},2411:(e,t,n)=>{"use strict";n.d(t,{h:()=>a});var r=n(7633),i=n(4743),s=n(3923),o=n(9513);class a extends s.K{_map=(0,r.Gc)({});_types=(0,r.Gc)(new Map);_count=(0,r.Gc)({});constructor(e){super(e)}get postils(){return this._types.get(o.u0.postil)||new Map}get meta(){return a.meta}get_types_cube(e){return this._types.get(e)||new Map}add_cube(e){const t=e.id,n=e.meta.type;void 0===this._count[t]?this._count[t]=1:this._count[t]++,this._map[t]=e;const i=this._types.get(n);i?i.set(t,e):this._types.set(n,(0,r.Gc)(new Map([[t,e]])))}remove_cube(e){const t=e.id,n=e.meta.type;0===--this._count[t]&&(delete this._map[t],this._types.get(n)?.delete(t))}find_cube(e){return this._map[e]}find_postil(e){for(let t of Object.values(this.postils)){if(t.id===e)return t;const n=t.find_cube(e);if(n)return n}}clear_all_map_selected(){const e=this.get_types_cube(o.u0.submap);if(e)for(let[t,n]of e)n.clear_node_selected();this.root instanceof i.EU&&this.root.clear_node_selected()}static get meta(){return{type:o.Mu.cubes,version:1}}}},2519:(e,t,n)=>{"use strict";n.d(t,{o:()=>i,H:()=>s});const r=new Map;class i{static get_cmd_handler(e,t){const n=r.get(e);return n?.get(t)}static set_cmd_handler(e,t,n){let i=r.get(e);i?i.set(t,n):(i=new Map,i.set(t,n),r.set(e,i))}static init_cmd_handler(e){const t=e.meta,n=r.get(t.type);if(n)for(let[t,r]of n)e.set_vip_cmd_handler(t,r.bind(e))}}function s(e){return(t,n)=>{const r=t[n];if(!r)return;const s=t.meta;i.set_cmd_handler(s.type,e,r)}}},2551:(e,t,n)=>{"use strict";n.d(t,{F:()=>r});class r{static _funcs=new Map;static get url(){return this._funcs.get("asset-url")}static get tips(){return this._funcs.get("tip")}static register_asset_url(e){this._funcs.set("asset-url",e)}static register_tip(e){this._funcs.set("tip",e)}}},2698:(e,t,n)=>{"use strict";n.d(t,{M:()=>i});var r=n(9204);class i extends r._{}},2773:(e,t,n)=>{"use strict";n.d(t,{W:()=>l});var r=n(7633),i=n(4116),s=n(3028),o=n(6753),a=n(9513);class l extends o.K{_format_brush=null;get meta(){return l.meta}get format_brush(){const e={};return this._format_brush&&Object.assign(e,this._format_brush),e}constructor(e){super(e)}paint(e,t=!1){const{root:n,cursor:o,history:a,courier:l}=this,c=new s.vk(l);if(!e)return;const d=structuredClone((0,r.ux)(e));if(d["text-align"]){const t=e["text-align"];c.merge(this.text_align(t)),delete d["text-align"]}if(n.scope_count_normal>0){const e=n.get_scope_cubes();for(let n of e){const e=n.cube;for(let r of e.children.slice(...n.range))c.tell(r,i.VL.set_css(r.id,structuredClone(d),t))}}else{const{cube_selection:e,cube_start:n,cube_end:r,offset_start:s,offset_end:a}=o;if(!e||!n||!r)return;const l=i.VL.set_selection_css(e.id,d,n.id,r.id,s,a,t);c.tell(e,l)}a.record(c)}clear(){const{root:e,cursor:t,history:n,courier:r}=this,o=new s.vk(r),a={};if(e.scope_count_normal>0){const t=e.get_scope_cubes();for(let e of t){const t=e.cube;for(let n of t.children.slice(...e.range))o.tell(n,i.VL.set_css(n.id,structuredClone(a),!1,!0))}}else{const{cube_selection:e,cube_start:n,cube_end:r,offset_start:s,offset_end:l}=t;if(!e||!n||!r)return;const c=i.VL.set_selection_css(e.id,a,n.id,r.id,s,l,!1,!0);o.tell(e,c)}n.record(o)}text_align(e){const{root:t,cursor:n,history:r,courier:o}=this,a=new s.vk(o),l={"text-align":e};if(t.scope_count_normal>0){const e=t.get_scope_cubes();for(let t of e){const e=t.cube;for(let n of e.children.slice(...t.range))a.tell(n,i.VL.set_css(n.id,structuredClone(l)))}}else{const e=t.cursor.find_selection_lines();for(let t of e){const e=i.VL.set_css(t.id,structuredClone(l));a.tell(t,e)}}return a}indent(){const{root:e,cursor:t,history:n,courier:r,config:o}=this,a=new s.vk(r);if(e.scope_count_normal>0){const t=e.get_scope_cubes();for(let e of t){const t=e.cube;for(let n of t.children.slice(...e.range)){const e=n.attrs.indent>0?n.attrs.indent+1:1;a.tell(n,i.VL.set_attr(n.id,{indent:e}))}}}else{const e=t.find_selection_lines();for(let t of e){const e=t.attrs.indent||0,n=e>0?e+1:1;a.tell(t,i.VL.set_attr(t.id,{indent:n}))}}n.record(a)}unindent(){const{root:e,cursor:t,history:n,courier:r}=this,o=new s.vk(r);if(e.scope_count_normal>0){const t=e.get_scope_cubes();for(let e of t){const t=e.cube.children.slice(...e.range);for(let e of t){let t=e.attrs.indent;t>0&&o.tell(e,i.VL.set_attr(e.id,{indent:t-1}))}}}else{const e=t.find_selection_lines();for(let t of e){const e=t.attrs.indent||0;e>0&&o.tell(t,i.VL.set_attr(t.id,{indent:e-1}))}}n.record(o)}copy_format(){const{root:e,cursor:t}=this;if(e.scope_count_normal>0){const t=[...e.scope_normal][0].focus_cube;this._format_brush=structuredClone((0,r.ux)(t.css))}else{const{cube_focus:e}=t;if(!e)return;this._format_brush=structuredClone((0,r.ux)(e.css))}}apply_format_brush(){const e=this._format_brush;if(!e)return;const{root:t,courier:n,history:r}=this,o=new s.vk(n);if(t.scope_count_normal>0){const n=t.get_scope_cubes();for(let t of n)for(let n of t.cube.children.slice(...t.range)){const t=i.VL.set_css(n.id,e,!1,!0);o.tell(n,t)}}else{const{cube_selection:e,cube_end:t,cube_start:n,offset_start:r,offset_end:s}=this.cursor;if(!e||!t||!n)return;const a=i.VL.set_selection_css(e.id,this.format_brush,n.id,t.id,r,s,!1,!0);o.tell(e,a)}r.record(o)}static get meta(){return{type:a.Mu.painter,version:1}}}},3028:(e,t,n)=>{"use strict";n.d(t,{PI:()=>u,C6:()=>d,vk:()=>h});var r=n(7633),i=n(4089),s=n(9513),o=n(6753),a=n(2551),l=n(3923),c=n(8631);class d extends l.K{_record;_resolve;_status=s.yn.pending;_p=Promise.resolve();_prev_tip_remove;get meta(){return d.meta}get status(){return this._status}constructor(e,t){const n=a.F.tips;super(e),this._record=t,this._prev_tip_remove=n?.tip_info("播放器已就绪,点我播放",1/0,this.play.bind(this))}waiting(){return new Promise(e=>{this._resolve=e,[s.yn.pending,s.yn.playing].includes(this.status)&&e()})}clear_message(){this._prev_tip_remove&&this._prev_tip_remove()}async play(){const e=a.F.tips;this.clear_message(),this.status!==s.yn.stop&&(this._status=s.yn.playing,this._prev_tip_remove=e?.tip_info("正在演示,点此暂停",1/0,this.pause.bind(this)));for(let e of this._record.stack){const t=this.courier.get_recorder();for(let n of e.do){await c.I.sleep(this.config.data.player_speed),await(0,i.dY)(),this.stats.showing=!0;let e=this.root.find_cube(n.id);e?(e.dom?.scrollIntoView({inline:"nearest",block:"nearest",behavior:"smooth"}),t.tell(e,n)):console.warn(`未发现演示cube:${n}`)}await(0,i.dY)(),this.history.record(t),await this.waiting()}this._status=s.yn.stop,this.clear_message(),this.stats.showing=!1,e?.tip_success("演示完毕",9e3)}pause(){const e=a.F.tips;this.clear_message(),this._status!==s.yn.stop&&(this._status=s.yn.pause,this.stats.showing=!1,this._prev_tip_remove=e?.tip_info("暂停演示,点此恢复",1/0,this.continue.bind(this)))}continue(){const e=a.F.tips;this.clear_message(),this._status!==s.yn.stop&&(this._resolve&&this._resolve(),this._status=s.yn.playing,this._prev_tip_remove=e?.tip_info("正在演示,点此暂停",1/0,this.pause.bind(this)))}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:s.Mu.player,version:1}}}class u extends o.K{stack_undo=(0,r.Gc)([]);stack_redo=(0,r.Gc)([]);get meta(){return u.meta}get len_undo(){return this.stack_undo.length}get len_redo(){return this.stack_redo.length}constructor(e){super(e)}execute_command_group(e){const t=(e,n,r)=>{n<r.length&&(0,i.dY)(()=>{this.courier.pass(e),t(r[n+1],n+1,r)})};t(e[0],0,e)}undo(){const e=a.F.tips;if(this.stats.is_read_mode)return e?.tip_info("阅读模式不可操作");if(!this.courier)return;const t=this.stack_undo.pop();if(!t)return e?.tip_info("已无更多记录");this.stack_redo.push(t);const n=t.stack_undo;this.execute_command_group(n),this.event.emit_status_update()}redo(){const e=a.F.tips;if(this.stats.is_read_mode)return e?.tip_info("阅读模式不可操作");if(!this.courier)return;const t=this.stack_redo.pop();if(!t)return e?.tip_info("已无更多记录");this.stack_undo.push(t);const n=t.stack_do;this.execute_command_group(n),this.event.emit_status_update()}record(e){if(!this.stats.is_read_mode&&0!==e.stack_undo.length){if(this.config.data.history_length>0&&this.config.data.history_length<Number.POSITIVE_INFINITY){const e=this.stack_undo.length-this.config.data.history_length;e>0&&this.stack_undo.splice(0,e)}this.stack_undo.push(e),this.event.emit_status_update()}}play(e){return new d(this.root,e)}export(e=0){const t=this.stack_undo.slice(e),n={version:this.meta.version,stack:[],docid:this.root.id};for(let e of t)n.stack.push({do:e.stack_do,undo:e.stack_undo});return n}download(e="record.json"){const t=this.export(),n=document.createElement("a");n.download="filename";const r=new Blob([JSON.stringify(t)],{type:"text/plain"});n.href=URL.createObjectURL(r),n.click()}update_data(...e){return{}}clear_stack(){this.stack_undo.length=0,this.stack_redo.length=0,this.event.emit_status_update()}static get meta(){return{type:s.Mu.history,version:1}}}class h{do=[];undo=[];courier;get stack_do(){const e=[];return e.push(...this.do),e}get stack_undo(){const e=[];return e.push(...this.undo),e}constructor(e){this.courier=e}add_cmd(e){this.do.push(structuredClone((0,r.ux)(e)))}add_recover(e){e&&this.undo.unshift(e)}pass(e){let t=this.courier.pass(e);t instanceof h&&this.merge(t)}tick(e,t){(0,i.dY)(()=>{t?this.tell(t,e):this.courier.pass(e)})}tell(e,...t){const n=a.F.tips;if(this.courier.stats.mode===s.fv.read)return n?.tip_info("只读模式不可操作"),this;for(let n of t){if(!e||e.id!==n.id)return this;console.log("🟩",e,e.type,n),this.courier.event.emit_edit_before(e,n),this.merge(e.on(n)),this.courier.event.emit_edit_after(e,n)}return this}merge(e){return e instanceof h?(this.do.push(...structuredClone((0,r.ux)(e.stack_do))),this.undo.unshift(...structuredClone((0,r.ux)(e.stack_undo))),this):this}}},3097:(e,t,n)=>{"use strict";n.d(t,{j:()=>r});class r{handler=new Map;vip_handler=new Map;constructor(){}on(e){const t=this.get_vip_cmd_handler(e.name)||this.get_cmd_handler(e.name);if(t)return t(e)}get_cmd_handler(e){return this.handler.get(e)}get_vip_cmd_handler(e){return this.vip_handler.get(e)}set_cmd_handler(e,t){this.handler.set(e,t)}set_vip_cmd_handler(e,t){this.vip_handler.set(e,t)}static get_default(...e){throw Error("sub-cube have't implement get_default method")}static get meta(){throw Error("sub-cube have't implement attribution meta")}}},3347:(e,t,n)=>{"use strict";n.d(t,{P:()=>u});var r=n(1068),i=n(4743),s=n(4116),o=n(8631),a=n(9513),l=n(3028),c=n(6753),d=n(4089);class u extends c.K{selection;cursor_step=20;scroll_distance=50;safa_distance=20;get meta(){return u.meta}get has_selection(){return!this.selection.isCollapsed}get client_rect(){return this.range?.getBoundingClientRect()}get client_rects(){return this.range?.getClientRects()}get range(){if(0!==this.selection?.rangeCount)return this.selection?.getRangeAt(0)}get ranges(){const e=[];for(let t=0;t<this.selection.rangeCount;t++)e.push(this.selection.getRangeAt(0));return e}get offset_start(){return this.range?this.range?.startOffset:-1}get offset_end(){return this.range?this.range?.endOffset:-1}get node_start(){return this.range?.startContainer}get node_end(){return this.range?.endContainer}get node_focus(){return this.selection.focusNode}get node_anchor(){return this.selection.anchorNode}get top_edge(){return this.safa_distance}get bottom_edge(){return document.documentElement.clientHeight-this.safa_distance}get cube_selection(){if(!this.range)return;const e=this.range.commonAncestorContainer,t=this.stats.active_root;return t&&this.get_node_cube(e,t)||this.get_node_cube(e,this.root)}get cube_start(){const e=this.range,t=this.cube_selection;if(!e||!t)return;const n=e.startContainer,r=this.get_node_cube(n,t);return r instanceof s._D?r:void 0}get cube_end(){const e=this.range,t=this.cube_selection;if(!e||!t)return;const n=e.endContainer,r=this.get_node_cube(n,t);return r instanceof s._D?r:void 0}get cube_focus(){const e=this.cube_selection,t=this.node_focus;if(!e||!t)return;const n=this.get_node_cube(t,e);return n instanceof s._D?n:void 0}get cube_anchor(){const e=this.cube_selection,t=this.node_anchor;if(!e||!t)return;const n=this.get_node_cube(t,e);return n instanceof s._D?n:void 0}constructor(e){super(e);let t=window.getSelection();if(!t)throw Error("NoteCursor : can't find Selection API");this.selection=t}move_up_by_coor(){}locate_next_line(e,t,n){let s="up"===e?t.prev_line:t.next_line;const o=t.clientRect;let a=s?.clientRect;for(;s&&a&&o&&(a.left>=o.right||a.right<=o.left);){let t="up"===e?s.prev_line:s.next_line;if(!t)break;s=t,a=t.clientRect}if(!s)return;const l=[],c=new Map;for(let e of s.children)if(e instanceof i.P6){let t=e.clientRects;if(!t)continue;for(let n=0;n<t.length;n++)l.push(t[n]),c.set(t[n],e)}const d="up"===e?r.MathRect.get_rect_point(n.left,r._RectPosition.left_mid):r.MathRect.get_rect_point(n.left,r._RectPosition.right_mid),u=r.MathRect.get_nearest_rect(d,l);if(!u)return;const h=r.MathRect.get_shadow_point_horizental(d,u),p=document.caretPositionFromPoint(h.x,h.y);if(p&&p.offsetNode instanceof Text)this.set_cursor(p.offsetNode,p.offset);else if(p&&!(p.offsetNode instanceof Text)){const e=c.get(u);if(!e)return;e.set_cursor_in_tail()}}locate_current_line(e,t,n){const s=[],o=[],a=new Map;for(let e of t.children)if(e instanceof i.P6){let t=e.clientRects;if(!t)continue;for(let n=0;n<t.length;n++){const r=t[n];s.push(r),a.set(r,e)}}if(1===s.length)return!1;if("up"===e){const e=n.left.top;for(let t of s)t.bottom<=e&&o.push(t)}else if("down"===e){const e=n.right.bottom;for(let t of s)t.y>=e&&o.push(t)}if(o.length>0){const t="down"===e?{x:n.right.x,y:n.right.y}:{x:n.left.x,y:n.left.y},i=r.MathRect.get_nearest_rect(t,o);if(!i)return!1;const s=r.MathRect.get_shadow_point_horizental(t,i),l=document.caretPositionFromPoint(s.x,s.y);if(l&&l.offsetNode instanceof Text)return this.set_cursor(l.offsetNode,l.offset),!0;{const e=a.get(i);if(!e)return!1;e.set_cursor_in_tail()}}return!1}move_vertical(e){const{cube_start:t,cube_end:n}=this;if(!(t instanceof i.P6&&n instanceof i.P6))return;const r="up"===e?t.line:n.line,s=this.get_selection_edge_position();r&&s&&(this.locate_current_line(e,r,s)||this.locate_next_line(e,r,s))}move_left(){if(!this.range)return;const{cube_start:e,offset_start:t,offset_end:n,node_end:r}=this,{doc:o,courier:a}=this,c=new l.vk(a);if(e instanceof i.P6){if(this.has_selection)return this.set_cursor(this.range.startContainer,this.range.startOffset);if(e.drop_zero_width_space(t).pos>0)if(e.is_empty){let t=e.prev_cube_deep;t&&c.tell(t,s.UB.in_tail(t.id,0))}else{const n=e.find_text_nav_pos(t,"left");r&&this.set_cursor(r,n)}else{const t=e.prev_cube_deep;if(t){const n=e.meta.block||t.meta.block?0:1;c.tell(t,s.UB.in_tail(t.id,n,"right"))}}}}move_right(){if(!this.range)return;const{cube_end:e,offset_start:t,offset_end:n,node_end:r}=this,{doc:o,courier:a}=this,c=new l.vk(a);if(e instanceof i.P6){if(this.has_selection)return this.set_cursor(this.range.endContainer,this.range.endOffset);if(n<e.drop_zero_width_space(n).len)if(e.is_empty){let t=e.next_cube_deep;t&&c.tell(t,s.UB.in_head(t.id,0))}else{const t=e.find_text_nav_pos(n,"right");r&&this.set_cursor(r,t)}else{const t=e.next_cube_deep;if(t){const n=e.meta.block||t.meta.block?0:1;c.tell(t,s.UB.in_head(t.id,n,"left"))}}}}move_up(){this.move_vertical("up")}move_down(){return this.move_vertical("down")}move_end(){if(!this.range)return;const{cube_end:e}=this,{startContainer:t,endContainer:n,startOffset:i,endOffset:s}=this.range;if(!e)return;this.set_cursor(this.range.endContainer,this.range.endOffset);const a=this.range.getClientRects();if(0===a.length)return;const l=r.MathRect.get_rect_point(a[a.length-1],r._RectPosition.center);let c=o.I.get_client_rects(e.id);if(!c)return;let d=c.length,u=c[0],h=c[c.length-1],p=h;if(d>1){for(let e=0;e<d;e++){const t=c[e];if(r.MathRect.is_point_in_rect(l,t)){p=t;break}}if(p!==h)return this.locate_cursor_on_rect(p,r._RectPosition.right_mid)}let m=e.next_cube;if(!m)return this.locate_cursor_on_rect(p,r._RectPosition.right_mid);for(c=o.I.get_client_rects(m.id);c;){if(d=c.length,u=c[0],u.x<p.right)return this.locate_cursor_on_rect(p,r._RectPosition.right_mid);if(d>1)return this.locate_cursor_on_rect(u,r._RectPosition.right_mid);if(m=m?.next_cube,!m)return this.locate_cursor_on_rect(u,r._RectPosition.right_mid);c=o.I.get_client_rects(m.id)}}move_home(){if(!this.range)return;const{cube_end:e}=this,{startContainer:t,endContainer:n,startOffset:i,endOffset:s}=this.range;if(this.set_cursor(this.range.startContainer,this.range.startOffset),!e)return;const a=this.range.getClientRects();if(0===a.length)return;const l=r.MathRect.get_rect_point(a[a.length-1],r._RectPosition.center);let c=o.I.get_client_rects(e.id);if(!c)return;let d=c.length,u=c[0],h=c[c.length-1],p=u;if(d>1){for(let e=0;e<d;e++){const t=c[e];if(r.MathRect.is_point_in_rect(l,t)){p=t;break}}if(p!==u)return this.locate_cursor_on_rect(p,r._RectPosition.left_mid)}let m=e.prev_cube;if(!m)return this.locate_cursor_on_rect(p,r._RectPosition.left_mid);for(c=o.I.get_client_rects(m.id);c;){if(d=c.length,h=c[c.length-1],h.right>p.left)return this.locate_cursor_on_rect(p,r._RectPosition.left_mid);if(d>1)return this.locate_cursor_on_rect(h,r._RectPosition.left_mid);if(m=m?.prev_cube,!m)return this.locate_cursor_on_rect(h,r._RectPosition.left_mid);c=o.I.get_client_rects(m.id)}}extend_left(){if(!this.range)return;const{startContainer:e,startOffset:t,endContainer:n,endOffset:r}=this.range,{anchorNode:i,anchorOffset:s,focusNode:o,focusOffset:a}=this.selection,l=i||e,c="number"==typeof s?s:t,u=o||n,h="number"==typeof a?a:r;this.set_cursor(u,h),this.move_left(),(0,d.dY)(()=>{const e=this.range?.endContainer,t=this.range?.endOffset;e&&"number"==typeof t&&this.set_selection_between(l,c,e,t)})}extend_right(){if(!this.range)return;const{startContainer:e,startOffset:t,endContainer:n,endOffset:r}=this.range,{anchorNode:i,anchorOffset:s,focusNode:o,focusOffset:a}=this.selection,l=i||e,c="number"==typeof s?s:t,u=o||n,h="number"==typeof a?a:r;this.set_cursor(u,h),this.move_right(),(0,d.dY)(()=>{const e=this.range?.endContainer,t=this.range?.endOffset;e&&"number"==typeof t&&this.set_selection_between(l,c,e,t)})}extend_up(){if(!this.range)return;const{startContainer:e,startOffset:t,endContainer:n,endOffset:r}=this.range,{anchorNode:i,anchorOffset:s,focusNode:o,focusOffset:a}=this.selection,l=i||e,c="number"==typeof s?s:t,d=o||n,u="number"==typeof a?a:r;this.set_cursor(d,u),this.move_up();const h=this.range.endContainer,p=this.range.endOffset;this.set_selection_between(l,c,h,p)}extend_down(){if(!this.range)return;const{startContainer:e,startOffset:t,endContainer:n,endOffset:r}=this.range,{anchorNode:i,anchorOffset:s,focusNode:o,focusOffset:a}=this.selection,l=i||e,c="number"==typeof s?s:t,d=o||n,u="number"==typeof a?a:r;this.set_cursor(d,u),this.move_down();const h=this.range.endContainer,p=this.range.endOffset;this.set_selection_between(l,c,h,p)}extend_home(){if(!this.range)return;const{startContainer:e,startOffset:t,endContainer:n,endOffset:r}=this.range,{anchorNode:i,anchorOffset:s,focusNode:o,focusOffset:a}=this.selection,l=i||e,c="number"==typeof s?s:t,d=o||n,u="number"==typeof a?a:r;this.set_cursor(d,u),this.move_home();const h=this.range.endContainer,p=this.range.endOffset;this.set_selection_between(l,c,h,p)}extend_end(){if(!this.range)return;const{startContainer:e,startOffset:t,endContainer:n,endOffset:r}=this.range,{anchorNode:i,anchorOffset:s,focusNode:o,focusOffset:a}=this.selection,l=i||e,c="number"==typeof s?s:t,d=o||n,u="number"==typeof a?a:r;this.set_cursor(d,u),this.move_end();const h=this.range.endContainer,p=this.range.endOffset;this.set_selection_between(l,c,h,p)}is_contains_selection(e){const t=[];for(let e of this.ranges)t.push(e.commonAncestorContainer);for(let n of t)if(!this.get_node_cube(n,e))return!1;return!0}get_node_cube(e,t){let n=e instanceof Element?e:e.parentElement;const r=[];for(;n;){if(n.id){let e;if(r.push(n.id),this.root,e=t.find_cube(n.id),e)return e}n=n.parentElement}}get_focus_line(){const{cube_end:e}=this;if(e)return e instanceof i.P6?e.line:void 0}set_cursor(e,t){if(!(e instanceof Text))throw Error("NoteCursor : curosr only be set in TextNode");let n=Math.min(e.length,t);this.selection?.setPosition(e,n),e.parentElement&&e.parentElement.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}locate_cursor_on_rect(e,t){let n=r.MathRect.get_rect_point(e,t);const i=document.caretPositionFromPoint(n.x,n.y),s=window.getSelection();if(i&&s&&i.offsetNode instanceof Text)return s.setPosition(i.offsetNode,i.offset)}locate_cursor_by_coor(e,t){const{courier:n,history:r,root:i}=this,o=document.caretPositionFromPoint(e,t),a=o?.offsetNode,c=new l.vk(n);if(a){if(a instanceof Text)o.offsetNode instanceof Text&&(a.parentElement?.parentElement?.focus(),this.set_cursor(o.offsetNode,o.offset));else{const e=i.cursor.get_node_cube(a,i);if(e?.in_postil)return;const t=e?.pcube;if(!e||!t)return;const n=e.meta;e.next_cube,n.block||c.tell(e,s.UB.in_head(e.id,0,"left"))}r.record(c)}}set_cursor_by_coor(e,t){if(t<=this.top_edge){let e=document.documentElement.scrollTop,n=e>this.scroll_distance?this.scroll_distance:e;r.DomAnimation.scroll_element(document.documentElement,-this.scroll_distance,"vertical"),t+=n}else if(t>=this.bottom_edge){let e=document.documentElement.scrollHeight-document.documentElement.clientHeight-document.documentElement.scrollTop,n=e>this.scroll_distance?this.scroll_distance:e;r.DomAnimation.scroll_element(document.documentElement,this.scroll_distance,"vertical"),t-=n}const n=document.caretPositionFromPoint(e,t);if(n&&n.offsetNode instanceof Text){this.set_cursor(n.offsetNode,n.offset);let e=this.get_selection_edge_position()?.right;if(!e)return;return e.y<=this.top_edge?window.scrollBy({top:-this.scroll_distance,behavior:"smooth"}):e.y>=this.bottom_edge&&window.scrollBy({top:this.scroll_distance,behavior:"smooth"}),n}}get_selection_edge_position(){if(!this.range)return;const e=this.range.getClientRects();if(0===e.length)return;const t=e[0],n=e[e.length-1];return{left:new DOMRect(t.x,t.y,0,t.height),right:new DOMRect(n.x,n.y,0,n.height)}}set_selection_between(e,t,n,r){this.selection.setBaseAndExtent(e,t,n,r)}get_selection_text(e=!0){const{cube_end:t,cube_start:n,offset_start:r,offset_end:s}=this;let o="";if(e&&!this.has_selection&&n instanceof i.P6)return n.text;if(this.cube_selection instanceof i.P6)return this.cube_selection.text.slice(r,s);{let e=!1,a=!1;const l=this.find_inline_cube();for(let c of l){for(let l of c){if(a)break;e||l!==n||(e=!0,l instanceof i.P6&&(o+=l.text.slice(r))),a||l!==t||(a=!0,l instanceof i.P6&&(o+=l.text.slice(0,s))),e&&!a&&l instanceof i.P6&&l!==n&&l!==t&&(o+=l.text)}o+="\n"}}return o}find_cube_by_coor(e){const{x:t,y:n}=e,r=document.elementFromPoint(t,n);if(r)return this.get_node_cube(r,this.root)}find_selection_lines(){const e=[],{cube_selection:t,cube_start:n,cube_end:r}=this;if(t instanceof i.P6){let e=t.line;if(e)return[e]}else{if(t instanceof i.gK)return[t];if(n instanceof i.P6&&r instanceof i.P6){const t=n.line,i=r.line;if(t&&i){let n=t;for(;n&&(e.push(n),n!==i);)n=n.next_line}}}return e}find_inline_cube(){const e=[],{cube_start:t,cube_end:n,offset_start:r,offset_end:s}=this;if(!t||!n)return e;if(!(t instanceof i.P6&&n instanceof i.P6))return e;const o=this.find_selection_lines();if(0===o.length)return[];const a=o[0],l=o[o.length-1],c=t.index,d=n.index;if(1===o.length){const t=[];for(let e of a.children.slice(c,d+1))t.push(e);e.push(t)}else{let t=[];for(let e of a.children.slice(c))t.push(e);e.push(t),t=[];for(let n of o.slice(1,-1)){for(let e of n.children)t.push(e);e.push(t),t=[]}for(let e of l.children.slice(0,d+1))t.push(e);e.push(t)}return e}find_inline_data(){const e=[],t=this.find_inline_cube();if(0===t.length)return e;const n=t[0],r=t[t.length-1],s=n[0],o=r[r.length-1],{cube_start:a,cube_end:l,offset_start:c,offset_end:d}=this;if(!a||!l)return e;if(a===l){const t=a.export();t.info=t.info.slice(c,d),e.push(t)}else if(n===r){if(a instanceof i.P6&&a===s){const t=a.export();t.info=t.info.slice(c),e.push(t)}for(let t of n.slice(1,-1))e.push(t.export());if(l instanceof i.P6&&l===o){const t=l.export();t.info=t.info.slice(0,d),e.push(t)}}else{if(a instanceof i.P6&&a===s){const t=a.export();t.info=t.info.slice(c),e.push(t)}e.push(...n.slice(1).map(e=>e.export()));for(let n of t.slice(1,-1)){const t=i.gK.get_default(n.map(e=>e.export()));e.push(t)}const u=i.gK.get_default(r.slice(0,-1).map(e=>e.export()));if(l instanceof i.P6&&l===o){const e=l.export();e.info=e.info.slice(0,d),u.info.push(e)}e.push(u)}return e}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:a.Mu.cursor,version:1}}}},3431:(e,t,n)=>{"use strict";n.d(t,{o:()=>i});var r=n(9513);class i{static add(e,t,n){return{id:e,name:r.JC.add,data:t,pos:n}}static remove(e,t){return{id:e,name:r.JC.remove,range:t}}static indent(e,t){return{id:e,name:r.JC.indent,items:t}}}},3447:(e,t,n)=>{"use strict";n.d(t,{V:()=>i});var r=n(9513);class i{static insert_child(e,t,n){return{id:e,name:r.zS.cube_insert_child,data:t,pos:n}}static delete_child(e,t,n,i=!1){return{id:e,name:r.zS.cube_delete_child,dir:t,range:n,reserve:i}}static insert(e,t,n,i,s,o){return{id:e,name:r.zS.cube_insert,data:t,start_id:n,end_id:i,offset_end:o,offset_start:s}}static delete(e,t,n,i,s,o,a=!1){return{id:e,name:r.zS.cube_delete,dir:t,start_id:n,end_id:i,offset_start:s,offset_end:o,reserve:a}}static delete_adjacent(e,t,n,i){return{id:e,name:r.zS.cube_delete_adjacent,from:t,offset:i,from_id:n}}static set_selection_css(e,t,n,i,s,o,a=!1,l=!1){return{id:e,name:r.zS.cube_set_selection_css,css:t,start_id:n,end_id:i,offset_start:s,offset_end:o,toggle:a,replace:l}}static set_css(e,t,n=!1,i=!1){return{id:e,name:r.zS.cube_set_css,css:t,toggle:n,replace:i}}static set_attr(e,t){return{id:e,name:r.zS.cube_set_attr,attr:t}}static partition(e,t,n,i,s){return{name:r.zS.cube_partition,id:e,start_id:t,end_id:n,offset_start:i,offset_end:s}}static reorder(e,t,n){return{id:e,name:r.zS.cube_reorder,cubeid:t,index:n}}static reset(e,t){return{id:e,name:r.zS.cube_reset,data:t}}static merge(e,t,n,i){return{id:e,name:r.zS.cube_merge,method:t,cubeid:n,offset:i}}static postil_add(e,t=[]){return{name:r.zS.cube_postil_add,id:e,data:t}}static postil_remove(e,t){return{name:r.zS.cube_postil_remove,id:e,range:t}}static resize(e,t=-1,n=-1){return this.set_attr(e,{width:t,height:n})}static fold(e,t){return this.set_attr(e,{fold:t})}}},3682:(e,t,n)=>{"use strict";n.d(t,{y:()=>i});var r=n(9513);class i{static node_add(e,t){return{id:e,name:r.kU.node_add,data:t}}static node_remove(e,t){return{id:e,name:r.kU.node_remove,data:t}}static linker_add(e,t){return{id:e,name:r.kU.linker_add,data:t}}static linker_remove(e,t){return{id:e,name:r.kU.linker_remove,data:t}}}},3923:(e,t,n)=>{"use strict";n.d(t,{K:()=>r.K});var r=n(6753)},3972:(e,t,n)=>{"use strict";function r(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return e=>e in t}n.d(t,{$3:()=>p,$H:()=>B,BH:()=>q,BX:()=>J,Bm:()=>w,C4:()=>Y,CE:()=>f,CP:()=>c,DY:()=>D,Gv:()=>x,J$:()=>Z,Kg:()=>v,MZ:()=>i,Mp:()=>l,NO:()=>a,Oj:()=>s,PT:()=>P,Qd:()=>T,Ro:()=>j,SU:()=>z,TF:()=>u,Tg:()=>E,Tn:()=>y,Tr:()=>$,We:()=>U,X$:()=>d,Y2:()=>Q,ZH:()=>O,Zf:()=>M,bB:()=>H,cy:()=>m,gd:()=>b,pD:()=>r,rU:()=>I,tE:()=>o,u3:()=>ee,vM:()=>_,v_:()=>ne,yI:()=>L,yL:()=>k,yQ:()=>V});const i={},s=[],o=()=>{},a=()=>!1,l=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),c=e=>e.startsWith("onUpdate:"),d=Object.assign,u=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},h=Object.prototype.hasOwnProperty,p=(e,t)=>h.call(e,t),m=Array.isArray,f=e=>"[object Map]"===C(e),_=e=>"[object Set]"===C(e),g=e=>"[object Date]"===C(e),b=e=>"[object RegExp]"===C(e),y=e=>"function"==typeof e,v=e=>"string"==typeof e,w=e=>"symbol"==typeof e,x=e=>null!==e&&"object"==typeof e,k=e=>(x(e)||y(e))&&y(e.then)&&y(e.catch),S=Object.prototype.toString,C=e=>S.call(e),M=e=>C(e).slice(8,-1),T=e=>"[object Object]"===C(e),L=e=>v(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,z=r(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),A=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},R=/-\w/g,P=A(e=>e.replace(R,e=>e.slice(1).toUpperCase())),N=/\B([A-Z])/g,E=A(e=>e.replace(N,"-$1").toLowerCase()),O=A(e=>e.charAt(0).toUpperCase()+e.slice(1)),I=A(e=>e?`on${O(e)}`:""),B=(e,t)=>!Object.is(e,t),D=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},V=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},H=e=>{const t=parseFloat(e);return isNaN(t)?e:t},j=e=>{const t=v(e)?Number(e):NaN;return isNaN(t)?e:t};let F;const U=()=>F||(F="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:{}),q=r("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol");function $(e){if(m(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],i=v(r)?W(r):$(r);if(i)for(const e in i)t[e]=i[e]}return t}if(v(e)||x(e))return e}const G=/;(?![^(]*\))/g,X=/:([^]+)/,K=/\/\*[^]*?\*\//g;function W(e){const t={};return e.replace(K,"").split(G).forEach(e=>{if(e){const n=e.split(X);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function Y(e){let t="";if(v(e))t=e;else if(m(e))for(let n=0;n<e.length;n++){const r=Y(e[n]);r&&(t+=r+" ")}else if(x(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const Z=r("itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly");function Q(e){return!!e||""===e}function J(e,t){if(e===t)return!0;let n=g(e),r=g(t);if(n||r)return!(!n||!r)&&e.getTime()===t.getTime();if(n=w(e),r=w(t),n||r)return e===t;if(n=m(e),r=m(t),n||r)return!(!n||!r)&&function(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=J(e[r],t[r]);return n}(e,t);if(n=x(e),r=x(t),n||r){if(!n||!r)return!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e){const r=e.hasOwnProperty(n),i=t.hasOwnProperty(n);if(r&&!i||!r&&i||!J(e[n],t[n]))return!1}}return String(e)===String(t)}function ee(e,t){return e.findIndex(e=>J(e,t))}const te=e=>!(!e||!0!==e.__v_isRef),ne=e=>v(e)?e:null==e?"":m(e)||x(e)&&(e.toString===S||!y(e.toString))?te(e)?ne(e.value):JSON.stringify(e,re,2):String(e),re=(e,t)=>te(t)?re(e,t.value):f(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[ie(t,r)+" =>"]=n,e),{})}:_(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>ie(e))}:w(t)?ie(t):!x(t)||m(t)||T(t)?t:String(t),ie=(e,t="")=>{var n;return w(e)?`Symbol(${null!=(n=e.description)?n:t})`:e}},4e3:(e,t,n)=>{"use strict";n.d(t,{W:()=>a});var r=n(4089),i=n(3028),s=n(9513),o=n(6753);class a extends o.K{command_group_do=[];command_group_undo=[];get meta(){return a.meta}execute_command_group(e){if(this.stats.mode===s.fv.read)return;const t=(e,n,i)=>{n<i.length&&(0,r.dY)(()=>{this.pass(e),t(i[n+1],n+1,i)})};t(e[0],0,e)}constructor(e){super(e)}get_recorder(){return new i.vk(this)}pass(e){if(this.stats.mode===s.fv.read)return;const t=e,n=e.id,r=this.root.find_cube(n);if(!r)return void console.error("未发现cube:",n);console.log("🟨",r,r.type,t);const o=new i.vk(this);let a=r.on(t);return a instanceof i.vk&&o.merge(a),o}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:s.Mu.courier,version:1}}}},4089:(e,t,n)=>{"use strict";n.d(t,{$u:()=>J,$y:()=>le,CE:()=>Tt,Df:()=>O,EW:()=>on,FK:()=>gt,Fv:()=>Bt,Gy:()=>A,K9:()=>We,Lk:()=>Nt,MZ:()=>E,OW:()=>N,Q3:()=>Dt,QP:()=>P,Wv:()=>Lt,bF:()=>Et,bo:()=>C,dY:()=>f,eW:()=>It,hi:()=>te,nI:()=>Gt,pI:()=>de,pM:()=>I,qL:()=>o,rk:()=>D,sV:()=>Z,uX:()=>kt,wB:()=>rt,xo:()=>ee});var r=n(7633),i=n(3972);function s(e,t,n,r){try{return r?e(...r):e()}catch(e){a(e,t,n)}}function o(e,t,n,r){if((0,i.Tn)(e)){const o=s(e,t,n,r);return o&&(0,i.yL)(o)&&o.catch(e=>{a(e,t,n)}),o}if((0,i.cy)(e)){const i=[];for(let s=0;s<e.length;s++)i.push(o(e[s],t,n,r));return i}}function a(e,t,n,o=!0){t&&t.vnode;const{errorHandler:a,throwUnhandledErrorInProduction:l}=t&&t.appContext.config||i.MZ;if(t){let i=t.parent;const o=t.proxy,l=`https://vuejs.org/error-reference/#runtime-${n}`;for(;i;){const t=i.ec;if(t)for(let n=0;n<t.length;n++)if(!1===t[n](e,o,l))return;i=i.parent}if(a)return(0,r.C4)(),s(a,null,10,[e,o,l]),void(0,r.bl)()}!function(e,t,n,r=!0,i=!1){if(i)throw e;console.error(e)}(e,0,0,o,l)}const l=[];let c=-1;const d=[];let u=null,h=0;const p=Promise.resolve();let m=null;function f(e){const t=m||p;return e?t.then(this?e.bind(this):e):t}function _(e){if(!(1&e.flags)){const t=v(e),n=l[l.length-1];!n||!(2&e.flags)&&t>=v(n)?l.push(e):l.splice(function(e){let t=c+1,n=l.length;for(;t<n;){const r=t+n>>>1,i=l[r],s=v(i);s<e||s===e&&2&i.flags?t=r+1:n=r}return t}(t),0,e),e.flags|=1,g()}}function g(){m||(m=p.then(w))}function b(e,t,n=c+1){for(;n<l.length;n++){const t=l[n];if(t&&2&t.flags){if(e&&t.id!==e.uid)continue;l.splice(n,1),n--,4&t.flags&&(t.flags&=-2),t(),4&t.flags||(t.flags&=-2)}}}function y(e){if(d.length){const e=[...new Set(d)].sort((e,t)=>v(e)-v(t));if(d.length=0,u)return void u.push(...e);for(u=e,h=0;h<u.length;h++){const e=u[h];4&e.flags&&(e.flags&=-2),8&e.flags||e(),e.flags&=-2}u=null,h=0}}const v=e=>null==e.id?2&e.flags?-1:1/0:e.id;function w(e){i.tE;try{for(c=0;c<l.length;c++){const e=l[c];!e||8&e.flags||(4&e.flags&&(e.flags&=-2),s(e,e.i,e.i?15:14),4&e.flags||(e.flags&=-2))}}finally{for(;c<l.length;c++){const e=l[c];e&&(e.flags&=-2)}c=-1,l.length=0,y(),m=null,(l.length||d.length)&&w(e)}}let x=null,k=null;function S(e){const t=x;return x=e,k=e&&e.type.__scopeId||null,t}function C(e,t){if(null===x)return e;const n=sn(x),s=e.dirs||(e.dirs=[]);for(let e=0;e<t.length;e++){let[o,a,l,c=i.MZ]=t[e];o&&((0,i.Tn)(o)&&(o={mounted:o,updated:o}),o.deep&&(0,r.hV)(a),s.push({dir:o,instance:n,value:a,oldValue:void 0,arg:l,modifiers:c}))}return e}function M(e,t,n,i){const s=e.dirs,a=t&&t.dirs;for(let l=0;l<s.length;l++){const c=s[l];a&&(c.oldValue=a[l].value);let d=c.dir[i];d&&((0,r.C4)(),o(d,n,8,[e.el,c,e,t]),(0,r.bl)())}}const T=Symbol("_vte"),L=Symbol("_leaveCb"),z=Symbol("_enterCb");function A(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Z(()=>{e.isMounted=!0}),ee(()=>{e.isUnmounting=!0}),e}const R=[Function,Array],P={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:R,onEnter:R,onAfterEnter:R,onEnterCancelled:R,onBeforeLeave:R,onLeave:R,onAfterLeave:R,onLeaveCancelled:R,onBeforeAppear:R,onAppear:R,onAfterAppear:R,onAppearCancelled:R};function N(e,t,n,r,s){const{appear:a,mode:l,persisted:c=!1,onBeforeEnter:d,onEnter:u,onAfterEnter:h,onEnterCancelled:p,onBeforeLeave:m,onLeave:f,onAfterLeave:_,onLeaveCancelled:g,onBeforeAppear:b,onAppear:y,onAfterAppear:v,onAppearCancelled:w}=t,x=String(e.key),k=function(e,t){const{leavingVNodes:n}=e;let r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}(n,e),S=(e,t)=>{e&&o(e,r,9,t)},C=(e,t)=>{const n=t[1];S(e,t),(0,i.cy)(e)?e.every(e=>e.length<=1)&&n():e.length<=1&&n()},M={mode:l,persisted:c,beforeEnter(t){let r=d;if(!n.isMounted){if(!a)return;r=b||d}t[L]&&t[L](!0);const i=k[x];i&&At(e,i)&&i.el[L]&&i.el[L](),S(r,[t])},enter(e){let t=u,r=h,i=p;if(!n.isMounted){if(!a)return;t=y||u,r=v||h,i=w||p}let s=!1;const o=e[z]=t=>{s||(s=!0,S(t?i:r,[e]),M.delayedLeave&&M.delayedLeave(),e[z]=void 0)};t?C(t,[e,o]):o()},leave(t,r){const i=String(e.key);if(t[z]&&t[z](!0),n.isUnmounting)return r();S(m,[t]);let s=!1;const o=t[L]=n=>{s||(s=!0,r(),S(n?g:_,[t]),t[L]=void 0,k[i]===e&&delete k[i])};k[i]=e,f?C(f,[t,o]):o()},clone(e){const i=N(e,t,n,r,s);return s&&s(i),i}};return M}function E(e,t){6&e.shapeFlag&&e.component?(e.transition=t,E(e.component.subTree,t)):128&e.shapeFlag?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function O(e,t=!1,n){let r=[],i=0;for(let s=0;s<e.length;s++){let o=e[s];const a=null==n?o.key:String(n)+String(null!=o.key?o.key:s);o.type===gt?(128&o.patchFlag&&i++,r=r.concat(O(o.children,t,a))):(t||o.type!==yt)&&r.push(null!=a?Ot(o,{key:a}):o)}if(i>1)for(let e=0;e<r.length;e++)r[e].patchFlag=-2;return r}function I(e,t){return(0,i.Tn)(e)?(()=>(0,i.X$)({name:e.name},t,{setup:e}))():e}function B(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function D(e){const t=Gt(),n=(0,r.IJ)(null);if(t){const r=t.refs===i.MZ?t.refs={}:t.refs;Object.defineProperty(r,e,{enumerable:!0,get:()=>n.value,set:e=>n.value=e})}return n}const V=new WeakMap;function H(e,t,n,o,a=!1){if((0,i.cy)(e))return void e.forEach((e,r)=>H(e,t&&((0,i.cy)(t)?t[r]:t),n,o,a));if(F(o)&&!a)return void(512&o.shapeFlag&&o.type.__asyncResolved&&o.component.subTree.component&&H(e,t,n,o.component.subTree));const l=4&o.shapeFlag?sn(o.component):o.el,c=a?null:l,{i:d,r:u}=e,h=t&&t.r,p=d.refs===i.MZ?d.refs={}:d.refs,m=d.setupState,f=(0,r.ux)(m),_=m===i.MZ?i.NO:e=>(0,i.$3)(f,e);if(null!=h&&h!==u)if(j(t),(0,i.Kg)(h))p[h]=null,_(h)&&(m[h]=null);else if((0,r.i9)(h)){h.value=null;const e=t;e.k&&(p[e.k]=null)}if((0,i.Tn)(u))s(u,d,12,[c,p]);else{const t=(0,i.Kg)(u),s=(0,r.i9)(u);if(t||s){const r=()=>{if(e.f){const n=t?_(u)?m[u]:p[u]:u.value;if(a)(0,i.cy)(n)&&(0,i.TF)(n,l);else if((0,i.cy)(n))n.includes(l)||n.push(l);else if(t)p[u]=[l],_(u)&&(m[u]=p[u]);else{const t=[l];u.value=t,e.k&&(p[e.k]=t)}}else t?(p[u]=c,_(u)&&(m[u]=c)):s&&(u.value=c,e.k&&(p[e.k]=c))};if(c){const t=()=>{r(),V.delete(e)};t.id=-1,V.set(e,t),Ke(t,n)}else j(e),r()}}}function j(e){const t=V.get(e);t&&(t.flags|=8,V.delete(e))}(0,i.We)().requestIdleCallback,(0,i.We)().cancelIdleCallback;const F=e=>!!e.type.__asyncLoader,U=e=>e.type.__isKeepAlive;function q(e,t){G(e,"a",t)}function $(e,t){G(e,"da",t)}function G(e,t,n=$t){const r=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(K(t,r,n),n){let e=n.parent;for(;e&&e.parent;)U(e.parent.vnode)&&X(r,t,n,e),e=e.parent}}function X(e,t,n,r){const s=K(t,e,r,!0);te(()=>{(0,i.TF)(r[t],s)},n)}function K(e,t,n=$t,i=!1){if(n){const s=n[e]||(n[e]=[]),a=t.__weh||(t.__weh=(...i)=>{(0,r.C4)();const s=Wt(n),a=o(t,n,e,i);return s(),(0,r.bl)(),a});return i?s.unshift(a):s.push(a),a}}RegExp,RegExp;const W=e=>(t,n=$t)=>{en&&"sp"!==e||K(e,(...e)=>t(...e),n)},Y=W("bm"),Z=W("m"),Q=W("bu"),J=W("u"),ee=W("bum"),te=W("um"),ne=W("sp"),re=W("rtg"),ie=W("rtc");function se(e,t=$t){K("ec",e,t)}const oe="components",ae=Symbol.for("v-ndc");function le(e){return(0,i.Kg)(e)?function(e,t,n=!0,r=!1){const s=x||$t;if(s){const n=s.type;if(e===oe){const e=function(e,t=!0){return(0,i.Tn)(e)?e.displayName||e.name:e.name||t&&e.__name}(n,!1);if(e&&(e===t||e===(0,i.PT)(t)||e===(0,i.ZH)((0,i.PT)(t))))return n}const o=ce(s[e]||n[e],t)||ce(s.appContext[e],t);return!o&&r?n:o}}(oe,e,!1)||e:e||ae}function ce(e,t){return e&&(e[t]||e[(0,i.PT)(t)]||e[(0,i.ZH)((0,i.PT)(t))])}function de(e,t,n,s){let o;const a=n&&n[s],l=(0,i.cy)(e);if(l||(0,i.Kg)(e)){let n=!1,i=!1;l&&(0,r.g8)(e)&&(n=!(0,r.fE)(e),i=(0,r.Tm)(e),e=(0,r.qA)(e)),o=new Array(e.length);for(let s=0,l=e.length;s<l;s++)o[s]=t(n?i?(0,r.a1)((0,r.lJ)(e[s])):(0,r.lJ)(e[s]):e[s],s,void 0,a&&a[s])}else if("number"==typeof e){o=new Array(e);for(let n=0;n<e;n++)o[n]=t(n+1,n,void 0,a&&a[n])}else if((0,i.Gv)(e))if(e[Symbol.iterator])o=Array.from(e,(e,n)=>t(e,n,void 0,a&&a[n]));else{const n=Object.keys(e);o=new Array(n.length);for(let r=0,i=n.length;r<i;r++){const i=n[r];o[r]=t(e[i],i,r,a&&a[r])}}else o=[];return n&&(n[s]=o),o}const ue=e=>e?Zt(e)?sn(e):ue(e.parent):null,he=(0,i.X$)(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>ue(e.parent),$root:e=>ue(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>ye(e),$forceUpdate:e=>e.f||(e.f=()=>{_(e.update)}),$nextTick:e=>e.n||(e.n=f.bind(e.proxy)),$watch:e=>st.bind(e)}),pe=(e,t)=>e!==i.MZ&&!e.__isScriptSetup&&(0,i.$3)(e,t),me={get({_:e},t){if("__v_skip"===t)return!0;const{ctx:n,setupState:s,data:o,props:a,accessCache:l,type:c,appContext:d}=e;let u;if("$"!==t[0]){const r=l[t];if(void 0!==r)switch(r){case 1:return s[t];case 2:return o[t];case 4:return n[t];case 3:return a[t]}else{if(pe(s,t))return l[t]=1,s[t];if(o!==i.MZ&&(0,i.$3)(o,t))return l[t]=2,o[t];if((u=e.propsOptions[0])&&(0,i.$3)(u,t))return l[t]=3,a[t];if(n!==i.MZ&&(0,i.$3)(n,t))return l[t]=4,n[t];_e&&(l[t]=0)}}const h=he[t];let p,m;return h?("$attrs"===t&&(0,r.u4)(e.attrs,"get",""),h(e)):(p=c.__cssModules)&&(p=p[t])?p:n!==i.MZ&&(0,i.$3)(n,t)?(l[t]=4,n[t]):(m=d.config.globalProperties,(0,i.$3)(m,t)?m[t]:void 0)},set({_:e},t,n){const{data:r,setupState:s,ctx:o}=e;return pe(s,t)?(s[t]=n,!0):r!==i.MZ&&(0,i.$3)(r,t)?(r[t]=n,!0):!((0,i.$3)(e.props,t)||"$"===t[0]&&t.slice(1)in e||(o[t]=n,0))},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:s,propsOptions:o,type:a}},l){let c,d;return!!(n[l]||e!==i.MZ&&"$"!==l[0]&&(0,i.$3)(e,l)||pe(t,l)||(c=o[0])&&(0,i.$3)(c,l)||(0,i.$3)(r,l)||(0,i.$3)(he,l)||(0,i.$3)(s.config.globalProperties,l)||(d=a.__cssModules)&&d[l])},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:(0,i.$3)(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function fe(e){return(0,i.cy)(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}let _e=!0;function ge(e,t,n){o((0,i.cy)(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function be(e,t,n,r){let s=r.includes(".")?ot(n,r):()=>n[r];if((0,i.Kg)(e)){const n=t[e];(0,i.Tn)(n)&&rt(s,n)}else if((0,i.Tn)(e))rt(s,e.bind(n));else if((0,i.Gv)(e))if((0,i.cy)(e))e.forEach(e=>be(e,t,n,r));else{const r=(0,i.Tn)(e.handler)?e.handler.bind(n):t[e.handler];(0,i.Tn)(r)&&rt(s,r,e)}}function ye(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:s,optionsCache:o,config:{optionMergeStrategies:a}}=e.appContext,l=o.get(t);let c;return l?c=l:s.length||n||r?(c={},s.length&&s.forEach(e=>ve(c,e,a,!0)),ve(c,t,a)):c=t,(0,i.Gv)(t)&&o.set(t,c),c}function ve(e,t,n,r=!1){const{mixins:i,extends:s}=t;s&&ve(e,s,n,!0),i&&i.forEach(t=>ve(e,t,n,!0));for(const i in t)if(r&&"expose"===i);else{const r=we[i]||n&&n[i];e[i]=r?r(e[i],t[i]):t[i]}return e}const we={data:xe,props:Me,emits:Me,methods:Ce,computed:Ce,beforeCreate:Se,created:Se,beforeMount:Se,mounted:Se,beforeUpdate:Se,updated:Se,beforeDestroy:Se,beforeUnmount:Se,destroyed:Se,unmounted:Se,activated:Se,deactivated:Se,errorCaptured:Se,serverPrefetch:Se,components:Ce,directives:Ce,watch:function(e,t){if(!e)return t;if(!t)return e;const n=(0,i.X$)(Object.create(null),e);for(const r in t)n[r]=Se(e[r],t[r]);return n},provide:xe,inject:function(e,t){return Ce(ke(e),ke(t))}};function xe(e,t){return t?e?function(){return(0,i.X$)((0,i.Tn)(e)?e.call(this,this):e,(0,i.Tn)(t)?t.call(this,this):t)}:t:e}function ke(e){if((0,i.cy)(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Se(e,t){return e?[...new Set([].concat(e,t))]:t}function Ce(e,t){return e?(0,i.X$)(Object.create(null),e,t):t}function Me(e,t){return e?(0,i.cy)(e)&&(0,i.cy)(t)?[...new Set([...e,...t])]:(0,i.X$)(Object.create(null),fe(e),fe(null!=t?t:{})):t}function Te(){return{app:null,config:{isNativeTag:i.NO,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let Le=0;function ze(e,t){return function(n,r=null){(0,i.Tn)(n)||(n=(0,i.X$)({},n)),null==r||(0,i.Gv)(r)||(r=null);const s=Te(),a=new WeakSet,l=[];let c=!1;const d=s.app={_uid:Le++,_component:n,_props:r,_container:null,_context:s,_instance:null,version:an,get config(){return s.config},set config(e){},use:(e,...t)=>(a.has(e)||(e&&(0,i.Tn)(e.install)?(a.add(e),e.install(d,...t)):(0,i.Tn)(e)&&(a.add(e),e(d,...t))),d),mixin:e=>(s.mixins.includes(e)||s.mixins.push(e),d),component:(e,t)=>t?(s.components[e]=t,d):s.components[e],directive:(e,t)=>t?(s.directives[e]=t,d):s.directives[e],mount(i,o,a){if(!c){const l=d._ceVNode||Et(n,r);return l.appContext=s,!0===a?a="svg":!1===a&&(a=void 0),o&&t?t(l,i):e(l,i,a),c=!0,d._container=i,i.__vue_app__=d,sn(l.component)}},onUnmount(e){l.push(e)},unmount(){c&&(o(l,d._instance,16),e(null,d._container),delete d._container.__vue_app__)},provide:(e,t)=>(s.provides[e]=t,d),runWithContext(e){const t=Ae;Ae=d;try{return e()}finally{Ae=t}}};return d}}let Ae=null;function Re(e,t,n=!1){const r=Gt();if(r||Ae){let s=Ae?Ae._context.provides:r?null==r.parent||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(s&&e in s)return s[e];if(arguments.length>1)return n&&(0,i.Tn)(t)?t.call(r&&r.proxy):t}}const Pe={},Ne=()=>Object.create(Pe),Ee=e=>Object.getPrototypeOf(e)===Pe;function Oe(e,t,n,s){const[o,a]=e.propsOptions;let l,c=!1;if(t)for(let r in t){if((0,i.SU)(r))continue;const d=t[r];let u;o&&(0,i.$3)(o,u=(0,i.PT)(r))?a&&a.includes(u)?(l||(l={}))[u]=d:n[u]=d:ut(e.emitsOptions,r)||r in s&&d===s[r]||(s[r]=d,c=!0)}if(a){const t=(0,r.ux)(n),s=l||i.MZ;for(let r=0;r<a.length;r++){const l=a[r];n[l]=Ie(o,t,l,s[l],e,!(0,i.$3)(s,l))}}return c}function Ie(e,t,n,r,s,o){const a=e[n];if(null!=a){const e=(0,i.$3)(a,"default");if(e&&void 0===r){const e=a.default;if(a.type!==Function&&!a.skipFactory&&(0,i.Tn)(e)){const{propsDefaults:i}=s;if(n in i)r=i[n];else{const o=Wt(s);r=i[n]=e.call(null,t),o()}}else r=e;s.ce&&s.ce._setProp(n,r)}a[0]&&(o&&!e?r=!1:!a[1]||""!==r&&r!==(0,i.Tg)(n)||(r=!0))}return r}const Be=new WeakMap;function De(e,t,n=!1){const r=n?Be:t.propsCache,s=r.get(e);if(s)return s;const o=e.props,a={},l=[];let c=!1;if(!(0,i.Tn)(e)){const r=e=>{c=!0;const[n,r]=De(e,t,!0);(0,i.X$)(a,n),r&&l.push(...r)};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}if(!o&&!c)return(0,i.Gv)(e)&&r.set(e,i.Oj),i.Oj;if((0,i.cy)(o))for(let e=0;e<o.length;e++){const t=(0,i.PT)(o[e]);Ve(t)&&(a[t]=i.MZ)}else if(o)for(const e in o){const t=(0,i.PT)(e);if(Ve(t)){const n=o[e],r=a[t]=(0,i.cy)(n)||(0,i.Tn)(n)?{type:n}:(0,i.X$)({},n),s=r.type;let c=!1,d=!0;if((0,i.cy)(s))for(let e=0;e<s.length;++e){const t=s[e],n=(0,i.Tn)(t)&&t.name;if("Boolean"===n){c=!0;break}"String"===n&&(d=!1)}else c=(0,i.Tn)(s)&&"Boolean"===s.name;r[0]=c,r[1]=d,(c||(0,i.$3)(r,"default"))&&l.push(t)}}const d=[a,l];return(0,i.Gv)(e)&&r.set(e,d),d}function Ve(e){return"$"!==e[0]&&!(0,i.SU)(e)}const He=e=>"_"===e||"_ctx"===e||"$stable"===e,je=e=>(0,i.cy)(e)?e.map(Vt):[Vt(e)],Fe=(e,t,n)=>{if(t._n)return t;const r=function(e,t=x){if(!t)return e;if(e._n)return e;const n=(...r)=>{n._d&&Ct(-1);const i=S(t);let s;try{s=e(...r)}finally{S(i),n._d&&Ct(1)}return s};return n._n=!0,n._c=!0,n._d=!0,n}((...e)=>je(t(...e)),n);return r._c=!1,r},Ue=(e,t,n)=>{const r=e._ctx;for(const n in e){if(He(n))continue;const s=e[n];if((0,i.Tn)(s))t[n]=Fe(0,s,r);else if(null!=s){const e=je(s);t[n]=()=>e}}},qe=(e,t)=>{const n=je(t);e.slots.default=()=>n},$e=(e,t,n)=>{for(const r in t)!n&&He(r)||(e[r]=t[r])},Ge=(e,t,n)=>{const r=e.slots=Ne();if(32&e.vnode.shapeFlag){const e=t._;e?($e(r,t,n),n&&(0,i.yQ)(r,"_",e,!0)):Ue(t,r)}else t&&qe(e,t)},Xe=(e,t,n)=>{const{vnode:r,slots:s}=e;let o=!0,a=i.MZ;if(32&r.shapeFlag){const e=t._;e?n&&1===e?o=!1:$e(s,t,n):(o=!t.$stable,Ue(t,s)),a=t}else t&&(qe(e,t),a={default:1});if(o)for(const e in s)He(e)||null!=a[e]||delete s[e]},Ke=function(e,t){t&&t.pendingBranch?(0,i.cy)(e)?t.effects.push(...e):t.effects.push(e):(n=e,(0,i.cy)(n)?d.push(...n):u&&-1===n.id?u.splice(h+1,0,n):1&n.flags||(d.push(n),n.flags|=1),g());var n};function We(e){return function(e,t){(0,i.We)().__VUE__=!0;const{insert:n,remove:o,patchProp:l,createElement:c,createText:d,createComment:u,setText:h,setElementText:p,parentNode:m,nextSibling:f,setScopeId:g=i.tE,insertStaticContent:v}=e,w=(e,t,n,r=null,i=null,s=null,o=void 0,a=null,l=!!t.dynamicChildren)=>{if(e===t)return;e&&!At(e,t)&&(r=te(e),Y(e,i,s,!0),e=null),-2===t.patchFlag&&(l=!1,t.dynamicChildren=null);const{type:c,ref:d,shapeFlag:u}=t;switch(c){case bt:x(e,t,n,r);break;case yt:k(e,t,n,r);break;case vt:null==e&&S(t,n,r,o);break;case gt:I(e,t,n,r,i,s,o,a,l);break;default:1&u?z(e,t,n,r,i,s,o,a,l):6&u?D(e,t,n,r,i,s,o,a,l):(64&u||128&u)&&c.process(e,t,n,r,i,s,o,a,l,ie)}null!=d&&i?H(d,e&&e.ref,s,t||e,!t):null==d&&e&&null!=e.ref&&H(e.ref,null,s,e,!0)},x=(e,t,r,i)=>{if(null==e)n(t.el=d(t.children),r,i);else{const n=t.el=e.el;t.children!==e.children&&h(n,t.children)}},k=(e,t,r,i)=>{null==e?n(t.el=u(t.children||""),r,i):t.el=e.el},S=(e,t,n,r)=>{[e.el,e.anchor]=v(e.children,t,n,r,e.el,e.anchor)},C=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=f(e),o(e),e=n;o(t)},z=(e,t,n,r,i,s,o,a,l)=>{"svg"===t.type?o="svg":"math"===t.type&&(o="mathml"),null==e?A(t,n,r,i,s,o,a,l):N(e,t,i,s,o,a,l)},A=(e,t,r,s,o,a,d,u)=>{let h,m;const{props:f,shapeFlag:_,transition:g,dirs:b}=e;if(h=e.el=c(e.type,a,f&&f.is,f),8&_?p(h,e.children):16&_&&P(e.children,h,null,s,o,Ye(e,a),d,u),b&&M(e,null,s,"created"),R(h,e,e.scopeId,d,s),f){for(const e in f)"value"===e||(0,i.SU)(e)||l(h,e,null,f[e],a,s);"value"in f&&l(h,"value",null,f.value,a),(m=f.onVnodeBeforeMount)&&Ft(m,s,e)}b&&M(e,null,s,"beforeMount");const y=function(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}(o,g);y&&g.beforeEnter(h),n(h,t,r),((m=f&&f.onVnodeMounted)||y||b)&&Ke(()=>{m&&Ft(m,s,e),y&&g.enter(h),b&&M(e,null,s,"mounted")},o)},R=(e,t,n,r,i)=>{if(n&&g(e,n),r)for(let t=0;t<r.length;t++)g(e,r[t]);if(i){let n=i.subTree;if(t===n||_t(n.type)&&(n.ssContent===t||n.ssFallback===t)){const t=i.vnode;R(e,t,t.scopeId,t.slotScopeIds,i.parent)}}},P=(e,t,n,r,i,s,o,a,l=0)=>{for(let c=l;c<e.length;c++){const l=e[c]=a?Ht(e[c]):Vt(e[c]);w(null,l,t,n,r,i,s,o,a)}},N=(e,t,n,r,s,o,a)=>{const c=t.el=e.el;let{patchFlag:d,dynamicChildren:u,dirs:h}=t;d|=16&e.patchFlag;const m=e.props||i.MZ,f=t.props||i.MZ;let _;if(n&&Ze(n,!1),(_=f.onVnodeBeforeUpdate)&&Ft(_,n,t,e),h&&M(t,e,n,"beforeUpdate"),n&&Ze(n,!0),(m.innerHTML&&null==f.innerHTML||m.textContent&&null==f.textContent)&&p(c,""),u?E(e.dynamicChildren,u,c,n,r,Ye(t,s),o):a||G(e,t,c,null,n,r,Ye(t,s),o,!1),d>0){if(16&d)O(c,m,f,n,s);else if(2&d&&m.class!==f.class&&l(c,"class",null,f.class,s),4&d&&l(c,"style",m.style,f.style,s),8&d){const e=t.dynamicProps;for(let t=0;t<e.length;t++){const r=e[t],i=m[r],o=f[r];o===i&&"value"!==r||l(c,r,i,o,s,n)}}1&d&&e.children!==t.children&&p(c,t.children)}else a||null!=u||O(c,m,f,n,s);((_=f.onVnodeUpdated)||h)&&Ke(()=>{_&&Ft(_,n,t,e),h&&M(t,e,n,"updated")},r)},E=(e,t,n,r,i,s,o)=>{for(let a=0;a<t.length;a++){const l=e[a],c=t[a],d=l.el&&(l.type===gt||!At(l,c)||198&l.shapeFlag)?m(l.el):n;w(l,c,d,null,r,i,s,o,!0)}},O=(e,t,n,r,s)=>{if(t!==n){if(t!==i.MZ)for(const o in t)(0,i.SU)(o)||o in n||l(e,o,t[o],null,s,r);for(const o in n){if((0,i.SU)(o))continue;const a=n[o],c=t[o];a!==c&&"value"!==o&&l(e,o,c,a,s,r)}"value"in n&&l(e,"value",t.value,n.value,s)}},I=(e,t,r,i,s,o,a,l,c)=>{const u=t.el=e?e.el:d(""),h=t.anchor=e?e.anchor:d("");let{patchFlag:p,dynamicChildren:m,slotScopeIds:f}=t;f&&(l=l?l.concat(f):f),null==e?(n(u,r,i),n(h,r,i),P(t.children||[],r,h,s,o,a,l,c)):p>0&&64&p&&m&&e.dynamicChildren?(E(e.dynamicChildren,m,r,s,o,a,l),(null!=t.key||s&&t===s.subTree)&&Qe(e,t,!0)):G(e,t,r,h,s,o,a,l,c)},D=(e,t,n,r,i,s,o,a,l)=>{t.slotScopeIds=a,null==e?512&t.shapeFlag?i.ctx.activate(t,n,r,o,l):V(t,n,r,i,s,o,l):j(e,t,l)},V=(e,t,n,o,l,c,d)=>{const u=e.component=function(e,t,n){const s=e.type,o=(t?t.appContext:e.appContext)||Ut,a={uid:qt++,vnode:e,type:s,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new r.yC(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:De(s,o),emitsOptions:dt(s,o),emit:null,emitted:null,propsDefaults:i.MZ,inheritAttrs:s.inheritAttrs,ctx:i.MZ,data:i.MZ,props:i.MZ,attrs:i.MZ,slots:i.MZ,refs:i.MZ,setupState:i.MZ,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return a.ctx={_:a},a.root=t?t.root:a,a.emit=lt.bind(null,a),e.ce&&e.ce(a),a}(e,o,l);if(U(e)&&(u.ctx.renderer=ie),function(e,t=!1,n=!1){t&&Kt(t);const{props:o,children:l}=e.vnode,c=Zt(e);!function(e,t,n,i=!1){const s={},o=Ne();e.propsDefaults=Object.create(null),Oe(e,t,s,o);for(const t in e.propsOptions[0])t in s||(s[t]=void 0);n?e.props=i?s:(0,r.Gc)(s):e.type.props?e.props=s:e.props=o,e.attrs=o}(e,o,c,t),Ge(e,l,n||t);const d=c?function(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,me);const{setup:o}=n;if(o){(0,r.C4)();const n=e.setupContext=o.length>1?function(e){const t=t=>{e.exposed=t||{}};return{attrs:new Proxy(e.attrs,rn),slots:e.slots,emit:e.emit,expose:t}}(e):null,l=Wt(e),c=s(o,e,0,[e.props,n]),d=(0,i.yL)(c);if((0,r.bl)(),l(),!d&&!e.sp||F(e)||B(e),d){if(c.then(Yt,Yt),t)return c.then(n=>{tn(e,n,t)}).catch(t=>{a(t,e,0)});e.asyncDep=c}else tn(e,c,t)}else nn(e,t)}(e,t):void 0;t&&Kt(!1)}(u,!1,d),u.asyncDep){if(l&&l.registerDep(u,q,d),!e.el){const r=u.subTree=Et(yt);k(null,r,t,n),e.placeholder=r.el}}else q(u,e,t,n,l,c,d)},j=(e,t,n)=>{const r=t.component=e.component;if(function(e,t,n){const{props:r,children:i,component:s}=e,{props:o,children:a,patchFlag:l}=t,c=s.emitsOptions;if(t.dirs||t.transition)return!0;if(!(n&&l>=0))return!(!i&&!a||a&&a.$stable)||r!==o&&(r?!o||ft(r,o,c):!!o);if(1024&l)return!0;if(16&l)return r?ft(r,o,c):!!o;if(8&l){const e=t.dynamicProps;for(let t=0;t<e.length;t++){const n=e[t];if(o[n]!==r[n]&&!ut(c,n))return!0}}return!1}(e,t,n)){if(r.asyncDep&&!r.asyncResolved)return void $(r,t,n);r.next=t,r.update()}else t.el=e.el,r.vnode=t},q=(e,t,n,s,o,a,l)=>{const c=()=>{if(e.isMounted){let{next:t,bu:n,u:r,parent:s,vnode:d}=e;{const n=Je(e);if(n)return t&&(t.el=d.el,$(e,t,l)),void n.asyncDep.then(()=>{e.isUnmounted||c()})}let u,h=t;Ze(e,!1),t?(t.el=d.el,$(e,t,l)):t=d,n&&(0,i.DY)(n),(u=t.props&&t.props.onVnodeBeforeUpdate)&&Ft(u,s,t,d),Ze(e,!0);const p=ht(e),f=e.subTree;e.subTree=p,w(f,p,m(f.el),te(f),e,o,a),t.el=p.el,null===h&&function({vnode:e,parent:t},n){for(;t;){const r=t.subTree;if(r.suspense&&r.suspense.activeBranch===e&&(r.el=e.el),r!==e)break;(e=t.vnode).el=n,t=t.parent}}(e,p.el),r&&Ke(r,o),(u=t.props&&t.props.onVnodeUpdated)&&Ke(()=>Ft(u,s,t,d),o)}else{let r;const{el:l,props:c}=t,{bm:d,m:u,parent:h,root:p,type:m}=e,f=F(t);if(Ze(e,!1),d&&(0,i.DY)(d),!f&&(r=c&&c.onVnodeBeforeMount)&&Ft(r,h,t),Ze(e,!0),l&&oe){const t=()=>{e.subTree=ht(e),oe(l,e.subTree,e,o,null)};f&&m.__asyncHydrate?m.__asyncHydrate(l,e,t):t()}else{p.ce&&!1!==p.ce._def.shadowRoot&&p.ce._injectChildStyle(m);const r=e.subTree=ht(e);w(null,r,n,s,e,o,a),t.el=r.el}if(u&&Ke(u,o),!f&&(r=c&&c.onVnodeMounted)){const e=t;Ke(()=>Ft(r,h,e),o)}(256&t.shapeFlag||h&&F(h.vnode)&&256&h.vnode.shapeFlag)&&e.a&&Ke(e.a,o),e.isMounted=!0,t=n=s=null}};e.scope.on();const d=e.effect=new r.X2(c);e.scope.off();const u=e.update=d.run.bind(d),h=e.job=d.runIfDirty.bind(d);h.i=e,h.id=e.uid,d.scheduler=()=>_(h),Ze(e,!0),u()},$=(e,t,n)=>{t.component=e;const s=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,s){const{props:o,attrs:a,vnode:{patchFlag:l}}=e,c=(0,r.ux)(o),[d]=e.propsOptions;let u=!1;if(!(s||l>0)||16&l){let r;Oe(e,t,o,a)&&(u=!0);for(const s in c)t&&((0,i.$3)(t,s)||(r=(0,i.Tg)(s))!==s&&(0,i.$3)(t,r))||(d?!n||void 0===n[s]&&void 0===n[r]||(o[s]=Ie(d,c,s,void 0,e,!0)):delete o[s]);if(a!==c)for(const e in a)t&&(0,i.$3)(t,e)||(delete a[e],u=!0)}else if(8&l){const n=e.vnode.dynamicProps;for(let r=0;r<n.length;r++){let s=n[r];if(ut(e.emitsOptions,s))continue;const l=t[s];if(d)if((0,i.$3)(a,s))l!==a[s]&&(a[s]=l,u=!0);else{const t=(0,i.PT)(s);o[t]=Ie(d,c,t,l,e,!1)}else l!==a[s]&&(a[s]=l,u=!0)}}u&&(0,r.hZ)(e.attrs,"set","")}(e,t.props,s,n),Xe(e,t.children,n),(0,r.C4)(),b(e),(0,r.bl)()},G=(e,t,n,r,i,s,o,a,l=!1)=>{const c=e&&e.children,d=e?e.shapeFlag:0,u=t.children,{patchFlag:h,shapeFlag:m}=t;if(h>0){if(128&h)return void K(c,u,n,r,i,s,o,a,l);if(256&h)return void X(c,u,n,r,i,s,o,a,l)}8&m?(16&d&&ee(c,i,s),u!==c&&p(n,u)):16&d?16&m?K(c,u,n,r,i,s,o,a,l):ee(c,i,s,!0):(8&d&&p(n,""),16&m&&P(u,n,r,i,s,o,a,l))},X=(e,t,n,r,s,o,a,l,c)=>{e=e||i.Oj,t=t||i.Oj;const d=e.length,u=t.length,h=Math.min(d,u);let p;for(p=0;p<h;p++){const r=t[p]=c?Ht(t[p]):Vt(t[p]);w(e[p],r,n,null,s,o,a,l,c)}d>u?ee(e,s,o,!0,!1,h):P(t,n,r,s,o,a,l,c,h)},K=(e,t,n,r,s,o,a,l,c)=>{let d=0;const u=t.length;let h=e.length-1,p=u-1;for(;d<=h&&d<=p;){const r=e[d],i=t[d]=c?Ht(t[d]):Vt(t[d]);if(!At(r,i))break;w(r,i,n,null,s,o,a,l,c),d++}for(;d<=h&&d<=p;){const r=e[h],i=t[p]=c?Ht(t[p]):Vt(t[p]);if(!At(r,i))break;w(r,i,n,null,s,o,a,l,c),h--,p--}if(d>h){if(d<=p){const e=p+1,i=e<u?t[e].el:r;for(;d<=p;)w(null,t[d]=c?Ht(t[d]):Vt(t[d]),n,i,s,o,a,l,c),d++}}else if(d>p)for(;d<=h;)Y(e[d],s,o,!0),d++;else{const m=d,f=d,_=new Map;for(d=f;d<=p;d++){const e=t[d]=c?Ht(t[d]):Vt(t[d]);null!=e.key&&_.set(e.key,d)}let g,b=0;const y=p-f+1;let v=!1,x=0;const k=new Array(y);for(d=0;d<y;d++)k[d]=0;for(d=m;d<=h;d++){const r=e[d];if(b>=y){Y(r,s,o,!0);continue}let i;if(null!=r.key)i=_.get(r.key);else for(g=f;g<=p;g++)if(0===k[g-f]&&At(r,t[g])){i=g;break}void 0===i?Y(r,s,o,!0):(k[i-f]=d+1,i>=x?x=i:v=!0,w(r,t[i],n,null,s,o,a,l,c),b++)}const S=v?function(e){const t=e.slice(),n=[0];let r,i,s,o,a;const l=e.length;for(r=0;r<l;r++){const l=e[r];if(0!==l){if(i=n[n.length-1],e[i]<l){t[r]=i,n.push(r);continue}for(s=0,o=n.length-1;s<o;)a=s+o>>1,e[n[a]]<l?s=a+1:o=a;l<e[n[s]]&&(s>0&&(t[r]=n[s-1]),n[s]=r)}}for(s=n.length,o=n[s-1];s-- >0;)n[s]=o,o=t[o];return n}(k):i.Oj;for(g=S.length-1,d=y-1;d>=0;d--){const e=f+d,i=t[e],h=t[e+1],p=e+1<u?h.el||h.placeholder:r;0===k[d]?w(null,i,n,p,s,o,a,l,c):v&&(g<0||d!==S[g]?W(i,n,p,2):g--)}}},W=(e,t,r,i,s=null)=>{const{el:a,type:l,transition:c,children:d,shapeFlag:u}=e;if(6&u)W(e.component.subTree,t,r,i);else if(128&u)e.suspense.move(t,r,i);else if(64&u)l.move(e,t,r,ie);else if(l!==gt)if(l!==vt)if(2!==i&&1&u&&c)if(0===i)c.beforeEnter(a),n(a,t,r),Ke(()=>c.enter(a),s);else{const{leave:i,delayLeave:s,afterLeave:l}=c,d=()=>{e.ctx.isUnmounted?o(a):n(a,t,r)},u=()=>{a._isLeaving&&a[L](!0),i(a,()=>{d(),l&&l()})};s?s(a,d,u):u()}else n(a,t,r);else(({el:e,anchor:t},r,i)=>{let s;for(;e&&e!==t;)s=f(e),n(e,r,i),e=s;n(t,r,i)})(e,t,r);else{n(a,t,r);for(let e=0;e<d.length;e++)W(d[e],t,r,i);n(e.anchor,t,r)}},Y=(e,t,n,i=!1,s=!1)=>{const{type:o,props:a,ref:l,children:c,dynamicChildren:d,shapeFlag:u,patchFlag:h,dirs:p,cacheIndex:m}=e;if(-2===h&&(s=!1),null!=l&&((0,r.C4)(),H(l,null,n,e,!0),(0,r.bl)()),null!=m&&(t.renderCache[m]=void 0),256&u)return void t.ctx.deactivate(e);const f=1&u&&p,_=!F(e);let g;if(_&&(g=a&&a.onVnodeBeforeUnmount)&&Ft(g,t,e),6&u)J(e.component,n,i);else{if(128&u)return void e.suspense.unmount(n,i);f&&M(e,null,t,"beforeUnmount"),64&u?e.type.remove(e,t,n,ie,i):d&&!d.hasOnce&&(o!==gt||h>0&&64&h)?ee(d,t,n,!1,!0):(o===gt&&384&h||!s&&16&u)&&ee(c,t,n),i&&Z(e)}(_&&(g=a&&a.onVnodeUnmounted)||f)&&Ke(()=>{g&&Ft(g,t,e),f&&M(e,null,t,"unmounted")},n)},Z=e=>{const{type:t,el:n,anchor:r,transition:i}=e;if(t===gt)return void Q(n,r);if(t===vt)return void C(e);const s=()=>{o(n),i&&!i.persisted&&i.afterLeave&&i.afterLeave()};if(1&e.shapeFlag&&i&&!i.persisted){const{leave:t,delayLeave:r}=i,o=()=>t(n,s);r?r(e.el,s,o):o()}else s()},Q=(e,t)=>{let n;for(;e!==t;)n=f(e),o(e),e=n;o(t)},J=(e,t,n)=>{const{bum:r,scope:s,job:o,subTree:a,um:l,m:c,a:d}=e;et(c),et(d),r&&(0,i.DY)(r),s.stop(),o&&(o.flags|=8,Y(a,e,t,n)),l&&Ke(l,t),Ke(()=>{e.isUnmounted=!0},t)},ee=(e,t,n,r=!1,i=!1,s=0)=>{for(let o=s;o<e.length;o++)Y(e[o],t,n,r,i)},te=e=>{if(6&e.shapeFlag)return te(e.component.subTree);if(128&e.shapeFlag)return e.suspense.next();const t=f(e.anchor||e.el),n=t&&t[T];return n?f(n):t};let ne=!1;const re=(e,t,n)=>{null==e?t._vnode&&Y(t._vnode,null,null,!0):w(t._vnode||null,e,t,null,null,null,n),t._vnode=e,ne||(ne=!0,b(),y(),ne=!1)},ie={p:w,um:Y,m:W,r:Z,mt:V,mc:P,pc:G,pbc:E,n:te,o:e};let se,oe;return t&&([se,oe]=t(ie)),{render:re,hydrate:se,createApp:ze(re,se)}}(e)}function Ye({type:e,props:t},n){return"svg"===n&&"foreignObject"===e||"mathml"===n&&"annotation-xml"===e&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function Ze({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Qe(e,t,n=!1){const r=e.children,s=t.children;if((0,i.cy)(r)&&(0,i.cy)(s))for(let e=0;e<r.length;e++){const t=r[e];let i=s[e];1&i.shapeFlag&&!i.dynamicChildren&&((i.patchFlag<=0||32===i.patchFlag)&&(i=s[e]=Ht(s[e]),i.el=t.el),n||-2===i.patchFlag||Qe(t,i)),i.type===bt&&-1!==i.patchFlag&&(i.el=t.el),i.type!==yt||i.el||(i.el=t.el)}}function Je(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Je(t)}function et(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}const tt=Symbol.for("v-scx"),nt=()=>Re(tt);function rt(e,t,n){return it(e,t,n)}function it(e,t,n=i.MZ){const{immediate:s,deep:a,flush:l,once:c}=n,d=(0,i.X$)({},n),u=t&&s||!t&&"post"!==l;let h;if(en)if("sync"===l){const e=nt();h=e.__watcherHandles||(e.__watcherHandles=[])}else if(!u){const e=()=>{};return e.stop=i.tE,e.resume=i.tE,e.pause=i.tE,e}const p=$t;d.call=(e,t,n)=>o(e,p,t,n);let m=!1;"post"===l?d.scheduler=e=>{Ke(e,p&&p.suspense)}:"sync"!==l&&(m=!0,d.scheduler=(e,t)=>{t?e():_(e)}),d.augmentJob=e=>{t&&(e.flags|=4),m&&(e.flags|=2,p&&(e.id=p.uid,e.i=p))};const f=(0,r.wB)(e,t,d);return en&&(h?h.push(f):u&&f()),f}function st(e,t,n){const r=this.proxy,s=(0,i.Kg)(e)?e.includes(".")?ot(r,e):()=>r[e]:e.bind(r,r);let o;(0,i.Tn)(t)?o=t:(o=t.handler,n=t);const a=Wt(this),l=it(s,o.bind(r),n);return a(),l}function ot(e,t){const n=t.split(".");return()=>{let t=e;for(let e=0;e<n.length&&t;e++)t=t[n[e]];return t}}const at=(e,t)=>"modelValue"===t||"model-value"===t?e.modelModifiers:e[`${t}Modifiers`]||e[`${(0,i.PT)(t)}Modifiers`]||e[`${(0,i.Tg)(t)}Modifiers`];function lt(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||i.MZ;let s=n;const a=t.startsWith("update:"),l=a&&at(r,t.slice(7));let c;l&&(l.trim&&(s=n.map(e=>(0,i.Kg)(e)?e.trim():e)),l.number&&(s=n.map(i.bB)));let d=r[c=(0,i.rU)(t)]||r[c=(0,i.rU)((0,i.PT)(t))];!d&&a&&(d=r[c=(0,i.rU)((0,i.Tg)(t))]),d&&o(d,e,6,s);const u=r[c+"Once"];if(u){if(e.emitted){if(e.emitted[c])return}else e.emitted={};e.emitted[c]=!0,o(u,e,6,s)}}const ct=new WeakMap;function dt(e,t,n=!1){const r=n?ct:t.emitsCache,s=r.get(e);if(void 0!==s)return s;const o=e.emits;let a={},l=!1;if(!(0,i.Tn)(e)){const r=e=>{const n=dt(e,t,!0);n&&(l=!0,(0,i.X$)(a,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return o||l?((0,i.cy)(o)?o.forEach(e=>a[e]=null):(0,i.X$)(a,o),(0,i.Gv)(e)&&r.set(e,a),a):((0,i.Gv)(e)&&r.set(e,null),null)}function ut(e,t){return!(!e||!(0,i.Mp)(t))&&(t=t.slice(2).replace(/Once$/,""),(0,i.$3)(e,t[0].toLowerCase()+t.slice(1))||(0,i.$3)(e,(0,i.Tg)(t))||(0,i.$3)(e,t))}function ht(e){const{type:t,vnode:n,proxy:r,withProxy:s,propsOptions:[o],slots:l,attrs:c,emit:d,render:u,renderCache:h,props:p,data:m,setupState:f,ctx:_,inheritAttrs:g}=e,b=S(e);let y,v;try{if(4&n.shapeFlag){const e=s||r,t=e;y=Vt(u.call(t,e,h,p,f,m,_)),v=c}else{const e=t;y=Vt(e.length>1?e(p,{attrs:c,slots:l,emit:d}):e(p,null)),v=t.props?c:pt(c)}}catch(t){wt.length=0,a(t,e,1),y=Et(yt)}let w=y;if(v&&!1!==g){const e=Object.keys(v),{shapeFlag:t}=w;e.length&&7&t&&(o&&e.some(i.CP)&&(v=mt(v,o)),w=Ot(w,v,!1,!0))}return n.dirs&&(w=Ot(w,null,!1,!0),w.dirs=w.dirs?w.dirs.concat(n.dirs):n.dirs),n.transition&&E(w,n.transition),y=w,S(b),y}const pt=e=>{let t;for(const n in e)("class"===n||"style"===n||(0,i.Mp)(n))&&((t||(t={}))[n]=e[n]);return t},mt=(e,t)=>{const n={};for(const r in e)(0,i.CP)(r)&&r.slice(9)in t||(n[r]=e[r]);return n};function ft(e,t,n){const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let i=0;i<r.length;i++){const s=r[i];if(t[s]!==e[s]&&!ut(n,s))return!0}return!1}const _t=e=>e.__isSuspense;const gt=Symbol.for("v-fgt"),bt=Symbol.for("v-txt"),yt=Symbol.for("v-cmt"),vt=Symbol.for("v-stc"),wt=[];let xt=null;function kt(e=!1){wt.push(xt=e?null:[])}let St=1;function Ct(e,t=!1){St+=e,e<0&&xt&&t&&(xt.hasOnce=!0)}function Mt(e){return e.dynamicChildren=St>0?xt||i.Oj:null,wt.pop(),xt=wt[wt.length-1]||null,St>0&&xt&&xt.push(e),e}function Tt(e,t,n,r,i,s){return Mt(Nt(e,t,n,r,i,s,!0))}function Lt(e,t,n,r,i){return Mt(Et(e,t,n,r,i,!0))}function zt(e){return!!e&&!0===e.__v_isVNode}function At(e,t){return e.type===t.type&&e.key===t.key}const Rt=({key:e})=>null!=e?e:null,Pt=({ref:e,ref_key:t,ref_for:n})=>("number"==typeof e&&(e=""+e),null!=e?(0,i.Kg)(e)||(0,r.i9)(e)||(0,i.Tn)(e)?{i:x,r:e,k:t,f:!!n}:e:null);function Nt(e,t=null,n=null,r=0,s=null,o=(e===gt?0:1),a=!1,l=!1){const c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Rt(t),ref:t&&Pt(t),scopeId:k,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:r,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:x};return l?(jt(c,n),128&o&&e.normalize(c)):n&&(c.shapeFlag|=(0,i.Kg)(n)?8:16),St>0&&!a&&xt&&(c.patchFlag>0||6&o)&&32!==c.patchFlag&&xt.push(c),c}const Et=function(e,t=null,n=null,s=0,o=null,a=!1){if(e&&e!==ae||(e=yt),zt(e)){const r=Ot(e,t,!0);return n&&jt(r,n),St>0&&!a&&xt&&(6&r.shapeFlag?xt[xt.indexOf(e)]=r:xt.push(r)),r.patchFlag=-2,r}if(l=e,(0,i.Tn)(l)&&"__vccOpts"in l&&(e=e.__vccOpts),t){t=function(e){return e?(0,r.ju)(e)||Ee(e)?(0,i.X$)({},e):e:null}(t);let{class:e,style:n}=t;e&&!(0,i.Kg)(e)&&(t.class=(0,i.C4)(e)),(0,i.Gv)(n)&&((0,r.ju)(n)&&!(0,i.cy)(n)&&(n=(0,i.X$)({},n)),t.style=(0,i.Tr)(n))}var l;return Nt(e,t,n,s,o,(0,i.Kg)(e)?1:_t(e)?128:(e=>e.__isTeleport)(e)?64:(0,i.Gv)(e)?4:(0,i.Tn)(e)?2:0,a,!0)};function Ot(e,t,n=!1,r=!1){const{props:s,ref:o,patchFlag:a,children:l,transition:c}=e,d=t?function(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const e in r)if("class"===e)t.class!==r.class&&(t.class=(0,i.C4)([t.class,r.class]));else if("style"===e)t.style=(0,i.Tr)([t.style,r.style]);else if((0,i.Mp)(e)){const n=t[e],s=r[e];!s||n===s||(0,i.cy)(n)&&n.includes(s)||(t[e]=n?[].concat(n,s):s)}else""!==e&&(t[e]=r[e])}return t}(s||{},t):s,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:d,key:d&&Rt(d),ref:t&&t.ref?n&&o?(0,i.cy)(o)?o.concat(Pt(t)):[o,Pt(t)]:Pt(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==gt?-1===a?16:16|a:a,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Ot(e.ssContent),ssFallback:e.ssFallback&&Ot(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&r&&E(u,c.clone(u)),u}function It(e=" ",t=0){return Et(bt,null,e,t)}function Bt(e,t){const n=Et(vt,null,e);return n.staticCount=t,n}function Dt(e="",t=!1){return t?(kt(),Lt(yt,null,e)):Et(yt,null,e)}function Vt(e){return null==e||"boolean"==typeof e?Et(yt):(0,i.cy)(e)?Et(gt,null,e.slice()):zt(e)?Ht(e):Et(bt,null,String(e))}function Ht(e){return null===e.el&&-1!==e.patchFlag||e.memo?e:Ot(e)}function jt(e,t){let n=0;const{shapeFlag:r}=e;if(null==t)t=null;else if((0,i.cy)(t))n=16;else if("object"==typeof t){if(65&r){const n=t.default;return void(n&&(n._c&&(n._d=!1),jt(e,n()),n._c&&(n._d=!0)))}{n=32;const r=t._;r||Ee(t)?3===r&&x&&(1===x.slots._?t._=1:(t._=2,e.patchFlag|=1024)):t._ctx=x}}else(0,i.Tn)(t)?(t={default:t,_ctx:x},n=32):(t=String(t),64&r?(n=16,t=[It(t)]):n=8);e.children=t,e.shapeFlag|=n}function Ft(e,t,n,r=null){o(e,t,7,[n,r])}const Ut=Te();let qt=0;let $t=null;const Gt=()=>$t||x;let Xt,Kt;{const e=(0,i.We)(),t=(t,n)=>{let r;return(r=e[t])||(r=e[t]=[]),r.push(n),e=>{r.length>1?r.forEach(t=>t(e)):r[0](e)}};Xt=t("__VUE_INSTANCE_SETTERS__",e=>$t=e),Kt=t("__VUE_SSR_SETTERS__",e=>en=e)}const Wt=e=>{const t=$t;return Xt(e),e.scope.on(),()=>{e.scope.off(),Xt(t)}},Yt=()=>{$t&&$t.scope.off(),Xt(null)};function Zt(e){return 4&e.vnode.shapeFlag}let Qt,Jt,en=!1;function tn(e,t,n){(0,i.Tn)(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:(0,i.Gv)(t)&&(e.setupState=(0,r.Pr)(t)),nn(e,n)}function nn(e,t,n){const s=e.type;if(!e.render){if(!t&&Qt&&!s.render){const t=s.template||ye(e).template;if(t){const{isCustomElement:n,compilerOptions:r}=e.appContext.config,{delimiters:o,compilerOptions:a}=s,l=(0,i.X$)((0,i.X$)({isCustomElement:n,delimiters:o},r),a);s.render=Qt(t,l)}}e.render=s.render||i.tE,Jt&&Jt(e)}{const t=Wt(e);(0,r.C4)();try{!function(e){const t=ye(e),n=e.proxy,s=e.ctx;_e=!1,t.beforeCreate&&ge(t.beforeCreate,e,"bc");const{data:o,computed:a,methods:l,watch:c,provide:d,inject:u,created:h,beforeMount:p,mounted:m,beforeUpdate:f,updated:_,activated:g,deactivated:b,beforeDestroy:y,beforeUnmount:v,destroyed:w,unmounted:x,render:k,renderTracked:S,renderTriggered:C,errorCaptured:M,serverPrefetch:T,expose:L,inheritAttrs:z,components:A,directives:R,filters:P}=t;if(u&&function(e,t){(0,i.cy)(e)&&(e=ke(e));for(const n in e){const s=e[n];let o;o=(0,i.Gv)(s)?"default"in s?Re(s.from||n,s.default,!0):Re(s.from||n):Re(s),(0,r.i9)(o)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>o.value,set:e=>o.value=e}):t[n]=o}}(u,s),l)for(const e in l){const t=l[e];(0,i.Tn)(t)&&(s[e]=t.bind(n))}if(o){const t=o.call(n,n);(0,i.Gv)(t)&&(e.data=(0,r.Kh)(t))}if(_e=!0,a)for(const e in a){const t=a[e],r=(0,i.Tn)(t)?t.bind(n,n):(0,i.Tn)(t.get)?t.get.bind(n,n):i.tE,o=!(0,i.Tn)(t)&&(0,i.Tn)(t.set)?t.set.bind(n):i.tE,l=on({get:r,set:o});Object.defineProperty(s,e,{enumerable:!0,configurable:!0,get:()=>l.value,set:e=>l.value=e})}if(c)for(const e in c)be(c[e],s,n,e);if(d){const e=(0,i.Tn)(d)?d.call(n):d;Reflect.ownKeys(e).forEach(t=>{!function(e,t){if($t){let n=$t.provides;const r=$t.parent&&$t.parent.provides;r===n&&(n=$t.provides=Object.create(r)),n[e]=t}}(t,e[t])})}function N(e,t){(0,i.cy)(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(h&&ge(h,e,"c"),N(Y,p),N(Z,m),N(Q,f),N(J,_),N(q,g),N($,b),N(se,M),N(ie,S),N(re,C),N(ee,v),N(te,x),N(ne,T),(0,i.cy)(L))if(L.length){const t=e.exposed||(e.exposed={});L.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||(e.exposed={});k&&e.render===i.tE&&(e.render=k),null!=z&&(e.inheritAttrs=z),A&&(e.components=A),R&&(e.directives=R),T&&B(e)}(e)}finally{(0,r.bl)(),t()}}}const rn={get:(e,t)=>((0,r.u4)(e,"get",""),e[t])};function sn(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy((0,r.Pr)((0,r.IG)(e.exposed)),{get:(t,n)=>n in t?t[n]:n in he?he[n](e):void 0,has:(e,t)=>t in e||t in he})):e.proxy}const on=(e,t)=>(0,r.EW)(e,t,en),an="3.5.21"},4116:(e,t,n)=>{"use strict";n.d(t,{MR:()=>s.M,MT:()=>a.M,Sv:()=>u.S,UB:()=>c.U,VL:()=>l.V,_D:()=>o._,j5:()=>i.j,wP:()=>r.w,yc:()=>d.y});var r=n(9390),i=n(3097),s=n(2332),o=n(9204),a=n(2698),l=n(3447),c=n(8304),d=n(3682),u=n(722)},4314:(e,t,n)=>{"use strict";n.d(t,{Bz:()=>s,NW:()=>o,h_:()=>i});var r=n(7633);const i=(0,r.Kh)({point:{x:0,y:0},css:{},cube:void 0,menu:void 0,stack_pos:[],stack_menus:[],stack_rect:[]}),s=(0,r.Kh)({open:!1,data:{},submit(){}});function o(e,t){s.open=!0,s.submit=t,s.data=e}},4430:(e,t,n)=>{"use strict";n.d(t,{uz:()=>r.uz}),n(4314);var r=n(1642)},4743:(e,t,n)=>{"use strict";n.d(t,{yI:()=>jn,UF:()=>Ja,ev:()=>Un,$6:()=>Et,LU:()=>vt,DW:()=>zr,ry:()=>nr,OA:()=>np,PL:()=>ln,LO:()=>xr,fl:()=>Ap,en:()=>ip,zl:()=>$,ZU:()=>D,A6:()=>cr,vV:()=>P,c9:()=>er,XV:()=>Lt,mM:()=>zp,de:()=>Nt,HR:()=>yt,p4:()=>rl,RQ:()=>lr,oY:()=>wt,qH:()=>rp,fC:()=>i.f,gK:()=>kt,R$:()=>Ln,Kw:()=>wr,NQ:()=>Lr,Qm:()=>b,EU:()=>An,gL:()=>Hn,$u:()=>q,at:()=>Np,gv:()=>Tn,Ku:()=>yp,P6:()=>X,ju:()=>V,LZ:()=>Sp,k9:()=>fr,sf:()=>on,e8:()=>an,Nj:()=>Rn,AG:()=>Fn,iO:()=>Pn});var r={};n.r(r),n.d(r,{boolean:()=>as,booleanish:()=>ls,commaOrSpaceSeparated:()=>ps,commaSeparated:()=>hs,number:()=>ds,overloadedBoolean:()=>cs,spaceSeparated:()=>us});var i=n(4926),s=n(8606),o=n(4116),a=n(9513),l=n(7633),c=n(4089),d=n(3972);const u=["id","data-type"],h={class:"lost-info"},p=(0,c.pM)({__name:"cube-lost",props:{cube:{}},setup:e=>(e,t)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-lost",id:e.cube.id,"data-type":(0,l.R1)(a.u0).lost},[t[2]||(t[2]=(0,c.Lk)("div",{class:"lost-title"},"异常方块",-1)),(0,c.Lk)("div",h,[t[0]||(t[0]=(0,c.Lk)("div",null,"方块类型: ",-1)),(0,c.Lk)("div",null,(0,d.v_)(e.cube.cube_name),1),t[1]||(t[1]=(0,c.Lk)("div",null,"异常原因: ",-1)),(0,c.Lk)("div",null,(0,d.v_)(e.cube.msg),1)])],8,u))});var m=n(6743);const f=(0,m.A)(p,[["__scopeId","data-v-2525a8c9"]]);var _=n(3028),g=n(8631);class b extends o._D{_msg=(0,l.KR)("");get msg(){return this._msg.value}set msg(e){this._msg.value=e}_component=f;get component(){return this._component}get meta(){return b.meta}get cube_name(){return this.data.type}get is_empty(){return!1}get children(){return[]}constructor(e,t,n){super(e,t),e&&this.setup(e,t),this.msg=n}build_child(){}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}gc(){}replace_id(e,t={}){return b.replace_id(this.root,e,t)}export(){const e=this.base_export();return e.attrs.postil&&(e.info.attrs.postil=e.attrs.postil),e}on_cursor_in_head(e){const{courier:t,next_cube:n}=this,r=new _.vk(t);return n&&r.tell(n,o.UB.in_head(n.id,0)),r}on_cursor_in_tail(e){const{courier:t,prev_cube:n}=this,r=new _.vk(t);return n&&r.tell(n,o.UB.in_head(n.id,0)),r}static get_default(e){return{id:(0,s.Ak)(),type:a.u0.lost,info:e,css:{},attrs:{}}}static get meta(){return{cubename:"异常方块",type:a.u0.lost,block:!1,version:1,show:!1}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();return n[r]=i,t.id=i,t}}const y=["id","data-type"],v=(0,c.pM)({__name:"cube-text",props:{cube:{}},setup(e){function t(){const t=e.cube.postil;t&&t.visible(!t.show)}return(e,n)=>((0,c.uX)(),(0,c.CE)("span",{class:(0,d.C4)(["cube-text",{"text-mark":e.cube.has_postil}]),style:(0,d.Tr)(e.cube.css),onClick:t,id:e.cube.id,"data-type":(0,l.R1)(a.u0).text},(0,d.v_)(e.cube.text),15,y))}}),w=(0,m.A)(v,[["__scopeId","data-v-54fe1fb2"]]);var x=n(8474),k=n(2519);const S=(0,c.pM)({__name:"cube-view",props:{cube:{}},setup:e=>(e,t)=>((0,c.uX)(),(0,c.Wv)((0,c.$y)(e.cube.component),{cube:(0,l.IG)(e.cube)},null,8,["cube"]))});var C=n(7977);const M=["id","data-type"],T={class:"iconbox"},L=(0,c.pM)({__name:"cube-annotation",props:{cube:{}},setup(e){const t=(0,l.Kh)({fold:!1});function n(){const{courier:t,history:n}=e.cube.root,r=e.cube.pcube,i=e.cube.index,s=new _.vk(t);s.tell(r,o.VL.delete_child(r.id,"backward",[i,i+1])),n.record(s)}function r(){t.fold=!t.fold}return(e,i)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-annotation",style:(0,d.Tr)(e.cube.css),id:e.cube.id,"data-type":(0,l.R1)(a.u0).annotation},[(0,c.Lk)("div",T,[(0,c.Lk)("div",{class:(0,d.C4)(["iconfont",(0,l.R1)(C.R).icons.fold,t.fold?"annotation-icon-active":""]),onClick:r,title:"折叠批注块"},null,2),(0,c.Lk)("div",{class:"iconfont icon-Delete",onClick:n,title:"删除批注块"})]),t.fold?(0,c.Q3)("v-if",!0):((0,c.uX)(),(0,c.CE)("div",{key:0,class:(0,d.C4)(["annotation-contents",{"annotation-fold":t.fold}])},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.children,e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:e,class:"annotation-box"},null,8,["cube"]))),128))],2))],12,M))}}),z=(0,m.A)(L,[["__scopeId","data-v-b157e116"]]);var A=n(9927);function R(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class P extends o._D{_component=z;constructor(e,t){super(e,t);const n=this.setup(e,t);return this.init(),n}get component(){return this._component}get meta(){return P.meta}init(){}gc(){super.base_gc()}export(){const e=this.base_export();e.info=[];for(let t of this._children)e.info.push(t.export());return e}build_child(e){const t=g.I.build_cubes(e.info,this);this._children.push(...t)}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}splice(e,t,...n){const r=this._children.splice(e,t,...n);for(let e of r)e.gc();const i=[];for(let e of r)e instanceof o._D&&i.push(e.export());return{children:r,data:i}}replace_id(e,t={}){return P.replace_id(this.root,e,t)}on_insert_child(e){const{courier:t}=this,{pos:n,data:r}=e,i=t.get_recorder();if(i.add_cmd(e),0===r.length)return;if(!this.meta.block)return;let s=this.get_valid_index(n);const a=this.create_child_block(r);this.splice(s,0,...a),i.add_recover(o.VL.delete_child(this.id,"backward",[s,s+a.length]));const l=this.children[s+1];return l?i.tell(l,o.UB.in_head(l.id,0)):i.tell(this.child_last,o.UB.in_tail(this.child_last.id,0)),i}on_delete_child(e){const{courier:t,pid:n,index:r,pcube:i}=this,s=t.get_recorder();s.add_cmd(e);const{dir:a,range:l}=e,[c,d]=l;let u=c<0?0:c,h=d>this.child_count?this.child_count:d;if(u>=h)return;if(u<=0&&h>=this.child_count)return this.is_empty?s.tell(i,o.VL.delete_child(n,a,[r,r+1])):s.tell(this,o.VL.reset(this.id,[])),s;const p=this.children[u-1],m=this.children[h],f=h-u;let _=this.splice(c,f);return s.add_recover(o.VL.insert_child(this.id,_.data,c)),"backward"===a?p?s.tell(p,o.UB.in_tail(p.id,0)):m&&s.tell(m,o.UB.in_head(m.id,0)):"forward"===a&&(m?s.tell(m,o.UB.in_head(m.id,0)):p&&s.tell(p,o.UB.in_tail(p.id,0))),s}on_reset(e){const{courier:t,history:n}=this,{data:r}=e,i=new _.vk(t),s=[];for(let e of this.children)s.push(e.export());const a=g.I.build_cubes(r,this);return this.splice(0,this.child_count,...a),i.add_recover(o.VL.reset(this.id,s)),i}static get meta(){return{cubename:"批注",type:x.u0.annotation,block:!0,version:1,show:!1}}static get_default(e={},t={}){const n={id:(0,s.Ak)(),type:x.u0.text,info:"",attrs:{},css:{}},r={id:(0,s.Ak)(),type:x.u0.line,info:[n],attrs:{},css:{}},i={id:(0,s.Ak)(),type:x.u0.box,info:[r],attrs:{},css:{}};return{id:(0,s.Ak)(),type:x.u0.annotation,info:[i],css:e,attrs:t}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i;let s=[];for(let r of t.info){const t=A.K.find_cube(r.type);t&&t.replace_id&&s.push(t.replace_id(e,r,n))}return t.info=s,t}}R([(0,k.H)(a.zS.cube_insert_child)],P.prototype,"on_insert_child",null),R([(0,k.H)(a.zS.cube_delete_child)],P.prototype,"on_delete_child",null),R([(0,k.H)(a.zS.cube_reset)],P.prototype,"on_reset",null);var N=n(1068);const E=["id","data-type"],O={class:"title"},I=(0,c.pM)({__name:"cube-text-link",props:{cube:{}},setup(e){function t(){const t=document.createElement("a");t.href=e.cube.data.info.url,t.target="_blank",t.click()}function n(){e.cube.event.emit_text_link_edit(e.cube)}function r(){const{courier:t,history:n}=e.cube.root,{pcube:r,index:i}=e.cube,s=new _.vk(t);s.tell(r,o.VL.delete_child(r.id,"backward",[i,i+1])),n.record(s)}return(e,i)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-link",style:(0,d.Tr)(e.cube.css),id:e.cube.id,"data-type":(0,l.R1)(a.u0).link},[(0,c.Lk)("div",O,(0,d.v_)(e.cube.data.info.title),1),(0,c.Lk)("div",{class:"link",onClick:t},(0,d.v_)(e.cube.data.info.url),1),(0,c.Lk)("div",{class:"iconbox"},[(0,c.Lk)("div",{class:"iconfont icon-rename",onClick:n}),(0,c.Lk)("div",{class:"iconfont icon-Delete",onClick:r})])],12,E))}}),B=(0,m.A)(I,[["__scopeId","data-v-2946c9fa"]]);class D{static update(e,t,n){return{id:e,name:a.gS.update,title:t,url:n}}}class V extends o._D{constructor(e,t){return super(e,t),this.setup(e,t)}get info(){return this.data.info}get component(){return B}get meta(){return V.meta}get url(){return this.data.info.url}get title(){return this.data.info.title}build_child(e){}gc(){}export(){return this.base_export()}replace_id(e,t={}){return V.replace_id(this.root,e,t)}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}on_update_info(e){const{courier:t,cursor:n}=this,{url:r,title:i}=e,s=t.get_recorder();s.add_cmd(e);const o=this.info.title,a=this.info.url;return this.info.url=r,this.info.title=i,s.add_recover(D.update(this.id,o,a)),s}static get meta(){return{cubename:"文本链接",type:a.u0.link,block:!0,show:!1,version:1}}static get_default(e,t,n={},r={}){return{id:(0,s.Ak)(),type:a.u0.link,info:{url:e,title:t},css:n,attrs:r}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();return n[r]=i,t.id=i,t}}!function(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);s>3&&o&&Object.defineProperty(t,n,o)}([(0,k.H)(a.gS.update)],V.prototype,"on_update_info",null);const H=["id","data-type"],j=(0,c.pM)({__name:"cube-postil",props:{cube:{}},setup(e){const t=(0,c.EW)(()=>e.cube.children.filter(e=>e instanceof V)),n=(0,c.EW)(()=>e.cube.children.filter(e=>!(e instanceof V))),r=(0,c.EW)(()=>({...e.cube.css}));function i(){e.cube.visible(!1)}function s(){const{courier:t,history:n}=e.cube.root,r=e.cube.pcube,i=new _.vk(t);i.tell(r,o.VL.postil_remove(r.id,[0,e.cube.child_count])),n.record(i)}function u(e){e.preventDefault(),e.stopPropagation();const t=e.currentTarget;if(!(t instanceof HTMLElement))return;const{deltaY:n}=e;n>0?N.DomAnimation.scroll_element(t,20,"vertical"):N.DomAnimation.scroll_element(t,-20,"vertical")}return(e,o)=>e.cube.show?((0,c.uX)(),(0,c.CE)("div",{key:0,class:"cube-postil",style:(0,d.Tr)(r.value),id:e.cube.id,"data-type":(0,l.R1)(a.u0).postil},[(0,c.Lk)("div",{class:"iconbox"},[(0,c.Lk)("div",{class:"iconfont icon-Delete delete",title:"清空",onClick:s}),(0,c.Lk)("div",{class:"iconfont icon-close close",title:"关闭",onClick:i})]),(0,c.Lk)("div",{class:"mark-contents",onWheel:u},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(t.value,e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:e},null,8,["cube"]))),128)),((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(n.value,e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:e},null,8,["cube"]))),128))],32)],12,H)):(0,c.Q3)("v-if",!0)}}),F=(0,m.A)(j,[["__scopeId","data-v-7ca0a800"]]);function U(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class q extends o._D{_handler_update_pos;_handler_corrent;_timer_corrent;_show=(0,l.KR)(!1);constructor(e,t){super(e,t);const n=this.setup(e,t);return t.has_postil=!0,n}get default_size(){return{x:0,y:0,width:180,height:130}}get show(){return this._show.value}set show(e){this._show.value=e,e&&this.root.listener.check_float()}get has_annotation(){for(let e of this.children)if(e instanceof P)return!0;return!1}get meta(){return q.meta}get component(){return F}get is_empty(){return 1===this.child_count&&this.child_first.is_empty}build_child(e){const t=g.I.build_cubes(e.info,this);this._children.push(...t)}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}export(){const e=this.base_export();e.info=[];for(let t of this.children)e.info.push(t.export());return e}gc(){super.base_gc(),this.root.cubes.remove_cube(this),this._handler_update_pos&&(this.root.event.off(this._handler_update_pos),this._handler_update_pos=null)}replace_id(e,t={}){return q.replace_id(this.root,e,t)}on_insert_child(e){const{courier:t}=this,{pos:n,data:r}=e,i=t.get_recorder();if(i.add_cmd(e),0===r.length)return;if(!this.meta.block)return;let s=this.get_valid_index(n);const a=this.create_child_block(r);this.splice(s,0,...a),i.add_recover(o.VL.delete_child(this.id,"backward",[s,s+a.length]));const l=this.children[s+1];return l?i.tell(l,o.UB.in_head(l.id,0)):i.tell(this.child_last,o.UB.in_tail(this.child_last.id,0)),i}on_delete_child(e){const{courier:t,pid:n,index:r,pcube:i}=this,s=t.get_recorder();s.add_cmd(e);const{dir:a,range:l}=e,[c,d]=l;let u=c<0?0:c,h=d>this.child_count?this.child_count:d;if(u>=h)return;if(u<=0&&h>=this.child_count)return s.tell(this,o.VL.reset(this.id,[])),s;const p=this.children[u-1],m=this.children[h],f=h-u;let _=this.splice(c,f);return s.add_recover(o.VL.insert_child(this.id,_.data,c)),"backward"===a?p?s.tell(p,o.UB.in_tail(p.id,0)):m&&s.tell(m,o.UB.in_head(m.id,0)):"forward"===a&&(m?s.tell(m,o.UB.in_head(m.id,0)):p&&s.tell(p,o.UB.in_tail(p.id,0))),s}on_reset(e){const{courier:t,history:n}=this,{data:r}=e,i=new _.vk(t),s=[];for(let e of this.children)s.push(e.export());const a=g.I.build_cubes(r,this);return this.splice(0,this.child_count,...a),i.add_recover(o.VL.reset(this.id,s)),i}splice(e,t,...n){const r=this._children.splice(e,t,...n);for(let e of r)e.gc();const i=[];for(let e of r)e instanceof o._D&&i.push(e.export());return{children:r,data:i}}visible(e){if(e){const{courier:e,child_last:t}=this;this.update_pos(),this.show=!0,(0,c.dY)(()=>{const n=e.get_recorder();n.tell(t,o.UB.in_tail(t.id,0)),this.history.record(n)})}else this.show=!1}update_pos(e=!0){(0,c.dY)(()=>{const e=this.pcube.clientRect,t=this.clientRect||this.default_size;if(!e)return void(this.show=!1);const n={x:0,y:0,width:window.innerWidth,height:window.innerHeight},r=N.MathRect.move_rect_to_other(n,t,e,5);this.data.css.left=`${r.x}px`,this.data.css.top=`${r.y}px`})}static get_default(e=[],t={}){return{id:(0,s.Ak)(),type:a.u0.postil,info:e,attrs:{},css:t}}static get meta(){return{cubename:"标注内容",type:a.u0.postil,show:!1,version:1,block:!0}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i;const s=[];for(let r of t.info){const t=A.K.find_cube(r.type);t&&t.replace_id&&s.push(t.replace_id(e,r,n))}return t.info=s,t}}U([(0,k.H)(a.zS.cube_insert_child)],q.prototype,"on_insert_child",null),U([(0,k.H)(a.zS.cube_delete_child)],q.prototype,"on_delete_child",null),U([(0,k.H)(a.zS.cube_reset)],q.prototype,"on_reset",null);class ${static reset(e,t,n,r){return{id:e,name:a.lm.text_reset,info:t,cursor_after:r,cursor_before:n}}static break(e,t){return{id:e,name:a.lm.text_break,offset:t}}}function G(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class X extends o._D{_component=w;get attrs(){return this.data.attrs}get component(){return this._component}get meta(){return X.meta}get is_empty(){return X.is_empty_text(this.data)}get len(){return this.text.length}get text(){return this.data.info}get text_node(){const e=this.dom?.firstChild;if(e instanceof Text)return e}get children(){return[]}get line(){let e=this.pcube;for(;e;){if(e instanceof kt)return e;e=e.pcube}}constructor(e,t){super(e,t);const n=this.setup(e,t);return this.data.info=this.data.info.replace("\r",""),this.data.info||(this.data.info=""),this.init(),n}init(){this.root.stats.update_count_word(this.len)}build_child(e){const t=e.attrs?.postil;t&&(this.postil=new q(t,this))}gc(){super.base_gc(),this.root.stats.update_count_word(-this.len)}replace_id(e,t={}){return X.replace_id(this.root,e,t)}find_child_cube(e){}export(){return this.base_export()}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}merge_text(e){const{courier:t}=this,n=t.get_recorder(),r=this.prev_cube,i=this.next_cube,s=r instanceof X,a=i instanceof X;if(s&&a){const t=o.VL.merge(this.id,"both",this.id,e);n.tell(this,t)}else if(s){const t=o.VL.merge(this.id,"left",this.id,e);n.tell(this,t)}else if(a){const t=o.VL.merge(this.id,"right",this.id,e);n.tell(this,t)}return n}on_partition(e){const{courier:t,cursor:n,pcube:r}=this,{start_id:i,end_id:s,offset_end:a,offset_start:c}=e,d=this.get_valid_index(c),u=this.get_valid_index(a),h=new _.vk(t),p=this.text.slice(0,d),m=this.text.slice(d,u),f=this.text.slice(u);if(m){const e=X.get_default(m,structuredClone((0,l.ux)(this.css)));if(p){if(p){if(h.tell(this,$.reset(this.id,p,p.length,p.length)),f){const e=X.get_default(f,structuredClone((0,l.ux)(this.css)));h.tell(r,o.VL.insert_child(r.id,[e],this.index+1))}h.tell(r,o.VL.insert_child(r.id,[e],this.index+1))}}else if(h.tell(this,$.reset(this.id,m,m.length,m.length)),f){const e=X.get_default(f,structuredClone((0,l.ux)(this.css)));h.tell(r,o.VL.insert_child(r.id,[e],this.index+1))}return h}if(0===d){const e=X.get_default();h.tell(r,o.VL.insert_child(r.id,[e],this.index))}else if(d===this.len){const e=X.get_default();h.tell(r,o.VL.insert_child(r.id,[e],this.index+1))}else if(d>0&&d<this.len){const e=X.get_default(f,structuredClone((0,l.ux)(this.css)));return h.tell(r,o.VL.insert_child(r.id,[e],this.index+1)),h.tell(this,$.reset(this.id,p,p.length,p.length)),h}return h}on_cube_merge(e){const{courier:t,prev_cube:n,pcube:r,next_cube:i,pid:s,index:a}=this,{method:l,offset:c,cubeid:d}=e;let u=this.get_valid_index(c);const h=new _.vk(t);if("left"===l&&n instanceof X&&this.can_merge_with(n)){const e=n.id;h.tell(r,o.VL.delete_child(s,"forward",[a-1,a])),h.tell(this,$.reset(this.id,n.text+this.text,u,u+n.len)),this.event.emit_text_merge(e,this.id)}else if("right"===l&&i instanceof X&&this.can_merge_with(i)){const e=i.id;h.tell(r,o.VL.delete_child(s,"backward",[a+1,a+2])),h.tell(this,$.reset(this.id,this.text+i.text,u,u)),this.event.emit_text_merge(e,this.id)}else if("both"===l)if(n instanceof X&&i instanceof X&&this.can_merge_with(n)&&this.can_merge_with(i)){const e=n.len+u,t=n.id,s=i.id;h.tell(r,o.VL.delete_child(this.pid,"backward",[this.index-1,this.index])),h.tell(r,o.VL.delete_child(this.pid,"backward",[this.index+1,this.index+2])),h.tell(this,$.reset(this.id,n.text+this.text+i.text,u,e)),this.event.emit_text_merge(t,this.id),this.event.emit_text_merge(s,this.id)}else if(n instanceof X&&this.can_merge_with(n)){const e=n.id;h.tell(r,o.VL.delete_child(s,"forward",[a-1,a])),h.tell(this,$.reset(this.id,n.text+this.text,u,u+n.len)),this.event.emit_text_merge(e,this.id)}else if(i instanceof X&&this.can_merge_with(i)){const e=i.id;h.tell(r,o.VL.delete_child(s,"backward",[a+1,a+2])),h.tell(this,$.reset(this.id,this.text+i.text,u,u)),this.event.emit_text_merge(e,this.id)}return h}on_cube_insert(e){const{data:t,start_id:n,end_id:r,offset_end:i,offset_start:s}=e,{courier:a,pid:c,pcube:d}=this,u=new _.vk(a);this.cursor.has_selection;let h=s,p=i;if(h<0&&(h=0),p>this.text.length&&(p=this.text.length),i!==s){const e=o.VL.delete(this.id,"backward",this.id,this.id,s,i,!0);u.tell(this,e)}const m=g.I.pick(t),f=this.text.slice(0,h),b=this.text.slice(p);if(m.head.length>0)if(f)if(f&&b){u.tell(this,$.reset(this.id,f,f.length,f.length));const e=X.get_default(b,structuredClone((0,l.ux)(this.css)),structuredClone((0,l.ux)(this.attrs)));u.tell(d,o.VL.insert_child(c,[e],this.index+1)),u.tell(d,o.VL.insert_child(c,m.head,this.index+1))}else b||u.tell(d,o.VL.insert_child(c,m.head,this.index+1));else u.tell(d,o.VL.insert_child(c,m.head,this.index));const y=[...m.body];if(m.tail.length>0&&y.push(kt.get_default(m.tail)),m.root.length>0)for(let e of m.root)y.push(...e.info);if(y.length>0){if(0===m.head.length&&i>0&&i<this.len){u.tell(this,$.reset(this.id,f,f.length,f.length));const e=X.get_default(b,structuredClone((0,l.ux)(this.css)),structuredClone((0,l.ux)(this.attrs)));u.tell(d,o.VL.insert_child(c,[e],this.index+1))}u.tell(d,o.VL.insert_child(this.pid,y,this.index+1))}return u}on_cube_delete(e){const{courier:t,index:n,pcube:r,pid:i}=this,{dir:s,start_id:a,end_id:l,offset_start:c,offset_end:d,reserve:u}=e,h=new _.vk(t),p=this.get_valid_index(c),m=this.get_valid_index(d),f=p!==m||"head"===c||"tail"===d;if(0===p&&m===this.len)return u?h.tell(this,$.reset(this.id,"",this.len,1)):h.tell(r,o.VL.delete_child(i,"backward",[n,n+1])),h;const g=this.text.slice(0,p),b=this.text.slice(m);if(f)h.tell(this,$.reset(this.id,g+b,m,p));else{const e=p;if("backward"===s)if(0===e||0===X.drop_zero_width_space(this.text,p).pos)if(this.pcube.is_empty&&this.pcube instanceof o._D)h.merge(this.pcube.remove_self());else{const e=this.prev_cube_deep;if(!e)return;if(e.meta.block){const t=e.pcube;t&&h.merge(t.delete_edge(this,s))}else h.tell(e,o.VL.delete_adjacent(e.id,"right",this.id,0))}else if(this.is_empty)h.tell(r,o.VL.delete_child(i,"backward",[n,n+1]));else{const e=this.find_text_deleted(p,"left");h.tell(this,$.reset(this.id,e.text,g.length,e.pos)),e.text&&h.tell(this,o.VL.merge(this.id,"both",this.id,g.length-1))}else if("forward"===s)if(e===this.len||e===X.drop_zero_width_space(this.text,p).len)if(this.pcube.is_empty&&this.pcube instanceof o._D)h.merge(this.pcube.remove_self());else{const e=this.next_cube_deep;if(!e)return;if(e.meta.block){const t=e?.pcube;t&&h.merge(t.delete_edge(this,s))}else h.tell(e,o.VL.delete_adjacent(e.id,"left",this.id,this.len))}else if(this.is_empty)h.tell(r,o.VL.delete_child(i,"forward",[n,n+1]));else{const t=this.find_text_deleted(e,"right");h.tell(this,$.reset(this.id,t.text,g.length,g.length)),h.tell(this,o.VL.merge(this.id,"both",this.id,g.length))}}return h}on_text_reset(e){const{courier:t,pid:n,index:r,pcube:i,len:s}=this,{info:a,cursor_after:l,cursor_before:c}=e,d=t.get_recorder();d.add_cmd(e);let u=this.text;!a&&this.is_empty;const h=X.drop_zero_intelligence(a,l);return this.data.info=h.text,this.root.stats.update_count_word(h.len-s),d.tell(this,o.UB.in_head(this.id,h.pos)),d.add_recover($.reset(this.id,u,h.pos,c)),d}on_cube_set_selection_css(e){const{courier:t,pid:n,pcube:r}=this,{css:i,start_id:s,end_id:a,offset_start:c,offset_end:d,toggle:u,replace:h}=e;if(0===Object.keys(i).length&&!h)return;const p=new _.vk(t),m=this.get_valid_index(c),f=this.get_valid_index(d),g=X.drop_zero_width_space(this.text.slice(0,m),0).text,b=X.drop_zero_width_space(this.text.slice(m,f),0).text,y=X.drop_zero_width_space(this.text.slice(f),0).text;if(0===m&&f===this.len||m===f&&s===a)p.tell(this,o.VL.set_css(this.id,i,u,h)),p.tell(this,o.VL.merge(this.id,"both",this.id,f));else if(0===m&&b){const e=structuredClone((0,l.ux)(this.css));if(p.tell(this,$.reset(this.id,b,f,f)),p.tell(this,o.VL.set_css(this.id,i,u,h)),y){const t=X.get_default(y,e);p.tell(r,o.VL.insert_child(n,[t],this.index+1));const i=r.find_cube(t.id);i&&p.tell(i,o.VL.merge(t.id,"both",t.id,0))}p.tell(this,o.UB.in_tail(this.id,0)),p.tell(this,o.VL.merge(this.id,"left",this.id,this.len))}else if(m>0){if(g&&(p.tell(this,$.reset(this.id,g,m,m)),p.tell(this,o.VL.merge(this.id,"left",this.id,f))),y){const e=X.get_default(y,structuredClone((0,l.ux)(this.css))),t=[e];p.tell(r,o.VL.insert_child(n,t,this.index+1));const i=r.find_cube(e.id);i&&p.tell(i,o.VL.merge(i.id,"right",i.id,0))}if(b){const e=X.get_default(b,structuredClone((0,l.ux)(this.css)));p.tell(r,o.VL.insert_child(n,[e],this.index+1));const t=r.find_cube(e.id);t&&(p.tell(t,o.VL.set_css(e.id,i,u,h)),p.tell(t,o.VL.merge(e.id,"both",e.id,g.length+m)))}}return p}on_cube_break(e){const{courier:t,cursor:n,pcube:r,pid:i,index:s}=this,a=r.pcube;if(!a)return;const{offset:l}=e;let c=s+1;const d=new _.vk(t),u=this.text[l-1],h=this.text[l];let p=l,m=!1;if(u){const e=u.charCodeAt(0);55296<=e&&e<=56319&&(m=!0)}if(h&&!m){const e=h.charCodeAt(0);56320<=e&&e<=57343&&(m=!0)}m&&(p+=1),d.tell(this,o.VL.partition(this.id,this.id,this.id,p,p));const f=[];for(let e of r.children.slice(c))f.push(e.export());d.tell(r,o.VL.delete_child(r.id,"backward",[c,r.child_count]));const g=kt.get_default(f),b=this.line;b&&b.inherit_line([g]),d.tell(a,o.VL.insert_child(a.id,[g],r.index+1));const y=r.next_cube;return y?.id===g.id&&d.tell(y,o.UB.in_head(y.id,0,void 0)),d}on_cube_delete_adjacent(e){const{courier:t,pcube:n}=this,{from:r,from_id:i,offset:s}=e,a=new _.vk(t);if("left"===r)if(this.is_empty)a.merge(this.remove_self());else{const e=this.prev_cube_deep;e?.meta.block?a.tell(this,o.UB.in_head(this.id,0)):a.tell(this,o.VL.delete(this.id,"forward",this.id,this.id,0,0))}else if(this.is_empty)a.merge(this.remove_self());else{const e=this.next_cube_deep;e?.meta.block?a.tell(this,o.UB.in_tail(this.id,0)):a.tell(this,o.VL.delete(this.id,"backward",this.id,this.id,this.len,this.len))}return a}add_link(e,t){const{cursor:n,courier:r}=this,i=r.get_recorder(),s=V.get_default(t,e);return i.tell(this,o.VL.postil_add(this.id,[s])),i}add_annotation(e){const t=this.courier.get_recorder(),n=e||P.get_default();return t.tell(this,o.VL.postil_add(this.id,[n])),t}get_valid_index(e){return"head"===e?0:"tail"===e?this.text.length:e<0?0:e>this.text.length?this.text.length:e}set_cursor_in_head(e=0){const t=this.get_valid_index(e);(0,c.dY)(()=>{this.line?.dom?.focus();const e=this.text_node;e&&this.cursor.set_cursor(e,t<0?0:t)})}set_cursor_in_tail(e=0){let t=this.len-this.get_valid_index(e);(0,c.dY)(()=>{this.line?.dom?.focus();const e=this.text_node;e&&this.cursor.set_cursor(e,t<0?0:t)})}find_text_nav_pos(e,t){const n=this.text;let r=e;if(e<0&&(r=0),e>n.length&&(r=n.length),"left"===t){let e=r-1,t=n[e];for(;""===t&&e>=0;)e-=1,t=n[e];if(t){const n=t.charCodeAt(0);56320<=n&&n<=57343&&(e-=1)}return e<0?0:e}{let e=r+1,t=n[e];for(;""===t&&e<n.length;)e+=1,t=n[e];if(t){const n=t.charCodeAt(0);55296<=n&&n<=56319&&(e+=1)}return e>n.length?n.length:e}}find_text_deleted(e,t){if(e<0)return{text:this.text,pos:0};if(e>this.len)return{text:this.text,pos:this.len};if("left"===t){let n=this.find_text_nav_pos(e,t),r=this.text.slice(0,n),i=this.text.slice(e),s=r[r.length-1];if(s){const t=s.charCodeAt(0);55296<=t&&t<=56319&&(r=r.slice(0,-1),e-=1)}return{text:r+i,pos:n}}{let n=this.find_text_nav_pos(e,t),r=this.text.slice(0,e),i=this.text.slice(n),s=i[0];if(s){const e=s.charCodeAt(0);56320<=e&&e<=57343&&(i=i.slice(1))}return{text:r+i,pos:e}}}is_text_remain(e,t){if(0===this.len)return!1;const[n,r]=t;if(n===r)return"backward"===e?0!==this.find_text_nav_pos(n,"left")||this.find_text_nav_pos(r-1,"right")!==this.len:this.find_text_nav_pos(n,"right")!==this.len||0!==this.find_text_nav_pos(n,"left");{if(0===n&&r===this.len)return!1;const e=this.find_text_nav_pos(n+1,"left"),t=this.find_text_nav_pos(r-1,"right");return e>0||t<this.len}}drop_zero_width_space(e){return X.drop_zero_width_space(this.text,e)}can_merge_with(e){const t=g.I.is_same_style(this.css,e.css)||0===Object.keys(e.css).length,n=g.I.is_same_attrs(this.attrs,e.attrs),r=!this.postil&&!e.postil;return t&&n&&r}static drop_zero_width_space(e,t){let n="",r=t;r<0&&(r=0),r>e.length&&(r=e.length);const i=e.slice(0,r),s=e.slice(r);if(i){for(let e of i)""!==e&&(n+=e);r=n.length}if(s)for(let e of s)""!==e&&(n+=e);return{text:n,pos:r,get len(){return this.text.length}}}static drop_zero_intelligence(e,t){let n="",r=t;r<0&&(r=0),r>e.length&&(r=e.length);const i=e.slice(0,r),s=e.slice(r);if(i){for(let e=0;e<i.length;e++){let t=i[e],r=i[e-1];""===t&&"\n"!==r||(n+=t)}r=n.length}if(s)for(let e=0;e<s.length;e++){let t=s[e],r=s[e-1];""===t&&"\n"!==r||(n+=t)}return n||(n="",r=1),{text:n,pos:r,get len(){return this.text.length}}}static is_empty_text(e){if(e.type!==x.u0.text)return!1;let t="";for(let n of e.info)if(""!==n&&(t+=n),t.length>0)return!1;return 0===t.length}static get meta(){return{version:1,type:x.u0.text,cubename:"文本",block:!1,show:!1}}static get_default(e="",t={},n={}){const r=e||"";return{id:(0,s.Ak)(),type:x.u0.text,info:r,css:structuredClone((0,l.ux)(t)),attrs:structuredClone((0,l.ux)(n))}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();return n[r]=i,t.id=i,e.event.emit_replace_id(r,i),t}}G([(0,k.H)(a.zS.cube_partition)],X.prototype,"on_partition",null),G([(0,k.H)(a.zS.cube_merge)],X.prototype,"on_cube_merge",null),G([(0,k.H)(a.zS.cube_insert)],X.prototype,"on_cube_insert",null),G([(0,k.H)(a.zS.cube_delete)],X.prototype,"on_cube_delete",null),G([(0,k.H)(a.lm.text_reset)],X.prototype,"on_text_reset",null),G([(0,k.H)(a.zS.cube_set_selection_css)],X.prototype,"on_cube_set_selection_css",null),G([(0,k.H)(a.lm.text_break)],X.prototype,"on_cube_break",null),G([(0,k.H)(a.zS.cube_delete_adjacent)],X.prototype,"on_cube_delete_adjacent",null);const K=["id","data-type","contenteditable"],W=(0,c.pM)({__name:"cube-line",props:{cube:{}},setup:e=>(e,t)=>((0,c.uX)(),(0,c.CE)("div",{class:(0,d.C4)(["cube-line",{"line-first-letter-lower":e.cube.attrs.first_letter_lower}]),id:e.cube.id,"data-type":(0,l.R1)(a.u0).line,style:(0,d.Tr)(e.cube.css),contenteditable:e.cube.editable,spellcheck:"false"},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.children,e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:e},null,8,["cube"]))),128))],14,K))}),Y=(0,m.A)(W,[["__scopeId","data-v-f72cf81e"]]);let Z;const Q="undefined"!=typeof window&&window.trustedTypes;if(Q)try{Z=Q.createPolicy("vue",{createHTML:e=>e})}catch(e){}const J=Z?e=>Z.createHTML(e):e=>e,ee="undefined"!=typeof document?document:null,te=ee&&ee.createElement("template"),ne={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const i="svg"===t?ee.createElementNS("http://www.w3.org/2000/svg",e):"mathml"===t?ee.createElementNS("http://www.w3.org/1998/Math/MathML",e):n?ee.createElement(e,{is:n}):ee.createElement(e);return"select"===e&&r&&null!=r.multiple&&i.setAttribute("multiple",r.multiple),i},createText:e=>ee.createTextNode(e),createComment:e=>ee.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>ee.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,i,s){const o=n?n.previousSibling:t.lastChild;if(i&&(i===s||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),i!==s&&(i=i.nextSibling););else{te.innerHTML=J("svg"===r?`<svg>${e}</svg>`:"mathml"===r?`<math>${e}</math>`:e);const i=te.content;if("svg"===r||"mathml"===r){const e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},re=Symbol("_vtc");Boolean;c.QP;const ie=Symbol("_vod"),se=Symbol("_vsh"),oe=Symbol(""),ae=/(?:^|;)\s*display\s*:/,le=/\s*!important$/;function ce(e,t,n){if((0,d.cy)(n))n.forEach(n=>ce(e,t,n));else if(null==n&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=function(e,t){const n=ue[t];if(n)return n;let r=(0,d.PT)(t);if("filter"!==r&&r in e)return ue[t]=r;r=(0,d.ZH)(r);for(let n=0;n<de.length;n++){const i=de[n]+r;if(i in e)return ue[t]=i}return t}(e,t);le.test(n)?e.setProperty((0,d.Tg)(r),n.replace(le,""),"important"):e[r]=n}}const de=["Webkit","Moz","ms"],ue={},he="http://www.w3.org/1999/xlink";function pe(e,t,n,r,i,s=(0,d.J$)(t)){r&&t.startsWith("xlink:")?null==n?e.removeAttributeNS(he,t.slice(6,t.length)):e.setAttributeNS(he,t,n):null==n||s&&!(0,d.Y2)(n)?e.removeAttribute(t):e.setAttribute(t,s?"":(0,d.Bm)(n)?String(n):n)}function me(e,t,n,r,i){if("innerHTML"===t||"textContent"===t)return void(null!=n&&(e[t]="innerHTML"===t?J(n):n));const s=e.tagName;if("value"===t&&"PROGRESS"!==s&&!s.includes("-")){const r="OPTION"===s?e.getAttribute("value")||"":e.value,i=null==n?"checkbox"===e.type?"on":"":String(n);return r===i&&"_value"in e||(e.value=i),null==n&&e.removeAttribute(t),void(e._value=n)}let o=!1;if(""===n||null==n){const r=typeof e[t];"boolean"===r?n=(0,d.Y2)(n):null==n&&"string"===r?(n="",o=!0):"number"===r&&(n=0,o=!0)}try{e[t]=n}catch(e){}o&&e.removeAttribute(i||t)}function fe(e,t,n,r){e.addEventListener(t,n,r)}const _e=Symbol("_vei");const ge=/(?:Once|Passive|Capture)$/;let be=0;const ye=Promise.resolve(),ve=()=>be||(ye.then(()=>be=0),be=Date.now()),we=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123;"undefined"!=typeof HTMLElement&&HTMLElement,Symbol("_moveCb"),Symbol("_enterCb");const xe=e=>{const t=e.props["onUpdate:modelValue"]||!1;return(0,d.cy)(t)?e=>(0,d.DY)(t,e):t};function ke(e){e.target.composing=!0}function Se(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Ce=Symbol("_assign"),Me={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e[Ce]=xe(i);const s=r||i.props&&"number"===i.props.type;fe(e,t?"change":"input",t=>{if(t.target.composing)return;let r=e.value;n&&(r=r.trim()),s&&(r=(0,d.bB)(r)),e[Ce](r)}),n&&fe(e,"change",()=>{e.value=e.value.trim()}),t||(fe(e,"compositionstart",ke),fe(e,"compositionend",Se),fe(e,"change",Se))},mounted(e,{value:t}){e.value=null==t?"":t},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:s}},o){if(e[Ce]=xe(o),e.composing)return;const a=null==t?"":t;if((!s&&"number"!==e.type||/^0\d/.test(e.value)?e.value:(0,d.bB)(e.value))!==a){if(document.activeElement===e&&"range"!==e.type){if(r&&t===n)return;if(i&&e.value.trim()===a)return}e.value=a}}},Te=(0,d.X$)({patchProp:(e,t,n,r,i,s)=>{const o="svg"===i;"class"===t?function(e,t,n){const r=e[re];r&&(t=(t?[t,...r]:[...r]).join(" ")),null==t?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}(e,r,o):"style"===t?function(e,t,n){const r=e.style,i=(0,d.Kg)(n);let s=!1;if(n&&!i){if(t)if((0,d.Kg)(t))for(const e of t.split(";")){const t=e.slice(0,e.indexOf(":")).trim();null==n[t]&&ce(r,t,"")}else for(const e in t)null==n[e]&&ce(r,e,"");for(const e in n)"display"===e&&(s=!0),ce(r,e,n[e])}else if(i){if(t!==n){const e=r[oe];e&&(n+=";"+e),r.cssText=n,s=ae.test(n)}}else t&&e.removeAttribute("style");ie in e&&(e[ie]=s?r.display:"",e[se]&&(r.display="none"))}(e,n,r):(0,d.Mp)(t)?(0,d.CP)(t)||function(e,t,n,r,i=null){const s=e[_e]||(e[_e]={}),o=s[t];if(r&&o)o.value=r;else{const[n,a]=function(e){let t;if(ge.test(e)){let n;for(t={};n=e.match(ge);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[":"===e[2]?e.slice(3):(0,d.Tg)(e.slice(2)),t]}(t);if(r){const o=s[t]=function(e,t){const n=e=>{if(e._vts){if(e._vts<=n.attached)return}else e._vts=Date.now();(0,c.qL)(function(e,t){if((0,d.cy)(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(e=>t=>!t._stopped&&e&&e(t))}return t}(e,n.value),t,5,[e])};return n.value=e,n.attached=ve(),n}(r,i);fe(e,n,o,a)}else o&&(function(e,t,n,r){e.removeEventListener(t,n,r)}(e,n,o,a),s[t]=void 0)}}(e,t,0,r,s):("."===t[0]?(t=t.slice(1),1):"^"===t[0]?(t=t.slice(1),0):function(e,t,n,r){if(r)return"innerHTML"===t||"textContent"===t||!!(t in e&&we(t)&&(0,d.Tn)(n));if("spellcheck"===t||"draggable"===t||"translate"===t||"autocorrect"===t)return!1;if("form"===t)return!1;if("list"===t&&"INPUT"===e.tagName)return!1;if("type"===t&&"TEXTAREA"===e.tagName)return!1;if("width"===t||"height"===t){const t=e.tagName;if("IMG"===t||"VIDEO"===t||"CANVAS"===t||"SOURCE"===t)return!1}return(!we(t)||!(0,d.Kg)(n))&&t in e}(e,t,r,o))?(me(e,t,r),e.tagName.includes("-")||"value"!==t&&"checked"!==t&&"selected"!==t||pe(e,t,r,o,0,"value"!==t)):!e._isVueCE||!/[A-Z]/.test(t)&&(0,d.Kg)(r)?("true-value"===t?e._trueValue=r:"false-value"===t&&(e._falseValue=r),pe(e,t,r,o)):me(e,(0,d.PT)(t),r,0,t)}},ne);let Le;const ze=(...e)=>{const t=(Le||(Le=(0,c.K9)(Te))).createApp(...e),{mount:n}=t;return t.mount=e=>{const r=function(e){if((0,d.Kg)(e))return document.querySelector(e);return e}(e);if(!r)return;const i=t._component;(0,d.Tn)(i)||i.render||i.template||(i.template=r.innerHTML),1===r.nodeType&&(r.textContent="");const s=n(r,!1,function(e){return e instanceof SVGElement?"svg":"function"==typeof MathMLElement&&e instanceof MathMLElement?"mathml":void 0}(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),s},t};function Ae(e,t){if(t.freeze)return;e.preventDefault(),e.stopPropagation();const{doc:n,stats:r}=t,{deltaY:i,currentTarget:s}=e,o=t.config.data.revert_scope;i>0&&!o?t.expand("down"):t.expand("up")}const Re={class:"iconbox"},Pe=(0,c.pM)({__name:"note-scope",props:{selection:{}},setup(e){const t=(0,c.EW)(()=>{if(!e.selection.pos)return;const t=Math.min(e.selection.pos.width,e.selection.pos.height);return 0!==t?{"font-size":Math.min(Math.max(Math.floor(t/3),18),64)+"px"}:void 0}),n=(0,c.EW)(()=>{if(!e.selection.pos)return;const t=Math.min(e.selection.pos.width,e.selection.pos.height);return 0!==t?{"font-size":Math.min(Math.max(Math.floor(t/3),18),64)+"px",display:e.selection.pos.width<30?"none":"unset"}:void 0});function r(){e.selection.freeze=!e.selection.freeze}function i(t,n,r){t.stopPropagation();const{root:i}=e.selection,s=new _.vk(i.courier),a=n.get_scope_info(),l=a.cube.children[a.range[0]],c=a.cube.children[a.range[1]-1];if("A"===r&&c)if(c instanceof yt){const e=yt.get_default();s.tell(a.cube,o.VL.insert_child(a.cube.id,[e],c.index+1))}else{const e=kt.get_default(),t=o.VL.insert_child(a.cube.id,[e],c.index+1);s.tell(a.cube,t)}else if("B"===r&&l)if(l instanceof yt){const e=yt.get_default();s.tell(a.cube,o.VL.insert_child(a.cube.id,[e],l.index))}else{const e=kt.get_default(),t=o.VL.insert_child(a.cube.id,[e],l.index);s.tell(a.cube,t)}i.history.record(s)}function s(t){t.preventDefault(),t.stopPropagation(),e.selection.remove()}return(e,o)=>((0,c.uX)(),(0,c.CE)("div",{class:(0,d.C4)(["doc-scope",{freeze:e.selection.freeze}]),style:(0,d.Tr)(e.selection.css),onWheel:o[3]||(o[3]=t=>(0,l.R1)(Ae)(t,e.selection)),onClick:r,onContextmenu:s},[(0,c.Lk)("div",Re,[(0,c.Lk)("div",{class:"iconfont icon-a-copy",style:(0,d.Tr)(n.value),title:"在上方插入行",onClick:o[0]||(o[0]=t=>i(t,e.selection,"A"))},null,4),(0,c.Lk)("div",{class:"iconfont icon-force_vortex-copy",title:"取消选区",style:(0,d.Tr)(t.value),onClick:o[1]||(o[1]=()=>e.selection.remove())},null,4),(0,c.Lk)("div",{class:"iconfont icon-B-copy",style:(0,d.Tr)(n.value),title:"在上方插入行",onClick:o[2]||(o[2]=t=>i(t,e.selection,"B"))},null,4)])],38))}}),Ne=(0,m.A)(Pe,[["__scopeId","data-v-bdec0da6"]]);var Ee=n(3923);class Oe extends Ee.K{has_down=!1;down_caret=void 0;constructor(e){super(e)}get root(){return this._root}pointerdown(e){if(this.root.stats.is_read_mode)return e.preventDefault();e.preventDefault(),this.has_down=!0,this.down_caret=document.caretPositionFromPoint(e.clientX,e.clientY),this.click_selection_text(e),this.cursor.locate_cursor_by_coor(e.clientX,e.clientY)}pointermove(e){this.stats.view_point={x:e.clientX,y:e.clientY},this.drag_selection_text(e)}pointercancel(e){this.has_down=!1,this.down_caret=null}pointerup(e){e.preventDefault(),this.has_down=!1,this.down_caret=null}beforeinput(e){if(this.stats.in_composition_mode)return;if(this.event.emit_doc_input_before(e).some(e=>"stop"===e))return;e.preventDefault();const{courier:t,cursor:n,history:r}=this,i=e.data,{cube_end:s,cube_start:a,cube_selection:l,offset_start:c,offset_end:d}=n;if(!l||!s||!a)return;const u=a.id,h=s.id,p=l.id;if("insertText"===e.inputType){if(!(l instanceof X&&i)){const e=t.get_recorder(),n=X.get_default(i||""),s=o.VL.insert(p,[n],u,h,c,d);return e.tell(l,s),r.record(e)}{const e=t.get_recorder();this.ins(e,this.root,i,l,c,d),r.record(e)}}else if("deleteContentBackward"===e.inputType||"deleteContentForward"===e.inputType){const n=t.get_recorder();if(!this.root.scope_count_normal){let t="deleteContentBackward"===e.inputType?"backward":"forward";const i=o.VL.delete(p,t,u,h,c,d);return n.tell(l,i),r.record(n)}{const e=this.clipboard.delete_scope();e&&this.history.record(e)}}}compositionstart(e){this.stats.in_composition_mode=!0,this.clear_selection_text()}compositionupdate(e){}compositionend(e){const{courier:t,cursor:n,history:r,stats:i,event:s}=this.root;if(n.has_selection)return;if(!i.in_composition_mode)return;const{cube_end:o,cube_start:a,cube_selection:l,offset_start:c,offset_end:d}=n,u=e.data,h=new _.vk(t);if(l&&o&&a){if(l instanceof X){const e=l.text,t=d-u.length,n=`${e.slice(0,t)}${u}${e.slice(t)}`,r=$.reset(l.id,n,t,d);h.tell(l,r)}else console.error("编辑目标无法在内存结构中找到,此问题多由于未将子cube计算到children属性");i.in_composition_mode=!1,r.record(h),s.emit_doc_input_compositionend(e)}}clear_selection_text(){const{cursor:e,courier:t,history:n}=this;if(!e.has_selection)return;const{cube_end:r,cube_start:i,cube_selection:s,offset_start:a,offset_end:l}=e;if(!s||!r||!i)return;const c=new _.vk(t);c.tell(s,o.VL.delete(s.id,"backward",i.id,r.id,a,l)),n.record(c)}ins(e,t,n,r,i,s){const{courier:a,history:l}=t,c=r.text,d=c.slice(0,i)+n+c.slice(s),u=i+n.length,h=$.reset(r.id,d,i,u);e.tell(r,h);const p=o.VL.merge(r.id,"both",r.id,u);return e.tell(r,p),e}click_selection_text(e){if(!this.down_caret||!e.shiftKey)return;const{offset_end:t,node_end:n}=this.cursor,{offset:r,offsetNode:i}=this.down_caret;n instanceof Text&&i instanceof Text&&Promise.resolve().then(()=>{this.cursor.set_selection_between(n,t,i,r)})}drag_selection_text(e){if(!this.has_down||!this.down_caret||!g.I.check_mouse_key(e,"left"))return;const t=document.caretPositionFromPoint(e.clientX,e.clientY);t&&this.down_caret.offsetNode instanceof Text&&t.offsetNode instanceof Text&&this.cursor.set_selection_between(this.down_caret.offsetNode,this.down_caret.offset,t.offsetNode,t.offset)}}class Ie extends Oe{dragenter(e){e.preventDefault()}dragover(e){e.preventDefault()}dragleave(e){e.preventDefault()}drop(e){}handler_click_foot(e){e.preventDefault();const{courier:t,cursor:n,history:r}=this.root,i=this.root.child_last;if(i&&i.is_empty){let e=i;for(;e;){if(e instanceof X){e.line?.dom?.focus(),e.set_cursor_in_tail();break}e=e.child_last}}else{const e=new _.vk(t),n=yt.get_default();e.tell(this.root,o.VL.insert_child(this.root.id,[n],this.root.child_count)),r.record(e)}}}class Be extends Oe{}var De=n(4314),Ve=n(1642);const He={class:"dialog-form"},je={class:"form-grid"},Fe={class:"label"},Ue=["onUpdate:modelValue"],qe=(0,c.pM)({__name:"menu-dialog",setup(e){const t=(0,l.KR)();function n(){const e=t.value;e&&(De.Bz.open=!1,e.close())}function r(){n(),De.Bz.submit(De.Bz.data)}return(0,c.wB)(()=>De.Bz.open,()=>{const e=t.value;e&&(De.Bz.open?e.showModal():e.close())}),(e,i)=>((0,c.uX)(),(0,c.CE)("dialog",{class:"menu-dialog",ref_key:"root",ref:t,onClose:n},[(0,c.Lk)("div",He,[(0,c.Lk)("div",{class:"close-corner",onClick:n}),(0,c.Lk)("div",je,[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(Object.keys((0,l.R1)(De.Bz).data),e=>((0,c.uX)(),(0,c.CE)(c.FK,{key:e},[(0,c.Lk)("div",Fe,(0,d.v_)(e),1),(0,c.bo)((0,c.Lk)("input",{type:"text","onUpdate:modelValue":t=>(0,l.R1)(De.Bz).data[e]=t},null,8,Ue),[[Me,(0,l.R1)(De.Bz).data[e]]])],64))),128))]),(0,c.Lk)("div",{class:"dialog-submit",onClick:r},"确认")])],544))}}),$e=(0,m.A)(qe,[["__scopeId","data-v-edfb8f60"]]),Ge={class:"menu-title iconfont icon-sp"},Xe=["onPointerdown","onMouseenter"],Ke={class:"item-shortcut"},We={key:0,class:"iconfont icon-arrow-right"},Ye={class:"menu-title iconfont icon-sp"},Ze=["onPointerdown","onMouseenter"],Qe={class:"item-shortcut"},Je={key:0,class:"iconfont icon-arrow-right"},et=(0,c.pM)({__name:"note-menu",props:{root:{}},setup(e){const t=(0,l.KR)(),n=(0,l.KR)([]);function r(e,t=!1){t?(De.h_.stack_menus.length=e,De.h_.stack_rect.length=e,De.h_.menu=void 0):(De.h_.stack_menus.length=e,De.h_.stack_rect.length=e)}function i(e,t,n){if(r(t),!n.has_submenu)return;const i=e.currentTarget;De.h_.stack_rect.push(i.getBoundingClientRect());const s=n.mouseenter(e);De.h_.stack_menus.push(s)}function s(e,t){r(0,!0),t.click(e)}function o(e){return{cursor:e.usable?"unset":"not-allowed",color:e.usable?"unset":"var(--menu-item-disable-color)"}}function a(e){e.stopPropagation()}return(0,c.wB)(()=>De.h_.point,async()=>{const e=t.value;if(!e)return;await(0,c.dY)(),De.h_.stack_pos.length=0;const n={x:0,y:0,width:window.innerWidth,height:window.innerHeight},r=e.getBoundingClientRect(),i={x:De.h_.point.x,y:De.h_.point.y,width:0,height:0},s=N.MathRect.move_rect_to_other(n,r,i);De.h_.css={left:s.x+"px",top:s.y+"px"}}),(0,c.wB)(De.h_.stack_menus,async()=>{await(0,c.dY)();const e=n.value;if(!e)return;De.h_.stack_pos.length=0;const t={x:0,y:0,width:window.innerWidth,height:window.innerHeight};for(let n=0;n<De.h_.stack_menus.length;n++){const r=De.h_.stack_rect[n],i=e[n].getBoundingClientRect(),s=(0,Ve.LU)(t,i,r);De.h_.stack_pos.push({left:s.x+"px",top:s.y+"px"})}}),(0,c.sV)(()=>{document.documentElement.addEventListener("pointerdown",e=>{const n=t.value;if(!n)return;const r=e.target;r&&!n.contains(r)&&(De.h_.menu=void 0,De.h_.stack_menus.length=0,De.h_.stack_pos.length=0,De.h_.stack_rect.length=0)},{capture:!0})}),(e,r)=>((0,c.uX)(),(0,c.CE)("div",{class:"note-menus",style:(0,d.Tr)((0,l.R1)(De.h_).css),ref_key:"dom",ref:t,onWheel:a},[(0,c.Q3)(" 弹窗 "),(0,c.bF)($e),(0,c.Q3)(" 主菜单列表 "),(0,l.R1)(De.h_).menu?((0,c.uX)(),(0,c.CE)("div",{key:0,class:"menu-list",ref_key:"ms",ref:n},[(0,c.Lk)("div",Ge,(0,d.v_)((0,l.R1)(De.h_).menu.title),1),((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)((0,l.R1)(De.h_).menu.menus,e=>((0,c.uX)(),(0,c.CE)("div",{class:(0,d.C4)(["menu-item",{"active-item":(0,l.R1)(De.h_).menu.active.includes(e.title)}]),style:(0,d.Tr)(o(e)),key:e.title,onPointerdown:t=>s(t,e),onMouseenter:t=>i(t,0,e)},[(0,c.Lk)("div",{class:(0,d.C4)(["item-title",e.icon])},(0,d.v_)(e.title),3),(0,c.Lk)("div",Ke,(0,d.v_)(e.shortcut),1),e.has_submenu?((0,c.uX)(),(0,c.CE)("div",We)):(0,c.Q3)("v-if",!0)],46,Xe))),128))],512)):(0,c.Q3)("v-if",!0),(0,c.Q3)(" 子菜单列表 "),((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)((0,l.R1)(De.h_).stack_menus,(e,t)=>((0,c.uX)(),(0,c.CE)("div",{class:"submenu-list",ref_for:!0,ref_key:"ms",ref:n,style:(0,d.Tr)((0,l.R1)(De.h_).stack_pos[t])},[(0,c.Lk)("div",Ye,(0,d.v_)(e.title),1),((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.menus,n=>((0,c.uX)(),(0,c.CE)("div",{class:(0,d.C4)(["menu-item",{"active-item":e.active.includes(n.title)}]),style:(0,d.Tr)(o(n)),key:n.title,onPointerdown:e=>s(e,n),onMouseenter:e=>i(e,t+1,n)},[(0,c.Lk)("div",{class:(0,d.C4)(["item-title",n.icon])},(0,d.v_)(n.title),3),(0,c.Lk)("div",Qe,(0,d.v_)(n.shortcut),1),n.has_submenu?((0,c.uX)(),(0,c.CE)("div",Je)):(0,c.Q3)("v-if",!0)],46,Ze))),128))],4))),256))],36))}}),tt=(0,m.A)(et,[["__scopeId","data-v-1e6a8174"]]),nt=["id","data-type"],rt={class:"doc-postils"},it=(0,c.pM)({__name:"cube-doc",props:{cube:{}},setup(e){const t=e.cube,{config:n}=e.cube,r=new Ie(t),i=e=>r.pointerdown(e),s=e=>r.pointermove(e),o=e=>r.pointerup(e),u=e=>r.pointercancel(e),h=e=>r.handler_click_foot(e),p=e=>r.compositionstart(e),m=e=>r.compositionupdate(e),f=e=>r.compositionend(e),_=e=>r.beforeinput(e),g=e=>r.dragover(e),b=e=>r.dragenter(e),y=e=>r.dragleave(e),v=e=>r.drop(e);return(0,c.sV)(()=>{document.documentElement.addEventListener("pointerup",o),document.documentElement.addEventListener("pointermove",s),document.documentElement.addEventListener("pointercancel",u)}),(e,r)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-doc",id:(0,l.R1)(t).id,"data-type":(0,l.R1)(a.u0).doc,style:(0,d.Tr)((0,l.R1)(n).css_vars),onDragover:g,onDragenter:b,onDragleave:y,onDrop:v},[(0,c.Lk)("div",{class:"note",onPointerdown:i,onCompositionstart:p,onCompositionupdate:m,onCompositionend:f,onBeforeinput:_},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)((0,l.R1)(t).children,e=>((0,c.uX)(),(0,c.Wv)((0,c.$y)(e.component),{key:e.id,cube:e,id:e.id},null,8,["cube","id"]))),128)),(0,c.Q3)(" doc-cubes "),(0,c.Lk)("div",rt,[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)((0,l.R1)(t).cubes.postils,([e,t])=>((0,c.uX)(),(0,c.Wv)(S,{key:t.id,cube:t},null,8,["cube"]))),128))]),(0,c.Q3)(" footer "),(0,c.Lk)("div",{class:"cube-doc-footer",onPointerdown:h},null,32)],32),(0,c.Q3)(" scope selection "),((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)((0,l.R1)(t).scope,e=>((0,c.uX)(),(0,c.Wv)(Ne,{key:e.id,selection:(0,l.IG)(e)},null,8,["selection"]))),128)),(0,c.Q3)(" menus "),(0,c.bF)(tt,{root:e.cube},null,8,["root"])],44,nt))}}),st=(0,m.A)(it,[["__scopeId","data-v-728e5342"]]);let ot,at,lt=!1,ct=null,dt=null;function ut(e,t){const{courier:n,history:r,id:i,cubes:s}=t,a=n.get_recorder();a.tell(t,o.VL.fold(i,!t.attrs.fold)),r.record(a);for(let e of Object.values(s.postils))e.pcube?.top===t&&e.visible(!1);const l=t.child_first.id;if(!l)return;const c=document.getElementById(l);c?.scrollIntoView({block:"nearest",behavior:"smooth"})}function ht(e,t){e.preventDefault();const{root:n,stats:r}=t;r.anchor_root_id===t.id?r.anchor_root_id="":n.stats.anchor_root_id=t.id}var pt=n(4430);const mt=["id","data-type"],ft={class:"cube-box-root-content"},_t=(0,c.pM)({__name:"cube-box-root",props:{cube:{}},setup(e){const t=e.cube,{stats:n}=e.cube,r=(0,c.EW)(()=>({opacity:(e.cube.child_count+10)/60})),i=e=>function(e,t){if(e.stopPropagation(),!lt)return void e.preventDefault();const n=e.currentTarget;n instanceof HTMLElement&&(ct=n,ot=t,document.body.style.setProperty("--box-root-pointer-events","none"))}(e,t),s=e=>function(e,t){if(!lt||!ot)return;e.stopPropagation();const n=e.currentTarget;n instanceof HTMLElement&&t!==ot&&(n!==dt&&dt?.classList.remove("drag-enter"),dt=n,at=t,dt.classList.add("drag-enter"))}(e,t),u=e=>function(e,t){lt&&(e.preventDefault(),e.stopPropagation(),ot&&at&&ct&&dt&&ot!==at&&(ct.style["view-transition-name"]=ot.id,document.startViewTransition(()=>{if(!(ot&&at&&ct&&dt))return;const{courier:e,history:n}=t,r=new _.vk(e),i=ct.getBoundingClientRect(),s=at.index,a=ot.export(),l=at.pcube;ot.pcube===l?r.tell(ot.pcube,o.VL.reorder(ot.pid,ot.id,at.index)):(r.merge(ot.remove_self()),r.tell(l,o.VL.insert_child(l.id,[a],s))),n.record(r);const c=dt.getBoundingClientRect(),d=c.x-i.x,u=c.y-i.y;document.body.style.setProperty("--x",d+"px"),document.body.style.setProperty("--y",u+"px")}),lt=!1))}(e,t),h=e=>(dt&&dt.classList.remove("drag-enter"),ct&&ct.classList.remove("drag-enter"),void(lt=!1)),p=e=>function(e){e.preventDefault(),e.stopPropagation(),dt&&dt.classList.add("drag-enter")}(e),m=e=>function(e){e.stopPropagation(),dt&&dt.classList.remove("drag-enter")}(e),f=e=>function(e){const t=e.target;t instanceof HTMLElement&&"cube-box-root-dragger"===t.dataset.tag&&(lt=!0,e.stopPropagation())}(e),g=e=>function(e,t){const{stats:n}=t.root,r=t.index+1;n.active_root_index=r}(0,t);function b(e){const{stats:t}=e;return{"anchor-root":t.anchor_root_id===e.id,"fold-root":e.attrs.fold}}return(e,n)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-box-root",style:(0,d.Tr)((0,l.R1)(t).css),draggable:"true",id:e.cube.id,"data-type":(0,l.R1)(a.u0).box_root,onContextmenu:n[2]||(n[2]=t=>(0,l.R1)(pt.uz)(t,e.cube)),onFocusin:g,onDragstart:i,onDragenter:s,onDrop:u,onDragend:h,onDragover:p,onDragleave:m,onPointerdown:f},[(0,c.Lk)("div",{class:(0,d.C4)(["cube-dragger",b(e.cube)]),style:(0,d.Tr)(r.value),onClick:n[0]||(n[0]=t=>(0,l.R1)(ut)(t,e.cube)),onContextmenu:n[1]||(n[1]=t=>(0,l.R1)(ht)(t,e.cube)),"data-tag":"cube-box-root-dragger"},null,38),(0,c.Lk)("div",ft,[e.cube.attrs.fold?((0,c.uX)(),(0,c.Wv)(S,{key:0,cube:e.cube.child_first},null,8,["cube"])):((0,c.uX)(!0),(0,c.CE)(c.FK,{key:1},(0,c.pI)((0,l.R1)(t).children,e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:(0,l.IG)(e)},null,8,["cube"]))),128))])],44,mt))}}),gt=(0,m.A)(_t,[["__scopeId","data-v-76631106"]]);function bt(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class yt extends o._D{_component=gt;constructor(e,t){return super(e,t),this.setup(e,t)}get children(){const e=[];for(let t of this._children)e.push(t);return e}get component(){return this._component}get meta(){return yt.meta}get is_empty(){return 1===this.child_count&&this.child_first instanceof kt&&this.child_first.is_empty}get attrs(){return this.data.attrs}splice(e,t,...n){const r=this._children.splice(e,t,...n);for(let e of r)e.gc();const i=[];for(let e of r)e instanceof o._D&&i.push(e.export());return{children:r,data:i}}build_child(e){const t=g.I.build_cubes(e.info,this);this._children.push(...t)}gc(){super.base_gc()}export(){const e=this.base_export();e.info=[];for(let t of this.children){let n=t.export();e.info.push(n)}return e}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}replace_id(e,t={}){return yt.replace_id(this.root,e,t)}on_cube_delete_adjacent(e){const{courier:t}=this,{from:n,offset:r,from_id:i}=e,s=new _.vk(t);return"left"===n?this.prev_cube_deep instanceof yt?s.tell(this,o.VL.merge(this.id,"left",i,r)):s.tell(this,o.UB.in_head(this.id,0)):"right"===n&&(this.next_cube_deep instanceof yt?s.merge(this.on(o.VL.merge(this.id,"right",i,r))):s.tell(this,o.UB.in_tail(this.id,0))),s}on_merge(e){const{courier:t,prev_cube:n,next_cube:r,index:i,pid:s}=this,{method:a,cubeid:l,offset:c}=e,d=new _.vk(t);if("left"===a&&n instanceof yt){const e=this.export().info;d.tell(n,o.VL.insert_child(n.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(this.pid,"forward",[i,i+1]));const t=n.find_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}else if("right"===a&&r instanceof yt){const e=r.export().info;d.tell(this,o.VL.insert_child(this.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(s,"backward",[i+1,i+2]));const t=this.find_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}else if("both"===a)if(n instanceof yt&&r instanceof yt){const e=this.export().info,t=r.export().info;d.tell(n,o.VL.insert_child(n.id,e.concat(t),"tail")),d.tell(this.pcube,o.VL.delete_child(this.pid,"backward",[this.index,this.index+2]));const i=n.find_cube(l);i&&d.tell(i,o.UB.in_head(l,c))}else if(n instanceof yt&&!(r instanceof yt)){const e=this.export().info;d.tell(n,o.VL.insert_child(n.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(this.pid,"forward",[i,i+1]));const t=n.find_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}else if(!(n instanceof yt)&&r instanceof yt){const e=r.export().info;d.tell(this,o.VL.insert_child(this.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(s,"backward",[i+1,i+2]));const t=this.find_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}return d}on_cube_reorder(e){const{courier:t,history:n,cursor:r}=this,{cubeid:i,index:s}=e,a=this.find_child_cube(i);if(!a||a.index===s)return;const l=new _.vk(t);let c=0,d=a.index;return"tail"===s?c=this.child_count:"number"==typeof s&&(c=s),this.splice(d,1),this.splice(c,0,a),l.add_recover(o.VL.reorder(this.id,a.id,d)),l}on_cube_reset(e){const t=this.courier,{data:n}=e,r=t.get_recorder();r.add_cmd(e);const i=g.I.filter_out_empty(n);if(0===i.length){const e=this.children[0];if(1===this.child_count&&e instanceof X&&e.is_empty)return;const t=this.export().info,n=new kt(kt.get_default(),this);this.splice(0,this.child_count,n),r.add_recover(o.VL.reset(this.id,t)),r.tell(n,o.UB.in_tail(n.id,0))}else{const e=this.export().info,t=g.I.build_cubes(i,this);this.splice(0,this.child_count,...t),r.add_recover(o.VL.reset(this.id,e))}return r}on_insert_child(e){const{courier:t}=this,{pos:n,data:r}=e,i=t.get_recorder();if(i.add_cmd(e),0===r.length)return;let s=this.get_valid_index(n);const a=g.I.pick(r,!0),l=g.I.build_cubes(a.sort,this);this.splice(s,0,...l),i.add_recover(o.VL.delete_child(this.id,"backward",[s,s+l.length]));const c=l[l.length-1],d=this.children[s+1];return c?i.tell(c,o.UB.in_tail(c.id,0)):i.tell(d,o.UB.in_head(d.id,0)),i}on_delete_child(e){const{courier:t,pid:n,index:r,pcube:i}=this,{dir:s,range:a,reserve:l}=e,c=t.get_recorder();c.add_cmd(e);const[d,u]=a;let h=d<0?0:d,p=u>this.child_count?this.child_count:u;if(!(h>=p)){if(h<=0&&p>=this.child_count&&!l){if(l){if(this.is_empty)return;c.tell(this,o.VL.delete_child(this.id,s,[1,this.child_count]));const e=this.child_first;e&&c.tell(e,o.VL.delete_child(e.id,s,[0,e.child_count],l))}else this.is_empty?c.tell(i,o.VL.delete_child(n,s,[r,r+1])):c.tell(this,o.VL.reset(this.id,[]));return c}{const e=this.children[h-1],t=this.children[p],n=p-h;let r=this.splice(d,n);c.add_recover(o.VL.insert_child(this.id,r.data,d)),"backward"===s?e?c.tell(e,o.UB.in_tail(e.id,0)):t&&c.tell(t,o.UB.in_head(t.id,0)):"forward"===s&&(t?c.tell(t,o.UB.in_head(t.id,0)):e&&c.tell(e,o.UB.in_tail(e.id,0)))}return c}}get_valid_index(e){return"head"===e?0:"tail"===e?this.child_count:e<0?0:e>this.child_count?this.child_count:e}static filter_out_empty(e){return e.filter(e=>!X.is_empty_text(e))}static get meta(){return{type:a.u0.box_root,cubename:"根级块",version:1,block:!0,show:!1}}static get_default(e=[],t={},n={fold:!1}){const r=0===e.length?[kt.get_default()]:e;return{id:g.I.get_id(),type:a.u0.box_root,info:r,css:t,attrs:n}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i;const s=[];for(let r of t.info){const t=A.K.find_cube(r.type);t&&t.replace_id&&s.push(t.replace_id(e,r,n))}return t.info=s,t}}bt([(0,k.H)(a.zS.cube_delete_adjacent)],yt.prototype,"on_cube_delete_adjacent",null),bt([(0,k.H)(a.zS.cube_merge)],yt.prototype,"on_merge",null),bt([(0,k.H)(a.zS.cube_reorder)],yt.prototype,"on_cube_reorder",null),bt([(0,k.H)(a.zS.cube_reset)],yt.prototype,"on_cube_reset",null),bt([(0,k.H)(a.zS.cube_insert_child)],yt.prototype,"on_insert_child",null),bt([(0,k.H)(a.zS.cube_delete_child)],yt.prototype,"on_delete_child",null);class vt{}class wt extends o.MR{_app;data;constructor(e){super();const t=this.update_data(e).data;this.data=(0,l.Kh)(t),this.build_child(t),k.o.init_cmd_handler(this),A.K.add_doc(this),this._app=ze(st,{cube:this})}get domain(){return"doc"}get app(){return this._app}get component(){return st}get meta(){return wt.meta}get doc(){return this}get children(){const e=[];for(let t of this._children)e.push(t);return e}build_child(e){const t=g.I.build_cubes(e.info,this);return this._children.push(...t),t}gc(){}export(){const e=(0,l.ux)(this.data);e.css=structuredClone((0,l.ux)(this.css)),e.attrs=structuredClone((0,l.ux)(this.attrs)),e.info=[];for(let t of this.children){let n=t.export();e.info.push(n)}return e}update_data(e){return e.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}replace_id(e,t={}){return wt.replace_id(this.root,e,t)}render(e){this._dom=e,this.hotkeys.listen(e),this.app.mount(e),this.event.emit_status_update()}static get meta(){return{type:a.u0.doc,cubename:"文档",version:1,block:!0,show:!1}}static get_default(){return yt.get_default(),{id:(0,s.Ak)(),type:a.u0.doc,versions:A.K.export_versions(),info:[],css:{},attrs:{}}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i;const s=[];for(let r of t.info){const t=A.K.find_cube(r.type);t&&t.replace_id&&s.push(t.replace_id(e,r,n))}return t.info=s,t}}function xt(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class kt extends o._D{_component=Y;get children(){const e=[];for(let t of this._children)e.push(t);return e}get component(){return this._component}get editable(){if(this.stats.is_read_mode)return!1;const e=this.host_postil,t=this.host_node;return!e&&t?t.editable:!(!e||t)||!e||!t||e.level>t.level||t.editable}get meta(){return kt.meta}get is_empty(){return 1===this.child_count&&this.child_first.is_empty}get attrs(){return this.data.attrs}get child_first_text(){for(let e of this._children)if(e instanceof X)return e}get child_last_text(){for(let e of[...this._children].reverse())if(e instanceof X)return e}get next_line(){let e=this.next_cube_deep;for(;e;){if(e instanceof wt)return;let t=g.I.find_line(e,"first");if(t)return t;e=e.next_cube_deep}}get prev_line(){let e=this.prev_cube_deep;for(;e;){if(e instanceof wt)return;let t=g.I.find_line(e,"last");if(t)return t;e=e.prev_cube_deep}}constructor(e,t){return super(e,t),this.setup(e,t)}gc(){super.base_gc()}splice(e,t,...n){const r=this._children.splice(e,t,...n);for(let e of r)e.gc();const i=[];for(let e of r)e instanceof o._D&&i.push(e.export());return{children:r,data:i}}build_child(e){const t=g.I.build_cubes(e.info,this);this._children.push(...t)}export(){const e=this.base_export();e.info=[];for(let t of this.children)e.info.push(t.export());return e}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}replace_id(e,t={}){return kt.replace_id(this.root,e,t)}inherit_line(e){const t=Math.min(...e.map(e=>e.attrs.indent||0));for(let n of e){const e=this.attrs.indent;if(e){const r=n.attrs.indent||0;n.attrs.indent=e+r-t}this.css["text-indent"]&&n.type===this.type&&(n.css["text-indent"]=this.css["text-indent"])}}on_cube_merge(e){const{courier:t,prev_cube:n,next_cube:r,index:i,pid:s,pcube:a}=this,{method:l,cubeid:c,offset:d}=e,u=new _.vk(t);if("left"===l&&n instanceof kt){const e=this.export().info,t=g.I.filter_out_empty(e);u.tell(n,o.VL.insert_child(n.id,t,"tail")),u.tell(a,o.VL.delete_child(this.pid,"forward",[i,i+1]));const r=n.find_child_cube(c);r&&u.tell(r,o.UB.in_head(c,d))}else if("right"===l&&r instanceof kt){const e=r.export().info,t=g.I.filter_out_empty(e);u.tell(this,o.VL.insert_child(this.id,t,"tail")),u.tell(a,o.VL.delete_child(s,"backward",[i+1,i+2]));const n=this.find_child_cube(c);n&&u.tell(n,o.UB.in_head(c,d))}else if("both"===l)if(n instanceof kt&&r instanceof kt){const e=g.I.filter_out_empty(this.export().info),t=g.I.filter_out_empty(r.export().info);u.tell(n,o.VL.insert_child(n.id,e.concat(t),"tail")),u.tell(a,o.VL.delete_child(this.pid,"backward",[this.index,this.index+2]));const i=n.find_child_cube(c);i&&u.tell(i,o.UB.in_head(c,d))}else if(n instanceof kt&&!(r instanceof kt)){const e=g.I.filter_out_empty(this.export().info);u.tell(n,o.VL.insert_child(n.id,e,"tail")),u.tell(a,o.VL.delete_child(this.pid,"forward",[i,i+1]));const t=n.find_child_cube(c);t&&u.tell(t,o.UB.in_head(c,d))}else if(!(n instanceof kt)&&r instanceof kt){const e=g.I.filter_out_empty(r.export().info);u.tell(this,o.VL.insert_child(this.id,e,"tail")),u.tell(a,o.VL.delete_child(s,"backward",[i+1,i+2]));const t=this.find_child_cube(c);t&&u.tell(t,o.UB.in_head(c,d))}return u}on_cube_reset(e){const{courier:t}=this,{data:n}=e,r=t.get_recorder();r.add_cmd(e);const i=g.I.filter_out_empty(n);if(0===i.length){if(this.is_empty)return;const e=this.export().info,t=new X(X.get_default(),this);this.splice(0,this.child_count,t),r.add_recover(o.VL.reset(this.id,e)),r.tell(t,o.UB.in_tail(t.id,0))}else{const e=this.export().info,t=g.I.build_cubes(i,this);this.splice(0,this.child_count,...t),r.add_recover(o.VL.reset(this.id,e))}return r}on_insert_child(e){const{courier:t,pid:n,pcube:r}=this,{pos:i,data:s}=e,a=new _.vk(t);if(0===s.length)return a;let l=this.get_valid_index(i);const c=g.I.pick(s);if(c.head.length>0){a.add_cmd(e);const t=g.I.build_cubes(s,this),n=t[t.length-1];this.splice(l,0,...t),a.add_recover(o.VL.delete_child(this.id,"backward",[l,l+t.length])),n&&a.tell(n,o.UB.in_tail(n.id,0))}const d=[...c.body];if(c.tail.length>0&&d.push(kt.get_default(c.tail)),c.root.length>0)for(let e of c.root)d.push(...e.info);if(d.length>0)if(this.inherit_line(d),this.is_empty)a.tell(r,o.VL.insert_child(n,d,this.index)),a.tell(r,o.VL.delete_child(n,"backward",[this.index,this.index+1]));else{const e=this.get_valid_index(l+c.head.length);if(e<this.child_count){const t=this._children.slice(e);if(t.length>0){const i=t.map(e=>e.export()),s=kt.get_default(i);this.inherit_line([s]),a.tell(this,o.VL.delete_child(this.id,"backward",[e,this.child_count])),a.tell(r,o.VL.insert_child(n,[s],this.index+1))}}a.tell(r,o.VL.insert_child(n,d,this.index+1))}return a}on_delete_child(e){const{dir:t,range:n,reserve:r}=e,{courier:i,pid:s,index:a,pcube:l}=this,c=i.get_recorder();c.add_cmd(e);const[d,u]=n;let h=d<0?0:d,p=u>this.child_count?this.child_count:u;if(!(h>=p)){if(h<=0&&p>=this.child_count)if(r){if(this.is_empty)return;const e=this.child_first;e instanceof X?(c.tell(this,o.VL.delete_child(this.id,t,[1,this.child_count])),c.tell(e,$.reset(e.id,"",1,1))):c.tell(this,o.VL.reset(this.id,[]))}else this.is_empty?c.tell(l,o.VL.delete_child(s,t,[a,a+1])):c.tell(this,o.VL.reset(this.id,[]));else{const e=this.children[h-1],n=this.children[p],r=p-h;if(h>=this.child_count||r<=0)return;let i=this.splice(h,r);c.add_recover(o.VL.insert_child(this.id,i.data,d)),"backward"===t?e?c.tell(e,o.UB.in_tail(e.id,0)):n&&c.tell(n,o.UB.in_head(n.id,0)):"forward"===t&&(n?c.tell(n,o.UB.in_head(n.id,0)):e&&c.tell(e,o.UB.in_tail(e.id,0)))}return c}}on_cube_delete_adjacent(e){const{courier:t,pid:n,prev_cube:r,next_cube:i,pcube:s}=this,{from:a,from_id:l,offset:c}=e,d=new _.vk(t);return"left"===a?this.prev_cube_deep instanceof kt?d.tell(this,o.VL.merge(this.id,"left",l,c)):d.tell(this,o.UB.in_head(this.id,0,void 0)):"right"===a&&(this.next_cube_deep instanceof kt?d.tell(this,o.VL.merge(this.id,"right",l,c)):d.tell(this,o.UB.in_tail(this.id,0,void 0))),d}static filter_out_empty(e){return e.filter(e=>!X.is_empty_text(e))}static get meta(){return{version:1,type:a.u0.line,cubename:"行",block:!0,show:!1}}static get_default(e=[],t={},n={}){const r=0===e.length?[X.get_default()]:e;return{id:(0,s.Ak)(),type:a.u0.line,info:r,css:t,attrs:n}}static get_default_by_string(e="",t={},n={}){const r=[X.get_default(e||"")];return{id:(0,s.Ak)(),type:a.u0.line,info:r,css:t,attrs:n}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i;const s=[];for(let r of t.info){const t=A.K.find_cube(r.type);t&&t.replace_id&&s.push(t.replace_id(e,r,n))}return t.info=s,t}}xt([(0,k.H)(a.zS.cube_merge)],kt.prototype,"on_cube_merge",null),xt([(0,k.H)(a.zS.cube_reset)],kt.prototype,"on_cube_reset",null),xt([(0,k.H)(a.zS.cube_insert_child)],kt.prototype,"on_insert_child",null),xt([(0,k.H)(a.zS.cube_delete_child)],kt.prototype,"on_delete_child",null),xt([(0,k.H)(a.zS.cube_delete_adjacent)],kt.prototype,"on_cube_delete_adjacent",null);const St=["id","data-type"],Ct=(0,c.pM)({__name:"cube-box",props:{cube:{}},setup(e){function t(t){if(t.target===t.currentTarget){t.stopPropagation();const{courier:n,history:r}=e.cube,i=n.get_recorder(),s=o.UB.in_tail(e.cube.id,0,"none");i.tell(e.cube,s),r.record(i)}}return(e,n)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-box",style:(0,d.Tr)(e.cube.css),id:e.cube.id,"data-type":(0,l.R1)(x.u0).box,onPointerup:t},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.children,e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:e},null,8,["cube"]))),128))],44,St))}}),Mt=(0,m.A)(Ct,[["__scopeId","data-v-29b5ba30"]]);function Tt(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class Lt extends o._D{constructor(e,t){return super(e,t),this.setup(e,t)}get children(){const e=[];for(let t of this._children)e.push(t);return e}get component(){return(0,l.IG)(Mt)}get attrs(){return this.data.attrs}get meta(){return Lt.meta}get is_empty(){return 1===this.child_count&&this.child_first.is_empty}splice(e,t,...n){const r=this._children.splice(e,t,...n);for(let e of r)e.gc();const i=[];for(let e of r)e instanceof o._D&&i.push(e.export());return{children:r,data:i}}build_child(e){const t=g.I.build_cubes(e.info,this);this._children.push(...t)}export(){const e=this.base_export();e.info=[];for(let t of this.children){let n=t.export();e.info.push(n)}return e}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}gc(){super.base_gc()}replace_id(e,t={}){return Lt.replace_id(this.root,e,t)}on_merge(e){const{courier:t,prev_cube:n,next_cube:r,index:i,pid:s}=this,{method:a,cubeid:l,offset:c}=e,d=new _.vk(t);if("left"===a&&n instanceof Lt){const e=this.export().info;d.tell(n,o.VL.insert_child(n.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(this.pid,"forward",[i,i+1]));const t=n.find_child_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}else if("right"===a&&r instanceof Lt){const e=r.export().info;d.tell(this,o.VL.insert_child(this.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(s,"backward",[i+1,i+2]));const t=this.find_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}else if("both"===a)if(n instanceof Lt&&r instanceof Lt){const e=this.export().info,t=r.export().info;d.tell(n,o.VL.insert_child(n.id,e.concat(t),"tail")),d.tell(this.pcube,o.VL.delete_child(this.pid,"backward",[this.index,this.index+2]));const i=n.find_cube(l);i&&d.tell(i,o.UB.in_head(l,c))}else if(n instanceof Lt&&!(r instanceof Lt)){const e=this.export().info;d.tell(n,o.VL.insert_child(n.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(this.pid,"forward",[i,i+1]));const t=n.find_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}else if(!(n instanceof Lt)&&r instanceof Lt){const e=r.export().info;d.tell(this,o.VL.insert_child(this.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(s,"backward",[i+1,i+2]));const t=this.find_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}return d}on_box_order(e){const{courier:t,history:n,cursor:r}=this,{cubeid:i,index:s}=e,a=this.find_child_cube(i);if(!a||a.index===s)return;const l=new _.vk(t);let c=0,d=a.index;return"tail"===s?c=this.child_count:"number"==typeof s&&(c=s),this.splice(d,1),this.splice(c,0,a),l.add_recover(o.VL.reorder(this.id,a.id,d)),l}on_insert_child(e){const{courier:t}=this,{pos:n,data:r}=e,i=t.get_recorder();if(i.add_cmd(e),0===r.length)return;if(!this.meta.block)return;let s=this.get_valid_index(n);const a=this.create_child_block(r);this.splice(s,0,...a),i.add_recover(o.VL.delete_child(this.id,"backward",[s,s+a.length]));const l=this.children[s+1];return l?i.tell(l,o.UB.in_head(l.id,0)):i.tell(this.child_last,o.UB.in_tail(this.child_last.id,0)),i}on_delete_child(e){const{courier:t,pid:n,index:r,pcube:i}=this,{dir:s,range:a,reserve:l}=e,c=t.get_recorder();c.add_cmd(e);const[d,u]=a;let h=d<0?0:d,p=u>this.child_count?this.child_count:u;if(!(h>=p)){if(h<=0&&p>=this.child_count)if(l){if(this.is_empty)return;c.tell(this,o.VL.delete_child(this.id,s,[1,this.child_count]));const e=this.child_first;e&&c.tell(e,o.VL.delete_child(e.id,s,[0,e.child_count],l))}else this.is_empty?c.tell(i,o.VL.delete_child(n,s,[r,r+1])):c.tell(this,o.VL.reset(this.id,[]));else{const e=this.children[h-1],t=this.children[p],n=p-h;if(h>=this.child_count||n<=0)return;let r=this.splice(h,n);c.add_recover(o.VL.insert_child(this.id,r.data,d)),"backward"===s?e?c.tell(e,o.UB.in_tail(e.id,0)):t&&c.tell(t,o.UB.in_head(t.id,0)):"forward"===s&&(t?c.tell(t,o.UB.in_head(t.id,0)):e&&c.tell(e,o.UB.in_tail(e.id,0)))}return c}}on_box_reset(e){const t=this.courier,{data:n}=e,r=t.get_recorder();r.add_cmd(e);const i=g.I.filter_out_empty(n);if(0===i.length){if(this.is_empty)return;const e=this.export().info,t=new kt(kt.get_default(),this);this.splice(0,this.child_count,t),r.add_recover(o.VL.reset(this.id,e)),r.tell(t,o.UB.in_tail(t.id,0))}else{const e=this.export().info,t=g.I.build_cubes(i,this);this.splice(0,this.child_count,...t),r.add_recover(o.VL.reset(this.id,e))}return r}on_cube_delete_adjacent(e){const{courier:t,pcube:n,pid:r}=this,{from:i,from_id:s,offset:a}=e,l=new _.vk(t);if("left"===i)if(this.prev_cube_deep instanceof Lt)l.tell(this,o.VL.merge(this.id,"left",s,a));else{const e=this.export().info,t=this.child_first.id;l.tell(n,o.VL.insert_child(r,e,this.index)),l.merge(this.remove_self());const c=n.find_cube(t);c&&l.tell(c,o.VL.delete_adjacent(t,i,s,a))}else if("right"===i)if(this.next_cube_deep instanceof Lt)l.merge(this.on(o.VL.merge(this.id,"right",s,a)));else{const e=this.export().info,t=this.child_first.id;l.tell(n,o.VL.insert_child(r,e,this.index)),l.merge(this.remove_self());const c=n.find_cube(t);c&&l.tell(c,o.VL.delete_adjacent(t,i,s,a))}return l}get_valid_index(e){return"head"===e?0:"tail"===e?this.child_count:e<0?0:e>this.child_count?this.child_count:e}static get meta(){return{type:a.u0.box,cubename:"块",version:1,block:!0,show:!0}}static get_default(e=[],t={},n={}){const r=[];return 0===e.length?r.push(kt.get_default()):r.push(...g.I.pick(e).sort),{id:g.I.get_id(),type:a.u0.box,info:r,css:t,attrs:n}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i;const s=[];for(let r of t.info){const t=A.K.find_cube(r.type);t&&t.replace_id&&s.push(t.replace_id(e,r,n))}return t.info=s,t}}Tt([(0,k.H)(a.zS.cube_merge)],Lt.prototype,"on_merge",null),Tt([(0,k.H)(a.zS.cube_reorder)],Lt.prototype,"on_box_order",null),Tt([(0,k.H)(a.zS.cube_insert_child)],Lt.prototype,"on_insert_child",null),Tt([(0,k.H)(a.zS.cube_delete_child)],Lt.prototype,"on_delete_child",null),Tt([(0,k.H)(a.zS.cube_reset)],Lt.prototype,"on_box_reset",null),Tt([(0,k.H)(a.zS.cube_delete_adjacent)],Lt.prototype,"on_cube_delete_adjacent",null);const zt=["data-type"],At=(0,c.pM)({__name:"cube-box-folder",props:{cube:{}},setup(e){const t=e.cube,{stats:n}=e.cube;return(e,n)=>((0,c.uX)(),(0,c.CE)("div",{class:(0,d.C4)(["cube-box-folder",{"cube-box-folder-active":e.cube.attrs.fold}]),style:(0,d.Tr)((0,l.R1)(t).css),"data-type":(0,l.R1)(a.u0).box_folder},[e.cube.attrs.fold?((0,c.uX)(),(0,c.Wv)(S,{key:0,cube:e.cube.child_first},null,8,["cube"])):((0,c.uX)(!0),(0,c.CE)(c.FK,{key:1},(0,c.pI)((0,l.R1)(t).children,e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:(0,l.IG)(e)},null,8,["cube"]))),128)),(0,c.Lk)("div",{class:(0,d.C4)(["folder-tag",{"folder-tag-active":e.cube.attrs.fold}]),onClick:n[0]||(n[0]=t=>function(e,t){const{courier:n,history:r,cubes:i,id:s,pcube:a}=t,l=n.get_recorder();l.tell(t,o.VL.fold(s,!t.attrs.fold)),r.record(l);for(let e of Object.values(i.postils))e.find_upstream_untill(a)===t&&e.visible(!1);const c=t.child_first.id;if(!c)return;const d=document.getElementById(c);d?.scrollIntoView({block:"nearest",behavior:"smooth"})}(0,e.cube))},null,2)],14,zt))}}),Rt=(0,m.A)(At,[["__scopeId","data-v-c8ad020a"]]);function Pt(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class Nt extends o._D{_component=Rt;constructor(e,t){return super(e,t),this.setup(e,t)}get children(){const e=[];for(let t of this._children)e.push(t);return e}get component(){return this._component}get meta(){return Nt.meta}get is_empty(){return 1===this.child_count&&this.child_first instanceof kt&&this.child_first.is_empty}get attrs(){return this.data.attrs}splice(e,t,...n){const r=this._children.splice(e,t,...n);for(let e of r)e.gc();const i=[];for(let e of r)e instanceof o._D&&i.push(e.export());return{children:r,data:i}}build_child(e){const t=g.I.build_cubes(e.info,this);this._children.push(...t)}gc(){super.base_gc()}export(){const e=this.base_export();e.info=[];for(let t of this.children){let n=t.export();e.info.push(n)}return e}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}replace_id(e,t){return Nt.replace_id(this.root,e,t)}on_cube_delete_adjacent(e){const{courier:t}=this,{from:n,offset:r,from_id:i}=e,s=new _.vk(t);return"left"===n?this.prev_cube_deep instanceof Nt?s.tell(this,o.VL.merge(this.id,"left",i,r)):s.tell(this,o.UB.in_head(this.id,0)):"right"===n&&(this.next_cube_deep instanceof Nt?s.merge(this.on(o.VL.merge(this.id,"right",i,r))):s.tell(this,o.UB.in_tail(this.id,0))),s}on_merge(e){const{courier:t,prev_cube:n,next_cube:r,index:i,pid:s}=this,{method:a,cubeid:l,offset:c}=e,d=new _.vk(t);if("left"===a&&n instanceof Nt){const e=this.export().info;d.tell(n,o.VL.insert_child(n.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(this.pid,"forward",[i,i+1]));const t=n.find_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}else if("right"===a&&r instanceof Nt){const e=r.export().info;d.tell(this,o.VL.insert_child(this.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(s,"backward",[i+1,i+2]));const t=this.find_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}else if("both"===a)if(n instanceof Nt&&r instanceof Nt){const e=this.export().info,t=r.export().info;d.tell(n,o.VL.insert_child(n.id,e.concat(t),"tail")),d.tell(this.pcube,o.VL.delete_child(this.pid,"backward",[this.index,this.index+2]));const i=n.find_cube(l);i&&d.tell(i,o.UB.in_head(l,c))}else if(n instanceof Nt&&!(r instanceof Nt)){const e=this.export().info;d.tell(n,o.VL.insert_child(n.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(this.pid,"forward",[i,i+1]));const t=n.find_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}else if(!(n instanceof Nt)&&r instanceof Nt){const e=r.export().info;d.tell(this,o.VL.insert_child(this.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(s,"backward",[i+1,i+2]));const t=this.find_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}return d}on_cube_reorder(e){const{courier:t,history:n,cursor:r}=this,{cubeid:i,index:s}=e,a=this.find_child_cube(i);if(!a||a.index===s)return;const l=new _.vk(t);let c=0,d=a.index;return"tail"===s?c=this.child_count:"number"==typeof s&&(c=s),this.splice(d,1),this.splice(c,0,a),l.add_recover(o.VL.reorder(this.id,a.id,d)),l}on_cube_reset(e){const t=this.courier,{data:n}=e,r=t.get_recorder();r.add_cmd(e);const i=g.I.filter_out_empty(n);if(0===i.length){const e=this.children[0];if(1===this.child_count&&e instanceof X&&e.is_empty)return;const t=this.export().info,n=new kt(kt.get_default(),this);this.splice(0,this.child_count,n),r.add_recover(o.VL.reset(this.id,t)),r.tell(n,o.UB.in_tail(n.id,0))}else{const e=this.export().info,t=g.I.build_cubes(i,this);this.splice(0,this.child_count,...t),r.add_recover(o.VL.reset(this.id,e))}return r}on_insert_child(e){const{courier:t}=this,{pos:n,data:r}=e,i=t.get_recorder();if(i.add_cmd(e),0===r.length)return;if(!this.meta.block)return;let s=this.get_valid_index(n);const a=this.create_child_block(r);this.splice(s,0,...a),i.add_recover(o.VL.delete_child(this.id,"backward",[s,s+a.length]));const l=a[a.length-1],c=this.children[s+1];return l?i.tell(l,o.UB.in_tail(l.id,0)):i.tell(c,o.UB.in_head(c.id,0)),i}on_delete_child(e){const{courier:t,pid:n,index:r,pcube:i}=this,{dir:s,range:a,reserve:l}=e,c=t.get_recorder();c.add_cmd(e);const[d,u]=a;let h=d<0?0:d,p=u>this.child_count?this.child_count:u;if(h>=p)return;if(h<=0&&p>=this.child_count){if(l){if(this.is_empty)return;c.tell(this,o.VL.delete_child(this.id,s,[1,this.child_count]));const e=this.child_first;e&&c.tell(e,o.VL.delete_child(e.id,s,[0,e.child_count],l))}else this.is_empty?c.tell(i,o.VL.delete_child(n,s,[r,r+1])):c.tell(this,o.VL.reset(this.id,[]));return c}const m=this.children[h-1],f=this.children[p],_=p-h;let g=this.splice(d,_);return c.add_recover(o.VL.insert_child(this.id,g.data,d)),"backward"===s?m?c.tell(m,o.UB.in_tail(m.id,0)):f&&c.tell(f,o.UB.in_head(f.id,0)):"forward"===s&&(f?c.tell(f,o.UB.in_head(f.id,0)):m&&c.tell(m,o.UB.in_tail(m.id,0))),c}get_valid_index(e){return"head"===e?0:"tail"===e?this.child_count:e<0?0:e>this.child_count?this.child_count:e}static filter_out_empty(e){return e.filter(e=>!X.is_empty_text(e))}static get meta(){return{type:a.u0.box_folder,cubename:"折叠块",version:1,block:!0,show:!0}}static get_default(e=[],t={},n={fold:!1}){const r=0===e.length?[kt.get_default()]:e;return{id:g.I.get_id(),type:a.u0.box_folder,info:r,css:t,attrs:n}}static replace_id(e,t,n){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i;const s=[];for(let r of t.info){const t=A.K.find_cube(r.type);t&&t.replace_id&&s.push(t.replace_id(e,r,n))}return t.info=s,t}}Pt([(0,k.H)(a.zS.cube_delete_adjacent)],Nt.prototype,"on_cube_delete_adjacent",null),Pt([(0,k.H)(a.zS.cube_merge)],Nt.prototype,"on_merge",null),Pt([(0,k.H)(a.zS.cube_reorder)],Nt.prototype,"on_cube_reorder",null),Pt([(0,k.H)(a.zS.cube_reset)],Nt.prototype,"on_cube_reset",null),Pt([(0,k.H)(a.zS.cube_insert_child)],Nt.prototype,"on_insert_child",null),Pt([(0,k.H)(a.zS.cube_delete_child)],Nt.prototype,"on_delete_child",null);class Et{}const Ot=["d","id","data-type","stroke-width","stroke","marker-start","marker-end"],It=(0,c.pM)({__name:"cube-linker",props:{cube:{}},setup:e=>(t,n)=>((0,c.uX)(),(0,c.CE)("path",{d:t.cube.path,id:t.cube.id,class:(0,d.C4)({"line-delete-selected":e.cube.pcube.in_delete_line(e.cube)}),style:(0,d.Tr)(t.cube.css),"data-type":(0,l.R1)(a.u0).linker,"stroke-width":t.cube.attrs.stroke_width,stroke:t.cube.attrs.stroke,"marker-start":`url(#${t.cube.anchor_left})`,"marker-end":`url(#${t.cube.anchor_right})`},null,14,Ot))}),Bt=(0,m.A)(It,[["__scopeId","data-v-76929958"]]),Dt=["cx","cy"],Vt=(0,c.pM)({__name:"op-node-drag",props:{interaction:{}},setup(e){const{info_node_drag:t}=e.interaction;return(e,n)=>((0,c.uX)(),(0,c.CE)(c.FK,null,[(0,l.R1)(t).show?((0,c.uX)(),(0,c.CE)("circle",{key:0,cx:(0,l.R1)(t).x,cy:(0,l.R1)(t).y,r:"20",stroke:"black","stroke-width":"2","stroke-dasharray":"4 4",fill:"none"},null,8,Dt)):(0,c.Q3)("v-if",!0),(0,c.Q3)(' <g data-flag="drag-nodes" :transform="get_matrix()" style="pointer-events: none; user-select: none; opacity: 0.8" v-if="info_node_drag.show">\r\n <path d="M -54.5 -18 L 54.5 -18 Q 56.5 -18 56.5 -16 L 56.5 16 Q 56.5 18 54.5 18 L -54.5 18 Q -56.5 18 -56.5 16 L -56.5 -16 Q -56.5 -18 -54.5 -18 z" style="fill: rgba(255, 255, 255, 0.05); stroke: rgba(102, 115, 129, 0.5); stroke-width: 2"></path>\r\n <path d="M -54.5 -18 L -54.5 -20 Q -54.5 -22 -52.5 -22 L 58.5 -22 Q 60.5 -22 60.5 -20 L 60.5 14 Q 60.5 16 58.5 16 L 56.5 16" style="fill: none; stroke: rgba(102, 115, 129, 0.5); stroke-width: 2"></path>\r\n <text x="0" y="7" text-anchor="middle" font-size="14" style="fill: rgb(113 117 122)">已选择{{info_node_drag.count}}个节点</text>\r\n </g> ')],2112))}}),Ht={class:"map-status"},jt={class:"map-scale"},Ft={class:"map-nodes"},Ut=(0,c.pM)({__name:"map-status",props:{cube:{}},setup(e){const t=e.cube,n=(0,c.EW)(()=>e.cube.cubes.get_types_cube(a.u0.node));function r(e){const n=t.dom_rect,r={x:n.x+n.width/2,y:n.y+n.height/2};t.scale_by_point(r,e,e)}return(t,i)=>((0,c.uX)(),(0,c.CE)("div",Ht,[(0,c.Lk)("div",jt,[(0,c.Lk)("span",{class:"iconfont icon-icon_window_small_new-copy-copy",onClick:i[0]||(i[0]=e=>r(-.1))}),(0,c.Lk)("span",null,(0,d.v_)((100*e.cube.matrix2d.a).toFixed(0)+"%"),1),(0,c.Lk)("span",{class:"iconfont icon-add",onClick:i[1]||(i[1]=e=>r(.1))})]),(0,c.Lk)("div",Ft,[(0,c.Lk)("span",null,"节点 : "+(0,d.v_)(n.value.size),1)])]))}}),qt=(0,m.A)(Ut,[["__scopeId","data-v-0d43440f"]]),$t=new g.J,Gt=["id","data-type"],Xt=["transform"],Kt=["data-group"],Wt=["data-group"],Yt=["data-group"],Zt=["data-group"],Qt=["d"],Jt=["d","stroke-width","stroke","marker-start","marker-end"],en=["d"],tn={class:"doc-postils"},nn=(0,c.pM)({__name:"cube-map",props:{cube:{}},setup(e){const t=e.cube,{placeholder:n,config:r}=e.cube,i=r.data,s=new Be(t),o=(0,l.KR)(),u=new ResizeObserver(e=>{$t.resolve()});(0,c.sV)(()=>{const t=o.value;t&&u.observe(t),window.addEventListener("resize",t=>{e.cube.check_show_throttle()})});const h=e=>s.pointerdown(e),p=e=>s.pointermove(e),m=e=>s.pointerup(e),f=e=>s.pointercancel(e),_=e=>s.compositionstart(e),g=e=>s.compositionupdate(e),b=e=>s.compositionend(e),y=e=>s.beforeinput(e);return(0,c.sV)(()=>{document.documentElement.addEventListener("pointerup",m),document.documentElement.addEventListener("pointermove",p),document.documentElement.addEventListener("pointercancel",f)}),(e,s)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-map",id:e.cube.id,"data-type":(0,l.R1)(a.u0).map},[(0,c.Lk)("div",{class:"note",onPointerdown:h,onCompositionstart:_,onCompositionupdate:g,onCompositionend:b,onBeforeinput:y},[((0,c.uX)(),(0,c.CE)("svg",{ref_key:"svg",ref:o,style:(0,d.Tr)((0,l.R1)(r).css_vars)},[(0,c.Lk)("g",{transform:(0,l.R1)(t).matrix2d_dom_string},[(0,c.Lk)("g",{"data-group":(0,l.R1)(a.L6).markers,class:"group-defs"},[...s[0]||(s[0]=[(0,c.Fv)('<defs data-v-370c2bc9>\x3c!-- 箭头 --\x3e<marker id="marker-arrow" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="auto" fill="context-stroke" data-v-370c2bc9><path d="M 0 0 L 6 3 L 0 6 z" data-v-370c2bc9></path></marker>\x3c!-- 圆 --\x3e<marker id="marker-point" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="auto" fill="context-stroke" data-v-370c2bc9><circle cx="3" cy="3" r="3" data-v-370c2bc9></circle></marker>\x3c!-- 方块 --\x3e<marker id="marker-square" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="auto" fill="context-stroke" data-v-370c2bc9><rect x="0" y="0" width="6" height="6" rx="1" ry="1" data-v-370c2bc9></rect></marker>\x3c!-- 菱形 --\x3e<marker id="marker-rhomb" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="45" fill="context-stroke" data-v-370c2bc9><rect x="0" y="0" width="6" height="6" rx="1" ry="1" data-v-370c2bc9></rect></marker></defs>',1)])],8,Kt),(0,c.Lk)("g",{"data-group":(0,l.R1)(a.L6).linkers,class:"group-linkers"},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)((0,l.R1)(t).get_linkers_view(),e=>((0,c.uX)(),(0,c.Wv)(Bt,{key:e.id,cube:e},null,8,["cube"]))),128))],8,Wt),(0,c.Lk)("g",{"data-group":(0,l.R1)(a.L6).nodes,class:"group-nodes"},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.get_nodes_view(),e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:e},null,8,["cube"]))),128))],8,Yt),(0,c.Lk)("g",{"data-group":(0,l.R1)(a.L6).placeholder,class:"group-placeholder"},[(0,l.R1)(n).box_selector?((0,c.uX)(),(0,c.CE)("path",{key:0,class:"placeholder-box-selector",d:(0,l.R1)(n).box_selector},null,8,Qt)):(0,c.Q3)("v-if",!0),((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)((0,l.R1)(n).linker,e=>((0,c.uX)(),(0,c.CE)(c.FK,null,[e?((0,c.uX)(),(0,c.CE)("path",{key:0,class:"placeholder-linker",d:e,"stroke-width":(0,l.R1)(i).map_linker_stroke_width,stroke:(0,l.R1)(i).map_linker_stroke,"marker-start":`url(#${(0,l.R1)(i).map_linker_anchor_left})`,"marker-end":`url(#${(0,l.R1)(i).map_linker_anchor_right})`},null,8,Jt)):(0,c.Q3)("v-if",!0)],64))),256)),(0,l.R1)(n).line_delete?((0,c.uX)(),(0,c.CE)("path",{key:1,class:"placeholder-line-delete",d:(0,l.R1)(n).line_delete,stroke:"#ff7f7f","marker-start":"url(#marker-point)","marker-end":"url(#marker-arrow)"},null,8,en)):(0,c.Q3)("v-if",!0),(0,c.Q3)(' <rect :x="placeholder.node.x" :y="placeholder.node.y" rx="4" ry="4" :width="placeholder.node.width" :height="placeholder.node.height" stroke="none" fill="#00aaff" v-if="placeholder.node"></rect> '),(0,c.bF)(Vt,{interaction:e.cube.interaction},null,8,["interaction"])],8,Zt),(0,c.Q3)(" --------------------------------------------------------以下是测试信息----------------------------------------------------------- "),(0,c.Q3)(" ------------------节点信息---------------------- "),(0,c.Q3)(' <template v-for="node of cube.nodes_test" v-if="cube.isdev"> '),(0,c.Q3)(" 采样点 "),(0,c.Q3)(' <circle :cx="item.x" :cy="item.y" r="4" v-for="item of node.sample"></circle> '),(0,c.Q3)(" 中心点 "),(0,c.Q3)(' <circle :cx="node.bound.pos_center.x" :cy="node.bound.pos_center.y" r="4" fill="red"></circle> '),(0,c.Q3)(" 左上角 "),(0,c.Q3)(' <circle :cx="node.bound.pos.x" :cy="node.bound.pos.y" r="4" fill="blue"></circle> '),(0,c.Q3)(" 边界框 "),(0,c.Q3)(' <rect :x="node.bound.pos.x" :y="node.bound.pos.y" :width="node.bound.size_bound.width" :height="node.bound.size_bound.height" stroke="red" fill="none"></rect> '),(0,c.Q3)(" 树边界框 "),(0,c.Q3)(' <rect :x="node.bound.pos_tree.x" :y="node.bound.pos_tree.y" :width="node.bound.size_tree.width" :height="node.bound.size_tree.height" stroke="red" fill="none"></rect> '),(0,c.Q3)(" </template> "),(0,c.Q3)(" ------------------连线信息---------------------- "),(0,c.Q3)(' <template v-if="cube.root.isdev" v-for="linker of Object.values(cube.linkers)"> '),(0,c.Q3)(" 采样点 "),(0,c.Q3)(' <circle :cx="item.x" :cy="item.y" r="4" v-for="item of linker.sample"></circle> '),(0,c.Q3)(" 中心点 "),(0,c.Q3)(' <circle :cx="node.bound.pos_center.x" :cy="node.bound.pos_center.y" r="4" fill="red"></circle> '),(0,c.Q3)(" 左上角 "),(0,c.Q3)(' <circle :cx="node.bound.pos.x" :cy="node.bound.pos.y" r="4" fill="blue"></circle> '),(0,c.Q3)(" 边界框 "),(0,c.Q3)(' <rect :x="node.bound.pos.x" :y="node.bound.pos.y" :width="node.bound.size_bound.width" :height="node.bound.size_bound.height" stroke="red" fill="none"></rect> '),(0,c.Q3)(" 树边界框 "),(0,c.Q3)(' <rect :x="node.bound.pos_tree.x" :y="node.bound.pos_tree.y" :width="node.bound.size_tree.width" :height="node.bound.size_tree.height" stroke="red" fill="none"></rect> '),(0,c.Q3)(" </template> "),(0,c.Q3)(" ------------------意图区域---------------------- "),(0,c.Q3)(' <rect :x="PP.prev.x" :y="PP.prev.y" :width="PP.prev.width" :height="PP.prev.height" stroke="red" fill="none"></rect>\r\n <rect :x="PP.next.x" :y="PP.next.y" :width="PP.next.width" :height="PP.next.height" stroke="blue" fill="none"></rect>\r\n <rect :x="PP.child.x" :y="PP.child.y" :width="PP.child.width" :height="PP.child.height" stroke="green" fill="none" v-if="PP.child"></rect> ')],8,Xt)],4)),(0,c.Q3)(" doc-cubes "),(0,c.Lk)("div",tn,[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)((0,l.R1)(t).cubes.postils,([e,t])=>((0,c.uX)(),(0,c.Wv)(S,{key:t.id,cube:t},null,8,["cube"]))),128))])],32),(0,c.Q3)(" scope selection "),((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)((0,l.R1)(t).scope,e=>((0,c.uX)(),(0,c.Wv)(Ne,{key:e.id,selection:(0,l.IG)(e)},null,8,["selection"]))),128)),(0,c.Q3)(" map status "),(0,c.bF)(qt,{cube:e.cube},null,8,["cube"]),(0,c.Q3)(" menus "),(0,c.bF)(tt,{root:e.cube},null,8,["root"])],8,Gt))}}),rn=(0,m.A)(nn,[["__scopeId","data-v-370c2bc9"]]);var sn=n(7552);class on{static draw(e){const{type:t,from:n,to:r}=e;return"line"===t?this.line(n,r):"bezier2"===t?this.bezier2(n,r):"polyline"===t?this.polyline(n,r):"polyline2"===t?this.polyline2(n,r):"polyline3"===t?this.polyline3(n,r):"wave"===t?this.wave(n,r):this.polyline(n,r)}static get_line(e,t,n){return"line"===n?this.line(e,t):"bezier2"===n?this.bezier2(e,t):"polyline"===n?this.polyline(e,t):"polyline2"===n?this.polyline2(e,t):"polyline3"===n?this.polyline3(e,t):"wave"===n?this.wave(e,t):this.polyline(e,t)}static line(e,t){return`M${e.x.toFixed(1)} ${e.y.toFixed(1)}L${t.x.toFixed(1)} ${t.y.toFixed(1)}`}static bezier2(e,t){const n=(e.x+t.x)/2,r=n,i=e.y,s=n,o=t.y;return`M${e.x.toFixed(1)} ${e.y.toFixed(1)} C${r} ${i} ${s} ${o} ${t.x.toFixed(1)} ${t.y.toFixed(1)}`}static polyline(e,t,n=4){const r=(e.x+t.x)/2,i=e,s=t,o=r,a=i.y,l=r,c=s.y,d=Math.sign(e.x-t.x),u=Math.sign(t.y-e.y),h=Math.sign(e.y-t.y),p=Math.sign(t.x-e.x);return`M${i.x} ${i.y} H ${o+d*n} Q ${o} ${a} ${o} ${a+u*n} V ${c+h*n} Q${l} ${c} ${l+p*n} ${c} H ${s.x}`}static polyline2(e,t,n=4){const r=e,i=t,s=(e.x+t.x)/2,o=r.y;return`M${r.x} ${r.y} L${s} ${o} L ${i.x} ${i.y}`}static polyline3(e,t,n=4){const r=(e.x+t.x)/2,i=e,s=t,o=(i.y,r),a=s.y;return`M${i.x} ${i.y} L${o} ${a} L ${s.x} ${s.y}`}static wave(e,t,n=2,r=8){const i=t.x-e.x,s=t.y-e.y,o=Math.sqrt(i*i+s*s),a=Math.atan2(s,i),l=r??o/10;let c=`M ${e.x} ${e.y}`;const d=20*n;for(let t=0;t<=d;t++){const r=t/d,o=e.x+i*r,u=e.y+s*r,h=l*Math.sin(r*n*Math.PI*2),p=o+-Math.sin(a)*h,m=u+Math.cos(a)*h;if(0===t)c+=` M ${p} ${m}`;else{const r=(t-1)/d,o=l*Math.sin(r*n*Math.PI*2),u=-Math.sin(a)*o,h=Math.cos(a)*o,f=e.x+i*r+u,_=e.y+s*r+h;c+=` C ${f+(p-f)/3} ${_+(m-_)/3}, ${p-(p-f)/3} ${m-(m-_)/3}, ${p} ${m}`}}return c}}class an{static map={right:this.right.bind(this),left:this.left.bind(this),down:this.down.bind(this),up:this.up.bind(this),"time-right":this.time_right.bind(this),"time-down":this.time_down.bind(this)};static find(e,t){const n=e.layout_type;if(!n)return this.free_to_any(e,t);if(t.is_layout_root)return this.free_to_any(e,t);const r=this.map[n];return r?r(e,t):this.free_to_any(e,t)}static get_point(e){const t=e.layout_type;if(!t)return;const n=e.bound.rect;return"right"===t?N.MathRect.get_rect_point(n,N._RectPosition.right_mid):"left"===t?N.MathRect.get_rect_point(n,N._RectPosition.left_mid):"down"===t?N.MathRect.get_rect_point(n,N._RectPosition.bottom_mid):"up"===t?N.MathRect.get_rect_point(n,N._RectPosition.top_mid):"time-down"===t?N.MathRect.get_rect_point(n,N._RectPosition.bottom_mid):"time-right"===t?N.MathRect.get_rect_point(n,N._RectPosition.right_mid):void 0}static time_down(e,t){const n=t.prev_node||e,r={...n.bound.pos,...n.bound.size_bound},i={...t.bound.pos,...t.bound.size_bound};return{from:N.MathRect.get_rect_point(r,N._RectPosition.bottom_mid),to:N.MathRect.get_rect_point(i,N._RectPosition.top_mid)}}static time_right(e,t){const n=t.prev_node||e,r={...n.bound.pos,...n.bound.size_bound},i={...t.bound.pos,...t.bound.size_bound};return{from:N.MathRect.get_rect_point(r,N._RectPosition.right_mid),to:N.MathRect.get_rect_point(i,N._RectPosition.left_mid)}}static up(e,t){const n={...e.bound.pos,...e.bound.size_bound},r={...t.bound.pos,...t.bound.size_bound};return{from:N.MathRect.get_rect_point(n,N._RectPosition.top_mid),to:N.MathRect.get_rect_point(r,N._RectPosition.bottom_mid)}}static right(e,t){const n={...e.bound.pos,...e.bound.size_bound},r={...t.bound.pos,...t.bound.size_bound};return{from:N.MathRect.get_rect_point(n,N._RectPosition.right_mid),to:N.MathRect.get_rect_point(r,N._RectPosition.left_mid)}}static left(e,t){const n={...e.bound.pos,...e.bound.size_bound},r={...t.bound.pos,...t.bound.size_bound};return{from:N.MathRect.get_rect_point(n,N._RectPosition.left_mid),to:N.MathRect.get_rect_point(r,N._RectPosition.right_mid)}}static down(e,t){const n={...e.bound.pos,...e.bound.size_bound},r={...t.bound.pos,...t.bound.size_bound};return{from:N.MathRect.get_rect_point(n,N._RectPosition.bottom_mid),to:N.MathRect.get_rect_point(r,N._RectPosition.top_mid)}}static free_to_any(e,t){const n=e.sample,r=t.sample;if(0!==n.length&&0!==r.length)return sn.U.find_closest_points(n,r)}}class ln{static update(e,t){return{id:e,name:a.Sd.update,attrs:t}}}var cn=n(9788),dn=n(2698),un=n(7084);const hn={class:"map-status"},pn=(0,c.pM)({__name:"submap-status",props:{cube:{}},setup(e){function t(t){const n=e.cube.dom_rect,r={x:n.x+n.width/2,y:n.y+n.height/2};e.cube.scale_by_point(r,t,t)}return(n,r)=>((0,c.uX)(),(0,c.CE)("div",hn,[(0,c.Lk)("span",{class:"iconfont icon-icon_window_small_new-copy-copy",onClick:r[0]||(r[0]=e=>t(-.1))}),(0,c.Lk)("span",null,(0,d.v_)((100*e.cube.matrix2d.a).toFixed(0)+"%"),1),(0,c.Lk)("span",{class:"iconfont icon-add",onClick:r[1]||(r[1]=e=>t(.1))})]))}}),mn=(0,m.A)(pn,[["__scopeId","data-v-cb09d654"]]),fn=["id","data-type"],_n=["transform"],gn=["data-group"],bn=["data-group"],yn=["data-group"],vn=["data-group"],wn=["d"],xn=["d","stroke-width","stroke","marker-start","marker-end"],kn=["d"],Sn=(0,c.pM)({__name:"cube-submap",props:{cube:{}},setup(e){const{placeholder:t}=e.cube,n=e.cube.config.data,r=(0,l.KR)(),i=(0,l.KR)(),s=new ResizeObserver(e=>{}),u=(0,l.KR)();let h;function p(){e.cube.dom_svg_rect}return(0,c.sV)(()=>{const t=i.value;t&&s.observe(t);const n=r.value;n&&e.cube.interaction.register(n);const a=u.value;if(!a)return;h=new N.DragDiff(a);let l=e.cube.attrs.width,c=e.cube.attrs.height,d=l,p=c;h.register_down(()=>{l=e.cube.attrs.width,c=e.cube.attrs.height}),h.register_move((e,t)=>{d=Math.round(e+l),p=Math.round(t+c),n.style.width=d+"px",n.style.height=p+"px"}),h.register_up((t,n)=>{if(l===d&&c===p)return;const r=e.cube.courier.get_recorder(),i=Math.round(t+l),s=Math.round(n+c);r.tell(e.cube,o.VL.resize(e.cube.id,i,s)),e.cube.history.record(r),e.cube.check_show()}),h.register_cancel(()=>{e.cube.attrs.width=l,e.cube.attrs.height=c})}),(0,c.hi)(()=>{h?.off()}),(e,s)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-submap",id:e.cube.id,style:(0,d.Tr)(e.cube.css),"data-type":(0,l.R1)(a.u0).submap,ref_key:"box",ref:r,onClick:p},[((0,c.uX)(),(0,c.CE)("svg",{ref_key:"svg",ref:i},[(0,c.Lk)("g",{transform:e.cube.matrix2d_dom_string},[(0,c.Lk)("g",{"data-group":(0,l.R1)(a.L6).markers,class:"group-defs"},[...s[0]||(s[0]=[(0,c.Fv)('<defs data-v-128c2391>\x3c!-- 箭头 --\x3e<marker id="marker-arrow" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="auto" fill="context-stroke" data-v-128c2391><path d="M 0 0 L 6 3 L 0 6 z" data-v-128c2391></path></marker>\x3c!-- 圆 --\x3e<marker id="marker-point" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="auto" fill="context-stroke" data-v-128c2391><circle cx="3" cy="3" r="3" data-v-128c2391></circle></marker>\x3c!-- 方块 --\x3e<marker id="marker-square" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="auto" fill="context-stroke" data-v-128c2391><rect x="0" y="0" width="6" height="6" rx="1" ry="1" data-v-128c2391></rect></marker>\x3c!-- 菱形 --\x3e<marker id="marker-rhomb" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="45" fill="context-stroke" data-v-128c2391><rect x="0" y="0" width="6" height="6" rx="1" ry="1" data-v-128c2391></rect></marker></defs>',1)])],8,gn),(0,c.Lk)("g",{"data-group":(0,l.R1)(a.L6).linkers,class:"group-linkers"},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.get_linkers_view(),e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:e},null,8,["cube"]))),128))],8,bn),(0,c.Lk)("g",{"data-group":(0,l.R1)(a.L6).nodes,class:"group-nodes"},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.get_nodes_view(),e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:e},null,8,["cube"]))),128))],8,yn),(0,c.Lk)("g",{"data-group":(0,l.R1)(a.L6).placeholder,class:"group-placeholder"},[(0,l.R1)(t).box_selector?((0,c.uX)(),(0,c.CE)("path",{key:0,class:"placeholder-box-selector",d:(0,l.R1)(t).box_selector},null,8,wn)):(0,c.Q3)("v-if",!0),((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)((0,l.R1)(t).linker,e=>((0,c.uX)(),(0,c.CE)(c.FK,null,[e?((0,c.uX)(),(0,c.CE)("path",{key:0,class:"placeholder-linker",d:e,"stroke-width":(0,l.R1)(n).map_linker_stroke_width,stroke:(0,l.R1)(n).map_linker_stroke,"marker-start":`url(#${(0,l.R1)(n).map_linker_anchor_left})`,"marker-end":`url(#${(0,l.R1)(n).map_linker_anchor_right})`},null,8,xn)):(0,c.Q3)("v-if",!0)],64))),256)),(0,l.R1)(t).line_delete?((0,c.uX)(),(0,c.CE)("path",{key:1,class:"placeholder-line-delete",d:(0,l.R1)(t).line_delete,stroke:"#ff7f7f","marker-start":"url(#marker-point)","marker-end":"url(#marker-arrow)"},null,8,kn)):(0,c.Q3)("v-if",!0),(0,c.Q3)(' <rect :x="placeholder.node.x" :y="placeholder.node.y" rx="4" ry="4" :width="placeholder.node.width" :height="placeholder.node.height" stroke="none" fill="#00aaff" v-if="placeholder.node"></rect> '),(0,c.bF)(Vt,{interaction:e.cube.interaction},null,8,["interaction"])],8,vn)],8,_n)],512)),(0,c.bF)(mn,{cube:e.cube},null,8,["cube"]),(0,c.Lk)("div",{class:"submap-dragger",ref_key:"dragger",ref:u},null,512)],12,fn))}}),Cn=(0,m.A)(Sn,[["__scopeId","data-v-128c2391"]]);function Mn(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class Tn extends o._D{_interaction;_has_layout=!1;_display_success=!1;data;nodes_test=(0,l.Gc)({});matrix2d=(0,l.Kh)(sn.c.get_default());nodes=(0,l.Gc)({});node_from=(0,l.Kh)({});node_to=(0,l.Kh)({});node_editing=(0,l.Gc)(new Set);linkers=(0,l.Gc)({});nodes_selected=(0,l.Gc)(new Set);line_delete_selected=(0,l.Gc)(new Set);view_nodes=(0,l.Gc)(new Set);view_linkers=(0,l.Gc)(new Set);placeholder=(0,l.Kh)({linker:[],box_selector:"",line_delete:"",node:{x:0,y:0,width:0,height:0}});constructor(e,t){return super(e,t),this._interaction=new un.T(this),this.setup(e,t)}get perf(){return!1}get css(){return{...super.css,width:this.attrs.width+"px",height:this.attrs.height+"px"}}get attrs(){return this.data.attrs}get has_layout(){return this._has_layout}get dom_rect(){const e=this.dom;return e?e.getBoundingClientRect():new DOMRect(0,0,0,0)}get dom_svg_rect(){const e=this.dom?.getElementsByTagName("svg");return e?e[0].getBoundingClientRect():new DOMRect(0,0,0,0)}get matrix2d_dom_string(){return sn.c.get_dom_string(this.matrix2d)}get interaction(){return this._interaction}get domain(){return"doc"}get meta(){return Tn.meta}get component(){return Cn}get_linker(e){return this.linkers[e]}get_node(e){return this.nodes[e]}get_node_from(e){return this.node_from[e]}get_node_to(e){return this.node_to[e]}get_view_rect(){const{clientHeight:e,clientWidth:t}=document.documentElement,n=this.dom_svg_rect,r=Math.max(n.left,0),i=Math.min(n.right,t),s={x:r,y:Math.max(0,n.top)},o={x:i,y:Math.min(n.bottom,e)},a=this.view_point_to_real(s),l=this.view_point_to_real(o),c=l.x-a.x,d=l.y-a.y;return{x:a.x,y:a.y,width:c,height:d}}get_view_center(){const e=this.get_view_rect();return{x:e.x+e.width/2,y:e.y+e.height/2}}get_view_cube(){const e=this.get_view_rect(),t=[];for(let n of Object.values(this.nodes))N.MathRect.check_intersection(e,n.bound.rect)&&t.push(n);for(let n of Object.values(this.linkers))N.MathRect.check_intersection(e,n.rect)&&t.push(n);return t}find_layout_root(e){const t=new Set;for(let n of e){const e=n.layout_root;e&&t.add(e)}return t}wait_nodes_render(e){const t=[];for(let n of e)t.push(n.wait_layout_self());return Promise.all(t)}find_cube(e){const t=this.linkers[e];if(t)return t;for(let t of Object.values(this.nodes)){const n=t.find_cube(e);if(n)return n}}filter(e){const t=[];for(let n of Object.values(this.linkers))e(n)&&t.push(n),t.push(...n.filter(e));for(let n of Object.values(this.nodes))e(n)&&t.push(n),t.push(...n.filter(e));return t}each(e){for(let t of Object.values(this.linkers))e(t),t.each(e);for(let t of Object.values(this.nodes))e(t),t.each(e)}find_child_cube(e){return this.nodes[e]||this.linkers[e]}register_node_editing(e){this.node_editing.add(e)}remove_node_editing(e){this.node_editing.delete(e)}toggle_node_editing(e){this.node_editing.has(e)?this.node_editing.delete(e):this.node_editing.add(e)}check_node_editing(){for(let e of this.node_editing)e.editable||this.remove_node_editing(e)}clear_node_editing(){for(let e of this.node_editing)e.editable=!1;this.node_editing.clear()}register_node_selected(e){this.nodes_selected.add(e)}unregister_node_selected(e){this.nodes_selected.delete(e)}toggle_node_selected(e){this.nodes_selected.has(e)?this.nodes_selected.delete(e):this.nodes_selected.add(e)}is_node_selected(e){return this.nodes_selected.has(e)}in_delete_line(e){return this.line_delete_selected.has(e)}put_delete_selected(e){this.line_delete_selected.add(e)}get_delete_selected(){return new Set(this.line_delete_selected)}clear_delete_line(){this.line_delete_selected.clear()}clear_node_selected(){this.nodes_selected.clear()}pick(...e){for(let t of e)t instanceof o.wP?(this.nodes[t.id]=t,this.view_nodes.add(t)):t instanceof Ln&&(this.linkers[t.id]=t,this.view_linkers.add(t))}show_all(){for(let e of Object.values(this.nodes))this.view_nodes.add(e);for(let e of Object.values(this.linkers))this.view_linkers.add(e)}get_nodes_selected(){return new Set(this.nodes_selected)}get_nodes_view(){return new Set(this.view_nodes)}get_linkers_view(){return new Set(this.view_linkers)}get_nodes_all(){return[...Object.values(this.nodes)]}get_linkers_all(){return[...Object.values(this.linkers)]}get_nodes_intersection(e){let t=[];for(let n of Object.values(this.nodes)){const r=n.bound.rect;N.MathRect.check_intersection(e,r)&&t.push(n)}return t}set_graph_visible(e,t){t?e instanceof o.wP?this.view_nodes.add(e):e instanceof Ln&&this.view_linkers.add(e):e instanceof o.wP?this.view_nodes.delete(e):e instanceof Ln&&this.view_linkers.delete(e)}toggle_graph_visible(e){e instanceof o.wP?this.view_nodes.has(e)?this.view_nodes.delete(e):this.view_nodes.add(e):e instanceof Ln&&(this.view_linkers.has(e)?this.view_linkers.delete(e):this.view_linkers.add(e))}get_farest_node_selected(e){if(0!==this.nodes_selected.size){if(e===a.tX.left){let e;for(let t of this.nodes_selected){const n=t.bound.rect;(!e||n.x<e.bound.pos.x)&&(e=t)}return e}if(e===a.tX.right){let e;for(let t of this.nodes_selected){const n=t.bound.rect,r=e?.bound.rect;(!r||n.x+n.width>r.x+r.width)&&(e=t)}return e}if(e===a.tX.down){let e;for(let t of this.nodes_selected){const n=t.bound.rect,r=e?.bound.rect;(!r||n.y+n.height>r.y+r.height)&&(e=t)}return e}if(e===a.tX.up){let e;for(let t of this.nodes_selected){const n=t.bound.rect,r=e?.bound.rect;(!r||n.y<r.y)&&(e=t)}return e}}}get_nearest_node(e,t){const n=e.bound.rect;let r=e,i=1/0;if(t===a.tX.left)for(let t of Object.values(this.nodes)){if(e===t)continue;const s=t.bound.rect;if(s.x>n.x||s.y+s.height<n.y||s.y>n.y+n.height)continue;const o=N.MathRect.distance_with(n,s);o<i&&(r=t,i=o)}else if(t===a.tX.right)for(let t of Object.values(this.nodes)){if(e===t)continue;let s=t.bound.rect;if(s.x+s.width<n.x+n.width||s.y+s.height<n.y||s.y>n.y+n.height)continue;const o=N.MathRect.distance_with(n,s);o<i&&(r=t,i=o)}else if(t===a.tX.up)for(let t of Object.values(this.nodes)){if(e===t)continue;let s=t.bound.rect;if(s.y>n.y||s.x>n.x+n.width||s.x+s.width<n.x)continue;const o=N.MathRect.distance_with(n,s);o<i&&(r=t,i=o)}else if(t===a.tX.down)for(let t of Object.values(this.nodes)){if(e===t)continue;let s=t.bound.rect;if(s.y+s.height<n.y+n.height||s.x>n.x+n.width||s.x+s.width<n.x)continue;const o=N.MathRect.distance_with(n,s);o<i&&(r=t,i=o)}return r}move_select(e){if(0===this.nodes_selected.size)return;const t=this.get_farest_node_selected(e);if(!t)return;const n=this.get_nearest_node(t,e);this.clear_node_selected(),this.register_node_selected(n),n.move_in_fig_view()}layout(){const e=this.get_view_rect();for(let t of Object.values(this.nodes))t.is_layout_root&&t.attrs.layout&&t.layout(e);this.perf&&this.check_show_line()}check_in_view(e){const{innerHeight:t,innerWidth:n}=window;return!(e.y>t||e.y+e.height<0||e.x>n||e.x+e.width<0)}check_show(){this.perf&&(this.check_show_node(),this.check_show_line())}check_show_line(){if(this.perf){this.view_linkers.clear();for(let e of this.view_nodes)e.check_show_line()}}check_show_node(){if(!this.perf)return;const e=this.get_view_rect();for(let t of Object.values(this.nodes))t.check_show(e)}layout_throttle=N.Notice.throttle(this.layout.bind(this),70);check_show_throttle=N.Notice.throttle(this.check_show.bind(this),100);check_show_line_throttle=N.Notice.throttle(this.check_show_line.bind(this),100);check_show_node_throttle=N.Notice.throttle(this.check_show_node.bind(this),100);async build_child(e){const{nodes:t,linkers:n}=e.info,r=g.I.build_cubes(t,this);for(let e of r)this.nodes[e.id]=e,this.view_nodes=(0,l.Gc)(new Set(r));await this.wait_nodes_render(r),await this.layout(),this._has_layout=!0;for(let e of n){const t=this.get_node(e.attrs.from),n=this.get_node(e.attrs.to);if(!t||!n)continue;const r=new Ln(e,this);this.linkers[r.id]=r,this.perf||this.view_linkers.add(r)}}update_data(e){return{usable:!0,data:e}}export(){const e=Tn.get_default();e.id=this.id,e.css=structuredClone((0,l.ux)(this.css)),e.attrs=structuredClone((0,l.ux)(this.attrs));const t=[],n=[];e.info={nodes:t,linkers:n,node_from:(0,l.ux)(this.node_from),node_to:(0,l.ux)(this.node_to)};for(let e of Object.values(this.nodes))t.push(e.export());for(let e of Object.values(this.linkers))n.push(e.export());return e}remove_node(e){delete this.nodes[e.id],this.view_nodes.delete(e),e.gc()}remove_linker(e){delete this.linkers[e.id],this.view_linkers.delete(e),e.gc()}on_node_add(e){const{data:t}=e,{cursor:n,courier:r,history:i}=this,s=r.get_recorder();s.add_cmd(e);const a=g.I.build_cubes(t,this);this.pick(...a);const l=t.map(e=>e.id);return s.add_recover(o.yc.node_remove(this.id,l)),Promise.resolve().then(async()=>{const e=this.find_layout_root(a),t=this.get_view_rect();for(let n of e)n.layout_throttle(t);this.config.data.map_perf&&this.check_show_line_throttle()}),s}on_node_remove(e){const{data:t}=e,{courier:n,cursor:r,history:i}=this;if(0===t.length)return;const s=n.get_recorder();s.add_cmd(e);const a=[],l=new Set;for(let e of t){const t=this.get_node(e);if(!t)continue;a.push(t.export());const n=t.layout_root;n&&n!==t&&l.add(t.layout_root);for(let n of t.from){const t=this.get_linker_id(n,e);this.get_linker(t)&&s.tell(this,o.yc.linker_remove(this.id,[t]))}for(let e of t.to){const n=this.get_linker_id(t.id,e);this.get_linker(n)&&s.tell(this,o.yc.linker_remove(this.id,[n]))}this.remove_node(t)}s.add_recover(o.yc.node_add(this.id,a));const c=this.get_view_rect();for(let e of l)e.layout_throttle(c);return this.config.data.map_perf&&this.check_show_line_throttle(),s}on_linker_add(e){const{data:t}=e,{courier:n,cursor:r,history:i}=this,s=n.get_recorder();s.add_cmd(e);const a=new Set,l=[];for(let e of t){const{index_to:t,index_from:n,linker:r}=e,i=new Ln(r,this),s=i.from_node,o=i.to_node;if(!s||!o)continue;this.pick(i);let c=this.node_from[i.to_id],d=this.node_to[i.from_id];c?c.indexOf(i.from_id)<0&&c.splice(n,0,i.from_id):this.node_from[i.to_id]=[i.from_id],d?d.indexOf(i.to_id)<0&&d.splice(t,0,i.to_id):this.node_to[i.from_id]=[i.to_id],l.unshift(i.id);const u=s.layout_root;u&&a.add(u)}s.add_recover(o.yc.linker_remove(this.id,l));const c=this.get_view_rect();for(let e of a)e.layout_throttle(c);return this.config.data.map_perf&&this.check_show_line_throttle(),s}on_linker_remove(e){const{data:t}=e,{courier:n,cursor:r,history:i}=this;if(0===t.length)return;const s=n.get_recorder();s.add_cmd(e);const a=[],l=[];for(let e of t){const t=this.get_linker(e);if(!t)continue;const n=this.get_node(t.from_id);n&&l.push(n);const r=this.node_to[t.from_id],i=this.node_from[t.to_id];if(r&&i){const e=r.indexOf(t.to_id),n=i.indexOf(t.from_id);r.splice(e,1),i.splice(n,1),a.unshift({linker:t.export(),index_to:e,index_from:n})}this.remove_linker(t)}const c=this.find_layout_root(l),d=this.get_view_rect();for(let e of c)e.layout_throttle(d);return this.config.data.map_perf&&this.check_show_line_throttle(),s.add_recover(o.yc.linker_add(this.id,a)),s}get_linker_id(e,t){return e+"-"+t}replace_id(e,t={}){return Tn.replace_id(this.root,e,t)}reset_matrix(e){Object.assign(this.matrix2d,e),this.event.emit_status_update()}translate(e,t){const n=sn.c.multiply(this.matrix2d,sn.c.get_matrix_translate(e,t));this.reset_matrix(n)}scale_diff(e,t){this.matrix2d.a+=e,this.matrix2d.d+=t}scale_by_point(e,t,n){const{map_scale_max:r,map_scale_min:i}=this.config.data,s=this.matrix2d.a+t;if(s>r||s<i)return;const o=this.view_point_to_fig(e),a=this.untransform_point(o);this.matrix2d.a+=t,this.matrix2d.d+=n;const l=this.transform_point(a),c=sn.c.multiply(this.matrix2d,sn.c.get_matrix_translate(o.x-l.x,o.y-l.y));this.reset_matrix(c)}view_point_to_fig(e){const t=this.dom_svg_rect,{sx:n,sy:r}=this.get_upstream_sum_scale();let{x:i,y:s}=e;return{x:(i-t.x)/n,y:(s-t.y)/r}}view_point_to_real(e){const t=this.view_point_to_fig(e);return this.untransform_point(t)}fig_point_to_view(e){const t=this.dom_svg_rect;return{x:e.x+t.x,y:e.y+t.y}}fig_point_to_real(e){return this.untransform_point(e)}real_point_to_fig(e){return this.transform_point(e)}real_point_to_view(e){const t=this.real_point_to_fig(e);return this.fig_point_to_view(t)}transform_point(e){const{a:t,b:n,c:r,d:i,e:s,f:o}=this.matrix2d,{x:a,y:l}=e;return{x:t*a+r*l+s,y:n*a+i*l+o}}untransform_point(e){const{a:t,b:n,c:r,d:i,e:s,f:o}=this.matrix2d,{x:a,y:l}=e;return{x:(a-s-r*l)/t,y:(l-o-n*a)/i}}static get meta(){return{type:a.u0.submap,cubename:"子图",version:1,block:!0,show:!0}}static get_default(e=400,t=200){return{id:g.I.get_id(),type:a.u0.submap,info:{nodes:[],linkers:[],node_from:{},node_to:{}},css:{},attrs:{width:e,height:t}}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();return n[r]=i,t.id=i,g.I.replace_id(e,t.info.nodes,n),g.I.replace_id(e,t.info.linkers,n),t}}Mn([(0,k.H)(a.kU.node_add)],Tn.prototype,"on_node_add",null),Mn([(0,k.H)(a.kU.node_remove)],Tn.prototype,"on_node_remove",null),Mn([(0,k.H)(a.kU.linker_add)],Tn.prototype,"on_linker_add",null),Mn([(0,k.H)(a.kU.linker_remove)],Tn.prototype,"on_linker_remove",null);class Ln extends dn.M{_point_from={x:0,y:0};_point_to={x:0,y:0};_show=!1;pcube;sample=(0,l.Gc)([]);constructor(e,t){return super(e,t),this.pcube=t,this.setup(e,t)}_from_node=(0,c.EW)(()=>this.pcube.get_node(this.from_id));_to_node=(0,c.EW)(()=>this.pcube.get_node(this.to_id));_path=(0,c.EW)(()=>this.layout_self());get show(){return this._show}set show(e){this._show=e,e?this.pcube.set_graph_visible(this,!0):this.pcube.set_graph_visible(this,!1)}get info(){return this.data.info}get anchor_left(){return this.attrs.anchor_left||a._A.point}get anchor_right(){return this.attrs.anchor_right||a._A.arrow}get point_from(){return{...this._point_from}}get point_to(){return{...this._point_to}}get rect(){return{x:Math.min(this._point_from.x,this._point_to.x),y:Math.min(this._point_from.y,this._point_to.y),width:Math.abs(this._point_from.x-this._point_to.x),height:Math.abs(this._point_from.y-this._point_to.y)}}get component(){return Bt}get from_id(){return this.attrs.from}get to_id(){return this.attrs.to}get from_node(){return this._from_node.value}get to_node(){return this._to_node.value}export(){const e=this.base_export();return e.attrs.from=this.from_id,e.attrs.to=this.to_id,e}build_child(e){}update_data(e){return{usable:!0,data:e}}get meta(){return Ln.meta}get domain(){return"map"}get id(){return sn.U.get_linker_id(this.from_id,this.to_id)}get path(){return this._path.value}replace_id(e,t={}){return Ln.replace_id(this.root,e,t)}layout_self(){const e=this.from_node,t=this.to_node;if(!e||!t)return"";const n=this.attrs.type,r=an.find(e,t);if(r){this._point_from=r.from,this._point_to=r.to;const e=on.draw({type:n,...r});return this.sample=sn.U.svg_path_sample(e,8),e}return""}get_linker_info(){const e=this.from_node,t=this.to_node;if(!e||!t)return;const n=this.pcube.get_node_to(e.id),r=this.pcube.get_node_from(t.id),i=n?.indexOf(t.id)||-1,s=r?.indexOf(e.id)||-1;return{linker:this.export(),index_from:s,index_to:i}}get_upstream_sum_scale(){const e=[];let t=this.pcube;for(;t&&((t instanceof Tn||t instanceof rn)&&e.push(t),t.pcube);)t=t.pcube;let n=1,r=1;for(let t of e){const{a:e,d:i}=t.matrix2d;n*=e,r*=i}return{sx:n,sy:r}}check_show(e){return this.from_node?.show||this.to_node?.show?(this.show=!0,!0):(this.show=!1,!1)}on_linker_update(e){const{courier:t,history:n}=this,{attrs:r}=e,i=t.get_recorder();i.add_cmd(e);const s=structuredClone((0,l.ux)(this.data.attrs));Object.assign(this.attrs,r);const o=ln.update(this.id,s);return i.add_recover(o),i}get_link_right(){const e=this.from_node?.bound.get_bound_rect_point(N._RectPosition.right_mid),t=this.to_node?.bound.get_bound_rect_point(N._RectPosition.left_mid),n=this.attrs.type;return e&&t?"line"===n?on.line(e,t):"bezier2"===n?on.bezier2(e,t):on.line(e,t):""}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();return n[r]=i,t.id=i,t.attrs.from=n[t.attrs.from]||t.attrs.from,t.attrs.to=n[t.attrs.to]||t.attrs.to,t}static get meta(){return{cubename:"连接线",type:a.u0.linker,block:!1,version:1,show:!1}}static get_default(e,t,n){const{map_linker_anchor_left:r,map_linker_anchor_right:i,map_linker_line:s,map_linker_stroke:o,map_linker_stroke_width:l}=cn.B.config;return{id:sn.U.get_linker_id(e,t),type:a.u0.linker,info:{},attrs:{from:e,to:t,type:n||s,anchor_left:r,anchor_right:i,stroke:o,stroke_width:l},css:{}}}}function zn(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}!function(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);s>3&&o&&Object.defineProperty(t,n,o)}([(0,k.H)(a.Sd.update)],Ln.prototype,"on_linker_update",null);class An extends o.MR{_app;_interaction;_has_layout=(0,l.KR)(!1);data;nodes_test=(0,l.Gc)({});nodes=(0,l.Gc)({});node_from=(0,l.Kh)({});node_to=(0,l.Kh)({});node_editing=(0,l.Gc)(new Set);linkers=(0,l.Gc)({});nodes_selected=(0,l.Gc)(new Set);line_delete_selected=(0,l.Gc)(new Set);view_nodes=(0,l.Gc)(new Set);view_linkers=(0,l.Gc)(new Set);placeholder=(0,l.Kh)({linker:[],box_selector:"",line_delete:"",node:{x:0,y:0,width:0,height:0}});constructor(e){super();const t=this.update_data(e).data;this.data=(0,l.Kh)(t),this.node_to=this.data.info.node_to||{},this.node_from=this.data.info.node_from||{},this._interaction=new un.T(this),this.build_child(t),k.o.init_cmd_handler(this),A.K.add_map(this),this._app=ze(rn,{cube:this}),this.stats.view="map"}get perf(){return this.config.data.map_perf}get matrix2d(){return this.attrs.matrix2d}get attrs(){return this.data.attrs}get has_layout(){return this._has_layout.value}get dom_rect(){const e=this.dom;return e?e.getBoundingClientRect():new DOMRect(0,0,0,0)}get dom_svg_rect(){const e=this.dom?.getElementsByTagName("svg");return e?e[0].getBoundingClientRect():new DOMRect(0,0,0,0)}get interaction(){return this._interaction}get matrix2d_dom_string(){return sn.c.get_dom_string(this.matrix2d)}get domain(){return"map"}get app(){return this._app}get component(){return rn}get meta(){return An.meta}get children(){return[...this._children]}get_linker(e){return this.linkers[e]}get_node(e){return this.nodes[e]}get_node_from(e){return this.node_from[e]}get_node_to(e){return this.node_to[e]}get_view_rect(){const{clientHeight:e,clientWidth:t}=document.documentElement,n=this.dom_rect,r=Math.max(n.left,0),i=Math.min(n.right,t),s={x:r,y:Math.max(0,n.top)},o={x:i,y:Math.min(n.bottom,e)},a=this.view_point_to_real(s),l=this.view_point_to_real(o),c=l.x-a.x,d=l.y-a.y;return{x:a.x,y:a.y,width:c,height:d}}get_view_center(){const e=this.get_view_rect();return{x:e.x+e.width/2,y:e.y+e.height/2}}get_view_cube(){const e=this.get_view_rect(),t=[];for(let n of Object.values(this.nodes))N.MathRect.check_intersection(e,n.bound.rect)&&t.push(n);for(let n of Object.values(this.linkers))N.MathRect.check_intersection(e,n.rect)&&t.push(n);return t}find_layout_root(e){const t=new Set;for(let n of e){const e=n.layout_root;e&&t.add(e)}return t}get_farest_node_selected(e){if(0!==this.nodes_selected.size){if(e===a.tX.left){let e;for(let t of this.nodes_selected){const n=t.bound.rect;(!e||n.x<e.bound.pos.x)&&(e=t)}return e}if(e===a.tX.right){let e;for(let t of this.nodes_selected){const n=t.bound.rect,r=e?.bound.rect;(!r||n.x+n.width>r.x+r.width)&&(e=t)}return e}if(e===a.tX.down){let e;for(let t of this.nodes_selected){const n=t.bound.rect,r=e?.bound.rect;(!r||n.y+n.height>r.y+r.height)&&(e=t)}return e}if(e===a.tX.up){let e;for(let t of this.nodes_selected){const n=t.bound.rect,r=e?.bound.rect;(!r||n.y<r.y)&&(e=t)}return e}}}get_nearest_node(e,t){const n=e.bound.rect;let r=e,i=1/0;if(t===a.tX.left)for(let t of Object.values(this.nodes)){if(e===t)continue;const s=t.bound.rect;if(s.x>n.x||s.y+s.height<n.y||s.y>n.y+n.height)continue;const o=N.MathRect.distance_with(n,s);o<i&&(r=t,i=o)}else if(t===a.tX.right)for(let t of Object.values(this.nodes)){if(e===t)continue;let s=t.bound.rect;if(s.x+s.width<n.x+n.width||s.y+s.height<n.y||s.y>n.y+n.height)continue;const o=N.MathRect.distance_with(n,s);o<i&&(r=t,i=o)}else if(t===a.tX.up)for(let t of Object.values(this.nodes)){if(e===t)continue;let s=t.bound.rect;if(s.y>n.y||s.x>n.x+n.width||s.x+s.width<n.x)continue;const o=N.MathRect.distance_with(n,s);o<i&&(r=t,i=o)}else if(t===a.tX.down)for(let t of Object.values(this.nodes)){if(e===t)continue;let s=t.bound.rect;if(s.y+s.height<n.y+n.height||s.x>n.x+n.width||s.x+s.width<n.x)continue;const o=N.MathRect.distance_with(n,s);o<i&&(r=t,i=o)}return r}move_select(e){if(0===this.nodes_selected.size)return;const t=this.get_farest_node_selected(e);if(!t)return;const n=this.get_nearest_node(t,e);this.clear_node_selected(),this.register_node_selected(n),n.move_in_fig_view()}wait_nodes_render(e){return sn.U.wait_nodes_render(e)}find_cube(e){return this.cubes.find_cube(e)}filter(e){const t=[];for(let n of Object.values(this.linkers))e(n)&&t.push(n),t.push(...n.filter(e));for(let n of Object.values(this.nodes))e(n)&&t.push(n),t.push(...n.filter(e));return t}each(e){for(let t of Object.values(this.linkers))e(t),t.each(e);for(let t of Object.values(this.nodes))e(t),t.each(e)}find_child_cube(e){return this.nodes[e]||this.linkers[e]}register_node_editing(e){this.node_editing.add(e)}remove_node_editing(e){this.node_editing.delete(e)}toggle_node_editing(e){this.node_editing.has(e)?this.node_editing.delete(e):this.node_editing.add(e)}check_node_editing(){for(let e of this.node_editing)e.editable||this.remove_node_editing(e)}clear_node_editing(){for(let e of this.node_editing)e.editable=!1;this.node_editing.clear()}register_node_selected(e){this.nodes_selected.add(e)}unregister_node_selected(e){this.nodes_selected.delete(e)}toggle_node_selected(e){this.nodes_selected.has(e)?this.nodes_selected.delete(e):this.nodes_selected.add(e)}is_node_selected(e){return this.nodes_selected.has(e)}in_delete_line(e){return this.line_delete_selected.has(e)}put_delete_selected(e){this.line_delete_selected.add(e)}get_delete_selected(){return new Set(this.line_delete_selected)}clear_delete_line(){this.line_delete_selected.clear()}clear_node_selected(){this.nodes_selected.clear()}pick(...e){for(let t of e)t instanceof o.wP?(this.nodes[t.id]=t,t.show=!0):t instanceof Ln&&(this.linkers[t.id]=t,t.show=!0)}show_all(){for(let e of Object.values(this.nodes))this.view_nodes.add(e);for(let e of Object.values(this.linkers))this.view_linkers.add(e)}get_nodes_view(){return new Set(this.view_nodes)}get_linkers_view(){return new Set(this.view_linkers)}get_nodes_selected(){return new Set(this.nodes_selected)}get_nodes_all(){return[...Object.values(this.nodes)]}get_linkers_all(){return[...Object.values(this.linkers)]}get_nodes_intersection(e){let t=[];for(let n of Object.values(this.nodes)){const r=n.bound.rect;N.MathRect.check_intersection(e,r)&&t.push(n)}return t}set_graph_visible(e,t){t?e instanceof o.wP?this.view_nodes.add(e):e instanceof Ln&&this.view_linkers.add(e):e instanceof o.wP?this.view_nodes.delete(e):e instanceof Ln&&this.view_linkers.delete(e)}toggle_graph_visible(e){e instanceof o.wP?this.view_nodes.has(e)?this.view_nodes.delete(e):this.view_nodes.add(e):e instanceof Ln&&(this.view_linkers.has(e)?this.view_linkers.delete(e):this.view_linkers.add(e))}remove_node(e){delete this.nodes[e.id],this.view_nodes.delete(e),e.gc()}remove_linker(e){delete this.linkers[e.id],this.view_linkers.delete(e),e.gc()}async build_child(e){const{nodes:t,linkers:n}=e.info;console.time("🍋build-nodes");const r=g.I.build_cubes(t,this);console.timeEnd("🍋build-nodes");for(let e of r)this.nodes[e.id]=e,this.view_nodes=(0,l.Gc)(new Set(r));for(let e of n){const t=this.get_node(e.attrs.from),n=this.get_node(e.attrs.to);if(!t||!n)continue;const r=new Ln(e,this);this.linkers[r.id]=r,this.perf||this.view_linkers.add(r)}}layout(){console.time("🍋layout-nodes");const e=this.get_view_rect();for(let t of Object.values(this.nodes))t.is_layout_root&&t.attrs.layout&&t.layout(e);this.perf&&this.check_show_line(),console.timeEnd("🍋layout-nodes")}check_show(){this.perf&&(console.time("🍋动态显示检查"),this.check_show_node(),this.check_show_line(),console.timeEnd("🍋动态显示检查"))}check_show_line(){if(this.perf){this.view_linkers.clear();for(let e of this.view_nodes)e.check_show_line()}}check_show_node(){if(!this.perf)return;const e=this.get_view_rect();for(let t of Object.values(this.nodes))t.check_show(e)}layout_throttle=N.Notice.throttle(this.layout.bind(this),70);check_show_throttle=N.Notice.throttle(this.check_show.bind(this),100);check_show_line_throttle=N.Notice.throttle(this.check_show_line.bind(this),100);check_show_node_throttle=N.Notice.throttle(this.check_show_node.bind(this),100);gc(){}export(){const e=An.get_default();e.id=this.id,e.css=structuredClone((0,l.ux)(this.css)),e.attrs=structuredClone((0,l.ux)(this.attrs)),e.attrs.matrix2d={...this.matrix2d};const t=[],n=[];e.info={nodes:t,linkers:n,node_from:(0,l.ux)(this.node_from),node_to:(0,l.ux)(this.node_to)};for(let e of Object.values(this.nodes))t.push(e.export());for(let e of Object.values(this.linkers))n.push(e.export());return e}update_data(e){return e.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}async render(e){this._dom=e,this.app.mount(e),console.time("🍋wait-svg"),await $t.ps,console.timeEnd("🍋wait-svg"),console.time("🍋wait-nodes"),await sn.U.wait_nodes_render([...this.view_nodes]),console.timeEnd("🍋wait-nodes"),this.layout(),this._has_layout.value=!0;const t=this.dom?.querySelector(".note");this.event.emit_status_update(),t&&(this.hotkeys.listen(t),this.interaction.register(t))}on_node_add(e){const{data:t}=e,{cursor:n,courier:r,history:i}=this,s=r.get_recorder();s.add_cmd(e);const a=g.I.build_cubes(t,this);this.pick(...a);const l=t.map(e=>e.id);return s.add_recover(o.yc.node_remove(this.id,l)),Promise.resolve().then(async()=>{await sn.U.wait_nodes_render(a);const e=this.find_layout_root(a),t=this.get_view_rect();for(let n of e)n.layout_throttle(t)}),s}on_node_remove(e){const{data:t}=e,{courier:n,cursor:r,history:i}=this;if(0===t.length)return;const s=n.get_recorder();s.add_cmd(e);const a=[],l=new Set;for(let e of t){const t=this.get_node(e);if(!t)continue;a.push(t.export());const n=t.layout_root;n&&n!==t&&l.add(t.layout_root);for(let n of t.from){const t=this.get_linker_id(n,e);this.get_linker(t)&&s.tell(this,o.yc.linker_remove(this.id,[t]))}for(let e of t.to){const n=this.get_linker_id(t.id,e);this.get_linker(n)&&s.tell(this,o.yc.linker_remove(this.id,[n]))}this.remove_node(t)}s.add_recover(o.yc.node_add(this.id,a));const c=this.get_view_rect();for(let e of l)e.layout_throttle(c);return s}on_linker_add(e){const{data:t}=e,{courier:n,cursor:r,history:i}=this,s=n.get_recorder();s.add_cmd(e);const a=new Set,l=[];if(0===t.length)return;for(let e of t){const{index_to:t,index_from:n,linker:r}=e,i=new Ln(r,this),s=i.from_node,o=i.to_node;if(!s||!o)continue;this.pick(i);let c=this.node_from[i.to_id],d=this.node_to[i.from_id];c?c.indexOf(i.from_id)<0&&c.splice(n,0,i.from_id):this.node_from[i.to_id]=[i.from_id],d?d.indexOf(i.to_id)<0&&d.splice(t,0,i.to_id):this.node_to[i.from_id]=[i.to_id],l.unshift(i.id);const u=s.layout_root;u&&a.add(u)}s.add_recover(o.yc.linker_remove(this.id,l));const c=this.get_view_rect();for(let e of a)e.layout_throttle(c);return s}on_linker_remove(e){const{data:t}=e,{courier:n,cursor:r,history:i}=this;if(0===t.length)return;const s=n.get_recorder();s.add_cmd(e);const a=[],l=[];for(let e of t){const t=this.get_linker(e);if(!t)continue;const n=this.get_node(t.from_id);n&&l.push(n);const r=this.node_to[t.from_id],i=this.node_from[t.to_id];if(r&&i){const e=r.indexOf(t.to_id),n=i.indexOf(t.from_id);r.splice(e,1),i.splice(n,1),a.unshift({linker:t.export(),index_to:e,index_from:n})}this.remove_linker(t)}const c=this.find_layout_root(l),d=this.get_view_rect();for(let e of c)e.layout_throttle(d);return s.add_recover(o.yc.linker_add(this.id,a)),s}get_linker_id(e,t){return sn.U.get_linker_id(e,t)}replace_id(e,t={}){return An.replace_id(this.root,e,t)}reset_matrix(e){Object.assign(this.matrix2d,e),this.event.emit_status_update()}translate(e,t){const n=sn.c.multiply(this.matrix2d,sn.c.get_matrix_translate(e,t));this.reset_matrix(n)}scale_diff(e,t){this.matrix2d.a+=e,this.matrix2d.d+=t}scale_by_point(e,t,n){const{map_scale_max:r,map_scale_min:i}=this.config.data,s=this.matrix2d.a+t;if(s>r||s<i)return;const o=this.view_point_to_fig(e),a=this.untransform_point(o);this.matrix2d.a+=t,this.matrix2d.d+=n;const l=this.transform_point(a),c=o.x-l.x,d=o.y-l.y,u=sn.c.multiply(this.matrix2d,sn.c.get_matrix_translate(c,d));this.reset_matrix(u)}get_upstream_sum_scale(){return{sx:1,sy:1}}view_point_to_fig(e){const t=this.dom_svg_rect,{sx:n,sy:r}=this.get_upstream_sum_scale();let{x:i,y:s}=e;return{x:(i-t.x)/n,y:(s-t.y)/r}}view_point_to_real(e){const t=this.view_point_to_fig(e);return this.untransform_point(t)}fig_point_to_view(e){const t=this.dom_svg_rect;return{x:e.x+t.x,y:e.y+t.y}}fig_point_to_real(e){return this.untransform_point(e)}real_point_to_fig(e){return this.transform_point(e)}real_point_to_view(e){const t=this.real_point_to_fig(e);return this.fig_point_to_view(t)}transform_point(e){const{a:t,b:n,c:r,d:i,e:s,f:o}=this.matrix2d,{x:a,y:l}=e;return{x:t*a+r*l+s,y:n*a+i*l+o}}untransform_point(e){const{a:t,b:n,c:r,d:i,e:s,f:o}=this.matrix2d,{x:a,y:l}=e;return{x:(a-s-r*l)/t,y:(l-o-n*a)/i}}static get meta(){return{type:a.u0.map,cubename:"图形笔记",version:1,block:!0,show:!1}}static get_default(){return{id:g.I.get_id(),type:a.u0.map,versions:A.K.export_versions(),info:{nodes:[],linkers:[],node_from:{},node_to:{}},css:{},attrs:{matrix2d:sn.c.get_default()}}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();return n[r]=i,t.id=i,g.I.replace_id(e,t.info.nodes,n),g.I.replace_id(e,t.info.linkers,n),t}}zn([(0,k.H)(a.kU.node_add)],An.prototype,"on_node_add",null),zn([(0,k.H)(a.kU.node_remove)],An.prototype,"on_node_remove",null),zn([(0,k.H)(a.kU.linker_add)],An.prototype,"on_linker_add",null),zn([(0,k.H)(a.kU.linker_remove)],An.prototype,"on_linker_remove",null);class Rn{_observer;_nodes={};constructor(){this._observer=new ResizeObserver(this.watch.bind(this))}watch(e,t){for(let t of e){const e=t.target,n=t.target.dataset.id,r=this._nodes[n];r&&e.isConnected&&r.layout_self(t)}}register(e,t){const n=e.dataset.id;n&&(this._nodes[n]=t,this._observer.observe(e))}unregister(e){const t=e.dataset.id;t&&(delete this._nodes[t],e&&this._observer.unobserve(e))}}const Pn=new Rn,Nn=["id","data-type","transform","data-editing"],En=["d"],On=["x","y","width","height"],In=["data-id"],Bn={class:"node-status"},Dn=(0,c.pM)({__name:"cube-node",props:{cube:{}},setup(e){const{bound:t,shape:n}=e.cube,r=(0,l.KR)(),{map_node_padding:i}=e.cube.config.data;(0,c.sV)(()=>{const t=r.value;t&&Pn.register(t,e.cube)}),(0,c.xo)(()=>{const e=r.value;e&&Pn.unregister(e)});const s=(0,c.EW)(()=>({"node-selected":e.cube.pcube.is_node_selected(e.cube),"node-editable":e.cube.editable,"line-delete-selected":e.cube.pcube.in_delete_line(e.cube)}));function o(t,n){e.cube.event.emit_node_status_click(t,{node:e.cube,click:n})}return(e,i)=>((0,c.uX)(),(0,c.CE)("g",{id:e.cube.id,"data-type":(0,l.R1)(a.u0).node,class:(0,d.C4)(["cube-node",s.value]),transform:e.cube.matrix2d_dom_string,"data-editing":e.cube.editable},[(0,c.Lk)("path",{d:(0,l.R1)(n).path,ref:"p",style:(0,d.Tr)({fill:e.cube.attrs.fill})},null,12,En),((0,c.uX)(),(0,c.CE)("foreignObject",{x:(0,l.R1)(t).pos_cbox.x,y:(0,l.R1)(t).pos_cbox.y,width:(0,l.R1)(t).size.width,height:(0,l.R1)(t).size.height,style:(0,d.Tr)(e.cube.css)},[(0,c.Lk)("div",{class:"cube-node-box",ref_key:"box",ref:r,"data-id":e.cube.id},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.children,e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:e},null,8,["cube"]))),128)),(0,c.Lk)("div",Bn,[e.cube.is_layout_root?((0,c.uX)(),(0,c.CE)("div",{key:0,class:"iconfont icon-system-mind-map-filled",onClick:i[0]||(i[0]=e=>o(e,"root"))})):(0,c.Q3)("v-if",!0),e.cube.attrs.layout?((0,c.uX)(),(0,c.CE)("div",{key:1,class:(0,d.C4)(e.cube.icons[e.cube.attrs.layout]),onClick:i[1]||(i[1]=e=>o(e,"layout"))},null,2)):(0,c.Q3)("v-if",!0)])],8,In)],12,On))],10,Nn))}}),Vn=(0,m.A)(Dn,[["__scopeId","data-v-4f29a794"]]);class Hn extends o.wP{constructor(e,t){return super(e,t),this.setup(e,t)}get domain(){return"map"}get meta(){return Hn.meta}get component(){return Vn}build_child(e){this._children.push(...g.I.build_cubes(e.info,this))}update_data(e){return e.attrs.matrix&&(e.attrs.matrix2d=e.attrs.matrix,delete e.attrs.matrix),{usable:!0,data:e}}gc(){this.base_gc()}export(){const e=this.base_export();e.info=[],e.attrs=structuredClone((0,l.ux)(this.attrs)),e.attrs.matrix2d=this.matrix2d_real;for(let t of this._children)e.info.push(t.export());return e}replace_id(e,t={}){return Hn.replace_id(this.root,e,t)}static get meta(){return{cubename:"图形节点",type:a.u0.node,block:!0,version:1,show:!1}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();return n[r]=i,t.id=i,g.I.replace_id(e,t.info,n),t}static get_default(e,t="rect"){return{id:g.I.get_id(),type:a.u0.node,info:[yt.get_default()],attrs:{root:!1,matrix2d:{a:1,b:0,c:0,d:1,e:e.x,f:e.y},shape:t,layout:null},css:{}}}a(e=!0,t="time-down"){const{courier:n}=this,r=n.get_recorder(),i=o.Sv.layout_change(this.id,{root:e,layout:t});r.tell(this,i),this.history.record(r);const s=this.pcube.get_view_rect();this.layout_root?.layout(s)}}class jn{_cube;_size=(0,l.Kh)(o.wP.get_default_node_size());_size_bound=(0,c.EW)(()=>this.get_size_bound());_size_tree=(0,c.EW)(()=>this.get_size_tree());_pos_cbox=(0,c.EW)(()=>this.get_pos_cbox());_pos=(0,c.EW)(()=>this.get_pos());_pos_center=(0,c.EW)(()=>this.get_pos_center());_pos_tree=(0,c.EW)(()=>this.get_pos_tree());_layout_pos_tree;constructor(e,t){this._cube=e,this._layout_pos_tree=(0,l.Kh)({x:t.e,y:t.f})}get rect(){return{...this.pos,...this.size_bound}}get pos_tree(){return this._pos_tree.value}get matrix2d(){return this._cube.matrix2d}get config(){return this.cube.config}get cube(){return this._cube}get pcube(){return this.cube.pcube}get size(){return{...this._size}}get size_tree(){return this._size_tree.value}get size_bound(){return this._size_bound.value}get pos_raw(){return{x:this.matrix2d.e,y:this.matrix2d.f}}get pos(){return this._pos.value}get pos_center(){return this._pos_center.value}get pos_cbox(){return this._pos_cbox.value}get_size_tree(){const{map_node_hgap:e,map_node_vgap:t}=this.config.data;if(0===this.cube.count_to)return this.size_bound;const n=this.cube.layout_type,r=this.cube.get_layout_nodes(),i=this.size_bound;if(0===r.length)return this.size_bound;const{sum_tree_height:s,sum_tree_width:o,max_tree_height:a,max_tree_width:l,mw_rect:c,mh_rect:d}=this.stat_downstream_nodes_size(r);if("left"===n)return{width:i.width+e+l,height:Math.max(i.height,s)};if("right"===n)return{width:i.width+e+l,height:Math.max(i.height,s)};if("down"===n)return{width:Math.max(i.width,o),height:i.height+t+a};if("up"===n)return{width:Math.max(i.width,o),height:i.height+t+a};if("time-right"===n){const t=d.height,n=i.height;if(n<t||n>a)return{width:i.width+e+o,height:Math.max(a,n)};{const r=n/2;return{width:i.width+e+o,height:r+Math.max(a-t/2,r)}}}if("time-down"===n){const e=i.width/2,n=c.width/2;return{width:Math.max(e,n)+Math.max(e,l-n),height:i.height+t+s}}return i}get_rect(){return{...this.get_pos(),...this.get_size_bound()}}stat_downstream_nodes_size(e){const{map_node_hgap:t,map_node_vgap:n}=this.cube.config.data;let r=0,i=0,s=0,o=0,a={x:0,y:0,width:0,height:0},l={x:0,y:0,width:0,height:0};for(let t of e){const e=t.bound.size_tree;s+=e.height,o+=e.width,e.width>r&&(r=e.width,a=t.bound.rect),e.height>i&&(i=e.height,l=t.bound.rect)}return{max_tree_height:i,max_tree_width:r,sum_tree_height:s+(e.length-1)*n,sum_tree_width:o+(e.length-1)*t,mw_rect:a,mh_rect:l}}get_pos_cbox(){const e=this.cube.attrs.shape,{width:t,height:n}=this.size_bound,{map_node_padding:r}=this.cube.config.data,i=n/2;return"circle"===e?{x:t/2-this.size.width/2,y:i-this.size.height/2}:{x:r,y:r}}get_pos(){this.cube.attrs.shape;const e=this.size_tree,t=this.size_bound,n=this.pos_tree,r=this.cube.layout_type,i=this.matrix2d.e,s=this.matrix2d.f,o=this.cube.get_layout_nodes(),{sum_tree_height:a,sum_tree_width:l,max_tree_height:c,max_tree_width:d,mw_rect:u,mh_rect:h}=this.stat_downstream_nodes_size(o);if(this.cube.is_layout_root||!this.cube.layout_upstream)return{x:i,y:s};if("right"===r)return{x:n.x,y:n.y-t.height/2+e.height/2};if("left"===r)return{x:n.x+e.width-t.width,y:n.y+e.height/2-t.height/2};if("down"===r)return{x:n.x+e.width/2-t.width/2,y:n.y};if("up"===r)return{x:n.x+e.width/2-t.width/2,y:n.y+e.height-t.height};if("time-right"===r){const e=Math.max(h.height,t.height)/2;return{x:n.x,y:n.y+e-t.height/2}}if("time-down"===r){const e=Math.max(u.width,t.width)/2;return{x:n.x+e-t.width/2,y:n.y}}return{x:i,y:s}}get_pos_center(){const e=this.pos,{width:t,height:n}=this.size_bound;return{x:e.x+t/2,y:e.y+n/2}}get_pos_tree(){if(this.cube.layout_upstream)return this._layout_pos_tree;const e=this.cube.layout_type,t=this.size_bound,n=this.size_tree,r=this.matrix2d.e,i=this.matrix2d.f,s=r+t.width/2,o=i+t.height/2,a=this.cube.attrs.shape;if(!e)return{x:r,y:i};if("right"===e)return{x:r,y:i+t.height/2-n.height/2};if("left"===e)return{x:r+t.width-n.width,y:i+t.height/2-n.height/2};if("down"===e)return{x:r+t.width/2-n.width/2,y:i};if("up"===e)return{x:r+t.width/2-n.width/2,y:i+t.height-n.height};if("time-right"===e){const e={x:r,y:i};if("circle"===a){const e=Math.sqrt(t.width*t.width+(t.height+t.height))/2;return{x:s-e,y:o-e}}return e}if("time-down"===e)return{x:r,y:i};if("circle"===a){const e=Math.sqrt(t.width*t.width+(t.height+t.height))/2;return{x:s-e,y:o-e}}return{x:r,y:i}}get_size_bound_raw(){const{map_node_padding:e}=this.cube.config.data;return this.cube.attrs.shape,{width:this.size.width+2*e,height:this.size.height+2*e}}get_size_bound(){this.cube.shape.type;const{map_node_padding:e}=this.cube.config.data;return{width:this.size.width+2*e,height:this.size.height+2*e}}update_pos_tree(e,t){this._layout_pos_tree.x=e,this._layout_pos_tree.y=t}update_size(e,t){if(this._size.width=e,this._size.height=t,this.cube.pcube.has_layout&&!this.cube.clipboard.pasted_from){const e=this.cube.layout_root;if(e){const t=e.pcube.get_view_rect();e.layout_throttle(t)}}}get_bound_rect_point(e){const t={...this.pos,...this.size_bound};return N.MathRect.get_rect_point(t,e)}}class Fn{static get_shaple(e){const t=e.attrs.shape;return"rect"===t?this.rect(e):"circle"===t?this.circle(e):this.rect(e)}static rect(e,t=4,n=4){const{width:r,height:i}=e.bound.size,s=r+2*t,o=r+2*t,a=i+2*t,l=i+2*t;return`M${0+n} 0H${s-n}Q${s} 0 ${s} ${0+n}V${a-n}Q${o} ${a} ${o-n} ${a}H ${0+n}Q0 ${l} 0 ${l-n}V${0+n}Q0 0 ${0+n} 0Z`}static circle(e){const{width:t,height:n}=e.bound.size,r=Math.sqrt(t*t+n*n)/2;return`M${r} 0 A ${r} ${r} 0 1 0 ${r} ${2*r}A${r} ${r} 0 1 0 ${r} 0`}}class Un{static reset(e,t,n){return{id:e,name:a.tK.reset,args:t,funcs:n}}}let qn="";function $n(e,t){if(qn===t.funcname.text)return;qn=t.funcname.text;const{funcname:n,args:r,funcs:i,courier:s,history:o}=t,a=new _.vk(s),l=new Set,c=new Set;for(let e of n.children){if(!(e instanceof kt))continue;const t=e.text.trim();if(!t||""===t)continue;const n=Gn(t);for(let e of n.args)l.add(e);c.add(n.name)}const d=[],u=[],h=[...l],p=[...c];if(h.length===r.length)for(let e=0;e<r.length;e++)d.push({name:h[e],desc:r[e].desc.export()});else for(let e of h){const t=r.find(t=>t.name===e);if(t)d.push({name:e,desc:t.desc.export()});else{const t=kt.get_default(),n=kt.get_default();d.push({name:e,desc:Lt.get_default([t,n])})}}if(p.length===i.length)for(let e=0;e<i.length;e++)u.push({name:p[e],desc:i[e].desc.export()});else for(let e of p){const t=i.find(t=>t.name===e);if(t)u.push({name:e,desc:t.desc.export()});else{const t=kt.get_default(),n=kt.get_default();u.push({name:e,desc:Lt.get_default([t,n])})}}a.tell(t,Un.reset(t.id,d,u)),o.record(a)}function Gn(e){const t=e.replace("...",""),n=t.indexOf("("),r=t.indexOf(")"),i=t.indexOf("."),s={name:"",args:[]};if(s.name=i<0&&n>0?t.slice(0,n):i>0&&n>0?t.slice(i+1,n):t.slice(i+1),n<0||r<0)return s.name=t,s;const o=t.slice(n+1,r);for(let e of o.split(",")){let t=e.trim();t&&s.args.push(t)}return s}const Xn=["id","data-type"],Kn={class:"cube-api-content"},Wn={class:"api-description"},Yn={class:"arg-name"},Zn={class:"func-name"},Qn=(0,c.pM)({__name:"cube-api",props:{cube:{}},setup:e=>(e,t)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-api",id:e.cube.id,"data-type":(0,l.R1)(a.u0).api,style:(0,d.Tr)(e.cube.css),ref:"root"},[(0,c.Lk)("div",Kn,[(0,c.Lk)("div",{class:"header",onKeyup:t[0]||(t[0]=t=>(0,l.R1)($n)(t,e.cube))},[(0,c.bF)(S,{cube:e.cube.funcname},null,8,["cube"])],32),(0,c.Lk)("div",Wn,[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.args,e=>((0,c.uX)(),(0,c.CE)(c.FK,{key:e.desc.id},[(0,c.Lk)("div",Yn,(0,d.v_)(e.name),1),(0,c.bF)(S,{class:"arg-desc",cube:e.desc},null,8,["cube"]),(0,c.Q3)(' <component class=\'arg-desc\' :is="item.component" :cube="item" :id="item.id"></component> ')],64))),128)),((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.funcs,e=>((0,c.uX)(),(0,c.CE)(c.FK,{key:e.desc.id},[(0,c.Lk)("div",Zn,(0,d.v_)(e.name),1),(0,c.bF)(S,{class:"func-desc",cube:e.desc},null,8,["cube"]),(0,c.Q3)(' <component class=\'func-desc\' :is="item.component" :cube="item" :id="item.id"></component> ')],64))),128))])])],12,Xn))}),Jn=(0,m.A)(Qn,[["__scopeId","data-v-2f228956"]]);class er extends o._D{_component=Jn;funcname;args=(0,l.Gc)([]);funcs=(0,l.Gc)([]);constructor(e,t){return super(e,t),this.setup(e,t)}get component(){return this._component}get children(){const e=this.args.map(e=>e.desc),t=this.funcs.map(e=>e.desc);return[this.funcname,...e,...t]}get meta(){return er.meta}get is_empty(){return 1===this.funcname.child_count&&this.funcname.child_first.is_empty}splice(e,t,...n){const r=this._children.splice(e,t,...n);for(let e of r)e.gc();const i=[];for(let e of r)e instanceof o._D&&i.push(e.export());return{children:r,data:i}}replace_id(e,t={}){return er.replace_id(this.root,e,t)}build_child(e){this.funcname=new Lt(e.info.names,this),this.build_desc(this.info.args,this.info.funcs)}gc(){super.base_gc()}export(){const e=this.base_export();return e.info.names=this.funcname.export(),e.info.args=this.get_args_data(),e.info.funcs=this.get_funcs_data(),e}build_desc(e,t){for(let e of this.args)e.desc.gc();for(let e of this.funcs)e.desc.gc();this.args.length=0,this.funcs.length=0;for(let t of e){const e={name:t.name,desc:new Lt(t.desc,this)};this.args.push(e)}for(let e of t){const t={name:e.name,desc:new Lt(e.desc,this)};this.funcs.push(t)}}get_args_data(){const e=[];for(let t of this.args){const n={name:t.name,desc:t.desc.export()};e.push(n)}return e}get_funcs_data(){const e=[];for(let t of this.funcs){const n={name:t.name,desc:t.desc.export()};e.push(n)}return e}reset_api(e){const{courier:t,history:n}=this,{args:r,funcs:i}=e,s=t.get_recorder();s.add_cmd(e);const o=structuredClone(this.get_args_data()),a=structuredClone(this.get_funcs_data());return this.build_desc(r,i),s.add_recover(Un.reset(this.id,o,a)),s}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}static get meta(){return{type:a.u0.api,version:1,cubename:"Api",block:!0,show:!0}}static get_default(e=[],t={},n={}){const r=[];for(let t of e)r.push(kt.get_default_by_string(t));return{id:(0,s.Ak)(),type:a.u0.api,info:{names:Lt.get_default(r),args:[],funcs:[]},css:t,attrs:n}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i,t.info.names=Lt.replace_id(e,t.info.names,n);for(let r of t.info.args)r.desc=Lt.replace_id(e,r.desc,n);for(let r of t.info.funcs)r.desc=Lt.replace_id(e,r.desc,n);return t}}function tr(e,t="tail"){const{courier:n,history:r}=e,i=new _.vk(n),s=[Lt.get_default(),Lt.get_default()],o=nr.insert_row(e.id,t,[s]);i.tell(e,o),r.record(i)}!function(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);s>3&&o&&Object.defineProperty(t,n,o)}([(0,k.H)(a.tK.reset)],er.prototype,"reset_api",null);class nr{static insert_row(e,t,n){return{id:e,name:a.J8.insert_row,pos:t,rows:n}}static remove_row(e,t,n=!1){return{id:e,name:a.J8.remove_row,range:t,reserve:n}}static change_width_col1(e,t){return{id:e,width:t,name:a.J8.change_width_col1}}}const rr=["id","data-type"],ir=(0,c.pM)({__name:"cube-detail-list",props:{cube:{}},setup(e){const t=e.cube.root,n=(0,c.rk)("root"),r=(0,l.KR)();(0,c.sV)(()=>{const i=r.value,s=n.value;if(!i)return;const o=new N.DragDiff(i);let a=e.cube.attrs.width_col1,l=a;o.register_down(()=>{a=e.cube.attrs.width_col1}),o.register_move((e,n)=>{t.stats.is_read_mode||(l=Math.round(e+a),s?.style.setProperty("--width-col1",l+"px"))}),o.register_up((n,r)=>{if(t.stats.is_read_mode)return;if(a===l)return;const i=e.cube.courier.get_recorder(),s=Math.round(n+a);i.tell(e.cube,nr.change_width_col1(e.cube.id,s)),e.cube.history.record(i)}),o.register_cancel(()=>{e.cube.attrs.width=a,i.style.left=a-2+"px"})});const i=(0,c.EW)(()=>({...e.cube.css,"--width-col1":e.cube.attrs.width_col1+"px"}));return(t,s)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-detail-list",id:t.cube.id,"data-type":(0,l.R1)(a.u0).detail_list,ref_key:"root",ref:n,style:(0,d.Tr)(i.value),onContextmenu:s[1]||(s[1]=e=>(0,l.R1)(pt.uz)(e,t.cube))},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(t.cube.children,t=>((0,c.uX)(),(0,c.Wv)(S,{key:t.id,cube:t,onKeydown:n=>function(t,n){t.ctrlKey&&!t.shiftKey&&"Enter"===t.key?(t.stopPropagation(),tr(e.cube,Math.floor(n.index/2)+1)):t.ctrlKey&&t.shiftKey&&"Enter"===t.key&&(t.stopPropagation(),tr(e.cube,Math.floor(n.index/2)))}(n,t)},null,8,["cube","onKeydown"]))),128)),(0,c.Lk)("div",{class:"adder-wrap",onClick:s[0]||(s[0]=()=>(0,l.R1)(tr)(t.cube))},[...s[2]||(s[2]=[(0,c.Lk)("div",{class:"adder"},null,-1)])]),(0,c.Lk)("div",{class:"adjuster",ref_key:"adjuster",ref:r},null,512)],44,rr))}}),sr=(0,m.A)(ir,[["__scopeId","data-v-6b68d605"]]),or=[function(e,t){return t>=2||e.attrs.width_col1||(e.attrs.width_col1=150),e}];function ar(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class lr extends o._D{rows;_component=sr;constructor(e,t){return super(e,t),this.rows=(0,l.Gc)([]),this.setup(e,t)}get component(){return this._component}get children(){const e=[];for(let t of this.rows)e.push(...t);return e}get attrs(){return this.data.attrs}get css_col1(){return this.attrs.width_col1||(this.attrs.width_col1=150),{width:this.attrs.width_col1+"px"}}get is_empty(){return!1}get row_count(){return this.rows.length}get col1(){return this.rows.map(e=>e[0])}get col2(){return this.rows.map(e=>e[1])}get meta(){return lr.meta}update_data(e){return function(e,t){const n=t[lr.meta.type];return n>lr.meta.version?{data:e,usable:!1}:{data:or.reduce((e,t)=>t(e,n),e),usable:!0}}(e,this.root.versions)}build_child(e){for(let t of e.info){const e=new Lt(t[0],this),n=new Lt(t[1],this);this.rows.push([e,n])}}copy(e,t){if(e===t)return[this.children[e].export()];const n=Math.floor(e/2),r=Math.floor((t-1)/2),i=lr.get_default();i.info=[];for(let e=n;e<=r;e++){const t=this.rows[e];if(!t)continue;const n=[t[0].export(),t[1].export()];i.info.push(n)}return 0===i.info.length?[]:[i]}gc(){super.base_gc()}export(){const e=this.base_export();e.css=structuredClone((0,l.ux)(this.css)),e.attrs=structuredClone((0,l.ux)(this.attrs)),e.info=[];for(let[t,n]of this.rows){const r=t.export(),i=n.export();e.info.push([r,i])}return e}replace_id(e,t={}){return lr.replace_id(this.root,e,t)}splice_rows(e,t,...n){const r=this.rows.splice(e,t,...n);for(let[e,t]of r)e.gc(),t.gc();return r}check_delete_edge(e){return 0==e.index%2&&!!e.is_empty}insert_row(e){const{courier:t}=this,{pos:n,rows:r}=e,i=t.get_recorder();i.add_cmd(e);const s=[];for(let[e,t]of r)s.push([new Lt(e,this),new Lt(t,this)]);let o=[0,0];return"tail"===n?(o=[this.row_count,this.row_count+s.length],this.rows.push(...s)):"head"===n?(o=[0,0+s.length],this.rows.unshift(...s)):(o=[n,n+s.length],this.splice_rows(n,0,...s)),i.add_recover(nr.remove_row(this.id,o)),i}remove_row(e){const{courier:t,cursor:n}=this,{range:r,reserve:i}=e,s=new _.vk(t);let[a,l]=r;if(a<0&&(a=0),l>this.row_count&&(l=this.row_count),0===a&&l>=this.row_count)if(i){if(this.is_empty)return;s.tell(this,nr.remove_row(this.id,[1,this.child_count]));const e=this.child_first,t=e.next_cube;t&&s.tell(t,o.VL.delete_child(t.id,"backward",[0,t.child_count],!0)),e&&s.tell(e,o.VL.delete_child(e.id,"backward",[0,e.child_count],!0))}else s.merge(this.remove_self());else{const e=this.rows[a-1]?.[1],t=this.rows[l+1]?.[1],n=this.splice_rows(a,l-a),r=[];for(let[e,t]of n)r.push([e.export(),t.export()]);s.add_recover(nr.insert_row(this.id,a,r)),e?s.tell(e,o.UB.in_tail(e.id,0,void 0)):t&&s.tell(t,o.UB.in_head(t.id,0,void 0))}return s}change_width_col1(e){const{width:t}=e,{courier:n,id:r}=this,i=n.get_recorder();i.add_cmd(e);const s=this.attrs.width_col1;return this.attrs.width_col1=t,this.dom?.style.setProperty("--width-col1",t+"px"),i.add_recover(nr.change_width_col1(r,s)),i}delete_cube(e){const{courier:t,pid:n,index:r,pcube:i}=this,{dir:s,range:o,reserve:a}=e,[l,c]=o,d=Math.floor(l/2),u=Math.floor((c-1)/2),h=(this.children[l],nr.remove_row(this.id,[d,u+1],a));return this.remove_row(h)}static get meta(){return{type:x.u0.detail_list,version:2,cubename:"清单",block:!0,show:!0}}static get_default(e=[],t={},n={}){const r=0===e.length?[[Lt.get_default(),Lt.get_default()]]:e;return{id:(0,s.Ak)(),type:x.u0.detail_list,info:r,css:t,attrs:{width_col1:150}}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i;const s=[];for(let r of t.info)s.push([Lt.replace_id(e,r[0],n),Lt.replace_id(e,r[1],n)]);return t.info=s,t}}ar([(0,k.H)(a.J8.insert_row)],lr.prototype,"insert_row",null),ar([(0,k.H)(a.J8.remove_row)],lr.prototype,"remove_row",null),ar([(0,k.H)(a.J8.change_width_col1)],lr.prototype,"change_width_col1",null),ar([(0,k.H)(a.zS.cube_delete_child)],lr.prototype,"delete_cube",null);class cr{static add(e,t,n){return{id:e,name:a.Ny.add,data:t,pos:n}}static remove(e,t){return{id:e,name:a.Ny.remove,range:t}}static indent(e,t){return{id:e,name:a.Ny.indent,items:t}}static status(e,t,n){return{id:e,name:a.Ny.status,index:t,done:n}}}const dr=["id","data-type"],ur=["onClick"],hr=(0,c.pM)({__name:"cube-todo",props:{cube:{}},setup(e){const{root:t}=e.cube,{config:n}=t;return(t,r)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-todo",id:t.cube.id,style:(0,d.Tr)(t.cube.css),"data-type":(0,l.R1)(a.u0).todo,onContextmenu:r[0]||(r[0]=e=>(0,l.R1)(pt.uz)(e,t.cube))},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(t.cube.items,(r,i)=>((0,c.uX)(),(0,c.CE)("div",{key:r.data.id,class:"todoitem",style:(0,d.Tr)({"margin-left":r.indent*(0,l.R1)(n).data.line_indent+"px"})},[(0,c.Lk)("div",{class:(0,d.C4)(["todoitem-status",{active:r.done}]),onClick:()=>function(t,n){const r=cr.status(e.cube.id,n,!t.done),i=e.cube.courier.get_recorder();i.tell(e.cube,r),e.cube.history.record(i)}(r,i)},null,10,ur),(0,c.bF)(S,{class:"todoitem-box",cube:r.data,onKeydown:e=>function(e,t,n,r){const{courier:i,history:s,cursor:o}=t,{indent:a}=n,l=n.data;if(e.ctrlKey&&!e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=i.get_recorder(),o=t.create_item_data(a);n.tell(t,cr.add(t.id,[o],r+1)),s.record(n)}else if(e.ctrlKey&&e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=i.get_recorder(),o=t.create_item_data(a);n.tell(t,cr.add(t.id,[o],r)),s.record(n)}else if("Tab"!==e.key||e.shiftKey){if("Tab"===e.key&&e.shiftKey){e.stopPropagation(),e.preventDefault();const{cube_start:n,cube_end:r}=o,a=i.get_recorder();if(n&&r){const e=n.find_upstream_untill(t),i=r.find_upstream_untill(t);if(!e||!i)return;const o=t.items.slice(e.index,i.index+1),l=[];for(let e of o)l.push({id:e.data.id,indent:!1});a.tell(t,cr.indent(t.id,l)),s.record(a)}else{const e=[{id:l.id,indent:!1}];a.tell(t,cr.indent(t.id,e)),s.record(a)}}}else{e.stopPropagation(),e.preventDefault();const{cube_start:n,cube_end:r}=o,a=i.get_recorder();if(n&&r){const e=n.find_upstream_untill(t),i=r.find_upstream_untill(t);if(!e||!i)return;const o=t.items.slice(e.index,i.index+1),l=[];for(let e of o)l.push({id:e.data.id,indent:!0});a.tell(t,cr.indent(t.id,l)),s.record(a)}else{const e=[{id:l.id,indent:!0}];a.tell(t,cr.indent(t.id,e)),s.record(a)}}}(e,t.cube,r,i)},null,8,["cube","onKeydown"])],4))),128))],44,dr))}}),pr=(0,m.A)(hr,[["__scopeId","data-v-33222767"]]);function mr(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class fr extends o._D{_component=pr;items=(0,l.Kh)([]);get component(){return this._component}get children(){return[...this.items.map(e=>e.data)]}constructor(e,t){return super(e,t),this.setup(e,t)}get meta(){return fr.meta}get info(){return this.data.info}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}build_child(e){for(let t of e.info){let e=new Lt(t.data,this),n={done:t.done,indent:t.indent,data:(0,l.IG)(e)};this.items.push(n)}}export(){const e=this.base_export();e.info=[];for(let t of this.items)e.info.push({done:t.done,indent:t.indent,data:t.data.export()});return e}gc(){return super.base_gc()}copy(e,t){const n=super.base_export();n.info=[];const r=this.items.slice(e,t);for(let e of r)n.info.push({done:e.done,indent:e.indent,data:e.data.export()});return[n]}splice(e,t,...n){const r=this.items.splice(e,t,...n),i=[];for(let e of r)e.data.gc(),i.push({done:e.done,indent:e.indent,data:e.data.export()});return{children:r,data:i}}replace_id(e,t={}){return fr.replace_id(this.root,e,t)}create(e){const t=[];for(let n of e){let e=new Lt(n.data,this);t.push({done:n.done,indent:n.indent,data:e})}return t}create_item_data(e=0){return{done:!1,indent:e,data:Lt.get_default()}}add_item(e){const{data:t,pos:n}=e,{courier:r,pcube:i}=this,s=r.get_recorder();s.add_cmd(e);const a=this.get_valid_index(n),c=[];for(let e of t){const t=new Lt(e.data,this);let n={done:e.done,indent:e.indent,data:(0,l.IG)(t)};c.push(n)}this.splice(a,0,...c);const d=c[c.length-1]?.data;return d&&s.tell(d,o.UB.in_tail(d.id,void 0)),s.add_recover(cr.remove(this.id,[a,a+c.length])),s}remove_item(e){const{range:t}=e,{courier:n,pcube:r}=this,i=n.get_recorder();i.add_cmd(e);const[s,a]=t;if(s<=0&&a>=this.child_count)return this.remove_self();const l=t[1]-t[0],c=this.items[s-1]?.data,d=this.items[a+1]?.data,u=this.splice(s,l);return i.add_recover(cr.add(this.id,u.data,s)),c?i.tell(c,o.UB.in_tail(c.id,0,void 0)):d&&i.tell(d,o.UB.in_head(d.id,0,void 0)),i}indent_todoitem(e){const{items:t}=e,{courier:n}=this,r=n.get_recorder();r.add_cmd(e);const i=[];for(let e of t){let t=this.items.find(t=>t.data.id===e.id);t&&(t.indent=e.indent?t.indent+1:t.indent-1,t.indent<0&&(t.indent=0),i.push({id:e.id,indent:!e.indent}))}return r.add_recover(cr.indent(this.id,i)),r}update_status(e){const{courier:t}=this,{index:n,done:r}=e,i=t.get_recorder();i.add_cmd(e);const s=this.items[n];if(s)return s.done=r,i.add_recover(cr.status(this.id,n,!r)),i}on_delete_child(e){const{courier:t,pid:n,index:r,pcube:i}=this,{dir:s,range:o}=e,a=cr.remove(this.id,o);return this.remove_item(a)}static get_default(){let e=Lt.get_default();return{id:(0,s.Ak)(),type:a.u0.todo,info:[{done:!1,indent:0,data:e}],attrs:{},css:{}}}static get_todo_item(e,t=!1){const n=g.I.pick(e).sort;return{done:t,indent:0,data:Lt.get_default(n)}}static get meta(){return{cubename:"待办列表",type:a.u0.todo,block:!0,version:1,show:!0}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i;for(let r of t.info)r.data=Lt.replace_id(e,r.data,n);return t}}mr([(0,k.H)(a.Ny.add)],fr.prototype,"add_item",null),mr([(0,k.H)(a.Ny.remove)],fr.prototype,"remove_item",null),mr([(0,k.H)(a.Ny.indent)],fr.prototype,"indent_todoitem",null),mr([(0,k.H)(a.Ny.status)],fr.prototype,"update_status",null),mr([(0,k.H)(a.zS.cube_delete_child)],fr.prototype,"on_delete_child",null);var _r=n(3431);const gr=["id","data-type"],br=(0,c.pM)({__name:"cube-list",props:{cube:{}},setup(e){const{config:t}=e.cube;return(e,n)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-list",id:e.cube.id,style:(0,d.Tr)(e.cube.css),"data-type":(0,l.R1)(a.u0).list,onContextmenu:n[0]||(n[0]=t=>(0,l.R1)(pt.uz)(t,e.cube))},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.items,(r,i)=>((0,c.uX)(),(0,c.CE)("div",{key:r.data.id,class:"listitem",style:(0,d.Tr)({"margin-left":r.indent*(0,l.R1)(t).data.line_indent+"px"})},[n[1]||(n[1]=(0,c.Lk)("div",{class:"listitem-symbol"},null,-1)),(0,c.bF)(S,{class:"listitem-box",cube:r.data,onKeydown:t=>function(e,t,n,r){const{courier:i,history:s,cursor:o}=t,{data:a,indent:l}=n,c=a;if(e.ctrlKey&&!e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=i.get_recorder(),o=t.create_item_data(l);n.tell(t,_r.o.add(t.id,[o],r+1)),s.record(n)}else if(e.ctrlKey&&e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=i.get_recorder(),o=t.create_item_data(l);n.tell(t,_r.o.add(t.id,[o],r)),s.record(n)}else if("Tab"!==e.key||e.shiftKey){if("Tab"===e.key&&e.shiftKey){e.stopPropagation(),e.preventDefault();const{cube_start:n,cube_end:r}=o,a=i.get_recorder();if(n&&r){const e=n.find_upstream_untill(t),i=r.find_upstream_untill(t);if(!e||!i)return;const o=t.items.slice(e.index,i.index+1),l=[];for(let e of o)l.push({id:e.data.id,indent:!1});a.tell(t,_r.o.indent(t.id,l)),s.record(a)}else{const e=[{id:c.id,indent:!1}];a.tell(t,_r.o.indent(t.id,e)),s.record(a)}}}else{e.stopPropagation(),e.preventDefault();const{cube_start:n,cube_end:r}=o,a=i.get_recorder();if(n&&r){const e=n.find_upstream_untill(t),i=r.find_upstream_untill(t);if(!e||!i)return;const o=t.items.slice(e.index,i.index+1),l=[];for(let e of o)l.push({id:e.data.id,indent:!0});a.tell(t,_r.o.indent(t.id,l)),s.record(a)}else{const e=[{id:c.id,indent:!0}];a.tell(t,_r.o.indent(t.id,e)),s.record(a)}}}(t,e.cube,r,i)},null,8,["cube","onKeydown"])],4))),128))],44,gr))}}),yr=(0,m.A)(br,[["__scopeId","data-v-4c4b9f9c"]]);function vr(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class wr extends o._D{_component=yr;items=(0,l.Kh)([]);get component(){return this._component}get children(){return[...this.items.map(e=>e.data)]}constructor(e,t){return super(e,t),this.setup(e,t)}get meta(){return wr.meta}get info(){return this.data.info}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}build_child(e){for(let t of e.info){let e=new Lt(t.data,this),n={indent:t.indent,data:(0,l.IG)(e)};this.items.push(n)}}export(){const e=this.base_export();e.info=[];for(let t of this.items)e.info.push({indent:t.indent,data:t.data.export()});return e}gc(){return super.base_gc()}copy(e,t){const n=super.base_export();n.info=[];const r=this.items.slice(e,t);for(let e of r)n.info.push({indent:e.indent,data:e.data.export()});return[n]}splice(e,t,...n){const r=this.items.splice(e,t,...n),i=[];for(let e of r)e.data.gc(),i.push({indent:e.indent,data:e.data.export()});return{children:r,data:i}}replace_id(e,t={}){return wr.replace_id(this.root,e,t)}create(e){const t=[];for(let n of e){let e=new Lt(n.data,this);t.push({indent:n.indent,data:e})}return t}create_item_data(e=0){return{indent:e,data:Lt.get_default()}}add_item(e){const{data:t,pos:n}=e,{courier:r,pcube:i}=this,s=r.get_recorder();s.add_cmd(e);const a=this.get_valid_index(n),c=[];for(let e of t){const t=new Lt(e.data,this);let n={indent:e.indent,data:(0,l.IG)(t)};c.push(n)}this.splice(a,0,...c);const d=c[c.length-1]?.data;return d&&s.tell(d,o.UB.in_tail(d.id,void 0)),s.add_recover(_r.o.remove(this.id,[a,a+c.length])),s}remove_item(e){const{range:t}=e,{courier:n,pcube:r}=this,i=n.get_recorder();i.add_cmd(e);const[s,a]=t;if(0===s&&a>=this.child_count)return this.remove_self();const l=t[1]-t[0],c=this.items[s-1]?.data,d=this.items[a+1]?.data,u=this.splice(s,l);return i.add_recover(_r.o.add(this.id,u.data,s)),c?i.tell(c,o.UB.in_tail(c.id,0,void 0)):d&&i.tell(d,o.UB.in_head(d.id,0,void 0)),i}indent_item(e){const{items:t}=e,{courier:n}=this,r=n.get_recorder();r.add_cmd(e);const i=[];for(let e of t){let t=this.items.find(t=>t.data.id===e.id);t&&(t.indent=e.indent?t.indent+1:t.indent-1,t.indent<0&&(t.indent=0),i.push({id:e.id,indent:!e.indent}))}return r.add_recover(_r.o.indent(this.id,i)),r}on_delete_child(e){const{courier:t,pid:n,index:r,pcube:i}=this,{dir:s,range:o}=e,a=_r.o.remove(this.id,o);return this.remove_item(a)}static get_default(){let e=Lt.get_default();return{id:(0,s.Ak)(),type:a.u0.list,info:[{indent:0,data:e}],attrs:{},css:{}}}static get_list_item(e){return{indent:0,data:Lt.get_default(g.I.pick(e).sort)}}static get meta(){return{cubename:"列表",type:a.u0.list,block:!0,version:1,show:!0}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i;for(let r of t.info)r.data=Lt.replace_id(e,r.data,n);return t}}vr([(0,k.H)(a.JC.add)],wr.prototype,"add_item",null),vr([(0,k.H)(a.JC.remove)],wr.prototype,"remove_item",null),vr([(0,k.H)(a.JC.indent)],wr.prototype,"indent_item",null),vr([(0,k.H)(a.zS.cube_delete_child)],wr.prototype,"on_delete_child",null);class xr{static add(e,t,n){return{id:e,name:a.mM.add,data:t,pos:n}}static remove(e,t){return{id:e,name:a.mM.remove,range:t}}static indent(e,t){return{id:e,name:a.mM.indent,items:t}}}const kr=["id","data-type"],Sr={class:"listitem-symbol"},Cr=(0,c.pM)({__name:"cube-list-ordered",props:{cube:{}},setup(e){const{root:t}=e.cube,{config:n}=t;return(e,t)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-list-ordered",id:e.cube.id,style:(0,d.Tr)(e.cube.css),"data-type":(0,l.R1)(a.u0).list_ordered,onContextmenu:t[0]||(t[0]=t=>(0,l.R1)(pt.uz)(t,e.cube))},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.items,(t,r)=>((0,c.uX)(),(0,c.CE)("div",{key:t.data.id,class:"listitem",style:(0,d.Tr)({"margin-left":t.indent*(0,l.R1)(n).data.line_indent+"px"})},[(0,c.Lk)("div",Sr,(0,d.v_)(r+1),1),(0,c.bF)(S,{class:"listitem-box",cube:t.data,onKeydown:n=>function(e,t,n,r){const{courier:i,history:s,cursor:o}=t,{data:a,indent:l}=n,c=a;if(e.ctrlKey&&!e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=i.get_recorder(),o=t.create_item_data(l);n.tell(t,xr.add(t.id,[o],r+1)),s.record(n)}else if(e.ctrlKey&&e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=i.get_recorder(),o=t.create_item_data(l);n.tell(t,xr.add(t.id,[o],r)),s.record(n)}else if("Tab"!==e.key||e.shiftKey){if("Tab"===e.key&&e.shiftKey){e.stopPropagation(),e.preventDefault();const{cube_start:n,cube_end:r}=o,a=i.get_recorder();if(n&&r){const e=n.find_upstream_untill(t),i=r.find_upstream_untill(t);if(!e||!i)return;const o=t.items.slice(e.index,i.index+1),l=[];for(let e of o)l.push({id:e.data.id,indent:!1});a.tell(t,xr.indent(t.id,l)),s.record(a)}else{const e=[{id:c.id,indent:!1}];a.tell(t,xr.indent(t.id,e)),s.record(a)}}}else{e.stopPropagation(),e.preventDefault();const{cube_start:n,cube_end:r}=o,a=i.get_recorder();if(n&&r){const e=n.find_upstream_untill(t),i=r.find_upstream_untill(t);if(!e||!i)return;const o=t.items.slice(e.index,i.index+1),l=[];for(let e of o)l.push({id:e.data.id,indent:!0});a.tell(t,xr.indent(t.id,l)),s.record(a)}else{const e=[{id:c.id,indent:!0}];a.tell(t,xr.indent(t.id,e)),s.record(a)}}}(n,e.cube,t,r)},null,8,["cube","onKeydown"])],4))),128))],44,kr))}}),Mr=(0,m.A)(Cr,[["__scopeId","data-v-743fd90a"]]);function Tr(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class Lr extends o._D{items=(0,l.Kh)([]);get component(){return Mr}get children(){return[...this.items.map(e=>e.data)]}constructor(e,t){return super(e,t),this.setup(e,t)}get meta(){return Lr.meta}get info(){return this.data.info}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}build_child(e){for(let t of e.info){let e=new Lt(t.data,this),n={indent:t.indent,data:(0,l.IG)(e)};this.items.push(n)}}export(){const e=super.base_export();e.info=[];for(let t of this.items)e.info.push({indent:t.indent,data:t.data.export()});return e}gc(){return super.base_gc()}copy(e,t){const n=super.base_export();n.info=[];const r=this.items.slice(e,t);for(let e of r)n.info.push({indent:e.indent,data:e.data.export()});return[n]}splice(e,t,...n){const r=this.items.splice(e,t,...n),i=[];for(let e of r)e.data.gc(),i.push({indent:e.indent,data:e.data.export()});return{children:r,data:i}}replace_id(e,t={}){return Lr.replace_id(this.root,e,t)}create(e){const t=[];for(let n of e){let e=new Lt(n.data,this);t.push({indent:n.indent,data:e})}return t}create_item_data(e=0){return{indent:e,data:Lt.get_default()}}add_item(e){const{data:t,pos:n}=e,{courier:r,pcube:i}=this,s=r.get_recorder();s.add_cmd(e);const a=this.get_valid_index(n),c=[];for(let e of t){const t=new Lt(e.data,this);let n={indent:e.indent,data:(0,l.IG)(t)};c.push(n)}this.splice(a,0,...c);const d=c[c.length-1]?.data;return d&&s.tell(d,o.UB.in_tail(d.id,void 0)),s.add_recover(xr.remove(this.id,[a,a+c.length])),s}remove_item(e){const{range:t}=e,{courier:n,pcube:r}=this,i=n.get_recorder();i.add_cmd(e);const[s,a]=t;if(0===s&&a>=this.child_count)return this.remove_self();const l=t[1]-t[0],c=this.items[s-1]?.data,d=this.items[a+1]?.data,u=this.splice(s,l);return i.add_recover(xr.add(this.id,u.data,s)),c?i.tell(c,o.UB.in_tail(c.id,0,void 0)):d&&i.tell(d,o.UB.in_head(d.id,0,void 0)),i}indent_item(e){const{items:t}=e,{courier:n}=this,r=n.get_recorder();r.add_cmd(e);const i=[];for(let e of t){let t=this.items.find(t=>t.data.id===e.id);t&&(t.indent=e.indent?t.indent+1:t.indent-1,t.indent<0&&(t.indent=0),i.push({id:e.id,indent:!e.indent}))}return r.add_recover(xr.indent(this.id,i)),r}on_delete_child(e){const{courier:t,pid:n,index:r,pcube:i}=this,{dir:s,range:o}=e,a=xr.remove(this.id,o);return this.remove_item(a)}static get_default(){let e=Lt.get_default();return{id:g.I.get_id(),type:a.u0.list_ordered,info:[{indent:0,data:e}],attrs:{},css:{}}}static get_list_item(e){return{indent:0,data:Lt.get_default(g.I.pick(e).sort)}}static get meta(){return{cubename:"有序列表",type:a.u0.list_ordered,block:!0,version:1,show:!0}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i;for(let r of t.info)r.data=Lt.replace_id(e,r.data,n);return t}}Tr([(0,k.H)(a.mM.add)],Lr.prototype,"add_item",null),Tr([(0,k.H)(a.mM.remove)],Lr.prototype,"remove_item",null),Tr([(0,k.H)(a.mM.indent)],Lr.prototype,"indent_item",null),Tr([(0,k.H)(a.zS.cube_delete_child)],Lr.prototype,"on_delete_child",null);class zr{static update(e,t,n){return{id:e,name:a.GW.code_update,code:n,tabid:t}}static add(e,t,n=!0){return{id:e,name:a.GW.code_add,item:(0,l.ux)(t),focus:n}}static remove(e,t){return{id:e,name:a.GW.code_remove,tabid:t}}static rename(e,t,n){return{id:e,name:a.GW.code_rename,tabid:t,filename:n}}static change_lang(e,t,n){return{id:e,name:a.GW.change_lang,tabid:t,lang:n}}static change_active(e,t){return{id:e,name:a.GW.change_active,tabid:t}}static change_theme(e,t,n){return{id:e,tabid:t,theme:n,name:a.GW.change_theme}}}const Ar=[{id:"abap",name:"ABAP",import:()=>n.e(8617).then(n.bind(n,8617))},{id:"actionscript-3",name:"ActionScript",import:()=>n.e(3516).then(n.bind(n,3516))},{id:"ada",name:"Ada",import:()=>n.e(7561).then(n.bind(n,7561))},{id:"angular-html",name:"Angular HTML",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(535)]).then(n.bind(n,535))},{id:"angular-ts",name:"Angular TypeScript",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(7611),n.e(535),n.e(4886)]).then(n.bind(n,4886))},{id:"apache",name:"Apache Conf",import:()=>n.e(7625).then(n.bind(n,7625))},{id:"apex",name:"Apex",import:()=>n.e(9819).then(n.bind(n,9819))},{id:"apl",name:"APL",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(6967),n.e(7504)]).then(n.bind(n,7504))},{id:"applescript",name:"AppleScript",import:()=>n.e(2108).then(n.bind(n,2108))},{id:"ara",name:"Ara",import:()=>n.e(5611).then(n.bind(n,5611))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:()=>n.e(4354).then(n.bind(n,4354))},{id:"asm",name:"Assembly",import:()=>n.e(6324).then(n.bind(n,6324))},{id:"astro",name:"Astro",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4714),n.e(6940),n.e(4408)]).then(n.bind(n,4408))},{id:"awk",name:"AWK",import:()=>n.e(4862).then(n.bind(n,4862))},{id:"ballerina",name:"Ballerina",import:()=>n.e(5141).then(n.bind(n,5141))},{id:"bat",name:"Batch File",aliases:["batch"],import:()=>n.e(2068).then(n.bind(n,2068))},{id:"beancount",name:"Beancount",import:()=>n.e(5026).then(n.bind(n,5026))},{id:"berry",name:"Berry",aliases:["be"],import:()=>n.e(8753).then(n.bind(n,8753))},{id:"bibtex",name:"BibTeX",import:()=>n.e(4009).then(n.bind(n,4009))},{id:"bicep",name:"Bicep",import:()=>n.e(7688).then(n.bind(n,7688))},{id:"blade",name:"Blade",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(6967),n.e(1230),n.e(5283)]).then(n.bind(n,5283))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:()=>n.e(5314).then(n.bind(n,5314))},{id:"c",name:"C",import:()=>n.e(5814).then(n.bind(n,5814))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:()=>n.e(5728).then(n.bind(n,5728))},{id:"cairo",name:"Cairo",import:()=>Promise.all([n.e(2473),n.e(8237)]).then(n.bind(n,8237))},{id:"clarity",name:"Clarity",import:()=>n.e(6677).then(n.bind(n,6677))},{id:"clojure",name:"Clojure",aliases:["clj"],import:()=>n.e(7681).then(n.bind(n,7681))},{id:"cmake",name:"CMake",import:()=>n.e(5936).then(n.bind(n,5936))},{id:"cobol",name:"COBOL",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(6967),n.e(780)]).then(n.bind(n,780))},{id:"codeowners",name:"CODEOWNERS",import:()=>n.e(9096).then(n.bind(n,9096))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:()=>n.e(6283).then(n.bind(n,6283))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:()=>Promise.all([n.e(7258),n.e(6563)]).then(n.bind(n,6563))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:()=>n.e(489).then(n.bind(n,489))},{id:"coq",name:"Coq",import:()=>n.e(8418).then(n.bind(n,8418))},{id:"cpp",name:"C++",aliases:["c++"],import:()=>Promise.all([n.e(1230),n.e(5814),n.e(4914)]).then(n.bind(n,4914))},{id:"crystal",name:"Crystal",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(1230),n.e(5814),n.e(3894),n.e(3403)]).then(n.bind(n,3403))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:()=>n.e(2354).then(n.bind(n,2354))},{id:"css",name:"CSS",import:()=>n.e(1708).then(n.bind(n,1708))},{id:"csv",name:"CSV",import:()=>n.e(8849).then(n.bind(n,1230))},{id:"cue",name:"CUE",import:()=>n.e(172).then(n.bind(n,172))},{id:"cypher",name:"Cypher",aliases:["cql"],import:()=>n.e(9806).then(n.bind(n,9806))},{id:"d",name:"D",import:()=>n.e(5177).then(n.bind(n,5177))},{id:"dart",name:"Dart",import:()=>n.e(9728).then(n.bind(n,9728))},{id:"dax",name:"DAX",import:()=>n.e(874).then(n.bind(n,874))},{id:"desktop",name:"Desktop",import:()=>n.e(6173).then(n.bind(n,6173))},{id:"diff",name:"Diff",import:()=>n.e(7670).then(n.bind(n,7670))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:()=>n.e(415).then(n.bind(n,415))},{id:"dotenv",name:"dotEnv",import:()=>n.e(2173).then(n.bind(n,2173))},{id:"dream-maker",name:"Dream Maker",import:()=>n.e(3227).then(n.bind(n,3227))},{id:"edge",name:"Edge",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(4714),n.e(3052)]).then(n.bind(n,3052))},{id:"elixir",name:"Elixir",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(3330)]).then(n.bind(n,3330))},{id:"elm",name:"Elm",import:()=>Promise.all([n.e(5814),n.e(9641)]).then(n.bind(n,9641))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:()=>n.e(2505).then(n.bind(n,2505))},{id:"erb",name:"ERB",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(4714),n.e(6967),n.e(1230),n.e(5814),n.e(3894),n.e(6940),n.e(6262),n.e(4914),n.e(3170),n.e(4007),n.e(9524)]).then(n.bind(n,9524))},{id:"erlang",name:"Erlang",aliases:["erl"],import:()=>Promise.all([n.e(7900),n.e(2266)]).then(n.bind(n,2266))},{id:"fennel",name:"Fennel",import:()=>n.e(1631).then(n.bind(n,1631))},{id:"fish",name:"Fish",import:()=>n.e(9661).then(n.bind(n,9661))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:()=>n.e(9077).then(n.bind(n,9077))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:()=>Promise.all([n.e(8553),n.e(7549)]).then(n.bind(n,7549))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:()=>n.e(8553).then(n.bind(n,8553))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:()=>Promise.all([n.e(7900),n.e(9689)]).then(n.bind(n,9689))},{id:"gdresource",name:"GDResource",import:()=>n.e(7434).then(n.bind(n,7434))},{id:"gdscript",name:"GDScript",import:()=>n.e(4311).then(n.bind(n,4311))},{id:"gdshader",name:"GDShader",import:()=>n.e(6405).then(n.bind(n,6405))},{id:"genie",name:"Genie",import:()=>n.e(9017).then(n.bind(n,9017))},{id:"gherkin",name:"Gherkin",import:()=>n.e(4451).then(n.bind(n,4451))},{id:"git-commit",name:"Git Commit Message",import:()=>n.e(2861).then(n.bind(n,2861))},{id:"git-rebase",name:"Git Rebase Message",import:()=>Promise.all([n.e(3894),n.e(638)]).then(n.bind(n,638))},{id:"gleam",name:"Gleam",import:()=>n.e(8201).then(n.bind(n,8201))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(4714),n.e(8700)]).then(n.bind(n,8700))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(4714),n.e(5050)]).then(n.bind(n,5050))},{id:"glsl",name:"GLSL",import:()=>Promise.all([n.e(5814),n.e(2723)]).then(n.bind(n,2723))},{id:"gnuplot",name:"Gnuplot",import:()=>n.e(396).then(n.bind(n,396))},{id:"go",name:"Go",import:()=>n.e(3941).then(n.bind(n,3941))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:()=>Promise.all([n.e(7258),n.e(4714),n.e(6940),n.e(6262),n.e(3170)]).then(n.bind(n,3170))},{id:"groovy",name:"Groovy",import:()=>n.e(1037).then(n.bind(n,1037))},{id:"hack",name:"Hack",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(1230),n.e(6356)]).then(n.bind(n,6356))},{id:"haml",name:"Ruby Haml",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(3949)]).then(n.bind(n,3949))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(1655)]).then(n.bind(n,1655))},{id:"haskell",name:"Haskell",aliases:["hs"],import:()=>n.e(9045).then(n.bind(n,9045))},{id:"haxe",name:"Haxe",import:()=>n.e(8107).then(n.bind(n,8107))},{id:"hcl",name:"HashiCorp HCL",import:()=>n.e(6124).then(n.bind(n,6124))},{id:"hjson",name:"Hjson",import:()=>n.e(5203).then(n.bind(n,5203))},{id:"hlsl",name:"HLSL",import:()=>n.e(4598).then(n.bind(n,4598))},{id:"html",name:"HTML",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940)]).then(n.bind(n,4940))},{id:"html-derivative",name:"HTML (Derivative)",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(914)]).then(n.bind(n,914))},{id:"http",name:"HTTP",import:()=>Promise.all([n.e(7258),n.e(4714),n.e(6967),n.e(3894),n.e(6940),n.e(6262),n.e(3170),n.e(5119)]).then(n.bind(n,5119))},{id:"hxml",name:"HXML",import:()=>n.e(8320).then(n.bind(n,8320))},{id:"hy",name:"Hy",import:()=>n.e(7470).then(n.bind(n,7470))},{id:"imba",name:"Imba",import:()=>n.e(3702).then(n.bind(n,3702))},{id:"ini",name:"INI",aliases:["properties"],import:()=>n.e(6343).then(n.bind(n,6343))},{id:"java",name:"Java",import:()=>n.e(6967).then(n.bind(n,6967))},{id:"javascript",name:"JavaScript",aliases:["js"],import:()=>n.e(7258).then(n.bind(n,7258))},{id:"jinja",name:"Jinja",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(3837)]).then(n.bind(n,3837))},{id:"jison",name:"Jison",import:()=>Promise.all([n.e(7258),n.e(5536)]).then(n.bind(n,5536))},{id:"json",name:"JSON",import:()=>n.e(5709).then(n.bind(n,5709))},{id:"json5",name:"JSON5",import:()=>n.e(6010).then(n.bind(n,6010))},{id:"jsonc",name:"JSON with Comments",import:()=>n.e(212).then(n.bind(n,212))},{id:"jsonl",name:"JSON Lines",import:()=>n.e(4843).then(n.bind(n,4843))},{id:"jsonnet",name:"Jsonnet",import:()=>n.e(4962).then(n.bind(n,4962))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:()=>n.e(7922).then(n.bind(n,7922))},{id:"jsx",name:"JSX",import:()=>n.e(6262).then(n.bind(n,6262))},{id:"julia",name:"Julia",aliases:["jl"],import:()=>Promise.all([n.e(7258),n.e(1230),n.e(5814),n.e(4914),n.e(2473),n.e(9983),n.e(9910)]).then(n.bind(n,9910))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:()=>n.e(2660).then(n.bind(n,2660))},{id:"kusto",name:"Kusto",aliases:["kql"],import:()=>n.e(6297).then(n.bind(n,6297))},{id:"latex",name:"LaTeX",import:()=>Promise.all([n.e(9983),n.e(7817)]).then(n.bind(n,7817))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:()=>n.e(8003).then(n.bind(n,8003))},{id:"less",name:"Less",import:()=>n.e(6964).then(n.bind(n,6964))},{id:"liquid",name:"Liquid",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(327)]).then(n.bind(n,327))},{id:"llvm",name:"LLVM IR",import:()=>n.e(3972).then(n.bind(n,1591))},{id:"log",name:"Log file",import:()=>n.e(3247).then(n.bind(n,3247))},{id:"logo",name:"Logo",import:()=>n.e(9730).then(n.bind(n,9730))},{id:"lua",name:"Lua",import:()=>Promise.all([n.e(5814),n.e(4199)]).then(n.bind(n,4199))},{id:"luau",name:"Luau",import:()=>n.e(5744).then(n.bind(n,5744))},{id:"make",name:"Makefile",aliases:["makefile"],import:()=>n.e(1757).then(n.bind(n,1757))},{id:"markdown",name:"Markdown",aliases:["md"],import:()=>n.e(7900).then(n.bind(n,7900))},{id:"marko",name:"Marko",import:()=>Promise.all([n.e(1708),n.e(4714),n.e(7611),n.e(6964),n.e(9175)]).then(n.bind(n,9175))},{id:"matlab",name:"MATLAB",import:()=>n.e(2492).then(n.bind(n,2492))},{id:"mdc",name:"MDC",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(7900),n.e(2215)]).then(n.bind(n,2215))},{id:"mdx",name:"MDX",import:()=>n.e(4452).then(n.bind(n,4452))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:()=>n.e(2860).then(n.bind(n,2860))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:()=>n.e(8499).then(n.bind(n,8499))},{id:"mojo",name:"Mojo",import:()=>n.e(9526).then(n.bind(n,9526))},{id:"move",name:"Move",import:()=>n.e(9104).then(n.bind(n,9104))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:()=>n.e(6239).then(n.bind(n,6239))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:()=>n.e(9876).then(n.bind(n,9876))},{id:"nginx",name:"Nginx",import:()=>Promise.all([n.e(5814),n.e(697)]).then(n.bind(n,697))},{id:"nim",name:"Nim",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(6967),n.e(5814),n.e(7900),n.e(4697)]).then(n.bind(n,4697))},{id:"nix",name:"Nix",import:()=>n.e(8212).then(n.bind(n,8212))},{id:"nushell",name:"nushell",aliases:["nu"],import:()=>n.e(7374).then(n.bind(n,7374))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:()=>n.e(7148).then(n.bind(n,7148))},{id:"objective-cpp",name:"Objective-C++",import:()=>n.e(9788).then(n.bind(n,7407))},{id:"ocaml",name:"OCaml",import:()=>n.e(9057).then(n.bind(n,9057))},{id:"pascal",name:"Pascal",import:()=>n.e(9079).then(n.bind(n,9079))},{id:"perl",name:"Perl",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(6967),n.e(1230),n.e(9984)]).then(n.bind(n,9984))},{id:"php",name:"PHP",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(6967),n.e(1230),n.e(7765),n.e(7966)]).then(n.bind(n,7765))},{id:"plsql",name:"PL/SQL",import:()=>n.e(8389).then(n.bind(n,8389))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:()=>n.e(4520).then(n.bind(n,4520))},{id:"polar",name:"Polar",import:()=>n.e(9845).then(n.bind(n,9845))},{id:"postcss",name:"PostCSS",import:()=>n.e(9270).then(n.bind(n,9270))},{id:"powerquery",name:"PowerQuery",import:()=>n.e(454).then(n.bind(n,454))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:()=>n.e(1476).then(n.bind(n,1476))},{id:"prisma",name:"Prisma",import:()=>n.e(5731).then(n.bind(n,5731))},{id:"prolog",name:"Prolog",import:()=>n.e(9206).then(n.bind(n,9206))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:()=>n.e(5891).then(n.bind(n,5891))},{id:"pug",name:"Pug",aliases:["jade"],import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(6757)]).then(n.bind(n,6757))},{id:"puppet",name:"Puppet",import:()=>n.e(3593).then(n.bind(n,3593))},{id:"purescript",name:"PureScript",import:()=>n.e(9904).then(n.bind(n,9904))},{id:"python",name:"Python",aliases:["py"],import:()=>n.e(2473).then(n.bind(n,2473))},{id:"qml",name:"QML",import:()=>Promise.all([n.e(7258),n.e(1803)]).then(n.bind(n,1803))},{id:"qmldir",name:"QML Directory",import:()=>n.e(4292).then(n.bind(n,4292))},{id:"qss",name:"Qt Style Sheets",import:()=>n.e(402).then(n.bind(n,402))},{id:"r",name:"R",import:()=>n.e(9983).then(n.bind(n,9983))},{id:"racket",name:"Racket",import:()=>n.e(9281).then(n.bind(n,9281))},{id:"raku",name:"Raku",aliases:["perl6"],import:()=>n.e(9780).then(n.bind(n,9780))},{id:"razor",name:"ASP.NET Razor",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(2354),n.e(245)]).then(n.bind(n,245))},{id:"reg",name:"Windows Registry Script",import:()=>n.e(5827).then(n.bind(n,5827))},{id:"regexp",name:"RegExp",aliases:["regex"],import:()=>n.e(3124).then(n.bind(n,3124))},{id:"rel",name:"Rel",import:()=>n.e(3043).then(n.bind(n,5424))},{id:"riscv",name:"RISC-V",import:()=>n.e(8684).then(n.bind(n,8684))},{id:"rst",name:"reStructuredText",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(4714),n.e(6967),n.e(1230),n.e(5814),n.e(3894),n.e(6940),n.e(6262),n.e(4914),n.e(3170),n.e(2473),n.e(4007),n.e(8234)]).then(n.bind(n,8234))},{id:"ruby",name:"Ruby",aliases:["rb"],import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(4714),n.e(6967),n.e(1230),n.e(5814),n.e(3894),n.e(6940),n.e(6262),n.e(4914),n.e(3170),n.e(4007)]).then(n.bind(n,4007))},{id:"rust",name:"Rust",aliases:["rs"],import:()=>n.e(7145).then(n.bind(n,7145))},{id:"sas",name:"SAS",import:()=>Promise.all([n.e(1230),n.e(9478)]).then(n.bind(n,9478))},{id:"sass",name:"Sass",import:()=>n.e(8709).then(n.bind(n,8709))},{id:"scala",name:"Scala",import:()=>n.e(3947).then(n.bind(n,3947))},{id:"scheme",name:"Scheme",import:()=>n.e(9982).then(n.bind(n,9982))},{id:"scss",name:"SCSS",import:()=>Promise.all([n.e(1708),n.e(7611)]).then(n.bind(n,7611))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:()=>n.e(1624).then(n.bind(n,1624))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:()=>n.e(8249).then(n.bind(n,8249))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:()=>n.e(3894).then(n.bind(n,3894))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:()=>Promise.all([n.e(3894),n.e(9965)]).then(n.bind(n,9965))},{id:"smalltalk",name:"Smalltalk",import:()=>n.e(1066).then(n.bind(n,1066))},{id:"solidity",name:"Solidity",import:()=>n.e(4780).then(n.bind(n,4780))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(7642)]).then(n.bind(n,7642))},{id:"sparql",name:"SPARQL",import:()=>n.e(4108).then(n.bind(n,4108))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:()=>n.e(6514).then(n.bind(n,6514))},{id:"sql",name:"SQL",import:()=>n.e(1230).then(n.bind(n,8849))},{id:"ssh-config",name:"SSH Config",import:()=>n.e(3874).then(n.bind(n,3874))},{id:"stata",name:"Stata",import:()=>Promise.all([n.e(1230),n.e(542)]).then(n.bind(n,542))},{id:"stylus",name:"Stylus",aliases:["styl"],import:()=>n.e(41).then(n.bind(n,41))},{id:"svelte",name:"Svelte",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4714),n.e(3454)]).then(n.bind(n,3454))},{id:"swift",name:"Swift",import:()=>n.e(8436).then(n.bind(n,8436))},{id:"system-verilog",name:"SystemVerilog",import:()=>n.e(6577).then(n.bind(n,6577))},{id:"systemd",name:"Systemd Units",import:()=>n.e(16).then(n.bind(n,16))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:()=>n.e(4660).then(n.bind(n,4660))},{id:"tasl",name:"Tasl",import:()=>n.e(1839).then(n.bind(n,1839))},{id:"tcl",name:"Tcl",import:()=>n.e(7328).then(n.bind(n,7328))},{id:"templ",name:"Templ",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(3941),n.e(7095)]).then(n.bind(n,7095))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:()=>n.e(4385).then(n.bind(n,4385))},{id:"tex",name:"TeX",import:()=>Promise.all([n.e(9983),n.e(9198)]).then(n.bind(n,9198))},{id:"toml",name:"TOML",import:()=>n.e(5363).then(n.bind(n,5363))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(4714),n.e(6967),n.e(1230),n.e(5814),n.e(9556)]).then(n.bind(n,9556))},{id:"tsv",name:"TSV",import:()=>n.e(6045).then(n.bind(n,8426))},{id:"tsx",name:"TSX",import:()=>n.e(6940).then(n.bind(n,6940))},{id:"turtle",name:"Turtle",import:()=>n.e(4877).then(n.bind(n,4877))},{id:"twig",name:"Twig",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(4714),n.e(6967),n.e(1230),n.e(5814),n.e(3894),n.e(6940),n.e(6262),n.e(4914),n.e(3170),n.e(2473),n.e(7611),n.e(4007),n.e(7765),n.e(4236)]).then(n.bind(n,4236))},{id:"typescript",name:"TypeScript",aliases:["ts"],import:()=>n.e(4714).then(n.bind(n,4714))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:()=>n.e(794).then(n.bind(n,794))},{id:"typst",name:"Typst",aliases:["typ"],import:()=>n.e(8711).then(n.bind(n,8711))},{id:"v",name:"V",import:()=>n.e(5443).then(n.bind(n,5443))},{id:"vala",name:"Vala",import:()=>n.e(7141).then(n.bind(n,7141))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:()=>n.e(8235).then(n.bind(n,8235))},{id:"verilog",name:"Verilog",import:()=>n.e(4283).then(n.bind(n,4283))},{id:"vhdl",name:"VHDL",import:()=>n.e(5521).then(n.bind(n,5521))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:()=>n.e(7567).then(n.bind(n,7567))},{id:"vue",name:"Vue",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(4714),n.e(1432)]).then(n.bind(n,1432))},{id:"vue-html",name:"Vue HTML",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(4714),n.e(1432),n.e(7789)]).then(n.bind(n,7789))},{id:"vue-vine",name:"Vue Vine",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(4714),n.e(7611),n.e(6964),n.e(1432),n.e(41),n.e(5954)]).then(n.bind(n,5954))},{id:"vyper",name:"Vyper",aliases:["vy"],import:()=>n.e(845).then(n.bind(n,845))},{id:"wasm",name:"WebAssembly",import:()=>n.e(7615).then(n.bind(n,7615))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:()=>n.e(8393).then(n.bind(n,8393))},{id:"wgsl",name:"WGSL",import:()=>n.e(5884).then(n.bind(n,5884))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:()=>n.e(2062).then(n.bind(n,2062))},{id:"wit",name:"WebAssembly Interface Types",import:()=>n.e(6957).then(n.bind(n,6957))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:()=>n.e(5589).then(n.bind(n,5589))},{id:"xml",name:"XML",import:()=>Promise.all([n.e(6967),n.e(5585)]).then(n.bind(n,7966))},{id:"xsl",name:"XSL",import:()=>Promise.all([n.e(6967),n.e(5628)]).then(n.bind(n,5628))},{id:"yaml",name:"YAML",aliases:["yml"],import:()=>n.e(4546).then(n.bind(n,4546))},{id:"zenscript",name:"ZenScript",import:()=>n.e(5099).then(n.bind(n,5099))},{id:"zig",name:"Zig",import:()=>n.e(3279).then(n.bind(n,3279))}],Rr=Object.fromEntries(Ar.map(e=>[e.id,e.import])),Pr=Object.fromEntries(Ar.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),Nr={...Rr,...Pr},Er=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:()=>n.e(2691).then(n.bind(n,2691))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:()=>n.e(7768).then(n.bind(n,7768))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:()=>n.e(7927).then(n.bind(n,7927))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:()=>n.e(1216).then(n.bind(n,1216))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:()=>n.e(7788).then(n.bind(n,7788))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:()=>n.e(2071).then(n.bind(n,2071))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:()=>n.e(9692).then(n.bind(n,9692))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:()=>n.e(3032).then(n.bind(n,3032))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:()=>n.e(8485).then(n.bind(n,8485))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:()=>n.e(284).then(n.bind(n,284))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:()=>n.e(1545).then(n.bind(n,1545))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:()=>n.e(6083).then(n.bind(n,6083))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:()=>n.e(5647).then(n.bind(n,5647))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:()=>n.e(9179).then(n.bind(n,9179))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:()=>n.e(9976).then(n.bind(n,9976))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:()=>n.e(9831).then(n.bind(n,9831))},{id:"github-light",displayName:"GitHub Light",type:"light",import:()=>n.e(9809).then(n.bind(n,9809))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:()=>n.e(9681).then(n.bind(n,9681))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:()=>n.e(1425).then(n.bind(n,1425))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:()=>n.e(6865).then(n.bind(n,6865))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:()=>n.e(7824).then(n.bind(n,7824))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:()=>n.e(3646).then(n.bind(n,3646))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:()=>n.e(2419).then(n.bind(n,2419))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:()=>n.e(9225).then(n.bind(n,9225))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:()=>n.e(4112).then(n.bind(n,4112))},{id:"houston",displayName:"Houston",type:"dark",import:()=>n.e(8931).then(n.bind(n,8931))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:()=>n.e(2184).then(n.bind(n,2184))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:()=>n.e(2142).then(n.bind(n,2142))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:()=>n.e(5638).then(n.bind(n,5638))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:()=>n.e(7831).then(n.bind(n,7831))},{id:"light-plus",displayName:"Light Plus",type:"light",import:()=>n.e(8426).then(n.bind(n,6045))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:()=>n.e(3492).then(n.bind(n,3492))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:()=>n.e(3720).then(n.bind(n,3720))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:()=>n.e(9294).then(n.bind(n,9294))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:()=>n.e(4081).then(n.bind(n,4081))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:()=>n.e(1729).then(n.bind(n,1729))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:()=>n.e(4614).then(n.bind(n,4614))},{id:"min-light",displayName:"Min Light",type:"light",import:()=>n.e(2934).then(n.bind(n,2934))},{id:"monokai",displayName:"Monokai",type:"dark",import:()=>n.e(2535).then(n.bind(n,2535))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:()=>n.e(4214).then(n.bind(n,4214))},{id:"nord",displayName:"Nord",type:"dark",import:()=>n.e(4552).then(n.bind(n,4552))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:()=>n.e(6736).then(n.bind(n,6736))},{id:"one-light",displayName:"One Light",type:"light",import:()=>n.e(3906).then(n.bind(n,3906))},{id:"plastic",displayName:"Plastic",type:"dark",import:()=>n.e(4445).then(n.bind(n,4445))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:()=>n.e(4465).then(n.bind(n,4465))},{id:"red",displayName:"Red",type:"dark",import:()=>n.e(6980).then(n.bind(n,6980))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:()=>n.e(753).then(n.bind(n,753))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:()=>n.e(5424).then(n.bind(n,3043))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:()=>n.e(8093).then(n.bind(n,8093))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:()=>n.e(4838).then(n.bind(n,4838))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:()=>n.e(5601).then(n.bind(n,5601))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:()=>n.e(1857).then(n.bind(n,1857))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:()=>n.e(7217).then(n.bind(n,7217))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:()=>n.e(1931).then(n.bind(n,1931))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:()=>n.e(321).then(n.bind(n,321))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:()=>n.e(5034).then(n.bind(n,5034))},{id:"vesper",displayName:"Vesper",type:"dark",import:()=>n.e(224).then(n.bind(n,224))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:()=>n.e(5542).then(n.bind(n,5542))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:()=>n.e(6517).then(n.bind(n,8898))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:()=>n.e(5143).then(n.bind(n,5143))}],Or=Object.fromEntries(Er.map(e=>[e.id,e.import]));class Ir extends Error{constructor(e){super(e),this.name="ShikiError"}}function Br(e){return Array.isArray(e)?function(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=Br(e[n]);return t}(e):e instanceof RegExp?e:"object"==typeof e?function(e){let t={};for(let n in e)t[n]=Br(e[n]);return t}(e):e}function Dr(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function Vr(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return 0===t?e:~t===e.length-1?Vr(e.substring(0,e.length-1)):e.substr(1+~t)}var Hr=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,jr=class{static hasCaptures(e){return null!==e&&(Hr.lastIndex=0,Hr.test(e))}static replaceCaptures(e,t,n){return e.replace(Hr,(e,r,i,s)=>{let o=n[parseInt(r||i,10)];if(!o)return e;{let e=t.substring(o.start,o.end);for(;"."===e[0];)e=e.substring(1);switch(s){case"downcase":return e.toLowerCase();case"upcase":return e.toUpperCase();default:return e}}})}};function Fr(e,t){return e<t?-1:e>t?1:0}function Ur(e,t){if(null===e&&null===t)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=Fr(e[r],t[r]);if(0!==n)return n}return 0}return n-r}function qr(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function $r(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var Gr=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},Xr=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(function(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i,s=t[e];if(!s.settings)continue;if("string"==typeof s.scope){let e=s.scope;e=e.replace(/^[,]+/,""),e=e.replace(/[,]+$/,""),i=e.split(",")}else i=Array.isArray(s.scope)?s.scope:[""];let o=-1;if("string"==typeof s.settings.fontStyle){o=0;let e=s.settings.fontStyle.split(" ");for(let t=0,n=e.length;t<n;t++)switch(e[t]){case"italic":o|=1;break;case"bold":o|=2;break;case"underline":o|=4;break;case"strikethrough":o|=8}}let a=null;"string"==typeof s.settings.foreground&&qr(s.settings.foreground)&&(a=s.settings.foreground);let l=null;"string"==typeof s.settings.background&&qr(s.settings.background)&&(l=s.settings.background);for(let t=0,s=i.length;t<s;t++){let s=i[t].trim().split(" "),c=s[s.length-1],d=null;s.length>1&&(d=s.slice(0,s.length-1),d.reverse()),n[r++]=new Zr(c,d,e,o,a,l)}}return n}(e),t)}static createFromParsedTheme(e,t){return function(e,t){e.sort((e,t)=>{let n=Fr(e.scope,t.scope);return 0!==n?n:(n=Ur(e.parentScopes,t.parentScopes),0!==n?n:e.index-t.index)});let n=0,r="#000000",i="#ffffff";for(;e.length>=1&&""===e[0].scope;){let t=e.shift();-1!==t.fontStyle&&(n=t.fontStyle),null!==t.foreground&&(r=t.foreground),null!==t.background&&(i=t.background)}let s=new Jr(t),o=new Yr(n,s.getId(r),s.getId(i)),a=new ni(new ti(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];a.insert(0,n.scope,n.parentScopes,n.fontStyle,s.getId(n.foreground),s.getId(n.background))}return new Xr(s,o,a)}(e,t)}_cachedMatchRoot=new Gr(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(null===e)return this._defaults;const t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>function(e,t){if(0===t.length)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(">"===r){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!Wr(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}(e.parent,t.parentScopes));return n?new Yr(n.fontStyle,n.foreground,n.background):null}},Kr=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(const r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this;const t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(" ")}extends(e){return this===e||null!==this.parent&&this.parent.extends(e)}getExtensionIfDefined(e){const t=[];let n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function Wr(e,t){return t===e||e.startsWith(t)&&"."===e[t.length]}var Yr=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}},Zr=class{constructor(e,t,n,r,i,s){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=s}},Qr=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(Qr||{}),Jr=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(null===e)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},ei=Object.freeze([]),ti=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||ei,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,-1!==t&&(this.fontStyle=t),0!==n&&(this.foreground=n),0!==r&&(this.background=r)}},ni=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;">"===e.parentScopes[n]&&n++,">"===t.parentScopes[r]&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){const i=t.parentScopes[r].length-e.parentScopes[n].length;if(0!==i)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(""!==t){let e,n,r=t.indexOf(".");if(-1===r?(e=t,n=""):(e=t.substring(0,r),n=t.substring(r+1)),this._children.hasOwnProperty(e))return this._children[e].match(n)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,s,o){if(""===n)return void this._doInsertHere(t,r,i,s,o);let a,l,c,d=n.indexOf(".");-1===d?(a=n,l=""):(a=n.substring(0,d),l=n.substring(d+1)),this._children.hasOwnProperty(a)?c=this._children[a]:(c=new e(this._mainRule.clone(),ti.cloneArr(this._rulesWithParentScopes)),this._children[a]=c),c.insert(t+1,l,r,i,s,o)}_doInsertHere(e,t,n,r,i){if(null!==t){for(let s=0,o=this._rulesWithParentScopes.length;s<o;s++){let o=this._rulesWithParentScopes[s];if(0===Ur(o.parentScopes,t))return void o.acceptOverwrite(e,n,r,i)}-1===n&&(n=this._mainRule.fontStyle),0===r&&(r=this._mainRule.foreground),0===i&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new ti(e,t,n,r,i))}else this._mainRule.acceptOverwrite(e,n,r,i)}},ri=class e{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(t){const n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),s=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:s,background:o})}static getLanguageId(e){return(255&e)>>>0}static getTokenType(e){return(768&e)>>>8}static containsBalancedBrackets(e){return!!(1024&e)}static getFontStyle(e){return(30720&e)>>>11}static getForeground(e){return(16744448&e)>>>15}static getBackground(e){return(4278190080&e)>>>24}static set(t,n,r,i,s,o,a){let l=e.getLanguageId(t),c=e.getTokenType(t),d=e.containsBalancedBrackets(t)?1:0,u=e.getFontStyle(t),h=e.getForeground(t),p=e.getBackground(t);return 0!==n&&(l=n),8!==r&&(c=r),null!==i&&(d=i?1:0),-1!==s&&(u=s),0!==o&&(h=o),0!==a&&(p=a),(l|c<<8|d<<10|u<<11|h<<15|p<<24)>>>0}};function ii(e){return e}function si(e,t){const n=[],r=function(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const r=n[0];return n=t.exec(e),r}}}(e);let i=r.next();for(;null!==i;){let e=0;if(2===i.length&&":"===i.charAt(1)){switch(i.charAt(0)){case"R":e=1;break;case"L":e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),","!==i)break;i=r.next()}return n;function s(){if("-"===i){i=r.next();const e=s();return t=>!!e&&!e(t)}if("("===i){i=r.next();const e=function(){const e=[];let t=o();for(;t&&(e.push(t),"|"===i||","===i);){do{i=r.next()}while("|"===i||","===i);t=o()}return t=>e.some(e=>e(t))}();return")"===i&&(i=r.next()),e}if(oi(i)){const e=[];do{e.push(i),i=r.next()}while(oi(i));return n=>t(e,n)}return null}function o(){const e=[];let t=s();for(;t;)e.push(t),t=s();return t=>e.every(e=>e(t))}}function oi(e){return!!e&&!!e.match(/[\w\.:]+/)}function ai(e){"function"==typeof e.dispose&&e.dispose()}var li=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},ci=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},di=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},ui=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new li(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new di;for(const n of e)hi(n,this.initialScopeName,this.repo,t);for(const e of t.references)if(e instanceof li){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName))continue;if(this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function hi(e,t,n,r){const i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const s=n.lookup(t);e instanceof li?mi({baseGrammar:s,selfGrammar:i},r):pi(e.ruleName,{baseGrammar:s,selfGrammar:i,repository:i.repository},r);const o=n.injections(e.scopeName);if(o)for(const e of o)r.add(new li(e))}function pi(e,t,n){t.repository&&t.repository[e]&&fi([t.repository[e]],t,n)}function mi(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&fi(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&fi(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function fi(e,t,n){for(const r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const e=r.repository?Dr({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&fi(r.patterns,{...t,repository:e},n);const i=r.include;if(!i)continue;const s=wi(i);switch(s.kind){case 0:mi({...t,selfGrammar:t.baseGrammar},n);break;case 1:mi(t,n);break;case 2:pi(s.ruleName,{...t,repository:e},n);break;case 3:case 4:const r=s.scopeName===t.selfGrammar.scopeName?t.selfGrammar:s.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){const i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};4===s.kind?pi(s.ruleName,i,n):mi(i,n)}else 4===s.kind?n.add(new ci(s.scopeName,s.ruleName)):n.add(new li(s.scopeName))}}}var _i=class{kind=0},gi=class{kind=1},bi=class{constructor(e){this.ruleName=e}kind=2},yi=class{constructor(e){this.scopeName=e}kind=3},vi=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function wi(e){if("$base"===e)return new _i;if("$self"===e)return new gi;const t=e.indexOf("#");if(-1===t)return new yi(e);if(0===t)return new bi(e.substring(1));{const n=e.substring(0,t),r=e.substring(t+1);return new vi(n,r)}}var xi=/\\(\d+)/,ki=/\\(\d+)/g;Symbol("RuleId");var Si=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=jr.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=jr.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${Vr(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return this._nameIsCapturing&&null!==this._name&&null!==e&&null!==t?jr.replaceCaptures(this._name,e,t):this._name}getContentName(e,t){return this._contentNameIsCapturing&&null!==this._contentName?jr.replaceCaptures(this._contentName,e,t):this._contentName}},Ci=class extends Si{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,r){throw new Error("Not supported!")}},Mi=class extends Si{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new Ri(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Pi,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Ti=class extends Si{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Pi,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Li=class extends Si{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,s,o,a,l,c){super(e,t,n,r),this._begin=new Ri(i,this.id),this.beginCaptures=s,this._end=new Ri(o||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=l||!1,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Pi;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},zi=class extends Si{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,s,o,a,l){super(e,t,n,r),this._begin=new Ri(i,this.id),this.beginCaptures=s,this.whileCaptures=a,this._while=new Ri(o,-2),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Pi;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Pi,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||""),this._cachedCompiledWhilePatterns}},Ai=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new Ci(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new Mi(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(void 0===t.begin){t.repository&&(r=Dr({},r,t.repository));let i=t.patterns;return void 0===i&&t.include&&(i=[{include:t.include}]),new Ti(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new zi(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new Li(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let s=0;for(const e in t){if("$vscodeTextmateLocation"===e)continue;const t=parseInt(e,10);t>s&&(s=t)}for(let e=0;e<=s;e++)i[e]=null;for(const s in t){if("$vscodeTextmateLocation"===s)continue;const o=parseInt(s,10);let a=0;t[s].patterns&&(a=e.getCompiledRuleId(t[s],n,r)),i[o]=e.createCaptureRule(n,t[s].$vscodeTextmateLocation,t[s].name,t[s].contentName,a)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let s=0,o=t.length;s<o;s++){const o=t[s];let a=-1;if(o.include){const t=wi(o.include);switch(t.kind){case 0:case 1:a=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(a=e.getCompiledRuleId(i,n,r));break;case 3:case 4:const s=t.scopeName,l=4===t.kind?t.ruleName:null,c=n.getExternalGrammar(s,r);if(c)if(l){let t=c.repository[l];t&&(a=e.getCompiledRuleId(t,n,c.repository))}else a=e.getCompiledRuleId(c.repository.$self,n,c.repository)}}else a=e.getCompiledRuleId(o,n,r);if(-1!==a){const e=n.getRule(a);let t=!1;if((e instanceof Ti||e instanceof Li||e instanceof zi)&&e.hasMissingPatterns&&0===e.patterns.length&&(t=!0),t)continue;i.push(a)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},Ri=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&"string"==typeof e){const t=e.length;let n=0,r=[],i=!1;for(let s=0;s<t;s++)if("\\"===e.charAt(s)&&s+1<t){const t=e.charAt(s+1);"z"===t?(r.push(e.substring(n,s)),r.push("$(?!\\n)(?<!\\n)"),n=s+2):"A"!==t&&"G"!==t||(i=!0),s++}this.hasAnchor=i,0===n?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=t,"string"==typeof this.source?this.hasBackReferences=xi.test(this.source):this.hasBackReferences=!1}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if("string"!=typeof this.source)throw new Error("This method should only be called if the source is a string");let n=t.map(t=>e.substring(t.start,t.end));return ki.lastIndex=0,this.source.replace(ki,(e,t)=>$r(n[parseInt(t,10)]||""))}_buildAnchorCache(){if("string"!=typeof this.source)throw new Error("This method should only be called if the source is a string");let e,t,n,r,i=[],s=[],o=[],a=[];for(e=0,t=this.source.length;e<t;e++)n=this.source.charAt(e),i[e]=n,s[e]=n,o[e]=n,a[e]=n,"\\"===n&&e+1<t&&(r=this.source.charAt(e+1),"A"===r?(i[e+1]="",s[e+1]="",o[e+1]="A",a[e+1]="A"):"G"===r?(i[e+1]="",s[e+1]="G",o[e+1]="",a[e+1]="G"):(i[e+1]=r,s[e+1]=r,o[e+1]=r,a[e+1]=r),e++);return{A0_G0:i.join(""),A0_G1:s.join(""),A1_G0:o.join(""),A1_G1:a.join("")}}resolveAnchors(e,t){return this.hasAnchor&&this._anchorCache&&"string"==typeof this.source?e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0:this.source}},Pi=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new Ni(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let r=this._items.map(e=>e.resolveAnchors(t,n));return new Ni(e,r,this._items.map(e=>e.ruleId))}},Ni=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){"function"==typeof this.scanner.dispose&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join("\n")}findNextMatchSync(e,t,n){const r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},Ei=class{constructor(e,t){this.languageId=e,this.tokenType=t}},Oi=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new Ei(e,8),this._embeddedLanguagesMatcher=new Ii(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return null===t?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Ei(0,0);_getBasicScopeAttributes=new Gr(e=>{const t=this._scopeToLanguage(e),n=this._toStandardTokenType(e);return new Ei(t,n)});_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){const n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},Ii=class{values;scopesRegExp;constructor(e){if(0===e.length)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([e,t])=>$r(e));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);return t?this.values.get(t[1]):void 0}},Bi=("undefined"!=typeof process&&process.env.VSCODE_TEXTMATE_DEBUG,class{constructor(e,t){this.stack=e,this.stoppedEarly=t}});function Di(e,t,n,r,i,s,o,a){const l=t.content.length;let c=!1,d=-1;if(o){const o=function(e,t,n,r,i,s){let o=i.beginRuleCapturedEOL?0:-1;const a=[];for(let t=i;t;t=t.pop()){const n=t.getRule(e);n instanceof zi&&a.push({rule:n,stack:t})}for(let l=a.pop();l;l=a.pop()){const{ruleScanner:a,findOptions:c}=Hi(l.rule,e,l.stack.endRule,n,r===o),d=a.findNextMatchSync(t,r,c);if(!d){i=l.stack.pop();break}if(-2!==d.ruleId){i=l.stack.pop();break}d.captureIndices&&d.captureIndices.length&&(s.produce(l.stack,d.captureIndices[0].start),ji(e,t,n,l.stack,s,l.rule.whileCaptures,d.captureIndices),s.produce(l.stack,d.captureIndices[0].end),o=d.captureIndices[0].end,d.captureIndices[0].end>r&&(r=d.captureIndices[0].end,n=!1))}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}(e,t,n,r,i,s);i=o.stack,r=o.linePos,n=o.isFirstLine,d=o.anchorPosition}const u=Date.now();for(;!c;){if(0!==a&&Date.now()-u>a)return new Bi(i,!0);h()}return new Bi(i,!1);function h(){const o=function(e,t,n,r,i,s){const o=function(e,t,n,r,i,s){const o=i.getRule(e),{ruleScanner:a,findOptions:l}=Vi(o,e,i.endRule,n,r===s),c=a.findNextMatchSync(t,r,l);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}(e,t,n,r,i,s),a=e.getInjections();if(0===a.length)return o;const l=function(e,t,n,r,i,s,o){let a,l=Number.MAX_VALUE,c=null,d=0;const u=s.contentNameScopesList.getScopeNames();for(let s=0,h=e.length;s<h;s++){const h=e[s];if(!h.matcher(u))continue;const p=t.getRule(h.ruleId),{ruleScanner:m,findOptions:f}=Vi(p,t,null,r,i===o),_=m.findNextMatchSync(n,i,f);if(!_)continue;const g=_.captureIndices[0].start;if(!(g>=l)&&(l=g,c=_.captureIndices,a=_.ruleId,d=h.priority,l===i))break}return c?{priorityMatch:-1===d,captureIndices:c,matchedRuleId:a}:null}(a,e,t,n,r,i,s);if(!l)return o;if(!o)return l;const c=o.captureIndices[0].start,d=l.captureIndices[0].start;return d<c||l.priorityMatch&&d===c?l:o}(e,t,n,r,i,d);if(!o)return s.produce(i,l),void(c=!0);const a=o.captureIndices,u=o.matchedRuleId,h=!!(a&&a.length>0)&&a[0].end>r;if(-1===u){const o=i.getRule(e);s.produce(i,a[0].start),i=i.withContentNameScopesList(i.nameScopesList),ji(e,t,n,i,s,o.endCaptures,a),s.produce(i,a[0].end);const u=i;if(i=i.parent,d=u.getAnchorPos(),!h&&u.getEnterPos()===r)return i=u,s.produce(i,l),void(c=!0)}else{const o=e.getRule(u);s.produce(i,a[0].start);const p=i,m=o.getName(t.content,a),f=i.contentNameScopesList.pushAttributed(m,e);if(i=i.push(u,r,d,a[0].end===l,null,f,f),o instanceof Li){const r=o;ji(e,t,n,i,s,r.beginCaptures,a),s.produce(i,a[0].end),d=a[0].end;const u=r.getContentName(t.content,a),m=f.pushAttributed(u,e);if(i=i.withContentNameScopesList(m),r.endHasBackReferences&&(i=i.withEndRule(r.getEndWithResolvedBackReferences(t.content,a))),!h&&p.hasSameRuleAs(i))return i=i.pop(),s.produce(i,l),void(c=!0)}else if(o instanceof zi){const r=o;ji(e,t,n,i,s,r.beginCaptures,a),s.produce(i,a[0].end),d=a[0].end;const u=r.getContentName(t.content,a),m=f.pushAttributed(u,e);if(i=i.withContentNameScopesList(m),r.whileHasBackReferences&&(i=i.withEndRule(r.getWhileWithResolvedBackReferences(t.content,a))),!h&&p.hasSameRuleAs(i))return i=i.pop(),s.produce(i,l),void(c=!0)}else if(ji(e,t,n,i,s,o.captures,a),s.produce(i,a[0].end),i=i.pop(),!h)return i=i.safePop(),s.produce(i,l),void(c=!0)}a[0].end>r&&(r=a[0].end,n=!1)}}function Vi(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function Hi(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function ji(e,t,n,r,i,s,o){if(0===s.length)return;const a=t.content,l=Math.min(s.length,o.length),c=[],d=o[0].end;for(let t=0;t<l;t++){const l=s[t];if(null===l)continue;const u=o[t];if(0===u.length)continue;if(u.start>d)break;for(;c.length>0&&c[c.length-1].endPos<=u.start;)i.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop();if(c.length>0?i.produceFromScopes(c[c.length-1].scopes,u.start):i.produce(r,u.start),l.retokenizeCapturedWithRuleId){const t=l.getName(a,o),s=r.contentNameScopesList.pushAttributed(t,e),c=l.getContentName(a,o),d=s.pushAttributed(c,e),h=r.push(l.retokenizeCapturedWithRuleId,u.start,-1,!1,null,s,d),p=e.createOnigString(a.substring(0,u.end));Di(e,p,n&&0===u.start,u.start,h,i,!1,0),ai(p);continue}const h=l.getName(a,o);if(null!==h){const t=(c.length>0?c[c.length-1].scopes:r.contentNameScopesList).pushAttributed(h,e);c.push(new Fi(t,u.end))}}for(;c.length>0;)i.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop()}var Fi=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function Ui(e,t,n,r,i){const s=si(t,qi),o=Ai.getCompiledRuleId(n,r,i.repository);for(const n of s)e.push({debugSelector:t,matcher:n.matcher,ruleId:o,grammar:i,priority:n.priority})}function qi(e,t){if(t.length<e.length)return!1;let n=0;return e.every(e=>{for(let r=n;r<t.length;r++)if($i(t[r],e))return n=r+1,!0;return!1})}function $i(e,t){if(!e)return!1;if(e===t)return!0;const n=t.length;return e.length>n&&e.substr(0,n)===t&&"."===e[n]}var Gi=class{constructor(e,t,n,r,i,s,o,a){if(this._rootScopeName=e,this.balancedBracketSelectors=s,this._onigLib=a,this._basicScopeAttributesProvider=new Oi(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=Xi(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(const e of Object.keys(i)){const t=si(e,qi);for(const n of t)this._tokenTypeMatchers.push({matcher:n.matcher,type:i[e]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e=[],t=this._rootScopeName,n=(e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e))(t);if(n){const r=n.injections;if(r)for(let t in r)Ui(e,t,r[t],this,n);const i=this._grammarRepository.injections(t);i&&i.forEach(t=>{const n=this.getExternalGrammar(t);if(n){const t=n.injectionSelector;t&&Ui(e,t,n,this,n)}})}return e.sort((e,t)=>e.priority-t.priority),e}getInjections(){return null===this._injections&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=Xi(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){const r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){let i;if(-1===this._rootId&&(this._rootId=Ai.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections()),t&&t!==Wi.NULL)i=!1,t.reset();else{i=!0;const e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=ri.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),s=this.getRule(this._rootId).getName(null,null);let o;o=s?Ki.createRootAndLookUpScopeName(s,r,this):Ki.createRoot("unknown",r),t=new Wi(null,this._rootId,-1,-1,!1,null,o,o)}e+="\n";const s=this.createOnigString(e),o=s.content.length,a=new Zi(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),l=Di(this,s,i,0,t,a,!0,r);return ai(s),{lineLength:o,lineTokens:a,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function Xi(e,t){return(e=Br(e)).repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var Ki=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(const t of n)i=Kr.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new Kr(null,t),n)}static createRootAndLookUpScopeName(t,n,r){const i=r.getMetadataForScope(t),s=new Kr(null,t),o=r.themeProvider.themeMatch(s),a=e.mergeAttributes(n,i,o);return new e(null,s,a)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return e.equals(this,t)}static equals(e,t){for(;;){if(e===t)return!0;if(!e&&!t)return!0;if(!e||!t)return!1;if(e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}}static mergeAttributes(e,t,n){let r=-1,i=0,s=0;return null!==n&&(r=n.fontStyle,i=n.foregroundId,s=n.backgroundId),ri.set(e,t.languageId,t.tokenType,null,r,i,s)}pushAttributed(t,n){if(null===t)return this;if(-1===t.indexOf(" "))return e._pushAttributed(this,t,n);const r=t.split(/ /g);let i=this;for(const t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){const i=r.getMetadataForScope(n),s=t.scopePath.push(n),o=r.themeProvider.themeMatch(s),a=e.mergeAttributes(t.tokenAttributes,i,o);return new e(t,s,a)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){const t=[];let n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},Wi=class e{constructor(e,t,n,r,i,s,o,a){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=s,this.nameScopesList=o,this.contentNameScopesList=a,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return null!==t&&e._equals(this,t)}static _equals(e,t){return e===t||!!this._structuralEquals(e,t)&&Ki.equals(e.contentNameScopesList,t.contentNameScopesList)}static _structuralEquals(e,t){for(;;){if(e===t)return!0;if(!e&&!t)return!0;if(!e||!t)return!1;if(e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,s,o,a){return new e(this,t,n,r,i,s,o,a)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){const e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){const r=Ki.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Ki.fromExtension(r,n.contentNameScopesList))}},Yi=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>"*"===e?(this.allowAny=!0,[]):si(e,qi).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>si(e,qi).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&0===this.unbalancedBracketScopes.length}get matchesNever(){return 0===this.balancedBracketScopes.length&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},Zi=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const t=e?.getScopeNames()??[];for(const e of this._tokenTypeOverrides)e.matcher(t)&&(n=ri.set(n,0,ii(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}return r&&(n=ri.set(n,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n||(this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n)),void(this._lastTokenEndIndex=t)}const n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),0===this._tokens.length&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),0===this._binaryTokens.length&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e<t;e++)n[e]=this._binaryTokens[e];return n}},Qi=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,i){if(!this._grammars.has(e)){let s=this._rawGrammars.get(e);if(!s)return null;this._grammars.set(e,function(e,t,n,r,i,s,o,a){return new Gi(e,t,n,r,i,s,o,a)}(e,s,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},Ji=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new Qi(Xr.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(Xr.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new Yi(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){const s=new ui(this._syncRegistry,e);for(;s.Q.length>0;)s.Q.map(e=>this._loadSingleGrammar(e.scopeName)),s.processQueue();return this._grammarForScopeName(e,t,n,r,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){const t=this._options.loadGrammar(e);if(t){const n="function"==typeof this._options.getInjections?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,i)}},es=Wi.NULL;const ts=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class ns{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function rs(e,t){const n={},r={};for(const t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new ns(n,r,t)}function is(e){return e.toLowerCase()}ns.prototype.normal={},ns.prototype.property={},ns.prototype.space=void 0;class ss{constructor(e,t){this.attribute=t,this.property=e}}ss.prototype.attribute="",ss.prototype.booleanish=!1,ss.prototype.boolean=!1,ss.prototype.commaOrSpaceSeparated=!1,ss.prototype.commaSeparated=!1,ss.prototype.defined=!1,ss.prototype.mustUseProperty=!1,ss.prototype.number=!1,ss.prototype.overloadedBoolean=!1,ss.prototype.property="",ss.prototype.spaceSeparated=!1,ss.prototype.space=void 0;let os=0;const as=ms(),ls=ms(),cs=ms(),ds=ms(),us=ms(),hs=ms(),ps=ms();function ms(){return 2**++os}const fs=Object.keys(r);class _s extends ss{constructor(e,t,n,i){let s=-1;if(super(e,t),gs(this,"space",i),"number"==typeof n)for(;++s<fs.length;){const e=fs[s];gs(this,fs[s],(n&r[e])===r[e])}}}function gs(e,t,n){n&&(e[t]=n)}function bs(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new _s(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[is(r)]=r,n[is(s.attribute)]=r}return new ns(t,n,e.space)}_s.prototype.defined=!0;const ys=bs({properties:{ariaActiveDescendant:null,ariaAtomic:ls,ariaAutoComplete:null,ariaBusy:ls,ariaChecked:ls,ariaColCount:ds,ariaColIndex:ds,ariaColSpan:ds,ariaControls:us,ariaCurrent:null,ariaDescribedBy:us,ariaDetails:null,ariaDisabled:ls,ariaDropEffect:us,ariaErrorMessage:null,ariaExpanded:ls,ariaFlowTo:us,ariaGrabbed:ls,ariaHasPopup:null,ariaHidden:ls,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:us,ariaLevel:ds,ariaLive:null,ariaModal:ls,ariaMultiLine:ls,ariaMultiSelectable:ls,ariaOrientation:null,ariaOwns:us,ariaPlaceholder:null,ariaPosInSet:ds,ariaPressed:ls,ariaReadOnly:ls,ariaRelevant:null,ariaRequired:ls,ariaRoleDescription:us,ariaRowCount:ds,ariaRowIndex:ds,ariaRowSpan:ds,ariaSelected:ls,ariaSetSize:ds,ariaSort:null,ariaValueMax:ds,ariaValueMin:ds,ariaValueNow:ds,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function vs(e,t){return t in e?e[t]:t}function ws(e,t){return vs(e,t.toLowerCase())}const xs=bs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:hs,acceptCharset:us,accessKey:us,action:null,allow:null,allowFullScreen:as,allowPaymentRequest:as,allowUserMedia:as,alt:null,as:null,async:as,autoCapitalize:null,autoComplete:us,autoFocus:as,autoPlay:as,blocking:us,capture:null,charSet:null,checked:as,cite:null,className:us,cols:ds,colSpan:null,content:null,contentEditable:ls,controls:as,controlsList:us,coords:ds|hs,crossOrigin:null,data:null,dateTime:null,decoding:null,default:as,defer:as,dir:null,dirName:null,disabled:as,download:cs,draggable:ls,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:as,formTarget:null,headers:us,height:ds,hidden:cs,high:ds,href:null,hrefLang:null,htmlFor:us,httpEquiv:us,id:null,imageSizes:null,imageSrcSet:null,inert:as,inputMode:null,integrity:null,is:null,isMap:as,itemId:null,itemProp:us,itemRef:us,itemScope:as,itemType:us,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:as,low:ds,manifest:null,max:null,maxLength:ds,media:null,method:null,min:null,minLength:ds,multiple:as,muted:as,name:null,nonce:null,noModule:as,noValidate:as,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:as,optimum:ds,pattern:null,ping:us,placeholder:null,playsInline:as,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:as,referrerPolicy:null,rel:us,required:as,reversed:as,rows:ds,rowSpan:ds,sandbox:us,scope:null,scoped:as,seamless:as,selected:as,shadowRootClonable:as,shadowRootDelegatesFocus:as,shadowRootMode:null,shape:null,size:ds,sizes:null,slot:null,span:ds,spellCheck:ls,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ds,step:null,style:null,tabIndex:ds,target:null,title:null,translate:null,type:null,typeMustMatch:as,useMap:null,value:ls,width:ds,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:us,axis:null,background:null,bgColor:null,border:ds,borderColor:null,bottomMargin:ds,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:as,declare:as,event:null,face:null,frame:null,frameBorder:null,hSpace:ds,leftMargin:ds,link:null,longDesc:null,lowSrc:null,marginHeight:ds,marginWidth:ds,noResize:as,noHref:as,noShade:as,noWrap:as,object:null,profile:null,prompt:null,rev:null,rightMargin:ds,rules:null,scheme:null,scrolling:ls,standby:null,summary:null,text:null,topMargin:ds,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ds,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:as,disableRemotePlayback:as,prefix:null,property:null,results:ds,security:null,unselectable:null},space:"html",transform:ws}),ks=bs({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ps,accentHeight:ds,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ds,amplitude:ds,arabicForm:null,ascent:ds,attributeName:null,attributeType:null,azimuth:ds,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ds,by:null,calcMode:null,capHeight:ds,className:us,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ds,diffuseConstant:ds,direction:null,display:null,dur:null,divisor:ds,dominantBaseline:null,download:as,dx:null,dy:null,edgeMode:null,editable:null,elevation:ds,enableBackground:null,end:null,event:null,exponent:ds,externalResourcesRequired:null,fill:null,fillOpacity:ds,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:hs,g2:hs,glyphName:hs,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ds,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ds,horizOriginX:ds,horizOriginY:ds,id:null,ideographic:ds,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ds,k:ds,k1:ds,k2:ds,k3:ds,k4:ds,kernelMatrix:ps,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ds,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ds,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ds,overlineThickness:ds,paintOrder:null,panose1:null,path:null,pathLength:ds,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:us,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ds,pointsAtY:ds,pointsAtZ:ds,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ps,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ps,rev:ps,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ps,requiredFeatures:ps,requiredFonts:ps,requiredFormats:ps,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ds,specularExponent:ds,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ds,strikethroughThickness:ds,string:null,stroke:null,strokeDashArray:ps,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ds,strokeOpacity:ds,strokeWidth:null,style:null,surfaceScale:ds,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ps,tabIndex:ds,tableValues:null,target:null,targetX:ds,targetY:ds,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ps,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ds,underlineThickness:ds,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ds,values:null,vAlphabetic:ds,vMathematical:ds,vectorEffect:null,vHanging:ds,vIdeographic:ds,version:null,vertAdvY:ds,vertOriginX:ds,vertOriginY:ds,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ds,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:vs}),Ss=bs({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),Cs=bs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:ws}),Ms=bs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),Ts=rs([ys,xs,Ss,Cs,Ms],"html"),Ls=rs([ys,ks,Ss,Cs,Ms],"svg"),zs={}.hasOwnProperty,As=/["&'<>`]/g,Rs=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Ps=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Ns=/[|\\{}()[\]^$+*?.]/g,Es=new WeakMap;const Os=/[\dA-Fa-f]/,Is=/\d/,Bs=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],Ds={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},Vs=["cent","copy","divide","gt","lt","not","para","times"],Hs={}.hasOwnProperty,js={};let Fs;for(Fs in Ds)Hs.call(Ds,Fs)&&(js[Ds[Fs]]=Fs);const Us=/[^\dA-Za-z]/;function qs(e,t,n){let r,i=function(e,t,n){const r="&#x"+e.toString(16).toUpperCase();return n&&t&&!Os.test(String.fromCharCode(t))?r:r+";"}(e,t,n.omitOptionalSemicolons);if((n.useNamedReferences||n.useShortestReferences)&&(r=function(e,t,n,r){const i=String.fromCharCode(e);if(Hs.call(js,i)){const e=js[i],s="&"+e;return n&&Bs.includes(e)&&!Vs.includes(e)&&(!r||t&&61!==t&&Us.test(String.fromCharCode(t)))?s:s+";"}return""}(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!r)&&n.useShortestReferences){const r=function(e,t,n){const r="&#"+String(e);return n&&t&&!Is.test(String.fromCharCode(t))?r:r+";"}(e,t,n.omitOptionalSemicolons);r.length<i.length&&(i=r)}return r&&(!n.useShortestReferences||r.length<i.length)?r:i}function $s(e,t){return function(e,t){return e=e.replace(t.subset?function(e){let t=Es.get(e);return t||(t=function(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(Ns,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}(e),Es.set(e,t)),t}(t.subset):As,n),t.subset||t.escapeOnly?e:e.replace(Rs,function(e,n,r){return t.format(1024*(e.charCodeAt(0)-55296)+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}).replace(Ps,n);function n(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}(e,Object.assign({format:qs},t))}const Gs=/^>|^->|<!--|-->|--!>|<!-$/g,Xs=[">"],Ks=["<",">"];function Ws(e,t){const n=String(e);if("string"!=typeof t)throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;-1!==i;)r++,i=n.indexOf(t,i+t.length);return r}function Ys(e,t){const n=t||{};return(""===e[e.length-1]?[...e,""]:e).join((n.padRight?" ":"")+","+(!1===n.padLeft?"":" ")).trim()}const Zs=/[A-Z]/g,Qs=/-[a-z]/g,Js=/^data[-\w.:]+$/i;function eo(e){return"-"+e.toLowerCase()}function to(e){return e.charAt(1).toUpperCase()}function no(e){return e.join(" ").trim()}const ro=/[ \t\n\f\r]/g;function io(e){return"object"==typeof e?"text"===e.type&&so(e.value):so(e)}function so(e){return""===e.replace(ro,"")}const oo=co(1),ao=co(-1),lo=[];function co(e){return function(t,n,r){const i=t?t.children:lo;let s=(n||0)+e,o=i[s];if(!r)for(;o&&io(o);)s+=e,o=i[s];return o}}const uo={}.hasOwnProperty;function ho(e){return function(t,n,r){return uo.call(e,t.tagName)&&e[t.tagName](t,n,r)}}const po=ho({body:function(e,t,n){const r=oo(n,t);return!r||"comment"!==r.type},caption:mo,colgroup:mo,dd:function(e,t,n){const r=oo(n,t);return!r||"element"===r.type&&("dt"===r.tagName||"dd"===r.tagName)},dt:function(e,t,n){const r=oo(n,t);return Boolean(r&&"element"===r.type&&("dt"===r.tagName||"dd"===r.tagName))},head:mo,html:function(e,t,n){const r=oo(n,t);return!r||"comment"!==r.type},li:function(e,t,n){const r=oo(n,t);return!r||"element"===r.type&&"li"===r.tagName},optgroup:function(e,t,n){const r=oo(n,t);return!r||"element"===r.type&&"optgroup"===r.tagName},option:function(e,t,n){const r=oo(n,t);return!r||"element"===r.type&&("option"===r.tagName||"optgroup"===r.tagName)},p:function(e,t,n){const r=oo(n,t);return r?"element"===r.type&&("address"===r.tagName||"article"===r.tagName||"aside"===r.tagName||"blockquote"===r.tagName||"details"===r.tagName||"div"===r.tagName||"dl"===r.tagName||"fieldset"===r.tagName||"figcaption"===r.tagName||"figure"===r.tagName||"footer"===r.tagName||"form"===r.tagName||"h1"===r.tagName||"h2"===r.tagName||"h3"===r.tagName||"h4"===r.tagName||"h5"===r.tagName||"h6"===r.tagName||"header"===r.tagName||"hgroup"===r.tagName||"hr"===r.tagName||"main"===r.tagName||"menu"===r.tagName||"nav"===r.tagName||"ol"===r.tagName||"p"===r.tagName||"pre"===r.tagName||"section"===r.tagName||"table"===r.tagName||"ul"===r.tagName):!n||!("element"===n.type&&("a"===n.tagName||"audio"===n.tagName||"del"===n.tagName||"ins"===n.tagName||"map"===n.tagName||"noscript"===n.tagName||"video"===n.tagName))},rp:fo,rt:fo,tbody:function(e,t,n){const r=oo(n,t);return!r||"element"===r.type&&("tbody"===r.tagName||"tfoot"===r.tagName)},td:_o,tfoot:function(e,t,n){return!oo(n,t)},th:_o,thead:function(e,t,n){const r=oo(n,t);return Boolean(r&&"element"===r.type&&("tbody"===r.tagName||"tfoot"===r.tagName))},tr:function(e,t,n){const r=oo(n,t);return!r||"element"===r.type&&"tr"===r.tagName}});function mo(e,t,n){const r=oo(n,t,!0);return!r||"comment"!==r.type&&!("text"===r.type&&io(r.value.charAt(0)))}function fo(e,t,n){const r=oo(n,t);return!r||"element"===r.type&&("rp"===r.tagName||"rt"===r.tagName)}function _o(e,t,n){const r=oo(n,t);return!r||"element"===r.type&&("td"===r.tagName||"th"===r.tagName)}const go=ho({body:function(e){const t=oo(e,-1,!0);return!(t&&("comment"===t.type||"text"===t.type&&io(t.value.charAt(0))||"element"===t.type&&("meta"===t.tagName||"link"===t.tagName||"script"===t.tagName||"style"===t.tagName||"template"===t.tagName)))},colgroup:function(e,t,n){const r=ao(n,t),i=oo(e,-1,!0);return!(n&&r&&"element"===r.type&&"colgroup"===r.tagName&&po(r,n.children.indexOf(r),n))&&Boolean(i&&"element"===i.type&&"col"===i.tagName)},head:function(e){const t=new Set;for(const n of e.children)if("element"===n.type&&("base"===n.tagName||"title"===n.tagName)){if(t.has(n.tagName))return!1;t.add(n.tagName)}const n=e.children[0];return!n||"element"===n.type},html:function(e){const t=oo(e,-1);return!t||"comment"!==t.type},tbody:function(e,t,n){const r=ao(n,t),i=oo(e,-1);return(!n||!r||"element"!==r.type||"thead"!==r.tagName&&"tbody"!==r.tagName||!po(r,n.children.indexOf(r),n))&&Boolean(i&&"element"===i.type&&"tr"===i.tagName)}}),bo={name:[["\t\n\f\r &/=>".split(""),"\t\n\f\r \"&'/=>`".split("")],["\0\t\n\f\r \"&'/<=>".split(""),"\0\t\n\f\r \"&'/<=>`".split("")]],unquoted:[["\t\n\f\r &>".split(""),"\0\t\n\f\r \"&'<=>`".split("")],["\0\t\n\f\r \"&'<=>`".split(""),"\0\t\n\f\r \"&'<=>`".split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function yo(e,t,n){const r=function(e,t){const n=is(t);let r=t,i=ss;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&Js.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(Qs,to);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!Qs.test(e)){let n=e.replace(Zs,eo);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}i=_s}return new i(r,t)}(e.schema,t),i=e.settings.allowParseErrors&&"html"===e.schema.space?0:1,s=e.settings.allowDangerousCharacters?0:1;let o,a=e.quote;if(!r.overloadedBoolean||n!==r.attribute&&""!==n?!r.boolean&&!r.overloadedBoolean||"string"==typeof n&&n!==r.attribute&&""!==n||(n=Boolean(n)):n=!0,null==n||!1===n||"number"==typeof n&&Number.isNaN(n))return"";const l=$s(r.attribute,Object.assign({},e.settings.characterReferences,{subset:bo.name[i][s]}));return!0===n?l:(n=Array.isArray(n)?(r.commaSeparated?Ys:no)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n?l:(e.settings.preferUnquoted&&(o=$s(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:bo.unquoted[i][s]}))),o!==n&&(e.settings.quoteSmart&&Ws(n,a)>Ws(n,e.alternative)&&(a=e.alternative),o=a+$s(n,Object.assign({},e.settings.characterReferences,{subset:("'"===a?bo.single:bo.double)[i][s],attribute:!0}))+a),l+(o?"="+o:o)))}const vo=["<","&"];function wo(e,t,n,r){return!n||"element"!==n.type||"script"!==n.tagName&&"style"!==n.tagName?$s(e.value,Object.assign({},r.settings.characterReferences,{subset:vo})):e.value}const xo=function(e,t){const n=t||{};function r(t,...n){let i=r.invalid;const s=r.handlers;if(t&&zs.call(t,e)){const n=String(t[e]);i=zs.call(s,n)?s[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}("type",{invalid:function(e){throw new Error("Expected node, not `"+e+"`")},unknown:function(e){throw new Error("Cannot compile unknown node `"+e.type+"`")},handlers:{comment:function(e,t,n,r){return r.settings.bogusComments?"<?"+$s(e.value,Object.assign({},r.settings.characterReferences,{subset:Xs}))+">":"\x3c!--"+e.value.replace(Gs,function(e){return $s(e,Object.assign({},r.settings.characterReferences,{subset:Ks}))})+"--\x3e"},doctype:function(e,t,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"},element:function(e,t,n,r){const i=r.schema,s="svg"!==i.space&&r.settings.omitOptionalTags;let o="svg"===i.space?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase());const a=[];let l;"html"===i.space&&"svg"===e.tagName&&(r.schema=Ls);const c=function(e,t){const n=[];let r,i=-1;if(t)for(r in t)if(null!==t[r]&&void 0!==t[r]){const i=yo(e,r,t[r]);i&&n.push(i)}for(;++i<n.length;){const t=e.settings.tightAttributes?n[i].charAt(n[i].length-1):void 0;i!==n.length-1&&'"'!==t&&"'"!==t&&(n[i]+=" ")}return n.join("")}(r,e.properties),d=r.all("html"===i.space&&"template"===e.tagName?e.content:e);return r.schema=i,d&&(o=!1),!c&&s&&go(e,t,n)||(a.push("<",e.tagName,c?" "+c:""),o&&("svg"===i.space||r.settings.closeSelfClosing)&&(l=c.charAt(c.length-1),(!r.settings.tightSelfClosing||"/"===l||l&&'"'!==l&&"'"!==l)&&a.push(" "),a.push("/")),a.push(">")),a.push(d),o||s&&po(e,t,n)||a.push("</"+e.tagName+">"),a.join("")},raw:function(e,t,n,r){return r.settings.allowDangerousHtml?e.value:wo(e,0,n,r)},root:function(e,t,n,r){return r.all(e)},text:wo}}),ko={},So={},Co=[];function Mo(e,t,n){return xo(e,t,n,this)}function To(e){const t=[],n=e&&e.children||Co;let r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join("")}function Lo(e,t){const n="string"==typeof e?{}:{...e.colorReplacements},r="string"==typeof e?e:e.name;for(const[e,i]of Object.entries(t?.colorReplacements||{}))"string"==typeof i?n[e]=i:e===r&&Object.assign(n,i);return n}function zo(e,t){return e&&t?.[e?.toLowerCase()]||e}async function Ao(e){return Promise.resolve("function"==typeof e?e():e).then(e=>e.default||e)}function Ro(e){return!e||["plaintext","txt","text","plain"].includes(e)}function Po(e){return"ansi"===e||Ro(e)}function No(e){return"none"===e}function Eo(e){return No(e)}function Oo(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],"string"==typeof e.properties.class&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);const n=Array.isArray(t)?t:t.split(/\s+/g);for(const t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}function Io(e,t=!1){const n=e.split(/(\r?\n)/g);let r=0;const i=[];for(let e=0;e<n.length;e+=2){const s=t?n[e]+(n[e+1]||""):n[e];i.push([s,r]),r+=n[e].length,r+=n[e+1]?.length||0}return i}const Bo="light-dark()",Do=["color","background-color"];function Vo(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&Qr.Italic&&(t["font-style"]="italic"),e.fontStyle&Qr.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&Qr.Underline&&n.push("underline"),e.fontStyle&Qr.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function Ho(e){return"string"==typeof e?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(";")}const jo=new WeakMap;function Fo(e,t){jo.set(e,t)}function Uo(e){return jo.get(e)}class qo{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(e,t){return new qo(Object.fromEntries((n=t,Array.isArray(n)?n:[n]).map(e=>[e,es])),e);var n}constructor(...e){if(2===e.length){const[t,n]=e;this.lang=n,this._stacks=t}else{const[t,n,r]=e;this.lang=n,this._stacks={[r]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return function(e){const t=[],n=new Set;return function e(r){if(n.has(r))return;n.add(r);const i=r?.nameScopesList?.scopeName;i&&t.push(i),r.parent&&e(r.parent)}(e),t}(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function $o(){const e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=function(e){if("number"==typeof e){if(e<0||e>t.source.length)throw new Ir(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...r.indexToPos(e),offset:e}}{const t=r.lines[e.line];if(void 0===t)throw new Ir(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${r.lines.length}`);let n=e.character;if(n<0&&(n=t.length+n),n<0||n>t.length)throw new Ir(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:n,offset:r.posToIndex(e.line,n)}}};const r=function(e){const t=Io(e,!0).map(([e])=>e);return{lines:t,indexToPos:function(n){if(n===e.length)return{line:t.length-1,character:t[t.length-1].length};let r=n,i=0;for(const e of t){if(r<e.length)break;r-=e.length,i++}return{line:i,character:r}},posToIndex:function(e,n){let r=0;for(let n=0;n<e;n++)r+=t[n].length;return r+=n,r}}}(t.source),i=(t.options.decorations||[]).map(e=>({...e,start:n(e.start),end:n(e.end)}));!function(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new Ir(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){const t=e[r],i=n.start.offset<=t.start.offset&&t.start.offset<n.end.offset,s=n.start.offset<t.end.offset&&t.end.offset<=n.end.offset,o=t.start.offset<=n.start.offset&&n.start.offset<t.end.offset,a=t.start.offset<n.end.offset&&n.end.offset<=t.end.offset;if(i||s||o||a){if(i&&s)continue;if(o&&a)continue;if(o&&n.start.offset===n.end.offset)continue;if(s&&t.start.offset===t.end.offset)continue;throw new Ir(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}(i),e.set(t.meta,{decorations:i,converter:r,source:t.source})}return e.get(t.meta)}return{name:"shiki:decorations",tokens(e){if(!this.options.decorations?.length)return;const n=function(e,t){const n=Array.from(t instanceof Set?t:new Set(t)).sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{const t=n.filter(t=>e.offset<t&&t<e.offset+e.content.length).map(t=>t-e.offset).sort((e,t)=>e-t);return t.length?function(e,t){let n=0;const r=[];for(const i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}(e,t):e})):e}(e,t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]));return n},code(e){if(!this.options.decorations?.length)return;const n=t(this),r=Array.from(e.children).filter(e=>"element"===e.type&&"span"===e.tagName);if(r.length!==n.converter.lines.length)throw new Ir(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function i(e,t,n,i){const s=r[e];let a="",l=-1,c=-1;if(0===t&&(l=0),0===n&&(c=0),n===Number.POSITIVE_INFINITY&&(c=s.children.length),-1===l||-1===c)for(let e=0;e<s.children.length;e++)a+=Go(s.children[e]),-1===l&&a.length===t&&(l=e+1),-1===c&&a.length===n&&(c=e+1);if(-1===l)throw new Ir(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(-1===c)throw new Ir(`Failed to find end index for decoration ${JSON.stringify(i.end)}`);const d=s.children.slice(l,c);if(i.alwaysWrap||d.length!==s.children.length)if(i.alwaysWrap||1!==d.length||"element"!==d[0].type){const e={type:"element",tagName:"span",properties:{},children:d};o(e,i,"wrapper"),s.children.splice(l,d.length,e)}else o(d[0],i,"token");else o(s,i,"line")}function s(e,t){r[e]=o(r[e],t,"line")}function o(e,t,n){const r=t.properties||{},i=t.transform||(e=>e);return e.tagName=t.tagName||"span",e.properties={...e.properties,...r,class:e.properties.class},t.properties?.class&&Oo(e,t.properties.class),i(e,n)||e}const a=[],l=n.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset);for(const e of l){const{start:t,end:n}=e;if(t.line===n.line)i(t.line,t.character,n.character,e);else if(t.line<n.line){i(t.line,t.character,Number.POSITIVE_INFINITY,e);for(let r=t.line+1;r<n.line;r++)a.unshift(()=>s(r,e));i(n.line,0,n.character,e)}}a.forEach(e=>e())}}}function Go(e){return"text"===e.type?e.value:"element"===e.type?e.children.map(Go).join(""):""}const Xo=[$o()];function Ko(e){const t=function(e){const t=[],n=[],r=[];for(const i of e)switch(i.enforce){case"pre":t.push(i);break;case"post":n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...Xo]}var Wo=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],Yo={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function Zo(e,t){const n=e.indexOf("",t);if(-1!==n&&"["===e[n+1]){const t=e.indexOf("m",n);if(-1!==t)return{sequence:e.substring(n+2,t).split(";"),startPosition:n,position:t+1}}return{position:e.length}}function Qo(e){const t=e.shift();if("2"===t){const t=e.splice(0,3).map(e=>Number.parseInt(e));if(3!==t.length||t.some(e=>Number.isNaN(e)))return;return{type:"rgb",rgb:t}}if("5"===t){const t=e.shift();if(t)return{type:"table",index:Number(t)}}}function Jo(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const r=Number.parseInt(n);if(!Number.isNaN(r))if(0===r)t.push({type:"resetAll"});else if(r<=9)Yo[r]&&t.push({type:"setDecoration",value:Yo[r]});else if(r<=29){const e=Yo[r-20];e&&(t.push({type:"resetDecoration",value:e}),"dim"===e&&t.push({type:"resetDecoration",value:"bold"}))}else if(r<=37)t.push({type:"setForegroundColor",value:{type:"named",name:Wo[r-30]}});else if(38===r){const n=Qo(e);n&&t.push({type:"setForegroundColor",value:n})}else if(39===r)t.push({type:"resetForegroundColor"});else if(r<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:Wo[r-40]}});else if(48===r){const n=Qo(e);n&&t.push({type:"setBackgroundColor",value:n})}else 49===r?t.push({type:"resetBackgroundColor"}):53===r?t.push({type:"setDecoration",value:"overline"}):55===r?t.push({type:"resetDecoration",value:"overline"}):r>=90&&r<=97?t.push({type:"setForegroundColor",value:{type:"named",name:Wo[r-90+8]}}):r>=100&&r<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:Wo[r-100+8]}})}return t}var ea={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function ta(e=ea){function t(t){return e[t]}function n(e){return`#${e.map(e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,"0")).join("")}`}let r;return{value:function(e){switch(e.type){case"named":return t(e.name);case"rgb":return n(e.rgb);case"table":return i=e.index,function(){if(r)return r;r=[];for(let e=0;e<Wo.length;e++)r.push(t(Wo[e]));let e=[0,95,135,175,215,255];for(let t=0;t<6;t++)for(let i=0;i<6;i++)for(let s=0;s<6;s++)r.push(n([e[t],e[i],e[s]]));let i=8;for(let e=0;e<24;e++,i+=10)r.push(n([i,i,i]));return r}()[i]}var i}}}function na(e,t,n={}){const{lang:r="text",theme:i=e.getLoadedThemes()[0]}=n;if(Ro(r)||No(i))return Io(t).map(e=>[{content:e[0],offset:e[1]}]);const{theme:s,colorMap:o}=e.setTheme(i);if("ansi"===r)return function(e,t,n){const r=Lo(e,n),i=Io(t),s=ta(Object.fromEntries(Wo.map(t=>[t,e.colors?.[`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`]]))),o=function(){let e=null,t=null,n=new Set;return{parse(r){const i=[];let s=0;do{const o=Zo(r,s),a=o.sequence?r.substring(s,o.startPosition):r.substring(s);if(a.length>0&&i.push({value:a,foreground:e,background:t,decorations:new Set(n)}),o.sequence){const r=Jo(o.sequence);for(const i of r)"resetAll"===i.type?(e=null,t=null,n.clear()):"resetForegroundColor"===i.type?e=null:"resetBackgroundColor"===i.type?t=null:"resetDecoration"===i.type&&n.delete(i.value);for(const i of r)"setForegroundColor"===i.type?e=i.value:"setBackgroundColor"===i.type?t=i.value:"setDecoration"===i.type&&n.add(i.value)}s=o.position}while(s<r.length);return i}}}();return i.map(t=>o.parse(t[0]).map(n=>{let i,o;n.decorations.has("reverse")?(i=n.background?s.value(n.background):e.bg,o=n.foreground?s.value(n.foreground):e.fg):(i=n.foreground?s.value(n.foreground):e.fg,o=n.background?s.value(n.background):void 0),i=zo(i,r),o=zo(o,r),n.decorations.has("dim")&&(i=function(e){const t=e.match(/#([0-9a-f]{3})([0-9a-f]{3})?([0-9a-f]{2})?/);if(t){if(t[3]){const e=Math.round(Number.parseInt(t[3],16)/2).toString(16).padStart(2,"0");return`#${t[1]}${t[2]}${e}`}return t[2]?`#${t[1]}${t[2]}80`:`#${Array.from(t[1]).map(e=>`${e}${e}`).join("")}80`}const n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}(i));let a=Qr.None;return n.decorations.has("bold")&&(a|=Qr.Bold),n.decorations.has("italic")&&(a|=Qr.Italic),n.decorations.has("underline")&&(a|=Qr.Underline),n.decorations.has("strikethrough")&&(a|=Qr.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:a}}))}(s,t,n);const a=e.getLanguage(r);if(n.grammarState){if(n.grammarState.lang!==a.name)throw new Ir(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${a.name}"`);if(!n.grammarState.themes.includes(s.name))throw new Ir(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${s.name}"`)}return function(e,t,n,r,i){const s=ra(e,t,n,r,i),o=new qo(ra(e,t,n,r,i).stateStack,t.name,n.name);return Fo(s.tokens,o),s.tokens}(t,a,s,o,n)}function ra(e,t,n,r,i){const s=Lo(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:a=500}=i,l=Io(e);let c=i.grammarState?function(e,t){if(!(e instanceof qo))throw new Ir("Invalid grammar state");return e.getInternalStack(t)}(i.grammarState,n.name)??es:null!=i.grammarContextCode?ra(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack:es,d=[];const u=[];for(let e=0,h=l.length;e<h;e++){const[h,p]=l[e];if(""===h){d=[],u.push([]);continue}if(o>0&&h.length>=o){d=[],u.push([{content:h,offset:p,color:"",fontStyle:0}]);continue}let m,f,_;i.includeExplanation&&(m=t.tokenizeLine(h,c,a),f=m.tokens,_=0);const g=t.tokenizeLine2(h,c,a),b=g.tokens.length/2;for(let e=0;e<b;e++){const t=g.tokens[2*e],o=e+1<b?g.tokens[2*e+2]:h.length;if(t===o)continue;const a=g.tokens[2*e+1],l=zo(r[ri.getForeground(a)],s),c=ri.getFontStyle(a),u={content:h.substring(t,o),offset:p+t,color:l,fontStyle:c};if(i.includeExplanation){const e=[];if("scopeName"!==i.includeExplanation)for(const t of n.settings){let n;switch(typeof t.scope){case"string":n=t.scope.split(/,/).map(e=>e.trim());break;case"object":n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(/ /))})}u.explanation=[];let r=0;for(;t+r<o;){const t=f[_],n=h.substring(t.startIndex,t.endIndex);r+=n.length,u.explanation.push({content:n,scopes:"scopeName"===i.includeExplanation?ia(t.scopes):sa(e,t.scopes)}),_+=1}}d.push(u)}u.push(d),d=[],c=g.ruleStack}return{tokens:u,stateStack:c}}function ia(e){return e.map(e=>({scopeName:e}))}function sa(e,t){const n=[];for(let r=0,i=t.length;r<i;r++){const i=t[r];n[r]={scopeName:i,themeMatches:la(e,i,t.slice(0,r))}}return n}function oa(e,t){return e===t||t.substring(0,e.length)===e&&"."===t[e.length]}function aa(e,t,n){if(!oa(e[e.length-1],t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)oa(e[r],n[i])&&(r-=1),i-=1;return-1===r}function la(e,t,n){const r=[];for(const{selectors:i,settings:s}of e)for(const e of i)if(aa(e,t,n)){r.push(s);break}return r}function ca(e,t,n){const r=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),i=r.map(r=>{const i=na(e,t,{...n,theme:r.theme});return{tokens:i,state:Uo(i),theme:"string"==typeof r.theme?r.theme:r.theme.name}}),s=function(...e){const t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){const i=e.map(e=>e[r]),s=t.map(()=>[]);t.forEach((e,t)=>e.push(s[t]));const o=i.map(()=>0),a=i.map(e=>e[0]);for(;a.every(e=>e);){const e=Math.min(...a.map(e=>e.content.length));for(let t=0;t<n;t++){const n=a[t];n.content.length===e?(s[t].push(n),o[t]+=1,a[t]=i[t][o[t]]):(s[t].push({...n,content:n.content.slice(0,e)}),a[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}(...i.map(e=>e.tokens)),o=s[0].map((e,t)=>e.map((e,i)=>{const o={content:e.content,variants:{},offset:e.offset};return"includeExplanation"in n&&n.includeExplanation&&(o.explanation=e.explanation),s.forEach((e,n)=>{const{content:s,explanation:a,offset:l,...c}=e[t][i];o.variants[r[n].color]=c}),o})),a=i[0].state?new qo(Object.fromEntries(i.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),i[0].state.lang):void 0;return a&&Fo(o,a),o}function da(e,t,n){let r,i,s,o,a,l;if("themes"in n){const{defaultColor:c="light",cssVariablePrefix:d="--shiki-",colorsRendering:u="css-vars"}=n,h=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===c?-1:t.color===c?1:0);if(0===h.length)throw new Ir("`themes` option must not be empty");const p=ca(e,t,n);if(l=Uo(p),c&&Bo!==c&&!h.find(e=>e.color===c))throw new Ir(`\`themes\` option must contain the defaultColor key \`${c}\``);const m=h.map(t=>e.getTheme(t.theme)),f=h.map(e=>e.color);s=p.map(e=>e.map(e=>function(e,t,n,r,i="css-vars"){const s={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>Vo(e.variants[t])),a=new Set(o.flatMap(e=>Object.keys(e))),l={},c=(e,r)=>{const i="color"===r?"":"background-color"===r?"-bg":`-${r}`;return n+t[e]+("color"===r?"":i)};return o.forEach((e,n)=>{for(const s of a){const a=e[s]||"inherit";if(0===n&&r&&Do.includes(s))if(r===Bo&&o.length>1){const e=t.findIndex(e=>"light"===e),r=t.findIndex(e=>"dark"===e);if(-1===e||-1===r)throw new Ir('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const d=o[e][s]||"inherit",u=o[r][s]||"inherit";l[s]=`light-dark(${d}, ${u})`,"css-vars"===i&&(l[c(n,s)]=a)}else l[s]=a;else"css-vars"===i&&(l[c(n,s)]=a)}}),s.htmlStyle=l,s}(e,f,d,c,u))),l&&Fo(s,l);const _=h.map(e=>Lo(e.theme,n));i=ua(h,m,_,d,c,"fg",u),r=ua(h,m,_,d,c,"bg",u),o=`shiki-themes ${m.map(e=>e.name).join(" ")}`,a=c?void 0:[i,r].join(";")}else{if(!("theme"in n))throw new Ir("Invalid options, either `theme` or `themes` must be provided");{const a=Lo(n.theme,n);s=na(e,t,n);const c=e.getTheme(n.theme);r=zo(c.bg,a),i=zo(c.fg,a),o=c.name,l=Uo(s)}}return{tokens:s,fg:i,bg:r,themeName:o,rootStyle:a,grammarState:l}}function ua(e,t,n,r,i,s,o){return e.map((a,l)=>{const c=zo(t[l][s],n[l])||"inherit",d=`${r+a.color}${"bg"===s?"-bg":""}:${c}`;if(0===l&&i){if(i===Bo&&e.length>1){const r=e.findIndex(e=>"light"===e.color),i=e.findIndex(e=>"dark"===e.color);if(-1===r||-1===i)throw new Ir('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${zo(t[r][s],n[r])||"inherit"}, ${zo(t[i][s],n[i])||"inherit"});${d}`}return c}return"css-vars"===o?d:null}).filter(e=>!!e).join(";")}function ha(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>ha(e,t,n),codeToTokens:(t,n)=>da(e,t,n)}){let i=t;for(const e of Ko(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:s,fg:o,bg:a,themeName:l,rootStyle:c,grammarState:d}=da(e,i,n);const{mergeWhitespaces:u=!0,mergeSameStyleTokens:h=!1}=n;!0===u?s=function(e){return e.map(e=>{const t=[];let n="",r=0;return e.forEach((i,s)=>{const o=!(i.fontStyle&&(i.fontStyle&Qr.Underline||i.fontStyle&Qr.Strikethrough));o&&i.content.match(/^\s+$/)&&e[s+1]?(r||(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=0,n=""):t.push(i)}),t})}(s):"never"===u&&(s=function(e){return e.map(e=>e.flatMap(e=>{if(e.content.match(/^\s+$/))return e;const t=e.content.match(/^(\s*)(.*?)(\s*)$/);if(!t)return e;const[,n,r,i]=t;if(!n&&!i)return e;const s=[{...e,offset:e.offset+n.length,content:r}];return n&&s.unshift({content:n,offset:e.offset}),i&&s.push({content:i,offset:e.offset+n.length+r.length}),s}))}(s)),h&&(s=function(e){return e.map(e=>{const t=[];for(const n of e){if(0===t.length){t.push({...n});continue}const e=t[t.length-1],r=Ho(e.htmlStyle||Vo(e)),i=Ho(n.htmlStyle||Vo(n)),s=e.fontStyle&&(e.fontStyle&Qr.Underline||e.fontStyle&Qr.Strikethrough),o=n.fontStyle&&(n.fontStyle&Qr.Underline||n.fontStyle&Qr.Strikethrough);s||o||r!==i?t.push({...n}):e.content+=n.content}return t})}(s));const p={...r,get source(){return i}};for(const e of Ko(n))s=e.tokens?.call(p,s)||s;return function(e,t,n,r=Uo(e)){const i=Ko(t),s=[],o={type:"root",children:[]},{structure:a="classic",tabindex:l="0"}=t;let c={type:"element",tagName:"pre",properties:{class:`shiki ${t.themeName||""}`,style:t.rootStyle||`background-color:${t.bg};color:${t.fg}`,...!1!==l&&null!=l?{tabindex:l.toString()}:{},...Object.fromEntries(Array.from(Object.entries(t.meta||{})).filter(([e])=>!e.startsWith("_")))},children:[]},d={type:"element",tagName:"code",properties:{},children:s};const u=[],h={...n,structure:a,addClassToHast:Oo,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return c},get code(){return d},get lines(){return u}};if(e.forEach((e,t)=>{t&&("inline"===a?o.children.push({type:"element",tagName:"br",properties:{},children:[]}):"classic"===a&&s.push({type:"text",value:"\n"}));let n={type:"element",tagName:"span",properties:{class:"line"},children:[]},r=0;for(const s of e){let e={type:"element",tagName:"span",properties:{...s.htmlAttrs},children:[{type:"text",value:s.content}]};const l=Ho(s.htmlStyle||Vo(s));l&&(e.properties.style=l);for(const o of i)e=o?.span?.call(h,e,t+1,r,n,s)||e;"inline"===a?o.children.push(e):"classic"===a&&n.children.push(e),r+=s.content.length}if("classic"===a){for(const e of i)n=e?.line?.call(h,n,t+1)||n;u.push(n),s.push(n)}}),"classic"===a){for(const e of i)d=e?.code?.call(h,d)||d;c.children.push(d);for(const e of i)c=e?.pre?.call(h,c)||c;o.children.push(c)}let p=o;for(const e of i)p=e?.root?.call(h,p)||p;return r&&Fo(p,r),p}(s,{...n,fg:o,bg:a,themeName:l,rootStyle:c},p,d)}function pa(e,t,n){const r={meta:{},options:n,codeToHast:(t,n)=>ha(e,t,n),codeToTokens:(t,n)=>da(e,t,n)};let i=function(e,t){const n=t||ko,r=n.quote||'"',i='"'===r?"'":'"';if('"'!==r&&"'"!==r)throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:Mo,all:To,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||ts,characterReferences:n.characterReferences||So,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:"svg"===n.space?Ls:Ts,quote:r,alternative:i}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}(ha(e,t,n,r));for(const e of Ko(n))i=e.postprocess?.call(r,i,n)||i;return i}const ma="__shiki_resolved";function fa(e){if(e?.[ma])return e;const t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||="dark",t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){const e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(r=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!r&&t?.colors?.["editor.foreground"]&&(r=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),r||(r="light"===t.type?"#333333":"#bbbbbb"),n||(n="light"===t.type?"#fffffe":"#1e1e1e"),t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0;const s=new Map;function o(e){if(s.has(e))return s.get(e);i+=1;const n=`#${i.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?o(e):(s.set(e,n),n)}t.settings=t.settings.map(e=>{const n=e.settings?.foreground&&!e.settings.foreground.startsWith("#"),r=e.settings?.background&&!e.settings.background.startsWith("#");if(!n&&!r)return e;const i={...e,settings:{...e.settings}};if(n){const n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,i.settings.foreground=n}if(r){const n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,i.settings.background=n}return i});for(const e of Object.keys(t.colors||{}))if(("editor.foreground"===e||"editor.background"===e||e.startsWith("terminal.ansi"))&&!t.colors[e]?.startsWith("#")){const n=o(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,ma,{enumerable:!1,writable:!1,value:!0}),t}async function _a(e){return Array.from(new Set((await Promise.all(e.filter(e=>!Po(e)).map(async e=>await Ao(e).then(e=>Array.isArray(e)?e:[e])))).flat()))}async function ga(e){return(await Promise.all(e.map(async e=>Eo(e)?null:fa(await Ao(e))))).filter(e=>!!e)}class ba extends Error{constructor(e){super(e),this.name="ShikiError"}}class ya extends Ji{constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(e){return"string"==typeof e?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){const t=fa(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=Xr.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){if(this._alias[e]){const t=new Set([e]);for(;this._alias[e];){if(e=this._alias[e],t.has(e))throw new ba(`Circular alias \`${Array.from(t).join(" -> ")} -> ${e}\``);t.add(e)}}return this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;const t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);const n={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(const e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(const t of e)this.resolveEmbeddedLanguages(t);const t=Array.from(this._langGraph.entries()),n=t.filter(([e,t])=>!t);if(n.length){const e=t.filter(([e,t])=>t&&t.embeddedLangs?.some(e=>n.map(([e])=>e).includes(e))).filter(e=>!n.includes(e));throw new ba(`Missing languages ${n.map(([e])=>`\`${e}\``).join(", ")}, required by ${e.map(([e])=>`\`${e}\``).join(", ")}`)}for(const[e,n]of t)this._resolver.addLanguage(n);for(const[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(e){if(this._langMap.set(e.name,e),this._langGraph.set(e.name,e),e.embeddedLangs)for(const t of e.embeddedLangs)this._langGraph.set(t,this._langMap.get(t))}}class va{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){const t=e.split(".");let n=[];for(let e=1;e<=t.length;e++){const r=t.slice(0,e).join(".");n=[...n,...this._injections.get(r)||[]]}return n}}let wa=0;async function xa(e){e.engine||function(e,t=3){t>3||console.trace(`[SHIKI DEPRECATE]: ${e}`)}("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,r]=await Promise.all([ga(e.themes||[]),_a(e.langs||[]),e.engine]);return function(e){wa+=1,!1!==e.warnings&&wa>=10&&wa%10==0&&console.warn(`[Shiki] ${wa} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new ba("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(fa),i=new va(e.engine,n),s=new ya(i,r,n,e.langAlias);let o;function a(e){if("none"===e)return{bg:"",fg:"",name:"none",settings:[],type:"dark"};d();const t=s.getTheme(e);if(!t)throw new ba(`Theme \`${e}\` not found, you may need to load it first`);return t}function l(...e){d(),s.loadLanguages(e.flat(1))}function c(...e){d();for(const t of e.flat(1))s.loadTheme(t)}function d(){if(t)throw new ba("Shiki instance has been disposed")}function u(){t||(t=!0,s.dispose(),wa-=1)}return{setTheme:function(e){d();const t=a(e);return o!==e&&(s.setTheme(t),o=e),{theme:t,colorMap:s.getColorMap()}},getTheme:a,getLanguage:function(e){d();const t=s.getGrammar("string"==typeof e?e:e.name);if(!t)throw new ba(`Language \`${e}\` not found, you may need to load it first`);return t},getLoadedThemes:function(){return d(),s.getLoadedThemes()},getLoadedLanguages:function(){return d(),s.getLoadedLanguages()},loadLanguage:async function(...e){return l(await _a(e))},loadLanguageSync:l,loadTheme:async function(...e){return d(),c(await ga(e))},loadThemeSync:c,dispose:u,[Symbol.dispose]:u}}({...e,themes:t,langs:n,engine:r})}async function ka(e){const t=await xa(e);return{getLastGrammarState:(...e)=>function(...e){if(2===e.length)return Uo(e[1]);const[t,n,r={}]=e,{lang:i="text",theme:s=t.getLoadedThemes()[0]}=r;if(Ro(i)||No(s))throw new Ir("Plain language does not have grammar state");if("ansi"===i)throw new Ir("ANSI language does not have grammar state");const{theme:o,colorMap:a}=t.setTheme(s),l=t.getLanguage(i);return new qo(ra(n,l,o,a,r).stateStack,l.name,o.name)}(t,...e),codeToTokensBase:(e,n)=>na(t,e,n),codeToTokensWithThemes:(e,n)=>ca(t,e,n),codeToTokens:(e,n)=>da(t,e,n),codeToHast:(e,n)=>ha(t,e,n),codeToHtml:(e,n)=>pa(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function Sa(e){const t=e.langs,n=e.themes,r=e.engine;return async function(e){function i(n){if("string"==typeof n){if(Po(n))return[];n=e.langAlias?.[n]||n;const r=t[n];if(!r)throw new Ir(`Language \`${n}\` is not included in this bundle. You may want to load it from external source.`);return r}return n}function s(e){if(Eo(e))return"none";if("string"==typeof e){const t=n[e];if(!t)throw new Ir(`Theme \`${e}\` is not included in this bundle. You may want to load it from external source.`);return t}return e}const o=(e.themes??[]).map(e=>s(e)),a=(e.langs??[]).map(e=>i(e)),l=await ka({engine:e.engine??r(),...e,themes:o,langs:a});return{...l,loadLanguage:(...e)=>l.loadLanguage(...e.map(i)),loadTheme:(...e)=>l.loadTheme(...e.map(s)),getBundledLanguages:()=>t,getBundledThemes:()=>n}}}function Ca(e,t){const n=function(e){let t;return async function(n={}){if(t){const e=await t;return await Promise.all([e.loadTheme(...n.themes||[]),e.loadLanguage(...n.langs||[])]),e}return t=e({...n,themes:n.themes||[],langs:n.langs||[]}),t}}(e);async function r(e,r){const i=await n({langs:[r.lang],themes:"theme"in r?[r.theme]:Object.values(r.themes)}),s=await(t?.guessEmbeddedLanguages?.(e,r.lang,i));return s&&await i.loadLanguage(...s),i}return{getSingletonHighlighter:e=>n(e),codeToHtml:async(e,t)=>(await r(e,t)).codeToHtml(e,t),codeToHast:async(e,t)=>(await r(e,t)).codeToHast(e,t),codeToTokens:async(e,t)=>(await r(e,t)).codeToTokens(e,t),codeToTokensBase:async(e,t)=>(await r(e,t)).codeToTokensBase(e,t),codeToTokensWithThemes:async(e,t)=>(await r(e,t)).codeToTokensWithThemes(e,t),getLastGrammarState:async(e,t)=>(await n({langs:[t.lang],themes:[t.theme]})).getLastGrammarState(e,t)}}class Ma extends Error{constructor(e){super(e),this.name="ShikiError"}}function Ta(){return"undefined"!=typeof performance?performance.now():Date.now()}const La=(e,t)=>e+(t-e%t)%t;var za=Object.defineProperty,Aa=(e,t,n)=>((e,t,n)=>t in e?za(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);let Ra=null;class Pa{constructor(e){Aa(this,"utf16Length"),Aa(this,"utf8Length"),Aa(this,"utf16Value"),Aa(this,"utf8Value"),Aa(this,"utf16OffsetToUtf8"),Aa(this,"utf8OffsetToUtf16");const t=e.length,n=Pa._utf8ByteLength(e),r=n!==t,i=r?new Uint32Array(t+1):null;r&&(i[t]=n);const s=r?new Uint32Array(n+1):null;r&&(s[n]=t);const o=new Uint8Array(n);let a=0;for(let n=0;n<t;n++){const l=e.charCodeAt(n);let c=l,d=!1;if(l>=55296&&l<=56319&&n+1<t){const t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(c=65536+(l-55296<<10)|t-56320,d=!0)}r&&(i[n]=a,d&&(i[n+1]=a),c<=127?s[a+0]=n:c<=2047?(s[a+0]=n,s[a+1]=n):c<=65535?(s[a+0]=n,s[a+1]=n,s[a+2]=n):(s[a+0]=n,s[a+1]=n,s[a+2]=n,s[a+3]=n)),c<=127?o[a++]=c:c<=2047?(o[a++]=192|(1984&c)>>>6,o[a++]=128|(63&c)>>>0):c<=65535?(o[a++]=224|(61440&c)>>>12,o[a++]=128|(4032&c)>>>6,o[a++]=128|(63&c)>>>0):(o[a++]=240|(1835008&c)>>>18,o[a++]=128|(258048&c)>>>12,o[a++]=128|(4032&c)>>>6,o[a++]=128|(63&c)>>>0),d&&n++}this.utf16Length=t,this.utf8Length=n,this.utf16Value=e,this.utf8Value=o,this.utf16OffsetToUtf8=i,this.utf8OffsetToUtf16=s}static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n<r;n++){const i=e.charCodeAt(n);let s=i,o=!1;if(i>=55296&&i<=56319&&n+1<r){const t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(s=65536+(i-55296<<10)|t-56320,o=!0)}t+=s<=127?1:s<=2047?2:s<=65535?3:4,o&&n++}return t}createString(e){const t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}}const Na=class e{constructor(t){if(Aa(this,"id",++e.LAST_ID),Aa(this,"_onigBinding"),Aa(this,"content"),Aa(this,"utf16Length"),Aa(this,"utf8Length"),Aa(this,"utf16OffsetToUtf8"),Aa(this,"utf8OffsetToUtf16"),Aa(this,"ptr"),!Ra)throw new Ma("Must invoke loadWasm first.");this._onigBinding=Ra,this.content=t;const n=new Pa(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||(e._sharedPtr=Ra.omalloc(1e4)),e._sharedPtrInUse=!0,Ra.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(Ra)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};Aa(Na,"LAST_ID",0),Aa(Na,"_sharedPtr",0),Aa(Na,"_sharedPtrInUse",!1);let Ea,Oa=Na;class Ia{constructor(e){if(Aa(this,"_onigBinding"),Aa(this,"_ptr"),!Ra)throw new Ma("Must invoke loadWasm first.");const t=[],n=[];for(let r=0,i=e.length;r<i;r++){const i=new Pa(e[r]);t[r]=i.createString(Ra),n[r]=i.utf8Length}const r=Ra.omalloc(4*e.length);Ra.HEAPU32.set(t,r/4);const i=Ra.omalloc(4*e.length);Ra.HEAPU32.set(n,i/4);const s=Ra.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)Ra.ofree(t[n]);Ra.ofree(i),Ra.ofree(r),0===s&&function(e){throw new Ma(e.UTF8ToString(e.getLastOnigError()))}(Ra),this._onigBinding=Ra,this._ptr=s}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let r=0;if("number"==typeof n&&(r=n),"string"==typeof e){e=new Oa(e);const n=this._findNextMatchSync(e,t,!1,r);return e.dispose(),n}return this._findNextMatchSync(e,t,!1,r)}_findNextMatchSync(e,t,n,r){const i=this._onigBinding,s=i.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),r);if(0===s)return null;const o=i.HEAPU32;let a=s/4;const l=o[a++],c=o[a++],d=[];for(let t=0;t<c;t++){const n=e.convertUtf8OffsetToUtf16(o[a++]),r=e.convertUtf8OffsetToUtf16(o[a++]);d[t]={start:n,end:r,length:r-n}}return{index:l,captureIndices:d}}}function Ba(e){return Ea||(Ea=async function(){Ra=await async function(e){let t,n;const r={};function i(e){n=e,r.HEAPU8=new Uint8Array(e),r.HEAPU32=new Uint32Array(e)}function s(e){try{return t.grow(e-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}const o="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function a(e,t){return e?function(e,t,n=1024){const r=t+n;let i=t;for(;e[i]&&!(i>=r);)++i;if(i-t>16&&e.buffer&&o)return o.decode(e.subarray(t,i));let s="";for(;t<i;){let n=e[t++];if(!(128&n)){s+=String.fromCharCode(n);continue}const r=63&e[t++];if(192==(224&n)){s+=String.fromCharCode((31&n)<<6|r);continue}const i=63&e[t++];if(n=224==(240&n)?(15&n)<<12|r<<6|i:(7&n)<<18|r<<12|i<<6|63&e[t++],n<65536)s+=String.fromCharCode(n);else{const e=n-65536;s+=String.fromCharCode(55296|e>>10,56320|1023&e)}}return s}(r.HEAPU8,e,t):""}const l={emscripten_get_now:Ta,emscripten_memcpy_big:function(e,t,n){r.HEAPU8.copyWithin(e,t,t+n)},emscripten_resize_heap:function(e){const t=r.HEAPU8.length,n=2147483648;if((e>>>=0)>n)return!1;for(let r=1;r<=4;r*=2){let i=t*(1+.2/r);if(i=Math.min(i,e+100663296),s(Math.min(n,La(Math.max(e,i),65536))))return!0}return!1},fd_write:()=>0};return await async function(){const n={env:l,wasi_snapshot_preview1:l},s=await e(n);t=s.memory,i(t.buffer),Object.assign(r,s),r.UTF8ToString=a}(),r}(async t=>{let n=e;var r;return n=await n,"function"==typeof n&&(n=await n(t)),"function"==typeof n&&(n=await n(t)),"function"==typeof n.instantiator?n=await n.instantiator(t):"function"!=typeof n.default?(function(e){return void 0!==e.data}(n)&&(n=n.data),function(e){return"undefined"!=typeof Response&&e instanceof Response}(n)?n="function"==typeof WebAssembly.instantiateStreaming?await(r=n,e=>WebAssembly.instantiateStreaming(r,e))(t):await function(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}(n)(t):function(e){return"undefined"!=typeof ArrayBuffer&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||"undefined"!=typeof Buffer&&Buffer.isBuffer?.(e)||"undefined"!=typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer||"undefined"!=typeof Uint32Array&&e instanceof Uint32Array}(n)||n instanceof WebAssembly.Module?n=await Da(n)(t):"default"in n&&n.default instanceof WebAssembly.Module&&(n=await Da(n.default)(t))):n=await n.default(t),"instance"in n&&(n=n.instance),"exports"in n&&(n=n.exports),n})}(),Ea)}function Da(e){return t=>WebAssembly.instantiate(e,t)}const Va=Sa({langs:Nr,themes:Or,engine:()=>async function(e){return e&&await Ba(e),{createScanner:e=>new Ia(e.map(e=>"string"==typeof e?e:e.source)),createString:e=>new Oa(e)}}(n.e(4709).then(n.bind(n,4709)))}),{codeToHtml:Ha,codeToHast:ja,codeToTokens:Fa,codeToTokensBase:Ua,codeToTokensWithThemes:qa,getSingletonHighlighter:$a,getLastGrammarState:Ga}=Ca(Va,{guessEmbeddedLanguages:function(e,t,n){const r=new Set;for(const t of e.matchAll(/lang=["']([\w-]+)["']/g))r.add(t[1]);for(const t of e.matchAll(/(?:```|~~~)([\w-]+)/g))r.add(t[1]);for(const t of e.matchAll(/\\begin\{([\w-]+)\}/g))r.add(t[1]);if(!n)return Array.from(r);const i=n.getBundledLanguages();return Array.from(r).filter(e=>e&&i[e])}}),Xa=["id","data-type"],Ka=["data-id","onClick"],Wa=["innerHTML"],Ya=["disabled"],Za=(0,c.pM)({__name:"cube-code",props:{cube:{}},setup(e){const{root:t}=e.cube,{stats:n}=t,r=(0,l.KR)(),i=(0,l.KR)(),s=(0,l.KR)(),u=(0,l.KR)();let h;function p(e){if(!e._draglist)return;const t=e._draglist.init();return e.items.length>0&&t<=0?requestAnimationFrame(()=>p(e)):void 0}(0,c.wB)(()=>[e.cube.active_tab_id,e.cube.active_tab?.code],()=>{const t=e.cube.active_tab,n=u.value;t&&n&&(n.value=t.code)},{immediate:!0}),(0,c.wB)(()=>[e.cube.code_html],()=>{const t=e.cube.active_tab,n=u.value,r=n?.previousElementSibling;if(!t||!n||!r)return;const i=n.parentElement;(0,c.dY)(()=>{const t=r.nextElementSibling,n=r.firstElementChild;if(t&&n){if(i){const t=n.style.backgroundColor;if(t.startsWith("rgb")){const n=t.replace("rgb","rgba").replace(")",", 0.85)");e.cube.attrs.codebg=n}else e.cube.attrs.codebg=t;e.cube.attrs.caret=n.style.color}n.style.border="none",n.style.outline="none"}})}),(0,c.sV)(()=>{const t=u.value;t&&(t.value=e.cube.active_tab?.code||"");const n=r.value,a=s.value;if(!n||!a)return;e.cube._draglist=new N.DragList(n,"horizental","data-id","insert"),e.cube._draglist.register_start(()=>{const t=e.cube._draglist;if(!t)return;const n=e.cube.get_upstream_sum_scale();t.scale_h=n.sx,t.scale_v=n.sy}),p(e.cube);const l=i.value;if(!l)return;h=new N.DragDiff(l);let c=e.cube.attrs.width,d=e.cube.attrs.height,m=c,f=d;h.register_down(()=>{c=e.cube.attrs.width,d=e.cube.attrs.height}),h.register_move((e,t)=>{m=Math.round(e+c),f=Math.round(t+d),a.style.width=m+"px",a.style.height=f+"px"}),h.register_up((t,n)=>{if(c===m&&d===f)return;const r=e.cube.courier.get_recorder(),i=Math.round(t+c),s=Math.round(n+d);r.tell(e.cube,o.VL.resize(e.cube.id,i,s)),e.cube.history.record(r)}),h.register_cancel(()=>{e.cube.attrs.width=c,e.cube.attrs.height=d})}),(0,c.hi)(()=>{h?.off()});const m=(0,c.EW)(()=>({"caret-color":e.cube.attrs.caret}));function f(e){e.stopPropagation()}function _(t){const n=t.previousElementSibling;if(t.parentElement,!n)return;const r=t.value,{id:i,courier:s,history:o}=e.cube,a=s.get_recorder();a.tell(e.cube,zr.update(i,e.cube.active_tab_id,r)),o.record(a)}function g(e){const t=e.currentTarget;t.value,_(t)}function b(e){const{hotkeys:n,clipboard:r,history:i}=t,s=e.key.toLowerCase();if([n.data[a.ZS["scope-add"]]].some(t=>n.validate(e,t)))return e.preventDefault();if(t.scope_count_normal>0&&["backspace","delete"].includes(s)){e.preventDefault(),e.stopPropagation();const t=r.delete_scope();return void(t&&i.record(t))}const o=e.currentTarget;if("tab"===s){e.preventDefault(),e.stopPropagation();let t=o.value;const n=o.selectionStart,r=o.selectionEnd;t=t.slice(0,n)+"\t"+t.slice(r),o.value=t,o.selectionStart=n+1,o.selectionEnd=n+1,_(o)}}function y(e){e.preventDefault();const t=e.currentTarget;t.scrollTop=0,t.scrollLeft=0}function v(e,t=50){e.stopPropagation();const n=e.currentTarget;e.deltaY>0?N.DomAnimation.scroll_element(n,t,"horizental"):N.DomAnimation.scroll_element(n,-t,"horizental")}function w(e){const t=e.currentTarget,n=t.firstElementChild,r=t.lastElementChild;if(!n||!r)return;const i=e.shiftKey,{scrollLeft:s,scrollTop:o,scrollWidth:a,scrollHeight:l}=t,c=t.getBoundingClientRect();e.deltaY>0?i?s+c.width<a&&(e.preventDefault(),e.stopPropagation(),N.DomAnimation.scroll_element(t,20,"horizental")):o+c.height<l&&(e.preventDefault(),e.stopPropagation(),N.DomAnimation.scroll_element(t,20,"vertical")):i?s>0&&(e.preventDefault(),e.stopPropagation(),N.DomAnimation.scroll_element(t,-20,"horizental")):o>0&&(e.preventDefault(),e.stopPropagation(),N.DomAnimation.scroll_element(t,-20,"vertical"))}function x(t){(0,pt.uz)(t,e.cube)}return(t,o)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-code",id:t.cube.id,"data-type":(0,l.R1)(a.u0).code,ref_key:"code",ref:s,style:(0,d.Tr)(t.cube.css),onPointerdown:f,onBeforeinput:f,onCompositionstart:f,onContextmenu:x},[(0,c.Lk)("div",{class:"code-tabbar",onWheel:v},[(0,c.Lk)("div",{class:"code-tabs-box",ref_key:"tabsbox",ref:r},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(t.cube.items,n=>((0,c.uX)(),(0,c.CE)("div",{class:"code-tab","data-id":n.id,key:n.id,onClick:()=>function(t){const{courier:n,history:r}=e.cube,i=n.get_recorder();i.tell(e.cube,zr.change_active(e.cube.id,t.id)),r.record(i)}(n)},[(0,c.Lk)("div",{class:(0,d.C4)(["code-tab-name",{"code-active-tab":n.id===t.cube.active_tab_id}])},(0,d.v_)(n.name),3)],8,Ka))),128))],512)],32),(0,c.Lk)("div",{class:"code-box",onWheel:w},[(0,c.Lk)("div",{class:"code-box-inner",style:(0,d.Tr)({background:t.cube.attrs.codebg})},[(0,c.Lk)("span",{class:"code-highlight",onWheel:o[0]||(o[0]=e=>e.preventDefault()),innerHTML:t.cube.code_html},null,40,Wa),(0,c.Lk)("textarea",{disabled:(0,l.R1)(n).is_read_mode,ref_key:"textarea",ref:u,style:(0,d.Tr)(m.value),onKeyup:y,onKeydown:b,autocapitalize:"false",autocomplete:"false",autocorrect:"false",spellcheck:"false",onInput:g},null,44,Ya)],4)],32),(0,c.Lk)("div",{class:"code-dragger",ref_key:"code_dragger",ref:i},null,512)],44,Xa))}}),Qa=(0,m.A)(Za,[["__scopeId","data-v-6d594329"]]),Ja={".py":"python",".java":"java",".c":"c",".cpp":"c++",".js":"javascript",".html":"html",".css":"css",".php":"php",".rb":"ruby",".go":"go",".swift":"swift",".kt":"kotlin",".rs":"rust",".ts":"typescript",".sh":"shell",".pl":"perl",".cs":"c#",".sql":"sql",".r":"r",".m":"matlab",".adb":"ada",".ads":"ada",".lua":"lua",".scala":"scala",".dart":"dart",".hs":"haskell",".erl":"erlang",".ex":"elixir",".jl":"julia",".groovy":"groovy",".fs":"f#",".clj":"clojure",".scm":"scheme",".ml":"ocaml",".pas":"pascal",".d":"d",".nim":"nim",".zig":"zig",".v":"v",".coffee":"coffeescript",".litcoffee":"coffeescript",".vue":"vue",".svelte":"svelte",".elm":"elm",".purs":"purescript",".exs":"elixir",".eex":"elixir",".heex":"elixir",".tcl":"tcl",".tk":"tcl",".awk":"awk",".ps1":"powershell",".psm1":"powershell",".psd1":"powershell",".bat":"batch",".cmd":"batch",".json":"json",".xml":"xml",".yaml":"yaml",".yml":"yaml",".toml":"toml",".ini":"ini",".md":"markdown",".markdown":"markdown",".tex":"latex",".sty":"latex",".cls":"latex",".bib":"bibtex",".csv":"csv",".tsv":"tsv",".log":"log"};var el=n(2551);function tl(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}const nl="dracula";class rl extends o._D{_code_html=(0,l.KR)("");static _langs=[...Object.keys(Nr)];static _themes=[...Object.keys(Or)];static get langs(){return[...this._langs]}static get themes(){return[...this._themes]}constructor(e,t){super(e,t);const n=this.setup(e,t);return this.init(),n}get langs(){return[...rl._langs]}get themes(){return[...rl._themes]}_draglist;get component(){return Qa}get items(){return this.info.tabs}get active_tab_id(){return this.info.active_tab_id}set active_tab_id(e){const t=this.items.find(t=>t.id===e);t&&(this.info.active_tab_id=t.id)}get active_tab(){return this.items.find(e=>e.id===this.active_tab_id)}get code_html(){return this._code_html.value}get info(){return this.data.info}get css(){const e=this.config.data.line_indent,t=this.attrs.indent,n=this.attrs.width,r=this.attrs.height;return{...this.data.css,"margin-left":t>0?t*e+"px":"0px",width:n+"px",height:r+"px"}}get attrs(){return this.data.attrs}init(){this.update_active_code_html()}export(){return this.base_export()}gc(){super.base_gc()}build_child(e){}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}update_active_code_html(){if(0===this.items.length)this._code_html.value="";else{const e=this.active_tab;if(!e)return;this.code_to_html(e).then(e=>{this._code_html.value=e})}}code_to_html(e){return Ha(e.code,{lang:e.lang,theme:e.theme,cssVariablePrefix:"--shiki-"})}get meta(){return rl.meta}create_tab(e,t,n=nl){return{id:g.I.get_id(),name:t,lang:e,code:"",theme:n||nl}}replace_id(e,t={}){return rl.replace_id(this.root,e,t)}copy_code(){const e=this.active_tab;if(!e)return el.F.tips?.tip_error("当前没有激活的代码块tab");const t=e.code,n=new Blob([t],{type:"text/plain"}),r=new ClipboardItem({[n.type]:n});this.clipboard.set_clipboard_data(r).then(e=>{el.F.tips?.tip_info("复制代码成功👏")})}change_lang(e){const{tabid:t,lang:n}=e,{courier:r,id:i}=this,s=r.get_recorder(),o=this.items.find(e=>e.id===t);if(!o)return;const a=o.lang;return o.lang=n,s.add_recover(zr.change_lang(i,t,a)),this.update_active_code_html(),s}change_theme(e){const{tabid:t,theme:n}=e,{courier:r,id:i}=this,s=r.get_recorder(),o=this.items.find(e=>e.id===t);if(!o)return;const a=o.theme;return o.theme=n,s.add_recover(zr.change_theme(i,t,a)),this.update_active_code_html(),s}code_update(e){const{tabid:t,code:n}=e,{courier:r,id:i}=this,s=r.get_recorder();s.add_cmd(e);const o=this.items.find(e=>e.id===t);if(!o)return;const a=o.code;return o.code=n,s.add_recover(zr.update(i,t,a)),this.update_active_code_html(),s}code_add(e){const{item:t,focus:n}=e,{courier:r,id:i}=this,s=r.get_recorder();return s.add_cmd(e),this.info.tabs.push(t),s.add_recover(zr.remove(i,t.id)),this.update_active_code_html(),n&&s.tell(this,zr.change_active(i,t.id)),(0,c.dY)(()=>{this._draglist?.init()}),s}code_remove(e){const{tabid:t}=e,{courier:n,id:r}=this,i=n.get_recorder();i.add_cmd(e);const s=this.items.find(e=>e.id===t);if(!s)return;const o=this.items.indexOf(s),a=this.items[o-1]||this.items[o+1];return o>=0&&this.items.splice(o,1),i.add_recover(zr.add(r,s)),a&&(this.active_tab_id=a.id),this.update_active_code_html(),(0,c.dY)(()=>{this._draglist?.init()}),i}code_rename(e){const{tabid:t,filename:n}=e,{courier:r,id:i}=this,s=r.get_recorder();s.add_cmd(e);const o=this.items.find(e=>e.id===t);if(!o)return;const a=o.name;return o.name=n,s.add_recover(zr.rename(i,t,a)),s}change_active(e){const{tabid:t}=e,{courier:n,id:r}=this,i=n.get_recorder(),s=this.items.find(e=>e.id===t);if(!s)return s;const o=this.active_tab_id;return this.active_tab_id=t,i.add_recover(zr.change_active(r,o)),this.update_active_code_html(),i}on_cursor_in_tail(e){const{offset:t,from:n}=e,{courier:r,prev_cube:i,pcube:s,next_cube:o}=this,a=new _.vk(r),l=(this.meta,this.dom?.querySelector("textarea"));return l?.focus(),a}on_cursor_in_head(e){const{offset:t,from:n}=e,{courier:r,prev_cube:i,pcube:s,next_cube:o}=this,a=new _.vk(r),l=(this.meta,this.dom?.querySelector("textarea"));return l?.focus(),a}static get meta(){return{cubename:"代码块",type:a.u0.code,block:!0,version:1,show:!0}}static get_default(){return{id:g.I.get_id(),type:a.u0.code,info:{tabs:[],active_tab_id:""},attrs:{width:560,height:200,codebg:"transparent",caret:"black"},css:{}}}static get_default_by_string(e="typescript",t=""){const n={name:`code${this.get_format_from_lang(e)}`,id:g.I.get_id(),code:t,lang:e,theme:"andromeeda"};return{id:g.I.get_id(),type:a.u0.code,info:{tabs:[n],active_tab_id:n.id},attrs:{width:560,height:200,codebg:"transparent",caret:"black"},css:{}}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();return n[r]=i,t.id=i,t}static get_format_from_lang(e){for(let t in Ja)if(Ja[t]===e)return t;return""}static get_lang_from_format(e){return Ja[e]}}tl([(0,k.H)(a.GW.change_lang)],rl.prototype,"change_lang",null),tl([(0,k.H)(a.GW.change_theme)],rl.prototype,"change_theme",null),tl([(0,k.H)(a.GW.code_update)],rl.prototype,"code_update",null),tl([(0,k.H)(a.GW.code_add)],rl.prototype,"code_add",null),tl([(0,k.H)(a.GW.code_remove)],rl.prototype,"code_remove",null),tl([(0,k.H)(a.GW.code_rename)],rl.prototype,"code_rename",null),tl([(0,k.H)(a.GW.change_active)],rl.prototype,"change_active",null),tl([(0,k.H)(a.K9.cursor_in_tail)],rl.prototype,"on_cursor_in_tail",null),tl([(0,k.H)(a.K9.cursor_in_head)],rl.prototype,"on_cursor_in_head",null);const il=["id","data-type","innerHTML"],sl=(0,c.pM)({__name:"cube-fomula",props:{cube:{}},setup(e){const{stats:t,event:n}=e.cube.root;function r(){n.emit_show_cube_editor(e.cube)}const i=(0,c.EW)(()=>{let t={...e.cube.css};return e.cube.attrs.block&&(t.display="block",t["text-align"]="center"),t});return(e,t)=>((0,c.uX)(),(0,c.CE)("span",{class:"cube-fomula",onClick:r,id:e.cube.id,"data-type":(0,l.R1)(a.u0).fomula,style:(0,d.Tr)(i.value),innerHTML:e.cube.mathml},null,12,il))}}),ol=(0,m.A)(sl,[["__scopeId","data-v-b85f3e3c"]]);class al{constructor(e,t,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}static range(e,t){return t?e&&e.loc&&t.loc&&e.loc.lexer===t.loc.lexer?new al(e.loc.lexer,e.loc.start,t.loc.end):null:e&&e.loc}}class ll{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(e,t){return new ll(t,al.range(this,e))}}class cl{constructor(e,t){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var n,r,i="KaTeX parse error: "+e,s=t&&t.loc;if(s&&s.start<=s.end){var o=s.lexer.input;n=s.start,r=s.end,n===o.length?i+=" at end of input: ":i+=" at position "+(n+1)+": ";var a=o.slice(n,r).replace(/[^]/g,"$&̲");i+=(n>15?"…"+o.slice(n-15,n):o.slice(0,n))+a+(r+15<o.length?o.slice(r,r+15)+"…":o.slice(r))}var l=new Error(i);return l.name="ParseError",l.__proto__=cl.prototype,l.position=n,null!=n&&null!=r&&(l.length=r-n),l.rawMessage=e,l}}cl.prototype.__proto__=Error.prototype;var dl=/([A-Z])/g,ul={"&":"&",">":">","<":"<",'"':""","'":"'"},hl=/[&><"']/g,pl=function e(t){return"ordgroup"===t.type||"color"===t.type?1===t.body.length?e(t.body[0]):t:"font"===t.type?e(t.body):t},ml=function(e,t){return-1!==e.indexOf(t)},fl=function(e,t){return void 0===e?t:e},_l=function(e){return String(e).replace(hl,e=>ul[e])},gl=function(e){return e.replace(dl,"-$1").toLowerCase()},bl=pl,yl=function(e){var t=pl(e);return"mathord"===t.type||"textord"===t.type||"atom"===t.type},vl=function(e){var t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?":"!==t[2]?null:/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?t[1].toLowerCase():null:"_relative"},wl={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand <n>",cliProcessor:e=>"Infinity"===e?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function xl(e){if(e.default)return e.default;var t=e.type,n=Array.isArray(t)?t[0]:t;if("string"!=typeof n)return n.enum[0];switch(n){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class kl{constructor(e){for(var t in this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{},wl)if(wl.hasOwnProperty(t)){var n=wl[t];this[t]=void 0!==e[t]?n.processor?n.processor(e[t]):e[t]:xl(n)}}reportNonstrict(e,t,n){var r=this.strict;if("function"==typeof r&&(r=r(e,t,n)),r&&"ignore"!==r){if(!0===r||"error"===r)throw new cl("LaTeX-incompatible input and strict mode is set to 'error': "+t+" ["+e+"]",n);"warn"===r?"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"):"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+r+"': "+t+" ["+e+"]")}}useStrictBehavior(e,t,n){var r=this.strict;if("function"==typeof r)try{r=r(e,t,n)}catch(e){r="error"}return!(!r||"ignore"===r||!0!==r&&"error"!==r&&("warn"===r?("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"),1):("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+r+"': "+t+" ["+e+"]"),1)))}isTrusted(e){if(e.url&&!e.protocol){var t=vl(e.url);if(null==t)return!1;e.protocol=t}var n="function"==typeof this.trust?this.trust(e):this.trust;return Boolean(n)}}class Sl{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return Cl[Ml[this.id]]}sub(){return Cl[Tl[this.id]]}fracNum(){return Cl[Ll[this.id]]}fracDen(){return Cl[zl[this.id]]}cramp(){return Cl[Al[this.id]]}text(){return Cl[Rl[this.id]]}isTight(){return this.size>=2}}var Cl=[new Sl(0,0,!1),new Sl(1,0,!0),new Sl(2,1,!1),new Sl(3,1,!0),new Sl(4,2,!1),new Sl(5,2,!0),new Sl(6,3,!1),new Sl(7,3,!0)],Ml=[4,5,4,5,6,7,6,7],Tl=[5,5,5,5,7,7,7,7],Ll=[2,3,4,5,6,7,6,7],zl=[3,3,5,5,7,7,7,7],Al=[1,1,3,3,5,5,7,7],Rl=[0,1,2,3,2,3,2,3],Pl={DISPLAY:Cl[0],TEXT:Cl[2],SCRIPT:Cl[4],SCRIPTSCRIPT:Cl[6]},Nl=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}],El=[];function Ol(e){for(var t=0;t<El.length;t+=2)if(e>=El[t]&&e<=El[t+1])return!0;return!1}Nl.forEach(e=>e.blocks.forEach(e=>El.push(...e)));var Il={doubleleftarrow:"M262 157\nl10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3\n 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28\n 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5\nc2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5\n 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z",doublerightarrow:"M399738 392l\n-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5\n 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88\n-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68\n-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\nc-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z",leftarrow:"M400000 241H110l3-3c68.7-52.7 113.7-120\n 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8\n-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247\nc-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208\n 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3\n 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202\n l-3-3h399890zM100 241v40h399900v-40z",leftbrace:"M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\n 5-6 9-10 13-.7 1-7.3 1-20 1H6z",leftbraceunder:"M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\n 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z",leftgroup:"M400000 80\nH435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0\n 435 0h399565z",leftgroupunder:"M400000 262\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\n 435 219h399565z",leftharpoon:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\n-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5\n-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7\n-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z",leftharpoonplus:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5\n 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3\n-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\nm0 0v40h400000v-40z",leftharpoondown:"M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333\n 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5\n 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667\n-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z",leftharpoondownplus:"M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12\n 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7\n-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0\nv40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z",lefthook:"M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5\n-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3\n-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21\n 71.5 23h399859zM103 281v-40h399897v40z",leftlinesegment:"M40 281 V428 H0 V94 H40 V241 H400000 v40z\nM40 281 V428 H0 V94 H40 V241 H400000 v40z",leftmapsto:"M40 281 V448H0V74H40V241H400000v40z\nM40 281 V448H0V74H40V241H400000v40z",leftToFrom:"M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23\n-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8\nc28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3\n 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z",longequal:"M0 50 h400000 v40H0z m0 194h40000v40H0z\nM0 50 h400000 v40H0z m0 194h40000v40H0z",midbrace:"M200428 334\nc-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14\n-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7\n 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11\n 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z",midbraceunder:"M199572 214\nc100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\n 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0\n-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z",oiintSize1:"M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6\n-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z\nm368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8\n60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z",oiintSize2:"M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8\n-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z\nm502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2\nc0 110 84 276 504 276s502.4-166 502.4-276z",oiiintSize1:"M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6\n-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z\nm525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0\n85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z",oiiintSize2:"M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8\n-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z\nm770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1\nc0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z",rightarrow:"M0 241v40h399891c-47.3 35.3-84 78-110 128\n-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20\n 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7\n 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85\n-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n 151.7 139 205zm0 0v40h399900v-40z",rightbrace:"M400000 542l\n-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5\ns-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1\nc124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z",rightbraceunder:"M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\n-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z",rightgroup:"M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0\n 3-1 3-3v-38c-76-158-257-219-435-219H0z",rightgroupunder:"M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18\n 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z",rightharpoon:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3\n-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2\n-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58\n 69.2 92 94.5zm0 0v40h399900v-40z",rightharpoonplus:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11\n-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7\n 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z\nm0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z",rightharpoondown:"M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8\n 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5\n-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95\n-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z",rightharpoondownplus:"M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8\n 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3\n 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3\n-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z\nm0-194v40h400000v-40zm0 0v40h400000v-40z",righthook:"M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3\n 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0\n-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21\n 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z",rightlinesegment:"M399960 241 V94 h40 V428 h-40 V281 H0 v-40z\nM399960 241 V94 h40 V428 h-40 V281 H0 v-40z",rightToFrom:"M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23\n 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32\n-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142\n-167z M100 147v40h399900v-40zM0 341v40h399900v-40z",twoheadleftarrow:"M0 167c68 40\n 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69\n-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3\n-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19\n-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101\n 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z",twoheadrightarrow:"M400000 167\nc-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3\n 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42\n 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333\n-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70\n 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z",tilde1:"M200 55.538c-77 0-168 73.953-177 73.953-3 0-7\n-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0\n 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0\n 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128\n-68.267.847-113-73.952-191-73.952z",tilde2:"M344 55.266c-142 0-300.638 81.316-311.5 86.418\n-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9\n 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114\nc1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751\n 181.476 676 181.476c-149 0-189-126.21-332-126.21z",tilde3:"M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457\n-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0\n 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697\n 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696\n -338 0-409-156.573-744-156.573z",tilde4:"M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345\n-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409\n 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9\n 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409\n -175.236-744-175.236z",vec:"M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5\n3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11\n10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63\n-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1\n-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59\nH213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359\nc-16-25.333-24-45-24-59z",widehat1:"M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22\nc-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z",widehat2:"M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat3:"M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat4:"M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widecheck1:"M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,\n-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z",widecheck2:"M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck3:"M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck4:"M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",baraboveleftarrow:"M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202\nc4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5\nc-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130\ns-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47\n121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6\ns2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11\nc0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z\nM100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z",rightarrowabovebar:"M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32\n-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0\n13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39\n-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5\n-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z",baraboveshortleftharpoon:"M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17\nc2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21\nc-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40\nc-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z\nM0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z",rightharpoonaboveshortbar:"M0,241 l0,40c399126,0,399993,0,399993,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z",shortbaraboveleftharpoon:"M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,\n1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,\n-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z\nM93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z",shortrightharpoonabovebar:"M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z"};class Bl{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return ml(this.classes,e)}toNode(){for(var e=document.createDocumentFragment(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){for(var e="",t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){return this.children.map(e=>e.toText()).join("")}}var Dl={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Vl={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},Hl={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function jl(e,t,n){if(!Dl[t])throw new Error("Font metrics not found for font: "+t+".");var r=e.charCodeAt(0),i=Dl[t][r];if(!i&&e[0]in Hl&&(r=Hl[e[0]].charCodeAt(0),i=Dl[t][r]),i||"text"!==n||Ol(r)&&(i=Dl[t][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var Fl={},Ul=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],ql=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],$l=function(e,t){return t.size<2?e:Ul[e-1][t.size-1]};class Gl{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||Gl.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=ql[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return new Gl(t)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:$l(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:ql[e-1]})}havingBaseStyle(e){e=e||this.style.text();var t=$l(Gl.BASESIZE,e);return this.size===t&&this.textSize===Gl.BASESIZE&&this.style===e?this:this.extend({style:e,size:t})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Gl.BASESIZE?["sizing","reset-size"+this.size,"size"+Gl.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=function(e){var t;if(!Fl[t=e>=5?0:e>=3?1:2]){var n=Fl[t]={cssEmPerMu:Vl.quad[t]/18};for(var r in Vl)Vl.hasOwnProperty(r)&&(n[r]=Vl[r][t])}return Fl[t]}(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Gl.BASESIZE=6;var Xl={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:1.00375,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:1.00375},Kl={ex:!0,em:!0,mu:!0},Wl=function(e){return"string"!=typeof e&&(e=e.unit),e in Xl||e in Kl||"ex"===e},Yl=function(e,t){var n;if(e.unit in Xl)n=Xl[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if("mu"===e.unit)n=t.fontMetrics().cssEmPerMu;else{var r;if(r=t.style.isTight()?t.havingStyle(t.style.text()):t,"ex"===e.unit)n=r.fontMetrics().xHeight;else{if("em"!==e.unit)throw new cl("Invalid unit: '"+e.unit+"'");n=r.fontMetrics().quad}r!==t&&(n*=r.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},Zl=function(e){return+e.toFixed(4)+"em"},Ql=function(e){return e.filter(e=>e).join(" ")},Jl=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push("mtight");var r=t.getColor();r&&(this.style.color=r)}},ec=function(e){var t=document.createElement(e);for(var n in t.className=Ql(this.classes),this.style)this.style.hasOwnProperty(n)&&(t.style[n]=this.style[n]);for(var r in this.attributes)this.attributes.hasOwnProperty(r)&&t.setAttribute(r,this.attributes[r]);for(var i=0;i<this.children.length;i++)t.appendChild(this.children[i].toNode());return t},tc=/[\s"'>/=\x00-\x1f]/,nc=function(e){var t="<"+e;this.classes.length&&(t+=' class="'+_l(Ql(this.classes))+'"');var n="";for(var r in this.style)this.style.hasOwnProperty(r)&&(n+=gl(r)+":"+this.style[r]+";");for(var i in n&&(t+=' style="'+_l(n)+'"'),this.attributes)if(this.attributes.hasOwnProperty(i)){if(tc.test(i))throw new cl("Invalid attribute name '"+i+"'");t+=" "+i+'="'+_l(this.attributes[i])+'"'}t+=">";for(var s=0;s<this.children.length;s++)t+=this.children[s].toMarkup();return t+"</"+e+">"};class rc{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,Jl.call(this,e,n,r),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return ml(this.classes,e)}toNode(){return ec.call(this,"span")}toMarkup(){return nc.call(this,"span")}}class ic{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,Jl.call(this,t,r),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return ml(this.classes,e)}toNode(){return ec.call(this,"a")}toMarkup(){return nc.call(this,"a")}}class sc{constructor(e,t,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=["mord"],this.style=n}hasClass(e){return ml(this.classes,e)}toNode(){var e=document.createElement("img");for(var t in e.src=this.src,e.alt=this.alt,e.className="mord",this.style)this.style.hasOwnProperty(t)&&(e.style[t]=this.style[t]);return e}toMarkup(){var e='<img src="'+_l(this.src)+'" alt="'+_l(this.alt)+'"',t="";for(var n in this.style)this.style.hasOwnProperty(n)&&(t+=gl(n)+":"+this.style[n]+";");return t&&(e+=' style="'+_l(t)+'"'),e+"'/>"}}var oc={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class ac{constructor(e,t,n,r,i,s,o,a){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=n||0,this.italic=r||0,this.skew=i||0,this.width=s||0,this.classes=o||[],this.style=a||{},this.maxFontSize=0;var l=function(e){for(var t=0;t<Nl.length;t++)for(var n=Nl[t],r=0;r<n.blocks.length;r++){var i=n.blocks[r];if(e>=i[0]&&e<=i[1])return n.name}return null}(this.text.charCodeAt(0));l&&this.classes.push(l+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=oc[this.text])}hasClass(e){return ml(this.classes,e)}toNode(){var e=document.createTextNode(this.text),t=null;for(var n in this.italic>0&&((t=document.createElement("span")).style.marginRight=Zl(this.italic)),this.classes.length>0&&((t=t||document.createElement("span")).className=Ql(this.classes)),this.style)this.style.hasOwnProperty(n)&&((t=t||document.createElement("span")).style[n]=this.style[n]);return t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t="<span";this.classes.length&&(e=!0,t+=' class="',t+=_l(Ql(this.classes)),t+='"');var n="";for(var r in this.italic>0&&(n+="margin-right:"+this.italic+"em;"),this.style)this.style.hasOwnProperty(r)&&(n+=gl(r)+":"+this.style[r]+";");n&&(e=!0,t+=' style="'+_l(n)+'"');var i=_l(this.text);return e?(t+=">",t+=i,t+="</span>"):i}}class lc{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);for(var n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){var e='<svg xmlns="http://www.w3.org/2000/svg"';for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="'+_l(this.attributes[t])+'"');e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+"</svg>"}}class cc{constructor(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","path");return this.alternate?e.setAttribute("d",this.alternate):e.setAttribute("d",Il[this.pathName]),e}toMarkup(){return this.alternate?'<path d="'+_l(this.alternate)+'"/>':'<path d="'+_l(Il[this.pathName])+'"/>'}}class dc{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","line");for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);return e}toMarkup(){var e="<line";for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="'+_l(this.attributes[t])+'"');return e+"/>"}}function uc(e){if(e instanceof ac)return e;throw new Error("Expected symbolNode but got "+String(e)+".")}var hc={bin:1,close:1,inner:1,open:1,punct:1,rel:1},pc={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},mc={math:{},text:{}};function fc(e,t,n,r,i,s){mc[e][i]={font:t,group:n,replace:r},s&&r&&(mc[e][r]=mc[e][i])}var _c="math",gc="text",bc="main",yc="ams",vc="accent-token",wc="bin",xc="close",kc="inner",Sc="mathord",Cc="op-token",Mc="open",Tc="punct",Lc="rel",zc="spacing",Ac="textord";fc(_c,bc,Lc,"≡","\\equiv",!0),fc(_c,bc,Lc,"≺","\\prec",!0),fc(_c,bc,Lc,"≻","\\succ",!0),fc(_c,bc,Lc,"∼","\\sim",!0),fc(_c,bc,Lc,"⊥","\\perp"),fc(_c,bc,Lc,"⪯","\\preceq",!0),fc(_c,bc,Lc,"⪰","\\succeq",!0),fc(_c,bc,Lc,"≃","\\simeq",!0),fc(_c,bc,Lc,"∣","\\mid",!0),fc(_c,bc,Lc,"≪","\\ll",!0),fc(_c,bc,Lc,"≫","\\gg",!0),fc(_c,bc,Lc,"≍","\\asymp",!0),fc(_c,bc,Lc,"∥","\\parallel"),fc(_c,bc,Lc,"⋈","\\bowtie",!0),fc(_c,bc,Lc,"⌣","\\smile",!0),fc(_c,bc,Lc,"⊑","\\sqsubseteq",!0),fc(_c,bc,Lc,"⊒","\\sqsupseteq",!0),fc(_c,bc,Lc,"≐","\\doteq",!0),fc(_c,bc,Lc,"⌢","\\frown",!0),fc(_c,bc,Lc,"∋","\\ni",!0),fc(_c,bc,Lc,"∝","\\propto",!0),fc(_c,bc,Lc,"⊢","\\vdash",!0),fc(_c,bc,Lc,"⊣","\\dashv",!0),fc(_c,bc,Lc,"∋","\\owns"),fc(_c,bc,Tc,".","\\ldotp"),fc(_c,bc,Tc,"⋅","\\cdotp"),fc(_c,bc,Ac,"#","\\#"),fc(gc,bc,Ac,"#","\\#"),fc(_c,bc,Ac,"&","\\&"),fc(gc,bc,Ac,"&","\\&"),fc(_c,bc,Ac,"ℵ","\\aleph",!0),fc(_c,bc,Ac,"∀","\\forall",!0),fc(_c,bc,Ac,"ℏ","\\hbar",!0),fc(_c,bc,Ac,"∃","\\exists",!0),fc(_c,bc,Ac,"∇","\\nabla",!0),fc(_c,bc,Ac,"♭","\\flat",!0),fc(_c,bc,Ac,"ℓ","\\ell",!0),fc(_c,bc,Ac,"♮","\\natural",!0),fc(_c,bc,Ac,"♣","\\clubsuit",!0),fc(_c,bc,Ac,"℘","\\wp",!0),fc(_c,bc,Ac,"♯","\\sharp",!0),fc(_c,bc,Ac,"♢","\\diamondsuit",!0),fc(_c,bc,Ac,"ℜ","\\Re",!0),fc(_c,bc,Ac,"♡","\\heartsuit",!0),fc(_c,bc,Ac,"ℑ","\\Im",!0),fc(_c,bc,Ac,"♠","\\spadesuit",!0),fc(_c,bc,Ac,"§","\\S",!0),fc(gc,bc,Ac,"§","\\S"),fc(_c,bc,Ac,"¶","\\P",!0),fc(gc,bc,Ac,"¶","\\P"),fc(_c,bc,Ac,"†","\\dag"),fc(gc,bc,Ac,"†","\\dag"),fc(gc,bc,Ac,"†","\\textdagger"),fc(_c,bc,Ac,"‡","\\ddag"),fc(gc,bc,Ac,"‡","\\ddag"),fc(gc,bc,Ac,"‡","\\textdaggerdbl"),fc(_c,bc,xc,"⎱","\\rmoustache",!0),fc(_c,bc,Mc,"⎰","\\lmoustache",!0),fc(_c,bc,xc,"⟯","\\rgroup",!0),fc(_c,bc,Mc,"⟮","\\lgroup",!0),fc(_c,bc,wc,"∓","\\mp",!0),fc(_c,bc,wc,"⊖","\\ominus",!0),fc(_c,bc,wc,"⊎","\\uplus",!0),fc(_c,bc,wc,"⊓","\\sqcap",!0),fc(_c,bc,wc,"∗","\\ast"),fc(_c,bc,wc,"⊔","\\sqcup",!0),fc(_c,bc,wc,"◯","\\bigcirc",!0),fc(_c,bc,wc,"∙","\\bullet",!0),fc(_c,bc,wc,"‡","\\ddagger"),fc(_c,bc,wc,"≀","\\wr",!0),fc(_c,bc,wc,"⨿","\\amalg"),fc(_c,bc,wc,"&","\\And"),fc(_c,bc,Lc,"⟵","\\longleftarrow",!0),fc(_c,bc,Lc,"⇐","\\Leftarrow",!0),fc(_c,bc,Lc,"⟸","\\Longleftarrow",!0),fc(_c,bc,Lc,"⟶","\\longrightarrow",!0),fc(_c,bc,Lc,"⇒","\\Rightarrow",!0),fc(_c,bc,Lc,"⟹","\\Longrightarrow",!0),fc(_c,bc,Lc,"↔","\\leftrightarrow",!0),fc(_c,bc,Lc,"⟷","\\longleftrightarrow",!0),fc(_c,bc,Lc,"⇔","\\Leftrightarrow",!0),fc(_c,bc,Lc,"⟺","\\Longleftrightarrow",!0),fc(_c,bc,Lc,"↦","\\mapsto",!0),fc(_c,bc,Lc,"⟼","\\longmapsto",!0),fc(_c,bc,Lc,"↗","\\nearrow",!0),fc(_c,bc,Lc,"↩","\\hookleftarrow",!0),fc(_c,bc,Lc,"↪","\\hookrightarrow",!0),fc(_c,bc,Lc,"↘","\\searrow",!0),fc(_c,bc,Lc,"↼","\\leftharpoonup",!0),fc(_c,bc,Lc,"⇀","\\rightharpoonup",!0),fc(_c,bc,Lc,"↙","\\swarrow",!0),fc(_c,bc,Lc,"↽","\\leftharpoondown",!0),fc(_c,bc,Lc,"⇁","\\rightharpoondown",!0),fc(_c,bc,Lc,"↖","\\nwarrow",!0),fc(_c,bc,Lc,"⇌","\\rightleftharpoons",!0),fc(_c,yc,Lc,"≮","\\nless",!0),fc(_c,yc,Lc,"","\\@nleqslant"),fc(_c,yc,Lc,"","\\@nleqq"),fc(_c,yc,Lc,"⪇","\\lneq",!0),fc(_c,yc,Lc,"≨","\\lneqq",!0),fc(_c,yc,Lc,"","\\@lvertneqq"),fc(_c,yc,Lc,"⋦","\\lnsim",!0),fc(_c,yc,Lc,"⪉","\\lnapprox",!0),fc(_c,yc,Lc,"⊀","\\nprec",!0),fc(_c,yc,Lc,"⋠","\\npreceq",!0),fc(_c,yc,Lc,"⋨","\\precnsim",!0),fc(_c,yc,Lc,"⪹","\\precnapprox",!0),fc(_c,yc,Lc,"≁","\\nsim",!0),fc(_c,yc,Lc,"","\\@nshortmid"),fc(_c,yc,Lc,"∤","\\nmid",!0),fc(_c,yc,Lc,"⊬","\\nvdash",!0),fc(_c,yc,Lc,"⊭","\\nvDash",!0),fc(_c,yc,Lc,"⋪","\\ntriangleleft"),fc(_c,yc,Lc,"⋬","\\ntrianglelefteq",!0),fc(_c,yc,Lc,"⊊","\\subsetneq",!0),fc(_c,yc,Lc,"","\\@varsubsetneq"),fc(_c,yc,Lc,"⫋","\\subsetneqq",!0),fc(_c,yc,Lc,"","\\@varsubsetneqq"),fc(_c,yc,Lc,"≯","\\ngtr",!0),fc(_c,yc,Lc,"","\\@ngeqslant"),fc(_c,yc,Lc,"","\\@ngeqq"),fc(_c,yc,Lc,"⪈","\\gneq",!0),fc(_c,yc,Lc,"≩","\\gneqq",!0),fc(_c,yc,Lc,"","\\@gvertneqq"),fc(_c,yc,Lc,"⋧","\\gnsim",!0),fc(_c,yc,Lc,"⪊","\\gnapprox",!0),fc(_c,yc,Lc,"⊁","\\nsucc",!0),fc(_c,yc,Lc,"⋡","\\nsucceq",!0),fc(_c,yc,Lc,"⋩","\\succnsim",!0),fc(_c,yc,Lc,"⪺","\\succnapprox",!0),fc(_c,yc,Lc,"≆","\\ncong",!0),fc(_c,yc,Lc,"","\\@nshortparallel"),fc(_c,yc,Lc,"∦","\\nparallel",!0),fc(_c,yc,Lc,"⊯","\\nVDash",!0),fc(_c,yc,Lc,"⋫","\\ntriangleright"),fc(_c,yc,Lc,"⋭","\\ntrianglerighteq",!0),fc(_c,yc,Lc,"","\\@nsupseteqq"),fc(_c,yc,Lc,"⊋","\\supsetneq",!0),fc(_c,yc,Lc,"","\\@varsupsetneq"),fc(_c,yc,Lc,"⫌","\\supsetneqq",!0),fc(_c,yc,Lc,"","\\@varsupsetneqq"),fc(_c,yc,Lc,"⊮","\\nVdash",!0),fc(_c,yc,Lc,"⪵","\\precneqq",!0),fc(_c,yc,Lc,"⪶","\\succneqq",!0),fc(_c,yc,Lc,"","\\@nsubseteqq"),fc(_c,yc,wc,"⊴","\\unlhd"),fc(_c,yc,wc,"⊵","\\unrhd"),fc(_c,yc,Lc,"↚","\\nleftarrow",!0),fc(_c,yc,Lc,"↛","\\nrightarrow",!0),fc(_c,yc,Lc,"⇍","\\nLeftarrow",!0),fc(_c,yc,Lc,"⇏","\\nRightarrow",!0),fc(_c,yc,Lc,"↮","\\nleftrightarrow",!0),fc(_c,yc,Lc,"⇎","\\nLeftrightarrow",!0),fc(_c,yc,Lc,"△","\\vartriangle"),fc(_c,yc,Ac,"ℏ","\\hslash"),fc(_c,yc,Ac,"▽","\\triangledown"),fc(_c,yc,Ac,"◊","\\lozenge"),fc(_c,yc,Ac,"Ⓢ","\\circledS"),fc(_c,yc,Ac,"®","\\circledR"),fc(gc,yc,Ac,"®","\\circledR"),fc(_c,yc,Ac,"∡","\\measuredangle",!0),fc(_c,yc,Ac,"∄","\\nexists"),fc(_c,yc,Ac,"℧","\\mho"),fc(_c,yc,Ac,"Ⅎ","\\Finv",!0),fc(_c,yc,Ac,"⅁","\\Game",!0),fc(_c,yc,Ac,"‵","\\backprime"),fc(_c,yc,Ac,"▲","\\blacktriangle"),fc(_c,yc,Ac,"▼","\\blacktriangledown"),fc(_c,yc,Ac,"■","\\blacksquare"),fc(_c,yc,Ac,"⧫","\\blacklozenge"),fc(_c,yc,Ac,"★","\\bigstar"),fc(_c,yc,Ac,"∢","\\sphericalangle",!0),fc(_c,yc,Ac,"∁","\\complement",!0),fc(_c,yc,Ac,"ð","\\eth",!0),fc(gc,bc,Ac,"ð","ð"),fc(_c,yc,Ac,"╱","\\diagup"),fc(_c,yc,Ac,"╲","\\diagdown"),fc(_c,yc,Ac,"□","\\square"),fc(_c,yc,Ac,"□","\\Box"),fc(_c,yc,Ac,"◊","\\Diamond"),fc(_c,yc,Ac,"¥","\\yen",!0),fc(gc,yc,Ac,"¥","\\yen",!0),fc(_c,yc,Ac,"✓","\\checkmark",!0),fc(gc,yc,Ac,"✓","\\checkmark"),fc(_c,yc,Ac,"ℶ","\\beth",!0),fc(_c,yc,Ac,"ℸ","\\daleth",!0),fc(_c,yc,Ac,"ℷ","\\gimel",!0),fc(_c,yc,Ac,"ϝ","\\digamma",!0),fc(_c,yc,Ac,"ϰ","\\varkappa"),fc(_c,yc,Mc,"┌","\\@ulcorner",!0),fc(_c,yc,xc,"┐","\\@urcorner",!0),fc(_c,yc,Mc,"└","\\@llcorner",!0),fc(_c,yc,xc,"┘","\\@lrcorner",!0),fc(_c,yc,Lc,"≦","\\leqq",!0),fc(_c,yc,Lc,"⩽","\\leqslant",!0),fc(_c,yc,Lc,"⪕","\\eqslantless",!0),fc(_c,yc,Lc,"≲","\\lesssim",!0),fc(_c,yc,Lc,"⪅","\\lessapprox",!0),fc(_c,yc,Lc,"≊","\\approxeq",!0),fc(_c,yc,wc,"⋖","\\lessdot"),fc(_c,yc,Lc,"⋘","\\lll",!0),fc(_c,yc,Lc,"≶","\\lessgtr",!0),fc(_c,yc,Lc,"⋚","\\lesseqgtr",!0),fc(_c,yc,Lc,"⪋","\\lesseqqgtr",!0),fc(_c,yc,Lc,"≑","\\doteqdot"),fc(_c,yc,Lc,"≓","\\risingdotseq",!0),fc(_c,yc,Lc,"≒","\\fallingdotseq",!0),fc(_c,yc,Lc,"∽","\\backsim",!0),fc(_c,yc,Lc,"⋍","\\backsimeq",!0),fc(_c,yc,Lc,"⫅","\\subseteqq",!0),fc(_c,yc,Lc,"⋐","\\Subset",!0),fc(_c,yc,Lc,"⊏","\\sqsubset",!0),fc(_c,yc,Lc,"≼","\\preccurlyeq",!0),fc(_c,yc,Lc,"⋞","\\curlyeqprec",!0),fc(_c,yc,Lc,"≾","\\precsim",!0),fc(_c,yc,Lc,"⪷","\\precapprox",!0),fc(_c,yc,Lc,"⊲","\\vartriangleleft"),fc(_c,yc,Lc,"⊴","\\trianglelefteq"),fc(_c,yc,Lc,"⊨","\\vDash",!0),fc(_c,yc,Lc,"⊪","\\Vvdash",!0),fc(_c,yc,Lc,"⌣","\\smallsmile"),fc(_c,yc,Lc,"⌢","\\smallfrown"),fc(_c,yc,Lc,"≏","\\bumpeq",!0),fc(_c,yc,Lc,"≎","\\Bumpeq",!0),fc(_c,yc,Lc,"≧","\\geqq",!0),fc(_c,yc,Lc,"⩾","\\geqslant",!0),fc(_c,yc,Lc,"⪖","\\eqslantgtr",!0),fc(_c,yc,Lc,"≳","\\gtrsim",!0),fc(_c,yc,Lc,"⪆","\\gtrapprox",!0),fc(_c,yc,wc,"⋗","\\gtrdot"),fc(_c,yc,Lc,"⋙","\\ggg",!0),fc(_c,yc,Lc,"≷","\\gtrless",!0),fc(_c,yc,Lc,"⋛","\\gtreqless",!0),fc(_c,yc,Lc,"⪌","\\gtreqqless",!0),fc(_c,yc,Lc,"≖","\\eqcirc",!0),fc(_c,yc,Lc,"≗","\\circeq",!0),fc(_c,yc,Lc,"≜","\\triangleq",!0),fc(_c,yc,Lc,"∼","\\thicksim"),fc(_c,yc,Lc,"≈","\\thickapprox"),fc(_c,yc,Lc,"⫆","\\supseteqq",!0),fc(_c,yc,Lc,"⋑","\\Supset",!0),fc(_c,yc,Lc,"⊐","\\sqsupset",!0),fc(_c,yc,Lc,"≽","\\succcurlyeq",!0),fc(_c,yc,Lc,"⋟","\\curlyeqsucc",!0),fc(_c,yc,Lc,"≿","\\succsim",!0),fc(_c,yc,Lc,"⪸","\\succapprox",!0),fc(_c,yc,Lc,"⊳","\\vartriangleright"),fc(_c,yc,Lc,"⊵","\\trianglerighteq"),fc(_c,yc,Lc,"⊩","\\Vdash",!0),fc(_c,yc,Lc,"∣","\\shortmid"),fc(_c,yc,Lc,"∥","\\shortparallel"),fc(_c,yc,Lc,"≬","\\between",!0),fc(_c,yc,Lc,"⋔","\\pitchfork",!0),fc(_c,yc,Lc,"∝","\\varpropto"),fc(_c,yc,Lc,"◀","\\blacktriangleleft"),fc(_c,yc,Lc,"∴","\\therefore",!0),fc(_c,yc,Lc,"∍","\\backepsilon"),fc(_c,yc,Lc,"▶","\\blacktriangleright"),fc(_c,yc,Lc,"∵","\\because",!0),fc(_c,yc,Lc,"⋘","\\llless"),fc(_c,yc,Lc,"⋙","\\gggtr"),fc(_c,yc,wc,"⊲","\\lhd"),fc(_c,yc,wc,"⊳","\\rhd"),fc(_c,yc,Lc,"≂","\\eqsim",!0),fc(_c,bc,Lc,"⋈","\\Join"),fc(_c,yc,Lc,"≑","\\Doteq",!0),fc(_c,yc,wc,"∔","\\dotplus",!0),fc(_c,yc,wc,"∖","\\smallsetminus"),fc(_c,yc,wc,"⋒","\\Cap",!0),fc(_c,yc,wc,"⋓","\\Cup",!0),fc(_c,yc,wc,"⩞","\\doublebarwedge",!0),fc(_c,yc,wc,"⊟","\\boxminus",!0),fc(_c,yc,wc,"⊞","\\boxplus",!0),fc(_c,yc,wc,"⋇","\\divideontimes",!0),fc(_c,yc,wc,"⋉","\\ltimes",!0),fc(_c,yc,wc,"⋊","\\rtimes",!0),fc(_c,yc,wc,"⋋","\\leftthreetimes",!0),fc(_c,yc,wc,"⋌","\\rightthreetimes",!0),fc(_c,yc,wc,"⋏","\\curlywedge",!0),fc(_c,yc,wc,"⋎","\\curlyvee",!0),fc(_c,yc,wc,"⊝","\\circleddash",!0),fc(_c,yc,wc,"⊛","\\circledast",!0),fc(_c,yc,wc,"⋅","\\centerdot"),fc(_c,yc,wc,"⊺","\\intercal",!0),fc(_c,yc,wc,"⋒","\\doublecap"),fc(_c,yc,wc,"⋓","\\doublecup"),fc(_c,yc,wc,"⊠","\\boxtimes",!0),fc(_c,yc,Lc,"⇢","\\dashrightarrow",!0),fc(_c,yc,Lc,"⇠","\\dashleftarrow",!0),fc(_c,yc,Lc,"⇇","\\leftleftarrows",!0),fc(_c,yc,Lc,"⇆","\\leftrightarrows",!0),fc(_c,yc,Lc,"⇚","\\Lleftarrow",!0),fc(_c,yc,Lc,"↞","\\twoheadleftarrow",!0),fc(_c,yc,Lc,"↢","\\leftarrowtail",!0),fc(_c,yc,Lc,"↫","\\looparrowleft",!0),fc(_c,yc,Lc,"⇋","\\leftrightharpoons",!0),fc(_c,yc,Lc,"↶","\\curvearrowleft",!0),fc(_c,yc,Lc,"↺","\\circlearrowleft",!0),fc(_c,yc,Lc,"↰","\\Lsh",!0),fc(_c,yc,Lc,"⇈","\\upuparrows",!0),fc(_c,yc,Lc,"↿","\\upharpoonleft",!0),fc(_c,yc,Lc,"⇃","\\downharpoonleft",!0),fc(_c,bc,Lc,"⊶","\\origof",!0),fc(_c,bc,Lc,"⊷","\\imageof",!0),fc(_c,yc,Lc,"⊸","\\multimap",!0),fc(_c,yc,Lc,"↭","\\leftrightsquigarrow",!0),fc(_c,yc,Lc,"⇉","\\rightrightarrows",!0),fc(_c,yc,Lc,"⇄","\\rightleftarrows",!0),fc(_c,yc,Lc,"↠","\\twoheadrightarrow",!0),fc(_c,yc,Lc,"↣","\\rightarrowtail",!0),fc(_c,yc,Lc,"↬","\\looparrowright",!0),fc(_c,yc,Lc,"↷","\\curvearrowright",!0),fc(_c,yc,Lc,"↻","\\circlearrowright",!0),fc(_c,yc,Lc,"↱","\\Rsh",!0),fc(_c,yc,Lc,"⇊","\\downdownarrows",!0),fc(_c,yc,Lc,"↾","\\upharpoonright",!0),fc(_c,yc,Lc,"⇂","\\downharpoonright",!0),fc(_c,yc,Lc,"⇝","\\rightsquigarrow",!0),fc(_c,yc,Lc,"⇝","\\leadsto"),fc(_c,yc,Lc,"⇛","\\Rrightarrow",!0),fc(_c,yc,Lc,"↾","\\restriction"),fc(_c,bc,Ac,"‘","`"),fc(_c,bc,Ac,"$","\\$"),fc(gc,bc,Ac,"$","\\$"),fc(gc,bc,Ac,"$","\\textdollar"),fc(_c,bc,Ac,"%","\\%"),fc(gc,bc,Ac,"%","\\%"),fc(_c,bc,Ac,"_","\\_"),fc(gc,bc,Ac,"_","\\_"),fc(gc,bc,Ac,"_","\\textunderscore"),fc(_c,bc,Ac,"∠","\\angle",!0),fc(_c,bc,Ac,"∞","\\infty",!0),fc(_c,bc,Ac,"′","\\prime"),fc(_c,bc,Ac,"△","\\triangle"),fc(_c,bc,Ac,"Γ","\\Gamma",!0),fc(_c,bc,Ac,"Δ","\\Delta",!0),fc(_c,bc,Ac,"Θ","\\Theta",!0),fc(_c,bc,Ac,"Λ","\\Lambda",!0),fc(_c,bc,Ac,"Ξ","\\Xi",!0),fc(_c,bc,Ac,"Π","\\Pi",!0),fc(_c,bc,Ac,"Σ","\\Sigma",!0),fc(_c,bc,Ac,"Υ","\\Upsilon",!0),fc(_c,bc,Ac,"Φ","\\Phi",!0),fc(_c,bc,Ac,"Ψ","\\Psi",!0),fc(_c,bc,Ac,"Ω","\\Omega",!0),fc(_c,bc,Ac,"A","Α"),fc(_c,bc,Ac,"B","Β"),fc(_c,bc,Ac,"E","Ε"),fc(_c,bc,Ac,"Z","Ζ"),fc(_c,bc,Ac,"H","Η"),fc(_c,bc,Ac,"I","Ι"),fc(_c,bc,Ac,"K","Κ"),fc(_c,bc,Ac,"M","Μ"),fc(_c,bc,Ac,"N","Ν"),fc(_c,bc,Ac,"O","Ο"),fc(_c,bc,Ac,"P","Ρ"),fc(_c,bc,Ac,"T","Τ"),fc(_c,bc,Ac,"X","Χ"),fc(_c,bc,Ac,"¬","\\neg",!0),fc(_c,bc,Ac,"¬","\\lnot"),fc(_c,bc,Ac,"⊤","\\top"),fc(_c,bc,Ac,"⊥","\\bot"),fc(_c,bc,Ac,"∅","\\emptyset"),fc(_c,yc,Ac,"∅","\\varnothing"),fc(_c,bc,Sc,"α","\\alpha",!0),fc(_c,bc,Sc,"β","\\beta",!0),fc(_c,bc,Sc,"γ","\\gamma",!0),fc(_c,bc,Sc,"δ","\\delta",!0),fc(_c,bc,Sc,"ϵ","\\epsilon",!0),fc(_c,bc,Sc,"ζ","\\zeta",!0),fc(_c,bc,Sc,"η","\\eta",!0),fc(_c,bc,Sc,"θ","\\theta",!0),fc(_c,bc,Sc,"ι","\\iota",!0),fc(_c,bc,Sc,"κ","\\kappa",!0),fc(_c,bc,Sc,"λ","\\lambda",!0),fc(_c,bc,Sc,"μ","\\mu",!0),fc(_c,bc,Sc,"ν","\\nu",!0),fc(_c,bc,Sc,"ξ","\\xi",!0),fc(_c,bc,Sc,"ο","\\omicron",!0),fc(_c,bc,Sc,"π","\\pi",!0),fc(_c,bc,Sc,"ρ","\\rho",!0),fc(_c,bc,Sc,"σ","\\sigma",!0),fc(_c,bc,Sc,"τ","\\tau",!0),fc(_c,bc,Sc,"υ","\\upsilon",!0),fc(_c,bc,Sc,"ϕ","\\phi",!0),fc(_c,bc,Sc,"χ","\\chi",!0),fc(_c,bc,Sc,"ψ","\\psi",!0),fc(_c,bc,Sc,"ω","\\omega",!0),fc(_c,bc,Sc,"ε","\\varepsilon",!0),fc(_c,bc,Sc,"ϑ","\\vartheta",!0),fc(_c,bc,Sc,"ϖ","\\varpi",!0),fc(_c,bc,Sc,"ϱ","\\varrho",!0),fc(_c,bc,Sc,"ς","\\varsigma",!0),fc(_c,bc,Sc,"φ","\\varphi",!0),fc(_c,bc,wc,"∗","*",!0),fc(_c,bc,wc,"+","+"),fc(_c,bc,wc,"−","-",!0),fc(_c,bc,wc,"⋅","\\cdot",!0),fc(_c,bc,wc,"∘","\\circ",!0),fc(_c,bc,wc,"÷","\\div",!0),fc(_c,bc,wc,"±","\\pm",!0),fc(_c,bc,wc,"×","\\times",!0),fc(_c,bc,wc,"∩","\\cap",!0),fc(_c,bc,wc,"∪","\\cup",!0),fc(_c,bc,wc,"∖","\\setminus",!0),fc(_c,bc,wc,"∧","\\land"),fc(_c,bc,wc,"∨","\\lor"),fc(_c,bc,wc,"∧","\\wedge",!0),fc(_c,bc,wc,"∨","\\vee",!0),fc(_c,bc,Ac,"√","\\surd"),fc(_c,bc,Mc,"⟨","\\langle",!0),fc(_c,bc,Mc,"∣","\\lvert"),fc(_c,bc,Mc,"∥","\\lVert"),fc(_c,bc,xc,"?","?"),fc(_c,bc,xc,"!","!"),fc(_c,bc,xc,"⟩","\\rangle",!0),fc(_c,bc,xc,"∣","\\rvert"),fc(_c,bc,xc,"∥","\\rVert"),fc(_c,bc,Lc,"=","="),fc(_c,bc,Lc,":",":"),fc(_c,bc,Lc,"≈","\\approx",!0),fc(_c,bc,Lc,"≅","\\cong",!0),fc(_c,bc,Lc,"≥","\\ge"),fc(_c,bc,Lc,"≥","\\geq",!0),fc(_c,bc,Lc,"←","\\gets"),fc(_c,bc,Lc,">","\\gt",!0),fc(_c,bc,Lc,"∈","\\in",!0),fc(_c,bc,Lc,"","\\@not"),fc(_c,bc,Lc,"⊂","\\subset",!0),fc(_c,bc,Lc,"⊃","\\supset",!0),fc(_c,bc,Lc,"⊆","\\subseteq",!0),fc(_c,bc,Lc,"⊇","\\supseteq",!0),fc(_c,yc,Lc,"⊈","\\nsubseteq",!0),fc(_c,yc,Lc,"⊉","\\nsupseteq",!0),fc(_c,bc,Lc,"⊨","\\models"),fc(_c,bc,Lc,"←","\\leftarrow",!0),fc(_c,bc,Lc,"≤","\\le"),fc(_c,bc,Lc,"≤","\\leq",!0),fc(_c,bc,Lc,"<","\\lt",!0),fc(_c,bc,Lc,"→","\\rightarrow",!0),fc(_c,bc,Lc,"→","\\to"),fc(_c,yc,Lc,"≱","\\ngeq",!0),fc(_c,yc,Lc,"≰","\\nleq",!0),fc(_c,bc,zc," ","\\ "),fc(_c,bc,zc," ","\\space"),fc(_c,bc,zc," ","\\nobreakspace"),fc(gc,bc,zc," ","\\ "),fc(gc,bc,zc," "," "),fc(gc,bc,zc," ","\\space"),fc(gc,bc,zc," ","\\nobreakspace"),fc(_c,bc,zc,null,"\\nobreak"),fc(_c,bc,zc,null,"\\allowbreak"),fc(_c,bc,Tc,",",","),fc(_c,bc,Tc,";",";"),fc(_c,yc,wc,"⊼","\\barwedge",!0),fc(_c,yc,wc,"⊻","\\veebar",!0),fc(_c,bc,wc,"⊙","\\odot",!0),fc(_c,bc,wc,"⊕","\\oplus",!0),fc(_c,bc,wc,"⊗","\\otimes",!0),fc(_c,bc,Ac,"∂","\\partial",!0),fc(_c,bc,wc,"⊘","\\oslash",!0),fc(_c,yc,wc,"⊚","\\circledcirc",!0),fc(_c,yc,wc,"⊡","\\boxdot",!0),fc(_c,bc,wc,"△","\\bigtriangleup"),fc(_c,bc,wc,"▽","\\bigtriangledown"),fc(_c,bc,wc,"†","\\dagger"),fc(_c,bc,wc,"⋄","\\diamond"),fc(_c,bc,wc,"⋆","\\star"),fc(_c,bc,wc,"◃","\\triangleleft"),fc(_c,bc,wc,"▹","\\triangleright"),fc(_c,bc,Mc,"{","\\{"),fc(gc,bc,Ac,"{","\\{"),fc(gc,bc,Ac,"{","\\textbraceleft"),fc(_c,bc,xc,"}","\\}"),fc(gc,bc,Ac,"}","\\}"),fc(gc,bc,Ac,"}","\\textbraceright"),fc(_c,bc,Mc,"{","\\lbrace"),fc(_c,bc,xc,"}","\\rbrace"),fc(_c,bc,Mc,"[","\\lbrack",!0),fc(gc,bc,Ac,"[","\\lbrack",!0),fc(_c,bc,xc,"]","\\rbrack",!0),fc(gc,bc,Ac,"]","\\rbrack",!0),fc(_c,bc,Mc,"(","\\lparen",!0),fc(_c,bc,xc,")","\\rparen",!0),fc(gc,bc,Ac,"<","\\textless",!0),fc(gc,bc,Ac,">","\\textgreater",!0),fc(_c,bc,Mc,"⌊","\\lfloor",!0),fc(_c,bc,xc,"⌋","\\rfloor",!0),fc(_c,bc,Mc,"⌈","\\lceil",!0),fc(_c,bc,xc,"⌉","\\rceil",!0),fc(_c,bc,Ac,"\\","\\backslash"),fc(_c,bc,Ac,"∣","|"),fc(_c,bc,Ac,"∣","\\vert"),fc(gc,bc,Ac,"|","\\textbar",!0),fc(_c,bc,Ac,"∥","\\|"),fc(_c,bc,Ac,"∥","\\Vert"),fc(gc,bc,Ac,"∥","\\textbardbl"),fc(gc,bc,Ac,"~","\\textasciitilde"),fc(gc,bc,Ac,"\\","\\textbackslash"),fc(gc,bc,Ac,"^","\\textasciicircum"),fc(_c,bc,Lc,"↑","\\uparrow",!0),fc(_c,bc,Lc,"⇑","\\Uparrow",!0),fc(_c,bc,Lc,"↓","\\downarrow",!0),fc(_c,bc,Lc,"⇓","\\Downarrow",!0),fc(_c,bc,Lc,"↕","\\updownarrow",!0),fc(_c,bc,Lc,"⇕","\\Updownarrow",!0),fc(_c,bc,Cc,"∐","\\coprod"),fc(_c,bc,Cc,"⋁","\\bigvee"),fc(_c,bc,Cc,"⋀","\\bigwedge"),fc(_c,bc,Cc,"⨄","\\biguplus"),fc(_c,bc,Cc,"⋂","\\bigcap"),fc(_c,bc,Cc,"⋃","\\bigcup"),fc(_c,bc,Cc,"∫","\\int"),fc(_c,bc,Cc,"∫","\\intop"),fc(_c,bc,Cc,"∬","\\iint"),fc(_c,bc,Cc,"∭","\\iiint"),fc(_c,bc,Cc,"∏","\\prod"),fc(_c,bc,Cc,"∑","\\sum"),fc(_c,bc,Cc,"⨂","\\bigotimes"),fc(_c,bc,Cc,"⨁","\\bigoplus"),fc(_c,bc,Cc,"⨀","\\bigodot"),fc(_c,bc,Cc,"∮","\\oint"),fc(_c,bc,Cc,"∯","\\oiint"),fc(_c,bc,Cc,"∰","\\oiiint"),fc(_c,bc,Cc,"⨆","\\bigsqcup"),fc(_c,bc,Cc,"∫","\\smallint"),fc(gc,bc,kc,"…","\\textellipsis"),fc(_c,bc,kc,"…","\\mathellipsis"),fc(gc,bc,kc,"…","\\ldots",!0),fc(_c,bc,kc,"…","\\ldots",!0),fc(_c,bc,kc,"⋯","\\@cdots",!0),fc(_c,bc,kc,"⋱","\\ddots",!0),fc(_c,bc,Ac,"⋮","\\varvdots"),fc(gc,bc,Ac,"⋮","\\varvdots"),fc(_c,bc,vc,"ˊ","\\acute"),fc(_c,bc,vc,"ˋ","\\grave"),fc(_c,bc,vc,"¨","\\ddot"),fc(_c,bc,vc,"~","\\tilde"),fc(_c,bc,vc,"ˉ","\\bar"),fc(_c,bc,vc,"˘","\\breve"),fc(_c,bc,vc,"ˇ","\\check"),fc(_c,bc,vc,"^","\\hat"),fc(_c,bc,vc,"⃗","\\vec"),fc(_c,bc,vc,"˙","\\dot"),fc(_c,bc,vc,"˚","\\mathring"),fc(_c,bc,Sc,"","\\@imath"),fc(_c,bc,Sc,"","\\@jmath"),fc(_c,bc,Ac,"ı","ı"),fc(_c,bc,Ac,"ȷ","ȷ"),fc(gc,bc,Ac,"ı","\\i",!0),fc(gc,bc,Ac,"ȷ","\\j",!0),fc(gc,bc,Ac,"ß","\\ss",!0),fc(gc,bc,Ac,"æ","\\ae",!0),fc(gc,bc,Ac,"œ","\\oe",!0),fc(gc,bc,Ac,"ø","\\o",!0),fc(gc,bc,Ac,"Æ","\\AE",!0),fc(gc,bc,Ac,"Œ","\\OE",!0),fc(gc,bc,Ac,"Ø","\\O",!0),fc(gc,bc,vc,"ˊ","\\'"),fc(gc,bc,vc,"ˋ","\\`"),fc(gc,bc,vc,"ˆ","\\^"),fc(gc,bc,vc,"˜","\\~"),fc(gc,bc,vc,"ˉ","\\="),fc(gc,bc,vc,"˘","\\u"),fc(gc,bc,vc,"˙","\\."),fc(gc,bc,vc,"¸","\\c"),fc(gc,bc,vc,"˚","\\r"),fc(gc,bc,vc,"ˇ","\\v"),fc(gc,bc,vc,"¨",'\\"'),fc(gc,bc,vc,"˝","\\H"),fc(gc,bc,vc,"◯","\\textcircled");var Rc={"--":!0,"---":!0,"``":!0,"''":!0};fc(gc,bc,Ac,"–","--",!0),fc(gc,bc,Ac,"–","\\textendash"),fc(gc,bc,Ac,"—","---",!0),fc(gc,bc,Ac,"—","\\textemdash"),fc(gc,bc,Ac,"‘","`",!0),fc(gc,bc,Ac,"‘","\\textquoteleft"),fc(gc,bc,Ac,"’","'",!0),fc(gc,bc,Ac,"’","\\textquoteright"),fc(gc,bc,Ac,"“","``",!0),fc(gc,bc,Ac,"“","\\textquotedblleft"),fc(gc,bc,Ac,"”","''",!0),fc(gc,bc,Ac,"”","\\textquotedblright"),fc(_c,bc,Ac,"°","\\degree",!0),fc(gc,bc,Ac,"°","\\degree"),fc(gc,bc,Ac,"°","\\textdegree",!0),fc(_c,bc,Ac,"£","\\pounds"),fc(_c,bc,Ac,"£","\\mathsterling",!0),fc(gc,bc,Ac,"£","\\pounds"),fc(gc,bc,Ac,"£","\\textsterling",!0),fc(_c,yc,Ac,"✠","\\maltese"),fc(gc,yc,Ac,"✠","\\maltese");for(var Pc=0;Pc<14;Pc++){var Nc='0123456789/@."'.charAt(Pc);fc(_c,bc,Ac,Nc,Nc)}for(var Ec=0;Ec<25;Ec++){var Oc='0123456789!@*()-=+";:?/.,'.charAt(Ec);fc(gc,bc,Ac,Oc,Oc)}for(var Ic="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Bc=0;Bc<52;Bc++){var Dc=Ic.charAt(Bc);fc(_c,bc,Sc,Dc,Dc),fc(gc,bc,Ac,Dc,Dc)}fc(_c,yc,Ac,"C","ℂ"),fc(gc,yc,Ac,"C","ℂ"),fc(_c,yc,Ac,"H","ℍ"),fc(gc,yc,Ac,"H","ℍ"),fc(_c,yc,Ac,"N","ℕ"),fc(gc,yc,Ac,"N","ℕ"),fc(_c,yc,Ac,"P","ℙ"),fc(gc,yc,Ac,"P","ℙ"),fc(_c,yc,Ac,"Q","ℚ"),fc(gc,yc,Ac,"Q","ℚ"),fc(_c,yc,Ac,"R","ℝ"),fc(gc,yc,Ac,"R","ℝ"),fc(_c,yc,Ac,"Z","ℤ"),fc(gc,yc,Ac,"Z","ℤ"),fc(_c,bc,Sc,"h","ℎ"),fc(gc,bc,Sc,"h","ℎ");for(var Vc="",Hc=0;Hc<52;Hc++){var jc=Ic.charAt(Hc);fc(_c,bc,Sc,jc,Vc=String.fromCharCode(55349,56320+Hc)),fc(gc,bc,Ac,jc,Vc),fc(_c,bc,Sc,jc,Vc=String.fromCharCode(55349,56372+Hc)),fc(gc,bc,Ac,jc,Vc),fc(_c,bc,Sc,jc,Vc=String.fromCharCode(55349,56424+Hc)),fc(gc,bc,Ac,jc,Vc),fc(_c,bc,Sc,jc,Vc=String.fromCharCode(55349,56580+Hc)),fc(gc,bc,Ac,jc,Vc),fc(_c,bc,Sc,jc,Vc=String.fromCharCode(55349,56684+Hc)),fc(gc,bc,Ac,jc,Vc),fc(_c,bc,Sc,jc,Vc=String.fromCharCode(55349,56736+Hc)),fc(gc,bc,Ac,jc,Vc),fc(_c,bc,Sc,jc,Vc=String.fromCharCode(55349,56788+Hc)),fc(gc,bc,Ac,jc,Vc),fc(_c,bc,Sc,jc,Vc=String.fromCharCode(55349,56840+Hc)),fc(gc,bc,Ac,jc,Vc),fc(_c,bc,Sc,jc,Vc=String.fromCharCode(55349,56944+Hc)),fc(gc,bc,Ac,jc,Vc),Hc<26&&(fc(_c,bc,Sc,jc,Vc=String.fromCharCode(55349,56632+Hc)),fc(gc,bc,Ac,jc,Vc),fc(_c,bc,Sc,jc,Vc=String.fromCharCode(55349,56476+Hc)),fc(gc,bc,Ac,jc,Vc))}fc(_c,bc,Sc,"k",Vc=String.fromCharCode(55349,56668)),fc(gc,bc,Ac,"k",Vc);for(var Fc=0;Fc<10;Fc++){var Uc=Fc.toString();fc(_c,bc,Sc,Uc,Vc=String.fromCharCode(55349,57294+Fc)),fc(gc,bc,Ac,Uc,Vc),fc(_c,bc,Sc,Uc,Vc=String.fromCharCode(55349,57314+Fc)),fc(gc,bc,Ac,Uc,Vc),fc(_c,bc,Sc,Uc,Vc=String.fromCharCode(55349,57324+Fc)),fc(gc,bc,Ac,Uc,Vc),fc(_c,bc,Sc,Uc,Vc=String.fromCharCode(55349,57334+Fc)),fc(gc,bc,Ac,Uc,Vc)}for(var qc=0;qc<3;qc++){var $c="ÐÞþ".charAt(qc);fc(_c,bc,Sc,$c,$c),fc(gc,bc,Ac,$c,$c)}var Gc=[["mathbf","textbf","Main-Bold"],["mathbf","textbf","Main-Bold"],["mathnormal","textit","Math-Italic"],["mathnormal","textit","Math-Italic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["mathscr","textscr","Script-Regular"],["","",""],["","",""],["","",""],["mathfrak","textfrak","Fraktur-Regular"],["mathfrak","textfrak","Fraktur-Regular"],["mathbb","textbb","AMS-Regular"],["mathbb","textbb","AMS-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathitsf","textitsf","SansSerif-Italic"],["mathitsf","textitsf","SansSerif-Italic"],["","",""],["","",""],["mathtt","texttt","Typewriter-Regular"],["mathtt","texttt","Typewriter-Regular"]],Xc=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],Kc=function(e,t,n){return mc[n][e]&&mc[n][e].replace&&(e=mc[n][e].replace),{value:e,metrics:jl(e,t,n)}},Wc=function(e,t,n,r,i){var s,o=Kc(e,t,n),a=o.metrics;if(e=o.value,a){var l=a.italic;("text"===n||r&&"mathit"===r.font)&&(l=0),s=new ac(e,a.height,a.depth,l,a.skew,a.width,i)}else"undefined"!=typeof console&&console.warn("No character metrics for '"+e+"' in style '"+t+"' and mode '"+n+"'"),s=new ac(e,0,0,0,0,0,i);if(r){s.maxFontSize=r.sizeMultiplier,r.style.isTight()&&s.classes.push("mtight");var c=r.getColor();c&&(s.style.color=c)}return s},Yc=(e,t)=>{if(Ql(e.classes)!==Ql(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize)return!1;if(1===e.classes.length){var n=e.classes[0];if("mbin"===n||"mord"===n)return!1}for(var r in e.style)if(e.style.hasOwnProperty(r)&&e.style[r]!==t.style[r])return!1;for(var i in t.style)if(t.style.hasOwnProperty(i)&&e.style[i]!==t.style[i])return!1;return!0},Zc=function(e){for(var t=0,n=0,r=0,i=0;i<e.children.length;i++){var s=e.children[i];s.height>t&&(t=s.height),s.depth>n&&(n=s.depth),s.maxFontSize>r&&(r=s.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=r},Qc=function(e,t,n,r){var i=new rc(e,t,n,r);return Zc(i),i},Jc=(e,t,n,r)=>new rc(e,t,n,r),ed=function(e){var t=new Bl(e);return Zc(t),t},td=function(e,t,n){var r="";switch(e){case"amsrm":r="AMS";break;case"textrm":r="Main";break;case"textsf":r="SansSerif";break;case"texttt":r="Typewriter";break;default:r=e}return r+"-"+("textbf"===t&&"textit"===n?"BoldItalic":"textbf"===t?"Bold":"textit"===t?"Italic":"Regular")},nd={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},rd={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},id={fontMap:nd,makeSymbol:Wc,mathsym:function(e,t,n,r){return void 0===r&&(r=[]),"boldsymbol"===n.font&&Kc(e,"Main-Bold",t).metrics?Wc(e,"Main-Bold",t,n,r.concat(["mathbf"])):"\\"===e||"main"===mc[t][e].font?Wc(e,"Main-Regular",t,n,r):Wc(e,"AMS-Regular",t,n,r.concat(["amsrm"]))},makeSpan:Qc,makeSvgSpan:Jc,makeLineSpan:function(e,t,n){var r=Qc([e],[],t);return r.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),r.style.borderBottomWidth=Zl(r.height),r.maxFontSize=1,r},makeAnchor:function(e,t,n,r){var i=new ic(e,t,n,r);return Zc(i),i},makeFragment:ed,wrapFragment:function(e,t){return e instanceof Bl?Qc([],[e],t):e},makeVList:function(e,t){for(var{children:n,depth:r}=function(e){if("individualShift"===e.positionType){for(var t=e.children,n=[t[0]],r=-t[0].shift-t[0].elem.depth,i=r,s=1;s<t.length;s++){var o=-t[s].shift-i-t[s].elem.depth,a=o-(t[s-1].elem.height+t[s-1].elem.depth);i+=o,n.push({type:"kern",size:a}),n.push(t[s])}return{children:n,depth:r}}var l;if("top"===e.positionType){for(var c=e.positionData,d=0;d<e.children.length;d++){var u=e.children[d];c-="kern"===u.type?u.size:u.elem.height+u.elem.depth}l=c}else if("bottom"===e.positionType)l=-e.positionData;else{var h=e.children[0];if("elem"!==h.type)throw new Error('First child must have type "elem".');if("shift"===e.positionType)l=-h.elem.depth-e.positionData;else{if("firstBaseline"!==e.positionType)throw new Error("Invalid positionType "+e.positionType+".");l=-h.elem.depth}}return{children:e.children,depth:l}}(e),i=0,s=0;s<n.length;s++){var o=n[s];if("elem"===o.type){var a=o.elem;i=Math.max(i,a.maxFontSize,a.height)}}i+=2;var l=Qc(["pstrut"],[]);l.style.height=Zl(i);for(var c=[],d=r,u=r,h=r,p=0;p<n.length;p++){var m=n[p];if("kern"===m.type)h+=m.size;else{var f=m.elem,_=m.wrapperClasses||[],g=m.wrapperStyle||{},b=Qc(_,[l,f],void 0,g);b.style.top=Zl(-i-h-f.depth),m.marginLeft&&(b.style.marginLeft=m.marginLeft),m.marginRight&&(b.style.marginRight=m.marginRight),c.push(b),h+=f.height+f.depth}d=Math.min(d,h),u=Math.max(u,h)}var y,v=Qc(["vlist"],c);if(v.style.height=Zl(u),d<0){var w=Qc([],[]),x=Qc(["vlist"],[w]);x.style.height=Zl(-d);var k=Qc(["vlist-s"],[new ac("")]);y=[Qc(["vlist-r"],[v,k]),Qc(["vlist-r"],[x])]}else y=[Qc(["vlist-r"],[v])];var S=Qc(["vlist-t"],y);return 2===y.length&&S.classes.push("vlist-t2"),S.height=u,S.depth=-d,S},makeOrd:function(e,t,n){var r=e.mode,i=e.text,s=["mord"],o="math"===r||"text"===r&&t.font,a=o?t.font:t.fontFamily,l="",c="";if(55349===i.charCodeAt(0)&&([l,c]=function(e,t){var n=1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536,r="math"===t?0:1;if(119808<=n&&n<120484){var i=Math.floor((n-119808)/26);return[Gc[i][2],Gc[i][r]]}if(120782<=n&&n<=120831){var s=Math.floor((n-120782)/10);return[Xc[s][2],Xc[s][r]]}if(120485===n||120486===n)return[Gc[0][2],Gc[0][r]];if(120486<n&&n<120782)return["",""];throw new cl("Unsupported character: "+e)}(i,r)),l.length>0)return Wc(i,l,r,t,s.concat(c));if(a){var d,u;if("boldsymbol"===a){var h=function(e,t,n,r,i){return"textord"!==i&&Kc(e,"Math-BoldItalic",t).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}}(i,r,0,0,n);d=h.fontName,u=[h.fontClass]}else o?(d=nd[a].fontName,u=[a]):(d=td(a,t.fontWeight,t.fontShape),u=[a,t.fontWeight,t.fontShape]);if(Kc(i,d,r).metrics)return Wc(i,d,r,t,s.concat(u));if(Rc.hasOwnProperty(i)&&"Typewriter"===d.slice(0,10)){for(var p=[],m=0;m<i.length;m++)p.push(Wc(i[m],d,r,t,s.concat(u)));return ed(p)}}if("mathord"===n)return Wc(i,"Math-Italic",r,t,s.concat(["mathnormal"]));if("textord"===n){var f=mc[r][i]&&mc[r][i].font;if("ams"===f){var _=td("amsrm",t.fontWeight,t.fontShape);return Wc(i,_,r,t,s.concat("amsrm",t.fontWeight,t.fontShape))}if("main"!==f&&f){var g=td(f,t.fontWeight,t.fontShape);return Wc(i,g,r,t,s.concat(g,t.fontWeight,t.fontShape))}var b=td("textrm",t.fontWeight,t.fontShape);return Wc(i,b,r,t,s.concat(t.fontWeight,t.fontShape))}throw new Error("unexpected type: "+n+" in makeOrd")},makeGlue:(e,t)=>{var n=Qc(["mspace"],[],t),r=Yl(e,t);return n.style.marginRight=Zl(r),n},staticSvg:function(e,t){var[n,r,i]=rd[e],s=new cc(n),o=new lc([s],{width:Zl(r),height:Zl(i),style:"width:"+Zl(r),viewBox:"0 0 "+1e3*r+" "+1e3*i,preserveAspectRatio:"xMinYMin"}),a=Jc(["overlay"],[o],t);return a.height=i,a.style.height=Zl(i),a.style.width=Zl(r),a},svgData:rd,tryCombineChars:e=>{for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n instanceof ac&&r instanceof ac&&Yc(n,r)&&(n.text+=r.text,n.height=Math.max(n.height,r.height),n.depth=Math.max(n.depth,r.depth),n.italic=r.italic,e.splice(t+1,1),t--)}return e}},sd={number:3,unit:"mu"},od={number:4,unit:"mu"},ad={number:5,unit:"mu"},ld={mord:{mop:sd,mbin:od,mrel:ad,minner:sd},mop:{mord:sd,mop:sd,mrel:ad,minner:sd},mbin:{mord:od,mop:od,mopen:od,minner:od},mrel:{mord:ad,mop:ad,mopen:ad,minner:ad},mopen:{},mclose:{mop:sd,mbin:od,mrel:ad,minner:sd},mpunct:{mord:sd,mop:sd,mrel:ad,mopen:sd,mclose:sd,mpunct:sd,minner:sd},minner:{mord:sd,mop:sd,mbin:od,mrel:ad,mopen:sd,mpunct:sd,minner:sd}},cd={mord:{mop:sd},mop:{mord:sd,mop:sd},mbin:{},mrel:{},mopen:{},mclose:{mop:sd},mpunct:{},minner:{mop:sd}},dd={},ud={},hd={};function pd(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:s,mathmlBuilder:o}=e,a={type:t,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:void 0===r.allowedInMath||r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:i},l=0;l<n.length;++l)dd[n[l]]=a;t&&(s&&(ud[t]=s),o&&(hd[t]=o))}function md(e){var{type:t,htmlBuilder:n,mathmlBuilder:r}=e;pd({type:t,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:n,mathmlBuilder:r})}var fd=function(e){return"ordgroup"===e.type&&1===e.body.length?e.body[0]:e},_d=function(e){return"ordgroup"===e.type?e.body:[e]},gd=id.makeSpan,bd=["leftmost","mbin","mopen","mrel","mop","mpunct"],yd=["rightmost","mrel","mclose","mpunct"],vd={display:Pl.DISPLAY,text:Pl.TEXT,script:Pl.SCRIPT,scriptscript:Pl.SCRIPTSCRIPT},wd={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},xd=function(e,t,n,r){void 0===r&&(r=[null,null]);for(var i=[],s=0;s<e.length;s++){var o=Ld(e[s],t);if(o instanceof Bl){var a=o.children;i.push(...a)}else i.push(o)}if(id.tryCombineChars(i),!n)return i;var l=t;if(1===e.length){var c=e[0];"sizing"===c.type?l=t.havingSize(c.size):"styling"===c.type&&(l=t.havingStyle(vd[c.style]))}var d=gd([r[0]||"leftmost"],[],t),u=gd([r[1]||"rightmost"],[],t),h="root"===n;return kd(i,(e,t)=>{var n=t.classes[0],r=e.classes[0];"mbin"===n&&ml(yd,r)?t.classes[0]="mord":"mbin"===r&&ml(bd,n)&&(e.classes[0]="mord")},{node:d},u,h),kd(i,(e,t)=>{var n=Md(t),r=Md(e),i=n&&r?e.hasClass("mtight")?cd[n][r]:ld[n][r]:null;if(i)return id.makeGlue(i,l)},{node:d},u,h),i},kd=function e(t,n,r,i,s){i&&t.push(i);for(var o=0;o<t.length;o++){var a=t[o],l=Sd(a);if(l)e(l.children,n,r,null,s);else{var c=!a.hasClass("mspace");if(c){var d=n(a,r.node);d&&(r.insertAfter?r.insertAfter(d):(t.unshift(d),o++))}c?r.node=a:s&&a.hasClass("newline")&&(r.node=gd(["leftmost"])),r.insertAfter=(e=>n=>{t.splice(e+1,0,n),o++})(o)}}i&&t.pop()},Sd=function(e){return e instanceof Bl||e instanceof ic||e instanceof rc&&e.hasClass("enclosing")?e:null},Cd=function e(t,n){var r=Sd(t);if(r){var i=r.children;if(i.length){if("right"===n)return e(i[i.length-1],"right");if("left"===n)return e(i[0],"left")}}return t},Md=function(e,t){return e?(t&&(e=Cd(e,t)),wd[e.classes[0]]||null):null},Td=function(e,t){var n=["nulldelimiter"].concat(e.baseSizingClasses());return gd(t.concat(n))},Ld=function(e,t,n){if(!e)return gd();if(ud[e.type]){var r=ud[e.type](e,t);if(n&&t.size!==n.size){r=gd(t.sizingClasses(n),[r],t);var i=t.sizeMultiplier/n.sizeMultiplier;r.height*=i,r.depth*=i}return r}throw new cl("Got group of unknown type: '"+e.type+"'")};function zd(e,t){var n=gd(["base"],e,t),r=gd(["strut"]);return r.style.height=Zl(n.height+n.depth),n.depth&&(r.style.verticalAlign=Zl(-n.depth)),n.children.unshift(r),n}function Ad(e,t){var n=null;1===e.length&&"tag"===e[0].type&&(n=e[0].tag,e=e[0].body);var r,i=xd(e,t,"root");2===i.length&&i[1].hasClass("tag")&&(r=i.pop());for(var s,o=[],a=[],l=0;l<i.length;l++)if(a.push(i[l]),i[l].hasClass("mbin")||i[l].hasClass("mrel")||i[l].hasClass("allowbreak")){for(var c=!1;l<i.length-1&&i[l+1].hasClass("mspace")&&!i[l+1].hasClass("newline");)l++,a.push(i[l]),i[l].hasClass("nobreak")&&(c=!0);c||(o.push(zd(a,t)),a=[])}else i[l].hasClass("newline")&&(a.pop(),a.length>0&&(o.push(zd(a,t)),a=[]),o.push(i[l]));a.length>0&&o.push(zd(a,t)),n?((s=zd(xd(n,t,!0))).classes=["tag"],o.push(s)):r&&o.push(r);var d=gd(["katex-html"],o);if(d.setAttribute("aria-hidden","true"),s){var u=s.children[0];u.style.height=Zl(d.height+d.depth),d.depth&&(u.style.verticalAlign=Zl(-d.depth))}return d}function Rd(e){return new Bl(e)}class Pd{constructor(e,t,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=n||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=Ql(this.classes));for(var n=0;n<this.children.length;n++)if(this.children[n]instanceof Nd&&this.children[n+1]instanceof Nd){for(var r=this.children[n].toText()+this.children[++n].toText();this.children[n+1]instanceof Nd;)r+=this.children[++n].toText();e.appendChild(new Nd(r).toNode())}else e.appendChild(this.children[n].toNode());return e}toMarkup(){var e="<"+this.type;for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="',e+=_l(this.attributes[t]),e+='"');this.classes.length>0&&(e+=' class ="'+_l(Ql(this.classes))+'"'),e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+"</"+this.type+">"}toText(){return this.children.map(e=>e.toText()).join("")}}class Nd{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return _l(this.toText())}toText(){return this.text}}var Ed={MathNode:Pd,TextNode:Nd,SpaceNode:class{constructor(e){this.width=void 0,this.character=void 0,this.width=e,this.character=e>=.05555&&e<=.05556?" ":e>=.1666&&e<=.1667?" ":e>=.2222&&e<=.2223?" ":e>=.2777&&e<=.2778?" ":e>=-.05556&&e<=-.05555?" ":e>=-.1667&&e<=-.1666?" ":e>=-.2223&&e<=-.2222?" ":e>=-.2778&&e<=-.2777?" ":null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",Zl(this.width)),e}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+Zl(this.width)+'"/>'}toText(){return this.character?this.character:" "}},newDocumentFragment:Rd},Od=function(e,t,n){return!mc[t][e]||!mc[t][e].replace||55349===e.charCodeAt(0)||Rc.hasOwnProperty(e)&&n&&(n.fontFamily&&"tt"===n.fontFamily.slice(4,6)||n.font&&"tt"===n.font.slice(4,6))||(e=mc[t][e].replace),new Ed.TextNode(e)},Id=function(e){return 1===e.length?e[0]:new Ed.MathNode("mrow",e)},Bd=function(e,t){if("texttt"===t.fontFamily)return"monospace";if("textsf"===t.fontFamily)return"textit"===t.fontShape&&"textbf"===t.fontWeight?"sans-serif-bold-italic":"textit"===t.fontShape?"sans-serif-italic":"textbf"===t.fontWeight?"bold-sans-serif":"sans-serif";if("textit"===t.fontShape&&"textbf"===t.fontWeight)return"bold-italic";if("textit"===t.fontShape)return"italic";if("textbf"===t.fontWeight)return"bold";var n=t.font;if(!n||"mathnormal"===n)return null;var r=e.mode;if("mathit"===n)return"italic";if("boldsymbol"===n)return"textord"===e.type?"bold":"bold-italic";if("mathbf"===n)return"bold";if("mathbb"===n)return"double-struck";if("mathsfit"===n)return"sans-serif-italic";if("mathfrak"===n)return"fraktur";if("mathscr"===n||"mathcal"===n)return"script";if("mathsf"===n)return"sans-serif";if("mathtt"===n)return"monospace";var i=e.text;return ml(["\\imath","\\jmath"],i)?null:(mc[r][i]&&mc[r][i].replace&&(i=mc[r][i].replace),jl(i,id.fontMap[n].fontName,r)?id.fontMap[n].variant:null)};function Dd(e){if(!e)return!1;if("mi"===e.type&&1===e.children.length){var t=e.children[0];return t instanceof Nd&&"."===t.text}if("mo"===e.type&&1===e.children.length&&"true"===e.getAttribute("separator")&&"0em"===e.getAttribute("lspace")&&"0em"===e.getAttribute("rspace")){var n=e.children[0];return n instanceof Nd&&","===n.text}return!1}var Vd=function(e,t,n){if(1===e.length){var r=jd(e[0],t);return n&&r instanceof Pd&&"mo"===r.type&&(r.setAttribute("lspace","0em"),r.setAttribute("rspace","0em")),[r]}for(var i,s=[],o=0;o<e.length;o++){var a=jd(e[o],t);if(a instanceof Pd&&i instanceof Pd){if("mtext"===a.type&&"mtext"===i.type&&a.getAttribute("mathvariant")===i.getAttribute("mathvariant")){i.children.push(...a.children);continue}if("mn"===a.type&&"mn"===i.type){i.children.push(...a.children);continue}if(Dd(a)&&"mn"===i.type){i.children.push(...a.children);continue}if("mn"===a.type&&Dd(i))a.children=[...i.children,...a.children],s.pop();else if(("msup"===a.type||"msub"===a.type)&&a.children.length>=1&&("mn"===i.type||Dd(i))){var l=a.children[0];l instanceof Pd&&"mn"===l.type&&(l.children=[...i.children,...l.children],s.pop())}else if("mi"===i.type&&1===i.children.length){var c=i.children[0];if(c instanceof Nd&&"̸"===c.text&&("mo"===a.type||"mi"===a.type||"mn"===a.type)){var d=a.children[0];d instanceof Nd&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),s.pop())}}}s.push(a),i=a}return s},Hd=function(e,t,n){return Id(Vd(e,t,n))},jd=function(e,t){if(!e)return new Ed.MathNode("mrow");if(hd[e.type])return hd[e.type](e,t);throw new cl("Got group of unknown type: '"+e.type+"'")};function Fd(e,t,n,r,i){var s,o=Vd(e,n);s=1===o.length&&o[0]instanceof Pd&&ml(["mrow","mtable"],o[0].type)?o[0]:new Ed.MathNode("mrow",o);var a=new Ed.MathNode("annotation",[new Ed.TextNode(t)]);a.setAttribute("encoding","application/x-tex");var l=new Ed.MathNode("semantics",[s,a]),c=new Ed.MathNode("math",[l]);return c.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&c.setAttribute("display","block"),id.makeSpan([i?"katex":"katex-mathml"],[c])}var Ud={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},qd={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},$d=function(e){var t=new Ed.MathNode("mo",[new Ed.TextNode(Ud[e.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},Gd=function(e,t){var{span:n,minWidth:r,height:i}=function(){var n=4e5,r=e.label.slice(1);if(ml(["widehat","widecheck","widetilde","utilde"],r)){var i,s,o,a="ordgroup"===(p=e.base).type?p.body.length:1;if(a>5)"widehat"===r||"widecheck"===r?(i=420,n=2364,o=.42,s=r+"4"):(i=312,n=2340,o=.34,s="tilde4");else{var l=[1,1,2,2,3,3][a];"widehat"===r||"widecheck"===r?(n=[0,1062,2364,2364,2364][l],i=[0,239,300,360,420][l],o=[0,.24,.3,.3,.36,.42][l],s=r+l):(n=[0,600,1033,2339,2340][l],i=[0,260,286,306,312][l],o=[0,.26,.286,.3,.306,.34][l],s="tilde"+l)}var c=new cc(s),d=new lc([c],{width:"100%",height:Zl(o),viewBox:"0 0 "+n+" "+i,preserveAspectRatio:"none"});return{span:id.makeSvgSpan([],[d],t),minWidth:0,height:o}}var u,h,p,m=[],f=qd[r],[_,g,b]=f,y=b/1e3,v=_.length;if(1===v)u=["hide-tail"],h=[f[3]];else if(2===v)u=["halfarrow-left","halfarrow-right"],h=["xMinYMin","xMaxYMin"];else{if(3!==v)throw new Error("Correct katexImagesData or update code here to support\n "+v+" children.");u=["brace-left","brace-center","brace-right"],h=["xMinYMin","xMidYMin","xMaxYMin"]}for(var w=0;w<v;w++){var x=new cc(_[w]),k=new lc([x],{width:"400em",height:Zl(y),viewBox:"0 0 "+n+" "+b,preserveAspectRatio:h[w]+" slice"}),S=id.makeSvgSpan([u[w]],[k],t);if(1===v)return{span:S,minWidth:g,height:y};S.style.height=Zl(y),m.push(S)}return{span:id.makeSpan(["stretchy"],m,t),minWidth:g,height:y}}();return n.height=i,n.style.height=Zl(i),r>0&&(n.style.minWidth=Zl(r)),n};function Xd(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function Kd(e){var t=Wd(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function Wd(e){return e&&("atom"===e.type||pc.hasOwnProperty(e.type))?e:null}var Yd=(e,t)=>{var n,r,i;e&&"supsub"===e.type?(n=(r=Xd(e.base,"accent")).base,e.base=n,i=function(e){if(e instanceof rc)return e;throw new Error("Expected span<HtmlDomNode> but got "+String(e)+".")}(Ld(e,t)),e.base=r):n=(r=Xd(e,"accent")).base;var s=Ld(n,t.havingCrampedStyle()),o=0;if(r.isShifty&&yl(n)){var a=bl(n);o=uc(Ld(a,t.havingCrampedStyle())).skew}var l,c="\\c"===r.label,d=c?s.height+s.depth:Math.min(s.height,t.fontMetrics().xHeight);if(r.isStretchy)l=Gd(r,t),l=id.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"elem",elem:l,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+Zl(2*o)+")",marginLeft:Zl(2*o)}:void 0}]},t);else{var u,h;"\\vec"===r.label?(u=id.staticSvg("vec",t),h=id.svgData.vec[1]):((u=uc(u=id.makeOrd({mode:r.mode,text:r.label},t,"textord"))).italic=0,h=u.width,c&&(d+=u.depth)),l=id.makeSpan(["accent-body"],[u]);var p="\\textcircled"===r.label;p&&(l.classes.push("accent-full"),d=s.height);var m=o;p||(m-=h/2),l.style.left=Zl(m),"\\textcircled"===r.label&&(l.style.top=".2em"),l=id.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:-d},{type:"elem",elem:l}]},t)}var f=id.makeSpan(["mord","accent"],[l],t);return i?(i.children[0]=f,i.height=Math.max(f.height,i.height),i.classes[0]="mord",i):f},Zd=(e,t)=>{var n=e.isStretchy?$d(e.label):new Ed.MathNode("mo",[Od(e.label,e.mode)]),r=new Ed.MathNode("mover",[jd(e.base,t),n]);return r.setAttribute("accent","true"),r},Qd=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));pd({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,t)=>{var n=fd(t[0]),r=!Qd.test(e.funcName),i=!r||"\\widehat"===e.funcName||"\\widetilde"===e.funcName||"\\widecheck"===e.funcName;return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:i,base:n}},htmlBuilder:Yd,mathmlBuilder:Zd}),pd({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{var n=t[0],r=e.parser.mode;return"math"===r&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:Yd,mathmlBuilder:Zd}),pd({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"accentUnder",mode:n.mode,label:r,base:i}},htmlBuilder:(e,t)=>{var n=Ld(e.base,t),r=Gd(e,t),i="\\utilde"===e.label?.12:0,s=id.makeVList({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:n}]},t);return id.makeSpan(["mord","accentunder"],[s],t)},mathmlBuilder:(e,t)=>{var n=$d(e.label),r=new Ed.MathNode("munder",[jd(e.base,t),n]);return r.setAttribute("accentunder","true"),r}});var Jd=e=>{var t=new Ed.MathNode("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};pd({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r,funcName:i}=e;return{type:"xArrow",mode:r.mode,label:i,body:t[0],below:n[0]}},htmlBuilder(e,t){var n,r=t.style,i=t.havingStyle(r.sup()),s=id.wrapFragment(Ld(e.body,i,t),t),o="\\x"===e.label.slice(0,2)?"x":"cd";s.classes.push(o+"-arrow-pad"),e.below&&(i=t.havingStyle(r.sub()),(n=id.wrapFragment(Ld(e.below,i,t),t)).classes.push(o+"-arrow-pad"));var a,l=Gd(e,t),c=-t.fontMetrics().axisHeight+.5*l.height,d=-t.fontMetrics().axisHeight-.5*l.height-.111;if((s.depth>.25||"\\xleftequilibrium"===e.label)&&(d-=s.depth),n){var u=-t.fontMetrics().axisHeight+n.height+.5*l.height+.111;a=id.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:d},{type:"elem",elem:l,shift:c},{type:"elem",elem:n,shift:u}]},t)}else a=id.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:d},{type:"elem",elem:l,shift:c}]},t);return a.children[0].children[0].children[1].classes.push("svg-align"),id.makeSpan(["mrel","x-arrow"],[a],t)},mathmlBuilder(e,t){var n,r=$d(e.label);if(r.setAttribute("minsize","x"===e.label.charAt(0)?"1.75em":"3.0em"),e.body){var i=Jd(jd(e.body,t));if(e.below){var s=Jd(jd(e.below,t));n=new Ed.MathNode("munderover",[r,s,i])}else n=new Ed.MathNode("mover",[r,i])}else if(e.below){var o=Jd(jd(e.below,t));n=new Ed.MathNode("munder",[r,o])}else n=Jd(),n=new Ed.MathNode("mover",[r,n]);return n}});var eu=id.makeSpan;function tu(e,t){var n=xd(e.body,t,!0);return eu([e.mclass],n,t)}function nu(e,t){var n,r=Vd(e.body,t);return"minner"===e.mclass?n=new Ed.MathNode("mpadded",r):"mord"===e.mclass?e.isCharacterBox?(n=r[0]).type="mi":n=new Ed.MathNode("mi",r):(e.isCharacterBox?(n=r[0]).type="mo":n=new Ed.MathNode("mo",r),"mbin"===e.mclass?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):"mpunct"===e.mclass?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):"mopen"===e.mclass||"mclose"===e.mclass?(n.attributes.lspace="0em",n.attributes.rspace="0em"):"minner"===e.mclass&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}pd({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+r.slice(5),body:_d(i),isCharacterBox:yl(i)}},htmlBuilder:tu,mathmlBuilder:nu});var ru=e=>{var t="ordgroup"===e.type&&e.body.length?e.body[0]:e;return"atom"!==t.type||"bin"!==t.family&&"rel"!==t.family?"mord":"m"+t.family};pd({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:ru(t[0]),body:_d(t[1]),isCharacterBox:yl(t[1])}}}),pd({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,t){var n,{parser:r,funcName:i}=e,s=t[1],o=t[0];n="\\stackrel"!==i?ru(s):"mrel";var a={type:"op",mode:s.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:"\\stackrel"!==i,body:_d(s)},l={type:"supsub",mode:o.mode,base:a,sup:"\\underset"===i?null:o,sub:"\\underset"===i?o:null};return{type:"mclass",mode:r.mode,mclass:n,body:[l],isCharacterBox:yl(l)}},htmlBuilder:tu,mathmlBuilder:nu}),pd({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"pmb",mode:n.mode,mclass:ru(t[0]),body:_d(t[0])}},htmlBuilder(e,t){var n=xd(e.body,t,!0),r=id.makeSpan([e.mclass],n,t);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,t){var n=Vd(e.body,t),r=new Ed.MathNode("mstyle",n);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var iu={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},su=()=>({type:"styling",body:[],mode:"math",style:"display"}),ou=e=>"textord"===e.type&&"@"===e.text,au=(e,t)=>("mathord"===e.type||"atom"===e.type)&&e.text===t;function lu(e,t,n){var r=iu[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":var i={type:"atom",text:r,mode:"math",family:"rel"},s={type:"ordgroup",mode:"math",body:[n.callFunction("\\\\cdleft",[t[0]],[]),n.callFunction("\\Big",[i],[]),n.callFunction("\\\\cdright",[t[1]],[])]};return n.callFunction("\\\\cdparent",[s],[]);case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":return n.callFunction("\\Big",[{type:"textord",text:"\\Vert",mode:"math"}],[]);default:return{type:"textord",text:" ",mode:"math"}}}pd({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"cdlabel",mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=id.wrapFragment(Ld(e.label,n,t),t);return r.classes.push("cd-label-"+e.side),r.style.bottom=Zl(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new Ed.MathNode("mrow",[jd(e.label,t)]);return(n=new Ed.MathNode("mpadded",[n])).setAttribute("width","0"),"left"===e.side&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),(n=new Ed.MathNode("mstyle",[n])).setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}}),pd({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,t){var{parser:n}=e;return{type:"cdlabelparent",mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=id.wrapFragment(Ld(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder:(e,t)=>new Ed.MathNode("mrow",[jd(e.fragment,t)])}),pd({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,r=Xd(t[0],"ordgroup").body,i="",s=0;s<r.length;s++)i+=Xd(r[s],"textord").text;var o,a=parseInt(i);if(isNaN(a))throw new cl("\\@char has non-numeric argument "+i);if(a<0||a>=1114111)throw new cl("\\@char with invalid code point "+i);return a<=65535?o=String.fromCharCode(a):(a-=65536,o=String.fromCharCode(55296+(a>>10),56320+(1023&a))),{type:"textord",mode:n.mode,text:o}}});var cu=(e,t)=>{var n=xd(e.body,t.withColor(e.color),!1);return id.makeFragment(n)},du=(e,t)=>{var n=Vd(e.body,t.withColor(e.color)),r=new Ed.MathNode("mstyle",n);return r.setAttribute("mathcolor",e.color),r};pd({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){var{parser:n}=e,r=Xd(t[0],"color-token").color,i=t[1];return{type:"color",mode:n.mode,color:r,body:_d(i)}},htmlBuilder:cu,mathmlBuilder:du}),pd({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,t){var{parser:n,breakOnTokenText:r}=e,i=Xd(t[0],"color-token").color;n.gullet.macros.set("\\current@color",i);var s=n.parseExpression(!0,r);return{type:"color",mode:n.mode,color:i,body:s}},htmlBuilder:cu,mathmlBuilder:du}),pd({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,n){var{parser:r}=e,i="["===r.gullet.future().text?r.parseSizeGroup(!0):null,s=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:s,size:i&&Xd(i,"size").value}},htmlBuilder(e,t){var n=id.makeSpan(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=Zl(Yl(e.size,t)))),n},mathmlBuilder(e,t){var n=new Ed.MathNode("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",Zl(Yl(e.size,t)))),n}});var uu={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},hu=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new cl("Expected a control sequence",e);return t},pu=(e,t,n,r)=>{var i=e.gullet.macros.get(n.text);null==i&&(n.noexpand=!0,i={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,i,r)};pd({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var r=t.fetch();if(uu[r.text])return"\\global"!==n&&"\\\\globallong"!==n||(r.text=uu[r.text]),Xd(t.parseFunction(),"internal");throw new cl("Invalid token after macro prefix",r)}}),pd({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=t.gullet.popToken(),i=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new cl("Expected a control sequence",r);for(var s,o=0,a=[[]];"{"!==t.gullet.future().text;)if("#"===(r=t.gullet.popToken()).text){if("{"===t.gullet.future().text){s=t.gullet.future(),a[o].push("{");break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new cl('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==o+1)throw new cl('Argument number "'+r.text+'" out of order');o++,a.push([])}else{if("EOF"===r.text)throw new cl("Expected a macro definition");a[o].push(r.text)}var{tokens:l}=t.gullet.consumeArg();return s&&l.unshift(s),"\\edef"!==n&&"\\xdef"!==n||(l=t.gullet.expandTokens(l)).reverse(),t.gullet.macros.set(i,{tokens:l,numArgs:o,delimiters:a},n===uu[n]),{type:"internal",mode:t.mode}}}),pd({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=hu(t.gullet.popToken());t.gullet.consumeSpaces();var i=(e=>{var t=e.gullet.popToken();return"="===t.text&&" "===(t=e.gullet.popToken()).text&&(t=e.gullet.popToken()),t})(t);return pu(t,r,i,"\\\\globallet"===n),{type:"internal",mode:t.mode}}}),pd({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=hu(t.gullet.popToken()),i=t.gullet.popToken(),s=t.gullet.popToken();return pu(t,r,s,"\\\\globalfuture"===n),t.gullet.pushToken(s),t.gullet.pushToken(i),{type:"internal",mode:t.mode}}});var mu=function(e,t,n){var r=jl(mc.math[e]&&mc.math[e].replace||e,t,n);if(!r)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return r},fu=function(e,t,n,r){var i=n.havingBaseStyle(t),s=id.makeSpan(r.concat(i.sizingClasses(n)),[e],n),o=i.sizeMultiplier/n.sizeMultiplier;return s.height*=o,s.depth*=o,s.maxFontSize=i.sizeMultiplier,s},_u=function(e,t,n){var r=t.havingBaseStyle(n),i=(1-t.sizeMultiplier/r.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=Zl(i),e.height-=i,e.depth+=i},gu=function(e,t,n,r,i,s){var o=function(e,t,n,r){return id.makeSymbol(e,"Size"+t+"-Regular",n,r)}(e,t,i,r),a=fu(id.makeSpan(["delimsizing","size"+t],[o],r),Pl.TEXT,r,s);return n&&_u(a,r,Pl.TEXT),a},bu=function(e,t,n){return{type:"elem",elem:id.makeSpan(["delimsizinginner","Size1-Regular"===t?"delim-size1":"delim-size4"],[id.makeSpan([],[id.makeSymbol(e,t,n)])])}},yu=function(e,t,n){var r=Dl["Size4-Regular"][e.charCodeAt(0)]?Dl["Size4-Regular"][e.charCodeAt(0)][4]:Dl["Size1-Regular"][e.charCodeAt(0)][4],i=new cc("inner",function(e,t){switch(e){case"⎜":return"M291 0 H417 V"+t+" H291z M291 0 H417 V"+t+" H291z";case"∣":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145z";case"∥":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145zM367 0 H410 V"+t+" H367z M367 0 H410 V"+t+" H367z";case"⎟":return"M457 0 H583 V"+t+" H457z M457 0 H583 V"+t+" H457z";case"⎢":return"M319 0 H403 V"+t+" H319z M319 0 H403 V"+t+" H319z";case"⎥":return"M263 0 H347 V"+t+" H263z M263 0 H347 V"+t+" H263z";case"⎪":return"M384 0 H504 V"+t+" H384z M384 0 H504 V"+t+" H384z";case"⏐":return"M312 0 H355 V"+t+" H312z M312 0 H355 V"+t+" H312z";case"‖":return"M257 0 H300 V"+t+" H257z M257 0 H300 V"+t+" H257zM478 0 H521 V"+t+" H478z M478 0 H521 V"+t+" H478z";default:return""}}(e,Math.round(1e3*t))),s=new lc([i],{width:Zl(r),height:Zl(t),style:"width:"+Zl(r),viewBox:"0 0 "+1e3*r+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),o=id.makeSvgSpan([],[s],n);return o.height=t,o.style.height=Zl(t),o.style.width=Zl(r),{type:"elem",elem:o}},vu={type:"kern",size:-.008},wu=["|","\\lvert","\\rvert","\\vert"],xu=["\\|","\\lVert","\\rVert","\\Vert"],ku=function(e,t,n,r,i,s){var o,a,l,c,d="",u=0;o=l=c=e,a=null;var h="Size1-Regular";"\\uparrow"===e?l=c="⏐":"\\Uparrow"===e?l=c="‖":"\\downarrow"===e?o=l="⏐":"\\Downarrow"===e?o=l="‖":"\\updownarrow"===e?(o="\\uparrow",l="⏐",c="\\downarrow"):"\\Updownarrow"===e?(o="\\Uparrow",l="‖",c="\\Downarrow"):ml(wu,e)?(l="∣",d="vert",u=333):ml(xu,e)?(l="∥",d="doublevert",u=556):"["===e||"\\lbrack"===e?(o="⎡",l="⎢",c="⎣",h="Size4-Regular",d="lbrack",u=667):"]"===e||"\\rbrack"===e?(o="⎤",l="⎥",c="⎦",h="Size4-Regular",d="rbrack",u=667):"\\lfloor"===e||"⌊"===e?(l=o="⎢",c="⎣",h="Size4-Regular",d="lfloor",u=667):"\\lceil"===e||"⌈"===e?(o="⎡",l=c="⎢",h="Size4-Regular",d="lceil",u=667):"\\rfloor"===e||"⌋"===e?(l=o="⎥",c="⎦",h="Size4-Regular",d="rfloor",u=667):"\\rceil"===e||"⌉"===e?(o="⎤",l=c="⎥",h="Size4-Regular",d="rceil",u=667):"("===e||"\\lparen"===e?(o="⎛",l="⎜",c="⎝",h="Size4-Regular",d="lparen",u=875):")"===e||"\\rparen"===e?(o="⎞",l="⎟",c="⎠",h="Size4-Regular",d="rparen",u=875):"\\{"===e||"\\lbrace"===e?(o="⎧",a="⎨",c="⎩",l="⎪",h="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(o="⎫",a="⎬",c="⎭",l="⎪",h="Size4-Regular"):"\\lgroup"===e||"⟮"===e?(o="⎧",c="⎩",l="⎪",h="Size4-Regular"):"\\rgroup"===e||"⟯"===e?(o="⎫",c="⎭",l="⎪",h="Size4-Regular"):"\\lmoustache"===e||"⎰"===e?(o="⎧",c="⎭",l="⎪",h="Size4-Regular"):"\\rmoustache"!==e&&"⎱"!==e||(o="⎫",c="⎩",l="⎪",h="Size4-Regular");var p=mu(o,h,i),m=p.height+p.depth,f=mu(l,h,i),_=f.height+f.depth,g=mu(c,h,i),b=g.height+g.depth,y=0,v=1;if(null!==a){var w=mu(a,h,i);y=w.height+w.depth,v=2}var x=m+b+y,k=x+Math.max(0,Math.ceil((t-x)/(v*_)))*v*_,S=r.fontMetrics().axisHeight;n&&(S*=r.sizeMultiplier);var C=k/2-S,M=[];if(d.length>0){var T=k-m-b,L=Math.round(1e3*k),z=function(e,t){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+" v1759 h347 v-84\nH403z M403 1759 V0 H319 V1759 v"+t+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+" v1759 H0 v84 H347z\nM347 1759 V0 H263 V1759 v"+t+" v1759 h84z";case"vert":return"M145 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+t+" v585 h43z";case"doublevert":return"M145 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+t+" v585 h43z\nM367 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M410 15 H367 v585 v"+t+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+t+" v1715 h263 v84 H319z\nMM319 602 V0 H403 V602 v"+t+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+t+" v1799 H0 v-84 H319z\nMM319 602 V0 H403 V602 v"+t+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+" v602 h84z\nM403 1759 V0 H319 V1759 v"+t+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+" v602 h84z\nM347 1759 V0 h-84 V1759 v"+t+" v602 h84z";case"lparen":return"M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1\nc-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,\n-36,557 l0,"+(t+84)+"c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,\n949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9\nc0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,\n-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189\nl0,-"+(t+92)+"c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,\n-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z";case"rparen":return"M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,\n63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5\nc11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,"+(t+9)+"\nc-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664\nc-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11\nc0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17\nc242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558\nl0,-"+(t+144)+"c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,\n-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z";default:throw new Error("Unknown stretchy delimiter.")}}(d,Math.round(1e3*T)),A=new cc(d,z),R=(u/1e3).toFixed(3)+"em",P=(L/1e3).toFixed(3)+"em",N=new lc([A],{width:R,height:P,viewBox:"0 0 "+u+" "+L}),E=id.makeSvgSpan([],[N],r);E.height=L/1e3,E.style.width=R,E.style.height=P,M.push({type:"elem",elem:E})}else{if(M.push(bu(c,h,i)),M.push(vu),null===a){var O=k-m-b+.016;M.push(yu(l,O,r))}else{var I=(k-m-b-y)/2+.016;M.push(yu(l,I,r)),M.push(vu),M.push(bu(a,h,i)),M.push(vu),M.push(yu(l,I,r))}M.push(vu),M.push(bu(o,h,i))}var B=r.havingBaseStyle(Pl.TEXT),D=id.makeVList({positionType:"bottom",positionData:C,children:M},B);return fu(id.makeSpan(["delimsizing","mult"],[D],B),Pl.TEXT,r,s)},Su=.08,Cu=function(e,t,n,r,i){var s=function(e,t,n){t*=1e3;var r="";switch(e){case"sqrtMain":r=function(e){return"M95,"+(622+e+80)+"\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl"+e/2.075+" -"+e+"\nc5.3,-9.3,12,-14,20,-14\nH400000v"+(40+e)+"H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM"+(834+e)+" 80h400000v"+(40+e)+"h-400000z"}(t);break;case"sqrtSize1":r=function(e){return"M263,"+(601+e+80)+"c0.7,0,18,39.7,52,119\nc34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120\nc340,-704.7,510.7,-1060.3,512,-1067\nl"+e/2.084+" -"+e+"\nc4.7,-7.3,11,-11,19,-11\nH40000v"+(40+e)+"H1012.3\ns-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232\nc-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1\ns-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26\nc-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z\nM"+(1001+e)+" 80h400000v"+(40+e)+"h-400000z"}(t);break;case"sqrtSize2":r=function(e){return"M983 "+(10+e+80)+"\nl"+e/3.13+" -"+e+"\nc4,-6.7,10,-10,18,-10 H400000v"+(40+e)+"\nH1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7\ns-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744\nc-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30\nc26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722\nc56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5\nc53.7,-170.3,84.5,-266.8,92.5,-289.5z\nM"+(1001+e)+" 80h400000v"+(40+e)+"h-400000z"}(t);break;case"sqrtSize3":r=function(e){return"M424,"+(2398+e+80)+"\nc-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514\nc0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20\ns-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121\ns209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081\nl"+e/4.223+" -"+e+"c4,-6.7,10,-10,18,-10 H400000\nv"+(40+e)+"H1014.6\ns-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185\nc-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2z M"+(1001+e)+" 80\nh400000v"+(40+e)+"h-400000z"}(t);break;case"sqrtSize4":r=function(e){return"M473,"+(2713+e+80)+"\nc339.3,-1799.3,509.3,-2700,510,-2702 l"+e/5.298+" -"+e+"\nc3.3,-7.3,9.3,-11,18,-11 H400000v"+(40+e)+"H1017.7\ns-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200\nc0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26\ns76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,\n606zM"+(1001+e)+" 80h400000v"+(40+e)+"H1017.7z"}(t);break;case"sqrtTall":r=function(e,t,n){return"M702 "+(e+80)+"H400000"+(40+e)+"\nH742v"+(n-54-80-e)+"l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1\nh-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170\nc-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667\n219 661 l218 661zM702 80H400000v"+(40+e)+"H742z"}(t,0,n)}return r}(e,r,n),o=new cc(e,s),a=new lc([o],{width:"400em",height:Zl(t),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return id.makeSvgSpan(["hide-tail"],[a],i)},Mu=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],Tu=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],Lu=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],zu=[0,1.2,1.8,2.4,3],Au=[{type:"small",style:Pl.SCRIPTSCRIPT},{type:"small",style:Pl.SCRIPT},{type:"small",style:Pl.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Ru=[{type:"small",style:Pl.SCRIPTSCRIPT},{type:"small",style:Pl.SCRIPT},{type:"small",style:Pl.TEXT},{type:"stack"}],Pu=[{type:"small",style:Pl.SCRIPTSCRIPT},{type:"small",style:Pl.SCRIPT},{type:"small",style:Pl.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],Nu=function(e){if("small"===e.type)return"Main-Regular";if("large"===e.type)return"Size"+e.size+"-Regular";if("stack"===e.type)return"Size4-Regular";throw new Error("Add support for delim type '"+e.type+"' here.")},Eu=function(e,t,n,r){for(var i=Math.min(2,3-r.style.size);i<n.length&&"stack"!==n[i].type;i++){var s=mu(e,Nu(n[i]),"math"),o=s.height+s.depth;if("small"===n[i].type&&(o*=r.havingBaseStyle(n[i].style).sizeMultiplier),o>t)return n[i]}return n[n.length-1]},Ou=function(e,t,n,r,i,s){var o;"<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),o=ml(Lu,e)?Au:ml(Mu,e)?Pu:Ru;var a=Eu(e,t,o,r);return"small"===a.type?function(e,t,n,r,i,s){var o=id.makeSymbol(e,"Main-Regular",i,r),a=fu(o,t,r,s);return n&&_u(a,r,t),a}(e,a.style,n,r,i,s):"large"===a.type?gu(e,a.size,n,r,i,s):ku(e,t,n,r,i,s)},Iu={sqrtImage:function(e,t){var n,r,i=t.havingBaseSizing(),s=Eu("\\surd",e*i.sizeMultiplier,Pu,i),o=i.sizeMultiplier,a=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),l=0,c=0,d=0;return"small"===s.type?(e<1?o=1:e<1.4&&(o=.7),c=(1+a)/o,(n=Cu("sqrtMain",l=(1+a+Su)/o,d=1e3+1e3*a+80,a,t)).style.minWidth="0.853em",r=.833/o):"large"===s.type?(d=1080*zu[s.size],c=(zu[s.size]+a)/o,l=(zu[s.size]+a+Su)/o,(n=Cu("sqrtSize"+s.size,l,d,a,t)).style.minWidth="1.02em",r=1/o):(l=e+a+Su,c=e+a,d=Math.floor(1e3*e+a)+80,(n=Cu("sqrtTall",l,d,a,t)).style.minWidth="0.742em",r=1.056),n.height=c,n.style.height=Zl(l),{span:n,advanceWidth:r,ruleWidth:(t.fontMetrics().sqrtRuleThickness+a)*o}},sizedDelim:function(e,t,n,r,i){if("<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),ml(Mu,e)||ml(Lu,e))return gu(e,t,!1,n,r,i);if(ml(Tu,e))return ku(e,zu[t],!1,n,r,i);throw new cl("Illegal delimiter: '"+e+"'")},sizeToMaxHeight:zu,customSizedDelim:Ou,leftRightDelim:function(e,t,n,r,i,s){var o=r.fontMetrics().axisHeight*r.sizeMultiplier,a=5/r.fontMetrics().ptPerEm,l=Math.max(t-o,n+o),c=Math.max(l/500*901,2*l-a);return Ou(e,c,!0,r,i,s)}},Bu={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},Du=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function Vu(e,t){var n=Wd(e);if(n&&ml(Du,n.text))return n;throw new cl(n?"Invalid delimiter '"+n.text+"' after '"+t.funcName+"'":"Invalid delimiter type '"+e.type+"'",e)}function Hu(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}pd({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,t)=>{var n=Vu(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:Bu[e.funcName].size,mclass:Bu[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>"."===e.delim?id.makeSpan([e.mclass]):Iu.sizedDelim(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];"."!==e.delim&&t.push(Od(e.delim,e.mode));var n=new Ed.MathNode("mo",t);"mopen"===e.mclass||"mclose"===e.mclass?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=Zl(Iu.sizeToMaxHeight[e.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}}),pd({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=e.parser.gullet.macros.get("\\current@color");if(n&&"string"!=typeof n)throw new cl("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Vu(t[0],e).text,color:n}}}),pd({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Vu(t[0],e),r=e.parser;++r.leftrightDepth;var i=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var s=Xd(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:i,left:n.text,right:s.delim,rightColor:s.color}},htmlBuilder:(e,t)=>{Hu(e);for(var n,r,i=xd(e.body,t,!0,["mopen","mclose"]),s=0,o=0,a=!1,l=0;l<i.length;l++)i[l].isMiddle?a=!0:(s=Math.max(i[l].height,s),o=Math.max(i[l].depth,o));if(s*=t.sizeMultiplier,o*=t.sizeMultiplier,n="."===e.left?Td(t,["mopen"]):Iu.leftRightDelim(e.left,s,o,t,e.mode,["mopen"]),i.unshift(n),a)for(var c=1;c<i.length;c++){var d=i[c].isMiddle;d&&(i[c]=Iu.leftRightDelim(d.delim,s,o,d.options,e.mode,[]))}if("."===e.right)r=Td(t,["mclose"]);else{var u=e.rightColor?t.withColor(e.rightColor):t;r=Iu.leftRightDelim(e.right,s,o,u,e.mode,["mclose"])}return i.push(r),id.makeSpan(["minner"],i,t)},mathmlBuilder:(e,t)=>{Hu(e);var n=Vd(e.body,t);if("."!==e.left){var r=new Ed.MathNode("mo",[Od(e.left,e.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if("."!==e.right){var i=new Ed.MathNode("mo",[Od(e.right,e.mode)]);i.setAttribute("fence","true"),e.rightColor&&i.setAttribute("mathcolor",e.rightColor),n.push(i)}return Id(n)}}),pd({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Vu(t[0],e);if(!e.parser.leftrightDepth)throw new cl("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;if("."===e.delim)n=Td(t,[]);else{n=Iu.sizedDelim(e.delim,1,t,e.mode,[]);var r={delim:e.delim,options:t};n.isMiddle=r}return n},mathmlBuilder:(e,t)=>{var n="\\vert"===e.delim||"|"===e.delim?Od("|","text"):Od(e.delim,e.mode),r=new Ed.MathNode("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var ju=(e,t)=>{var n,r,i,s=id.wrapFragment(Ld(e.body,t),t),o=e.label.slice(1),a=t.sizeMultiplier,l=0,c=yl(e.body);if("sout"===o)(n=id.makeSpan(["stretchy","sout"])).height=t.fontMetrics().defaultRuleThickness/a,l=-.5*t.fontMetrics().xHeight;else if("phase"===o){var d=Yl({number:.6,unit:"pt"},t),u=Yl({number:.35,unit:"ex"},t);a/=t.havingBaseSizing().sizeMultiplier;var h=s.height+s.depth+d+u;s.style.paddingLeft=Zl(h/2+d);var p=Math.floor(1e3*h*a),m="M400000 "+(r=p)+" H0 L"+r/2+" 0 l65 45 L145 "+(r-80)+" H400000z",f=new lc([new cc("phase",m)],{width:"400em",height:Zl(p/1e3),viewBox:"0 0 400000 "+p,preserveAspectRatio:"xMinYMin slice"});(n=id.makeSvgSpan(["hide-tail"],[f],t)).style.height=Zl(h),l=s.depth+d+u}else{/cancel/.test(o)?c||s.classes.push("cancel-pad"):"angl"===o?s.classes.push("anglpad"):s.classes.push("boxpad");var _=0,g=0,b=0;/box/.test(o)?(b=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),g=_=t.fontMetrics().fboxsep+("colorbox"===o?0:b)):"angl"===o?(_=4*(b=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness)),g=Math.max(0,.25-s.depth)):g=_=c?.2:0,n=function(e,t,n,r,i){var s,o=e.height+e.depth+n+r;if(/fbox|color|angl/.test(t)){if(s=id.makeSpan(["stretchy",t],[],i),"fbox"===t){var a=i.color&&i.getColor();a&&(s.style.borderColor=a)}}else{var l=[];/^[bx]cancel$/.test(t)&&l.push(new dc({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&l.push(new dc({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var c=new lc(l,{width:"100%",height:Zl(o)});s=id.makeSvgSpan([],[c],i)}return s.height=o,s.style.height=Zl(o),s}(s,o,_,g,t),/fbox|boxed|fcolorbox/.test(o)?(n.style.borderStyle="solid",n.style.borderWidth=Zl(b)):"angl"===o&&.049!==b&&(n.style.borderTopWidth=Zl(b),n.style.borderRightWidth=Zl(b)),l=s.depth+g,e.backgroundColor&&(n.style.backgroundColor=e.backgroundColor,e.borderColor&&(n.style.borderColor=e.borderColor))}if(e.backgroundColor)i=id.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:l},{type:"elem",elem:s,shift:0}]},t);else{var y=/cancel|phase/.test(o)?["svg-align"]:[];i=id.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:0},{type:"elem",elem:n,shift:l,wrapperClasses:y}]},t)}return/cancel/.test(o)&&(i.height=s.height,i.depth=s.depth),/cancel/.test(o)&&!c?id.makeSpan(["mord","cancel-lap"],[i],t):id.makeSpan(["mord"],[i],t)},Fu=(e,t)=>{var n=0,r=new Ed.MathNode(e.label.indexOf("colorbox")>-1?"mpadded":"menclose",[jd(e.body,t)]);switch(e.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),"\\fcolorbox"===e.label){var i=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute("style","border: "+i+"em solid "+String(e.borderColor))}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike")}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};pd({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(e,t,n){var{parser:r,funcName:i}=e,s=Xd(t[0],"color-token").color,o=t[1];return{type:"enclose",mode:r.mode,label:i,backgroundColor:s,body:o}},htmlBuilder:ju,mathmlBuilder:Fu}),pd({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(e,t,n){var{parser:r,funcName:i}=e,s=Xd(t[0],"color-token").color,o=Xd(t[1],"color-token").color,a=t[2];return{type:"enclose",mode:r.mode,label:i,backgroundColor:o,borderColor:s,body:a}},htmlBuilder:ju,mathmlBuilder:Fu}),pd({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\fbox",body:t[0]}}}),pd({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"enclose",mode:n.mode,label:r,body:i}},htmlBuilder:ju,mathmlBuilder:Fu}),pd({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\angl",body:t[0]}}});var Uu={};function qu(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:s,mathmlBuilder:o}=e,a={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},l=0;l<n.length;++l)Uu[n[l]]=a;s&&(ud[t]=s),o&&(hd[t]=o)}var $u={};function Gu(e,t){$u[e]=t}function Xu(e){var t=[];e.consumeSpaces();var n=e.fetch().text;for("\\relax"===n&&(e.consume(),e.consumeSpaces(),n=e.fetch().text);"\\hline"===n||"\\hdashline"===n;)e.consume(),t.push("\\hdashline"===n),e.consumeSpaces(),n=e.fetch().text;return t}var Ku=e=>{if(!e.parser.settings.displayMode)throw new cl("{"+e.envName+"} can be used only in display mode.")};function Wu(e){if(-1===e.indexOf("ed"))return-1===e.indexOf("*")}function Yu(e,t,n){var{hskipBeforeAndAfter:r,addJot:i,cols:s,arraystretch:o,colSeparationType:a,autoTag:l,singleRow:c,emptySingleRow:d,maxNumCols:u,leqno:h}=t;if(e.gullet.beginGroup(),c||e.gullet.macros.set("\\cr","\\\\\\relax"),!o){var p=e.gullet.expandMacroAsText("\\arraystretch");if(null==p)o=1;else if(!(o=parseFloat(p))||o<0)throw new cl("Invalid \\arraystretch: "+p)}e.gullet.beginGroup();var m=[],f=[m],_=[],g=[],b=null!=l?[]:void 0;function y(){l&&e.gullet.macros.set("\\@eqnsw","1",!0)}function v(){b&&(e.gullet.macros.get("\\df@tag")?(b.push(e.subparse([new ll("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):b.push(Boolean(l)&&"1"===e.gullet.macros.get("\\@eqnsw")))}for(y(),g.push(Xu(e));;){var w=e.parseExpression(!1,c?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup(),w={type:"ordgroup",mode:e.mode,body:w},n&&(w={type:"styling",mode:e.mode,style:n,body:[w]}),m.push(w);var x=e.fetch().text;if("&"===x){if(u&&m.length===u){if(c||a)throw new cl("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else{if("\\end"===x){v(),1===m.length&&"styling"===w.type&&0===w.body[0].body.length&&(f.length>1||!d)&&f.pop(),g.length<f.length+1&&g.push([]);break}if("\\\\"!==x)throw new cl("Expected & or \\\\ or \\cr or \\end",e.nextToken);e.consume();var k=void 0;" "!==e.gullet.future().text&&(k=e.parseSizeGroup(!0)),_.push(k?k.value:null),v(),g.push(Xu(e)),m=[],f.push(m),y()}}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:e.mode,addJot:i,arraystretch:o,body:f,cols:s,rowGaps:_,hskipBeforeAndAfter:r,hLinesBeforeRow:g,colSeparationType:a,tags:b,leqno:h}}function Zu(e){return"d"===e.slice(0,1)?"display":"text"}var Qu=function(e,t){var n,r,i=e.body.length,s=e.hLinesBeforeRow,o=0,a=new Array(i),l=[],c=Math.max(t.fontMetrics().arrayRuleWidth,t.minRuleThickness),d=1/t.fontMetrics().ptPerEm,u=5*d;e.colSeparationType&&"small"===e.colSeparationType&&(u=t.havingStyle(Pl.SCRIPT).sizeMultiplier/t.sizeMultiplier*.2778);var h="CD"===e.colSeparationType?Yl({number:3,unit:"ex"},t):12*d,p=3*d,m=e.arraystretch*h,f=.7*m,_=.3*m,g=0;function b(e){for(var t=0;t<e.length;++t)t>0&&(g+=.25),l.push({pos:g,isDashed:e[t]})}for(b(s[0]),n=0;n<e.body.length;++n){var y=e.body[n],v=f,w=_;o<y.length&&(o=y.length);var x=new Array(y.length);for(r=0;r<y.length;++r){var k=Ld(y[r],t);w<k.depth&&(w=k.depth),v<k.height&&(v=k.height),x[r]=k}var S=e.rowGaps[n],C=0;S&&(C=Yl(S,t))>0&&(w<(C+=_)&&(w=C),C=0),e.addJot&&(w+=p),x.height=v,x.depth=w,g+=v,x.pos=g,g+=w+C,a[n]=x,b(s[n+1])}var M,T,L=g/2+t.fontMetrics().axisHeight,z=e.cols||[],A=[],R=[];if(e.tags&&e.tags.some(e=>e))for(n=0;n<i;++n){var P=a[n],N=P.pos-L,E=e.tags[n],O=void 0;(O=!0===E?id.makeSpan(["eqn-num"],[],t):id.makeSpan([],!1===E?[]:xd(E,t,!0),t)).depth=P.depth,O.height=P.height,R.push({type:"elem",elem:O,shift:N})}for(r=0,T=0;r<o||T<z.length;++r,++T){for(var I=z[T]||{},B=!0;"separator"===I.type;){if(B||((M=id.makeSpan(["arraycolsep"],[])).style.width=Zl(t.fontMetrics().doubleRuleSep),A.push(M)),"|"!==I.separator&&":"!==I.separator)throw new cl("Invalid separator type: "+I.separator);var D="|"===I.separator?"solid":"dashed",V=id.makeSpan(["vertical-separator"],[],t);V.style.height=Zl(g),V.style.borderRightWidth=Zl(c),V.style.borderRightStyle=D,V.style.margin="0 "+Zl(-c/2);var H=g-L;H&&(V.style.verticalAlign=Zl(-H)),A.push(V),I=z[++T]||{},B=!1}if(!(r>=o)){var j=void 0;(r>0||e.hskipBeforeAndAfter)&&0!==(j=fl(I.pregap,u))&&((M=id.makeSpan(["arraycolsep"],[])).style.width=Zl(j),A.push(M));var F=[];for(n=0;n<i;++n){var U=a[n],q=U[r];if(q){var $=U.pos-L;q.depth=U.depth,q.height=U.height,F.push({type:"elem",elem:q,shift:$})}}F=id.makeVList({positionType:"individualShift",children:F},t),F=id.makeSpan(["col-align-"+(I.align||"c")],[F]),A.push(F),(r<o-1||e.hskipBeforeAndAfter)&&0!==(j=fl(I.postgap,u))&&((M=id.makeSpan(["arraycolsep"],[])).style.width=Zl(j),A.push(M))}}if(a=id.makeSpan(["mtable"],A),l.length>0){for(var G=id.makeLineSpan("hline",t,c),X=id.makeLineSpan("hdashline",t,c),K=[{type:"elem",elem:a,shift:0}];l.length>0;){var W=l.pop(),Y=W.pos-L;W.isDashed?K.push({type:"elem",elem:X,shift:Y}):K.push({type:"elem",elem:G,shift:Y})}a=id.makeVList({positionType:"individualShift",children:K},t)}if(0===R.length)return id.makeSpan(["mord"],[a],t);var Z=id.makeVList({positionType:"individualShift",children:R},t);return Z=id.makeSpan(["tag"],[Z],t),id.makeFragment([a,Z])},Ju={c:"center ",l:"left ",r:"right "},eh=function(e,t){for(var n=[],r=new Ed.MathNode("mtd",[],["mtr-glue"]),i=new Ed.MathNode("mtd",[],["mml-eqn-num"]),s=0;s<e.body.length;s++){for(var o=e.body[s],a=[],l=0;l<o.length;l++)a.push(new Ed.MathNode("mtd",[jd(o[l],t)]));e.tags&&e.tags[s]&&(a.unshift(r),a.push(r),e.leqno?a.unshift(i):a.push(i)),n.push(new Ed.MathNode("mtr",a))}var c=new Ed.MathNode("mtable",n),d=.5===e.arraystretch?.1:.16+e.arraystretch-1+(e.addJot?.09:0);c.setAttribute("rowspacing",Zl(d));var u="",h="";if(e.cols&&e.cols.length>0){var p=e.cols,m="",f=!1,_=0,g=p.length;"separator"===p[0].type&&(u+="top ",_=1),"separator"===p[p.length-1].type&&(u+="bottom ",g-=1);for(var b=_;b<g;b++)"align"===p[b].type?(h+=Ju[p[b].align],f&&(m+="none "),f=!0):"separator"===p[b].type&&f&&(m+="|"===p[b].separator?"solid ":"dashed ",f=!1);c.setAttribute("columnalign",h.trim()),/[sd]/.test(m)&&c.setAttribute("columnlines",m.trim())}if("align"===e.colSeparationType){for(var y=e.cols||[],v="",w=1;w<y.length;w++)v+=w%2?"0em ":"1em ";c.setAttribute("columnspacing",v.trim())}else"alignat"===e.colSeparationType||"gather"===e.colSeparationType?c.setAttribute("columnspacing","0em"):"small"===e.colSeparationType?c.setAttribute("columnspacing","0.2778em"):"CD"===e.colSeparationType?c.setAttribute("columnspacing","0.5em"):c.setAttribute("columnspacing","1em");var x="",k=e.hLinesBeforeRow;u+=k[0].length>0?"left ":"",u+=k[k.length-1].length>0?"right ":"";for(var S=1;S<k.length-1;S++)x+=0===k[S].length?"none ":k[S][0]?"dashed ":"solid ";return/[sd]/.test(x)&&c.setAttribute("rowlines",x.trim()),""!==u&&(c=new Ed.MathNode("menclose",[c])).setAttribute("notation",u.trim()),e.arraystretch&&e.arraystretch<1&&(c=new Ed.MathNode("mstyle",[c])).setAttribute("scriptlevel","1"),c},th=function(e,t){-1===e.envName.indexOf("ed")&&Ku(e);var n,r=[],i=e.envName.indexOf("at")>-1?"alignat":"align",s="split"===e.envName,o=Yu(e.parser,{cols:r,addJot:!0,autoTag:s?void 0:Wu(e.envName),emptySingleRow:!0,colSeparationType:i,maxNumCols:s?2:void 0,leqno:e.parser.settings.leqno},"display"),a=0,l={type:"ordgroup",mode:e.mode,body:[]};if(t[0]&&"ordgroup"===t[0].type){for(var c="",d=0;d<t[0].body.length;d++)c+=Xd(t[0].body[d],"textord").text;n=Number(c),a=2*n}var u=!a;o.body.forEach(function(e){for(var t=1;t<e.length;t+=2){var r=Xd(e[t],"styling");Xd(r.body[0],"ordgroup").body.unshift(l)}if(u)a<e.length&&(a=e.length);else{var i=e.length/2;if(n<i)throw new cl("Too many math in a row: expected "+n+", but got "+i,e[0])}});for(var h=0;h<a;++h){var p="r",m=0;h%2==1?p="l":h>0&&u&&(m=1),r[h]={type:"align",align:p,pregap:m,postgap:0}}return o.colSeparationType=u?"align":"alignat",o};qu({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=(Wd(t[0])?[t[0]]:Xd(t[0],"ordgroup").body).map(function(e){var t=Kd(e).text;if(-1!=="lcr".indexOf(t))return{type:"align",align:t};if("|"===t)return{type:"separator",separator:"|"};if(":"===t)return{type:"separator",separator:":"};throw new cl("Unknown column alignment: "+t,e)}),r={cols:n,hskipBeforeAndAfter:!0,maxNumCols:n.length};return Yu(e.parser,r,Zu(e.envName))},htmlBuilder:Qu,mathmlBuilder:eh}),qu({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],n="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if("*"===e.envName.charAt(e.envName.length-1)){var i=e.parser;if(i.consumeSpaces(),"["===i.fetch().text){if(i.consume(),i.consumeSpaces(),n=i.fetch().text,-1==="lcr".indexOf(n))throw new cl("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),r.cols=[{type:"align",align:n}]}}var s=Yu(e.parser,r,Zu(e.envName)),o=Math.max(0,...s.body.map(e=>e.length));return s.cols=new Array(o).fill({type:"align",align:n}),t?{type:"leftright",mode:e.mode,body:[s],left:t[0],right:t[1],rightColor:void 0}:s},htmlBuilder:Qu,mathmlBuilder:eh}),qu({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t=Yu(e.parser,{arraystretch:.5},"script");return t.colSeparationType="small",t},htmlBuilder:Qu,mathmlBuilder:eh}),qu({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=(Wd(t[0])?[t[0]]:Xd(t[0],"ordgroup").body).map(function(e){var t=Kd(e).text;if(-1!=="lc".indexOf(t))return{type:"align",align:t};throw new cl("Unknown column alignment: "+t,e)});if(n.length>1)throw new cl("{subarray} can contain only one column");var r={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5};if((r=Yu(e.parser,r,"script")).body.length>0&&r.body[0].length>1)throw new cl("{subarray} can contain only one column");return r},htmlBuilder:Qu,mathmlBuilder:eh}),qu({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t=Yu(e.parser,{arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},Zu(e.envName));return{type:"leftright",mode:e.mode,body:[t],left:e.envName.indexOf("r")>-1?".":"\\{",right:e.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:Qu,mathmlBuilder:eh}),qu({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:th,htmlBuilder:Qu,mathmlBuilder:eh}),qu({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){ml(["gather","gather*"],e.envName)&&Ku(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:Wu(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Yu(e.parser,t,"display")},htmlBuilder:Qu,mathmlBuilder:eh}),qu({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:th,htmlBuilder:Qu,mathmlBuilder:eh}),qu({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Ku(e);var t={autoTag:Wu(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Yu(e.parser,t,"display")},htmlBuilder:Qu,mathmlBuilder:eh}),qu({type:"array",names:["CD"],props:{numArgs:0},handler:e=>(Ku(e),function(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if("&"!==n&&"\\\\"!==n){if("\\end"===n){0===t[t.length-1].length&&t.pop();break}throw new cl("Expected \\\\ or \\cr or \\end",e.nextToken)}e.consume()}for(var r=[],i=[r],s=0;s<t.length;s++){for(var o=t[s],a=su(),l=0;l<o.length;l++)if(ou(o[l])){r.push(a);var c=Kd(o[l+=1]).text,d=new Array(2);if(d[0]={type:"ordgroup",mode:"math",body:[]},d[1]={type:"ordgroup",mode:"math",body:[]},"=|.".indexOf(c)>-1);else{if(!("<>AV".indexOf(c)>-1))throw new cl('Expected one of "<>AV=|." after @',o[l]);for(var u=0;u<2;u++){for(var h=!0,p=l+1;p<o.length;p++){if(au(o[p],c)){h=!1,l=p;break}if(ou(o[p]))throw new cl("Missing a "+c+" character to complete a CD arrow.",o[p]);d[u].body.push(o[p])}if(h)throw new cl("Missing a "+c+" character to complete a CD arrow.",o[l])}}var m={type:"styling",body:[lu(c,d,e)],mode:"math",style:"display"};r.push(m),a=su()}else a.body.push(o[l]);s%2==0?r.push(a):r.shift(),r=[],i.push(r)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25}),colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}(e.parser)),htmlBuilder:Qu,mathmlBuilder:eh}),Gu("\\nonumber","\\gdef\\@eqnsw{0}"),Gu("\\notag","\\nonumber"),pd({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new cl(e.funcName+" valid only within array environment")}});var nh=Uu;pd({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];if("ordgroup"!==i.type)throw new cl("Invalid environment name",i);for(var s="",o=0;o<i.body.length;++o)s+=Xd(i.body[o],"textord").text;if("\\begin"===r){if(!nh.hasOwnProperty(s))throw new cl("No such environment: "+s,i);var a=nh[s],{args:l,optArgs:c}=n.parseArguments("\\begin{"+s+"}",a),d={mode:n.mode,envName:s,parser:n},u=a.handler(d,l,c);n.expect("\\end",!1);var h=n.nextToken,p=Xd(n.parseFunction(),"environment");if(p.name!==s)throw new cl("Mismatch: \\begin{"+s+"} matched by \\end{"+p.name+"}",h);return u}return{type:"environment",mode:n.mode,name:s,nameGroup:i}}});var rh=(e,t)=>{var n=e.font,r=t.withFont(n);return Ld(e.body,r)},ih=(e,t)=>{var n=e.font,r=t.withFont(n);return jd(e.body,r)},sh={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};pd({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=fd(t[0]),s=r;return s in sh&&(s=sh[s]),{type:"font",mode:n.mode,font:s.slice(1),body:i}},htmlBuilder:rh,mathmlBuilder:ih}),pd({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,r=t[0],i=yl(r);return{type:"mclass",mode:n.mode,mclass:ru(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:i}}}),pd({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r,breakOnTokenText:i}=e,{mode:s}=n,o=n.parseExpression(!0,i);return{type:"font",mode:s,font:"math"+r.slice(1),body:{type:"ordgroup",mode:n.mode,body:o}}},htmlBuilder:rh,mathmlBuilder:ih});var oh=(e,t)=>{var n=t;return"display"===e?n=n.id>=Pl.SCRIPT.id?n.text():Pl.DISPLAY:"text"===e&&n.size===Pl.DISPLAY.size?n=Pl.TEXT:"script"===e?n=Pl.SCRIPT:"scriptscript"===e&&(n=Pl.SCRIPTSCRIPT),n},ah=(e,t)=>{var n,r=oh(e.size,t.style),i=r.fracNum(),s=r.fracDen();n=t.havingStyle(i);var o=Ld(e.numer,n,t);if(e.continued){var a=8.5/t.fontMetrics().ptPerEm,l=3.5/t.fontMetrics().ptPerEm;o.height=o.height<a?a:o.height,o.depth=o.depth<l?l:o.depth}n=t.havingStyle(s);var c,d,u,h,p,m,f,_,g,b,y=Ld(e.denom,n,t);if(e.hasBarLine?(e.barSize?(d=Yl(e.barSize,t),c=id.makeLineSpan("frac-line",t,d)):c=id.makeLineSpan("frac-line",t),d=c.height,u=c.height):(c=null,d=0,u=t.fontMetrics().defaultRuleThickness),r.size===Pl.DISPLAY.size||"display"===e.size?(h=t.fontMetrics().num1,p=d>0?3*u:7*u,m=t.fontMetrics().denom1):(d>0?(h=t.fontMetrics().num2,p=u):(h=t.fontMetrics().num3,p=3*u),m=t.fontMetrics().denom2),c){var v=t.fontMetrics().axisHeight;h-o.depth-(v+.5*d)<p&&(h+=p-(h-o.depth-(v+.5*d))),v-.5*d-(y.height-m)<p&&(m+=p-(v-.5*d-(y.height-m))),f=id.makeVList({positionType:"individualShift",children:[{type:"elem",elem:y,shift:m},{type:"elem",elem:c,shift:-(v-.5*d)},{type:"elem",elem:o,shift:-h}]},t)}else{var w=h-o.depth-(y.height-m);w<p&&(h+=.5*(p-w),m+=.5*(p-w)),f=id.makeVList({positionType:"individualShift",children:[{type:"elem",elem:y,shift:m},{type:"elem",elem:o,shift:-h}]},t)}return n=t.havingStyle(r),f.height*=n.sizeMultiplier/t.sizeMultiplier,f.depth*=n.sizeMultiplier/t.sizeMultiplier,_=r.size===Pl.DISPLAY.size?t.fontMetrics().delim1:r.size===Pl.SCRIPTSCRIPT.size?t.havingStyle(Pl.SCRIPT).fontMetrics().delim2:t.fontMetrics().delim2,g=null==e.leftDelim?Td(t,["mopen"]):Iu.customSizedDelim(e.leftDelim,_,!0,t.havingStyle(r),e.mode,["mopen"]),b=e.continued?id.makeSpan([]):null==e.rightDelim?Td(t,["mclose"]):Iu.customSizedDelim(e.rightDelim,_,!0,t.havingStyle(r),e.mode,["mclose"]),id.makeSpan(["mord"].concat(n.sizingClasses(t)),[g,id.makeSpan(["mfrac"],[f]),b],t)},lh=(e,t)=>{var n=new Ed.MathNode("mfrac",[jd(e.numer,t),jd(e.denom,t)]);if(e.hasBarLine){if(e.barSize){var r=Yl(e.barSize,t);n.setAttribute("linethickness",Zl(r))}}else n.setAttribute("linethickness","0px");var i=oh(e.size,t.style);if(i.size!==t.style.size){n=new Ed.MathNode("mstyle",[n]);var s=i.size===Pl.DISPLAY.size?"true":"false";n.setAttribute("displaystyle",s),n.setAttribute("scriptlevel","0")}if(null!=e.leftDelim||null!=e.rightDelim){var o=[];if(null!=e.leftDelim){var a=new Ed.MathNode("mo",[new Ed.TextNode(e.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),o.push(a)}if(o.push(n),null!=e.rightDelim){var l=new Ed.MathNode("mo",[new Ed.TextNode(e.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),o.push(l)}return Id(o)}return n};pd({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var n,{parser:r,funcName:i}=e,s=t[0],o=t[1],a=null,l=null,c="auto";switch(i){case"\\dfrac":case"\\frac":case"\\tfrac":n=!0;break;case"\\\\atopfrac":n=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":n=!1,a="(",l=")";break;case"\\\\bracefrac":n=!1,a="\\{",l="\\}";break;case"\\\\brackfrac":n=!1,a="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}switch(i){case"\\dfrac":case"\\dbinom":c="display";break;case"\\tfrac":case"\\tbinom":c="text"}return{type:"genfrac",mode:r.mode,continued:!1,numer:s,denom:o,hasBarLine:n,leftDelim:a,rightDelim:l,size:c,barSize:null}},htmlBuilder:ah,mathmlBuilder:lh}),pd({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],s=t[1];return{type:"genfrac",mode:n.mode,continued:!0,numer:i,denom:s,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}}),pd({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var t,{parser:n,funcName:r,token:i}=e;switch(r){case"\\over":t="\\frac";break;case"\\choose":t="\\binom";break;case"\\atop":t="\\\\atopfrac";break;case"\\brace":t="\\\\bracefrac";break;case"\\brack":t="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:n.mode,replaceWith:t,token:i}}});var ch=["display","text","script","scriptscript"],dh=function(e){var t=null;return e.length>0&&(t="."===(t=e)?null:t),t};pd({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){var n,{parser:r}=e,i=t[4],s=t[5],o=fd(t[0]),a="atom"===o.type&&"open"===o.family?dh(o.text):null,l=fd(t[1]),c="atom"===l.type&&"close"===l.family?dh(l.text):null,d=Xd(t[2],"size"),u=null;n=!!d.isBlank||(u=d.value).number>0;var h="auto",p=t[3];if("ordgroup"===p.type){if(p.body.length>0){var m=Xd(p.body[0],"textord");h=ch[Number(m.text)]}}else p=Xd(p,"textord"),h=ch[Number(p.text)];return{type:"genfrac",mode:r.mode,numer:i,denom:s,continued:!1,hasBarLine:n,barSize:u,leftDelim:a,rightDelim:c,size:h}},htmlBuilder:ah,mathmlBuilder:lh}),pd({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){var{parser:n,funcName:r,token:i}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:Xd(t[0],"size").value,token:i}}}),pd({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],s=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e}(Xd(t[1],"infix").size),o=t[2],a=s.number>0;return{type:"genfrac",mode:n.mode,numer:i,denom:o,continued:!1,hasBarLine:a,barSize:s,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:ah,mathmlBuilder:lh});var uh=(e,t)=>{var n,r,i=t.style;"supsub"===e.type?(n=e.sup?Ld(e.sup,t.havingStyle(i.sup()),t):Ld(e.sub,t.havingStyle(i.sub()),t),r=Xd(e.base,"horizBrace")):r=Xd(e,"horizBrace");var s,o=Ld(r.base,t.havingBaseStyle(Pl.DISPLAY)),a=Gd(r,t);if(r.isOver?(s=id.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"kern",size:.1},{type:"elem",elem:a}]},t)).children[0].children[0].children[1].classes.push("svg-align"):(s=id.makeVList({positionType:"bottom",positionData:o.depth+.1+a.height,children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:o}]},t)).children[0].children[0].children[0].classes.push("svg-align"),n){var l=id.makeSpan(["mord",r.isOver?"mover":"munder"],[s],t);s=r.isOver?id.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]},t):id.makeVList({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]},t)}return id.makeSpan(["mord",r.isOver?"mover":"munder"],[s],t)};pd({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"horizBrace",mode:n.mode,label:r,isOver:/^\\over/.test(r),base:t[0]}},htmlBuilder:uh,mathmlBuilder:(e,t)=>{var n=$d(e.label);return new Ed.MathNode(e.isOver?"mover":"munder",[jd(e.base,t),n])}}),pd({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[1],i=Xd(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:n.mode,href:i,body:_d(r)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var n=xd(e.body,t,!1);return id.makeAnchor(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=Hd(e.body,t);return n instanceof Pd||(n=new Pd("mrow",[n])),n.setAttribute("href",e.href),n}}),pd({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=Xd(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:r}))return n.formatUnsupportedCmd("\\url");for(var i=[],s=0;s<r.length;s++){var o=r[s];"~"===o&&(o="\\textasciitilde"),i.push({type:"textord",mode:"text",text:o})}var a={type:"text",mode:n.mode,font:"\\texttt",body:i};return{type:"href",mode:n.mode,href:r,body:_d(a)}}}),pd({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler(e,t){var{parser:n}=e;return{type:"hbox",mode:n.mode,body:_d(t[0])}},htmlBuilder(e,t){var n=xd(e.body,t,!1);return id.makeFragment(n)},mathmlBuilder:(e,t)=>new Ed.MathNode("mrow",Vd(e.body,t))}),pd({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(e,t)=>{var n,{parser:r,funcName:i,token:s}=e,o=Xd(t[0],"raw").string,a=t[1];r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var l={};switch(i){case"\\htmlClass":l.class=o,n={command:"\\htmlClass",class:o};break;case"\\htmlId":l.id=o,n={command:"\\htmlId",id:o};break;case"\\htmlStyle":l.style=o,n={command:"\\htmlStyle",style:o};break;case"\\htmlData":for(var c=o.split(","),d=0;d<c.length;d++){var u=c[d].split("=");if(2!==u.length)throw new cl("Error parsing key-value for \\htmlData");l["data-"+u[0].trim()]=u[1].trim()}n={command:"\\htmlData",attributes:l};break;default:throw new Error("Unrecognized html command")}return r.settings.isTrusted(n)?{type:"html",mode:r.mode,attributes:l,body:_d(a)}:r.formatUnsupportedCmd(i)},htmlBuilder:(e,t)=>{var n=xd(e.body,t,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var i=id.makeSpan(r,n,t);for(var s in e.attributes)"class"!==s&&e.attributes.hasOwnProperty(s)&&i.setAttribute(s,e.attributes[s]);return i},mathmlBuilder:(e,t)=>Hd(e.body,t)}),pd({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"htmlmathml",mode:n.mode,html:_d(t[0]),mathml:_d(t[1])}},htmlBuilder:(e,t)=>{var n=xd(e.html,t,!1);return id.makeFragment(n)},mathmlBuilder:(e,t)=>Hd(e.mathml,t)});var hh=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new cl("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(t[1]+t[2]),unit:t[3]};if(!Wl(n))throw new cl("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};pd({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,n)=>{var{parser:r}=e,i={number:0,unit:"em"},s={number:.9,unit:"em"},o={number:0,unit:"em"},a="";if(n[0])for(var l=Xd(n[0],"raw").string.split(","),c=0;c<l.length;c++){var d=l[c].split("=");if(2===d.length){var u=d[1].trim();switch(d[0].trim()){case"alt":a=u;break;case"width":i=hh(u);break;case"height":s=hh(u);break;case"totalheight":o=hh(u);break;default:throw new cl("Invalid key: '"+d[0]+"' in \\includegraphics.")}}}var h=Xd(t[0],"url").url;return""===a&&(a=(a=(a=h).replace(/^.*[\\/]/,"")).substring(0,a.lastIndexOf("."))),r.settings.isTrusted({command:"\\includegraphics",url:h})?{type:"includegraphics",mode:r.mode,alt:a,width:i,height:s,totalheight:o,src:h}:r.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(e,t)=>{var n=Yl(e.height,t),r=0;e.totalheight.number>0&&(r=Yl(e.totalheight,t)-n);var i=0;e.width.number>0&&(i=Yl(e.width,t));var s={height:Zl(n+r)};i>0&&(s.width=Zl(i)),r>0&&(s.verticalAlign=Zl(-r));var o=new sc(e.src,e.alt,s);return o.height=n,o.depth=r,o},mathmlBuilder:(e,t)=>{var n=new Ed.MathNode("mglyph",[]);n.setAttribute("alt",e.alt);var r=Yl(e.height,t),i=0;if(e.totalheight.number>0&&(i=Yl(e.totalheight,t)-r,n.setAttribute("valign",Zl(-i))),n.setAttribute("height",Zl(r+i)),e.width.number>0){var s=Yl(e.width,t);n.setAttribute("width",Zl(s))}return n.setAttribute("src",e.src),n}}),pd({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=Xd(t[0],"size");if(n.settings.strict){var s="m"===r[1],o="mu"===i.value.unit;s?(o||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, not "+i.value.unit+" units"),"math"!==n.mode&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):o&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:i.value}},htmlBuilder:(e,t)=>id.makeGlue(e.dimension,t),mathmlBuilder(e,t){var n=Yl(e.dimension,t);return new Ed.SpaceNode(n)}}),pd({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"lap",mode:n.mode,alignment:r.slice(5),body:i}},htmlBuilder:(e,t)=>{var n;"clap"===e.alignment?(n=id.makeSpan([],[Ld(e.body,t)]),n=id.makeSpan(["inner"],[n],t)):n=id.makeSpan(["inner"],[Ld(e.body,t)]);var r=id.makeSpan(["fix"],[]),i=id.makeSpan([e.alignment],[n,r],t),s=id.makeSpan(["strut"]);return s.style.height=Zl(i.height+i.depth),i.depth&&(s.style.verticalAlign=Zl(-i.depth)),i.children.unshift(s),i=id.makeSpan(["thinbox"],[i],t),id.makeSpan(["mord","vbox"],[i],t)},mathmlBuilder:(e,t)=>{var n=new Ed.MathNode("mpadded",[jd(e.body,t)]);if("rlap"!==e.alignment){var r="llap"===e.alignment?"-1":"-0.5";n.setAttribute("lspace",r+"width")}return n.setAttribute("width","0px"),n}}),pd({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:r}=e,i=r.mode;r.switchMode("math");var s="\\("===n?"\\)":"$",o=r.parseExpression(!1,s);return r.expect(s),r.switchMode(i),{type:"styling",mode:r.mode,style:"text",body:o}}}),pd({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new cl("Mismatched "+e.funcName)}});var ph=(e,t)=>{switch(t.style.size){case Pl.DISPLAY.size:return e.display;case Pl.TEXT.size:return e.text;case Pl.SCRIPT.size:return e.script;case Pl.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};pd({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:_d(t[0]),text:_d(t[1]),script:_d(t[2]),scriptscript:_d(t[3])}},htmlBuilder:(e,t)=>{var n=ph(e,t),r=xd(n,t,!1);return id.makeFragment(r)},mathmlBuilder:(e,t)=>{var n=ph(e,t);return Hd(n,t)}});var mh=(e,t,n,r,i,s,o)=>{e=id.makeSpan([],[e]);var a,l,c,d=n&&yl(n);if(t){var u=Ld(t,r.havingStyle(i.sup()),r);l={elem:u,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-u.depth)}}if(n){var h=Ld(n,r.havingStyle(i.sub()),r);a={elem:h,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-h.height)}}if(l&&a){var p=r.fontMetrics().bigOpSpacing5+a.elem.height+a.elem.depth+a.kern+e.depth+o;c=id.makeVList({positionType:"bottom",positionData:p,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:a.elem,marginLeft:Zl(-s)},{type:"kern",size:a.kern},{type:"elem",elem:e},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:Zl(s)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}else if(a){var m=e.height-o;c=id.makeVList({positionType:"top",positionData:m,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:a.elem,marginLeft:Zl(-s)},{type:"kern",size:a.kern},{type:"elem",elem:e}]},r)}else{if(!l)return e;var f=e.depth+o;c=id.makeVList({positionType:"bottom",positionData:f,children:[{type:"elem",elem:e},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:Zl(s)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}var _=[c];if(a&&0!==s&&!d){var g=id.makeSpan(["mspace"],[],r);g.style.marginRight=Zl(s),_.unshift(g)}return id.makeSpan(["mop","op-limits"],_,r)},fh=["\\smallint"],_h=(e,t)=>{var n,r,i,s=!1;"supsub"===e.type?(n=e.sup,r=e.sub,i=Xd(e.base,"op"),s=!0):i=Xd(e,"op");var o,a=t.style,l=!1;if(a.size===Pl.DISPLAY.size&&i.symbol&&!ml(fh,i.name)&&(l=!0),i.symbol){var c=l?"Size2-Regular":"Size1-Regular",d="";if("\\oiint"!==i.name&&"\\oiiint"!==i.name||(d=i.name.slice(1),i.name="oiint"===d?"\\iint":"\\iiint"),o=id.makeSymbol(i.name,c,"math",t,["mop","op-symbol",l?"large-op":"small-op"]),d.length>0){var u=o.italic,h=id.staticSvg(d+"Size"+(l?"2":"1"),t);o=id.makeVList({positionType:"individualShift",children:[{type:"elem",elem:o,shift:0},{type:"elem",elem:h,shift:l?.08:0}]},t),i.name="\\"+d,o.classes.unshift("mop"),o.italic=u}}else if(i.body){var p=xd(i.body,t,!0);1===p.length&&p[0]instanceof ac?(o=p[0]).classes[0]="mop":o=id.makeSpan(["mop"],p,t)}else{for(var m=[],f=1;f<i.name.length;f++)m.push(id.mathsym(i.name[f],i.mode,t));o=id.makeSpan(["mop"],m,t)}var _=0,g=0;return(o instanceof ac||"\\oiint"===i.name||"\\oiiint"===i.name)&&!i.suppressBaseShift&&(_=(o.height-o.depth)/2-t.fontMetrics().axisHeight,g=o.italic),s?mh(o,n,r,t,a,g,_):(_&&(o.style.position="relative",o.style.top=Zl(_)),o)},gh=(e,t)=>{var n;if(e.symbol)n=new Pd("mo",[Od(e.name,e.mode)]),ml(fh,e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new Pd("mo",Vd(e.body,t));else{n=new Pd("mi",[new Nd(e.name.slice(1))]);var r=new Pd("mo",[Od("","text")]);n=e.parentIsSupSub?new Pd("mrow",[n,r]):Rd([n,r])}return n},bh={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};pd({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=r;return 1===i.length&&(i=bh[i]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:_h,mathmlBuilder:gh}),pd({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:_d(r)}},htmlBuilder:_h,mathmlBuilder:gh});var yh={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};pd({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:_h,mathmlBuilder:gh}),pd({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:_h,mathmlBuilder:gh}),pd({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e,r=n;return 1===r.length&&(r=yh[r]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:_h,mathmlBuilder:gh});var vh=(e,t)=>{var n,r,i,s,o=!1;if("supsub"===e.type?(n=e.sup,r=e.sub,i=Xd(e.base,"operatorname"),o=!0):i=Xd(e,"operatorname"),i.body.length>0){for(var a=i.body.map(e=>{var t=e.text;return"string"==typeof t?{type:"textord",mode:e.mode,text:t}:e}),l=xd(a,t.withFont("mathrm"),!0),c=0;c<l.length;c++){var d=l[c];d instanceof ac&&(d.text=d.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}s=id.makeSpan(["mop"],l,t)}else s=id.makeSpan(["mop"],[],t);return o?mh(s,n,r,t,t.style,0,0):s};function wh(e,t,n){for(var r=xd(e,t,!1),i=t.sizeMultiplier/n.sizeMultiplier,s=0;s<r.length;s++){var o=r[s].classes.indexOf("sizing");o<0?Array.prototype.push.apply(r[s].classes,t.sizingClasses(n)):r[s].classes[o+1]==="reset-size"+t.size&&(r[s].classes[o+1]="reset-size"+n.size),r[s].height*=i,r[s].depth*=i}return id.makeFragment(r)}pd({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"operatorname",mode:n.mode,body:_d(i),alwaysHandleSupSub:"\\operatornamewithlimits"===r,limits:!1,parentIsSupSub:!1}},htmlBuilder:vh,mathmlBuilder:(e,t)=>{for(var n=Vd(e.body,t.withFont("mathrm")),r=!0,i=0;i<n.length;i++){var s=n[i];if(s instanceof Ed.SpaceNode);else if(s instanceof Ed.MathNode)switch(s.type){case"mi":case"mn":case"ms":case"mspace":case"mtext":break;case"mo":var o=s.children[0];1===s.children.length&&o instanceof Ed.TextNode?o.text=o.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):r=!1;break;default:r=!1}else r=!1}if(r){var a=n.map(e=>e.toText()).join("");n=[new Ed.TextNode(a)]}var l=new Ed.MathNode("mi",n);l.setAttribute("mathvariant","normal");var c=new Ed.MathNode("mo",[Od("","text")]);return e.parentIsSupSub?new Ed.MathNode("mrow",[l,c]):Ed.newDocumentFragment([l,c])}}),Gu("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),md({type:"ordgroup",htmlBuilder:(e,t)=>e.semisimple?id.makeFragment(xd(e.body,t,!1)):id.makeSpan(["mord"],xd(e.body,t,!0),t),mathmlBuilder:(e,t)=>Hd(e.body,t,!0)}),pd({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,t){var{parser:n}=e,r=t[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(e,t){var n=Ld(e.body,t.havingCrampedStyle()),r=id.makeLineSpan("overline-line",t),i=t.fontMetrics().defaultRuleThickness,s=id.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r},{type:"kern",size:i}]},t);return id.makeSpan(["mord","overline"],[s],t)},mathmlBuilder(e,t){var n=new Ed.MathNode("mo",[new Ed.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new Ed.MathNode("mover",[jd(e.body,t),n]);return r.setAttribute("accent","true"),r}}),pd({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"phantom",mode:n.mode,body:_d(r)}},htmlBuilder:(e,t)=>{var n=xd(e.body,t.withPhantom(),!1);return id.makeFragment(n)},mathmlBuilder:(e,t)=>{var n=Vd(e.body,t);return new Ed.MathNode("mphantom",n)}}),pd({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"hphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=id.makeSpan([],[Ld(e.body,t.withPhantom())]);if(n.height=0,n.depth=0,n.children)for(var r=0;r<n.children.length;r++)n.children[r].height=0,n.children[r].depth=0;return n=id.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},t),id.makeSpan(["mord"],[n],t)},mathmlBuilder:(e,t)=>{var n=Vd(_d(e.body),t),r=new Ed.MathNode("mphantom",n),i=new Ed.MathNode("mpadded",[r]);return i.setAttribute("height","0px"),i.setAttribute("depth","0px"),i}}),pd({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"vphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=id.makeSpan(["inner"],[Ld(e.body,t.withPhantom())]),r=id.makeSpan(["fix"],[]);return id.makeSpan(["mord","rlap"],[n,r],t)},mathmlBuilder:(e,t)=>{var n=Vd(_d(e.body),t),r=new Ed.MathNode("mphantom",n),i=new Ed.MathNode("mpadded",[r]);return i.setAttribute("width","0px"),i}}),pd({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e,r=Xd(t[0],"size").value,i=t[1];return{type:"raisebox",mode:n.mode,dy:r,body:i}},htmlBuilder(e,t){var n=Ld(e.body,t),r=Yl(e.dy,t);return id.makeVList({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]},t)},mathmlBuilder(e,t){var n=new Ed.MathNode("mpadded",[jd(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute("voffset",r),n}}),pd({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}}),pd({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,t,n){var{parser:r}=e,i=n[0],s=Xd(t[0],"size"),o=Xd(t[1],"size");return{type:"rule",mode:r.mode,shift:i&&Xd(i,"size").value,width:s.value,height:o.value}},htmlBuilder(e,t){var n=id.makeSpan(["mord","rule"],[],t),r=Yl(e.width,t),i=Yl(e.height,t),s=e.shift?Yl(e.shift,t):0;return n.style.borderRightWidth=Zl(r),n.style.borderTopWidth=Zl(i),n.style.bottom=Zl(s),n.width=r,n.height=i+s,n.depth=-s,n.maxFontSize=1.125*i*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=Yl(e.width,t),r=Yl(e.height,t),i=e.shift?Yl(e.shift,t):0,s=t.color&&t.getColor()||"black",o=new Ed.MathNode("mspace");o.setAttribute("mathbackground",s),o.setAttribute("width",Zl(n)),o.setAttribute("height",Zl(r));var a=new Ed.MathNode("mpadded",[o]);return i>=0?a.setAttribute("height",Zl(i)):(a.setAttribute("height",Zl(i)),a.setAttribute("depth",Zl(-i))),a.setAttribute("voffset",Zl(i)),a}});var xh=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"];pd({type:"sizing",names:xh,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:n,funcName:r,parser:i}=e,s=i.parseExpression(!1,n);return{type:"sizing",mode:i.mode,size:xh.indexOf(r)+1,body:s}},htmlBuilder:(e,t)=>{var n=t.havingSize(e.size);return wh(e.body,n,t)},mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=Vd(e.body,n),i=new Ed.MathNode("mstyle",r);return i.setAttribute("mathsize",Zl(n.sizeMultiplier)),i}}),pd({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:r}=e,i=!1,s=!1,o=n[0]&&Xd(n[0],"ordgroup");if(o)for(var a="",l=0;l<o.body.length;++l)if("t"===(a=o.body[l].text))i=!0;else{if("b"!==a){i=!1,s=!1;break}s=!0}else i=!0,s=!0;var c=t[0];return{type:"smash",mode:r.mode,body:c,smashHeight:i,smashDepth:s}},htmlBuilder:(e,t)=>{var n=id.makeSpan([],[Ld(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0,n.children))for(var r=0;r<n.children.length;r++)n.children[r].height=0;if(e.smashDepth&&(n.depth=0,n.children))for(var i=0;i<n.children.length;i++)n.children[i].depth=0;var s=id.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},t);return id.makeSpan(["mord"],[s],t)},mathmlBuilder:(e,t)=>{var n=new Ed.MathNode("mpadded",[jd(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}}),pd({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r}=e,i=n[0],s=t[0];return{type:"sqrt",mode:r.mode,body:s,index:i}},htmlBuilder(e,t){var n=Ld(e.body,t.havingCrampedStyle());0===n.height&&(n.height=t.fontMetrics().xHeight),n=id.wrapFragment(n,t);var r=t.fontMetrics().defaultRuleThickness,i=r;t.style.id<Pl.TEXT.id&&(i=t.fontMetrics().xHeight);var s=r+i/4,o=n.height+n.depth+s+r,{span:a,ruleWidth:l,advanceWidth:c}=Iu.sqrtImage(o,t),d=a.height-l;d>n.height+n.depth+s&&(s=(s+d-n.height-n.depth)/2);var u=a.height-n.height-s-l;n.style.paddingLeft=Zl(c);var h=id.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+u)},{type:"elem",elem:a},{type:"kern",size:l}]},t);if(e.index){var p=t.havingStyle(Pl.SCRIPTSCRIPT),m=Ld(e.index,p,t),f=.6*(h.height-h.depth),_=id.makeVList({positionType:"shift",positionData:-f,children:[{type:"elem",elem:m}]},t),g=id.makeSpan(["root"],[_]);return id.makeSpan(["mord","sqrt"],[g,h],t)}return id.makeSpan(["mord","sqrt"],[h],t)},mathmlBuilder(e,t){var{body:n,index:r}=e;return r?new Ed.MathNode("mroot",[jd(n,t),jd(r,t)]):new Ed.MathNode("msqrt",[jd(n,t)])}});var kh={display:Pl.DISPLAY,text:Pl.TEXT,script:Pl.SCRIPT,scriptscript:Pl.SCRIPTSCRIPT};pd({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:r,parser:i}=e,s=i.parseExpression(!0,n),o=r.slice(1,r.length-5);return{type:"styling",mode:i.mode,style:o,body:s}},htmlBuilder(e,t){var n=kh[e.style],r=t.havingStyle(n).withFont("");return wh(e.body,r,t)},mathmlBuilder(e,t){var n=kh[e.style],r=t.havingStyle(n),i=Vd(e.body,r),s=new Ed.MathNode("mstyle",i),o={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]}[e.style];return s.setAttribute("scriptlevel",o[0]),s.setAttribute("displaystyle",o[1]),s}}),md({type:"supsub",htmlBuilder(e,t){var n=function(e,t){var n=e.base;return n?"op"===n.type?n.limits&&(t.style.size===Pl.DISPLAY.size||n.alwaysHandleSupSub)?_h:null:"operatorname"===n.type?n.alwaysHandleSupSub&&(t.style.size===Pl.DISPLAY.size||n.limits)?vh:null:"accent"===n.type?yl(n.base)?Yd:null:"horizBrace"===n.type&&!e.sub===n.isOver?uh:null:null}(e,t);if(n)return n(e,t);var r,i,s,{base:o,sup:a,sub:l}=e,c=Ld(o,t),d=t.fontMetrics(),u=0,h=0,p=o&&yl(o);if(a){var m=t.havingStyle(t.style.sup());r=Ld(a,m,t),p||(u=c.height-m.fontMetrics().supDrop*m.sizeMultiplier/t.sizeMultiplier)}if(l){var f=t.havingStyle(t.style.sub());i=Ld(l,f,t),p||(h=c.depth+f.fontMetrics().subDrop*f.sizeMultiplier/t.sizeMultiplier)}s=t.style===Pl.DISPLAY?d.sup1:t.style.cramped?d.sup3:d.sup2;var _,g=t.sizeMultiplier,b=Zl(.5/d.ptPerEm/g),y=null;if(i){var v=e.base&&"op"===e.base.type&&e.base.name&&("\\oiint"===e.base.name||"\\oiiint"===e.base.name);(c instanceof ac||v)&&(y=Zl(-c.italic))}if(r&&i){u=Math.max(u,s,r.depth+.25*d.xHeight),h=Math.max(h,d.sub2);var w=4*d.defaultRuleThickness;if(u-r.depth-(i.height-h)<w){h=w-(u-r.depth)+i.height;var x=.8*d.xHeight-(u-r.depth);x>0&&(u+=x,h-=x)}_=id.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:h,marginRight:b,marginLeft:y},{type:"elem",elem:r,shift:-u,marginRight:b}]},t)}else if(i){h=Math.max(h,d.sub1,i.height-.8*d.xHeight),_=id.makeVList({positionType:"shift",positionData:h,children:[{type:"elem",elem:i,marginLeft:y,marginRight:b}]},t)}else{if(!r)throw new Error("supsub must have either sup or sub.");u=Math.max(u,s,r.depth+.25*d.xHeight),_=id.makeVList({positionType:"shift",positionData:-u,children:[{type:"elem",elem:r,marginRight:b}]},t)}var k=Md(c,"right")||"mord";return id.makeSpan([k],[c,id.makeSpan(["msupsub"],[_])],t)},mathmlBuilder(e,t){var n,r=!1;e.base&&"horizBrace"===e.base.type&&!!e.sup===e.base.isOver&&(r=!0,n=e.base.isOver),!e.base||"op"!==e.base.type&&"operatorname"!==e.base.type||(e.base.parentIsSupSub=!0);var i,s=[jd(e.base,t)];if(e.sub&&s.push(jd(e.sub,t)),e.sup&&s.push(jd(e.sup,t)),r)i=n?"mover":"munder";else if(e.sub)if(e.sup){var o=e.base;i=o&&"op"===o.type&&o.limits&&t.style===Pl.DISPLAY||o&&"operatorname"===o.type&&o.alwaysHandleSupSub&&(t.style===Pl.DISPLAY||o.limits)?"munderover":"msubsup"}else{var a=e.base;i=a&&"op"===a.type&&a.limits&&(t.style===Pl.DISPLAY||a.alwaysHandleSupSub)||a&&"operatorname"===a.type&&a.alwaysHandleSupSub&&(a.limits||t.style===Pl.DISPLAY)?"munder":"msub"}else{var l=e.base;i=l&&"op"===l.type&&l.limits&&(t.style===Pl.DISPLAY||l.alwaysHandleSupSub)||l&&"operatorname"===l.type&&l.alwaysHandleSupSub&&(l.limits||t.style===Pl.DISPLAY)?"mover":"msup"}return new Ed.MathNode(i,s)}}),md({type:"atom",htmlBuilder:(e,t)=>id.mathsym(e.text,e.mode,t,["m"+e.family]),mathmlBuilder(e,t){var n=new Ed.MathNode("mo",[Od(e.text,e.mode)]);if("bin"===e.family){var r=Bd(e,t);"bold-italic"===r&&n.setAttribute("mathvariant",r)}else"punct"===e.family?n.setAttribute("separator","true"):"open"!==e.family&&"close"!==e.family||n.setAttribute("stretchy","false");return n}});var Sh={mi:"italic",mn:"normal",mtext:"normal"};md({type:"mathord",htmlBuilder:(e,t)=>id.makeOrd(e,t,"mathord"),mathmlBuilder(e,t){var n=new Ed.MathNode("mi",[Od(e.text,e.mode,t)]),r=Bd(e,t)||"italic";return r!==Sh[n.type]&&n.setAttribute("mathvariant",r),n}}),md({type:"textord",htmlBuilder:(e,t)=>id.makeOrd(e,t,"textord"),mathmlBuilder(e,t){var n,r=Od(e.text,e.mode,t),i=Bd(e,t)||"normal";return n="text"===e.mode?new Ed.MathNode("mtext",[r]):/[0-9]/.test(e.text)?new Ed.MathNode("mn",[r]):"\\prime"===e.text?new Ed.MathNode("mo",[r]):new Ed.MathNode("mi",[r]),i!==Sh[n.type]&&n.setAttribute("mathvariant",i),n}});var Ch={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Mh={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};md({type:"spacing",htmlBuilder(e,t){if(Mh.hasOwnProperty(e.text)){var n=Mh[e.text].className||"";if("text"===e.mode){var r=id.makeOrd(e,t,"textord");return r.classes.push(n),r}return id.makeSpan(["mspace",n],[id.mathsym(e.text,e.mode,t)],t)}if(Ch.hasOwnProperty(e.text))return id.makeSpan(["mspace",Ch[e.text]],[],t);throw new cl('Unknown type of space "'+e.text+'"')},mathmlBuilder(e,t){if(!Mh.hasOwnProperty(e.text)){if(Ch.hasOwnProperty(e.text))return new Ed.MathNode("mspace");throw new cl('Unknown type of space "'+e.text+'"')}return new Ed.MathNode("mtext",[new Ed.TextNode(" ")])}});var Th=()=>{var e=new Ed.MathNode("mtd",[]);return e.setAttribute("width","50%"),e};md({type:"tag",mathmlBuilder(e,t){var n=new Ed.MathNode("mtable",[new Ed.MathNode("mtr",[Th(),new Ed.MathNode("mtd",[Hd(e.body,t)]),Th(),new Ed.MathNode("mtd",[Hd(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var Lh={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},zh={"\\textbf":"textbf","\\textmd":"textmd"},Ah={"\\textit":"textit","\\textup":"textup"},Rh=(e,t)=>{var n=e.font;return n?Lh[n]?t.withTextFontFamily(Lh[n]):zh[n]?t.withTextFontWeight(zh[n]):"\\emph"===n?"textit"===t.fontShape?t.withTextFontShape("textup"):t.withTextFontShape("textit"):t.withTextFontShape(Ah[n]):t};pd({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"text",mode:n.mode,body:_d(i),font:r}},htmlBuilder(e,t){var n=Rh(e,t),r=xd(e.body,n,!0);return id.makeSpan(["mord","text"],r,n)},mathmlBuilder(e,t){var n=Rh(e,t);return Hd(e.body,n)}}),pd({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"underline",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Ld(e.body,t),r=id.makeLineSpan("underline-line",t),i=t.fontMetrics().defaultRuleThickness,s=id.makeVList({positionType:"top",positionData:n.height,children:[{type:"kern",size:i},{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n}]},t);return id.makeSpan(["mord","underline"],[s],t)},mathmlBuilder(e,t){var n=new Ed.MathNode("mo",[new Ed.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new Ed.MathNode("munder",[jd(e.body,t),n]);return r.setAttribute("accentunder","true"),r}}),pd({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"vcenter",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Ld(e.body,t),r=t.fontMetrics().axisHeight,i=.5*(n.height-r-(n.depth+r));return id.makeVList({positionType:"shift",positionData:i,children:[{type:"elem",elem:n}]},t)},mathmlBuilder:(e,t)=>new Ed.MathNode("mpadded",[jd(e.body,t)],["vcenter"])}),pd({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new cl("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=Ph(e),r=[],i=t.havingStyle(t.style.text()),s=0;s<n.length;s++){var o=n[s];"~"===o&&(o="\\textasciitilde"),r.push(id.makeSymbol(o,"Typewriter-Regular",e.mode,i,["mord","texttt"]))}return id.makeSpan(["mord","text"].concat(i.sizingClasses(t)),id.tryCombineChars(r),i)},mathmlBuilder(e,t){var n=new Ed.TextNode(Ph(e)),r=new Ed.MathNode("mtext",[n]);return r.setAttribute("mathvariant","monospace"),r}});var Ph=e=>e.body.replace(/ /g,e.star?"␣":" "),Nh=dd,Eh="[ \r\n\t]",Oh="(\\\\[a-zA-Z@]+)"+Eh+"*",Ih="[̀-ͯ]",Bh=new RegExp(Ih+"+$"),Dh="("+Eh+"+)|\\\\(\n|[ \r\t]+\n?)[ \r\t]*|([!-\\[\\]-‧-豈-]"+Ih+"*|[\ud800-\udbff][\udc00-\udfff]"+Ih+"*|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5|"+Oh+"|\\\\[^\ud800-\udfff])";class Vh{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(Dh,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new ll("EOF",new al(this,t,t));var n=this.tokenRegex.exec(e);if(null===n||n.index!==t)throw new cl("Unexpected character: '"+e[t]+"'",new ll(e[t],new al(this,t,t+1)));var r=n[6]||n[3]||(n[2]?"\\ ":" ");if(14===this.catcodes[r]){var i=e.indexOf("\n",this.tokenRegex.lastIndex);return-1===i?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=i+1,this.lex()}return new ll(r,new al(this,t,this.tokenRegex.lastIndex))}}class Hh{constructor(e,t){void 0===e&&(e={}),void 0===t&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(0===this.undefStack.length)throw new cl("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(null==e[t]?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,n){if(void 0===n&&(n=!1),n){for(var r=0;r<this.undefStack.length;r++)delete this.undefStack[r][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(e)&&(i[e]=this.current[e])}null==t?delete this.current[e]:this.current[e]=t}}var jh=$u;Gu("\\noexpand",function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}}),Gu("\\expandafter",function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}}),Gu("\\@firstoftwo",function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}}),Gu("\\@secondoftwo",function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}}),Gu("\\@ifnextchar",function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return 1===t[0].length&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}}),Gu("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),Gu("\\TextOrMath",function(e){var t=e.consumeArgs(2);return"text"===e.mode?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var Fh={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};Gu("\\char",function(e){var t,n=e.popToken(),r="";if("'"===n.text)t=8,n=e.popToken();else if('"'===n.text)t=16,n=e.popToken();else if("`"===n.text)if("\\"===(n=e.popToken()).text[0])r=n.text.charCodeAt(1);else{if("EOF"===n.text)throw new cl("\\char` missing argument");r=n.text.charCodeAt(0)}else t=10;if(t){if(null==(r=Fh[n.text])||r>=t)throw new cl("Invalid base-"+t+" digit "+n.text);for(var i;null!=(i=Fh[e.future().text])&&i<t;)r*=t,r+=i,e.popToken()}return"\\@char{"+r+"}"});var Uh=(e,t,n,r)=>{var i=e.consumeArg().tokens;if(1!==i.length)throw new cl("\\newcommand's first argument must be a macro name");var s=i[0].text,o=e.isDefined(s);if(o&&!t)throw new cl("\\newcommand{"+s+"} attempting to redefine "+s+"; use \\renewcommand");if(!o&&!n)throw new cl("\\renewcommand{"+s+"} when command "+s+" does not yet exist; use \\newcommand");var a=0;if(1===(i=e.consumeArg().tokens).length&&"["===i[0].text){for(var l="",c=e.expandNextToken();"]"!==c.text&&"EOF"!==c.text;)l+=c.text,c=e.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new cl("Invalid number of arguments: "+l);a=parseInt(l),i=e.consumeArg().tokens}return o&&r||e.macros.set(s,{tokens:i,numArgs:a}),""};Gu("\\newcommand",e=>Uh(e,!1,!0,!1)),Gu("\\renewcommand",e=>Uh(e,!0,!1,!1)),Gu("\\providecommand",e=>Uh(e,!0,!0,!0)),Gu("\\message",e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(e=>e.text).join("")),""}),Gu("\\errmessage",e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(e=>e.text).join("")),""}),Gu("\\show",e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),Nh[n],mc.math[n],mc.text[n]),""}),Gu("\\bgroup","{"),Gu("\\egroup","}"),Gu("~","\\nobreakspace"),Gu("\\lq","`"),Gu("\\rq","'"),Gu("\\aa","\\r a"),Gu("\\AA","\\r A"),Gu("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),Gu("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),Gu("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),Gu("ℬ","\\mathscr{B}"),Gu("ℰ","\\mathscr{E}"),Gu("ℱ","\\mathscr{F}"),Gu("ℋ","\\mathscr{H}"),Gu("ℐ","\\mathscr{I}"),Gu("ℒ","\\mathscr{L}"),Gu("ℳ","\\mathscr{M}"),Gu("ℛ","\\mathscr{R}"),Gu("ℭ","\\mathfrak{C}"),Gu("ℌ","\\mathfrak{H}"),Gu("ℨ","\\mathfrak{Z}"),Gu("\\Bbbk","\\Bbb{k}"),Gu("·","\\cdotp"),Gu("\\llap","\\mathllap{\\textrm{#1}}"),Gu("\\rlap","\\mathrlap{\\textrm{#1}}"),Gu("\\clap","\\mathclap{\\textrm{#1}}"),Gu("\\mathstrut","\\vphantom{(}"),Gu("\\underbar","\\underline{\\text{#1}}"),Gu("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'),Gu("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),Gu("\\ne","\\neq"),Gu("≠","\\neq"),Gu("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),Gu("∉","\\notin"),Gu("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),Gu("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),Gu("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),Gu("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),Gu("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),Gu("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),Gu("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),Gu("⟂","\\perp"),Gu("‼","\\mathclose{!\\mkern-0.8mu!}"),Gu("∌","\\notni"),Gu("⌜","\\ulcorner"),Gu("⌝","\\urcorner"),Gu("⌞","\\llcorner"),Gu("⌟","\\lrcorner"),Gu("©","\\copyright"),Gu("®","\\textregistered"),Gu("️","\\textregistered"),Gu("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),Gu("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),Gu("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),Gu("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),Gu("\\vdots","{\\varvdots\\rule{0pt}{15pt}}"),Gu("⋮","\\vdots"),Gu("\\varGamma","\\mathit{\\Gamma}"),Gu("\\varDelta","\\mathit{\\Delta}"),Gu("\\varTheta","\\mathit{\\Theta}"),Gu("\\varLambda","\\mathit{\\Lambda}"),Gu("\\varXi","\\mathit{\\Xi}"),Gu("\\varPi","\\mathit{\\Pi}"),Gu("\\varSigma","\\mathit{\\Sigma}"),Gu("\\varUpsilon","\\mathit{\\Upsilon}"),Gu("\\varPhi","\\mathit{\\Phi}"),Gu("\\varPsi","\\mathit{\\Psi}"),Gu("\\varOmega","\\mathit{\\Omega}"),Gu("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),Gu("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),Gu("\\boxed","\\fbox{$\\displaystyle{#1}$}"),Gu("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),Gu("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),Gu("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;"),Gu("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}"),Gu("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var qh={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};Gu("\\dots",function(e){var t="\\dotso",n=e.expandAfterFuture().text;return n in qh?t=qh[n]:("\\not"===n.slice(0,4)||n in mc.math&&ml(["bin","rel"],mc.math[n].group))&&(t="\\dotsb"),t});var $h={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};Gu("\\dotso",function(e){return e.future().text in $h?"\\ldots\\,":"\\ldots"}),Gu("\\dotsc",function(e){var t=e.future().text;return t in $h&&","!==t?"\\ldots\\,":"\\ldots"}),Gu("\\cdots",function(e){return e.future().text in $h?"\\@cdots\\,":"\\@cdots"}),Gu("\\dotsb","\\cdots"),Gu("\\dotsm","\\cdots"),Gu("\\dotsi","\\!\\cdots"),Gu("\\dotsx","\\ldots\\,"),Gu("\\DOTSI","\\relax"),Gu("\\DOTSB","\\relax"),Gu("\\DOTSX","\\relax"),Gu("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),Gu("\\,","\\tmspace+{3mu}{.1667em}"),Gu("\\thinspace","\\,"),Gu("\\>","\\mskip{4mu}"),Gu("\\:","\\tmspace+{4mu}{.2222em}"),Gu("\\medspace","\\:"),Gu("\\;","\\tmspace+{5mu}{.2777em}"),Gu("\\thickspace","\\;"),Gu("\\!","\\tmspace-{3mu}{.1667em}"),Gu("\\negthinspace","\\!"),Gu("\\negmedspace","\\tmspace-{4mu}{.2222em}"),Gu("\\negthickspace","\\tmspace-{5mu}{.277em}"),Gu("\\enspace","\\kern.5em "),Gu("\\enskip","\\hskip.5em\\relax"),Gu("\\quad","\\hskip1em\\relax"),Gu("\\qquad","\\hskip2em\\relax"),Gu("\\tag","\\@ifstar\\tag@literal\\tag@paren"),Gu("\\tag@paren","\\tag@literal{({#1})}"),Gu("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new cl("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"}),Gu("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),Gu("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),Gu("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),Gu("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),Gu("\\newline","\\\\\\relax"),Gu("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var Gh=Zl(Dl["Main-Regular"]["T".charCodeAt(0)][1]-.7*Dl["Main-Regular"]["A".charCodeAt(0)][1]);Gu("\\LaTeX","\\textrm{\\html@mathml{L\\kern-.36em\\raisebox{"+Gh+"}{\\scriptstyle A}\\kern-.15em\\TeX}{LaTeX}}"),Gu("\\KaTeX","\\textrm{\\html@mathml{K\\kern-.17em\\raisebox{"+Gh+"}{\\scriptstyle A}\\kern-.15em\\TeX}{KaTeX}}"),Gu("\\hspace","\\@ifstar\\@hspacer\\@hspace"),Gu("\\@hspace","\\hskip #1\\relax"),Gu("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),Gu("\\ordinarycolon",":"),Gu("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),Gu("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),Gu("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),Gu("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),Gu("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),Gu("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),Gu("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),Gu("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),Gu("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),Gu("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),Gu("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),Gu("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),Gu("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),Gu("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),Gu("∷","\\dblcolon"),Gu("∹","\\eqcolon"),Gu("≔","\\coloneqq"),Gu("≕","\\eqqcolon"),Gu("⩴","\\Coloneqq"),Gu("\\ratio","\\vcentcolon"),Gu("\\coloncolon","\\dblcolon"),Gu("\\colonequals","\\coloneqq"),Gu("\\coloncolonequals","\\Coloneqq"),Gu("\\equalscolon","\\eqqcolon"),Gu("\\equalscoloncolon","\\Eqqcolon"),Gu("\\colonminus","\\coloneq"),Gu("\\coloncolonminus","\\Coloneq"),Gu("\\minuscolon","\\eqcolon"),Gu("\\minuscoloncolon","\\Eqcolon"),Gu("\\coloncolonapprox","\\Colonapprox"),Gu("\\coloncolonsim","\\Colonsim"),Gu("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),Gu("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),Gu("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),Gu("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),Gu("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),Gu("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),Gu("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),Gu("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),Gu("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),Gu("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),Gu("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),Gu("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),Gu("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),Gu("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),Gu("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),Gu("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),Gu("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),Gu("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),Gu("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),Gu("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),Gu("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),Gu("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),Gu("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),Gu("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),Gu("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),Gu("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),Gu("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),Gu("\\imath","\\html@mathml{\\@imath}{ı}"),Gu("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),Gu("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),Gu("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),Gu("⟦","\\llbracket"),Gu("⟧","\\rrbracket"),Gu("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),Gu("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),Gu("⦃","\\lBrace"),Gu("⦄","\\rBrace"),Gu("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),Gu("⦵","\\minuso"),Gu("\\darr","\\downarrow"),Gu("\\dArr","\\Downarrow"),Gu("\\Darr","\\Downarrow"),Gu("\\lang","\\langle"),Gu("\\rang","\\rangle"),Gu("\\uarr","\\uparrow"),Gu("\\uArr","\\Uparrow"),Gu("\\Uarr","\\Uparrow"),Gu("\\N","\\mathbb{N}"),Gu("\\R","\\mathbb{R}"),Gu("\\Z","\\mathbb{Z}"),Gu("\\alef","\\aleph"),Gu("\\alefsym","\\aleph"),Gu("\\Alpha","\\mathrm{A}"),Gu("\\Beta","\\mathrm{B}"),Gu("\\bull","\\bullet"),Gu("\\Chi","\\mathrm{X}"),Gu("\\clubs","\\clubsuit"),Gu("\\cnums","\\mathbb{C}"),Gu("\\Complex","\\mathbb{C}"),Gu("\\Dagger","\\ddagger"),Gu("\\diamonds","\\diamondsuit"),Gu("\\empty","\\emptyset"),Gu("\\Epsilon","\\mathrm{E}"),Gu("\\Eta","\\mathrm{H}"),Gu("\\exist","\\exists"),Gu("\\harr","\\leftrightarrow"),Gu("\\hArr","\\Leftrightarrow"),Gu("\\Harr","\\Leftrightarrow"),Gu("\\hearts","\\heartsuit"),Gu("\\image","\\Im"),Gu("\\infin","\\infty"),Gu("\\Iota","\\mathrm{I}"),Gu("\\isin","\\in"),Gu("\\Kappa","\\mathrm{K}"),Gu("\\larr","\\leftarrow"),Gu("\\lArr","\\Leftarrow"),Gu("\\Larr","\\Leftarrow"),Gu("\\lrarr","\\leftrightarrow"),Gu("\\lrArr","\\Leftrightarrow"),Gu("\\Lrarr","\\Leftrightarrow"),Gu("\\Mu","\\mathrm{M}"),Gu("\\natnums","\\mathbb{N}"),Gu("\\Nu","\\mathrm{N}"),Gu("\\Omicron","\\mathrm{O}"),Gu("\\plusmn","\\pm"),Gu("\\rarr","\\rightarrow"),Gu("\\rArr","\\Rightarrow"),Gu("\\Rarr","\\Rightarrow"),Gu("\\real","\\Re"),Gu("\\reals","\\mathbb{R}"),Gu("\\Reals","\\mathbb{R}"),Gu("\\Rho","\\mathrm{P}"),Gu("\\sdot","\\cdot"),Gu("\\sect","\\S"),Gu("\\spades","\\spadesuit"),Gu("\\sub","\\subset"),Gu("\\sube","\\subseteq"),Gu("\\supe","\\supseteq"),Gu("\\Tau","\\mathrm{T}"),Gu("\\thetasym","\\vartheta"),Gu("\\weierp","\\wp"),Gu("\\Zeta","\\mathrm{Z}"),Gu("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),Gu("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),Gu("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),Gu("\\bra","\\mathinner{\\langle{#1}|}"),Gu("\\ket","\\mathinner{|{#1}\\rangle}"),Gu("\\braket","\\mathinner{\\langle{#1}\\rangle}"),Gu("\\Bra","\\left\\langle#1\\right|"),Gu("\\Ket","\\left|#1\\right\\rangle");var Xh=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,i=t.consumeArg().tokens,s=t.consumeArg().tokens,o=t.macros.get("|"),a=t.macros.get("\\|");t.macros.beginGroup();var l=t=>n=>{e&&(n.macros.set("|",o),i.length&&n.macros.set("\\|",a));var s=t;return!t&&i.length&&"|"===n.future().text&&(n.popToken(),s=!0),{tokens:s?i:r,numArgs:0}};t.macros.set("|",l(!1)),i.length&&t.macros.set("\\|",l(!0));var c=t.consumeArg().tokens,d=t.expandTokens([...s,...c,...n]);return t.macros.endGroup(),{tokens:d.reverse(),numArgs:0}};Gu("\\bra@ket",Xh(!1)),Gu("\\bra@set",Xh(!0)),Gu("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),Gu("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),Gu("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),Gu("\\angln","{\\angl n}"),Gu("\\blue","\\textcolor{##6495ed}{#1}"),Gu("\\orange","\\textcolor{##ffa500}{#1}"),Gu("\\pink","\\textcolor{##ff00af}{#1}"),Gu("\\red","\\textcolor{##df0030}{#1}"),Gu("\\green","\\textcolor{##28ae7b}{#1}"),Gu("\\gray","\\textcolor{gray}{#1}"),Gu("\\purple","\\textcolor{##9d38bd}{#1}"),Gu("\\blueA","\\textcolor{##ccfaff}{#1}"),Gu("\\blueB","\\textcolor{##80f6ff}{#1}"),Gu("\\blueC","\\textcolor{##63d9ea}{#1}"),Gu("\\blueD","\\textcolor{##11accd}{#1}"),Gu("\\blueE","\\textcolor{##0c7f99}{#1}"),Gu("\\tealA","\\textcolor{##94fff5}{#1}"),Gu("\\tealB","\\textcolor{##26edd5}{#1}"),Gu("\\tealC","\\textcolor{##01d1c1}{#1}"),Gu("\\tealD","\\textcolor{##01a995}{#1}"),Gu("\\tealE","\\textcolor{##208170}{#1}"),Gu("\\greenA","\\textcolor{##b6ffb0}{#1}"),Gu("\\greenB","\\textcolor{##8af281}{#1}"),Gu("\\greenC","\\textcolor{##74cf70}{#1}"),Gu("\\greenD","\\textcolor{##1fab54}{#1}"),Gu("\\greenE","\\textcolor{##0d923f}{#1}"),Gu("\\goldA","\\textcolor{##ffd0a9}{#1}"),Gu("\\goldB","\\textcolor{##ffbb71}{#1}"),Gu("\\goldC","\\textcolor{##ff9c39}{#1}"),Gu("\\goldD","\\textcolor{##e07d10}{#1}"),Gu("\\goldE","\\textcolor{##a75a05}{#1}"),Gu("\\redA","\\textcolor{##fca9a9}{#1}"),Gu("\\redB","\\textcolor{##ff8482}{#1}"),Gu("\\redC","\\textcolor{##f9685d}{#1}"),Gu("\\redD","\\textcolor{##e84d39}{#1}"),Gu("\\redE","\\textcolor{##bc2612}{#1}"),Gu("\\maroonA","\\textcolor{##ffbde0}{#1}"),Gu("\\maroonB","\\textcolor{##ff92c6}{#1}"),Gu("\\maroonC","\\textcolor{##ed5fa6}{#1}"),Gu("\\maroonD","\\textcolor{##ca337c}{#1}"),Gu("\\maroonE","\\textcolor{##9e034e}{#1}"),Gu("\\purpleA","\\textcolor{##ddd7ff}{#1}"),Gu("\\purpleB","\\textcolor{##c6b9fc}{#1}"),Gu("\\purpleC","\\textcolor{##aa87ff}{#1}"),Gu("\\purpleD","\\textcolor{##7854ab}{#1}"),Gu("\\purpleE","\\textcolor{##543b78}{#1}"),Gu("\\mintA","\\textcolor{##f5f9e8}{#1}"),Gu("\\mintB","\\textcolor{##edf2df}{#1}"),Gu("\\mintC","\\textcolor{##e0e5cc}{#1}"),Gu("\\grayA","\\textcolor{##f6f7f7}{#1}"),Gu("\\grayB","\\textcolor{##f0f1f2}{#1}"),Gu("\\grayC","\\textcolor{##e3e5e6}{#1}"),Gu("\\grayD","\\textcolor{##d6d8da}{#1}"),Gu("\\grayE","\\textcolor{##babec2}{#1}"),Gu("\\grayF","\\textcolor{##888d93}{#1}"),Gu("\\grayG","\\textcolor{##626569}{#1}"),Gu("\\grayH","\\textcolor{##3b3e40}{#1}"),Gu("\\grayI","\\textcolor{##21242c}{#1}"),Gu("\\kaBlue","\\textcolor{##314453}{#1}"),Gu("\\kaGreen","\\textcolor{##71B307}{#1}");var Kh={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class Wh{constructor(e,t,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new Hh(jh,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new Vh(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return 0===this.stack.length&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,r;if(e){if(this.consumeSpaces(),"["!==this.future().text)return null;t=this.popToken(),({tokens:r,end:n}=this.consumeArg(["]"]))}else({tokens:r,start:t,end:n}=this.consumeArg());return this.pushToken(new ll("EOF",n.loc)),this.pushTokens(r),t.range(n,"")}consumeSpaces(){for(;" "===this.future().text;)this.stack.pop()}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var r,i=this.future(),s=0,o=0;do{if(r=this.popToken(),t.push(r),"{"===r.text)++s;else if("}"===r.text){if(-1===--s)throw new cl("Extra }",r)}else if("EOF"===r.text)throw new cl("Unexpected end of input in a macro argument, expected '"+(e&&n?e[o]:"}")+"'",r);if(e&&n)if((0===s||1===s&&"{"===e[o])&&r.text===e[o]){if(++o===e.length){t.splice(-o,o);break}}else o=0}while(0!==s||n);return"{"===i.text&&"}"===t[t.length-1].text&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:i,end:r}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new cl("The length of delimiters doesn't match the number of args!");for(var n=t[0],r=0;r<n.length;r++){var i=this.popToken();if(n[r]!==i.text)throw new cl("Use of the macro doesn't match its definition",i)}}for(var s=[],o=0;o<e;o++)s.push(this.consumeArg(t&&t[o+1]).tokens);return s}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new cl("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var t=this.popToken(),n=t.text,r=t.noexpand?null:this._getExpansion(n);if(null==r||e&&r.unexpandable){if(e&&null==r&&"\\"===n[0]&&!this.isDefined(n))throw new cl("Undefined control sequence: "+n);return this.pushToken(t),!1}this.countExpansion(1);var i=r.tokens,s=this.consumeArgs(r.numArgs,r.delimiters);if(r.numArgs)for(var o=(i=i.slice()).length-1;o>=0;--o){var a=i[o];if("#"===a.text){if(0===o)throw new cl("Incomplete placeholder at end of macro body",a);if("#"===(a=i[--o]).text)i.splice(o+1,1);else{if(!/^[1-9]$/.test(a.text))throw new cl("Not a valid argument number",a);i.splice(o,2,...s[+a.text-1])}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(!1===this.expandOnce()){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}throw new Error}expandMacro(e){return this.macros.has(e)?this.expandTokens([new ll(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(!1===this.expandOnce(!0)){var r=this.stack.pop();r.treatAsRelax&&(r.noexpand=!1,r.treatAsRelax=!1),t.push(r)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t?t.map(e=>e.text).join(""):t}_getExpansion(e){var t=this.macros.get(e);if(null==t)return t;if(1===e.length){var n=this.lexer.catcodes[e];if(null!=n&&13!==n)return}var r="function"==typeof t?t(this):t;if("string"==typeof r){var i=0;if(-1!==r.indexOf("#"))for(var s=r.replace(/##/g,"");-1!==s.indexOf("#"+(i+1));)++i;for(var o=new Vh(r,this.settings),a=[],l=o.lex();"EOF"!==l.text;)a.push(l),l=o.lex();return a.reverse(),{tokens:a,numArgs:i}}return r}isDefined(e){return this.macros.has(e)||Nh.hasOwnProperty(e)||mc.math.hasOwnProperty(e)||mc.text.hasOwnProperty(e)||Kh.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return null!=t?"string"==typeof t||"function"==typeof t||!t.unexpandable:Nh.hasOwnProperty(e)&&!Nh[e].primitive}}var Yh=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,Zh=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9",ₐ:"a",ₑ:"e",ₕ:"h",ᵢ:"i",ⱼ:"j",ₖ:"k",ₗ:"l",ₘ:"m",ₙ:"n",ₒ:"o",ₚ:"p",ᵣ:"r",ₛ:"s",ₜ:"t",ᵤ:"u",ᵥ:"v",ₓ:"x",ᵦ:"β",ᵧ:"γ",ᵨ:"ρ",ᵩ:"ϕ",ᵪ:"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9",ᴬ:"A",ᴮ:"B",ᴰ:"D",ᴱ:"E",ᴳ:"G",ᴴ:"H",ᴵ:"I",ᴶ:"J",ᴷ:"K",ᴸ:"L",ᴹ:"M",ᴺ:"N",ᴼ:"O",ᴾ:"P",ᴿ:"R",ᵀ:"T",ᵁ:"U",ⱽ:"V",ᵂ:"W",ᵃ:"a",ᵇ:"b",ᶜ:"c",ᵈ:"d",ᵉ:"e",ᶠ:"f",ᵍ:"g",ʰ:"h",ⁱ:"i",ʲ:"j",ᵏ:"k",ˡ:"l",ᵐ:"m",ⁿ:"n",ᵒ:"o",ᵖ:"p",ʳ:"r",ˢ:"s",ᵗ:"t",ᵘ:"u",ᵛ:"v",ʷ:"w",ˣ:"x",ʸ:"y",ᶻ:"z",ᵝ:"β",ᵞ:"γ",ᵟ:"δ",ᵠ:"ϕ",ᵡ:"χ",ᶿ:"θ"}),Qh={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},Jh={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class ep{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new Wh(e,t,this.mode),this.settings=t,this.leftrightDepth=0}expect(e,t){if(void 0===t&&(t=!0),this.fetch().text!==e)throw new cl("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return null==this.nextToken&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new ll("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,n}parseExpression(e,t){for(var n=[];;){"math"===this.mode&&this.consumeSpaces();var r=this.fetch();if(-1!==ep.endOfExpression.indexOf(r.text))break;if(t&&r.text===t)break;if(e&&Nh[r.text]&&Nh[r.text].infix)break;var i=this.parseAtom(t);if(!i)break;"internal"!==i.type&&n.push(i)}return"text"===this.mode&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var t,n=-1,r=0;r<e.length;r++)if("infix"===e[r].type){if(-1!==n)throw new cl("only one infix operator per group",e[r].token);n=r,t=e[r].replaceWith}if(-1!==n&&t){var i,s,o=e.slice(0,n),a=e.slice(n+1);return i=1===o.length&&"ordgroup"===o[0].type?o[0]:{type:"ordgroup",mode:this.mode,body:o},s=1===a.length&&"ordgroup"===a[0].type?a[0]:{type:"ordgroup",mode:this.mode,body:a},["\\\\abovefrac"===t?this.callFunction(t,[i,e[n],s],[]):this.callFunction(t,[i,s],[])]}return e}handleSupSubscript(e){var t,n=this.fetch(),r=n.text;this.consume(),this.consumeSpaces();do{var i;t=this.parseGroup(e)}while("internal"===(null==(i=t)?void 0:i.type));if(!t)throw new cl("Expected group after '"+r+"'",n);return t}formatUnsupportedCmd(e){for(var t=[],n=0;n<e.length;n++)t.push({type:"textord",mode:"text",text:e[n]});var r={type:"text",mode:this.mode,body:t};return{type:"color",mode:this.mode,color:this.settings.errorColor,body:[r]}}parseAtom(e){var t,n,r=this.parseGroup("atom",e);if("internal"===(null==r?void 0:r.type))return r;if("text"===this.mode)return r;for(;;){this.consumeSpaces();var i=this.fetch();if("\\limits"===i.text||"\\nolimits"===i.text){if(r&&"op"===r.type){var s="\\limits"===i.text;r.limits=s,r.alwaysHandleSupSub=!0}else{if(!r||"operatorname"!==r.type)throw new cl("Limit controls must follow a math operator",i);r.alwaysHandleSupSub&&(r.limits="\\limits"===i.text)}this.consume()}else if("^"===i.text){if(t)throw new cl("Double superscript",i);t=this.handleSupSubscript("superscript")}else if("_"===i.text){if(n)throw new cl("Double subscript",i);n=this.handleSupSubscript("subscript")}else if("'"===i.text){if(t)throw new cl("Double superscript",i);var o={type:"textord",mode:this.mode,text:"\\prime"},a=[o];for(this.consume();"'"===this.fetch().text;)a.push(o),this.consume();"^"===this.fetch().text&&a.push(this.handleSupSubscript("superscript")),t={type:"ordgroup",mode:this.mode,body:a}}else{if(!Zh[i.text])break;var l=Yh.test(i.text),c=[];for(c.push(new ll(Zh[i.text])),this.consume();;){var d=this.fetch().text;if(!Zh[d])break;if(Yh.test(d)!==l)break;c.unshift(new ll(Zh[d])),this.consume()}var u=this.subparse(c);l?n={type:"ordgroup",mode:"math",body:u}:t={type:"ordgroup",mode:"math",body:u}}}return t||n?{type:"supsub",mode:this.mode,base:r,sup:t,sub:n}:r}parseFunction(e,t){var n=this.fetch(),r=n.text,i=Nh[r];if(!i)return null;if(this.consume(),t&&"atom"!==t&&!i.allowedInArgument)throw new cl("Got function '"+r+"' with no arguments"+(t?" as "+t:""),n);if("text"===this.mode&&!i.allowedInText)throw new cl("Can't use function '"+r+"' in text mode",n);if("math"===this.mode&&!1===i.allowedInMath)throw new cl("Can't use function '"+r+"' in math mode",n);var{args:s,optArgs:o}=this.parseArguments(r,i);return this.callFunction(r,s,o,n,e)}callFunction(e,t,n,r,i){var s={funcName:e,parser:this,token:r,breakOnTokenText:i},o=Nh[e];if(o&&o.handler)return o.handler(s,t,n);throw new cl("No function handler for "+e)}parseArguments(e,t){var n=t.numArgs+t.numOptionalArgs;if(0===n)return{args:[],optArgs:[]};for(var r=[],i=[],s=0;s<n;s++){var o=t.argTypes&&t.argTypes[s],a=s<t.numOptionalArgs;(t.primitive&&null==o||"sqrt"===t.type&&1===s&&null==i[0])&&(o="primitive");var l=this.parseGroupOfType("argument to '"+e+"'",o,a);if(a)i.push(l);else{if(null==l)throw new cl("Null argument, please report this as a bug");r.push(l)}}return{args:r,optArgs:i}}parseGroupOfType(e,t,n){switch(t){case"color":return this.parseColorGroup(n);case"size":return this.parseSizeGroup(n);case"url":return this.parseUrlGroup(n);case"math":case"text":return this.parseArgumentGroup(n,t);case"hbox":var r=this.parseArgumentGroup(n,"text");return null!=r?{type:"styling",mode:r.mode,body:[r],style:"text"}:null;case"raw":var i=this.parseStringGroup("raw",n);return null!=i?{type:"raw",mode:"text",string:i.text}:null;case"primitive":if(n)throw new cl("A primitive argument cannot be optional");var s=this.parseGroup(e);if(null==s)throw new cl("Expected group as "+e,this.fetch());return s;case"original":case null:case void 0:return this.parseArgumentGroup(n);default:throw new cl("Unknown group type as "+e,this.fetch())}}consumeSpaces(){for(;" "===this.fetch().text;)this.consume()}parseStringGroup(e,t){var n=this.gullet.scanArgument(t);if(null==n)return null;for(var r,i="";"EOF"!==(r=this.fetch()).text;)i+=r.text,this.consume();return this.consume(),n.text=i,n}parseRegexGroup(e,t){for(var n,r=this.fetch(),i=r,s="";"EOF"!==(n=this.fetch()).text&&e.test(s+n.text);)s+=(i=n).text,this.consume();if(""===s)throw new cl("Invalid "+t+": '"+r.text+"'",r);return r.range(i,s)}parseColorGroup(e){var t=this.parseStringGroup("color",e);if(null==t)return null;var n=/^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);if(!n)throw new cl("Invalid color: '"+t.text+"'",t);var r=n[0];return/^[0-9a-f]{6}$/i.test(r)&&(r="#"+r),{type:"color-token",mode:this.mode,color:r}}parseSizeGroup(e){var t,n=!1;if(this.gullet.consumeSpaces(),!(t=e||"{"===this.gullet.future().text?this.parseStringGroup("size",e):this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size")))return null;e||0!==t.text.length||(t.text="0pt",n=!0);var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!r)throw new cl("Invalid size: '"+t.text+"'",t);var i={number:+(r[1]+r[2]),unit:r[3]};if(!Wl(i))throw new cl("Invalid unit: '"+i.unit+"'",t);return{type:"size",mode:this.mode,value:i,isBlank:n}}parseUrlGroup(e){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var t=this.parseStringGroup("url",e);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),null==t)return null;var n=t.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:n}}parseArgumentGroup(e,t){var n=this.gullet.scanArgument(e);if(null==n)return null;var r=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();var i=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var s={type:"ordgroup",mode:this.mode,loc:n.loc,body:i};return t&&this.switchMode(r),s}parseGroup(e,t){var n,r=this.fetch(),i=r.text;if("{"===i||"\\begingroup"===i){this.consume();var s="{"===i?"}":"\\endgroup";this.gullet.beginGroup();var o=this.parseExpression(!1,s),a=this.fetch();this.expect(s),this.gullet.endGroup(),n={type:"ordgroup",mode:this.mode,loc:al.range(r,a),body:o,semisimple:"\\begingroup"===i||void 0}}else if(null==(n=this.parseFunction(t,e)||this.parseSymbol())&&"\\"===i[0]&&!Kh.hasOwnProperty(i)){if(this.settings.throwOnError)throw new cl("Undefined control sequence: "+i,r);n=this.formatUnsupportedCmd(i),this.consume()}return n}formLigatures(e){for(var t=e.length-1,n=0;n<t;++n){var r=e[n],i=r.text;"-"===i&&"-"===e[n+1].text&&(n+1<t&&"-"===e[n+2].text?(e.splice(n,3,{type:"textord",mode:"text",loc:al.range(r,e[n+2]),text:"---"}),t-=2):(e.splice(n,2,{type:"textord",mode:"text",loc:al.range(r,e[n+1]),text:"--"}),t-=1)),"'"!==i&&"`"!==i||e[n+1].text!==i||(e.splice(n,2,{type:"textord",mode:"text",loc:al.range(r,e[n+1]),text:i+i}),t-=1)}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),r="*"===n.charAt(0);if(r&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new cl("\\verb assertion failed --\n please report what input caused this bug");return{type:"verb",mode:"text",body:n=n.slice(1,-1),star:r}}Jh.hasOwnProperty(t[0])&&!mc[this.mode][t[0]]&&(this.settings.strict&&"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+t[0]+'" used in math mode',e),t=Jh[t[0]]+t.slice(1));var i,s=Bh.exec(t);if(s&&("i"===(t=t.substring(0,s.index))?t="ı":"j"===t&&(t="ȷ")),mc[this.mode][t]){this.settings.strict&&"math"===this.mode&&"ÐÞþ".indexOf(t)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',e);var o,a=mc[this.mode][t].group,l=al.range(e);if(hc.hasOwnProperty(a)){var c=a;o={type:"atom",mode:this.mode,family:c,loc:l,text:t}}else o={type:a,mode:this.mode,loc:l,text:t};i=o}else{if(!(t.charCodeAt(0)>=128))return null;this.settings.strict&&(Ol(t.charCodeAt(0))?"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'" ('+t.charCodeAt(0)+")",e)),i={type:"textord",mode:"text",loc:al.range(e),text:t}}if(this.consume(),s)for(var d=0;d<s[0].length;d++){var u=s[0][d];if(!Qh[u])throw new cl("Unknown accent ' "+u+"'",e);var h=Qh[u][this.mode]||Qh[u].text;if(!h)throw new cl("Accent "+u+" unsupported in "+this.mode+" mode",e);i={type:"accent",mode:this.mode,loc:al.range(e),label:h,isStretchy:!1,isShifty:!0,base:i}}return i}}ep.endOfExpression=["}","\\endgroup","\\end","\\right","&"];"undefined"!=typeof document&&"CSS1Compat"!==document.compatMode&&"undefined"!=typeof console&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype.");var tp=function(e,t){var n=new kl(t);try{return function(e,t,n){var r,i=function(e){return new Gl({style:e.displayMode?Pl.DISPLAY:Pl.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})}(n);if("mathml"===n.output)return Fd(e,t,i,n.displayMode,!0);if("html"===n.output){var s=Ad(e,i);r=id.makeSpan(["katex"],[s])}else{var o=Fd(e,t,i,n.displayMode,!1),a=Ad(e,i);r=id.makeSpan(["katex"],[o,a])}return function(e,t){if(t.displayMode){var n=["katex-display"];t.leqno&&n.push("leqno"),t.fleqn&&n.push("fleqn"),e=id.makeSpan(n,[e])}return e}(r,n)}(function(e,t){if(!("string"==typeof e||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var n=new ep(e,t);delete n.gullet.macros.current["\\df@tag"];var r=n.parse();if(delete n.gullet.macros.current["\\current@color"],delete n.gullet.macros.current["\\color"],n.gullet.macros.get("\\df@tag")){if(!t.displayMode)throw new cl("\\tag works only in display equations");r=[{type:"tag",mode:"text",body:r,tag:n.subparse([new ll("\\df@tag")])}]}return r}(e,n),e,n)}catch(t){return function(e,t,n){if(n.throwOnError||!(e instanceof cl))throw e;var r=id.makeSpan(["katex-error"],[new ac(t)]);return r.setAttribute("title",e.toString()),r.setAttribute("style","color:"+n.errorColor),r}(t,e,n)}};class np{static update(e,t,n,r=!1){return{id:e,name:a.nY.update,size:n,latex:t,block:r}}}class rp extends o._D{_mathml=(0,l.KR)("");constructor(e,t){return super(e,t),this.setup(e,t)}get component(){return ol}get mathml(){const e=this.attrs.size+this.info;return rp.render(e,{displayMode:this.attrs.block})}get attrs(){return this.data.attrs}get meta(){return rp.meta}build_child(e){}export(){return this.base_export()}gc(){super.base_gc()}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}replace_id(e,t={}){return rp.replace_id(this.root,e,t)}update(e){const{latex:t,block:n,size:r}=e,{courier:i,id:s}=this,o=i.get_recorder();o.add_cmd(e);const a=this.info,l=this.attrs.block,c=this.attrs.size;return this.data.info=t,this.data.attrs.block=n,this.data.attrs.size=r,o.add_recover(np.update(s,a,c,l)),o}static render(e,t={}){const n={...t,throwOnError:!1,output:"html"};try{return function(e,t){return tp(e,t).toMarkup()}(e,{...n})}catch(e){return""}}static get meta(){return{cubename:"公式",type:a.u0.fomula,block:!1,version:1,show:!0}}static get_default(e="",t={},n={}){return{id:g.I.get_id(),type:a.u0.fomula,info:e,attrs:{block:!1,size:a.$f.h4,...n},css:t}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();return n[r]=i,t.id=i,t}}!function(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);s>3&&o&&Object.defineProperty(t,n,o)}([(0,k.H)(a.nY.update)],rp.prototype,"update",null);class ip{static add_title(e,t){return{id:e,name:a.BS.add_title,data:t}}static remove_title(e){return{id:e,name:a.BS.remove_title}}static add_cell(e,t){return{id:e,name:a.BS.add_cell,data:t}}static remove_cell(e,t){return{id:e,name:a.BS.remove_cell,cid:t}}static add_row(e,t,n){return{id:e,name:a.BS.add_row,index:t,rows:n}}static remove_row(e,t){return{id:e,name:a.BS.remove_row,index:t}}static add_col(e,t,n){return{id:e,name:a.BS.add_col,index:t,cols:n}}static remove_col(e,t){return{id:e,name:a.BS.remove_col,index:t}}static moveto(e,t,n){return{id:e,name:a.BS.moveto,tid:t,cells:n}}static merge(e,t){return{id:e,name:a.BS.merge,area:t}}static update_cell_area(e,t,n){return{id:e,name:a.BS.update_area,tid:t,area:n}}static add_grid_col(e,t,n){return{id:e,name:a.BS.add_grid_col,index:t,width:n}}static remove_grid_col(e,t){return{id:e,name:a.BS.remove_grid_col,index:t}}static col_resize(e,t,n){return{id:e,name:a.BS.col_resize,cols:t,step:n}}}function sp(e,t){const{hotkeys:n,courier:r,id:i,history:s}=t,o=el.F.tips;if(n.validate_hotkeys(e))return;if(!e.ctrlKey)return;e.stopPropagation();const l=e.key.toLowerCase(),c=e.shiftKey,d=t.get_active_cell();if(!d)return o?.tip_info("未发现激活单元格");if(l===a.tX.up)if(c){const e=t.get_cell_area(d);if(!t.check_orderly_row_top(e.top))return o?.tip_info("上方不整齐");const n=r.get_recorder(),i=[];for(let e=0;e<t.size[1];e++)i.push(Lt.get_default());n.tell(t,ip.add_row(t.id,d.row,i)),s.record(n)}else{if(t.get_cell(d.row-1,d.col))return o?.tip_info("上方已存在单元格");if(d.row-1<0)return o?.tip_info("上方已达边界");{const e=r.get_recorder(),n={row:d.row-1,col:d.col,rowspan:1,colspan:1,data:Lt.get_default()};e.tell(t,ip.add_cell(t.id,n)),s.record(e)}}else if(l===a.tX.down)if(c){const e=t.get_cell_area(d);if(!t.check_orderly_row_bottom(e.bottom))return o?.tip_info("下方不整齐");const n=r.get_recorder(),i=[];for(let e=0;e<t.size[1];e++)i.push(Lt.get_default());n.tell(t,ip.add_row(t.id,d.row+d.rowspan,i)),s.record(n)}else{if(t.get_cell(d.row+1,d.col))return o?.tip_info("下方已存在单元格");if(d.row+1>=t.size[0])return o?.tip_info("下方已达边界");{const e=r.get_recorder(),n={row:d.row+1,col:d.col,rowspan:1,colspan:1,data:Lt.get_default()};e.tell(t,ip.add_cell(t.id,n)),s.record(e)}}else if(l===a.tX.left)if(c){const e=t.get_cell_area(d);if(!t.check_orderly_col_left(e.left))return o?.tip_info("左侧不整齐");const n=r.get_recorder(),i=[];for(let e=0;e<t.size[0];e++)i.push(Lt.get_default());n.tell(t,ip.add_col(t.id,d.col,i)),s.record(n)}else{if(t.get_cell(d.row,d.col-1))return o?.tip_info("左侧已存在单元格");if(d.col-1<0)return o?.tip_info("左侧已达边界");{const e=r.get_recorder(),n={row:d.row,col:d.col-1,rowspan:1,colspan:1,data:Lt.get_default()};e.tell(t,ip.add_cell(t.id,n)),s.record(e)}}else if(l===a.tX.right)if(c){const e=t.get_cell_area(d);if(!t.check_orderly_col_right(e.right))return o?.tip_info("右侧不整齐");const n=r.get_recorder(),i=[];for(let e=0;e<t.size[0];e++)i.push(Lt.get_default());n.tell(t,ip.add_col(t.id,d.col+d.colspan,i)),s.record(n)}else{if(t.get_cell(d.row,d.col+1))return o?.tip_info("右侧已存在单元格");if(d.col+1>=t.size[1])return o?.tip_info("右侧已达边界");{const e=r.get_recorder(),n={row:d.row,col:d.col+1,rowspan:1,colspan:1,data:Lt.get_default()};e.tell(t,ip.add_cell(t.id,n)),s.record(e)}}}const op={drag_cell:void 0,hover:void 0};function ap(e,t){const n=e.currentTarget;n.parentElement?.style.setProperty("--drag-pointer-events","none"),e.stopPropagation(),op.drag_cell=t}function lp(e,t){if(op.drag_cell===t)return;const n=e.currentTarget;n.classList.add("cube-cell-selection"),op.hover=n}function cp(e,t){e.currentTarget.classList.remove("cube-cell-selection")}function dp(e,t){const{drag_cell:n,hover:r}=op,{pcube:i,courier:s,history:o}=t.box;if(!n)return;const a=e.currentTarget;a.parentElement?.style.setProperty("--drag-pointer-events","auto"),r&&r.classList.remove("cube-cell-selection");const l=s.get_recorder();l.tell(i,ip.moveto(i.id,t.box.id,[n.box.id])),o.record(l)}const up={anchor:void 0,hover:void 0,down_point:void 0,has_down:!1,has_move:!1};function hp(e,t){const{root:n,cursor:r}=t;if(e.ctrlKey)e.stopPropagation();else{g.I.check_mouse_key(e,"left")&&t.clear_selection();const n=e.target;if(!(n instanceof Node))return;const r=t.find_dom_cube(n),i=r?.find_upstream_untill(t);if(!i)return;const s=t.cells.find(e=>e.box===i);if(!s)return;up.down_point={x:e.clientX,y:e.clientY},up.has_down=!0,up.anchor=s}}function pp(e,t){const{cursor:n}=t,{down_point:r,has_down:i,anchor:s,has_move:o}=up;if(!r)return;if(up.has_move=Math.sqrt((e.clientX-r.x)**2+(e.clientY-r.y)**2)>5,!i||!s||!o||e.buttons<=0)return;const a=e.target;if(!(a instanceof Node))return;const l=t.find_dom_cube(a),c=l?.find_upstream_untill(t),d=t.cells.find(e=>e.box===c);if(!d||d===s)return void t.clear_selection();const u={left:Math.min(s.col,d.col),right:Math.max(s.col+s.colspan-1,d.col+d.colspan-1),top:Math.min(s.row,d.row),bottom:Math.max(s.row+s.rowspan-1,d.row+d.rowspan-1)},h=t.get_rectarea_cell(u);t.clear_selection();for(let e of h.cells)e.selection=!0;h.cells.length>1&&e.stopPropagation()}function mp(e,t){const{cursor:n}=t;up.has_down=!1,up.anchor=void 0}const fp=["id","data-type"],_p=(0,c.pM)({__name:"cube-table",props:{cube:{}},setup(e){const t=(0,c.rk)("dragger"),n=(0,c.rk)("box");function r(e){return{"grid-row":`${e.row+1}/span ${e.rowspan}`,"grid-column":`${e.col+1}/span ${e.colspan}`}}function i(e){return{"cube-cell-selection":e.selection}}const s=(0,c.EW)(()=>({"grid-template-columns":e.cube.cols.map(e=>e>0?e+"fr":"1fr").join(" ")}));return(0,c.sV)(()=>{const r=t.value,i=n.value;if(!r||!i)return;let s=e.cube.data.attrs.width,a=s;const l=new N.DragDiff(r);l.register_down(()=>{s=e.cube.data.attrs.width}),l.register_move((t,n)=>{s+t<e.cube.min_width||(a=s+t,i.style.width=a+"px")}),l.register_up((t,n)=>{if(a===s)return;const{courier:r,history:i}=e.cube,l=r.get_recorder();l.tell(e.cube,o.VL.resize(e.cube.id,a)),i.record(l)}),l.register_cancel(()=>{i.style.width=s+"px"})}),(e,o)=>((0,c.uX)(),(0,c.CE)("div",{ref_key:"box",ref:n,class:"cube-table",style:(0,d.Tr)(e.cube.css),id:e.cube.id,"data-type":(0,l.R1)(a.u0).table,onPointerdown:o[0]||(o[0]=t=>(0,l.R1)(hp)(t,e.cube)),onPointermove:o[1]||(o[1]=t=>(0,l.R1)(pp)(t,e.cube)),onPointerup:o[2]||(o[2]=t=>(0,l.R1)(mp)(t,e.cube)),onPointercancel:o[3]||(o[3]=t=>(0,l.R1)(mp)(t,e.cube)),onKeyup:o[4]||(o[4]=t=>(0,l.R1)(sp)(t,e.cube)),onContextmenu:o[5]||(o[5]=t=>(0,l.R1)(pt.uz)(t,e.cube))},[e.cube.title?((0,c.uX)(),(0,c.Wv)(S,{key:0,class:"cube-table-title",cube:(0,l.IG)(e.cube.title)},null,8,["cube"])):(0,c.Q3)("v-if",!0),(0,c.Lk)("div",{class:"cube-table-container",style:(0,d.Tr)(s.value)},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.cells,(e,t)=>((0,c.uX)(),(0,c.Wv)(S,{key:e.box.id,cube:(0,l.IG)(e.box),style:(0,d.Tr)(r(e)),class:(0,d.C4)(i(e)),draggable:"true",onDragstart:t=>(0,l.R1)(ap)(t,e),onDragenter:t=>(0,l.R1)(lp)(t,e),onDragleave:t=>(0,l.R1)(cp)(t,e),onDrop:t=>(0,l.R1)(dp)(t,e)},null,8,["cube","style","class","onDragstart","onDragenter","onDragleave","onDrop"]))),128))],4),(0,c.Lk)("div",{class:"cube-table-dragger",ref_key:"dragger",ref:t},null,512)],44,fp))}}),gp=(0,m.A)(_p,[["__scopeId","data-v-727c5c78"]]);function bp(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class yp extends o._D{cells=(0,l.Kh)([]);_title=(0,l.KR)(void 0);get title(){return this._title.value}set title(e){this._title.value=e}get component(){return gp}get meta(){return yp.meta}get children(){const e=[],t=[...this.cells];return t.sort((e,t)=>e.row!==t.row?e.row-t.row:e.col-t.col),this.title&&e.unshift(this.title),e.push(...t.map(e=>e.box)),e}get cells_sorted(){const e=[],t=[...this.cells];return t.sort((e,t)=>e.row!==t.row?e.row-t.row:e.col-t.col),e.push(...t),e}get css(){const e=this.attrs;return{...super.css,width:e.width+"px"}}get attrs(){return this.data.attrs}get cols(){return this.data.info.cols}get size(){return this.data.info.size}get selection_cells(){const e=[];for(let t of this.cells_sorted)t.selection&&e.push(t);return e}get min_width(){return 500}constructor(e,t){return super(e,t),this.setup(e,t)}build_child(e){e.info.title&&(this.title=(0,l.IG)(new Lt(e.info.title,this)));for(let t of e.info.cells){const e=new Lt(t.data,this),n={row:t.row,col:t.col,rowspan:t.rowspan,colspan:t.colspan,box:(0,l.IG)(e),selection:!1};this.cells.push(n)}}export(){const e=this.base_export();this.title&&(e.info.title=this.title.export()),e.info.cells=[];for(let t of this.cells)e.info.cells.push(this.get_cell_data(t));return e}update_data(e){return{usable:!0,data:e}}gc(){this.base_gc()}get_cell_data(e){return{row:e.row,col:e.col,rowspan:e.rowspan,colspan:e.colspan,data:e.box.export()}}replace_id(e,t={}){return yp.replace_id(this.root,e,t)}get_rows(e){const t=[];for(let n of this.cells_sorted)e>=n.row&&e<n.row+n.rowspan&&t.push(n);return t}get_cols(e){const t=[];for(let n of this.cells_sorted)e>=n.col&&e<n.col+n.colspan&&t.push(n);return t}check_orderly_col(e){const t=this.get_cols(e),n=[];for(let e of t)n.push(this.get_cell_area(e));const r=1===new Set(n.map(e=>e.right)).size,i=1===new Set(n.map(e=>e.left)).size;return r&&i}check_orderly_col_left(e){const t=this.get_cols(e),n=[];for(let e of t)n.push(this.get_cell_area(e));return 1===new Set(n.map(e=>e.left)).size}check_orderly_col_right(e){const t=this.get_cols(e),n=[];for(let e of t)n.push(this.get_cell_area(e));return 1===new Set(n.map(e=>e.right)).size}check_orderly_row(e){const t=this.get_rows(e),n=[];for(let e of t)n.push(this.get_cell_area(e));const r=1===new Set(n.map(e=>e.bottom)).size,i=1===new Set(n.map(e=>e.top)).size;return r&&i}check_orderly_row_top(e){const t=this.get_rows(e),n=[];for(let e of t)n.push(this.get_cell_area(e));return new Set(n.map(e=>e.bottom)).size,1===new Set(n.map(e=>e.top)).size}check_orderly_row_bottom(e){const t=this.get_rows(e),n=[];for(let e of t)n.push(this.get_cell_area(e));return 1===new Set(n.map(e=>e.bottom)).size}get_cell_area(e){return{left:e.col,right:e.col+e.colspan-1,top:e.row,bottom:e.row+e.rowspan-1}}get_cell(e,t){for(let n of this.cells){const r=e>=n.row&&e<n.row+n.rowspan,i=t>=n.col&&t<n.col+n.colspan;if(r&&i)return n}}get_rectarea_cell(e){let t=!1;for(;!t;){const{left:n,right:r,top:i,bottom:s}=e;for(let o of this.cells){let{row:a,rowspan:l,col:c,colspan:d}=o,u=a,h=a+l-1,p=c,m=c+d-1;if(n>=p&&n<=m||n<=p&&m<=r||r>=p&&r<=m){if(u<i&&h>=i){e.top=a;break}if(u<=s&&h>s){e.bottom=a+l-1;break}}if(i>=u&&i<=h||i<u&&s>=h||s>=u&&s<=h){if(p<n&&m>=n){e.left=c;break}if(p<=r&&m>r){e.right=c+d-1;break}}o===this.cells[this.cells.length-1]&&(t=!0)}}const n=[];for(let t of this.cells_sorted){let{row:r,col:i,rowspan:s,colspan:o}=t;i>=e.left&&i+o-1<=e.right&&r>=e.top&&r+s-1<=e.bottom&&n.push(t)}return{...e,cells:n}}clear_selection(){for(let e of this.cells)e.selection=!1}get_active_cell(){const{cursor:e}=this,{cube_end:t}=e;if(!t)return;const n=t?.find_upstream_untill(this);return this.cells.find(e=>e.box===n)}set_selection_area(e){this.get_rectarea_cell(e);for(let e of this.cells)e.selection=!1;for(let e of this.cells)e.selection=!0}get_focus_cell(){const{cursor:e}=this,{cube_end:t}=e;if(!t)return;const n=t.find_upstream_untill(this);return n?this.cells.find(e=>e.box.id===n.id):void 0}get_selection_area(){let e,t;const n=this.selection_cells;if(0!==n.length){for(let r of n){const n=this.get_cell_area(r);e||(e=[n.top,n.bottom]),t||(t=[n.left,n.right]),n.top<e[0]&&(e[0]=n.top),n.left<t[0]&&(t[0]=n.left),n.bottom>e[1]&&(e[1]=n.bottom),n.right>t[1]&&(t[1]=n.right)}if(e&&t)return{left:t[0],right:t[1],top:e[0],bottom:e[1]}}}get_selection_size(){const e=this.get_selection_area();if(e)return[e.bottom-e.top+1,e.right-e.left+1]}get_selection_text(){const e=this.selection_cells;let t="";if(0===e.length)return t;for(let n of e)t+=n.box.text;return t}copy_selection_table(){const e=this.get_selection_size(),t=this.selection_cells,n=this.get_selection_area();if(!e||!t||!n)return;const r=[];for(let e of t)r.push({row:e.row-n.top,col:e.col-n.left,rowspan:e.rowspan,colspan:e.colspan,data:e.box.export()});const i=yp.get_default_by_data(e,r);return i.attrs=structuredClone((0,l.ux)(this.attrs)),i}add_title(e){const{data:t}=e,{courier:n,cursor:r,id:i}=this,s=n.get_recorder();s.add_cmd(e);const o=new Lt(t,this);return this.title=(0,l.IG)(o),s.add_recover(ip.remove_title(i)),s}remove_title(e){const{id:t,courier:n,cursor:r}=this;if(!this.title)return;const i=this.title.export(),s=n.get_recorder();return s.add_cmd(e),this.title=void 0,s.add_recover(ip.add_title(t,i)),s}add_cell(e){const{id:t,courier:n,cursor:r}=this,{data:i}=e;this.clear_selection();const s=n.get_recorder();s.add_cmd(e);const o={row:i.row,col:i.col,rowspan:i.rowspan,colspan:i.colspan,box:(0,l.IG)(new Lt(i.data,this)),selection:!1};return this.cells.push(o),s.add_recover(ip.remove_cell(t,o.box.id)),s}remove_cell(e){const{id:t,courier:n,cursor:r}=this,{cid:i}=e,s=n.get_recorder();s.add_cmd(e);const o=this.cells.findIndex(e=>e.box.id===i),a=this.cells[o];if(!a)return;const l={row:a.row,col:a.col,rowspan:a.rowspan,colspan:a.colspan,data:a.box.export()};return o>=0&&this.cells.splice(o,1),s.add_recover(ip.add_cell(t,l)),s}add_row(e){const{courier:t,cursor:n,id:r}=this,{index:i,rows:s}=e,o=t.get_recorder(),a=[];for(let e=0;e<s.length;e++){const t=s[e];a.push({row:i,col:e,rowspan:1,colspan:1,data:t})}this.size[0]++;for(let e of this.cells)e.row<i||o.tell(this,ip.update_cell_area(r,e.box.id,{row:e.row+1,col:e.col,rowspan:e.rowspan,colspan:e.colspan}));for(let e of a)o.tell(this,ip.add_cell(r,e));return o}remove_row(e){const{id:t,courier:n,cursor:r}=this,{index:i}=e,s=this.get_rows(i),o=n.get_recorder();for(let e of s)o.tell(this,ip.remove_cell(t,e.box.id));return this.size[0]--,o}add_col(e){const{id:t,cursor:n,courier:r}=this,{index:i,cols:s}=e,o=r.get_recorder(),a=[];for(let e=0;e<s.length;e++){const t=s[e];a.push({row:e,col:i,rowspan:1,colspan:1,data:t})}o.tell(this,ip.add_grid_col(t,i,2));for(let e of this.cells)e.col<i||o.tell(this,ip.update_cell_area(t,e.box.id,{row:e.row,col:e.col+1,rowspan:e.rowspan,colspan:e.colspan}));for(let e of a)o.tell(this,ip.add_cell(t,e));return o}remove_col(e){const{id:t,cursor:n,courier:r}=this,{index:i}=e;if(!this.check_orderly_col(i))return el.F.tips?.tip_info("目标列不整齐");let s;for(let e=0;e<=this.size[0]&&(s||(s=this.get_cell(e,i),!s));e++);if(!s)return;const o=r.get_recorder();for(let e=s.col;e<s.col+s.colspan;e++)o.tell(this,ip.remove_grid_col(t,e));const a=this.get_cols(i);for(let e of a)o.tell(this,ip.remove_cell(t,e.box.id));for(let e of this.cells){if(e.col<i)continue;const n={row:e.row,col:e.col-1,rowspan:e.rowspan,colspan:e.colspan};o.tell(this,ip.update_cell_area(t,e.box.id,n))}return o}moveto(e){const{id:t,courier:n,cursor:r}=this,{tid:i,cells:s}=e,a=n.get_recorder(),l=this.cells.find(e=>e.box.id===i);if(!l)return;const c=l.box,d=this.cells_sorted.filter(e=>e.box.id!==i&&s.includes(e.box.id));for(let e of d){const n=e.box.export();a.tell(this,ip.remove_cell(t,e.box.id)),a.tell(c,o.VL.insert_child(c.id,n.info,c.child_count))}return a}update_area(e){const{id:t,courier:n,cursor:r}=this,{tid:i,area:s}=e,o=n.get_recorder(),a=this.cells.find(e=>e.box.id===i);if(!a)return;o.add_cmd(e);const l={row:a.row,col:a.col,rowspan:a.rowspan,colspan:a.colspan};return a.row=s.row,a.col=s.col,a.rowspan=s.rowspan,a.colspan=s.colspan,o.add_recover(ip.update_cell_area(t,i,l)),o}merge_cell(e){const{id:t,cursor:n,courier:r}=this,{area:i}=e,s=r.get_recorder(),o=this.get_rectarea_cell(i);let a=o.cells[0];if(!a)return;const l={row:i.top,col:i.left,rowspan:i.bottom-i.top+1,colspan:i.right-i.left+1},c=a.box.id;return s.tell(this,ip.update_cell_area(t,c,l)),s.tell(this,ip.moveto(t,c,o.cells.map(e=>e.box.id))),s}add_grid_col(e){const{id:t,courier:n,cursor:r}=this,{index:i,width:s}=e,o=n.get_recorder();return o.add_cmd(e),this.cols.splice(i,0,s),this.size[1]++,o.add_recover(ip.remove_grid_col(t,i)),o}remove_grid_col(e){const{id:t,courier:n,cursor:r}=this,{index:i}=e,s=n.get_recorder(),o=this.cols.splice(i,1);if(0!==o.length)return this.size[1]--,s.add_recover(ip.add_grid_col(t,i,o[0])),s}col_resize(e){const{id:t,courier:n,cursor:r}=this,{cols:i,step:s}=e,o=n.get_recorder();o.add_cmd(e);let a=!1;for(let e=i[0];e<=i[1];e++){let t=this.cols[e]+s;t<=0||(a=!0,this.cols[e]=t)}if(a)return o.add_recover(ip.col_resize(t,i,-s)),o}delete_child(e){const{dir:t,range:n,reserve:r}=e,{courier:i,cursor:s,history:a}=this,l=i.get_recorder();let[c,d]=this.get_valid_range(n);if(0===c&&d>=this.child_count)if(r){if(this.is_empty)return;const e=this.child_first;l.tell(this,o.VL.delete_child(this.id,"backward",[1,this.child_count],r)),l.tell(e,o.VL.delete_child(e.id,"backward",[0,e.child_count],r))}else l.merge(this.remove_self());else{let e=[];for(let t=c;t<d;t++){let n=this.children[t];e.push(n.id)}for(let t of e)l.tell(this,ip.remove_cell(this.id,t))}return l}static get meta(){return{cubename:"表格",type:a.u0.table,block:!0,version:1,show:!0}}static get_default(e=3,t=3){const n=[],r=[];r.length=t,r.fill(2);for(let r=0;r<e;r++)for(let e=0;e<t;e++){const t={row:r,col:e,rowspan:1,colspan:1,data:Lt.get_default()};n.push(t)}return{id:g.I.get_id(),type:a.u0.table,info:{size:[e,t],cols:r,cells:n},attrs:{width:500},css:{}}}static get_default_by_data(e,t){const[n,r]=e,i=[];return i.length=r,i.fill(2),{id:g.I.get_id(),type:a.u0.table,info:{size:[n,r],cols:i,cells:t},attrs:{width:500},css:{}}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i,t.info.title&&(t.info.title=Lt.replace_id(e,t.info.title,n));for(let r of t.info.cells)r.data=Lt.replace_id(e,r.data,n);return t}}bp([(0,k.H)(a.BS.add_title)],yp.prototype,"add_title",null),bp([(0,k.H)(a.BS.remove_title)],yp.prototype,"remove_title",null),bp([(0,k.H)(a.BS.add_cell)],yp.prototype,"add_cell",null),bp([(0,k.H)(a.BS.remove_cell)],yp.prototype,"remove_cell",null),bp([(0,k.H)(a.BS.add_row)],yp.prototype,"add_row",null),bp([(0,k.H)(a.BS.remove_row)],yp.prototype,"remove_row",null),bp([(0,k.H)(a.BS.add_col)],yp.prototype,"add_col",null),bp([(0,k.H)(a.BS.remove_col)],yp.prototype,"remove_col",null),bp([(0,k.H)(a.BS.moveto)],yp.prototype,"moveto",null),bp([(0,k.H)(a.BS.update_area)],yp.prototype,"update_area",null),bp([(0,k.H)(a.BS.merge)],yp.prototype,"merge_cell",null),bp([(0,k.H)(a.BS.add_grid_col)],yp.prototype,"add_grid_col",null),bp([(0,k.H)(a.BS.remove_grid_col)],yp.prototype,"remove_grid_col",null),bp([(0,k.H)(a.BS.col_resize)],yp.prototype,"col_resize",null),bp([(0,k.H)(a.zS.cube_delete_child)],yp.prototype,"delete_child",null);const vp=["id","data-type"],wp=(0,c.pM)({__name:"cube-tip",props:{cube:{}},setup:e=>(e,t)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-tip",style:(0,d.Tr)(e.cube.css),id:e.cube.id,"data-type":(0,l.R1)(a.u0).tip},[(0,c.bF)(S,{cube:e.cube.box},null,8,["cube"])],12,vp))}),xp=(0,m.A)(wp,[["__scopeId","data-v-433bbb71"]]);function kp(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class Sp extends o._D{_component=xp;get component(){return this._component}get children(){return[this.box]}box;constructor(e,t){return super(e,t),this.setup(e,t)}splice(e,t,...n){const r=this._children.splice(e,t,...n);for(let e of r)e.gc();const i=[];for(let e of r)e instanceof o._D&&i.push(e.export());return{children:r,data:i}}replace_id(e,t={}){return Sp.replace_id(this.root,e,t)}build_child(e){this.box=new Lt(e.info,this)}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}export(){const e=this.base_export();return e.info=this.box.export(),e}gc(){super.base_gc()}on_insert_child(e){const{courier:t}=this,{pos:n,data:r}=e,i=t.get_recorder();if(i.add_cmd(e),0===r.length)return;if(!this.meta.block)return;let s=this.get_valid_index(n);const a=this.create_child_block(r);this.splice(s,0,...a),i.add_recover(o.VL.delete_child(this.id,"backward",[s,s+a.length]));const l=this.children[s+1];return l?i.tell(l,o.UB.in_head(l.id,0)):i.tell(this.child_last,o.UB.in_tail(this.child_last.id,0)),i}on_delete_child(e){const{courier:t,pid:n,index:r,pcube:i}=this,s=t.get_recorder();s.add_cmd(e);const{dir:a,range:l}=e,[c,d]=l;let u=c<0?0:c,h=d>this.child_count?this.child_count:d;if(u>=h)return;if(u<=0&&h>=this.child_count)return this.is_empty?s.tell(i,o.VL.delete_child(n,a,[r,r+1])):s.tell(this,o.VL.reset(this.id,[])),s;const p=this.children[u-1],m=this.children[h],f=h-u;let _=this.splice(c,f);return s.add_recover(o.VL.insert_child(this.id,_.data,c)),"backward"===a?p?s.tell(p,o.UB.in_tail(p.id,0)):m&&s.tell(m,o.UB.in_head(m.id,0)):"forward"===a&&(m?s.tell(m,o.UB.in_head(m.id,0)):p&&s.tell(p,o.UB.in_tail(p.id,0))),s}on_reset(e){const{courier:t,history:n}=this,{data:r}=e,i=new _.vk(t),s=[];for(let e of this.children)s.push(e.export());const a=g.I.build_cubes(r,this);return this.splice(0,this.child_count,...a),i.add_recover(o.VL.reset(this.id,s)),i}get meta(){return Sp.meta}static get meta(){return{cubename:"提示",type:a.u0.tip,block:!0,version:1,show:!0}}static get_default(e,t={},n={}){return{id:g.I.get_id(),type:a.u0.tip,info:Lt.get_default(e),attrs:n,css:t}}static get_default_by_string(e,t={},n={}){const r=kt.get_default_by_string(e),i=Lt.get_default([r]);return{id:g.I.get_id(),type:a.u0.tip,info:i,attrs:n,css:t}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();return n[r]=i,t.id=i,t.info=Lt.replace_id(e,t.info,n),t}}kp([(0,k.H)(a.zS.cube_insert_child)],Sp.prototype,"on_insert_child",null),kp([(0,k.H)(a.zS.cube_delete_child)],Sp.prototype,"on_delete_child",null),kp([(0,k.H)(a.zS.cube_reset)],Sp.prototype,"on_reset",null);const Cp=["id","data-type"],Mp=(0,c.pM)({__name:"cube-box-columns",props:{cube:{}},setup(e){const t=(0,l.KR)(),n=(0,l.KR)();let r;return(0,l.Kh)({open:!1}),(0,c.sV)(()=>{const i=t.value;if(!i)return;const s=n.value;if(!s)return;r=new N.DragDiff(s);let a=e.cube.attrs.width,l=e.cube.attrs.height,c=a,d=l;r.register_down(()=>{a=e.cube.attrs.width,l=e.cube.attrs.height}),r.register_move((t,n)=>{c=Math.round(t+a),c<e.cube.min_width&&(c=e.cube.min_width),i.style.width=c+"px",i.style.height=d+"px"}),r.register_up((t,n)=>{if(a===c&&l===d)return;const r=e.cube.courier.get_recorder(),i=Math.round(t+a);r.tell(e.cube,o.VL.resize(e.cube.id,i)),e.cube.history.record(r)}),r.register_cancel(()=>{e.cube.attrs.width=a,e.cube.attrs.height=l})}),(0,c.hi)(()=>{r?.off()}),(r,i)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-box-columns",ref_key:"box",ref:t,style:(0,d.Tr)(r.cube.css),id:r.cube.id,"data-type":(0,l.R1)(a.u0).box_columns,onContextmenu:i[0]||(i[0]=e=>(0,l.R1)(pt.uz)(e,r.cube))},[(0,c.Lk)("div",{class:"box-columns-content",style:(0,d.Tr)(e.cube.attrs.column_count?{"column-count":e.cube.attrs.column_count}:e.cube.attrs.column_width?{"column-width":e.cube.attrs.column_width+"px"}:{})},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(r.cube.children,e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:e},null,8,["cube"]))),128))],4),(0,c.Lk)("div",{class:"box-columns-dragger",ref_key:"dragger",ref:n},null,512)],44,Cp))}}),Tp=(0,m.A)(Mp,[["__scopeId","data-v-622bc65f"]]);function Lp(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class zp extends o._D{constructor(e,t){return super(e,t),this.setup(e,t)}get component(){return Tp}get css(){const{width:e}=this.data.attrs;return{...super.css,width:e+"px"}}get attrs(){return this.data.attrs}get meta(){return zp.meta}get min_width(){return 200}build_child(e){const t=g.I.build_cubes(e.info,this);this._children.push(...t)}update_data(e){return{data:e,usable:!0}}export(){const e=this.base_export();e.info=[];for(let t of this._children)e.info.push(t.export());return e}gc(){this.base_gc()}replace_id(e,t){return zp.replace_id(this.root,e,t)}on_insert_child(e){const{courier:t,history:n}=this,{data:r}=e,i=t.get_recorder();i.add_cmd(e);const s=g.I.build_cubes(e.data,this),a=this.child_count;return this._children.push(...s),i.add_recover(o.VL.delete_child(this.id,"backward",[a,this.child_count])),i}on_delete_child(e){const{courier:t,history:n}=this,{dir:r,range:i,reserve:s}=e,a=t.get_recorder(),l=this.get_valid_index(i[0]),c=this.get_valid_index(i[1]),d=[],u=this._children.splice(l,c-l);for(let e of u)d.push(e.export());return a.add_recover(o.VL.insert_child(this.id,d,l)),a}static replace_id(e,t,n){const r=t.id,i=n[r]||g.I.get_id();return n[r]=i,t.id=i,g.I.replace_id(e,t.info,n),t}static get_default(){const e=Lt.get_default(),t=Lt.get_default(),n=Lt.get_default();return{id:g.I.get_id(),type:a.u0.box_columns,info:[e,t,n],attrs:{width:400,column_count:3},css:{}}}static get meta(){return{cubename:"多列容器",type:a.u0.box_columns,block:!0,version:1,show:!0}}}Lp([(0,k.H)(a.zS.cube_insert_child)],zp.prototype,"on_insert_child",null),Lp([(0,k.H)(a.zS.cube_delete_child)],zp.prototype,"on_delete_child",null);class Ap{static reset(e,t){return{id:e,name:a.DI.reset_explanation,explanation:t}}}const Rp=["id","data-type"],Pp=(0,c.pM)({__name:"cube-rt",props:{cube:{}},setup(e){const{event:t}=e.cube;function n(){t.emit_show_cube_editor(e.cube)}return(e,t)=>((0,c.uX)(),(0,c.CE)("ruby",{class:"cube-rt",id:e.cube.id,style:(0,d.Tr)(e.cube.css),"data-type":(0,l.R1)(a.u0).rt,onClick:n},[(0,c.eW)((0,d.v_)(e.cube.info.text)+" ",1),(0,c.Lk)("rt",null,(0,d.v_)(e.cube.info.explanation),1),t[0]||(t[0]=(0,c.eW)(" ",-1))],12,Rp))}});class Np extends o._D{data;constructor(e,t){return super(e,t),this.setup(e,t)}get info(){return this.data.info}get component(){return Pp}get meta(){return Np.meta}build_child(e){}update_data(e){return{usable:!0,data:e}}export(){return this.base_export()}gc(){this.base_gc()}replace_id(e,t){return Np.replace_id(this.root,e,t)}reset_explanation(e){const{explanation:t}=e,{courier:n}=this,r=n.get_recorder();r.add_cmd(e);const i=this.info.explanation;this.info.explanation=t;const s=Ap.reset(this.id,i);return r.add_recover(s),r}static get meta(){return{cubename:"标注文本",type:a.u0.rt,block:!1,version:1,show:!1}}static get_default(e="",t="",n={}){return{id:g.I.get_id(),type:a.u0.rt,info:{text:e,explanation:t},attrs:{},css:n}}static replace_id(e,t,n){const r=t.id;return t.id=n[r]||g.I.get_id(),n[r]=t.id,t}}!function(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);s>3&&o&&Object.defineProperty(t,n,o)}([(0,k.H)(a.DI.reset_explanation)],Np.prototype,"reset_explanation",null)},4823:(e,t,n)=>{"use strict";n.d(t,{R:()=>u});var r=n(7633),i=n(4743),s=n(8606),o=n(9513),a=n(1068),l=n(8631),c=n(3923),d=n(4116);class u extends c.K{_id=(0,s.Ak)();scroll_offset=100;_freeze=(0,r.KR)(!1);get meta(){return u.meta}get id(){return this._id}pos=(0,r.Kh)({x:0,y:0,width:0,height:0});css=(0,r.Kh)({});get freeze(){return this._freeze.value}set freeze(e){this._freeze.value=e}_direction=null;get focus_cube(){return this.selection_line[this.selection_line.length-1]}get second_cube(){return this.selection_line.length<=1?void 0:this.selection_line[this.selection_line.length-2]}get len(){return this.selection_line.length}selection_line=[];constructor(e,t){super(e),this.selection_line.push(t),this.listener.check_float()}expand(e){if(!(this.focus_cube instanceof i.$u&&this._direction===e))if("up"===e){if("down"===this._direction&&this.len>1)return this.selection_line.pop(),void this.update_area();const e=this.focus_cube.prev_cube||this.focus_cube.pcube;if(!e||e instanceof d.MR)return;if("map"===e.domain)return;e===this.second_cube?(this.selection_line.pop(),this.update_area()):(null!==this._direction&&1!==this.len||(this._direction="up"),this.selection_line.push(e),this.update_area())}else{if("up"===this._direction&&this.len>1)return this.selection_line.pop(),void this.update_area();const e=this.focus_cube.next_cube||this.focus_cube.pcube;if(!e||e instanceof d.MR)return;if("map"===e.domain)return;e===this.second_cube?(this.selection_line.pop(),this.update_area()):(null!==this._direction&&1!==this.len||(this._direction="down"),this.selection_line.push(e),this.update_area())}}shrink(){1!==this.selection_line.length&&(this.selection_line.pop(),this.update_area())}update_area(e=!0){if(e){const e=[];for(let t of this.selection_line){const n=t.clientRect;n&&e.push(n)}if(0===e.length)return this.remove();const t=a.MathRect.merge(...e);this.css.width=`${t.width}px`,this.css.height=`${t.height}px`,this.css.left=t.x+"px",this.css.top=t.y+"px",this.pos.x=t.x+document.documentElement.scrollLeft,this.pos.y=t.y+document.documentElement.scrollTop,this.pos.width=t.width,this.pos.height=t.height}else{const e=this.pos.x-document.documentElement.scrollLeft,t=this.pos.y-document.documentElement.scrollTop;this.css.left=e+"px",this.css.top=t+"px"}}find_line_next(e){if(this.selection_line.indexOf(e)<this.selection_line.length)return this.selection_line[this.selection_line.length-1]}find_line_prev(e){const t=this.selection_line.indexOf(e);if(t>0)return this.selection_line[t-1]}get_scope_info(){let e=this.focus_cube.level;const t=this.focus_cube.pcube,n=[],r=[];for(let t of this.selection_line){const i=t.level,s=t.index;i===e&&(n.push(t),r.push(s))}return{cube:t,range:[Math.min(...r),Math.max(...r)+1],from:this.id}}remove(){this.root.remove_scope(this.id),this.event.emit_status_update()}find_scope_lines(){const e=this.root.get_scope_cubes(),t=[],n=[];for(let n of e)t.push(...l.I.get_flat_cube(n.cube));for(let e of t)e instanceof i.gK&&n.push(e);return n}find_inline_data(){const e=[],t=this.find_scope_lines();for(let n of t)e.push(...n.children);return e}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:o.Mu.scope,version:1}}}},4926:(e,t,n)=>{"use strict";n.d(t,{f:()=>y});var r=n(4116),i=n(9513),s=n(4089),o=n(3972),a=n(7633),l=n(3028);function c(e,t,n,r){e.stopPropagation(),e.preventDefault(),r.isdown=!0,r.dir=n,r.dom=t.dom;const i=e.currentTarget,s=i.parentElement?.parentElement;r.x=e.clientX,r.width_origin=t.css.width,t.css.width?(r.width=Number.parseInt(t.css.width.trim().slice(0,-2)),r.width_result=r.width):s&&(r.width=s?.getBoundingClientRect().width,r.width_result=r.width)}var d=n(2551),u=n(4430);const h=["id","data-type"],p={class:"tools-left"},m={class:"tools-right"},f=["src","loading"],_=(0,s.pM)({__name:"cube-img",props:{cube:{}},setup(e){const{root:t,stats:n}=e.cube,_={isdown:!1,ismove:!1,x:0,width:-1,dir:"left",width_origin:500},g=t.id,b=d.F.url,y=t=>c(t,e.cube,"left",_),v=t=>c(t,e.cube,"right",_),w=t=>function(e,t,n){if(!n.isdown||!n.dom)return;n.ismove=!0,e.preventDefault();const r="left"===n.dir?1:-1,i=e.clientX-n.x,s=Math.abs(n.width-i*r);t.data.css.width=s+"px",n.width_result=s}(t,e.cube,_),x=t=>function(e,t,n){if(n.width===n.width_result||!n.isdown||!n.ismove)return;n.isdown=!1,n.ismove=!1,t.data.css.width=n.width_origin;const{courier:i,history:s}=t.root,o=new l.vk(i);o.tell(t,r.VL.set_css(t.id,{width:n.width_result+"px"})),s.record(o)}(0,e.cube,_),k=t=>function(e,t,n){if(n.width===n.width_result||!n.isdown||!n.ismove)return;n.isdown=!1,n.ismove=!1,t.data.css.width=n.width_origin;const{courier:i,history:s}=t.root,o=new l.vk(i);o.tell(t,r.VL.set_css(t.id,{width:n.width_result+"px"})),s.record(o)}(0,e.cube,_);function S(t){const n=t.currentTarget.parentElement;Object.assign(n.style,e.cube.css),n.classList.add("cube-img-load-failed")}return(0,s.sV)(()=>{document.documentElement.addEventListener("pointermove",w),document.documentElement.addEventListener("pointerup",x),document.documentElement.addEventListener("pointercancel",k)}),(0,s.hi)(()=>{document.documentElement.removeEventListener("pointermove",w),document.documentElement.removeEventListener("pointerup",x),document.documentElement.removeEventListener("pointercancel",k)}),(r,l)=>((0,s.uX)(),(0,s.CE)("div",{class:"cube-img",style:(0,o.Tr)(r.cube.css),id:r.cube.id,"data-type":(0,a.R1)(i.u0).img,onContextmenu:l[0]||(l[0]=e=>(0,a.R1)(u.uz)(e,r.cube))},[(0,s.Lk)("div",p,[(0,s.Lk)("div",{class:"dragger",onPointerdown:y},null,32)]),(0,s.Lk)("div",m,[(0,s.Lk)("div",{class:"dragger",onPointerdown:v},null,32)]),(0,s.Lk)("img",{style:(0,o.Tr)(r.cube.css),src:t.isdev?e.cube.info:b?b(g,"image",e.cube.info):void 0,alt:"",onErrorOnce:S,loading:(0,a.R1)(n).mode===(0,a.R1)(i.fv).export?"eager":"lazy"},null,44,f),(0,s.Q3)(' <div class="tools-img">\r\n <div class="iconfont icon-floatleft" @click="() => float(\'L\')"></div>\r\n <div class="iconfont icon-floatright" @click="() => float(\'R\')"></div>\r\n <div class="iconfont icon-close" @click="clear"></div>\r\n </div> ')],44,h))}}),g=(0,n(6743).A)(_,[["__scopeId","data-v-400e35f7"]]);var b=n(8631);class y extends r._D{_component=g;_children=[];get is_empty(){return 0===this.data.info.trim().length}get children(){return this._children}get meta(){return y.meta}get component(){return this._component}constructor(e,t){super(e,t);const n=this.setup(e,t),r=this.clipboard.pasted_from;return r&&this.event.emit_asset_copy(r.noteid,"image",e.info),n}build_child(){}update_data(e){const t=this.versions[this.meta.type];return t>this.meta.version?{data:e,usable:!1}:(1===t&&e.info.startsWith("image://")&&(e.info=e.info.slice(8)),{data:e,usable:!0})}float(e){const{courier:t}=this.root,n={float:"L"===e?"inline-start":"inline-end"},i=t.get_recorder(),s=r.VL.set_css(this.id,n,!0);return i.tell(this,s),i}clear_float(){const{courier:e}=this.root,t=e.get_recorder(),n=r.VL.set_css(this.id,{float:null},!0);return t.tell(this,n),t}gc(){super.base_gc()}export(){return this.base_export()}replace_id(e,t={}){return y.replace_id(this.root,e,t)}static get meta(){return{type:i.u0.img,cubename:"图片",block:!1,version:2,show:!1}}static replace_id(e,t,n={}){const r=t.id,i=b.I.get_id();return n[r]=i,t.id=i,t}static get_default(e="",t={},n={}){return{id:b.I.get_id(),type:i.u0.img,info:e,css:t,attrs:n}}}},6517:(e,t,n)=>{"use strict";n.d(t,{F:()=>h});var r=n(4743),i=n(4116),s=n(4926),o=n(6753),a=n(3028),l=n(9513),c=n(8631),d=n(2551),u=n(4089);class h extends o.K{_copy_data=[];_img_mime=["image/png","image/jpeg","image/gif"];_paste_stack=[];get pasted_from(){return this._paste_stack[this._paste_stack.length-1]}get copy_data(){return[...this._copy_data]}get meta(){return h.meta}constructor(e){super(e)}async copy(e){const{root:t,cursor:n}=this;return t.scope_count_normal>0?this.copy_scope(e):this.copy_selection(e)}async copy_selection(e){const{root:t,cursor:n}=this;if(n.has_selection){this._copy_data=n.find_inline_data();let r=n.get_selection_text();const i={noteid:t.id,cubedata:this._copy_data},s=JSON.stringify(i);return e.setData("application/json",s),e.setData("text/plain",r),!0}{const{cube_end:r}=n;if(!r)return!1;const i=[r.export()];this._copy_data=i;let s="";for(let e of this._copy_data)e.type===l.u0.text&&(s+=e.info);const o={noteid:t.id,cubedata:i},a=JSON.stringify(o);return e.setData("application/json",a),e.setData("text/plain",s),!0}}async copy_scope(e){const t=d.F.tips;if(0===this.root.scope.size)return t?.tip_info("无块选区,未复制内容"),!1;if(0===this.root.scope_count_normal)return t?.tip_info("无正常块选区,未复制内容"),!1;const n=this.root.get_scope_cubes();this.root.clear_scope();const r=[];let i="";for(let e of n){for(let t of e.cube.children.slice(...e.range))i+=t.text;r.push(...e.cube.copy(...e.range))}this._copy_data=r;const s={noteid:this.root.id,cubedata:this._copy_data},o=JSON.stringify(s);return e.setData("application/json",o),e.setData("text/plain",i),!0}set_clipboard_cubedata(e,t){const n={noteid:this.root.id,cubedata:t},r=JSON.stringify(n),i=(new TextEncoder).encode(r),s=JSON.stringify([...i]),o=new Blob([e],{type:"text/plain"}),a=new Blob([s],{type:"text/html"}),l=new ClipboardItem({[o.type]:o,[a.type]:a});return this.set_clipboard_data(l)}async paste(e){const{cursor:t,courier:n}=this,r=e.items,i=n.get_recorder();let s=[];i.merge(this.delete()),await(0,u.dY)();for(let e=0;e<r.length;e++){const t=r[e];if(t.type.startsWith("image")){const e=t.getAsFile();e&&s.push(e)}}if(s.length>0){for(let e of s){const t=await this.paste_img(e);i.merge(t)}return i}const o=e.getData("application/json");if(o){let e=!1;try{const t=JSON.parse(o);if(t&&t.cubedata&&t.noteid)return this._paste_stack.push(t),e=!0,i.merge(this.paste_cubes(t.cubedata)),i}catch(e){}finally{e&&this._paste_stack.pop()}}const a=e.getData("text/html");if(a)try{const e=(new DOMParser).parseFromString(a,"text/html").body.textContent.trim(),t=JSON.parse(e),n=new Uint8Array(t),r=(new TextDecoder).decode(n),s=JSON.parse(r);let o=!1;try{if(s&&s.cubedata&&s.noteid)return this._paste_stack.push(s),o=!0,i.merge(this.paste_cubes(s.cubedata)),i}catch(e){}finally{o&&this._paste_stack.pop()}}catch(e){console.error("🟥paste",e)}const l=e.getData("text/plain");if(l){const e=this.get_cubedata_from_text(l);return i?.merge(),i.merge(this.paste_cubes(e)),i}return i}get_cubedata_from_text(e){const t=e.replace("\r","").split("\n"),n=[];if(1===t.length){const e=r.P6.get_default(t[0]);n.push(e)}else for(let e of t){if(!e.trim())continue;const t=r.gK.get_default_by_string(e);n.push(t)}return n}paste_cubes(e){if(0===e.length)return;const{courier:t,history:n,cursor:r}=this,s=new a.vk(t),{cube_selection:o,cube_end:l,cube_start:d,offset_start:u,offset_end:h}=r;if(!o||!l||!d)return;r.has_selection&&s.tell(o,i.VL.delete(o.id,"backward",d.id,l.id,u,h,!0));const p=c.I.replace_id(this.root,e);return s.tell(d,i.VL.insert(d.id,p,d.id,d.id,u,u)),s}async paste_img(e){const{courier:t,history:n,cursor:r}=this,o=new a.vk(t),{cube_selection:l,cube_end:c,cube_start:d,offset_start:u,offset_end:h}=r;if(!l||!c||!d)return;const p=s.f.get_default();if(this.root.isdev)p.info=URL.createObjectURL(e),o.tell(c,i.VL.insert(c.id,[p],d.id,c.id,u,h));else{const t=p.id+".png",n=t;await this.event.emit_asset_save("image",t,e),p.info=n,o.tell(c,i.VL.insert(c.id,[p],d.id,c.id,u,h))}return o}delete(){const{root:e,courier:t,cursor:n}=this;return e.scope_count_normal>0?this.delete_scope():n.has_selection?this.delete_selection():void 0}delete_selection(){const{courier:e,cursor:t,history:n}=this,r=new a.vk(e),{cube_end:s,cube_start:o,cube_selection:l,offset_start:c,offset_end:d}=t;if(!l||!s||!o)return;const u=o.id,h=s.id,p=l.id,m=i.VL.delete(p,"backward",u,h,c,d);return r.tell(l,m),r}delete_scope(){const e=d.F.tips,{root:t,courier:n,history:r,cursor:i}=this;if(0===t.scope.size)return void e?.tip_info("无块选区");if(0===t.scope_count_normal)return void e?.tip_info("无常规块选区");const s=new a.vk(n),o=this._root.get_scope_cubes(),l=new Map;for(let e of o){let t=l.get(e.cube);t?t.push(e.range):l.set(e.cube,[e.range])}const c=new Set;for(let[e,t]of l){const n=e.children;for(let e of t){const t=n.slice(e[0],e[1]);for(let e of t)c.add(e)}for(let e of c)s.merge(e.remove_self())}return this.root.clear_scope(),s}cut(e){const{root:t,courier:n,cursor:r}=this;t.scope_count_normal>0?this.cut_scope(e):this.cut_selection(e)}cut_scope(e){const{root:t,courier:n,history:r,cursor:i}=this,s=d.F.tips;if(0===t.scope.size)return s?.tip_info("无块选区"),!1;if(0===t.scope_count_normal)return s?.tip_info("无常规块选区"),!1;const o=new a.vk(n),c=this._root.get_scope_cubes(),u=new Map;for(let e of c){let t=u.get(e.cube);t?t.push(e.range):u.set(e.cube,[e.range])}const h=[];for(let[e,t]of u){const n=new Set;e.children;for(let r of t){const t=e.children.slice(r[0],r[1]);for(let e of t)n.add(e);h.push(...e.copy(...r))}for(let e of n)o.merge(e.remove_self())}this._copy_data=h;let p="";for(let e of this._copy_data)e.type===l.u0.text&&(p+=e.info);const m={noteid:this.root.id,cubedata:h},f=JSON.stringify(m);e.setData("text/plain",p),e.setData("application/json",f),this.root.clear_scope(),r.record(o)}cut_selection(e){const{courier:t,cursor:n,history:r}=this,s=new a.vk(t),{cube_end:o,cube_start:c,cube_selection:d,offset_start:u,offset_end:h}=n;if(d&&o&&c)if(n.has_selection){this._copy_data=n.find_inline_data();let t="";for(let e of this._copy_data)e.type===l.u0.text&&(t+=e.info);const a={noteid:this.root.id,cubedata:this._copy_data},p=JSON.stringify(a);e.setData("text/plain",t),e.setData("application/json",p);const m=c.id,f=o.id,_=d.id,g=i.VL.delete(_,"backward",m,f,u,h);s.tell(d,g),r.record(s)}else{const t=o.export();this._copy_data=[t];let n="";for(let e of this._copy_data)e.type===l.u0.text&&(n+=e.info);const a={noteid:this.root.id,cubedata:this._copy_data},c=JSON.stringify(a);e.setData("text/plain",n),e.setData("application/json",c);const d=o.pcube,u=o.index,h=i.VL.delete_child(d.id,"backward",[u,u+1]);s.tell(d,h),r.record(s)}}set_clipboard_data(e){return new Promise((t,n)=>{navigator.clipboard?navigator.clipboard.write([e]).then(e=>t(!0)).catch(e=>{t(!1),console.error("写入粘贴板数据失败",e)}):t(!1)})}read_clipboard(){return new Promise(e=>{navigator.clipboard?navigator.clipboard.read().then(async t=>{const n=new Map;for(let e of t)if(e instanceof ClipboardItem){const t=e.types;for(let r of t)await e.getType(r).then(async e=>n.set(e.type,e))}e(n)}):e(new Map)})}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:l.Mu.clipboard,version:1}}}},6743:(e,t)=>{"use strict";t.A=(e,t)=>{const n=e.__vccOpts||e;for(const[e,r]of t)n[e]=r;return n}},6753:(e,t,n)=>{"use strict";n.d(t,{K:()=>i});var r=n(4743);class i{_root;get root(){return this._root}get doc(){const e=this.root;if(e instanceof r.oY)return e}get courier(){return this.root.courier}get history(){return this.root.history}get cursor(){return this.root.cursor}get event(){return this.root.event}get listener(){return this.root.listener}get clipboard(){return this.root.clipboard}get painter(){return this.root.painter}get cubes(){return this.root.cubes}get config(){return this.root.config}get stats(){return this.root.stats}get hotkeys(){return this.root.hotkeys}constructor(e){this._root=e}}},7084:(e,t,n)=>{"use strict";n.d(t,{T:()=>k});var r=n(3923),i=n(9513),s=n(4116),o=n(7552);class a extends r.K{_interaction;scope_down=null;fig_matrix_origin;pos_down_real;flow=!1;m;constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:fig-drag"}reset_status(){this.flow=!1}down(e,t){this.scope_down=t;const{selector:n}=t;"fig"===n.type&&this.map.interaction.check_mouse_key(e,"mid")&&(e.stopPropagation(),e.preventDefault(),this.pos_down_real=this.map.view_point_to_real(t.pos),this.flow=!0,this.fig_matrix_origin={...this.map.matrix2d})}move(e){if(!this.flow||!this.scope_down||!this._interaction.check_mouse_key(e,"mid"))return;e.stopPropagation(),e.preventDefault();const{map_sum_scale:t}=this.scope_down,n=e.clientX,r=e.clientY,i=(n-this.scope_down.pos.x)/t.sx,s=(r-this.scope_down.pos.y)/t.sy;this.m=o.c.multiply(this.fig_matrix_origin,o.c.get_matrix_translate(i,s)),this.map.reset_matrix(this.m)}up(e){if(!this.flow)return this.reset_status();e.stopPropagation(),e.preventDefault();const t=this.courier.get_recorder();t.tell(this.map,s.VL.set_attr(this.map.id,{matrix2d:this.m})),this.history.record(t),this.flow=!1,this.map.check_show()}cancel(e){this.flow&&(this.flow=!1,this.map.check_show())}leave(e){this.flow&&(this.flow=!1,this.map.check_show())}wheel(e){}dblclick(e){}contextmenu(e){}}class l extends r.K{_interaction;constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:fig-scale"}down(e,t){}move(e){}up(e){}cancel(e){}leave(){}wheel(e){if(!e.ctrlKey)return;e.stopPropagation(),e.preventDefault();const{map_scale_step:t}=this.config.data,n=e.deltaY,r=-Math.sign(n),i={x:e.clientX,y:e.clientY},s=r*t;this.map.scale_by_point(i,s,s),this.map.check_show_throttle()}dblclick(e){}contextmenu(e){}}class c extends r.K{_interaction;count=0;constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:fig-wheel"}down(e,t){}move(e){}up(e){}cancel(e){}leave(){}wheel(e){e.stopPropagation(),e.preventDefault(),this.count++;const t=-Math.sign(e.deltaY)*this.config.data.scroll_distance;if(!e.ctrlKey){if(e.shiftKey){const e=o.c.multiply(this.map.matrix2d,o.c.get_matrix_translate(t,0));this.map.reset_matrix(e)}else{const e=o.c.multiply(this.map.matrix2d,o.c.get_matrix_translate(0,t));this.map.reset_matrix(e)}this.map.check_show_throttle()}}dblclick(e){}contextmenu(e){}}var d=n(4743),u=n(1068);class h extends r.K{_interaction;down_point;view_cubes=[];flow=!1;count=0;rate=5;constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:line-delete"}reset(){this.flow=!1,this.map.placeholder.line_delete="",this.view_cubes=[]}down(e,t){const{selector:n,pos:r}=t;this.stats.is_read_mode||"fig"===n.type&&this.map.interaction.check_mouse_key(e,"right")&&(e.stopPropagation(),e.preventDefault(),this.flow=!0,this.down_point=this.map.view_point_to_real(r),this.view_cubes=this.map.get_view_cube())}move(e){if(!this.flow)return;e.stopPropagation(),e.preventDefault(),this.count++;const t={x:e.clientX,y:e.clientY},n=this.map.view_point_to_real(t);if(this.map.placeholder.line_delete=d.sf.line(this.down_point,n),this.count%this.rate!==0)return;this.count=1,this.map.clear_delete_line();const r={from:this.down_point,to:n};for(let e of this.view_cubes)if(e instanceof s.wP){let t=e.sample[0];for(let n of e.sample.slice(1)){const i={from:t,to:n};if(u.MathLine.check_intersection(i,r)){this.map.put_delete_selected(e);break}t=n}}else if(e instanceof d.R$){let t=e.sample[0];for(let n of e.sample.slice(1)){const i={from:t,to:n};if(u.MathLine.check_intersection(i,r)){this.map.put_delete_selected(e);break}t=n}}}up(e){if(!this.flow)return;e.stopPropagation(),e.preventDefault();const{courier:t,history:n}=this.root,r=t.get_recorder(),i=this.map.id,o=[],a=[],l=this.map.get_delete_selected();for(let e of l)e instanceof s.wP?o.push(e.id):e instanceof d.R$&&a.push(e.id);const c=s.yc.node_remove(i,o),u=s.yc.linker_remove(i,a);r.tell(this.map,c,u),n.record(r),this.reset()}cancel(e){this.reset()}leave(){}wheel(e){}dblclick(e){}contextmenu(e){}}class p extends r.K{_interaction;flow=!1;constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:node-add"}down(e,t){}move(e){}up(e){this.flow&&(this.flow=!1)}cancel(e){this.flow}wheel(e){}leave(){}dblclick(e,t){const{selector:n,pos:r}=t;if("fig"!==n.type)return;e.stopPropagation(),e.preventDefault();const{courier:i,history:o}=this,a=s.wP.get_default_node_pos(r,this.map),l=[d.gL.get_default(a)],c=s.yc.node_add(this.map.id,l),u=i.get_recorder();u.tell(this.map,c),o.record(u)}contextmenu(e){}}class m extends r.K{_interaction;flow=!1;point_down;count=0;rate=10;constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:node-box-selected"}reset(){this.flow=!1,this.map.placeholder.box_selector=""}down(e,t){const{pos:n,selector:r}=t,{type:i,res:s}=r;"fig"===i&&this._interaction.check_mouse_key(e,"left")&&(e.preventDefault(),this.flow=!0,this.point_down=this.map.view_point_to_real(n))}move(e){if(!this.flow)return;this.count++,e.preventDefault();const t={x:e.clientX,y:e.clientY},n=this.map.view_point_to_real(t),r=this.get_rect_area(this.point_down,n);if(this.map.placeholder.box_selector=r,this.count%this.rate!==0)return;this.count=1;const i={x:Math.min(this.point_down.x,n.x),y:Math.min(this.point_down.y,n.y),width:Math.abs(n.x-this.point_down.x),height:Math.abs(n.y-this.point_down.y)},s=this.map.get_nodes_intersection(i);this.map.clear_node_selected();for(let e of s)this.map.register_node_selected(e)}up(e){this.flow&&(e.stopPropagation(),e.preventDefault(),this.reset())}cancel(e){this.flow&&this.reset()}wheel(e){}leave(){}dblclick(e,t){}contextmenu(e){}get_rect_area(e,t,n=4){const r=t.x-e.x,i=t.y-e.y,s=Math.sign(r)*n,o=Math.sign(i)*n,a=e,l=a.x+r,c=a.y,d=t,u=a.x,h=a.y+i;return`M${a.x+s} ${a.y}H${l-s}Q${l} ${c} ${l} ${c+o}V${d.y-o}Q${d.x} ${d.y} ${d.x-s} ${d.y}H ${u+s}Q${u} ${h} ${u} ${h-o}V${a.y+o}Q${a.x} ${a.y} ${a.x+s} ${a.y}Z`}check_intersection(e,t){const n=e.x+e.width/2,r=e.y+e.height/2,i=t.x+t.width/2,s=t.y+t.height/2,o=Math.abs(n-i),a=Math.abs(r-s);return o<=(e.width+t.width)/2&&a<=(e.height+t.height)/2}}class f extends r.K{_interaction;flow=!1;constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:node-click-select"}down(e,t){const{selector:n,pos:r}=t,{type:i,res:s}=n;"node"!==i||n.res.editable||(e.stopPropagation(),e.preventDefault(),e.ctrlKey||this.map.clear_node_selected(),s.pcube.toggle_node_selected(s))}move(e){this.flow}up(e){this.flow}leave(e){}cancel(e){}wheel(e){}dblclick(e){}contextmenu(e){}}class _ extends r.K{_interaction;down_node;down_pos;matrix=new Map;matrix_translate=o.c.get_matrix_translate(0,0);scope_down;flow=!1;recover_select=!1;has_down=!1;view_cubes=[];near;intention="none";constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:node-drag"}reset_status(){this.recover_select=!1,this.matrix.clear(),this.flow=!1,this.has_down=!1,this._interaction.info_node_drag.show=!1,this.view_cubes=[]}down(e,t){this.scope_down=t;const{selector:n,pos:r,selected_nodes:i,view_cubes:s}=t;if("node"===n.type&&this.map.interaction.check_mouse_key(e,"left")&&!n.res.editable)if(e.stopPropagation(),e.preventDefault(),this.reset_status(),this.has_down=!0,this.view_cubes=s,this.down_node=n.res,this.down_pos=this.map.view_point_to_real(r),i.has(this.down_node))for(let e of i)this.matrix.set(e,{...e.matrix2d});else this.matrix.set(this.down_node,{...this.down_node.matrix2d})}move(e){if(!this.has_down||!this.map.interaction.check_mouse_key(e,"left")||!this.down_pos)return;this.flow=!0,e.preventDefault();const t=this._interaction.info_node_drag,n={x:e.clientX,y:e.clientY},r=this.map.view_point_to_real(n),i=r.x-this.down_pos.x,s=r.y-this.down_pos.y;if(!this.recover_select){this.map.clear_node_selected();for(let[e]of this.matrix)this.map.register_node_selected(e);this.recover_select=!0}t.show=!1,this.matrix_translate=o.c.get_matrix_translate(i,s);for(let[e,t]of this.matrix){if(!t||e.is_captive)continue;const n=o.c.multiply(t,this.matrix_translate);e.reset_matrix(n)}}up(e){if(!this.flow)return this.reset_status();e.stopPropagation(),e.preventDefault();const{courier:t,history:n}=this,r=t.get_recorder();if(e.ctrlKey);else{const e=[];for(let[t,n]of this.matrix){if(!n)continue;t.reset_matrix(n),t.is_layout_root&&t.layout_type&&e.push(t);const i=o.c.multiply(n,this.matrix_translate);r.tell(t,s.VL.set_attr(t.id,{matrix2d:i}))}n.record(r);const t=this.map.get_view_rect();for(let n of e)n.layout_throttle(t)}this.reset_status()}cancel(e){this.flow&&this.reset_status()}leave(){}wheel(e){}dblclick(e){}contextmenu(e){}}class g extends r.K{_interaction;constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:node-edit"}down(e,t){}move(e){}up(e){}leave(){}cancel(e){}wheel(e){}dblclick(e,t){const{selector:n,pos:r}=t;"node"===n.type&&(e.stopPropagation(),e.preventDefault(),n.res.editable=!0)}contextmenu(e){}}class b extends r.K{_interaction;constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:node-edit-exit"}down(e,t){const{selector:n}=t,{type:r,res:i}=n;"fig"!==r&&"empty"!==r||(e.stopPropagation(),e.preventDefault(),this.cubes.clear_all_map_selected(),this.map.clear_node_editing())}move(e){}up(e){}leave(){}cancel(e){}wheel(e){}dblclick(e,t){}contextmenu(e){}}var y=n(2551);class v extends r.K{_interaction;down_node;flow=!1;selected_nodes=new Set;recorver_selected=!1;has_down=!1;constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:node-line"}reset_status(){this.flow=!1,this.has_down=!1,this.selected_nodes.clear(),this.map.placeholder.linker=[],this.recorver_selected=!1}down(e,t){const{selector:n,pos:r,selected_nodes:i}=t;if("node"===n.type&&this._interaction.check_mouse_key(e,"right"))if(this.reset_status(),this.has_down=!0,e.preventDefault(),e.stopPropagation(),this.down_node=n.res,i.has(this.down_node))for(let e of i)this.selected_nodes.add(e);else this.selected_nodes.add(this.down_node)}move(e){if(!this._interaction.check_mouse_key(e,"right")||!this.has_down)return;this.flow=!0,e.stopPropagation(),e.preventDefault();const t=this._interaction.get_map_selector(e),{res:n,type:r}=t;this.map.placeholder.linker=[];const i=this.map.config.data.map_linker_line;if(!this.recorver_selected){this.recorver_selected=!0,this.map.clear_node_selected();for(let e of this.selected_nodes)this.map.register_node_selected(e)}if("node"===r)for(let e of this.selected_nodes){const{from:t,to:r}=o.U.find_closest_points(e.sample,n.sample);this.map.placeholder.linker.push(d.sf.get_line(t,r,i))}else{const t={x:e.clientX,y:e.clientY},n=this.map.view_point_to_real(t);for(let e of this.selected_nodes){const t=o.U.find_closet_point(e.sample,n);this.map.placeholder.linker.push(d.sf.get_line(t,n,i))}}}up(e){if(!this.flow)return this.reset_status();e.preventDefault(),e.stopPropagation();const{courier:t,history:n}=this,r=this._interaction.get_map_selector(e),{res:i,type:a}=r;if("node"===a){if(i===this.down_node)return;const e=t.get_recorder();for(let t of this.selected_nodes){const n=this.map.get_linker_id(t.id,i.id);if(this.map.get_linker(n))y.F.tips?.tip_warning("已存在连接线");else{const n=o.U.create_linker_info(this.map,t.id,i.id),r=s.yc.linker_add(this.map.id,[n]);e.tell(this.map,r)}}n.record(e)}else if("fig"===a){const{courier:t,history:n}=this,r=t.get_recorder(),i=s.wP.get_default_node_pos({x:e.clientX,y:e.clientY},this.map),a=d.gL.get_default(i),l=s.yc.node_add(this.map.id,[a]);r.tell(this.map,l);for(let e of this.selected_nodes){const t=this.map.get_linker_id(e.id,a.id);if(this.map.get_linker(t)){y.F.tips?.tip_warning("已存在连接线");continue}const n=o.U.create_linker_info(this.map,e.id,a.id),i=s.yc.linker_add(this.map.id,[n]);r.tell(this.map,i)}n.record(r)}this.reset_status()}leave(){}cancel(e){this.reset_status()}wheel(e){}dblclick(e,t){}contextmenu(e){e.preventDefault()}}var w=n(7633),x=n(8631);class k extends r.K{_map;interactions_pointer=[];interaction_keyboard=[];constructor(e){super(e.root),this._map=e,this.interactions_pointer.push(new a(this)),this.interactions_pointer.push(new l(this)),this.interactions_pointer.push(new c(this)),this.interactions_pointer.push(new g(this)),this.interactions_pointer.push(new b(this)),this.interactions_pointer.push(new p(this)),this.interactions_pointer.push(new v(this)),this.interactions_pointer.push(new _(this)),this.interactions_pointer.push(new m(this)),this.interactions_pointer.push(new h(this)),this.interactions_pointer.push(new f(this))}info_node_drag=(0,w.Kh)({show:!1,count:0,x:0,y:0});get map(){return this._map}register(e){e.addEventListener("pointerdown",this.pointerdown.bind(this)),e.addEventListener("pointermove",this.pointermove.bind(this)),e.addEventListener("pointerup",this.pointerup.bind(this)),e.addEventListener("pointercancel",this.pointercancel.bind(this)),e.addEventListener("pointerleave",this.pointerleave.bind(this)),e.addEventListener("wheel",this.wheel.bind(this)),e.addEventListener("dblclick",this.dblclick.bind(this)),e.addEventListener("contextmenu",this.contextmenu.bind(this))}check_mouse_key(e,t){return x.I.check_mouse_key(e,t)}get_map_selector(e){let t=e.target;for(;t&&t!==document.body;){const e=t.dataset.type,n=t.id;if(n&&e){if(e===i.u0.node){const e=this.map.get_node(n);if(e)return{type:"node",res:e}}else if(e===i.u0.linker){const e=this.map.get_linker(n);if(e)return{type:"linker",res:e}}else if(e===i.u0.map||e===i.u0.submap)return{type:"fig",res:this.map};t=t.parentElement}else t=t.parentElement}return{type:"empty",res:void 0}}pointerdown(e){const t={selector:this.get_map_selector(e),pos:{x:e.clientX,y:e.clientY},selected_nodes:this.map.get_nodes_selected(),view_cubes:this.map.get_view_cube(),map_sum_scale:this.map.get_upstream_sum_scale()},{selector:n}=t,{res:r,type:i}=n;if("node"===i&&this.root.isdev){this.map.nodes_test[r.id]=r,console.log("------------------------------------节点信息");const t=r.bound;console.log("id",r.id),console.log("matrix:",{...t.matrix2d}),console.log("pos:",t.pos),console.log("pos_tree:",t.pos_tree),console.log("size_bound:",t.size_bound),console.log("size_tree:",t.size_tree),console.log("fig_pos:",r.pcube.real_point_to_fig(t.pos)),console.log("view_pos:",r.pcube.real_point_to_view(t.pos)),console.log("to_size",r.to.size),console.log("in_size",r.from.size),console.log("节点",r),this.check_mouse_key(e,"mid")&&r.a()}for(let n of this.interactions_pointer)n.down(e,t);"fig"===t.selector.type&&this.event.emit_fig_click(e)}pointermove(e){for(let t of this.interactions_pointer)t.move(e)}pointerup(e){for(let t of this.interactions_pointer)t.up(e)}pointercancel(e){for(let t of this.interactions_pointer)t.cancel(e)}pointerleave(e){for(let t of this.interactions_pointer)t.leave(e)}dblclick(e){const t={selector:this.get_map_selector(e),pos:{x:e.clientX,y:e.clientY},selected_nodes:this.map.get_nodes_selected(),view_cubes:this.map.get_view_cube(),map_sum_scale:this.map.get_upstream_sum_scale()};for(let n of this.interactions_pointer)n.dblclick(e,t)}wheel(e){e.preventDefault(),e.stopImmediatePropagation();for(let t of this.interactions_pointer)t.wheel(e)}contextmenu(e){for(let t of this.interactions_pointer)t.contextmenu(e)}}},7552:(e,t,n)=>{"use strict";n.d(t,{U:()=>s,c:()=>r});class r{static get_default(){return{a:1,b:0,c:0,d:1,e:0,f:0}}static to_array(e){return[e.a,e.b,e.c,e.d,e.e,e.f]}static is_default(e){return 1===e.a&&0===e.b&&0===e.c&&1===e.d&&0===e.e&&0===e.f}static get_matrix(e,t,n,r,i,s){return{a:e,b:t,c:n,d:r,e:i,f:s}}static get_matrix_translate(e,t){return{a:1,b:0,c:0,d:1,e,f:t}}static get_matrix_scale(e,t){return{a:e,b:0,c:0,d:t,e:0,f:0}}static get_matrix_reflection_horizental(){return{a:1,b:0,c:0,d:-1,e:0,f:0}}static get_matrix_reflection_vertical(){return{a:-1,b:0,c:0,d:1,e:0,f:0}}static multiply(e,t){return{a:t.a*e.a+t.c*e.b,b:t.b*e.a+t.d*e.b,c:t.a*e.c+t.c*e.d,d:t.b*e.c+t.d*e.d,e:t.a*e.e+t.c*e.f+t.e,f:t.b*e.e+t.d*e.f+t.f}}static translate(e,t,n){const r=this.get_matrix_translate(t,n);return this.multiply(e,r)}static get_dom_string(e){const{a:t,b:n,c:r,d:i,e:s,f:o}=e;return`matrix(${t.toFixed(1)},${n},${r},${i.toFixed(1)},${s.toFixed(1)},${o.toFixed(1)})`}static map_point_to_view(e,t){return{x:e.x+t.x,y:e.y+t.y}}static view_point_to_map(e,t){return{x:e.x-t.x,y:e.y-t.y}}}var i=n(4743);class s{static path=document.createElementNS("http://www.w3.org/2000/svg","path");static svg_path_sample(e,t=24){if(!e||t<2)return[];this.path.setAttribute("d",e);const n=[],r=this.path.getTotalLength()/t;for(let e=0;e<=t;e++){const t=e*r,i=this.path.getPointAtLength(t);n.push({x:i.x,y:i.y})}return n}static get_line_k(e,t){const n=t.y-e.y,r=t.x-e.x;return 0===r?Number.POSITIVE_INFINITY:n/r}static find_closet_point(e,t){let n=1/0,r=e[0];const{x:i,y:s}=t;for(let t of e){let e=(i-t.x)**2+(s-t.y)**2;e<n&&(n=e,r=t)}return r}static offset_points(e,t){const n=[],{x:r,y:i}=t;for(let t of e)n.push({x:t.x+r,y:t.y+i});return n}static find_closest_points(e,t){let n=1/0,r=e[0],i=t[0];for(let s=0;s<e.length;s++){const o=e[s];for(let e=0;e<t.length;e++){const s=t[e],a=o.x-s.x,l=o.y-s.y,c=a*a+l*l;c<n&&(n=c,r=o,i=s)}}return{from:r,to:i}}static polygonCentroid(e){let t=0,n=0,r=0;const i=e.length;for(let s=0;s<i;s++){const{x:o,y:a}=e[s],{x:l,y:c}=e[(s+1)%i],d=o*c-l*a;r+=d,t+=(o+l)*d,n+=(a+c)*d}return r*=.5,t/=6*r,n/=6*r,{x:t,y:n}}static get_polygon_area(e){let t=0;const n=e.length;for(let r=0;r<n;r++){const{x:i,y:s}=e[r],{x:o,y:a}=e[(r+1)%n];t+=i*a-o*s}return t/2}static find_line_to_layout_root(e,t=new Set){if(e.is_layout_root)return{has_root:!0,line:[e]};t.add(e.id);for(let n of e.from){if(t.has(n))continue;const r=e.pcube.get_node(n);if(r){if(r.is_layout_root)return{has_root:!0,line:[e,r]};{const n=this.find_line_to_layout_root(r,t);if(n.has_root)return n.line.unshift(e),n}}}return{has_root:!1,line:[]}}static get_linker_id(e,t){return e+"-"+t}static wait_nodes_render(e){const t=[];for(let n of e)t.push(n.wait_layout_self());return Promise.all(t)}static create_linker_info(e,t,n){const r=e.get_node(t),s=e.get_node(n),o=r?.to.size||0,a=s?.from.size||0;return{linker:i.R$.get_default(t,n),index_from:a,index_to:o}}}},7633:(e,t,n)=>{"use strict";n.d(t,{C4:()=>k,EW:()=>Pe,Gc:()=>he,IG:()=>ve,IJ:()=>Ce,KR:()=>Se,Kh:()=>ue,Pr:()=>Ae,R1:()=>Le,Tm:()=>_e,X2:()=>l,a1:()=>xe,bl:()=>S,fE:()=>ge,g8:()=>fe,hV:()=>Be,hZ:()=>O,i9:()=>ke,ju:()=>be,lJ:()=>we,qA:()=>B,u4:()=>E,ux:()=>ye,wB:()=>Ie,yC:()=>o});var r=n(3972);let i,s;class o{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=i,!e&&i&&(this.index=(i.scopes||(i.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){let e,t;if(this._isPaused=!0,this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].pause();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){let e,t;if(this._isPaused=!1,this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].resume();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].resume()}}run(e){if(this._active){const t=i;try{return i=this,e()}finally{i=t}}}on(){1===++this._on&&(this.prevScope=i,i=this)}off(){this._on>0&&0===--this._on&&(i=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){let t,n;for(this._active=!1,t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();for(this.effects.length=0,t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){const e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0}}}const a=new WeakSet;class l{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,i&&i.active&&i.effects.push(this)}pause(){this.flags|=64}resume(){64&this.flags&&(this.flags&=-65,a.has(this)&&(a.delete(this),this.trigger()))}notify(){2&this.flags&&!(32&this.flags)||8&this.flags||h(this)}run(){if(!(1&this.flags))return this.fn();this.flags|=2,C(this),f(this);const e=s,t=w;s=this,w=!0;try{return this.fn()}finally{_(this),s=e,w=t,this.flags&=-3}}stop(){if(1&this.flags){for(let e=this.deps;e;e=e.nextDep)y(e);this.deps=this.depsTail=void 0,C(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){64&this.flags?a.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){g(this)&&this.run()}get dirty(){return g(this)}}let c,d,u=0;function h(e,t=!1){if(e.flags|=8,t)return e.next=d,void(d=e);e.next=c,c=e}function p(){u++}function m(){if(--u>0)return;if(d){let e=d;for(d=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;c;){let t=c;for(c=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,1&t.flags)try{t.trigger()}catch(t){e||(e=t)}t=n}}if(e)throw e}function f(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function _(e){let t,n=e.depsTail,r=n;for(;r;){const e=r.prevDep;-1===r.version?(r===n&&(n=e),y(r),v(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function g(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(b(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function b(e){if(4&e.flags&&!(16&e.flags))return;if(e.flags&=-17,e.globalVersion===M)return;if(e.globalVersion=M,!e.isSSR&&128&e.flags&&(!e.deps&&!e._dirty||!g(e)))return;e.flags|=2;const t=e.dep,n=s,i=w;s=e,w=!0;try{f(e);const n=e.fn(e._value);(0===t.version||(0,r.$H)(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{s=n,w=i,_(e),e.flags&=-3}}function y(e,t=!1){const{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)y(e,!0)}t||--n.sc||!n.map||n.map.delete(n.key)}function v(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let w=!0;const x=[];function k(){x.push(w),w=!1}function S(){const e=x.pop();w=void 0===e||e}function C(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const e=s;s=void 0;try{t()}finally{s=e}}}let M=0;class T{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class L{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!s||!w||s===this.computed)return;let t=this.activeLink;if(void 0===t||t.sub!==s)t=this.activeLink=new T(s,this),s.deps?(t.prevDep=s.depsTail,s.depsTail.nextDep=t,s.depsTail=t):s.deps=s.depsTail=t,z(t);else if(-1===t.version&&(t.version=this.version,t.nextDep)){const e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=s.depsTail,t.nextDep=void 0,s.depsTail.nextDep=t,s.depsTail=t,s.deps===t&&(s.deps=e)}return t}trigger(e){this.version++,M++,this.notify(e)}notify(e){p();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{m()}}}function z(e){if(e.dep.sc++,4&e.sub.flags){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)z(e)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const A=new WeakMap,R=Symbol(""),P=Symbol(""),N=Symbol("");function E(e,t,n){if(w&&s){let t=A.get(e);t||A.set(e,t=new Map);let r=t.get(n);r||(t.set(n,r=new L),r.map=t,r.key=n),r.track()}}function O(e,t,n,i,s,o){const a=A.get(e);if(!a)return void M++;const l=e=>{e&&e.trigger()};if(p(),"clear"===t)a.forEach(l);else{const s=(0,r.cy)(e),o=s&&(0,r.yI)(n);if(s&&"length"===n){const e=Number(i);a.forEach((t,n)=>{("length"===n||n===N||!(0,r.Bm)(n)&&n>=e)&&l(t)})}else switch((void 0!==n||a.has(void 0))&&l(a.get(n)),o&&l(a.get(N)),t){case"add":s?o&&l(a.get("length")):(l(a.get(R)),(0,r.CE)(e)&&l(a.get(P)));break;case"delete":s||(l(a.get(R)),(0,r.CE)(e)&&l(a.get(P)));break;case"set":(0,r.CE)(e)&&l(a.get(R))}}m()}function I(e){const t=ye(e);return t===e?t:(E(t,0,N),ge(e)?t:t.map(we))}function B(e){return E(e=ye(e),0,N),e}const D={__proto__:null,[Symbol.iterator](){return V(this,Symbol.iterator,we)},concat(...e){return I(this).concat(...e.map(e=>(0,r.cy)(e)?I(e):e))},entries(){return V(this,"entries",e=>(e[1]=we(e[1]),e))},every(e,t){return j(this,"every",e,t,void 0,arguments)},filter(e,t){return j(this,"filter",e,t,e=>e.map(we),arguments)},find(e,t){return j(this,"find",e,t,we,arguments)},findIndex(e,t){return j(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return j(this,"findLast",e,t,we,arguments)},findLastIndex(e,t){return j(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return j(this,"forEach",e,t,void 0,arguments)},includes(...e){return U(this,"includes",e)},indexOf(...e){return U(this,"indexOf",e)},join(e){return I(this).join(e)},lastIndexOf(...e){return U(this,"lastIndexOf",e)},map(e,t){return j(this,"map",e,t,void 0,arguments)},pop(){return q(this,"pop")},push(...e){return q(this,"push",e)},reduce(e,...t){return F(this,"reduce",e,t)},reduceRight(e,...t){return F(this,"reduceRight",e,t)},shift(){return q(this,"shift")},some(e,t){return j(this,"some",e,t,void 0,arguments)},splice(...e){return q(this,"splice",e)},toReversed(){return I(this).toReversed()},toSorted(e){return I(this).toSorted(e)},toSpliced(...e){return I(this).toSpliced(...e)},unshift(...e){return q(this,"unshift",e)},values(){return V(this,"values",we)}};function V(e,t,n){const r=B(e),i=r[t]();return r===e||ge(e)||(i._next=i.next,i.next=()=>{const e=i._next();return e.value&&(e.value=n(e.value)),e}),i}const H=Array.prototype;function j(e,t,n,r,i,s){const o=B(e),a=o!==e&&!ge(e),l=o[t];if(l!==H[t]){const t=l.apply(e,s);return a?we(t):t}let c=n;o!==e&&(a?c=function(t,r){return n.call(this,we(t),r,e)}:n.length>2&&(c=function(t,r){return n.call(this,t,r,e)}));const d=l.call(o,c,r);return a&&i?i(d):d}function F(e,t,n,r){const i=B(e);let s=n;return i!==e&&(ge(e)?n.length>3&&(s=function(t,r,i){return n.call(this,t,r,i,e)}):s=function(t,r,i){return n.call(this,t,we(r),i,e)}),i[t](s,...r)}function U(e,t,n){const r=ye(e);E(r,0,N);const i=r[t](...n);return-1!==i&&!1!==i||!be(n[0])?i:(n[0]=ye(n[0]),r[t](...n))}function q(e,t,n=[]){k(),p();const r=ye(e)[t].apply(e,n);return m(),S(),r}const $=(0,r.pD)("__proto__,__v_isRef,__isVue"),G=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>"arguments"!==e&&"caller"!==e).map(e=>Symbol[e]).filter(r.Bm));function X(e){(0,r.Bm)(e)||(e=String(e));const t=ye(this);return E(t,0,e),t.hasOwnProperty(e)}class K{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if("__v_skip"===t)return e.__v_skip;const i=this._isReadonly,s=this._isShallow;if("__v_isReactive"===t)return!i;if("__v_isReadonly"===t)return i;if("__v_isShallow"===t)return s;if("__v_raw"===t)return n===(i?s?de:ce:s?le:ae).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const o=(0,r.cy)(e);if(!i){let e;if(o&&(e=D[t]))return e;if("hasOwnProperty"===t)return X}const a=Reflect.get(e,t,ke(e)?e:n);return((0,r.Bm)(t)?G.has(t):$(t))?a:(i||E(e,0,t),s?a:ke(a)?o&&(0,r.yI)(t)?a:a.value:(0,r.Gv)(a)?i?pe(a):ue(a):a)}}class W extends K{constructor(e=!1){super(!1,e)}set(e,t,n,i){let s=e[t];if(!this._isShallow){const t=_e(s);if(ge(n)||_e(n)||(s=ye(s),n=ye(n)),!(0,r.cy)(e)&&ke(s)&&!ke(n))return t||(s.value=n),!0}const o=(0,r.cy)(e)&&(0,r.yI)(t)?Number(t)<e.length:(0,r.$3)(e,t),a=Reflect.set(e,t,n,ke(e)?e:i);return e===ye(i)&&(o?(0,r.$H)(n,s)&&O(e,"set",t,n):O(e,"add",t,n)),a}deleteProperty(e,t){const n=(0,r.$3)(e,t),i=(e[t],Reflect.deleteProperty(e,t));return i&&n&&O(e,"delete",t,void 0),i}has(e,t){const n=Reflect.has(e,t);return(0,r.Bm)(t)&&G.has(t)||E(e,0,t),n}ownKeys(e){return E(e,0,(0,r.cy)(e)?"length":R),Reflect.ownKeys(e)}}class Y extends K{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}const Z=new W,Q=new Y,J=new W(!0),ee=e=>e,te=e=>Reflect.getPrototypeOf(e);function ne(e){return function(...t){return"delete"!==e&&("clear"===e?void 0:this)}}function re(e,t){const n=function(e,t){const n={get(n){const i=this.__v_raw,s=ye(i),o=ye(n);e||((0,r.$H)(n,o)&&E(s,0,n),E(s,0,o));const{has:a}=te(s),l=t?ee:e?xe:we;return a.call(s,n)?l(i.get(n)):a.call(s,o)?l(i.get(o)):void(i!==s&&i.get(n))},get size(){const t=this.__v_raw;return!e&&E(ye(t),0,R),t.size},has(t){const n=this.__v_raw,i=ye(n),s=ye(t);return e||((0,r.$H)(t,s)&&E(i,0,t),E(i,0,s)),t===s?n.has(t):n.has(t)||n.has(s)},forEach(n,r){const i=this,s=i.__v_raw,o=ye(s),a=t?ee:e?xe:we;return!e&&E(o,0,R),s.forEach((e,t)=>n.call(r,a(e),a(t),i))}};return(0,r.X$)(n,e?{add:ne("add"),set:ne("set"),delete:ne("delete"),clear:ne("clear")}:{add(e){t||ge(e)||_e(e)||(e=ye(e));const n=ye(this);return te(n).has.call(n,e)||(n.add(e),O(n,"add",e,e)),this},set(e,n){t||ge(n)||_e(n)||(n=ye(n));const i=ye(this),{has:s,get:o}=te(i);let a=s.call(i,e);a||(e=ye(e),a=s.call(i,e));const l=o.call(i,e);return i.set(e,n),a?(0,r.$H)(n,l)&&O(i,"set",e,n):O(i,"add",e,n),this},delete(e){const t=ye(this),{has:n,get:r}=te(t);let i=n.call(t,e);i||(e=ye(e),i=n.call(t,e)),r&&r.call(t,e);const s=t.delete(e);return i&&O(t,"delete",e,void 0),s},clear(){const e=ye(this),t=0!==e.size,n=e.clear();return t&&O(e,"clear",void 0,void 0),n}}),["keys","values","entries",Symbol.iterator].forEach(i=>{n[i]=function(e,t,n){return function(...i){const s=this.__v_raw,o=ye(s),a=(0,r.CE)(o),l="entries"===e||e===Symbol.iterator&&a,c="keys"===e&&a,d=s[e](...i),u=n?ee:t?xe:we;return!t&&E(o,0,c?P:R),{next(){const{value:e,done:t}=d.next();return t?{value:e,done:t}:{value:l?[u(e[0]),u(e[1])]:u(e),done:t}},[Symbol.iterator](){return this}}}}(i,e,t)}),n}(e,t);return(t,i,s)=>"__v_isReactive"===i?!e:"__v_isReadonly"===i?e:"__v_raw"===i?t:Reflect.get((0,r.$3)(n,i)&&i in t?n:t,i,s)}const ie={get:re(!1,!1)},se={get:re(!1,!0)},oe={get:re(!0,!1)},ae=new WeakMap,le=new WeakMap,ce=new WeakMap,de=new WeakMap;function ue(e){return _e(e)?e:me(e,!1,Z,ie,ae)}function he(e){return me(e,!1,J,se,le)}function pe(e){return me(e,!0,Q,oe,ce)}function me(e,t,n,i,s){if(!(0,r.Gv)(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const o=(a=e).__v_skip||!Object.isExtensible(a)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((0,r.Zf)(a));var a;if(0===o)return e;const l=s.get(e);if(l)return l;const c=new Proxy(e,2===o?i:n);return s.set(e,c),c}function fe(e){return _e(e)?fe(e.__v_raw):!(!e||!e.__v_isReactive)}function _e(e){return!(!e||!e.__v_isReadonly)}function ge(e){return!(!e||!e.__v_isShallow)}function be(e){return!!e&&!!e.__v_raw}function ye(e){const t=e&&e.__v_raw;return t?ye(t):e}function ve(e){return!(0,r.$3)(e,"__v_skip")&&Object.isExtensible(e)&&(0,r.yQ)(e,"__v_skip",!0),e}const we=e=>(0,r.Gv)(e)?ue(e):e,xe=e=>(0,r.Gv)(e)?pe(e):e;function ke(e){return!!e&&!0===e.__v_isRef}function Se(e){return Me(e,!1)}function Ce(e){return Me(e,!0)}function Me(e,t){return ke(e)?e:new Te(e,t)}class Te{constructor(e,t){this.dep=new L,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:ye(e),this._value=t?e:we(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,n=this.__v_isShallow||ge(e)||_e(e);e=n?e:ye(e),(0,r.$H)(e,t)&&(this._rawValue=e,this._value=n?e:we(e),this.dep.trigger())}}function Le(e){return ke(e)?e.value:e}const ze={get:(e,t,n)=>"__v_raw"===t?e:Le(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const i=e[t];return ke(i)&&!ke(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function Ae(e){return fe(e)?e:new Proxy(e,ze)}class Re{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new L(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=M-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(8&this.flags||s===this))return h(this,!0),!0}get value(){const e=this.dep.track();return b(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function Pe(e,t,n=!1){let i,s;return(0,r.Tn)(e)?i=e:(i=e.get,s=e.set),new Re(i,s,n)}const Ne={},Ee=new WeakMap;let Oe;function Ie(e,t,n=r.MZ){const{immediate:s,deep:o,once:a,scheduler:c,augmentJob:d,call:u}=n,h=e=>o?e:ge(e)||!1===o||0===o?Be(e,1):Be(e);let p,m,f,_,g=!1,b=!1;if(ke(e)?(m=()=>e.value,g=ge(e)):fe(e)?(m=()=>h(e),g=!0):(0,r.cy)(e)?(b=!0,g=e.some(e=>fe(e)||ge(e)),m=()=>e.map(e=>ke(e)?e.value:fe(e)?h(e):(0,r.Tn)(e)?u?u(e,2):e():void 0)):m=(0,r.Tn)(e)?t?u?()=>u(e,2):e:()=>{if(f){k();try{f()}finally{S()}}const t=Oe;Oe=p;try{return u?u(e,3,[_]):e(_)}finally{Oe=t}}:r.tE,t&&o){const e=m,t=!0===o?1/0:o;m=()=>Be(e(),t)}const y=i,v=()=>{p.stop(),y&&y.active&&(0,r.TF)(y.effects,p)};if(a&&t){const e=t;t=(...t)=>{e(...t),v()}}let w=b?new Array(e.length).fill(Ne):Ne;const x=e=>{if(1&p.flags&&(p.dirty||e))if(t){const e=p.run();if(o||g||(b?e.some((e,t)=>(0,r.$H)(e,w[t])):(0,r.$H)(e,w))){f&&f();const n=Oe;Oe=p;try{const n=[e,w===Ne?void 0:b&&w[0]===Ne?[]:w,_];w=e,u?u(t,3,n):t(...n)}finally{Oe=n}}}else p.run()};return d&&d(x),p=new l(m),p.scheduler=c?()=>c(x,!1):x,_=e=>function(e,t=!1,n=Oe){if(n){let t=Ee.get(n);t||Ee.set(n,t=[]),t.push(e)}}(e,!1,p),f=p.onStop=()=>{const e=Ee.get(p);if(e){if(u)u(e,4);else for(const t of e)t();Ee.delete(p)}},t?s?x(!0):w=p.run():c?c(x.bind(null,!0),!0):p.run(),v.pause=p.pause.bind(p),v.resume=p.resume.bind(p),v.stop=v,v}function Be(e,t=1/0,n){if(t<=0||!(0,r.Gv)(e)||e.__v_skip)return e;if(((n=n||new Map).get(e)||0)>=t)return e;if(n.set(e,t),t--,ke(e))Be(e.value,t,n);else if((0,r.cy)(e))for(let r=0;r<e.length;r++)Be(e[r],t,n);else if((0,r.vM)(e)||(0,r.CE)(e))e.forEach(e=>{Be(e,t,n)});else if((0,r.Qd)(e)){for(const r in e)Be(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Be(e[r],t,n)}return e}},7852:(e,t,n)=>{"use strict";n.d(t,{t:()=>i});var r=n(3923);class i extends r.K{timer_float_check=!1;constructor(e){super(e),this.init()}init(){}check_float(){const{stats:e,cubes:t}=this.root;this.timer_float_check||requestAnimationFrame(()=>{let e=!0;for(let t of this.root.scope)e=!1,t.update_area();for(let[n,r]of t.postils)r.show&&(e=!1,r.update_pos());e||this.check_float()})}}},7977:(e,t,n)=>{"use strict";n.d(t,{R:()=>r});class r{static get icons(){return{annotation:"icon-Annotation",down:"icon-cc-arrow-down-square",left:"icon-cc-arrow-left-square",right:"icon-cc-arrow-right-square",up:"icon-cc-arrow-up-square",eraser:"icon-eraser",table_merge:"icon-hebingdanyuange",table_unmerge:"icon-quxiaohebingdanyuange",img:"icon-img",table:"icon-grid",table_delete_row:"icon-shanchuhang",table_delete_col:"icon-shanchulie",table_delete_cell:"icon-list-delete-cell",table_title:"icon-a-Addheader2x",table_expand_col:"icon-expand-horizontal-1--expand-resize-bigger-horizont",table_shrink_col:"icon-shrink-horizontal-1--resize-shrink-bigger-horizont",info:"icon-info",info2:"icon-error",rename:"icon-rename",copy:"icon-copy",delete:"icon-Delete",close:"icon-close",add:"icon-add",fold:"icon-fold"}}}},8304:(e,t,n)=>{"use strict";n.d(t,{U:()=>i});var r=n(9513);class i{static in_head(e,t=0,n="none"){return{id:e,name:r.K9.cursor_in_head,offset:t,from:n}}static in_tail(e,t=0,n="none"){return{id:e,name:r.K9.cursor_in_tail,offset:t,from:n}}}},8474:(e,t,n)=>{"use strict";n.d(t,{zS:()=>s,K9:()=>o,kU:()=>a,s1:()=>l,Mu:()=>r,u0:()=>i});var r=function(e){return e.courier="courier",e.cursor="cursor",e.config="config",e.cubes="cubes",e.clipboard="clipboard",e.event="event",e.fomula="fomula",e.painter="painter",e.player="player",e.hotkeys="hotkeys",e.history="history",e.scope="scope",e.stats="stats",e}({}),i=function(e){return e.api="api",e.annotation="annotation",e.box="box",e.box_root="box-root",e.box_folder="box-folder",e.box_columns="box-columns",e.code="code",e.doc="doc",e.detail_list="detail-list",e.fomula="fomula",e.img="img",e.lost="lost",e.line="line",e.list="list",e.list_ordered="list-ordered",e.linker="linker",e.link="link",e.map="map",e.submap="submap",e.node="node",e.postil="postil",e.rt="rt",e.text="text",e.tip="tip",e.todo="todo",e.table="table",e}({}),s=function(e){return e.cube_insert_child="cube-insert-child",e.cube_delete_child="cube-delete-child",e.cube_reset="cube-reset",e.cube_delete_adjacent="cube-delete-adjacent",e.cube_set_selection_css="cube-set-selection-css",e.cube_insert="cube-insert",e.cube_delete="cube-delete",e.cube_partition="cube-partition",e.cube_reorder="cube-reorder",e.cube_set_css="cube-set-css",e.cube_set_attr="cube-set-attr",e.cube_move="cube-move",e.cube_merge="cube-merge",e.cube_postil_add="cube-postil-add",e.cube_postil_remove="cube-postil-remove",e.cube_fold="cube-fold",e.cube_resize="cube-resize",e}({}),o=function(e){return e.cursor_in_head="cursor:in-head",e.cursor_in_tail="cursor:in-tail",e}({}),a=function(e){return e.node_add="node-add",e.node_remove="node-remove",e.linker_add="linker-add",e.linker_remove="linker-remove",e}({}),l=function(e){return e.layout_update="node:layout-update",e.append_child="node:append-child",e}({})},8606:(e,t,n)=>{"use strict";n.d(t,{Ak:()=>r});let r=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[e]];return t}},8631:(e,t,n)=>{"use strict";n.d(t,{I:()=>d,J:()=>u});var r=n(8606),i=n(4116),s=n(4743),o=n(9927),a=n(9513),l=n(3028),c=n(2551);class d{static get_id(){return(0,r.Ak)()}static async sleep(e=100){return new Promise(t=>{setTimeout(t,e)})}static is_same_style(e,t){let n=new Set(Object.keys(e)),r=new Set(Object.keys(t)),i=new Set([...n,...r]);if(n.size!==i.size||n.size!==r.size)return!1;for(let r of n)if(e[r]!==t[r])return!1;return!0}static is_same_attrs(e,t){let n=new Set(Object.keys(e)),r=new Set(Object.keys(t)),i=new Set([...n,...r]);if(n.size!==i.size||n.size!==r.size)return!1;for(let r of n)if(e[r]!==t[r])return!1;return!0}async locate(e,t,n=!0){const{courier:r,history:s}=e,o=e.find_cube(t),a=c.F.tips;if(o instanceof i._D&&o.top){const e=o.top;if(o.find_upstream_untill(e)!==e.child_first){const t=r.get_recorder();t.tell(e,i.VL.fold(e.id,!1)),s.record(t)}}const l=document.getElementById(t);if(!l)return a?.tip_error("未发现书签锚点");let d=l.style.backgroundColor;l.style.backgroundColor="var(--locate-anchor-bg)",setTimeout(()=>{"var(--locate-anchor-bg)"===l.style.backgroundColor&&(l.style.backgroundColor=d)},3e3),n&&l.scrollIntoView({block:"center",behavior:"instant"})}static exports(e){const t=[];for(let n of e)t.push(n.export());return t}static build_cubes(e,t){const n=[];for(let r of e){if(!r)continue;let e=o.K.find_cube(r.type);if(e)n.push(new e(r,t));else{const e=new s.Qm(r,t,"未注册cube");n.push(e)}}return n}static get_client_rects(e){const t=document.getElementById(e);if(t)return t.getClientRects()}static pick(e,t=!1){const n=o.K.metas_cube;let r=[],i=[],l=[],c=[],d=null,u=-1,h=-1,p=e,m=[];for(let t=0;t<e.length;t++){const n=e[t];if(n.type===a.u0.box_root){p=e.slice(0,t),m=e.slice(t+1),d=n,c.push(d);break}}for(let e=0;e<p.length;e++){const t=p[e];n.get(t.type)?.block&&(u<0?u=e:h=e)}if(u>=0&&h>=0){const e=p.slice(0,u),t=p.slice(h+1),o=[];let a=s.gK.get_default();a.info=[];for(let e of p.slice(u,h+1))n.get(e.type)?.block?(o.push(e),a.info.length>0&&(o.push(a),a=s.gK.get_default(),a.info=[])):a.info.push(e);r=e,i=o,l=t}else u>=0&&h<0?(r=p.slice(0,u),i=p.slice(u,u+1),l=p.slice(u+1)):(r=p,i=[],l=[]);if(d){let e=s.gK.get_default();e.info=[];for(let t of m)t.type===a.u0.box_root?(d=t,c.push(t)):n.get(t.type)?.block?(t.type===a.u0.box?d.info.push(...t.info):d.info.push(t),e.info.length>0&&d&&(d.info.push(e),e=s.gK.get_default())):e.info.push(t);e.info.length>0&&d&&d.info.push(e)}const f=[];if(r.length>0&&f.push(s.gK.get_default(r)),i.length>0&&f.push(...i),l.length>0&&f.push(s.gK.get_default(l)),c.length>0)if(t)for(let e of c)f.push(...e.info);else f.push(...c);return{head:r,body:i,tail:l,root:c,sort:f}}static find_line(e,t="first"){if(e instanceof s.gK)return e;const n=o.K.metas_cube.get(e.type);if(!n||!n.block)return;const r="first"===t?e.children:e.children.reverse();for(let e of r){let n=this.find_line(e,t);if(n)return n}}static filter_out_empty(e){return e.filter(e=>!s.P6.is_empty_text(e))}static get_flat_cube(e,t=!0){const n=e.children,r=[];if(t)for(let e of n)r.push(e),r.push(...this.get_flat_cube(e));else{r.push(...n);for(let e of r)r.push(...e.children)}return r}static replace_id(e,t,n={}){const r=[];for(let i of t){const t=o.K.find_cube(i.type);t&&t.replace_id&&r.push(t.replace_id(e,i,n))}return r}static insert_cubes(e,t){const{courier:n,history:r,cursor:s}=e,{cube_selection:o,cube_start:a,cube_end:c,offset_end:d,offset_start:u}=s;if(!o||!a||!c)return;const h=new l.vk(n);s.has_selection&&h.tell(o,i.VL.delete(o.id,"backward",a.id,c.id,u,d)),h.tell(a,i.VL.insert(a.id,t,a.id,a.id,u,u)),r.record(h)}static check_mouse_key(e,t){let n={left:{pointermove:{button:-1,buttons:1},pointerdown:{button:0,buttons:1},pointerup:{button:0,buttons:0}},right:{pointermove:{button:-1,buttons:2},pointerdown:{button:2,buttons:2},pointerup:{button:2,buttons:0}},mid:{pointermove:{button:-1,buttons:4},pointerdown:{button:1,buttons:4},pointerup:{button:1,buttons:0}}}[t][e.type];return e.button==n.button&&e.buttons==n.buttons}}class u{ps;resolve;reject;constructor(){this.ps=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}},9204:(e,t,n)=>{"use strict";n.d(t,{_:()=>m});var r=n(7633),i=n(9513),s=n(3097),o=n(2519),a=n(8631),l=n(3028),c=n(3447),d=n(8304),u=n(4743),h=n(2332),p=n(9390);class m extends s.j{_children=(0,r.Gc)([]);_has_postil=(0,r.KR)(!1);postil=null;pcube;data;constructor(e,t){super(),this.pcube=t}get domain(){return"doc"}get text(){let e="";for(let t of this.children)e+=t.text,t instanceof u.gK&&(e+="\n");return this instanceof u.gK&&(e+="\n"),e}get top(){let e=this;for(;e;){if(e.pcube instanceof h.M)return e;e=e.pcube}return e}get is_empty(){const e=this.children;return 0===e.length||1===e.length&&this.child_first.is_empty}get children(){return[...this._children]}get has_postil(){return this._has_postil.value}set has_postil(e){this._has_postil.value=e}get dom(){return document.getElementById(this.id)}get level(){return this.pcube.level+1}get host_postil(){return this instanceof u.$u?this:this.pcube.host_postil}get host_node(){let e=this.pcube;for(;e&&e instanceof m;){if("map"===e.domain&&e instanceof p.w)return e;e=e.pcube}}get in_postil(){return this instanceof u.$u||this.pcube.in_postil}get child_count(){return this.children.length}get child_first(){return this.children[0]}get child_last(){return this.children[this.children.length-1]}get pid(){return this.pcube.id}get id(){return this.data.id}get css(){return this.data.css||(this.data.css={}),{...this.data.css,"margin-left":this.attrs.indent>0?this.attrs.indent*this.root.config.data.line_indent+"px":"0px"}}get attrs(){return this.data.attrs||(this.data.attrs={}),this.data.attrs}get info(){return this.data.info}get type(){return this.data.type}get root(){return this.pcube.root}get courier(){return this.root.courier}get config(){return this.root.config}get history(){return this.root.history}get hotkeys(){return this.root.hotkeys}get cursor(){return this.root.cursor}get event(){return this.root.event}get clipboard(){return this.root.clipboard}get painter(){return this.root.painter}get cubes(){return this.root.cubes}get stats(){return this.root.stats}get versions(){return this.root.versions}get clientRect(){return this.dom?.getBoundingClientRect()}get clientRects(){return this.dom?.getClientRects()}get prev_cube(){return this.pcube.find_prev_cube(this.id)}get next_cube(){return this.pcube.find_next_cube(this.id)}get prev_cube_deep(){let e=this;for(;e;){let t=e.prev_cube;if(t instanceof m)return t;e=e.pcube}}get next_cube_deep(){let e=this;for(;e;){let t=e.next_cube;if(t instanceof m)return t;e=e.pcube}}get index(){return this.pcube?this.pcube.find_child_index(this.id):0}_setup(){this.set_cmd_handler(i.zS.cube_set_selection_css,this.on_cube_set_selection_css.bind(this)),this.set_cmd_handler(i.zS.cube_insert,this.on_insert.bind(this)),this.set_cmd_handler(i.zS.cube_delete,this.on_cube_delete.bind(this)),this.set_cmd_handler(i.zS.cube_set_css,this.on_cube_set_css.bind(this)),this.set_cmd_handler(i.zS.cube_set_attr,this.on_cube_set_attr.bind(this)),this.set_cmd_handler(i.zS.cube_delete_adjacent,this.on_cube_delete_adjacent.bind(this)),this.set_cmd_handler(i.zS.cube_postil_add,this.on_postil_add.bind(this)),this.set_cmd_handler(i.zS.cube_postil_remove,this.on_postil_remove.bind(this)),this.set_cmd_handler(i.K9.cursor_in_head,this.on_cursor_in_head.bind(this)),this.set_cmd_handler(i.K9.cursor_in_tail,this.on_cursor_in_tail.bind(this)),o.o.init_cmd_handler(this)}setup(e,t){let n;try{n=structuredClone((0,r.ux)(e))}catch(n){return new u.Qm(e,t,"克隆数据失败")}if(!n)return new u.Qm(e,t,"克隆数据为空");try{const i=this.update_data(n);if(!i.data)return new u.Qm(e,t,"升级后数据为空");if(!i.usable)return new u.Qm(e,t,"高版本数据,请升级软件");this.data=(0,r.Kh)(i.data),this._setup(),this.build_child(i.data),this.cubes.add_cube(this)}catch(n){return new u.Qm(e,t,"数据升级失败")}return this}create_child_block(e){const t=a.I.pick(e);return a.I.build_cubes(t.sort,this)}gc(){this.base_gc()}base_gc(){this.cubes.remove_cube(this);for(let e of this.children)e.gc()}base_export(){const e=structuredClone((0,r.ux)(this.data));return this.postil&&(e.attrs.postil=this.postil.export()),e}copy(e,t){const n=this.children.slice(e,t),r=[];for(let e of n){let t=e.export();r.push(t)}return r}get_upstream_sum_scale(){const e=[];let t=this.pcube;for(;t&&((t instanceof u.gv||t instanceof u.EU)&&e.push(t),t.pcube);)t=t.pcube;let n=1,r=1;for(let t of e){const{a:e,d:i}=t.matrix2d;n*=e,r*=i}return{sx:n,sy:r}}delete_edge(e,t){const{courier:n}=this,r=new l.vk(n);if("backward"===t){const t=e.prev_cube_deep,n=t?.next_cube;let i=e.pcube;if(i.is_empty&&i instanceof m){const e=i.prev_cube_deep;return r.merge(i.remove_self()),e&&r.tell(e,d.U.in_tail(e.id)),r}if(t&&t.is_empty)return r.merge(t.remove_self()),n&&r.tell(n,d.U.in_head(n.id)),r;if(n&&t.type===n.type)return r.merge(n.merge("left"));if(t)return r.tell(t,d.U.in_tail(t.id))}else{const t=e.next_cube_deep,n=t?.prev_cube;let i=e.pcube;for(;i&&i!==this;){const e=i.next_cube_deep;if(i.is_empty&&i instanceof m)return r.merge(i.remove_self()),e&&r.tell(e,d.U.in_head(e.id)),r;i=i.pcube}if(t&&t.is_empty)return r.merge(t.remove_self()),n&&r.tell(n,d.U.in_tail(n.id)),r;if(n&&t.type===n.type)return r.merge(t.merge("left"));if(t)return r.tell(t,d.U.in_tail(t.id))}}remove_self(e="backward"){const{pcube:t,courier:n,index:r}=this,i=new l.vk(n);return i.tell(t,c.V.delete_child(t.id,e,[r,r+1])),i}merge(e){const{pcube:t,cursor:n,courier:r}=this,{cube_end:i,offset_end:s}=n;if(!i)return;const o=r.get_recorder();return o.tell(this,c.V.merge(this.id,e,i.id,s)),o}find_cube(e){if(e===this.id)return this;for(let t of this.children){if(t.id===e)return t;const n=t.find_cube(e);if(n)return n}}filter(e){const t=[];e(this)&&t.push(this);for(let n of this.children)e(n)&&t.push(n),t.push(...n.filter(e));return t}each(e){for(let t of this.children)e(t),t.each(e)}find_dom_cube(e){let t=e instanceof Element?e:e.parentElement;const n=[];for(;t;){if(t.id){let e;if(n.push(t.id),e=this.find_cube(t.id),e)return e}t=t.parentElement}}is_contains_cube(e){if(e===this)return!0;let t=e;for(;t;){if(t.pcube===this)return!0;t=t.pcube}return!1}find_upstream_untill(e){if(!e.is_contains_cube(this))return;let t=this;for(;t;){if(t instanceof m&&t.pcube===e)return t;t=t.pcube}}find_upstream_target(e){let t=this;for(;t instanceof m;)if(t=t.pcube,e(t))return t}find_child_cube(e){return this.children.find(t=>t.id===e)}find_child_index(e){return this.children.findIndex(t=>t.id===e)}find_next_cube(e){const t=this.find_child_index(e);return this.children[t+1]}find_prev_cube(e){const t=this.find_child_index(e);return this.children[t-1]}on_cube_set_selection_css(e){const{cursor:t,courier:n}=this,{css:r,start_id:i,end_id:s,offset_end:o,offset_start:a,toggle:d,replace:u}=e,h=new l.vk(n);if(i!==s||o!==a){if(s&&!i){const e=this.find_cube(s),t=e?.find_upstream_untill(this);if(!t)return;const n=this.children.slice(0,t.index);for(let e of n)h.tell(e,c.V.set_selection_css(e.id,r,e.id,e.id,"head","tail",d,u));return h.tell(t,c.V.set_selection_css(t.id,r,null,s,"head",o,d,u)),h}if(i&&!s){const e=this.find_cube(i),t=e?.find_upstream_untill(this);if(!t)return;const n=this.children.slice(t.index+1);for(let e of n)h.tell(e,c.V.set_selection_css(e.id,r,e.id,e.id,"head","tail",d,u));return h.tell(t,c.V.set_selection_css(t.id,r,i,null,a,"tail",d,u)),h}if("tail"===o&&"head"===a){for(let e of this.children)h.tell(e,c.V.set_selection_css(e.id,r,e.id,e.id,"head","tail",d,u));return h}if(s&&i){const e=this.find_cube(i),t=this.find_cube(s),n=e?.find_upstream_untill(this),l=t?.find_upstream_untill(this);if(!n||!l)return;const p=this.children.slice(n.index+1,l.index);for(let e of p)h.tell(e,c.V.set_selection_css(e.id,r,e.id,e.id,"head","tail",d,u));return h.tell(n,c.V.set_selection_css(n.id,r,i,null,a,"tail",d,u)),n!==l&&h.tell(l,c.V.set_selection_css(l.id,r,null,s,"head",o,d,u)),h}}}on_insert(e){if(0===e.data.length)return;const{courier:t,cursor:n,pid:r}=this,i=new l.vk(t),{data:s,end_id:o,start_id:a,offset_end:u,offset_start:h}=e,p=this.find_cube(a),m=this.find_cube(o),f=p?.find_upstream_untill(this),_=m?.find_upstream_untill(this);if(!f||!_)return i;if(m!==p||h!==u)if(f&&f===_)i.tell(f,c.V.delete(f.id,"backward",a,o,h,u)),i.tell(f,c.V.insert(f.id,s,a,o,h,u));else{i.tell(_,c.V.delete(_.id,"backward",null,o,"head",u)),i.tell(this,c.V.delete_child(this.id,"backward",[f.index+1,_.index])),i.tell(this,c.V.insert_child(this.id,s,f.index+1)),i.tell(f,c.V.delete(f.id,"backward",a,null,h,"tail"));let e=s[s.length-1];const t=this.top.find_cube(e.id);t&&i.tell(t,d.U.in_tail(e.id,0))}else i.tell(m,c.V.insert(o,s,a,o,h,u));return i}on_cube_delete(e){const{courier:t,cursor:n}=this,{dir:r,start_id:i,end_id:s,offset_end:o,offset_start:a,reserve:d}=e,h=new l.vk(t);if(!i&&s){const e=this.find_cube(s),t=e?.find_upstream_untill(this);if(!t||!e)return;return h.tell(this,c.V.delete_child(this.id,r,[0,t.index],d)),h.tell(t,c.V.delete(t.id,r,i,s,"head",o,d)),h}if(i&&!s){const e=this.find_cube(i),t=e?.find_upstream_untill(this);if(!t||!e)return;return h.tell(this,c.V.delete_child(this.id,r,[t.index+1,this.child_count],d)),h.tell(t,c.V.delete(t.id,r,i,s,a,o,d)),h}if("head"===a&&"tail"===o){if(d){if(this.is_empty)return;h.tell(this,c.V.delete_child(this.id,r,[1,this.child_count]));const e=this.child_first;e.meta.block?h.tell(e,c.V.delete_child(e.id,r,[0,e.child_count],d)):e instanceof u.P6?h.tell(e,u.zl.reset(e.id,"",1,1)):h.tell(e,c.V.reset(e.id,[]))}else h.tell(this.pcube,c.V.delete_child(this.pid,"backward",[this.index,this.index+1]));return h}if(i&&s){const e=this.find_cube(i),t=this.find_cube(s);if(!e||!t)return;const n=e.find_upstream_untill(this),l=t.find_upstream_untill(this);if(!n||!l)return h;const d=n.index,p=l.index;if(i!==s||a!==o)if(n===l)h.tell(n,c.V.delete(n.id,r,i,s,a,o,!0));else if(h.tell(l,c.V.delete(l.id,r,null,s,"head",o)),h.tell(this,c.V.delete_child(this.id,"backward",[d+1,p])),h.tell(n,c.V.delete(n.id,r,i,null,a,"tail",!0)),e instanceof u.P6){const t=e.get_valid_index(a);e.set_cursor_in_head(t)}return h}}on_cube_set_css(e){const{courier:t,cursor:n}=this,{css:i,toggle:s,replace:o}=e,a=t.get_recorder();if(a.add_cmd(e),o){const e=structuredClone((0,r.ux)(this.css));return this.data.css=i,a.add_recover(c.V.set_css(this.id,e,!1,!0)),a}if(0===Object.keys(i).length)return;let l=!0;const d=structuredClone((0,r.ux)(this.css)),u=structuredClone((0,r.ux)(this.css));for(let e in i){const t=i[e],n=this.css[e]||null;d[e]=n,null===t||s&&t===n?(l=!1,delete u[e]):t!==n&&(l=!1,u[e]=t)}return this.data.css=u,l?void 0:(a.add_recover(c.V.set_css(this.id,d)),a)}on_cube_set_attr(e){const{courier:t,cursor:n}=this,{attr:i}=e,s=t.get_recorder();if(s.add_cmd(e),0===Object.keys(i).length)return;const o={};for(let e in i){const t=i[e];o[e]=structuredClone((0,r.ux)(this.attrs[e]))||null,null===t?delete this.data.attrs[e]:this.data.attrs[e]=t}return s.add_recover(c.V.set_attr(this.id,o)),s}on_cube_delete_adjacent(e){const{courier:t,pcube:n,pid:r,index:i}=this,{from:s,from_id:o,offset:a}=e,u=new l.vk(t);if(this.meta.block){const e=this.child_first,t=this.child_last;this.is_empty&&u.tell(n,c.V.delete_child(r,"backward",[this.index,this.index+1])),"left"===s?u.tell(e,d.U.in_head(e.id,0,s)):u.tell(t,d.U.in_tail(t.id,0,s))}else u.tell(n,c.V.delete_child(r,"backward",[this.index,this.index+1]));return u}on_postil_add(e){const{courier:t}=this,{data:n}=e;if(this.postil){const e=new l.vk(t),r=this.postil;return e.tell(r,c.V.insert_child(r.id,n,r.child_count)),this.has_postil=!0,this.postil.show=!0,e}{const r=t.get_recorder();r.add_cmd(e);const i=u.$u.get_default(n),s=new u.$u(i,this);return this.postil=s,r.add_recover(c.V.postil_remove(this.id,[0,s.child_count])),this.postil.show=!0,this.has_postil=!0,r}}on_postil_remove(e){const{courier:t}=this,{range:n}=e,[r,i]=n,s=this.postil;if(!s)return;let o=r<0?0:r,a=i>s.child_count?s.child_count:i;if(o<=0&&a>=s.child_count){const n=t.get_recorder();n.add_cmd(e);const r=s.export();return n.add_recover(c.V.postil_add(this.id,r.info)),this.postil=null,this.has_postil=!1,s.gc(),n}{const e=new l.vk(t);return e.tell(s,c.V.delete_child(s.id,"backward",[o,a])),e}}on_cursor_in_head(e){const{offset:t,from:n}=e,{courier:r,prev_cube:i,pcube:s,next_cube:o}=this,a=new l.vk(r);if(this.meta.block){const e=this.child_first;if(!e)return a;a.tell(e,d.U.in_head(e.id,t))}else if(this instanceof u.P6)this.set_cursor_in_head(t);else if("none"===n||"right"===n)if(i&&i instanceof u.P6)i.set_cursor_in_tail();else{const e=u.P6.get_default();a.tell(s,c.V.insert_child(s.id,[e],this.index))}else if("left"===n)if(o&&o instanceof u.P6)o.set_cursor_in_head();else{const e=u.P6.get_default();a.tell(s,c.V.insert_child(s.id,[e],this.index+1))}return a}on_cursor_in_tail(e){const{offset:t,from:n}=e,{courier:r,prev_cube:i,pcube:s,next_cube:o}=this,a=new l.vk(r);if(this.meta.block){const e=this.child_last;if(!e)return a;a.tell(e,d.U.in_tail(e.id,t))}else if(this instanceof u.P6)this.set_cursor_in_tail(t);else if("none"===n||"left"===n)if(o&&o instanceof u.P6)o.set_cursor_in_head();else{const e=u.P6.get_default();a.tell(s,c.V.insert_child(s.id,[e],this.index+1))}else if("right"===n)if(i&&i instanceof u.P6)i.set_cursor_in_tail();else{const e=u.P6.get_default();a.tell(s,c.V.insert_child(s.id,[e],this.index))}return a}get_valid_index(e){return"head"===e?0:"tail"===e?this.child_count:e<0?0:e>this.child_count?this.child_count:e}get_valid_range(e){let[t,n]=e;return t<0&&(t=0),n>this.child_count&&(n=this.child_count),[t,n]}}},9390:(e,t,n)=>{"use strict";n.d(t,{w:()=>g});var r=n(7633),i=n(4089),s=n(4743),o=n(9513),a=n(7552),l=n(3028),c=n(8631),d=n(3447),u=n(8304),h=n(1068);class p{static layout_tree(e,t,n){if(0==e.count_to)return;const r=e.layout_type;return"right"===r?this.right(e,t,n):"left"===r?this.left(e,t,n):"down"===r?this.down(e,t,n):"up"===r?this.up(e,t,n):"time-down"===r?this.time_down(e,t,n):"time-right"===r?this.time_right(e,t,n):void this.layout_downstream(e,t,n)}static layout_downstream(e,t,n){for(let e of t)e.layout(n)}static right(e,t,n){const{map_node_hgap:r,map_node_vgap:i}=e.config.data,s=e.bound,{pos_tree:o,size_bound:a,size_tree:l}=s;let c=o.x+r+a.width,d=o.y,u=0;for(let e=0;e<t.length;e++){const r=t[e],s=r.bound;s.update_pos_tree(c,d+u+e*i),u+=s.size_tree.height,r.layout(n)}}static left(e,t,n){const{map_node_hgap:r,map_node_vgap:i}=e.config.data,s=e.bound,{pos_tree:o,size_bound:a,size_tree:l}=s;let c=o.x+l.width-a.width-r,d=o.y,u=0;for(let e=0;e<t.length;e++){const r=t[e],s=r.bound;s.update_pos_tree(c-s.size_tree.width,d+u+e*i),u+=s.size_tree.height,r.layout(n)}}static down(e,t,n){const{map_node_hgap:r,map_node_vgap:i}=e.config.data,s=e.bound,{pos_tree:o,size_bound:a,size_tree:l}=s;let c=o.x,d=o.y+i+a.height,u=0;for(let e=0;e<t.length;e++){const i=t[e],s=i.bound;s.update_pos_tree(c+u+e*r,d),u+=s.size_tree.width,i.layout(n)}}static up(e,t,n){const{map_node_hgap:r,map_node_vgap:i}=e.config.data,s=e.bound,{pos_tree:o,size_bound:a,size_tree:l}=s;let c=o.x,d=o.y+l.height-a.height-i,u=0;for(let e=0;e<t.length;e++){const i=t[e],s=i.bound;s.update_pos_tree(c+u+e*r,d-s.size_tree.height),u+=s.size_tree.width,i.layout(n)}}static time_right(e,t,n){const{map_node_hgap:r,map_node_vgap:i}=e.config.data,s=e.bound,{pos:o,size_bound:a,size_tree:l,pos_tree:c}=s,{sum_tree_height:d,sum_tree_width:u,max_tree_height:h,max_tree_width:p,mw_rect:m,mh_rect:f}=e.bound.stat_downstream_nodes_size(t);Math.max(f.height,a.height);let _=o.x+a.width+r,g=o.y+a.height/2,b=0;for(let e=0;e<t.length;e++){const i=t[e],s=i.bound,{size_bound:o,size_tree:a}=s,l=i.attrs.layout;"right"===l||"left"===l?s.update_pos_tree(_+b+e*r,g-a.height/2):"up"===l?s.update_pos_tree(_+b+e*r,g-(a.height-o.height/2)):s.update_pos_tree(_+b+e*r,g-o.height/2),b+=s.size_tree.width,i.layout(n)}}static time_down(e,t,n){const{map_node_hgap:r,map_node_vgap:i}=e.config.data,s=e.bound,{pos_tree:o,pos:a,size_bound:l,size_tree:c}=s,{sum_tree_height:d,sum_tree_width:u,max_tree_height:h,max_tree_width:p,mw_rect:m,mh_rect:f}=e.bound.stat_downstream_nodes_size(t);Math.max(m.width,l.width);let _=a.x+l.width/2,g=a.y+l.height+i,b=0;for(let e=0;e<t.length;e++){const r=t[e],s=r.bound,o=r.attrs.layout,{size_bound:a,size_tree:l}=s;"left"===o?s.update_pos_tree(_-(l.width-a.width/2),g+b+e*i):"down"===o||"up"===o?s.update_pos_tree(_-l.width/2,g+b+e*i):s.update_pos_tree(_-a.width/2,g+b+e*i),b+=s.size_tree.height,r.layout(n)}}}var m=n(722),f=n(3682),_=n(2698);class g extends _.M{_editable=(0,r.KR)(!1);_waiter=new Set;_layout_self_success=!1;_show=!1;bound;data;pcube;icons={right:"icon-right iconfont",left:"icon-left iconfont",up:"icon-up iconfont",down:"icon-down iconfont","time-down":"icon-time-down iconfont","time-right":"icon-time-right iconfont"};shape=(0,r.Kh)({type:"rect",path:"",sample:[]});constructor(e,t){super(e,t),this.pcube=t,this._init_handler(),this.bound=new s.yI(this,e.attrs.matrix2d||a.c.get_default()),this.shape.type=e.attrs.shape||"rect"}_init_handler(){this.set_cmd_handler(o.zS.cube_reset,this.on_reset.bind(this)),this.set_cmd_handler(o.zS.cube_insert,this.on_cube_insert.bind(this)),this.set_cmd_handler(o.zS.cube_reorder,this.on_cube_reorder.bind(this)),this.set_cmd_handler(o.zS.cube_delete_child,this.on_delete_cube.bind(this)),this.set_cmd_handler(o.zS.cube_insert_child,this.on_insert_child.bind(this)),this.set_cmd_handler(o.s1.append_child,this.on_append_child.bind(this)),this.set_cmd_handler(o.s1.layout_update,this.on_layout_update.bind(this))}get matrix2d(){return this.attrs.matrix2d}get rect(){return this.bound.get_rect()}get show(){return this._show}set show(e){this._show=e,e?this.pcube.set_graph_visible(this,!0):this.pcube.set_graph_visible(this,!1)}_layout_from=(0,i.EW)(()=>this.get_layout_from());_layout_nodes=(0,i.EW)(()=>this.get_layout_nodes());_layout_upstream=(0,i.EW)(()=>{if(this.is_layout_root||0===this.count_from)return;const e=this.layout_line;return!e||e.length<2?void 0:e[e.length-2]});_sample=(0,i.EW)(()=>{if(this.is_layout_root||!this.layout_upstream){const e={x:this.matrix2d.e,y:this.matrix2d.f};return a.U.offset_points(this.shape.sample,e)}return a.U.offset_points(this.shape.sample,this.bound.pos)});get is_captive(){return!this.is_layout_root&&!!this.layout_root?.attrs.layout&&!!this.layout_upstream}get layout_self_success(){return this._layout_self_success}get attrs(){return this.data.attrs}get path(){return this.shape.path}get index(){return this.layout_upstream?this.layout_upstream.layout_nodes.indexOf(this):0}get prev_node(){if(!this.layout_upstream)return;const e=this.index;return this.layout_upstream.layout_nodes[e-1]}get next_node(){if(!this.layout_upstream)return;const e=this.index;return this.layout_upstream.layout_nodes[e+1]}get sample_count(){return 8}get sample(){return this._sample.value}get editable(){return this._editable.value}set editable(e){e?this.pcube.register_node_editing(this):this.pcube.remove_node_editing(this),this._editable.value=e;const t=this.courier.get_recorder(),n=this.child_last,r=u.U.in_tail(n.id,0);t.tell(n,r),this.history.record(t)}get layout_upstream(){return this._layout_upstream.value}get layout_line(){return this.get_layout_line()}get layout_root(){return this.layout_line?.[0]}get layout_nodes(){return this._layout_nodes.value}get is_layout_root(){return this.attrs.root||!1}get domain(){return"map"}get node_level(){return this.is_layout_root||!this.layout_upstream?0:this.layout_line.length-1}get from(){const e=this.pcube.get_node_from(this.id);return new Set(e||[])}get to(){const e=this.pcube.get_node_to(this.id);return new Set(e||[])}get node_last(){const e=this.pcube.get_node_to(this.id),t=e?e[e.length-1]:this.id;return this.pcube.get_node(t)||this}get count_from(){return this.from.size}get count_to(){return this.to.size}get nodes_to(){const e=[];for(let t of this.to){const n=this.pcube.find_child_cube(t);n&&n instanceof g&&e.push(n)}return e}get nodes_from(){const e=[];for(let t of this.from){const n=this.pcube.find_child_cube(t);n&&n instanceof g&&e.push(n)}return e}get layout_type(){return this.attrs.layout||this.is_layout_root?this.attrs.layout||null:this.layout_from.get_downstream_layout_type(this)}get layout_from(){return this._layout_from.value}get matrix2d_dom_string(){const{a:e,b:t,c:n,d:r,e:i,f:s}=this.matrix2d;if(this.is_layout_root||!this.layout_upstream)return a.c.get_dom_string(this.matrix2d);{const i=this.bound.pos;return`matrix(${e.toFixed(1)},${t},${n},${r.toFixed(1)},${i.x.toFixed(1)},${i.y.toFixed(1)})`}}get matrix2d_real(){const{a:e,b:t,c:n,d:r,e:i,f:s}=this.matrix2d;if(this.is_layout_root||!this.layout_upstream)return{...this.matrix2d};{const i=this.bound.pos;return{a:e,b:t,c:n,d:r,e:i.x,f:i.y}}}get_node_layout_env(){const e=this.layout_upstream;if(!e)return;const t=e.layout_nodes,n=t.indexOf(this);return n<0?void 0:{prev:t[n-1],next:t[n+1],index:n}}get_upstream_sum_scale(){const e=[];let t=this.pcube;for(;t&&((t instanceof s.gv||t instanceof s.EU)&&e.push(t),t.pcube);)t=t.pcube;let n=1,r=1;for(let t of e){const{a:e,d:i}=t.matrix2d;n*=e,r*=i}return{sx:n,sy:r}}move_to_center(){const e=this.pcube.get_view_center(),t=this.pcube.transform_point(e),n=this.bound.pos_center,r=this.pcube.real_point_to_fig(n),i=t.x-r.x,s=t.y-r.y,o=a.c.multiply(this.pcube.matrix2d,a.c.get_matrix_translate(i,s));this.pcube.reset_matrix(o)}move_in_fig_view(){if(this.check_in_fig_view(!0))return;const e=this.pcube,t=e.get_view_rect(),{dx:n,dy:r}=h.MathRect.move_rect_in_other(this.bound.rect,t),i=a.c.multiply(e.matrix2d,a.c.get_matrix_translate(n,r));e.reset_matrix(i),e.check_show()}check_in_fig_view(e=!1){const t=this.pcube.get_view_rect();return e?h.MathRect.can_contain(t,this.rect):h.MathRect.check_intersection(t,this.rect)}layout(e){if(this.layout_type||this.is_layout_root){this.is_layout_root&&console.log("🍊start-root-layout");const t=this.pcube.perf,n=this.get_layout_nodes();if(p.layout_tree(this,n,e),t)for(let t of n)t.check_show(e)}}layout_throttle=h.Notice.throttle(this.layout.bind(this),100);layout_self(e){const t=e.borderBoxSize[0];if(!t)return;const{blockSize:n,inlineSize:r}=t,i=this.bound.size;if(this.layout_self_success&&i.width===Math.ceil(r)&&i.height===Math.ceil(n))return;this._layout_self_success=!0;const o={width:Math.ceil(r),height:Math.ceil(n)};if(this.bound.update_size(o.width,o.height),this.shape.path=s.AG.get_shaple(this),this.shape.sample=this.get_sample(),!this.layout_upstream){const e=this.pcube.get_view_rect();this.check_show(e)}for(let e of this._waiter)e()}wait_layout_self(){return new Promise(e=>{this._layout_self_success?e(!0):this._waiter.add(e)})}check_show(e){return!!this.pcube.perf&&(h.MathRect.check_intersection(e,this.rect)?(this.show=!0,!0):(this.show=!1,!1))}check_show_line(){const e=this.id;if(this.show){for(let t of this.to){const n=a.U.get_linker_id(e,t),r=this.pcube.get_linker(n);r&&(r.show=!0)}for(let t of this.from){const n=a.U.get_linker_id(t,e),r=this.pcube.get_linker(n);r&&(r.show=!0)}}else{for(let t of this.to){const n=a.U.get_linker_id(e,t),r=this.pcube.get_linker(n);r&&(r.show=!1)}for(let t of this.from){const n=a.U.get_linker_id(t,e),r=this.pcube.get_linker(n);r&&(r.show=!1)}}}get_downstream_layout_type(e){const t=this.attrs.layout;if(!t)return null;if(e===this)return t;if(["down","up","left","right"].includes(t))return t;const n=e.node_level-this.node_level;return"time-right"===t?1===n?"time-down":"right":"time-down"===t?"right":t}get_sample(){if("rect"===this.shape.type){const e={x:0,y:0,...this.bound.size_bound},t=h.MathRect.get_rect_point;return[t(e,h._RectPosition.left_top),t(e,h._RectPosition.top_mid),t(e,h._RectPosition.right_top),t(e,h._RectPosition.right_mid),t(e,h._RectPosition.right_bottom),t(e,h._RectPosition.bottom_mid),t(e,h._RectPosition.left_bottom),t(e,h._RectPosition.left_mid),t(e,h._RectPosition.left_top)]}return a.U.svg_path_sample(this.shape.path,this.sample_count)}splice(e,t,...n){const r=this._children.splice(e,t,...n);for(let e of r)e.gc();const i=[];for(let e of r)i.push(e.export());return{children:r,data:i}}reset_matrix(e){Object.assign(this.matrix2d,e)}get_node(e){if(e)return this.pcube.get_node(e)}get_layout_line(){const e=a.U.find_line_to_layout_root(this);return e.has_root?e.line.toReversed():[]}get_layout_nodes(){const e=[],t=this.layout_line;if(!t)return e;const n=new Set([...t].map(e=>e.id));for(let t of this.to){if(n.has(t))continue;const r=this.get_node(t);r?r.layout_upstream===this&&e.push(r):this.to.delete(t)}return e}get_layout_index(e){return e.indexOf(this)}get_layout_from(){if(this.attrs.layout)return this;const e=this.layout_line;if(!e)return this;for(let t of e.reverse())if(t.is_layout_root||t.attrs.layout)return t;return this}translate(e,t){const n=a.c.translate(this.matrix2d,e,t);this.reset_matrix(n)}break_link_node(e){this.from.delete(e),this.to.delete(e)}remove_self(){for(let e of this.from){const t=this.pcube.find_child_cube(e);t&&t instanceof g&&t.break_link_node(this.id)}for(let e of this.to){const t=this.pcube.find_child_cube(e);t&&t instanceof g&&t.break_link_node(this.id)}return super.remove_self()}find_dom_cube(e){let t=e instanceof Element?e:e.parentElement;const n=[];for(;t;){if(t.id){let e;if(n.push(t.id),e=this.find_cube(t.id),e)return e}t=t.parentElement}}on_reset(e){const{courier:t}=this,{data:n}=e,r=t.get_recorder();r.add_cmd(e);const i=this.export().info,s=c.I.build_cubes(n,this);return this.splice(0,this.child_count,...s),r.add_recover(d.V.reset(this.id,i)),r}on_cube_reorder(e){const{courier:t,history:n,cursor:r}=this,{cubeid:i,index:s}=e,o=this.find_child_cube(i);if(!o||o.index===s)return;const a=new l.vk(t);let c=0,u=o.index;return"tail"===s?c=this.child_count:"number"==typeof s&&(c=s),this.splice(u,1),this.splice(c,0,o),a.add_recover(d.V.reorder(this.id,o.id,u)),a}on_insert_child(e){const{courier:t}=this,n=t.get_recorder();n.add_cmd(e);const{pos:r,data:i}=e;if(0===i.length)return n;const a=[];for(let e of i)e.type===o.u0.box_root&&a.push(new s.HR(e,this));let l=this.get_valid_index(r);this.splice(l,0,...a);const c=a[a.length-1];return c&&n.tell(c,u.U.in_tail(c.id,0)),n.add_recover(d.V.delete_child(this.id,"backward",[l,l+a.length])),n}on_delete_cube(e){const{courier:t,pcube:n,pid:r}=this,{dir:i,range:o}=e,[a,l]=o,c=t.get_recorder();c.add_cmd(e);const h=this.children[a-1],p=this.children[l],m=l-a;if(a!==l){if(a<=0&&l>=this.child_count){this.child_first,c.tell(this,d.V.reset(this.id,[]));const e=d.V.insert_child(this.id,[s.HR.get_default()],0);return c.tell(this,e),c}{let e=this.splice(a,m);h&&"backward"===i||!p?c.tell(h,u.U.in_tail(h.id,0)):(p&&"forward"===i||!h)&&c.tell(p,u.U.in_head(p.id,0));const t=e.data;c.add_recover(d.V.insert_child(this.id,t,a))}return c}}on_cube_insert(e){if(0===e.data.length)return;const{courier:t,cursor:n,pid:r,pcube:i}=this,s=new l.vk(t),{data:o,end_id:a,start_id:c,offset_end:h,offset_start:p}=e,m=this.find_cube(c),f=this.find_cube(a),_=m?.find_upstream_untill(this),g=f?.find_upstream_untill(this);if(!_||!g)return s;if(f!==m||p!==h)if(_&&_===g)s.tell(_,d.V.delete(_.id,"backward",c,a,p,h)),s.tell(_,d.V.insert(_.id,o,c,a,p,h));else{s.tell(g,d.V.delete(g.id,"backward",null,a,"head",h)),s.tell(this,d.V.delete_child(this.id,"backward",[_.index+1,g.index])),s.tell(this,d.V.insert_child(this.id,e.data,_.index+1)),s.tell(_,d.V.delete(_.id,"backward",c,null,p,"tail"));let t=e.data[e.data.length-1];if(t){const e=this.find_child_cube(t.id);e&&s.tell(e,u.U.in_tail(t.id,0))}}else s.tell(f,d.V.insert(a,o,c,a,p,h));return s}on_layout_update(e){const{courier:t,history:n}=this,{attrs:i}=e,s=t.get_recorder(),o=structuredClone((0,r.ux)(this.data.attrs));let a=!1;s.add_cmd(e);for(let e in i){const t=i[e];t!==this.attrs[e]&&(this.attrs[e]=t,a=!0)}if(i.matrix2d){const e=i.matrix2d;this.reset_matrix(e)}if(a){const e=this.pcube.get_view_rect();this.layout_root?.layout_throttle(e),this.pcube.check_show_line()}const l=m.S.layout_change(this.id,o);return s.add_recover(l),s}on_append_child(e){const{courier:t,history:n,pcube:r}=this,{previd:i}=e,{map_node_hgap:o,map_node_vgap:l}=this.config.data,c=t.get_recorder(),d=this.node_last.bound,u={x:d.pos.x,y:d.pos.y+d.size_bound.height+l},h=s.gL.get_default(u),p=f.y.node_add(r.id,[h]);c.tell(r,p);const m=a.U.create_linker_info(this.pcube,this.id,h.id),_=f.y.linker_add(r.id,[m]);c.tell(r,_);const g=r.get_node_to(this.id),b=g?.indexOf(h.id);if(g&&void 0!==b&&b>=0)if(null===i)g.splice(b,1),g.unshift(h.id);else if(i){const e=g.indexOf(i);e>=0&&(g.splice(b,1),g.splice(e+1,0,h.id))}return c}static get_default_node_size(e=0){return{width:120+2*e,height:36+2*e}}static get_default_node_pos(e,t){const{map_node_padding:n}=t.config.data,r=t.view_point_to_real(e),i=g.get_default_node_size(n);return{x:r.x-i.width/2,y:r.y-i.height/2}}}},9513:(e,t,n)=>{"use strict";n.d(t,{tK:()=>l,GW:()=>h,zS:()=>r.zS,K9:()=>r.K9,J8:()=>c,QI:()=>s,nY:()=>f,$f:()=>m,ZS:()=>k,ec:()=>S,SN:()=>M,_A:()=>g,Sd:()=>b,JC:()=>d,mM:()=>u,kU:()=>r.kU,L6:()=>o,tX:()=>C,s1:()=>r.s1,Mu:()=>r.Mu,u0:()=>r.u0,dp:()=>w,fv:()=>x,yn:()=>v,DI:()=>y,BS:()=>_,lm:()=>i,gS:()=>a,Ny:()=>p});var r=n(8474),i=function(e){return e.text_reset="cube-text:text-reset",e.text_merge="cube-text:text-merge",e.text_break="cube-text:text-break",e}({}),s=function(){return{}}(),o=function(e){return e.markers="markers",e.nodes="nodes",e.linkers="linkers",e.placeholder="placeholder",e}({}),a=function(e){return e.update="text-link:update",e}({}),l=function(e){return e.reset="cube-api:reset",e}({}),c=function(e){return e.insert_row="cube-detail-list:insert-row",e.remove_row="cube-detail-list:remove-row",e.change_width_col1="cube-detail-list:change-width-col1",e}({}),d=function(e){return e.add="cube-list:add",e.remove="cube-list:remove",e.indent="cube-list:indent",e}({}),u=function(e){return e.add="cube-list-ordered:add",e.remove="cube-list-ordered:remove",e.indent="cube-list-ordered:indent",e}({}),h=function(e){return e.change_lang="cube-code:change-lang",e.change_active="cube-code:change-active",e.change_theme="cube-code:change-theme",e.code_update="cube-code:update-code",e.code_add="cube-code:code-add",e.code_remove="cube-code:code-remove",e.code_rename="cube-code:code-rename",e}({}),p=function(e){return e.add="cube-todo:add",e.remove="cube-todo:remove",e.indent="cube-todo:indent",e.status="cube-todo:status",e}({}),m=function(e){return e.h1="\\Huge ",e.h2="\\huge ",e.h3="\\Large ",e.h4="\\normalsize ",e.h5="\\small ",e.h6="\\tiny ",e}({}),f=function(e){return e.update="cube-fomula:update",e}({}),_=function(e){return e.add_title="cube-table:add-title",e.remove_title="cube-table:remove-title",e.add_cell="cube-table:add-cell",e.remove_cell="cube-table:remove-cell",e.add_row="cube-table:add-row",e.remove_row="cube-table:remove-row",e.add_col="cube-table:add-col",e.remove_col="cube-table:remove-col",e.add_grid_col="cube-table:add-grid-col",e.remove_grid_col="cube-table:remove-grid-col",e.merge="cube-table:merge",e.moveto="cube-table:moveto",e.update_area="cube-table:update-area",e.reorder="cube-table:reorder",e.col_resize="cube-table:col-resize",e}({}),g=function(e){return e.arrow="marker-arrow",e.point="marker-point",e.square="marker-square",e.rhomb="marker-rhomb",e}({}),b=function(e){return e.update="linker:update",e}({}),y=function(e){return e.reset_explanation="cube-rt:reset-explanation",e}({}),v=function(e){return e.pending="pending",e.playing="playing",e.pause="pause",e.stop="stop",e}({}),w=function(e){return e["asset-save"]="note-event:asset-save",e["asset-download"]="note-event:asset-download",e["asset-copy"]="note-event:asset-copy",e.export="note-event:export",e["replace-id"]="note-event:replace-id",e["edit-before"]="note-event:edit-before",e["edit-after"]="note-event:edit-after",e["text-merge"]="note-event:text-merge",e.esc="note-event:esc",e["selection-change"]="note-event:selection-change",e["cursor-nav-before"]="note-event:cursor-nav-before",e["cursor-nav-after"]="note-event:cursor-nav-after",e["enter-before"]="note-event:enter-before",e["enter-after"]="note-event:enter-after",e["show-cube-editor"]="note-event:show-cube-editor",e["text-link-edit"]="note-event:text-link-edit",e["doc-input-before"]="note-event:doc-input-before",e["doc-input-compositionend"]="note-event:doc-input-compositionend",e["status-update"]="note-event:status-update",e["node-status-clicked"]="note-event:node-status-clicked",e["fig-click"]="note-event:fig-click",e}({}),x=function(e){return e.read="read",e.edit="edit",e.export="export",e}({}),k=function(e){return e["break-line"]="换行",e["cursor-nav"]="光标导航",e["cursor-nav-extend"]="光标复选",e["format-brush-apply"]="应用格式刷",e["format-brush-copy"]="复制格式刷",e.undo="撤销",e.redo="重做",e["indent-line"]="缩进",e["unindent-line"]="反向缩进",e["clear-css"]="重置样式",e["scope-clear"]="清空块选区",e["scope-add"]="添加块选区",e["root-add-next"]="向后添加根级块",e["root-add-prev"]="向前添加根级块",e["break-root"]="分裂根级块",e["break-text"]="文本块换行",e["fold-block"]="折叠所在块",e["text-add-annotation"]="添加批注",e["text-italic"]="斜体",e["text-bold"]="加粗",e["text-underline"]="下划线",e["text-align-left"]="左对齐",e["text-align-center"]="居中对齐",e["text-align-right"]="右对齐",e["text-partition"]="分裂文本块",e}({}),S=function(e){return e.core="核心",e.common="通用",e.text="文本块",e.block="块",e.scope="块选区",e.dict="字典",e.bookmark="书签",e.search="搜索",e.css="样式",e.float="面板",e.other="其他",e}({}),C=function(e){return e.left="arrowleft",e.right="arrowright",e.up="arrowup",e.down="arrowdown",e.end="end",e.home="home",e}({}),M=function(e){return e.enter="Enter",e}({})},9788:(e,t,n)=>{"use strict";n.d(t,{B:()=>l});var r=n(7633),i=n(4089),s=n(3923),o=n(9513),a=n(4743);class l extends s.K{static config;cp=l.default_config;data;get meta(){return l.meta}get css_vars(){const e=this.data;return{"--text-transition":e.text_transition?"0.5s":"none","--text-family":`${e.text_family}`,"--node-max-width":`${e.map_node_max_width}px`}}constructor(e){super(e),this.data=(0,r.Kh)(l.default_config),l.config=this.data,this.watch()}init(e){Object.assign(this.data,e),this.cp=structuredClone((0,r.ux)(this.data))}watch(){(0,i.wB)(()=>this.data.map_perf,(e,t)=>{if(e){this.root instanceof a.EU&&this.root.check_show();const e=this.root.cubes.get_types_cube(o.u0.submap);for(let[t,n]of e)n.check_show()}else{this.root instanceof a.EU&&this.root.show_all();const e=this.root.cubes.get_types_cube(o.u0.submap);for(let[t,n]of e)n.show_all()}})}export(){return structuredClone((0,r.ux)(this.data))}static get meta(){return{type:o.Mu.config,version:4}}static get default_config(){return{text_transition:!0,text_family:'"Comic Sans MS"',text_fontsize:16,code_theme:"dracula",line_indent:40,history_length:1/0,player_speed:150,input_quick_prefix:"/",revert_scope:!1,map_node_hgap:40,map_node_vgap:40,map_node_padding:4,map_node_max_width:800,map_node_exit_by_esc:!0,map_scale_max:5,map_scale_min:.1,map_scale_step:.1,scroll_distance:20,map_linker_anchor_left:o._A.point,map_linker_anchor_right:o._A.arrow,map_linker_line:"line",map_linker_stroke:"black",map_linker_stroke_width:2,map_perf:!0}}}},9927:(e,t,n)=>{"use strict";n.d(t,{K:()=>i});var r=n(4743);class i{static docs=new Map;static maps=new Map;static _cubes=new Map;static _metas_cube=new Map;static get metas_cube(){const e=new Map;for(let[t,n]of this._cubes)e.set(t,n.meta);return e}static init(){this.register_cube_core()}static add_doc(e){this.docs.set(e.id,e)}static add_map(e){this.maps.set(e.id,e)}static register_cube(e){const t=e.meta;t||console.error(`NoteManager: can't find static member meta in ${e}`),this._cubes.set(t.type,e)}static find_cube(e){return this._cubes.get(e)}static export_versions(){const e={[r.oY.meta.type]:r.oY.meta.version};for(const[t,n]of this._cubes)e[t]=n.meta.version;return e}static get_sdk_meta(){return{version:"1.72.1",time_publish:1761985889063}}static register_cube_core(){i.register_cube(r.P6),i.register_cube(r.gK),i.register_cube(r.fC),i.register_cube(r.$u),i.register_cube(r.ju),i.register_cube(r.vV),i.register_cube(r.HR),i.register_cube(r.Kw),i.register_cube(r.NQ),i.register_cube(r.k9),i.register_cube(r.LZ),i.register_cube(r.RQ),i.register_cube(r.Ku),i.register_cube(r.qH),i.register_cube(r.p4),i.register_cube(r.c9),i.register_cube(r.XV),i.register_cube(r.de),i.register_cube(r.gL),i.register_cube(r.R$),i.register_cube(r.mM),i.register_cube(r.gv),i.register_cube(r.at)}}}},r={};function i(e){var t=r[e];if(void 0!==t)return t.exports;var s=r[e]={exports:{}};return n[e](s,s.exports,i),s.exports}i.m=n,i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce((t,n)=>(i.f[n](e,t),t),[])),i.u=e=>"chunk/"+e+"-"+i.h()+".js",i.miniCssF=e=>{},i.h=()=>"66a27e7af2992c3cc6c4",i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="deepsky:",i.l=(n,r,s,o)=>{if(e[n])e[n].push(r);else{var a,l;if(void 0!==s)for(var c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var u=c[d];if(u.getAttribute("src")==n||u.getAttribute("data-webpack")==t+s){a=u;break}}a||(l=!0,(a=document.createElement("script")).charset="utf-8",i.nc&&a.setAttribute("nonce",i.nc),a.setAttribute("data-webpack",t+s),a.src=n),e[n]=[r];var h=(t,r)=>{a.onerror=a.onload=null,clearTimeout(p);var i=e[n];if(delete e[n],a.parentNode&&a.parentNode.removeChild(a),i&&i.forEach(e=>e(r)),t)return t(r)},p=setTimeout(h.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=h.bind(null,a.onerror),a.onload=h.bind(null,a.onload),l&&document.head.appendChild(a)}},i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;i.g.importScripts&&(e=i.g.location+"");var t=i.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&(!e||!/^http(s?):/.test(e));)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=e})(),(()=>{var e={3057:0};i.f.j=(t,n)=>{var r=i.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var s=new Promise((n,i)=>r=e[t]=[n,i]);n.push(r[2]=s);var o=i.p+i.u(t),a=new Error;i.l(o,n=>{if(i.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var s=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src;a.message="Loading chunk "+t+" failed.\n("+s+": "+o+")",a.name="ChunkLoadError",a.type=s,a.request=o,r[1](a)}},"chunk-"+t,t)}};var t=(t,n)=>{var r,s,[o,a,l]=n,c=0;if(o.some(t=>0!==e[t])){for(r in a)i.o(a,r)&&(i.m[r]=a[r]);l&&l(i)}for(t&&t(n);c<o.length;c++)s=o[c],i.o(e,s)&&e[s]&&e[s][0](),e[s]=0},n=self.webpackChunkdeepsky=self.webpackChunkdeepsky||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var s={};return(()=>{"use strict";i.r(s),i.d(s,{BoundBox:()=>r.yI,CodeLanguageMap:()=>r.UF,CommandApi:()=>r.ev,CommandBoxFolder:()=>r.$6,CommandBoxRoot:()=>r.LU,CommandCode:()=>r.DW,CommandCube:()=>o.VL,CommandCursor:()=>o.UB,CommandDetailList:()=>r.ry,CommandFomula:()=>r.OA,CommandLinker:()=>r.PL,CommandListOrdered:()=>r.LO,CommandMap:()=>o.yc,CommandNode:()=>o.Sv,CommandRt:()=>r.fl,CommandTable:()=>r.en,CommandText:()=>r.zl,CommandTextLink:()=>r.ZU,CommandTodo:()=>r.A6,CubeAnnotation:()=>r.vV,CubeApi:()=>r.c9,CubeBase:()=>o.j5,CubeBox:()=>r.XV,CubeBoxColumns:()=>r.mM,CubeBoxFolder:()=>r.de,CubeBoxRoot:()=>r.HR,CubeChild:()=>o._D,CubeCode:()=>r.p4,CubeDetailList:()=>r.RQ,CubeDoc:()=>r.oY,CubeFomula:()=>r.qH,CubeHandler:()=>a.o,CubeImg:()=>r.fC,CubeLine:()=>r.gK,CubeLinker:()=>r.R$,CubeList:()=>r.Kw,CubeListOrdered:()=>r.NQ,CubeLost:()=>r.Qm,CubeMap:()=>r.EU,CubeNode:()=>r.gL,CubePostil:()=>r.$u,CubeRoot:()=>o.MR,CubeRt:()=>r.at,CubeSubMap:()=>r.gv,CubeTable:()=>r.Ku,CubeText:()=>r.P6,CubeTextLink:()=>r.ju,CubeTip:()=>r.LZ,CubeTodo:()=>r.k9,LinkerLine:()=>r.sf,LinkerPoint:()=>r.e8,MapBase:()=>o.MT,MapInteraction:()=>C.T,MapNodeBase:()=>o.wP,MapTools:()=>S.U,Matrix2D:()=>S.c,NodeObserver:()=>r.Nj,NodeShape:()=>r.AG,NoteApi:()=>x.F,NoteBase:()=>l.K,NoteClipBoard:()=>c.F,NoteCourier:()=>d.W,NoteCubes:()=>m.h,NoteCursor:()=>u.P,NoteEvent:()=>p.z,NoteHistory:()=>f.PI,NoteHotkeys:()=>_.Wu,NoteIcons:()=>h.R,NoteListener:()=>y.t,NoteManager:()=>g.K,NotePainter:()=>b.W,NotePlayer:()=>f.C6,NoteScope:()=>v.R,NoteStats:()=>w.I,NoteTools:()=>k.I,Recorder:()=>f.vk,Waiter:()=>k.J,_ApiCommandNames:()=>n.tK,_CodeCommandNames:()=>n.GW,_CubeCommandName:()=>n.zS,_CursorCommandName:()=>n.K9,_DetaiListCommandName:()=>n.J8,_DocCommandName:()=>n.QI,_FomulaCommandNames:()=>n.nY,_FomulaSize:()=>n.$f,_HotKeys:()=>n.ZS,_HotKeysGroup:()=>n.ec,_Keys:()=>n.SN,_LinkerAnchor:()=>n._A,_LinkerCommandNames:()=>n.Sd,_ListCommandNames:()=>n.JC,_ListOrderedCommandNames:()=>n.mM,_MapCommandName:()=>n.kU,_MapGroup:()=>n.L6,_NavigationKey:()=>n.tX,_NodeCommandName:()=>n.s1,_NoteCores:()=>n.Mu,_NoteCubeTypes:()=>n.u0,_NoteEvents:()=>n.dp,_NoteMode:()=>n.fv,_PlayStatus:()=>n.yn,_RtCommandNames:()=>n.DI,_TableCommandNames:()=>n.BS,_TextCommandName:()=>n.lm,_TextLinkCommandNames:()=>n.gS,_TodoCommandNames:()=>n.Ny,cmd:()=>a.H,key:()=>_.Eb,keymap:()=>_.w4,node_observer:()=>r.iO});var e=i(1068),t={};for(const n in e)"default"!==n&&(t[n]=()=>e[n]);i.d(s,t);var n=i(9513),r=i(4743),o=i(4116),a=i(2519),l=i(3923),c=i(6517),d=i(4e3),u=i(3347),h=i(2160),p=i(1490),m=i(2411),f=i(3028),_=i(539),g=i(9927),b=i(2773),y=i(7852),v=i(4823),w=i(685),x=i(2551),k=i(8631),S=i(7552),C=i(7084)})(),s})());
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.deepsky=t():e.deepsky=t()}(self,()=>(()=>{var e,t,n={539:(e,t,n)=>{"use strict";n.d(t,{Wu:()=>m,Eb:()=>p,w4:()=>h});var r=n(4743),i=n(4116),s=n(9513),o=n(3028),a=n(6753),l=n(7633),c=n(4089),d=n(2551);function u(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}const h=new Map;function p(e){return(t,n)=>{let r=t[n];h.set(e,r)}}class m extends a.K{handlers=(0,l.Kh)(new Map);data;get meta(){return m.meta}constructor(e){super(e),this.data=(0,l.Kh)(m.default_hotkeys)}listen(e){this.listen_cursor_hotkey(e),this.listen_uncursor_hotkey(e),this.listen_cvx(e)}listen_cursor_hotkey(e){const t=this;e.addEventListener("keydown",e=>{const n=t.stats.mode,o=e.key.toLowerCase(),a=document.activeElement;let l=!1;if(n===s.fv.edit&&a!==document.body){for(let[n,r]of h){let i=t.data[n];i.cursor&&t.validate(e,i)&&(console.log("🟪命中快捷键",i.name),l=!0,r.bind(t)(e))}for(let[n,r]of t.handlers){let i=t.data[n];i.cursor&&t.validate(e,i)&&(console.log("🟪命中快捷键",i.name),l=!0,r(e))}if(!l&&"tab"===o){l=!0;const{cursor:t,courier:n,history:s}=this,{cube_end:o,cube_start:a,offset_start:c,offset_end:d,has_selection:u,cube_selection:h}=t,p=n.get_recorder();if(!h||!o||!a)return;e.preventDefault(),u&&p.tell(h,i.VL.delete(h.id,"backward",a.id,o.id,c,d,!0));const m=a.text,f=m.slice(0,c)+"\t"+m.slice(c);p.tell(a,r.zl.reset(a.id,f,d,c+1)),s.record(p)}}})}listen_uncursor_hotkey(e){const t=this;document.documentElement.addEventListener("keydown",e=>{const n=t.stats.mode,r=document.activeElement,i=[s.tX.down,s.tX.left,s.tX.right,s.tX.up],o=e.key.toLowerCase();this.root;let a=!1;if(this.cursor.cube_end||r===document.body){for(let[n,r]of h){let i=t.data[n];i.cursor||t.validate(e,i)&&(console.log("🟪命中快捷键",i.name),a=!0,r.bind(t)(e))}for(let[n,r]of t.handlers){let i=t.data[n];i.cursor||t.validate(e,i)&&(console.log("🟪命中快捷键",i.name),a=!0,r(e))}}a||r!==document.body||n!==s.fv.edit||(" "===o?this.listen_map_space(e):"backspace"===o||"delete"===o?this.listen_map_delete(e):"enter"===o?this.listen_map_enter(e):"tab"===o?this.listen_map_tab(e):i.includes(o)&&this.listen_map_nav(e))})}listen_map_nav(e){const t=this.root,n=e.key.toLowerCase(),i=this.cubes.get_types_cube(s.u0.submap),o=[s.tX.down,s.tX.left,s.tX.right,s.tX.up];if(t instanceof r.EU&&t.get_nodes_selected().size>0)o.includes(n)&&t.move_select(n);else for(let[e,t]of i)t.move_select(n)}listen_map_delete(e){const{courier:t,history:n}=this,o=t.get_recorder();if(this.root instanceof r.EU){const e=[...this.root.get_nodes_selected()].map(e=>e.id);o.tell(this.root,i.yc.node_remove(this.root.id,e))}const a=this.cubes.get_types_cube(s.u0.submap);for(let[e,t]of a){const e=[...t.get_nodes_selected()].map(e=>e.id);o.tell(t,i.yc.node_remove(t.id,e))}n.record(o)}listen_map_enter(e){const{courier:t,history:n}=this,o=t.get_recorder();let a=!1;if(this.root instanceof r.EU){const t=this.root.get_nodes_selected();for(let n of t){const t=n.layout_upstream;if(!t){a=!0;continue}let r=n.id;e.shiftKey&&(r=n.prev_node?.id||null);const s=i.Sv.append_child(t.id,r);o.tell(t,s)}}const l=this.cubes.get_types_cube(s.u0.submap);for(let[t,n]of l){const t=n.get_nodes_selected();for(let n of t){const t=n.layout_upstream;if(!t){a=!0;continue}let r=n.id;e.shiftKey&&(r=n.prev_node?.id||null);const s=i.Sv.append_child(t.id,r);o.tell(t,s)}}a&&d.F.tips?.tip_warning("无法在没有布局上游的节点添加同级"),n.record(o)}listen_map_tab(e){e.preventDefault();const{courier:t,history:n}=this,o=t.get_recorder();if(this.root instanceof r.EU){const e=this.root.get_nodes_selected();for(let t of e){const e=i.Sv.append_child(t.id);o.tell(t,e)}}const a=this.cubes.get_types_cube(s.u0.submap);for(let[e,t]of a){const e=t.get_nodes_selected();for(let t of e){const e=i.Sv.append_child(t.id);o.tell(t,e)}}n.record(o)}listen_map_space(e){const t=this.root;if(e.preventDefault(),t instanceof r.EU){const e=t.get_nodes_selected();for(let t of e)t.editable=!0}const n=t.cubes.get_types_cube(s.u0.submap);for(let[e,t]of n){const e=t.get_nodes_selected();for(let t of e)t.editable=!0}}listen_cvx(e){let t=e;this.root instanceof r.EU&&(t=document.documentElement),t.addEventListener("paste",async e=>{const t=e.clipboardData,{cursor:n}=this,{cube_end:i}=n;if(i instanceof r.P6&&t){e.preventDefault();const n=await this.clipboard.paste(t);this.history.record(n)}}),t.addEventListener("copy",e=>{const t=e.clipboardData,{doc:n,hotkeys:i,cursor:s}=this;t&&(this.root.scope_count_normal>0||s.has_selection||s.cube_end instanceof r.P6)&&(e.preventDefault(),this.clipboard.copy(t))}),t.addEventListener("cut",e=>{const t=e.clipboardData,{root:n,cursor:i}=this;t&&(n.scope_count_normal>0||i.cube_end instanceof r.P6)&&(e.preventDefault(),this.clipboard.cut(t))})}register(e,t){this.data[t.name]=t,this.handlers.set(t.name,e)}reset(e){Object.assign(this.data,e)}reset_handler(e,t){this.handlers.set(e,t)}export(){return structuredClone((0,l.ux)(this.data))}update_data(...e){return{}}validate(e,t){return t.meta===e.metaKey&&t.alt===e.altKey&&t.shift===e.shiftKey&&t.ctrl===e.ctrlKey&&(0===t.key.length||t.key.includes(e.key.toLocaleLowerCase()))}which(e){for(let t of Object.values(this.data))if(this.validate(e,t))return t}validate_hotkeys(e){for(let t of Object.values(this.data))if(this.validate(e,t))return!0;return!1}get_hotkey_str(e){const t=this.data[e];if(!t)return"";let n="";return t.meta&&(n+="meta + "),t.ctrl&&(n+="ctrl + "),t.alt&&(n+="alt + "),t.shift&&(n+="shift + "),n+=t.key,n}clear_scope(e){e.preventDefault(),this.root.clear_scope(!1)}clear_css(e){e.preventDefault();const{cursor:t}=this;this.root.painter.clear()}bold(e){e.preventDefault(),this.root.painter.paint({"font-weight":"700"},!0)}unindent_line(e){e.preventDefault(),this.root.painter.unindent()}indent_line(e){e.preventDefault(),this.root.painter.indent()}undo(e){e.preventDefault(),this.root.history.undo()}redo(e){e.preventDefault(),this.root.history.redo()}cursor_navigation(e){const t=this.cursor.get_focus_line(),n=this.root.cursor;if(!t)return;if(!n.range)return;e.preventDefault();const r=[s.tX.down,s.tX.end,s.tX.home,s.tX.left,s.tX.right,s.tX.up],i=e.key.toLocaleLowerCase();r.includes(i)&&this.event.emit_cursor_nav_before(e).some(e=>!1===e)||(i===s.tX.left?n.move_left():i===s.tX.right?n.move_right():i===s.tX.up?n.move_up():i===s.tX.down?n.move_down():i===s.tX.home?n.move_home():i===s.tX.end&&n.move_end(),this.event.emit_cursor_nav_after(e))}cursor_extend_navigation(e){const t=this.cursor.get_focus_line(),n=this.root.cursor;t&&n.cube_end instanceof r.P6&&(e.preventDefault(),e.key.toLocaleLowerCase()===s.tX.left?n.extend_left():e.key.toLocaleLowerCase()===s.tX.right?n.extend_right():e.key.toLocaleLowerCase()===s.tX.up?n.extend_up():e.key.toLocaleLowerCase()===s.tX.down?n.extend_down():e.key.toLocaleLowerCase()===s.tX.home?n.extend_home():e.key.toLocaleLowerCase()===s.tX.end&&n.extend_end())}text_break(e){const{courier:t,cursor:n,history:i,doc:s}=this;if(n.has_selection)return;e.preventDefault();const a=new o.vk(t),{cube_end:l,cube_start:c,cube_selection:d,offset_end:u,offset_start:h}=n;if(l){if(l instanceof r.P6){const e=l.text.slice(0,u)+"\n"+l.text.slice(u);a.tell(l,r.zl.reset(l.id,e,u,u+2))}i.record(a)}}break(e){if(this.event.emit_enter_before(e).some(e=>"stop"===e))return;if(!this.cursor.get_focus_line())return;e.preventDefault();const{courier:t,history:n,cursor:s,doc:a}=this,{cube_end:l,cube_start:c,cube_selection:d,offset_end:u,offset_start:h}=s;if(!d||!l||!c)return;const p=new o.vk(t),m=c.id,f=l.id;s.has_selection&&p.tell(d,i.VL.delete(d.id,"backward",m,f,h,u,!0)),p.tell(c,r.zl.break(c.id,h)),n.record(p),this.event.emit_enter_after(e)}async break_root(e){const{cursor:t,courier:n,history:s}=this,{cube_end:o,offset_end:a}=t;if(!o)return;const l=o.find_upstream_target(e=>e instanceof r.HR);if(!l)return;const d=o.find_upstream_untill(l);if(!d)return;const u=[],h=d.index,p=l.children.slice(h);for(let e of p)u.push(e.export());const m=r.HR.get_default(u),f=n.get_recorder(),_=l.pcube;f.tell(_,i.VL.insert_child(_.id,[m],l.index+1)),f.tell(l,i.VL.delete_child(l.id,"backward",[h,l.child_count])),o instanceof r.P6&&(await(0,c.dY)(),o.set_cursor_in_head(a)),s.record(f)}text_partition(e){const{cursor:t,history:n,courier:s}=this,o=d.F.tips,{cube_selection:a,offset_end:l,offset_start:c}=t;if(!(a instanceof r.P6))return o?.tip_warning("选区必须在一个文本块内");const u=s.get_recorder(),h=a.id;u.tell(a,i.VL.partition(h,h,h,c,l)),n.record(u)}add_scope(e){this.root.add_scope()}underline(e){const{cursor:t,courier:n,history:r}=this,{cube_selection:s,cube_end:a,cube_start:l,offset_start:c,offset_end:d}=t,u=new o.vk(n);s&&l&&a&&(u.tell(s,i.VL.set_selection_css(s.id,{"text-decoration-line":"underline"},l.id,a.id,c,d,!0)),r.record(u))}copy_format(e){const{root:t}=this;e.preventDefault(),t.painter.copy_format()}apply_format(e){const{root:t}=this;e.preventDefault(),t.painter.apply_format_brush()}italic(e){e.preventDefault(),this.painter.paint({"font-style":"italic"},!0)}align_left(e){e.preventDefault(),this.painter.paint({"text-align":"left"},!0)}align_center(e){e.preventDefault(),this.painter.paint({"text-align":"center"},!0)}align_right(e){e.preventDefault(),this.painter.paint({"text-align":"right"},!0)}next_root(e){e.preventDefault();const{cursor:t,history:n}=this,{cube_end:s}=t;if(!s)return;const a=s.find_upstream_target(e=>e instanceof r.HR);if(!a)return;const l=a.pcube,c=new o.vk(this.courier),d=r.HR.get_default();c.tell(l,i.VL.insert_child(l.id,[d],a.index+1)),n.record(c)}prev_root(e){e.preventDefault();const{cursor:t,history:n}=this,{cube_end:s}=t;if(!s)return;const a=s.find_upstream_target(e=>e instanceof r.HR);if(!a)return;const l=a.pcube,c=new o.vk(this.courier),d=r.HR.get_default();c.tell(l,i.VL.insert_child(l.id,[d],a.index)),n.record(c)}add_annotation(e){e.preventDefault();const t=d.F.tips,{cursor:n,courier:s,history:a}=this,{cube_selection:l,cube_start:c,cube_end:u,offset_end:h,offset_start:p}=n,m=new o.vk(s);if(!l||!c||!u)return t?.tip_warning("未发现光标或选区");const f=c.id,_=u.id,g=r.vV.get_default();if(n.has_selection)if(l instanceof r.P6)if(m.tell(l,i.VL.partition(l.id,f,_,p,h)),0===p){if(l.postil?.has_annotation)return t?.tip_warning("已添加批注"),m;m.tell(l,i.VL.postil_add(l.id,[g])),m.tell(l,i.UB.in_head(l.id,h))}else{const e=l.next_cube;if(e instanceof r.P6){if(e.postil?.has_annotation)return t?.tip_warning("已添加批注"),m;m.tell(e,i.VL.postil_add(e.id,[g])),m.tell(e,i.UB.in_head(e.id,h))}}else t?.tip_warning("选区跨越多个文本块");else u instanceof r.P6&&(m.merge(u.add_annotation()),m.tell(u,i.UB.in_head(u.id,h)));a.record(m)}fold_block(e){e.preventDefault();const{cursor:t}=this,{cube_end:n,offset_end:s}=t;if(!n)return;let o,a=n;for(;!o;){let e=a.pcube;if(e instanceof r.de||e instanceof r.HR)o=e;else if(e instanceof i.MR)return;a=e}if(o){const e=o.child_first,t=n.find_upstream_untill(o)===e,r=this.courier.get_recorder(),a=!o.attrs.fold,l=i.VL.set_attr(o.id,{fold:a});r.tell(o,l),t?r.tell(n,i.UB.in_head(n.id,s)):a&&e&&r.tell(e,i.UB.in_tail(e.id,0)),this.history.record(r)}}static get meta(){return{type:s.Mu.hotkeys,version:1}}static get default_hotkeys(){return{[s.ZS["fold-block"]]:{name:s.ZS["fold-block"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["z"],cursor:!0,group:s.ec.block},[s.ZS["text-partition"]]:{name:s.ZS["text-partition"],show:!0,meta:!1,shift:!1,alt:!0,ctrl:!1,key:["x"],cursor:!0,group:s.ec.text},[s.ZS["text-add-annotation"]]:{name:s.ZS["text-add-annotation"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["a"],cursor:!0,group:s.ec.text},[s.ZS["scope-clear"]]:{name:s.ZS["scope-clear"],show:!0,meta:!1,shift:!1,alt:!0,ctrl:!1,key:["c"],group:s.ec.scope},[s.ZS["clear-css"]]:{name:s.ZS["clear-css"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["r"],cursor:!0,group:s.ec.css},[s.ZS["root-add-prev"]]:{name:s.ZS["root-add-prev"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["enter"],cursor:!0,group:s.ec.block},[s.ZS["root-add-next"]]:{name:s.ZS["root-add-next"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["enter"],cursor:!0,group:s.ec.block},[s.ZS["text-align-left"]]:{name:s.ZS["text-align-left"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["l"],cursor:!0,group:s.ec.common},[s.ZS["text-align-center"]]:{name:s.ZS["text-align-center"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["e"],cursor:!0,group:s.ec.common},[s.ZS["text-align-right"]]:{name:s.ZS["text-align-right"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["r"],cursor:!0,group:s.ec.common},[s.ZS["break-text"]]:{name:s.ZS["break-text"],show:!1,meta:!1,shift:!0,alt:!1,ctrl:!1,key:["enter"],cursor:!0,group:s.ec.text},[s.ZS["break-line"]]:{name:s.ZS["break-line"],show:!1,meta:!1,shift:!1,alt:!1,ctrl:!1,key:["enter"],cursor:!0,group:s.ec.core},[s.ZS["break-root"]]:{name:s.ZS["break-root"],show:!0,meta:!1,shift:!1,alt:!0,ctrl:!1,key:["enter"],cursor:!0,group:s.ec.block},[s.ZS["cursor-nav"]]:{name:s.ZS["cursor-nav"],show:!1,meta:!1,shift:!1,alt:!1,ctrl:!1,cursor:!0,key:[s.tX.down,s.tX.left,s.tX.right,s.tX.up,s.tX.home,s.tX.end],group:s.ec.core},[s.ZS["cursor-nav-extend"]]:{name:s.ZS["cursor-nav-extend"],show:!1,meta:!1,shift:!0,alt:!1,ctrl:!1,cursor:!0,key:[s.tX.down,s.tX.left,s.tX.right,s.tX.up,s.tX.home,s.tX.end],group:s.ec.core},[s.ZS.undo]:{name:s.ZS.undo,show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["z"],cursor:!1,group:s.ec.common},[s.ZS.redo]:{name:s.ZS.redo,show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["y"],cursor:!1,group:s.ec.common},[s.ZS["indent-line"]]:{name:s.ZS["indent-line"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["m"],cursor:!0,group:s.ec.common},[s.ZS["unindent-line"]]:{name:s.ZS["unindent-line"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["m"],cursor:!0,group:s.ec.common},[s.ZS["text-bold"]]:{name:s.ZS["text-bold"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["b"],cursor:!0,group:s.ec.text},[s.ZS["scope-add"]]:{name:s.ZS["scope-add"],show:!0,meta:!1,shift:!1,alt:!0,ctrl:!1,key:["s"],cursor:!1,group:s.ec.scope},[s.ZS["text-underline"]]:{name:s.ZS["text-underline"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["u"],cursor:!0,group:s.ec.text},[s.ZS["text-italic"]]:{name:s.ZS["text-italic"],show:!0,meta:!1,shift:!1,alt:!1,ctrl:!0,key:["i"],cursor:!0,group:s.ec.text},[s.ZS["format-brush-copy"]]:{name:s.ZS["format-brush-copy"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["c"],cursor:!0,group:s.ec.common},[s.ZS["format-brush-apply"]]:{name:s.ZS["format-brush-apply"],show:!0,meta:!1,shift:!0,alt:!1,ctrl:!0,key:["v"],cursor:!0,group:s.ec.common}}}}u([p(s.ZS["scope-clear"])],m.prototype,"clear_scope",null),u([p(s.ZS["clear-css"])],m.prototype,"clear_css",null),u([p(s.ZS["text-bold"])],m.prototype,"bold",null),u([p(s.ZS["unindent-line"])],m.prototype,"unindent_line",null),u([p(s.ZS["indent-line"])],m.prototype,"indent_line",null),u([p(s.ZS.undo)],m.prototype,"undo",null),u([p(s.ZS.redo)],m.prototype,"redo",null),u([p(s.ZS["cursor-nav"])],m.prototype,"cursor_navigation",null),u([p(s.ZS["cursor-nav-extend"])],m.prototype,"cursor_extend_navigation",null),u([p(s.ZS["break-text"])],m.prototype,"text_break",null),u([p(s.ZS["break-line"])],m.prototype,"break",null),u([p(s.ZS["break-root"])],m.prototype,"break_root",null),u([p(s.ZS["text-partition"])],m.prototype,"text_partition",null),u([p(s.ZS["scope-add"])],m.prototype,"add_scope",null),u([p(s.ZS["text-underline"])],m.prototype,"underline",null),u([p(s.ZS["format-brush-copy"])],m.prototype,"copy_format",null),u([p(s.ZS["format-brush-apply"])],m.prototype,"apply_format",null),u([p(s.ZS["text-italic"])],m.prototype,"italic",null),u([p(s.ZS["text-align-left"])],m.prototype,"align_left",null),u([p(s.ZS["text-align-center"])],m.prototype,"align_center",null),u([p(s.ZS["text-align-right"])],m.prototype,"align_right",null),u([p(s.ZS["root-add-next"])],m.prototype,"next_root",null),u([p(s.ZS["root-add-prev"])],m.prototype,"prev_root",null),u([p(s.ZS["text-add-annotation"])],m.prototype,"add_annotation",null),u([p(s.ZS["fold-block"])],m.prototype,"fold_block",null)},685:(e,t,n)=>{"use strict";n.d(t,{I:()=>a});var r=n(7633),i=n(3923),s=n(9513),o=n(4743);class a extends i.K{_count_word=(0,r.KR)(0);_active_root_index=(0,r.KR)(0);_anchor_root_id=(0,r.KR)("");_mode=(0,r.KR)(s.fv.read);_view=(0,r.KR)("doc");_in_composition_mode=(0,r.KR)(!1);_in_recording=(0,r.KR)(!1);_showing=(0,r.KR)(!1);view_point=(0,r.Kh)({x:0,y:0});get view(){return this._view.value}set view(e){this._view.value=e}get is_doc_view(){return"doc"===this.view}get is_map_view(){return"map"===this.view}get mode_name(){return{[s.fv.edit]:"编辑模式",[s.fv.read]:"阅读模式",[s.fv.export]:"导出模式"}[this.mode]}get showing(){return this._showing.value}set showing(e){this._showing.value=e,this.event.emit_status_update()}get is_recording(){return this._in_recording.value}set is_recording(e){this._in_recording.value=e,this.event.emit_status_update()}get len_undo(){return this.history.len_undo}get len_redo(){return this.history.len_redo}get is_read_mode(){return this._mode.value===s.fv.read}get is_edit_mode(){return this._mode.value===s.fv.edit}get in_composition_mode(){return this._in_composition_mode.value}set in_composition_mode(e){this._in_composition_mode.value=e,this.event.emit_status_update()}get mode(){return this._mode.value}set mode(e){const t=this.mode;this._mode.value=e,t!==e&&this.event.emit_status_update()}get anchor_root_id(){return this._anchor_root_id.value}set anchor_root_id(e){this._anchor_root_id.value=e,this.event.emit_status_update()}get anchor_root(){return this.root instanceof o.oY?this.root.children.find(e=>e.id===this.anchor_root_id):this.root.find_cube(this.anchor_root_id)}get count_root(){return this.root.child_count}get count_word(){return this._count_word.value}get active_root(){return this.root.children[this.active_root_index-1]}get active_root_index(){return this._active_root_index.value}set active_root_index(e){this._active_root_index.value=e,this.event.emit_status_update()}get count_scope(){return this.root.scope.size}get count_scope_freeze(){return this.root.scope_count_freeze}get count_scope_normal(){return this.root.scope_count_normal}get meta(){return a.meta}constructor(e){super(e)}update_count_word(e){this._count_word.value+=e,this.event.emit_status_update()}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:s.Mu.stats,version:1}}}},722:(e,t,n)=>{"use strict";n.d(t,{S:()=>i});var r=n(9513);class i{static layout_change(e,t){return{id:e,name:r.s1.layout_update,attrs:t}}static append_child(e,t){return{id:e,name:r.s1.append_child,previd:t}}}},1068:e=>{var t;self,t=()=>(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{ArrayTools:()=>u,DateTime:()=>c,DomAnimation:()=>d,DragDiff:()=>f,DragList:()=>p,Iteration:()=>a,MathBase:()=>_,MathLine:()=>v,MathPoint:()=>b,MathPolygon:()=>y,MathRect:()=>g,Notice:()=>o,_RectPosition:()=>s});var n,r,i,s=function(e){return e.left_mid="left-mid",e.left_top="left-top",e.left_bottom="left-bottom",e.top_mid="top-mid",e.bottom_mid="bottom-mid",e.right_top="right-top",e.right_mid="right-mid",e.right_bottom="right_bottom",e.center="center",e}({});class o{static rope(e,t){return(...n)=>{let r=Symbol();return this.scope[e]=r,t(()=>r===this.scope[e],...n)}}static throttle(e,t=100){let n;return function(...r){n||(n=setTimeout(()=>{e(...r),n=void 0},t))}}static debounce(e,t=100){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>{e(...r)},t)}}}i={},(r="scope")in(n=o)?Object.defineProperty(n,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[r]=i;class a{static*zip(...e){let t=e.map(e=>Array.isArray(e)?e:[e]),n=t.map(e=>e.length),r=Math.min(...n);for(let e=0;e<r;e++){let n=[];for(let r=0;r<t.length;r++)n.push(t[r][e]);yield n}}}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class c{static get_month_name(e){let t;return t=e||new Date,this.month_names[t.getMonth()]}static get_week_name(e){let t;return t=e||new Date,this.weeks_names[t.getDay()]}static get_date_string(e){return`${e.getFullYear()}-${e.getMonth()+1}-${e.getDate()}`}static get_week_string(e){let t;t=e||new Date;const n=t.getDate(),r=t.getDay(),i=new Date(t.getFullYear(),t.getMonth(),n-r),s=new Date(t.getFullYear(),t.getMonth(),n+(6-r));return`${this.get_date_string(i)}:${this.get_date_string(s)}`}static get_week_days(e){const t=[];let n;n=e||new Date;const r=n.getFullYear(),i=n.getMonth(),s=n.getDate(),o=n.getDay(),a=new Date(r,i,s-o),l=a.getFullYear(),c=a.getMonth(),d=a.getDate();t.push(a);for(let e=1;e<=6;e++)t.push(new Date(l,c,d+e));return t}}l(c,"month_names",["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]),l(c,"weeks_names",["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]);class d{static scroll_element(e,t,n="vertical"){let r=t;const i=()=>{if(Math.abs(r)>2){let t=r/10;r-=t,"vertical"===n?e.scrollTop+=t:e.scrollLeft+=t,requestAnimationFrame(i)}"vertical"===n?e.scrollTop+=r:e.scrollLeft+=r};i()}}class u{static swap(e,t,n){const r=e[t],i=e[n];e[t]=i,e[n]=r}}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class p{init(){const e=this.order,t=new Set;this.order=[];for(let e=0;e<this.container.children.length;e++){const n=this.container.children[e],r=n.getAttribute(this.attr);r&&n instanceof HTMLElement&&(n.setAttribute("draggable","true"),n.style.position="absolute","horizental"===this.dir?n.style.left="0px":n.style.top="0px",this.order_origin.push(r),t.add(r),this.map.has(r)||this.register(n),this.map.set(r,n))}const n=this.init_container();this.container.addEventListener("dragenter",e=>{e.preventDefault()}),this.container.addEventListener("dragover",e=>{e.preventDefault()});for(let n of e)t.has(n)?(this.order.push(n),t.delete(n)):this.map.delete(n);for(let e of t)this.order.push(e);return this.sort(),n}sort(){for(let e=0;e<this.order.length;e++){const t=this.order[e],n=this.map.get(t);if(!n)continue;const r=this.sum_translate(this.order.slice(0,e));"horizental"===this.dir?n.style.transform=`translateX(${r}px)`:n.style.transform=`translateY(${r}px)`}for(let e of this.callback)e([...this.order])}init_container(){let e=0;for(const[t,n]of this.map)"horizental"===this.dir?e+=n.getBoundingClientRect().width/this.scale_h:e+=n.getBoundingClientRect().height/this.scale_v;return"horizental"===this.dir?this.container.style.width=e+"px":this.container.style.height=e+"px",e}sum_translate(e){let t=0;for(let n of e){const e=this.map.get(n);e&&("horizental"===this.dir?t+=e.getBoundingClientRect().width/this.scale_h:t+=e.getBoundingClientRect().height/this.scale_v)}return t}register(e){this._func_start=this.on_dragstart.bind(this),this._func_over=this.on_dragover.bind(this),this._func_enter=this.on_dragenter.bind(this),this._func_end=this.on_dragend.bind(this),e.addEventListener("dragstart",this._func_start,{capture:!0}),e.addEventListener("dragover",this._func_over,{capture:!0}),e.addEventListener("dragenter",this._func_enter,{capture:!0}),e.addEventListener("dragend",this._func_end,{capture:!0}),this.realtime||e.addEventListener("drop",this.on_drop.bind(this),{capture:!0})}on_dragstart(e){e.stopPropagation();const t=e.currentTarget;if(t instanceof HTMLElement&&(this.drag_id=t.getAttribute(this.attr),this.drag_id))for(let t of this.callback_start)t(e,this.drag_id);this.container.style.setProperty(this.css_var_point_events,"none")}on_dragenter(e){if(e.stopPropagation(),e.preventDefault(),!this.realtime)return;const t=e.currentTarget;if(e.target!==t)return;if(!(t instanceof HTMLElement))return;const n=t.getAttribute(this.attr),r=this.drag_id;if(!n||!r||n===r)return;const i=this.order.indexOf(n),s=this.order.indexOf(r);i<0||s<0||("swap"===this.effect?u.swap(this.order,i,s):(this.order.splice(s,1),this.order.splice(i,0,r)),this.init_container(),this.sort())}on_dragover(e){e.preventDefault(),e.stopPropagation()}on_drop(e){e.stopPropagation();const t=e.target;if(!(t instanceof HTMLElement))return;const n=t.getAttribute(this.attr),r=this.drag_id;if(!n||!r||n===r)return;const i=this.order.indexOf(n),s=this.order.indexOf(r);i<0||s<0||("swap"===this.effect?u.swap(this.order,i,s):(this.order.splice(s,1),this.order.splice(i,0,r)),this.sort())}on_dragend(e){this.container.style.setProperty(this.css_var_point_events,"auto");for(let t of this.callback_end)t(e)}register_start(e){this.callback_start.add(e)}register_dropend(e){this.callback_end.add(e)}register_callback(e){this.callback.add(e)}off_callback(e){this.callback.delete(e)}off_callback_start(e){this.callback_start.delete(e)}off_callback_drop(e){this.callback_end.delete(e)}constructor(e,t,n,r,i=!0){h(this,"container",void 0),h(this,"drag_id",void 0),h(this,"dir","vertical"),h(this,"effect",void 0),h(this,"attr",void 0),h(this,"realtime",!0),h(this,"order_origin",[]),h(this,"order",[]),h(this,"css_var_point_events","--drag-item-point-event"),h(this,"map",new Map),h(this,"callback",new Set),h(this,"callback_start",new Set),h(this,"callback_end",new Set),h(this,"scale_h",1),h(this,"scale_v",1),h(this,"_func_start",void 0),h(this,"_func_over",void 0),h(this,"_func_enter",void 0),h(this,"_func_end",void 0),h(this,"_callback_start",void 0),this.container=e,this.dir=t,this.attr=n,this.realtime=i,this.effect=r,e.style.position="relative"}}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class f{get el(){return this._el}init(){this._handler_down=e=>this._pointdown(e),this._handler_move=e=>this._pointmove(e),this._handler_up=e=>this._pointup(e),this._handler_cancel=e=>this._pointercancel(e),this.el.addEventListener("pointerdown",this._handler_down),document.documentElement.addEventListener("pointermove",this._handler_move),document.documentElement.addEventListener("pointerup",this._handler_up),document.documentElement.addEventListener("pointercancel",this._handler_cancel)}_pointdown(e){e.stopPropagation(),e.preventDefault();const t=e.target;this.el.contains(t)&&(this._is_down=!0,this._down_point={x:e.clientX,y:e.clientY},this._func_down&&this._func_down())}_pointmove(e){if(!this._is_down||!this._down_point||e.buttons<=0)return;e.stopPropagation(),e.preventDefault(),this._is_move=!0;const t=e.clientX-this._down_point.x,n=e.clientY-this._down_point.y;this._func_move&&this._func_move(t,n)}_pointup(e){if(e.preventDefault(),e.stopPropagation(),!this._is_down||!this._is_move)return;if(this._is_down=!1,this._is_move=!1,!this._down_point)return;const t=e.clientX-this._down_point.x,n=e.clientY-this._down_point.y;this._down_point=void 0,this._func_up&&this._func_up(t,n)}_pointercancel(e){this._is_down&&this._is_move&&(this._is_down=!1,this._is_move=!1,this._down_point=void 0,this._func_cancel&&this._func_cancel())}off(){this.el.removeEventListener("pointerdown",this._handler_down),document.documentElement.removeEventListener("pointermove",this._handler_move),document.documentElement.removeEventListener("pointerup",this._handler_up),document.documentElement.removeEventListener("pointercancel",this._handler_cancel)}register_down(e){this._func_down=e}register_move(e){this._func_move=e}register_up(e){this._func_up=e}register_cancel(e){this._func_cancel=e}constructor(e){m(this,"_el",void 0),m(this,"_handler_down",void 0),m(this,"_handler_move",void 0),m(this,"_handler_up",void 0),m(this,"_handler_cancel",void 0),m(this,"_func_down",void 0),m(this,"_func_move",void 0),m(this,"_func_up",void 0),m(this,"_func_cancel",void 0),m(this,"_is_down",!1),m(this,"_is_move",!1),m(this,"_down_point",void 0),this._el=e,this.init()}}class _{static sum(e){let t=0;for(let n of e)t+=n;return t}}class g{static get_rect_point(e,t){const{x:n,y:r,width:i,height:o}=e,a=r+o,l=n+i,c=n+i/2,d=r+o/2;if(t===s.left_bottom)return{x:n,y:a};if(t===s.left_top)return{x:n,y:r};if(t===s.left_mid)return{x:n,y:d};if(t===s.right_top)return{x:l,y:r};if(t===s.right_mid)return{x:l,y:d};if(t===s.right_bottom)return{x:l,y:a};if(t===s.bottom_mid)return{x:c,y:a};if(t===s.top_mid)return{x:c,y:r};if(t===s.center)return{x:c,y:d};throw Error("MathRect: the position keyword is invalid")}static is_point_in_rect(e,t,n=!0){const r=e.x===t.x||e.x===t.x+t.width,i=e.y===t.y||e.y===t.y+t.height,s=e.x>t.x&&e.x<t.x+t.width,o=e.y>t.y&&e.y<t.y+t.height;return n?(s||r)&&(o||i):s&&o}static get_point_in_rects(e,t,n=!0){const r=[];for(let i of t)this.is_point_in_rect(e,i,n)&&r.push(i);return r}static get_point_center(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}static move_rect_to_other(e,t,n,r=5){const i={width:e.width,height:Math.abs(e.y-n.y)},s={width:e.width,height:Math.abs(e.height-(n.y+n.height))},o={width:Math.abs(n.x-e.x),height:e.height},a={width:Math.abs(e.width-(n.x+n.width)),height:e.height};if(g.can_include(s,t)){const i=t.width+n.x-e.width,s=n.y+n.height+r;return{x:i<0?n.x:n.x-i,y:s}}if(g.can_include(i,t)){const i=t.width+n.x-e.width,s=n.y-t.height-r;return{x:i<0?n.x:n.x-i,y:s}}if(g.can_include(o,t)){const i=n.y+t.height-e.height;return{x:n.x-t.width-r,y:i<0?n.y:n.y-i}}if(g.can_include(a,t)){const i=n.y+t.height-e.height;return{x:n.x+n.width+r,y:i<0?n.y:n.y-i}}if(g.can_include(e,t)){const r=e.y+e.height-t.height;let i=n.x;return a.width>=t.width?i=n.x+n.width:o.width>=t.width&&(i=n.x-t.width),{x:i,y:r}}return{x:n.x,y:0}}static move_rect_in_other(e,t){if(g.can_contain(t,e))return{dx:0,dy:0};let n=0,r=0;return e.x<t.x?n=t.x-e.x:e.x+e.width>t.x+t.width&&(n=t.x+t.width-(e.x+e.width)),e.y<t.y?r=t.y-e.y:e.y+e.height>t.y+t.height&&(r=t.y+t.height-(e.y+e.height)),{dx:n,dy:r}}static can_include(e,t){return t.width<=e.width&&t.height<=e.height}static can_contain(e,t){return!(!this.can_include(e,t)||t.x<e.x||t.x>e.x+e.width-t.width||t.y<e.y||t.y>e.y+e.height-t.height)}static check_intersection(e,t){const n=e.x+e.width/2,r=e.y+e.height/2,i=t.x+t.width/2,s=t.y+t.height/2,o=Math.abs(n-i),a=Math.abs(r-s);return o<=(e.width+t.width)/2&&a<=(e.height+t.height)/2}static limit_point_in_rect(e,t){const n=t.x,r=t.y,i=t.x+t.width,s=t.y+t.height;let o=e.x,a=e.y;return o<n&&(o=n),o>i&&(o=i),a<r&&(a=r),a>s&&(a=s),{x:o,y:a}}static point_distance_with_rect(e,t){if(this.is_point_in_rect(e,t,!0))return 0;const n=t.x+t.width/2,r=t.y+t.height/2,i=t.width/2,s=t.height/2,o=Math.abs(n-e.x),a=Math.abs(r-e.y);return o<=i&&a>s?a-s:a<=s&&o>i?o-i:Math.sqrt(Math.pow(o-i,2)+Math.pow(a-s,2))}static distance_with(e,t){const n=this.get_point_center(e),r=this.get_point_center(t),i=Math.abs(n.x-r.x),s=Math.abs(n.y-r.y),o=(e.width+t.width)/2,a=(e.height+t.height)/2;if(i<=o&&s<=a)return 0;if(i>o&&s<=a)return i-o;if(i<=o&&s>a)return s-a;{let e=Math.pow(i-o,2),t=Math.pow(s-a,2);return Math.sqrt(e+t)}}static get_nearest_rect(e,t){if(0===t.length)return;let n,r=Number.POSITIVE_INFINITY;for(let i of t){let t=this.point_distance_with_rect(e,i);t<r&&(r=t,n=i)}return n}static get_shadow_point_horizental(e,t){let n=t.x,r=t.y+t.height/2;return n=e.x<=t.x?t.x:e.x>=t.x+t.width?t.x+t.width:e.x,{x:n,y:r}}static merge(...e){const t=e[0];let n=t.x,r=t.x+t.width,i=t.y,s=t.y+t.height;for(let t of e.slice(1)){const{x:e,y:o,width:a,height:l}=t;e<n&&(n=e),e+a>r&&(r=e+a),o<i&&(i=o),o+l>s&&(s=o+l)}return{x:n,y:i,width:r-n,height:s-i}}}class b{static svg_path_sample(e,t=24){if(!e||t<2)return[];this.path.setAttribute("d",e);const n=[],r=this.path.getTotalLength()/t;for(let e=0;e<t;e++){const t=e*r,i=this.path.getPointAtLength(t);n.push({x:i.x,y:i.y})}return n}static get_line_k(e,t,n=100){const r=t.y-e.y,i=t.x-e.x;return 0===i?Number.POSITIVE_INFINITY:r/i}static distance(e,t){const n=e.x-t.x,r=e.y-t.y;return Math.sqrt(n*n+r*r)}static find_closet_point(e,t){let n=1/0,r=e[0];const{x:i,y:s}=t;for(let t of e){let e=Math.pow(i-t.x,2)+Math.pow(s-t.y,2);e<n&&(n=e,r=t)}return r}static offset_points(e,t){const n=[],{x:r,y:i}=t;for(let t of e)n.push({x:t.x+r,y:t.y+i});return n}static find_closest_points(e,t){let n=1/0,r=e[0],i=t[0];for(let s=0;s<e.length;s++){const o=e[s];for(let e=0;e<t.length;e++){const s=t[e],a=o.x-s.x,l=o.y-s.y,c=a*a+l*l;c<n&&(n=c,r=o,i=s)}}return{from:r,to:i}}}!function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(b,"path",document.createElementNS("http://www.w3.org/2000/svg","path"));class y{static polygon_center(e){let t=0,n=0,r=0;const i=e.length;for(let s=0;s<i;s++){const{x:o,y:a}=e[s],{x:l,y:c}=e[(s+1)%i],d=o*c-l*a;r+=d,t+=(o+l)*d,n+=(a+c)*d}return r*=.5,t/=6*r,n/=6*r,{x:t,y:n}}static get_polygon_area(e){let t=0;const n=e.length;for(let r=0;r<n;r++){const{x:i,y:s}=e[r],{x:o,y:a}=e[(r+1)%n];t+=i*a-o*s}return t/2}}class v{static check_intersection(e,t){const{from:n,to:r}=e,{from:i,to:s}=t;let o,a;if(o=n.x===r.x?Number.POSITIVE_INFINITY:(r.y-n.y)/(r.x-n.x),a=i.x===s.x?Number.POSITIVE_INFINITY:(s.y-i.y)/(s.x-i.x),o===a)return!1;const l=Math.min(n.x,r.x),c=Math.max(n.x,r.x),d=Math.min(n.y,r.y),u=Math.max(n.y,r.y),h=Math.min(i.x,s.x),p=Math.max(i.x,s.x),m=Math.min(i.y,s.y),f=Math.max(i.y,s.y);if(o===Number.POSITIVE_INFINITY){const e=n.x,t=a*(e-i.x)+i.y;return e>=l&&e<=c&&e>=h&&e<=p&&t>=d&&t<=u&&t>=m&&t<=f}if(a===Number.POSITIVE_INFINITY){const e=i.x,t=(r.y-n.y)/(r.x-n.x)*(e-n.x)+n.y;return e>=l&&e<=c&&e>=h&&e<=p&&t>=d&&t<=u&&t>=m&&t<=f}{const e=(i.y-n.y+o*n.x-a*i.x)/(o-a),t=o*(e-n.x)+n.y;return e>=l&&e<=c&&e>=h&&e<=p&&t>=d&&t<=u&&t>=m&&t<=f}}}return t})(),e.exports=t()},1490:(e,t,n)=>{"use strict";n.d(t,{z:()=>o});var r=n(2551),i=n(6753),s=n(9513);class o extends i.K{_listener=new Map;_updating_status=!1;get meta(){return o.meta}constructor(e){super(e),this._listen()}_listen(){document.documentElement.addEventListener("keyup",e=>{"Escape"===e.key&&this.emit_esc()}),document.addEventListener("selectionchange",e=>{this.emit_selection_change(e)})}on(e,t){const n=this._listener.get(e);n?n.add(t):this._listener.set(e,new Set([t]))}emit(e,...t){const n=this._listener.get(e);if(!n)return[];const r=[];for(let e of n)r.push(e(...t));return r}off(e){for(let[t,n]of this._listener)for(let t of n)e===t&&n.delete(t)}on_asset_save(e){const t=r.F.tips,n=this._listener.get(s.dp["asset-save"]);n?(n.clear(),t?.tip_info("唯一事件-资源保存:回调已覆盖"),n.add(e)):this._listener.set(s.dp["asset-save"],new Set([e]))}async emit_asset_save(e,t,n){const i=r.F.tips,o=this._listener.get(s.dp["asset-save"]);if(!o)return i?.tip_warning("未注册保存函数"),!1;const a=[...o][0];return!!a&&await a(e,t,n)}on_asset_download(e){const t=r.F.tips,n=this._listener.get(s.dp["asset-download"]);n?(n.clear(),t?.tip_info("唯一事件-资源下载:回调已覆盖"),n.add(e)):this._listener.set(s.dp["asset-download"],new Set([e]))}async emit_asset_download(e,t){const n=r.F.tips,i=this._listener.get(s.dp["asset-download"]);if(!i)return n?.tip_warning("未注册保存函数"),!1;const o=[...i][0];return!!o&&await o(e,t)}on_asset_copy(e){const t=r.F.tips,n=this._listener.get(s.dp["asset-copy"]);n?(n.clear(),t?.tip_info("唯一事件-资源复制:回调已覆盖"),n.add(e)):this._listener.set(s.dp["asset-copy"],new Set([e]))}async emit_asset_copy(e,t,n){const i=r.F.tips,o=this._listener.get(s.dp["asset-copy"]);if(!o)return i?.tip_warning("未注册保存函数"),!1;const a=[...o][0];return!!a&&await a(e,t,n)}emit_replace_id(e,t){const n=this._listener.get(s.dp["replace-id"]);if(!n)return!1;for(let r of n)r(e,t)}on_replace_id(e){const t=this._listener.get(s.dp["replace-id"]);t?t.add(e):this._listener.set(s.dp["replace-id"],new Set([e]))}emit_edit_before(e,t){const n=this._listener.get(s.dp["edit-before"]);if(!n)return!1;for(let r of n)r(e,t)}on_edit_before(e){const t=this._listener.get(s.dp["edit-before"]);t?t.add(e):this._listener.set(s.dp["edit-before"],new Set([e]))}emit_edit_after(e,t){const n=this._listener.get(s.dp["edit-after"]);if(!n)return!1;for(let r of n)r(e,t)}on_edit_after(e){const t=this._listener.get(s.dp["edit-after"]);t?t.add(e):this._listener.set(s.dp["edit-after"],new Set([e]))}emit_text_merge(e,t){const n=this._listener.get(s.dp["text-merge"]);if(!n)return!1;for(let r of n)r(e,t)}on_text_merge(e){const t=this._listener.get(s.dp["text-merge"]);t?t.add(e):this._listener.set(s.dp["text-merge"],new Set([e]))}on_esc(e){const t=this._listener.get(s.dp.esc);t?t.add(e):this._listener.set(s.dp.esc,new Set([e]))}emit_esc(){const e=this._listener.get(s.dp.esc);if(!e)return!1;for(let t of e)t()}on_selection_change(e){this.on(s.dp["selection-change"],e)}emit_selection_change(e){this.emit(s.dp["selection-change"],e)}emit_cursor_nav_before(e){return this.emit(s.dp["cursor-nav-before"],e)}on_cursor_nav_before(e){this.on(s.dp["cursor-nav-before"],e)}emit_cursor_nav_after(e){return this.emit(s.dp["cursor-nav-after"],e)}on_cursor_nav_after(e){this.on(s.dp["cursor-nav-after"],e)}on_enter_before(e){this.on(s.dp["enter-before"],e)}emit_enter_before(e){return this.emit(s.dp["enter-before"],e)}on_enter_after(e){this.on(s.dp["enter-after"],e)}emit_enter_after(e){return this.emit(s.dp["enter-after"],e)}on_show_cube_editor(e){this.on(s.dp["show-cube-editor"],e)}emit_show_cube_editor(e){return this.emit(s.dp["show-cube-editor"],e)}on_text_link_edit(e){this.on(s.dp["text-link-edit"],e)}emit_text_link_edit(e){return this.emit(s.dp["text-link-edit"],e)}on_doc_input_before(e){return this.on(s.dp["doc-input-before"],e)}emit_doc_input_before(e){return this.emit(s.dp["doc-input-before"],e)}on_doc_input_compositionend(e){return this.on(s.dp["doc-input-compositionend"],e)}emit_doc_input_compositionend(e){return this.emit(s.dp["doc-input-compositionend"],e)}on_status_update(e){return this.on(s.dp["status-update"],e)}emit_status_update(){this._updating_status||(this._updating_status=!0,Promise.resolve().then(()=>{const{root:e}=this,t=e,n={mode:this.stats.mode,count_word:this.stats.count_word,count_scope_normal:this.stats.count_scope_normal,count_scope_all:this.root.scope.size,count_stack_redo:this.history.len_redo,count_stack_undo:this.history.len_undo,count_root:this.stats.count_root,active_root_index:this.stats.active_root_index,anchor_root_id:this.stats.anchor_root_id,note_recording:this.stats.is_recording,note_composition_input:this.stats.in_composition_mode,note_showing:this.stats.showing,map_matrix:{...t.matrix2d}};this.emit(s.dp["status-update"],n),this._updating_status=!1}))}on_node_status_click(e){return this.on(s.dp["node-status-clicked"],e)}emit_node_status_click(e,t){return this.emit(s.dp["node-status-clicked"],e,t)}on_fig_click(e){return this.on(s.dp["fig-click"],e)}emit_fig_click(e){return this.emit(s.dp["fig-click"],e)}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:s.Mu.event,version:1}}}},1642:(e,t,n)=>{"use strict";n.d(t,{L$:()=>M,LU:()=>S,uz:()=>k});var r=n(4116),i=n(4314),s=n(1068),o=n(4743);var a=n(2551);function l(e,t=!1){const{cursor:n,courier:r,stats:i,history:s}=e,l=a.F.tips,{cube_end:c}=n,d=e.get_active_cell();if(!d)return l?.tip_info("未发现激活单元格");if(t){if(e.get_cell(d.row,d.col-1))return l?.tip_info("左侧已存在单元格");if(d.col-1<0)return l?.tip_info("左侧已达边界");{const t=r.get_recorder(),n={row:d.row,col:d.col-1,rowspan:1,colspan:1,data:o.XV.get_default()};t.tell(e,o.en.add_cell(e.id,n)),s.record(t)}}else{const t=e.get_cell_area(d);if(!e.check_orderly_col_left(t.left))return l?.tip_info("左侧不整齐");const n=r.get_recorder(),i=[];for(let t=0;t<e.size[0];t++)i.push(o.XV.get_default());n.tell(e,o.en.add_col(e.id,d.col,i)),s.record(n)}}function c(e,t=!1){const{cursor:n,courier:r,stats:i,history:s}=e,l=a.F.tips,{cube_end:c}=n,d=e.get_active_cell();if(!d)return l?.tip_info("未发现激活单元格");if(t){if(e.get_cell(d.row,d.col+1))return l?.tip_info("右侧已存在单元格");if(d.col+1>=e.size[1])return l?.tip_info("右侧已达边界");{const t=r.get_recorder(),n={row:d.row,col:d.col+1,rowspan:1,colspan:1,data:o.XV.get_default()};t.tell(e,o.en.add_cell(e.id,n)),s.record(t)}}else{const t=e.get_cell_area(d);if(!e.check_orderly_col_right(t.right))return l?.tip_info("右侧不整齐");const n=r.get_recorder(),i=[];for(let t=0;t<e.size[0];t++)i.push(o.XV.get_default());n.tell(e,o.en.add_col(e.id,d.col+d.colspan,i)),s.record(n)}}function d(e,t=!1){const{cursor:n,courier:r,stats:i,history:s}=e,l=a.F.tips,{cube_end:c}=n,d=e.get_active_cell();if(!d)return l?.tip_info("未发现激活单元格");if(t){if(e.get_cell(d.row-1,d.col))return l?.tip_info("上方已存在单元格");if(d.row-1<0)return l?.tip_info("上方已达边界");{const t=r.get_recorder(),n={row:d.row-1,col:d.col,rowspan:1,colspan:1,data:o.XV.get_default()};t.tell(e,o.en.add_cell(e.id,n)),s.record(t)}}else{const t=e.get_cell_area(d);if(!e.check_orderly_row_top(t.top))return l?.tip_info("上方不整齐");const n=r.get_recorder(),i=[];for(let t=0;t<e.size[1];t++)i.push(o.XV.get_default());n.tell(e,o.en.add_row(e.id,d.row,i)),s.record(n)}}function u(e,t=!1){const{cursor:n,courier:r,stats:i,history:s}=e,l=a.F.tips,{cube_end:c}=n,d=e.get_active_cell();if(!d)return l?.tip_info("未发现激活单元格");if(t){if(e.get_cell(d.row+1,d.col))return l?.tip_info("下方已存在单元格");if(d.row+1>=e.size[0])return l?.tip_info("下方已达边界");{const t=r.get_recorder(),n={row:d.row+1,col:d.col,rowspan:1,colspan:1,data:o.XV.get_default()};t.tell(e,o.en.add_cell(e.id,n)),s.record(t)}}else{const t=e.get_cell_area(d);if(!e.check_orderly_row_bottom(t.bottom))return l?.tip_info("下方不整齐");const n=r.get_recorder(),i=[];for(let t=0;t<e.size[1];t++)i.push(o.XV.get_default());n.tell(e,o.en.add_row(e.id,d.row+d.rowspan,i)),s.record(n)}}function h(e,t){const{cursor:n,courier:r,stats:i,history:s,id:l}=e,c=a.F.tips,{cube_end:d}=n,u=e.get_active_cell();if(!u)return c?.tip_info("未发现激活单元格");const h=r.get_recorder(),p=e.get_cell_area(u);h.tell(e,o.en.col_resize(l,[p.left,p.right],t)),s.record(h)}function p(e,t){const{courier:n,history:i}=e,s=n.get_recorder();s.tell(e,r.VL.set_attr(e.id,{column_count:t,column_width:null})),i.record(s)}function m(e,t){const{courier:n,history:i}=e,s=n.get_recorder();s.tell(e,r.VL.set_attr(e.id,{column_width:t,column_count:null})),i.record(s)}var f=n(3431),_=n(8631),g=n(9513);function b(e,t=!1){const n=e,{cursor:r,courier:i,history:s}=e,{cube_start:o,cube_end:a}=r;if(!o||!a)return;const l=i.get_recorder();if(t){const e=o.find_upstream_untill(n),t=a.find_upstream_untill(n);if(!e||!t)return;const r=n.items.slice(e.index,t.index+1),i=[];for(let e of r)i.push({id:e.data.id,indent:!1});l.tell(n,f.o.indent(n.id,i)),s.record(l)}else{const e=o.find_upstream_untill(n),t=a.find_upstream_untill(n);if(!e||!t)return;const r=n.items.slice(e.index,t.index+1),i=[];for(let e of r)i.push({id:e.data.id,indent:!0});l.tell(n,f.o.indent(n.id,i)),s.record(l)}}function y(e,t=!1){const n=e,{cursor:r,courier:i,history:s}=e,{cube_start:a,cube_end:l}=r;if(!a||!l)return;const c=i.get_recorder();if(t){const e=a.find_upstream_untill(n),t=l.find_upstream_untill(n);if(!e||!t)return;const r=n.items.slice(e.index,t.index+1),i=[];for(let e of r)i.push({id:e.data.id,indent:!1});c.tell(n,o.LO.indent(n.id,i)),s.record(c)}else{const e=a.find_upstream_untill(n),t=l.find_upstream_untill(n);if(!e||!t)return;const r=n.items.slice(e.index,t.index+1),i=[];for(let e of r)i.push({id:e.data.id,indent:!0});c.tell(n,o.LO.indent(n.id,i)),s.record(c)}}function v(e,t=!1){const n=e,{cursor:r,courier:i,history:s}=e,{cube_start:a,cube_end:l}=r;if(!a||!l)return;const c=i.get_recorder();if(t){const e=a.find_upstream_untill(n),t=l.find_upstream_untill(n);if(!e||!t)return;const r=n.items.slice(e.index,t.index+1),i=[];for(let e of r)i.push({id:e.data.id,indent:!1});c.tell(n,o.A6.indent(n.id,i)),s.record(c)}else{const e=a.find_upstream_untill(n),t=l.find_upstream_untill(n);if(!e||!t)return;const r=n.items.slice(e.index,t.index+1),i=[];for(let e of r)i.push({id:e.data.id,indent:!0});c.tell(n,o.A6.indent(n.id,i)),s.record(c)}}var w=n(3028);function x(e,t="tail"){const{courier:n,history:r}=e,i=new w.vk(n),s=[o.XV.get_default(),o.XV.get_default()],a=o.ry.insert_row(e.id,t,[s]);i.tell(e,a),r.record(i)}async function k(e,t){e.preventDefault(),e.stopPropagation(),i.h_.cube=t,i.h_.point={x:e.clientX,y:e.clientY},i.h_.stack_pos.length=0,i.h_.stack_rect.length=0,i.h_.stack_menus.length=0,t instanceof o.p4?i.h_.menu=function(e){const t=[...M(e,!0),{usable:!0,title:"语言",icon:["iconfont","icon-square"],has_submenu:!0,mouseenter:t=>function(e){return{title:"选择语言",active:[e.active_tab?.lang||""],menus:e.langs.map(t=>({title:t,usable:!0,icon:["iconfont","icon-square"],mouseenter(e){},click(n){const{courier:r,history:i,id:s,active_tab:a}=e;if(!a)return;const l=r.get_recorder();l.tell(e,o.DW.change_lang(s,a.id,t)),i.record(l)}}))}}(e),click(e){}},{usable:!0,title:"主题",icon:["iconfont","icon-square"],has_submenu:!0,mouseenter:t=>function(e){return{title:"选择主题",active:[e.active_tab?.theme||""],menus:e.themes.map(t=>({title:t,usable:!0,icon:["iconfont","icon-square"],mouseenter(e){},click(n){const{courier:r,history:i,id:s,active_tab:a}=e;if(!a)return;const l=r.get_recorder();l.tell(e,o.DW.change_theme(s,a.id,t)),i.record(l)}}))}}(e),click(e){}},{usable:!0,title:"添加代码块",icon:["iconfont","icon-add"],click(t){(0,i.NW)({文件名:""},t=>{const n=t["文件名"],r=n.lastIndexOf(".");let i="typescript";if(r>=0){const e=n.slice(r);i=o.UF[e]||i}const{code_theme:s}=e.config.data,a=e.create_tab(i,n,s),l=e.courier.get_recorder();l.tell(e,o.DW.add(e.id,a)),e.history.record(l)})},mouseenter(e){}},{usable:!0,title:"重命名",icon:["iconfont","icon-rename"],click(t){const n={文件名:e.active_tab?.name||""};(0,i.NW)(n,t=>{const n=e.active_tab;if(!n)return;const r=t["文件名"],i=e.courier.get_recorder();i.tell(e,o.DW.rename(e.id,n.id,r)),e.history.record(i)})},mouseenter(e){}},{usable:!0,title:"复制代码",icon:["iconfont","icon-copy"],click(t){e.copy_code()},mouseenter(e){}},{usable:!0,title:"清空代码",icon:["iconfont","icon-eraser"],click(t){const n=e.active_tab;if(!n)return;const r=e.courier.get_recorder();r.tell(e,o.DW.update(e.id,n.id,"")),e.history.record(r)},mouseenter(e){}},{usable:!0,title:"删除代码",icon:["iconfont","icon-close"],click(t){const n=e.active_tab;if(!n)return;const r=e.courier.get_recorder();r.tell(e,o.DW.remove(e.id,n.id)),e.history.record(r)},mouseenter(e){}}];return{title:e.meta.cubename,active:[],menus:t}}(t):t instanceof o.Ku?i.h_.menu=function(e){const t=e.get_active_cell(),n=[...M(e,!0),{usable:!0,title:e.title?"移除标题":"添加标题",icon:["iconfont","icon-a-Addheader2x"],has_submenu:!1,mouseenter(e){},click(t){const{history:n,courier:r,id:i}=e,s=r.get_recorder();if(e.title){const t=o.en.remove_title(i);s.tell(e,t)}else{const t=o.XV.get_default(),n=o.en.add_title(i,t);s.tell(e,n)}n.record(s)}},{usable:e.selection_cells.length>0,title:"复制子表",icon:["iconfont","icon-grid"],has_submenu:!1,mouseenter(e){},click(t){const{clipboard:n}=e,r=a.F.tips,i=e.copy_selection_table();if(!i)return a.F.tips?.tip_error("复制子表失败");const s=e.get_selection_text();n.set_clipboard_cubedata(s,[i]),r?.tip_success("复制子表成功")}},{usable:e.selection_cells.length>0,title:"合并单元格",icon:["iconfont","icon-hebingdanyuange"],has_submenu:!1,mouseenter(e){},click(t){!function(e){const{courier:t,id:n,history:r}=e,i=a.F.tips,s=t.get_recorder(),l=e.get_selection_area();if(!l)return i?.tip_info("无选中单元格");s.tell(e,o.en.merge(n,l)),r.record(s)}(e)}},{usable:!!t,title:"扩大当前列宽",icon:["iconfont","icon-expand-horizontal-1--expand-resize-bigger-horizont"],has_submenu:!1,shortcut:"",mouseenter(e){},click(t){h(e,1)}},{usable:!!t,title:"缩小当前列宽",icon:["iconfont","icon-shrink-horizontal-1--resize-shrink-bigger-horizont"],has_submenu:!1,shortcut:"",mouseenter(e){},click(t){h(e,-1)}},{usable:!!t,title:"向左插入列",icon:["iconfont","icon-cc-arrow-left-square"],has_submenu:!1,shortcut:"ctrl + shift + ⇠",mouseenter(e){},click(t){l(e)}},{usable:!!t,title:"向右插入列",icon:["iconfont","icon-cc-arrow-right-square"],has_submenu:!1,shortcut:"ctrl + shift + ⇢",mouseenter(e){},click(t){c(e)}},{usable:!!t,title:"向上插入行",icon:["iconfont","icon-cc-arrow-up-square"],has_submenu:!1,shortcut:"ctrl + shift + ↑",mouseenter(e){},click(t){d(e)}},{usable:!!t,title:"向下插入行",icon:["iconfont","icon-cc-arrow-down-square"],has_submenu:!1,shortcut:"ctrl + shift + ⇣",mouseenter(e){},click(t){u(e)}},{usable:!!t,title:"向左插入单元格",icon:["iconfont","icon-cc-arrow-left-square"],has_submenu:!1,shortcut:"ctrl + ⇠",mouseenter(e){},click(t){l(e,!0)}},{usable:!!t,title:"向右插入单元格",icon:["iconfont","icon-cc-arrow-right-square"],has_submenu:!1,shortcut:"ctrl + ⇢",mouseenter(e){},click(t){c(e,!0)}},{usable:!!t,title:"向上插入单元格",icon:["iconfont","icon-cc-arrow-up-square"],has_submenu:!1,shortcut:"ctrl + ↑",mouseenter(e){},click(t){d(e,!0)}},{usable:!!t,title:"向下插入单元格",icon:["iconfont","icon-cc-arrow-down-square"],has_submenu:!1,shortcut:"ctrl + ⇣",mouseenter(e){},click(t){u(e,!0)}},{usable:!!t,title:"删除当前行",icon:["iconfont","icon-shanchuhang"],has_submenu:!1,shortcut:"",mouseenter(e){},click(t){!function(e){const{cursor:t,courier:n,stats:r,history:i,id:s}=e,l=a.F.tips,{cube_end:c}=t,d=e.get_active_cell();if(!d)return l?.tip_info("未发现激活单元格");if(!e.check_orderly_row(d.row))return l?.tip_info("当前行不整齐");{const t=n.get_recorder();t.tell(e,o.en.remove_row(s,d.row)),i.record(t)}}(e)}},{usable:!!t,title:"删除当前列",icon:["iconfont","icon-shanchulie"],has_submenu:!1,shortcut:"",mouseenter(e){},click(t){!function(e){const{cursor:t,courier:n,stats:r,history:i,id:s}=e,l=a.F.tips,{cube_end:c}=t,d=e.get_active_cell();if(!d)return l?.tip_info("未发现激活单元格");if(!e.check_orderly_col(d.col))return l?.tip_info("当前列不整齐");{const t=n.get_recorder();t.tell(e,o.en.remove_col(s,d.col)),i.record(t)}}(e)}},{usable:!!t,title:"删除当前单元格",icon:["iconfont","icon-list-delete-cell"],has_submenu:!1,shortcut:"",mouseenter(e){},click(t){!function(e){const{cursor:t,courier:n,stats:r,history:i,id:s}=e,l=a.F.tips,{cube_end:c}=t,d=e.get_active_cell();if(!d)return l?.tip_info("未发现激活单元格");const u=n.get_recorder();u.tell(e,o.en.remove_cell(s,d.box.id)),i.record(u)}(e)}}];return{title:e.meta.cubename,active:[],menus:n}}(t):t instanceof o.HR?i.h_.menu=function(e){const t=[...M(e)];return{title:e.meta.cubename,active:[],menus:t}}(t):t instanceof o.mM?i.h_.menu=function(e){const t=[...M(e,!0),{usable:!0,title:"添加块",shortcut:"",has_submenu:!1,icon:["iconfont","icon-add"],mouseenter(){},click(){!function(e){const{courier:t,history:n}=e,i=t.get_recorder(),s=[o.XV.get_default()];i.tell(e,r.VL.insert_child(e.id,s,e.child_count)),n.record(i)}(e)}},{usable:!0,title:"布局•限定列宽",shortcut:"",has_submenu:!0,icon:["iconfont","icon-circle"],mouseenter:()=>function(e){const t=[{usable:!0,title:120,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){m(e,120)}},{usable:!0,title:140,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){m(e,140)}},{usable:!0,title:160,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){m(e,160)}},{usable:!0,title:180,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){m(e,180)}},{usable:!0,title:200,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){m(e,200)}}];return{title:"限定列宽",active:[e.attrs.column_width],menus:t}}(e),click(){}},{usable:!0,title:"布局•限定列数",shortcut:"",has_submenu:!0,icon:["iconfont","icon-circle"],mouseenter:()=>function(e){const t=[{usable:!0,title:2,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){p(e,2)}},{usable:!0,title:3,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){p(e,3)}},{usable:!0,title:4,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){p(e,4)}},{usable:!0,title:5,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){p(e,5)}},{usable:!0,title:6,shortcut:"",has_submenu:!1,icon:["iconfont","icon-circle"],mouseenter(){},click(){p(e,6)}}];return{title:"限定列数",active:[e.attrs.column_count],menus:t}}(e),click(){}}];return{title:e.meta.cubename,active:[],menus:t}}(t):t instanceof o.Kw?i.h_.menu=function(e){const t=[...M(e),{usable:!0,title:"缩进",icon:["iconfont","icon-square"],shortcut:"tab",has_submenu:!1,mouseenter(){},click(t){b(e)}},{usable:!0,title:"反向缩进",icon:["iconfont","icon-square"],shortcut:"shift + tab",has_submenu:!1,mouseenter(){},click(t){b(e,!0)}},{usable:!0,title:"转换为有序列表",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{courier:n,history:i}=e,s=structuredClone(e.export());s.id=_.I.get_id(),s.type=g.u0.list_ordered;const o=e.pcube,a=e.index,l=n.get_recorder(),c=r.VL.delete_child(o.id,"backward",[a,a+1],!0),d=r.VL.insert_child(o.id,[s],a);l.tell(o,c,d),i.record(l)}},{usable:!0,title:"转换为待办列表",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{courier:n,history:i}=e,s=structuredClone(e.export());s.id=_.I.get_id(),s.type=g.u0.todo;for(let e of s.info)e.done=e.done||!1;const o=e.pcube,a=e.index,l=n.get_recorder(),c=r.VL.delete_child(o.id,"backward",[a,a+1],!0),d=r.VL.insert_child(o.id,[s],a);l.tell(o,c,d),i.record(l)}}];return{title:e.meta.cubename,active:[],menus:t}}(t):t instanceof o.NQ?i.h_.menu=function(e){const t=[...M(e),{usable:!0,title:"缩进",icon:["iconfont","icon-square"],shortcut:"tab",has_submenu:!1,mouseenter(){},click(t){y(e)}},{usable:!0,title:"反向缩进",icon:["iconfont","icon-square"],shortcut:"shift + tab",has_submenu:!1,mouseenter(){},click(t){y(e,!0)}},{usable:!0,title:"转换为无序列表",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{courier:n,history:i}=e,s=structuredClone(e.export());s.id=_.I.get_id(),s.type=g.u0.list;const o=e.pcube,a=e.index,l=n.get_recorder(),c=r.VL.delete_child(o.id,"backward",[a,a+1],!0),d=r.VL.insert_child(o.id,[s],a);l.tell(o,c,d),i.record(l)}},{usable:!0,title:"转换为待办列表",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{courier:n,history:i}=e,s=structuredClone(e.export());s.id=_.I.get_id(),s.type=g.u0.todo;for(let e of s.info)e.done=e.done||!1;const o=e.pcube,a=e.index,l=n.get_recorder(),c=r.VL.delete_child(o.id,"backward",[a,a+1],!0),d=r.VL.insert_child(o.id,[s],a);l.tell(o,c,d),i.record(l)}}];return{title:e.meta.cubename,active:[],menus:t}}(t):t instanceof o.k9?i.h_.menu=function(e){const t=[...M(e),{usable:!0,title:"缩进",icon:["iconfont","icon-square"],shortcut:"tab",has_submenu:!1,mouseenter(){},click(t){v(e)}},{usable:!0,title:"反向缩进",icon:["iconfont","icon-square"],shortcut:"shift + tab",has_submenu:!1,mouseenter(){},click(t){v(e,!0)}},{usable:!0,title:"转换为无序列表",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{courier:n,history:i}=e,s=structuredClone(e.export());s.id=_.I.get_id(),s.type=g.u0.list;const o=e.pcube,a=e.index,l=n.get_recorder(),c=r.VL.delete_child(o.id,"backward",[a,a+1],!0),d=r.VL.insert_child(o.id,[s],a);l.tell(o,c,d),i.record(l)}},{usable:!0,title:"转换为有序列表",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{courier:n,history:i}=e,s=structuredClone(e.export());s.id=_.I.get_id(),s.type=g.u0.list_ordered;const o=e.pcube,a=e.index,l=n.get_recorder(),c=r.VL.delete_child(o.id,"backward",[a,a+1],!0),d=r.VL.insert_child(o.id,[s],a);l.tell(o,c,d),i.record(l)}}];return{title:e.meta.cubename,active:[],menus:t}}(t):t instanceof o.fC?i.h_.menu=function(e){const t=[{usable:!0,title:"下载",icon:["iconfont","icon-download"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){e.event.emit_asset_download("image",e.info)}},{usable:!0,title:"复制到粘贴板",icon:["iconfont","icon-copy"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const n=e.dom?.querySelector("img");if(!n)return a.F.tips?.tip_error("复制失败");fetch(n.src).then(e=>e.blob()).then(async t=>{const n=new ClipboardItem({"image/png":t});await e.clipboard.set_clipboard_data(n)&&a.F.tips?.tip_success("复制成功🍊")})}},{usable:!0,title:"文字环绕",icon:["iconfont","icon-square"],shortcut:"",has_submenu:!0,mouseenter:()=>function(e){return{title:"文字环绕",active:[],menus:[{usable:!0,title:"无环绕",icon:["iconfont","icon-close"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{history:n}=e;n.record(e.clear_float())}},{usable:!0,title:"左环绕",icon:["iconfont","icon-floatleft"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{history:n}=e;n.record(e.float("L"))}},{usable:!0,title:"右环绕",icon:["iconfont","icon-floatright"],shortcut:"",has_submenu:!1,mouseenter(){},click(t){const{history:n}=e;n.record(e.float("R"))}}]}}(e),click(e){}}];return{title:e.meta.cubename,active:[],menus:t}}(t):t instanceof o.RQ&&(i.h_.menu=function(e){const t=[...M(e,!1),{usable:!0,title:"向下插入行",shortcut:"ctrl + enter",icon:["iconfont","icon-cc-arrow-down-square"],mouseenter(){},click(){const{cursor:t}=e,{cube_end:n}=t;if(!n)return;const r=n.find_upstream_untill(e);r instanceof o.XV&&x(e,Math.floor(r.index/2)+1)}},{usable:!0,title:"向上插入行",shortcut:"ctrl + shift + enter",icon:["iconfont","icon-cc-arrow-up-square"],mouseenter(){},click(){const{cursor:t}=e,{cube_end:n}=t;if(!n)return;const r=n.find_upstream_untill(e);r instanceof o.XV&&x(e,Math.floor(r.index/2))}}];return{title:e.meta.cubename,active:[],menus:t}}(t))}function S(e,t,n,r=5){e.width,Math.abs(e.y-n.y),e.width,Math.abs(e.height-(n.y+n.height)),Math.abs(n.x-e.x),e.height;const i={width:Math.abs(e.width-(n.x+n.width)),height:e.height};if(s.MathRect.can_include(i,t)){const i=n.y+t.height-e.height;return{x:n.x+n.width+r,y:i<0?n.y:n.y-i}}{const i=n.y+t.height-e.height;return{x:n.x-t.width-r,y:i<0?n.y:n.y-i}}}function C(e,t){const{courier:n,history:i}=e,s=n.get_recorder(),a=e.pcube;if("A"===t)if(e instanceof o.HR){const t=o.HR.get_default();s.tell(a,r.VL.insert_child(a.id,[t],e.index+1))}else{const t=o.gK.get_default(),n=r.VL.insert_child(a.id,[t],e.index+1);s.tell(a,n)}else if("B"===t&&e)if(e instanceof o.HR){const t=o.HR.get_default();s.tell(a,r.VL.insert_child(a.id,[t],e.index))}else{const t=o.gK.get_default(),n=r.VL.insert_child(a.id,[t],e.index);s.tell(a,n)}i.record(s)}function M(e,t=!1){const n=[{usable:!0,title:"向前插入行",icon:["iconfont","icon-circle"],has_submenu:!1,mouseenter(e){},click(t){C(e,"B")}},{usable:!0,title:"向后插入行",icon:["iconfont","icon-circle"],has_submenu:!1,mouseenter(e){},click(t){C(e,"A")}}],r={usable:!0,title:"全屏",icon:["iconfont","icon-square"],has_submenu:!1,mouseenter(e){},click(t){e.dom?.requestFullscreen()}};return t&&n.push(r),n}},2160:(e,t,n)=>{"use strict";n.d(t,{R:()=>r.R});var r=n(7977)},2332:(e,t,n)=>{"use strict";n.d(t,{M:()=>C});var r=n(7633),i=n(4743),s=n(3028),o=n(9927),a=n(9513),l=n(3097),c=n(4823),d=n(7852),u=n(2411),h=n(539),p=n(685),m=n(1490),f=n(2773),_=n(6517),g=n(9788),b=n(3347),y=n(4e3),v=n(2519),w=n(2551),x=n(3447),k=n(8304),S=n(8631);class C extends l.j{_scopes=(0,r.Gc)(new Set);_dom;_children=(0,r.Gc)([]);_courier;_history;_cursor;_config;_clipboard;_painter;_event;_stats;_hotkeys;_cubes;_listener;_isdev=!1;constructor(){super(),this._cubes=new u.h(this),this._hotkeys=new h.Wu(this),this._config=new g.B(this),this._cursor=new b.P(this),this._courier=new y.W(this),this._history=new s.PI(this),this._clipboard=new _.F(this),this._painter=new f.W(this),this._event=new m.z(this),this._stats=new p.I(this),this._listener=new d.t(this),Promise.resolve().then(()=>this._cubes.add_cube(this)),this.set_cmd_handler(a.zS.cube_reset,this.on_reset.bind(this)),this.set_cmd_handler(a.zS.cube_reorder,this.on_cube_reorder.bind(this)),this.set_cmd_handler(a.zS.cube_insert_child,this.on_insert_cube.bind(this)),this.set_cmd_handler(a.zS.cube_delete_child,this.on_delete_cube.bind(this)),this.set_cmd_handler(a.zS.cube_set_selection_css,this.on_cube_set_selection_css.bind(this)),this.set_cmd_handler(a.zS.cube_insert,this.on_cube_insert.bind(this)),this.set_cmd_handler(a.zS.cube_delete,this.on_cube_delete.bind(this)),this.set_cmd_handler(a.zS.cube_set_attr,this.on_cube_set_attr.bind(this)),this.set_cmd_handler(a.K9.cursor_in_tail,this.on_cursor_in_tail.bind(this)),v.o.init_cmd_handler(this)}get editable(){return!0}get config(){return this._config}get hotkeys(){return this._hotkeys}get stats(){return this._stats}get cubes(){return this._cubes}get cursor(){return this._cursor}get listener(){return this._listener}get courier(){return this._courier}get history(){return this._history}get clipboard(){return this._clipboard}get painter(){return this._painter}get event(){return this._event}get root(){return this}get isdev(){return this._isdev}get dom(){return document.getElementById(this.id)}get clientRect(){return this.dom?.getBoundingClientRect()}get clientRects(){return this.dom?.getClientRects()}get pid(){}get index(){return 0}get css(){return Object.assign({},this.data.css)}get attrs(){return Object.assign({},this.data.attrs)}get info(){return this.data.info}get child_count(){return this._children.length}get child_first(){return this._children[0]}get child_last(){return this._children[this._children.length-1]}get id(){return this.data.id}get pcube(){}get type(){return this.data.type}get versions(){return Object.assign({},this.data.versions)}get level(){return 0}get in_postil(){return!1}get host_postil(){return null}get next_cube_deep(){}get prev_cube_deep(){}get root_dom(){return this._dom}get is_empty(){const e=1===this.child_count,t=this.child_first.is_empty;return e&&t}get prev_cube(){}get next_cube(){}get host_node(){}get scope(){return new Set([...this._scopes])}get scope_normal(){const e=new Set;for(let t of this.scope)t.freeze||e.add(t);return e}get scope_freeze(){const e=new Set;for(let t of this.scope)t.freeze&&e.add(t);return e}get scope_count_normal(){return this._scopes.size-this.scope_count_freeze}get scope_count_freeze(){let e=0;for(let t of this.scope)t.freeze&&e++;return e}set_dev(e=!0){this._isdev=e,window.root=this}find_child_cube(e){return this._children.find(t=>t.id===e)}find_child_index(e){return this.children.findIndex(t=>t.id===e)}find_next_cube(e){const t=this.find_child_index(e);return this.children[t+1]}find_prev_cube(e){const t=this.find_child_index(e);return this.children[t-1]}is_contains_cube(e){return!!e&&e.root===this}get_valid_index(e){return"head"===e?0:"tail"===e?this.child_count:e<0?0:e>this.child_count?this.child_count:e}copy(e,t){const n=this._children.slice(e,t),r=[];for(let e of n){let t=e.export();r.push(t)}return r}find_cube(e){return this.cubes.find_cube(e)}filter(e){const t=[];for(let n of this.children)e(n)&&t.push(n),t.push(...n.filter(e));return t}each(e){for(let t of this.children)e(t),t.each(e)}find_upstream_untill(){}add_scope_by_cube(e){const t=new c.R(this,e);this._scopes.add(t),this.event.emit_status_update()}add_scope(e=!1){if(e){const e=this.cursor.cube_end;if(!e||e instanceof C)return w.F.tips?.tip_warning("光标未在有效块内");this.add_scope_by_cube(e)}else{const e=this.stats.view_point,t=this.cursor.find_cube_by_coor(e);if(!t||t instanceof C)return w.F.tips?.tip_warning("光标未在有效块内");this.add_scope_by_cube(t)}}remove_scope(e){for(let t of this._scopes)if(t.id===e){this._scopes.delete(t);break}}clear_scope(e=!0){for(let t of this._scopes)e&&t.freeze||this._scopes.delete(t)}freeze_scopes(){for(let e of this._scopes)e.freeze=!0}sort_scope(){const e=[...this._scopes];return e.sort((e,t)=>e.pos.y-t.pos.y),e}get_scope_cubes(e=!1,t=!0){if(0===this._scopes.size)return[];const n=[],r=e?this.sort_scope():this.scope;for(let e of r)t&&e.freeze||n.push(e.get_scope_info());return n}get_scope_cubes_data(){const e=this.get_scope_cubes(),t=[];for(let n of e)t.push(...n.cube.copy(n.range[0],n.range[1]));return t}delete_edge(e,t){const{courier:n}=this,r=new s.vk(n);if("backward"===t){const t=e.find_upstream_untill(this);if(t&&t.is_empty)return t.remove_self();const n=e.prev_cube_deep;if(n&&n.is_empty)return n.remove_self();const i=n?.next_cube;if(i&&n.type===i.type)return i.merge("left");if(n)return r.tell(n,k.U.in_tail(n.id))}else{const t=e.find_upstream_untill(this);if(t&&t.is_empty)return t.remove_self();const n=e.next_cube_deep;if(n&&n.is_empty)return n.remove_self();const i=n?.prev_cube;if(i&&n.type===i.type)return n.merge("left");if(n)return r.tell(n,k.U.in_tail(n.id))}}splice(e,t,...n){const r=this._children.splice(e,t,...n);for(let e of r)e.gc();const i=[];for(let e of r)i.push(e.export());return{children:r,data:i}}get_sdk_version(){return o.K.get_sdk_meta()}on_reset(e){const{courier:t}=this,{data:n}=e,r=t.get_recorder();r.add_cmd(e);const i=this.export().info,s=S.I.build_cubes(n,this);return this.splice(0,this.child_count,...s),r.add_recover(x.V.reset(this.id,i)),r}on_cube_reorder(e){const{courier:t,history:n,cursor:r}=this,{cubeid:i,index:o}=e,a=this.find_child_cube(i);if(!a||a.index===o)return;const l=new s.vk(t);let c=0,d=a.index;return"tail"===o?c=this.child_count:"number"==typeof o&&(c=o),this.splice(d,1),this.splice(c,0,a),l.add_recover(x.V.reorder(this.id,a.id,d)),l}on_insert_cube(e){const{courier:t}=this,n=t.get_recorder();n.add_cmd(e);const{pos:r,data:s}=e;if(0===s.length)return n;const o=[];for(let e of s)e.type===a.u0.box_root&&o.push(new i.HR(e,this));let l=this.get_valid_index(r);this.splice(l,0,...o);const c=o[o.length-1];return c&&n.tell(c,k.U.in_tail(c.id,0)),n.add_recover(x.V.delete_child(this.id,"backward",[l,l+o.length])),n}on_delete_cube(e){const{courier:t,pcube:n,pid:r}=this,{dir:i,range:s}=e,[o,a]=s,l=t.get_recorder();l.add_cmd(e);const c=this.children[o-1],d=this.children[a],u=a-o;if(o!==a){if(o<=0&&a>=this.child_count){const e=this.child_first;return this.child_count>1&&l.tell(this,x.V.delete_child(this.id,i,[1,this.child_count])),e.is_empty||l.tell(e,x.V.reset(e.id,[])),l}{let e=this.splice(o,u);c&&"backward"===i||!d?l.tell(c,k.U.in_tail(c.id,0)):(d&&"forward"===i||!c)&&l.tell(d,k.U.in_head(d.id,0));const t=e.data;l.add_recover(x.V.insert_child(this.id,t,o))}return l}}on_cube_set_selection_css(e){const{cursor:t,courier:n,pcube:r,pid:i}=this,{css:o,start_id:a,end_id:l,offset_end:c,offset_start:d}=e,u=new s.vk(n);if(a!==l||c!==d){if(l&&!a){const e=this.find_cube(l),t=e?.find_upstream_untill(this);if(!t)return;const n=this.children.slice(0,t.index);for(let e of n)u.tell(e,x.V.set_selection_css(e.id,o,e.id,e.id,"head","tail"));return u.tell(t,x.V.set_selection_css(t.id,o,null,l,"head",c)),u}if(a&&!l){const e=this.find_cube(a),t=e?.find_upstream_untill(this);if(!t)return;const n=this.children.slice(t.index+1);for(let e of n)u.tell(e,x.V.set_selection_css(e.id,o,e.id,e.id,"head","tail"));return u.tell(t,x.V.set_selection_css(t.id,o,a,null,d,"tail")),u}if("tail"===c&&"head"===d){for(let e of this.children)u.tell(e,x.V.set_selection_css(e.id,o,e.id,e.id,"head","tail"));return u}if(l&&a){const e=this.find_cube(a),t=this.find_cube(l),n=e?.find_upstream_untill(this),r=t?.find_upstream_untill(this);if(!n||!r)return;const i=this.children.slice(n.index+1,r.index);for(let e of i)u.tell(e,x.V.set_selection_css(e.id,o,e.id,e.id,"head","tail"));return u.tell(n,x.V.set_selection_css(n.id,o,a,null,d,"tail")),u.tell(r,x.V.set_selection_css(r.id,o,null,l,"head",c)),u}}}on_cube_insert(e){if(0===e.data.length)return;const{courier:t,cursor:n,pid:r,pcube:i}=this,o=new s.vk(t),{data:a,end_id:l,start_id:c,offset_end:d,offset_start:u}=e,h=this.find_cube(c),p=this.find_cube(l),m=h?.find_upstream_untill(this),f=p?.find_upstream_untill(this);if(!m||!f)return o;if(p!==h||u!==d)if(m&&m===f)o.tell(m,x.V.delete(m.id,"backward",c,l,u,d)),o.tell(m,x.V.insert(m.id,a,c,l,u,d));else{o.tell(f,x.V.delete(f.id,"backward",null,l,"head",d)),o.tell(this,x.V.delete_child(this.id,"backward",[m.index+1,f.index])),o.tell(this,x.V.insert_child(this.id,e.data,m.index+1)),o.tell(m,x.V.delete(m.id,"backward",c,null,u,"tail"));let t=e.data[e.data.length-1];if(t){const e=this.find_child_cube(t.id);e&&o.tell(e,k.U.in_tail(t.id,0))}}else o.tell(p,x.V.insert(l,a,c,l,u,d));return o}on_cube_delete(e){const{courier:t,cursor:n}=this,{dir:r,start_id:o,end_id:a,offset_end:l,offset_start:c,reserve:d}=e,u=new s.vk(t);if(!o&&a){const e=this.find_cube(a),t=e?.find_upstream_untill(this);if(!t||!e)return;return u.tell(this,x.V.delete_child(this.id,r,[0,t.index])),u.tell(t,x.V.delete(t.id,r,o,a,"head",l)),u}if(o&&!a){const e=this.find_cube(o),t=e?.find_upstream_untill(this);if(!t||!e)return;return u.tell(this,x.V.delete_child(this.id,r,[t.index+1,this.child_count])),u.tell(t,x.V.delete(t.id,r,o,a,c,l)),u}if("head"===c&&"tail"===l)return u.tell(this,x.V.reset(this.id,[])),u;if(o&&a){const e=this.find_cube(o),t=this.find_cube(a);if(!(e instanceof i.P6&&t instanceof i.P6))return;const n=e.find_upstream_untill(this),s=t.find_upstream_untill(this);if(!n||!s)return u;const d=n.index,h=s.index;if(o!==a||c!==l)if(n===s)u.tell(n,x.V.delete(n.id,r,o,a,c,l,!0));else{u.tell(s,x.V.delete(s.id,r,null,a,"head",l)),u.tell(this,x.V.delete_child(this.id,"backward",[d+1,h])),u.tell(n,x.V.delete(n.id,r,o,null,c,"tail",!0));let t=0;if("number"==typeof c&&(t=c),u.tell(n,x.V.merge(n.id,"right",o,t)),n.is_empty)u.tell(this,x.V.delete_child(this.id,"backward",[n.index,n.index+1]));else if(e instanceof i.P6){const n=e.pcube;u.tell(n,x.V.merge(n.id,"right",o,t))}}return u}}on_cube_set_attr(e){const{courier:t,cursor:n}=this,{attr:i}=e,s=t.get_recorder();if(s.add_cmd(e),0===Object.keys(i).length)return;const o={};for(let e in i){const t=i[e];o[e]=structuredClone((0,r.ux)(this.attrs[e]))||null,null===t?delete this.attrs[e]:this.attrs[e]=t}return s.add_recover(x.V.set_attr(this.id,o)),s}on_cursor_in_tail(e){const{offset:t}=e,{courier:n}=this,r=this.child_last,i=new s.vk(n);if(r)return i.tell(r,k.U.in_tail(r.id,t)),i}}},2411:(e,t,n)=>{"use strict";n.d(t,{h:()=>a});var r=n(7633),i=n(4743),s=n(3923),o=n(9513);class a extends s.K{_map=(0,r.Gc)({});_types=(0,r.Gc)(new Map);_count=(0,r.Gc)({});constructor(e){super(e)}get postils(){return this._types.get(o.u0.postil)||new Map}get meta(){return a.meta}get_types_cube(e){return this._types.get(e)||new Map}add_cube(e){const t=e.id,n=e.meta.type;void 0===this._count[t]?this._count[t]=1:this._count[t]++,this._map[t]=e;const i=this._types.get(n);i?i.set(t,e):this._types.set(n,(0,r.Gc)(new Map([[t,e]])))}remove_cube(e){const t=e.id,n=e.meta.type;0===--this._count[t]&&(delete this._map[t],this._types.get(n)?.delete(t))}find_cube(e){return this._map[e]}find_postil(e){for(let t of Object.values(this.postils)){if(t.id===e)return t;const n=t.find_cube(e);if(n)return n}}clear_all_map_selected(){const e=this.get_types_cube(o.u0.submap);if(e)for(let[t,n]of e)n.clear_node_selected();this.root instanceof i.EU&&this.root.clear_node_selected()}static get meta(){return{type:o.Mu.cubes,version:1}}}},2519:(e,t,n)=>{"use strict";n.d(t,{o:()=>i,H:()=>s});const r=new Map;class i{static get_cmd_handler(e,t){const n=r.get(e);return n?.get(t)}static set_cmd_handler(e,t,n){let i=r.get(e);i?i.set(t,n):(i=new Map,i.set(t,n),r.set(e,i))}static init_cmd_handler(e){const t=e.meta,n=r.get(t.type);if(n)for(let[t,r]of n)e.set_vip_cmd_handler(t,r.bind(e))}}function s(e){return(t,n)=>{const r=t[n];if(!r)return;const s=t.meta;i.set_cmd_handler(s.type,e,r)}}},2551:(e,t,n)=>{"use strict";n.d(t,{F:()=>r});class r{static _funcs=new Map;static get url(){return this._funcs.get("asset-url")}static get tips(){return this._funcs.get("tip")}static register_asset_url(e){this._funcs.set("asset-url",e)}static register_tip(e){this._funcs.set("tip",e)}}},2698:(e,t,n)=>{"use strict";n.d(t,{M:()=>i});var r=n(9204);class i extends r._{}},2773:(e,t,n)=>{"use strict";n.d(t,{W:()=>l});var r=n(7633),i=n(4116),s=n(3028),o=n(6753),a=n(9513);class l extends o.K{_format_brush=null;get meta(){return l.meta}get format_brush(){const e={};return this._format_brush&&Object.assign(e,this._format_brush),e}constructor(e){super(e)}paint(e,t=!1){const{root:n,cursor:o,history:a,courier:l}=this,c=new s.vk(l);if(!e)return;const d=structuredClone((0,r.ux)(e));if(d["text-align"]){const t=e["text-align"];c.merge(this.text_align(t)),delete d["text-align"]}if(n.scope_count_normal>0){const e=n.get_scope_cubes();for(let n of e){const e=n.cube;for(let r of e.children.slice(...n.range))c.tell(r,i.VL.set_css(r.id,structuredClone(d),t))}}else{const{cube_selection:e,cube_start:n,cube_end:r,offset_start:s,offset_end:a}=o;if(!e||!n||!r)return;const l=i.VL.set_selection_css(e.id,d,n.id,r.id,s,a,t);c.tell(e,l)}a.record(c)}clear(){const{root:e,cursor:t,history:n,courier:r}=this,o=new s.vk(r),a={};if(e.scope_count_normal>0){const t=e.get_scope_cubes();for(let e of t){const t=e.cube;for(let n of t.children.slice(...e.range))o.tell(n,i.VL.set_css(n.id,structuredClone(a),!1,!0))}}else{const{cube_selection:e,cube_start:n,cube_end:r,offset_start:s,offset_end:l}=t;if(!e||!n||!r)return;const c=i.VL.set_selection_css(e.id,a,n.id,r.id,s,l,!1,!0);o.tell(e,c)}n.record(o)}text_align(e){const{root:t,cursor:n,history:r,courier:o}=this,a=new s.vk(o),l={"text-align":e};if(t.scope_count_normal>0){const e=t.get_scope_cubes();for(let t of e){const e=t.cube;for(let n of e.children.slice(...t.range))a.tell(n,i.VL.set_css(n.id,structuredClone(l)))}}else{const e=t.cursor.find_selection_lines();for(let t of e){const e=i.VL.set_css(t.id,structuredClone(l));a.tell(t,e)}}return a}indent(){const{root:e,cursor:t,history:n,courier:r,config:o}=this,a=new s.vk(r);if(e.scope_count_normal>0){const t=e.get_scope_cubes();for(let e of t){const t=e.cube;for(let n of t.children.slice(...e.range)){const e=n.attrs.indent>0?n.attrs.indent+1:1;a.tell(n,i.VL.set_attr(n.id,{indent:e}))}}}else{const e=t.find_selection_lines();for(let t of e){const e=t.attrs.indent||0,n=e>0?e+1:1;a.tell(t,i.VL.set_attr(t.id,{indent:n}))}}n.record(a)}unindent(){const{root:e,cursor:t,history:n,courier:r}=this,o=new s.vk(r);if(e.scope_count_normal>0){const t=e.get_scope_cubes();for(let e of t){const t=e.cube.children.slice(...e.range);for(let e of t){let t=e.attrs.indent;t>0&&o.tell(e,i.VL.set_attr(e.id,{indent:t-1}))}}}else{const e=t.find_selection_lines();for(let t of e){const e=t.attrs.indent||0;e>0&&o.tell(t,i.VL.set_attr(t.id,{indent:e-1}))}}n.record(o)}copy_format(){const{root:e,cursor:t}=this;if(e.scope_count_normal>0){const t=[...e.scope_normal][0].focus_cube;this._format_brush=structuredClone((0,r.ux)(t.css))}else{const{cube_focus:e}=t;if(!e)return;this._format_brush=structuredClone((0,r.ux)(e.css))}}apply_format_brush(){const e=this._format_brush;if(!e)return;const{root:t,courier:n,history:r}=this,o=new s.vk(n);if(t.scope_count_normal>0){const n=t.get_scope_cubes();for(let t of n)for(let n of t.cube.children.slice(...t.range)){const t=i.VL.set_css(n.id,e,!1,!0);o.tell(n,t)}}else{const{cube_selection:e,cube_end:t,cube_start:n,offset_start:r,offset_end:s}=this.cursor;if(!e||!t||!n)return;const a=i.VL.set_selection_css(e.id,this.format_brush,n.id,t.id,r,s,!1,!0);o.tell(e,a)}r.record(o)}static get meta(){return{type:a.Mu.painter,version:1}}}},3028:(e,t,n)=>{"use strict";n.d(t,{PI:()=>u,C6:()=>d,vk:()=>h});var r=n(7633),i=n(4089),s=n(9513),o=n(6753),a=n(2551),l=n(3923),c=n(8631);class d extends l.K{_record;_resolve;_status=s.yn.pending;_p=Promise.resolve();_prev_tip_remove;get meta(){return d.meta}get status(){return this._status}constructor(e,t){const n=a.F.tips;super(e),this._record=t,this._prev_tip_remove=n?.tip_info("播放器已就绪,点我播放",1/0,this.play.bind(this))}waiting(){return new Promise(e=>{this._resolve=e,[s.yn.pending,s.yn.playing].includes(this.status)&&e()})}clear_message(){this._prev_tip_remove&&this._prev_tip_remove()}async play(){const e=a.F.tips;this.clear_message(),this.status!==s.yn.stop&&(this._status=s.yn.playing,this._prev_tip_remove=e?.tip_info("正在演示,点此暂停",1/0,this.pause.bind(this)));for(let e of this._record.stack){const t=this.courier.get_recorder();for(let n of e.do){await c.I.sleep(this.config.data.player_speed),await(0,i.dY)(),this.stats.showing=!0;let e=this.root.find_cube(n.id);e?(e.dom?.scrollIntoView({inline:"nearest",block:"nearest",behavior:"smooth"}),t.tell(e,n)):console.warn(`未发现演示cube:${n}`)}await(0,i.dY)(),this.history.record(t),await this.waiting()}this._status=s.yn.stop,this.clear_message(),this.stats.showing=!1,e?.tip_success("演示完毕",9e3)}pause(){const e=a.F.tips;this.clear_message(),this._status!==s.yn.stop&&(this._status=s.yn.pause,this.stats.showing=!1,this._prev_tip_remove=e?.tip_info("暂停演示,点此恢复",1/0,this.continue.bind(this)))}continue(){const e=a.F.tips;this.clear_message(),this._status!==s.yn.stop&&(this._resolve&&this._resolve(),this._status=s.yn.playing,this._prev_tip_remove=e?.tip_info("正在演示,点此暂停",1/0,this.pause.bind(this)))}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:s.Mu.player,version:1}}}class u extends o.K{stack_undo=(0,r.Gc)([]);stack_redo=(0,r.Gc)([]);get meta(){return u.meta}get len_undo(){return this.stack_undo.length}get len_redo(){return this.stack_redo.length}constructor(e){super(e)}execute_command_group(e){const t=(e,n,r)=>{n<r.length&&(0,i.dY)(()=>{this.courier.pass(e),t(r[n+1],n+1,r)})};t(e[0],0,e)}undo(){const e=a.F.tips;if(this.stats.is_read_mode)return e?.tip_info("阅读模式不可操作");if(!this.courier)return;const t=this.stack_undo.pop();if(!t)return e?.tip_info("已无更多记录");this.stack_redo.push(t);const n=t.stack_undo;this.execute_command_group(n),this.event.emit_status_update()}redo(){const e=a.F.tips;if(this.stats.is_read_mode)return e?.tip_info("阅读模式不可操作");if(!this.courier)return;const t=this.stack_redo.pop();if(!t)return e?.tip_info("已无更多记录");this.stack_undo.push(t);const n=t.stack_do;this.execute_command_group(n),this.event.emit_status_update()}record(e){if(!this.stats.is_read_mode&&0!==e.stack_undo.length){if(this.config.data.history_length>0&&this.config.data.history_length<Number.POSITIVE_INFINITY){const e=this.stack_undo.length-this.config.data.history_length;e>0&&this.stack_undo.splice(0,e)}this.stack_undo.push(e),this.event.emit_status_update()}}play(e){return new d(this.root,e)}export(e=0){const t=this.stack_undo.slice(e),n={version:this.meta.version,stack:[],docid:this.root.id};for(let e of t)n.stack.push({do:e.stack_do,undo:e.stack_undo});return n}download(e="record.json"){const t=this.export(),n=document.createElement("a");n.download="filename";const r=new Blob([JSON.stringify(t)],{type:"text/plain"});n.href=URL.createObjectURL(r),n.click()}update_data(...e){return{}}clear_stack(){this.stack_undo.length=0,this.stack_redo.length=0,this.event.emit_status_update()}static get meta(){return{type:s.Mu.history,version:1}}}class h{do=[];undo=[];courier;get stack_do(){const e=[];return e.push(...this.do),e}get stack_undo(){const e=[];return e.push(...this.undo),e}constructor(e){this.courier=e}add_cmd(e){this.do.push(structuredClone((0,r.ux)(e)))}add_recover(e){e&&this.undo.unshift(e)}pass(e){let t=this.courier.pass(e);t instanceof h&&this.merge(t)}tick(e,t){(0,i.dY)(()=>{t?this.tell(t,e):this.courier.pass(e)})}tell(e,...t){const n=a.F.tips;if(this.courier.stats.mode===s.fv.read)return n?.tip_info("只读模式不可操作"),this;for(let n of t){if(!e||e.id!==n.id)return this;console.log("🟩",e,e.type,n),this.courier.event.emit_edit_before(e,n),this.merge(e.on(n)),this.courier.event.emit_edit_after(e,n)}return this}merge(e){return e instanceof h?(this.do.push(...structuredClone((0,r.ux)(e.stack_do))),this.undo.unshift(...structuredClone((0,r.ux)(e.stack_undo))),this):this}}},3097:(e,t,n)=>{"use strict";n.d(t,{j:()=>r});class r{handler=new Map;vip_handler=new Map;constructor(){}on(e){const t=this.get_vip_cmd_handler(e.name)||this.get_cmd_handler(e.name);if(t)return t(e)}get_cmd_handler(e){return this.handler.get(e)}get_vip_cmd_handler(e){return this.vip_handler.get(e)}set_cmd_handler(e,t){this.handler.set(e,t)}set_vip_cmd_handler(e,t){this.vip_handler.set(e,t)}static get_default(...e){throw Error("sub-cube have't implement get_default method")}static get meta(){throw Error("sub-cube have't implement attribution meta")}}},3347:(e,t,n)=>{"use strict";n.d(t,{P:()=>u});var r=n(1068),i=n(4743),s=n(4116),o=n(8631),a=n(9513),l=n(3028),c=n(6753),d=n(4089);class u extends c.K{selection;cursor_step=20;scroll_distance=50;safa_distance=20;get meta(){return u.meta}get has_selection(){return!this.selection.isCollapsed}get client_rect(){return this.range?.getBoundingClientRect()}get client_rects(){return this.range?.getClientRects()}get range(){if(0!==this.selection?.rangeCount)return this.selection?.getRangeAt(0)}get ranges(){const e=[];for(let t=0;t<this.selection.rangeCount;t++)e.push(this.selection.getRangeAt(0));return e}get offset_start(){return this.range?this.range?.startOffset:-1}get offset_end(){return this.range?this.range?.endOffset:-1}get node_start(){return this.range?.startContainer}get node_end(){return this.range?.endContainer}get node_focus(){return this.selection.focusNode}get node_anchor(){return this.selection.anchorNode}get top_edge(){return this.safa_distance}get bottom_edge(){return document.documentElement.clientHeight-this.safa_distance}get cube_selection(){if(!this.range)return;const e=this.range.commonAncestorContainer,t=this.stats.active_root;return t&&this.get_node_cube(e,t)||this.get_node_cube(e,this.root)}get cube_start(){const e=this.range,t=this.cube_selection;if(!e||!t)return;const n=e.startContainer,r=this.get_node_cube(n,t);return r instanceof s._D?r:void 0}get cube_end(){const e=this.range,t=this.cube_selection;if(!e||!t)return;const n=e.endContainer,r=this.get_node_cube(n,t);return r instanceof s._D?r:void 0}get cube_focus(){const e=this.cube_selection,t=this.node_focus;if(!e||!t)return;const n=this.get_node_cube(t,e);return n instanceof s._D?n:void 0}get cube_anchor(){const e=this.cube_selection,t=this.node_anchor;if(!e||!t)return;const n=this.get_node_cube(t,e);return n instanceof s._D?n:void 0}constructor(e){super(e);let t=window.getSelection();if(!t)throw Error("NoteCursor : can't find Selection API");this.selection=t}move_up_by_coor(){}locate_next_line(e,t,n){let s="up"===e?t.prev_line:t.next_line;const o=t.clientRect;let a=s?.clientRect;for(;s&&a&&o&&(a.left>=o.right||a.right<=o.left);){let t="up"===e?s.prev_line:s.next_line;if(!t)break;s=t,a=t.clientRect}if(!s)return;const l=[],c=new Map;for(let e of s.children)if(e instanceof i.P6){let t=e.clientRects;if(!t)continue;for(let n=0;n<t.length;n++)l.push(t[n]),c.set(t[n],e)}const d="up"===e?r.MathRect.get_rect_point(n.left,r._RectPosition.left_mid):r.MathRect.get_rect_point(n.left,r._RectPosition.right_mid),u=r.MathRect.get_nearest_rect(d,l);if(!u)return;const h=r.MathRect.get_shadow_point_horizental(d,u),p=document.caretPositionFromPoint(h.x,h.y);if(p&&p.offsetNode instanceof Text)this.set_cursor(p.offsetNode,p.offset);else if(p&&!(p.offsetNode instanceof Text)){const e=c.get(u);if(!e)return;e.set_cursor_in_tail()}}locate_current_line(e,t,n){const s=[],o=[],a=new Map;for(let e of t.children)if(e instanceof i.P6){let t=e.clientRects;if(!t)continue;for(let n=0;n<t.length;n++){const r=t[n];s.push(r),a.set(r,e)}}if(1===s.length)return!1;if("up"===e){const e=n.left.top;for(let t of s)t.bottom<=e&&o.push(t)}else if("down"===e){const e=n.right.bottom;for(let t of s)t.y>=e&&o.push(t)}if(o.length>0){const t="down"===e?{x:n.right.x,y:n.right.y}:{x:n.left.x,y:n.left.y},i=r.MathRect.get_nearest_rect(t,o);if(!i)return!1;const s=r.MathRect.get_shadow_point_horizental(t,i),l=document.caretPositionFromPoint(s.x,s.y);if(l&&l.offsetNode instanceof Text)return this.set_cursor(l.offsetNode,l.offset),!0;{const e=a.get(i);if(!e)return!1;e.set_cursor_in_tail()}}return!1}move_vertical(e){const{cube_start:t,cube_end:n}=this;if(!(t instanceof i.P6&&n instanceof i.P6))return;const r="up"===e?t.line:n.line,s=this.get_selection_edge_position();r&&s&&(this.locate_current_line(e,r,s)||this.locate_next_line(e,r,s))}move_left(){if(!this.range)return;const{cube_start:e,offset_start:t,offset_end:n,node_end:r}=this,{doc:o,courier:a}=this,c=new l.vk(a);if(e instanceof i.P6){if(this.has_selection)return this.set_cursor(this.range.startContainer,this.range.startOffset);if(e.drop_zero_width_space(t).pos>0)if(e.is_empty){let t=e.prev_cube_deep;t&&c.tell(t,s.UB.in_tail(t.id,0))}else{const n=e.find_text_nav_pos(t,"left");r&&this.set_cursor(r,n)}else{const t=e.prev_cube_deep;if(t){const n=e.meta.block||t.meta.block?0:1;c.tell(t,s.UB.in_tail(t.id,n,"right"))}}}}move_right(){if(!this.range)return;const{cube_end:e,offset_start:t,offset_end:n,node_end:r}=this,{doc:o,courier:a}=this,c=new l.vk(a);if(e instanceof i.P6){if(this.has_selection)return this.set_cursor(this.range.endContainer,this.range.endOffset);if(n<e.drop_zero_width_space(n).len)if(e.is_empty){let t=e.next_cube_deep;t&&c.tell(t,s.UB.in_head(t.id,0))}else{const t=e.find_text_nav_pos(n,"right");r&&this.set_cursor(r,t)}else{const t=e.next_cube_deep;if(t){const n=e.meta.block||t.meta.block?0:1;c.tell(t,s.UB.in_head(t.id,n,"left"))}}}}move_up(){this.move_vertical("up")}move_down(){return this.move_vertical("down")}move_end(){if(!this.range)return;const{cube_end:e}=this,{startContainer:t,endContainer:n,startOffset:i,endOffset:s}=this.range;if(!e)return;this.set_cursor(this.range.endContainer,this.range.endOffset);const a=this.range.getClientRects();if(0===a.length)return;const l=r.MathRect.get_rect_point(a[a.length-1],r._RectPosition.center);let c=o.I.get_client_rects(e.id);if(!c)return;let d=c.length,u=c[0],h=c[c.length-1],p=h;if(d>1){for(let e=0;e<d;e++){const t=c[e];if(r.MathRect.is_point_in_rect(l,t)){p=t;break}}if(p!==h)return this.locate_cursor_on_rect(p,r._RectPosition.right_mid)}let m=e.next_cube;if(!m)return this.locate_cursor_on_rect(p,r._RectPosition.right_mid);for(c=o.I.get_client_rects(m.id);c;){if(d=c.length,u=c[0],u.x<p.right)return this.locate_cursor_on_rect(p,r._RectPosition.right_mid);if(d>1)return this.locate_cursor_on_rect(u,r._RectPosition.right_mid);if(m=m?.next_cube,!m)return this.locate_cursor_on_rect(u,r._RectPosition.right_mid);c=o.I.get_client_rects(m.id)}}move_home(){if(!this.range)return;const{cube_end:e}=this,{startContainer:t,endContainer:n,startOffset:i,endOffset:s}=this.range;if(this.set_cursor(this.range.startContainer,this.range.startOffset),!e)return;const a=this.range.getClientRects();if(0===a.length)return;const l=r.MathRect.get_rect_point(a[a.length-1],r._RectPosition.center);let c=o.I.get_client_rects(e.id);if(!c)return;let d=c.length,u=c[0],h=c[c.length-1],p=u;if(d>1){for(let e=0;e<d;e++){const t=c[e];if(r.MathRect.is_point_in_rect(l,t)){p=t;break}}if(p!==u)return this.locate_cursor_on_rect(p,r._RectPosition.left_mid)}let m=e.prev_cube;if(!m)return this.locate_cursor_on_rect(p,r._RectPosition.left_mid);for(c=o.I.get_client_rects(m.id);c;){if(d=c.length,h=c[c.length-1],h.right>p.left)return this.locate_cursor_on_rect(p,r._RectPosition.left_mid);if(d>1)return this.locate_cursor_on_rect(h,r._RectPosition.left_mid);if(m=m?.prev_cube,!m)return this.locate_cursor_on_rect(h,r._RectPosition.left_mid);c=o.I.get_client_rects(m.id)}}extend_left(){if(!this.range)return;const{startContainer:e,startOffset:t,endContainer:n,endOffset:r}=this.range,{anchorNode:i,anchorOffset:s,focusNode:o,focusOffset:a}=this.selection,l=i||e,c="number"==typeof s?s:t,u=o||n,h="number"==typeof a?a:r;this.set_cursor(u,h),this.move_left(),(0,d.dY)(()=>{const e=this.range?.endContainer,t=this.range?.endOffset;e&&"number"==typeof t&&this.set_selection_between(l,c,e,t)})}extend_right(){if(!this.range)return;const{startContainer:e,startOffset:t,endContainer:n,endOffset:r}=this.range,{anchorNode:i,anchorOffset:s,focusNode:o,focusOffset:a}=this.selection,l=i||e,c="number"==typeof s?s:t,u=o||n,h="number"==typeof a?a:r;this.set_cursor(u,h),this.move_right(),(0,d.dY)(()=>{const e=this.range?.endContainer,t=this.range?.endOffset;e&&"number"==typeof t&&this.set_selection_between(l,c,e,t)})}extend_up(){if(!this.range)return;const{startContainer:e,startOffset:t,endContainer:n,endOffset:r}=this.range,{anchorNode:i,anchorOffset:s,focusNode:o,focusOffset:a}=this.selection,l=i||e,c="number"==typeof s?s:t,d=o||n,u="number"==typeof a?a:r;this.set_cursor(d,u),this.move_up();const h=this.range.endContainer,p=this.range.endOffset;this.set_selection_between(l,c,h,p)}extend_down(){if(!this.range)return;const{startContainer:e,startOffset:t,endContainer:n,endOffset:r}=this.range,{anchorNode:i,anchorOffset:s,focusNode:o,focusOffset:a}=this.selection,l=i||e,c="number"==typeof s?s:t,d=o||n,u="number"==typeof a?a:r;this.set_cursor(d,u),this.move_down();const h=this.range.endContainer,p=this.range.endOffset;this.set_selection_between(l,c,h,p)}extend_home(){if(!this.range)return;const{startContainer:e,startOffset:t,endContainer:n,endOffset:r}=this.range,{anchorNode:i,anchorOffset:s,focusNode:o,focusOffset:a}=this.selection,l=i||e,c="number"==typeof s?s:t,d=o||n,u="number"==typeof a?a:r;this.set_cursor(d,u),this.move_home();const h=this.range.endContainer,p=this.range.endOffset;this.set_selection_between(l,c,h,p)}extend_end(){if(!this.range)return;const{startContainer:e,startOffset:t,endContainer:n,endOffset:r}=this.range,{anchorNode:i,anchorOffset:s,focusNode:o,focusOffset:a}=this.selection,l=i||e,c="number"==typeof s?s:t,d=o||n,u="number"==typeof a?a:r;this.set_cursor(d,u),this.move_end();const h=this.range.endContainer,p=this.range.endOffset;this.set_selection_between(l,c,h,p)}is_contains_selection(e){const t=[];for(let e of this.ranges)t.push(e.commonAncestorContainer);for(let n of t)if(!this.get_node_cube(n,e))return!1;return!0}get_node_cube(e,t){let n=e instanceof Element?e:e.parentElement;const r=[];for(;n;){if(n.id){let e;if(r.push(n.id),this.root,e=t.find_cube(n.id),e)return e}n=n.parentElement}}get_focus_line(){const{cube_end:e}=this;if(e)return e instanceof i.P6?e.line:void 0}set_cursor(e,t){if(!(e instanceof Text))throw Error("NoteCursor : curosr only be set in TextNode");let n=Math.min(e.length,t);this.selection?.setPosition(e,n),e.parentElement&&e.parentElement.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}locate_cursor_on_rect(e,t){let n=r.MathRect.get_rect_point(e,t);const i=document.caretPositionFromPoint(n.x,n.y),s=window.getSelection();if(i&&s&&i.offsetNode instanceof Text)return s.setPosition(i.offsetNode,i.offset)}locate_cursor_by_coor(e,t){const{courier:n,history:r,root:i}=this,o=document.caretPositionFromPoint(e,t),a=o?.offsetNode,c=new l.vk(n);if(a){if(a instanceof Text)o.offsetNode instanceof Text&&(a.parentElement?.parentElement?.focus(),this.set_cursor(o.offsetNode,o.offset));else{const e=i.cursor.get_node_cube(a,i);if(e?.in_postil)return;const t=e?.pcube;if(!e||!t)return;const n=e.meta;e.next_cube,n.block||c.tell(e,s.UB.in_head(e.id,0,"left"))}r.record(c)}}set_cursor_by_coor(e,t){if(t<=this.top_edge){let e=document.documentElement.scrollTop,n=e>this.scroll_distance?this.scroll_distance:e;r.DomAnimation.scroll_element(document.documentElement,-this.scroll_distance,"vertical"),t+=n}else if(t>=this.bottom_edge){let e=document.documentElement.scrollHeight-document.documentElement.clientHeight-document.documentElement.scrollTop,n=e>this.scroll_distance?this.scroll_distance:e;r.DomAnimation.scroll_element(document.documentElement,this.scroll_distance,"vertical"),t-=n}const n=document.caretPositionFromPoint(e,t);if(n&&n.offsetNode instanceof Text){this.set_cursor(n.offsetNode,n.offset);let e=this.get_selection_edge_position()?.right;if(!e)return;return e.y<=this.top_edge?window.scrollBy({top:-this.scroll_distance,behavior:"smooth"}):e.y>=this.bottom_edge&&window.scrollBy({top:this.scroll_distance,behavior:"smooth"}),n}}get_selection_edge_position(){if(!this.range)return;const e=this.range.getClientRects();if(0===e.length)return;const t=e[0],n=e[e.length-1];return{left:new DOMRect(t.x,t.y,0,t.height),right:new DOMRect(n.x,n.y,0,n.height)}}set_selection_between(e,t,n,r){this.selection.setBaseAndExtent(e,t,n,r)}get_selection_text(e=!0){const{cube_end:t,cube_start:n,offset_start:r,offset_end:s}=this;let o="";if(e&&!this.has_selection&&n instanceof i.P6)return n.text;if(this.cube_selection instanceof i.P6)return this.cube_selection.text.slice(r,s);{let e=!1,a=!1;const l=this.find_inline_cube();for(let c of l){for(let l of c){if(a)break;e||l!==n||(e=!0,l instanceof i.P6&&(o+=l.text.slice(r))),a||l!==t||(a=!0,l instanceof i.P6&&(o+=l.text.slice(0,s))),e&&!a&&l instanceof i.P6&&l!==n&&l!==t&&(o+=l.text)}o+="\n"}}return o}find_cube_by_coor(e){const{x:t,y:n}=e,r=document.elementFromPoint(t,n);if(r)return this.get_node_cube(r,this.root)}find_selection_lines(){const e=[],{cube_selection:t,cube_start:n,cube_end:r}=this;if(t instanceof i.P6){let e=t.line;if(e)return[e]}else{if(t instanceof i.gK)return[t];if(n instanceof i.P6&&r instanceof i.P6){const t=n.line,i=r.line;if(t&&i){let n=t;for(;n&&(e.push(n),n!==i);)n=n.next_line}}}return e}find_inline_cube(){const e=[],{cube_start:t,cube_end:n,offset_start:r,offset_end:s}=this;if(!t||!n)return e;if(!(t instanceof i.P6&&n instanceof i.P6))return e;const o=this.find_selection_lines();if(0===o.length)return[];const a=o[0],l=o[o.length-1],c=t.index,d=n.index;if(1===o.length){const t=[];for(let e of a.children.slice(c,d+1))t.push(e);e.push(t)}else{let t=[];for(let e of a.children.slice(c))t.push(e);e.push(t),t=[];for(let n of o.slice(1,-1)){for(let e of n.children)t.push(e);e.push(t),t=[]}for(let e of l.children.slice(0,d+1))t.push(e);e.push(t)}return e}find_inline_data(){const e=[],t=this.find_inline_cube();if(0===t.length)return e;const n=t[0],r=t[t.length-1],s=n[0],o=r[r.length-1],{cube_start:a,cube_end:l,offset_start:c,offset_end:d}=this;if(!a||!l)return e;if(a===l){const t=a.export();t.info=t.info.slice(c,d),e.push(t)}else if(n===r){if(a instanceof i.P6&&a===s){const t=a.export();t.info=t.info.slice(c),e.push(t)}for(let t of n.slice(1,-1))e.push(t.export());if(l instanceof i.P6&&l===o){const t=l.export();t.info=t.info.slice(0,d),e.push(t)}}else{if(a instanceof i.P6&&a===s){const t=a.export();t.info=t.info.slice(c),e.push(t)}e.push(...n.slice(1).map(e=>e.export()));for(let n of t.slice(1,-1)){const t=i.gK.get_default(n.map(e=>e.export()));e.push(t)}const u=i.gK.get_default(r.slice(0,-1).map(e=>e.export()));if(l instanceof i.P6&&l===o){const e=l.export();e.info=e.info.slice(0,d),u.info.push(e)}e.push(u)}return e}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:a.Mu.cursor,version:1}}}},3431:(e,t,n)=>{"use strict";n.d(t,{o:()=>i});var r=n(9513);class i{static add(e,t,n){return{id:e,name:r.JC.add,data:t,pos:n}}static remove(e,t){return{id:e,name:r.JC.remove,range:t}}static indent(e,t){return{id:e,name:r.JC.indent,items:t}}}},3447:(e,t,n)=>{"use strict";n.d(t,{V:()=>i});var r=n(9513);class i{static insert_child(e,t,n){return{id:e,name:r.zS.cube_insert_child,data:t,pos:n}}static delete_child(e,t,n,i=!1){return{id:e,name:r.zS.cube_delete_child,dir:t,range:n,reserve:i}}static insert(e,t,n,i,s,o){return{id:e,name:r.zS.cube_insert,data:t,start_id:n,end_id:i,offset_end:o,offset_start:s}}static delete(e,t,n,i,s,o,a=!1){return{id:e,name:r.zS.cube_delete,dir:t,start_id:n,end_id:i,offset_start:s,offset_end:o,reserve:a}}static delete_adjacent(e,t,n,i){return{id:e,name:r.zS.cube_delete_adjacent,from:t,offset:i,from_id:n}}static set_selection_css(e,t,n,i,s,o,a=!1,l=!1){return{id:e,name:r.zS.cube_set_selection_css,css:t,start_id:n,end_id:i,offset_start:s,offset_end:o,toggle:a,replace:l}}static set_css(e,t,n=!1,i=!1){return{id:e,name:r.zS.cube_set_css,css:t,toggle:n,replace:i}}static set_attr(e,t){return{id:e,name:r.zS.cube_set_attr,attr:t}}static partition(e,t,n,i,s){return{name:r.zS.cube_partition,id:e,start_id:t,end_id:n,offset_start:i,offset_end:s}}static reorder(e,t,n){return{id:e,name:r.zS.cube_reorder,cubeid:t,index:n}}static reset(e,t){return{id:e,name:r.zS.cube_reset,data:t}}static merge(e,t,n,i){return{id:e,name:r.zS.cube_merge,method:t,cubeid:n,offset:i}}static postil_add(e,t=[]){return{name:r.zS.cube_postil_add,id:e,data:t}}static postil_remove(e,t){return{name:r.zS.cube_postil_remove,id:e,range:t}}static resize(e,t=-1,n=-1){return this.set_attr(e,{width:t,height:n})}static fold(e,t){return this.set_attr(e,{fold:t})}}},3682:(e,t,n)=>{"use strict";n.d(t,{y:()=>i});var r=n(9513);class i{static node_add(e,t){return{id:e,name:r.kU.node_add,data:t}}static node_remove(e,t){return{id:e,name:r.kU.node_remove,data:t}}static linker_add(e,t){return{id:e,name:r.kU.linker_add,data:t}}static linker_remove(e,t){return{id:e,name:r.kU.linker_remove,data:t}}}},3923:(e,t,n)=>{"use strict";n.d(t,{K:()=>r.K});var r=n(6753)},3972:(e,t,n)=>{"use strict";function r(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return e=>e in t}n.d(t,{$3:()=>p,$H:()=>B,BH:()=>q,BX:()=>J,Bm:()=>w,C4:()=>Y,CE:()=>f,CP:()=>c,DY:()=>D,Gv:()=>x,J$:()=>Z,Kg:()=>v,MZ:()=>i,Mp:()=>l,NO:()=>a,Oj:()=>s,PT:()=>P,Qd:()=>L,Ro:()=>j,SU:()=>z,TF:()=>u,Tg:()=>E,Tn:()=>y,Tr:()=>$,We:()=>U,X$:()=>d,Y2:()=>Q,ZH:()=>O,Zf:()=>M,bB:()=>H,cy:()=>m,gd:()=>b,pD:()=>r,rU:()=>I,tE:()=>o,u3:()=>ee,vM:()=>_,v_:()=>ne,yI:()=>T,yL:()=>k,yQ:()=>V});const i={},s=[],o=()=>{},a=()=>!1,l=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),c=e=>e.startsWith("onUpdate:"),d=Object.assign,u=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},h=Object.prototype.hasOwnProperty,p=(e,t)=>h.call(e,t),m=Array.isArray,f=e=>"[object Map]"===C(e),_=e=>"[object Set]"===C(e),g=e=>"[object Date]"===C(e),b=e=>"[object RegExp]"===C(e),y=e=>"function"==typeof e,v=e=>"string"==typeof e,w=e=>"symbol"==typeof e,x=e=>null!==e&&"object"==typeof e,k=e=>(x(e)||y(e))&&y(e.then)&&y(e.catch),S=Object.prototype.toString,C=e=>S.call(e),M=e=>C(e).slice(8,-1),L=e=>"[object Object]"===C(e),T=e=>v(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,z=r(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),A=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},R=/-\w/g,P=A(e=>e.replace(R,e=>e.slice(1).toUpperCase())),N=/\B([A-Z])/g,E=A(e=>e.replace(N,"-$1").toLowerCase()),O=A(e=>e.charAt(0).toUpperCase()+e.slice(1)),I=A(e=>e?`on${O(e)}`:""),B=(e,t)=>!Object.is(e,t),D=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},V=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},H=e=>{const t=parseFloat(e);return isNaN(t)?e:t},j=e=>{const t=v(e)?Number(e):NaN;return isNaN(t)?e:t};let F;const U=()=>F||(F="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:{}),q=r("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol");function $(e){if(m(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],i=v(r)?W(r):$(r);if(i)for(const e in i)t[e]=i[e]}return t}if(v(e)||x(e))return e}const G=/;(?![^(]*\))/g,X=/:([^]+)/,K=/\/\*[^]*?\*\//g;function W(e){const t={};return e.replace(K,"").split(G).forEach(e=>{if(e){const n=e.split(X);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function Y(e){let t="";if(v(e))t=e;else if(m(e))for(let n=0;n<e.length;n++){const r=Y(e[n]);r&&(t+=r+" ")}else if(x(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const Z=r("itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly");function Q(e){return!!e||""===e}function J(e,t){if(e===t)return!0;let n=g(e),r=g(t);if(n||r)return!(!n||!r)&&e.getTime()===t.getTime();if(n=w(e),r=w(t),n||r)return e===t;if(n=m(e),r=m(t),n||r)return!(!n||!r)&&function(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=J(e[r],t[r]);return n}(e,t);if(n=x(e),r=x(t),n||r){if(!n||!r)return!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e){const r=e.hasOwnProperty(n),i=t.hasOwnProperty(n);if(r&&!i||!r&&i||!J(e[n],t[n]))return!1}}return String(e)===String(t)}function ee(e,t){return e.findIndex(e=>J(e,t))}const te=e=>!(!e||!0!==e.__v_isRef),ne=e=>v(e)?e:null==e?"":m(e)||x(e)&&(e.toString===S||!y(e.toString))?te(e)?ne(e.value):JSON.stringify(e,re,2):String(e),re=(e,t)=>te(t)?re(e,t.value):f(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[ie(t,r)+" =>"]=n,e),{})}:_(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>ie(e))}:w(t)?ie(t):!x(t)||m(t)||L(t)?t:String(t),ie=(e,t="")=>{var n;return w(e)?`Symbol(${null!=(n=e.description)?n:t})`:e}},4e3:(e,t,n)=>{"use strict";n.d(t,{W:()=>a});var r=n(4089),i=n(3028),s=n(9513),o=n(6753);class a extends o.K{command_group_do=[];command_group_undo=[];get meta(){return a.meta}execute_command_group(e){if(this.stats.mode===s.fv.read)return;const t=(e,n,i)=>{n<i.length&&(0,r.dY)(()=>{this.pass(e),t(i[n+1],n+1,i)})};t(e[0],0,e)}constructor(e){super(e)}get_recorder(){return new i.vk(this)}pass(e){if(this.stats.mode===s.fv.read)return;const t=e,n=e.id,r=this.root.find_cube(n);if(!r)return void console.error("未发现cube:",n);console.log("🟨",r,r.type,t);const o=new i.vk(this);let a=r.on(t);return a instanceof i.vk&&o.merge(a),o}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:s.Mu.courier,version:1}}}},4089:(e,t,n)=>{"use strict";n.d(t,{$u:()=>J,$y:()=>le,CE:()=>Lt,Df:()=>O,EW:()=>on,FK:()=>gt,Fv:()=>Bt,Gy:()=>A,K9:()=>We,Lk:()=>Nt,MZ:()=>E,OW:()=>N,Q3:()=>Dt,QP:()=>P,Wv:()=>Tt,bF:()=>Et,bo:()=>C,dY:()=>f,eW:()=>It,hi:()=>te,nI:()=>Gt,pI:()=>de,pM:()=>I,qL:()=>o,rk:()=>D,sV:()=>Z,uX:()=>kt,wB:()=>rt,xo:()=>ee});var r=n(7633),i=n(3972);function s(e,t,n,r){try{return r?e(...r):e()}catch(e){a(e,t,n)}}function o(e,t,n,r){if((0,i.Tn)(e)){const o=s(e,t,n,r);return o&&(0,i.yL)(o)&&o.catch(e=>{a(e,t,n)}),o}if((0,i.cy)(e)){const i=[];for(let s=0;s<e.length;s++)i.push(o(e[s],t,n,r));return i}}function a(e,t,n,o=!0){t&&t.vnode;const{errorHandler:a,throwUnhandledErrorInProduction:l}=t&&t.appContext.config||i.MZ;if(t){let i=t.parent;const o=t.proxy,l=`https://vuejs.org/error-reference/#runtime-${n}`;for(;i;){const t=i.ec;if(t)for(let n=0;n<t.length;n++)if(!1===t[n](e,o,l))return;i=i.parent}if(a)return(0,r.C4)(),s(a,null,10,[e,o,l]),void(0,r.bl)()}!function(e,t,n,r=!0,i=!1){if(i)throw e;console.error(e)}(e,0,0,o,l)}const l=[];let c=-1;const d=[];let u=null,h=0;const p=Promise.resolve();let m=null;function f(e){const t=m||p;return e?t.then(this?e.bind(this):e):t}function _(e){if(!(1&e.flags)){const t=v(e),n=l[l.length-1];!n||!(2&e.flags)&&t>=v(n)?l.push(e):l.splice(function(e){let t=c+1,n=l.length;for(;t<n;){const r=t+n>>>1,i=l[r],s=v(i);s<e||s===e&&2&i.flags?t=r+1:n=r}return t}(t),0,e),e.flags|=1,g()}}function g(){m||(m=p.then(w))}function b(e,t,n=c+1){for(;n<l.length;n++){const t=l[n];if(t&&2&t.flags){if(e&&t.id!==e.uid)continue;l.splice(n,1),n--,4&t.flags&&(t.flags&=-2),t(),4&t.flags||(t.flags&=-2)}}}function y(e){if(d.length){const e=[...new Set(d)].sort((e,t)=>v(e)-v(t));if(d.length=0,u)return void u.push(...e);for(u=e,h=0;h<u.length;h++){const e=u[h];4&e.flags&&(e.flags&=-2),8&e.flags||e(),e.flags&=-2}u=null,h=0}}const v=e=>null==e.id?2&e.flags?-1:1/0:e.id;function w(e){i.tE;try{for(c=0;c<l.length;c++){const e=l[c];!e||8&e.flags||(4&e.flags&&(e.flags&=-2),s(e,e.i,e.i?15:14),4&e.flags||(e.flags&=-2))}}finally{for(;c<l.length;c++){const e=l[c];e&&(e.flags&=-2)}c=-1,l.length=0,y(),m=null,(l.length||d.length)&&w(e)}}let x=null,k=null;function S(e){const t=x;return x=e,k=e&&e.type.__scopeId||null,t}function C(e,t){if(null===x)return e;const n=sn(x),s=e.dirs||(e.dirs=[]);for(let e=0;e<t.length;e++){let[o,a,l,c=i.MZ]=t[e];o&&((0,i.Tn)(o)&&(o={mounted:o,updated:o}),o.deep&&(0,r.hV)(a),s.push({dir:o,instance:n,value:a,oldValue:void 0,arg:l,modifiers:c}))}return e}function M(e,t,n,i){const s=e.dirs,a=t&&t.dirs;for(let l=0;l<s.length;l++){const c=s[l];a&&(c.oldValue=a[l].value);let d=c.dir[i];d&&((0,r.C4)(),o(d,n,8,[e.el,c,e,t]),(0,r.bl)())}}const L=Symbol("_vte"),T=Symbol("_leaveCb"),z=Symbol("_enterCb");function A(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Z(()=>{e.isMounted=!0}),ee(()=>{e.isUnmounting=!0}),e}const R=[Function,Array],P={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:R,onEnter:R,onAfterEnter:R,onEnterCancelled:R,onBeforeLeave:R,onLeave:R,onAfterLeave:R,onLeaveCancelled:R,onBeforeAppear:R,onAppear:R,onAfterAppear:R,onAppearCancelled:R};function N(e,t,n,r,s){const{appear:a,mode:l,persisted:c=!1,onBeforeEnter:d,onEnter:u,onAfterEnter:h,onEnterCancelled:p,onBeforeLeave:m,onLeave:f,onAfterLeave:_,onLeaveCancelled:g,onBeforeAppear:b,onAppear:y,onAfterAppear:v,onAppearCancelled:w}=t,x=String(e.key),k=function(e,t){const{leavingVNodes:n}=e;let r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}(n,e),S=(e,t)=>{e&&o(e,r,9,t)},C=(e,t)=>{const n=t[1];S(e,t),(0,i.cy)(e)?e.every(e=>e.length<=1)&&n():e.length<=1&&n()},M={mode:l,persisted:c,beforeEnter(t){let r=d;if(!n.isMounted){if(!a)return;r=b||d}t[T]&&t[T](!0);const i=k[x];i&&At(e,i)&&i.el[T]&&i.el[T](),S(r,[t])},enter(e){let t=u,r=h,i=p;if(!n.isMounted){if(!a)return;t=y||u,r=v||h,i=w||p}let s=!1;const o=e[z]=t=>{s||(s=!0,S(t?i:r,[e]),M.delayedLeave&&M.delayedLeave(),e[z]=void 0)};t?C(t,[e,o]):o()},leave(t,r){const i=String(e.key);if(t[z]&&t[z](!0),n.isUnmounting)return r();S(m,[t]);let s=!1;const o=t[T]=n=>{s||(s=!0,r(),S(n?g:_,[t]),t[T]=void 0,k[i]===e&&delete k[i])};k[i]=e,f?C(f,[t,o]):o()},clone(e){const i=N(e,t,n,r,s);return s&&s(i),i}};return M}function E(e,t){6&e.shapeFlag&&e.component?(e.transition=t,E(e.component.subTree,t)):128&e.shapeFlag?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function O(e,t=!1,n){let r=[],i=0;for(let s=0;s<e.length;s++){let o=e[s];const a=null==n?o.key:String(n)+String(null!=o.key?o.key:s);o.type===gt?(128&o.patchFlag&&i++,r=r.concat(O(o.children,t,a))):(t||o.type!==yt)&&r.push(null!=a?Ot(o,{key:a}):o)}if(i>1)for(let e=0;e<r.length;e++)r[e].patchFlag=-2;return r}function I(e,t){return(0,i.Tn)(e)?(()=>(0,i.X$)({name:e.name},t,{setup:e}))():e}function B(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function D(e){const t=Gt(),n=(0,r.IJ)(null);if(t){const r=t.refs===i.MZ?t.refs={}:t.refs;Object.defineProperty(r,e,{enumerable:!0,get:()=>n.value,set:e=>n.value=e})}return n}const V=new WeakMap;function H(e,t,n,o,a=!1){if((0,i.cy)(e))return void e.forEach((e,r)=>H(e,t&&((0,i.cy)(t)?t[r]:t),n,o,a));if(F(o)&&!a)return void(512&o.shapeFlag&&o.type.__asyncResolved&&o.component.subTree.component&&H(e,t,n,o.component.subTree));const l=4&o.shapeFlag?sn(o.component):o.el,c=a?null:l,{i:d,r:u}=e,h=t&&t.r,p=d.refs===i.MZ?d.refs={}:d.refs,m=d.setupState,f=(0,r.ux)(m),_=m===i.MZ?i.NO:e=>(0,i.$3)(f,e);if(null!=h&&h!==u)if(j(t),(0,i.Kg)(h))p[h]=null,_(h)&&(m[h]=null);else if((0,r.i9)(h)){h.value=null;const e=t;e.k&&(p[e.k]=null)}if((0,i.Tn)(u))s(u,d,12,[c,p]);else{const t=(0,i.Kg)(u),s=(0,r.i9)(u);if(t||s){const r=()=>{if(e.f){const n=t?_(u)?m[u]:p[u]:u.value;if(a)(0,i.cy)(n)&&(0,i.TF)(n,l);else if((0,i.cy)(n))n.includes(l)||n.push(l);else if(t)p[u]=[l],_(u)&&(m[u]=p[u]);else{const t=[l];u.value=t,e.k&&(p[e.k]=t)}}else t?(p[u]=c,_(u)&&(m[u]=c)):s&&(u.value=c,e.k&&(p[e.k]=c))};if(c){const t=()=>{r(),V.delete(e)};t.id=-1,V.set(e,t),Ke(t,n)}else j(e),r()}}}function j(e){const t=V.get(e);t&&(t.flags|=8,V.delete(e))}(0,i.We)().requestIdleCallback,(0,i.We)().cancelIdleCallback;const F=e=>!!e.type.__asyncLoader,U=e=>e.type.__isKeepAlive;function q(e,t){G(e,"a",t)}function $(e,t){G(e,"da",t)}function G(e,t,n=$t){const r=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(K(t,r,n),n){let e=n.parent;for(;e&&e.parent;)U(e.parent.vnode)&&X(r,t,n,e),e=e.parent}}function X(e,t,n,r){const s=K(t,e,r,!0);te(()=>{(0,i.TF)(r[t],s)},n)}function K(e,t,n=$t,i=!1){if(n){const s=n[e]||(n[e]=[]),a=t.__weh||(t.__weh=(...i)=>{(0,r.C4)();const s=Wt(n),a=o(t,n,e,i);return s(),(0,r.bl)(),a});return i?s.unshift(a):s.push(a),a}}RegExp,RegExp;const W=e=>(t,n=$t)=>{en&&"sp"!==e||K(e,(...e)=>t(...e),n)},Y=W("bm"),Z=W("m"),Q=W("bu"),J=W("u"),ee=W("bum"),te=W("um"),ne=W("sp"),re=W("rtg"),ie=W("rtc");function se(e,t=$t){K("ec",e,t)}const oe="components",ae=Symbol.for("v-ndc");function le(e){return(0,i.Kg)(e)?function(e,t,n=!0,r=!1){const s=x||$t;if(s){const n=s.type;if(e===oe){const e=function(e,t=!0){return(0,i.Tn)(e)?e.displayName||e.name:e.name||t&&e.__name}(n,!1);if(e&&(e===t||e===(0,i.PT)(t)||e===(0,i.ZH)((0,i.PT)(t))))return n}const o=ce(s[e]||n[e],t)||ce(s.appContext[e],t);return!o&&r?n:o}}(oe,e,!1)||e:e||ae}function ce(e,t){return e&&(e[t]||e[(0,i.PT)(t)]||e[(0,i.ZH)((0,i.PT)(t))])}function de(e,t,n,s){let o;const a=n&&n[s],l=(0,i.cy)(e);if(l||(0,i.Kg)(e)){let n=!1,i=!1;l&&(0,r.g8)(e)&&(n=!(0,r.fE)(e),i=(0,r.Tm)(e),e=(0,r.qA)(e)),o=new Array(e.length);for(let s=0,l=e.length;s<l;s++)o[s]=t(n?i?(0,r.a1)((0,r.lJ)(e[s])):(0,r.lJ)(e[s]):e[s],s,void 0,a&&a[s])}else if("number"==typeof e){o=new Array(e);for(let n=0;n<e;n++)o[n]=t(n+1,n,void 0,a&&a[n])}else if((0,i.Gv)(e))if(e[Symbol.iterator])o=Array.from(e,(e,n)=>t(e,n,void 0,a&&a[n]));else{const n=Object.keys(e);o=new Array(n.length);for(let r=0,i=n.length;r<i;r++){const i=n[r];o[r]=t(e[i],i,r,a&&a[r])}}else o=[];return n&&(n[s]=o),o}const ue=e=>e?Zt(e)?sn(e):ue(e.parent):null,he=(0,i.X$)(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>ue(e.parent),$root:e=>ue(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>ye(e),$forceUpdate:e=>e.f||(e.f=()=>{_(e.update)}),$nextTick:e=>e.n||(e.n=f.bind(e.proxy)),$watch:e=>st.bind(e)}),pe=(e,t)=>e!==i.MZ&&!e.__isScriptSetup&&(0,i.$3)(e,t),me={get({_:e},t){if("__v_skip"===t)return!0;const{ctx:n,setupState:s,data:o,props:a,accessCache:l,type:c,appContext:d}=e;let u;if("$"!==t[0]){const r=l[t];if(void 0!==r)switch(r){case 1:return s[t];case 2:return o[t];case 4:return n[t];case 3:return a[t]}else{if(pe(s,t))return l[t]=1,s[t];if(o!==i.MZ&&(0,i.$3)(o,t))return l[t]=2,o[t];if((u=e.propsOptions[0])&&(0,i.$3)(u,t))return l[t]=3,a[t];if(n!==i.MZ&&(0,i.$3)(n,t))return l[t]=4,n[t];_e&&(l[t]=0)}}const h=he[t];let p,m;return h?("$attrs"===t&&(0,r.u4)(e.attrs,"get",""),h(e)):(p=c.__cssModules)&&(p=p[t])?p:n!==i.MZ&&(0,i.$3)(n,t)?(l[t]=4,n[t]):(m=d.config.globalProperties,(0,i.$3)(m,t)?m[t]:void 0)},set({_:e},t,n){const{data:r,setupState:s,ctx:o}=e;return pe(s,t)?(s[t]=n,!0):r!==i.MZ&&(0,i.$3)(r,t)?(r[t]=n,!0):!((0,i.$3)(e.props,t)||"$"===t[0]&&t.slice(1)in e||(o[t]=n,0))},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:s,propsOptions:o,type:a}},l){let c,d;return!!(n[l]||e!==i.MZ&&"$"!==l[0]&&(0,i.$3)(e,l)||pe(t,l)||(c=o[0])&&(0,i.$3)(c,l)||(0,i.$3)(r,l)||(0,i.$3)(he,l)||(0,i.$3)(s.config.globalProperties,l)||(d=a.__cssModules)&&d[l])},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:(0,i.$3)(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function fe(e){return(0,i.cy)(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}let _e=!0;function ge(e,t,n){o((0,i.cy)(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function be(e,t,n,r){let s=r.includes(".")?ot(n,r):()=>n[r];if((0,i.Kg)(e)){const n=t[e];(0,i.Tn)(n)&&rt(s,n)}else if((0,i.Tn)(e))rt(s,e.bind(n));else if((0,i.Gv)(e))if((0,i.cy)(e))e.forEach(e=>be(e,t,n,r));else{const r=(0,i.Tn)(e.handler)?e.handler.bind(n):t[e.handler];(0,i.Tn)(r)&&rt(s,r,e)}}function ye(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:s,optionsCache:o,config:{optionMergeStrategies:a}}=e.appContext,l=o.get(t);let c;return l?c=l:s.length||n||r?(c={},s.length&&s.forEach(e=>ve(c,e,a,!0)),ve(c,t,a)):c=t,(0,i.Gv)(t)&&o.set(t,c),c}function ve(e,t,n,r=!1){const{mixins:i,extends:s}=t;s&&ve(e,s,n,!0),i&&i.forEach(t=>ve(e,t,n,!0));for(const i in t)if(r&&"expose"===i);else{const r=we[i]||n&&n[i];e[i]=r?r(e[i],t[i]):t[i]}return e}const we={data:xe,props:Me,emits:Me,methods:Ce,computed:Ce,beforeCreate:Se,created:Se,beforeMount:Se,mounted:Se,beforeUpdate:Se,updated:Se,beforeDestroy:Se,beforeUnmount:Se,destroyed:Se,unmounted:Se,activated:Se,deactivated:Se,errorCaptured:Se,serverPrefetch:Se,components:Ce,directives:Ce,watch:function(e,t){if(!e)return t;if(!t)return e;const n=(0,i.X$)(Object.create(null),e);for(const r in t)n[r]=Se(e[r],t[r]);return n},provide:xe,inject:function(e,t){return Ce(ke(e),ke(t))}};function xe(e,t){return t?e?function(){return(0,i.X$)((0,i.Tn)(e)?e.call(this,this):e,(0,i.Tn)(t)?t.call(this,this):t)}:t:e}function ke(e){if((0,i.cy)(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Se(e,t){return e?[...new Set([].concat(e,t))]:t}function Ce(e,t){return e?(0,i.X$)(Object.create(null),e,t):t}function Me(e,t){return e?(0,i.cy)(e)&&(0,i.cy)(t)?[...new Set([...e,...t])]:(0,i.X$)(Object.create(null),fe(e),fe(null!=t?t:{})):t}function Le(){return{app:null,config:{isNativeTag:i.NO,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let Te=0;function ze(e,t){return function(n,r=null){(0,i.Tn)(n)||(n=(0,i.X$)({},n)),null==r||(0,i.Gv)(r)||(r=null);const s=Le(),a=new WeakSet,l=[];let c=!1;const d=s.app={_uid:Te++,_component:n,_props:r,_container:null,_context:s,_instance:null,version:an,get config(){return s.config},set config(e){},use:(e,...t)=>(a.has(e)||(e&&(0,i.Tn)(e.install)?(a.add(e),e.install(d,...t)):(0,i.Tn)(e)&&(a.add(e),e(d,...t))),d),mixin:e=>(s.mixins.includes(e)||s.mixins.push(e),d),component:(e,t)=>t?(s.components[e]=t,d):s.components[e],directive:(e,t)=>t?(s.directives[e]=t,d):s.directives[e],mount(i,o,a){if(!c){const l=d._ceVNode||Et(n,r);return l.appContext=s,!0===a?a="svg":!1===a&&(a=void 0),o&&t?t(l,i):e(l,i,a),c=!0,d._container=i,i.__vue_app__=d,sn(l.component)}},onUnmount(e){l.push(e)},unmount(){c&&(o(l,d._instance,16),e(null,d._container),delete d._container.__vue_app__)},provide:(e,t)=>(s.provides[e]=t,d),runWithContext(e){const t=Ae;Ae=d;try{return e()}finally{Ae=t}}};return d}}let Ae=null;function Re(e,t,n=!1){const r=Gt();if(r||Ae){let s=Ae?Ae._context.provides:r?null==r.parent||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(s&&e in s)return s[e];if(arguments.length>1)return n&&(0,i.Tn)(t)?t.call(r&&r.proxy):t}}const Pe={},Ne=()=>Object.create(Pe),Ee=e=>Object.getPrototypeOf(e)===Pe;function Oe(e,t,n,s){const[o,a]=e.propsOptions;let l,c=!1;if(t)for(let r in t){if((0,i.SU)(r))continue;const d=t[r];let u;o&&(0,i.$3)(o,u=(0,i.PT)(r))?a&&a.includes(u)?(l||(l={}))[u]=d:n[u]=d:ut(e.emitsOptions,r)||r in s&&d===s[r]||(s[r]=d,c=!0)}if(a){const t=(0,r.ux)(n),s=l||i.MZ;for(let r=0;r<a.length;r++){const l=a[r];n[l]=Ie(o,t,l,s[l],e,!(0,i.$3)(s,l))}}return c}function Ie(e,t,n,r,s,o){const a=e[n];if(null!=a){const e=(0,i.$3)(a,"default");if(e&&void 0===r){const e=a.default;if(a.type!==Function&&!a.skipFactory&&(0,i.Tn)(e)){const{propsDefaults:i}=s;if(n in i)r=i[n];else{const o=Wt(s);r=i[n]=e.call(null,t),o()}}else r=e;s.ce&&s.ce._setProp(n,r)}a[0]&&(o&&!e?r=!1:!a[1]||""!==r&&r!==(0,i.Tg)(n)||(r=!0))}return r}const Be=new WeakMap;function De(e,t,n=!1){const r=n?Be:t.propsCache,s=r.get(e);if(s)return s;const o=e.props,a={},l=[];let c=!1;if(!(0,i.Tn)(e)){const r=e=>{c=!0;const[n,r]=De(e,t,!0);(0,i.X$)(a,n),r&&l.push(...r)};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}if(!o&&!c)return(0,i.Gv)(e)&&r.set(e,i.Oj),i.Oj;if((0,i.cy)(o))for(let e=0;e<o.length;e++){const t=(0,i.PT)(o[e]);Ve(t)&&(a[t]=i.MZ)}else if(o)for(const e in o){const t=(0,i.PT)(e);if(Ve(t)){const n=o[e],r=a[t]=(0,i.cy)(n)||(0,i.Tn)(n)?{type:n}:(0,i.X$)({},n),s=r.type;let c=!1,d=!0;if((0,i.cy)(s))for(let e=0;e<s.length;++e){const t=s[e],n=(0,i.Tn)(t)&&t.name;if("Boolean"===n){c=!0;break}"String"===n&&(d=!1)}else c=(0,i.Tn)(s)&&"Boolean"===s.name;r[0]=c,r[1]=d,(c||(0,i.$3)(r,"default"))&&l.push(t)}}const d=[a,l];return(0,i.Gv)(e)&&r.set(e,d),d}function Ve(e){return"$"!==e[0]&&!(0,i.SU)(e)}const He=e=>"_"===e||"_ctx"===e||"$stable"===e,je=e=>(0,i.cy)(e)?e.map(Vt):[Vt(e)],Fe=(e,t,n)=>{if(t._n)return t;const r=function(e,t=x){if(!t)return e;if(e._n)return e;const n=(...r)=>{n._d&&Ct(-1);const i=S(t);let s;try{s=e(...r)}finally{S(i),n._d&&Ct(1)}return s};return n._n=!0,n._c=!0,n._d=!0,n}((...e)=>je(t(...e)),n);return r._c=!1,r},Ue=(e,t,n)=>{const r=e._ctx;for(const n in e){if(He(n))continue;const s=e[n];if((0,i.Tn)(s))t[n]=Fe(0,s,r);else if(null!=s){const e=je(s);t[n]=()=>e}}},qe=(e,t)=>{const n=je(t);e.slots.default=()=>n},$e=(e,t,n)=>{for(const r in t)!n&&He(r)||(e[r]=t[r])},Ge=(e,t,n)=>{const r=e.slots=Ne();if(32&e.vnode.shapeFlag){const e=t._;e?($e(r,t,n),n&&(0,i.yQ)(r,"_",e,!0)):Ue(t,r)}else t&&qe(e,t)},Xe=(e,t,n)=>{const{vnode:r,slots:s}=e;let o=!0,a=i.MZ;if(32&r.shapeFlag){const e=t._;e?n&&1===e?o=!1:$e(s,t,n):(o=!t.$stable,Ue(t,s)),a=t}else t&&(qe(e,t),a={default:1});if(o)for(const e in s)He(e)||null!=a[e]||delete s[e]},Ke=function(e,t){t&&t.pendingBranch?(0,i.cy)(e)?t.effects.push(...e):t.effects.push(e):(n=e,(0,i.cy)(n)?d.push(...n):u&&-1===n.id?u.splice(h+1,0,n):1&n.flags||(d.push(n),n.flags|=1),g());var n};function We(e){return function(e,t){(0,i.We)().__VUE__=!0;const{insert:n,remove:o,patchProp:l,createElement:c,createText:d,createComment:u,setText:h,setElementText:p,parentNode:m,nextSibling:f,setScopeId:g=i.tE,insertStaticContent:v}=e,w=(e,t,n,r=null,i=null,s=null,o=void 0,a=null,l=!!t.dynamicChildren)=>{if(e===t)return;e&&!At(e,t)&&(r=te(e),Y(e,i,s,!0),e=null),-2===t.patchFlag&&(l=!1,t.dynamicChildren=null);const{type:c,ref:d,shapeFlag:u}=t;switch(c){case bt:x(e,t,n,r);break;case yt:k(e,t,n,r);break;case vt:null==e&&S(t,n,r,o);break;case gt:I(e,t,n,r,i,s,o,a,l);break;default:1&u?z(e,t,n,r,i,s,o,a,l):6&u?D(e,t,n,r,i,s,o,a,l):(64&u||128&u)&&c.process(e,t,n,r,i,s,o,a,l,ie)}null!=d&&i?H(d,e&&e.ref,s,t||e,!t):null==d&&e&&null!=e.ref&&H(e.ref,null,s,e,!0)},x=(e,t,r,i)=>{if(null==e)n(t.el=d(t.children),r,i);else{const n=t.el=e.el;t.children!==e.children&&h(n,t.children)}},k=(e,t,r,i)=>{null==e?n(t.el=u(t.children||""),r,i):t.el=e.el},S=(e,t,n,r)=>{[e.el,e.anchor]=v(e.children,t,n,r,e.el,e.anchor)},C=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=f(e),o(e),e=n;o(t)},z=(e,t,n,r,i,s,o,a,l)=>{"svg"===t.type?o="svg":"math"===t.type&&(o="mathml"),null==e?A(t,n,r,i,s,o,a,l):N(e,t,i,s,o,a,l)},A=(e,t,r,s,o,a,d,u)=>{let h,m;const{props:f,shapeFlag:_,transition:g,dirs:b}=e;if(h=e.el=c(e.type,a,f&&f.is,f),8&_?p(h,e.children):16&_&&P(e.children,h,null,s,o,Ye(e,a),d,u),b&&M(e,null,s,"created"),R(h,e,e.scopeId,d,s),f){for(const e in f)"value"===e||(0,i.SU)(e)||l(h,e,null,f[e],a,s);"value"in f&&l(h,"value",null,f.value,a),(m=f.onVnodeBeforeMount)&&Ft(m,s,e)}b&&M(e,null,s,"beforeMount");const y=function(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}(o,g);y&&g.beforeEnter(h),n(h,t,r),((m=f&&f.onVnodeMounted)||y||b)&&Ke(()=>{m&&Ft(m,s,e),y&&g.enter(h),b&&M(e,null,s,"mounted")},o)},R=(e,t,n,r,i)=>{if(n&&g(e,n),r)for(let t=0;t<r.length;t++)g(e,r[t]);if(i){let n=i.subTree;if(t===n||_t(n.type)&&(n.ssContent===t||n.ssFallback===t)){const t=i.vnode;R(e,t,t.scopeId,t.slotScopeIds,i.parent)}}},P=(e,t,n,r,i,s,o,a,l=0)=>{for(let c=l;c<e.length;c++){const l=e[c]=a?Ht(e[c]):Vt(e[c]);w(null,l,t,n,r,i,s,o,a)}},N=(e,t,n,r,s,o,a)=>{const c=t.el=e.el;let{patchFlag:d,dynamicChildren:u,dirs:h}=t;d|=16&e.patchFlag;const m=e.props||i.MZ,f=t.props||i.MZ;let _;if(n&&Ze(n,!1),(_=f.onVnodeBeforeUpdate)&&Ft(_,n,t,e),h&&M(t,e,n,"beforeUpdate"),n&&Ze(n,!0),(m.innerHTML&&null==f.innerHTML||m.textContent&&null==f.textContent)&&p(c,""),u?E(e.dynamicChildren,u,c,n,r,Ye(t,s),o):a||G(e,t,c,null,n,r,Ye(t,s),o,!1),d>0){if(16&d)O(c,m,f,n,s);else if(2&d&&m.class!==f.class&&l(c,"class",null,f.class,s),4&d&&l(c,"style",m.style,f.style,s),8&d){const e=t.dynamicProps;for(let t=0;t<e.length;t++){const r=e[t],i=m[r],o=f[r];o===i&&"value"!==r||l(c,r,i,o,s,n)}}1&d&&e.children!==t.children&&p(c,t.children)}else a||null!=u||O(c,m,f,n,s);((_=f.onVnodeUpdated)||h)&&Ke(()=>{_&&Ft(_,n,t,e),h&&M(t,e,n,"updated")},r)},E=(e,t,n,r,i,s,o)=>{for(let a=0;a<t.length;a++){const l=e[a],c=t[a],d=l.el&&(l.type===gt||!At(l,c)||198&l.shapeFlag)?m(l.el):n;w(l,c,d,null,r,i,s,o,!0)}},O=(e,t,n,r,s)=>{if(t!==n){if(t!==i.MZ)for(const o in t)(0,i.SU)(o)||o in n||l(e,o,t[o],null,s,r);for(const o in n){if((0,i.SU)(o))continue;const a=n[o],c=t[o];a!==c&&"value"!==o&&l(e,o,c,a,s,r)}"value"in n&&l(e,"value",t.value,n.value,s)}},I=(e,t,r,i,s,o,a,l,c)=>{const u=t.el=e?e.el:d(""),h=t.anchor=e?e.anchor:d("");let{patchFlag:p,dynamicChildren:m,slotScopeIds:f}=t;f&&(l=l?l.concat(f):f),null==e?(n(u,r,i),n(h,r,i),P(t.children||[],r,h,s,o,a,l,c)):p>0&&64&p&&m&&e.dynamicChildren?(E(e.dynamicChildren,m,r,s,o,a,l),(null!=t.key||s&&t===s.subTree)&&Qe(e,t,!0)):G(e,t,r,h,s,o,a,l,c)},D=(e,t,n,r,i,s,o,a,l)=>{t.slotScopeIds=a,null==e?512&t.shapeFlag?i.ctx.activate(t,n,r,o,l):V(t,n,r,i,s,o,l):j(e,t,l)},V=(e,t,n,o,l,c,d)=>{const u=e.component=function(e,t,n){const s=e.type,o=(t?t.appContext:e.appContext)||Ut,a={uid:qt++,vnode:e,type:s,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new r.yC(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:De(s,o),emitsOptions:dt(s,o),emit:null,emitted:null,propsDefaults:i.MZ,inheritAttrs:s.inheritAttrs,ctx:i.MZ,data:i.MZ,props:i.MZ,attrs:i.MZ,slots:i.MZ,refs:i.MZ,setupState:i.MZ,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return a.ctx={_:a},a.root=t?t.root:a,a.emit=lt.bind(null,a),e.ce&&e.ce(a),a}(e,o,l);if(U(e)&&(u.ctx.renderer=ie),function(e,t=!1,n=!1){t&&Kt(t);const{props:o,children:l}=e.vnode,c=Zt(e);!function(e,t,n,i=!1){const s={},o=Ne();e.propsDefaults=Object.create(null),Oe(e,t,s,o);for(const t in e.propsOptions[0])t in s||(s[t]=void 0);n?e.props=i?s:(0,r.Gc)(s):e.type.props?e.props=s:e.props=o,e.attrs=o}(e,o,c,t),Ge(e,l,n||t);const d=c?function(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,me);const{setup:o}=n;if(o){(0,r.C4)();const n=e.setupContext=o.length>1?function(e){const t=t=>{e.exposed=t||{}};return{attrs:new Proxy(e.attrs,rn),slots:e.slots,emit:e.emit,expose:t}}(e):null,l=Wt(e),c=s(o,e,0,[e.props,n]),d=(0,i.yL)(c);if((0,r.bl)(),l(),!d&&!e.sp||F(e)||B(e),d){if(c.then(Yt,Yt),t)return c.then(n=>{tn(e,n,t)}).catch(t=>{a(t,e,0)});e.asyncDep=c}else tn(e,c,t)}else nn(e,t)}(e,t):void 0;t&&Kt(!1)}(u,!1,d),u.asyncDep){if(l&&l.registerDep(u,q,d),!e.el){const r=u.subTree=Et(yt);k(null,r,t,n),e.placeholder=r.el}}else q(u,e,t,n,l,c,d)},j=(e,t,n)=>{const r=t.component=e.component;if(function(e,t,n){const{props:r,children:i,component:s}=e,{props:o,children:a,patchFlag:l}=t,c=s.emitsOptions;if(t.dirs||t.transition)return!0;if(!(n&&l>=0))return!(!i&&!a||a&&a.$stable)||r!==o&&(r?!o||ft(r,o,c):!!o);if(1024&l)return!0;if(16&l)return r?ft(r,o,c):!!o;if(8&l){const e=t.dynamicProps;for(let t=0;t<e.length;t++){const n=e[t];if(o[n]!==r[n]&&!ut(c,n))return!0}}return!1}(e,t,n)){if(r.asyncDep&&!r.asyncResolved)return void $(r,t,n);r.next=t,r.update()}else t.el=e.el,r.vnode=t},q=(e,t,n,s,o,a,l)=>{const c=()=>{if(e.isMounted){let{next:t,bu:n,u:r,parent:s,vnode:d}=e;{const n=Je(e);if(n)return t&&(t.el=d.el,$(e,t,l)),void n.asyncDep.then(()=>{e.isUnmounted||c()})}let u,h=t;Ze(e,!1),t?(t.el=d.el,$(e,t,l)):t=d,n&&(0,i.DY)(n),(u=t.props&&t.props.onVnodeBeforeUpdate)&&Ft(u,s,t,d),Ze(e,!0);const p=ht(e),f=e.subTree;e.subTree=p,w(f,p,m(f.el),te(f),e,o,a),t.el=p.el,null===h&&function({vnode:e,parent:t},n){for(;t;){const r=t.subTree;if(r.suspense&&r.suspense.activeBranch===e&&(r.el=e.el),r!==e)break;(e=t.vnode).el=n,t=t.parent}}(e,p.el),r&&Ke(r,o),(u=t.props&&t.props.onVnodeUpdated)&&Ke(()=>Ft(u,s,t,d),o)}else{let r;const{el:l,props:c}=t,{bm:d,m:u,parent:h,root:p,type:m}=e,f=F(t);if(Ze(e,!1),d&&(0,i.DY)(d),!f&&(r=c&&c.onVnodeBeforeMount)&&Ft(r,h,t),Ze(e,!0),l&&oe){const t=()=>{e.subTree=ht(e),oe(l,e.subTree,e,o,null)};f&&m.__asyncHydrate?m.__asyncHydrate(l,e,t):t()}else{p.ce&&!1!==p.ce._def.shadowRoot&&p.ce._injectChildStyle(m);const r=e.subTree=ht(e);w(null,r,n,s,e,o,a),t.el=r.el}if(u&&Ke(u,o),!f&&(r=c&&c.onVnodeMounted)){const e=t;Ke(()=>Ft(r,h,e),o)}(256&t.shapeFlag||h&&F(h.vnode)&&256&h.vnode.shapeFlag)&&e.a&&Ke(e.a,o),e.isMounted=!0,t=n=s=null}};e.scope.on();const d=e.effect=new r.X2(c);e.scope.off();const u=e.update=d.run.bind(d),h=e.job=d.runIfDirty.bind(d);h.i=e,h.id=e.uid,d.scheduler=()=>_(h),Ze(e,!0),u()},$=(e,t,n)=>{t.component=e;const s=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,s){const{props:o,attrs:a,vnode:{patchFlag:l}}=e,c=(0,r.ux)(o),[d]=e.propsOptions;let u=!1;if(!(s||l>0)||16&l){let r;Oe(e,t,o,a)&&(u=!0);for(const s in c)t&&((0,i.$3)(t,s)||(r=(0,i.Tg)(s))!==s&&(0,i.$3)(t,r))||(d?!n||void 0===n[s]&&void 0===n[r]||(o[s]=Ie(d,c,s,void 0,e,!0)):delete o[s]);if(a!==c)for(const e in a)t&&(0,i.$3)(t,e)||(delete a[e],u=!0)}else if(8&l){const n=e.vnode.dynamicProps;for(let r=0;r<n.length;r++){let s=n[r];if(ut(e.emitsOptions,s))continue;const l=t[s];if(d)if((0,i.$3)(a,s))l!==a[s]&&(a[s]=l,u=!0);else{const t=(0,i.PT)(s);o[t]=Ie(d,c,t,l,e,!1)}else l!==a[s]&&(a[s]=l,u=!0)}}u&&(0,r.hZ)(e.attrs,"set","")}(e,t.props,s,n),Xe(e,t.children,n),(0,r.C4)(),b(e),(0,r.bl)()},G=(e,t,n,r,i,s,o,a,l=!1)=>{const c=e&&e.children,d=e?e.shapeFlag:0,u=t.children,{patchFlag:h,shapeFlag:m}=t;if(h>0){if(128&h)return void K(c,u,n,r,i,s,o,a,l);if(256&h)return void X(c,u,n,r,i,s,o,a,l)}8&m?(16&d&&ee(c,i,s),u!==c&&p(n,u)):16&d?16&m?K(c,u,n,r,i,s,o,a,l):ee(c,i,s,!0):(8&d&&p(n,""),16&m&&P(u,n,r,i,s,o,a,l))},X=(e,t,n,r,s,o,a,l,c)=>{e=e||i.Oj,t=t||i.Oj;const d=e.length,u=t.length,h=Math.min(d,u);let p;for(p=0;p<h;p++){const r=t[p]=c?Ht(t[p]):Vt(t[p]);w(e[p],r,n,null,s,o,a,l,c)}d>u?ee(e,s,o,!0,!1,h):P(t,n,r,s,o,a,l,c,h)},K=(e,t,n,r,s,o,a,l,c)=>{let d=0;const u=t.length;let h=e.length-1,p=u-1;for(;d<=h&&d<=p;){const r=e[d],i=t[d]=c?Ht(t[d]):Vt(t[d]);if(!At(r,i))break;w(r,i,n,null,s,o,a,l,c),d++}for(;d<=h&&d<=p;){const r=e[h],i=t[p]=c?Ht(t[p]):Vt(t[p]);if(!At(r,i))break;w(r,i,n,null,s,o,a,l,c),h--,p--}if(d>h){if(d<=p){const e=p+1,i=e<u?t[e].el:r;for(;d<=p;)w(null,t[d]=c?Ht(t[d]):Vt(t[d]),n,i,s,o,a,l,c),d++}}else if(d>p)for(;d<=h;)Y(e[d],s,o,!0),d++;else{const m=d,f=d,_=new Map;for(d=f;d<=p;d++){const e=t[d]=c?Ht(t[d]):Vt(t[d]);null!=e.key&&_.set(e.key,d)}let g,b=0;const y=p-f+1;let v=!1,x=0;const k=new Array(y);for(d=0;d<y;d++)k[d]=0;for(d=m;d<=h;d++){const r=e[d];if(b>=y){Y(r,s,o,!0);continue}let i;if(null!=r.key)i=_.get(r.key);else for(g=f;g<=p;g++)if(0===k[g-f]&&At(r,t[g])){i=g;break}void 0===i?Y(r,s,o,!0):(k[i-f]=d+1,i>=x?x=i:v=!0,w(r,t[i],n,null,s,o,a,l,c),b++)}const S=v?function(e){const t=e.slice(),n=[0];let r,i,s,o,a;const l=e.length;for(r=0;r<l;r++){const l=e[r];if(0!==l){if(i=n[n.length-1],e[i]<l){t[r]=i,n.push(r);continue}for(s=0,o=n.length-1;s<o;)a=s+o>>1,e[n[a]]<l?s=a+1:o=a;l<e[n[s]]&&(s>0&&(t[r]=n[s-1]),n[s]=r)}}for(s=n.length,o=n[s-1];s-- >0;)n[s]=o,o=t[o];return n}(k):i.Oj;for(g=S.length-1,d=y-1;d>=0;d--){const e=f+d,i=t[e],h=t[e+1],p=e+1<u?h.el||h.placeholder:r;0===k[d]?w(null,i,n,p,s,o,a,l,c):v&&(g<0||d!==S[g]?W(i,n,p,2):g--)}}},W=(e,t,r,i,s=null)=>{const{el:a,type:l,transition:c,children:d,shapeFlag:u}=e;if(6&u)W(e.component.subTree,t,r,i);else if(128&u)e.suspense.move(t,r,i);else if(64&u)l.move(e,t,r,ie);else if(l!==gt)if(l!==vt)if(2!==i&&1&u&&c)if(0===i)c.beforeEnter(a),n(a,t,r),Ke(()=>c.enter(a),s);else{const{leave:i,delayLeave:s,afterLeave:l}=c,d=()=>{e.ctx.isUnmounted?o(a):n(a,t,r)},u=()=>{a._isLeaving&&a[T](!0),i(a,()=>{d(),l&&l()})};s?s(a,d,u):u()}else n(a,t,r);else(({el:e,anchor:t},r,i)=>{let s;for(;e&&e!==t;)s=f(e),n(e,r,i),e=s;n(t,r,i)})(e,t,r);else{n(a,t,r);for(let e=0;e<d.length;e++)W(d[e],t,r,i);n(e.anchor,t,r)}},Y=(e,t,n,i=!1,s=!1)=>{const{type:o,props:a,ref:l,children:c,dynamicChildren:d,shapeFlag:u,patchFlag:h,dirs:p,cacheIndex:m}=e;if(-2===h&&(s=!1),null!=l&&((0,r.C4)(),H(l,null,n,e,!0),(0,r.bl)()),null!=m&&(t.renderCache[m]=void 0),256&u)return void t.ctx.deactivate(e);const f=1&u&&p,_=!F(e);let g;if(_&&(g=a&&a.onVnodeBeforeUnmount)&&Ft(g,t,e),6&u)J(e.component,n,i);else{if(128&u)return void e.suspense.unmount(n,i);f&&M(e,null,t,"beforeUnmount"),64&u?e.type.remove(e,t,n,ie,i):d&&!d.hasOnce&&(o!==gt||h>0&&64&h)?ee(d,t,n,!1,!0):(o===gt&&384&h||!s&&16&u)&&ee(c,t,n),i&&Z(e)}(_&&(g=a&&a.onVnodeUnmounted)||f)&&Ke(()=>{g&&Ft(g,t,e),f&&M(e,null,t,"unmounted")},n)},Z=e=>{const{type:t,el:n,anchor:r,transition:i}=e;if(t===gt)return void Q(n,r);if(t===vt)return void C(e);const s=()=>{o(n),i&&!i.persisted&&i.afterLeave&&i.afterLeave()};if(1&e.shapeFlag&&i&&!i.persisted){const{leave:t,delayLeave:r}=i,o=()=>t(n,s);r?r(e.el,s,o):o()}else s()},Q=(e,t)=>{let n;for(;e!==t;)n=f(e),o(e),e=n;o(t)},J=(e,t,n)=>{const{bum:r,scope:s,job:o,subTree:a,um:l,m:c,a:d}=e;et(c),et(d),r&&(0,i.DY)(r),s.stop(),o&&(o.flags|=8,Y(a,e,t,n)),l&&Ke(l,t),Ke(()=>{e.isUnmounted=!0},t)},ee=(e,t,n,r=!1,i=!1,s=0)=>{for(let o=s;o<e.length;o++)Y(e[o],t,n,r,i)},te=e=>{if(6&e.shapeFlag)return te(e.component.subTree);if(128&e.shapeFlag)return e.suspense.next();const t=f(e.anchor||e.el),n=t&&t[L];return n?f(n):t};let ne=!1;const re=(e,t,n)=>{null==e?t._vnode&&Y(t._vnode,null,null,!0):w(t._vnode||null,e,t,null,null,null,n),t._vnode=e,ne||(ne=!0,b(),y(),ne=!1)},ie={p:w,um:Y,m:W,r:Z,mt:V,mc:P,pc:G,pbc:E,n:te,o:e};let se,oe;return t&&([se,oe]=t(ie)),{render:re,hydrate:se,createApp:ze(re,se)}}(e)}function Ye({type:e,props:t},n){return"svg"===n&&"foreignObject"===e||"mathml"===n&&"annotation-xml"===e&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function Ze({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Qe(e,t,n=!1){const r=e.children,s=t.children;if((0,i.cy)(r)&&(0,i.cy)(s))for(let e=0;e<r.length;e++){const t=r[e];let i=s[e];1&i.shapeFlag&&!i.dynamicChildren&&((i.patchFlag<=0||32===i.patchFlag)&&(i=s[e]=Ht(s[e]),i.el=t.el),n||-2===i.patchFlag||Qe(t,i)),i.type===bt&&-1!==i.patchFlag&&(i.el=t.el),i.type!==yt||i.el||(i.el=t.el)}}function Je(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Je(t)}function et(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}const tt=Symbol.for("v-scx"),nt=()=>Re(tt);function rt(e,t,n){return it(e,t,n)}function it(e,t,n=i.MZ){const{immediate:s,deep:a,flush:l,once:c}=n,d=(0,i.X$)({},n),u=t&&s||!t&&"post"!==l;let h;if(en)if("sync"===l){const e=nt();h=e.__watcherHandles||(e.__watcherHandles=[])}else if(!u){const e=()=>{};return e.stop=i.tE,e.resume=i.tE,e.pause=i.tE,e}const p=$t;d.call=(e,t,n)=>o(e,p,t,n);let m=!1;"post"===l?d.scheduler=e=>{Ke(e,p&&p.suspense)}:"sync"!==l&&(m=!0,d.scheduler=(e,t)=>{t?e():_(e)}),d.augmentJob=e=>{t&&(e.flags|=4),m&&(e.flags|=2,p&&(e.id=p.uid,e.i=p))};const f=(0,r.wB)(e,t,d);return en&&(h?h.push(f):u&&f()),f}function st(e,t,n){const r=this.proxy,s=(0,i.Kg)(e)?e.includes(".")?ot(r,e):()=>r[e]:e.bind(r,r);let o;(0,i.Tn)(t)?o=t:(o=t.handler,n=t);const a=Wt(this),l=it(s,o.bind(r),n);return a(),l}function ot(e,t){const n=t.split(".");return()=>{let t=e;for(let e=0;e<n.length&&t;e++)t=t[n[e]];return t}}const at=(e,t)=>"modelValue"===t||"model-value"===t?e.modelModifiers:e[`${t}Modifiers`]||e[`${(0,i.PT)(t)}Modifiers`]||e[`${(0,i.Tg)(t)}Modifiers`];function lt(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||i.MZ;let s=n;const a=t.startsWith("update:"),l=a&&at(r,t.slice(7));let c;l&&(l.trim&&(s=n.map(e=>(0,i.Kg)(e)?e.trim():e)),l.number&&(s=n.map(i.bB)));let d=r[c=(0,i.rU)(t)]||r[c=(0,i.rU)((0,i.PT)(t))];!d&&a&&(d=r[c=(0,i.rU)((0,i.Tg)(t))]),d&&o(d,e,6,s);const u=r[c+"Once"];if(u){if(e.emitted){if(e.emitted[c])return}else e.emitted={};e.emitted[c]=!0,o(u,e,6,s)}}const ct=new WeakMap;function dt(e,t,n=!1){const r=n?ct:t.emitsCache,s=r.get(e);if(void 0!==s)return s;const o=e.emits;let a={},l=!1;if(!(0,i.Tn)(e)){const r=e=>{const n=dt(e,t,!0);n&&(l=!0,(0,i.X$)(a,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return o||l?((0,i.cy)(o)?o.forEach(e=>a[e]=null):(0,i.X$)(a,o),(0,i.Gv)(e)&&r.set(e,a),a):((0,i.Gv)(e)&&r.set(e,null),null)}function ut(e,t){return!(!e||!(0,i.Mp)(t))&&(t=t.slice(2).replace(/Once$/,""),(0,i.$3)(e,t[0].toLowerCase()+t.slice(1))||(0,i.$3)(e,(0,i.Tg)(t))||(0,i.$3)(e,t))}function ht(e){const{type:t,vnode:n,proxy:r,withProxy:s,propsOptions:[o],slots:l,attrs:c,emit:d,render:u,renderCache:h,props:p,data:m,setupState:f,ctx:_,inheritAttrs:g}=e,b=S(e);let y,v;try{if(4&n.shapeFlag){const e=s||r,t=e;y=Vt(u.call(t,e,h,p,f,m,_)),v=c}else{const e=t;y=Vt(e.length>1?e(p,{attrs:c,slots:l,emit:d}):e(p,null)),v=t.props?c:pt(c)}}catch(t){wt.length=0,a(t,e,1),y=Et(yt)}let w=y;if(v&&!1!==g){const e=Object.keys(v),{shapeFlag:t}=w;e.length&&7&t&&(o&&e.some(i.CP)&&(v=mt(v,o)),w=Ot(w,v,!1,!0))}return n.dirs&&(w=Ot(w,null,!1,!0),w.dirs=w.dirs?w.dirs.concat(n.dirs):n.dirs),n.transition&&E(w,n.transition),y=w,S(b),y}const pt=e=>{let t;for(const n in e)("class"===n||"style"===n||(0,i.Mp)(n))&&((t||(t={}))[n]=e[n]);return t},mt=(e,t)=>{const n={};for(const r in e)(0,i.CP)(r)&&r.slice(9)in t||(n[r]=e[r]);return n};function ft(e,t,n){const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let i=0;i<r.length;i++){const s=r[i];if(t[s]!==e[s]&&!ut(n,s))return!0}return!1}const _t=e=>e.__isSuspense;const gt=Symbol.for("v-fgt"),bt=Symbol.for("v-txt"),yt=Symbol.for("v-cmt"),vt=Symbol.for("v-stc"),wt=[];let xt=null;function kt(e=!1){wt.push(xt=e?null:[])}let St=1;function Ct(e,t=!1){St+=e,e<0&&xt&&t&&(xt.hasOnce=!0)}function Mt(e){return e.dynamicChildren=St>0?xt||i.Oj:null,wt.pop(),xt=wt[wt.length-1]||null,St>0&&xt&&xt.push(e),e}function Lt(e,t,n,r,i,s){return Mt(Nt(e,t,n,r,i,s,!0))}function Tt(e,t,n,r,i){return Mt(Et(e,t,n,r,i,!0))}function zt(e){return!!e&&!0===e.__v_isVNode}function At(e,t){return e.type===t.type&&e.key===t.key}const Rt=({key:e})=>null!=e?e:null,Pt=({ref:e,ref_key:t,ref_for:n})=>("number"==typeof e&&(e=""+e),null!=e?(0,i.Kg)(e)||(0,r.i9)(e)||(0,i.Tn)(e)?{i:x,r:e,k:t,f:!!n}:e:null);function Nt(e,t=null,n=null,r=0,s=null,o=(e===gt?0:1),a=!1,l=!1){const c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Rt(t),ref:t&&Pt(t),scopeId:k,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:r,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:x};return l?(jt(c,n),128&o&&e.normalize(c)):n&&(c.shapeFlag|=(0,i.Kg)(n)?8:16),St>0&&!a&&xt&&(c.patchFlag>0||6&o)&&32!==c.patchFlag&&xt.push(c),c}const Et=function(e,t=null,n=null,s=0,o=null,a=!1){if(e&&e!==ae||(e=yt),zt(e)){const r=Ot(e,t,!0);return n&&jt(r,n),St>0&&!a&&xt&&(6&r.shapeFlag?xt[xt.indexOf(e)]=r:xt.push(r)),r.patchFlag=-2,r}if(l=e,(0,i.Tn)(l)&&"__vccOpts"in l&&(e=e.__vccOpts),t){t=function(e){return e?(0,r.ju)(e)||Ee(e)?(0,i.X$)({},e):e:null}(t);let{class:e,style:n}=t;e&&!(0,i.Kg)(e)&&(t.class=(0,i.C4)(e)),(0,i.Gv)(n)&&((0,r.ju)(n)&&!(0,i.cy)(n)&&(n=(0,i.X$)({},n)),t.style=(0,i.Tr)(n))}var l;return Nt(e,t,n,s,o,(0,i.Kg)(e)?1:_t(e)?128:(e=>e.__isTeleport)(e)?64:(0,i.Gv)(e)?4:(0,i.Tn)(e)?2:0,a,!0)};function Ot(e,t,n=!1,r=!1){const{props:s,ref:o,patchFlag:a,children:l,transition:c}=e,d=t?function(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const e in r)if("class"===e)t.class!==r.class&&(t.class=(0,i.C4)([t.class,r.class]));else if("style"===e)t.style=(0,i.Tr)([t.style,r.style]);else if((0,i.Mp)(e)){const n=t[e],s=r[e];!s||n===s||(0,i.cy)(n)&&n.includes(s)||(t[e]=n?[].concat(n,s):s)}else""!==e&&(t[e]=r[e])}return t}(s||{},t):s,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:d,key:d&&Rt(d),ref:t&&t.ref?n&&o?(0,i.cy)(o)?o.concat(Pt(t)):[o,Pt(t)]:Pt(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==gt?-1===a?16:16|a:a,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Ot(e.ssContent),ssFallback:e.ssFallback&&Ot(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&r&&E(u,c.clone(u)),u}function It(e=" ",t=0){return Et(bt,null,e,t)}function Bt(e,t){const n=Et(vt,null,e);return n.staticCount=t,n}function Dt(e="",t=!1){return t?(kt(),Tt(yt,null,e)):Et(yt,null,e)}function Vt(e){return null==e||"boolean"==typeof e?Et(yt):(0,i.cy)(e)?Et(gt,null,e.slice()):zt(e)?Ht(e):Et(bt,null,String(e))}function Ht(e){return null===e.el&&-1!==e.patchFlag||e.memo?e:Ot(e)}function jt(e,t){let n=0;const{shapeFlag:r}=e;if(null==t)t=null;else if((0,i.cy)(t))n=16;else if("object"==typeof t){if(65&r){const n=t.default;return void(n&&(n._c&&(n._d=!1),jt(e,n()),n._c&&(n._d=!0)))}{n=32;const r=t._;r||Ee(t)?3===r&&x&&(1===x.slots._?t._=1:(t._=2,e.patchFlag|=1024)):t._ctx=x}}else(0,i.Tn)(t)?(t={default:t,_ctx:x},n=32):(t=String(t),64&r?(n=16,t=[It(t)]):n=8);e.children=t,e.shapeFlag|=n}function Ft(e,t,n,r=null){o(e,t,7,[n,r])}const Ut=Le();let qt=0;let $t=null;const Gt=()=>$t||x;let Xt,Kt;{const e=(0,i.We)(),t=(t,n)=>{let r;return(r=e[t])||(r=e[t]=[]),r.push(n),e=>{r.length>1?r.forEach(t=>t(e)):r[0](e)}};Xt=t("__VUE_INSTANCE_SETTERS__",e=>$t=e),Kt=t("__VUE_SSR_SETTERS__",e=>en=e)}const Wt=e=>{const t=$t;return Xt(e),e.scope.on(),()=>{e.scope.off(),Xt(t)}},Yt=()=>{$t&&$t.scope.off(),Xt(null)};function Zt(e){return 4&e.vnode.shapeFlag}let Qt,Jt,en=!1;function tn(e,t,n){(0,i.Tn)(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:(0,i.Gv)(t)&&(e.setupState=(0,r.Pr)(t)),nn(e,n)}function nn(e,t,n){const s=e.type;if(!e.render){if(!t&&Qt&&!s.render){const t=s.template||ye(e).template;if(t){const{isCustomElement:n,compilerOptions:r}=e.appContext.config,{delimiters:o,compilerOptions:a}=s,l=(0,i.X$)((0,i.X$)({isCustomElement:n,delimiters:o},r),a);s.render=Qt(t,l)}}e.render=s.render||i.tE,Jt&&Jt(e)}{const t=Wt(e);(0,r.C4)();try{!function(e){const t=ye(e),n=e.proxy,s=e.ctx;_e=!1,t.beforeCreate&&ge(t.beforeCreate,e,"bc");const{data:o,computed:a,methods:l,watch:c,provide:d,inject:u,created:h,beforeMount:p,mounted:m,beforeUpdate:f,updated:_,activated:g,deactivated:b,beforeDestroy:y,beforeUnmount:v,destroyed:w,unmounted:x,render:k,renderTracked:S,renderTriggered:C,errorCaptured:M,serverPrefetch:L,expose:T,inheritAttrs:z,components:A,directives:R,filters:P}=t;if(u&&function(e,t){(0,i.cy)(e)&&(e=ke(e));for(const n in e){const s=e[n];let o;o=(0,i.Gv)(s)?"default"in s?Re(s.from||n,s.default,!0):Re(s.from||n):Re(s),(0,r.i9)(o)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>o.value,set:e=>o.value=e}):t[n]=o}}(u,s),l)for(const e in l){const t=l[e];(0,i.Tn)(t)&&(s[e]=t.bind(n))}if(o){const t=o.call(n,n);(0,i.Gv)(t)&&(e.data=(0,r.Kh)(t))}if(_e=!0,a)for(const e in a){const t=a[e],r=(0,i.Tn)(t)?t.bind(n,n):(0,i.Tn)(t.get)?t.get.bind(n,n):i.tE,o=!(0,i.Tn)(t)&&(0,i.Tn)(t.set)?t.set.bind(n):i.tE,l=on({get:r,set:o});Object.defineProperty(s,e,{enumerable:!0,configurable:!0,get:()=>l.value,set:e=>l.value=e})}if(c)for(const e in c)be(c[e],s,n,e);if(d){const e=(0,i.Tn)(d)?d.call(n):d;Reflect.ownKeys(e).forEach(t=>{!function(e,t){if($t){let n=$t.provides;const r=$t.parent&&$t.parent.provides;r===n&&(n=$t.provides=Object.create(r)),n[e]=t}}(t,e[t])})}function N(e,t){(0,i.cy)(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(h&&ge(h,e,"c"),N(Y,p),N(Z,m),N(Q,f),N(J,_),N(q,g),N($,b),N(se,M),N(ie,S),N(re,C),N(ee,v),N(te,x),N(ne,L),(0,i.cy)(T))if(T.length){const t=e.exposed||(e.exposed={});T.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||(e.exposed={});k&&e.render===i.tE&&(e.render=k),null!=z&&(e.inheritAttrs=z),A&&(e.components=A),R&&(e.directives=R),L&&B(e)}(e)}finally{(0,r.bl)(),t()}}}const rn={get:(e,t)=>((0,r.u4)(e,"get",""),e[t])};function sn(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy((0,r.Pr)((0,r.IG)(e.exposed)),{get:(t,n)=>n in t?t[n]:n in he?he[n](e):void 0,has:(e,t)=>t in e||t in he})):e.proxy}const on=(e,t)=>(0,r.EW)(e,t,en),an="3.5.21"},4116:(e,t,n)=>{"use strict";n.d(t,{MR:()=>s.M,MT:()=>a.M,Sv:()=>u.S,UB:()=>c.U,VL:()=>l.V,_D:()=>o._,j5:()=>i.j,wP:()=>r.w,yc:()=>d.y});var r=n(9390),i=n(3097),s=n(2332),o=n(9204),a=n(2698),l=n(3447),c=n(8304),d=n(3682),u=n(722)},4314:(e,t,n)=>{"use strict";n.d(t,{Bz:()=>s,NW:()=>o,h_:()=>i});var r=n(7633);const i=(0,r.Kh)({point:{x:0,y:0},css:{},cube:void 0,menu:void 0,stack_pos:[],stack_menus:[],stack_rect:[]}),s=(0,r.Kh)({open:!1,data:{},submit(){}});function o(e,t){s.open=!0,s.submit=t,s.data=e}},4430:(e,t,n)=>{"use strict";n.d(t,{uz:()=>r.uz}),n(4314);var r=n(1642)},4743:(e,t,n)=>{"use strict";n.d(t,{yI:()=>jn,UF:()=>Ja,ev:()=>Un,$6:()=>Et,LU:()=>vt,DW:()=>zr,ry:()=>nr,OA:()=>np,PL:()=>ln,LO:()=>xr,fl:()=>Ap,en:()=>ip,zl:()=>$,ZU:()=>D,A6:()=>cr,vV:()=>P,c9:()=>er,XV:()=>Tt,mM:()=>zp,de:()=>Nt,HR:()=>yt,p4:()=>rl,RQ:()=>lr,oY:()=>wt,qH:()=>rp,fC:()=>i.f,gK:()=>kt,R$:()=>Tn,Kw:()=>wr,NQ:()=>Tr,Qm:()=>b,EU:()=>An,gL:()=>Hn,$u:()=>q,at:()=>Np,gv:()=>Ln,Ku:()=>yp,P6:()=>X,ju:()=>V,LZ:()=>Sp,k9:()=>fr,sf:()=>on,e8:()=>an,Nj:()=>Rn,AG:()=>Fn,iO:()=>Pn});var r={};n.r(r),n.d(r,{boolean:()=>as,booleanish:()=>ls,commaOrSpaceSeparated:()=>ps,commaSeparated:()=>hs,number:()=>ds,overloadedBoolean:()=>cs,spaceSeparated:()=>us});var i=n(4926),s=n(8606),o=n(4116),a=n(9513),l=n(7633),c=n(4089),d=n(3972);const u=["id","data-type"],h={class:"lost-info"},p=(0,c.pM)({__name:"cube-lost",props:{cube:{}},setup:e=>(e,t)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-lost",id:e.cube.id,"data-type":(0,l.R1)(a.u0).lost},[t[2]||(t[2]=(0,c.Lk)("div",{class:"lost-title"},"异常方块",-1)),(0,c.Lk)("div",h,[t[0]||(t[0]=(0,c.Lk)("div",null,"方块类型: ",-1)),(0,c.Lk)("div",null,(0,d.v_)(e.cube.cube_name),1),t[1]||(t[1]=(0,c.Lk)("div",null,"异常原因: ",-1)),(0,c.Lk)("div",null,(0,d.v_)(e.cube.msg),1)])],8,u))});var m=n(6743);const f=(0,m.A)(p,[["__scopeId","data-v-2525a8c9"]]);var _=n(3028),g=n(8631);class b extends o._D{_msg=(0,l.KR)("");get msg(){return this._msg.value}set msg(e){this._msg.value=e}_component=f;get component(){return this._component}get meta(){return b.meta}get cube_name(){return this.data.type}get is_empty(){return!1}get children(){return[]}constructor(e,t,n){super(e,t),e&&this.setup(e,t),this.msg=n}build_child(){}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}gc(){}replace_id(e,t={}){return b.replace_id(this.root,e,t)}export(){const e=this.base_export();return e.attrs.postil&&(e.info.attrs.postil=e.attrs.postil),e}on_cursor_in_head(e){const{courier:t,next_cube:n}=this,r=new _.vk(t);return n&&r.tell(n,o.UB.in_head(n.id,0)),r}on_cursor_in_tail(e){const{courier:t,prev_cube:n}=this,r=new _.vk(t);return n&&r.tell(n,o.UB.in_head(n.id,0)),r}static get_default(e){return{id:(0,s.Ak)(),type:a.u0.lost,info:e,css:{},attrs:{}}}static get meta(){return{cubename:"异常方块",type:a.u0.lost,block:!1,version:1,show:!1}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();return n[r]=i,t.id=i,t}}const y=["id","data-type"],v=(0,c.pM)({__name:"cube-text",props:{cube:{}},setup(e){function t(){const t=e.cube.postil;t&&t.visible(!t.show)}return(e,n)=>((0,c.uX)(),(0,c.CE)("span",{class:(0,d.C4)(["cube-text",{"text-mark":e.cube.has_postil}]),style:(0,d.Tr)(e.cube.css),onClick:t,id:e.cube.id,"data-type":(0,l.R1)(a.u0).text},(0,d.v_)(e.cube.text),15,y))}}),w=(0,m.A)(v,[["__scopeId","data-v-54fe1fb2"]]);var x=n(8474),k=n(2519);const S=(0,c.pM)({__name:"cube-view",props:{cube:{}},setup:e=>(e,t)=>((0,c.uX)(),(0,c.Wv)((0,c.$y)(e.cube.component),{cube:(0,l.IG)(e.cube)},null,8,["cube"]))});var C=n(7977);const M=["id","data-type"],L={class:"iconbox"},T=(0,c.pM)({__name:"cube-annotation",props:{cube:{}},setup(e){const t=(0,l.Kh)({fold:!1});function n(){const{courier:t,history:n}=e.cube.root,r=e.cube.pcube,i=e.cube.index,s=new _.vk(t);s.tell(r,o.VL.delete_child(r.id,"backward",[i,i+1])),n.record(s)}function r(){t.fold=!t.fold}return(e,i)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-annotation",style:(0,d.Tr)(e.cube.css),id:e.cube.id,"data-type":(0,l.R1)(a.u0).annotation},[(0,c.Lk)("div",L,[(0,c.Lk)("div",{class:(0,d.C4)(["iconfont",(0,l.R1)(C.R).icons.fold,t.fold?"annotation-icon-active":""]),onClick:r,title:"折叠批注块"},null,2),(0,c.Lk)("div",{class:"iconfont icon-Delete",onClick:n,title:"删除批注块"})]),t.fold?(0,c.Q3)("v-if",!0):((0,c.uX)(),(0,c.CE)("div",{key:0,class:(0,d.C4)(["annotation-contents",{"annotation-fold":t.fold}])},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.children,e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:e,class:"annotation-box"},null,8,["cube"]))),128))],2))],12,M))}}),z=(0,m.A)(T,[["__scopeId","data-v-b157e116"]]);var A=n(9927);function R(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class P extends o._D{_component=z;constructor(e,t){super(e,t);const n=this.setup(e,t);return this.init(),n}get component(){return this._component}get meta(){return P.meta}init(){}gc(){super.base_gc()}export(){const e=this.base_export();e.info=[];for(let t of this._children)e.info.push(t.export());return e}build_child(e){const t=g.I.build_cubes(e.info,this);this._children.push(...t)}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}splice(e,t,...n){const r=this._children.splice(e,t,...n);for(let e of r)e.gc();const i=[];for(let e of r)e instanceof o._D&&i.push(e.export());return{children:r,data:i}}replace_id(e,t={}){return P.replace_id(this.root,e,t)}on_insert_child(e){const{courier:t}=this,{pos:n,data:r}=e,i=t.get_recorder();if(i.add_cmd(e),0===r.length)return;if(!this.meta.block)return;let s=this.get_valid_index(n);const a=this.create_child_block(r);this.splice(s,0,...a),i.add_recover(o.VL.delete_child(this.id,"backward",[s,s+a.length]));const l=this.children[s+1];return l?i.tell(l,o.UB.in_head(l.id,0)):i.tell(this.child_last,o.UB.in_tail(this.child_last.id,0)),i}on_delete_child(e){const{courier:t,pid:n,index:r,pcube:i}=this,s=t.get_recorder();s.add_cmd(e);const{dir:a,range:l}=e,[c,d]=l;let u=c<0?0:c,h=d>this.child_count?this.child_count:d;if(u>=h)return;if(u<=0&&h>=this.child_count)return this.is_empty?s.tell(i,o.VL.delete_child(n,a,[r,r+1])):s.tell(this,o.VL.reset(this.id,[])),s;const p=this.children[u-1],m=this.children[h],f=h-u;let _=this.splice(c,f);return s.add_recover(o.VL.insert_child(this.id,_.data,c)),"backward"===a?p?s.tell(p,o.UB.in_tail(p.id,0)):m&&s.tell(m,o.UB.in_head(m.id,0)):"forward"===a&&(m?s.tell(m,o.UB.in_head(m.id,0)):p&&s.tell(p,o.UB.in_tail(p.id,0))),s}on_reset(e){const{courier:t,history:n}=this,{data:r}=e,i=new _.vk(t),s=[];for(let e of this.children)s.push(e.export());const a=g.I.build_cubes(r,this);return this.splice(0,this.child_count,...a),i.add_recover(o.VL.reset(this.id,s)),i}static get meta(){return{cubename:"批注",type:x.u0.annotation,block:!0,version:1,show:!1}}static get_default(e={},t={}){const n={id:(0,s.Ak)(),type:x.u0.text,info:"",attrs:{},css:{}},r={id:(0,s.Ak)(),type:x.u0.line,info:[n],attrs:{},css:{}},i={id:(0,s.Ak)(),type:x.u0.box,info:[r],attrs:{},css:{}};return{id:(0,s.Ak)(),type:x.u0.annotation,info:[i],css:e,attrs:t}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i;let s=[];for(let r of t.info){const t=A.K.find_cube(r.type);t&&t.replace_id&&s.push(t.replace_id(e,r,n))}return t.info=s,t}}R([(0,k.H)(a.zS.cube_insert_child)],P.prototype,"on_insert_child",null),R([(0,k.H)(a.zS.cube_delete_child)],P.prototype,"on_delete_child",null),R([(0,k.H)(a.zS.cube_reset)],P.prototype,"on_reset",null);var N=n(1068);const E=["id","data-type"],O={class:"title"},I=(0,c.pM)({__name:"cube-text-link",props:{cube:{}},setup(e){function t(){const t=document.createElement("a");t.href=e.cube.data.info.url,t.target="_blank",t.click()}function n(){e.cube.event.emit_text_link_edit(e.cube)}function r(){const{courier:t,history:n}=e.cube.root,{pcube:r,index:i}=e.cube,s=new _.vk(t);s.tell(r,o.VL.delete_child(r.id,"backward",[i,i+1])),n.record(s)}return(e,i)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-link",style:(0,d.Tr)(e.cube.css),id:e.cube.id,"data-type":(0,l.R1)(a.u0).link},[(0,c.Lk)("div",O,(0,d.v_)(e.cube.data.info.title),1),(0,c.Lk)("div",{class:"link",onClick:t},(0,d.v_)(e.cube.data.info.url),1),(0,c.Lk)("div",{class:"iconbox"},[(0,c.Lk)("div",{class:"iconfont icon-rename",onClick:n}),(0,c.Lk)("div",{class:"iconfont icon-Delete",onClick:r})])],12,E))}}),B=(0,m.A)(I,[["__scopeId","data-v-2946c9fa"]]);class D{static update(e,t,n){return{id:e,name:a.gS.update,title:t,url:n}}}class V extends o._D{constructor(e,t){return super(e,t),this.setup(e,t)}get info(){return this.data.info}get component(){return B}get meta(){return V.meta}get url(){return this.data.info.url}get title(){return this.data.info.title}build_child(e){}gc(){}export(){return this.base_export()}replace_id(e,t={}){return V.replace_id(this.root,e,t)}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}on_update_info(e){const{courier:t,cursor:n}=this,{url:r,title:i}=e,s=t.get_recorder();s.add_cmd(e);const o=this.info.title,a=this.info.url;return this.info.url=r,this.info.title=i,s.add_recover(D.update(this.id,o,a)),s}static get meta(){return{cubename:"文本链接",type:a.u0.link,block:!0,show:!1,version:1}}static get_default(e,t,n={},r={}){return{id:(0,s.Ak)(),type:a.u0.link,info:{url:e,title:t},css:n,attrs:r}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();return n[r]=i,t.id=i,t}}!function(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);s>3&&o&&Object.defineProperty(t,n,o)}([(0,k.H)(a.gS.update)],V.prototype,"on_update_info",null);const H=["id","data-type"],j=(0,c.pM)({__name:"cube-postil",props:{cube:{}},setup(e){const t=(0,c.EW)(()=>e.cube.children.filter(e=>e instanceof V)),n=(0,c.EW)(()=>e.cube.children.filter(e=>!(e instanceof V))),r=(0,c.EW)(()=>({...e.cube.css}));function i(){e.cube.visible(!1)}function s(){const{courier:t,history:n}=e.cube.root,r=e.cube.pcube,i=new _.vk(t);i.tell(r,o.VL.postil_remove(r.id,[0,e.cube.child_count])),n.record(i)}function u(e){e.preventDefault(),e.stopPropagation();const t=e.currentTarget;if(!(t instanceof HTMLElement))return;const{deltaY:n}=e;n>0?N.DomAnimation.scroll_element(t,20,"vertical"):N.DomAnimation.scroll_element(t,-20,"vertical")}return(e,o)=>e.cube.show?((0,c.uX)(),(0,c.CE)("div",{key:0,class:"cube-postil",style:(0,d.Tr)(r.value),id:e.cube.id,"data-type":(0,l.R1)(a.u0).postil},[(0,c.Lk)("div",{class:"iconbox"},[(0,c.Lk)("div",{class:"iconfont icon-Delete delete",title:"清空",onClick:s}),(0,c.Lk)("div",{class:"iconfont icon-close close",title:"关闭",onClick:i})]),(0,c.Lk)("div",{class:"mark-contents",onWheel:u},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(t.value,e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:e},null,8,["cube"]))),128)),((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(n.value,e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:e},null,8,["cube"]))),128))],32)],12,H)):(0,c.Q3)("v-if",!0)}}),F=(0,m.A)(j,[["__scopeId","data-v-7ca0a800"]]);function U(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class q extends o._D{_handler_update_pos;_handler_corrent;_timer_corrent;_show=(0,l.KR)(!1);constructor(e,t){super(e,t);const n=this.setup(e,t);return t.has_postil=!0,n}get default_size(){return{x:0,y:0,width:180,height:130}}get show(){return this._show.value}set show(e){this._show.value=e,e&&this.root.listener.check_float()}get has_annotation(){for(let e of this.children)if(e instanceof P)return!0;return!1}get meta(){return q.meta}get component(){return F}get is_empty(){return 1===this.child_count&&this.child_first.is_empty}build_child(e){const t=g.I.build_cubes(e.info,this);this._children.push(...t)}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}export(){const e=this.base_export();e.info=[];for(let t of this.children)e.info.push(t.export());return e}gc(){super.base_gc(),this.root.cubes.remove_cube(this),this._handler_update_pos&&(this.root.event.off(this._handler_update_pos),this._handler_update_pos=null)}replace_id(e,t={}){return q.replace_id(this.root,e,t)}on_insert_child(e){const{courier:t}=this,{pos:n,data:r}=e,i=t.get_recorder();if(i.add_cmd(e),0===r.length)return;if(!this.meta.block)return;let s=this.get_valid_index(n);const a=this.create_child_block(r);this.splice(s,0,...a),i.add_recover(o.VL.delete_child(this.id,"backward",[s,s+a.length]));const l=this.children[s+1];return l?i.tell(l,o.UB.in_head(l.id,0)):i.tell(this.child_last,o.UB.in_tail(this.child_last.id,0)),i}on_delete_child(e){const{courier:t,pid:n,index:r,pcube:i}=this,s=t.get_recorder();s.add_cmd(e);const{dir:a,range:l}=e,[c,d]=l;let u=c<0?0:c,h=d>this.child_count?this.child_count:d;if(u>=h)return;if(u<=0&&h>=this.child_count)return s.tell(this,o.VL.reset(this.id,[])),s;const p=this.children[u-1],m=this.children[h],f=h-u;let _=this.splice(c,f);return s.add_recover(o.VL.insert_child(this.id,_.data,c)),"backward"===a?p?s.tell(p,o.UB.in_tail(p.id,0)):m&&s.tell(m,o.UB.in_head(m.id,0)):"forward"===a&&(m?s.tell(m,o.UB.in_head(m.id,0)):p&&s.tell(p,o.UB.in_tail(p.id,0))),s}on_reset(e){const{courier:t,history:n}=this,{data:r}=e,i=new _.vk(t),s=[];for(let e of this.children)s.push(e.export());const a=g.I.build_cubes(r,this);return this.splice(0,this.child_count,...a),i.add_recover(o.VL.reset(this.id,s)),i}splice(e,t,...n){const r=this._children.splice(e,t,...n);for(let e of r)e.gc();const i=[];for(let e of r)e instanceof o._D&&i.push(e.export());return{children:r,data:i}}visible(e){if(e){const{courier:e,child_last:t}=this;this.update_pos(),this.show=!0,(0,c.dY)(()=>{const n=e.get_recorder();n.tell(t,o.UB.in_tail(t.id,0)),this.history.record(n)})}else this.show=!1}update_pos(e=!0){(0,c.dY)(()=>{const e=this.pcube.clientRect,t=this.clientRect||this.default_size;if(!e)return void(this.show=!1);const n={x:0,y:0,width:window.innerWidth,height:window.innerHeight},r=N.MathRect.move_rect_to_other(n,t,e,5);this.data.css.left=`${r.x}px`,this.data.css.top=`${r.y}px`})}static get_default(e=[],t={}){return{id:(0,s.Ak)(),type:a.u0.postil,info:e,attrs:{},css:t}}static get meta(){return{cubename:"标注内容",type:a.u0.postil,show:!1,version:1,block:!0}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i;const s=[];for(let r of t.info){const t=A.K.find_cube(r.type);t&&t.replace_id&&s.push(t.replace_id(e,r,n))}return t.info=s,t}}U([(0,k.H)(a.zS.cube_insert_child)],q.prototype,"on_insert_child",null),U([(0,k.H)(a.zS.cube_delete_child)],q.prototype,"on_delete_child",null),U([(0,k.H)(a.zS.cube_reset)],q.prototype,"on_reset",null);class ${static reset(e,t,n,r){return{id:e,name:a.lm.text_reset,info:t,cursor_after:r,cursor_before:n}}static break(e,t){return{id:e,name:a.lm.text_break,offset:t}}}function G(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class X extends o._D{_component=w;get attrs(){return this.data.attrs}get component(){return this._component}get meta(){return X.meta}get is_empty(){return X.is_empty_text(this.data)}get len(){return this.text.length}get text(){return this.data.info}get text_node(){const e=this.dom?.firstChild;if(e instanceof Text)return e}get children(){return[]}get line(){let e=this.pcube;for(;e;){if(e instanceof kt)return e;e=e.pcube}}constructor(e,t){super(e,t);const n=this.setup(e,t);return this.data.info=this.data.info.replace("\r",""),this.data.info||(this.data.info=""),this.init(),n}init(){this.root.stats.update_count_word(this.len)}build_child(e){const t=e.attrs?.postil;t&&(this.postil=new q(t,this))}gc(){super.base_gc(),this.root.stats.update_count_word(-this.len)}replace_id(e,t={}){return X.replace_id(this.root,e,t)}find_child_cube(e){}export(){return this.base_export()}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}merge_text(e){const{courier:t}=this,n=t.get_recorder(),r=this.prev_cube,i=this.next_cube,s=r instanceof X,a=i instanceof X;if(s&&a){const t=o.VL.merge(this.id,"both",this.id,e);n.tell(this,t)}else if(s){const t=o.VL.merge(this.id,"left",this.id,e);n.tell(this,t)}else if(a){const t=o.VL.merge(this.id,"right",this.id,e);n.tell(this,t)}return n}on_partition(e){const{courier:t,cursor:n,pcube:r}=this,{start_id:i,end_id:s,offset_end:a,offset_start:c}=e,d=this.get_valid_index(c),u=this.get_valid_index(a),h=new _.vk(t),p=this.text.slice(0,d),m=this.text.slice(d,u),f=this.text.slice(u);if(m){const e=X.get_default(m,structuredClone((0,l.ux)(this.css)));if(p){if(p){if(h.tell(this,$.reset(this.id,p,p.length,p.length)),f){const e=X.get_default(f,structuredClone((0,l.ux)(this.css)));h.tell(r,o.VL.insert_child(r.id,[e],this.index+1))}h.tell(r,o.VL.insert_child(r.id,[e],this.index+1))}}else if(h.tell(this,$.reset(this.id,m,m.length,m.length)),f){const e=X.get_default(f,structuredClone((0,l.ux)(this.css)));h.tell(r,o.VL.insert_child(r.id,[e],this.index+1))}return h}if(0===d){const e=X.get_default();h.tell(r,o.VL.insert_child(r.id,[e],this.index))}else if(d===this.len){const e=X.get_default();h.tell(r,o.VL.insert_child(r.id,[e],this.index+1))}else if(d>0&&d<this.len){const e=X.get_default(f,structuredClone((0,l.ux)(this.css)));return h.tell(r,o.VL.insert_child(r.id,[e],this.index+1)),h.tell(this,$.reset(this.id,p,p.length,p.length)),h}return h}on_cube_merge(e){const{courier:t,prev_cube:n,pcube:r,next_cube:i,pid:s,index:a}=this,{method:l,offset:c,cubeid:d}=e;let u=this.get_valid_index(c);const h=new _.vk(t);if("left"===l&&n instanceof X&&this.can_merge_with(n)){const e=n.id;h.tell(r,o.VL.delete_child(s,"forward",[a-1,a])),h.tell(this,$.reset(this.id,n.text+this.text,u,u+n.len)),this.event.emit_text_merge(e,this.id)}else if("right"===l&&i instanceof X&&this.can_merge_with(i)){const e=i.id;h.tell(r,o.VL.delete_child(s,"backward",[a+1,a+2])),h.tell(this,$.reset(this.id,this.text+i.text,u,u)),this.event.emit_text_merge(e,this.id)}else if("both"===l)if(n instanceof X&&i instanceof X&&this.can_merge_with(n)&&this.can_merge_with(i)){const e=n.len+u,t=n.id,s=i.id;h.tell(r,o.VL.delete_child(this.pid,"backward",[this.index-1,this.index])),h.tell(r,o.VL.delete_child(this.pid,"backward",[this.index+1,this.index+2])),h.tell(this,$.reset(this.id,n.text+this.text+i.text,u,e)),this.event.emit_text_merge(t,this.id),this.event.emit_text_merge(s,this.id)}else if(n instanceof X&&this.can_merge_with(n)){const e=n.id;h.tell(r,o.VL.delete_child(s,"forward",[a-1,a])),h.tell(this,$.reset(this.id,n.text+this.text,u,u+n.len)),this.event.emit_text_merge(e,this.id)}else if(i instanceof X&&this.can_merge_with(i)){const e=i.id;h.tell(r,o.VL.delete_child(s,"backward",[a+1,a+2])),h.tell(this,$.reset(this.id,this.text+i.text,u,u)),this.event.emit_text_merge(e,this.id)}return h}on_cube_insert(e){const{data:t,start_id:n,end_id:r,offset_end:i,offset_start:s}=e,{courier:a,pid:c,pcube:d}=this,u=new _.vk(a);this.cursor.has_selection;let h=s,p=i;if(h<0&&(h=0),p>this.text.length&&(p=this.text.length),i!==s){const e=o.VL.delete(this.id,"backward",this.id,this.id,s,i,!0);u.tell(this,e)}const m=g.I.pick(t),f=this.text.slice(0,h),b=this.text.slice(p);if(m.head.length>0)if(f)if(f&&b){u.tell(this,$.reset(this.id,f,f.length,f.length));const e=X.get_default(b,structuredClone((0,l.ux)(this.css)),structuredClone((0,l.ux)(this.attrs)));u.tell(d,o.VL.insert_child(c,[e],this.index+1)),u.tell(d,o.VL.insert_child(c,m.head,this.index+1))}else b||u.tell(d,o.VL.insert_child(c,m.head,this.index+1));else u.tell(d,o.VL.insert_child(c,m.head,this.index));const y=[...m.body];if(m.tail.length>0&&y.push(kt.get_default(m.tail)),m.root.length>0)for(let e of m.root)y.push(...e.info);if(y.length>0){if(0===m.head.length&&i>0&&i<this.len){u.tell(this,$.reset(this.id,f,f.length,f.length));const e=X.get_default(b,structuredClone((0,l.ux)(this.css)),structuredClone((0,l.ux)(this.attrs)));u.tell(d,o.VL.insert_child(c,[e],this.index+1))}u.tell(d,o.VL.insert_child(this.pid,y,this.index+1))}return u}on_cube_delete(e){const{courier:t,index:n,pcube:r,pid:i}=this,{dir:s,start_id:a,end_id:l,offset_start:c,offset_end:d,reserve:u}=e,h=new _.vk(t),p=this.get_valid_index(c),m=this.get_valid_index(d),f=p!==m||"head"===c||"tail"===d;if(0===p&&m===this.len)return u?h.tell(this,$.reset(this.id,"",this.len,1)):h.tell(r,o.VL.delete_child(i,"backward",[n,n+1])),h;const g=this.text.slice(0,p),b=this.text.slice(m);if(f)h.tell(this,$.reset(this.id,g+b,m,p));else{const e=p;if("backward"===s)if(0===e||0===X.drop_zero_width_space(this.text,p).pos)if(this.pcube.is_empty&&this.pcube instanceof o._D)h.merge(this.pcube.remove_self());else{const e=this.prev_cube_deep;if(!e)return;if(e.meta.block){const t=e.pcube;t&&h.merge(t.delete_edge(this,s))}else h.tell(e,o.VL.delete_adjacent(e.id,"right",this.id,0))}else if(this.is_empty)h.tell(r,o.VL.delete_child(i,"backward",[n,n+1]));else{const e=this.find_text_deleted(p,"left");h.tell(this,$.reset(this.id,e.text,g.length,e.pos)),e.text&&h.tell(this,o.VL.merge(this.id,"both",this.id,g.length-1))}else if("forward"===s)if(e===this.len||e===X.drop_zero_width_space(this.text,p).len)if(this.pcube.is_empty&&this.pcube instanceof o._D)h.merge(this.pcube.remove_self());else{const e=this.next_cube_deep;if(!e)return;if(e.meta.block){const t=e?.pcube;t&&h.merge(t.delete_edge(this,s))}else h.tell(e,o.VL.delete_adjacent(e.id,"left",this.id,this.len))}else if(this.is_empty)h.tell(r,o.VL.delete_child(i,"forward",[n,n+1]));else{const t=this.find_text_deleted(e,"right");h.tell(this,$.reset(this.id,t.text,g.length,g.length)),h.tell(this,o.VL.merge(this.id,"both",this.id,g.length))}}return h}on_text_reset(e){const{courier:t,pid:n,index:r,pcube:i,len:s}=this,{info:a,cursor_after:l,cursor_before:c}=e,d=t.get_recorder();d.add_cmd(e);let u=this.text;!a&&this.is_empty;const h=X.drop_zero_intelligence(a,l);return this.data.info=h.text,this.root.stats.update_count_word(h.len-s),d.tell(this,o.UB.in_head(this.id,h.pos)),d.add_recover($.reset(this.id,u,h.pos,c)),d}on_cube_set_selection_css(e){const{courier:t,pid:n,pcube:r}=this,{css:i,start_id:s,end_id:a,offset_start:c,offset_end:d,toggle:u,replace:h}=e;if(0===Object.keys(i).length&&!h)return;const p=new _.vk(t),m=this.get_valid_index(c),f=this.get_valid_index(d),g=X.drop_zero_width_space(this.text.slice(0,m),0).text,b=X.drop_zero_width_space(this.text.slice(m,f),0).text,y=X.drop_zero_width_space(this.text.slice(f),0).text;if(0===m&&f===this.len||m===f&&s===a)p.tell(this,o.VL.set_css(this.id,i,u,h)),p.tell(this,o.VL.merge(this.id,"both",this.id,f));else if(0===m&&b){const e=structuredClone((0,l.ux)(this.css));if(p.tell(this,$.reset(this.id,b,f,f)),p.tell(this,o.VL.set_css(this.id,i,u,h)),y){const t=X.get_default(y,e);p.tell(r,o.VL.insert_child(n,[t],this.index+1));const i=r.find_cube(t.id);i&&p.tell(i,o.VL.merge(t.id,"both",t.id,0))}p.tell(this,o.UB.in_tail(this.id,0)),p.tell(this,o.VL.merge(this.id,"left",this.id,this.len))}else if(m>0){if(g&&(p.tell(this,$.reset(this.id,g,m,m)),p.tell(this,o.VL.merge(this.id,"left",this.id,f))),y){const e=X.get_default(y,structuredClone((0,l.ux)(this.css))),t=[e];p.tell(r,o.VL.insert_child(n,t,this.index+1));const i=r.find_cube(e.id);i&&p.tell(i,o.VL.merge(i.id,"right",i.id,0))}if(b){const e=X.get_default(b,structuredClone((0,l.ux)(this.css)));p.tell(r,o.VL.insert_child(n,[e],this.index+1));const t=r.find_cube(e.id);t&&(p.tell(t,o.VL.set_css(e.id,i,u,h)),p.tell(t,o.VL.merge(e.id,"both",e.id,g.length+m)))}}return p}on_cube_break(e){const{courier:t,cursor:n,pcube:r,pid:i,index:s}=this,a=r.pcube;if(!a)return;const{offset:l}=e;let c=s+1;const d=new _.vk(t),u=this.text[l-1],h=this.text[l];let p=l,m=!1;if(u){const e=u.charCodeAt(0);55296<=e&&e<=56319&&(m=!0)}if(h&&!m){const e=h.charCodeAt(0);56320<=e&&e<=57343&&(m=!0)}m&&(p+=1),d.tell(this,o.VL.partition(this.id,this.id,this.id,p,p));const f=[];for(let e of r.children.slice(c))f.push(e.export());d.tell(r,o.VL.delete_child(r.id,"backward",[c,r.child_count]));const g=kt.get_default(f),b=this.line;b&&b.inherit_line([g]),d.tell(a,o.VL.insert_child(a.id,[g],r.index+1));const y=r.next_cube;return y?.id===g.id&&d.tell(y,o.UB.in_head(y.id,0,void 0)),d}on_cube_delete_adjacent(e){const{courier:t,pcube:n}=this,{from:r,from_id:i,offset:s}=e,a=new _.vk(t);if("left"===r)if(this.is_empty)a.merge(this.remove_self());else{const e=this.prev_cube_deep;e?.meta.block?a.tell(this,o.UB.in_head(this.id,0)):a.tell(this,o.VL.delete(this.id,"forward",this.id,this.id,0,0))}else if(this.is_empty)a.merge(this.remove_self());else{const e=this.next_cube_deep;e?.meta.block?a.tell(this,o.UB.in_tail(this.id,0)):a.tell(this,o.VL.delete(this.id,"backward",this.id,this.id,this.len,this.len))}return a}add_link(e,t){const{cursor:n,courier:r}=this,i=r.get_recorder(),s=V.get_default(t,e);return i.tell(this,o.VL.postil_add(this.id,[s])),i}add_annotation(e){const t=this.courier.get_recorder(),n=e||P.get_default();return t.tell(this,o.VL.postil_add(this.id,[n])),t}get_valid_index(e){return"head"===e?0:"tail"===e?this.text.length:e<0?0:e>this.text.length?this.text.length:e}set_cursor_in_head(e=0){const t=this.get_valid_index(e);(0,c.dY)(()=>{this.line?.dom?.focus();const e=this.text_node;e&&this.cursor.set_cursor(e,t<0?0:t)})}set_cursor_in_tail(e=0){let t=this.len-this.get_valid_index(e);(0,c.dY)(()=>{this.line?.dom?.focus();const e=this.text_node;e&&this.cursor.set_cursor(e,t<0?0:t)})}find_text_nav_pos(e,t){const n=this.text;let r=e;if(e<0&&(r=0),e>n.length&&(r=n.length),"left"===t){let e=r-1,t=n[e];for(;""===t&&e>=0;)e-=1,t=n[e];if(t){const n=t.charCodeAt(0);56320<=n&&n<=57343&&(e-=1)}return e<0?0:e}{let e=r+1,t=n[e];for(;""===t&&e<n.length;)e+=1,t=n[e];if(t){const n=t.charCodeAt(0);55296<=n&&n<=56319&&(e+=1)}return e>n.length?n.length:e}}find_text_deleted(e,t){if(e<0)return{text:this.text,pos:0};if(e>this.len)return{text:this.text,pos:this.len};if("left"===t){let n=this.find_text_nav_pos(e,t),r=this.text.slice(0,n),i=this.text.slice(e),s=r[r.length-1];if(s){const t=s.charCodeAt(0);55296<=t&&t<=56319&&(r=r.slice(0,-1),e-=1)}return{text:r+i,pos:n}}{let n=this.find_text_nav_pos(e,t),r=this.text.slice(0,e),i=this.text.slice(n),s=i[0];if(s){const e=s.charCodeAt(0);56320<=e&&e<=57343&&(i=i.slice(1))}return{text:r+i,pos:e}}}is_text_remain(e,t){if(0===this.len)return!1;const[n,r]=t;if(n===r)return"backward"===e?0!==this.find_text_nav_pos(n,"left")||this.find_text_nav_pos(r-1,"right")!==this.len:this.find_text_nav_pos(n,"right")!==this.len||0!==this.find_text_nav_pos(n,"left");{if(0===n&&r===this.len)return!1;const e=this.find_text_nav_pos(n+1,"left"),t=this.find_text_nav_pos(r-1,"right");return e>0||t<this.len}}drop_zero_width_space(e){return X.drop_zero_width_space(this.text,e)}can_merge_with(e){const t=g.I.is_same_style(this.css,e.css)||0===Object.keys(e.css).length,n=g.I.is_same_attrs(this.attrs,e.attrs),r=!this.postil&&!e.postil;return t&&n&&r}static drop_zero_width_space(e,t){let n="",r=t;r<0&&(r=0),r>e.length&&(r=e.length);const i=e.slice(0,r),s=e.slice(r);if(i){for(let e of i)""!==e&&(n+=e);r=n.length}if(s)for(let e of s)""!==e&&(n+=e);return{text:n,pos:r,get len(){return this.text.length}}}static drop_zero_intelligence(e,t){let n="",r=t;r<0&&(r=0),r>e.length&&(r=e.length);const i=e.slice(0,r),s=e.slice(r);if(i){for(let e=0;e<i.length;e++){let t=i[e],r=i[e-1];""===t&&"\n"!==r||(n+=t)}r=n.length}if(s)for(let e=0;e<s.length;e++){let t=s[e],r=s[e-1];""===t&&"\n"!==r||(n+=t)}return n||(n="",r=1),{text:n,pos:r,get len(){return this.text.length}}}static is_empty_text(e){if(e.type!==x.u0.text)return!1;let t="";for(let n of e.info)if(""!==n&&(t+=n),t.length>0)return!1;return 0===t.length}static get meta(){return{version:1,type:x.u0.text,cubename:"文本",block:!1,show:!1}}static get_default(e="",t={},n={}){const r=e||"";return{id:(0,s.Ak)(),type:x.u0.text,info:r,css:structuredClone((0,l.ux)(t)),attrs:structuredClone((0,l.ux)(n))}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();return n[r]=i,t.id=i,e.event.emit_replace_id(r,i),t}}G([(0,k.H)(a.zS.cube_partition)],X.prototype,"on_partition",null),G([(0,k.H)(a.zS.cube_merge)],X.prototype,"on_cube_merge",null),G([(0,k.H)(a.zS.cube_insert)],X.prototype,"on_cube_insert",null),G([(0,k.H)(a.zS.cube_delete)],X.prototype,"on_cube_delete",null),G([(0,k.H)(a.lm.text_reset)],X.prototype,"on_text_reset",null),G([(0,k.H)(a.zS.cube_set_selection_css)],X.prototype,"on_cube_set_selection_css",null),G([(0,k.H)(a.lm.text_break)],X.prototype,"on_cube_break",null),G([(0,k.H)(a.zS.cube_delete_adjacent)],X.prototype,"on_cube_delete_adjacent",null);const K=["id","data-type","contenteditable"],W=(0,c.pM)({__name:"cube-line",props:{cube:{}},setup:e=>(e,t)=>((0,c.uX)(),(0,c.CE)("div",{class:(0,d.C4)(["cube-line",{"line-first-letter-lower":e.cube.attrs.first_letter_lower}]),id:e.cube.id,"data-type":(0,l.R1)(a.u0).line,style:(0,d.Tr)(e.cube.css),contenteditable:e.cube.editable,spellcheck:"false"},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.children,e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:e},null,8,["cube"]))),128))],14,K))}),Y=(0,m.A)(W,[["__scopeId","data-v-f72cf81e"]]);let Z;const Q="undefined"!=typeof window&&window.trustedTypes;if(Q)try{Z=Q.createPolicy("vue",{createHTML:e=>e})}catch(e){}const J=Z?e=>Z.createHTML(e):e=>e,ee="undefined"!=typeof document?document:null,te=ee&&ee.createElement("template"),ne={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const i="svg"===t?ee.createElementNS("http://www.w3.org/2000/svg",e):"mathml"===t?ee.createElementNS("http://www.w3.org/1998/Math/MathML",e):n?ee.createElement(e,{is:n}):ee.createElement(e);return"select"===e&&r&&null!=r.multiple&&i.setAttribute("multiple",r.multiple),i},createText:e=>ee.createTextNode(e),createComment:e=>ee.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>ee.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,i,s){const o=n?n.previousSibling:t.lastChild;if(i&&(i===s||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),i!==s&&(i=i.nextSibling););else{te.innerHTML=J("svg"===r?`<svg>${e}</svg>`:"mathml"===r?`<math>${e}</math>`:e);const i=te.content;if("svg"===r||"mathml"===r){const e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},re=Symbol("_vtc");Boolean;c.QP;const ie=Symbol("_vod"),se=Symbol("_vsh"),oe=Symbol(""),ae=/(?:^|;)\s*display\s*:/,le=/\s*!important$/;function ce(e,t,n){if((0,d.cy)(n))n.forEach(n=>ce(e,t,n));else if(null==n&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=function(e,t){const n=ue[t];if(n)return n;let r=(0,d.PT)(t);if("filter"!==r&&r in e)return ue[t]=r;r=(0,d.ZH)(r);for(let n=0;n<de.length;n++){const i=de[n]+r;if(i in e)return ue[t]=i}return t}(e,t);le.test(n)?e.setProperty((0,d.Tg)(r),n.replace(le,""),"important"):e[r]=n}}const de=["Webkit","Moz","ms"],ue={},he="http://www.w3.org/1999/xlink";function pe(e,t,n,r,i,s=(0,d.J$)(t)){r&&t.startsWith("xlink:")?null==n?e.removeAttributeNS(he,t.slice(6,t.length)):e.setAttributeNS(he,t,n):null==n||s&&!(0,d.Y2)(n)?e.removeAttribute(t):e.setAttribute(t,s?"":(0,d.Bm)(n)?String(n):n)}function me(e,t,n,r,i){if("innerHTML"===t||"textContent"===t)return void(null!=n&&(e[t]="innerHTML"===t?J(n):n));const s=e.tagName;if("value"===t&&"PROGRESS"!==s&&!s.includes("-")){const r="OPTION"===s?e.getAttribute("value")||"":e.value,i=null==n?"checkbox"===e.type?"on":"":String(n);return r===i&&"_value"in e||(e.value=i),null==n&&e.removeAttribute(t),void(e._value=n)}let o=!1;if(""===n||null==n){const r=typeof e[t];"boolean"===r?n=(0,d.Y2)(n):null==n&&"string"===r?(n="",o=!0):"number"===r&&(n=0,o=!0)}try{e[t]=n}catch(e){}o&&e.removeAttribute(i||t)}function fe(e,t,n,r){e.addEventListener(t,n,r)}const _e=Symbol("_vei");const ge=/(?:Once|Passive|Capture)$/;let be=0;const ye=Promise.resolve(),ve=()=>be||(ye.then(()=>be=0),be=Date.now()),we=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123;"undefined"!=typeof HTMLElement&&HTMLElement,Symbol("_moveCb"),Symbol("_enterCb");const xe=e=>{const t=e.props["onUpdate:modelValue"]||!1;return(0,d.cy)(t)?e=>(0,d.DY)(t,e):t};function ke(e){e.target.composing=!0}function Se(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Ce=Symbol("_assign"),Me={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e[Ce]=xe(i);const s=r||i.props&&"number"===i.props.type;fe(e,t?"change":"input",t=>{if(t.target.composing)return;let r=e.value;n&&(r=r.trim()),s&&(r=(0,d.bB)(r)),e[Ce](r)}),n&&fe(e,"change",()=>{e.value=e.value.trim()}),t||(fe(e,"compositionstart",ke),fe(e,"compositionend",Se),fe(e,"change",Se))},mounted(e,{value:t}){e.value=null==t?"":t},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:s}},o){if(e[Ce]=xe(o),e.composing)return;const a=null==t?"":t;if((!s&&"number"!==e.type||/^0\d/.test(e.value)?e.value:(0,d.bB)(e.value))!==a){if(document.activeElement===e&&"range"!==e.type){if(r&&t===n)return;if(i&&e.value.trim()===a)return}e.value=a}}},Le=(0,d.X$)({patchProp:(e,t,n,r,i,s)=>{const o="svg"===i;"class"===t?function(e,t,n){const r=e[re];r&&(t=(t?[t,...r]:[...r]).join(" ")),null==t?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}(e,r,o):"style"===t?function(e,t,n){const r=e.style,i=(0,d.Kg)(n);let s=!1;if(n&&!i){if(t)if((0,d.Kg)(t))for(const e of t.split(";")){const t=e.slice(0,e.indexOf(":")).trim();null==n[t]&&ce(r,t,"")}else for(const e in t)null==n[e]&&ce(r,e,"");for(const e in n)"display"===e&&(s=!0),ce(r,e,n[e])}else if(i){if(t!==n){const e=r[oe];e&&(n+=";"+e),r.cssText=n,s=ae.test(n)}}else t&&e.removeAttribute("style");ie in e&&(e[ie]=s?r.display:"",e[se]&&(r.display="none"))}(e,n,r):(0,d.Mp)(t)?(0,d.CP)(t)||function(e,t,n,r,i=null){const s=e[_e]||(e[_e]={}),o=s[t];if(r&&o)o.value=r;else{const[n,a]=function(e){let t;if(ge.test(e)){let n;for(t={};n=e.match(ge);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[":"===e[2]?e.slice(3):(0,d.Tg)(e.slice(2)),t]}(t);if(r){const o=s[t]=function(e,t){const n=e=>{if(e._vts){if(e._vts<=n.attached)return}else e._vts=Date.now();(0,c.qL)(function(e,t){if((0,d.cy)(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(e=>t=>!t._stopped&&e&&e(t))}return t}(e,n.value),t,5,[e])};return n.value=e,n.attached=ve(),n}(r,i);fe(e,n,o,a)}else o&&(function(e,t,n,r){e.removeEventListener(t,n,r)}(e,n,o,a),s[t]=void 0)}}(e,t,0,r,s):("."===t[0]?(t=t.slice(1),1):"^"===t[0]?(t=t.slice(1),0):function(e,t,n,r){if(r)return"innerHTML"===t||"textContent"===t||!!(t in e&&we(t)&&(0,d.Tn)(n));if("spellcheck"===t||"draggable"===t||"translate"===t||"autocorrect"===t)return!1;if("form"===t)return!1;if("list"===t&&"INPUT"===e.tagName)return!1;if("type"===t&&"TEXTAREA"===e.tagName)return!1;if("width"===t||"height"===t){const t=e.tagName;if("IMG"===t||"VIDEO"===t||"CANVAS"===t||"SOURCE"===t)return!1}return(!we(t)||!(0,d.Kg)(n))&&t in e}(e,t,r,o))?(me(e,t,r),e.tagName.includes("-")||"value"!==t&&"checked"!==t&&"selected"!==t||pe(e,t,r,o,0,"value"!==t)):!e._isVueCE||!/[A-Z]/.test(t)&&(0,d.Kg)(r)?("true-value"===t?e._trueValue=r:"false-value"===t&&(e._falseValue=r),pe(e,t,r,o)):me(e,(0,d.PT)(t),r,0,t)}},ne);let Te;const ze=(...e)=>{const t=(Te||(Te=(0,c.K9)(Le))).createApp(...e),{mount:n}=t;return t.mount=e=>{const r=function(e){if((0,d.Kg)(e))return document.querySelector(e);return e}(e);if(!r)return;const i=t._component;(0,d.Tn)(i)||i.render||i.template||(i.template=r.innerHTML),1===r.nodeType&&(r.textContent="");const s=n(r,!1,function(e){return e instanceof SVGElement?"svg":"function"==typeof MathMLElement&&e instanceof MathMLElement?"mathml":void 0}(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),s},t};function Ae(e,t){if(t.freeze)return;e.preventDefault(),e.stopPropagation();const{doc:n,stats:r}=t,{deltaY:i,currentTarget:s}=e,o=t.config.data.revert_scope;i>0&&!o?t.expand("down"):t.expand("up")}const Re={class:"iconbox"},Pe=(0,c.pM)({__name:"note-scope",props:{selection:{}},setup(e){const t=(0,c.EW)(()=>{if(!e.selection.pos)return;const t=Math.min(e.selection.pos.width,e.selection.pos.height);return 0!==t?{"font-size":Math.min(Math.max(Math.floor(t/3),18),64)+"px"}:void 0}),n=(0,c.EW)(()=>{if(!e.selection.pos)return;const t=Math.min(e.selection.pos.width,e.selection.pos.height);return 0!==t?{"font-size":Math.min(Math.max(Math.floor(t/3),18),64)+"px",display:e.selection.pos.width<30?"none":"unset"}:void 0});function r(){e.selection.freeze=!e.selection.freeze}function i(t,n,r){t.stopPropagation();const{root:i}=e.selection,s=new _.vk(i.courier),a=n.get_scope_info(),l=a.cube.children[a.range[0]],c=a.cube.children[a.range[1]-1];if("A"===r&&c)if(c instanceof yt){const e=yt.get_default();s.tell(a.cube,o.VL.insert_child(a.cube.id,[e],c.index+1))}else{const e=kt.get_default(),t=o.VL.insert_child(a.cube.id,[e],c.index+1);s.tell(a.cube,t)}else if("B"===r&&l)if(l instanceof yt){const e=yt.get_default();s.tell(a.cube,o.VL.insert_child(a.cube.id,[e],l.index))}else{const e=kt.get_default(),t=o.VL.insert_child(a.cube.id,[e],l.index);s.tell(a.cube,t)}i.history.record(s)}function s(t){t.preventDefault(),t.stopPropagation(),e.selection.remove()}return(e,o)=>((0,c.uX)(),(0,c.CE)("div",{class:(0,d.C4)(["doc-scope",{freeze:e.selection.freeze}]),style:(0,d.Tr)(e.selection.css),onWheel:o[3]||(o[3]=t=>(0,l.R1)(Ae)(t,e.selection)),onClick:r,onContextmenu:s},[(0,c.Lk)("div",Re,[(0,c.Lk)("div",{class:"iconfont icon-a-copy",style:(0,d.Tr)(n.value),title:"在上方插入行",onClick:o[0]||(o[0]=t=>i(t,e.selection,"A"))},null,4),(0,c.Lk)("div",{class:"iconfont icon-force_vortex-copy",title:"取消选区",style:(0,d.Tr)(t.value),onClick:o[1]||(o[1]=()=>e.selection.remove())},null,4),(0,c.Lk)("div",{class:"iconfont icon-B-copy",style:(0,d.Tr)(n.value),title:"在上方插入行",onClick:o[2]||(o[2]=t=>i(t,e.selection,"B"))},null,4)])],38))}}),Ne=(0,m.A)(Pe,[["__scopeId","data-v-bdec0da6"]]);var Ee=n(3923);class Oe extends Ee.K{has_down=!1;down_caret=void 0;constructor(e){super(e)}get root(){return this._root}pointerdown(e){if(this.root.stats.is_read_mode)return e.preventDefault();e.preventDefault(),this.has_down=!0,this.down_caret=document.caretPositionFromPoint(e.clientX,e.clientY),this.click_selection_text(e),this.cursor.locate_cursor_by_coor(e.clientX,e.clientY)}pointermove(e){this.stats.view_point={x:e.clientX,y:e.clientY},this.drag_selection_text(e)}pointercancel(e){this.has_down=!1,this.down_caret=null}pointerup(e){e.preventDefault(),this.has_down=!1,this.down_caret=null}beforeinput(e){if(this.stats.in_composition_mode)return;if(this.event.emit_doc_input_before(e).some(e=>"stop"===e))return;e.preventDefault();const{courier:t,cursor:n,history:r}=this,i=e.data,{cube_end:s,cube_start:a,cube_selection:l,offset_start:c,offset_end:d}=n;if(!l||!s||!a)return;const u=a.id,h=s.id,p=l.id;if("insertText"===e.inputType){if(!(l instanceof X&&i)){const e=t.get_recorder(),n=X.get_default(i||""),s=o.VL.insert(p,[n],u,h,c,d);return e.tell(l,s),r.record(e)}{const e=t.get_recorder();this.ins(e,this.root,i,l,c,d),r.record(e)}}else if("deleteContentBackward"===e.inputType||"deleteContentForward"===e.inputType){const n=t.get_recorder();if(!this.root.scope_count_normal){let t="deleteContentBackward"===e.inputType?"backward":"forward";const i=o.VL.delete(p,t,u,h,c,d);return n.tell(l,i),r.record(n)}{const e=this.clipboard.delete_scope();e&&this.history.record(e)}}}compositionstart(e){this.stats.in_composition_mode=!0,this.clear_selection_text()}compositionupdate(e){}compositionend(e){const{courier:t,cursor:n,history:r,stats:i,event:s}=this.root;if(n.has_selection)return;if(!i.in_composition_mode)return;const{cube_end:o,cube_start:a,cube_selection:l,offset_start:c,offset_end:d}=n,u=e.data,h=new _.vk(t);if(l&&o&&a){if(l instanceof X){const e=l.text,t=d-u.length,n=`${e.slice(0,t)}${u}${e.slice(t)}`,r=$.reset(l.id,n,t,d);h.tell(l,r)}else console.error("编辑目标无法在内存结构中找到,此问题多由于未将子cube计算到children属性");i.in_composition_mode=!1,r.record(h),s.emit_doc_input_compositionend(e)}}clear_selection_text(){const{cursor:e,courier:t,history:n}=this;if(!e.has_selection)return;const{cube_end:r,cube_start:i,cube_selection:s,offset_start:a,offset_end:l}=e;if(!s||!r||!i)return;const c=new _.vk(t);c.tell(s,o.VL.delete(s.id,"backward",i.id,r.id,a,l)),n.record(c)}ins(e,t,n,r,i,s){const{courier:a,history:l}=t,c=r.text,d=c.slice(0,i)+n+c.slice(s),u=i+n.length,h=$.reset(r.id,d,i,u);e.tell(r,h);const p=o.VL.merge(r.id,"both",r.id,u);return e.tell(r,p),e}click_selection_text(e){if(!this.down_caret||!e.shiftKey)return;const{offset_end:t,node_end:n}=this.cursor,{offset:r,offsetNode:i}=this.down_caret;n instanceof Text&&i instanceof Text&&Promise.resolve().then(()=>{this.cursor.set_selection_between(n,t,i,r)})}drag_selection_text(e){if(!this.has_down||!this.down_caret||!g.I.check_mouse_key(e,"left"))return;const t=document.caretPositionFromPoint(e.clientX,e.clientY);t&&this.down_caret.offsetNode instanceof Text&&t.offsetNode instanceof Text&&this.cursor.set_selection_between(this.down_caret.offsetNode,this.down_caret.offset,t.offsetNode,t.offset)}}class Ie extends Oe{dragenter(e){e.preventDefault()}dragover(e){e.preventDefault()}dragleave(e){e.preventDefault()}drop(e){}handler_click_foot(e){e.preventDefault();const{courier:t,cursor:n,history:r}=this.root,i=this.root.child_last;if(i&&i.is_empty){let e=i;for(;e;){if(e instanceof X){e.line?.dom?.focus(),e.set_cursor_in_tail();break}e=e.child_last}}else{const e=new _.vk(t),n=yt.get_default();e.tell(this.root,o.VL.insert_child(this.root.id,[n],this.root.child_count)),r.record(e)}}}class Be extends Oe{}var De=n(4314),Ve=n(1642);const He={class:"dialog-form"},je={class:"form-grid"},Fe={class:"label"},Ue=["onUpdate:modelValue"],qe=(0,c.pM)({__name:"menu-dialog",setup(e){const t=(0,l.KR)();function n(){const e=t.value;e&&(De.Bz.open=!1,e.close())}function r(){n(),De.Bz.submit(De.Bz.data)}return(0,c.wB)(()=>De.Bz.open,()=>{const e=t.value;e&&(De.Bz.open?e.showModal():e.close())}),(e,i)=>((0,c.uX)(),(0,c.CE)("dialog",{class:"menu-dialog",ref_key:"root",ref:t,onClose:n},[(0,c.Lk)("div",He,[(0,c.Lk)("div",{class:"close-corner",onClick:n}),(0,c.Lk)("div",je,[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(Object.keys((0,l.R1)(De.Bz).data),e=>((0,c.uX)(),(0,c.CE)(c.FK,{key:e},[(0,c.Lk)("div",Fe,(0,d.v_)(e),1),(0,c.bo)((0,c.Lk)("input",{type:"text","onUpdate:modelValue":t=>(0,l.R1)(De.Bz).data[e]=t},null,8,Ue),[[Me,(0,l.R1)(De.Bz).data[e]]])],64))),128))]),(0,c.Lk)("div",{class:"dialog-submit",onClick:r},"确认")])],544))}}),$e=(0,m.A)(qe,[["__scopeId","data-v-edfb8f60"]]),Ge={class:"menu-title iconfont icon-sp"},Xe=["onPointerdown","onMouseenter"],Ke={class:"item-shortcut"},We={key:0,class:"iconfont icon-arrow-right"},Ye={class:"menu-title iconfont icon-sp"},Ze=["onPointerdown","onMouseenter"],Qe={class:"item-shortcut"},Je={key:0,class:"iconfont icon-arrow-right"},et=(0,c.pM)({__name:"note-menu",props:{root:{}},setup(e){const t=(0,l.KR)(),n=(0,l.KR)([]);function r(e,t=!1){t?(De.h_.stack_menus.length=e,De.h_.stack_rect.length=e,De.h_.menu=void 0):(De.h_.stack_menus.length=e,De.h_.stack_rect.length=e)}function i(e,t,n){if(r(t),!n.has_submenu)return;const i=e.currentTarget;De.h_.stack_rect.push(i.getBoundingClientRect());const s=n.mouseenter(e);De.h_.stack_menus.push(s)}function s(e,t){r(0,!0),t.click(e)}function o(e){return{cursor:e.usable?"unset":"not-allowed",color:e.usable?"unset":"var(--menu-item-disable-color)"}}function a(e){e.stopPropagation()}return(0,c.wB)(()=>De.h_.point,async()=>{const e=t.value;if(!e)return;await(0,c.dY)(),De.h_.stack_pos.length=0;const n={x:0,y:0,width:window.innerWidth,height:window.innerHeight},r=e.getBoundingClientRect(),i={x:De.h_.point.x,y:De.h_.point.y,width:0,height:0},s=N.MathRect.move_rect_to_other(n,r,i);De.h_.css={left:s.x+"px",top:s.y+"px"}}),(0,c.wB)(De.h_.stack_menus,async()=>{await(0,c.dY)();const e=n.value;if(!e)return;De.h_.stack_pos.length=0;const t={x:0,y:0,width:window.innerWidth,height:window.innerHeight};for(let n=0;n<De.h_.stack_menus.length;n++){const r=De.h_.stack_rect[n],i=e[n].getBoundingClientRect(),s=(0,Ve.LU)(t,i,r);De.h_.stack_pos.push({left:s.x+"px",top:s.y+"px"})}}),(0,c.sV)(()=>{document.documentElement.addEventListener("pointerdown",e=>{const n=t.value;if(!n)return;const r=e.target;r&&!n.contains(r)&&(De.h_.menu=void 0,De.h_.stack_menus.length=0,De.h_.stack_pos.length=0,De.h_.stack_rect.length=0)},{capture:!0})}),(e,r)=>((0,c.uX)(),(0,c.CE)("div",{class:"note-menus",style:(0,d.Tr)((0,l.R1)(De.h_).css),ref_key:"dom",ref:t,onWheel:a},[(0,c.Q3)(" 弹窗 "),(0,c.bF)($e),(0,c.Q3)(" 主菜单列表 "),(0,l.R1)(De.h_).menu?((0,c.uX)(),(0,c.CE)("div",{key:0,class:"menu-list",ref_key:"ms",ref:n},[(0,c.Lk)("div",Ge,(0,d.v_)((0,l.R1)(De.h_).menu.title),1),((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)((0,l.R1)(De.h_).menu.menus,e=>((0,c.uX)(),(0,c.CE)("div",{class:(0,d.C4)(["menu-item",{"active-item":(0,l.R1)(De.h_).menu.active.includes(e.title)}]),style:(0,d.Tr)(o(e)),key:e.title,onPointerdown:t=>s(t,e),onMouseenter:t=>i(t,0,e)},[(0,c.Lk)("div",{class:(0,d.C4)(["item-title",e.icon])},(0,d.v_)(e.title),3),(0,c.Lk)("div",Ke,(0,d.v_)(e.shortcut),1),e.has_submenu?((0,c.uX)(),(0,c.CE)("div",We)):(0,c.Q3)("v-if",!0)],46,Xe))),128))],512)):(0,c.Q3)("v-if",!0),(0,c.Q3)(" 子菜单列表 "),((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)((0,l.R1)(De.h_).stack_menus,(e,t)=>((0,c.uX)(),(0,c.CE)("div",{class:"submenu-list",ref_for:!0,ref_key:"ms",ref:n,style:(0,d.Tr)((0,l.R1)(De.h_).stack_pos[t])},[(0,c.Lk)("div",Ye,(0,d.v_)(e.title),1),((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.menus,n=>((0,c.uX)(),(0,c.CE)("div",{class:(0,d.C4)(["menu-item",{"active-item":e.active.includes(n.title)}]),style:(0,d.Tr)(o(n)),key:n.title,onPointerdown:e=>s(e,n),onMouseenter:e=>i(e,t+1,n)},[(0,c.Lk)("div",{class:(0,d.C4)(["item-title",n.icon])},(0,d.v_)(n.title),3),(0,c.Lk)("div",Qe,(0,d.v_)(n.shortcut),1),n.has_submenu?((0,c.uX)(),(0,c.CE)("div",Je)):(0,c.Q3)("v-if",!0)],46,Ze))),128))],4))),256))],36))}}),tt=(0,m.A)(et,[["__scopeId","data-v-37bc0e84"]]),nt=["id","data-type"],rt={class:"doc-postils"},it=(0,c.pM)({__name:"cube-doc",props:{cube:{}},setup(e){const t=e.cube,{config:n}=e.cube,r=new Ie(t),i=e=>r.pointerdown(e),s=e=>r.pointermove(e),o=e=>r.pointerup(e),u=e=>r.pointercancel(e),h=e=>r.handler_click_foot(e),p=e=>r.compositionstart(e),m=e=>r.compositionupdate(e),f=e=>r.compositionend(e),_=e=>r.beforeinput(e),g=e=>r.dragover(e),b=e=>r.dragenter(e),y=e=>r.dragleave(e),v=e=>r.drop(e);return(0,c.sV)(()=>{document.documentElement.addEventListener("pointerup",o),document.documentElement.addEventListener("pointermove",s),document.documentElement.addEventListener("pointercancel",u)}),(e,r)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-doc",id:(0,l.R1)(t).id,"data-type":(0,l.R1)(a.u0).doc,style:(0,d.Tr)((0,l.R1)(n).css_vars),onDragover:g,onDragenter:b,onDragleave:y,onDrop:v},[(0,c.Lk)("div",{class:"note",onPointerdown:i,onCompositionstart:p,onCompositionupdate:m,onCompositionend:f,onBeforeinput:_},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)((0,l.R1)(t).children,e=>((0,c.uX)(),(0,c.Wv)((0,c.$y)(e.component),{key:e.id,cube:e,id:e.id},null,8,["cube","id"]))),128)),(0,c.Q3)(" doc-cubes "),(0,c.Lk)("div",rt,[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)((0,l.R1)(t).cubes.postils,([e,t])=>((0,c.uX)(),(0,c.Wv)(S,{key:t.id,cube:t},null,8,["cube"]))),128))]),(0,c.Q3)(" footer "),(0,c.Lk)("div",{class:"cube-doc-footer",onPointerdown:h},null,32)],32),(0,c.Q3)(" scope selection "),((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)((0,l.R1)(t).scope,e=>((0,c.uX)(),(0,c.Wv)(Ne,{key:e.id,selection:(0,l.IG)(e)},null,8,["selection"]))),128)),(0,c.Q3)(" menus "),(0,c.bF)(tt,{root:e.cube},null,8,["root"])],44,nt))}}),st=(0,m.A)(it,[["__scopeId","data-v-728e5342"]]);let ot,at,lt=!1,ct=null,dt=null;function ut(e,t){const{courier:n,history:r,id:i,cubes:s}=t,a=n.get_recorder();a.tell(t,o.VL.fold(i,!t.attrs.fold)),r.record(a);for(let e of Object.values(s.postils))e.pcube?.top===t&&e.visible(!1);const l=t.child_first.id;if(!l)return;const c=document.getElementById(l);c?.scrollIntoView({block:"nearest",behavior:"smooth"})}function ht(e,t){e.preventDefault();const{root:n,stats:r}=t;r.anchor_root_id===t.id?r.anchor_root_id="":n.stats.anchor_root_id=t.id}var pt=n(4430);const mt=["id","data-type"],ft={class:"cube-box-root-content"},_t=(0,c.pM)({__name:"cube-box-root",props:{cube:{}},setup(e){const t=e.cube,{stats:n}=e.cube,r=(0,c.EW)(()=>({opacity:(e.cube.child_count+10)/60})),i=e=>function(e,t){if(e.stopPropagation(),!lt)return void e.preventDefault();const n=e.currentTarget;n instanceof HTMLElement&&(ct=n,ot=t,document.body.style.setProperty("--box-root-pointer-events","none"))}(e,t),s=e=>function(e,t){if(!lt||!ot)return;e.stopPropagation();const n=e.currentTarget;n instanceof HTMLElement&&t!==ot&&(n!==dt&&dt?.classList.remove("drag-enter"),dt=n,at=t,dt.classList.add("drag-enter"))}(e,t),u=e=>function(e,t){lt&&(e.preventDefault(),e.stopPropagation(),ot&&at&&ct&&dt&&ot!==at&&(ct.style["view-transition-name"]=ot.id,document.startViewTransition(()=>{if(!(ot&&at&&ct&&dt))return;const{courier:e,history:n}=t,r=new _.vk(e),i=ct.getBoundingClientRect(),s=at.index,a=ot.export(),l=at.pcube;ot.pcube===l?r.tell(ot.pcube,o.VL.reorder(ot.pid,ot.id,at.index)):(r.merge(ot.remove_self()),r.tell(l,o.VL.insert_child(l.id,[a],s))),n.record(r);const c=dt.getBoundingClientRect(),d=c.x-i.x,u=c.y-i.y;document.body.style.setProperty("--x",d+"px"),document.body.style.setProperty("--y",u+"px")}),lt=!1))}(e,t),h=e=>(dt&&dt.classList.remove("drag-enter"),ct&&ct.classList.remove("drag-enter"),void(lt=!1)),p=e=>function(e){e.preventDefault(),e.stopPropagation(),dt&&dt.classList.add("drag-enter")}(e),m=e=>function(e){e.stopPropagation(),dt&&dt.classList.remove("drag-enter")}(e),f=e=>function(e){const t=e.target;t instanceof HTMLElement&&"cube-box-root-dragger"===t.dataset.tag&&(lt=!0,e.stopPropagation())}(e),g=e=>function(e,t){const{stats:n}=t.root,r=t.index+1;n.active_root_index=r}(0,t);function b(e){const{stats:t}=e;return{"anchor-root":t.anchor_root_id===e.id,"fold-root":e.attrs.fold}}return(e,n)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-box-root",style:(0,d.Tr)((0,l.R1)(t).css),draggable:"true",id:e.cube.id,"data-type":(0,l.R1)(a.u0).box_root,onContextmenu:n[2]||(n[2]=t=>(0,l.R1)(pt.uz)(t,e.cube)),onFocusin:g,onDragstart:i,onDragenter:s,onDrop:u,onDragend:h,onDragover:p,onDragleave:m,onPointerdown:f},[(0,c.Lk)("div",{class:(0,d.C4)(["cube-dragger",b(e.cube)]),style:(0,d.Tr)(r.value),onClick:n[0]||(n[0]=t=>(0,l.R1)(ut)(t,e.cube)),onContextmenu:n[1]||(n[1]=t=>(0,l.R1)(ht)(t,e.cube)),"data-tag":"cube-box-root-dragger"},null,38),(0,c.Lk)("div",ft,[e.cube.attrs.fold?((0,c.uX)(),(0,c.Wv)(S,{key:0,cube:e.cube.child_first},null,8,["cube"])):((0,c.uX)(!0),(0,c.CE)(c.FK,{key:1},(0,c.pI)((0,l.R1)(t).children,e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:(0,l.IG)(e)},null,8,["cube"]))),128))])],44,mt))}}),gt=(0,m.A)(_t,[["__scopeId","data-v-76631106"]]);function bt(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class yt extends o._D{_component=gt;constructor(e,t){return super(e,t),this.setup(e,t)}get children(){const e=[];for(let t of this._children)e.push(t);return e}get component(){return this._component}get meta(){return yt.meta}get is_empty(){return 1===this.child_count&&this.child_first instanceof kt&&this.child_first.is_empty}get attrs(){return this.data.attrs}splice(e,t,...n){const r=this._children.splice(e,t,...n);for(let e of r)e.gc();const i=[];for(let e of r)e instanceof o._D&&i.push(e.export());return{children:r,data:i}}build_child(e){const t=g.I.build_cubes(e.info,this);this._children.push(...t)}gc(){super.base_gc()}export(){const e=this.base_export();e.info=[];for(let t of this.children){let n=t.export();e.info.push(n)}return e}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}replace_id(e,t={}){return yt.replace_id(this.root,e,t)}on_cube_delete_adjacent(e){const{courier:t}=this,{from:n,offset:r,from_id:i}=e,s=new _.vk(t);return"left"===n?this.prev_cube_deep instanceof yt?s.tell(this,o.VL.merge(this.id,"left",i,r)):s.tell(this,o.UB.in_head(this.id,0)):"right"===n&&(this.next_cube_deep instanceof yt?s.merge(this.on(o.VL.merge(this.id,"right",i,r))):s.tell(this,o.UB.in_tail(this.id,0))),s}on_merge(e){const{courier:t,prev_cube:n,next_cube:r,index:i,pid:s}=this,{method:a,cubeid:l,offset:c}=e,d=new _.vk(t);if("left"===a&&n instanceof yt){const e=this.export().info;d.tell(n,o.VL.insert_child(n.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(this.pid,"forward",[i,i+1]));const t=n.find_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}else if("right"===a&&r instanceof yt){const e=r.export().info;d.tell(this,o.VL.insert_child(this.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(s,"backward",[i+1,i+2]));const t=this.find_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}else if("both"===a)if(n instanceof yt&&r instanceof yt){const e=this.export().info,t=r.export().info;d.tell(n,o.VL.insert_child(n.id,e.concat(t),"tail")),d.tell(this.pcube,o.VL.delete_child(this.pid,"backward",[this.index,this.index+2]));const i=n.find_cube(l);i&&d.tell(i,o.UB.in_head(l,c))}else if(n instanceof yt&&!(r instanceof yt)){const e=this.export().info;d.tell(n,o.VL.insert_child(n.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(this.pid,"forward",[i,i+1]));const t=n.find_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}else if(!(n instanceof yt)&&r instanceof yt){const e=r.export().info;d.tell(this,o.VL.insert_child(this.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(s,"backward",[i+1,i+2]));const t=this.find_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}return d}on_cube_reorder(e){const{courier:t,history:n,cursor:r}=this,{cubeid:i,index:s}=e,a=this.find_child_cube(i);if(!a||a.index===s)return;const l=new _.vk(t);let c=0,d=a.index;return"tail"===s?c=this.child_count:"number"==typeof s&&(c=s),this.splice(d,1),this.splice(c,0,a),l.add_recover(o.VL.reorder(this.id,a.id,d)),l}on_cube_reset(e){const t=this.courier,{data:n}=e,r=t.get_recorder();r.add_cmd(e);const i=g.I.filter_out_empty(n);if(0===i.length){const e=this.children[0];if(1===this.child_count&&e instanceof X&&e.is_empty)return;const t=this.export().info,n=new kt(kt.get_default(),this);this.splice(0,this.child_count,n),r.add_recover(o.VL.reset(this.id,t)),r.tell(n,o.UB.in_tail(n.id,0))}else{const e=this.export().info,t=g.I.build_cubes(i,this);this.splice(0,this.child_count,...t),r.add_recover(o.VL.reset(this.id,e))}return r}on_insert_child(e){const{courier:t}=this,{pos:n,data:r}=e,i=t.get_recorder();if(i.add_cmd(e),0===r.length)return;let s=this.get_valid_index(n);const a=g.I.pick(r,!0),l=g.I.build_cubes(a.sort,this);this.splice(s,0,...l),i.add_recover(o.VL.delete_child(this.id,"backward",[s,s+l.length]));const c=l[l.length-1],d=this.children[s+1];return c?i.tell(c,o.UB.in_tail(c.id,0)):i.tell(d,o.UB.in_head(d.id,0)),i}on_delete_child(e){const{courier:t,pid:n,index:r,pcube:i}=this,{dir:s,range:a,reserve:l}=e,c=t.get_recorder();c.add_cmd(e);const[d,u]=a;let h=d<0?0:d,p=u>this.child_count?this.child_count:u;if(!(h>=p)){if(h<=0&&p>=this.child_count&&!l){if(l){if(this.is_empty)return;c.tell(this,o.VL.delete_child(this.id,s,[1,this.child_count]));const e=this.child_first;e&&c.tell(e,o.VL.delete_child(e.id,s,[0,e.child_count],l))}else this.is_empty?c.tell(i,o.VL.delete_child(n,s,[r,r+1])):c.tell(this,o.VL.reset(this.id,[]));return c}{const e=this.children[h-1],t=this.children[p],n=p-h;let r=this.splice(d,n);c.add_recover(o.VL.insert_child(this.id,r.data,d)),"backward"===s?e?c.tell(e,o.UB.in_tail(e.id,0)):t&&c.tell(t,o.UB.in_head(t.id,0)):"forward"===s&&(t?c.tell(t,o.UB.in_head(t.id,0)):e&&c.tell(e,o.UB.in_tail(e.id,0)))}return c}}get_valid_index(e){return"head"===e?0:"tail"===e?this.child_count:e<0?0:e>this.child_count?this.child_count:e}static filter_out_empty(e){return e.filter(e=>!X.is_empty_text(e))}static get meta(){return{type:a.u0.box_root,cubename:"根级块",version:1,block:!0,show:!1}}static get_default(e=[],t={},n={fold:!1}){const r=0===e.length?[kt.get_default()]:e;return{id:g.I.get_id(),type:a.u0.box_root,info:r,css:t,attrs:n}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i;const s=[];for(let r of t.info){const t=A.K.find_cube(r.type);t&&t.replace_id&&s.push(t.replace_id(e,r,n))}return t.info=s,t}}bt([(0,k.H)(a.zS.cube_delete_adjacent)],yt.prototype,"on_cube_delete_adjacent",null),bt([(0,k.H)(a.zS.cube_merge)],yt.prototype,"on_merge",null),bt([(0,k.H)(a.zS.cube_reorder)],yt.prototype,"on_cube_reorder",null),bt([(0,k.H)(a.zS.cube_reset)],yt.prototype,"on_cube_reset",null),bt([(0,k.H)(a.zS.cube_insert_child)],yt.prototype,"on_insert_child",null),bt([(0,k.H)(a.zS.cube_delete_child)],yt.prototype,"on_delete_child",null);class vt{}class wt extends o.MR{_app;data;constructor(e){super();const t=this.update_data(e).data;this.data=(0,l.Kh)(t),this.build_child(t),k.o.init_cmd_handler(this),A.K.add_doc(this),this._app=ze(st,{cube:this})}get domain(){return"doc"}get app(){return this._app}get component(){return st}get meta(){return wt.meta}get doc(){return this}get children(){const e=[];for(let t of this._children)e.push(t);return e}build_child(e){const t=g.I.build_cubes(e.info,this);return this._children.push(...t),t}gc(){}export(){const e=(0,l.ux)(this.data);e.css=structuredClone((0,l.ux)(this.css)),e.attrs=structuredClone((0,l.ux)(this.attrs)),e.info=[];for(let t of this.children){let n=t.export();e.info.push(n)}return e}update_data(e){return e.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}replace_id(e,t={}){return wt.replace_id(this.root,e,t)}render(e){this._dom=e,this.hotkeys.listen(e),this.app.mount(e),this.event.emit_status_update()}static get meta(){return{type:a.u0.doc,cubename:"文档",version:1,block:!0,show:!1}}static get_default(){return yt.get_default(),{id:(0,s.Ak)(),type:a.u0.doc,versions:A.K.export_versions(),info:[],css:{},attrs:{}}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i;const s=[];for(let r of t.info){const t=A.K.find_cube(r.type);t&&t.replace_id&&s.push(t.replace_id(e,r,n))}return t.info=s,t}}function xt(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class kt extends o._D{_component=Y;get children(){const e=[];for(let t of this._children)e.push(t);return e}get component(){return this._component}get editable(){if(this.stats.is_read_mode)return!1;const e=this.host_postil,t=this.host_node;return!e&&t?t.editable:!(!e||t)||!e||!t||e.level>t.level||t.editable}get meta(){return kt.meta}get is_empty(){return 1===this.child_count&&this.child_first.is_empty}get attrs(){return this.data.attrs}get child_first_text(){for(let e of this._children)if(e instanceof X)return e}get child_last_text(){for(let e of[...this._children].reverse())if(e instanceof X)return e}get next_line(){let e=this.next_cube_deep;for(;e;){if(e instanceof wt)return;let t=g.I.find_line(e,"first");if(t)return t;e=e.next_cube_deep}}get prev_line(){let e=this.prev_cube_deep;for(;e;){if(e instanceof wt)return;let t=g.I.find_line(e,"last");if(t)return t;e=e.prev_cube_deep}}constructor(e,t){return super(e,t),this.setup(e,t)}gc(){super.base_gc()}splice(e,t,...n){const r=this._children.splice(e,t,...n);for(let e of r)e.gc();const i=[];for(let e of r)e instanceof o._D&&i.push(e.export());return{children:r,data:i}}build_child(e){const t=g.I.build_cubes(e.info,this);this._children.push(...t)}export(){const e=this.base_export();e.info=[];for(let t of this.children)e.info.push(t.export());return e}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}replace_id(e,t={}){return kt.replace_id(this.root,e,t)}inherit_line(e){const t=Math.min(...e.map(e=>e.attrs.indent||0));for(let n of e){const e=this.attrs.indent;if(e){const r=n.attrs.indent||0;n.attrs.indent=e+r-t}this.css["text-indent"]&&n.type===this.type&&(n.css["text-indent"]=this.css["text-indent"])}}on_cube_merge(e){const{courier:t,prev_cube:n,next_cube:r,index:i,pid:s,pcube:a}=this,{method:l,cubeid:c,offset:d}=e,u=new _.vk(t);if("left"===l&&n instanceof kt){const e=this.export().info,t=g.I.filter_out_empty(e);u.tell(n,o.VL.insert_child(n.id,t,"tail")),u.tell(a,o.VL.delete_child(this.pid,"forward",[i,i+1]));const r=n.find_child_cube(c);r&&u.tell(r,o.UB.in_head(c,d))}else if("right"===l&&r instanceof kt){const e=r.export().info,t=g.I.filter_out_empty(e);u.tell(this,o.VL.insert_child(this.id,t,"tail")),u.tell(a,o.VL.delete_child(s,"backward",[i+1,i+2]));const n=this.find_child_cube(c);n&&u.tell(n,o.UB.in_head(c,d))}else if("both"===l)if(n instanceof kt&&r instanceof kt){const e=g.I.filter_out_empty(this.export().info),t=g.I.filter_out_empty(r.export().info);u.tell(n,o.VL.insert_child(n.id,e.concat(t),"tail")),u.tell(a,o.VL.delete_child(this.pid,"backward",[this.index,this.index+2]));const i=n.find_child_cube(c);i&&u.tell(i,o.UB.in_head(c,d))}else if(n instanceof kt&&!(r instanceof kt)){const e=g.I.filter_out_empty(this.export().info);u.tell(n,o.VL.insert_child(n.id,e,"tail")),u.tell(a,o.VL.delete_child(this.pid,"forward",[i,i+1]));const t=n.find_child_cube(c);t&&u.tell(t,o.UB.in_head(c,d))}else if(!(n instanceof kt)&&r instanceof kt){const e=g.I.filter_out_empty(r.export().info);u.tell(this,o.VL.insert_child(this.id,e,"tail")),u.tell(a,o.VL.delete_child(s,"backward",[i+1,i+2]));const t=this.find_child_cube(c);t&&u.tell(t,o.UB.in_head(c,d))}return u}on_cube_reset(e){const{courier:t}=this,{data:n}=e,r=t.get_recorder();r.add_cmd(e);const i=g.I.filter_out_empty(n);if(0===i.length){if(this.is_empty)return;const e=this.export().info,t=new X(X.get_default(),this);this.splice(0,this.child_count,t),r.add_recover(o.VL.reset(this.id,e)),r.tell(t,o.UB.in_tail(t.id,0))}else{const e=this.export().info,t=g.I.build_cubes(i,this);this.splice(0,this.child_count,...t),r.add_recover(o.VL.reset(this.id,e))}return r}on_insert_child(e){const{courier:t,pid:n,pcube:r}=this,{pos:i,data:s}=e,a=new _.vk(t);if(0===s.length)return a;let l=this.get_valid_index(i);const c=g.I.pick(s);if(c.head.length>0){a.add_cmd(e);const t=g.I.build_cubes(s,this),n=t[t.length-1];this.splice(l,0,...t),a.add_recover(o.VL.delete_child(this.id,"backward",[l,l+t.length])),n&&a.tell(n,o.UB.in_tail(n.id,0))}const d=[...c.body];if(c.tail.length>0&&d.push(kt.get_default(c.tail)),c.root.length>0)for(let e of c.root)d.push(...e.info);if(d.length>0)if(this.inherit_line(d),this.is_empty)a.tell(r,o.VL.insert_child(n,d,this.index)),a.tell(r,o.VL.delete_child(n,"backward",[this.index,this.index+1]));else{const e=this.get_valid_index(l+c.head.length);if(e<this.child_count){const t=this._children.slice(e);if(t.length>0){const i=t.map(e=>e.export()),s=kt.get_default(i);this.inherit_line([s]),a.tell(this,o.VL.delete_child(this.id,"backward",[e,this.child_count])),a.tell(r,o.VL.insert_child(n,[s],this.index+1))}}a.tell(r,o.VL.insert_child(n,d,this.index+1))}return a}on_delete_child(e){const{dir:t,range:n,reserve:r}=e,{courier:i,pid:s,index:a,pcube:l}=this,c=i.get_recorder();c.add_cmd(e);const[d,u]=n;let h=d<0?0:d,p=u>this.child_count?this.child_count:u;if(!(h>=p)){if(h<=0&&p>=this.child_count)if(r){if(this.is_empty)return;const e=this.child_first;e instanceof X?(c.tell(this,o.VL.delete_child(this.id,t,[1,this.child_count])),c.tell(e,$.reset(e.id,"",1,1))):c.tell(this,o.VL.reset(this.id,[]))}else this.is_empty?c.tell(l,o.VL.delete_child(s,t,[a,a+1])):c.tell(this,o.VL.reset(this.id,[]));else{const e=this.children[h-1],n=this.children[p],r=p-h;if(h>=this.child_count||r<=0)return;let i=this.splice(h,r);c.add_recover(o.VL.insert_child(this.id,i.data,d)),"backward"===t?e?c.tell(e,o.UB.in_tail(e.id,0)):n&&c.tell(n,o.UB.in_head(n.id,0)):"forward"===t&&(n?c.tell(n,o.UB.in_head(n.id,0)):e&&c.tell(e,o.UB.in_tail(e.id,0)))}return c}}on_cube_delete_adjacent(e){const{courier:t,pid:n,prev_cube:r,next_cube:i,pcube:s}=this,{from:a,from_id:l,offset:c}=e,d=new _.vk(t);return"left"===a?this.prev_cube_deep instanceof kt?d.tell(this,o.VL.merge(this.id,"left",l,c)):d.tell(this,o.UB.in_head(this.id,0,void 0)):"right"===a&&(this.next_cube_deep instanceof kt?d.tell(this,o.VL.merge(this.id,"right",l,c)):d.tell(this,o.UB.in_tail(this.id,0,void 0))),d}static filter_out_empty(e){return e.filter(e=>!X.is_empty_text(e))}static get meta(){return{version:1,type:a.u0.line,cubename:"行",block:!0,show:!1}}static get_default(e=[],t={},n={}){const r=0===e.length?[X.get_default()]:e;return{id:(0,s.Ak)(),type:a.u0.line,info:r,css:t,attrs:n}}static get_default_by_string(e="",t={},n={}){const r=[X.get_default(e||"")];return{id:(0,s.Ak)(),type:a.u0.line,info:r,css:t,attrs:n}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i;const s=[];for(let r of t.info){const t=A.K.find_cube(r.type);t&&t.replace_id&&s.push(t.replace_id(e,r,n))}return t.info=s,t}}xt([(0,k.H)(a.zS.cube_merge)],kt.prototype,"on_cube_merge",null),xt([(0,k.H)(a.zS.cube_reset)],kt.prototype,"on_cube_reset",null),xt([(0,k.H)(a.zS.cube_insert_child)],kt.prototype,"on_insert_child",null),xt([(0,k.H)(a.zS.cube_delete_child)],kt.prototype,"on_delete_child",null),xt([(0,k.H)(a.zS.cube_delete_adjacent)],kt.prototype,"on_cube_delete_adjacent",null);const St=["id","data-type"],Ct=(0,c.pM)({__name:"cube-box",props:{cube:{}},setup(e){function t(t){if(t.target===t.currentTarget){t.stopPropagation();const{courier:n,history:r}=e.cube,i=n.get_recorder(),s=o.UB.in_tail(e.cube.id,0,"none");i.tell(e.cube,s),r.record(i)}}return(e,n)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-box",style:(0,d.Tr)(e.cube.css),id:e.cube.id,"data-type":(0,l.R1)(x.u0).box,onPointerup:t},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.children,e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:e},null,8,["cube"]))),128))],44,St))}}),Mt=(0,m.A)(Ct,[["__scopeId","data-v-29b5ba30"]]);function Lt(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class Tt extends o._D{constructor(e,t){return super(e,t),this.setup(e,t)}get children(){const e=[];for(let t of this._children)e.push(t);return e}get component(){return(0,l.IG)(Mt)}get attrs(){return this.data.attrs}get meta(){return Tt.meta}get is_empty(){return 1===this.child_count&&this.child_first.is_empty}splice(e,t,...n){const r=this._children.splice(e,t,...n);for(let e of r)e.gc();const i=[];for(let e of r)e instanceof o._D&&i.push(e.export());return{children:r,data:i}}build_child(e){const t=g.I.build_cubes(e.info,this);this._children.push(...t)}export(){const e=this.base_export();e.info=[];for(let t of this.children){let n=t.export();e.info.push(n)}return e}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}gc(){super.base_gc()}replace_id(e,t={}){return Tt.replace_id(this.root,e,t)}on_merge(e){const{courier:t,prev_cube:n,next_cube:r,index:i,pid:s}=this,{method:a,cubeid:l,offset:c}=e,d=new _.vk(t);if("left"===a&&n instanceof Tt){const e=this.export().info;d.tell(n,o.VL.insert_child(n.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(this.pid,"forward",[i,i+1]));const t=n.find_child_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}else if("right"===a&&r instanceof Tt){const e=r.export().info;d.tell(this,o.VL.insert_child(this.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(s,"backward",[i+1,i+2]));const t=this.find_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}else if("both"===a)if(n instanceof Tt&&r instanceof Tt){const e=this.export().info,t=r.export().info;d.tell(n,o.VL.insert_child(n.id,e.concat(t),"tail")),d.tell(this.pcube,o.VL.delete_child(this.pid,"backward",[this.index,this.index+2]));const i=n.find_cube(l);i&&d.tell(i,o.UB.in_head(l,c))}else if(n instanceof Tt&&!(r instanceof Tt)){const e=this.export().info;d.tell(n,o.VL.insert_child(n.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(this.pid,"forward",[i,i+1]));const t=n.find_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}else if(!(n instanceof Tt)&&r instanceof Tt){const e=r.export().info;d.tell(this,o.VL.insert_child(this.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(s,"backward",[i+1,i+2]));const t=this.find_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}return d}on_box_order(e){const{courier:t,history:n,cursor:r}=this,{cubeid:i,index:s}=e,a=this.find_child_cube(i);if(!a||a.index===s)return;const l=new _.vk(t);let c=0,d=a.index;return"tail"===s?c=this.child_count:"number"==typeof s&&(c=s),this.splice(d,1),this.splice(c,0,a),l.add_recover(o.VL.reorder(this.id,a.id,d)),l}on_insert_child(e){const{courier:t}=this,{pos:n,data:r}=e,i=t.get_recorder();if(i.add_cmd(e),0===r.length)return;if(!this.meta.block)return;let s=this.get_valid_index(n);const a=this.create_child_block(r);this.splice(s,0,...a),i.add_recover(o.VL.delete_child(this.id,"backward",[s,s+a.length]));const l=this.children[s+1];return l?i.tell(l,o.UB.in_head(l.id,0)):i.tell(this.child_last,o.UB.in_tail(this.child_last.id,0)),i}on_delete_child(e){const{courier:t,pid:n,index:r,pcube:i}=this,{dir:s,range:a,reserve:l}=e,c=t.get_recorder();c.add_cmd(e);const[d,u]=a;let h=d<0?0:d,p=u>this.child_count?this.child_count:u;if(!(h>=p)){if(h<=0&&p>=this.child_count)if(l){if(this.is_empty)return;c.tell(this,o.VL.delete_child(this.id,s,[1,this.child_count]));const e=this.child_first;e&&c.tell(e,o.VL.delete_child(e.id,s,[0,e.child_count],l))}else this.is_empty?c.tell(i,o.VL.delete_child(n,s,[r,r+1])):c.tell(this,o.VL.reset(this.id,[]));else{const e=this.children[h-1],t=this.children[p],n=p-h;if(h>=this.child_count||n<=0)return;let r=this.splice(h,n);c.add_recover(o.VL.insert_child(this.id,r.data,d)),"backward"===s?e?c.tell(e,o.UB.in_tail(e.id,0)):t&&c.tell(t,o.UB.in_head(t.id,0)):"forward"===s&&(t?c.tell(t,o.UB.in_head(t.id,0)):e&&c.tell(e,o.UB.in_tail(e.id,0)))}return c}}on_box_reset(e){const t=this.courier,{data:n}=e,r=t.get_recorder();r.add_cmd(e);const i=g.I.filter_out_empty(n);if(0===i.length){if(this.is_empty)return;const e=this.export().info,t=new kt(kt.get_default(),this);this.splice(0,this.child_count,t),r.add_recover(o.VL.reset(this.id,e)),r.tell(t,o.UB.in_tail(t.id,0))}else{const e=this.export().info,t=g.I.build_cubes(i,this);this.splice(0,this.child_count,...t),r.add_recover(o.VL.reset(this.id,e))}return r}on_cube_delete_adjacent(e){const{courier:t,pcube:n,pid:r}=this,{from:i,from_id:s,offset:a}=e,l=new _.vk(t);if("left"===i)if(this.prev_cube_deep instanceof Tt)l.tell(this,o.VL.merge(this.id,"left",s,a));else{const e=this.export().info,t=this.child_first.id;l.tell(n,o.VL.insert_child(r,e,this.index)),l.merge(this.remove_self());const c=n.find_cube(t);c&&l.tell(c,o.VL.delete_adjacent(t,i,s,a))}else if("right"===i)if(this.next_cube_deep instanceof Tt)l.merge(this.on(o.VL.merge(this.id,"right",s,a)));else{const e=this.export().info,t=this.child_first.id;l.tell(n,o.VL.insert_child(r,e,this.index)),l.merge(this.remove_self());const c=n.find_cube(t);c&&l.tell(c,o.VL.delete_adjacent(t,i,s,a))}return l}get_valid_index(e){return"head"===e?0:"tail"===e?this.child_count:e<0?0:e>this.child_count?this.child_count:e}static get meta(){return{type:a.u0.box,cubename:"块",version:1,block:!0,show:!0}}static get_default(e=[],t={},n={}){const r=[];return 0===e.length?r.push(kt.get_default()):r.push(...g.I.pick(e).sort),{id:g.I.get_id(),type:a.u0.box,info:r,css:t,attrs:n}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i;const s=[];for(let r of t.info){const t=A.K.find_cube(r.type);t&&t.replace_id&&s.push(t.replace_id(e,r,n))}return t.info=s,t}}Lt([(0,k.H)(a.zS.cube_merge)],Tt.prototype,"on_merge",null),Lt([(0,k.H)(a.zS.cube_reorder)],Tt.prototype,"on_box_order",null),Lt([(0,k.H)(a.zS.cube_insert_child)],Tt.prototype,"on_insert_child",null),Lt([(0,k.H)(a.zS.cube_delete_child)],Tt.prototype,"on_delete_child",null),Lt([(0,k.H)(a.zS.cube_reset)],Tt.prototype,"on_box_reset",null),Lt([(0,k.H)(a.zS.cube_delete_adjacent)],Tt.prototype,"on_cube_delete_adjacent",null);const zt=["id","data-type"],At=(0,c.pM)({__name:"cube-box-folder",props:{cube:{}},setup(e){const t=e.cube,{stats:n}=e.cube;return(e,n)=>((0,c.uX)(),(0,c.CE)("div",{class:(0,d.C4)(["cube-box-folder",{"cube-box-folder-active":e.cube.attrs.fold}]),id:e.cube.id,style:(0,d.Tr)((0,l.R1)(t).css),"data-type":(0,l.R1)(a.u0).box_folder},[e.cube.attrs.fold?((0,c.uX)(),(0,c.Wv)(S,{key:0,cube:e.cube.child_first},null,8,["cube"])):((0,c.uX)(!0),(0,c.CE)(c.FK,{key:1},(0,c.pI)((0,l.R1)(t).children,e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:(0,l.IG)(e)},null,8,["cube"]))),128)),(0,c.Lk)("div",{class:(0,d.C4)(["folder-tag",{"folder-tag-active":e.cube.attrs.fold}]),onClick:n[0]||(n[0]=t=>function(e,t){const{courier:n,history:r,cubes:i,id:s,pcube:a}=t,l=n.get_recorder();l.tell(t,o.VL.fold(s,!t.attrs.fold)),r.record(l);for(let e of Object.values(i.postils))e.find_upstream_untill(a)===t&&e.visible(!1);const c=t.child_first.id;if(!c)return;const d=document.getElementById(c);d?.scrollIntoView({block:"nearest",behavior:"smooth"})}(0,e.cube))},null,2)],14,zt))}}),Rt=(0,m.A)(At,[["__scopeId","data-v-e4ce51da"]]);function Pt(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class Nt extends o._D{_component=Rt;constructor(e,t){return super(e,t),this.setup(e,t)}get children(){const e=[];for(let t of this._children)e.push(t);return e}get component(){return this._component}get meta(){return Nt.meta}get is_empty(){return 1===this.child_count&&this.child_first instanceof kt&&this.child_first.is_empty}get attrs(){return this.data.attrs}splice(e,t,...n){const r=this._children.splice(e,t,...n);for(let e of r)e.gc();const i=[];for(let e of r)e instanceof o._D&&i.push(e.export());return{children:r,data:i}}build_child(e){const t=g.I.build_cubes(e.info,this);this._children.push(...t)}gc(){super.base_gc()}export(){const e=this.base_export();e.info=[];for(let t of this.children){let n=t.export();e.info.push(n)}return e}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}replace_id(e,t){return Nt.replace_id(this.root,e,t)}on_cube_delete_adjacent(e){const{courier:t}=this,{from:n,offset:r,from_id:i}=e,s=new _.vk(t);return"left"===n?this.prev_cube_deep instanceof Nt?s.tell(this,o.VL.merge(this.id,"left",i,r)):s.tell(this,o.UB.in_head(this.id,0)):"right"===n&&(this.next_cube_deep instanceof Nt?s.merge(this.on(o.VL.merge(this.id,"right",i,r))):s.tell(this,o.UB.in_tail(this.id,0))),s}on_merge(e){const{courier:t,prev_cube:n,next_cube:r,index:i,pid:s}=this,{method:a,cubeid:l,offset:c}=e,d=new _.vk(t);if("left"===a&&n instanceof Nt){const e=this.export().info;d.tell(n,o.VL.insert_child(n.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(this.pid,"forward",[i,i+1]));const t=n.find_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}else if("right"===a&&r instanceof Nt){const e=r.export().info;d.tell(this,o.VL.insert_child(this.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(s,"backward",[i+1,i+2]));const t=this.find_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}else if("both"===a)if(n instanceof Nt&&r instanceof Nt){const e=this.export().info,t=r.export().info;d.tell(n,o.VL.insert_child(n.id,e.concat(t),"tail")),d.tell(this.pcube,o.VL.delete_child(this.pid,"backward",[this.index,this.index+2]));const i=n.find_cube(l);i&&d.tell(i,o.UB.in_head(l,c))}else if(n instanceof Nt&&!(r instanceof Nt)){const e=this.export().info;d.tell(n,o.VL.insert_child(n.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(this.pid,"forward",[i,i+1]));const t=n.find_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}else if(!(n instanceof Nt)&&r instanceof Nt){const e=r.export().info;d.tell(this,o.VL.insert_child(this.id,e,"tail")),d.tell(this.pcube,o.VL.delete_child(s,"backward",[i+1,i+2]));const t=this.find_cube(l);t&&d.tell(t,o.UB.in_head(l,c))}return d}on_cube_reorder(e){const{courier:t,history:n,cursor:r}=this,{cubeid:i,index:s}=e,a=this.find_child_cube(i);if(!a||a.index===s)return;const l=new _.vk(t);let c=0,d=a.index;return"tail"===s?c=this.child_count:"number"==typeof s&&(c=s),this.splice(d,1),this.splice(c,0,a),l.add_recover(o.VL.reorder(this.id,a.id,d)),l}on_cube_reset(e){const t=this.courier,{data:n}=e,r=t.get_recorder();r.add_cmd(e);const i=g.I.filter_out_empty(n);if(0===i.length){const e=this.children[0];if(1===this.child_count&&e instanceof X&&e.is_empty)return;const t=this.export().info,n=new kt(kt.get_default(),this);this.splice(0,this.child_count,n),r.add_recover(o.VL.reset(this.id,t)),r.tell(n,o.UB.in_tail(n.id,0))}else{const e=this.export().info,t=g.I.build_cubes(i,this);this.splice(0,this.child_count,...t),r.add_recover(o.VL.reset(this.id,e))}return r}on_insert_child(e){const{courier:t}=this,{pos:n,data:r}=e,i=t.get_recorder();if(i.add_cmd(e),0===r.length)return;if(!this.meta.block)return;let s=this.get_valid_index(n);const a=this.create_child_block(r);this.splice(s,0,...a),i.add_recover(o.VL.delete_child(this.id,"backward",[s,s+a.length]));const l=a[a.length-1],c=this.children[s+1];return l?i.tell(l,o.UB.in_tail(l.id,0)):i.tell(c,o.UB.in_head(c.id,0)),i}on_delete_child(e){const{courier:t,pid:n,index:r,pcube:i}=this,{dir:s,range:a,reserve:l}=e,c=t.get_recorder();c.add_cmd(e);const[d,u]=a;let h=d<0?0:d,p=u>this.child_count?this.child_count:u;if(h>=p)return;if(h<=0&&p>=this.child_count){if(l){if(this.is_empty)return;c.tell(this,o.VL.delete_child(this.id,s,[1,this.child_count]));const e=this.child_first;e&&c.tell(e,o.VL.delete_child(e.id,s,[0,e.child_count],l))}else this.is_empty?c.tell(i,o.VL.delete_child(n,s,[r,r+1])):c.tell(this,o.VL.reset(this.id,[]));return c}const m=this.children[h-1],f=this.children[p],_=p-h;let g=this.splice(d,_);return c.add_recover(o.VL.insert_child(this.id,g.data,d)),"backward"===s?m?c.tell(m,o.UB.in_tail(m.id,0)):f&&c.tell(f,o.UB.in_head(f.id,0)):"forward"===s&&(f?c.tell(f,o.UB.in_head(f.id,0)):m&&c.tell(m,o.UB.in_tail(m.id,0))),c}get_valid_index(e){return"head"===e?0:"tail"===e?this.child_count:e<0?0:e>this.child_count?this.child_count:e}static filter_out_empty(e){return e.filter(e=>!X.is_empty_text(e))}static get meta(){return{type:a.u0.box_folder,cubename:"折叠块",version:1,block:!0,show:!0}}static get_default(e=[],t={},n={fold:!1}){const r=0===e.length?[kt.get_default()]:e;return{id:g.I.get_id(),type:a.u0.box_folder,info:r,css:t,attrs:n}}static replace_id(e,t,n){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i;const s=[];for(let r of t.info){const t=A.K.find_cube(r.type);t&&t.replace_id&&s.push(t.replace_id(e,r,n))}return t.info=s,t}}Pt([(0,k.H)(a.zS.cube_delete_adjacent)],Nt.prototype,"on_cube_delete_adjacent",null),Pt([(0,k.H)(a.zS.cube_merge)],Nt.prototype,"on_merge",null),Pt([(0,k.H)(a.zS.cube_reorder)],Nt.prototype,"on_cube_reorder",null),Pt([(0,k.H)(a.zS.cube_reset)],Nt.prototype,"on_cube_reset",null),Pt([(0,k.H)(a.zS.cube_insert_child)],Nt.prototype,"on_insert_child",null),Pt([(0,k.H)(a.zS.cube_delete_child)],Nt.prototype,"on_delete_child",null);class Et{}const Ot=["d","id","data-type","stroke-width","stroke","marker-start","marker-end"],It=(0,c.pM)({__name:"cube-linker",props:{cube:{}},setup:e=>(t,n)=>((0,c.uX)(),(0,c.CE)("path",{d:t.cube.path,id:t.cube.id,class:(0,d.C4)({"line-delete-selected":e.cube.pcube.in_delete_line(e.cube)}),style:(0,d.Tr)(t.cube.css),"data-type":(0,l.R1)(a.u0).linker,"stroke-width":t.cube.attrs.stroke_width,stroke:t.cube.attrs.stroke,"marker-start":`url(#${t.cube.anchor_left})`,"marker-end":`url(#${t.cube.anchor_right})`},null,14,Ot))}),Bt=(0,m.A)(It,[["__scopeId","data-v-76929958"]]),Dt=["cx","cy"],Vt=(0,c.pM)({__name:"op-node-drag",props:{interaction:{}},setup(e){const{info_node_drag:t}=e.interaction;return(e,n)=>((0,c.uX)(),(0,c.CE)(c.FK,null,[(0,l.R1)(t).show?((0,c.uX)(),(0,c.CE)("circle",{key:0,cx:(0,l.R1)(t).x,cy:(0,l.R1)(t).y,r:"20",stroke:"black","stroke-width":"2","stroke-dasharray":"4 4",fill:"none"},null,8,Dt)):(0,c.Q3)("v-if",!0),(0,c.Q3)(' <g data-flag="drag-nodes" :transform="get_matrix()" style="pointer-events: none; user-select: none; opacity: 0.8" v-if="info_node_drag.show">\r\n <path d="M -54.5 -18 L 54.5 -18 Q 56.5 -18 56.5 -16 L 56.5 16 Q 56.5 18 54.5 18 L -54.5 18 Q -56.5 18 -56.5 16 L -56.5 -16 Q -56.5 -18 -54.5 -18 z" style="fill: rgba(255, 255, 255, 0.05); stroke: rgba(102, 115, 129, 0.5); stroke-width: 2"></path>\r\n <path d="M -54.5 -18 L -54.5 -20 Q -54.5 -22 -52.5 -22 L 58.5 -22 Q 60.5 -22 60.5 -20 L 60.5 14 Q 60.5 16 58.5 16 L 56.5 16" style="fill: none; stroke: rgba(102, 115, 129, 0.5); stroke-width: 2"></path>\r\n <text x="0" y="7" text-anchor="middle" font-size="14" style="fill: rgb(113 117 122)">已选择{{info_node_drag.count}}个节点</text>\r\n </g> ')],2112))}}),Ht={class:"map-status"},jt={class:"map-scale"},Ft={class:"map-nodes"},Ut=(0,c.pM)({__name:"map-status",props:{cube:{}},setup(e){const t=e.cube,n=(0,c.EW)(()=>e.cube.cubes.get_types_cube(a.u0.node));function r(e){const n=t.dom_rect,r={x:n.x+n.width/2,y:n.y+n.height/2};t.scale_by_point(r,e,e)}return(t,i)=>((0,c.uX)(),(0,c.CE)("div",Ht,[(0,c.Lk)("div",jt,[(0,c.Lk)("span",{class:"iconfont icon-icon_window_small_new-copy-copy",onClick:i[0]||(i[0]=e=>r(-.1))}),(0,c.Lk)("span",null,(0,d.v_)((100*e.cube.matrix2d.a).toFixed(0)+"%"),1),(0,c.Lk)("span",{class:"iconfont icon-add",onClick:i[1]||(i[1]=e=>r(.1))})]),(0,c.Lk)("div",Ft,[(0,c.Lk)("span",null,"节点 : "+(0,d.v_)(n.value.size),1)])]))}}),qt=(0,m.A)(Ut,[["__scopeId","data-v-0d43440f"]]),$t=new g.J,Gt=["id","data-type"],Xt=["transform"],Kt=["data-group"],Wt=["data-group"],Yt=["data-group"],Zt=["data-group"],Qt=["d"],Jt=["d","stroke-width","stroke","marker-start","marker-end"],en=["d"],tn={class:"doc-postils"},nn=(0,c.pM)({__name:"cube-map",props:{cube:{}},setup(e){const t=e.cube,{placeholder:n,config:r}=e.cube,i=r.data,s=new Be(t),o=(0,l.KR)(),u=new ResizeObserver(e=>{$t.resolve()});(0,c.sV)(()=>{const t=o.value;t&&u.observe(t),window.addEventListener("resize",t=>{e.cube.check_show_throttle()})});const h=e=>s.pointerdown(e),p=e=>s.pointermove(e),m=e=>s.pointerup(e),f=e=>s.pointercancel(e),_=e=>s.compositionstart(e),g=e=>s.compositionupdate(e),b=e=>s.compositionend(e),y=e=>s.beforeinput(e);return(0,c.sV)(()=>{document.documentElement.addEventListener("pointerup",m),document.documentElement.addEventListener("pointermove",p),document.documentElement.addEventListener("pointercancel",f)}),(e,s)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-map",id:e.cube.id,"data-type":(0,l.R1)(a.u0).map},[(0,c.Lk)("div",{class:"note",onPointerdown:h,onCompositionstart:_,onCompositionupdate:g,onCompositionend:b,onBeforeinput:y},[((0,c.uX)(),(0,c.CE)("svg",{ref_key:"svg",ref:o,style:(0,d.Tr)((0,l.R1)(r).css_vars)},[(0,c.Lk)("g",{transform:(0,l.R1)(t).matrix2d_dom_string},[(0,c.Lk)("g",{"data-group":(0,l.R1)(a.L6).markers,class:"group-defs"},[...s[0]||(s[0]=[(0,c.Fv)('<defs data-v-370c2bc9>\x3c!-- 箭头 --\x3e<marker id="marker-arrow" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="auto" fill="context-stroke" data-v-370c2bc9><path d="M 0 0 L 6 3 L 0 6 z" data-v-370c2bc9></path></marker>\x3c!-- 圆 --\x3e<marker id="marker-point" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="auto" fill="context-stroke" data-v-370c2bc9><circle cx="3" cy="3" r="3" data-v-370c2bc9></circle></marker>\x3c!-- 方块 --\x3e<marker id="marker-square" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="auto" fill="context-stroke" data-v-370c2bc9><rect x="0" y="0" width="6" height="6" rx="1" ry="1" data-v-370c2bc9></rect></marker>\x3c!-- 菱形 --\x3e<marker id="marker-rhomb" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="45" fill="context-stroke" data-v-370c2bc9><rect x="0" y="0" width="6" height="6" rx="1" ry="1" data-v-370c2bc9></rect></marker></defs>',1)])],8,Kt),(0,c.Lk)("g",{"data-group":(0,l.R1)(a.L6).linkers,class:"group-linkers"},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)((0,l.R1)(t).get_linkers_view(),e=>((0,c.uX)(),(0,c.Wv)(Bt,{key:e.id,cube:e},null,8,["cube"]))),128))],8,Wt),(0,c.Lk)("g",{"data-group":(0,l.R1)(a.L6).nodes,class:"group-nodes"},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.get_nodes_view(),e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:e},null,8,["cube"]))),128))],8,Yt),(0,c.Lk)("g",{"data-group":(0,l.R1)(a.L6).placeholder,class:"group-placeholder"},[(0,l.R1)(n).box_selector?((0,c.uX)(),(0,c.CE)("path",{key:0,class:"placeholder-box-selector",d:(0,l.R1)(n).box_selector},null,8,Qt)):(0,c.Q3)("v-if",!0),((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)((0,l.R1)(n).linker,e=>((0,c.uX)(),(0,c.CE)(c.FK,null,[e?((0,c.uX)(),(0,c.CE)("path",{key:0,class:"placeholder-linker",d:e,"stroke-width":(0,l.R1)(i).map_linker_stroke_width,stroke:(0,l.R1)(i).map_linker_stroke,"marker-start":`url(#${(0,l.R1)(i).map_linker_anchor_left})`,"marker-end":`url(#${(0,l.R1)(i).map_linker_anchor_right})`},null,8,Jt)):(0,c.Q3)("v-if",!0)],64))),256)),(0,l.R1)(n).line_delete?((0,c.uX)(),(0,c.CE)("path",{key:1,class:"placeholder-line-delete",d:(0,l.R1)(n).line_delete,stroke:"#ff7f7f","marker-start":"url(#marker-point)","marker-end":"url(#marker-arrow)"},null,8,en)):(0,c.Q3)("v-if",!0),(0,c.Q3)(' <rect :x="placeholder.node.x" :y="placeholder.node.y" rx="4" ry="4" :width="placeholder.node.width" :height="placeholder.node.height" stroke="none" fill="#00aaff" v-if="placeholder.node"></rect> '),(0,c.bF)(Vt,{interaction:e.cube.interaction},null,8,["interaction"])],8,Zt),(0,c.Q3)(" --------------------------------------------------------以下是测试信息----------------------------------------------------------- "),(0,c.Q3)(" ------------------节点信息---------------------- "),(0,c.Q3)(' <template v-for="node of cube.nodes_test" v-if="cube.isdev"> '),(0,c.Q3)(" 采样点 "),(0,c.Q3)(' <circle :cx="item.x" :cy="item.y" r="4" v-for="item of node.sample"></circle> '),(0,c.Q3)(" 中心点 "),(0,c.Q3)(' <circle :cx="node.bound.pos_center.x" :cy="node.bound.pos_center.y" r="4" fill="red"></circle> '),(0,c.Q3)(" 左上角 "),(0,c.Q3)(' <circle :cx="node.bound.pos.x" :cy="node.bound.pos.y" r="4" fill="blue"></circle> '),(0,c.Q3)(" 边界框 "),(0,c.Q3)(' <rect :x="node.bound.pos.x" :y="node.bound.pos.y" :width="node.bound.size_bound.width" :height="node.bound.size_bound.height" stroke="red" fill="none"></rect> '),(0,c.Q3)(" 树边界框 "),(0,c.Q3)(' <rect :x="node.bound.pos_tree.x" :y="node.bound.pos_tree.y" :width="node.bound.size_tree.width" :height="node.bound.size_tree.height" stroke="red" fill="none"></rect> '),(0,c.Q3)(" </template> "),(0,c.Q3)(" ------------------连线信息---------------------- "),(0,c.Q3)(' <template v-if="cube.root.isdev" v-for="linker of Object.values(cube.linkers)"> '),(0,c.Q3)(" 采样点 "),(0,c.Q3)(' <circle :cx="item.x" :cy="item.y" r="4" v-for="item of linker.sample"></circle> '),(0,c.Q3)(" 中心点 "),(0,c.Q3)(' <circle :cx="node.bound.pos_center.x" :cy="node.bound.pos_center.y" r="4" fill="red"></circle> '),(0,c.Q3)(" 左上角 "),(0,c.Q3)(' <circle :cx="node.bound.pos.x" :cy="node.bound.pos.y" r="4" fill="blue"></circle> '),(0,c.Q3)(" 边界框 "),(0,c.Q3)(' <rect :x="node.bound.pos.x" :y="node.bound.pos.y" :width="node.bound.size_bound.width" :height="node.bound.size_bound.height" stroke="red" fill="none"></rect> '),(0,c.Q3)(" 树边界框 "),(0,c.Q3)(' <rect :x="node.bound.pos_tree.x" :y="node.bound.pos_tree.y" :width="node.bound.size_tree.width" :height="node.bound.size_tree.height" stroke="red" fill="none"></rect> '),(0,c.Q3)(" </template> "),(0,c.Q3)(" ------------------意图区域---------------------- "),(0,c.Q3)(' <rect :x="PP.prev.x" :y="PP.prev.y" :width="PP.prev.width" :height="PP.prev.height" stroke="red" fill="none"></rect>\r\n <rect :x="PP.next.x" :y="PP.next.y" :width="PP.next.width" :height="PP.next.height" stroke="blue" fill="none"></rect>\r\n <rect :x="PP.child.x" :y="PP.child.y" :width="PP.child.width" :height="PP.child.height" stroke="green" fill="none" v-if="PP.child"></rect> ')],8,Xt)],4)),(0,c.Q3)(" doc-cubes "),(0,c.Lk)("div",tn,[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)((0,l.R1)(t).cubes.postils,([e,t])=>((0,c.uX)(),(0,c.Wv)(S,{key:t.id,cube:t},null,8,["cube"]))),128))])],32),(0,c.Q3)(" scope selection "),((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)((0,l.R1)(t).scope,e=>((0,c.uX)(),(0,c.Wv)(Ne,{key:e.id,selection:(0,l.IG)(e)},null,8,["selection"]))),128)),(0,c.Q3)(" map status "),(0,c.bF)(qt,{cube:e.cube},null,8,["cube"]),(0,c.Q3)(" menus "),(0,c.bF)(tt,{root:e.cube},null,8,["root"])],8,Gt))}}),rn=(0,m.A)(nn,[["__scopeId","data-v-370c2bc9"]]);var sn=n(7552);class on{static draw(e){const{type:t,from:n,to:r}=e;return"line"===t?this.line(n,r):"bezier2"===t?this.bezier2(n,r):"polyline"===t?this.polyline(n,r):"polyline2"===t?this.polyline2(n,r):"polyline3"===t?this.polyline3(n,r):"wave"===t?this.wave(n,r):this.bezier2(n,r)}static get_line(e,t,n){return"line"===n?this.line(e,t):"bezier2"===n?this.bezier2(e,t):"polyline"===n?this.polyline(e,t):"polyline2"===n?this.polyline2(e,t):"polyline3"===n?this.polyline3(e,t):"wave"===n?this.wave(e,t):this.bezier2(e,t)}static line(e,t){return`M${e.x.toFixed(1)} ${e.y.toFixed(1)}L${t.x.toFixed(1)} ${t.y.toFixed(1)}`}static bezier2(e,t){const n=(e.x+t.x)/2,r=n,i=e.y,s=n,o=t.y;return`M${e.x.toFixed(1)} ${e.y.toFixed(1)} C${r} ${i} ${s} ${o} ${t.x.toFixed(1)} ${t.y.toFixed(1)}`}static polyline(e,t,n=4){const r=(e.x+t.x)/2,i=e,s=t,o=r,a=i.y,l=r,c=s.y,d=Math.sign(e.x-t.x),u=Math.sign(t.y-e.y),h=Math.sign(e.y-t.y),p=Math.sign(t.x-e.x);return`M${i.x} ${i.y} H ${o+d*n} Q ${o} ${a} ${o} ${a+u*n} V ${c+h*n} Q${l} ${c} ${l+p*n} ${c} H ${s.x}`}static polyline2(e,t,n=4){const r=e,i=t,s=(e.x+t.x)/2,o=r.y;return`M${r.x} ${r.y} L${s} ${o} L ${i.x} ${i.y}`}static polyline3(e,t,n=4){const r=(e.x+t.x)/2,i=e,s=t,o=(i.y,r),a=s.y;return`M${i.x} ${i.y} L${o} ${a} L ${s.x} ${s.y}`}static wave(e,t,n=2,r=8){const i=t.x-e.x,s=t.y-e.y,o=Math.sqrt(i*i+s*s),a=Math.atan2(s,i),l=r??o/10;let c=`M ${e.x} ${e.y}`;const d=20*n;for(let t=0;t<=d;t++){const r=t/d,o=e.x+i*r,u=e.y+s*r,h=l*Math.sin(r*n*Math.PI*2),p=o+-Math.sin(a)*h,m=u+Math.cos(a)*h;if(0===t)c+=` M ${p} ${m}`;else{const r=(t-1)/d,o=l*Math.sin(r*n*Math.PI*2),u=-Math.sin(a)*o,h=Math.cos(a)*o,f=e.x+i*r+u,_=e.y+s*r+h;c+=` C ${f+(p-f)/3} ${_+(m-_)/3}, ${p-(p-f)/3} ${m-(m-_)/3}, ${p} ${m}`}}return c}}class an{static map={right:this.right.bind(this),left:this.left.bind(this),down:this.down.bind(this),up:this.up.bind(this),"time-right":this.time_right.bind(this),"time-down":this.time_down.bind(this)};static find(e,t){const n=e.layout_type;if(!n)return this.free_to_any(e,t);if(t.is_layout_root)return this.free_to_any(e,t);const r=this.map[n];return r?r(e,t):this.free_to_any(e,t)}static get_point(e){const t=e.layout_type;if(!t)return;const n=e.bound.rect;return"right"===t?N.MathRect.get_rect_point(n,N._RectPosition.right_mid):"left"===t?N.MathRect.get_rect_point(n,N._RectPosition.left_mid):"down"===t?N.MathRect.get_rect_point(n,N._RectPosition.bottom_mid):"up"===t?N.MathRect.get_rect_point(n,N._RectPosition.top_mid):"time-down"===t?N.MathRect.get_rect_point(n,N._RectPosition.bottom_mid):"time-right"===t?N.MathRect.get_rect_point(n,N._RectPosition.right_mid):void 0}static time_down(e,t){const n=t.prev_node||e,r={...n.bound.pos,...n.bound.size_bound},i={...t.bound.pos,...t.bound.size_bound};return{from:N.MathRect.get_rect_point(r,N._RectPosition.bottom_mid),to:N.MathRect.get_rect_point(i,N._RectPosition.top_mid)}}static time_right(e,t){const n=t.prev_node||e,r={...n.bound.pos,...n.bound.size_bound},i={...t.bound.pos,...t.bound.size_bound};return{from:N.MathRect.get_rect_point(r,N._RectPosition.right_mid),to:N.MathRect.get_rect_point(i,N._RectPosition.left_mid)}}static up(e,t){const n={...e.bound.pos,...e.bound.size_bound},r={...t.bound.pos,...t.bound.size_bound};return{from:N.MathRect.get_rect_point(n,N._RectPosition.top_mid),to:N.MathRect.get_rect_point(r,N._RectPosition.bottom_mid)}}static right(e,t){const n={...e.bound.pos,...e.bound.size_bound},r={...t.bound.pos,...t.bound.size_bound};return{from:N.MathRect.get_rect_point(n,N._RectPosition.right_mid),to:N.MathRect.get_rect_point(r,N._RectPosition.left_mid)}}static left(e,t){const n={...e.bound.pos,...e.bound.size_bound},r={...t.bound.pos,...t.bound.size_bound};return{from:N.MathRect.get_rect_point(n,N._RectPosition.left_mid),to:N.MathRect.get_rect_point(r,N._RectPosition.right_mid)}}static down(e,t){const n={...e.bound.pos,...e.bound.size_bound},r={...t.bound.pos,...t.bound.size_bound};return{from:N.MathRect.get_rect_point(n,N._RectPosition.bottom_mid),to:N.MathRect.get_rect_point(r,N._RectPosition.top_mid)}}static free_to_any(e,t){const n=e.sample,r=t.sample;if(0!==n.length&&0!==r.length)return sn.U.find_closest_points(n,r)}}class ln{static update(e,t){return{id:e,name:a.Sd.update,attrs:t}}}var cn=n(9788),dn=n(2698),un=n(7084);const hn={class:"map-status"},pn=(0,c.pM)({__name:"submap-status",props:{cube:{}},setup(e){function t(t){const n=e.cube.dom_rect,r={x:n.x+n.width/2,y:n.y+n.height/2};e.cube.scale_by_point(r,t,t)}return(n,r)=>((0,c.uX)(),(0,c.CE)("div",hn,[(0,c.Lk)("span",{class:"iconfont icon-icon_window_small_new-copy-copy",onClick:r[0]||(r[0]=e=>t(-.1))}),(0,c.Lk)("span",null,(0,d.v_)((100*e.cube.matrix2d.a).toFixed(0)+"%"),1),(0,c.Lk)("span",{class:"iconfont icon-add",onClick:r[1]||(r[1]=e=>t(.1))})]))}}),mn=(0,m.A)(pn,[["__scopeId","data-v-cb09d654"]]),fn=["id","data-type"],_n=["transform"],gn=["data-group"],bn=["data-group"],yn=["data-group"],vn=["data-group"],wn=["d"],xn=["d","stroke-width","stroke","marker-start","marker-end"],kn=["d"],Sn=(0,c.pM)({__name:"cube-submap",props:{cube:{}},setup(e){const{placeholder:t}=e.cube,n=e.cube.config.data,r=(0,l.KR)(),i=(0,l.KR)(),s=new ResizeObserver(e=>{}),u=(0,l.KR)();let h;function p(){e.cube.dom_svg_rect}return(0,c.sV)(()=>{const t=i.value;t&&s.observe(t);const n=r.value;n&&e.cube.interaction.register(n);const a=u.value;if(!a)return;h=new N.DragDiff(a);let l=e.cube.attrs.width,c=e.cube.attrs.height,d=l,p=c;h.register_down(()=>{l=e.cube.attrs.width,c=e.cube.attrs.height}),h.register_move((e,t)=>{d=Math.round(e+l),p=Math.round(t+c),n.style.width=d+"px",n.style.height=p+"px"}),h.register_up((t,n)=>{if(l===d&&c===p)return;const r=e.cube.courier.get_recorder(),i=Math.round(t+l),s=Math.round(n+c);r.tell(e.cube,o.VL.resize(e.cube.id,i,s)),e.cube.history.record(r),e.cube.check_show()}),h.register_cancel(()=>{e.cube.attrs.width=l,e.cube.attrs.height=c})}),(0,c.hi)(()=>{h?.off()}),(e,s)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-submap",id:e.cube.id,style:(0,d.Tr)(e.cube.css),"data-type":(0,l.R1)(a.u0).submap,ref_key:"box",ref:r,onClick:p},[((0,c.uX)(),(0,c.CE)("svg",{ref_key:"svg",ref:i},[(0,c.Lk)("g",{transform:e.cube.matrix2d_dom_string},[(0,c.Lk)("g",{"data-group":(0,l.R1)(a.L6).markers,class:"group-defs"},[...s[0]||(s[0]=[(0,c.Fv)('<defs data-v-128c2391>\x3c!-- 箭头 --\x3e<marker id="marker-arrow" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="auto" fill="context-stroke" data-v-128c2391><path d="M 0 0 L 6 3 L 0 6 z" data-v-128c2391></path></marker>\x3c!-- 圆 --\x3e<marker id="marker-point" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="auto" fill="context-stroke" data-v-128c2391><circle cx="3" cy="3" r="3" data-v-128c2391></circle></marker>\x3c!-- 方块 --\x3e<marker id="marker-square" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="auto" fill="context-stroke" data-v-128c2391><rect x="0" y="0" width="6" height="6" rx="1" ry="1" data-v-128c2391></rect></marker>\x3c!-- 菱形 --\x3e<marker id="marker-rhomb" refX="3" refY="3" markerWidth="6" markerHeight="6" orient="45" fill="context-stroke" data-v-128c2391><rect x="0" y="0" width="6" height="6" rx="1" ry="1" data-v-128c2391></rect></marker></defs>',1)])],8,gn),(0,c.Lk)("g",{"data-group":(0,l.R1)(a.L6).linkers,class:"group-linkers"},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.get_linkers_view(),e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:e},null,8,["cube"]))),128))],8,bn),(0,c.Lk)("g",{"data-group":(0,l.R1)(a.L6).nodes,class:"group-nodes"},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.get_nodes_view(),e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:e},null,8,["cube"]))),128))],8,yn),(0,c.Lk)("g",{"data-group":(0,l.R1)(a.L6).placeholder,class:"group-placeholder"},[(0,l.R1)(t).box_selector?((0,c.uX)(),(0,c.CE)("path",{key:0,class:"placeholder-box-selector",d:(0,l.R1)(t).box_selector},null,8,wn)):(0,c.Q3)("v-if",!0),((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)((0,l.R1)(t).linker,e=>((0,c.uX)(),(0,c.CE)(c.FK,null,[e?((0,c.uX)(),(0,c.CE)("path",{key:0,class:"placeholder-linker",d:e,"stroke-width":(0,l.R1)(n).map_linker_stroke_width,stroke:(0,l.R1)(n).map_linker_stroke,"marker-start":`url(#${(0,l.R1)(n).map_linker_anchor_left})`,"marker-end":`url(#${(0,l.R1)(n).map_linker_anchor_right})`},null,8,xn)):(0,c.Q3)("v-if",!0)],64))),256)),(0,l.R1)(t).line_delete?((0,c.uX)(),(0,c.CE)("path",{key:1,class:"placeholder-line-delete",d:(0,l.R1)(t).line_delete,stroke:"#ff7f7f","marker-start":"url(#marker-point)","marker-end":"url(#marker-arrow)"},null,8,kn)):(0,c.Q3)("v-if",!0),(0,c.Q3)(' <rect :x="placeholder.node.x" :y="placeholder.node.y" rx="4" ry="4" :width="placeholder.node.width" :height="placeholder.node.height" stroke="none" fill="#00aaff" v-if="placeholder.node"></rect> '),(0,c.bF)(Vt,{interaction:e.cube.interaction},null,8,["interaction"])],8,vn)],8,_n)],512)),(0,c.bF)(mn,{cube:e.cube},null,8,["cube"]),(0,c.Lk)("div",{class:"submap-dragger",ref_key:"dragger",ref:u},null,512)],12,fn))}}),Cn=(0,m.A)(Sn,[["__scopeId","data-v-128c2391"]]);function Mn(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class Ln extends o._D{_interaction;_has_layout=!1;_display_success=!1;data;nodes_test=(0,l.Gc)({});matrix2d=(0,l.Kh)(sn.c.get_default());nodes=(0,l.Gc)({});node_from=(0,l.Kh)({});node_to=(0,l.Kh)({});node_editing=(0,l.Gc)(new Set);linkers=(0,l.Gc)({});nodes_selected=(0,l.Gc)(new Set);line_delete_selected=(0,l.Gc)(new Set);view_nodes=(0,l.Gc)(new Set);view_linkers=(0,l.Gc)(new Set);placeholder=(0,l.Kh)({linker:[],box_selector:"",line_delete:"",node:{x:0,y:0,width:0,height:0}});constructor(e,t){return super(e,t),this._interaction=new un.T(this),this.setup(e,t)}get perf(){return!1}get css(){return{...super.css,width:this.attrs.width+"px",height:this.attrs.height+"px"}}get attrs(){return this.data.attrs}get has_layout(){return this._has_layout}get dom_rect(){const e=this.dom;return e?e.getBoundingClientRect():new DOMRect(0,0,0,0)}get dom_svg_rect(){const e=this.dom?.getElementsByTagName("svg");return e?e[0].getBoundingClientRect():new DOMRect(0,0,0,0)}get matrix2d_dom_string(){return sn.c.get_dom_string(this.matrix2d)}get interaction(){return this._interaction}get domain(){return"doc"}get meta(){return Ln.meta}get component(){return Cn}get_linker(e){return this.linkers[e]}get_node(e){return this.nodes[e]}get_node_from(e){return this.node_from[e]}get_node_to(e){return this.node_to[e]}get_view_rect(){const{clientHeight:e,clientWidth:t}=document.documentElement,n=this.dom_svg_rect,r=Math.max(n.left,0),i=Math.min(n.right,t),s={x:r,y:Math.max(0,n.top)},o={x:i,y:Math.min(n.bottom,e)},a=this.view_point_to_real(s),l=this.view_point_to_real(o),c=l.x-a.x,d=l.y-a.y;return{x:a.x,y:a.y,width:c,height:d}}get_view_center(){const e=this.get_view_rect();return{x:e.x+e.width/2,y:e.y+e.height/2}}get_view_cube(){const e=this.get_view_rect(),t=[];for(let n of Object.values(this.nodes))N.MathRect.check_intersection(e,n.bound.rect)&&t.push(n);for(let n of Object.values(this.linkers))N.MathRect.check_intersection(e,n.rect)&&t.push(n);return t}find_layout_root(e){const t=new Set;for(let n of e){const e=n.layout_root;e&&t.add(e)}return t}wait_nodes_render(e){const t=[];for(let n of e)t.push(n.wait_layout_self());return Promise.all(t)}find_cube(e){const t=this.linkers[e];if(t)return t;for(let t of Object.values(this.nodes)){const n=t.find_cube(e);if(n)return n}}filter(e){const t=[];for(let n of Object.values(this.linkers))e(n)&&t.push(n),t.push(...n.filter(e));for(let n of Object.values(this.nodes))e(n)&&t.push(n),t.push(...n.filter(e));return t}each(e){for(let t of Object.values(this.linkers))e(t),t.each(e);for(let t of Object.values(this.nodes))e(t),t.each(e)}find_child_cube(e){return this.nodes[e]||this.linkers[e]}register_node_editing(e){this.node_editing.add(e)}remove_node_editing(e){this.node_editing.delete(e)}toggle_node_editing(e){this.node_editing.has(e)?this.node_editing.delete(e):this.node_editing.add(e)}check_node_editing(){for(let e of this.node_editing)e.editable||this.remove_node_editing(e)}clear_node_editing(){for(let e of this.node_editing)e.editable=!1;this.node_editing.clear()}register_node_selected(e){this.nodes_selected.add(e)}unregister_node_selected(e){this.nodes_selected.delete(e)}toggle_node_selected(e){this.nodes_selected.has(e)?this.nodes_selected.delete(e):this.nodes_selected.add(e)}is_node_selected(e){return this.nodes_selected.has(e)}in_delete_line(e){return this.line_delete_selected.has(e)}put_delete_selected(e){this.line_delete_selected.add(e)}get_delete_selected(){return new Set(this.line_delete_selected)}clear_delete_line(){this.line_delete_selected.clear()}clear_node_selected(){this.nodes_selected.clear()}pick(...e){for(let t of e)t instanceof o.wP?(this.nodes[t.id]=t,this.view_nodes.add(t)):t instanceof Tn&&(this.linkers[t.id]=t,this.view_linkers.add(t))}show_all(){for(let e of Object.values(this.nodes))this.view_nodes.add(e);for(let e of Object.values(this.linkers))this.view_linkers.add(e)}get_nodes_selected(){return new Set(this.nodes_selected)}get_nodes_view(){return new Set(this.view_nodes)}get_linkers_view(){return new Set(this.view_linkers)}get_nodes_all(){return[...Object.values(this.nodes)]}get_linkers_all(){return[...Object.values(this.linkers)]}get_nodes_intersection(e){let t=[];for(let n of Object.values(this.nodes)){const r=n.bound.rect;N.MathRect.check_intersection(e,r)&&t.push(n)}return t}set_graph_visible(e,t){t?e instanceof o.wP?this.view_nodes.add(e):e instanceof Tn&&this.view_linkers.add(e):e instanceof o.wP?this.view_nodes.delete(e):e instanceof Tn&&this.view_linkers.delete(e)}toggle_graph_visible(e){e instanceof o.wP?this.view_nodes.has(e)?this.view_nodes.delete(e):this.view_nodes.add(e):e instanceof Tn&&(this.view_linkers.has(e)?this.view_linkers.delete(e):this.view_linkers.add(e))}get_farest_node_selected(e){if(0!==this.nodes_selected.size){if(e===a.tX.left){let e;for(let t of this.nodes_selected){const n=t.bound.rect;(!e||n.x<e.bound.pos.x)&&(e=t)}return e}if(e===a.tX.right){let e;for(let t of this.nodes_selected){const n=t.bound.rect,r=e?.bound.rect;(!r||n.x+n.width>r.x+r.width)&&(e=t)}return e}if(e===a.tX.down){let e;for(let t of this.nodes_selected){const n=t.bound.rect,r=e?.bound.rect;(!r||n.y+n.height>r.y+r.height)&&(e=t)}return e}if(e===a.tX.up){let e;for(let t of this.nodes_selected){const n=t.bound.rect,r=e?.bound.rect;(!r||n.y<r.y)&&(e=t)}return e}}}get_nearest_node(e,t){const n=e.bound.rect;let r=e,i=1/0;if(t===a.tX.left)for(let t of Object.values(this.nodes)){if(!t.show||e===t)continue;const s=t.bound.rect;if(s.x>n.x||s.y+s.height<n.y||s.y>n.y+n.height)continue;const o=N.MathRect.distance_with(n,s);o<i&&(r=t,i=o)}else if(t===a.tX.right)for(let t of Object.values(this.nodes)){if(e===t)continue;let s=t.bound.rect;if(s.x+s.width<n.x+n.width||s.y+s.height<n.y||s.y>n.y+n.height)continue;const o=N.MathRect.distance_with(n,s);o<i&&(r=t,i=o)}else if(t===a.tX.up)for(let t of Object.values(this.nodes)){if(e===t)continue;let s=t.bound.rect;if(s.y>n.y||s.x>n.x+n.width||s.x+s.width<n.x)continue;const o=N.MathRect.distance_with(n,s);o<i&&(r=t,i=o)}else if(t===a.tX.down)for(let t of Object.values(this.nodes)){if(e===t)continue;let s=t.bound.rect;if(s.y+s.height<n.y+n.height||s.x>n.x+n.width||s.x+s.width<n.x)continue;const o=N.MathRect.distance_with(n,s);o<i&&(r=t,i=o)}return r}move_select(e){if(0===this.nodes_selected.size)return;const t=this.get_farest_node_selected(e);if(!t)return;const n=this.get_nearest_node(t,e);this.clear_node_selected(),this.register_node_selected(n),n.move_in_fig_view()}layout(){const e=this.get_view_rect();for(let t of Object.values(this.nodes))t.is_layout_root&&t.attrs.layout&&t.layout(e);this.perf&&this.check_show_line()}check_in_view(e){const{innerHeight:t,innerWidth:n}=window;return!(e.y>t||e.y+e.height<0||e.x>n||e.x+e.width<0)}check_show(){this.perf&&(this.check_show_node(),this.check_show_line())}check_show_line(){if(this.perf){this.view_linkers.clear();for(let e of this.view_nodes)e.check_show_line()}}check_show_node(){if(!this.perf)return;const e=this.get_view_rect();for(let t of Object.values(this.nodes))t.check_show(e)}layout_throttle=N.Notice.throttle(this.layout.bind(this),70);check_show_throttle=N.Notice.throttle(this.check_show.bind(this),100);check_show_line_throttle=N.Notice.throttle(this.check_show_line.bind(this),100);check_show_node_throttle=N.Notice.throttle(this.check_show_node.bind(this),100);async build_child(e){const{nodes:t,linkers:n}=e.info,r=g.I.build_cubes(t,this);for(let e of r)this.nodes[e.id]=e,this.view_nodes=(0,l.Gc)(new Set(r));await this.wait_nodes_render(r),await this.layout(),this._has_layout=!0;for(let e of n){const t=this.get_node(e.attrs.from),n=this.get_node(e.attrs.to);if(!t||!n)continue;const r=new Tn(e,this);this.linkers[r.id]=r,this.perf||this.view_linkers.add(r)}}update_data(e){return{usable:!0,data:e}}export(){const e=Ln.get_default();e.id=this.id,e.css=structuredClone((0,l.ux)(this.css)),e.attrs=structuredClone((0,l.ux)(this.attrs));const t=[],n=[];e.info={nodes:t,linkers:n,node_from:(0,l.ux)(this.node_from),node_to:(0,l.ux)(this.node_to)};for(let e of Object.values(this.nodes))t.push(e.export());for(let e of Object.values(this.linkers))n.push(e.export());return e}remove_node(e){delete this.nodes[e.id],this.view_nodes.delete(e),e.gc()}remove_linker(e){delete this.linkers[e.id],this.view_linkers.delete(e),e.gc()}on_node_add(e){const{data:t}=e,{cursor:n,courier:r,history:i}=this,s=r.get_recorder();s.add_cmd(e);const a=g.I.build_cubes(t,this);this.pick(...a);const l=t.map(e=>e.id);return s.add_recover(o.yc.node_remove(this.id,l)),Promise.resolve().then(async()=>{const e=this.find_layout_root(a),t=this.get_view_rect();for(let n of e)n.layout_throttle(t);this.config.data.map_perf&&this.check_show_line_throttle()}),s}on_node_remove(e){const{data:t}=e,{courier:n,cursor:r,history:i}=this;if(0===t.length)return;const s=n.get_recorder();s.add_cmd(e);const a=[],l=new Set;for(let e of t){const t=this.get_node(e);if(!t)continue;a.push(t.export());const n=t.layout_root;n&&n!==t&&l.add(t.layout_root);for(let n of t.from){const t=this.get_linker_id(n,e);this.get_linker(t)&&s.tell(this,o.yc.linker_remove(this.id,[t]))}for(let e of t.to){const n=this.get_linker_id(t.id,e);this.get_linker(n)&&s.tell(this,o.yc.linker_remove(this.id,[n]))}this.remove_node(t)}s.add_recover(o.yc.node_add(this.id,a));const c=this.get_view_rect();for(let e of l)e.layout_throttle(c);return this.config.data.map_perf&&this.check_show_line_throttle(),s}on_linker_add(e){const{data:t}=e,{courier:n,cursor:r,history:i}=this,s=n.get_recorder();s.add_cmd(e);const a=new Set,l=[];for(let e of t){const{index_to:t,index_from:n,linker:r}=e,i=new Tn(r,this),s=i.from_node,o=i.to_node;if(!s||!o)continue;this.pick(i);let c=this.node_from[i.to_id],d=this.node_to[i.from_id];c?c.indexOf(i.from_id)<0&&c.splice(n,0,i.from_id):this.node_from[i.to_id]=[i.from_id],d?d.indexOf(i.to_id)<0&&d.splice(t,0,i.to_id):this.node_to[i.from_id]=[i.to_id],l.unshift(i.id);const u=s.layout_root;u&&a.add(u)}s.add_recover(o.yc.linker_remove(this.id,l));const c=this.get_view_rect();for(let e of a)e.layout_throttle(c);return this.config.data.map_perf&&this.check_show_line_throttle(),s}on_linker_remove(e){const{data:t}=e,{courier:n,cursor:r,history:i}=this;if(0===t.length)return;const s=n.get_recorder();s.add_cmd(e);const a=[],l=[];for(let e of t){const t=this.get_linker(e);if(!t)continue;const n=this.get_node(t.from_id);n&&l.push(n);const r=this.node_to[t.from_id],i=this.node_from[t.to_id];if(r&&i){const e=r.indexOf(t.to_id),n=i.indexOf(t.from_id);r.splice(e,1),i.splice(n,1),a.unshift({linker:t.export(),index_to:e,index_from:n})}this.remove_linker(t)}const c=this.find_layout_root(l),d=this.get_view_rect();for(let e of c)e.layout_throttle(d);return this.config.data.map_perf&&this.check_show_line_throttle(),s.add_recover(o.yc.linker_add(this.id,a)),s}get_linker_id(e,t){return e+"-"+t}replace_id(e,t={}){return Ln.replace_id(this.root,e,t)}reset_matrix(e){Object.assign(this.matrix2d,e),this.event.emit_status_update()}translate(e,t){const n=sn.c.multiply(this.matrix2d,sn.c.get_matrix_translate(e,t));this.reset_matrix(n)}scale_diff(e,t){this.matrix2d.a+=e,this.matrix2d.d+=t}scale_by_point(e,t,n){const{map_scale_max:r,map_scale_min:i}=this.config.data,s=this.matrix2d.a+t;if(s>r||s<i)return;const o=this.view_point_to_fig(e),a=this.untransform_point(o);this.matrix2d.a+=t,this.matrix2d.d+=n;const l=this.transform_point(a),c=sn.c.multiply(this.matrix2d,sn.c.get_matrix_translate(o.x-l.x,o.y-l.y));this.reset_matrix(c)}view_point_to_fig(e){const t=this.dom_svg_rect,{sx:n,sy:r}=this.get_upstream_sum_scale();let{x:i,y:s}=e;return{x:(i-t.x)/n,y:(s-t.y)/r}}view_point_to_real(e){const t=this.view_point_to_fig(e);return this.untransform_point(t)}fig_point_to_view(e){const t=this.dom_svg_rect;return{x:e.x+t.x,y:e.y+t.y}}fig_point_to_real(e){return this.untransform_point(e)}real_point_to_fig(e){return this.transform_point(e)}real_point_to_view(e){const t=this.real_point_to_fig(e);return this.fig_point_to_view(t)}transform_point(e){const{a:t,b:n,c:r,d:i,e:s,f:o}=this.matrix2d,{x:a,y:l}=e;return{x:t*a+r*l+s,y:n*a+i*l+o}}untransform_point(e){const{a:t,b:n,c:r,d:i,e:s,f:o}=this.matrix2d,{x:a,y:l}=e;return{x:(a-s-r*l)/t,y:(l-o-n*a)/i}}static get meta(){return{type:a.u0.submap,cubename:"子图",version:1,block:!0,show:!0}}static get_default(e=400,t=200){return{id:g.I.get_id(),type:a.u0.submap,info:{nodes:[],linkers:[],node_from:{},node_to:{}},css:{},attrs:{width:e,height:t}}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();return n[r]=i,t.id=i,g.I.replace_id(e,t.info.nodes,n),g.I.replace_id(e,t.info.linkers,n),t}}Mn([(0,k.H)(a.kU.node_add)],Ln.prototype,"on_node_add",null),Mn([(0,k.H)(a.kU.node_remove)],Ln.prototype,"on_node_remove",null),Mn([(0,k.H)(a.kU.linker_add)],Ln.prototype,"on_linker_add",null),Mn([(0,k.H)(a.kU.linker_remove)],Ln.prototype,"on_linker_remove",null);class Tn extends dn.M{_point_from={x:0,y:0};_point_to={x:0,y:0};_show=!1;pcube;sample=(0,l.Gc)([]);constructor(e,t){return super(e,t),this.pcube=t,this.setup(e,t)}_from_node=(0,c.EW)(()=>this.pcube.get_node(this.from_id));_to_node=(0,c.EW)(()=>this.pcube.get_node(this.to_id));_path=(0,c.EW)(()=>this.layout_self());get show(){return this._show}set show(e){this._show=e,e?this.pcube.set_graph_visible(this,!0):this.pcube.set_graph_visible(this,!1)}get info(){return this.data.info}get anchor_left(){return this.attrs.anchor_left||a._A.point}get anchor_right(){return this.attrs.anchor_right||a._A.arrow}get point_from(){return{...this._point_from}}get point_to(){return{...this._point_to}}get rect(){return{x:Math.min(this._point_from.x,this._point_to.x),y:Math.min(this._point_from.y,this._point_to.y),width:Math.abs(this._point_from.x-this._point_to.x),height:Math.abs(this._point_from.y-this._point_to.y)}}get component(){return Bt}get from_id(){return this.attrs.from}get to_id(){return this.attrs.to}get from_node(){return this._from_node.value}get to_node(){return this._to_node.value}export(){const e=this.base_export();return e.attrs.from=this.from_id,e.attrs.to=this.to_id,e}build_child(e){}update_data(e){return{usable:!0,data:e}}get meta(){return Tn.meta}get domain(){return"map"}get id(){return sn.U.get_linker_id(this.from_id,this.to_id)}get path(){return this._path.value}replace_id(e,t={}){return Tn.replace_id(this.root,e,t)}layout_self(){const e=this.from_node,t=this.to_node;if(!e||!t)return"";const n=this.attrs.type,r=an.find(e,t);if(r){this._point_from=r.from,this._point_to=r.to;const e=on.draw({type:n,...r});return this.sample=sn.U.svg_path_sample(e,8),e}return""}get_linker_info(){const e=this.from_node,t=this.to_node;if(!e||!t)return;const n=this.pcube.get_node_to(e.id),r=this.pcube.get_node_from(t.id),i=n?.indexOf(t.id)||-1,s=r?.indexOf(e.id)||-1;return{linker:this.export(),index_from:s,index_to:i}}get_upstream_sum_scale(){const e=[];let t=this.pcube;for(;t&&((t instanceof Ln||t instanceof rn)&&e.push(t),t.pcube);)t=t.pcube;let n=1,r=1;for(let t of e){const{a:e,d:i}=t.matrix2d;n*=e,r*=i}return{sx:n,sy:r}}check_show(e){return this.from_node?.show||this.to_node?.show?(this.show=!0,!0):(this.show=!1,!1)}on_linker_update(e){const{courier:t,history:n}=this,{attrs:r}=e,i=t.get_recorder();i.add_cmd(e);const s=structuredClone((0,l.ux)(this.data.attrs));Object.assign(this.attrs,r);const o=ln.update(this.id,s);return i.add_recover(o),i}get_link_right(){const e=this.from_node?.bound.get_bound_rect_point(N._RectPosition.right_mid),t=this.to_node?.bound.get_bound_rect_point(N._RectPosition.left_mid),n=this.attrs.type;return e&&t?"line"===n?on.line(e,t):"bezier2"===n?on.bezier2(e,t):on.line(e,t):""}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();return n[r]=i,t.id=i,t.attrs.from=n[t.attrs.from]||t.attrs.from,t.attrs.to=n[t.attrs.to]||t.attrs.to,t}static get meta(){return{cubename:"连接线",type:a.u0.linker,block:!1,version:1,show:!1}}static get_default(e,t,n){const{map_linker_anchor_left:r,map_linker_anchor_right:i,map_linker_line:s,map_linker_stroke:o,map_linker_stroke_width:l}=cn.B.config;return{id:sn.U.get_linker_id(e,t),type:a.u0.linker,info:{},attrs:{from:e,to:t,type:n||s,anchor_left:r,anchor_right:i,stroke:o,stroke_width:l},css:{}}}}function zn(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}!function(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);s>3&&o&&Object.defineProperty(t,n,o)}([(0,k.H)(a.Sd.update)],Tn.prototype,"on_linker_update",null);class An extends o.MR{_app;_interaction;_has_layout=(0,l.KR)(!1);data;nodes_test=(0,l.Gc)({});nodes=(0,l.Gc)({});node_from=(0,l.Kh)({});node_to=(0,l.Kh)({});node_editing=(0,l.Gc)(new Set);linkers=(0,l.Gc)({});nodes_selected=(0,l.Gc)(new Set);line_delete_selected=(0,l.Gc)(new Set);view_nodes=(0,l.Gc)(new Set);view_linkers=(0,l.Gc)(new Set);placeholder=(0,l.Kh)({linker:[],box_selector:"",line_delete:"",node:{x:0,y:0,width:0,height:0}});constructor(e){super();const t=this.update_data(e).data;this.data=(0,l.Kh)(t),this.node_to=this.data.info.node_to||{},this.node_from=this.data.info.node_from||{},this._interaction=new un.T(this),this.build_child(t),k.o.init_cmd_handler(this),A.K.add_map(this),this._app=ze(rn,{cube:this}),this.stats.view="map"}get perf(){return this.config.data.map_perf}get matrix2d(){return this.attrs.matrix2d}get attrs(){return this.data.attrs}get has_layout(){return this._has_layout.value}get dom_rect(){const e=this.dom;return e?e.getBoundingClientRect():new DOMRect(0,0,0,0)}get dom_svg_rect(){const e=this.dom?.getElementsByTagName("svg");return e?e[0].getBoundingClientRect():new DOMRect(0,0,0,0)}get interaction(){return this._interaction}get matrix2d_dom_string(){return sn.c.get_dom_string(this.matrix2d)}get domain(){return"map"}get app(){return this._app}get component(){return rn}get meta(){return An.meta}get children(){return[...this._children]}get_linker(e){return this.linkers[e]}get_node(e){return this.nodes[e]}get_node_from(e){return this.node_from[e]}get_node_to(e){return this.node_to[e]}get_view_rect(){const{clientHeight:e,clientWidth:t}=document.documentElement,n=this.dom_rect,r=Math.max(n.left,0),i=Math.min(n.right,t),s={x:r,y:Math.max(0,n.top)},o={x:i,y:Math.min(n.bottom,e)},a=this.view_point_to_real(s),l=this.view_point_to_real(o),c=l.x-a.x,d=l.y-a.y;return{x:a.x,y:a.y,width:c,height:d}}get_view_center(){const e=this.get_view_rect();return{x:e.x+e.width/2,y:e.y+e.height/2}}get_view_cube(){const e=this.get_view_rect(),t=[];for(let n of Object.values(this.nodes))N.MathRect.check_intersection(e,n.bound.rect)&&t.push(n);for(let n of Object.values(this.linkers))N.MathRect.check_intersection(e,n.rect)&&t.push(n);return t}find_layout_root(e){const t=new Set;for(let n of e){const e=n.layout_root;e&&t.add(e)}return t}get_farest_node_selected(e){if(0!==this.nodes_selected.size){if(e===a.tX.left){let e;for(let t of this.nodes_selected){const n=t.bound.rect;(!e||n.x<e.bound.pos.x)&&(e=t)}return e}if(e===a.tX.right){let e;for(let t of this.nodes_selected){const n=t.bound.rect,r=e?.bound.rect;(!r||n.x+n.width>r.x+r.width)&&(e=t)}return e}if(e===a.tX.down){let e;for(let t of this.nodes_selected){const n=t.bound.rect,r=e?.bound.rect;(!r||n.y+n.height>r.y+r.height)&&(e=t)}return e}if(e===a.tX.up){let e;for(let t of this.nodes_selected){const n=t.bound.rect,r=e?.bound.rect;(!r||n.y<r.y)&&(e=t)}return e}}}get_nearest_node(e,t){const n=e.bound.rect;let r=e,i=1/0;if(t===a.tX.left)for(let t of Object.values(this.nodes)){if(!t.show||e===t)continue;const s=t.bound.rect;if(s.x>n.x||s.y+s.height<n.y||s.y>n.y+n.height)continue;const o=N.MathRect.distance_with(n,s);o<i&&(r=t,i=o)}else if(t===a.tX.right)for(let t of Object.values(this.nodes)){if(e===t)continue;let s=t.bound.rect;if(s.x+s.width<n.x+n.width||s.y+s.height<n.y||s.y>n.y+n.height)continue;const o=N.MathRect.distance_with(n,s);o<i&&(r=t,i=o)}else if(t===a.tX.up)for(let t of Object.values(this.nodes)){if(e===t)continue;let s=t.bound.rect;if(s.y>n.y||s.x>n.x+n.width||s.x+s.width<n.x)continue;const o=N.MathRect.distance_with(n,s);o<i&&(r=t,i=o)}else if(t===a.tX.down)for(let t of Object.values(this.nodes)){if(e===t)continue;let s=t.bound.rect;if(s.y+s.height<n.y+n.height||s.x>n.x+n.width||s.x+s.width<n.x)continue;const o=N.MathRect.distance_with(n,s);o<i&&(r=t,i=o)}return r}move_select(e){if(0===this.nodes_selected.size)return;const t=this.get_farest_node_selected(e);if(!t)return;const n=this.get_nearest_node(t,e);this.clear_node_selected(),this.register_node_selected(n),n.move_in_fig_view()}wait_nodes_render(e){return sn.U.wait_nodes_render(e)}find_cube(e){return this.cubes.find_cube(e)}filter(e){const t=[];for(let n of Object.values(this.linkers))e(n)&&t.push(n),t.push(...n.filter(e));for(let n of Object.values(this.nodes))e(n)&&t.push(n),t.push(...n.filter(e));return t}each(e){for(let t of Object.values(this.linkers))e(t),t.each(e);for(let t of Object.values(this.nodes))e(t),t.each(e)}find_child_cube(e){return this.nodes[e]||this.linkers[e]}register_node_editing(e){this.node_editing.add(e)}remove_node_editing(e){this.node_editing.delete(e)}toggle_node_editing(e){this.node_editing.has(e)?this.node_editing.delete(e):this.node_editing.add(e)}check_node_editing(){for(let e of this.node_editing)e.editable||this.remove_node_editing(e)}clear_node_editing(){for(let e of this.node_editing)e.editable=!1;this.node_editing.clear()}register_node_selected(e){this.nodes_selected.add(e)}unregister_node_selected(e){this.nodes_selected.delete(e)}toggle_node_selected(e){this.nodes_selected.has(e)?this.nodes_selected.delete(e):this.nodes_selected.add(e)}is_node_selected(e){return this.nodes_selected.has(e)}in_delete_line(e){return this.line_delete_selected.has(e)}put_delete_selected(e){this.line_delete_selected.add(e)}get_delete_selected(){return new Set(this.line_delete_selected)}clear_delete_line(){this.line_delete_selected.clear()}clear_node_selected(){this.nodes_selected.clear()}pick(...e){for(let t of e)t instanceof o.wP?(this.nodes[t.id]=t,t.show=!0):t instanceof Tn&&(this.linkers[t.id]=t,t.show=!0)}show_all(){for(let e of Object.values(this.nodes))this.view_nodes.add(e);for(let e of Object.values(this.linkers))this.view_linkers.add(e)}get_nodes_view(){return new Set(this.view_nodes)}get_linkers_view(){return new Set(this.view_linkers)}get_nodes_selected(){return new Set(this.nodes_selected)}get_nodes_all(){return[...Object.values(this.nodes)]}get_linkers_all(){return[...Object.values(this.linkers)]}get_nodes_intersection(e){let t=[];for(let n of Object.values(this.nodes)){const r=n.bound.rect;N.MathRect.check_intersection(e,r)&&t.push(n)}return t}set_graph_visible(e,t){t?e instanceof o.wP?this.view_nodes.add(e):e instanceof Tn&&this.view_linkers.add(e):e instanceof o.wP?this.view_nodes.delete(e):e instanceof Tn&&this.view_linkers.delete(e)}toggle_graph_visible(e){e instanceof o.wP?this.view_nodes.has(e)?this.view_nodes.delete(e):this.view_nodes.add(e):e instanceof Tn&&(this.view_linkers.has(e)?this.view_linkers.delete(e):this.view_linkers.add(e))}remove_node(e){delete this.nodes[e.id],this.view_nodes.delete(e),e.gc()}remove_linker(e){delete this.linkers[e.id],this.view_linkers.delete(e),e.gc()}async build_child(e){const{nodes:t,linkers:n}=e.info;console.time("🍋build-nodes");const r=g.I.build_cubes(t,this);console.timeEnd("🍋build-nodes");for(let e of r)this.nodes[e.id]=e,this.view_nodes=(0,l.Gc)(new Set(r));for(let e of n){const t=this.get_node(e.attrs.from),n=this.get_node(e.attrs.to);if(!t||!n)continue;const r=new Tn(e,this);this.linkers[r.id]=r,this.perf||this.view_linkers.add(r)}}layout(){console.time("🍋layout-nodes");const e=this.get_view_rect();for(let t of Object.values(this.nodes))t.is_layout_root&&t.attrs.layout&&t.layout(e);console.timeEnd("🍋layout-nodes"),this.perf&&this.check_show_line()}check_show(){console.time("🍋动态显示检查"),this.check_show_node(),this.check_show_line(),console.timeEnd("🍋动态显示检查")}check_show_line(){this.view_linkers.clear();for(let e of this.view_nodes)e.check_show_line()}check_show_node(){if(!this.perf)return;const e=this.get_view_rect();for(let t of Object.values(this.nodes))t.check_show(e)}layout_throttle=N.Notice.throttle(this.layout.bind(this),70);check_show_throttle=N.Notice.throttle(this.check_show.bind(this),100);check_show_line_throttle=N.Notice.throttle(this.check_show_line.bind(this),100);check_show_node_throttle=N.Notice.throttle(this.check_show_node.bind(this),100);gc(){}export(){const e=An.get_default();e.id=this.id,e.css=structuredClone((0,l.ux)(this.css)),e.attrs=structuredClone((0,l.ux)(this.attrs)),e.attrs.matrix2d={...this.matrix2d};const t=[],n=[];e.info={nodes:t,linkers:n,node_from:(0,l.ux)(this.node_from),node_to:(0,l.ux)(this.node_to)};for(let e of Object.values(this.nodes))t.push(e.export());for(let e of Object.values(this.linkers))n.push(e.export());return e}update_data(e){return e.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}async render(e){this._dom=e,this.app.mount(e),console.time("🍋wait-svg"),await $t.ps,console.timeEnd("🍋wait-svg"),console.time("🍋wait-nodes"),await sn.U.wait_nodes_render([...this.view_nodes]),console.timeEnd("🍋wait-nodes"),this.layout(),this._has_layout.value=!0;const t=this.dom?.querySelector(".note");this.event.emit_status_update(),t&&(this.hotkeys.listen(t),this.interaction.register(t))}on_node_add(e){const{data:t}=e,{cursor:n,courier:r,history:i}=this,s=r.get_recorder();s.add_cmd(e);const a=g.I.build_cubes(t,this);this.pick(...a);const l=t.map(e=>e.id);return s.add_recover(o.yc.node_remove(this.id,l)),Promise.resolve().then(async()=>{await sn.U.wait_nodes_render(a);const e=this.find_layout_root(a),t=this.get_view_rect();for(let n of e)n.layout_throttle(t)}),s}on_node_remove(e){const{data:t}=e,{courier:n,cursor:r,history:i}=this;if(0===t.length)return;const s=n.get_recorder();s.add_cmd(e);const a=[],l=new Set;for(let e of t){const t=this.get_node(e);if(!t)continue;a.push(t.export());const n=t.layout_root;n&&n!==t&&l.add(t.layout_root);for(let n of t.from){const t=this.get_linker_id(n,e);this.get_linker(t)&&s.tell(this,o.yc.linker_remove(this.id,[t]))}for(let e of t.to){const n=this.get_linker_id(t.id,e);this.get_linker(n)&&s.tell(this,o.yc.linker_remove(this.id,[n]))}this.remove_node(t)}s.add_recover(o.yc.node_add(this.id,a));const c=this.get_view_rect();for(let e of l)e.layout_throttle(c);return s}on_linker_add(e){const{data:t}=e,{courier:n,cursor:r,history:i}=this,s=n.get_recorder();s.add_cmd(e);const a=new Set,l=[];if(0===t.length)return;for(let e of t){const{index_to:t,index_from:n,linker:r}=e,i=new Tn(r,this),s=i.from_node,o=i.to_node;if(!s||!o)continue;this.pick(i);let c=this.node_from[i.to_id],d=this.node_to[i.from_id];c?c.indexOf(i.from_id)<0&&c.splice(n,0,i.from_id):this.node_from[i.to_id]=[i.from_id],d?d.indexOf(i.to_id)<0&&d.splice(t,0,i.to_id):this.node_to[i.from_id]=[i.to_id],l.unshift(i.id);const u=s.layout_root;u&&a.add(u)}s.add_recover(o.yc.linker_remove(this.id,l));const c=this.get_view_rect();for(let e of a)e.layout_throttle(c);return s}on_linker_remove(e){const{data:t}=e,{courier:n,cursor:r,history:i}=this;if(0===t.length)return;const s=n.get_recorder();s.add_cmd(e);const a=[],l=[];for(let e of t){const t=this.get_linker(e);if(!t)continue;const n=this.get_node(t.from_id);n&&l.push(n);const r=this.node_to[t.from_id],i=this.node_from[t.to_id];if(r&&i){const e=r.indexOf(t.to_id),n=i.indexOf(t.from_id);r.splice(e,1),i.splice(n,1),a.unshift({linker:t.export(),index_to:e,index_from:n})}this.remove_linker(t)}const c=this.find_layout_root(l),d=this.get_view_rect();for(let e of c)e.layout_throttle(d);return s.add_recover(o.yc.linker_add(this.id,a)),s}get_linker_id(e,t){return sn.U.get_linker_id(e,t)}replace_id(e,t={}){return An.replace_id(this.root,e,t)}reset_matrix(e){Object.assign(this.matrix2d,e),this.event.emit_status_update()}translate(e,t){const n=sn.c.multiply(this.matrix2d,sn.c.get_matrix_translate(e,t));this.reset_matrix(n)}scale_diff(e,t){this.matrix2d.a+=e,this.matrix2d.d+=t}scale_by_point(e,t,n){const{map_scale_max:r,map_scale_min:i}=this.config.data,s=this.matrix2d.a+t;if(s>r||s<i)return;const o=this.view_point_to_fig(e),a=this.untransform_point(o);this.matrix2d.a+=t,this.matrix2d.d+=n;const l=this.transform_point(a),c=o.x-l.x,d=o.y-l.y,u=sn.c.multiply(this.matrix2d,sn.c.get_matrix_translate(c,d));this.reset_matrix(u)}get_upstream_sum_scale(){return{sx:1,sy:1}}view_point_to_fig(e){const t=this.dom_svg_rect,{sx:n,sy:r}=this.get_upstream_sum_scale();let{x:i,y:s}=e;return{x:(i-t.x)/n,y:(s-t.y)/r}}view_point_to_real(e){const t=this.view_point_to_fig(e);return this.untransform_point(t)}fig_point_to_view(e){const t=this.dom_svg_rect;return{x:e.x+t.x,y:e.y+t.y}}fig_point_to_real(e){return this.untransform_point(e)}real_point_to_fig(e){return this.transform_point(e)}real_point_to_view(e){const t=this.real_point_to_fig(e);return this.fig_point_to_view(t)}transform_point(e){const{a:t,b:n,c:r,d:i,e:s,f:o}=this.matrix2d,{x:a,y:l}=e;return{x:t*a+r*l+s,y:n*a+i*l+o}}untransform_point(e){const{a:t,b:n,c:r,d:i,e:s,f:o}=this.matrix2d,{x:a,y:l}=e;return{x:(a-s-r*l)/t,y:(l-o-n*a)/i}}static get meta(){return{type:a.u0.map,cubename:"图形笔记",version:1,block:!0,show:!1}}static get_default(){return{id:g.I.get_id(),type:a.u0.map,versions:A.K.export_versions(),info:{nodes:[],linkers:[],node_from:{},node_to:{}},css:{},attrs:{matrix2d:sn.c.get_default()}}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();return n[r]=i,t.id=i,g.I.replace_id(e,t.info.nodes,n),g.I.replace_id(e,t.info.linkers,n),t}}zn([(0,k.H)(a.kU.node_add)],An.prototype,"on_node_add",null),zn([(0,k.H)(a.kU.node_remove)],An.prototype,"on_node_remove",null),zn([(0,k.H)(a.kU.linker_add)],An.prototype,"on_linker_add",null),zn([(0,k.H)(a.kU.linker_remove)],An.prototype,"on_linker_remove",null);class Rn{_observer;_nodes={};constructor(){this._observer=new ResizeObserver(this.watch.bind(this))}watch(e,t){for(let t of e){const e=t.target,n=t.target.dataset.id,r=this._nodes[n];r&&e.isConnected&&r.layout_self(t)}}register(e,t){const n=e.dataset.id;n&&(this._nodes[n]=t,this._observer.observe(e))}unregister(e){const t=e.dataset.id;t&&(delete this._nodes[t],e&&this._observer.unobserve(e))}}const Pn=new Rn,Nn=["id","data-type","transform","data-editing"],En=["d"],On=["x","y","width","height"],In=["data-id"],Bn={class:"node-status"},Dn=(0,c.pM)({__name:"cube-node",props:{cube:{}},setup(e){const{bound:t,shape:n}=e.cube,r=(0,l.KR)(),{map_node_padding:i}=e.cube.config.data;(0,c.sV)(()=>{const t=r.value;t&&Pn.register(t,e.cube)}),(0,c.xo)(()=>{const e=r.value;e&&Pn.unregister(e)});const s=(0,c.EW)(()=>({"node-selected":e.cube.pcube.is_node_selected(e.cube),"node-editable":e.cube.editable,"line-delete-selected":e.cube.pcube.in_delete_line(e.cube)}));function u(t,n){e.cube.event.emit_node_status_click(t,{node:e.cube,click:n})}function h(t=!0){const{courier:n,history:r}=e.cube,i=n.get_recorder(),s=o.Sv.layout_change(e.cube.id,{fold:t});i.tell(e.cube,s),r.record(i)}return(e,i)=>((0,c.uX)(),(0,c.CE)("g",{id:e.cube.id,"data-type":(0,l.R1)(a.u0).node,class:(0,d.C4)(["cube-node",s.value]),transform:e.cube.matrix2d_dom_string,"data-editing":e.cube.editable},[(0,c.Lk)("path",{d:(0,l.R1)(n).path,ref:"p",style:(0,d.Tr)({fill:e.cube.attrs.fill})},null,12,En),((0,c.uX)(),(0,c.CE)("foreignObject",{x:(0,l.R1)(t).pos_cbox.x,y:(0,l.R1)(t).pos_cbox.y,width:(0,l.R1)(t).size.width,height:(0,l.R1)(t).size.height,style:(0,d.Tr)(e.cube.css)},[(0,c.Lk)("div",{class:"cube-node-box",ref_key:"box",ref:r,"data-id":e.cube.id},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.children,e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:e},null,8,["cube"]))),128)),(0,c.Lk)("div",Bn,[e.cube.is_layout_root?((0,c.uX)(),(0,c.CE)("div",{key:0,class:"iconfont icon-system-mind-map-filled",onClick:i[0]||(i[0]=e=>u(e,"root"))})):(0,c.Q3)("v-if",!0),e.cube.attrs.layout?((0,c.uX)(),(0,c.CE)("div",{key:1,class:(0,d.C4)(e.cube.icons[e.cube.attrs.layout]),onClick:i[1]||(i[1]=e=>u(e,"layout"))},null,2)):(0,c.Q3)("v-if",!0),e.cube.to.size>0?((0,c.uX)(),(0,c.CE)(c.FK,{key:2},[e.cube.attrs.fold?((0,c.uX)(),(0,c.CE)("div",{key:0,class:"status-fold",onClick:i[2]||(i[2]=e=>h(!1))},(0,d.v_)(e.cube.layout_downstream_nodes.length),1)):((0,c.uX)(),(0,c.CE)("div",{key:1,class:"iconfont icon-minus2",onClick:i[3]||(i[3]=e=>h(!0))}))],64)):(0,c.Q3)("v-if",!0)])],8,In)],12,On))],10,Nn))}}),Vn=(0,m.A)(Dn,[["__scopeId","data-v-10fce4a0"]]);class Hn extends o.wP{constructor(e,t){return super(e,t),this.setup(e,t)}get domain(){return"map"}get meta(){return Hn.meta}get component(){return Vn}build_child(e){this._children.push(...g.I.build_cubes(e.info,this))}update_data(e){return e.attrs.matrix&&(e.attrs.matrix2d=e.attrs.matrix,delete e.attrs.matrix),{usable:!0,data:e}}gc(){this.base_gc()}export(){const e=this.base_export();e.info=[],e.attrs=structuredClone((0,l.ux)(this.attrs)),e.attrs.matrix2d=this.matrix2d_real;for(let t of this._children)e.info.push(t.export());return e}replace_id(e,t={}){return Hn.replace_id(this.root,e,t)}static get meta(){return{cubename:"图形节点",type:a.u0.node,block:!0,version:1,show:!1}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();return n[r]=i,t.id=i,g.I.replace_id(e,t.info,n),t}static get_default(e,t="rect"){return{id:g.I.get_id(),type:a.u0.node,info:[yt.get_default()],attrs:{root:!1,matrix2d:{a:1,b:0,c:0,d:1,e:e.x,f:e.y},shape:t,layout:null},css:{}}}a(e=!1,t=null,n=!0){const{courier:r}=this,i=r.get_recorder(),s=o.Sv.layout_change(this.id,{root:e,layout:t,fold:n});i.tell(this,s),this.history.record(i);const a=this.pcube.get_view_rect();this.layout_root?.layout(a)}}class jn{_cube;_size=(0,l.Kh)(o.wP.get_default_node_size());_size_bound=(0,c.EW)(()=>this.get_size_bound());_size_tree=(0,c.EW)(()=>this.get_size_tree());_pos_cbox=(0,c.EW)(()=>this.get_pos_cbox());_pos=(0,c.EW)(()=>this.get_pos());_pos_center=(0,c.EW)(()=>this.get_pos_center());_pos_tree=(0,c.EW)(()=>this.get_pos_tree());_layout_pos_tree;constructor(e,t){this._cube=e,this._layout_pos_tree=(0,l.Kh)({x:t.e,y:t.f})}get rect(){return{...this.pos,...this.size_bound}}get pos_tree(){return this._pos_tree.value}get matrix2d(){return this._cube.matrix2d}get config(){return this.cube.config}get cube(){return this._cube}get pcube(){return this.cube.pcube}get size(){return{...this._size}}get size_tree(){return this._size_tree.value}get size_bound(){return this._size_bound.value}get pos_raw(){return{x:this.matrix2d.e,y:this.matrix2d.f}}get pos(){return this._pos.value}get pos_center(){return this._pos_center.value}get pos_cbox(){return this._pos_cbox.value}get_size_tree(){const{map_node_hgap:e,map_node_vgap:t}=this.config.data;if(0===this.cube.count_to)return this.size_bound;const n=this.cube.layout_type,r=this.cube.get_layout_nodes(),i=this.size_bound;if(0===r.length)return this.size_bound;const{sum_tree_height:s,sum_tree_width:o,max_tree_height:a,max_tree_width:l,mw_rect:c,mh_rect:d}=this.stat_downstream_nodes_size(r);if("left"===n)return{width:i.width+e+l,height:Math.max(i.height,s)};if("right"===n)return{width:i.width+e+l,height:Math.max(i.height,s)};if("down"===n)return{width:Math.max(i.width,o),height:i.height+t+a};if("up"===n)return{width:Math.max(i.width,o),height:i.height+t+a};if("time-right"===n){const t=d.height,n=i.height;if(n<t||n>a)return{width:i.width+e+o,height:Math.max(a,n)};{const r=n/2;return{width:i.width+e+o,height:r+Math.max(a-t/2,r)}}}if("time-down"===n){const e=i.width/2,n=c.width/2;return{width:Math.max(e,n)+Math.max(e,l-n),height:i.height+t+s}}return i}get_rect(){return{...this.get_pos(),...this.get_size_bound()}}stat_downstream_nodes_size(e){const{map_node_hgap:t,map_node_vgap:n}=this.cube.config.data;let r=0,i=0,s=0,o=0,a={x:0,y:0,width:0,height:0},l={x:0,y:0,width:0,height:0};for(let t of e){const e=t.bound.size_tree;s+=e.height,o+=e.width,e.width>r&&(r=e.width,a=t.bound.rect),e.height>i&&(i=e.height,l=t.bound.rect)}return{max_tree_height:i,max_tree_width:r,sum_tree_height:s+(e.length-1)*n,sum_tree_width:o+(e.length-1)*t,mw_rect:a,mh_rect:l}}get_pos_cbox(){const e=this.cube.attrs.shape,{width:t,height:n}=this.size_bound,{map_node_padding:r}=this.cube.config.data,i=n/2;return"circle"===e?{x:t/2-this.size.width/2,y:i-this.size.height/2}:{x:r,y:r}}get_pos(){this.cube.attrs.shape;const e=this.size_tree,t=this.size_bound,n=this.pos_tree,r=this.cube.layout_type,i=this.matrix2d.e,s=this.matrix2d.f,o=this.cube.get_layout_nodes(),{sum_tree_height:a,sum_tree_width:l,max_tree_height:c,max_tree_width:d,mw_rect:u,mh_rect:h}=this.stat_downstream_nodes_size(o);if(this.cube.is_layout_root||!this.cube.layout_upstream)return{x:i,y:s};if("right"===r)return{x:n.x,y:n.y-t.height/2+e.height/2};if("left"===r)return{x:n.x+e.width-t.width,y:n.y+e.height/2-t.height/2};if("down"===r)return{x:n.x+e.width/2-t.width/2,y:n.y};if("up"===r)return{x:n.x+e.width/2-t.width/2,y:n.y+e.height-t.height};if("time-right"===r){const e=Math.max(h.height,t.height)/2;return{x:n.x,y:n.y+e-t.height/2}}if("time-down"===r){const e=Math.max(u.width,t.width)/2;return{x:n.x+e-t.width/2,y:n.y}}return{x:i,y:s}}get_pos_center(){const e=this.pos,{width:t,height:n}=this.size_bound;return{x:e.x+t/2,y:e.y+n/2}}get_pos_tree(){if(this.cube.layout_upstream)return this._layout_pos_tree;const e=this.cube.layout_type,t=this.size_bound,n=this.size_tree,r=this.matrix2d.e,i=this.matrix2d.f,s=r+t.width/2,o=i+t.height/2,a=this.cube.attrs.shape;if(!e)return{x:r,y:i};if("right"===e)return{x:r,y:i+t.height/2-n.height/2};if("left"===e)return{x:r+t.width-n.width,y:i+t.height/2-n.height/2};if("down"===e)return{x:r+t.width/2-n.width/2,y:i};if("up"===e)return{x:r+t.width/2-n.width/2,y:i+t.height-n.height};if("time-right"===e){const e={x:r,y:i};if("circle"===a){const e=Math.sqrt(t.width*t.width+(t.height+t.height))/2;return{x:s-e,y:o-e}}return e}if("time-down"===e)return{x:r,y:i};if("circle"===a){const e=Math.sqrt(t.width*t.width+(t.height+t.height))/2;return{x:s-e,y:o-e}}return{x:r,y:i}}get_size_bound_raw(){const{map_node_padding:e}=this.cube.config.data;return this.cube.attrs.shape,{width:this.size.width+2*e,height:this.size.height+2*e}}get_size_bound(){this.cube.shape.type;const{map_node_padding:e}=this.cube.config.data;return{width:this.size.width+2*e,height:this.size.height+2*e}}update_pos_tree(e,t){this._layout_pos_tree.x=e,this._layout_pos_tree.y=t}update_size(e,t){if(this._size.width=e,this._size.height=t,this.cube.pcube.has_layout&&!this.cube.clipboard.pasted_from){const e=this.cube.layout_root;if(e){const t=e.pcube.get_view_rect();e.layout_throttle(t)}}}get_bound_rect_point(e){const t={...this.pos,...this.size_bound};return N.MathRect.get_rect_point(t,e)}}class Fn{static get_shaple(e){const t=e.attrs.shape;return"rect"===t?this.rect(e):"circle"===t?this.circle(e):this.rect(e)}static rect(e,t=4,n=4){const{width:r,height:i}=e.bound.size,s=r+2*t,o=r+2*t,a=i+2*t,l=i+2*t;return`M${0+n} 0H${s-n}Q${s} 0 ${s} ${0+n}V${a-n}Q${o} ${a} ${o-n} ${a}H ${0+n}Q0 ${l} 0 ${l-n}V${0+n}Q0 0 ${0+n} 0Z`}static circle(e){const{width:t,height:n}=e.bound.size,r=Math.sqrt(t*t+n*n)/2;return`M${r} 0 A ${r} ${r} 0 1 0 ${r} ${2*r}A${r} ${r} 0 1 0 ${r} 0`}}class Un{static reset(e,t,n){return{id:e,name:a.tK.reset,args:t,funcs:n}}}let qn="";function $n(e,t){if(qn===t.funcname.text)return;qn=t.funcname.text;const{funcname:n,args:r,funcs:i,courier:s,history:o}=t,a=new _.vk(s),l=new Set,c=new Set;for(let e of n.children){if(!(e instanceof kt))continue;const t=e.text.trim();if(!t||""===t)continue;const n=Gn(t);for(let e of n.args)l.add(e);c.add(n.name)}const d=[],u=[],h=[...l],p=[...c];if(h.length===r.length)for(let e=0;e<r.length;e++)d.push({name:h[e],desc:r[e].desc.export()});else for(let e of h){const t=r.find(t=>t.name===e);if(t)d.push({name:e,desc:t.desc.export()});else{const t=kt.get_default(),n=kt.get_default();d.push({name:e,desc:Tt.get_default([t,n])})}}if(p.length===i.length)for(let e=0;e<i.length;e++)u.push({name:p[e],desc:i[e].desc.export()});else for(let e of p){const t=i.find(t=>t.name===e);if(t)u.push({name:e,desc:t.desc.export()});else{const t=kt.get_default(),n=kt.get_default();u.push({name:e,desc:Tt.get_default([t,n])})}}a.tell(t,Un.reset(t.id,d,u)),o.record(a)}function Gn(e){const t=e.replace("...",""),n=t.indexOf("("),r=t.indexOf(")"),i=t.indexOf("."),s={name:"",args:[]};if(s.name=i<0&&n>0?t.slice(0,n):i>0&&n>0?t.slice(i+1,n):t.slice(i+1),n<0||r<0)return s.name=t,s;const o=t.slice(n+1,r);for(let e of o.split(",")){let t=e.trim();t&&s.args.push(t)}return s}const Xn=["id","data-type"],Kn={class:"cube-api-content"},Wn={class:"api-description"},Yn={class:"arg-name"},Zn={class:"func-name"},Qn=(0,c.pM)({__name:"cube-api",props:{cube:{}},setup:e=>(e,t)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-api",id:e.cube.id,"data-type":(0,l.R1)(a.u0).api,style:(0,d.Tr)(e.cube.css),ref:"root"},[(0,c.Lk)("div",Kn,[(0,c.Lk)("div",{class:"header",onKeyup:t[0]||(t[0]=t=>(0,l.R1)($n)(t,e.cube))},[(0,c.bF)(S,{cube:e.cube.funcname},null,8,["cube"])],32),(0,c.Lk)("div",Wn,[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.args,e=>((0,c.uX)(),(0,c.CE)(c.FK,{key:e.desc.id},[(0,c.Lk)("div",Yn,(0,d.v_)(e.name),1),(0,c.bF)(S,{class:"arg-desc",cube:e.desc},null,8,["cube"]),(0,c.Q3)(' <component class=\'arg-desc\' :is="item.component" :cube="item" :id="item.id"></component> ')],64))),128)),((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.funcs,e=>((0,c.uX)(),(0,c.CE)(c.FK,{key:e.desc.id},[(0,c.Lk)("div",Zn,(0,d.v_)(e.name),1),(0,c.bF)(S,{class:"func-desc",cube:e.desc},null,8,["cube"]),(0,c.Q3)(' <component class=\'func-desc\' :is="item.component" :cube="item" :id="item.id"></component> ')],64))),128))])])],12,Xn))}),Jn=(0,m.A)(Qn,[["__scopeId","data-v-2f228956"]]);class er extends o._D{_component=Jn;funcname;args=(0,l.Gc)([]);funcs=(0,l.Gc)([]);constructor(e,t){return super(e,t),this.setup(e,t)}get component(){return this._component}get children(){const e=this.args.map(e=>e.desc),t=this.funcs.map(e=>e.desc);return[this.funcname,...e,...t]}get meta(){return er.meta}get is_empty(){return 1===this.funcname.child_count&&this.funcname.child_first.is_empty}splice(e,t,...n){const r=this._children.splice(e,t,...n);for(let e of r)e.gc();const i=[];for(let e of r)e instanceof o._D&&i.push(e.export());return{children:r,data:i}}replace_id(e,t={}){return er.replace_id(this.root,e,t)}build_child(e){this.funcname=new Tt(e.info.names,this),this.build_desc(this.info.args,this.info.funcs)}gc(){super.base_gc()}export(){const e=this.base_export();return e.info.names=this.funcname.export(),e.info.args=this.get_args_data(),e.info.funcs=this.get_funcs_data(),e}build_desc(e,t){for(let e of this.args)e.desc.gc();for(let e of this.funcs)e.desc.gc();this.args.length=0,this.funcs.length=0;for(let t of e){const e={name:t.name,desc:new Tt(t.desc,this)};this.args.push(e)}for(let e of t){const t={name:e.name,desc:new Tt(e.desc,this)};this.funcs.push(t)}}get_args_data(){const e=[];for(let t of this.args){const n={name:t.name,desc:t.desc.export()};e.push(n)}return e}get_funcs_data(){const e=[];for(let t of this.funcs){const n={name:t.name,desc:t.desc.export()};e.push(n)}return e}reset_api(e){const{courier:t,history:n}=this,{args:r,funcs:i}=e,s=t.get_recorder();s.add_cmd(e);const o=structuredClone(this.get_args_data()),a=structuredClone(this.get_funcs_data());return this.build_desc(r,i),s.add_recover(Un.reset(this.id,o,a)),s}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}static get meta(){return{type:a.u0.api,version:1,cubename:"Api",block:!0,show:!0}}static get_default(e=[],t={},n={}){const r=[];for(let t of e)r.push(kt.get_default_by_string(t));return{id:(0,s.Ak)(),type:a.u0.api,info:{names:Tt.get_default(r),args:[],funcs:[]},css:t,attrs:n}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i,t.info.names=Tt.replace_id(e,t.info.names,n);for(let r of t.info.args)r.desc=Tt.replace_id(e,r.desc,n);for(let r of t.info.funcs)r.desc=Tt.replace_id(e,r.desc,n);return t}}function tr(e,t="tail"){const{courier:n,history:r}=e,i=new _.vk(n),s=[Tt.get_default(),Tt.get_default()],o=nr.insert_row(e.id,t,[s]);i.tell(e,o),r.record(i)}!function(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);s>3&&o&&Object.defineProperty(t,n,o)}([(0,k.H)(a.tK.reset)],er.prototype,"reset_api",null);class nr{static insert_row(e,t,n){return{id:e,name:a.J8.insert_row,pos:t,rows:n}}static remove_row(e,t,n=!1){return{id:e,name:a.J8.remove_row,range:t,reserve:n}}static change_width_col1(e,t){return{id:e,width:t,name:a.J8.change_width_col1}}}const rr=["id","data-type"],ir=(0,c.pM)({__name:"cube-detail-list",props:{cube:{}},setup(e){const t=e.cube.root,n=(0,c.rk)("root"),r=(0,l.KR)();(0,c.sV)(()=>{const i=r.value,s=n.value;if(!i)return;const o=new N.DragDiff(i);let a=e.cube.attrs.width_col1,l=a;o.register_down(()=>{a=e.cube.attrs.width_col1}),o.register_move((e,n)=>{t.stats.is_read_mode||(l=Math.round(e+a),s?.style.setProperty("--width-col1",l+"px"))}),o.register_up((n,r)=>{if(t.stats.is_read_mode)return;if(a===l)return;const i=e.cube.courier.get_recorder(),s=Math.round(n+a);i.tell(e.cube,nr.change_width_col1(e.cube.id,s)),e.cube.history.record(i)}),o.register_cancel(()=>{e.cube.attrs.width=a,i.style.left=a-2+"px"})});const i=(0,c.EW)(()=>({...e.cube.css,"--width-col1":e.cube.attrs.width_col1+"px"}));return(t,s)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-detail-list",id:t.cube.id,"data-type":(0,l.R1)(a.u0).detail_list,ref_key:"root",ref:n,style:(0,d.Tr)(i.value),onContextmenu:s[1]||(s[1]=e=>(0,l.R1)(pt.uz)(e,t.cube))},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(t.cube.children,t=>((0,c.uX)(),(0,c.Wv)(S,{key:t.id,cube:t,onKeydown:n=>function(t,n){t.ctrlKey&&!t.shiftKey&&"Enter"===t.key?(t.stopPropagation(),tr(e.cube,Math.floor(n.index/2)+1)):t.ctrlKey&&t.shiftKey&&"Enter"===t.key&&(t.stopPropagation(),tr(e.cube,Math.floor(n.index/2)))}(n,t)},null,8,["cube","onKeydown"]))),128)),(0,c.Lk)("div",{class:"adder-wrap",onClick:s[0]||(s[0]=()=>(0,l.R1)(tr)(t.cube))},[...s[2]||(s[2]=[(0,c.Lk)("div",{class:"adder"},null,-1)])]),(0,c.Lk)("div",{class:"adjuster",ref_key:"adjuster",ref:r},null,512)],44,rr))}}),sr=(0,m.A)(ir,[["__scopeId","data-v-6b68d605"]]),or=[function(e,t){return t>=2||e.attrs.width_col1||(e.attrs.width_col1=150),e}];function ar(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class lr extends o._D{rows;_component=sr;constructor(e,t){return super(e,t),this.rows=(0,l.Gc)([]),this.setup(e,t)}get component(){return this._component}get children(){const e=[];for(let t of this.rows)e.push(...t);return e}get attrs(){return this.data.attrs}get css_col1(){return this.attrs.width_col1||(this.attrs.width_col1=150),{width:this.attrs.width_col1+"px"}}get is_empty(){return!1}get row_count(){return this.rows.length}get col1(){return this.rows.map(e=>e[0])}get col2(){return this.rows.map(e=>e[1])}get meta(){return lr.meta}update_data(e){return function(e,t){const n=t[lr.meta.type];return n>lr.meta.version?{data:e,usable:!1}:{data:or.reduce((e,t)=>t(e,n),e),usable:!0}}(e,this.root.versions)}build_child(e){for(let t of e.info){const e=new Tt(t[0],this),n=new Tt(t[1],this);this.rows.push([e,n])}}copy(e,t){if(e===t)return[this.children[e].export()];const n=Math.floor(e/2),r=Math.floor((t-1)/2),i=lr.get_default();i.info=[];for(let e=n;e<=r;e++){const t=this.rows[e];if(!t)continue;const n=[t[0].export(),t[1].export()];i.info.push(n)}return 0===i.info.length?[]:[i]}gc(){super.base_gc()}export(){const e=this.base_export();e.css=structuredClone((0,l.ux)(this.css)),e.attrs=structuredClone((0,l.ux)(this.attrs)),e.info=[];for(let[t,n]of this.rows){const r=t.export(),i=n.export();e.info.push([r,i])}return e}replace_id(e,t={}){return lr.replace_id(this.root,e,t)}splice_rows(e,t,...n){const r=this.rows.splice(e,t,...n);for(let[e,t]of r)e.gc(),t.gc();return r}check_delete_edge(e){return 0==e.index%2&&!!e.is_empty}insert_row(e){const{courier:t}=this,{pos:n,rows:r}=e,i=t.get_recorder();i.add_cmd(e);const s=[];for(let[e,t]of r)s.push([new Tt(e,this),new Tt(t,this)]);let o=[0,0];return"tail"===n?(o=[this.row_count,this.row_count+s.length],this.rows.push(...s)):"head"===n?(o=[0,0+s.length],this.rows.unshift(...s)):(o=[n,n+s.length],this.splice_rows(n,0,...s)),i.add_recover(nr.remove_row(this.id,o)),i}remove_row(e){const{courier:t,cursor:n}=this,{range:r,reserve:i}=e,s=new _.vk(t);let[a,l]=r;if(a<0&&(a=0),l>this.row_count&&(l=this.row_count),0===a&&l>=this.row_count)if(i){if(this.is_empty)return;s.tell(this,nr.remove_row(this.id,[1,this.child_count]));const e=this.child_first,t=e.next_cube;t&&s.tell(t,o.VL.delete_child(t.id,"backward",[0,t.child_count],!0)),e&&s.tell(e,o.VL.delete_child(e.id,"backward",[0,e.child_count],!0))}else s.merge(this.remove_self());else{const e=this.rows[a-1]?.[1],t=this.rows[l+1]?.[1],n=this.splice_rows(a,l-a),r=[];for(let[e,t]of n)r.push([e.export(),t.export()]);s.add_recover(nr.insert_row(this.id,a,r)),e?s.tell(e,o.UB.in_tail(e.id,0,void 0)):t&&s.tell(t,o.UB.in_head(t.id,0,void 0))}return s}change_width_col1(e){const{width:t}=e,{courier:n,id:r}=this,i=n.get_recorder();i.add_cmd(e);const s=this.attrs.width_col1;return this.attrs.width_col1=t,this.dom?.style.setProperty("--width-col1",t+"px"),i.add_recover(nr.change_width_col1(r,s)),i}delete_cube(e){const{courier:t,pid:n,index:r,pcube:i}=this,{dir:s,range:o,reserve:a}=e,[l,c]=o,d=Math.floor(l/2),u=Math.floor((c-1)/2),h=(this.children[l],nr.remove_row(this.id,[d,u+1],a));return this.remove_row(h)}static get meta(){return{type:x.u0.detail_list,version:2,cubename:"清单",block:!0,show:!0}}static get_default(e=[],t={},n={}){const r=0===e.length?[[Tt.get_default(),Tt.get_default()]]:e;return{id:(0,s.Ak)(),type:x.u0.detail_list,info:r,css:t,attrs:{width_col1:150}}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i;const s=[];for(let r of t.info)s.push([Tt.replace_id(e,r[0],n),Tt.replace_id(e,r[1],n)]);return t.info=s,t}}ar([(0,k.H)(a.J8.insert_row)],lr.prototype,"insert_row",null),ar([(0,k.H)(a.J8.remove_row)],lr.prototype,"remove_row",null),ar([(0,k.H)(a.J8.change_width_col1)],lr.prototype,"change_width_col1",null),ar([(0,k.H)(a.zS.cube_delete_child)],lr.prototype,"delete_cube",null);class cr{static add(e,t,n){return{id:e,name:a.Ny.add,data:t,pos:n}}static remove(e,t){return{id:e,name:a.Ny.remove,range:t}}static indent(e,t){return{id:e,name:a.Ny.indent,items:t}}static status(e,t,n){return{id:e,name:a.Ny.status,index:t,done:n}}}const dr=["id","data-type"],ur=["onClick"],hr=(0,c.pM)({__name:"cube-todo",props:{cube:{}},setup(e){const{root:t}=e.cube,{config:n}=t;return(t,r)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-todo",id:t.cube.id,style:(0,d.Tr)(t.cube.css),"data-type":(0,l.R1)(a.u0).todo,onContextmenu:r[0]||(r[0]=e=>(0,l.R1)(pt.uz)(e,t.cube))},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(t.cube.items,(r,i)=>((0,c.uX)(),(0,c.CE)("div",{key:r.data.id,class:"todoitem",style:(0,d.Tr)({"margin-left":r.indent*(0,l.R1)(n).data.line_indent+"px"})},[(0,c.Lk)("div",{class:(0,d.C4)(["todoitem-status",{active:r.done}]),onClick:()=>function(t,n){const r=cr.status(e.cube.id,n,!t.done),i=e.cube.courier.get_recorder();i.tell(e.cube,r),e.cube.history.record(i)}(r,i)},null,10,ur),(0,c.bF)(S,{class:"todoitem-box",cube:r.data,onKeydown:e=>function(e,t,n,r){const{courier:i,history:s,cursor:o}=t,{indent:a}=n,l=n.data;if(e.ctrlKey&&!e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=i.get_recorder(),o=t.create_item_data(a);n.tell(t,cr.add(t.id,[o],r+1)),s.record(n)}else if(e.ctrlKey&&e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=i.get_recorder(),o=t.create_item_data(a);n.tell(t,cr.add(t.id,[o],r)),s.record(n)}else if("Tab"!==e.key||e.shiftKey){if("Tab"===e.key&&e.shiftKey){e.stopPropagation(),e.preventDefault();const{cube_start:n,cube_end:r}=o,a=i.get_recorder();if(n&&r){const e=n.find_upstream_untill(t),i=r.find_upstream_untill(t);if(!e||!i)return;const o=t.items.slice(e.index,i.index+1),l=[];for(let e of o)l.push({id:e.data.id,indent:!1});a.tell(t,cr.indent(t.id,l)),s.record(a)}else{const e=[{id:l.id,indent:!1}];a.tell(t,cr.indent(t.id,e)),s.record(a)}}}else{e.stopPropagation(),e.preventDefault();const{cube_start:n,cube_end:r}=o,a=i.get_recorder();if(n&&r){const e=n.find_upstream_untill(t),i=r.find_upstream_untill(t);if(!e||!i)return;const o=t.items.slice(e.index,i.index+1),l=[];for(let e of o)l.push({id:e.data.id,indent:!0});a.tell(t,cr.indent(t.id,l)),s.record(a)}else{const e=[{id:l.id,indent:!0}];a.tell(t,cr.indent(t.id,e)),s.record(a)}}}(e,t.cube,r,i)},null,8,["cube","onKeydown"])],4))),128))],44,dr))}}),pr=(0,m.A)(hr,[["__scopeId","data-v-33222767"]]);function mr(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class fr extends o._D{_component=pr;items=(0,l.Kh)([]);get component(){return this._component}get children(){return[...this.items.map(e=>e.data)]}constructor(e,t){return super(e,t),this.setup(e,t)}get meta(){return fr.meta}get info(){return this.data.info}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}build_child(e){for(let t of e.info){let e=new Tt(t.data,this),n={done:t.done,indent:t.indent,data:(0,l.IG)(e)};this.items.push(n)}}export(){const e=this.base_export();e.info=[];for(let t of this.items)e.info.push({done:t.done,indent:t.indent,data:t.data.export()});return e}gc(){return super.base_gc()}copy(e,t){const n=super.base_export();n.info=[];const r=this.items.slice(e,t);for(let e of r)n.info.push({done:e.done,indent:e.indent,data:e.data.export()});return[n]}splice(e,t,...n){const r=this.items.splice(e,t,...n),i=[];for(let e of r)e.data.gc(),i.push({done:e.done,indent:e.indent,data:e.data.export()});return{children:r,data:i}}replace_id(e,t={}){return fr.replace_id(this.root,e,t)}create(e){const t=[];for(let n of e){let e=new Tt(n.data,this);t.push({done:n.done,indent:n.indent,data:e})}return t}create_item_data(e=0){return{done:!1,indent:e,data:Tt.get_default()}}add_item(e){const{data:t,pos:n}=e,{courier:r,pcube:i}=this,s=r.get_recorder();s.add_cmd(e);const a=this.get_valid_index(n),c=[];for(let e of t){const t=new Tt(e.data,this);let n={done:e.done,indent:e.indent,data:(0,l.IG)(t)};c.push(n)}this.splice(a,0,...c);const d=c[c.length-1]?.data;return d&&s.tell(d,o.UB.in_tail(d.id,void 0)),s.add_recover(cr.remove(this.id,[a,a+c.length])),s}remove_item(e){const{range:t}=e,{courier:n,pcube:r}=this,i=n.get_recorder();i.add_cmd(e);const[s,a]=t;if(s<=0&&a>=this.child_count)return this.remove_self();const l=t[1]-t[0],c=this.items[s-1]?.data,d=this.items[a+1]?.data,u=this.splice(s,l);return i.add_recover(cr.add(this.id,u.data,s)),c?i.tell(c,o.UB.in_tail(c.id,0,void 0)):d&&i.tell(d,o.UB.in_head(d.id,0,void 0)),i}indent_todoitem(e){const{items:t}=e,{courier:n}=this,r=n.get_recorder();r.add_cmd(e);const i=[];for(let e of t){let t=this.items.find(t=>t.data.id===e.id);t&&(t.indent=e.indent?t.indent+1:t.indent-1,t.indent<0&&(t.indent=0),i.push({id:e.id,indent:!e.indent}))}return r.add_recover(cr.indent(this.id,i)),r}update_status(e){const{courier:t}=this,{index:n,done:r}=e,i=t.get_recorder();i.add_cmd(e);const s=this.items[n];if(s)return s.done=r,i.add_recover(cr.status(this.id,n,!r)),i}on_delete_child(e){const{courier:t,pid:n,index:r,pcube:i}=this,{dir:s,range:o}=e,a=cr.remove(this.id,o);return this.remove_item(a)}static get_default(){let e=Tt.get_default();return{id:(0,s.Ak)(),type:a.u0.todo,info:[{done:!1,indent:0,data:e}],attrs:{},css:{}}}static get_todo_item(e,t=!1){const n=g.I.pick(e).sort;return{done:t,indent:0,data:Tt.get_default(n)}}static get meta(){return{cubename:"待办列表",type:a.u0.todo,block:!0,version:1,show:!0}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i;for(let r of t.info)r.data=Tt.replace_id(e,r.data,n);return t}}mr([(0,k.H)(a.Ny.add)],fr.prototype,"add_item",null),mr([(0,k.H)(a.Ny.remove)],fr.prototype,"remove_item",null),mr([(0,k.H)(a.Ny.indent)],fr.prototype,"indent_todoitem",null),mr([(0,k.H)(a.Ny.status)],fr.prototype,"update_status",null),mr([(0,k.H)(a.zS.cube_delete_child)],fr.prototype,"on_delete_child",null);var _r=n(3431);const gr=["id","data-type"],br=(0,c.pM)({__name:"cube-list",props:{cube:{}},setup(e){const{config:t}=e.cube;return(e,n)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-list",id:e.cube.id,style:(0,d.Tr)(e.cube.css),"data-type":(0,l.R1)(a.u0).list,onContextmenu:n[0]||(n[0]=t=>(0,l.R1)(pt.uz)(t,e.cube))},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.items,(r,i)=>((0,c.uX)(),(0,c.CE)("div",{key:r.data.id,class:"listitem",style:(0,d.Tr)({"margin-left":r.indent*(0,l.R1)(t).data.line_indent+"px"})},[n[1]||(n[1]=(0,c.Lk)("div",{class:"listitem-symbol"},null,-1)),(0,c.bF)(S,{class:"listitem-box",cube:r.data,onKeydown:t=>function(e,t,n,r){const{courier:i,history:s,cursor:o}=t,{data:a,indent:l}=n,c=a;if(e.ctrlKey&&!e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=i.get_recorder(),o=t.create_item_data(l);n.tell(t,_r.o.add(t.id,[o],r+1)),s.record(n)}else if(e.ctrlKey&&e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=i.get_recorder(),o=t.create_item_data(l);n.tell(t,_r.o.add(t.id,[o],r)),s.record(n)}else if("Tab"!==e.key||e.shiftKey){if("Tab"===e.key&&e.shiftKey){e.stopPropagation(),e.preventDefault();const{cube_start:n,cube_end:r}=o,a=i.get_recorder();if(n&&r){const e=n.find_upstream_untill(t),i=r.find_upstream_untill(t);if(!e||!i)return;const o=t.items.slice(e.index,i.index+1),l=[];for(let e of o)l.push({id:e.data.id,indent:!1});a.tell(t,_r.o.indent(t.id,l)),s.record(a)}else{const e=[{id:c.id,indent:!1}];a.tell(t,_r.o.indent(t.id,e)),s.record(a)}}}else{e.stopPropagation(),e.preventDefault();const{cube_start:n,cube_end:r}=o,a=i.get_recorder();if(n&&r){const e=n.find_upstream_untill(t),i=r.find_upstream_untill(t);if(!e||!i)return;const o=t.items.slice(e.index,i.index+1),l=[];for(let e of o)l.push({id:e.data.id,indent:!0});a.tell(t,_r.o.indent(t.id,l)),s.record(a)}else{const e=[{id:c.id,indent:!0}];a.tell(t,_r.o.indent(t.id,e)),s.record(a)}}}(t,e.cube,r,i)},null,8,["cube","onKeydown"])],4))),128))],44,gr))}}),yr=(0,m.A)(br,[["__scopeId","data-v-4c4b9f9c"]]);function vr(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class wr extends o._D{_component=yr;items=(0,l.Kh)([]);get component(){return this._component}get children(){return[...this.items.map(e=>e.data)]}constructor(e,t){return super(e,t),this.setup(e,t)}get meta(){return wr.meta}get info(){return this.data.info}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}build_child(e){for(let t of e.info){let e=new Tt(t.data,this),n={indent:t.indent,data:(0,l.IG)(e)};this.items.push(n)}}export(){const e=this.base_export();e.info=[];for(let t of this.items)e.info.push({indent:t.indent,data:t.data.export()});return e}gc(){return super.base_gc()}copy(e,t){const n=super.base_export();n.info=[];const r=this.items.slice(e,t);for(let e of r)n.info.push({indent:e.indent,data:e.data.export()});return[n]}splice(e,t,...n){const r=this.items.splice(e,t,...n),i=[];for(let e of r)e.data.gc(),i.push({indent:e.indent,data:e.data.export()});return{children:r,data:i}}replace_id(e,t={}){return wr.replace_id(this.root,e,t)}create(e){const t=[];for(let n of e){let e=new Tt(n.data,this);t.push({indent:n.indent,data:e})}return t}create_item_data(e=0){return{indent:e,data:Tt.get_default()}}add_item(e){const{data:t,pos:n}=e,{courier:r,pcube:i}=this,s=r.get_recorder();s.add_cmd(e);const a=this.get_valid_index(n),c=[];for(let e of t){const t=new Tt(e.data,this);let n={indent:e.indent,data:(0,l.IG)(t)};c.push(n)}this.splice(a,0,...c);const d=c[c.length-1]?.data;return d&&s.tell(d,o.UB.in_tail(d.id,void 0)),s.add_recover(_r.o.remove(this.id,[a,a+c.length])),s}remove_item(e){const{range:t}=e,{courier:n,pcube:r}=this,i=n.get_recorder();i.add_cmd(e);const[s,a]=t;if(0===s&&a>=this.child_count)return this.remove_self();const l=t[1]-t[0],c=this.items[s-1]?.data,d=this.items[a+1]?.data,u=this.splice(s,l);return i.add_recover(_r.o.add(this.id,u.data,s)),c?i.tell(c,o.UB.in_tail(c.id,0,void 0)):d&&i.tell(d,o.UB.in_head(d.id,0,void 0)),i}indent_item(e){const{items:t}=e,{courier:n}=this,r=n.get_recorder();r.add_cmd(e);const i=[];for(let e of t){let t=this.items.find(t=>t.data.id===e.id);t&&(t.indent=e.indent?t.indent+1:t.indent-1,t.indent<0&&(t.indent=0),i.push({id:e.id,indent:!e.indent}))}return r.add_recover(_r.o.indent(this.id,i)),r}on_delete_child(e){const{courier:t,pid:n,index:r,pcube:i}=this,{dir:s,range:o}=e,a=_r.o.remove(this.id,o);return this.remove_item(a)}static get_default(){let e=Tt.get_default();return{id:(0,s.Ak)(),type:a.u0.list,info:[{indent:0,data:e}],attrs:{},css:{}}}static get_list_item(e){return{indent:0,data:Tt.get_default(g.I.pick(e).sort)}}static get meta(){return{cubename:"列表",type:a.u0.list,block:!0,version:1,show:!0}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i;for(let r of t.info)r.data=Tt.replace_id(e,r.data,n);return t}}vr([(0,k.H)(a.JC.add)],wr.prototype,"add_item",null),vr([(0,k.H)(a.JC.remove)],wr.prototype,"remove_item",null),vr([(0,k.H)(a.JC.indent)],wr.prototype,"indent_item",null),vr([(0,k.H)(a.zS.cube_delete_child)],wr.prototype,"on_delete_child",null);class xr{static add(e,t,n){return{id:e,name:a.mM.add,data:t,pos:n}}static remove(e,t){return{id:e,name:a.mM.remove,range:t}}static indent(e,t){return{id:e,name:a.mM.indent,items:t}}}const kr=["id","data-type"],Sr={class:"listitem-symbol"},Cr=(0,c.pM)({__name:"cube-list-ordered",props:{cube:{}},setup(e){const{root:t}=e.cube,{config:n}=t;return(e,t)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-list-ordered",id:e.cube.id,style:(0,d.Tr)(e.cube.css),"data-type":(0,l.R1)(a.u0).list_ordered,onContextmenu:t[0]||(t[0]=t=>(0,l.R1)(pt.uz)(t,e.cube))},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.items,(t,r)=>((0,c.uX)(),(0,c.CE)("div",{key:t.data.id,class:"listitem",style:(0,d.Tr)({"margin-left":t.indent*(0,l.R1)(n).data.line_indent+"px"})},[(0,c.Lk)("div",Sr,(0,d.v_)(r+1),1),(0,c.bF)(S,{class:"listitem-box",cube:t.data,onKeydown:n=>function(e,t,n,r){const{courier:i,history:s,cursor:o}=t,{data:a,indent:l}=n,c=a;if(e.ctrlKey&&!e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=i.get_recorder(),o=t.create_item_data(l);n.tell(t,xr.add(t.id,[o],r+1)),s.record(n)}else if(e.ctrlKey&&e.shiftKey&&"Enter"===e.key){e.stopPropagation();const n=i.get_recorder(),o=t.create_item_data(l);n.tell(t,xr.add(t.id,[o],r)),s.record(n)}else if("Tab"!==e.key||e.shiftKey){if("Tab"===e.key&&e.shiftKey){e.stopPropagation(),e.preventDefault();const{cube_start:n,cube_end:r}=o,a=i.get_recorder();if(n&&r){const e=n.find_upstream_untill(t),i=r.find_upstream_untill(t);if(!e||!i)return;const o=t.items.slice(e.index,i.index+1),l=[];for(let e of o)l.push({id:e.data.id,indent:!1});a.tell(t,xr.indent(t.id,l)),s.record(a)}else{const e=[{id:c.id,indent:!1}];a.tell(t,xr.indent(t.id,e)),s.record(a)}}}else{e.stopPropagation(),e.preventDefault();const{cube_start:n,cube_end:r}=o,a=i.get_recorder();if(n&&r){const e=n.find_upstream_untill(t),i=r.find_upstream_untill(t);if(!e||!i)return;const o=t.items.slice(e.index,i.index+1),l=[];for(let e of o)l.push({id:e.data.id,indent:!0});a.tell(t,xr.indent(t.id,l)),s.record(a)}else{const e=[{id:c.id,indent:!0}];a.tell(t,xr.indent(t.id,e)),s.record(a)}}}(n,e.cube,t,r)},null,8,["cube","onKeydown"])],4))),128))],44,kr))}}),Mr=(0,m.A)(Cr,[["__scopeId","data-v-743fd90a"]]);function Lr(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class Tr extends o._D{items=(0,l.Kh)([]);get component(){return Mr}get children(){return[...this.items.map(e=>e.data)]}constructor(e,t){return super(e,t),this.setup(e,t)}get meta(){return Tr.meta}get info(){return this.data.info}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}build_child(e){for(let t of e.info){let e=new Tt(t.data,this),n={indent:t.indent,data:(0,l.IG)(e)};this.items.push(n)}}export(){const e=super.base_export();e.info=[];for(let t of this.items)e.info.push({indent:t.indent,data:t.data.export()});return e}gc(){return super.base_gc()}copy(e,t){const n=super.base_export();n.info=[];const r=this.items.slice(e,t);for(let e of r)n.info.push({indent:e.indent,data:e.data.export()});return[n]}splice(e,t,...n){const r=this.items.splice(e,t,...n),i=[];for(let e of r)e.data.gc(),i.push({indent:e.indent,data:e.data.export()});return{children:r,data:i}}replace_id(e,t={}){return Tr.replace_id(this.root,e,t)}create(e){const t=[];for(let n of e){let e=new Tt(n.data,this);t.push({indent:n.indent,data:e})}return t}create_item_data(e=0){return{indent:e,data:Tt.get_default()}}add_item(e){const{data:t,pos:n}=e,{courier:r,pcube:i}=this,s=r.get_recorder();s.add_cmd(e);const a=this.get_valid_index(n),c=[];for(let e of t){const t=new Tt(e.data,this);let n={indent:e.indent,data:(0,l.IG)(t)};c.push(n)}this.splice(a,0,...c);const d=c[c.length-1]?.data;return d&&s.tell(d,o.UB.in_tail(d.id,void 0)),s.add_recover(xr.remove(this.id,[a,a+c.length])),s}remove_item(e){const{range:t}=e,{courier:n,pcube:r}=this,i=n.get_recorder();i.add_cmd(e);const[s,a]=t;if(0===s&&a>=this.child_count)return this.remove_self();const l=t[1]-t[0],c=this.items[s-1]?.data,d=this.items[a+1]?.data,u=this.splice(s,l);return i.add_recover(xr.add(this.id,u.data,s)),c?i.tell(c,o.UB.in_tail(c.id,0,void 0)):d&&i.tell(d,o.UB.in_head(d.id,0,void 0)),i}indent_item(e){const{items:t}=e,{courier:n}=this,r=n.get_recorder();r.add_cmd(e);const i=[];for(let e of t){let t=this.items.find(t=>t.data.id===e.id);t&&(t.indent=e.indent?t.indent+1:t.indent-1,t.indent<0&&(t.indent=0),i.push({id:e.id,indent:!e.indent}))}return r.add_recover(xr.indent(this.id,i)),r}on_delete_child(e){const{courier:t,pid:n,index:r,pcube:i}=this,{dir:s,range:o}=e,a=xr.remove(this.id,o);return this.remove_item(a)}static get_default(){let e=Tt.get_default();return{id:g.I.get_id(),type:a.u0.list_ordered,info:[{indent:0,data:e}],attrs:{},css:{}}}static get_list_item(e){return{indent:0,data:Tt.get_default(g.I.pick(e).sort)}}static get meta(){return{cubename:"有序列表",type:a.u0.list_ordered,block:!0,version:1,show:!0}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i;for(let r of t.info)r.data=Tt.replace_id(e,r.data,n);return t}}Lr([(0,k.H)(a.mM.add)],Tr.prototype,"add_item",null),Lr([(0,k.H)(a.mM.remove)],Tr.prototype,"remove_item",null),Lr([(0,k.H)(a.mM.indent)],Tr.prototype,"indent_item",null),Lr([(0,k.H)(a.zS.cube_delete_child)],Tr.prototype,"on_delete_child",null);class zr{static update(e,t,n){return{id:e,name:a.GW.code_update,code:n,tabid:t}}static add(e,t,n=!0){return{id:e,name:a.GW.code_add,item:(0,l.ux)(t),focus:n}}static remove(e,t){return{id:e,name:a.GW.code_remove,tabid:t}}static rename(e,t,n){return{id:e,name:a.GW.code_rename,tabid:t,filename:n}}static change_lang(e,t,n){return{id:e,name:a.GW.change_lang,tabid:t,lang:n}}static change_active(e,t){return{id:e,name:a.GW.change_active,tabid:t}}static change_theme(e,t,n){return{id:e,tabid:t,theme:n,name:a.GW.change_theme}}}const Ar=[{id:"abap",name:"ABAP",import:()=>n.e(8617).then(n.bind(n,8617))},{id:"actionscript-3",name:"ActionScript",import:()=>n.e(3516).then(n.bind(n,3516))},{id:"ada",name:"Ada",import:()=>n.e(7561).then(n.bind(n,7561))},{id:"angular-html",name:"Angular HTML",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(535)]).then(n.bind(n,535))},{id:"angular-ts",name:"Angular TypeScript",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(7611),n.e(535),n.e(4886)]).then(n.bind(n,4886))},{id:"apache",name:"Apache Conf",import:()=>n.e(7625).then(n.bind(n,7625))},{id:"apex",name:"Apex",import:()=>n.e(9819).then(n.bind(n,9819))},{id:"apl",name:"APL",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(6967),n.e(7504)]).then(n.bind(n,7504))},{id:"applescript",name:"AppleScript",import:()=>n.e(2108).then(n.bind(n,2108))},{id:"ara",name:"Ara",import:()=>n.e(5611).then(n.bind(n,5611))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:()=>n.e(4354).then(n.bind(n,4354))},{id:"asm",name:"Assembly",import:()=>n.e(6324).then(n.bind(n,6324))},{id:"astro",name:"Astro",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4714),n.e(6940),n.e(4408)]).then(n.bind(n,4408))},{id:"awk",name:"AWK",import:()=>n.e(4862).then(n.bind(n,4862))},{id:"ballerina",name:"Ballerina",import:()=>n.e(5141).then(n.bind(n,5141))},{id:"bat",name:"Batch File",aliases:["batch"],import:()=>n.e(2068).then(n.bind(n,2068))},{id:"beancount",name:"Beancount",import:()=>n.e(5026).then(n.bind(n,5026))},{id:"berry",name:"Berry",aliases:["be"],import:()=>n.e(8753).then(n.bind(n,8753))},{id:"bibtex",name:"BibTeX",import:()=>n.e(4009).then(n.bind(n,4009))},{id:"bicep",name:"Bicep",import:()=>n.e(7688).then(n.bind(n,7688))},{id:"blade",name:"Blade",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(6967),n.e(1230),n.e(5283)]).then(n.bind(n,5283))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:()=>n.e(5314).then(n.bind(n,5314))},{id:"c",name:"C",import:()=>n.e(5814).then(n.bind(n,5814))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:()=>n.e(5728).then(n.bind(n,5728))},{id:"cairo",name:"Cairo",import:()=>Promise.all([n.e(2473),n.e(8237)]).then(n.bind(n,8237))},{id:"clarity",name:"Clarity",import:()=>n.e(6677).then(n.bind(n,6677))},{id:"clojure",name:"Clojure",aliases:["clj"],import:()=>n.e(7681).then(n.bind(n,7681))},{id:"cmake",name:"CMake",import:()=>n.e(5936).then(n.bind(n,5936))},{id:"cobol",name:"COBOL",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(6967),n.e(780)]).then(n.bind(n,780))},{id:"codeowners",name:"CODEOWNERS",import:()=>n.e(9096).then(n.bind(n,9096))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:()=>n.e(6283).then(n.bind(n,6283))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:()=>Promise.all([n.e(7258),n.e(6563)]).then(n.bind(n,6563))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:()=>n.e(489).then(n.bind(n,489))},{id:"coq",name:"Coq",import:()=>n.e(8418).then(n.bind(n,8418))},{id:"cpp",name:"C++",aliases:["c++"],import:()=>Promise.all([n.e(1230),n.e(5814),n.e(4914)]).then(n.bind(n,4914))},{id:"crystal",name:"Crystal",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(1230),n.e(5814),n.e(3894),n.e(3403)]).then(n.bind(n,3403))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:()=>n.e(2354).then(n.bind(n,2354))},{id:"css",name:"CSS",import:()=>n.e(1708).then(n.bind(n,1708))},{id:"csv",name:"CSV",import:()=>n.e(8849).then(n.bind(n,1230))},{id:"cue",name:"CUE",import:()=>n.e(172).then(n.bind(n,172))},{id:"cypher",name:"Cypher",aliases:["cql"],import:()=>n.e(9806).then(n.bind(n,9806))},{id:"d",name:"D",import:()=>n.e(5177).then(n.bind(n,5177))},{id:"dart",name:"Dart",import:()=>n.e(9728).then(n.bind(n,9728))},{id:"dax",name:"DAX",import:()=>n.e(874).then(n.bind(n,874))},{id:"desktop",name:"Desktop",import:()=>n.e(6173).then(n.bind(n,6173))},{id:"diff",name:"Diff",import:()=>n.e(7670).then(n.bind(n,7670))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:()=>n.e(415).then(n.bind(n,415))},{id:"dotenv",name:"dotEnv",import:()=>n.e(2173).then(n.bind(n,2173))},{id:"dream-maker",name:"Dream Maker",import:()=>n.e(3227).then(n.bind(n,3227))},{id:"edge",name:"Edge",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(4714),n.e(3052)]).then(n.bind(n,3052))},{id:"elixir",name:"Elixir",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(3330)]).then(n.bind(n,3330))},{id:"elm",name:"Elm",import:()=>Promise.all([n.e(5814),n.e(9641)]).then(n.bind(n,9641))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:()=>n.e(2505).then(n.bind(n,2505))},{id:"erb",name:"ERB",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(4714),n.e(6967),n.e(1230),n.e(5814),n.e(3894),n.e(6940),n.e(6262),n.e(4914),n.e(3170),n.e(4007),n.e(9524)]).then(n.bind(n,9524))},{id:"erlang",name:"Erlang",aliases:["erl"],import:()=>Promise.all([n.e(7900),n.e(2266)]).then(n.bind(n,2266))},{id:"fennel",name:"Fennel",import:()=>n.e(1631).then(n.bind(n,1631))},{id:"fish",name:"Fish",import:()=>n.e(9661).then(n.bind(n,9661))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:()=>n.e(9077).then(n.bind(n,9077))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:()=>Promise.all([n.e(8553),n.e(7549)]).then(n.bind(n,7549))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:()=>n.e(8553).then(n.bind(n,8553))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:()=>Promise.all([n.e(7900),n.e(9689)]).then(n.bind(n,9689))},{id:"gdresource",name:"GDResource",import:()=>n.e(7434).then(n.bind(n,7434))},{id:"gdscript",name:"GDScript",import:()=>n.e(4311).then(n.bind(n,4311))},{id:"gdshader",name:"GDShader",import:()=>n.e(6405).then(n.bind(n,6405))},{id:"genie",name:"Genie",import:()=>n.e(9017).then(n.bind(n,9017))},{id:"gherkin",name:"Gherkin",import:()=>n.e(4451).then(n.bind(n,4451))},{id:"git-commit",name:"Git Commit Message",import:()=>n.e(2861).then(n.bind(n,2861))},{id:"git-rebase",name:"Git Rebase Message",import:()=>Promise.all([n.e(3894),n.e(638)]).then(n.bind(n,638))},{id:"gleam",name:"Gleam",import:()=>n.e(8201).then(n.bind(n,8201))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(4714),n.e(8700)]).then(n.bind(n,8700))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(4714),n.e(5050)]).then(n.bind(n,5050))},{id:"glsl",name:"GLSL",import:()=>Promise.all([n.e(5814),n.e(2723)]).then(n.bind(n,2723))},{id:"gnuplot",name:"Gnuplot",import:()=>n.e(396).then(n.bind(n,396))},{id:"go",name:"Go",import:()=>n.e(3941).then(n.bind(n,3941))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:()=>Promise.all([n.e(7258),n.e(4714),n.e(6940),n.e(6262),n.e(3170)]).then(n.bind(n,3170))},{id:"groovy",name:"Groovy",import:()=>n.e(1037).then(n.bind(n,1037))},{id:"hack",name:"Hack",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(1230),n.e(6356)]).then(n.bind(n,6356))},{id:"haml",name:"Ruby Haml",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(3949)]).then(n.bind(n,3949))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(1655)]).then(n.bind(n,1655))},{id:"haskell",name:"Haskell",aliases:["hs"],import:()=>n.e(9045).then(n.bind(n,9045))},{id:"haxe",name:"Haxe",import:()=>n.e(8107).then(n.bind(n,8107))},{id:"hcl",name:"HashiCorp HCL",import:()=>n.e(6124).then(n.bind(n,6124))},{id:"hjson",name:"Hjson",import:()=>n.e(5203).then(n.bind(n,5203))},{id:"hlsl",name:"HLSL",import:()=>n.e(4598).then(n.bind(n,4598))},{id:"html",name:"HTML",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940)]).then(n.bind(n,4940))},{id:"html-derivative",name:"HTML (Derivative)",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(914)]).then(n.bind(n,914))},{id:"http",name:"HTTP",import:()=>Promise.all([n.e(7258),n.e(4714),n.e(6967),n.e(3894),n.e(6940),n.e(6262),n.e(3170),n.e(5119)]).then(n.bind(n,5119))},{id:"hxml",name:"HXML",import:()=>n.e(8320).then(n.bind(n,8320))},{id:"hy",name:"Hy",import:()=>n.e(7470).then(n.bind(n,7470))},{id:"imba",name:"Imba",import:()=>n.e(3702).then(n.bind(n,3702))},{id:"ini",name:"INI",aliases:["properties"],import:()=>n.e(6343).then(n.bind(n,6343))},{id:"java",name:"Java",import:()=>n.e(6967).then(n.bind(n,6967))},{id:"javascript",name:"JavaScript",aliases:["js"],import:()=>n.e(7258).then(n.bind(n,7258))},{id:"jinja",name:"Jinja",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(3837)]).then(n.bind(n,3837))},{id:"jison",name:"Jison",import:()=>Promise.all([n.e(7258),n.e(5536)]).then(n.bind(n,5536))},{id:"json",name:"JSON",import:()=>n.e(5709).then(n.bind(n,5709))},{id:"json5",name:"JSON5",import:()=>n.e(6010).then(n.bind(n,6010))},{id:"jsonc",name:"JSON with Comments",import:()=>n.e(212).then(n.bind(n,212))},{id:"jsonl",name:"JSON Lines",import:()=>n.e(4843).then(n.bind(n,4843))},{id:"jsonnet",name:"Jsonnet",import:()=>n.e(4962).then(n.bind(n,4962))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:()=>n.e(7922).then(n.bind(n,7922))},{id:"jsx",name:"JSX",import:()=>n.e(6262).then(n.bind(n,6262))},{id:"julia",name:"Julia",aliases:["jl"],import:()=>Promise.all([n.e(7258),n.e(1230),n.e(5814),n.e(4914),n.e(2473),n.e(9983),n.e(9910)]).then(n.bind(n,9910))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:()=>n.e(2660).then(n.bind(n,2660))},{id:"kusto",name:"Kusto",aliases:["kql"],import:()=>n.e(6297).then(n.bind(n,6297))},{id:"latex",name:"LaTeX",import:()=>Promise.all([n.e(9983),n.e(7817)]).then(n.bind(n,7817))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:()=>n.e(8003).then(n.bind(n,8003))},{id:"less",name:"Less",import:()=>n.e(6964).then(n.bind(n,6964))},{id:"liquid",name:"Liquid",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(327)]).then(n.bind(n,327))},{id:"llvm",name:"LLVM IR",import:()=>n.e(3972).then(n.bind(n,1591))},{id:"log",name:"Log file",import:()=>n.e(3247).then(n.bind(n,3247))},{id:"logo",name:"Logo",import:()=>n.e(9730).then(n.bind(n,9730))},{id:"lua",name:"Lua",import:()=>Promise.all([n.e(5814),n.e(4199)]).then(n.bind(n,4199))},{id:"luau",name:"Luau",import:()=>n.e(5744).then(n.bind(n,5744))},{id:"make",name:"Makefile",aliases:["makefile"],import:()=>n.e(1757).then(n.bind(n,1757))},{id:"markdown",name:"Markdown",aliases:["md"],import:()=>n.e(7900).then(n.bind(n,7900))},{id:"marko",name:"Marko",import:()=>Promise.all([n.e(1708),n.e(4714),n.e(7611),n.e(6964),n.e(9175)]).then(n.bind(n,9175))},{id:"matlab",name:"MATLAB",import:()=>n.e(2492).then(n.bind(n,2492))},{id:"mdc",name:"MDC",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(7900),n.e(2215)]).then(n.bind(n,2215))},{id:"mdx",name:"MDX",import:()=>n.e(4452).then(n.bind(n,4452))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:()=>n.e(2860).then(n.bind(n,2860))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:()=>n.e(8499).then(n.bind(n,8499))},{id:"mojo",name:"Mojo",import:()=>n.e(9526).then(n.bind(n,9526))},{id:"move",name:"Move",import:()=>n.e(9104).then(n.bind(n,9104))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:()=>n.e(6239).then(n.bind(n,6239))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:()=>n.e(9876).then(n.bind(n,9876))},{id:"nginx",name:"Nginx",import:()=>Promise.all([n.e(5814),n.e(697)]).then(n.bind(n,697))},{id:"nim",name:"Nim",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(6967),n.e(5814),n.e(7900),n.e(4697)]).then(n.bind(n,4697))},{id:"nix",name:"Nix",import:()=>n.e(8212).then(n.bind(n,8212))},{id:"nushell",name:"nushell",aliases:["nu"],import:()=>n.e(7374).then(n.bind(n,7374))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:()=>n.e(7148).then(n.bind(n,7148))},{id:"objective-cpp",name:"Objective-C++",import:()=>n.e(9788).then(n.bind(n,7407))},{id:"ocaml",name:"OCaml",import:()=>n.e(9057).then(n.bind(n,9057))},{id:"pascal",name:"Pascal",import:()=>n.e(9079).then(n.bind(n,9079))},{id:"perl",name:"Perl",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(6967),n.e(1230),n.e(9984)]).then(n.bind(n,9984))},{id:"php",name:"PHP",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(6967),n.e(1230),n.e(7765),n.e(7966)]).then(n.bind(n,7765))},{id:"plsql",name:"PL/SQL",import:()=>n.e(8389).then(n.bind(n,8389))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:()=>n.e(4520).then(n.bind(n,4520))},{id:"polar",name:"Polar",import:()=>n.e(9845).then(n.bind(n,9845))},{id:"postcss",name:"PostCSS",import:()=>n.e(9270).then(n.bind(n,9270))},{id:"powerquery",name:"PowerQuery",import:()=>n.e(454).then(n.bind(n,454))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:()=>n.e(1476).then(n.bind(n,1476))},{id:"prisma",name:"Prisma",import:()=>n.e(5731).then(n.bind(n,5731))},{id:"prolog",name:"Prolog",import:()=>n.e(9206).then(n.bind(n,9206))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:()=>n.e(5891).then(n.bind(n,5891))},{id:"pug",name:"Pug",aliases:["jade"],import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(6757)]).then(n.bind(n,6757))},{id:"puppet",name:"Puppet",import:()=>n.e(3593).then(n.bind(n,3593))},{id:"purescript",name:"PureScript",import:()=>n.e(9904).then(n.bind(n,9904))},{id:"python",name:"Python",aliases:["py"],import:()=>n.e(2473).then(n.bind(n,2473))},{id:"qml",name:"QML",import:()=>Promise.all([n.e(7258),n.e(1803)]).then(n.bind(n,1803))},{id:"qmldir",name:"QML Directory",import:()=>n.e(4292).then(n.bind(n,4292))},{id:"qss",name:"Qt Style Sheets",import:()=>n.e(402).then(n.bind(n,402))},{id:"r",name:"R",import:()=>n.e(9983).then(n.bind(n,9983))},{id:"racket",name:"Racket",import:()=>n.e(9281).then(n.bind(n,9281))},{id:"raku",name:"Raku",aliases:["perl6"],import:()=>n.e(9780).then(n.bind(n,9780))},{id:"razor",name:"ASP.NET Razor",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(2354),n.e(245)]).then(n.bind(n,245))},{id:"reg",name:"Windows Registry Script",import:()=>n.e(5827).then(n.bind(n,5827))},{id:"regexp",name:"RegExp",aliases:["regex"],import:()=>n.e(3124).then(n.bind(n,3124))},{id:"rel",name:"Rel",import:()=>n.e(3043).then(n.bind(n,5424))},{id:"riscv",name:"RISC-V",import:()=>n.e(8684).then(n.bind(n,8684))},{id:"rst",name:"reStructuredText",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(4714),n.e(6967),n.e(1230),n.e(5814),n.e(3894),n.e(6940),n.e(6262),n.e(4914),n.e(3170),n.e(2473),n.e(4007),n.e(8234)]).then(n.bind(n,8234))},{id:"ruby",name:"Ruby",aliases:["rb"],import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(4714),n.e(6967),n.e(1230),n.e(5814),n.e(3894),n.e(6940),n.e(6262),n.e(4914),n.e(3170),n.e(4007)]).then(n.bind(n,4007))},{id:"rust",name:"Rust",aliases:["rs"],import:()=>n.e(7145).then(n.bind(n,7145))},{id:"sas",name:"SAS",import:()=>Promise.all([n.e(1230),n.e(9478)]).then(n.bind(n,9478))},{id:"sass",name:"Sass",import:()=>n.e(8709).then(n.bind(n,8709))},{id:"scala",name:"Scala",import:()=>n.e(3947).then(n.bind(n,3947))},{id:"scheme",name:"Scheme",import:()=>n.e(9982).then(n.bind(n,9982))},{id:"scss",name:"SCSS",import:()=>Promise.all([n.e(1708),n.e(7611)]).then(n.bind(n,7611))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:()=>n.e(1624).then(n.bind(n,1624))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:()=>n.e(8249).then(n.bind(n,8249))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:()=>n.e(3894).then(n.bind(n,3894))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:()=>Promise.all([n.e(3894),n.e(9965)]).then(n.bind(n,9965))},{id:"smalltalk",name:"Smalltalk",import:()=>n.e(1066).then(n.bind(n,1066))},{id:"solidity",name:"Solidity",import:()=>n.e(4780).then(n.bind(n,4780))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(7642)]).then(n.bind(n,7642))},{id:"sparql",name:"SPARQL",import:()=>n.e(4108).then(n.bind(n,4108))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:()=>n.e(6514).then(n.bind(n,6514))},{id:"sql",name:"SQL",import:()=>n.e(1230).then(n.bind(n,8849))},{id:"ssh-config",name:"SSH Config",import:()=>n.e(3874).then(n.bind(n,3874))},{id:"stata",name:"Stata",import:()=>Promise.all([n.e(1230),n.e(542)]).then(n.bind(n,542))},{id:"stylus",name:"Stylus",aliases:["styl"],import:()=>n.e(41).then(n.bind(n,41))},{id:"svelte",name:"Svelte",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4714),n.e(3454)]).then(n.bind(n,3454))},{id:"swift",name:"Swift",import:()=>n.e(8436).then(n.bind(n,8436))},{id:"system-verilog",name:"SystemVerilog",import:()=>n.e(6577).then(n.bind(n,6577))},{id:"systemd",name:"Systemd Units",import:()=>n.e(16).then(n.bind(n,16))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:()=>n.e(4660).then(n.bind(n,4660))},{id:"tasl",name:"Tasl",import:()=>n.e(1839).then(n.bind(n,1839))},{id:"tcl",name:"Tcl",import:()=>n.e(7328).then(n.bind(n,7328))},{id:"templ",name:"Templ",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(3941),n.e(7095)]).then(n.bind(n,7095))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:()=>n.e(4385).then(n.bind(n,4385))},{id:"tex",name:"TeX",import:()=>Promise.all([n.e(9983),n.e(9198)]).then(n.bind(n,9198))},{id:"toml",name:"TOML",import:()=>n.e(5363).then(n.bind(n,5363))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(4714),n.e(6967),n.e(1230),n.e(5814),n.e(9556)]).then(n.bind(n,9556))},{id:"tsv",name:"TSV",import:()=>n.e(6045).then(n.bind(n,8426))},{id:"tsx",name:"TSX",import:()=>n.e(6940).then(n.bind(n,6940))},{id:"turtle",name:"Turtle",import:()=>n.e(4877).then(n.bind(n,4877))},{id:"twig",name:"Twig",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(4714),n.e(6967),n.e(1230),n.e(5814),n.e(3894),n.e(6940),n.e(6262),n.e(4914),n.e(3170),n.e(2473),n.e(7611),n.e(4007),n.e(7765),n.e(4236)]).then(n.bind(n,4236))},{id:"typescript",name:"TypeScript",aliases:["ts"],import:()=>n.e(4714).then(n.bind(n,4714))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:()=>n.e(794).then(n.bind(n,794))},{id:"typst",name:"Typst",aliases:["typ"],import:()=>n.e(8711).then(n.bind(n,8711))},{id:"v",name:"V",import:()=>n.e(5443).then(n.bind(n,5443))},{id:"vala",name:"Vala",import:()=>n.e(7141).then(n.bind(n,7141))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:()=>n.e(8235).then(n.bind(n,8235))},{id:"verilog",name:"Verilog",import:()=>n.e(4283).then(n.bind(n,4283))},{id:"vhdl",name:"VHDL",import:()=>n.e(5521).then(n.bind(n,5521))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:()=>n.e(7567).then(n.bind(n,7567))},{id:"vue",name:"Vue",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(4714),n.e(1432)]).then(n.bind(n,1432))},{id:"vue-html",name:"Vue HTML",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(4714),n.e(1432),n.e(7789)]).then(n.bind(n,7789))},{id:"vue-vine",name:"Vue Vine",import:()=>Promise.all([n.e(7258),n.e(1708),n.e(4940),n.e(4714),n.e(7611),n.e(6964),n.e(1432),n.e(41),n.e(5954)]).then(n.bind(n,5954))},{id:"vyper",name:"Vyper",aliases:["vy"],import:()=>n.e(845).then(n.bind(n,845))},{id:"wasm",name:"WebAssembly",import:()=>n.e(7615).then(n.bind(n,7615))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:()=>n.e(8393).then(n.bind(n,8393))},{id:"wgsl",name:"WGSL",import:()=>n.e(5884).then(n.bind(n,5884))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:()=>n.e(2062).then(n.bind(n,2062))},{id:"wit",name:"WebAssembly Interface Types",import:()=>n.e(6957).then(n.bind(n,6957))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:()=>n.e(5589).then(n.bind(n,5589))},{id:"xml",name:"XML",import:()=>Promise.all([n.e(6967),n.e(5585)]).then(n.bind(n,7966))},{id:"xsl",name:"XSL",import:()=>Promise.all([n.e(6967),n.e(5628)]).then(n.bind(n,5628))},{id:"yaml",name:"YAML",aliases:["yml"],import:()=>n.e(4546).then(n.bind(n,4546))},{id:"zenscript",name:"ZenScript",import:()=>n.e(5099).then(n.bind(n,5099))},{id:"zig",name:"Zig",import:()=>n.e(3279).then(n.bind(n,3279))}],Rr=Object.fromEntries(Ar.map(e=>[e.id,e.import])),Pr=Object.fromEntries(Ar.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),Nr={...Rr,...Pr},Er=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:()=>n.e(2691).then(n.bind(n,2691))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:()=>n.e(7768).then(n.bind(n,7768))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:()=>n.e(7927).then(n.bind(n,7927))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:()=>n.e(1216).then(n.bind(n,1216))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:()=>n.e(7788).then(n.bind(n,7788))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:()=>n.e(2071).then(n.bind(n,2071))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:()=>n.e(9692).then(n.bind(n,9692))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:()=>n.e(3032).then(n.bind(n,3032))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:()=>n.e(8485).then(n.bind(n,8485))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:()=>n.e(284).then(n.bind(n,284))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:()=>n.e(1545).then(n.bind(n,1545))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:()=>n.e(6083).then(n.bind(n,6083))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:()=>n.e(5647).then(n.bind(n,5647))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:()=>n.e(9179).then(n.bind(n,9179))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:()=>n.e(9976).then(n.bind(n,9976))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:()=>n.e(9831).then(n.bind(n,9831))},{id:"github-light",displayName:"GitHub Light",type:"light",import:()=>n.e(9809).then(n.bind(n,9809))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:()=>n.e(9681).then(n.bind(n,9681))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:()=>n.e(1425).then(n.bind(n,1425))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:()=>n.e(6865).then(n.bind(n,6865))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:()=>n.e(7824).then(n.bind(n,7824))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:()=>n.e(3646).then(n.bind(n,3646))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:()=>n.e(2419).then(n.bind(n,2419))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:()=>n.e(9225).then(n.bind(n,9225))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:()=>n.e(4112).then(n.bind(n,4112))},{id:"houston",displayName:"Houston",type:"dark",import:()=>n.e(8931).then(n.bind(n,8931))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:()=>n.e(2184).then(n.bind(n,2184))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:()=>n.e(2142).then(n.bind(n,2142))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:()=>n.e(5638).then(n.bind(n,5638))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:()=>n.e(7831).then(n.bind(n,7831))},{id:"light-plus",displayName:"Light Plus",type:"light",import:()=>n.e(8426).then(n.bind(n,6045))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:()=>n.e(3492).then(n.bind(n,3492))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:()=>n.e(3720).then(n.bind(n,3720))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:()=>n.e(9294).then(n.bind(n,9294))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:()=>n.e(4081).then(n.bind(n,4081))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:()=>n.e(1729).then(n.bind(n,1729))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:()=>n.e(4614).then(n.bind(n,4614))},{id:"min-light",displayName:"Min Light",type:"light",import:()=>n.e(2934).then(n.bind(n,2934))},{id:"monokai",displayName:"Monokai",type:"dark",import:()=>n.e(2535).then(n.bind(n,2535))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:()=>n.e(4214).then(n.bind(n,4214))},{id:"nord",displayName:"Nord",type:"dark",import:()=>n.e(4552).then(n.bind(n,4552))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:()=>n.e(6736).then(n.bind(n,6736))},{id:"one-light",displayName:"One Light",type:"light",import:()=>n.e(3906).then(n.bind(n,3906))},{id:"plastic",displayName:"Plastic",type:"dark",import:()=>n.e(4445).then(n.bind(n,4445))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:()=>n.e(4465).then(n.bind(n,4465))},{id:"red",displayName:"Red",type:"dark",import:()=>n.e(6980).then(n.bind(n,6980))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:()=>n.e(753).then(n.bind(n,753))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:()=>n.e(5424).then(n.bind(n,3043))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:()=>n.e(8093).then(n.bind(n,8093))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:()=>n.e(4838).then(n.bind(n,4838))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:()=>n.e(5601).then(n.bind(n,5601))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:()=>n.e(1857).then(n.bind(n,1857))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:()=>n.e(7217).then(n.bind(n,7217))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:()=>n.e(1931).then(n.bind(n,1931))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:()=>n.e(321).then(n.bind(n,321))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:()=>n.e(5034).then(n.bind(n,5034))},{id:"vesper",displayName:"Vesper",type:"dark",import:()=>n.e(224).then(n.bind(n,224))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:()=>n.e(5542).then(n.bind(n,5542))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:()=>n.e(6517).then(n.bind(n,8898))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:()=>n.e(5143).then(n.bind(n,5143))}],Or=Object.fromEntries(Er.map(e=>[e.id,e.import]));class Ir extends Error{constructor(e){super(e),this.name="ShikiError"}}function Br(e){return Array.isArray(e)?function(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=Br(e[n]);return t}(e):e instanceof RegExp?e:"object"==typeof e?function(e){let t={};for(let n in e)t[n]=Br(e[n]);return t}(e):e}function Dr(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function Vr(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return 0===t?e:~t===e.length-1?Vr(e.substring(0,e.length-1)):e.substr(1+~t)}var Hr=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,jr=class{static hasCaptures(e){return null!==e&&(Hr.lastIndex=0,Hr.test(e))}static replaceCaptures(e,t,n){return e.replace(Hr,(e,r,i,s)=>{let o=n[parseInt(r||i,10)];if(!o)return e;{let e=t.substring(o.start,o.end);for(;"."===e[0];)e=e.substring(1);switch(s){case"downcase":return e.toLowerCase();case"upcase":return e.toUpperCase();default:return e}}})}};function Fr(e,t){return e<t?-1:e>t?1:0}function Ur(e,t){if(null===e&&null===t)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=Fr(e[r],t[r]);if(0!==n)return n}return 0}return n-r}function qr(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function $r(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var Gr=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},Xr=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(function(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i,s=t[e];if(!s.settings)continue;if("string"==typeof s.scope){let e=s.scope;e=e.replace(/^[,]+/,""),e=e.replace(/[,]+$/,""),i=e.split(",")}else i=Array.isArray(s.scope)?s.scope:[""];let o=-1;if("string"==typeof s.settings.fontStyle){o=0;let e=s.settings.fontStyle.split(" ");for(let t=0,n=e.length;t<n;t++)switch(e[t]){case"italic":o|=1;break;case"bold":o|=2;break;case"underline":o|=4;break;case"strikethrough":o|=8}}let a=null;"string"==typeof s.settings.foreground&&qr(s.settings.foreground)&&(a=s.settings.foreground);let l=null;"string"==typeof s.settings.background&&qr(s.settings.background)&&(l=s.settings.background);for(let t=0,s=i.length;t<s;t++){let s=i[t].trim().split(" "),c=s[s.length-1],d=null;s.length>1&&(d=s.slice(0,s.length-1),d.reverse()),n[r++]=new Zr(c,d,e,o,a,l)}}return n}(e),t)}static createFromParsedTheme(e,t){return function(e,t){e.sort((e,t)=>{let n=Fr(e.scope,t.scope);return 0!==n?n:(n=Ur(e.parentScopes,t.parentScopes),0!==n?n:e.index-t.index)});let n=0,r="#000000",i="#ffffff";for(;e.length>=1&&""===e[0].scope;){let t=e.shift();-1!==t.fontStyle&&(n=t.fontStyle),null!==t.foreground&&(r=t.foreground),null!==t.background&&(i=t.background)}let s=new Jr(t),o=new Yr(n,s.getId(r),s.getId(i)),a=new ni(new ti(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];a.insert(0,n.scope,n.parentScopes,n.fontStyle,s.getId(n.foreground),s.getId(n.background))}return new Xr(s,o,a)}(e,t)}_cachedMatchRoot=new Gr(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(null===e)return this._defaults;const t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>function(e,t){if(0===t.length)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(">"===r){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!Wr(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}(e.parent,t.parentScopes));return n?new Yr(n.fontStyle,n.foreground,n.background):null}},Kr=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(const r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this;const t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(" ")}extends(e){return this===e||null!==this.parent&&this.parent.extends(e)}getExtensionIfDefined(e){const t=[];let n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function Wr(e,t){return t===e||e.startsWith(t)&&"."===e[t.length]}var Yr=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}},Zr=class{constructor(e,t,n,r,i,s){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=s}},Qr=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(Qr||{}),Jr=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(null===e)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},ei=Object.freeze([]),ti=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||ei,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,-1!==t&&(this.fontStyle=t),0!==n&&(this.foreground=n),0!==r&&(this.background=r)}},ni=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;">"===e.parentScopes[n]&&n++,">"===t.parentScopes[r]&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){const i=t.parentScopes[r].length-e.parentScopes[n].length;if(0!==i)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(""!==t){let e,n,r=t.indexOf(".");if(-1===r?(e=t,n=""):(e=t.substring(0,r),n=t.substring(r+1)),this._children.hasOwnProperty(e))return this._children[e].match(n)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,s,o){if(""===n)return void this._doInsertHere(t,r,i,s,o);let a,l,c,d=n.indexOf(".");-1===d?(a=n,l=""):(a=n.substring(0,d),l=n.substring(d+1)),this._children.hasOwnProperty(a)?c=this._children[a]:(c=new e(this._mainRule.clone(),ti.cloneArr(this._rulesWithParentScopes)),this._children[a]=c),c.insert(t+1,l,r,i,s,o)}_doInsertHere(e,t,n,r,i){if(null!==t){for(let s=0,o=this._rulesWithParentScopes.length;s<o;s++){let o=this._rulesWithParentScopes[s];if(0===Ur(o.parentScopes,t))return void o.acceptOverwrite(e,n,r,i)}-1===n&&(n=this._mainRule.fontStyle),0===r&&(r=this._mainRule.foreground),0===i&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new ti(e,t,n,r,i))}else this._mainRule.acceptOverwrite(e,n,r,i)}},ri=class e{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(t){const n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),s=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:s,background:o})}static getLanguageId(e){return(255&e)>>>0}static getTokenType(e){return(768&e)>>>8}static containsBalancedBrackets(e){return!!(1024&e)}static getFontStyle(e){return(30720&e)>>>11}static getForeground(e){return(16744448&e)>>>15}static getBackground(e){return(4278190080&e)>>>24}static set(t,n,r,i,s,o,a){let l=e.getLanguageId(t),c=e.getTokenType(t),d=e.containsBalancedBrackets(t)?1:0,u=e.getFontStyle(t),h=e.getForeground(t),p=e.getBackground(t);return 0!==n&&(l=n),8!==r&&(c=r),null!==i&&(d=i?1:0),-1!==s&&(u=s),0!==o&&(h=o),0!==a&&(p=a),(l|c<<8|d<<10|u<<11|h<<15|p<<24)>>>0}};function ii(e){return e}function si(e,t){const n=[],r=function(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const r=n[0];return n=t.exec(e),r}}}(e);let i=r.next();for(;null!==i;){let e=0;if(2===i.length&&":"===i.charAt(1)){switch(i.charAt(0)){case"R":e=1;break;case"L":e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),","!==i)break;i=r.next()}return n;function s(){if("-"===i){i=r.next();const e=s();return t=>!!e&&!e(t)}if("("===i){i=r.next();const e=function(){const e=[];let t=o();for(;t&&(e.push(t),"|"===i||","===i);){do{i=r.next()}while("|"===i||","===i);t=o()}return t=>e.some(e=>e(t))}();return")"===i&&(i=r.next()),e}if(oi(i)){const e=[];do{e.push(i),i=r.next()}while(oi(i));return n=>t(e,n)}return null}function o(){const e=[];let t=s();for(;t;)e.push(t),t=s();return t=>e.every(e=>e(t))}}function oi(e){return!!e&&!!e.match(/[\w\.:]+/)}function ai(e){"function"==typeof e.dispose&&e.dispose()}var li=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},ci=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},di=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},ui=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new li(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new di;for(const n of e)hi(n,this.initialScopeName,this.repo,t);for(const e of t.references)if(e instanceof li){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName))continue;if(this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function hi(e,t,n,r){const i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const s=n.lookup(t);e instanceof li?mi({baseGrammar:s,selfGrammar:i},r):pi(e.ruleName,{baseGrammar:s,selfGrammar:i,repository:i.repository},r);const o=n.injections(e.scopeName);if(o)for(const e of o)r.add(new li(e))}function pi(e,t,n){t.repository&&t.repository[e]&&fi([t.repository[e]],t,n)}function mi(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&fi(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&fi(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function fi(e,t,n){for(const r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const e=r.repository?Dr({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&fi(r.patterns,{...t,repository:e},n);const i=r.include;if(!i)continue;const s=wi(i);switch(s.kind){case 0:mi({...t,selfGrammar:t.baseGrammar},n);break;case 1:mi(t,n);break;case 2:pi(s.ruleName,{...t,repository:e},n);break;case 3:case 4:const r=s.scopeName===t.selfGrammar.scopeName?t.selfGrammar:s.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){const i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};4===s.kind?pi(s.ruleName,i,n):mi(i,n)}else 4===s.kind?n.add(new ci(s.scopeName,s.ruleName)):n.add(new li(s.scopeName))}}}var _i=class{kind=0},gi=class{kind=1},bi=class{constructor(e){this.ruleName=e}kind=2},yi=class{constructor(e){this.scopeName=e}kind=3},vi=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function wi(e){if("$base"===e)return new _i;if("$self"===e)return new gi;const t=e.indexOf("#");if(-1===t)return new yi(e);if(0===t)return new bi(e.substring(1));{const n=e.substring(0,t),r=e.substring(t+1);return new vi(n,r)}}var xi=/\\(\d+)/,ki=/\\(\d+)/g;Symbol("RuleId");var Si=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=jr.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=jr.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${Vr(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return this._nameIsCapturing&&null!==this._name&&null!==e&&null!==t?jr.replaceCaptures(this._name,e,t):this._name}getContentName(e,t){return this._contentNameIsCapturing&&null!==this._contentName?jr.replaceCaptures(this._contentName,e,t):this._contentName}},Ci=class extends Si{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,r){throw new Error("Not supported!")}},Mi=class extends Si{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new Ri(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Pi,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Li=class extends Si{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Pi,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Ti=class extends Si{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,s,o,a,l,c){super(e,t,n,r),this._begin=new Ri(i,this.id),this.beginCaptures=s,this._end=new Ri(o||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=l||!1,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Pi;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},zi=class extends Si{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,s,o,a,l){super(e,t,n,r),this._begin=new Ri(i,this.id),this.beginCaptures=s,this.whileCaptures=a,this._while=new Ri(o,-2),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Pi;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Pi,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||""),this._cachedCompiledWhilePatterns}},Ai=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new Ci(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new Mi(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(void 0===t.begin){t.repository&&(r=Dr({},r,t.repository));let i=t.patterns;return void 0===i&&t.include&&(i=[{include:t.include}]),new Li(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new zi(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new Ti(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let s=0;for(const e in t){if("$vscodeTextmateLocation"===e)continue;const t=parseInt(e,10);t>s&&(s=t)}for(let e=0;e<=s;e++)i[e]=null;for(const s in t){if("$vscodeTextmateLocation"===s)continue;const o=parseInt(s,10);let a=0;t[s].patterns&&(a=e.getCompiledRuleId(t[s],n,r)),i[o]=e.createCaptureRule(n,t[s].$vscodeTextmateLocation,t[s].name,t[s].contentName,a)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let s=0,o=t.length;s<o;s++){const o=t[s];let a=-1;if(o.include){const t=wi(o.include);switch(t.kind){case 0:case 1:a=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(a=e.getCompiledRuleId(i,n,r));break;case 3:case 4:const s=t.scopeName,l=4===t.kind?t.ruleName:null,c=n.getExternalGrammar(s,r);if(c)if(l){let t=c.repository[l];t&&(a=e.getCompiledRuleId(t,n,c.repository))}else a=e.getCompiledRuleId(c.repository.$self,n,c.repository)}}else a=e.getCompiledRuleId(o,n,r);if(-1!==a){const e=n.getRule(a);let t=!1;if((e instanceof Li||e instanceof Ti||e instanceof zi)&&e.hasMissingPatterns&&0===e.patterns.length&&(t=!0),t)continue;i.push(a)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},Ri=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&"string"==typeof e){const t=e.length;let n=0,r=[],i=!1;for(let s=0;s<t;s++)if("\\"===e.charAt(s)&&s+1<t){const t=e.charAt(s+1);"z"===t?(r.push(e.substring(n,s)),r.push("$(?!\\n)(?<!\\n)"),n=s+2):"A"!==t&&"G"!==t||(i=!0),s++}this.hasAnchor=i,0===n?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=t,"string"==typeof this.source?this.hasBackReferences=xi.test(this.source):this.hasBackReferences=!1}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if("string"!=typeof this.source)throw new Error("This method should only be called if the source is a string");let n=t.map(t=>e.substring(t.start,t.end));return ki.lastIndex=0,this.source.replace(ki,(e,t)=>$r(n[parseInt(t,10)]||""))}_buildAnchorCache(){if("string"!=typeof this.source)throw new Error("This method should only be called if the source is a string");let e,t,n,r,i=[],s=[],o=[],a=[];for(e=0,t=this.source.length;e<t;e++)n=this.source.charAt(e),i[e]=n,s[e]=n,o[e]=n,a[e]=n,"\\"===n&&e+1<t&&(r=this.source.charAt(e+1),"A"===r?(i[e+1]="",s[e+1]="",o[e+1]="A",a[e+1]="A"):"G"===r?(i[e+1]="",s[e+1]="G",o[e+1]="",a[e+1]="G"):(i[e+1]=r,s[e+1]=r,o[e+1]=r,a[e+1]=r),e++);return{A0_G0:i.join(""),A0_G1:s.join(""),A1_G0:o.join(""),A1_G1:a.join("")}}resolveAnchors(e,t){return this.hasAnchor&&this._anchorCache&&"string"==typeof this.source?e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0:this.source}},Pi=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new Ni(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let r=this._items.map(e=>e.resolveAnchors(t,n));return new Ni(e,r,this._items.map(e=>e.ruleId))}},Ni=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){"function"==typeof this.scanner.dispose&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join("\n")}findNextMatchSync(e,t,n){const r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},Ei=class{constructor(e,t){this.languageId=e,this.tokenType=t}},Oi=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new Ei(e,8),this._embeddedLanguagesMatcher=new Ii(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return null===t?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Ei(0,0);_getBasicScopeAttributes=new Gr(e=>{const t=this._scopeToLanguage(e),n=this._toStandardTokenType(e);return new Ei(t,n)});_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){const n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},Ii=class{values;scopesRegExp;constructor(e){if(0===e.length)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([e,t])=>$r(e));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);return t?this.values.get(t[1]):void 0}},Bi=("undefined"!=typeof process&&process.env.VSCODE_TEXTMATE_DEBUG,class{constructor(e,t){this.stack=e,this.stoppedEarly=t}});function Di(e,t,n,r,i,s,o,a){const l=t.content.length;let c=!1,d=-1;if(o){const o=function(e,t,n,r,i,s){let o=i.beginRuleCapturedEOL?0:-1;const a=[];for(let t=i;t;t=t.pop()){const n=t.getRule(e);n instanceof zi&&a.push({rule:n,stack:t})}for(let l=a.pop();l;l=a.pop()){const{ruleScanner:a,findOptions:c}=Hi(l.rule,e,l.stack.endRule,n,r===o),d=a.findNextMatchSync(t,r,c);if(!d){i=l.stack.pop();break}if(-2!==d.ruleId){i=l.stack.pop();break}d.captureIndices&&d.captureIndices.length&&(s.produce(l.stack,d.captureIndices[0].start),ji(e,t,n,l.stack,s,l.rule.whileCaptures,d.captureIndices),s.produce(l.stack,d.captureIndices[0].end),o=d.captureIndices[0].end,d.captureIndices[0].end>r&&(r=d.captureIndices[0].end,n=!1))}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}(e,t,n,r,i,s);i=o.stack,r=o.linePos,n=o.isFirstLine,d=o.anchorPosition}const u=Date.now();for(;!c;){if(0!==a&&Date.now()-u>a)return new Bi(i,!0);h()}return new Bi(i,!1);function h(){const o=function(e,t,n,r,i,s){const o=function(e,t,n,r,i,s){const o=i.getRule(e),{ruleScanner:a,findOptions:l}=Vi(o,e,i.endRule,n,r===s),c=a.findNextMatchSync(t,r,l);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}(e,t,n,r,i,s),a=e.getInjections();if(0===a.length)return o;const l=function(e,t,n,r,i,s,o){let a,l=Number.MAX_VALUE,c=null,d=0;const u=s.contentNameScopesList.getScopeNames();for(let s=0,h=e.length;s<h;s++){const h=e[s];if(!h.matcher(u))continue;const p=t.getRule(h.ruleId),{ruleScanner:m,findOptions:f}=Vi(p,t,null,r,i===o),_=m.findNextMatchSync(n,i,f);if(!_)continue;const g=_.captureIndices[0].start;if(!(g>=l)&&(l=g,c=_.captureIndices,a=_.ruleId,d=h.priority,l===i))break}return c?{priorityMatch:-1===d,captureIndices:c,matchedRuleId:a}:null}(a,e,t,n,r,i,s);if(!l)return o;if(!o)return l;const c=o.captureIndices[0].start,d=l.captureIndices[0].start;return d<c||l.priorityMatch&&d===c?l:o}(e,t,n,r,i,d);if(!o)return s.produce(i,l),void(c=!0);const a=o.captureIndices,u=o.matchedRuleId,h=!!(a&&a.length>0)&&a[0].end>r;if(-1===u){const o=i.getRule(e);s.produce(i,a[0].start),i=i.withContentNameScopesList(i.nameScopesList),ji(e,t,n,i,s,o.endCaptures,a),s.produce(i,a[0].end);const u=i;if(i=i.parent,d=u.getAnchorPos(),!h&&u.getEnterPos()===r)return i=u,s.produce(i,l),void(c=!0)}else{const o=e.getRule(u);s.produce(i,a[0].start);const p=i,m=o.getName(t.content,a),f=i.contentNameScopesList.pushAttributed(m,e);if(i=i.push(u,r,d,a[0].end===l,null,f,f),o instanceof Ti){const r=o;ji(e,t,n,i,s,r.beginCaptures,a),s.produce(i,a[0].end),d=a[0].end;const u=r.getContentName(t.content,a),m=f.pushAttributed(u,e);if(i=i.withContentNameScopesList(m),r.endHasBackReferences&&(i=i.withEndRule(r.getEndWithResolvedBackReferences(t.content,a))),!h&&p.hasSameRuleAs(i))return i=i.pop(),s.produce(i,l),void(c=!0)}else if(o instanceof zi){const r=o;ji(e,t,n,i,s,r.beginCaptures,a),s.produce(i,a[0].end),d=a[0].end;const u=r.getContentName(t.content,a),m=f.pushAttributed(u,e);if(i=i.withContentNameScopesList(m),r.whileHasBackReferences&&(i=i.withEndRule(r.getWhileWithResolvedBackReferences(t.content,a))),!h&&p.hasSameRuleAs(i))return i=i.pop(),s.produce(i,l),void(c=!0)}else if(ji(e,t,n,i,s,o.captures,a),s.produce(i,a[0].end),i=i.pop(),!h)return i=i.safePop(),s.produce(i,l),void(c=!0)}a[0].end>r&&(r=a[0].end,n=!1)}}function Vi(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function Hi(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function ji(e,t,n,r,i,s,o){if(0===s.length)return;const a=t.content,l=Math.min(s.length,o.length),c=[],d=o[0].end;for(let t=0;t<l;t++){const l=s[t];if(null===l)continue;const u=o[t];if(0===u.length)continue;if(u.start>d)break;for(;c.length>0&&c[c.length-1].endPos<=u.start;)i.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop();if(c.length>0?i.produceFromScopes(c[c.length-1].scopes,u.start):i.produce(r,u.start),l.retokenizeCapturedWithRuleId){const t=l.getName(a,o),s=r.contentNameScopesList.pushAttributed(t,e),c=l.getContentName(a,o),d=s.pushAttributed(c,e),h=r.push(l.retokenizeCapturedWithRuleId,u.start,-1,!1,null,s,d),p=e.createOnigString(a.substring(0,u.end));Di(e,p,n&&0===u.start,u.start,h,i,!1,0),ai(p);continue}const h=l.getName(a,o);if(null!==h){const t=(c.length>0?c[c.length-1].scopes:r.contentNameScopesList).pushAttributed(h,e);c.push(new Fi(t,u.end))}}for(;c.length>0;)i.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop()}var Fi=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function Ui(e,t,n,r,i){const s=si(t,qi),o=Ai.getCompiledRuleId(n,r,i.repository);for(const n of s)e.push({debugSelector:t,matcher:n.matcher,ruleId:o,grammar:i,priority:n.priority})}function qi(e,t){if(t.length<e.length)return!1;let n=0;return e.every(e=>{for(let r=n;r<t.length;r++)if($i(t[r],e))return n=r+1,!0;return!1})}function $i(e,t){if(!e)return!1;if(e===t)return!0;const n=t.length;return e.length>n&&e.substr(0,n)===t&&"."===e[n]}var Gi=class{constructor(e,t,n,r,i,s,o,a){if(this._rootScopeName=e,this.balancedBracketSelectors=s,this._onigLib=a,this._basicScopeAttributesProvider=new Oi(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=Xi(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(const e of Object.keys(i)){const t=si(e,qi);for(const n of t)this._tokenTypeMatchers.push({matcher:n.matcher,type:i[e]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e=[],t=this._rootScopeName,n=(e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e))(t);if(n){const r=n.injections;if(r)for(let t in r)Ui(e,t,r[t],this,n);const i=this._grammarRepository.injections(t);i&&i.forEach(t=>{const n=this.getExternalGrammar(t);if(n){const t=n.injectionSelector;t&&Ui(e,t,n,this,n)}})}return e.sort((e,t)=>e.priority-t.priority),e}getInjections(){return null===this._injections&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=Xi(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){const r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){let i;if(-1===this._rootId&&(this._rootId=Ai.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections()),t&&t!==Wi.NULL)i=!1,t.reset();else{i=!0;const e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=ri.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),s=this.getRule(this._rootId).getName(null,null);let o;o=s?Ki.createRootAndLookUpScopeName(s,r,this):Ki.createRoot("unknown",r),t=new Wi(null,this._rootId,-1,-1,!1,null,o,o)}e+="\n";const s=this.createOnigString(e),o=s.content.length,a=new Zi(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),l=Di(this,s,i,0,t,a,!0,r);return ai(s),{lineLength:o,lineTokens:a,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function Xi(e,t){return(e=Br(e)).repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var Ki=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(const t of n)i=Kr.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new Kr(null,t),n)}static createRootAndLookUpScopeName(t,n,r){const i=r.getMetadataForScope(t),s=new Kr(null,t),o=r.themeProvider.themeMatch(s),a=e.mergeAttributes(n,i,o);return new e(null,s,a)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return e.equals(this,t)}static equals(e,t){for(;;){if(e===t)return!0;if(!e&&!t)return!0;if(!e||!t)return!1;if(e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}}static mergeAttributes(e,t,n){let r=-1,i=0,s=0;return null!==n&&(r=n.fontStyle,i=n.foregroundId,s=n.backgroundId),ri.set(e,t.languageId,t.tokenType,null,r,i,s)}pushAttributed(t,n){if(null===t)return this;if(-1===t.indexOf(" "))return e._pushAttributed(this,t,n);const r=t.split(/ /g);let i=this;for(const t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){const i=r.getMetadataForScope(n),s=t.scopePath.push(n),o=r.themeProvider.themeMatch(s),a=e.mergeAttributes(t.tokenAttributes,i,o);return new e(t,s,a)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){const t=[];let n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},Wi=class e{constructor(e,t,n,r,i,s,o,a){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=s,this.nameScopesList=o,this.contentNameScopesList=a,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return null!==t&&e._equals(this,t)}static _equals(e,t){return e===t||!!this._structuralEquals(e,t)&&Ki.equals(e.contentNameScopesList,t.contentNameScopesList)}static _structuralEquals(e,t){for(;;){if(e===t)return!0;if(!e&&!t)return!0;if(!e||!t)return!1;if(e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,s,o,a){return new e(this,t,n,r,i,s,o,a)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){const e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){const r=Ki.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Ki.fromExtension(r,n.contentNameScopesList))}},Yi=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>"*"===e?(this.allowAny=!0,[]):si(e,qi).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>si(e,qi).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&0===this.unbalancedBracketScopes.length}get matchesNever(){return 0===this.balancedBracketScopes.length&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},Zi=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const t=e?.getScopeNames()??[];for(const e of this._tokenTypeOverrides)e.matcher(t)&&(n=ri.set(n,0,ii(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}return r&&(n=ri.set(n,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n||(this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n)),void(this._lastTokenEndIndex=t)}const n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),0===this._tokens.length&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),0===this._binaryTokens.length&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e<t;e++)n[e]=this._binaryTokens[e];return n}},Qi=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,i){if(!this._grammars.has(e)){let s=this._rawGrammars.get(e);if(!s)return null;this._grammars.set(e,function(e,t,n,r,i,s,o,a){return new Gi(e,t,n,r,i,s,o,a)}(e,s,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},Ji=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new Qi(Xr.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(Xr.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new Yi(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){const s=new ui(this._syncRegistry,e);for(;s.Q.length>0;)s.Q.map(e=>this._loadSingleGrammar(e.scopeName)),s.processQueue();return this._grammarForScopeName(e,t,n,r,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){const t=this._options.loadGrammar(e);if(t){const n="function"==typeof this._options.getInjections?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,i)}},es=Wi.NULL;const ts=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class ns{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function rs(e,t){const n={},r={};for(const t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new ns(n,r,t)}function is(e){return e.toLowerCase()}ns.prototype.normal={},ns.prototype.property={},ns.prototype.space=void 0;class ss{constructor(e,t){this.attribute=t,this.property=e}}ss.prototype.attribute="",ss.prototype.booleanish=!1,ss.prototype.boolean=!1,ss.prototype.commaOrSpaceSeparated=!1,ss.prototype.commaSeparated=!1,ss.prototype.defined=!1,ss.prototype.mustUseProperty=!1,ss.prototype.number=!1,ss.prototype.overloadedBoolean=!1,ss.prototype.property="",ss.prototype.spaceSeparated=!1,ss.prototype.space=void 0;let os=0;const as=ms(),ls=ms(),cs=ms(),ds=ms(),us=ms(),hs=ms(),ps=ms();function ms(){return 2**++os}const fs=Object.keys(r);class _s extends ss{constructor(e,t,n,i){let s=-1;if(super(e,t),gs(this,"space",i),"number"==typeof n)for(;++s<fs.length;){const e=fs[s];gs(this,fs[s],(n&r[e])===r[e])}}}function gs(e,t,n){n&&(e[t]=n)}function bs(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new _s(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[is(r)]=r,n[is(s.attribute)]=r}return new ns(t,n,e.space)}_s.prototype.defined=!0;const ys=bs({properties:{ariaActiveDescendant:null,ariaAtomic:ls,ariaAutoComplete:null,ariaBusy:ls,ariaChecked:ls,ariaColCount:ds,ariaColIndex:ds,ariaColSpan:ds,ariaControls:us,ariaCurrent:null,ariaDescribedBy:us,ariaDetails:null,ariaDisabled:ls,ariaDropEffect:us,ariaErrorMessage:null,ariaExpanded:ls,ariaFlowTo:us,ariaGrabbed:ls,ariaHasPopup:null,ariaHidden:ls,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:us,ariaLevel:ds,ariaLive:null,ariaModal:ls,ariaMultiLine:ls,ariaMultiSelectable:ls,ariaOrientation:null,ariaOwns:us,ariaPlaceholder:null,ariaPosInSet:ds,ariaPressed:ls,ariaReadOnly:ls,ariaRelevant:null,ariaRequired:ls,ariaRoleDescription:us,ariaRowCount:ds,ariaRowIndex:ds,ariaRowSpan:ds,ariaSelected:ls,ariaSetSize:ds,ariaSort:null,ariaValueMax:ds,ariaValueMin:ds,ariaValueNow:ds,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function vs(e,t){return t in e?e[t]:t}function ws(e,t){return vs(e,t.toLowerCase())}const xs=bs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:hs,acceptCharset:us,accessKey:us,action:null,allow:null,allowFullScreen:as,allowPaymentRequest:as,allowUserMedia:as,alt:null,as:null,async:as,autoCapitalize:null,autoComplete:us,autoFocus:as,autoPlay:as,blocking:us,capture:null,charSet:null,checked:as,cite:null,className:us,cols:ds,colSpan:null,content:null,contentEditable:ls,controls:as,controlsList:us,coords:ds|hs,crossOrigin:null,data:null,dateTime:null,decoding:null,default:as,defer:as,dir:null,dirName:null,disabled:as,download:cs,draggable:ls,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:as,formTarget:null,headers:us,height:ds,hidden:cs,high:ds,href:null,hrefLang:null,htmlFor:us,httpEquiv:us,id:null,imageSizes:null,imageSrcSet:null,inert:as,inputMode:null,integrity:null,is:null,isMap:as,itemId:null,itemProp:us,itemRef:us,itemScope:as,itemType:us,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:as,low:ds,manifest:null,max:null,maxLength:ds,media:null,method:null,min:null,minLength:ds,multiple:as,muted:as,name:null,nonce:null,noModule:as,noValidate:as,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:as,optimum:ds,pattern:null,ping:us,placeholder:null,playsInline:as,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:as,referrerPolicy:null,rel:us,required:as,reversed:as,rows:ds,rowSpan:ds,sandbox:us,scope:null,scoped:as,seamless:as,selected:as,shadowRootClonable:as,shadowRootDelegatesFocus:as,shadowRootMode:null,shape:null,size:ds,sizes:null,slot:null,span:ds,spellCheck:ls,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ds,step:null,style:null,tabIndex:ds,target:null,title:null,translate:null,type:null,typeMustMatch:as,useMap:null,value:ls,width:ds,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:us,axis:null,background:null,bgColor:null,border:ds,borderColor:null,bottomMargin:ds,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:as,declare:as,event:null,face:null,frame:null,frameBorder:null,hSpace:ds,leftMargin:ds,link:null,longDesc:null,lowSrc:null,marginHeight:ds,marginWidth:ds,noResize:as,noHref:as,noShade:as,noWrap:as,object:null,profile:null,prompt:null,rev:null,rightMargin:ds,rules:null,scheme:null,scrolling:ls,standby:null,summary:null,text:null,topMargin:ds,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ds,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:as,disableRemotePlayback:as,prefix:null,property:null,results:ds,security:null,unselectable:null},space:"html",transform:ws}),ks=bs({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ps,accentHeight:ds,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ds,amplitude:ds,arabicForm:null,ascent:ds,attributeName:null,attributeType:null,azimuth:ds,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ds,by:null,calcMode:null,capHeight:ds,className:us,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ds,diffuseConstant:ds,direction:null,display:null,dur:null,divisor:ds,dominantBaseline:null,download:as,dx:null,dy:null,edgeMode:null,editable:null,elevation:ds,enableBackground:null,end:null,event:null,exponent:ds,externalResourcesRequired:null,fill:null,fillOpacity:ds,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:hs,g2:hs,glyphName:hs,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ds,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ds,horizOriginX:ds,horizOriginY:ds,id:null,ideographic:ds,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ds,k:ds,k1:ds,k2:ds,k3:ds,k4:ds,kernelMatrix:ps,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ds,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ds,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ds,overlineThickness:ds,paintOrder:null,panose1:null,path:null,pathLength:ds,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:us,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ds,pointsAtY:ds,pointsAtZ:ds,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ps,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ps,rev:ps,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ps,requiredFeatures:ps,requiredFonts:ps,requiredFormats:ps,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ds,specularExponent:ds,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ds,strikethroughThickness:ds,string:null,stroke:null,strokeDashArray:ps,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ds,strokeOpacity:ds,strokeWidth:null,style:null,surfaceScale:ds,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ps,tabIndex:ds,tableValues:null,target:null,targetX:ds,targetY:ds,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ps,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ds,underlineThickness:ds,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ds,values:null,vAlphabetic:ds,vMathematical:ds,vectorEffect:null,vHanging:ds,vIdeographic:ds,version:null,vertAdvY:ds,vertOriginX:ds,vertOriginY:ds,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ds,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:vs}),Ss=bs({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),Cs=bs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:ws}),Ms=bs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),Ls=rs([ys,xs,Ss,Cs,Ms],"html"),Ts=rs([ys,ks,Ss,Cs,Ms],"svg"),zs={}.hasOwnProperty,As=/["&'<>`]/g,Rs=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Ps=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Ns=/[|\\{}()[\]^$+*?.]/g,Es=new WeakMap;const Os=/[\dA-Fa-f]/,Is=/\d/,Bs=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],Ds={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},Vs=["cent","copy","divide","gt","lt","not","para","times"],Hs={}.hasOwnProperty,js={};let Fs;for(Fs in Ds)Hs.call(Ds,Fs)&&(js[Ds[Fs]]=Fs);const Us=/[^\dA-Za-z]/;function qs(e,t,n){let r,i=function(e,t,n){const r="&#x"+e.toString(16).toUpperCase();return n&&t&&!Os.test(String.fromCharCode(t))?r:r+";"}(e,t,n.omitOptionalSemicolons);if((n.useNamedReferences||n.useShortestReferences)&&(r=function(e,t,n,r){const i=String.fromCharCode(e);if(Hs.call(js,i)){const e=js[i],s="&"+e;return n&&Bs.includes(e)&&!Vs.includes(e)&&(!r||t&&61!==t&&Us.test(String.fromCharCode(t)))?s:s+";"}return""}(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!r)&&n.useShortestReferences){const r=function(e,t,n){const r="&#"+String(e);return n&&t&&!Is.test(String.fromCharCode(t))?r:r+";"}(e,t,n.omitOptionalSemicolons);r.length<i.length&&(i=r)}return r&&(!n.useShortestReferences||r.length<i.length)?r:i}function $s(e,t){return function(e,t){return e=e.replace(t.subset?function(e){let t=Es.get(e);return t||(t=function(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(Ns,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}(e),Es.set(e,t)),t}(t.subset):As,n),t.subset||t.escapeOnly?e:e.replace(Rs,function(e,n,r){return t.format(1024*(e.charCodeAt(0)-55296)+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}).replace(Ps,n);function n(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}(e,Object.assign({format:qs},t))}const Gs=/^>|^->|<!--|-->|--!>|<!-$/g,Xs=[">"],Ks=["<",">"];function Ws(e,t){const n=String(e);if("string"!=typeof t)throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;-1!==i;)r++,i=n.indexOf(t,i+t.length);return r}function Ys(e,t){const n=t||{};return(""===e[e.length-1]?[...e,""]:e).join((n.padRight?" ":"")+","+(!1===n.padLeft?"":" ")).trim()}const Zs=/[A-Z]/g,Qs=/-[a-z]/g,Js=/^data[-\w.:]+$/i;function eo(e){return"-"+e.toLowerCase()}function to(e){return e.charAt(1).toUpperCase()}function no(e){return e.join(" ").trim()}const ro=/[ \t\n\f\r]/g;function io(e){return"object"==typeof e?"text"===e.type&&so(e.value):so(e)}function so(e){return""===e.replace(ro,"")}const oo=co(1),ao=co(-1),lo=[];function co(e){return function(t,n,r){const i=t?t.children:lo;let s=(n||0)+e,o=i[s];if(!r)for(;o&&io(o);)s+=e,o=i[s];return o}}const uo={}.hasOwnProperty;function ho(e){return function(t,n,r){return uo.call(e,t.tagName)&&e[t.tagName](t,n,r)}}const po=ho({body:function(e,t,n){const r=oo(n,t);return!r||"comment"!==r.type},caption:mo,colgroup:mo,dd:function(e,t,n){const r=oo(n,t);return!r||"element"===r.type&&("dt"===r.tagName||"dd"===r.tagName)},dt:function(e,t,n){const r=oo(n,t);return Boolean(r&&"element"===r.type&&("dt"===r.tagName||"dd"===r.tagName))},head:mo,html:function(e,t,n){const r=oo(n,t);return!r||"comment"!==r.type},li:function(e,t,n){const r=oo(n,t);return!r||"element"===r.type&&"li"===r.tagName},optgroup:function(e,t,n){const r=oo(n,t);return!r||"element"===r.type&&"optgroup"===r.tagName},option:function(e,t,n){const r=oo(n,t);return!r||"element"===r.type&&("option"===r.tagName||"optgroup"===r.tagName)},p:function(e,t,n){const r=oo(n,t);return r?"element"===r.type&&("address"===r.tagName||"article"===r.tagName||"aside"===r.tagName||"blockquote"===r.tagName||"details"===r.tagName||"div"===r.tagName||"dl"===r.tagName||"fieldset"===r.tagName||"figcaption"===r.tagName||"figure"===r.tagName||"footer"===r.tagName||"form"===r.tagName||"h1"===r.tagName||"h2"===r.tagName||"h3"===r.tagName||"h4"===r.tagName||"h5"===r.tagName||"h6"===r.tagName||"header"===r.tagName||"hgroup"===r.tagName||"hr"===r.tagName||"main"===r.tagName||"menu"===r.tagName||"nav"===r.tagName||"ol"===r.tagName||"p"===r.tagName||"pre"===r.tagName||"section"===r.tagName||"table"===r.tagName||"ul"===r.tagName):!n||!("element"===n.type&&("a"===n.tagName||"audio"===n.tagName||"del"===n.tagName||"ins"===n.tagName||"map"===n.tagName||"noscript"===n.tagName||"video"===n.tagName))},rp:fo,rt:fo,tbody:function(e,t,n){const r=oo(n,t);return!r||"element"===r.type&&("tbody"===r.tagName||"tfoot"===r.tagName)},td:_o,tfoot:function(e,t,n){return!oo(n,t)},th:_o,thead:function(e,t,n){const r=oo(n,t);return Boolean(r&&"element"===r.type&&("tbody"===r.tagName||"tfoot"===r.tagName))},tr:function(e,t,n){const r=oo(n,t);return!r||"element"===r.type&&"tr"===r.tagName}});function mo(e,t,n){const r=oo(n,t,!0);return!r||"comment"!==r.type&&!("text"===r.type&&io(r.value.charAt(0)))}function fo(e,t,n){const r=oo(n,t);return!r||"element"===r.type&&("rp"===r.tagName||"rt"===r.tagName)}function _o(e,t,n){const r=oo(n,t);return!r||"element"===r.type&&("td"===r.tagName||"th"===r.tagName)}const go=ho({body:function(e){const t=oo(e,-1,!0);return!(t&&("comment"===t.type||"text"===t.type&&io(t.value.charAt(0))||"element"===t.type&&("meta"===t.tagName||"link"===t.tagName||"script"===t.tagName||"style"===t.tagName||"template"===t.tagName)))},colgroup:function(e,t,n){const r=ao(n,t),i=oo(e,-1,!0);return!(n&&r&&"element"===r.type&&"colgroup"===r.tagName&&po(r,n.children.indexOf(r),n))&&Boolean(i&&"element"===i.type&&"col"===i.tagName)},head:function(e){const t=new Set;for(const n of e.children)if("element"===n.type&&("base"===n.tagName||"title"===n.tagName)){if(t.has(n.tagName))return!1;t.add(n.tagName)}const n=e.children[0];return!n||"element"===n.type},html:function(e){const t=oo(e,-1);return!t||"comment"!==t.type},tbody:function(e,t,n){const r=ao(n,t),i=oo(e,-1);return(!n||!r||"element"!==r.type||"thead"!==r.tagName&&"tbody"!==r.tagName||!po(r,n.children.indexOf(r),n))&&Boolean(i&&"element"===i.type&&"tr"===i.tagName)}}),bo={name:[["\t\n\f\r &/=>".split(""),"\t\n\f\r \"&'/=>`".split("")],["\0\t\n\f\r \"&'/<=>".split(""),"\0\t\n\f\r \"&'/<=>`".split("")]],unquoted:[["\t\n\f\r &>".split(""),"\0\t\n\f\r \"&'<=>`".split("")],["\0\t\n\f\r \"&'<=>`".split(""),"\0\t\n\f\r \"&'<=>`".split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function yo(e,t,n){const r=function(e,t){const n=is(t);let r=t,i=ss;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&Js.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(Qs,to);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!Qs.test(e)){let n=e.replace(Zs,eo);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}i=_s}return new i(r,t)}(e.schema,t),i=e.settings.allowParseErrors&&"html"===e.schema.space?0:1,s=e.settings.allowDangerousCharacters?0:1;let o,a=e.quote;if(!r.overloadedBoolean||n!==r.attribute&&""!==n?!r.boolean&&!r.overloadedBoolean||"string"==typeof n&&n!==r.attribute&&""!==n||(n=Boolean(n)):n=!0,null==n||!1===n||"number"==typeof n&&Number.isNaN(n))return"";const l=$s(r.attribute,Object.assign({},e.settings.characterReferences,{subset:bo.name[i][s]}));return!0===n?l:(n=Array.isArray(n)?(r.commaSeparated?Ys:no)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n?l:(e.settings.preferUnquoted&&(o=$s(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:bo.unquoted[i][s]}))),o!==n&&(e.settings.quoteSmart&&Ws(n,a)>Ws(n,e.alternative)&&(a=e.alternative),o=a+$s(n,Object.assign({},e.settings.characterReferences,{subset:("'"===a?bo.single:bo.double)[i][s],attribute:!0}))+a),l+(o?"="+o:o)))}const vo=["<","&"];function wo(e,t,n,r){return!n||"element"!==n.type||"script"!==n.tagName&&"style"!==n.tagName?$s(e.value,Object.assign({},r.settings.characterReferences,{subset:vo})):e.value}const xo=function(e,t){const n=t||{};function r(t,...n){let i=r.invalid;const s=r.handlers;if(t&&zs.call(t,e)){const n=String(t[e]);i=zs.call(s,n)?s[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}("type",{invalid:function(e){throw new Error("Expected node, not `"+e+"`")},unknown:function(e){throw new Error("Cannot compile unknown node `"+e.type+"`")},handlers:{comment:function(e,t,n,r){return r.settings.bogusComments?"<?"+$s(e.value,Object.assign({},r.settings.characterReferences,{subset:Xs}))+">":"\x3c!--"+e.value.replace(Gs,function(e){return $s(e,Object.assign({},r.settings.characterReferences,{subset:Ks}))})+"--\x3e"},doctype:function(e,t,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"},element:function(e,t,n,r){const i=r.schema,s="svg"!==i.space&&r.settings.omitOptionalTags;let o="svg"===i.space?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase());const a=[];let l;"html"===i.space&&"svg"===e.tagName&&(r.schema=Ts);const c=function(e,t){const n=[];let r,i=-1;if(t)for(r in t)if(null!==t[r]&&void 0!==t[r]){const i=yo(e,r,t[r]);i&&n.push(i)}for(;++i<n.length;){const t=e.settings.tightAttributes?n[i].charAt(n[i].length-1):void 0;i!==n.length-1&&'"'!==t&&"'"!==t&&(n[i]+=" ")}return n.join("")}(r,e.properties),d=r.all("html"===i.space&&"template"===e.tagName?e.content:e);return r.schema=i,d&&(o=!1),!c&&s&&go(e,t,n)||(a.push("<",e.tagName,c?" "+c:""),o&&("svg"===i.space||r.settings.closeSelfClosing)&&(l=c.charAt(c.length-1),(!r.settings.tightSelfClosing||"/"===l||l&&'"'!==l&&"'"!==l)&&a.push(" "),a.push("/")),a.push(">")),a.push(d),o||s&&po(e,t,n)||a.push("</"+e.tagName+">"),a.join("")},raw:function(e,t,n,r){return r.settings.allowDangerousHtml?e.value:wo(e,0,n,r)},root:function(e,t,n,r){return r.all(e)},text:wo}}),ko={},So={},Co=[];function Mo(e,t,n){return xo(e,t,n,this)}function Lo(e){const t=[],n=e&&e.children||Co;let r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join("")}function To(e,t){const n="string"==typeof e?{}:{...e.colorReplacements},r="string"==typeof e?e:e.name;for(const[e,i]of Object.entries(t?.colorReplacements||{}))"string"==typeof i?n[e]=i:e===r&&Object.assign(n,i);return n}function zo(e,t){return e&&t?.[e?.toLowerCase()]||e}async function Ao(e){return Promise.resolve("function"==typeof e?e():e).then(e=>e.default||e)}function Ro(e){return!e||["plaintext","txt","text","plain"].includes(e)}function Po(e){return"ansi"===e||Ro(e)}function No(e){return"none"===e}function Eo(e){return No(e)}function Oo(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],"string"==typeof e.properties.class&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);const n=Array.isArray(t)?t:t.split(/\s+/g);for(const t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}function Io(e,t=!1){const n=e.split(/(\r?\n)/g);let r=0;const i=[];for(let e=0;e<n.length;e+=2){const s=t?n[e]+(n[e+1]||""):n[e];i.push([s,r]),r+=n[e].length,r+=n[e+1]?.length||0}return i}const Bo="light-dark()",Do=["color","background-color"];function Vo(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&Qr.Italic&&(t["font-style"]="italic"),e.fontStyle&Qr.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&Qr.Underline&&n.push("underline"),e.fontStyle&Qr.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function Ho(e){return"string"==typeof e?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(";")}const jo=new WeakMap;function Fo(e,t){jo.set(e,t)}function Uo(e){return jo.get(e)}class qo{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(e,t){return new qo(Object.fromEntries((n=t,Array.isArray(n)?n:[n]).map(e=>[e,es])),e);var n}constructor(...e){if(2===e.length){const[t,n]=e;this.lang=n,this._stacks=t}else{const[t,n,r]=e;this.lang=n,this._stacks={[r]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return function(e){const t=[],n=new Set;return function e(r){if(n.has(r))return;n.add(r);const i=r?.nameScopesList?.scopeName;i&&t.push(i),r.parent&&e(r.parent)}(e),t}(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function $o(){const e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=function(e){if("number"==typeof e){if(e<0||e>t.source.length)throw new Ir(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...r.indexToPos(e),offset:e}}{const t=r.lines[e.line];if(void 0===t)throw new Ir(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${r.lines.length}`);let n=e.character;if(n<0&&(n=t.length+n),n<0||n>t.length)throw new Ir(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:n,offset:r.posToIndex(e.line,n)}}};const r=function(e){const t=Io(e,!0).map(([e])=>e);return{lines:t,indexToPos:function(n){if(n===e.length)return{line:t.length-1,character:t[t.length-1].length};let r=n,i=0;for(const e of t){if(r<e.length)break;r-=e.length,i++}return{line:i,character:r}},posToIndex:function(e,n){let r=0;for(let n=0;n<e;n++)r+=t[n].length;return r+=n,r}}}(t.source),i=(t.options.decorations||[]).map(e=>({...e,start:n(e.start),end:n(e.end)}));!function(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new Ir(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){const t=e[r],i=n.start.offset<=t.start.offset&&t.start.offset<n.end.offset,s=n.start.offset<t.end.offset&&t.end.offset<=n.end.offset,o=t.start.offset<=n.start.offset&&n.start.offset<t.end.offset,a=t.start.offset<n.end.offset&&n.end.offset<=t.end.offset;if(i||s||o||a){if(i&&s)continue;if(o&&a)continue;if(o&&n.start.offset===n.end.offset)continue;if(s&&t.start.offset===t.end.offset)continue;throw new Ir(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}(i),e.set(t.meta,{decorations:i,converter:r,source:t.source})}return e.get(t.meta)}return{name:"shiki:decorations",tokens(e){if(!this.options.decorations?.length)return;const n=function(e,t){const n=Array.from(t instanceof Set?t:new Set(t)).sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{const t=n.filter(t=>e.offset<t&&t<e.offset+e.content.length).map(t=>t-e.offset).sort((e,t)=>e-t);return t.length?function(e,t){let n=0;const r=[];for(const i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}(e,t):e})):e}(e,t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]));return n},code(e){if(!this.options.decorations?.length)return;const n=t(this),r=Array.from(e.children).filter(e=>"element"===e.type&&"span"===e.tagName);if(r.length!==n.converter.lines.length)throw new Ir(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function i(e,t,n,i){const s=r[e];let a="",l=-1,c=-1;if(0===t&&(l=0),0===n&&(c=0),n===Number.POSITIVE_INFINITY&&(c=s.children.length),-1===l||-1===c)for(let e=0;e<s.children.length;e++)a+=Go(s.children[e]),-1===l&&a.length===t&&(l=e+1),-1===c&&a.length===n&&(c=e+1);if(-1===l)throw new Ir(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(-1===c)throw new Ir(`Failed to find end index for decoration ${JSON.stringify(i.end)}`);const d=s.children.slice(l,c);if(i.alwaysWrap||d.length!==s.children.length)if(i.alwaysWrap||1!==d.length||"element"!==d[0].type){const e={type:"element",tagName:"span",properties:{},children:d};o(e,i,"wrapper"),s.children.splice(l,d.length,e)}else o(d[0],i,"token");else o(s,i,"line")}function s(e,t){r[e]=o(r[e],t,"line")}function o(e,t,n){const r=t.properties||{},i=t.transform||(e=>e);return e.tagName=t.tagName||"span",e.properties={...e.properties,...r,class:e.properties.class},t.properties?.class&&Oo(e,t.properties.class),i(e,n)||e}const a=[],l=n.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset);for(const e of l){const{start:t,end:n}=e;if(t.line===n.line)i(t.line,t.character,n.character,e);else if(t.line<n.line){i(t.line,t.character,Number.POSITIVE_INFINITY,e);for(let r=t.line+1;r<n.line;r++)a.unshift(()=>s(r,e));i(n.line,0,n.character,e)}}a.forEach(e=>e())}}}function Go(e){return"text"===e.type?e.value:"element"===e.type?e.children.map(Go).join(""):""}const Xo=[$o()];function Ko(e){const t=function(e){const t=[],n=[],r=[];for(const i of e)switch(i.enforce){case"pre":t.push(i);break;case"post":n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...Xo]}var Wo=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],Yo={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function Zo(e,t){const n=e.indexOf("",t);if(-1!==n&&"["===e[n+1]){const t=e.indexOf("m",n);if(-1!==t)return{sequence:e.substring(n+2,t).split(";"),startPosition:n,position:t+1}}return{position:e.length}}function Qo(e){const t=e.shift();if("2"===t){const t=e.splice(0,3).map(e=>Number.parseInt(e));if(3!==t.length||t.some(e=>Number.isNaN(e)))return;return{type:"rgb",rgb:t}}if("5"===t){const t=e.shift();if(t)return{type:"table",index:Number(t)}}}function Jo(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const r=Number.parseInt(n);if(!Number.isNaN(r))if(0===r)t.push({type:"resetAll"});else if(r<=9)Yo[r]&&t.push({type:"setDecoration",value:Yo[r]});else if(r<=29){const e=Yo[r-20];e&&(t.push({type:"resetDecoration",value:e}),"dim"===e&&t.push({type:"resetDecoration",value:"bold"}))}else if(r<=37)t.push({type:"setForegroundColor",value:{type:"named",name:Wo[r-30]}});else if(38===r){const n=Qo(e);n&&t.push({type:"setForegroundColor",value:n})}else if(39===r)t.push({type:"resetForegroundColor"});else if(r<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:Wo[r-40]}});else if(48===r){const n=Qo(e);n&&t.push({type:"setBackgroundColor",value:n})}else 49===r?t.push({type:"resetBackgroundColor"}):53===r?t.push({type:"setDecoration",value:"overline"}):55===r?t.push({type:"resetDecoration",value:"overline"}):r>=90&&r<=97?t.push({type:"setForegroundColor",value:{type:"named",name:Wo[r-90+8]}}):r>=100&&r<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:Wo[r-100+8]}})}return t}var ea={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function ta(e=ea){function t(t){return e[t]}function n(e){return`#${e.map(e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,"0")).join("")}`}let r;return{value:function(e){switch(e.type){case"named":return t(e.name);case"rgb":return n(e.rgb);case"table":return i=e.index,function(){if(r)return r;r=[];for(let e=0;e<Wo.length;e++)r.push(t(Wo[e]));let e=[0,95,135,175,215,255];for(let t=0;t<6;t++)for(let i=0;i<6;i++)for(let s=0;s<6;s++)r.push(n([e[t],e[i],e[s]]));let i=8;for(let e=0;e<24;e++,i+=10)r.push(n([i,i,i]));return r}()[i]}var i}}}function na(e,t,n={}){const{lang:r="text",theme:i=e.getLoadedThemes()[0]}=n;if(Ro(r)||No(i))return Io(t).map(e=>[{content:e[0],offset:e[1]}]);const{theme:s,colorMap:o}=e.setTheme(i);if("ansi"===r)return function(e,t,n){const r=To(e,n),i=Io(t),s=ta(Object.fromEntries(Wo.map(t=>[t,e.colors?.[`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`]]))),o=function(){let e=null,t=null,n=new Set;return{parse(r){const i=[];let s=0;do{const o=Zo(r,s),a=o.sequence?r.substring(s,o.startPosition):r.substring(s);if(a.length>0&&i.push({value:a,foreground:e,background:t,decorations:new Set(n)}),o.sequence){const r=Jo(o.sequence);for(const i of r)"resetAll"===i.type?(e=null,t=null,n.clear()):"resetForegroundColor"===i.type?e=null:"resetBackgroundColor"===i.type?t=null:"resetDecoration"===i.type&&n.delete(i.value);for(const i of r)"setForegroundColor"===i.type?e=i.value:"setBackgroundColor"===i.type?t=i.value:"setDecoration"===i.type&&n.add(i.value)}s=o.position}while(s<r.length);return i}}}();return i.map(t=>o.parse(t[0]).map(n=>{let i,o;n.decorations.has("reverse")?(i=n.background?s.value(n.background):e.bg,o=n.foreground?s.value(n.foreground):e.fg):(i=n.foreground?s.value(n.foreground):e.fg,o=n.background?s.value(n.background):void 0),i=zo(i,r),o=zo(o,r),n.decorations.has("dim")&&(i=function(e){const t=e.match(/#([0-9a-f]{3})([0-9a-f]{3})?([0-9a-f]{2})?/);if(t){if(t[3]){const e=Math.round(Number.parseInt(t[3],16)/2).toString(16).padStart(2,"0");return`#${t[1]}${t[2]}${e}`}return t[2]?`#${t[1]}${t[2]}80`:`#${Array.from(t[1]).map(e=>`${e}${e}`).join("")}80`}const n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}(i));let a=Qr.None;return n.decorations.has("bold")&&(a|=Qr.Bold),n.decorations.has("italic")&&(a|=Qr.Italic),n.decorations.has("underline")&&(a|=Qr.Underline),n.decorations.has("strikethrough")&&(a|=Qr.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:a}}))}(s,t,n);const a=e.getLanguage(r);if(n.grammarState){if(n.grammarState.lang!==a.name)throw new Ir(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${a.name}"`);if(!n.grammarState.themes.includes(s.name))throw new Ir(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${s.name}"`)}return function(e,t,n,r,i){const s=ra(e,t,n,r,i),o=new qo(ra(e,t,n,r,i).stateStack,t.name,n.name);return Fo(s.tokens,o),s.tokens}(t,a,s,o,n)}function ra(e,t,n,r,i){const s=To(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:a=500}=i,l=Io(e);let c=i.grammarState?function(e,t){if(!(e instanceof qo))throw new Ir("Invalid grammar state");return e.getInternalStack(t)}(i.grammarState,n.name)??es:null!=i.grammarContextCode?ra(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack:es,d=[];const u=[];for(let e=0,h=l.length;e<h;e++){const[h,p]=l[e];if(""===h){d=[],u.push([]);continue}if(o>0&&h.length>=o){d=[],u.push([{content:h,offset:p,color:"",fontStyle:0}]);continue}let m,f,_;i.includeExplanation&&(m=t.tokenizeLine(h,c,a),f=m.tokens,_=0);const g=t.tokenizeLine2(h,c,a),b=g.tokens.length/2;for(let e=0;e<b;e++){const t=g.tokens[2*e],o=e+1<b?g.tokens[2*e+2]:h.length;if(t===o)continue;const a=g.tokens[2*e+1],l=zo(r[ri.getForeground(a)],s),c=ri.getFontStyle(a),u={content:h.substring(t,o),offset:p+t,color:l,fontStyle:c};if(i.includeExplanation){const e=[];if("scopeName"!==i.includeExplanation)for(const t of n.settings){let n;switch(typeof t.scope){case"string":n=t.scope.split(/,/).map(e=>e.trim());break;case"object":n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(/ /))})}u.explanation=[];let r=0;for(;t+r<o;){const t=f[_],n=h.substring(t.startIndex,t.endIndex);r+=n.length,u.explanation.push({content:n,scopes:"scopeName"===i.includeExplanation?ia(t.scopes):sa(e,t.scopes)}),_+=1}}d.push(u)}u.push(d),d=[],c=g.ruleStack}return{tokens:u,stateStack:c}}function ia(e){return e.map(e=>({scopeName:e}))}function sa(e,t){const n=[];for(let r=0,i=t.length;r<i;r++){const i=t[r];n[r]={scopeName:i,themeMatches:la(e,i,t.slice(0,r))}}return n}function oa(e,t){return e===t||t.substring(0,e.length)===e&&"."===t[e.length]}function aa(e,t,n){if(!oa(e[e.length-1],t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)oa(e[r],n[i])&&(r-=1),i-=1;return-1===r}function la(e,t,n){const r=[];for(const{selectors:i,settings:s}of e)for(const e of i)if(aa(e,t,n)){r.push(s);break}return r}function ca(e,t,n){const r=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),i=r.map(r=>{const i=na(e,t,{...n,theme:r.theme});return{tokens:i,state:Uo(i),theme:"string"==typeof r.theme?r.theme:r.theme.name}}),s=function(...e){const t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){const i=e.map(e=>e[r]),s=t.map(()=>[]);t.forEach((e,t)=>e.push(s[t]));const o=i.map(()=>0),a=i.map(e=>e[0]);for(;a.every(e=>e);){const e=Math.min(...a.map(e=>e.content.length));for(let t=0;t<n;t++){const n=a[t];n.content.length===e?(s[t].push(n),o[t]+=1,a[t]=i[t][o[t]]):(s[t].push({...n,content:n.content.slice(0,e)}),a[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}(...i.map(e=>e.tokens)),o=s[0].map((e,t)=>e.map((e,i)=>{const o={content:e.content,variants:{},offset:e.offset};return"includeExplanation"in n&&n.includeExplanation&&(o.explanation=e.explanation),s.forEach((e,n)=>{const{content:s,explanation:a,offset:l,...c}=e[t][i];o.variants[r[n].color]=c}),o})),a=i[0].state?new qo(Object.fromEntries(i.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),i[0].state.lang):void 0;return a&&Fo(o,a),o}function da(e,t,n){let r,i,s,o,a,l;if("themes"in n){const{defaultColor:c="light",cssVariablePrefix:d="--shiki-",colorsRendering:u="css-vars"}=n,h=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===c?-1:t.color===c?1:0);if(0===h.length)throw new Ir("`themes` option must not be empty");const p=ca(e,t,n);if(l=Uo(p),c&&Bo!==c&&!h.find(e=>e.color===c))throw new Ir(`\`themes\` option must contain the defaultColor key \`${c}\``);const m=h.map(t=>e.getTheme(t.theme)),f=h.map(e=>e.color);s=p.map(e=>e.map(e=>function(e,t,n,r,i="css-vars"){const s={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>Vo(e.variants[t])),a=new Set(o.flatMap(e=>Object.keys(e))),l={},c=(e,r)=>{const i="color"===r?"":"background-color"===r?"-bg":`-${r}`;return n+t[e]+("color"===r?"":i)};return o.forEach((e,n)=>{for(const s of a){const a=e[s]||"inherit";if(0===n&&r&&Do.includes(s))if(r===Bo&&o.length>1){const e=t.findIndex(e=>"light"===e),r=t.findIndex(e=>"dark"===e);if(-1===e||-1===r)throw new Ir('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const d=o[e][s]||"inherit",u=o[r][s]||"inherit";l[s]=`light-dark(${d}, ${u})`,"css-vars"===i&&(l[c(n,s)]=a)}else l[s]=a;else"css-vars"===i&&(l[c(n,s)]=a)}}),s.htmlStyle=l,s}(e,f,d,c,u))),l&&Fo(s,l);const _=h.map(e=>To(e.theme,n));i=ua(h,m,_,d,c,"fg",u),r=ua(h,m,_,d,c,"bg",u),o=`shiki-themes ${m.map(e=>e.name).join(" ")}`,a=c?void 0:[i,r].join(";")}else{if(!("theme"in n))throw new Ir("Invalid options, either `theme` or `themes` must be provided");{const a=To(n.theme,n);s=na(e,t,n);const c=e.getTheme(n.theme);r=zo(c.bg,a),i=zo(c.fg,a),o=c.name,l=Uo(s)}}return{tokens:s,fg:i,bg:r,themeName:o,rootStyle:a,grammarState:l}}function ua(e,t,n,r,i,s,o){return e.map((a,l)=>{const c=zo(t[l][s],n[l])||"inherit",d=`${r+a.color}${"bg"===s?"-bg":""}:${c}`;if(0===l&&i){if(i===Bo&&e.length>1){const r=e.findIndex(e=>"light"===e.color),i=e.findIndex(e=>"dark"===e.color);if(-1===r||-1===i)throw new Ir('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${zo(t[r][s],n[r])||"inherit"}, ${zo(t[i][s],n[i])||"inherit"});${d}`}return c}return"css-vars"===o?d:null}).filter(e=>!!e).join(";")}function ha(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>ha(e,t,n),codeToTokens:(t,n)=>da(e,t,n)}){let i=t;for(const e of Ko(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:s,fg:o,bg:a,themeName:l,rootStyle:c,grammarState:d}=da(e,i,n);const{mergeWhitespaces:u=!0,mergeSameStyleTokens:h=!1}=n;!0===u?s=function(e){return e.map(e=>{const t=[];let n="",r=0;return e.forEach((i,s)=>{const o=!(i.fontStyle&&(i.fontStyle&Qr.Underline||i.fontStyle&Qr.Strikethrough));o&&i.content.match(/^\s+$/)&&e[s+1]?(r||(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=0,n=""):t.push(i)}),t})}(s):"never"===u&&(s=function(e){return e.map(e=>e.flatMap(e=>{if(e.content.match(/^\s+$/))return e;const t=e.content.match(/^(\s*)(.*?)(\s*)$/);if(!t)return e;const[,n,r,i]=t;if(!n&&!i)return e;const s=[{...e,offset:e.offset+n.length,content:r}];return n&&s.unshift({content:n,offset:e.offset}),i&&s.push({content:i,offset:e.offset+n.length+r.length}),s}))}(s)),h&&(s=function(e){return e.map(e=>{const t=[];for(const n of e){if(0===t.length){t.push({...n});continue}const e=t[t.length-1],r=Ho(e.htmlStyle||Vo(e)),i=Ho(n.htmlStyle||Vo(n)),s=e.fontStyle&&(e.fontStyle&Qr.Underline||e.fontStyle&Qr.Strikethrough),o=n.fontStyle&&(n.fontStyle&Qr.Underline||n.fontStyle&Qr.Strikethrough);s||o||r!==i?t.push({...n}):e.content+=n.content}return t})}(s));const p={...r,get source(){return i}};for(const e of Ko(n))s=e.tokens?.call(p,s)||s;return function(e,t,n,r=Uo(e)){const i=Ko(t),s=[],o={type:"root",children:[]},{structure:a="classic",tabindex:l="0"}=t;let c={type:"element",tagName:"pre",properties:{class:`shiki ${t.themeName||""}`,style:t.rootStyle||`background-color:${t.bg};color:${t.fg}`,...!1!==l&&null!=l?{tabindex:l.toString()}:{},...Object.fromEntries(Array.from(Object.entries(t.meta||{})).filter(([e])=>!e.startsWith("_")))},children:[]},d={type:"element",tagName:"code",properties:{},children:s};const u=[],h={...n,structure:a,addClassToHast:Oo,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return c},get code(){return d},get lines(){return u}};if(e.forEach((e,t)=>{t&&("inline"===a?o.children.push({type:"element",tagName:"br",properties:{},children:[]}):"classic"===a&&s.push({type:"text",value:"\n"}));let n={type:"element",tagName:"span",properties:{class:"line"},children:[]},r=0;for(const s of e){let e={type:"element",tagName:"span",properties:{...s.htmlAttrs},children:[{type:"text",value:s.content}]};const l=Ho(s.htmlStyle||Vo(s));l&&(e.properties.style=l);for(const o of i)e=o?.span?.call(h,e,t+1,r,n,s)||e;"inline"===a?o.children.push(e):"classic"===a&&n.children.push(e),r+=s.content.length}if("classic"===a){for(const e of i)n=e?.line?.call(h,n,t+1)||n;u.push(n),s.push(n)}}),"classic"===a){for(const e of i)d=e?.code?.call(h,d)||d;c.children.push(d);for(const e of i)c=e?.pre?.call(h,c)||c;o.children.push(c)}let p=o;for(const e of i)p=e?.root?.call(h,p)||p;return r&&Fo(p,r),p}(s,{...n,fg:o,bg:a,themeName:l,rootStyle:c},p,d)}function pa(e,t,n){const r={meta:{},options:n,codeToHast:(t,n)=>ha(e,t,n),codeToTokens:(t,n)=>da(e,t,n)};let i=function(e,t){const n=t||ko,r=n.quote||'"',i='"'===r?"'":'"';if('"'!==r&&"'"!==r)throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:Mo,all:Lo,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||ts,characterReferences:n.characterReferences||So,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:"svg"===n.space?Ts:Ls,quote:r,alternative:i}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}(ha(e,t,n,r));for(const e of Ko(n))i=e.postprocess?.call(r,i,n)||i;return i}const ma="__shiki_resolved";function fa(e){if(e?.[ma])return e;const t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||="dark",t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){const e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(r=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!r&&t?.colors?.["editor.foreground"]&&(r=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),r||(r="light"===t.type?"#333333":"#bbbbbb"),n||(n="light"===t.type?"#fffffe":"#1e1e1e"),t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0;const s=new Map;function o(e){if(s.has(e))return s.get(e);i+=1;const n=`#${i.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?o(e):(s.set(e,n),n)}t.settings=t.settings.map(e=>{const n=e.settings?.foreground&&!e.settings.foreground.startsWith("#"),r=e.settings?.background&&!e.settings.background.startsWith("#");if(!n&&!r)return e;const i={...e,settings:{...e.settings}};if(n){const n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,i.settings.foreground=n}if(r){const n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,i.settings.background=n}return i});for(const e of Object.keys(t.colors||{}))if(("editor.foreground"===e||"editor.background"===e||e.startsWith("terminal.ansi"))&&!t.colors[e]?.startsWith("#")){const n=o(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,ma,{enumerable:!1,writable:!1,value:!0}),t}async function _a(e){return Array.from(new Set((await Promise.all(e.filter(e=>!Po(e)).map(async e=>await Ao(e).then(e=>Array.isArray(e)?e:[e])))).flat()))}async function ga(e){return(await Promise.all(e.map(async e=>Eo(e)?null:fa(await Ao(e))))).filter(e=>!!e)}class ba extends Error{constructor(e){super(e),this.name="ShikiError"}}class ya extends Ji{constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(e){return"string"==typeof e?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){const t=fa(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=Xr.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){if(this._alias[e]){const t=new Set([e]);for(;this._alias[e];){if(e=this._alias[e],t.has(e))throw new ba(`Circular alias \`${Array.from(t).join(" -> ")} -> ${e}\``);t.add(e)}}return this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;const t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);const n={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(const e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(const t of e)this.resolveEmbeddedLanguages(t);const t=Array.from(this._langGraph.entries()),n=t.filter(([e,t])=>!t);if(n.length){const e=t.filter(([e,t])=>t&&t.embeddedLangs?.some(e=>n.map(([e])=>e).includes(e))).filter(e=>!n.includes(e));throw new ba(`Missing languages ${n.map(([e])=>`\`${e}\``).join(", ")}, required by ${e.map(([e])=>`\`${e}\``).join(", ")}`)}for(const[e,n]of t)this._resolver.addLanguage(n);for(const[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(e){if(this._langMap.set(e.name,e),this._langGraph.set(e.name,e),e.embeddedLangs)for(const t of e.embeddedLangs)this._langGraph.set(t,this._langMap.get(t))}}class va{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){const t=e.split(".");let n=[];for(let e=1;e<=t.length;e++){const r=t.slice(0,e).join(".");n=[...n,...this._injections.get(r)||[]]}return n}}let wa=0;async function xa(e){e.engine||function(e,t=3){t>3||console.trace(`[SHIKI DEPRECATE]: ${e}`)}("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,r]=await Promise.all([ga(e.themes||[]),_a(e.langs||[]),e.engine]);return function(e){wa+=1,!1!==e.warnings&&wa>=10&&wa%10==0&&console.warn(`[Shiki] ${wa} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new ba("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(fa),i=new va(e.engine,n),s=new ya(i,r,n,e.langAlias);let o;function a(e){if("none"===e)return{bg:"",fg:"",name:"none",settings:[],type:"dark"};d();const t=s.getTheme(e);if(!t)throw new ba(`Theme \`${e}\` not found, you may need to load it first`);return t}function l(...e){d(),s.loadLanguages(e.flat(1))}function c(...e){d();for(const t of e.flat(1))s.loadTheme(t)}function d(){if(t)throw new ba("Shiki instance has been disposed")}function u(){t||(t=!0,s.dispose(),wa-=1)}return{setTheme:function(e){d();const t=a(e);return o!==e&&(s.setTheme(t),o=e),{theme:t,colorMap:s.getColorMap()}},getTheme:a,getLanguage:function(e){d();const t=s.getGrammar("string"==typeof e?e:e.name);if(!t)throw new ba(`Language \`${e}\` not found, you may need to load it first`);return t},getLoadedThemes:function(){return d(),s.getLoadedThemes()},getLoadedLanguages:function(){return d(),s.getLoadedLanguages()},loadLanguage:async function(...e){return l(await _a(e))},loadLanguageSync:l,loadTheme:async function(...e){return d(),c(await ga(e))},loadThemeSync:c,dispose:u,[Symbol.dispose]:u}}({...e,themes:t,langs:n,engine:r})}async function ka(e){const t=await xa(e);return{getLastGrammarState:(...e)=>function(...e){if(2===e.length)return Uo(e[1]);const[t,n,r={}]=e,{lang:i="text",theme:s=t.getLoadedThemes()[0]}=r;if(Ro(i)||No(s))throw new Ir("Plain language does not have grammar state");if("ansi"===i)throw new Ir("ANSI language does not have grammar state");const{theme:o,colorMap:a}=t.setTheme(s),l=t.getLanguage(i);return new qo(ra(n,l,o,a,r).stateStack,l.name,o.name)}(t,...e),codeToTokensBase:(e,n)=>na(t,e,n),codeToTokensWithThemes:(e,n)=>ca(t,e,n),codeToTokens:(e,n)=>da(t,e,n),codeToHast:(e,n)=>ha(t,e,n),codeToHtml:(e,n)=>pa(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function Sa(e){const t=e.langs,n=e.themes,r=e.engine;return async function(e){function i(n){if("string"==typeof n){if(Po(n))return[];n=e.langAlias?.[n]||n;const r=t[n];if(!r)throw new Ir(`Language \`${n}\` is not included in this bundle. You may want to load it from external source.`);return r}return n}function s(e){if(Eo(e))return"none";if("string"==typeof e){const t=n[e];if(!t)throw new Ir(`Theme \`${e}\` is not included in this bundle. You may want to load it from external source.`);return t}return e}const o=(e.themes??[]).map(e=>s(e)),a=(e.langs??[]).map(e=>i(e)),l=await ka({engine:e.engine??r(),...e,themes:o,langs:a});return{...l,loadLanguage:(...e)=>l.loadLanguage(...e.map(i)),loadTheme:(...e)=>l.loadTheme(...e.map(s)),getBundledLanguages:()=>t,getBundledThemes:()=>n}}}function Ca(e,t){const n=function(e){let t;return async function(n={}){if(t){const e=await t;return await Promise.all([e.loadTheme(...n.themes||[]),e.loadLanguage(...n.langs||[])]),e}return t=e({...n,themes:n.themes||[],langs:n.langs||[]}),t}}(e);async function r(e,r){const i=await n({langs:[r.lang],themes:"theme"in r?[r.theme]:Object.values(r.themes)}),s=await(t?.guessEmbeddedLanguages?.(e,r.lang,i));return s&&await i.loadLanguage(...s),i}return{getSingletonHighlighter:e=>n(e),codeToHtml:async(e,t)=>(await r(e,t)).codeToHtml(e,t),codeToHast:async(e,t)=>(await r(e,t)).codeToHast(e,t),codeToTokens:async(e,t)=>(await r(e,t)).codeToTokens(e,t),codeToTokensBase:async(e,t)=>(await r(e,t)).codeToTokensBase(e,t),codeToTokensWithThemes:async(e,t)=>(await r(e,t)).codeToTokensWithThemes(e,t),getLastGrammarState:async(e,t)=>(await n({langs:[t.lang],themes:[t.theme]})).getLastGrammarState(e,t)}}class Ma extends Error{constructor(e){super(e),this.name="ShikiError"}}function La(){return"undefined"!=typeof performance?performance.now():Date.now()}const Ta=(e,t)=>e+(t-e%t)%t;var za=Object.defineProperty,Aa=(e,t,n)=>((e,t,n)=>t in e?za(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);let Ra=null;class Pa{constructor(e){Aa(this,"utf16Length"),Aa(this,"utf8Length"),Aa(this,"utf16Value"),Aa(this,"utf8Value"),Aa(this,"utf16OffsetToUtf8"),Aa(this,"utf8OffsetToUtf16");const t=e.length,n=Pa._utf8ByteLength(e),r=n!==t,i=r?new Uint32Array(t+1):null;r&&(i[t]=n);const s=r?new Uint32Array(n+1):null;r&&(s[n]=t);const o=new Uint8Array(n);let a=0;for(let n=0;n<t;n++){const l=e.charCodeAt(n);let c=l,d=!1;if(l>=55296&&l<=56319&&n+1<t){const t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(c=65536+(l-55296<<10)|t-56320,d=!0)}r&&(i[n]=a,d&&(i[n+1]=a),c<=127?s[a+0]=n:c<=2047?(s[a+0]=n,s[a+1]=n):c<=65535?(s[a+0]=n,s[a+1]=n,s[a+2]=n):(s[a+0]=n,s[a+1]=n,s[a+2]=n,s[a+3]=n)),c<=127?o[a++]=c:c<=2047?(o[a++]=192|(1984&c)>>>6,o[a++]=128|(63&c)>>>0):c<=65535?(o[a++]=224|(61440&c)>>>12,o[a++]=128|(4032&c)>>>6,o[a++]=128|(63&c)>>>0):(o[a++]=240|(1835008&c)>>>18,o[a++]=128|(258048&c)>>>12,o[a++]=128|(4032&c)>>>6,o[a++]=128|(63&c)>>>0),d&&n++}this.utf16Length=t,this.utf8Length=n,this.utf16Value=e,this.utf8Value=o,this.utf16OffsetToUtf8=i,this.utf8OffsetToUtf16=s}static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n<r;n++){const i=e.charCodeAt(n);let s=i,o=!1;if(i>=55296&&i<=56319&&n+1<r){const t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(s=65536+(i-55296<<10)|t-56320,o=!0)}t+=s<=127?1:s<=2047?2:s<=65535?3:4,o&&n++}return t}createString(e){const t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}}const Na=class e{constructor(t){if(Aa(this,"id",++e.LAST_ID),Aa(this,"_onigBinding"),Aa(this,"content"),Aa(this,"utf16Length"),Aa(this,"utf8Length"),Aa(this,"utf16OffsetToUtf8"),Aa(this,"utf8OffsetToUtf16"),Aa(this,"ptr"),!Ra)throw new Ma("Must invoke loadWasm first.");this._onigBinding=Ra,this.content=t;const n=new Pa(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||(e._sharedPtr=Ra.omalloc(1e4)),e._sharedPtrInUse=!0,Ra.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(Ra)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};Aa(Na,"LAST_ID",0),Aa(Na,"_sharedPtr",0),Aa(Na,"_sharedPtrInUse",!1);let Ea,Oa=Na;class Ia{constructor(e){if(Aa(this,"_onigBinding"),Aa(this,"_ptr"),!Ra)throw new Ma("Must invoke loadWasm first.");const t=[],n=[];for(let r=0,i=e.length;r<i;r++){const i=new Pa(e[r]);t[r]=i.createString(Ra),n[r]=i.utf8Length}const r=Ra.omalloc(4*e.length);Ra.HEAPU32.set(t,r/4);const i=Ra.omalloc(4*e.length);Ra.HEAPU32.set(n,i/4);const s=Ra.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)Ra.ofree(t[n]);Ra.ofree(i),Ra.ofree(r),0===s&&function(e){throw new Ma(e.UTF8ToString(e.getLastOnigError()))}(Ra),this._onigBinding=Ra,this._ptr=s}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let r=0;if("number"==typeof n&&(r=n),"string"==typeof e){e=new Oa(e);const n=this._findNextMatchSync(e,t,!1,r);return e.dispose(),n}return this._findNextMatchSync(e,t,!1,r)}_findNextMatchSync(e,t,n,r){const i=this._onigBinding,s=i.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),r);if(0===s)return null;const o=i.HEAPU32;let a=s/4;const l=o[a++],c=o[a++],d=[];for(let t=0;t<c;t++){const n=e.convertUtf8OffsetToUtf16(o[a++]),r=e.convertUtf8OffsetToUtf16(o[a++]);d[t]={start:n,end:r,length:r-n}}return{index:l,captureIndices:d}}}function Ba(e){return Ea||(Ea=async function(){Ra=await async function(e){let t,n;const r={};function i(e){n=e,r.HEAPU8=new Uint8Array(e),r.HEAPU32=new Uint32Array(e)}function s(e){try{return t.grow(e-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}const o="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function a(e,t){return e?function(e,t,n=1024){const r=t+n;let i=t;for(;e[i]&&!(i>=r);)++i;if(i-t>16&&e.buffer&&o)return o.decode(e.subarray(t,i));let s="";for(;t<i;){let n=e[t++];if(!(128&n)){s+=String.fromCharCode(n);continue}const r=63&e[t++];if(192==(224&n)){s+=String.fromCharCode((31&n)<<6|r);continue}const i=63&e[t++];if(n=224==(240&n)?(15&n)<<12|r<<6|i:(7&n)<<18|r<<12|i<<6|63&e[t++],n<65536)s+=String.fromCharCode(n);else{const e=n-65536;s+=String.fromCharCode(55296|e>>10,56320|1023&e)}}return s}(r.HEAPU8,e,t):""}const l={emscripten_get_now:La,emscripten_memcpy_big:function(e,t,n){r.HEAPU8.copyWithin(e,t,t+n)},emscripten_resize_heap:function(e){const t=r.HEAPU8.length,n=2147483648;if((e>>>=0)>n)return!1;for(let r=1;r<=4;r*=2){let i=t*(1+.2/r);if(i=Math.min(i,e+100663296),s(Math.min(n,Ta(Math.max(e,i),65536))))return!0}return!1},fd_write:()=>0};return await async function(){const n={env:l,wasi_snapshot_preview1:l},s=await e(n);t=s.memory,i(t.buffer),Object.assign(r,s),r.UTF8ToString=a}(),r}(async t=>{let n=e;var r;return n=await n,"function"==typeof n&&(n=await n(t)),"function"==typeof n&&(n=await n(t)),"function"==typeof n.instantiator?n=await n.instantiator(t):"function"!=typeof n.default?(function(e){return void 0!==e.data}(n)&&(n=n.data),function(e){return"undefined"!=typeof Response&&e instanceof Response}(n)?n="function"==typeof WebAssembly.instantiateStreaming?await(r=n,e=>WebAssembly.instantiateStreaming(r,e))(t):await function(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}(n)(t):function(e){return"undefined"!=typeof ArrayBuffer&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||"undefined"!=typeof Buffer&&Buffer.isBuffer?.(e)||"undefined"!=typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer||"undefined"!=typeof Uint32Array&&e instanceof Uint32Array}(n)||n instanceof WebAssembly.Module?n=await Da(n)(t):"default"in n&&n.default instanceof WebAssembly.Module&&(n=await Da(n.default)(t))):n=await n.default(t),"instance"in n&&(n=n.instance),"exports"in n&&(n=n.exports),n})}(),Ea)}function Da(e){return t=>WebAssembly.instantiate(e,t)}const Va=Sa({langs:Nr,themes:Or,engine:()=>async function(e){return e&&await Ba(e),{createScanner:e=>new Ia(e.map(e=>"string"==typeof e?e:e.source)),createString:e=>new Oa(e)}}(n.e(4709).then(n.bind(n,4709)))}),{codeToHtml:Ha,codeToHast:ja,codeToTokens:Fa,codeToTokensBase:Ua,codeToTokensWithThemes:qa,getSingletonHighlighter:$a,getLastGrammarState:Ga}=Ca(Va,{guessEmbeddedLanguages:function(e,t,n){const r=new Set;for(const t of e.matchAll(/lang=["']([\w-]+)["']/g))r.add(t[1]);for(const t of e.matchAll(/(?:```|~~~)([\w-]+)/g))r.add(t[1]);for(const t of e.matchAll(/\\begin\{([\w-]+)\}/g))r.add(t[1]);if(!n)return Array.from(r);const i=n.getBundledLanguages();return Array.from(r).filter(e=>e&&i[e])}}),Xa=["id","data-type"],Ka=["data-id","onClick"],Wa=["innerHTML"],Ya=["disabled"],Za=(0,c.pM)({__name:"cube-code",props:{cube:{}},setup(e){const{root:t}=e.cube,{stats:n}=t,r=(0,l.KR)(),i=(0,l.KR)(),s=(0,l.KR)(),u=(0,l.KR)();let h;function p(e){if(!e._draglist)return;const t=e._draglist.init();return e.items.length>0&&t<=0?requestAnimationFrame(()=>p(e)):void 0}(0,c.wB)(()=>[e.cube.active_tab_id,e.cube.active_tab?.code],()=>{const t=e.cube.active_tab,n=u.value;t&&n&&(n.value=t.code)},{immediate:!0}),(0,c.wB)(()=>[e.cube.code_html],()=>{const t=e.cube.active_tab,n=u.value,r=n?.previousElementSibling;if(!t||!n||!r)return;const i=n.parentElement;(0,c.dY)(()=>{const t=r.nextElementSibling,n=r.firstElementChild;if(t&&n){if(i){const t=n.style.backgroundColor;if(t.startsWith("rgb")){const n=t.replace("rgb","rgba").replace(")",", 0.85)");e.cube.attrs.codebg=n}else e.cube.attrs.codebg=t;e.cube.attrs.caret=n.style.color}n.style.border="none",n.style.outline="none"}})}),(0,c.sV)(()=>{const t=u.value;t&&(t.value=e.cube.active_tab?.code||"");const n=r.value,a=s.value;if(!n||!a)return;e.cube._draglist=new N.DragList(n,"horizental","data-id","insert"),e.cube._draglist.register_start(()=>{const t=e.cube._draglist;if(!t)return;const n=e.cube.get_upstream_sum_scale();t.scale_h=n.sx,t.scale_v=n.sy}),p(e.cube);const l=i.value;if(!l)return;h=new N.DragDiff(l);let c=e.cube.attrs.width,d=e.cube.attrs.height,m=c,f=d;h.register_down(()=>{c=e.cube.attrs.width,d=e.cube.attrs.height}),h.register_move((e,t)=>{m=Math.round(e+c),f=Math.round(t+d),a.style.width=m+"px",a.style.height=f+"px"}),h.register_up((t,n)=>{if(c===m&&d===f)return;const r=e.cube.courier.get_recorder(),i=Math.round(t+c),s=Math.round(n+d);r.tell(e.cube,o.VL.resize(e.cube.id,i,s)),e.cube.history.record(r)}),h.register_cancel(()=>{e.cube.attrs.width=c,e.cube.attrs.height=d})}),(0,c.hi)(()=>{h?.off()});const m=(0,c.EW)(()=>({"caret-color":e.cube.attrs.caret}));function f(e){e.stopPropagation()}function _(t){const n=t.previousElementSibling;if(t.parentElement,!n)return;const r=t.value,{id:i,courier:s,history:o}=e.cube,a=s.get_recorder();a.tell(e.cube,zr.update(i,e.cube.active_tab_id,r)),o.record(a)}function g(e){const t=e.currentTarget;t.value,_(t)}function b(e){const{hotkeys:n,clipboard:r,history:i}=t,s=e.key.toLowerCase();if([n.data[a.ZS["scope-add"]]].some(t=>n.validate(e,t)))return e.preventDefault();if(t.scope_count_normal>0&&["backspace","delete"].includes(s)){e.preventDefault(),e.stopPropagation();const t=r.delete_scope();return void(t&&i.record(t))}const o=e.currentTarget;if("tab"===s){e.preventDefault(),e.stopPropagation();let t=o.value;const n=o.selectionStart,r=o.selectionEnd;t=t.slice(0,n)+"\t"+t.slice(r),o.value=t,o.selectionStart=n+1,o.selectionEnd=n+1,_(o)}}function y(e){e.preventDefault();const t=e.currentTarget;t.scrollTop=0,t.scrollLeft=0}function v(e,t=50){e.stopPropagation();const n=e.currentTarget;e.deltaY>0?N.DomAnimation.scroll_element(n,t,"horizental"):N.DomAnimation.scroll_element(n,-t,"horizental")}function w(e){const t=e.currentTarget,n=t.firstElementChild,r=t.lastElementChild;if(!n||!r)return;const i=e.shiftKey,{scrollLeft:s,scrollTop:o,scrollWidth:a,scrollHeight:l}=t,c=t.getBoundingClientRect();e.deltaY>0?i?s+c.width<a&&(e.preventDefault(),e.stopPropagation(),N.DomAnimation.scroll_element(t,20,"horizental")):o+c.height<l&&(e.preventDefault(),e.stopPropagation(),N.DomAnimation.scroll_element(t,20,"vertical")):i?s>0&&(e.preventDefault(),e.stopPropagation(),N.DomAnimation.scroll_element(t,-20,"horizental")):o>0&&(e.preventDefault(),e.stopPropagation(),N.DomAnimation.scroll_element(t,-20,"vertical"))}function x(t){(0,pt.uz)(t,e.cube)}return(t,o)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-code",id:t.cube.id,"data-type":(0,l.R1)(a.u0).code,ref_key:"code",ref:s,style:(0,d.Tr)(t.cube.css),onPointerdown:f,onBeforeinput:f,onCompositionstart:f,onContextmenu:x},[(0,c.Lk)("div",{class:"code-tabbar",onWheel:v},[(0,c.Lk)("div",{class:"code-tabs-box",ref_key:"tabsbox",ref:r},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(t.cube.items,n=>((0,c.uX)(),(0,c.CE)("div",{class:"code-tab","data-id":n.id,key:n.id,onClick:()=>function(t){const{courier:n,history:r}=e.cube,i=n.get_recorder();i.tell(e.cube,zr.change_active(e.cube.id,t.id)),r.record(i)}(n)},[(0,c.Lk)("div",{class:(0,d.C4)(["code-tab-name",{"code-active-tab":n.id===t.cube.active_tab_id}])},(0,d.v_)(n.name),3)],8,Ka))),128))],512)],32),(0,c.Lk)("div",{class:"code-box",onWheel:w},[(0,c.Lk)("div",{class:"code-box-inner",style:(0,d.Tr)({background:t.cube.attrs.codebg})},[(0,c.Lk)("span",{class:"code-highlight",onWheel:o[0]||(o[0]=e=>e.preventDefault()),innerHTML:t.cube.code_html},null,40,Wa),(0,c.Lk)("textarea",{disabled:(0,l.R1)(n).is_read_mode,ref_key:"textarea",ref:u,style:(0,d.Tr)(m.value),onKeyup:y,onKeydown:b,autocapitalize:"false",autocomplete:"false",autocorrect:"false",spellcheck:"false",onInput:g},null,44,Ya)],4)],32),(0,c.Lk)("div",{class:"code-dragger",ref_key:"code_dragger",ref:i},null,512)],44,Xa))}}),Qa=(0,m.A)(Za,[["__scopeId","data-v-6d594329"]]),Ja={".py":"python",".java":"java",".c":"c",".cpp":"c++",".js":"javascript",".html":"html",".css":"css",".php":"php",".rb":"ruby",".go":"go",".swift":"swift",".kt":"kotlin",".rs":"rust",".ts":"typescript",".sh":"shell",".pl":"perl",".cs":"c#",".sql":"sql",".r":"r",".m":"matlab",".adb":"ada",".ads":"ada",".lua":"lua",".scala":"scala",".dart":"dart",".hs":"haskell",".erl":"erlang",".ex":"elixir",".jl":"julia",".groovy":"groovy",".fs":"f#",".clj":"clojure",".scm":"scheme",".ml":"ocaml",".pas":"pascal",".d":"d",".nim":"nim",".zig":"zig",".v":"v",".coffee":"coffeescript",".litcoffee":"coffeescript",".vue":"vue",".svelte":"svelte",".elm":"elm",".purs":"purescript",".exs":"elixir",".eex":"elixir",".heex":"elixir",".tcl":"tcl",".tk":"tcl",".awk":"awk",".ps1":"powershell",".psm1":"powershell",".psd1":"powershell",".bat":"batch",".cmd":"batch",".json":"json",".xml":"xml",".yaml":"yaml",".yml":"yaml",".toml":"toml",".ini":"ini",".md":"markdown",".markdown":"markdown",".tex":"latex",".sty":"latex",".cls":"latex",".bib":"bibtex",".csv":"csv",".tsv":"tsv",".log":"log"};var el=n(2551);function tl(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}const nl="dracula";class rl extends o._D{_code_html=(0,l.KR)("");static _langs=[...Object.keys(Nr)];static _themes=[...Object.keys(Or)];static get langs(){return[...this._langs]}static get themes(){return[...this._themes]}constructor(e,t){super(e,t);const n=this.setup(e,t);return this.init(),n}get langs(){return[...rl._langs]}get themes(){return[...rl._themes]}_draglist;get component(){return Qa}get items(){return this.info.tabs}get active_tab_id(){return this.info.active_tab_id}set active_tab_id(e){const t=this.items.find(t=>t.id===e);t&&(this.info.active_tab_id=t.id)}get active_tab(){return this.items.find(e=>e.id===this.active_tab_id)}get code_html(){return this._code_html.value}get info(){return this.data.info}get css(){const e=this.config.data.line_indent,t=this.attrs.indent,n=this.attrs.width,r=this.attrs.height;return{...this.data.css,"margin-left":t>0?t*e+"px":"0px",width:n+"px",height:r+"px"}}get attrs(){return this.data.attrs}init(){this.update_active_code_html()}export(){return this.base_export()}gc(){super.base_gc()}build_child(e){}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}update_active_code_html(){if(0===this.items.length)this._code_html.value="";else{const e=this.active_tab;if(!e)return;this.code_to_html(e).then(e=>{this._code_html.value=e})}}code_to_html(e){return Ha(e.code,{lang:e.lang,theme:e.theme,cssVariablePrefix:"--shiki-"})}get meta(){return rl.meta}create_tab(e,t,n=nl){return{id:g.I.get_id(),name:t,lang:e,code:"",theme:n||nl}}replace_id(e,t={}){return rl.replace_id(this.root,e,t)}copy_code(){const e=this.active_tab;if(!e)return el.F.tips?.tip_error("当前没有激活的代码块tab");const t=e.code,n=new Blob([t],{type:"text/plain"}),r=new ClipboardItem({[n.type]:n});this.clipboard.set_clipboard_data(r).then(e=>{el.F.tips?.tip_info("复制代码成功👏")})}change_lang(e){const{tabid:t,lang:n}=e,{courier:r,id:i}=this,s=r.get_recorder(),o=this.items.find(e=>e.id===t);if(!o)return;const a=o.lang;return o.lang=n,s.add_recover(zr.change_lang(i,t,a)),this.update_active_code_html(),s}change_theme(e){const{tabid:t,theme:n}=e,{courier:r,id:i}=this,s=r.get_recorder(),o=this.items.find(e=>e.id===t);if(!o)return;const a=o.theme;return o.theme=n,s.add_recover(zr.change_theme(i,t,a)),this.update_active_code_html(),s}code_update(e){const{tabid:t,code:n}=e,{courier:r,id:i}=this,s=r.get_recorder();s.add_cmd(e);const o=this.items.find(e=>e.id===t);if(!o)return;const a=o.code;return o.code=n,s.add_recover(zr.update(i,t,a)),this.update_active_code_html(),s}code_add(e){const{item:t,focus:n}=e,{courier:r,id:i}=this,s=r.get_recorder();return s.add_cmd(e),this.info.tabs.push(t),s.add_recover(zr.remove(i,t.id)),this.update_active_code_html(),n&&s.tell(this,zr.change_active(i,t.id)),(0,c.dY)(()=>{this._draglist?.init()}),s}code_remove(e){const{tabid:t}=e,{courier:n,id:r}=this,i=n.get_recorder();i.add_cmd(e);const s=this.items.find(e=>e.id===t);if(!s)return;const o=this.items.indexOf(s),a=this.items[o-1]||this.items[o+1];return o>=0&&this.items.splice(o,1),i.add_recover(zr.add(r,s)),a&&(this.active_tab_id=a.id),this.update_active_code_html(),(0,c.dY)(()=>{this._draglist?.init()}),i}code_rename(e){const{tabid:t,filename:n}=e,{courier:r,id:i}=this,s=r.get_recorder();s.add_cmd(e);const o=this.items.find(e=>e.id===t);if(!o)return;const a=o.name;return o.name=n,s.add_recover(zr.rename(i,t,a)),s}change_active(e){const{tabid:t}=e,{courier:n,id:r}=this,i=n.get_recorder(),s=this.items.find(e=>e.id===t);if(!s)return s;const o=this.active_tab_id;return this.active_tab_id=t,i.add_recover(zr.change_active(r,o)),this.update_active_code_html(),i}on_cursor_in_tail(e){const{offset:t,from:n}=e,{courier:r,prev_cube:i,pcube:s,next_cube:o}=this,a=new _.vk(r),l=(this.meta,this.dom?.querySelector("textarea"));return l?.focus(),a}on_cursor_in_head(e){const{offset:t,from:n}=e,{courier:r,prev_cube:i,pcube:s,next_cube:o}=this,a=new _.vk(r),l=(this.meta,this.dom?.querySelector("textarea"));return l?.focus(),a}static get meta(){return{cubename:"代码块",type:a.u0.code,block:!0,version:1,show:!0}}static get_default(){return{id:g.I.get_id(),type:a.u0.code,info:{tabs:[],active_tab_id:""},attrs:{width:560,height:200,codebg:"transparent",caret:"black"},css:{}}}static get_default_by_string(e="typescript",t=""){const n={name:`code${this.get_format_from_lang(e)}`,id:g.I.get_id(),code:t,lang:e,theme:"andromeeda"};return{id:g.I.get_id(),type:a.u0.code,info:{tabs:[n],active_tab_id:n.id},attrs:{width:560,height:200,codebg:"transparent",caret:"black"},css:{}}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();return n[r]=i,t.id=i,t}static get_format_from_lang(e){for(let t in Ja)if(Ja[t]===e)return t;return""}static get_lang_from_format(e){return Ja[e]}}tl([(0,k.H)(a.GW.change_lang)],rl.prototype,"change_lang",null),tl([(0,k.H)(a.GW.change_theme)],rl.prototype,"change_theme",null),tl([(0,k.H)(a.GW.code_update)],rl.prototype,"code_update",null),tl([(0,k.H)(a.GW.code_add)],rl.prototype,"code_add",null),tl([(0,k.H)(a.GW.code_remove)],rl.prototype,"code_remove",null),tl([(0,k.H)(a.GW.code_rename)],rl.prototype,"code_rename",null),tl([(0,k.H)(a.GW.change_active)],rl.prototype,"change_active",null),tl([(0,k.H)(a.K9.cursor_in_tail)],rl.prototype,"on_cursor_in_tail",null),tl([(0,k.H)(a.K9.cursor_in_head)],rl.prototype,"on_cursor_in_head",null);const il=["id","data-type","innerHTML"],sl=(0,c.pM)({__name:"cube-fomula",props:{cube:{}},setup(e){const{stats:t,event:n}=e.cube.root;function r(){n.emit_show_cube_editor(e.cube)}const i=(0,c.EW)(()=>{let t={...e.cube.css};return e.cube.attrs.block&&(t.display="block",t["text-align"]="center"),t});return(e,t)=>((0,c.uX)(),(0,c.CE)("span",{class:"cube-fomula",onClick:r,id:e.cube.id,"data-type":(0,l.R1)(a.u0).fomula,style:(0,d.Tr)(i.value),innerHTML:e.cube.mathml},null,12,il))}}),ol=(0,m.A)(sl,[["__scopeId","data-v-b85f3e3c"]]);class al{constructor(e,t,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}static range(e,t){return t?e&&e.loc&&t.loc&&e.loc.lexer===t.loc.lexer?new al(e.loc.lexer,e.loc.start,t.loc.end):null:e&&e.loc}}class ll{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(e,t){return new ll(t,al.range(this,e))}}class cl{constructor(e,t){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var n,r,i="KaTeX parse error: "+e,s=t&&t.loc;if(s&&s.start<=s.end){var o=s.lexer.input;n=s.start,r=s.end,n===o.length?i+=" at end of input: ":i+=" at position "+(n+1)+": ";var a=o.slice(n,r).replace(/[^]/g,"$&̲");i+=(n>15?"…"+o.slice(n-15,n):o.slice(0,n))+a+(r+15<o.length?o.slice(r,r+15)+"…":o.slice(r))}var l=new Error(i);return l.name="ParseError",l.__proto__=cl.prototype,l.position=n,null!=n&&null!=r&&(l.length=r-n),l.rawMessage=e,l}}cl.prototype.__proto__=Error.prototype;var dl=/([A-Z])/g,ul={"&":"&",">":">","<":"<",'"':""","'":"'"},hl=/[&><"']/g,pl=function e(t){return"ordgroup"===t.type||"color"===t.type?1===t.body.length?e(t.body[0]):t:"font"===t.type?e(t.body):t},ml=function(e,t){return-1!==e.indexOf(t)},fl=function(e,t){return void 0===e?t:e},_l=function(e){return String(e).replace(hl,e=>ul[e])},gl=function(e){return e.replace(dl,"-$1").toLowerCase()},bl=pl,yl=function(e){var t=pl(e);return"mathord"===t.type||"textord"===t.type||"atom"===t.type},vl=function(e){var t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?":"!==t[2]?null:/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?t[1].toLowerCase():null:"_relative"},wl={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand <n>",cliProcessor:e=>"Infinity"===e?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function xl(e){if(e.default)return e.default;var t=e.type,n=Array.isArray(t)?t[0]:t;if("string"!=typeof n)return n.enum[0];switch(n){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class kl{constructor(e){for(var t in this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{},wl)if(wl.hasOwnProperty(t)){var n=wl[t];this[t]=void 0!==e[t]?n.processor?n.processor(e[t]):e[t]:xl(n)}}reportNonstrict(e,t,n){var r=this.strict;if("function"==typeof r&&(r=r(e,t,n)),r&&"ignore"!==r){if(!0===r||"error"===r)throw new cl("LaTeX-incompatible input and strict mode is set to 'error': "+t+" ["+e+"]",n);"warn"===r?"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"):"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+r+"': "+t+" ["+e+"]")}}useStrictBehavior(e,t,n){var r=this.strict;if("function"==typeof r)try{r=r(e,t,n)}catch(e){r="error"}return!(!r||"ignore"===r||!0!==r&&"error"!==r&&("warn"===r?("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"),1):("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+r+"': "+t+" ["+e+"]"),1)))}isTrusted(e){if(e.url&&!e.protocol){var t=vl(e.url);if(null==t)return!1;e.protocol=t}var n="function"==typeof this.trust?this.trust(e):this.trust;return Boolean(n)}}class Sl{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return Cl[Ml[this.id]]}sub(){return Cl[Ll[this.id]]}fracNum(){return Cl[Tl[this.id]]}fracDen(){return Cl[zl[this.id]]}cramp(){return Cl[Al[this.id]]}text(){return Cl[Rl[this.id]]}isTight(){return this.size>=2}}var Cl=[new Sl(0,0,!1),new Sl(1,0,!0),new Sl(2,1,!1),new Sl(3,1,!0),new Sl(4,2,!1),new Sl(5,2,!0),new Sl(6,3,!1),new Sl(7,3,!0)],Ml=[4,5,4,5,6,7,6,7],Ll=[5,5,5,5,7,7,7,7],Tl=[2,3,4,5,6,7,6,7],zl=[3,3,5,5,7,7,7,7],Al=[1,1,3,3,5,5,7,7],Rl=[0,1,2,3,2,3,2,3],Pl={DISPLAY:Cl[0],TEXT:Cl[2],SCRIPT:Cl[4],SCRIPTSCRIPT:Cl[6]},Nl=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}],El=[];function Ol(e){for(var t=0;t<El.length;t+=2)if(e>=El[t]&&e<=El[t+1])return!0;return!1}Nl.forEach(e=>e.blocks.forEach(e=>El.push(...e)));var Il={doubleleftarrow:"M262 157\nl10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3\n 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28\n 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5\nc2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5\n 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z",doublerightarrow:"M399738 392l\n-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5\n 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88\n-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68\n-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\nc-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z",leftarrow:"M400000 241H110l3-3c68.7-52.7 113.7-120\n 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8\n-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247\nc-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208\n 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3\n 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202\n l-3-3h399890zM100 241v40h399900v-40z",leftbrace:"M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\n 5-6 9-10 13-.7 1-7.3 1-20 1H6z",leftbraceunder:"M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\n 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z",leftgroup:"M400000 80\nH435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0\n 435 0h399565z",leftgroupunder:"M400000 262\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\n 435 219h399565z",leftharpoon:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\n-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5\n-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7\n-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z",leftharpoonplus:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5\n 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3\n-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\nm0 0v40h400000v-40z",leftharpoondown:"M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333\n 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5\n 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667\n-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z",leftharpoondownplus:"M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12\n 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7\n-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0\nv40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z",lefthook:"M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5\n-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3\n-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21\n 71.5 23h399859zM103 281v-40h399897v40z",leftlinesegment:"M40 281 V428 H0 V94 H40 V241 H400000 v40z\nM40 281 V428 H0 V94 H40 V241 H400000 v40z",leftmapsto:"M40 281 V448H0V74H40V241H400000v40z\nM40 281 V448H0V74H40V241H400000v40z",leftToFrom:"M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23\n-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8\nc28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3\n 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z",longequal:"M0 50 h400000 v40H0z m0 194h40000v40H0z\nM0 50 h400000 v40H0z m0 194h40000v40H0z",midbrace:"M200428 334\nc-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14\n-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7\n 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11\n 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z",midbraceunder:"M199572 214\nc100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\n 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0\n-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z",oiintSize1:"M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6\n-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z\nm368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8\n60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z",oiintSize2:"M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8\n-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z\nm502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2\nc0 110 84 276 504 276s502.4-166 502.4-276z",oiiintSize1:"M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6\n-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z\nm525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0\n85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z",oiiintSize2:"M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8\n-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z\nm770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1\nc0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z",rightarrow:"M0 241v40h399891c-47.3 35.3-84 78-110 128\n-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20\n 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7\n 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85\n-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n 151.7 139 205zm0 0v40h399900v-40z",rightbrace:"M400000 542l\n-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5\ns-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1\nc124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z",rightbraceunder:"M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\n-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z",rightgroup:"M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0\n 3-1 3-3v-38c-76-158-257-219-435-219H0z",rightgroupunder:"M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18\n 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z",rightharpoon:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3\n-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2\n-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58\n 69.2 92 94.5zm0 0v40h399900v-40z",rightharpoonplus:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11\n-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7\n 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z\nm0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z",rightharpoondown:"M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8\n 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5\n-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95\n-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z",rightharpoondownplus:"M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8\n 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3\n 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3\n-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z\nm0-194v40h400000v-40zm0 0v40h400000v-40z",righthook:"M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3\n 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0\n-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21\n 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z",rightlinesegment:"M399960 241 V94 h40 V428 h-40 V281 H0 v-40z\nM399960 241 V94 h40 V428 h-40 V281 H0 v-40z",rightToFrom:"M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23\n 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32\n-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142\n-167z M100 147v40h399900v-40zM0 341v40h399900v-40z",twoheadleftarrow:"M0 167c68 40\n 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69\n-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3\n-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19\n-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101\n 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z",twoheadrightarrow:"M400000 167\nc-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3\n 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42\n 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333\n-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70\n 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z",tilde1:"M200 55.538c-77 0-168 73.953-177 73.953-3 0-7\n-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0\n 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0\n 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128\n-68.267.847-113-73.952-191-73.952z",tilde2:"M344 55.266c-142 0-300.638 81.316-311.5 86.418\n-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9\n 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114\nc1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751\n 181.476 676 181.476c-149 0-189-126.21-332-126.21z",tilde3:"M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457\n-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0\n 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697\n 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696\n -338 0-409-156.573-744-156.573z",tilde4:"M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345\n-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409\n 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9\n 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409\n -175.236-744-175.236z",vec:"M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5\n3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11\n10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63\n-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1\n-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59\nH213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359\nc-16-25.333-24-45-24-59z",widehat1:"M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22\nc-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z",widehat2:"M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat3:"M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat4:"M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widecheck1:"M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,\n-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z",widecheck2:"M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck3:"M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck4:"M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",baraboveleftarrow:"M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202\nc4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5\nc-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130\ns-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47\n121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6\ns2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11\nc0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z\nM100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z",rightarrowabovebar:"M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32\n-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0\n13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39\n-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5\n-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z",baraboveshortleftharpoon:"M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17\nc2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21\nc-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40\nc-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z\nM0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z",rightharpoonaboveshortbar:"M0,241 l0,40c399126,0,399993,0,399993,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z",shortbaraboveleftharpoon:"M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,\n1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,\n-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z\nM93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z",shortrightharpoonabovebar:"M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z"};class Bl{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return ml(this.classes,e)}toNode(){for(var e=document.createDocumentFragment(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){for(var e="",t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){return this.children.map(e=>e.toText()).join("")}}var Dl={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Vl={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},Hl={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function jl(e,t,n){if(!Dl[t])throw new Error("Font metrics not found for font: "+t+".");var r=e.charCodeAt(0),i=Dl[t][r];if(!i&&e[0]in Hl&&(r=Hl[e[0]].charCodeAt(0),i=Dl[t][r]),i||"text"!==n||Ol(r)&&(i=Dl[t][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var Fl={},Ul=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],ql=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],$l=function(e,t){return t.size<2?e:Ul[e-1][t.size-1]};class Gl{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||Gl.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=ql[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return new Gl(t)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:$l(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:ql[e-1]})}havingBaseStyle(e){e=e||this.style.text();var t=$l(Gl.BASESIZE,e);return this.size===t&&this.textSize===Gl.BASESIZE&&this.style===e?this:this.extend({style:e,size:t})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Gl.BASESIZE?["sizing","reset-size"+this.size,"size"+Gl.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=function(e){var t;if(!Fl[t=e>=5?0:e>=3?1:2]){var n=Fl[t]={cssEmPerMu:Vl.quad[t]/18};for(var r in Vl)Vl.hasOwnProperty(r)&&(n[r]=Vl[r][t])}return Fl[t]}(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Gl.BASESIZE=6;var Xl={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:1.00375,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:1.00375},Kl={ex:!0,em:!0,mu:!0},Wl=function(e){return"string"!=typeof e&&(e=e.unit),e in Xl||e in Kl||"ex"===e},Yl=function(e,t){var n;if(e.unit in Xl)n=Xl[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if("mu"===e.unit)n=t.fontMetrics().cssEmPerMu;else{var r;if(r=t.style.isTight()?t.havingStyle(t.style.text()):t,"ex"===e.unit)n=r.fontMetrics().xHeight;else{if("em"!==e.unit)throw new cl("Invalid unit: '"+e.unit+"'");n=r.fontMetrics().quad}r!==t&&(n*=r.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},Zl=function(e){return+e.toFixed(4)+"em"},Ql=function(e){return e.filter(e=>e).join(" ")},Jl=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push("mtight");var r=t.getColor();r&&(this.style.color=r)}},ec=function(e){var t=document.createElement(e);for(var n in t.className=Ql(this.classes),this.style)this.style.hasOwnProperty(n)&&(t.style[n]=this.style[n]);for(var r in this.attributes)this.attributes.hasOwnProperty(r)&&t.setAttribute(r,this.attributes[r]);for(var i=0;i<this.children.length;i++)t.appendChild(this.children[i].toNode());return t},tc=/[\s"'>/=\x00-\x1f]/,nc=function(e){var t="<"+e;this.classes.length&&(t+=' class="'+_l(Ql(this.classes))+'"');var n="";for(var r in this.style)this.style.hasOwnProperty(r)&&(n+=gl(r)+":"+this.style[r]+";");for(var i in n&&(t+=' style="'+_l(n)+'"'),this.attributes)if(this.attributes.hasOwnProperty(i)){if(tc.test(i))throw new cl("Invalid attribute name '"+i+"'");t+=" "+i+'="'+_l(this.attributes[i])+'"'}t+=">";for(var s=0;s<this.children.length;s++)t+=this.children[s].toMarkup();return t+"</"+e+">"};class rc{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,Jl.call(this,e,n,r),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return ml(this.classes,e)}toNode(){return ec.call(this,"span")}toMarkup(){return nc.call(this,"span")}}class ic{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,Jl.call(this,t,r),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return ml(this.classes,e)}toNode(){return ec.call(this,"a")}toMarkup(){return nc.call(this,"a")}}class sc{constructor(e,t,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=["mord"],this.style=n}hasClass(e){return ml(this.classes,e)}toNode(){var e=document.createElement("img");for(var t in e.src=this.src,e.alt=this.alt,e.className="mord",this.style)this.style.hasOwnProperty(t)&&(e.style[t]=this.style[t]);return e}toMarkup(){var e='<img src="'+_l(this.src)+'" alt="'+_l(this.alt)+'"',t="";for(var n in this.style)this.style.hasOwnProperty(n)&&(t+=gl(n)+":"+this.style[n]+";");return t&&(e+=' style="'+_l(t)+'"'),e+"'/>"}}var oc={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class ac{constructor(e,t,n,r,i,s,o,a){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=n||0,this.italic=r||0,this.skew=i||0,this.width=s||0,this.classes=o||[],this.style=a||{},this.maxFontSize=0;var l=function(e){for(var t=0;t<Nl.length;t++)for(var n=Nl[t],r=0;r<n.blocks.length;r++){var i=n.blocks[r];if(e>=i[0]&&e<=i[1])return n.name}return null}(this.text.charCodeAt(0));l&&this.classes.push(l+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=oc[this.text])}hasClass(e){return ml(this.classes,e)}toNode(){var e=document.createTextNode(this.text),t=null;for(var n in this.italic>0&&((t=document.createElement("span")).style.marginRight=Zl(this.italic)),this.classes.length>0&&((t=t||document.createElement("span")).className=Ql(this.classes)),this.style)this.style.hasOwnProperty(n)&&((t=t||document.createElement("span")).style[n]=this.style[n]);return t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t="<span";this.classes.length&&(e=!0,t+=' class="',t+=_l(Ql(this.classes)),t+='"');var n="";for(var r in this.italic>0&&(n+="margin-right:"+this.italic+"em;"),this.style)this.style.hasOwnProperty(r)&&(n+=gl(r)+":"+this.style[r]+";");n&&(e=!0,t+=' style="'+_l(n)+'"');var i=_l(this.text);return e?(t+=">",t+=i,t+="</span>"):i}}class lc{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);for(var n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){var e='<svg xmlns="http://www.w3.org/2000/svg"';for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="'+_l(this.attributes[t])+'"');e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+"</svg>"}}class cc{constructor(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","path");return this.alternate?e.setAttribute("d",this.alternate):e.setAttribute("d",Il[this.pathName]),e}toMarkup(){return this.alternate?'<path d="'+_l(this.alternate)+'"/>':'<path d="'+_l(Il[this.pathName])+'"/>'}}class dc{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","line");for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);return e}toMarkup(){var e="<line";for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="'+_l(this.attributes[t])+'"');return e+"/>"}}function uc(e){if(e instanceof ac)return e;throw new Error("Expected symbolNode but got "+String(e)+".")}var hc={bin:1,close:1,inner:1,open:1,punct:1,rel:1},pc={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},mc={math:{},text:{}};function fc(e,t,n,r,i,s){mc[e][i]={font:t,group:n,replace:r},s&&r&&(mc[e][r]=mc[e][i])}var _c="math",gc="text",bc="main",yc="ams",vc="accent-token",wc="bin",xc="close",kc="inner",Sc="mathord",Cc="op-token",Mc="open",Lc="punct",Tc="rel",zc="spacing",Ac="textord";fc(_c,bc,Tc,"≡","\\equiv",!0),fc(_c,bc,Tc,"≺","\\prec",!0),fc(_c,bc,Tc,"≻","\\succ",!0),fc(_c,bc,Tc,"∼","\\sim",!0),fc(_c,bc,Tc,"⊥","\\perp"),fc(_c,bc,Tc,"⪯","\\preceq",!0),fc(_c,bc,Tc,"⪰","\\succeq",!0),fc(_c,bc,Tc,"≃","\\simeq",!0),fc(_c,bc,Tc,"∣","\\mid",!0),fc(_c,bc,Tc,"≪","\\ll",!0),fc(_c,bc,Tc,"≫","\\gg",!0),fc(_c,bc,Tc,"≍","\\asymp",!0),fc(_c,bc,Tc,"∥","\\parallel"),fc(_c,bc,Tc,"⋈","\\bowtie",!0),fc(_c,bc,Tc,"⌣","\\smile",!0),fc(_c,bc,Tc,"⊑","\\sqsubseteq",!0),fc(_c,bc,Tc,"⊒","\\sqsupseteq",!0),fc(_c,bc,Tc,"≐","\\doteq",!0),fc(_c,bc,Tc,"⌢","\\frown",!0),fc(_c,bc,Tc,"∋","\\ni",!0),fc(_c,bc,Tc,"∝","\\propto",!0),fc(_c,bc,Tc,"⊢","\\vdash",!0),fc(_c,bc,Tc,"⊣","\\dashv",!0),fc(_c,bc,Tc,"∋","\\owns"),fc(_c,bc,Lc,".","\\ldotp"),fc(_c,bc,Lc,"⋅","\\cdotp"),fc(_c,bc,Ac,"#","\\#"),fc(gc,bc,Ac,"#","\\#"),fc(_c,bc,Ac,"&","\\&"),fc(gc,bc,Ac,"&","\\&"),fc(_c,bc,Ac,"ℵ","\\aleph",!0),fc(_c,bc,Ac,"∀","\\forall",!0),fc(_c,bc,Ac,"ℏ","\\hbar",!0),fc(_c,bc,Ac,"∃","\\exists",!0),fc(_c,bc,Ac,"∇","\\nabla",!0),fc(_c,bc,Ac,"♭","\\flat",!0),fc(_c,bc,Ac,"ℓ","\\ell",!0),fc(_c,bc,Ac,"♮","\\natural",!0),fc(_c,bc,Ac,"♣","\\clubsuit",!0),fc(_c,bc,Ac,"℘","\\wp",!0),fc(_c,bc,Ac,"♯","\\sharp",!0),fc(_c,bc,Ac,"♢","\\diamondsuit",!0),fc(_c,bc,Ac,"ℜ","\\Re",!0),fc(_c,bc,Ac,"♡","\\heartsuit",!0),fc(_c,bc,Ac,"ℑ","\\Im",!0),fc(_c,bc,Ac,"♠","\\spadesuit",!0),fc(_c,bc,Ac,"§","\\S",!0),fc(gc,bc,Ac,"§","\\S"),fc(_c,bc,Ac,"¶","\\P",!0),fc(gc,bc,Ac,"¶","\\P"),fc(_c,bc,Ac,"†","\\dag"),fc(gc,bc,Ac,"†","\\dag"),fc(gc,bc,Ac,"†","\\textdagger"),fc(_c,bc,Ac,"‡","\\ddag"),fc(gc,bc,Ac,"‡","\\ddag"),fc(gc,bc,Ac,"‡","\\textdaggerdbl"),fc(_c,bc,xc,"⎱","\\rmoustache",!0),fc(_c,bc,Mc,"⎰","\\lmoustache",!0),fc(_c,bc,xc,"⟯","\\rgroup",!0),fc(_c,bc,Mc,"⟮","\\lgroup",!0),fc(_c,bc,wc,"∓","\\mp",!0),fc(_c,bc,wc,"⊖","\\ominus",!0),fc(_c,bc,wc,"⊎","\\uplus",!0),fc(_c,bc,wc,"⊓","\\sqcap",!0),fc(_c,bc,wc,"∗","\\ast"),fc(_c,bc,wc,"⊔","\\sqcup",!0),fc(_c,bc,wc,"◯","\\bigcirc",!0),fc(_c,bc,wc,"∙","\\bullet",!0),fc(_c,bc,wc,"‡","\\ddagger"),fc(_c,bc,wc,"≀","\\wr",!0),fc(_c,bc,wc,"⨿","\\amalg"),fc(_c,bc,wc,"&","\\And"),fc(_c,bc,Tc,"⟵","\\longleftarrow",!0),fc(_c,bc,Tc,"⇐","\\Leftarrow",!0),fc(_c,bc,Tc,"⟸","\\Longleftarrow",!0),fc(_c,bc,Tc,"⟶","\\longrightarrow",!0),fc(_c,bc,Tc,"⇒","\\Rightarrow",!0),fc(_c,bc,Tc,"⟹","\\Longrightarrow",!0),fc(_c,bc,Tc,"↔","\\leftrightarrow",!0),fc(_c,bc,Tc,"⟷","\\longleftrightarrow",!0),fc(_c,bc,Tc,"⇔","\\Leftrightarrow",!0),fc(_c,bc,Tc,"⟺","\\Longleftrightarrow",!0),fc(_c,bc,Tc,"↦","\\mapsto",!0),fc(_c,bc,Tc,"⟼","\\longmapsto",!0),fc(_c,bc,Tc,"↗","\\nearrow",!0),fc(_c,bc,Tc,"↩","\\hookleftarrow",!0),fc(_c,bc,Tc,"↪","\\hookrightarrow",!0),fc(_c,bc,Tc,"↘","\\searrow",!0),fc(_c,bc,Tc,"↼","\\leftharpoonup",!0),fc(_c,bc,Tc,"⇀","\\rightharpoonup",!0),fc(_c,bc,Tc,"↙","\\swarrow",!0),fc(_c,bc,Tc,"↽","\\leftharpoondown",!0),fc(_c,bc,Tc,"⇁","\\rightharpoondown",!0),fc(_c,bc,Tc,"↖","\\nwarrow",!0),fc(_c,bc,Tc,"⇌","\\rightleftharpoons",!0),fc(_c,yc,Tc,"≮","\\nless",!0),fc(_c,yc,Tc,"","\\@nleqslant"),fc(_c,yc,Tc,"","\\@nleqq"),fc(_c,yc,Tc,"⪇","\\lneq",!0),fc(_c,yc,Tc,"≨","\\lneqq",!0),fc(_c,yc,Tc,"","\\@lvertneqq"),fc(_c,yc,Tc,"⋦","\\lnsim",!0),fc(_c,yc,Tc,"⪉","\\lnapprox",!0),fc(_c,yc,Tc,"⊀","\\nprec",!0),fc(_c,yc,Tc,"⋠","\\npreceq",!0),fc(_c,yc,Tc,"⋨","\\precnsim",!0),fc(_c,yc,Tc,"⪹","\\precnapprox",!0),fc(_c,yc,Tc,"≁","\\nsim",!0),fc(_c,yc,Tc,"","\\@nshortmid"),fc(_c,yc,Tc,"∤","\\nmid",!0),fc(_c,yc,Tc,"⊬","\\nvdash",!0),fc(_c,yc,Tc,"⊭","\\nvDash",!0),fc(_c,yc,Tc,"⋪","\\ntriangleleft"),fc(_c,yc,Tc,"⋬","\\ntrianglelefteq",!0),fc(_c,yc,Tc,"⊊","\\subsetneq",!0),fc(_c,yc,Tc,"","\\@varsubsetneq"),fc(_c,yc,Tc,"⫋","\\subsetneqq",!0),fc(_c,yc,Tc,"","\\@varsubsetneqq"),fc(_c,yc,Tc,"≯","\\ngtr",!0),fc(_c,yc,Tc,"","\\@ngeqslant"),fc(_c,yc,Tc,"","\\@ngeqq"),fc(_c,yc,Tc,"⪈","\\gneq",!0),fc(_c,yc,Tc,"≩","\\gneqq",!0),fc(_c,yc,Tc,"","\\@gvertneqq"),fc(_c,yc,Tc,"⋧","\\gnsim",!0),fc(_c,yc,Tc,"⪊","\\gnapprox",!0),fc(_c,yc,Tc,"⊁","\\nsucc",!0),fc(_c,yc,Tc,"⋡","\\nsucceq",!0),fc(_c,yc,Tc,"⋩","\\succnsim",!0),fc(_c,yc,Tc,"⪺","\\succnapprox",!0),fc(_c,yc,Tc,"≆","\\ncong",!0),fc(_c,yc,Tc,"","\\@nshortparallel"),fc(_c,yc,Tc,"∦","\\nparallel",!0),fc(_c,yc,Tc,"⊯","\\nVDash",!0),fc(_c,yc,Tc,"⋫","\\ntriangleright"),fc(_c,yc,Tc,"⋭","\\ntrianglerighteq",!0),fc(_c,yc,Tc,"","\\@nsupseteqq"),fc(_c,yc,Tc,"⊋","\\supsetneq",!0),fc(_c,yc,Tc,"","\\@varsupsetneq"),fc(_c,yc,Tc,"⫌","\\supsetneqq",!0),fc(_c,yc,Tc,"","\\@varsupsetneqq"),fc(_c,yc,Tc,"⊮","\\nVdash",!0),fc(_c,yc,Tc,"⪵","\\precneqq",!0),fc(_c,yc,Tc,"⪶","\\succneqq",!0),fc(_c,yc,Tc,"","\\@nsubseteqq"),fc(_c,yc,wc,"⊴","\\unlhd"),fc(_c,yc,wc,"⊵","\\unrhd"),fc(_c,yc,Tc,"↚","\\nleftarrow",!0),fc(_c,yc,Tc,"↛","\\nrightarrow",!0),fc(_c,yc,Tc,"⇍","\\nLeftarrow",!0),fc(_c,yc,Tc,"⇏","\\nRightarrow",!0),fc(_c,yc,Tc,"↮","\\nleftrightarrow",!0),fc(_c,yc,Tc,"⇎","\\nLeftrightarrow",!0),fc(_c,yc,Tc,"△","\\vartriangle"),fc(_c,yc,Ac,"ℏ","\\hslash"),fc(_c,yc,Ac,"▽","\\triangledown"),fc(_c,yc,Ac,"◊","\\lozenge"),fc(_c,yc,Ac,"Ⓢ","\\circledS"),fc(_c,yc,Ac,"®","\\circledR"),fc(gc,yc,Ac,"®","\\circledR"),fc(_c,yc,Ac,"∡","\\measuredangle",!0),fc(_c,yc,Ac,"∄","\\nexists"),fc(_c,yc,Ac,"℧","\\mho"),fc(_c,yc,Ac,"Ⅎ","\\Finv",!0),fc(_c,yc,Ac,"⅁","\\Game",!0),fc(_c,yc,Ac,"‵","\\backprime"),fc(_c,yc,Ac,"▲","\\blacktriangle"),fc(_c,yc,Ac,"▼","\\blacktriangledown"),fc(_c,yc,Ac,"■","\\blacksquare"),fc(_c,yc,Ac,"⧫","\\blacklozenge"),fc(_c,yc,Ac,"★","\\bigstar"),fc(_c,yc,Ac,"∢","\\sphericalangle",!0),fc(_c,yc,Ac,"∁","\\complement",!0),fc(_c,yc,Ac,"ð","\\eth",!0),fc(gc,bc,Ac,"ð","ð"),fc(_c,yc,Ac,"╱","\\diagup"),fc(_c,yc,Ac,"╲","\\diagdown"),fc(_c,yc,Ac,"□","\\square"),fc(_c,yc,Ac,"□","\\Box"),fc(_c,yc,Ac,"◊","\\Diamond"),fc(_c,yc,Ac,"¥","\\yen",!0),fc(gc,yc,Ac,"¥","\\yen",!0),fc(_c,yc,Ac,"✓","\\checkmark",!0),fc(gc,yc,Ac,"✓","\\checkmark"),fc(_c,yc,Ac,"ℶ","\\beth",!0),fc(_c,yc,Ac,"ℸ","\\daleth",!0),fc(_c,yc,Ac,"ℷ","\\gimel",!0),fc(_c,yc,Ac,"ϝ","\\digamma",!0),fc(_c,yc,Ac,"ϰ","\\varkappa"),fc(_c,yc,Mc,"┌","\\@ulcorner",!0),fc(_c,yc,xc,"┐","\\@urcorner",!0),fc(_c,yc,Mc,"└","\\@llcorner",!0),fc(_c,yc,xc,"┘","\\@lrcorner",!0),fc(_c,yc,Tc,"≦","\\leqq",!0),fc(_c,yc,Tc,"⩽","\\leqslant",!0),fc(_c,yc,Tc,"⪕","\\eqslantless",!0),fc(_c,yc,Tc,"≲","\\lesssim",!0),fc(_c,yc,Tc,"⪅","\\lessapprox",!0),fc(_c,yc,Tc,"≊","\\approxeq",!0),fc(_c,yc,wc,"⋖","\\lessdot"),fc(_c,yc,Tc,"⋘","\\lll",!0),fc(_c,yc,Tc,"≶","\\lessgtr",!0),fc(_c,yc,Tc,"⋚","\\lesseqgtr",!0),fc(_c,yc,Tc,"⪋","\\lesseqqgtr",!0),fc(_c,yc,Tc,"≑","\\doteqdot"),fc(_c,yc,Tc,"≓","\\risingdotseq",!0),fc(_c,yc,Tc,"≒","\\fallingdotseq",!0),fc(_c,yc,Tc,"∽","\\backsim",!0),fc(_c,yc,Tc,"⋍","\\backsimeq",!0),fc(_c,yc,Tc,"⫅","\\subseteqq",!0),fc(_c,yc,Tc,"⋐","\\Subset",!0),fc(_c,yc,Tc,"⊏","\\sqsubset",!0),fc(_c,yc,Tc,"≼","\\preccurlyeq",!0),fc(_c,yc,Tc,"⋞","\\curlyeqprec",!0),fc(_c,yc,Tc,"≾","\\precsim",!0),fc(_c,yc,Tc,"⪷","\\precapprox",!0),fc(_c,yc,Tc,"⊲","\\vartriangleleft"),fc(_c,yc,Tc,"⊴","\\trianglelefteq"),fc(_c,yc,Tc,"⊨","\\vDash",!0),fc(_c,yc,Tc,"⊪","\\Vvdash",!0),fc(_c,yc,Tc,"⌣","\\smallsmile"),fc(_c,yc,Tc,"⌢","\\smallfrown"),fc(_c,yc,Tc,"≏","\\bumpeq",!0),fc(_c,yc,Tc,"≎","\\Bumpeq",!0),fc(_c,yc,Tc,"≧","\\geqq",!0),fc(_c,yc,Tc,"⩾","\\geqslant",!0),fc(_c,yc,Tc,"⪖","\\eqslantgtr",!0),fc(_c,yc,Tc,"≳","\\gtrsim",!0),fc(_c,yc,Tc,"⪆","\\gtrapprox",!0),fc(_c,yc,wc,"⋗","\\gtrdot"),fc(_c,yc,Tc,"⋙","\\ggg",!0),fc(_c,yc,Tc,"≷","\\gtrless",!0),fc(_c,yc,Tc,"⋛","\\gtreqless",!0),fc(_c,yc,Tc,"⪌","\\gtreqqless",!0),fc(_c,yc,Tc,"≖","\\eqcirc",!0),fc(_c,yc,Tc,"≗","\\circeq",!0),fc(_c,yc,Tc,"≜","\\triangleq",!0),fc(_c,yc,Tc,"∼","\\thicksim"),fc(_c,yc,Tc,"≈","\\thickapprox"),fc(_c,yc,Tc,"⫆","\\supseteqq",!0),fc(_c,yc,Tc,"⋑","\\Supset",!0),fc(_c,yc,Tc,"⊐","\\sqsupset",!0),fc(_c,yc,Tc,"≽","\\succcurlyeq",!0),fc(_c,yc,Tc,"⋟","\\curlyeqsucc",!0),fc(_c,yc,Tc,"≿","\\succsim",!0),fc(_c,yc,Tc,"⪸","\\succapprox",!0),fc(_c,yc,Tc,"⊳","\\vartriangleright"),fc(_c,yc,Tc,"⊵","\\trianglerighteq"),fc(_c,yc,Tc,"⊩","\\Vdash",!0),fc(_c,yc,Tc,"∣","\\shortmid"),fc(_c,yc,Tc,"∥","\\shortparallel"),fc(_c,yc,Tc,"≬","\\between",!0),fc(_c,yc,Tc,"⋔","\\pitchfork",!0),fc(_c,yc,Tc,"∝","\\varpropto"),fc(_c,yc,Tc,"◀","\\blacktriangleleft"),fc(_c,yc,Tc,"∴","\\therefore",!0),fc(_c,yc,Tc,"∍","\\backepsilon"),fc(_c,yc,Tc,"▶","\\blacktriangleright"),fc(_c,yc,Tc,"∵","\\because",!0),fc(_c,yc,Tc,"⋘","\\llless"),fc(_c,yc,Tc,"⋙","\\gggtr"),fc(_c,yc,wc,"⊲","\\lhd"),fc(_c,yc,wc,"⊳","\\rhd"),fc(_c,yc,Tc,"≂","\\eqsim",!0),fc(_c,bc,Tc,"⋈","\\Join"),fc(_c,yc,Tc,"≑","\\Doteq",!0),fc(_c,yc,wc,"∔","\\dotplus",!0),fc(_c,yc,wc,"∖","\\smallsetminus"),fc(_c,yc,wc,"⋒","\\Cap",!0),fc(_c,yc,wc,"⋓","\\Cup",!0),fc(_c,yc,wc,"⩞","\\doublebarwedge",!0),fc(_c,yc,wc,"⊟","\\boxminus",!0),fc(_c,yc,wc,"⊞","\\boxplus",!0),fc(_c,yc,wc,"⋇","\\divideontimes",!0),fc(_c,yc,wc,"⋉","\\ltimes",!0),fc(_c,yc,wc,"⋊","\\rtimes",!0),fc(_c,yc,wc,"⋋","\\leftthreetimes",!0),fc(_c,yc,wc,"⋌","\\rightthreetimes",!0),fc(_c,yc,wc,"⋏","\\curlywedge",!0),fc(_c,yc,wc,"⋎","\\curlyvee",!0),fc(_c,yc,wc,"⊝","\\circleddash",!0),fc(_c,yc,wc,"⊛","\\circledast",!0),fc(_c,yc,wc,"⋅","\\centerdot"),fc(_c,yc,wc,"⊺","\\intercal",!0),fc(_c,yc,wc,"⋒","\\doublecap"),fc(_c,yc,wc,"⋓","\\doublecup"),fc(_c,yc,wc,"⊠","\\boxtimes",!0),fc(_c,yc,Tc,"⇢","\\dashrightarrow",!0),fc(_c,yc,Tc,"⇠","\\dashleftarrow",!0),fc(_c,yc,Tc,"⇇","\\leftleftarrows",!0),fc(_c,yc,Tc,"⇆","\\leftrightarrows",!0),fc(_c,yc,Tc,"⇚","\\Lleftarrow",!0),fc(_c,yc,Tc,"↞","\\twoheadleftarrow",!0),fc(_c,yc,Tc,"↢","\\leftarrowtail",!0),fc(_c,yc,Tc,"↫","\\looparrowleft",!0),fc(_c,yc,Tc,"⇋","\\leftrightharpoons",!0),fc(_c,yc,Tc,"↶","\\curvearrowleft",!0),fc(_c,yc,Tc,"↺","\\circlearrowleft",!0),fc(_c,yc,Tc,"↰","\\Lsh",!0),fc(_c,yc,Tc,"⇈","\\upuparrows",!0),fc(_c,yc,Tc,"↿","\\upharpoonleft",!0),fc(_c,yc,Tc,"⇃","\\downharpoonleft",!0),fc(_c,bc,Tc,"⊶","\\origof",!0),fc(_c,bc,Tc,"⊷","\\imageof",!0),fc(_c,yc,Tc,"⊸","\\multimap",!0),fc(_c,yc,Tc,"↭","\\leftrightsquigarrow",!0),fc(_c,yc,Tc,"⇉","\\rightrightarrows",!0),fc(_c,yc,Tc,"⇄","\\rightleftarrows",!0),fc(_c,yc,Tc,"↠","\\twoheadrightarrow",!0),fc(_c,yc,Tc,"↣","\\rightarrowtail",!0),fc(_c,yc,Tc,"↬","\\looparrowright",!0),fc(_c,yc,Tc,"↷","\\curvearrowright",!0),fc(_c,yc,Tc,"↻","\\circlearrowright",!0),fc(_c,yc,Tc,"↱","\\Rsh",!0),fc(_c,yc,Tc,"⇊","\\downdownarrows",!0),fc(_c,yc,Tc,"↾","\\upharpoonright",!0),fc(_c,yc,Tc,"⇂","\\downharpoonright",!0),fc(_c,yc,Tc,"⇝","\\rightsquigarrow",!0),fc(_c,yc,Tc,"⇝","\\leadsto"),fc(_c,yc,Tc,"⇛","\\Rrightarrow",!0),fc(_c,yc,Tc,"↾","\\restriction"),fc(_c,bc,Ac,"‘","`"),fc(_c,bc,Ac,"$","\\$"),fc(gc,bc,Ac,"$","\\$"),fc(gc,bc,Ac,"$","\\textdollar"),fc(_c,bc,Ac,"%","\\%"),fc(gc,bc,Ac,"%","\\%"),fc(_c,bc,Ac,"_","\\_"),fc(gc,bc,Ac,"_","\\_"),fc(gc,bc,Ac,"_","\\textunderscore"),fc(_c,bc,Ac,"∠","\\angle",!0),fc(_c,bc,Ac,"∞","\\infty",!0),fc(_c,bc,Ac,"′","\\prime"),fc(_c,bc,Ac,"△","\\triangle"),fc(_c,bc,Ac,"Γ","\\Gamma",!0),fc(_c,bc,Ac,"Δ","\\Delta",!0),fc(_c,bc,Ac,"Θ","\\Theta",!0),fc(_c,bc,Ac,"Λ","\\Lambda",!0),fc(_c,bc,Ac,"Ξ","\\Xi",!0),fc(_c,bc,Ac,"Π","\\Pi",!0),fc(_c,bc,Ac,"Σ","\\Sigma",!0),fc(_c,bc,Ac,"Υ","\\Upsilon",!0),fc(_c,bc,Ac,"Φ","\\Phi",!0),fc(_c,bc,Ac,"Ψ","\\Psi",!0),fc(_c,bc,Ac,"Ω","\\Omega",!0),fc(_c,bc,Ac,"A","Α"),fc(_c,bc,Ac,"B","Β"),fc(_c,bc,Ac,"E","Ε"),fc(_c,bc,Ac,"Z","Ζ"),fc(_c,bc,Ac,"H","Η"),fc(_c,bc,Ac,"I","Ι"),fc(_c,bc,Ac,"K","Κ"),fc(_c,bc,Ac,"M","Μ"),fc(_c,bc,Ac,"N","Ν"),fc(_c,bc,Ac,"O","Ο"),fc(_c,bc,Ac,"P","Ρ"),fc(_c,bc,Ac,"T","Τ"),fc(_c,bc,Ac,"X","Χ"),fc(_c,bc,Ac,"¬","\\neg",!0),fc(_c,bc,Ac,"¬","\\lnot"),fc(_c,bc,Ac,"⊤","\\top"),fc(_c,bc,Ac,"⊥","\\bot"),fc(_c,bc,Ac,"∅","\\emptyset"),fc(_c,yc,Ac,"∅","\\varnothing"),fc(_c,bc,Sc,"α","\\alpha",!0),fc(_c,bc,Sc,"β","\\beta",!0),fc(_c,bc,Sc,"γ","\\gamma",!0),fc(_c,bc,Sc,"δ","\\delta",!0),fc(_c,bc,Sc,"ϵ","\\epsilon",!0),fc(_c,bc,Sc,"ζ","\\zeta",!0),fc(_c,bc,Sc,"η","\\eta",!0),fc(_c,bc,Sc,"θ","\\theta",!0),fc(_c,bc,Sc,"ι","\\iota",!0),fc(_c,bc,Sc,"κ","\\kappa",!0),fc(_c,bc,Sc,"λ","\\lambda",!0),fc(_c,bc,Sc,"μ","\\mu",!0),fc(_c,bc,Sc,"ν","\\nu",!0),fc(_c,bc,Sc,"ξ","\\xi",!0),fc(_c,bc,Sc,"ο","\\omicron",!0),fc(_c,bc,Sc,"π","\\pi",!0),fc(_c,bc,Sc,"ρ","\\rho",!0),fc(_c,bc,Sc,"σ","\\sigma",!0),fc(_c,bc,Sc,"τ","\\tau",!0),fc(_c,bc,Sc,"υ","\\upsilon",!0),fc(_c,bc,Sc,"ϕ","\\phi",!0),fc(_c,bc,Sc,"χ","\\chi",!0),fc(_c,bc,Sc,"ψ","\\psi",!0),fc(_c,bc,Sc,"ω","\\omega",!0),fc(_c,bc,Sc,"ε","\\varepsilon",!0),fc(_c,bc,Sc,"ϑ","\\vartheta",!0),fc(_c,bc,Sc,"ϖ","\\varpi",!0),fc(_c,bc,Sc,"ϱ","\\varrho",!0),fc(_c,bc,Sc,"ς","\\varsigma",!0),fc(_c,bc,Sc,"φ","\\varphi",!0),fc(_c,bc,wc,"∗","*",!0),fc(_c,bc,wc,"+","+"),fc(_c,bc,wc,"−","-",!0),fc(_c,bc,wc,"⋅","\\cdot",!0),fc(_c,bc,wc,"∘","\\circ",!0),fc(_c,bc,wc,"÷","\\div",!0),fc(_c,bc,wc,"±","\\pm",!0),fc(_c,bc,wc,"×","\\times",!0),fc(_c,bc,wc,"∩","\\cap",!0),fc(_c,bc,wc,"∪","\\cup",!0),fc(_c,bc,wc,"∖","\\setminus",!0),fc(_c,bc,wc,"∧","\\land"),fc(_c,bc,wc,"∨","\\lor"),fc(_c,bc,wc,"∧","\\wedge",!0),fc(_c,bc,wc,"∨","\\vee",!0),fc(_c,bc,Ac,"√","\\surd"),fc(_c,bc,Mc,"⟨","\\langle",!0),fc(_c,bc,Mc,"∣","\\lvert"),fc(_c,bc,Mc,"∥","\\lVert"),fc(_c,bc,xc,"?","?"),fc(_c,bc,xc,"!","!"),fc(_c,bc,xc,"⟩","\\rangle",!0),fc(_c,bc,xc,"∣","\\rvert"),fc(_c,bc,xc,"∥","\\rVert"),fc(_c,bc,Tc,"=","="),fc(_c,bc,Tc,":",":"),fc(_c,bc,Tc,"≈","\\approx",!0),fc(_c,bc,Tc,"≅","\\cong",!0),fc(_c,bc,Tc,"≥","\\ge"),fc(_c,bc,Tc,"≥","\\geq",!0),fc(_c,bc,Tc,"←","\\gets"),fc(_c,bc,Tc,">","\\gt",!0),fc(_c,bc,Tc,"∈","\\in",!0),fc(_c,bc,Tc,"","\\@not"),fc(_c,bc,Tc,"⊂","\\subset",!0),fc(_c,bc,Tc,"⊃","\\supset",!0),fc(_c,bc,Tc,"⊆","\\subseteq",!0),fc(_c,bc,Tc,"⊇","\\supseteq",!0),fc(_c,yc,Tc,"⊈","\\nsubseteq",!0),fc(_c,yc,Tc,"⊉","\\nsupseteq",!0),fc(_c,bc,Tc,"⊨","\\models"),fc(_c,bc,Tc,"←","\\leftarrow",!0),fc(_c,bc,Tc,"≤","\\le"),fc(_c,bc,Tc,"≤","\\leq",!0),fc(_c,bc,Tc,"<","\\lt",!0),fc(_c,bc,Tc,"→","\\rightarrow",!0),fc(_c,bc,Tc,"→","\\to"),fc(_c,yc,Tc,"≱","\\ngeq",!0),fc(_c,yc,Tc,"≰","\\nleq",!0),fc(_c,bc,zc," ","\\ "),fc(_c,bc,zc," ","\\space"),fc(_c,bc,zc," ","\\nobreakspace"),fc(gc,bc,zc," ","\\ "),fc(gc,bc,zc," "," "),fc(gc,bc,zc," ","\\space"),fc(gc,bc,zc," ","\\nobreakspace"),fc(_c,bc,zc,null,"\\nobreak"),fc(_c,bc,zc,null,"\\allowbreak"),fc(_c,bc,Lc,",",","),fc(_c,bc,Lc,";",";"),fc(_c,yc,wc,"⊼","\\barwedge",!0),fc(_c,yc,wc,"⊻","\\veebar",!0),fc(_c,bc,wc,"⊙","\\odot",!0),fc(_c,bc,wc,"⊕","\\oplus",!0),fc(_c,bc,wc,"⊗","\\otimes",!0),fc(_c,bc,Ac,"∂","\\partial",!0),fc(_c,bc,wc,"⊘","\\oslash",!0),fc(_c,yc,wc,"⊚","\\circledcirc",!0),fc(_c,yc,wc,"⊡","\\boxdot",!0),fc(_c,bc,wc,"△","\\bigtriangleup"),fc(_c,bc,wc,"▽","\\bigtriangledown"),fc(_c,bc,wc,"†","\\dagger"),fc(_c,bc,wc,"⋄","\\diamond"),fc(_c,bc,wc,"⋆","\\star"),fc(_c,bc,wc,"◃","\\triangleleft"),fc(_c,bc,wc,"▹","\\triangleright"),fc(_c,bc,Mc,"{","\\{"),fc(gc,bc,Ac,"{","\\{"),fc(gc,bc,Ac,"{","\\textbraceleft"),fc(_c,bc,xc,"}","\\}"),fc(gc,bc,Ac,"}","\\}"),fc(gc,bc,Ac,"}","\\textbraceright"),fc(_c,bc,Mc,"{","\\lbrace"),fc(_c,bc,xc,"}","\\rbrace"),fc(_c,bc,Mc,"[","\\lbrack",!0),fc(gc,bc,Ac,"[","\\lbrack",!0),fc(_c,bc,xc,"]","\\rbrack",!0),fc(gc,bc,Ac,"]","\\rbrack",!0),fc(_c,bc,Mc,"(","\\lparen",!0),fc(_c,bc,xc,")","\\rparen",!0),fc(gc,bc,Ac,"<","\\textless",!0),fc(gc,bc,Ac,">","\\textgreater",!0),fc(_c,bc,Mc,"⌊","\\lfloor",!0),fc(_c,bc,xc,"⌋","\\rfloor",!0),fc(_c,bc,Mc,"⌈","\\lceil",!0),fc(_c,bc,xc,"⌉","\\rceil",!0),fc(_c,bc,Ac,"\\","\\backslash"),fc(_c,bc,Ac,"∣","|"),fc(_c,bc,Ac,"∣","\\vert"),fc(gc,bc,Ac,"|","\\textbar",!0),fc(_c,bc,Ac,"∥","\\|"),fc(_c,bc,Ac,"∥","\\Vert"),fc(gc,bc,Ac,"∥","\\textbardbl"),fc(gc,bc,Ac,"~","\\textasciitilde"),fc(gc,bc,Ac,"\\","\\textbackslash"),fc(gc,bc,Ac,"^","\\textasciicircum"),fc(_c,bc,Tc,"↑","\\uparrow",!0),fc(_c,bc,Tc,"⇑","\\Uparrow",!0),fc(_c,bc,Tc,"↓","\\downarrow",!0),fc(_c,bc,Tc,"⇓","\\Downarrow",!0),fc(_c,bc,Tc,"↕","\\updownarrow",!0),fc(_c,bc,Tc,"⇕","\\Updownarrow",!0),fc(_c,bc,Cc,"∐","\\coprod"),fc(_c,bc,Cc,"⋁","\\bigvee"),fc(_c,bc,Cc,"⋀","\\bigwedge"),fc(_c,bc,Cc,"⨄","\\biguplus"),fc(_c,bc,Cc,"⋂","\\bigcap"),fc(_c,bc,Cc,"⋃","\\bigcup"),fc(_c,bc,Cc,"∫","\\int"),fc(_c,bc,Cc,"∫","\\intop"),fc(_c,bc,Cc,"∬","\\iint"),fc(_c,bc,Cc,"∭","\\iiint"),fc(_c,bc,Cc,"∏","\\prod"),fc(_c,bc,Cc,"∑","\\sum"),fc(_c,bc,Cc,"⨂","\\bigotimes"),fc(_c,bc,Cc,"⨁","\\bigoplus"),fc(_c,bc,Cc,"⨀","\\bigodot"),fc(_c,bc,Cc,"∮","\\oint"),fc(_c,bc,Cc,"∯","\\oiint"),fc(_c,bc,Cc,"∰","\\oiiint"),fc(_c,bc,Cc,"⨆","\\bigsqcup"),fc(_c,bc,Cc,"∫","\\smallint"),fc(gc,bc,kc,"…","\\textellipsis"),fc(_c,bc,kc,"…","\\mathellipsis"),fc(gc,bc,kc,"…","\\ldots",!0),fc(_c,bc,kc,"…","\\ldots",!0),fc(_c,bc,kc,"⋯","\\@cdots",!0),fc(_c,bc,kc,"⋱","\\ddots",!0),fc(_c,bc,Ac,"⋮","\\varvdots"),fc(gc,bc,Ac,"⋮","\\varvdots"),fc(_c,bc,vc,"ˊ","\\acute"),fc(_c,bc,vc,"ˋ","\\grave"),fc(_c,bc,vc,"¨","\\ddot"),fc(_c,bc,vc,"~","\\tilde"),fc(_c,bc,vc,"ˉ","\\bar"),fc(_c,bc,vc,"˘","\\breve"),fc(_c,bc,vc,"ˇ","\\check"),fc(_c,bc,vc,"^","\\hat"),fc(_c,bc,vc,"⃗","\\vec"),fc(_c,bc,vc,"˙","\\dot"),fc(_c,bc,vc,"˚","\\mathring"),fc(_c,bc,Sc,"","\\@imath"),fc(_c,bc,Sc,"","\\@jmath"),fc(_c,bc,Ac,"ı","ı"),fc(_c,bc,Ac,"ȷ","ȷ"),fc(gc,bc,Ac,"ı","\\i",!0),fc(gc,bc,Ac,"ȷ","\\j",!0),fc(gc,bc,Ac,"ß","\\ss",!0),fc(gc,bc,Ac,"æ","\\ae",!0),fc(gc,bc,Ac,"œ","\\oe",!0),fc(gc,bc,Ac,"ø","\\o",!0),fc(gc,bc,Ac,"Æ","\\AE",!0),fc(gc,bc,Ac,"Œ","\\OE",!0),fc(gc,bc,Ac,"Ø","\\O",!0),fc(gc,bc,vc,"ˊ","\\'"),fc(gc,bc,vc,"ˋ","\\`"),fc(gc,bc,vc,"ˆ","\\^"),fc(gc,bc,vc,"˜","\\~"),fc(gc,bc,vc,"ˉ","\\="),fc(gc,bc,vc,"˘","\\u"),fc(gc,bc,vc,"˙","\\."),fc(gc,bc,vc,"¸","\\c"),fc(gc,bc,vc,"˚","\\r"),fc(gc,bc,vc,"ˇ","\\v"),fc(gc,bc,vc,"¨",'\\"'),fc(gc,bc,vc,"˝","\\H"),fc(gc,bc,vc,"◯","\\textcircled");var Rc={"--":!0,"---":!0,"``":!0,"''":!0};fc(gc,bc,Ac,"–","--",!0),fc(gc,bc,Ac,"–","\\textendash"),fc(gc,bc,Ac,"—","---",!0),fc(gc,bc,Ac,"—","\\textemdash"),fc(gc,bc,Ac,"‘","`",!0),fc(gc,bc,Ac,"‘","\\textquoteleft"),fc(gc,bc,Ac,"’","'",!0),fc(gc,bc,Ac,"’","\\textquoteright"),fc(gc,bc,Ac,"“","``",!0),fc(gc,bc,Ac,"“","\\textquotedblleft"),fc(gc,bc,Ac,"”","''",!0),fc(gc,bc,Ac,"”","\\textquotedblright"),fc(_c,bc,Ac,"°","\\degree",!0),fc(gc,bc,Ac,"°","\\degree"),fc(gc,bc,Ac,"°","\\textdegree",!0),fc(_c,bc,Ac,"£","\\pounds"),fc(_c,bc,Ac,"£","\\mathsterling",!0),fc(gc,bc,Ac,"£","\\pounds"),fc(gc,bc,Ac,"£","\\textsterling",!0),fc(_c,yc,Ac,"✠","\\maltese"),fc(gc,yc,Ac,"✠","\\maltese");for(var Pc=0;Pc<14;Pc++){var Nc='0123456789/@."'.charAt(Pc);fc(_c,bc,Ac,Nc,Nc)}for(var Ec=0;Ec<25;Ec++){var Oc='0123456789!@*()-=+";:?/.,'.charAt(Ec);fc(gc,bc,Ac,Oc,Oc)}for(var Ic="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Bc=0;Bc<52;Bc++){var Dc=Ic.charAt(Bc);fc(_c,bc,Sc,Dc,Dc),fc(gc,bc,Ac,Dc,Dc)}fc(_c,yc,Ac,"C","ℂ"),fc(gc,yc,Ac,"C","ℂ"),fc(_c,yc,Ac,"H","ℍ"),fc(gc,yc,Ac,"H","ℍ"),fc(_c,yc,Ac,"N","ℕ"),fc(gc,yc,Ac,"N","ℕ"),fc(_c,yc,Ac,"P","ℙ"),fc(gc,yc,Ac,"P","ℙ"),fc(_c,yc,Ac,"Q","ℚ"),fc(gc,yc,Ac,"Q","ℚ"),fc(_c,yc,Ac,"R","ℝ"),fc(gc,yc,Ac,"R","ℝ"),fc(_c,yc,Ac,"Z","ℤ"),fc(gc,yc,Ac,"Z","ℤ"),fc(_c,bc,Sc,"h","ℎ"),fc(gc,bc,Sc,"h","ℎ");for(var Vc="",Hc=0;Hc<52;Hc++){var jc=Ic.charAt(Hc);fc(_c,bc,Sc,jc,Vc=String.fromCharCode(55349,56320+Hc)),fc(gc,bc,Ac,jc,Vc),fc(_c,bc,Sc,jc,Vc=String.fromCharCode(55349,56372+Hc)),fc(gc,bc,Ac,jc,Vc),fc(_c,bc,Sc,jc,Vc=String.fromCharCode(55349,56424+Hc)),fc(gc,bc,Ac,jc,Vc),fc(_c,bc,Sc,jc,Vc=String.fromCharCode(55349,56580+Hc)),fc(gc,bc,Ac,jc,Vc),fc(_c,bc,Sc,jc,Vc=String.fromCharCode(55349,56684+Hc)),fc(gc,bc,Ac,jc,Vc),fc(_c,bc,Sc,jc,Vc=String.fromCharCode(55349,56736+Hc)),fc(gc,bc,Ac,jc,Vc),fc(_c,bc,Sc,jc,Vc=String.fromCharCode(55349,56788+Hc)),fc(gc,bc,Ac,jc,Vc),fc(_c,bc,Sc,jc,Vc=String.fromCharCode(55349,56840+Hc)),fc(gc,bc,Ac,jc,Vc),fc(_c,bc,Sc,jc,Vc=String.fromCharCode(55349,56944+Hc)),fc(gc,bc,Ac,jc,Vc),Hc<26&&(fc(_c,bc,Sc,jc,Vc=String.fromCharCode(55349,56632+Hc)),fc(gc,bc,Ac,jc,Vc),fc(_c,bc,Sc,jc,Vc=String.fromCharCode(55349,56476+Hc)),fc(gc,bc,Ac,jc,Vc))}fc(_c,bc,Sc,"k",Vc=String.fromCharCode(55349,56668)),fc(gc,bc,Ac,"k",Vc);for(var Fc=0;Fc<10;Fc++){var Uc=Fc.toString();fc(_c,bc,Sc,Uc,Vc=String.fromCharCode(55349,57294+Fc)),fc(gc,bc,Ac,Uc,Vc),fc(_c,bc,Sc,Uc,Vc=String.fromCharCode(55349,57314+Fc)),fc(gc,bc,Ac,Uc,Vc),fc(_c,bc,Sc,Uc,Vc=String.fromCharCode(55349,57324+Fc)),fc(gc,bc,Ac,Uc,Vc),fc(_c,bc,Sc,Uc,Vc=String.fromCharCode(55349,57334+Fc)),fc(gc,bc,Ac,Uc,Vc)}for(var qc=0;qc<3;qc++){var $c="ÐÞþ".charAt(qc);fc(_c,bc,Sc,$c,$c),fc(gc,bc,Ac,$c,$c)}var Gc=[["mathbf","textbf","Main-Bold"],["mathbf","textbf","Main-Bold"],["mathnormal","textit","Math-Italic"],["mathnormal","textit","Math-Italic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["mathscr","textscr","Script-Regular"],["","",""],["","",""],["","",""],["mathfrak","textfrak","Fraktur-Regular"],["mathfrak","textfrak","Fraktur-Regular"],["mathbb","textbb","AMS-Regular"],["mathbb","textbb","AMS-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathitsf","textitsf","SansSerif-Italic"],["mathitsf","textitsf","SansSerif-Italic"],["","",""],["","",""],["mathtt","texttt","Typewriter-Regular"],["mathtt","texttt","Typewriter-Regular"]],Xc=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],Kc=function(e,t,n){return mc[n][e]&&mc[n][e].replace&&(e=mc[n][e].replace),{value:e,metrics:jl(e,t,n)}},Wc=function(e,t,n,r,i){var s,o=Kc(e,t,n),a=o.metrics;if(e=o.value,a){var l=a.italic;("text"===n||r&&"mathit"===r.font)&&(l=0),s=new ac(e,a.height,a.depth,l,a.skew,a.width,i)}else"undefined"!=typeof console&&console.warn("No character metrics for '"+e+"' in style '"+t+"' and mode '"+n+"'"),s=new ac(e,0,0,0,0,0,i);if(r){s.maxFontSize=r.sizeMultiplier,r.style.isTight()&&s.classes.push("mtight");var c=r.getColor();c&&(s.style.color=c)}return s},Yc=(e,t)=>{if(Ql(e.classes)!==Ql(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize)return!1;if(1===e.classes.length){var n=e.classes[0];if("mbin"===n||"mord"===n)return!1}for(var r in e.style)if(e.style.hasOwnProperty(r)&&e.style[r]!==t.style[r])return!1;for(var i in t.style)if(t.style.hasOwnProperty(i)&&e.style[i]!==t.style[i])return!1;return!0},Zc=function(e){for(var t=0,n=0,r=0,i=0;i<e.children.length;i++){var s=e.children[i];s.height>t&&(t=s.height),s.depth>n&&(n=s.depth),s.maxFontSize>r&&(r=s.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=r},Qc=function(e,t,n,r){var i=new rc(e,t,n,r);return Zc(i),i},Jc=(e,t,n,r)=>new rc(e,t,n,r),ed=function(e){var t=new Bl(e);return Zc(t),t},td=function(e,t,n){var r="";switch(e){case"amsrm":r="AMS";break;case"textrm":r="Main";break;case"textsf":r="SansSerif";break;case"texttt":r="Typewriter";break;default:r=e}return r+"-"+("textbf"===t&&"textit"===n?"BoldItalic":"textbf"===t?"Bold":"textit"===t?"Italic":"Regular")},nd={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},rd={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},id={fontMap:nd,makeSymbol:Wc,mathsym:function(e,t,n,r){return void 0===r&&(r=[]),"boldsymbol"===n.font&&Kc(e,"Main-Bold",t).metrics?Wc(e,"Main-Bold",t,n,r.concat(["mathbf"])):"\\"===e||"main"===mc[t][e].font?Wc(e,"Main-Regular",t,n,r):Wc(e,"AMS-Regular",t,n,r.concat(["amsrm"]))},makeSpan:Qc,makeSvgSpan:Jc,makeLineSpan:function(e,t,n){var r=Qc([e],[],t);return r.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),r.style.borderBottomWidth=Zl(r.height),r.maxFontSize=1,r},makeAnchor:function(e,t,n,r){var i=new ic(e,t,n,r);return Zc(i),i},makeFragment:ed,wrapFragment:function(e,t){return e instanceof Bl?Qc([],[e],t):e},makeVList:function(e,t){for(var{children:n,depth:r}=function(e){if("individualShift"===e.positionType){for(var t=e.children,n=[t[0]],r=-t[0].shift-t[0].elem.depth,i=r,s=1;s<t.length;s++){var o=-t[s].shift-i-t[s].elem.depth,a=o-(t[s-1].elem.height+t[s-1].elem.depth);i+=o,n.push({type:"kern",size:a}),n.push(t[s])}return{children:n,depth:r}}var l;if("top"===e.positionType){for(var c=e.positionData,d=0;d<e.children.length;d++){var u=e.children[d];c-="kern"===u.type?u.size:u.elem.height+u.elem.depth}l=c}else if("bottom"===e.positionType)l=-e.positionData;else{var h=e.children[0];if("elem"!==h.type)throw new Error('First child must have type "elem".');if("shift"===e.positionType)l=-h.elem.depth-e.positionData;else{if("firstBaseline"!==e.positionType)throw new Error("Invalid positionType "+e.positionType+".");l=-h.elem.depth}}return{children:e.children,depth:l}}(e),i=0,s=0;s<n.length;s++){var o=n[s];if("elem"===o.type){var a=o.elem;i=Math.max(i,a.maxFontSize,a.height)}}i+=2;var l=Qc(["pstrut"],[]);l.style.height=Zl(i);for(var c=[],d=r,u=r,h=r,p=0;p<n.length;p++){var m=n[p];if("kern"===m.type)h+=m.size;else{var f=m.elem,_=m.wrapperClasses||[],g=m.wrapperStyle||{},b=Qc(_,[l,f],void 0,g);b.style.top=Zl(-i-h-f.depth),m.marginLeft&&(b.style.marginLeft=m.marginLeft),m.marginRight&&(b.style.marginRight=m.marginRight),c.push(b),h+=f.height+f.depth}d=Math.min(d,h),u=Math.max(u,h)}var y,v=Qc(["vlist"],c);if(v.style.height=Zl(u),d<0){var w=Qc([],[]),x=Qc(["vlist"],[w]);x.style.height=Zl(-d);var k=Qc(["vlist-s"],[new ac("")]);y=[Qc(["vlist-r"],[v,k]),Qc(["vlist-r"],[x])]}else y=[Qc(["vlist-r"],[v])];var S=Qc(["vlist-t"],y);return 2===y.length&&S.classes.push("vlist-t2"),S.height=u,S.depth=-d,S},makeOrd:function(e,t,n){var r=e.mode,i=e.text,s=["mord"],o="math"===r||"text"===r&&t.font,a=o?t.font:t.fontFamily,l="",c="";if(55349===i.charCodeAt(0)&&([l,c]=function(e,t){var n=1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536,r="math"===t?0:1;if(119808<=n&&n<120484){var i=Math.floor((n-119808)/26);return[Gc[i][2],Gc[i][r]]}if(120782<=n&&n<=120831){var s=Math.floor((n-120782)/10);return[Xc[s][2],Xc[s][r]]}if(120485===n||120486===n)return[Gc[0][2],Gc[0][r]];if(120486<n&&n<120782)return["",""];throw new cl("Unsupported character: "+e)}(i,r)),l.length>0)return Wc(i,l,r,t,s.concat(c));if(a){var d,u;if("boldsymbol"===a){var h=function(e,t,n,r,i){return"textord"!==i&&Kc(e,"Math-BoldItalic",t).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}}(i,r,0,0,n);d=h.fontName,u=[h.fontClass]}else o?(d=nd[a].fontName,u=[a]):(d=td(a,t.fontWeight,t.fontShape),u=[a,t.fontWeight,t.fontShape]);if(Kc(i,d,r).metrics)return Wc(i,d,r,t,s.concat(u));if(Rc.hasOwnProperty(i)&&"Typewriter"===d.slice(0,10)){for(var p=[],m=0;m<i.length;m++)p.push(Wc(i[m],d,r,t,s.concat(u)));return ed(p)}}if("mathord"===n)return Wc(i,"Math-Italic",r,t,s.concat(["mathnormal"]));if("textord"===n){var f=mc[r][i]&&mc[r][i].font;if("ams"===f){var _=td("amsrm",t.fontWeight,t.fontShape);return Wc(i,_,r,t,s.concat("amsrm",t.fontWeight,t.fontShape))}if("main"!==f&&f){var g=td(f,t.fontWeight,t.fontShape);return Wc(i,g,r,t,s.concat(g,t.fontWeight,t.fontShape))}var b=td("textrm",t.fontWeight,t.fontShape);return Wc(i,b,r,t,s.concat(t.fontWeight,t.fontShape))}throw new Error("unexpected type: "+n+" in makeOrd")},makeGlue:(e,t)=>{var n=Qc(["mspace"],[],t),r=Yl(e,t);return n.style.marginRight=Zl(r),n},staticSvg:function(e,t){var[n,r,i]=rd[e],s=new cc(n),o=new lc([s],{width:Zl(r),height:Zl(i),style:"width:"+Zl(r),viewBox:"0 0 "+1e3*r+" "+1e3*i,preserveAspectRatio:"xMinYMin"}),a=Jc(["overlay"],[o],t);return a.height=i,a.style.height=Zl(i),a.style.width=Zl(r),a},svgData:rd,tryCombineChars:e=>{for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n instanceof ac&&r instanceof ac&&Yc(n,r)&&(n.text+=r.text,n.height=Math.max(n.height,r.height),n.depth=Math.max(n.depth,r.depth),n.italic=r.italic,e.splice(t+1,1),t--)}return e}},sd={number:3,unit:"mu"},od={number:4,unit:"mu"},ad={number:5,unit:"mu"},ld={mord:{mop:sd,mbin:od,mrel:ad,minner:sd},mop:{mord:sd,mop:sd,mrel:ad,minner:sd},mbin:{mord:od,mop:od,mopen:od,minner:od},mrel:{mord:ad,mop:ad,mopen:ad,minner:ad},mopen:{},mclose:{mop:sd,mbin:od,mrel:ad,minner:sd},mpunct:{mord:sd,mop:sd,mrel:ad,mopen:sd,mclose:sd,mpunct:sd,minner:sd},minner:{mord:sd,mop:sd,mbin:od,mrel:ad,mopen:sd,mpunct:sd,minner:sd}},cd={mord:{mop:sd},mop:{mord:sd,mop:sd},mbin:{},mrel:{},mopen:{},mclose:{mop:sd},mpunct:{},minner:{mop:sd}},dd={},ud={},hd={};function pd(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:s,mathmlBuilder:o}=e,a={type:t,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:void 0===r.allowedInMath||r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:i},l=0;l<n.length;++l)dd[n[l]]=a;t&&(s&&(ud[t]=s),o&&(hd[t]=o))}function md(e){var{type:t,htmlBuilder:n,mathmlBuilder:r}=e;pd({type:t,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:n,mathmlBuilder:r})}var fd=function(e){return"ordgroup"===e.type&&1===e.body.length?e.body[0]:e},_d=function(e){return"ordgroup"===e.type?e.body:[e]},gd=id.makeSpan,bd=["leftmost","mbin","mopen","mrel","mop","mpunct"],yd=["rightmost","mrel","mclose","mpunct"],vd={display:Pl.DISPLAY,text:Pl.TEXT,script:Pl.SCRIPT,scriptscript:Pl.SCRIPTSCRIPT},wd={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},xd=function(e,t,n,r){void 0===r&&(r=[null,null]);for(var i=[],s=0;s<e.length;s++){var o=Td(e[s],t);if(o instanceof Bl){var a=o.children;i.push(...a)}else i.push(o)}if(id.tryCombineChars(i),!n)return i;var l=t;if(1===e.length){var c=e[0];"sizing"===c.type?l=t.havingSize(c.size):"styling"===c.type&&(l=t.havingStyle(vd[c.style]))}var d=gd([r[0]||"leftmost"],[],t),u=gd([r[1]||"rightmost"],[],t),h="root"===n;return kd(i,(e,t)=>{var n=t.classes[0],r=e.classes[0];"mbin"===n&&ml(yd,r)?t.classes[0]="mord":"mbin"===r&&ml(bd,n)&&(e.classes[0]="mord")},{node:d},u,h),kd(i,(e,t)=>{var n=Md(t),r=Md(e),i=n&&r?e.hasClass("mtight")?cd[n][r]:ld[n][r]:null;if(i)return id.makeGlue(i,l)},{node:d},u,h),i},kd=function e(t,n,r,i,s){i&&t.push(i);for(var o=0;o<t.length;o++){var a=t[o],l=Sd(a);if(l)e(l.children,n,r,null,s);else{var c=!a.hasClass("mspace");if(c){var d=n(a,r.node);d&&(r.insertAfter?r.insertAfter(d):(t.unshift(d),o++))}c?r.node=a:s&&a.hasClass("newline")&&(r.node=gd(["leftmost"])),r.insertAfter=(e=>n=>{t.splice(e+1,0,n),o++})(o)}}i&&t.pop()},Sd=function(e){return e instanceof Bl||e instanceof ic||e instanceof rc&&e.hasClass("enclosing")?e:null},Cd=function e(t,n){var r=Sd(t);if(r){var i=r.children;if(i.length){if("right"===n)return e(i[i.length-1],"right");if("left"===n)return e(i[0],"left")}}return t},Md=function(e,t){return e?(t&&(e=Cd(e,t)),wd[e.classes[0]]||null):null},Ld=function(e,t){var n=["nulldelimiter"].concat(e.baseSizingClasses());return gd(t.concat(n))},Td=function(e,t,n){if(!e)return gd();if(ud[e.type]){var r=ud[e.type](e,t);if(n&&t.size!==n.size){r=gd(t.sizingClasses(n),[r],t);var i=t.sizeMultiplier/n.sizeMultiplier;r.height*=i,r.depth*=i}return r}throw new cl("Got group of unknown type: '"+e.type+"'")};function zd(e,t){var n=gd(["base"],e,t),r=gd(["strut"]);return r.style.height=Zl(n.height+n.depth),n.depth&&(r.style.verticalAlign=Zl(-n.depth)),n.children.unshift(r),n}function Ad(e,t){var n=null;1===e.length&&"tag"===e[0].type&&(n=e[0].tag,e=e[0].body);var r,i=xd(e,t,"root");2===i.length&&i[1].hasClass("tag")&&(r=i.pop());for(var s,o=[],a=[],l=0;l<i.length;l++)if(a.push(i[l]),i[l].hasClass("mbin")||i[l].hasClass("mrel")||i[l].hasClass("allowbreak")){for(var c=!1;l<i.length-1&&i[l+1].hasClass("mspace")&&!i[l+1].hasClass("newline");)l++,a.push(i[l]),i[l].hasClass("nobreak")&&(c=!0);c||(o.push(zd(a,t)),a=[])}else i[l].hasClass("newline")&&(a.pop(),a.length>0&&(o.push(zd(a,t)),a=[]),o.push(i[l]));a.length>0&&o.push(zd(a,t)),n?((s=zd(xd(n,t,!0))).classes=["tag"],o.push(s)):r&&o.push(r);var d=gd(["katex-html"],o);if(d.setAttribute("aria-hidden","true"),s){var u=s.children[0];u.style.height=Zl(d.height+d.depth),d.depth&&(u.style.verticalAlign=Zl(-d.depth))}return d}function Rd(e){return new Bl(e)}class Pd{constructor(e,t,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=n||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=Ql(this.classes));for(var n=0;n<this.children.length;n++)if(this.children[n]instanceof Nd&&this.children[n+1]instanceof Nd){for(var r=this.children[n].toText()+this.children[++n].toText();this.children[n+1]instanceof Nd;)r+=this.children[++n].toText();e.appendChild(new Nd(r).toNode())}else e.appendChild(this.children[n].toNode());return e}toMarkup(){var e="<"+this.type;for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="',e+=_l(this.attributes[t]),e+='"');this.classes.length>0&&(e+=' class ="'+_l(Ql(this.classes))+'"'),e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+"</"+this.type+">"}toText(){return this.children.map(e=>e.toText()).join("")}}class Nd{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return _l(this.toText())}toText(){return this.text}}var Ed={MathNode:Pd,TextNode:Nd,SpaceNode:class{constructor(e){this.width=void 0,this.character=void 0,this.width=e,this.character=e>=.05555&&e<=.05556?" ":e>=.1666&&e<=.1667?" ":e>=.2222&&e<=.2223?" ":e>=.2777&&e<=.2778?" ":e>=-.05556&&e<=-.05555?" ":e>=-.1667&&e<=-.1666?" ":e>=-.2223&&e<=-.2222?" ":e>=-.2778&&e<=-.2777?" ":null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",Zl(this.width)),e}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+Zl(this.width)+'"/>'}toText(){return this.character?this.character:" "}},newDocumentFragment:Rd},Od=function(e,t,n){return!mc[t][e]||!mc[t][e].replace||55349===e.charCodeAt(0)||Rc.hasOwnProperty(e)&&n&&(n.fontFamily&&"tt"===n.fontFamily.slice(4,6)||n.font&&"tt"===n.font.slice(4,6))||(e=mc[t][e].replace),new Ed.TextNode(e)},Id=function(e){return 1===e.length?e[0]:new Ed.MathNode("mrow",e)},Bd=function(e,t){if("texttt"===t.fontFamily)return"monospace";if("textsf"===t.fontFamily)return"textit"===t.fontShape&&"textbf"===t.fontWeight?"sans-serif-bold-italic":"textit"===t.fontShape?"sans-serif-italic":"textbf"===t.fontWeight?"bold-sans-serif":"sans-serif";if("textit"===t.fontShape&&"textbf"===t.fontWeight)return"bold-italic";if("textit"===t.fontShape)return"italic";if("textbf"===t.fontWeight)return"bold";var n=t.font;if(!n||"mathnormal"===n)return null;var r=e.mode;if("mathit"===n)return"italic";if("boldsymbol"===n)return"textord"===e.type?"bold":"bold-italic";if("mathbf"===n)return"bold";if("mathbb"===n)return"double-struck";if("mathsfit"===n)return"sans-serif-italic";if("mathfrak"===n)return"fraktur";if("mathscr"===n||"mathcal"===n)return"script";if("mathsf"===n)return"sans-serif";if("mathtt"===n)return"monospace";var i=e.text;return ml(["\\imath","\\jmath"],i)?null:(mc[r][i]&&mc[r][i].replace&&(i=mc[r][i].replace),jl(i,id.fontMap[n].fontName,r)?id.fontMap[n].variant:null)};function Dd(e){if(!e)return!1;if("mi"===e.type&&1===e.children.length){var t=e.children[0];return t instanceof Nd&&"."===t.text}if("mo"===e.type&&1===e.children.length&&"true"===e.getAttribute("separator")&&"0em"===e.getAttribute("lspace")&&"0em"===e.getAttribute("rspace")){var n=e.children[0];return n instanceof Nd&&","===n.text}return!1}var Vd=function(e,t,n){if(1===e.length){var r=jd(e[0],t);return n&&r instanceof Pd&&"mo"===r.type&&(r.setAttribute("lspace","0em"),r.setAttribute("rspace","0em")),[r]}for(var i,s=[],o=0;o<e.length;o++){var a=jd(e[o],t);if(a instanceof Pd&&i instanceof Pd){if("mtext"===a.type&&"mtext"===i.type&&a.getAttribute("mathvariant")===i.getAttribute("mathvariant")){i.children.push(...a.children);continue}if("mn"===a.type&&"mn"===i.type){i.children.push(...a.children);continue}if(Dd(a)&&"mn"===i.type){i.children.push(...a.children);continue}if("mn"===a.type&&Dd(i))a.children=[...i.children,...a.children],s.pop();else if(("msup"===a.type||"msub"===a.type)&&a.children.length>=1&&("mn"===i.type||Dd(i))){var l=a.children[0];l instanceof Pd&&"mn"===l.type&&(l.children=[...i.children,...l.children],s.pop())}else if("mi"===i.type&&1===i.children.length){var c=i.children[0];if(c instanceof Nd&&"̸"===c.text&&("mo"===a.type||"mi"===a.type||"mn"===a.type)){var d=a.children[0];d instanceof Nd&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),s.pop())}}}s.push(a),i=a}return s},Hd=function(e,t,n){return Id(Vd(e,t,n))},jd=function(e,t){if(!e)return new Ed.MathNode("mrow");if(hd[e.type])return hd[e.type](e,t);throw new cl("Got group of unknown type: '"+e.type+"'")};function Fd(e,t,n,r,i){var s,o=Vd(e,n);s=1===o.length&&o[0]instanceof Pd&&ml(["mrow","mtable"],o[0].type)?o[0]:new Ed.MathNode("mrow",o);var a=new Ed.MathNode("annotation",[new Ed.TextNode(t)]);a.setAttribute("encoding","application/x-tex");var l=new Ed.MathNode("semantics",[s,a]),c=new Ed.MathNode("math",[l]);return c.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&c.setAttribute("display","block"),id.makeSpan([i?"katex":"katex-mathml"],[c])}var Ud={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},qd={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},$d=function(e){var t=new Ed.MathNode("mo",[new Ed.TextNode(Ud[e.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},Gd=function(e,t){var{span:n,minWidth:r,height:i}=function(){var n=4e5,r=e.label.slice(1);if(ml(["widehat","widecheck","widetilde","utilde"],r)){var i,s,o,a="ordgroup"===(p=e.base).type?p.body.length:1;if(a>5)"widehat"===r||"widecheck"===r?(i=420,n=2364,o=.42,s=r+"4"):(i=312,n=2340,o=.34,s="tilde4");else{var l=[1,1,2,2,3,3][a];"widehat"===r||"widecheck"===r?(n=[0,1062,2364,2364,2364][l],i=[0,239,300,360,420][l],o=[0,.24,.3,.3,.36,.42][l],s=r+l):(n=[0,600,1033,2339,2340][l],i=[0,260,286,306,312][l],o=[0,.26,.286,.3,.306,.34][l],s="tilde"+l)}var c=new cc(s),d=new lc([c],{width:"100%",height:Zl(o),viewBox:"0 0 "+n+" "+i,preserveAspectRatio:"none"});return{span:id.makeSvgSpan([],[d],t),minWidth:0,height:o}}var u,h,p,m=[],f=qd[r],[_,g,b]=f,y=b/1e3,v=_.length;if(1===v)u=["hide-tail"],h=[f[3]];else if(2===v)u=["halfarrow-left","halfarrow-right"],h=["xMinYMin","xMaxYMin"];else{if(3!==v)throw new Error("Correct katexImagesData or update code here to support\n "+v+" children.");u=["brace-left","brace-center","brace-right"],h=["xMinYMin","xMidYMin","xMaxYMin"]}for(var w=0;w<v;w++){var x=new cc(_[w]),k=new lc([x],{width:"400em",height:Zl(y),viewBox:"0 0 "+n+" "+b,preserveAspectRatio:h[w]+" slice"}),S=id.makeSvgSpan([u[w]],[k],t);if(1===v)return{span:S,minWidth:g,height:y};S.style.height=Zl(y),m.push(S)}return{span:id.makeSpan(["stretchy"],m,t),minWidth:g,height:y}}();return n.height=i,n.style.height=Zl(i),r>0&&(n.style.minWidth=Zl(r)),n};function Xd(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function Kd(e){var t=Wd(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function Wd(e){return e&&("atom"===e.type||pc.hasOwnProperty(e.type))?e:null}var Yd=(e,t)=>{var n,r,i;e&&"supsub"===e.type?(n=(r=Xd(e.base,"accent")).base,e.base=n,i=function(e){if(e instanceof rc)return e;throw new Error("Expected span<HtmlDomNode> but got "+String(e)+".")}(Td(e,t)),e.base=r):n=(r=Xd(e,"accent")).base;var s=Td(n,t.havingCrampedStyle()),o=0;if(r.isShifty&&yl(n)){var a=bl(n);o=uc(Td(a,t.havingCrampedStyle())).skew}var l,c="\\c"===r.label,d=c?s.height+s.depth:Math.min(s.height,t.fontMetrics().xHeight);if(r.isStretchy)l=Gd(r,t),l=id.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"elem",elem:l,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+Zl(2*o)+")",marginLeft:Zl(2*o)}:void 0}]},t);else{var u,h;"\\vec"===r.label?(u=id.staticSvg("vec",t),h=id.svgData.vec[1]):((u=uc(u=id.makeOrd({mode:r.mode,text:r.label},t,"textord"))).italic=0,h=u.width,c&&(d+=u.depth)),l=id.makeSpan(["accent-body"],[u]);var p="\\textcircled"===r.label;p&&(l.classes.push("accent-full"),d=s.height);var m=o;p||(m-=h/2),l.style.left=Zl(m),"\\textcircled"===r.label&&(l.style.top=".2em"),l=id.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:-d},{type:"elem",elem:l}]},t)}var f=id.makeSpan(["mord","accent"],[l],t);return i?(i.children[0]=f,i.height=Math.max(f.height,i.height),i.classes[0]="mord",i):f},Zd=(e,t)=>{var n=e.isStretchy?$d(e.label):new Ed.MathNode("mo",[Od(e.label,e.mode)]),r=new Ed.MathNode("mover",[jd(e.base,t),n]);return r.setAttribute("accent","true"),r},Qd=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));pd({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,t)=>{var n=fd(t[0]),r=!Qd.test(e.funcName),i=!r||"\\widehat"===e.funcName||"\\widetilde"===e.funcName||"\\widecheck"===e.funcName;return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:i,base:n}},htmlBuilder:Yd,mathmlBuilder:Zd}),pd({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{var n=t[0],r=e.parser.mode;return"math"===r&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:Yd,mathmlBuilder:Zd}),pd({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"accentUnder",mode:n.mode,label:r,base:i}},htmlBuilder:(e,t)=>{var n=Td(e.base,t),r=Gd(e,t),i="\\utilde"===e.label?.12:0,s=id.makeVList({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:n}]},t);return id.makeSpan(["mord","accentunder"],[s],t)},mathmlBuilder:(e,t)=>{var n=$d(e.label),r=new Ed.MathNode("munder",[jd(e.base,t),n]);return r.setAttribute("accentunder","true"),r}});var Jd=e=>{var t=new Ed.MathNode("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};pd({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r,funcName:i}=e;return{type:"xArrow",mode:r.mode,label:i,body:t[0],below:n[0]}},htmlBuilder(e,t){var n,r=t.style,i=t.havingStyle(r.sup()),s=id.wrapFragment(Td(e.body,i,t),t),o="\\x"===e.label.slice(0,2)?"x":"cd";s.classes.push(o+"-arrow-pad"),e.below&&(i=t.havingStyle(r.sub()),(n=id.wrapFragment(Td(e.below,i,t),t)).classes.push(o+"-arrow-pad"));var a,l=Gd(e,t),c=-t.fontMetrics().axisHeight+.5*l.height,d=-t.fontMetrics().axisHeight-.5*l.height-.111;if((s.depth>.25||"\\xleftequilibrium"===e.label)&&(d-=s.depth),n){var u=-t.fontMetrics().axisHeight+n.height+.5*l.height+.111;a=id.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:d},{type:"elem",elem:l,shift:c},{type:"elem",elem:n,shift:u}]},t)}else a=id.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:d},{type:"elem",elem:l,shift:c}]},t);return a.children[0].children[0].children[1].classes.push("svg-align"),id.makeSpan(["mrel","x-arrow"],[a],t)},mathmlBuilder(e,t){var n,r=$d(e.label);if(r.setAttribute("minsize","x"===e.label.charAt(0)?"1.75em":"3.0em"),e.body){var i=Jd(jd(e.body,t));if(e.below){var s=Jd(jd(e.below,t));n=new Ed.MathNode("munderover",[r,s,i])}else n=new Ed.MathNode("mover",[r,i])}else if(e.below){var o=Jd(jd(e.below,t));n=new Ed.MathNode("munder",[r,o])}else n=Jd(),n=new Ed.MathNode("mover",[r,n]);return n}});var eu=id.makeSpan;function tu(e,t){var n=xd(e.body,t,!0);return eu([e.mclass],n,t)}function nu(e,t){var n,r=Vd(e.body,t);return"minner"===e.mclass?n=new Ed.MathNode("mpadded",r):"mord"===e.mclass?e.isCharacterBox?(n=r[0]).type="mi":n=new Ed.MathNode("mi",r):(e.isCharacterBox?(n=r[0]).type="mo":n=new Ed.MathNode("mo",r),"mbin"===e.mclass?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):"mpunct"===e.mclass?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):"mopen"===e.mclass||"mclose"===e.mclass?(n.attributes.lspace="0em",n.attributes.rspace="0em"):"minner"===e.mclass&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}pd({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+r.slice(5),body:_d(i),isCharacterBox:yl(i)}},htmlBuilder:tu,mathmlBuilder:nu});var ru=e=>{var t="ordgroup"===e.type&&e.body.length?e.body[0]:e;return"atom"!==t.type||"bin"!==t.family&&"rel"!==t.family?"mord":"m"+t.family};pd({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:ru(t[0]),body:_d(t[1]),isCharacterBox:yl(t[1])}}}),pd({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,t){var n,{parser:r,funcName:i}=e,s=t[1],o=t[0];n="\\stackrel"!==i?ru(s):"mrel";var a={type:"op",mode:s.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:"\\stackrel"!==i,body:_d(s)},l={type:"supsub",mode:o.mode,base:a,sup:"\\underset"===i?null:o,sub:"\\underset"===i?o:null};return{type:"mclass",mode:r.mode,mclass:n,body:[l],isCharacterBox:yl(l)}},htmlBuilder:tu,mathmlBuilder:nu}),pd({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"pmb",mode:n.mode,mclass:ru(t[0]),body:_d(t[0])}},htmlBuilder(e,t){var n=xd(e.body,t,!0),r=id.makeSpan([e.mclass],n,t);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,t){var n=Vd(e.body,t),r=new Ed.MathNode("mstyle",n);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var iu={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},su=()=>({type:"styling",body:[],mode:"math",style:"display"}),ou=e=>"textord"===e.type&&"@"===e.text,au=(e,t)=>("mathord"===e.type||"atom"===e.type)&&e.text===t;function lu(e,t,n){var r=iu[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":var i={type:"atom",text:r,mode:"math",family:"rel"},s={type:"ordgroup",mode:"math",body:[n.callFunction("\\\\cdleft",[t[0]],[]),n.callFunction("\\Big",[i],[]),n.callFunction("\\\\cdright",[t[1]],[])]};return n.callFunction("\\\\cdparent",[s],[]);case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":return n.callFunction("\\Big",[{type:"textord",text:"\\Vert",mode:"math"}],[]);default:return{type:"textord",text:" ",mode:"math"}}}pd({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"cdlabel",mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=id.wrapFragment(Td(e.label,n,t),t);return r.classes.push("cd-label-"+e.side),r.style.bottom=Zl(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new Ed.MathNode("mrow",[jd(e.label,t)]);return(n=new Ed.MathNode("mpadded",[n])).setAttribute("width","0"),"left"===e.side&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),(n=new Ed.MathNode("mstyle",[n])).setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}}),pd({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,t){var{parser:n}=e;return{type:"cdlabelparent",mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=id.wrapFragment(Td(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder:(e,t)=>new Ed.MathNode("mrow",[jd(e.fragment,t)])}),pd({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,r=Xd(t[0],"ordgroup").body,i="",s=0;s<r.length;s++)i+=Xd(r[s],"textord").text;var o,a=parseInt(i);if(isNaN(a))throw new cl("\\@char has non-numeric argument "+i);if(a<0||a>=1114111)throw new cl("\\@char with invalid code point "+i);return a<=65535?o=String.fromCharCode(a):(a-=65536,o=String.fromCharCode(55296+(a>>10),56320+(1023&a))),{type:"textord",mode:n.mode,text:o}}});var cu=(e,t)=>{var n=xd(e.body,t.withColor(e.color),!1);return id.makeFragment(n)},du=(e,t)=>{var n=Vd(e.body,t.withColor(e.color)),r=new Ed.MathNode("mstyle",n);return r.setAttribute("mathcolor",e.color),r};pd({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){var{parser:n}=e,r=Xd(t[0],"color-token").color,i=t[1];return{type:"color",mode:n.mode,color:r,body:_d(i)}},htmlBuilder:cu,mathmlBuilder:du}),pd({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,t){var{parser:n,breakOnTokenText:r}=e,i=Xd(t[0],"color-token").color;n.gullet.macros.set("\\current@color",i);var s=n.parseExpression(!0,r);return{type:"color",mode:n.mode,color:i,body:s}},htmlBuilder:cu,mathmlBuilder:du}),pd({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,n){var{parser:r}=e,i="["===r.gullet.future().text?r.parseSizeGroup(!0):null,s=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:s,size:i&&Xd(i,"size").value}},htmlBuilder(e,t){var n=id.makeSpan(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=Zl(Yl(e.size,t)))),n},mathmlBuilder(e,t){var n=new Ed.MathNode("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",Zl(Yl(e.size,t)))),n}});var uu={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},hu=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new cl("Expected a control sequence",e);return t},pu=(e,t,n,r)=>{var i=e.gullet.macros.get(n.text);null==i&&(n.noexpand=!0,i={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,i,r)};pd({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var r=t.fetch();if(uu[r.text])return"\\global"!==n&&"\\\\globallong"!==n||(r.text=uu[r.text]),Xd(t.parseFunction(),"internal");throw new cl("Invalid token after macro prefix",r)}}),pd({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=t.gullet.popToken(),i=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new cl("Expected a control sequence",r);for(var s,o=0,a=[[]];"{"!==t.gullet.future().text;)if("#"===(r=t.gullet.popToken()).text){if("{"===t.gullet.future().text){s=t.gullet.future(),a[o].push("{");break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new cl('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==o+1)throw new cl('Argument number "'+r.text+'" out of order');o++,a.push([])}else{if("EOF"===r.text)throw new cl("Expected a macro definition");a[o].push(r.text)}var{tokens:l}=t.gullet.consumeArg();return s&&l.unshift(s),"\\edef"!==n&&"\\xdef"!==n||(l=t.gullet.expandTokens(l)).reverse(),t.gullet.macros.set(i,{tokens:l,numArgs:o,delimiters:a},n===uu[n]),{type:"internal",mode:t.mode}}}),pd({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=hu(t.gullet.popToken());t.gullet.consumeSpaces();var i=(e=>{var t=e.gullet.popToken();return"="===t.text&&" "===(t=e.gullet.popToken()).text&&(t=e.gullet.popToken()),t})(t);return pu(t,r,i,"\\\\globallet"===n),{type:"internal",mode:t.mode}}}),pd({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=hu(t.gullet.popToken()),i=t.gullet.popToken(),s=t.gullet.popToken();return pu(t,r,s,"\\\\globalfuture"===n),t.gullet.pushToken(s),t.gullet.pushToken(i),{type:"internal",mode:t.mode}}});var mu=function(e,t,n){var r=jl(mc.math[e]&&mc.math[e].replace||e,t,n);if(!r)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return r},fu=function(e,t,n,r){var i=n.havingBaseStyle(t),s=id.makeSpan(r.concat(i.sizingClasses(n)),[e],n),o=i.sizeMultiplier/n.sizeMultiplier;return s.height*=o,s.depth*=o,s.maxFontSize=i.sizeMultiplier,s},_u=function(e,t,n){var r=t.havingBaseStyle(n),i=(1-t.sizeMultiplier/r.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=Zl(i),e.height-=i,e.depth+=i},gu=function(e,t,n,r,i,s){var o=function(e,t,n,r){return id.makeSymbol(e,"Size"+t+"-Regular",n,r)}(e,t,i,r),a=fu(id.makeSpan(["delimsizing","size"+t],[o],r),Pl.TEXT,r,s);return n&&_u(a,r,Pl.TEXT),a},bu=function(e,t,n){return{type:"elem",elem:id.makeSpan(["delimsizinginner","Size1-Regular"===t?"delim-size1":"delim-size4"],[id.makeSpan([],[id.makeSymbol(e,t,n)])])}},yu=function(e,t,n){var r=Dl["Size4-Regular"][e.charCodeAt(0)]?Dl["Size4-Regular"][e.charCodeAt(0)][4]:Dl["Size1-Regular"][e.charCodeAt(0)][4],i=new cc("inner",function(e,t){switch(e){case"⎜":return"M291 0 H417 V"+t+" H291z M291 0 H417 V"+t+" H291z";case"∣":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145z";case"∥":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145zM367 0 H410 V"+t+" H367z M367 0 H410 V"+t+" H367z";case"⎟":return"M457 0 H583 V"+t+" H457z M457 0 H583 V"+t+" H457z";case"⎢":return"M319 0 H403 V"+t+" H319z M319 0 H403 V"+t+" H319z";case"⎥":return"M263 0 H347 V"+t+" H263z M263 0 H347 V"+t+" H263z";case"⎪":return"M384 0 H504 V"+t+" H384z M384 0 H504 V"+t+" H384z";case"⏐":return"M312 0 H355 V"+t+" H312z M312 0 H355 V"+t+" H312z";case"‖":return"M257 0 H300 V"+t+" H257z M257 0 H300 V"+t+" H257zM478 0 H521 V"+t+" H478z M478 0 H521 V"+t+" H478z";default:return""}}(e,Math.round(1e3*t))),s=new lc([i],{width:Zl(r),height:Zl(t),style:"width:"+Zl(r),viewBox:"0 0 "+1e3*r+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),o=id.makeSvgSpan([],[s],n);return o.height=t,o.style.height=Zl(t),o.style.width=Zl(r),{type:"elem",elem:o}},vu={type:"kern",size:-.008},wu=["|","\\lvert","\\rvert","\\vert"],xu=["\\|","\\lVert","\\rVert","\\Vert"],ku=function(e,t,n,r,i,s){var o,a,l,c,d="",u=0;o=l=c=e,a=null;var h="Size1-Regular";"\\uparrow"===e?l=c="⏐":"\\Uparrow"===e?l=c="‖":"\\downarrow"===e?o=l="⏐":"\\Downarrow"===e?o=l="‖":"\\updownarrow"===e?(o="\\uparrow",l="⏐",c="\\downarrow"):"\\Updownarrow"===e?(o="\\Uparrow",l="‖",c="\\Downarrow"):ml(wu,e)?(l="∣",d="vert",u=333):ml(xu,e)?(l="∥",d="doublevert",u=556):"["===e||"\\lbrack"===e?(o="⎡",l="⎢",c="⎣",h="Size4-Regular",d="lbrack",u=667):"]"===e||"\\rbrack"===e?(o="⎤",l="⎥",c="⎦",h="Size4-Regular",d="rbrack",u=667):"\\lfloor"===e||"⌊"===e?(l=o="⎢",c="⎣",h="Size4-Regular",d="lfloor",u=667):"\\lceil"===e||"⌈"===e?(o="⎡",l=c="⎢",h="Size4-Regular",d="lceil",u=667):"\\rfloor"===e||"⌋"===e?(l=o="⎥",c="⎦",h="Size4-Regular",d="rfloor",u=667):"\\rceil"===e||"⌉"===e?(o="⎤",l=c="⎥",h="Size4-Regular",d="rceil",u=667):"("===e||"\\lparen"===e?(o="⎛",l="⎜",c="⎝",h="Size4-Regular",d="lparen",u=875):")"===e||"\\rparen"===e?(o="⎞",l="⎟",c="⎠",h="Size4-Regular",d="rparen",u=875):"\\{"===e||"\\lbrace"===e?(o="⎧",a="⎨",c="⎩",l="⎪",h="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(o="⎫",a="⎬",c="⎭",l="⎪",h="Size4-Regular"):"\\lgroup"===e||"⟮"===e?(o="⎧",c="⎩",l="⎪",h="Size4-Regular"):"\\rgroup"===e||"⟯"===e?(o="⎫",c="⎭",l="⎪",h="Size4-Regular"):"\\lmoustache"===e||"⎰"===e?(o="⎧",c="⎭",l="⎪",h="Size4-Regular"):"\\rmoustache"!==e&&"⎱"!==e||(o="⎫",c="⎩",l="⎪",h="Size4-Regular");var p=mu(o,h,i),m=p.height+p.depth,f=mu(l,h,i),_=f.height+f.depth,g=mu(c,h,i),b=g.height+g.depth,y=0,v=1;if(null!==a){var w=mu(a,h,i);y=w.height+w.depth,v=2}var x=m+b+y,k=x+Math.max(0,Math.ceil((t-x)/(v*_)))*v*_,S=r.fontMetrics().axisHeight;n&&(S*=r.sizeMultiplier);var C=k/2-S,M=[];if(d.length>0){var L=k-m-b,T=Math.round(1e3*k),z=function(e,t){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+" v1759 h347 v-84\nH403z M403 1759 V0 H319 V1759 v"+t+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+" v1759 H0 v84 H347z\nM347 1759 V0 H263 V1759 v"+t+" v1759 h84z";case"vert":return"M145 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+t+" v585 h43z";case"doublevert":return"M145 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+t+" v585 h43z\nM367 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M410 15 H367 v585 v"+t+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+t+" v1715 h263 v84 H319z\nMM319 602 V0 H403 V602 v"+t+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+t+" v1799 H0 v-84 H319z\nMM319 602 V0 H403 V602 v"+t+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+" v602 h84z\nM403 1759 V0 H319 V1759 v"+t+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+" v602 h84z\nM347 1759 V0 h-84 V1759 v"+t+" v602 h84z";case"lparen":return"M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1\nc-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,\n-36,557 l0,"+(t+84)+"c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,\n949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9\nc0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,\n-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189\nl0,-"+(t+92)+"c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,\n-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z";case"rparen":return"M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,\n63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5\nc11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,"+(t+9)+"\nc-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664\nc-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11\nc0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17\nc242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558\nl0,-"+(t+144)+"c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,\n-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z";default:throw new Error("Unknown stretchy delimiter.")}}(d,Math.round(1e3*L)),A=new cc(d,z),R=(u/1e3).toFixed(3)+"em",P=(T/1e3).toFixed(3)+"em",N=new lc([A],{width:R,height:P,viewBox:"0 0 "+u+" "+T}),E=id.makeSvgSpan([],[N],r);E.height=T/1e3,E.style.width=R,E.style.height=P,M.push({type:"elem",elem:E})}else{if(M.push(bu(c,h,i)),M.push(vu),null===a){var O=k-m-b+.016;M.push(yu(l,O,r))}else{var I=(k-m-b-y)/2+.016;M.push(yu(l,I,r)),M.push(vu),M.push(bu(a,h,i)),M.push(vu),M.push(yu(l,I,r))}M.push(vu),M.push(bu(o,h,i))}var B=r.havingBaseStyle(Pl.TEXT),D=id.makeVList({positionType:"bottom",positionData:C,children:M},B);return fu(id.makeSpan(["delimsizing","mult"],[D],B),Pl.TEXT,r,s)},Su=.08,Cu=function(e,t,n,r,i){var s=function(e,t,n){t*=1e3;var r="";switch(e){case"sqrtMain":r=function(e){return"M95,"+(622+e+80)+"\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl"+e/2.075+" -"+e+"\nc5.3,-9.3,12,-14,20,-14\nH400000v"+(40+e)+"H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM"+(834+e)+" 80h400000v"+(40+e)+"h-400000z"}(t);break;case"sqrtSize1":r=function(e){return"M263,"+(601+e+80)+"c0.7,0,18,39.7,52,119\nc34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120\nc340,-704.7,510.7,-1060.3,512,-1067\nl"+e/2.084+" -"+e+"\nc4.7,-7.3,11,-11,19,-11\nH40000v"+(40+e)+"H1012.3\ns-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232\nc-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1\ns-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26\nc-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z\nM"+(1001+e)+" 80h400000v"+(40+e)+"h-400000z"}(t);break;case"sqrtSize2":r=function(e){return"M983 "+(10+e+80)+"\nl"+e/3.13+" -"+e+"\nc4,-6.7,10,-10,18,-10 H400000v"+(40+e)+"\nH1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7\ns-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744\nc-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30\nc26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722\nc56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5\nc53.7,-170.3,84.5,-266.8,92.5,-289.5z\nM"+(1001+e)+" 80h400000v"+(40+e)+"h-400000z"}(t);break;case"sqrtSize3":r=function(e){return"M424,"+(2398+e+80)+"\nc-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514\nc0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20\ns-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121\ns209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081\nl"+e/4.223+" -"+e+"c4,-6.7,10,-10,18,-10 H400000\nv"+(40+e)+"H1014.6\ns-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185\nc-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2z M"+(1001+e)+" 80\nh400000v"+(40+e)+"h-400000z"}(t);break;case"sqrtSize4":r=function(e){return"M473,"+(2713+e+80)+"\nc339.3,-1799.3,509.3,-2700,510,-2702 l"+e/5.298+" -"+e+"\nc3.3,-7.3,9.3,-11,18,-11 H400000v"+(40+e)+"H1017.7\ns-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200\nc0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26\ns76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,\n606zM"+(1001+e)+" 80h400000v"+(40+e)+"H1017.7z"}(t);break;case"sqrtTall":r=function(e,t,n){return"M702 "+(e+80)+"H400000"+(40+e)+"\nH742v"+(n-54-80-e)+"l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1\nh-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170\nc-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667\n219 661 l218 661zM702 80H400000v"+(40+e)+"H742z"}(t,0,n)}return r}(e,r,n),o=new cc(e,s),a=new lc([o],{width:"400em",height:Zl(t),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return id.makeSvgSpan(["hide-tail"],[a],i)},Mu=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],Lu=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],Tu=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],zu=[0,1.2,1.8,2.4,3],Au=[{type:"small",style:Pl.SCRIPTSCRIPT},{type:"small",style:Pl.SCRIPT},{type:"small",style:Pl.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Ru=[{type:"small",style:Pl.SCRIPTSCRIPT},{type:"small",style:Pl.SCRIPT},{type:"small",style:Pl.TEXT},{type:"stack"}],Pu=[{type:"small",style:Pl.SCRIPTSCRIPT},{type:"small",style:Pl.SCRIPT},{type:"small",style:Pl.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],Nu=function(e){if("small"===e.type)return"Main-Regular";if("large"===e.type)return"Size"+e.size+"-Regular";if("stack"===e.type)return"Size4-Regular";throw new Error("Add support for delim type '"+e.type+"' here.")},Eu=function(e,t,n,r){for(var i=Math.min(2,3-r.style.size);i<n.length&&"stack"!==n[i].type;i++){var s=mu(e,Nu(n[i]),"math"),o=s.height+s.depth;if("small"===n[i].type&&(o*=r.havingBaseStyle(n[i].style).sizeMultiplier),o>t)return n[i]}return n[n.length-1]},Ou=function(e,t,n,r,i,s){var o;"<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),o=ml(Tu,e)?Au:ml(Mu,e)?Pu:Ru;var a=Eu(e,t,o,r);return"small"===a.type?function(e,t,n,r,i,s){var o=id.makeSymbol(e,"Main-Regular",i,r),a=fu(o,t,r,s);return n&&_u(a,r,t),a}(e,a.style,n,r,i,s):"large"===a.type?gu(e,a.size,n,r,i,s):ku(e,t,n,r,i,s)},Iu={sqrtImage:function(e,t){var n,r,i=t.havingBaseSizing(),s=Eu("\\surd",e*i.sizeMultiplier,Pu,i),o=i.sizeMultiplier,a=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),l=0,c=0,d=0;return"small"===s.type?(e<1?o=1:e<1.4&&(o=.7),c=(1+a)/o,(n=Cu("sqrtMain",l=(1+a+Su)/o,d=1e3+1e3*a+80,a,t)).style.minWidth="0.853em",r=.833/o):"large"===s.type?(d=1080*zu[s.size],c=(zu[s.size]+a)/o,l=(zu[s.size]+a+Su)/o,(n=Cu("sqrtSize"+s.size,l,d,a,t)).style.minWidth="1.02em",r=1/o):(l=e+a+Su,c=e+a,d=Math.floor(1e3*e+a)+80,(n=Cu("sqrtTall",l,d,a,t)).style.minWidth="0.742em",r=1.056),n.height=c,n.style.height=Zl(l),{span:n,advanceWidth:r,ruleWidth:(t.fontMetrics().sqrtRuleThickness+a)*o}},sizedDelim:function(e,t,n,r,i){if("<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),ml(Mu,e)||ml(Tu,e))return gu(e,t,!1,n,r,i);if(ml(Lu,e))return ku(e,zu[t],!1,n,r,i);throw new cl("Illegal delimiter: '"+e+"'")},sizeToMaxHeight:zu,customSizedDelim:Ou,leftRightDelim:function(e,t,n,r,i,s){var o=r.fontMetrics().axisHeight*r.sizeMultiplier,a=5/r.fontMetrics().ptPerEm,l=Math.max(t-o,n+o),c=Math.max(l/500*901,2*l-a);return Ou(e,c,!0,r,i,s)}},Bu={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},Du=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function Vu(e,t){var n=Wd(e);if(n&&ml(Du,n.text))return n;throw new cl(n?"Invalid delimiter '"+n.text+"' after '"+t.funcName+"'":"Invalid delimiter type '"+e.type+"'",e)}function Hu(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}pd({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,t)=>{var n=Vu(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:Bu[e.funcName].size,mclass:Bu[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>"."===e.delim?id.makeSpan([e.mclass]):Iu.sizedDelim(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];"."!==e.delim&&t.push(Od(e.delim,e.mode));var n=new Ed.MathNode("mo",t);"mopen"===e.mclass||"mclose"===e.mclass?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=Zl(Iu.sizeToMaxHeight[e.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}}),pd({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=e.parser.gullet.macros.get("\\current@color");if(n&&"string"!=typeof n)throw new cl("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Vu(t[0],e).text,color:n}}}),pd({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Vu(t[0],e),r=e.parser;++r.leftrightDepth;var i=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var s=Xd(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:i,left:n.text,right:s.delim,rightColor:s.color}},htmlBuilder:(e,t)=>{Hu(e);for(var n,r,i=xd(e.body,t,!0,["mopen","mclose"]),s=0,o=0,a=!1,l=0;l<i.length;l++)i[l].isMiddle?a=!0:(s=Math.max(i[l].height,s),o=Math.max(i[l].depth,o));if(s*=t.sizeMultiplier,o*=t.sizeMultiplier,n="."===e.left?Ld(t,["mopen"]):Iu.leftRightDelim(e.left,s,o,t,e.mode,["mopen"]),i.unshift(n),a)for(var c=1;c<i.length;c++){var d=i[c].isMiddle;d&&(i[c]=Iu.leftRightDelim(d.delim,s,o,d.options,e.mode,[]))}if("."===e.right)r=Ld(t,["mclose"]);else{var u=e.rightColor?t.withColor(e.rightColor):t;r=Iu.leftRightDelim(e.right,s,o,u,e.mode,["mclose"])}return i.push(r),id.makeSpan(["minner"],i,t)},mathmlBuilder:(e,t)=>{Hu(e);var n=Vd(e.body,t);if("."!==e.left){var r=new Ed.MathNode("mo",[Od(e.left,e.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if("."!==e.right){var i=new Ed.MathNode("mo",[Od(e.right,e.mode)]);i.setAttribute("fence","true"),e.rightColor&&i.setAttribute("mathcolor",e.rightColor),n.push(i)}return Id(n)}}),pd({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Vu(t[0],e);if(!e.parser.leftrightDepth)throw new cl("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;if("."===e.delim)n=Ld(t,[]);else{n=Iu.sizedDelim(e.delim,1,t,e.mode,[]);var r={delim:e.delim,options:t};n.isMiddle=r}return n},mathmlBuilder:(e,t)=>{var n="\\vert"===e.delim||"|"===e.delim?Od("|","text"):Od(e.delim,e.mode),r=new Ed.MathNode("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var ju=(e,t)=>{var n,r,i,s=id.wrapFragment(Td(e.body,t),t),o=e.label.slice(1),a=t.sizeMultiplier,l=0,c=yl(e.body);if("sout"===o)(n=id.makeSpan(["stretchy","sout"])).height=t.fontMetrics().defaultRuleThickness/a,l=-.5*t.fontMetrics().xHeight;else if("phase"===o){var d=Yl({number:.6,unit:"pt"},t),u=Yl({number:.35,unit:"ex"},t);a/=t.havingBaseSizing().sizeMultiplier;var h=s.height+s.depth+d+u;s.style.paddingLeft=Zl(h/2+d);var p=Math.floor(1e3*h*a),m="M400000 "+(r=p)+" H0 L"+r/2+" 0 l65 45 L145 "+(r-80)+" H400000z",f=new lc([new cc("phase",m)],{width:"400em",height:Zl(p/1e3),viewBox:"0 0 400000 "+p,preserveAspectRatio:"xMinYMin slice"});(n=id.makeSvgSpan(["hide-tail"],[f],t)).style.height=Zl(h),l=s.depth+d+u}else{/cancel/.test(o)?c||s.classes.push("cancel-pad"):"angl"===o?s.classes.push("anglpad"):s.classes.push("boxpad");var _=0,g=0,b=0;/box/.test(o)?(b=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),g=_=t.fontMetrics().fboxsep+("colorbox"===o?0:b)):"angl"===o?(_=4*(b=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness)),g=Math.max(0,.25-s.depth)):g=_=c?.2:0,n=function(e,t,n,r,i){var s,o=e.height+e.depth+n+r;if(/fbox|color|angl/.test(t)){if(s=id.makeSpan(["stretchy",t],[],i),"fbox"===t){var a=i.color&&i.getColor();a&&(s.style.borderColor=a)}}else{var l=[];/^[bx]cancel$/.test(t)&&l.push(new dc({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&l.push(new dc({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var c=new lc(l,{width:"100%",height:Zl(o)});s=id.makeSvgSpan([],[c],i)}return s.height=o,s.style.height=Zl(o),s}(s,o,_,g,t),/fbox|boxed|fcolorbox/.test(o)?(n.style.borderStyle="solid",n.style.borderWidth=Zl(b)):"angl"===o&&.049!==b&&(n.style.borderTopWidth=Zl(b),n.style.borderRightWidth=Zl(b)),l=s.depth+g,e.backgroundColor&&(n.style.backgroundColor=e.backgroundColor,e.borderColor&&(n.style.borderColor=e.borderColor))}if(e.backgroundColor)i=id.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:l},{type:"elem",elem:s,shift:0}]},t);else{var y=/cancel|phase/.test(o)?["svg-align"]:[];i=id.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:0},{type:"elem",elem:n,shift:l,wrapperClasses:y}]},t)}return/cancel/.test(o)&&(i.height=s.height,i.depth=s.depth),/cancel/.test(o)&&!c?id.makeSpan(["mord","cancel-lap"],[i],t):id.makeSpan(["mord"],[i],t)},Fu=(e,t)=>{var n=0,r=new Ed.MathNode(e.label.indexOf("colorbox")>-1?"mpadded":"menclose",[jd(e.body,t)]);switch(e.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),"\\fcolorbox"===e.label){var i=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute("style","border: "+i+"em solid "+String(e.borderColor))}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike")}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};pd({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(e,t,n){var{parser:r,funcName:i}=e,s=Xd(t[0],"color-token").color,o=t[1];return{type:"enclose",mode:r.mode,label:i,backgroundColor:s,body:o}},htmlBuilder:ju,mathmlBuilder:Fu}),pd({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(e,t,n){var{parser:r,funcName:i}=e,s=Xd(t[0],"color-token").color,o=Xd(t[1],"color-token").color,a=t[2];return{type:"enclose",mode:r.mode,label:i,backgroundColor:o,borderColor:s,body:a}},htmlBuilder:ju,mathmlBuilder:Fu}),pd({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\fbox",body:t[0]}}}),pd({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"enclose",mode:n.mode,label:r,body:i}},htmlBuilder:ju,mathmlBuilder:Fu}),pd({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\angl",body:t[0]}}});var Uu={};function qu(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:s,mathmlBuilder:o}=e,a={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},l=0;l<n.length;++l)Uu[n[l]]=a;s&&(ud[t]=s),o&&(hd[t]=o)}var $u={};function Gu(e,t){$u[e]=t}function Xu(e){var t=[];e.consumeSpaces();var n=e.fetch().text;for("\\relax"===n&&(e.consume(),e.consumeSpaces(),n=e.fetch().text);"\\hline"===n||"\\hdashline"===n;)e.consume(),t.push("\\hdashline"===n),e.consumeSpaces(),n=e.fetch().text;return t}var Ku=e=>{if(!e.parser.settings.displayMode)throw new cl("{"+e.envName+"} can be used only in display mode.")};function Wu(e){if(-1===e.indexOf("ed"))return-1===e.indexOf("*")}function Yu(e,t,n){var{hskipBeforeAndAfter:r,addJot:i,cols:s,arraystretch:o,colSeparationType:a,autoTag:l,singleRow:c,emptySingleRow:d,maxNumCols:u,leqno:h}=t;if(e.gullet.beginGroup(),c||e.gullet.macros.set("\\cr","\\\\\\relax"),!o){var p=e.gullet.expandMacroAsText("\\arraystretch");if(null==p)o=1;else if(!(o=parseFloat(p))||o<0)throw new cl("Invalid \\arraystretch: "+p)}e.gullet.beginGroup();var m=[],f=[m],_=[],g=[],b=null!=l?[]:void 0;function y(){l&&e.gullet.macros.set("\\@eqnsw","1",!0)}function v(){b&&(e.gullet.macros.get("\\df@tag")?(b.push(e.subparse([new ll("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):b.push(Boolean(l)&&"1"===e.gullet.macros.get("\\@eqnsw")))}for(y(),g.push(Xu(e));;){var w=e.parseExpression(!1,c?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup(),w={type:"ordgroup",mode:e.mode,body:w},n&&(w={type:"styling",mode:e.mode,style:n,body:[w]}),m.push(w);var x=e.fetch().text;if("&"===x){if(u&&m.length===u){if(c||a)throw new cl("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else{if("\\end"===x){v(),1===m.length&&"styling"===w.type&&0===w.body[0].body.length&&(f.length>1||!d)&&f.pop(),g.length<f.length+1&&g.push([]);break}if("\\\\"!==x)throw new cl("Expected & or \\\\ or \\cr or \\end",e.nextToken);e.consume();var k=void 0;" "!==e.gullet.future().text&&(k=e.parseSizeGroup(!0)),_.push(k?k.value:null),v(),g.push(Xu(e)),m=[],f.push(m),y()}}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:e.mode,addJot:i,arraystretch:o,body:f,cols:s,rowGaps:_,hskipBeforeAndAfter:r,hLinesBeforeRow:g,colSeparationType:a,tags:b,leqno:h}}function Zu(e){return"d"===e.slice(0,1)?"display":"text"}var Qu=function(e,t){var n,r,i=e.body.length,s=e.hLinesBeforeRow,o=0,a=new Array(i),l=[],c=Math.max(t.fontMetrics().arrayRuleWidth,t.minRuleThickness),d=1/t.fontMetrics().ptPerEm,u=5*d;e.colSeparationType&&"small"===e.colSeparationType&&(u=t.havingStyle(Pl.SCRIPT).sizeMultiplier/t.sizeMultiplier*.2778);var h="CD"===e.colSeparationType?Yl({number:3,unit:"ex"},t):12*d,p=3*d,m=e.arraystretch*h,f=.7*m,_=.3*m,g=0;function b(e){for(var t=0;t<e.length;++t)t>0&&(g+=.25),l.push({pos:g,isDashed:e[t]})}for(b(s[0]),n=0;n<e.body.length;++n){var y=e.body[n],v=f,w=_;o<y.length&&(o=y.length);var x=new Array(y.length);for(r=0;r<y.length;++r){var k=Td(y[r],t);w<k.depth&&(w=k.depth),v<k.height&&(v=k.height),x[r]=k}var S=e.rowGaps[n],C=0;S&&(C=Yl(S,t))>0&&(w<(C+=_)&&(w=C),C=0),e.addJot&&(w+=p),x.height=v,x.depth=w,g+=v,x.pos=g,g+=w+C,a[n]=x,b(s[n+1])}var M,L,T=g/2+t.fontMetrics().axisHeight,z=e.cols||[],A=[],R=[];if(e.tags&&e.tags.some(e=>e))for(n=0;n<i;++n){var P=a[n],N=P.pos-T,E=e.tags[n],O=void 0;(O=!0===E?id.makeSpan(["eqn-num"],[],t):id.makeSpan([],!1===E?[]:xd(E,t,!0),t)).depth=P.depth,O.height=P.height,R.push({type:"elem",elem:O,shift:N})}for(r=0,L=0;r<o||L<z.length;++r,++L){for(var I=z[L]||{},B=!0;"separator"===I.type;){if(B||((M=id.makeSpan(["arraycolsep"],[])).style.width=Zl(t.fontMetrics().doubleRuleSep),A.push(M)),"|"!==I.separator&&":"!==I.separator)throw new cl("Invalid separator type: "+I.separator);var D="|"===I.separator?"solid":"dashed",V=id.makeSpan(["vertical-separator"],[],t);V.style.height=Zl(g),V.style.borderRightWidth=Zl(c),V.style.borderRightStyle=D,V.style.margin="0 "+Zl(-c/2);var H=g-T;H&&(V.style.verticalAlign=Zl(-H)),A.push(V),I=z[++L]||{},B=!1}if(!(r>=o)){var j=void 0;(r>0||e.hskipBeforeAndAfter)&&0!==(j=fl(I.pregap,u))&&((M=id.makeSpan(["arraycolsep"],[])).style.width=Zl(j),A.push(M));var F=[];for(n=0;n<i;++n){var U=a[n],q=U[r];if(q){var $=U.pos-T;q.depth=U.depth,q.height=U.height,F.push({type:"elem",elem:q,shift:$})}}F=id.makeVList({positionType:"individualShift",children:F},t),F=id.makeSpan(["col-align-"+(I.align||"c")],[F]),A.push(F),(r<o-1||e.hskipBeforeAndAfter)&&0!==(j=fl(I.postgap,u))&&((M=id.makeSpan(["arraycolsep"],[])).style.width=Zl(j),A.push(M))}}if(a=id.makeSpan(["mtable"],A),l.length>0){for(var G=id.makeLineSpan("hline",t,c),X=id.makeLineSpan("hdashline",t,c),K=[{type:"elem",elem:a,shift:0}];l.length>0;){var W=l.pop(),Y=W.pos-T;W.isDashed?K.push({type:"elem",elem:X,shift:Y}):K.push({type:"elem",elem:G,shift:Y})}a=id.makeVList({positionType:"individualShift",children:K},t)}if(0===R.length)return id.makeSpan(["mord"],[a],t);var Z=id.makeVList({positionType:"individualShift",children:R},t);return Z=id.makeSpan(["tag"],[Z],t),id.makeFragment([a,Z])},Ju={c:"center ",l:"left ",r:"right "},eh=function(e,t){for(var n=[],r=new Ed.MathNode("mtd",[],["mtr-glue"]),i=new Ed.MathNode("mtd",[],["mml-eqn-num"]),s=0;s<e.body.length;s++){for(var o=e.body[s],a=[],l=0;l<o.length;l++)a.push(new Ed.MathNode("mtd",[jd(o[l],t)]));e.tags&&e.tags[s]&&(a.unshift(r),a.push(r),e.leqno?a.unshift(i):a.push(i)),n.push(new Ed.MathNode("mtr",a))}var c=new Ed.MathNode("mtable",n),d=.5===e.arraystretch?.1:.16+e.arraystretch-1+(e.addJot?.09:0);c.setAttribute("rowspacing",Zl(d));var u="",h="";if(e.cols&&e.cols.length>0){var p=e.cols,m="",f=!1,_=0,g=p.length;"separator"===p[0].type&&(u+="top ",_=1),"separator"===p[p.length-1].type&&(u+="bottom ",g-=1);for(var b=_;b<g;b++)"align"===p[b].type?(h+=Ju[p[b].align],f&&(m+="none "),f=!0):"separator"===p[b].type&&f&&(m+="|"===p[b].separator?"solid ":"dashed ",f=!1);c.setAttribute("columnalign",h.trim()),/[sd]/.test(m)&&c.setAttribute("columnlines",m.trim())}if("align"===e.colSeparationType){for(var y=e.cols||[],v="",w=1;w<y.length;w++)v+=w%2?"0em ":"1em ";c.setAttribute("columnspacing",v.trim())}else"alignat"===e.colSeparationType||"gather"===e.colSeparationType?c.setAttribute("columnspacing","0em"):"small"===e.colSeparationType?c.setAttribute("columnspacing","0.2778em"):"CD"===e.colSeparationType?c.setAttribute("columnspacing","0.5em"):c.setAttribute("columnspacing","1em");var x="",k=e.hLinesBeforeRow;u+=k[0].length>0?"left ":"",u+=k[k.length-1].length>0?"right ":"";for(var S=1;S<k.length-1;S++)x+=0===k[S].length?"none ":k[S][0]?"dashed ":"solid ";return/[sd]/.test(x)&&c.setAttribute("rowlines",x.trim()),""!==u&&(c=new Ed.MathNode("menclose",[c])).setAttribute("notation",u.trim()),e.arraystretch&&e.arraystretch<1&&(c=new Ed.MathNode("mstyle",[c])).setAttribute("scriptlevel","1"),c},th=function(e,t){-1===e.envName.indexOf("ed")&&Ku(e);var n,r=[],i=e.envName.indexOf("at")>-1?"alignat":"align",s="split"===e.envName,o=Yu(e.parser,{cols:r,addJot:!0,autoTag:s?void 0:Wu(e.envName),emptySingleRow:!0,colSeparationType:i,maxNumCols:s?2:void 0,leqno:e.parser.settings.leqno},"display"),a=0,l={type:"ordgroup",mode:e.mode,body:[]};if(t[0]&&"ordgroup"===t[0].type){for(var c="",d=0;d<t[0].body.length;d++)c+=Xd(t[0].body[d],"textord").text;n=Number(c),a=2*n}var u=!a;o.body.forEach(function(e){for(var t=1;t<e.length;t+=2){var r=Xd(e[t],"styling");Xd(r.body[0],"ordgroup").body.unshift(l)}if(u)a<e.length&&(a=e.length);else{var i=e.length/2;if(n<i)throw new cl("Too many math in a row: expected "+n+", but got "+i,e[0])}});for(var h=0;h<a;++h){var p="r",m=0;h%2==1?p="l":h>0&&u&&(m=1),r[h]={type:"align",align:p,pregap:m,postgap:0}}return o.colSeparationType=u?"align":"alignat",o};qu({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=(Wd(t[0])?[t[0]]:Xd(t[0],"ordgroup").body).map(function(e){var t=Kd(e).text;if(-1!=="lcr".indexOf(t))return{type:"align",align:t};if("|"===t)return{type:"separator",separator:"|"};if(":"===t)return{type:"separator",separator:":"};throw new cl("Unknown column alignment: "+t,e)}),r={cols:n,hskipBeforeAndAfter:!0,maxNumCols:n.length};return Yu(e.parser,r,Zu(e.envName))},htmlBuilder:Qu,mathmlBuilder:eh}),qu({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],n="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if("*"===e.envName.charAt(e.envName.length-1)){var i=e.parser;if(i.consumeSpaces(),"["===i.fetch().text){if(i.consume(),i.consumeSpaces(),n=i.fetch().text,-1==="lcr".indexOf(n))throw new cl("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),r.cols=[{type:"align",align:n}]}}var s=Yu(e.parser,r,Zu(e.envName)),o=Math.max(0,...s.body.map(e=>e.length));return s.cols=new Array(o).fill({type:"align",align:n}),t?{type:"leftright",mode:e.mode,body:[s],left:t[0],right:t[1],rightColor:void 0}:s},htmlBuilder:Qu,mathmlBuilder:eh}),qu({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t=Yu(e.parser,{arraystretch:.5},"script");return t.colSeparationType="small",t},htmlBuilder:Qu,mathmlBuilder:eh}),qu({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=(Wd(t[0])?[t[0]]:Xd(t[0],"ordgroup").body).map(function(e){var t=Kd(e).text;if(-1!=="lc".indexOf(t))return{type:"align",align:t};throw new cl("Unknown column alignment: "+t,e)});if(n.length>1)throw new cl("{subarray} can contain only one column");var r={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5};if((r=Yu(e.parser,r,"script")).body.length>0&&r.body[0].length>1)throw new cl("{subarray} can contain only one column");return r},htmlBuilder:Qu,mathmlBuilder:eh}),qu({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t=Yu(e.parser,{arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},Zu(e.envName));return{type:"leftright",mode:e.mode,body:[t],left:e.envName.indexOf("r")>-1?".":"\\{",right:e.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:Qu,mathmlBuilder:eh}),qu({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:th,htmlBuilder:Qu,mathmlBuilder:eh}),qu({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){ml(["gather","gather*"],e.envName)&&Ku(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:Wu(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Yu(e.parser,t,"display")},htmlBuilder:Qu,mathmlBuilder:eh}),qu({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:th,htmlBuilder:Qu,mathmlBuilder:eh}),qu({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Ku(e);var t={autoTag:Wu(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Yu(e.parser,t,"display")},htmlBuilder:Qu,mathmlBuilder:eh}),qu({type:"array",names:["CD"],props:{numArgs:0},handler:e=>(Ku(e),function(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if("&"!==n&&"\\\\"!==n){if("\\end"===n){0===t[t.length-1].length&&t.pop();break}throw new cl("Expected \\\\ or \\cr or \\end",e.nextToken)}e.consume()}for(var r=[],i=[r],s=0;s<t.length;s++){for(var o=t[s],a=su(),l=0;l<o.length;l++)if(ou(o[l])){r.push(a);var c=Kd(o[l+=1]).text,d=new Array(2);if(d[0]={type:"ordgroup",mode:"math",body:[]},d[1]={type:"ordgroup",mode:"math",body:[]},"=|.".indexOf(c)>-1);else{if(!("<>AV".indexOf(c)>-1))throw new cl('Expected one of "<>AV=|." after @',o[l]);for(var u=0;u<2;u++){for(var h=!0,p=l+1;p<o.length;p++){if(au(o[p],c)){h=!1,l=p;break}if(ou(o[p]))throw new cl("Missing a "+c+" character to complete a CD arrow.",o[p]);d[u].body.push(o[p])}if(h)throw new cl("Missing a "+c+" character to complete a CD arrow.",o[l])}}var m={type:"styling",body:[lu(c,d,e)],mode:"math",style:"display"};r.push(m),a=su()}else a.body.push(o[l]);s%2==0?r.push(a):r.shift(),r=[],i.push(r)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25}),colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}(e.parser)),htmlBuilder:Qu,mathmlBuilder:eh}),Gu("\\nonumber","\\gdef\\@eqnsw{0}"),Gu("\\notag","\\nonumber"),pd({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new cl(e.funcName+" valid only within array environment")}});var nh=Uu;pd({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];if("ordgroup"!==i.type)throw new cl("Invalid environment name",i);for(var s="",o=0;o<i.body.length;++o)s+=Xd(i.body[o],"textord").text;if("\\begin"===r){if(!nh.hasOwnProperty(s))throw new cl("No such environment: "+s,i);var a=nh[s],{args:l,optArgs:c}=n.parseArguments("\\begin{"+s+"}",a),d={mode:n.mode,envName:s,parser:n},u=a.handler(d,l,c);n.expect("\\end",!1);var h=n.nextToken,p=Xd(n.parseFunction(),"environment");if(p.name!==s)throw new cl("Mismatch: \\begin{"+s+"} matched by \\end{"+p.name+"}",h);return u}return{type:"environment",mode:n.mode,name:s,nameGroup:i}}});var rh=(e,t)=>{var n=e.font,r=t.withFont(n);return Td(e.body,r)},ih=(e,t)=>{var n=e.font,r=t.withFont(n);return jd(e.body,r)},sh={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};pd({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=fd(t[0]),s=r;return s in sh&&(s=sh[s]),{type:"font",mode:n.mode,font:s.slice(1),body:i}},htmlBuilder:rh,mathmlBuilder:ih}),pd({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,r=t[0],i=yl(r);return{type:"mclass",mode:n.mode,mclass:ru(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:i}}}),pd({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r,breakOnTokenText:i}=e,{mode:s}=n,o=n.parseExpression(!0,i);return{type:"font",mode:s,font:"math"+r.slice(1),body:{type:"ordgroup",mode:n.mode,body:o}}},htmlBuilder:rh,mathmlBuilder:ih});var oh=(e,t)=>{var n=t;return"display"===e?n=n.id>=Pl.SCRIPT.id?n.text():Pl.DISPLAY:"text"===e&&n.size===Pl.DISPLAY.size?n=Pl.TEXT:"script"===e?n=Pl.SCRIPT:"scriptscript"===e&&(n=Pl.SCRIPTSCRIPT),n},ah=(e,t)=>{var n,r=oh(e.size,t.style),i=r.fracNum(),s=r.fracDen();n=t.havingStyle(i);var o=Td(e.numer,n,t);if(e.continued){var a=8.5/t.fontMetrics().ptPerEm,l=3.5/t.fontMetrics().ptPerEm;o.height=o.height<a?a:o.height,o.depth=o.depth<l?l:o.depth}n=t.havingStyle(s);var c,d,u,h,p,m,f,_,g,b,y=Td(e.denom,n,t);if(e.hasBarLine?(e.barSize?(d=Yl(e.barSize,t),c=id.makeLineSpan("frac-line",t,d)):c=id.makeLineSpan("frac-line",t),d=c.height,u=c.height):(c=null,d=0,u=t.fontMetrics().defaultRuleThickness),r.size===Pl.DISPLAY.size||"display"===e.size?(h=t.fontMetrics().num1,p=d>0?3*u:7*u,m=t.fontMetrics().denom1):(d>0?(h=t.fontMetrics().num2,p=u):(h=t.fontMetrics().num3,p=3*u),m=t.fontMetrics().denom2),c){var v=t.fontMetrics().axisHeight;h-o.depth-(v+.5*d)<p&&(h+=p-(h-o.depth-(v+.5*d))),v-.5*d-(y.height-m)<p&&(m+=p-(v-.5*d-(y.height-m))),f=id.makeVList({positionType:"individualShift",children:[{type:"elem",elem:y,shift:m},{type:"elem",elem:c,shift:-(v-.5*d)},{type:"elem",elem:o,shift:-h}]},t)}else{var w=h-o.depth-(y.height-m);w<p&&(h+=.5*(p-w),m+=.5*(p-w)),f=id.makeVList({positionType:"individualShift",children:[{type:"elem",elem:y,shift:m},{type:"elem",elem:o,shift:-h}]},t)}return n=t.havingStyle(r),f.height*=n.sizeMultiplier/t.sizeMultiplier,f.depth*=n.sizeMultiplier/t.sizeMultiplier,_=r.size===Pl.DISPLAY.size?t.fontMetrics().delim1:r.size===Pl.SCRIPTSCRIPT.size?t.havingStyle(Pl.SCRIPT).fontMetrics().delim2:t.fontMetrics().delim2,g=null==e.leftDelim?Ld(t,["mopen"]):Iu.customSizedDelim(e.leftDelim,_,!0,t.havingStyle(r),e.mode,["mopen"]),b=e.continued?id.makeSpan([]):null==e.rightDelim?Ld(t,["mclose"]):Iu.customSizedDelim(e.rightDelim,_,!0,t.havingStyle(r),e.mode,["mclose"]),id.makeSpan(["mord"].concat(n.sizingClasses(t)),[g,id.makeSpan(["mfrac"],[f]),b],t)},lh=(e,t)=>{var n=new Ed.MathNode("mfrac",[jd(e.numer,t),jd(e.denom,t)]);if(e.hasBarLine){if(e.barSize){var r=Yl(e.barSize,t);n.setAttribute("linethickness",Zl(r))}}else n.setAttribute("linethickness","0px");var i=oh(e.size,t.style);if(i.size!==t.style.size){n=new Ed.MathNode("mstyle",[n]);var s=i.size===Pl.DISPLAY.size?"true":"false";n.setAttribute("displaystyle",s),n.setAttribute("scriptlevel","0")}if(null!=e.leftDelim||null!=e.rightDelim){var o=[];if(null!=e.leftDelim){var a=new Ed.MathNode("mo",[new Ed.TextNode(e.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),o.push(a)}if(o.push(n),null!=e.rightDelim){var l=new Ed.MathNode("mo",[new Ed.TextNode(e.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),o.push(l)}return Id(o)}return n};pd({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var n,{parser:r,funcName:i}=e,s=t[0],o=t[1],a=null,l=null,c="auto";switch(i){case"\\dfrac":case"\\frac":case"\\tfrac":n=!0;break;case"\\\\atopfrac":n=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":n=!1,a="(",l=")";break;case"\\\\bracefrac":n=!1,a="\\{",l="\\}";break;case"\\\\brackfrac":n=!1,a="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}switch(i){case"\\dfrac":case"\\dbinom":c="display";break;case"\\tfrac":case"\\tbinom":c="text"}return{type:"genfrac",mode:r.mode,continued:!1,numer:s,denom:o,hasBarLine:n,leftDelim:a,rightDelim:l,size:c,barSize:null}},htmlBuilder:ah,mathmlBuilder:lh}),pd({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],s=t[1];return{type:"genfrac",mode:n.mode,continued:!0,numer:i,denom:s,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}}),pd({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var t,{parser:n,funcName:r,token:i}=e;switch(r){case"\\over":t="\\frac";break;case"\\choose":t="\\binom";break;case"\\atop":t="\\\\atopfrac";break;case"\\brace":t="\\\\bracefrac";break;case"\\brack":t="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:n.mode,replaceWith:t,token:i}}});var ch=["display","text","script","scriptscript"],dh=function(e){var t=null;return e.length>0&&(t="."===(t=e)?null:t),t};pd({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){var n,{parser:r}=e,i=t[4],s=t[5],o=fd(t[0]),a="atom"===o.type&&"open"===o.family?dh(o.text):null,l=fd(t[1]),c="atom"===l.type&&"close"===l.family?dh(l.text):null,d=Xd(t[2],"size"),u=null;n=!!d.isBlank||(u=d.value).number>0;var h="auto",p=t[3];if("ordgroup"===p.type){if(p.body.length>0){var m=Xd(p.body[0],"textord");h=ch[Number(m.text)]}}else p=Xd(p,"textord"),h=ch[Number(p.text)];return{type:"genfrac",mode:r.mode,numer:i,denom:s,continued:!1,hasBarLine:n,barSize:u,leftDelim:a,rightDelim:c,size:h}},htmlBuilder:ah,mathmlBuilder:lh}),pd({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){var{parser:n,funcName:r,token:i}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:Xd(t[0],"size").value,token:i}}}),pd({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],s=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e}(Xd(t[1],"infix").size),o=t[2],a=s.number>0;return{type:"genfrac",mode:n.mode,numer:i,denom:o,continued:!1,hasBarLine:a,barSize:s,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:ah,mathmlBuilder:lh});var uh=(e,t)=>{var n,r,i=t.style;"supsub"===e.type?(n=e.sup?Td(e.sup,t.havingStyle(i.sup()),t):Td(e.sub,t.havingStyle(i.sub()),t),r=Xd(e.base,"horizBrace")):r=Xd(e,"horizBrace");var s,o=Td(r.base,t.havingBaseStyle(Pl.DISPLAY)),a=Gd(r,t);if(r.isOver?(s=id.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"kern",size:.1},{type:"elem",elem:a}]},t)).children[0].children[0].children[1].classes.push("svg-align"):(s=id.makeVList({positionType:"bottom",positionData:o.depth+.1+a.height,children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:o}]},t)).children[0].children[0].children[0].classes.push("svg-align"),n){var l=id.makeSpan(["mord",r.isOver?"mover":"munder"],[s],t);s=r.isOver?id.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]},t):id.makeVList({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]},t)}return id.makeSpan(["mord",r.isOver?"mover":"munder"],[s],t)};pd({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"horizBrace",mode:n.mode,label:r,isOver:/^\\over/.test(r),base:t[0]}},htmlBuilder:uh,mathmlBuilder:(e,t)=>{var n=$d(e.label);return new Ed.MathNode(e.isOver?"mover":"munder",[jd(e.base,t),n])}}),pd({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[1],i=Xd(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:n.mode,href:i,body:_d(r)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var n=xd(e.body,t,!1);return id.makeAnchor(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=Hd(e.body,t);return n instanceof Pd||(n=new Pd("mrow",[n])),n.setAttribute("href",e.href),n}}),pd({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=Xd(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:r}))return n.formatUnsupportedCmd("\\url");for(var i=[],s=0;s<r.length;s++){var o=r[s];"~"===o&&(o="\\textasciitilde"),i.push({type:"textord",mode:"text",text:o})}var a={type:"text",mode:n.mode,font:"\\texttt",body:i};return{type:"href",mode:n.mode,href:r,body:_d(a)}}}),pd({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler(e,t){var{parser:n}=e;return{type:"hbox",mode:n.mode,body:_d(t[0])}},htmlBuilder(e,t){var n=xd(e.body,t,!1);return id.makeFragment(n)},mathmlBuilder:(e,t)=>new Ed.MathNode("mrow",Vd(e.body,t))}),pd({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(e,t)=>{var n,{parser:r,funcName:i,token:s}=e,o=Xd(t[0],"raw").string,a=t[1];r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var l={};switch(i){case"\\htmlClass":l.class=o,n={command:"\\htmlClass",class:o};break;case"\\htmlId":l.id=o,n={command:"\\htmlId",id:o};break;case"\\htmlStyle":l.style=o,n={command:"\\htmlStyle",style:o};break;case"\\htmlData":for(var c=o.split(","),d=0;d<c.length;d++){var u=c[d].split("=");if(2!==u.length)throw new cl("Error parsing key-value for \\htmlData");l["data-"+u[0].trim()]=u[1].trim()}n={command:"\\htmlData",attributes:l};break;default:throw new Error("Unrecognized html command")}return r.settings.isTrusted(n)?{type:"html",mode:r.mode,attributes:l,body:_d(a)}:r.formatUnsupportedCmd(i)},htmlBuilder:(e,t)=>{var n=xd(e.body,t,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var i=id.makeSpan(r,n,t);for(var s in e.attributes)"class"!==s&&e.attributes.hasOwnProperty(s)&&i.setAttribute(s,e.attributes[s]);return i},mathmlBuilder:(e,t)=>Hd(e.body,t)}),pd({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"htmlmathml",mode:n.mode,html:_d(t[0]),mathml:_d(t[1])}},htmlBuilder:(e,t)=>{var n=xd(e.html,t,!1);return id.makeFragment(n)},mathmlBuilder:(e,t)=>Hd(e.mathml,t)});var hh=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new cl("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(t[1]+t[2]),unit:t[3]};if(!Wl(n))throw new cl("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};pd({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,n)=>{var{parser:r}=e,i={number:0,unit:"em"},s={number:.9,unit:"em"},o={number:0,unit:"em"},a="";if(n[0])for(var l=Xd(n[0],"raw").string.split(","),c=0;c<l.length;c++){var d=l[c].split("=");if(2===d.length){var u=d[1].trim();switch(d[0].trim()){case"alt":a=u;break;case"width":i=hh(u);break;case"height":s=hh(u);break;case"totalheight":o=hh(u);break;default:throw new cl("Invalid key: '"+d[0]+"' in \\includegraphics.")}}}var h=Xd(t[0],"url").url;return""===a&&(a=(a=(a=h).replace(/^.*[\\/]/,"")).substring(0,a.lastIndexOf("."))),r.settings.isTrusted({command:"\\includegraphics",url:h})?{type:"includegraphics",mode:r.mode,alt:a,width:i,height:s,totalheight:o,src:h}:r.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(e,t)=>{var n=Yl(e.height,t),r=0;e.totalheight.number>0&&(r=Yl(e.totalheight,t)-n);var i=0;e.width.number>0&&(i=Yl(e.width,t));var s={height:Zl(n+r)};i>0&&(s.width=Zl(i)),r>0&&(s.verticalAlign=Zl(-r));var o=new sc(e.src,e.alt,s);return o.height=n,o.depth=r,o},mathmlBuilder:(e,t)=>{var n=new Ed.MathNode("mglyph",[]);n.setAttribute("alt",e.alt);var r=Yl(e.height,t),i=0;if(e.totalheight.number>0&&(i=Yl(e.totalheight,t)-r,n.setAttribute("valign",Zl(-i))),n.setAttribute("height",Zl(r+i)),e.width.number>0){var s=Yl(e.width,t);n.setAttribute("width",Zl(s))}return n.setAttribute("src",e.src),n}}),pd({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=Xd(t[0],"size");if(n.settings.strict){var s="m"===r[1],o="mu"===i.value.unit;s?(o||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, not "+i.value.unit+" units"),"math"!==n.mode&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):o&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:i.value}},htmlBuilder:(e,t)=>id.makeGlue(e.dimension,t),mathmlBuilder(e,t){var n=Yl(e.dimension,t);return new Ed.SpaceNode(n)}}),pd({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"lap",mode:n.mode,alignment:r.slice(5),body:i}},htmlBuilder:(e,t)=>{var n;"clap"===e.alignment?(n=id.makeSpan([],[Td(e.body,t)]),n=id.makeSpan(["inner"],[n],t)):n=id.makeSpan(["inner"],[Td(e.body,t)]);var r=id.makeSpan(["fix"],[]),i=id.makeSpan([e.alignment],[n,r],t),s=id.makeSpan(["strut"]);return s.style.height=Zl(i.height+i.depth),i.depth&&(s.style.verticalAlign=Zl(-i.depth)),i.children.unshift(s),i=id.makeSpan(["thinbox"],[i],t),id.makeSpan(["mord","vbox"],[i],t)},mathmlBuilder:(e,t)=>{var n=new Ed.MathNode("mpadded",[jd(e.body,t)]);if("rlap"!==e.alignment){var r="llap"===e.alignment?"-1":"-0.5";n.setAttribute("lspace",r+"width")}return n.setAttribute("width","0px"),n}}),pd({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:r}=e,i=r.mode;r.switchMode("math");var s="\\("===n?"\\)":"$",o=r.parseExpression(!1,s);return r.expect(s),r.switchMode(i),{type:"styling",mode:r.mode,style:"text",body:o}}}),pd({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new cl("Mismatched "+e.funcName)}});var ph=(e,t)=>{switch(t.style.size){case Pl.DISPLAY.size:return e.display;case Pl.TEXT.size:return e.text;case Pl.SCRIPT.size:return e.script;case Pl.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};pd({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:_d(t[0]),text:_d(t[1]),script:_d(t[2]),scriptscript:_d(t[3])}},htmlBuilder:(e,t)=>{var n=ph(e,t),r=xd(n,t,!1);return id.makeFragment(r)},mathmlBuilder:(e,t)=>{var n=ph(e,t);return Hd(n,t)}});var mh=(e,t,n,r,i,s,o)=>{e=id.makeSpan([],[e]);var a,l,c,d=n&&yl(n);if(t){var u=Td(t,r.havingStyle(i.sup()),r);l={elem:u,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-u.depth)}}if(n){var h=Td(n,r.havingStyle(i.sub()),r);a={elem:h,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-h.height)}}if(l&&a){var p=r.fontMetrics().bigOpSpacing5+a.elem.height+a.elem.depth+a.kern+e.depth+o;c=id.makeVList({positionType:"bottom",positionData:p,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:a.elem,marginLeft:Zl(-s)},{type:"kern",size:a.kern},{type:"elem",elem:e},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:Zl(s)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}else if(a){var m=e.height-o;c=id.makeVList({positionType:"top",positionData:m,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:a.elem,marginLeft:Zl(-s)},{type:"kern",size:a.kern},{type:"elem",elem:e}]},r)}else{if(!l)return e;var f=e.depth+o;c=id.makeVList({positionType:"bottom",positionData:f,children:[{type:"elem",elem:e},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:Zl(s)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}var _=[c];if(a&&0!==s&&!d){var g=id.makeSpan(["mspace"],[],r);g.style.marginRight=Zl(s),_.unshift(g)}return id.makeSpan(["mop","op-limits"],_,r)},fh=["\\smallint"],_h=(e,t)=>{var n,r,i,s=!1;"supsub"===e.type?(n=e.sup,r=e.sub,i=Xd(e.base,"op"),s=!0):i=Xd(e,"op");var o,a=t.style,l=!1;if(a.size===Pl.DISPLAY.size&&i.symbol&&!ml(fh,i.name)&&(l=!0),i.symbol){var c=l?"Size2-Regular":"Size1-Regular",d="";if("\\oiint"!==i.name&&"\\oiiint"!==i.name||(d=i.name.slice(1),i.name="oiint"===d?"\\iint":"\\iiint"),o=id.makeSymbol(i.name,c,"math",t,["mop","op-symbol",l?"large-op":"small-op"]),d.length>0){var u=o.italic,h=id.staticSvg(d+"Size"+(l?"2":"1"),t);o=id.makeVList({positionType:"individualShift",children:[{type:"elem",elem:o,shift:0},{type:"elem",elem:h,shift:l?.08:0}]},t),i.name="\\"+d,o.classes.unshift("mop"),o.italic=u}}else if(i.body){var p=xd(i.body,t,!0);1===p.length&&p[0]instanceof ac?(o=p[0]).classes[0]="mop":o=id.makeSpan(["mop"],p,t)}else{for(var m=[],f=1;f<i.name.length;f++)m.push(id.mathsym(i.name[f],i.mode,t));o=id.makeSpan(["mop"],m,t)}var _=0,g=0;return(o instanceof ac||"\\oiint"===i.name||"\\oiiint"===i.name)&&!i.suppressBaseShift&&(_=(o.height-o.depth)/2-t.fontMetrics().axisHeight,g=o.italic),s?mh(o,n,r,t,a,g,_):(_&&(o.style.position="relative",o.style.top=Zl(_)),o)},gh=(e,t)=>{var n;if(e.symbol)n=new Pd("mo",[Od(e.name,e.mode)]),ml(fh,e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new Pd("mo",Vd(e.body,t));else{n=new Pd("mi",[new Nd(e.name.slice(1))]);var r=new Pd("mo",[Od("","text")]);n=e.parentIsSupSub?new Pd("mrow",[n,r]):Rd([n,r])}return n},bh={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};pd({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=r;return 1===i.length&&(i=bh[i]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:_h,mathmlBuilder:gh}),pd({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:_d(r)}},htmlBuilder:_h,mathmlBuilder:gh});var yh={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};pd({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:_h,mathmlBuilder:gh}),pd({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:_h,mathmlBuilder:gh}),pd({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e,r=n;return 1===r.length&&(r=yh[r]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:_h,mathmlBuilder:gh});var vh=(e,t)=>{var n,r,i,s,o=!1;if("supsub"===e.type?(n=e.sup,r=e.sub,i=Xd(e.base,"operatorname"),o=!0):i=Xd(e,"operatorname"),i.body.length>0){for(var a=i.body.map(e=>{var t=e.text;return"string"==typeof t?{type:"textord",mode:e.mode,text:t}:e}),l=xd(a,t.withFont("mathrm"),!0),c=0;c<l.length;c++){var d=l[c];d instanceof ac&&(d.text=d.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}s=id.makeSpan(["mop"],l,t)}else s=id.makeSpan(["mop"],[],t);return o?mh(s,n,r,t,t.style,0,0):s};function wh(e,t,n){for(var r=xd(e,t,!1),i=t.sizeMultiplier/n.sizeMultiplier,s=0;s<r.length;s++){var o=r[s].classes.indexOf("sizing");o<0?Array.prototype.push.apply(r[s].classes,t.sizingClasses(n)):r[s].classes[o+1]==="reset-size"+t.size&&(r[s].classes[o+1]="reset-size"+n.size),r[s].height*=i,r[s].depth*=i}return id.makeFragment(r)}pd({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"operatorname",mode:n.mode,body:_d(i),alwaysHandleSupSub:"\\operatornamewithlimits"===r,limits:!1,parentIsSupSub:!1}},htmlBuilder:vh,mathmlBuilder:(e,t)=>{for(var n=Vd(e.body,t.withFont("mathrm")),r=!0,i=0;i<n.length;i++){var s=n[i];if(s instanceof Ed.SpaceNode);else if(s instanceof Ed.MathNode)switch(s.type){case"mi":case"mn":case"ms":case"mspace":case"mtext":break;case"mo":var o=s.children[0];1===s.children.length&&o instanceof Ed.TextNode?o.text=o.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):r=!1;break;default:r=!1}else r=!1}if(r){var a=n.map(e=>e.toText()).join("");n=[new Ed.TextNode(a)]}var l=new Ed.MathNode("mi",n);l.setAttribute("mathvariant","normal");var c=new Ed.MathNode("mo",[Od("","text")]);return e.parentIsSupSub?new Ed.MathNode("mrow",[l,c]):Ed.newDocumentFragment([l,c])}}),Gu("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),md({type:"ordgroup",htmlBuilder:(e,t)=>e.semisimple?id.makeFragment(xd(e.body,t,!1)):id.makeSpan(["mord"],xd(e.body,t,!0),t),mathmlBuilder:(e,t)=>Hd(e.body,t,!0)}),pd({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,t){var{parser:n}=e,r=t[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(e,t){var n=Td(e.body,t.havingCrampedStyle()),r=id.makeLineSpan("overline-line",t),i=t.fontMetrics().defaultRuleThickness,s=id.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r},{type:"kern",size:i}]},t);return id.makeSpan(["mord","overline"],[s],t)},mathmlBuilder(e,t){var n=new Ed.MathNode("mo",[new Ed.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new Ed.MathNode("mover",[jd(e.body,t),n]);return r.setAttribute("accent","true"),r}}),pd({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"phantom",mode:n.mode,body:_d(r)}},htmlBuilder:(e,t)=>{var n=xd(e.body,t.withPhantom(),!1);return id.makeFragment(n)},mathmlBuilder:(e,t)=>{var n=Vd(e.body,t);return new Ed.MathNode("mphantom",n)}}),pd({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"hphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=id.makeSpan([],[Td(e.body,t.withPhantom())]);if(n.height=0,n.depth=0,n.children)for(var r=0;r<n.children.length;r++)n.children[r].height=0,n.children[r].depth=0;return n=id.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},t),id.makeSpan(["mord"],[n],t)},mathmlBuilder:(e,t)=>{var n=Vd(_d(e.body),t),r=new Ed.MathNode("mphantom",n),i=new Ed.MathNode("mpadded",[r]);return i.setAttribute("height","0px"),i.setAttribute("depth","0px"),i}}),pd({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"vphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=id.makeSpan(["inner"],[Td(e.body,t.withPhantom())]),r=id.makeSpan(["fix"],[]);return id.makeSpan(["mord","rlap"],[n,r],t)},mathmlBuilder:(e,t)=>{var n=Vd(_d(e.body),t),r=new Ed.MathNode("mphantom",n),i=new Ed.MathNode("mpadded",[r]);return i.setAttribute("width","0px"),i}}),pd({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e,r=Xd(t[0],"size").value,i=t[1];return{type:"raisebox",mode:n.mode,dy:r,body:i}},htmlBuilder(e,t){var n=Td(e.body,t),r=Yl(e.dy,t);return id.makeVList({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]},t)},mathmlBuilder(e,t){var n=new Ed.MathNode("mpadded",[jd(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute("voffset",r),n}}),pd({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}}),pd({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,t,n){var{parser:r}=e,i=n[0],s=Xd(t[0],"size"),o=Xd(t[1],"size");return{type:"rule",mode:r.mode,shift:i&&Xd(i,"size").value,width:s.value,height:o.value}},htmlBuilder(e,t){var n=id.makeSpan(["mord","rule"],[],t),r=Yl(e.width,t),i=Yl(e.height,t),s=e.shift?Yl(e.shift,t):0;return n.style.borderRightWidth=Zl(r),n.style.borderTopWidth=Zl(i),n.style.bottom=Zl(s),n.width=r,n.height=i+s,n.depth=-s,n.maxFontSize=1.125*i*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=Yl(e.width,t),r=Yl(e.height,t),i=e.shift?Yl(e.shift,t):0,s=t.color&&t.getColor()||"black",o=new Ed.MathNode("mspace");o.setAttribute("mathbackground",s),o.setAttribute("width",Zl(n)),o.setAttribute("height",Zl(r));var a=new Ed.MathNode("mpadded",[o]);return i>=0?a.setAttribute("height",Zl(i)):(a.setAttribute("height",Zl(i)),a.setAttribute("depth",Zl(-i))),a.setAttribute("voffset",Zl(i)),a}});var xh=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"];pd({type:"sizing",names:xh,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:n,funcName:r,parser:i}=e,s=i.parseExpression(!1,n);return{type:"sizing",mode:i.mode,size:xh.indexOf(r)+1,body:s}},htmlBuilder:(e,t)=>{var n=t.havingSize(e.size);return wh(e.body,n,t)},mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=Vd(e.body,n),i=new Ed.MathNode("mstyle",r);return i.setAttribute("mathsize",Zl(n.sizeMultiplier)),i}}),pd({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:r}=e,i=!1,s=!1,o=n[0]&&Xd(n[0],"ordgroup");if(o)for(var a="",l=0;l<o.body.length;++l)if("t"===(a=o.body[l].text))i=!0;else{if("b"!==a){i=!1,s=!1;break}s=!0}else i=!0,s=!0;var c=t[0];return{type:"smash",mode:r.mode,body:c,smashHeight:i,smashDepth:s}},htmlBuilder:(e,t)=>{var n=id.makeSpan([],[Td(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0,n.children))for(var r=0;r<n.children.length;r++)n.children[r].height=0;if(e.smashDepth&&(n.depth=0,n.children))for(var i=0;i<n.children.length;i++)n.children[i].depth=0;var s=id.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},t);return id.makeSpan(["mord"],[s],t)},mathmlBuilder:(e,t)=>{var n=new Ed.MathNode("mpadded",[jd(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}}),pd({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r}=e,i=n[0],s=t[0];return{type:"sqrt",mode:r.mode,body:s,index:i}},htmlBuilder(e,t){var n=Td(e.body,t.havingCrampedStyle());0===n.height&&(n.height=t.fontMetrics().xHeight),n=id.wrapFragment(n,t);var r=t.fontMetrics().defaultRuleThickness,i=r;t.style.id<Pl.TEXT.id&&(i=t.fontMetrics().xHeight);var s=r+i/4,o=n.height+n.depth+s+r,{span:a,ruleWidth:l,advanceWidth:c}=Iu.sqrtImage(o,t),d=a.height-l;d>n.height+n.depth+s&&(s=(s+d-n.height-n.depth)/2);var u=a.height-n.height-s-l;n.style.paddingLeft=Zl(c);var h=id.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+u)},{type:"elem",elem:a},{type:"kern",size:l}]},t);if(e.index){var p=t.havingStyle(Pl.SCRIPTSCRIPT),m=Td(e.index,p,t),f=.6*(h.height-h.depth),_=id.makeVList({positionType:"shift",positionData:-f,children:[{type:"elem",elem:m}]},t),g=id.makeSpan(["root"],[_]);return id.makeSpan(["mord","sqrt"],[g,h],t)}return id.makeSpan(["mord","sqrt"],[h],t)},mathmlBuilder(e,t){var{body:n,index:r}=e;return r?new Ed.MathNode("mroot",[jd(n,t),jd(r,t)]):new Ed.MathNode("msqrt",[jd(n,t)])}});var kh={display:Pl.DISPLAY,text:Pl.TEXT,script:Pl.SCRIPT,scriptscript:Pl.SCRIPTSCRIPT};pd({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:r,parser:i}=e,s=i.parseExpression(!0,n),o=r.slice(1,r.length-5);return{type:"styling",mode:i.mode,style:o,body:s}},htmlBuilder(e,t){var n=kh[e.style],r=t.havingStyle(n).withFont("");return wh(e.body,r,t)},mathmlBuilder(e,t){var n=kh[e.style],r=t.havingStyle(n),i=Vd(e.body,r),s=new Ed.MathNode("mstyle",i),o={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]}[e.style];return s.setAttribute("scriptlevel",o[0]),s.setAttribute("displaystyle",o[1]),s}}),md({type:"supsub",htmlBuilder(e,t){var n=function(e,t){var n=e.base;return n?"op"===n.type?n.limits&&(t.style.size===Pl.DISPLAY.size||n.alwaysHandleSupSub)?_h:null:"operatorname"===n.type?n.alwaysHandleSupSub&&(t.style.size===Pl.DISPLAY.size||n.limits)?vh:null:"accent"===n.type?yl(n.base)?Yd:null:"horizBrace"===n.type&&!e.sub===n.isOver?uh:null:null}(e,t);if(n)return n(e,t);var r,i,s,{base:o,sup:a,sub:l}=e,c=Td(o,t),d=t.fontMetrics(),u=0,h=0,p=o&&yl(o);if(a){var m=t.havingStyle(t.style.sup());r=Td(a,m,t),p||(u=c.height-m.fontMetrics().supDrop*m.sizeMultiplier/t.sizeMultiplier)}if(l){var f=t.havingStyle(t.style.sub());i=Td(l,f,t),p||(h=c.depth+f.fontMetrics().subDrop*f.sizeMultiplier/t.sizeMultiplier)}s=t.style===Pl.DISPLAY?d.sup1:t.style.cramped?d.sup3:d.sup2;var _,g=t.sizeMultiplier,b=Zl(.5/d.ptPerEm/g),y=null;if(i){var v=e.base&&"op"===e.base.type&&e.base.name&&("\\oiint"===e.base.name||"\\oiiint"===e.base.name);(c instanceof ac||v)&&(y=Zl(-c.italic))}if(r&&i){u=Math.max(u,s,r.depth+.25*d.xHeight),h=Math.max(h,d.sub2);var w=4*d.defaultRuleThickness;if(u-r.depth-(i.height-h)<w){h=w-(u-r.depth)+i.height;var x=.8*d.xHeight-(u-r.depth);x>0&&(u+=x,h-=x)}_=id.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:h,marginRight:b,marginLeft:y},{type:"elem",elem:r,shift:-u,marginRight:b}]},t)}else if(i){h=Math.max(h,d.sub1,i.height-.8*d.xHeight),_=id.makeVList({positionType:"shift",positionData:h,children:[{type:"elem",elem:i,marginLeft:y,marginRight:b}]},t)}else{if(!r)throw new Error("supsub must have either sup or sub.");u=Math.max(u,s,r.depth+.25*d.xHeight),_=id.makeVList({positionType:"shift",positionData:-u,children:[{type:"elem",elem:r,marginRight:b}]},t)}var k=Md(c,"right")||"mord";return id.makeSpan([k],[c,id.makeSpan(["msupsub"],[_])],t)},mathmlBuilder(e,t){var n,r=!1;e.base&&"horizBrace"===e.base.type&&!!e.sup===e.base.isOver&&(r=!0,n=e.base.isOver),!e.base||"op"!==e.base.type&&"operatorname"!==e.base.type||(e.base.parentIsSupSub=!0);var i,s=[jd(e.base,t)];if(e.sub&&s.push(jd(e.sub,t)),e.sup&&s.push(jd(e.sup,t)),r)i=n?"mover":"munder";else if(e.sub)if(e.sup){var o=e.base;i=o&&"op"===o.type&&o.limits&&t.style===Pl.DISPLAY||o&&"operatorname"===o.type&&o.alwaysHandleSupSub&&(t.style===Pl.DISPLAY||o.limits)?"munderover":"msubsup"}else{var a=e.base;i=a&&"op"===a.type&&a.limits&&(t.style===Pl.DISPLAY||a.alwaysHandleSupSub)||a&&"operatorname"===a.type&&a.alwaysHandleSupSub&&(a.limits||t.style===Pl.DISPLAY)?"munder":"msub"}else{var l=e.base;i=l&&"op"===l.type&&l.limits&&(t.style===Pl.DISPLAY||l.alwaysHandleSupSub)||l&&"operatorname"===l.type&&l.alwaysHandleSupSub&&(l.limits||t.style===Pl.DISPLAY)?"mover":"msup"}return new Ed.MathNode(i,s)}}),md({type:"atom",htmlBuilder:(e,t)=>id.mathsym(e.text,e.mode,t,["m"+e.family]),mathmlBuilder(e,t){var n=new Ed.MathNode("mo",[Od(e.text,e.mode)]);if("bin"===e.family){var r=Bd(e,t);"bold-italic"===r&&n.setAttribute("mathvariant",r)}else"punct"===e.family?n.setAttribute("separator","true"):"open"!==e.family&&"close"!==e.family||n.setAttribute("stretchy","false");return n}});var Sh={mi:"italic",mn:"normal",mtext:"normal"};md({type:"mathord",htmlBuilder:(e,t)=>id.makeOrd(e,t,"mathord"),mathmlBuilder(e,t){var n=new Ed.MathNode("mi",[Od(e.text,e.mode,t)]),r=Bd(e,t)||"italic";return r!==Sh[n.type]&&n.setAttribute("mathvariant",r),n}}),md({type:"textord",htmlBuilder:(e,t)=>id.makeOrd(e,t,"textord"),mathmlBuilder(e,t){var n,r=Od(e.text,e.mode,t),i=Bd(e,t)||"normal";return n="text"===e.mode?new Ed.MathNode("mtext",[r]):/[0-9]/.test(e.text)?new Ed.MathNode("mn",[r]):"\\prime"===e.text?new Ed.MathNode("mo",[r]):new Ed.MathNode("mi",[r]),i!==Sh[n.type]&&n.setAttribute("mathvariant",i),n}});var Ch={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Mh={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};md({type:"spacing",htmlBuilder(e,t){if(Mh.hasOwnProperty(e.text)){var n=Mh[e.text].className||"";if("text"===e.mode){var r=id.makeOrd(e,t,"textord");return r.classes.push(n),r}return id.makeSpan(["mspace",n],[id.mathsym(e.text,e.mode,t)],t)}if(Ch.hasOwnProperty(e.text))return id.makeSpan(["mspace",Ch[e.text]],[],t);throw new cl('Unknown type of space "'+e.text+'"')},mathmlBuilder(e,t){if(!Mh.hasOwnProperty(e.text)){if(Ch.hasOwnProperty(e.text))return new Ed.MathNode("mspace");throw new cl('Unknown type of space "'+e.text+'"')}return new Ed.MathNode("mtext",[new Ed.TextNode(" ")])}});var Lh=()=>{var e=new Ed.MathNode("mtd",[]);return e.setAttribute("width","50%"),e};md({type:"tag",mathmlBuilder(e,t){var n=new Ed.MathNode("mtable",[new Ed.MathNode("mtr",[Lh(),new Ed.MathNode("mtd",[Hd(e.body,t)]),Lh(),new Ed.MathNode("mtd",[Hd(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var Th={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},zh={"\\textbf":"textbf","\\textmd":"textmd"},Ah={"\\textit":"textit","\\textup":"textup"},Rh=(e,t)=>{var n=e.font;return n?Th[n]?t.withTextFontFamily(Th[n]):zh[n]?t.withTextFontWeight(zh[n]):"\\emph"===n?"textit"===t.fontShape?t.withTextFontShape("textup"):t.withTextFontShape("textit"):t.withTextFontShape(Ah[n]):t};pd({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"text",mode:n.mode,body:_d(i),font:r}},htmlBuilder(e,t){var n=Rh(e,t),r=xd(e.body,n,!0);return id.makeSpan(["mord","text"],r,n)},mathmlBuilder(e,t){var n=Rh(e,t);return Hd(e.body,n)}}),pd({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"underline",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Td(e.body,t),r=id.makeLineSpan("underline-line",t),i=t.fontMetrics().defaultRuleThickness,s=id.makeVList({positionType:"top",positionData:n.height,children:[{type:"kern",size:i},{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n}]},t);return id.makeSpan(["mord","underline"],[s],t)},mathmlBuilder(e,t){var n=new Ed.MathNode("mo",[new Ed.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new Ed.MathNode("munder",[jd(e.body,t),n]);return r.setAttribute("accentunder","true"),r}}),pd({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"vcenter",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Td(e.body,t),r=t.fontMetrics().axisHeight,i=.5*(n.height-r-(n.depth+r));return id.makeVList({positionType:"shift",positionData:i,children:[{type:"elem",elem:n}]},t)},mathmlBuilder:(e,t)=>new Ed.MathNode("mpadded",[jd(e.body,t)],["vcenter"])}),pd({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new cl("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=Ph(e),r=[],i=t.havingStyle(t.style.text()),s=0;s<n.length;s++){var o=n[s];"~"===o&&(o="\\textasciitilde"),r.push(id.makeSymbol(o,"Typewriter-Regular",e.mode,i,["mord","texttt"]))}return id.makeSpan(["mord","text"].concat(i.sizingClasses(t)),id.tryCombineChars(r),i)},mathmlBuilder(e,t){var n=new Ed.TextNode(Ph(e)),r=new Ed.MathNode("mtext",[n]);return r.setAttribute("mathvariant","monospace"),r}});var Ph=e=>e.body.replace(/ /g,e.star?"␣":" "),Nh=dd,Eh="[ \r\n\t]",Oh="(\\\\[a-zA-Z@]+)"+Eh+"*",Ih="[̀-ͯ]",Bh=new RegExp(Ih+"+$"),Dh="("+Eh+"+)|\\\\(\n|[ \r\t]+\n?)[ \r\t]*|([!-\\[\\]-‧-豈-]"+Ih+"*|[\ud800-\udbff][\udc00-\udfff]"+Ih+"*|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5|"+Oh+"|\\\\[^\ud800-\udfff])";class Vh{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(Dh,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new ll("EOF",new al(this,t,t));var n=this.tokenRegex.exec(e);if(null===n||n.index!==t)throw new cl("Unexpected character: '"+e[t]+"'",new ll(e[t],new al(this,t,t+1)));var r=n[6]||n[3]||(n[2]?"\\ ":" ");if(14===this.catcodes[r]){var i=e.indexOf("\n",this.tokenRegex.lastIndex);return-1===i?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=i+1,this.lex()}return new ll(r,new al(this,t,this.tokenRegex.lastIndex))}}class Hh{constructor(e,t){void 0===e&&(e={}),void 0===t&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(0===this.undefStack.length)throw new cl("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(null==e[t]?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,n){if(void 0===n&&(n=!1),n){for(var r=0;r<this.undefStack.length;r++)delete this.undefStack[r][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(e)&&(i[e]=this.current[e])}null==t?delete this.current[e]:this.current[e]=t}}var jh=$u;Gu("\\noexpand",function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}}),Gu("\\expandafter",function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}}),Gu("\\@firstoftwo",function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}}),Gu("\\@secondoftwo",function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}}),Gu("\\@ifnextchar",function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return 1===t[0].length&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}}),Gu("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),Gu("\\TextOrMath",function(e){var t=e.consumeArgs(2);return"text"===e.mode?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var Fh={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};Gu("\\char",function(e){var t,n=e.popToken(),r="";if("'"===n.text)t=8,n=e.popToken();else if('"'===n.text)t=16,n=e.popToken();else if("`"===n.text)if("\\"===(n=e.popToken()).text[0])r=n.text.charCodeAt(1);else{if("EOF"===n.text)throw new cl("\\char` missing argument");r=n.text.charCodeAt(0)}else t=10;if(t){if(null==(r=Fh[n.text])||r>=t)throw new cl("Invalid base-"+t+" digit "+n.text);for(var i;null!=(i=Fh[e.future().text])&&i<t;)r*=t,r+=i,e.popToken()}return"\\@char{"+r+"}"});var Uh=(e,t,n,r)=>{var i=e.consumeArg().tokens;if(1!==i.length)throw new cl("\\newcommand's first argument must be a macro name");var s=i[0].text,o=e.isDefined(s);if(o&&!t)throw new cl("\\newcommand{"+s+"} attempting to redefine "+s+"; use \\renewcommand");if(!o&&!n)throw new cl("\\renewcommand{"+s+"} when command "+s+" does not yet exist; use \\newcommand");var a=0;if(1===(i=e.consumeArg().tokens).length&&"["===i[0].text){for(var l="",c=e.expandNextToken();"]"!==c.text&&"EOF"!==c.text;)l+=c.text,c=e.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new cl("Invalid number of arguments: "+l);a=parseInt(l),i=e.consumeArg().tokens}return o&&r||e.macros.set(s,{tokens:i,numArgs:a}),""};Gu("\\newcommand",e=>Uh(e,!1,!0,!1)),Gu("\\renewcommand",e=>Uh(e,!0,!1,!1)),Gu("\\providecommand",e=>Uh(e,!0,!0,!0)),Gu("\\message",e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(e=>e.text).join("")),""}),Gu("\\errmessage",e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(e=>e.text).join("")),""}),Gu("\\show",e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),Nh[n],mc.math[n],mc.text[n]),""}),Gu("\\bgroup","{"),Gu("\\egroup","}"),Gu("~","\\nobreakspace"),Gu("\\lq","`"),Gu("\\rq","'"),Gu("\\aa","\\r a"),Gu("\\AA","\\r A"),Gu("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),Gu("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),Gu("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),Gu("ℬ","\\mathscr{B}"),Gu("ℰ","\\mathscr{E}"),Gu("ℱ","\\mathscr{F}"),Gu("ℋ","\\mathscr{H}"),Gu("ℐ","\\mathscr{I}"),Gu("ℒ","\\mathscr{L}"),Gu("ℳ","\\mathscr{M}"),Gu("ℛ","\\mathscr{R}"),Gu("ℭ","\\mathfrak{C}"),Gu("ℌ","\\mathfrak{H}"),Gu("ℨ","\\mathfrak{Z}"),Gu("\\Bbbk","\\Bbb{k}"),Gu("·","\\cdotp"),Gu("\\llap","\\mathllap{\\textrm{#1}}"),Gu("\\rlap","\\mathrlap{\\textrm{#1}}"),Gu("\\clap","\\mathclap{\\textrm{#1}}"),Gu("\\mathstrut","\\vphantom{(}"),Gu("\\underbar","\\underline{\\text{#1}}"),Gu("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'),Gu("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),Gu("\\ne","\\neq"),Gu("≠","\\neq"),Gu("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),Gu("∉","\\notin"),Gu("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),Gu("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),Gu("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),Gu("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),Gu("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),Gu("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),Gu("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),Gu("⟂","\\perp"),Gu("‼","\\mathclose{!\\mkern-0.8mu!}"),Gu("∌","\\notni"),Gu("⌜","\\ulcorner"),Gu("⌝","\\urcorner"),Gu("⌞","\\llcorner"),Gu("⌟","\\lrcorner"),Gu("©","\\copyright"),Gu("®","\\textregistered"),Gu("️","\\textregistered"),Gu("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),Gu("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),Gu("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),Gu("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),Gu("\\vdots","{\\varvdots\\rule{0pt}{15pt}}"),Gu("⋮","\\vdots"),Gu("\\varGamma","\\mathit{\\Gamma}"),Gu("\\varDelta","\\mathit{\\Delta}"),Gu("\\varTheta","\\mathit{\\Theta}"),Gu("\\varLambda","\\mathit{\\Lambda}"),Gu("\\varXi","\\mathit{\\Xi}"),Gu("\\varPi","\\mathit{\\Pi}"),Gu("\\varSigma","\\mathit{\\Sigma}"),Gu("\\varUpsilon","\\mathit{\\Upsilon}"),Gu("\\varPhi","\\mathit{\\Phi}"),Gu("\\varPsi","\\mathit{\\Psi}"),Gu("\\varOmega","\\mathit{\\Omega}"),Gu("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),Gu("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),Gu("\\boxed","\\fbox{$\\displaystyle{#1}$}"),Gu("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),Gu("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),Gu("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;"),Gu("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}"),Gu("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var qh={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};Gu("\\dots",function(e){var t="\\dotso",n=e.expandAfterFuture().text;return n in qh?t=qh[n]:("\\not"===n.slice(0,4)||n in mc.math&&ml(["bin","rel"],mc.math[n].group))&&(t="\\dotsb"),t});var $h={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};Gu("\\dotso",function(e){return e.future().text in $h?"\\ldots\\,":"\\ldots"}),Gu("\\dotsc",function(e){var t=e.future().text;return t in $h&&","!==t?"\\ldots\\,":"\\ldots"}),Gu("\\cdots",function(e){return e.future().text in $h?"\\@cdots\\,":"\\@cdots"}),Gu("\\dotsb","\\cdots"),Gu("\\dotsm","\\cdots"),Gu("\\dotsi","\\!\\cdots"),Gu("\\dotsx","\\ldots\\,"),Gu("\\DOTSI","\\relax"),Gu("\\DOTSB","\\relax"),Gu("\\DOTSX","\\relax"),Gu("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),Gu("\\,","\\tmspace+{3mu}{.1667em}"),Gu("\\thinspace","\\,"),Gu("\\>","\\mskip{4mu}"),Gu("\\:","\\tmspace+{4mu}{.2222em}"),Gu("\\medspace","\\:"),Gu("\\;","\\tmspace+{5mu}{.2777em}"),Gu("\\thickspace","\\;"),Gu("\\!","\\tmspace-{3mu}{.1667em}"),Gu("\\negthinspace","\\!"),Gu("\\negmedspace","\\tmspace-{4mu}{.2222em}"),Gu("\\negthickspace","\\tmspace-{5mu}{.277em}"),Gu("\\enspace","\\kern.5em "),Gu("\\enskip","\\hskip.5em\\relax"),Gu("\\quad","\\hskip1em\\relax"),Gu("\\qquad","\\hskip2em\\relax"),Gu("\\tag","\\@ifstar\\tag@literal\\tag@paren"),Gu("\\tag@paren","\\tag@literal{({#1})}"),Gu("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new cl("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"}),Gu("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),Gu("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),Gu("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),Gu("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),Gu("\\newline","\\\\\\relax"),Gu("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var Gh=Zl(Dl["Main-Regular"]["T".charCodeAt(0)][1]-.7*Dl["Main-Regular"]["A".charCodeAt(0)][1]);Gu("\\LaTeX","\\textrm{\\html@mathml{L\\kern-.36em\\raisebox{"+Gh+"}{\\scriptstyle A}\\kern-.15em\\TeX}{LaTeX}}"),Gu("\\KaTeX","\\textrm{\\html@mathml{K\\kern-.17em\\raisebox{"+Gh+"}{\\scriptstyle A}\\kern-.15em\\TeX}{KaTeX}}"),Gu("\\hspace","\\@ifstar\\@hspacer\\@hspace"),Gu("\\@hspace","\\hskip #1\\relax"),Gu("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),Gu("\\ordinarycolon",":"),Gu("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),Gu("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),Gu("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),Gu("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),Gu("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),Gu("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),Gu("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),Gu("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),Gu("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),Gu("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),Gu("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),Gu("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),Gu("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),Gu("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),Gu("∷","\\dblcolon"),Gu("∹","\\eqcolon"),Gu("≔","\\coloneqq"),Gu("≕","\\eqqcolon"),Gu("⩴","\\Coloneqq"),Gu("\\ratio","\\vcentcolon"),Gu("\\coloncolon","\\dblcolon"),Gu("\\colonequals","\\coloneqq"),Gu("\\coloncolonequals","\\Coloneqq"),Gu("\\equalscolon","\\eqqcolon"),Gu("\\equalscoloncolon","\\Eqqcolon"),Gu("\\colonminus","\\coloneq"),Gu("\\coloncolonminus","\\Coloneq"),Gu("\\minuscolon","\\eqcolon"),Gu("\\minuscoloncolon","\\Eqcolon"),Gu("\\coloncolonapprox","\\Colonapprox"),Gu("\\coloncolonsim","\\Colonsim"),Gu("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),Gu("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),Gu("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),Gu("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),Gu("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),Gu("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),Gu("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),Gu("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),Gu("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),Gu("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),Gu("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),Gu("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),Gu("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),Gu("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),Gu("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),Gu("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),Gu("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),Gu("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),Gu("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),Gu("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),Gu("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),Gu("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),Gu("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),Gu("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),Gu("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),Gu("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),Gu("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),Gu("\\imath","\\html@mathml{\\@imath}{ı}"),Gu("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),Gu("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),Gu("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),Gu("⟦","\\llbracket"),Gu("⟧","\\rrbracket"),Gu("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),Gu("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),Gu("⦃","\\lBrace"),Gu("⦄","\\rBrace"),Gu("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),Gu("⦵","\\minuso"),Gu("\\darr","\\downarrow"),Gu("\\dArr","\\Downarrow"),Gu("\\Darr","\\Downarrow"),Gu("\\lang","\\langle"),Gu("\\rang","\\rangle"),Gu("\\uarr","\\uparrow"),Gu("\\uArr","\\Uparrow"),Gu("\\Uarr","\\Uparrow"),Gu("\\N","\\mathbb{N}"),Gu("\\R","\\mathbb{R}"),Gu("\\Z","\\mathbb{Z}"),Gu("\\alef","\\aleph"),Gu("\\alefsym","\\aleph"),Gu("\\Alpha","\\mathrm{A}"),Gu("\\Beta","\\mathrm{B}"),Gu("\\bull","\\bullet"),Gu("\\Chi","\\mathrm{X}"),Gu("\\clubs","\\clubsuit"),Gu("\\cnums","\\mathbb{C}"),Gu("\\Complex","\\mathbb{C}"),Gu("\\Dagger","\\ddagger"),Gu("\\diamonds","\\diamondsuit"),Gu("\\empty","\\emptyset"),Gu("\\Epsilon","\\mathrm{E}"),Gu("\\Eta","\\mathrm{H}"),Gu("\\exist","\\exists"),Gu("\\harr","\\leftrightarrow"),Gu("\\hArr","\\Leftrightarrow"),Gu("\\Harr","\\Leftrightarrow"),Gu("\\hearts","\\heartsuit"),Gu("\\image","\\Im"),Gu("\\infin","\\infty"),Gu("\\Iota","\\mathrm{I}"),Gu("\\isin","\\in"),Gu("\\Kappa","\\mathrm{K}"),Gu("\\larr","\\leftarrow"),Gu("\\lArr","\\Leftarrow"),Gu("\\Larr","\\Leftarrow"),Gu("\\lrarr","\\leftrightarrow"),Gu("\\lrArr","\\Leftrightarrow"),Gu("\\Lrarr","\\Leftrightarrow"),Gu("\\Mu","\\mathrm{M}"),Gu("\\natnums","\\mathbb{N}"),Gu("\\Nu","\\mathrm{N}"),Gu("\\Omicron","\\mathrm{O}"),Gu("\\plusmn","\\pm"),Gu("\\rarr","\\rightarrow"),Gu("\\rArr","\\Rightarrow"),Gu("\\Rarr","\\Rightarrow"),Gu("\\real","\\Re"),Gu("\\reals","\\mathbb{R}"),Gu("\\Reals","\\mathbb{R}"),Gu("\\Rho","\\mathrm{P}"),Gu("\\sdot","\\cdot"),Gu("\\sect","\\S"),Gu("\\spades","\\spadesuit"),Gu("\\sub","\\subset"),Gu("\\sube","\\subseteq"),Gu("\\supe","\\supseteq"),Gu("\\Tau","\\mathrm{T}"),Gu("\\thetasym","\\vartheta"),Gu("\\weierp","\\wp"),Gu("\\Zeta","\\mathrm{Z}"),Gu("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),Gu("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),Gu("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),Gu("\\bra","\\mathinner{\\langle{#1}|}"),Gu("\\ket","\\mathinner{|{#1}\\rangle}"),Gu("\\braket","\\mathinner{\\langle{#1}\\rangle}"),Gu("\\Bra","\\left\\langle#1\\right|"),Gu("\\Ket","\\left|#1\\right\\rangle");var Xh=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,i=t.consumeArg().tokens,s=t.consumeArg().tokens,o=t.macros.get("|"),a=t.macros.get("\\|");t.macros.beginGroup();var l=t=>n=>{e&&(n.macros.set("|",o),i.length&&n.macros.set("\\|",a));var s=t;return!t&&i.length&&"|"===n.future().text&&(n.popToken(),s=!0),{tokens:s?i:r,numArgs:0}};t.macros.set("|",l(!1)),i.length&&t.macros.set("\\|",l(!0));var c=t.consumeArg().tokens,d=t.expandTokens([...s,...c,...n]);return t.macros.endGroup(),{tokens:d.reverse(),numArgs:0}};Gu("\\bra@ket",Xh(!1)),Gu("\\bra@set",Xh(!0)),Gu("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),Gu("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),Gu("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),Gu("\\angln","{\\angl n}"),Gu("\\blue","\\textcolor{##6495ed}{#1}"),Gu("\\orange","\\textcolor{##ffa500}{#1}"),Gu("\\pink","\\textcolor{##ff00af}{#1}"),Gu("\\red","\\textcolor{##df0030}{#1}"),Gu("\\green","\\textcolor{##28ae7b}{#1}"),Gu("\\gray","\\textcolor{gray}{#1}"),Gu("\\purple","\\textcolor{##9d38bd}{#1}"),Gu("\\blueA","\\textcolor{##ccfaff}{#1}"),Gu("\\blueB","\\textcolor{##80f6ff}{#1}"),Gu("\\blueC","\\textcolor{##63d9ea}{#1}"),Gu("\\blueD","\\textcolor{##11accd}{#1}"),Gu("\\blueE","\\textcolor{##0c7f99}{#1}"),Gu("\\tealA","\\textcolor{##94fff5}{#1}"),Gu("\\tealB","\\textcolor{##26edd5}{#1}"),Gu("\\tealC","\\textcolor{##01d1c1}{#1}"),Gu("\\tealD","\\textcolor{##01a995}{#1}"),Gu("\\tealE","\\textcolor{##208170}{#1}"),Gu("\\greenA","\\textcolor{##b6ffb0}{#1}"),Gu("\\greenB","\\textcolor{##8af281}{#1}"),Gu("\\greenC","\\textcolor{##74cf70}{#1}"),Gu("\\greenD","\\textcolor{##1fab54}{#1}"),Gu("\\greenE","\\textcolor{##0d923f}{#1}"),Gu("\\goldA","\\textcolor{##ffd0a9}{#1}"),Gu("\\goldB","\\textcolor{##ffbb71}{#1}"),Gu("\\goldC","\\textcolor{##ff9c39}{#1}"),Gu("\\goldD","\\textcolor{##e07d10}{#1}"),Gu("\\goldE","\\textcolor{##a75a05}{#1}"),Gu("\\redA","\\textcolor{##fca9a9}{#1}"),Gu("\\redB","\\textcolor{##ff8482}{#1}"),Gu("\\redC","\\textcolor{##f9685d}{#1}"),Gu("\\redD","\\textcolor{##e84d39}{#1}"),Gu("\\redE","\\textcolor{##bc2612}{#1}"),Gu("\\maroonA","\\textcolor{##ffbde0}{#1}"),Gu("\\maroonB","\\textcolor{##ff92c6}{#1}"),Gu("\\maroonC","\\textcolor{##ed5fa6}{#1}"),Gu("\\maroonD","\\textcolor{##ca337c}{#1}"),Gu("\\maroonE","\\textcolor{##9e034e}{#1}"),Gu("\\purpleA","\\textcolor{##ddd7ff}{#1}"),Gu("\\purpleB","\\textcolor{##c6b9fc}{#1}"),Gu("\\purpleC","\\textcolor{##aa87ff}{#1}"),Gu("\\purpleD","\\textcolor{##7854ab}{#1}"),Gu("\\purpleE","\\textcolor{##543b78}{#1}"),Gu("\\mintA","\\textcolor{##f5f9e8}{#1}"),Gu("\\mintB","\\textcolor{##edf2df}{#1}"),Gu("\\mintC","\\textcolor{##e0e5cc}{#1}"),Gu("\\grayA","\\textcolor{##f6f7f7}{#1}"),Gu("\\grayB","\\textcolor{##f0f1f2}{#1}"),Gu("\\grayC","\\textcolor{##e3e5e6}{#1}"),Gu("\\grayD","\\textcolor{##d6d8da}{#1}"),Gu("\\grayE","\\textcolor{##babec2}{#1}"),Gu("\\grayF","\\textcolor{##888d93}{#1}"),Gu("\\grayG","\\textcolor{##626569}{#1}"),Gu("\\grayH","\\textcolor{##3b3e40}{#1}"),Gu("\\grayI","\\textcolor{##21242c}{#1}"),Gu("\\kaBlue","\\textcolor{##314453}{#1}"),Gu("\\kaGreen","\\textcolor{##71B307}{#1}");var Kh={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class Wh{constructor(e,t,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new Hh(jh,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new Vh(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return 0===this.stack.length&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,r;if(e){if(this.consumeSpaces(),"["!==this.future().text)return null;t=this.popToken(),({tokens:r,end:n}=this.consumeArg(["]"]))}else({tokens:r,start:t,end:n}=this.consumeArg());return this.pushToken(new ll("EOF",n.loc)),this.pushTokens(r),t.range(n,"")}consumeSpaces(){for(;" "===this.future().text;)this.stack.pop()}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var r,i=this.future(),s=0,o=0;do{if(r=this.popToken(),t.push(r),"{"===r.text)++s;else if("}"===r.text){if(-1===--s)throw new cl("Extra }",r)}else if("EOF"===r.text)throw new cl("Unexpected end of input in a macro argument, expected '"+(e&&n?e[o]:"}")+"'",r);if(e&&n)if((0===s||1===s&&"{"===e[o])&&r.text===e[o]){if(++o===e.length){t.splice(-o,o);break}}else o=0}while(0!==s||n);return"{"===i.text&&"}"===t[t.length-1].text&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:i,end:r}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new cl("The length of delimiters doesn't match the number of args!");for(var n=t[0],r=0;r<n.length;r++){var i=this.popToken();if(n[r]!==i.text)throw new cl("Use of the macro doesn't match its definition",i)}}for(var s=[],o=0;o<e;o++)s.push(this.consumeArg(t&&t[o+1]).tokens);return s}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new cl("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var t=this.popToken(),n=t.text,r=t.noexpand?null:this._getExpansion(n);if(null==r||e&&r.unexpandable){if(e&&null==r&&"\\"===n[0]&&!this.isDefined(n))throw new cl("Undefined control sequence: "+n);return this.pushToken(t),!1}this.countExpansion(1);var i=r.tokens,s=this.consumeArgs(r.numArgs,r.delimiters);if(r.numArgs)for(var o=(i=i.slice()).length-1;o>=0;--o){var a=i[o];if("#"===a.text){if(0===o)throw new cl("Incomplete placeholder at end of macro body",a);if("#"===(a=i[--o]).text)i.splice(o+1,1);else{if(!/^[1-9]$/.test(a.text))throw new cl("Not a valid argument number",a);i.splice(o,2,...s[+a.text-1])}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(!1===this.expandOnce()){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}throw new Error}expandMacro(e){return this.macros.has(e)?this.expandTokens([new ll(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(!1===this.expandOnce(!0)){var r=this.stack.pop();r.treatAsRelax&&(r.noexpand=!1,r.treatAsRelax=!1),t.push(r)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t?t.map(e=>e.text).join(""):t}_getExpansion(e){var t=this.macros.get(e);if(null==t)return t;if(1===e.length){var n=this.lexer.catcodes[e];if(null!=n&&13!==n)return}var r="function"==typeof t?t(this):t;if("string"==typeof r){var i=0;if(-1!==r.indexOf("#"))for(var s=r.replace(/##/g,"");-1!==s.indexOf("#"+(i+1));)++i;for(var o=new Vh(r,this.settings),a=[],l=o.lex();"EOF"!==l.text;)a.push(l),l=o.lex();return a.reverse(),{tokens:a,numArgs:i}}return r}isDefined(e){return this.macros.has(e)||Nh.hasOwnProperty(e)||mc.math.hasOwnProperty(e)||mc.text.hasOwnProperty(e)||Kh.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return null!=t?"string"==typeof t||"function"==typeof t||!t.unexpandable:Nh.hasOwnProperty(e)&&!Nh[e].primitive}}var Yh=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,Zh=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9",ₐ:"a",ₑ:"e",ₕ:"h",ᵢ:"i",ⱼ:"j",ₖ:"k",ₗ:"l",ₘ:"m",ₙ:"n",ₒ:"o",ₚ:"p",ᵣ:"r",ₛ:"s",ₜ:"t",ᵤ:"u",ᵥ:"v",ₓ:"x",ᵦ:"β",ᵧ:"γ",ᵨ:"ρ",ᵩ:"ϕ",ᵪ:"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9",ᴬ:"A",ᴮ:"B",ᴰ:"D",ᴱ:"E",ᴳ:"G",ᴴ:"H",ᴵ:"I",ᴶ:"J",ᴷ:"K",ᴸ:"L",ᴹ:"M",ᴺ:"N",ᴼ:"O",ᴾ:"P",ᴿ:"R",ᵀ:"T",ᵁ:"U",ⱽ:"V",ᵂ:"W",ᵃ:"a",ᵇ:"b",ᶜ:"c",ᵈ:"d",ᵉ:"e",ᶠ:"f",ᵍ:"g",ʰ:"h",ⁱ:"i",ʲ:"j",ᵏ:"k",ˡ:"l",ᵐ:"m",ⁿ:"n",ᵒ:"o",ᵖ:"p",ʳ:"r",ˢ:"s",ᵗ:"t",ᵘ:"u",ᵛ:"v",ʷ:"w",ˣ:"x",ʸ:"y",ᶻ:"z",ᵝ:"β",ᵞ:"γ",ᵟ:"δ",ᵠ:"ϕ",ᵡ:"χ",ᶿ:"θ"}),Qh={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},Jh={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class ep{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new Wh(e,t,this.mode),this.settings=t,this.leftrightDepth=0}expect(e,t){if(void 0===t&&(t=!0),this.fetch().text!==e)throw new cl("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return null==this.nextToken&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new ll("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,n}parseExpression(e,t){for(var n=[];;){"math"===this.mode&&this.consumeSpaces();var r=this.fetch();if(-1!==ep.endOfExpression.indexOf(r.text))break;if(t&&r.text===t)break;if(e&&Nh[r.text]&&Nh[r.text].infix)break;var i=this.parseAtom(t);if(!i)break;"internal"!==i.type&&n.push(i)}return"text"===this.mode&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var t,n=-1,r=0;r<e.length;r++)if("infix"===e[r].type){if(-1!==n)throw new cl("only one infix operator per group",e[r].token);n=r,t=e[r].replaceWith}if(-1!==n&&t){var i,s,o=e.slice(0,n),a=e.slice(n+1);return i=1===o.length&&"ordgroup"===o[0].type?o[0]:{type:"ordgroup",mode:this.mode,body:o},s=1===a.length&&"ordgroup"===a[0].type?a[0]:{type:"ordgroup",mode:this.mode,body:a},["\\\\abovefrac"===t?this.callFunction(t,[i,e[n],s],[]):this.callFunction(t,[i,s],[])]}return e}handleSupSubscript(e){var t,n=this.fetch(),r=n.text;this.consume(),this.consumeSpaces();do{var i;t=this.parseGroup(e)}while("internal"===(null==(i=t)?void 0:i.type));if(!t)throw new cl("Expected group after '"+r+"'",n);return t}formatUnsupportedCmd(e){for(var t=[],n=0;n<e.length;n++)t.push({type:"textord",mode:"text",text:e[n]});var r={type:"text",mode:this.mode,body:t};return{type:"color",mode:this.mode,color:this.settings.errorColor,body:[r]}}parseAtom(e){var t,n,r=this.parseGroup("atom",e);if("internal"===(null==r?void 0:r.type))return r;if("text"===this.mode)return r;for(;;){this.consumeSpaces();var i=this.fetch();if("\\limits"===i.text||"\\nolimits"===i.text){if(r&&"op"===r.type){var s="\\limits"===i.text;r.limits=s,r.alwaysHandleSupSub=!0}else{if(!r||"operatorname"!==r.type)throw new cl("Limit controls must follow a math operator",i);r.alwaysHandleSupSub&&(r.limits="\\limits"===i.text)}this.consume()}else if("^"===i.text){if(t)throw new cl("Double superscript",i);t=this.handleSupSubscript("superscript")}else if("_"===i.text){if(n)throw new cl("Double subscript",i);n=this.handleSupSubscript("subscript")}else if("'"===i.text){if(t)throw new cl("Double superscript",i);var o={type:"textord",mode:this.mode,text:"\\prime"},a=[o];for(this.consume();"'"===this.fetch().text;)a.push(o),this.consume();"^"===this.fetch().text&&a.push(this.handleSupSubscript("superscript")),t={type:"ordgroup",mode:this.mode,body:a}}else{if(!Zh[i.text])break;var l=Yh.test(i.text),c=[];for(c.push(new ll(Zh[i.text])),this.consume();;){var d=this.fetch().text;if(!Zh[d])break;if(Yh.test(d)!==l)break;c.unshift(new ll(Zh[d])),this.consume()}var u=this.subparse(c);l?n={type:"ordgroup",mode:"math",body:u}:t={type:"ordgroup",mode:"math",body:u}}}return t||n?{type:"supsub",mode:this.mode,base:r,sup:t,sub:n}:r}parseFunction(e,t){var n=this.fetch(),r=n.text,i=Nh[r];if(!i)return null;if(this.consume(),t&&"atom"!==t&&!i.allowedInArgument)throw new cl("Got function '"+r+"' with no arguments"+(t?" as "+t:""),n);if("text"===this.mode&&!i.allowedInText)throw new cl("Can't use function '"+r+"' in text mode",n);if("math"===this.mode&&!1===i.allowedInMath)throw new cl("Can't use function '"+r+"' in math mode",n);var{args:s,optArgs:o}=this.parseArguments(r,i);return this.callFunction(r,s,o,n,e)}callFunction(e,t,n,r,i){var s={funcName:e,parser:this,token:r,breakOnTokenText:i},o=Nh[e];if(o&&o.handler)return o.handler(s,t,n);throw new cl("No function handler for "+e)}parseArguments(e,t){var n=t.numArgs+t.numOptionalArgs;if(0===n)return{args:[],optArgs:[]};for(var r=[],i=[],s=0;s<n;s++){var o=t.argTypes&&t.argTypes[s],a=s<t.numOptionalArgs;(t.primitive&&null==o||"sqrt"===t.type&&1===s&&null==i[0])&&(o="primitive");var l=this.parseGroupOfType("argument to '"+e+"'",o,a);if(a)i.push(l);else{if(null==l)throw new cl("Null argument, please report this as a bug");r.push(l)}}return{args:r,optArgs:i}}parseGroupOfType(e,t,n){switch(t){case"color":return this.parseColorGroup(n);case"size":return this.parseSizeGroup(n);case"url":return this.parseUrlGroup(n);case"math":case"text":return this.parseArgumentGroup(n,t);case"hbox":var r=this.parseArgumentGroup(n,"text");return null!=r?{type:"styling",mode:r.mode,body:[r],style:"text"}:null;case"raw":var i=this.parseStringGroup("raw",n);return null!=i?{type:"raw",mode:"text",string:i.text}:null;case"primitive":if(n)throw new cl("A primitive argument cannot be optional");var s=this.parseGroup(e);if(null==s)throw new cl("Expected group as "+e,this.fetch());return s;case"original":case null:case void 0:return this.parseArgumentGroup(n);default:throw new cl("Unknown group type as "+e,this.fetch())}}consumeSpaces(){for(;" "===this.fetch().text;)this.consume()}parseStringGroup(e,t){var n=this.gullet.scanArgument(t);if(null==n)return null;for(var r,i="";"EOF"!==(r=this.fetch()).text;)i+=r.text,this.consume();return this.consume(),n.text=i,n}parseRegexGroup(e,t){for(var n,r=this.fetch(),i=r,s="";"EOF"!==(n=this.fetch()).text&&e.test(s+n.text);)s+=(i=n).text,this.consume();if(""===s)throw new cl("Invalid "+t+": '"+r.text+"'",r);return r.range(i,s)}parseColorGroup(e){var t=this.parseStringGroup("color",e);if(null==t)return null;var n=/^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);if(!n)throw new cl("Invalid color: '"+t.text+"'",t);var r=n[0];return/^[0-9a-f]{6}$/i.test(r)&&(r="#"+r),{type:"color-token",mode:this.mode,color:r}}parseSizeGroup(e){var t,n=!1;if(this.gullet.consumeSpaces(),!(t=e||"{"===this.gullet.future().text?this.parseStringGroup("size",e):this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size")))return null;e||0!==t.text.length||(t.text="0pt",n=!0);var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!r)throw new cl("Invalid size: '"+t.text+"'",t);var i={number:+(r[1]+r[2]),unit:r[3]};if(!Wl(i))throw new cl("Invalid unit: '"+i.unit+"'",t);return{type:"size",mode:this.mode,value:i,isBlank:n}}parseUrlGroup(e){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var t=this.parseStringGroup("url",e);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),null==t)return null;var n=t.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:n}}parseArgumentGroup(e,t){var n=this.gullet.scanArgument(e);if(null==n)return null;var r=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();var i=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var s={type:"ordgroup",mode:this.mode,loc:n.loc,body:i};return t&&this.switchMode(r),s}parseGroup(e,t){var n,r=this.fetch(),i=r.text;if("{"===i||"\\begingroup"===i){this.consume();var s="{"===i?"}":"\\endgroup";this.gullet.beginGroup();var o=this.parseExpression(!1,s),a=this.fetch();this.expect(s),this.gullet.endGroup(),n={type:"ordgroup",mode:this.mode,loc:al.range(r,a),body:o,semisimple:"\\begingroup"===i||void 0}}else if(null==(n=this.parseFunction(t,e)||this.parseSymbol())&&"\\"===i[0]&&!Kh.hasOwnProperty(i)){if(this.settings.throwOnError)throw new cl("Undefined control sequence: "+i,r);n=this.formatUnsupportedCmd(i),this.consume()}return n}formLigatures(e){for(var t=e.length-1,n=0;n<t;++n){var r=e[n],i=r.text;"-"===i&&"-"===e[n+1].text&&(n+1<t&&"-"===e[n+2].text?(e.splice(n,3,{type:"textord",mode:"text",loc:al.range(r,e[n+2]),text:"---"}),t-=2):(e.splice(n,2,{type:"textord",mode:"text",loc:al.range(r,e[n+1]),text:"--"}),t-=1)),"'"!==i&&"`"!==i||e[n+1].text!==i||(e.splice(n,2,{type:"textord",mode:"text",loc:al.range(r,e[n+1]),text:i+i}),t-=1)}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),r="*"===n.charAt(0);if(r&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new cl("\\verb assertion failed --\n please report what input caused this bug");return{type:"verb",mode:"text",body:n=n.slice(1,-1),star:r}}Jh.hasOwnProperty(t[0])&&!mc[this.mode][t[0]]&&(this.settings.strict&&"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+t[0]+'" used in math mode',e),t=Jh[t[0]]+t.slice(1));var i,s=Bh.exec(t);if(s&&("i"===(t=t.substring(0,s.index))?t="ı":"j"===t&&(t="ȷ")),mc[this.mode][t]){this.settings.strict&&"math"===this.mode&&"ÐÞþ".indexOf(t)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',e);var o,a=mc[this.mode][t].group,l=al.range(e);if(hc.hasOwnProperty(a)){var c=a;o={type:"atom",mode:this.mode,family:c,loc:l,text:t}}else o={type:a,mode:this.mode,loc:l,text:t};i=o}else{if(!(t.charCodeAt(0)>=128))return null;this.settings.strict&&(Ol(t.charCodeAt(0))?"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'" ('+t.charCodeAt(0)+")",e)),i={type:"textord",mode:"text",loc:al.range(e),text:t}}if(this.consume(),s)for(var d=0;d<s[0].length;d++){var u=s[0][d];if(!Qh[u])throw new cl("Unknown accent ' "+u+"'",e);var h=Qh[u][this.mode]||Qh[u].text;if(!h)throw new cl("Accent "+u+" unsupported in "+this.mode+" mode",e);i={type:"accent",mode:this.mode,loc:al.range(e),label:h,isStretchy:!1,isShifty:!0,base:i}}return i}}ep.endOfExpression=["}","\\endgroup","\\end","\\right","&"];"undefined"!=typeof document&&"CSS1Compat"!==document.compatMode&&"undefined"!=typeof console&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype.");var tp=function(e,t){var n=new kl(t);try{return function(e,t,n){var r,i=function(e){return new Gl({style:e.displayMode?Pl.DISPLAY:Pl.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})}(n);if("mathml"===n.output)return Fd(e,t,i,n.displayMode,!0);if("html"===n.output){var s=Ad(e,i);r=id.makeSpan(["katex"],[s])}else{var o=Fd(e,t,i,n.displayMode,!1),a=Ad(e,i);r=id.makeSpan(["katex"],[o,a])}return function(e,t){if(t.displayMode){var n=["katex-display"];t.leqno&&n.push("leqno"),t.fleqn&&n.push("fleqn"),e=id.makeSpan(n,[e])}return e}(r,n)}(function(e,t){if(!("string"==typeof e||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var n=new ep(e,t);delete n.gullet.macros.current["\\df@tag"];var r=n.parse();if(delete n.gullet.macros.current["\\current@color"],delete n.gullet.macros.current["\\color"],n.gullet.macros.get("\\df@tag")){if(!t.displayMode)throw new cl("\\tag works only in display equations");r=[{type:"tag",mode:"text",body:r,tag:n.subparse([new ll("\\df@tag")])}]}return r}(e,n),e,n)}catch(t){return function(e,t,n){if(n.throwOnError||!(e instanceof cl))throw e;var r=id.makeSpan(["katex-error"],[new ac(t)]);return r.setAttribute("title",e.toString()),r.setAttribute("style","color:"+n.errorColor),r}(t,e,n)}};class np{static update(e,t,n,r=!1){return{id:e,name:a.nY.update,size:n,latex:t,block:r}}}class rp extends o._D{_mathml=(0,l.KR)("");constructor(e,t){return super(e,t),this.setup(e,t)}get component(){return ol}get mathml(){const e=this.attrs.size+this.info;return rp.render(e,{displayMode:this.attrs.block})}get attrs(){return this.data.attrs}get meta(){return rp.meta}build_child(e){}export(){return this.base_export()}gc(){super.base_gc()}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}replace_id(e,t={}){return rp.replace_id(this.root,e,t)}update(e){const{latex:t,block:n,size:r}=e,{courier:i,id:s}=this,o=i.get_recorder();o.add_cmd(e);const a=this.info,l=this.attrs.block,c=this.attrs.size;return this.data.info=t,this.data.attrs.block=n,this.data.attrs.size=r,o.add_recover(np.update(s,a,c,l)),o}static render(e,t={}){const n={...t,throwOnError:!1,output:"html"};try{return function(e,t){return tp(e,t).toMarkup()}(e,{...n})}catch(e){return""}}static get meta(){return{cubename:"公式",type:a.u0.fomula,block:!1,version:1,show:!0}}static get_default(e="",t={},n={}){return{id:g.I.get_id(),type:a.u0.fomula,info:e,attrs:{block:!1,size:a.$f.h4,...n},css:t}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();return n[r]=i,t.id=i,t}}!function(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);s>3&&o&&Object.defineProperty(t,n,o)}([(0,k.H)(a.nY.update)],rp.prototype,"update",null);class ip{static add_title(e,t){return{id:e,name:a.BS.add_title,data:t}}static remove_title(e){return{id:e,name:a.BS.remove_title}}static add_cell(e,t){return{id:e,name:a.BS.add_cell,data:t}}static remove_cell(e,t){return{id:e,name:a.BS.remove_cell,cid:t}}static add_row(e,t,n){return{id:e,name:a.BS.add_row,index:t,rows:n}}static remove_row(e,t){return{id:e,name:a.BS.remove_row,index:t}}static add_col(e,t,n){return{id:e,name:a.BS.add_col,index:t,cols:n}}static remove_col(e,t){return{id:e,name:a.BS.remove_col,index:t}}static moveto(e,t,n){return{id:e,name:a.BS.moveto,tid:t,cells:n}}static merge(e,t){return{id:e,name:a.BS.merge,area:t}}static update_cell_area(e,t,n){return{id:e,name:a.BS.update_area,tid:t,area:n}}static add_grid_col(e,t,n){return{id:e,name:a.BS.add_grid_col,index:t,width:n}}static remove_grid_col(e,t){return{id:e,name:a.BS.remove_grid_col,index:t}}static col_resize(e,t,n){return{id:e,name:a.BS.col_resize,cols:t,step:n}}}function sp(e,t){const{hotkeys:n,courier:r,id:i,history:s}=t,o=el.F.tips;if(n.validate_hotkeys(e))return;if(!e.ctrlKey)return;e.stopPropagation();const l=e.key.toLowerCase(),c=e.shiftKey,d=t.get_active_cell();if(!d)return o?.tip_info("未发现激活单元格");if(l===a.tX.up)if(c){const e=t.get_cell_area(d);if(!t.check_orderly_row_top(e.top))return o?.tip_info("上方不整齐");const n=r.get_recorder(),i=[];for(let e=0;e<t.size[1];e++)i.push(Tt.get_default());n.tell(t,ip.add_row(t.id,d.row,i)),s.record(n)}else{if(t.get_cell(d.row-1,d.col))return o?.tip_info("上方已存在单元格");if(d.row-1<0)return o?.tip_info("上方已达边界");{const e=r.get_recorder(),n={row:d.row-1,col:d.col,rowspan:1,colspan:1,data:Tt.get_default()};e.tell(t,ip.add_cell(t.id,n)),s.record(e)}}else if(l===a.tX.down)if(c){const e=t.get_cell_area(d);if(!t.check_orderly_row_bottom(e.bottom))return o?.tip_info("下方不整齐");const n=r.get_recorder(),i=[];for(let e=0;e<t.size[1];e++)i.push(Tt.get_default());n.tell(t,ip.add_row(t.id,d.row+d.rowspan,i)),s.record(n)}else{if(t.get_cell(d.row+1,d.col))return o?.tip_info("下方已存在单元格");if(d.row+1>=t.size[0])return o?.tip_info("下方已达边界");{const e=r.get_recorder(),n={row:d.row+1,col:d.col,rowspan:1,colspan:1,data:Tt.get_default()};e.tell(t,ip.add_cell(t.id,n)),s.record(e)}}else if(l===a.tX.left)if(c){const e=t.get_cell_area(d);if(!t.check_orderly_col_left(e.left))return o?.tip_info("左侧不整齐");const n=r.get_recorder(),i=[];for(let e=0;e<t.size[0];e++)i.push(Tt.get_default());n.tell(t,ip.add_col(t.id,d.col,i)),s.record(n)}else{if(t.get_cell(d.row,d.col-1))return o?.tip_info("左侧已存在单元格");if(d.col-1<0)return o?.tip_info("左侧已达边界");{const e=r.get_recorder(),n={row:d.row,col:d.col-1,rowspan:1,colspan:1,data:Tt.get_default()};e.tell(t,ip.add_cell(t.id,n)),s.record(e)}}else if(l===a.tX.right)if(c){const e=t.get_cell_area(d);if(!t.check_orderly_col_right(e.right))return o?.tip_info("右侧不整齐");const n=r.get_recorder(),i=[];for(let e=0;e<t.size[0];e++)i.push(Tt.get_default());n.tell(t,ip.add_col(t.id,d.col+d.colspan,i)),s.record(n)}else{if(t.get_cell(d.row,d.col+1))return o?.tip_info("右侧已存在单元格");if(d.col+1>=t.size[1])return o?.tip_info("右侧已达边界");{const e=r.get_recorder(),n={row:d.row,col:d.col+1,rowspan:1,colspan:1,data:Tt.get_default()};e.tell(t,ip.add_cell(t.id,n)),s.record(e)}}}const op={drag_cell:void 0,hover:void 0};function ap(e,t){const n=e.currentTarget;n.parentElement?.style.setProperty("--drag-pointer-events","none"),e.stopPropagation(),op.drag_cell=t}function lp(e,t){if(op.drag_cell===t)return;const n=e.currentTarget;n.classList.add("cube-cell-selection"),op.hover=n}function cp(e,t){e.currentTarget.classList.remove("cube-cell-selection")}function dp(e,t){const{drag_cell:n,hover:r}=op,{pcube:i,courier:s,history:o}=t.box;if(!n)return;const a=e.currentTarget;a.parentElement?.style.setProperty("--drag-pointer-events","auto"),r&&r.classList.remove("cube-cell-selection");const l=s.get_recorder();l.tell(i,ip.moveto(i.id,t.box.id,[n.box.id])),o.record(l)}const up={anchor:void 0,hover:void 0,down_point:void 0,has_down:!1,has_move:!1};function hp(e,t){const{root:n,cursor:r}=t;if(e.ctrlKey)e.stopPropagation();else{g.I.check_mouse_key(e,"left")&&t.clear_selection();const n=e.target;if(!(n instanceof Node))return;const r=t.find_dom_cube(n),i=r?.find_upstream_untill(t);if(!i)return;const s=t.cells.find(e=>e.box===i);if(!s)return;up.down_point={x:e.clientX,y:e.clientY},up.has_down=!0,up.anchor=s}}function pp(e,t){const{cursor:n}=t,{down_point:r,has_down:i,anchor:s,has_move:o}=up;if(!r)return;if(up.has_move=Math.sqrt((e.clientX-r.x)**2+(e.clientY-r.y)**2)>5,!i||!s||!o||e.buttons<=0)return;const a=e.target;if(!(a instanceof Node))return;const l=t.find_dom_cube(a),c=l?.find_upstream_untill(t),d=t.cells.find(e=>e.box===c);if(!d||d===s)return void t.clear_selection();const u={left:Math.min(s.col,d.col),right:Math.max(s.col+s.colspan-1,d.col+d.colspan-1),top:Math.min(s.row,d.row),bottom:Math.max(s.row+s.rowspan-1,d.row+d.rowspan-1)},h=t.get_rectarea_cell(u);t.clear_selection();for(let e of h.cells)e.selection=!0;h.cells.length>1&&e.stopPropagation()}function mp(e,t){const{cursor:n}=t;up.has_down=!1,up.anchor=void 0}const fp=["id","data-type"],_p=(0,c.pM)({__name:"cube-table",props:{cube:{}},setup(e){const t=(0,c.rk)("dragger"),n=(0,c.rk)("box");function r(e){return{"grid-row":`${e.row+1}/span ${e.rowspan}`,"grid-column":`${e.col+1}/span ${e.colspan}`}}function i(e){return{"cube-cell-selection":e.selection}}const s=(0,c.EW)(()=>({"grid-template-columns":e.cube.cols.map(e=>e>0?e+"fr":"1fr").join(" ")}));return(0,c.sV)(()=>{const r=t.value,i=n.value;if(!r||!i)return;let s=e.cube.data.attrs.width,a=s;const l=new N.DragDiff(r);l.register_down(()=>{s=e.cube.data.attrs.width}),l.register_move((t,n)=>{s+t<e.cube.min_width||(a=s+t,i.style.width=a+"px")}),l.register_up((t,n)=>{if(a===s)return;const{courier:r,history:i}=e.cube,l=r.get_recorder();l.tell(e.cube,o.VL.resize(e.cube.id,a)),i.record(l)}),l.register_cancel(()=>{i.style.width=s+"px"})}),(e,o)=>((0,c.uX)(),(0,c.CE)("div",{ref_key:"box",ref:n,class:"cube-table",style:(0,d.Tr)(e.cube.css),id:e.cube.id,"data-type":(0,l.R1)(a.u0).table,onPointerdown:o[0]||(o[0]=t=>(0,l.R1)(hp)(t,e.cube)),onPointermove:o[1]||(o[1]=t=>(0,l.R1)(pp)(t,e.cube)),onPointerup:o[2]||(o[2]=t=>(0,l.R1)(mp)(t,e.cube)),onPointercancel:o[3]||(o[3]=t=>(0,l.R1)(mp)(t,e.cube)),onKeyup:o[4]||(o[4]=t=>(0,l.R1)(sp)(t,e.cube)),onContextmenu:o[5]||(o[5]=t=>(0,l.R1)(pt.uz)(t,e.cube))},[e.cube.title?((0,c.uX)(),(0,c.Wv)(S,{key:0,class:"cube-table-title",cube:(0,l.IG)(e.cube.title)},null,8,["cube"])):(0,c.Q3)("v-if",!0),(0,c.Lk)("div",{class:"cube-table-container",style:(0,d.Tr)(s.value)},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.cube.cells,(e,t)=>((0,c.uX)(),(0,c.Wv)(S,{key:e.box.id,cube:(0,l.IG)(e.box),style:(0,d.Tr)(r(e)),class:(0,d.C4)(i(e)),draggable:"true",onDragstart:t=>(0,l.R1)(ap)(t,e),onDragenter:t=>(0,l.R1)(lp)(t,e),onDragleave:t=>(0,l.R1)(cp)(t,e),onDrop:t=>(0,l.R1)(dp)(t,e)},null,8,["cube","style","class","onDragstart","onDragenter","onDragleave","onDrop"]))),128))],4),(0,c.Lk)("div",{class:"cube-table-dragger",ref_key:"dragger",ref:t},null,512)],44,fp))}}),gp=(0,m.A)(_p,[["__scopeId","data-v-727c5c78"]]);function bp(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class yp extends o._D{cells=(0,l.Kh)([]);_title=(0,l.KR)(void 0);get title(){return this._title.value}set title(e){this._title.value=e}get component(){return gp}get meta(){return yp.meta}get children(){const e=[],t=[...this.cells];return t.sort((e,t)=>e.row!==t.row?e.row-t.row:e.col-t.col),this.title&&e.unshift(this.title),e.push(...t.map(e=>e.box)),e}get cells_sorted(){const e=[],t=[...this.cells];return t.sort((e,t)=>e.row!==t.row?e.row-t.row:e.col-t.col),e.push(...t),e}get css(){const e=this.attrs;return{...super.css,width:e.width+"px"}}get attrs(){return this.data.attrs}get cols(){return this.data.info.cols}get size(){return this.data.info.size}get selection_cells(){const e=[];for(let t of this.cells_sorted)t.selection&&e.push(t);return e}get min_width(){return 500}constructor(e,t){return super(e,t),this.setup(e,t)}build_child(e){e.info.title&&(this.title=(0,l.IG)(new Tt(e.info.title,this)));for(let t of e.info.cells){const e=new Tt(t.data,this),n={row:t.row,col:t.col,rowspan:t.rowspan,colspan:t.colspan,box:(0,l.IG)(e),selection:!1};this.cells.push(n)}}export(){const e=this.base_export();this.title&&(e.info.title=this.title.export()),e.info.cells=[];for(let t of this.cells)e.info.cells.push(this.get_cell_data(t));return e}update_data(e){return{usable:!0,data:e}}gc(){this.base_gc()}get_cell_data(e){return{row:e.row,col:e.col,rowspan:e.rowspan,colspan:e.colspan,data:e.box.export()}}replace_id(e,t={}){return yp.replace_id(this.root,e,t)}get_rows(e){const t=[];for(let n of this.cells_sorted)e>=n.row&&e<n.row+n.rowspan&&t.push(n);return t}get_cols(e){const t=[];for(let n of this.cells_sorted)e>=n.col&&e<n.col+n.colspan&&t.push(n);return t}check_orderly_col(e){const t=this.get_cols(e),n=[];for(let e of t)n.push(this.get_cell_area(e));const r=1===new Set(n.map(e=>e.right)).size,i=1===new Set(n.map(e=>e.left)).size;return r&&i}check_orderly_col_left(e){const t=this.get_cols(e),n=[];for(let e of t)n.push(this.get_cell_area(e));return 1===new Set(n.map(e=>e.left)).size}check_orderly_col_right(e){const t=this.get_cols(e),n=[];for(let e of t)n.push(this.get_cell_area(e));return 1===new Set(n.map(e=>e.right)).size}check_orderly_row(e){const t=this.get_rows(e),n=[];for(let e of t)n.push(this.get_cell_area(e));const r=1===new Set(n.map(e=>e.bottom)).size,i=1===new Set(n.map(e=>e.top)).size;return r&&i}check_orderly_row_top(e){const t=this.get_rows(e),n=[];for(let e of t)n.push(this.get_cell_area(e));return new Set(n.map(e=>e.bottom)).size,1===new Set(n.map(e=>e.top)).size}check_orderly_row_bottom(e){const t=this.get_rows(e),n=[];for(let e of t)n.push(this.get_cell_area(e));return 1===new Set(n.map(e=>e.bottom)).size}get_cell_area(e){return{left:e.col,right:e.col+e.colspan-1,top:e.row,bottom:e.row+e.rowspan-1}}get_cell(e,t){for(let n of this.cells){const r=e>=n.row&&e<n.row+n.rowspan,i=t>=n.col&&t<n.col+n.colspan;if(r&&i)return n}}get_rectarea_cell(e){let t=!1;for(;!t;){const{left:n,right:r,top:i,bottom:s}=e;for(let o of this.cells){let{row:a,rowspan:l,col:c,colspan:d}=o,u=a,h=a+l-1,p=c,m=c+d-1;if(n>=p&&n<=m||n<=p&&m<=r||r>=p&&r<=m){if(u<i&&h>=i){e.top=a;break}if(u<=s&&h>s){e.bottom=a+l-1;break}}if(i>=u&&i<=h||i<u&&s>=h||s>=u&&s<=h){if(p<n&&m>=n){e.left=c;break}if(p<=r&&m>r){e.right=c+d-1;break}}o===this.cells[this.cells.length-1]&&(t=!0)}}const n=[];for(let t of this.cells_sorted){let{row:r,col:i,rowspan:s,colspan:o}=t;i>=e.left&&i+o-1<=e.right&&r>=e.top&&r+s-1<=e.bottom&&n.push(t)}return{...e,cells:n}}clear_selection(){for(let e of this.cells)e.selection=!1}get_active_cell(){const{cursor:e}=this,{cube_end:t}=e;if(!t)return;const n=t?.find_upstream_untill(this);return this.cells.find(e=>e.box===n)}set_selection_area(e){this.get_rectarea_cell(e);for(let e of this.cells)e.selection=!1;for(let e of this.cells)e.selection=!0}get_focus_cell(){const{cursor:e}=this,{cube_end:t}=e;if(!t)return;const n=t.find_upstream_untill(this);return n?this.cells.find(e=>e.box.id===n.id):void 0}get_selection_area(){let e,t;const n=this.selection_cells;if(0!==n.length){for(let r of n){const n=this.get_cell_area(r);e||(e=[n.top,n.bottom]),t||(t=[n.left,n.right]),n.top<e[0]&&(e[0]=n.top),n.left<t[0]&&(t[0]=n.left),n.bottom>e[1]&&(e[1]=n.bottom),n.right>t[1]&&(t[1]=n.right)}if(e&&t)return{left:t[0],right:t[1],top:e[0],bottom:e[1]}}}get_selection_size(){const e=this.get_selection_area();if(e)return[e.bottom-e.top+1,e.right-e.left+1]}get_selection_text(){const e=this.selection_cells;let t="";if(0===e.length)return t;for(let n of e)t+=n.box.text;return t}copy_selection_table(){const e=this.get_selection_size(),t=this.selection_cells,n=this.get_selection_area();if(!e||!t||!n)return;const r=[];for(let e of t)r.push({row:e.row-n.top,col:e.col-n.left,rowspan:e.rowspan,colspan:e.colspan,data:e.box.export()});const i=yp.get_default_by_data(e,r);return i.attrs=structuredClone((0,l.ux)(this.attrs)),i}add_title(e){const{data:t}=e,{courier:n,cursor:r,id:i}=this,s=n.get_recorder();s.add_cmd(e);const o=new Tt(t,this);return this.title=(0,l.IG)(o),s.add_recover(ip.remove_title(i)),s}remove_title(e){const{id:t,courier:n,cursor:r}=this;if(!this.title)return;const i=this.title.export(),s=n.get_recorder();return s.add_cmd(e),this.title=void 0,s.add_recover(ip.add_title(t,i)),s}add_cell(e){const{id:t,courier:n,cursor:r}=this,{data:i}=e;this.clear_selection();const s=n.get_recorder();s.add_cmd(e);const o={row:i.row,col:i.col,rowspan:i.rowspan,colspan:i.colspan,box:(0,l.IG)(new Tt(i.data,this)),selection:!1};return this.cells.push(o),s.add_recover(ip.remove_cell(t,o.box.id)),s}remove_cell(e){const{id:t,courier:n,cursor:r}=this,{cid:i}=e,s=n.get_recorder();s.add_cmd(e);const o=this.cells.findIndex(e=>e.box.id===i),a=this.cells[o];if(!a)return;const l={row:a.row,col:a.col,rowspan:a.rowspan,colspan:a.colspan,data:a.box.export()};return o>=0&&this.cells.splice(o,1),s.add_recover(ip.add_cell(t,l)),s}add_row(e){const{courier:t,cursor:n,id:r}=this,{index:i,rows:s}=e,o=t.get_recorder(),a=[];for(let e=0;e<s.length;e++){const t=s[e];a.push({row:i,col:e,rowspan:1,colspan:1,data:t})}this.size[0]++;for(let e of this.cells)e.row<i||o.tell(this,ip.update_cell_area(r,e.box.id,{row:e.row+1,col:e.col,rowspan:e.rowspan,colspan:e.colspan}));for(let e of a)o.tell(this,ip.add_cell(r,e));return o}remove_row(e){const{id:t,courier:n,cursor:r}=this,{index:i}=e,s=this.get_rows(i),o=n.get_recorder();for(let e of s)o.tell(this,ip.remove_cell(t,e.box.id));return this.size[0]--,o}add_col(e){const{id:t,cursor:n,courier:r}=this,{index:i,cols:s}=e,o=r.get_recorder(),a=[];for(let e=0;e<s.length;e++){const t=s[e];a.push({row:e,col:i,rowspan:1,colspan:1,data:t})}o.tell(this,ip.add_grid_col(t,i,2));for(let e of this.cells)e.col<i||o.tell(this,ip.update_cell_area(t,e.box.id,{row:e.row,col:e.col+1,rowspan:e.rowspan,colspan:e.colspan}));for(let e of a)o.tell(this,ip.add_cell(t,e));return o}remove_col(e){const{id:t,cursor:n,courier:r}=this,{index:i}=e;if(!this.check_orderly_col(i))return el.F.tips?.tip_info("目标列不整齐");let s;for(let e=0;e<=this.size[0]&&(s||(s=this.get_cell(e,i),!s));e++);if(!s)return;const o=r.get_recorder();for(let e=s.col;e<s.col+s.colspan;e++)o.tell(this,ip.remove_grid_col(t,e));const a=this.get_cols(i);for(let e of a)o.tell(this,ip.remove_cell(t,e.box.id));for(let e of this.cells){if(e.col<i)continue;const n={row:e.row,col:e.col-1,rowspan:e.rowspan,colspan:e.colspan};o.tell(this,ip.update_cell_area(t,e.box.id,n))}return o}moveto(e){const{id:t,courier:n,cursor:r}=this,{tid:i,cells:s}=e,a=n.get_recorder(),l=this.cells.find(e=>e.box.id===i);if(!l)return;const c=l.box,d=this.cells_sorted.filter(e=>e.box.id!==i&&s.includes(e.box.id));for(let e of d){const n=e.box.export();a.tell(this,ip.remove_cell(t,e.box.id)),a.tell(c,o.VL.insert_child(c.id,n.info,c.child_count))}return a}update_area(e){const{id:t,courier:n,cursor:r}=this,{tid:i,area:s}=e,o=n.get_recorder(),a=this.cells.find(e=>e.box.id===i);if(!a)return;o.add_cmd(e);const l={row:a.row,col:a.col,rowspan:a.rowspan,colspan:a.colspan};return a.row=s.row,a.col=s.col,a.rowspan=s.rowspan,a.colspan=s.colspan,o.add_recover(ip.update_cell_area(t,i,l)),o}merge_cell(e){const{id:t,cursor:n,courier:r}=this,{area:i}=e,s=r.get_recorder(),o=this.get_rectarea_cell(i);let a=o.cells[0];if(!a)return;const l={row:i.top,col:i.left,rowspan:i.bottom-i.top+1,colspan:i.right-i.left+1},c=a.box.id;return s.tell(this,ip.update_cell_area(t,c,l)),s.tell(this,ip.moveto(t,c,o.cells.map(e=>e.box.id))),s}add_grid_col(e){const{id:t,courier:n,cursor:r}=this,{index:i,width:s}=e,o=n.get_recorder();return o.add_cmd(e),this.cols.splice(i,0,s),this.size[1]++,o.add_recover(ip.remove_grid_col(t,i)),o}remove_grid_col(e){const{id:t,courier:n,cursor:r}=this,{index:i}=e,s=n.get_recorder(),o=this.cols.splice(i,1);if(0!==o.length)return this.size[1]--,s.add_recover(ip.add_grid_col(t,i,o[0])),s}col_resize(e){const{id:t,courier:n,cursor:r}=this,{cols:i,step:s}=e,o=n.get_recorder();o.add_cmd(e);let a=!1;for(let e=i[0];e<=i[1];e++){let t=this.cols[e]+s;t<=0||(a=!0,this.cols[e]=t)}if(a)return o.add_recover(ip.col_resize(t,i,-s)),o}delete_child(e){const{dir:t,range:n,reserve:r}=e,{courier:i,cursor:s,history:a}=this,l=i.get_recorder();let[c,d]=this.get_valid_range(n);if(0===c&&d>=this.child_count)if(r){if(this.is_empty)return;const e=this.child_first;l.tell(this,o.VL.delete_child(this.id,"backward",[1,this.child_count],r)),l.tell(e,o.VL.delete_child(e.id,"backward",[0,e.child_count],r))}else l.merge(this.remove_self());else{let e=[];for(let t=c;t<d;t++){let n=this.children[t];e.push(n.id)}for(let t of e)l.tell(this,ip.remove_cell(this.id,t))}return l}static get meta(){return{cubename:"表格",type:a.u0.table,block:!0,version:1,show:!0}}static get_default(e=3,t=3){const n=[],r=[];r.length=t,r.fill(2);for(let r=0;r<e;r++)for(let e=0;e<t;e++){const t={row:r,col:e,rowspan:1,colspan:1,data:Tt.get_default()};n.push(t)}return{id:g.I.get_id(),type:a.u0.table,info:{size:[e,t],cols:r,cells:n},attrs:{width:500},css:{}}}static get_default_by_data(e,t){const[n,r]=e,i=[];return i.length=r,i.fill(2),{id:g.I.get_id(),type:a.u0.table,info:{size:[n,r],cols:i,cells:t},attrs:{width:500},css:{}}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();n[r]=i,t.id=i,t.info.title&&(t.info.title=Tt.replace_id(e,t.info.title,n));for(let r of t.info.cells)r.data=Tt.replace_id(e,r.data,n);return t}}bp([(0,k.H)(a.BS.add_title)],yp.prototype,"add_title",null),bp([(0,k.H)(a.BS.remove_title)],yp.prototype,"remove_title",null),bp([(0,k.H)(a.BS.add_cell)],yp.prototype,"add_cell",null),bp([(0,k.H)(a.BS.remove_cell)],yp.prototype,"remove_cell",null),bp([(0,k.H)(a.BS.add_row)],yp.prototype,"add_row",null),bp([(0,k.H)(a.BS.remove_row)],yp.prototype,"remove_row",null),bp([(0,k.H)(a.BS.add_col)],yp.prototype,"add_col",null),bp([(0,k.H)(a.BS.remove_col)],yp.prototype,"remove_col",null),bp([(0,k.H)(a.BS.moveto)],yp.prototype,"moveto",null),bp([(0,k.H)(a.BS.update_area)],yp.prototype,"update_area",null),bp([(0,k.H)(a.BS.merge)],yp.prototype,"merge_cell",null),bp([(0,k.H)(a.BS.add_grid_col)],yp.prototype,"add_grid_col",null),bp([(0,k.H)(a.BS.remove_grid_col)],yp.prototype,"remove_grid_col",null),bp([(0,k.H)(a.BS.col_resize)],yp.prototype,"col_resize",null),bp([(0,k.H)(a.zS.cube_delete_child)],yp.prototype,"delete_child",null);const vp=["id","data-type"],wp=(0,c.pM)({__name:"cube-tip",props:{cube:{}},setup:e=>(e,t)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-tip",style:(0,d.Tr)(e.cube.css),id:e.cube.id,"data-type":(0,l.R1)(a.u0).tip},[(0,c.bF)(S,{cube:e.cube.box},null,8,["cube"])],12,vp))}),xp=(0,m.A)(wp,[["__scopeId","data-v-433bbb71"]]);function kp(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class Sp extends o._D{_component=xp;get component(){return this._component}get children(){return[this.box]}box;constructor(e,t){return super(e,t),this.setup(e,t)}splice(e,t,...n){const r=this._children.splice(e,t,...n);for(let e of r)e.gc();const i=[];for(let e of r)e instanceof o._D&&i.push(e.export());return{children:r,data:i}}replace_id(e,t={}){return Sp.replace_id(this.root,e,t)}build_child(e){this.box=new Tt(e.info,this)}update_data(e){return this.versions[this.meta.type]>this.meta.version?{data:e,usable:!1}:{data:e,usable:!0}}export(){const e=this.base_export();return e.info=this.box.export(),e}gc(){super.base_gc()}on_insert_child(e){const{courier:t}=this,{pos:n,data:r}=e,i=t.get_recorder();if(i.add_cmd(e),0===r.length)return;if(!this.meta.block)return;let s=this.get_valid_index(n);const a=this.create_child_block(r);this.splice(s,0,...a),i.add_recover(o.VL.delete_child(this.id,"backward",[s,s+a.length]));const l=this.children[s+1];return l?i.tell(l,o.UB.in_head(l.id,0)):i.tell(this.child_last,o.UB.in_tail(this.child_last.id,0)),i}on_delete_child(e){const{courier:t,pid:n,index:r,pcube:i}=this,s=t.get_recorder();s.add_cmd(e);const{dir:a,range:l}=e,[c,d]=l;let u=c<0?0:c,h=d>this.child_count?this.child_count:d;if(u>=h)return;if(u<=0&&h>=this.child_count)return this.is_empty?s.tell(i,o.VL.delete_child(n,a,[r,r+1])):s.tell(this,o.VL.reset(this.id,[])),s;const p=this.children[u-1],m=this.children[h],f=h-u;let _=this.splice(c,f);return s.add_recover(o.VL.insert_child(this.id,_.data,c)),"backward"===a?p?s.tell(p,o.UB.in_tail(p.id,0)):m&&s.tell(m,o.UB.in_head(m.id,0)):"forward"===a&&(m?s.tell(m,o.UB.in_head(m.id,0)):p&&s.tell(p,o.UB.in_tail(p.id,0))),s}on_reset(e){const{courier:t,history:n}=this,{data:r}=e,i=new _.vk(t),s=[];for(let e of this.children)s.push(e.export());const a=g.I.build_cubes(r,this);return this.splice(0,this.child_count,...a),i.add_recover(o.VL.reset(this.id,s)),i}get meta(){return Sp.meta}static get meta(){return{cubename:"提示",type:a.u0.tip,block:!0,version:1,show:!0}}static get_default(e,t={},n={}){return{id:g.I.get_id(),type:a.u0.tip,info:Tt.get_default(e),attrs:n,css:t}}static get_default_by_string(e,t={},n={}){const r=kt.get_default_by_string(e),i=Tt.get_default([r]);return{id:g.I.get_id(),type:a.u0.tip,info:i,attrs:n,css:t}}static replace_id(e,t,n={}){const r=t.id,i=g.I.get_id();return n[r]=i,t.id=i,t.info=Tt.replace_id(e,t.info,n),t}}kp([(0,k.H)(a.zS.cube_insert_child)],Sp.prototype,"on_insert_child",null),kp([(0,k.H)(a.zS.cube_delete_child)],Sp.prototype,"on_delete_child",null),kp([(0,k.H)(a.zS.cube_reset)],Sp.prototype,"on_reset",null);const Cp=["id","data-type"],Mp=(0,c.pM)({__name:"cube-box-columns",props:{cube:{}},setup(e){const t=(0,l.KR)(),n=(0,l.KR)();let r;return(0,l.Kh)({open:!1}),(0,c.sV)(()=>{const i=t.value;if(!i)return;const s=n.value;if(!s)return;r=new N.DragDiff(s);let a=e.cube.attrs.width,l=e.cube.attrs.height,c=a,d=l;r.register_down(()=>{a=e.cube.attrs.width,l=e.cube.attrs.height}),r.register_move((t,n)=>{c=Math.round(t+a),c<e.cube.min_width&&(c=e.cube.min_width),i.style.width=c+"px",i.style.height=d+"px"}),r.register_up((t,n)=>{if(a===c&&l===d)return;const r=e.cube.courier.get_recorder(),i=Math.round(t+a);r.tell(e.cube,o.VL.resize(e.cube.id,i)),e.cube.history.record(r)}),r.register_cancel(()=>{e.cube.attrs.width=a,e.cube.attrs.height=l})}),(0,c.hi)(()=>{r?.off()}),(r,i)=>((0,c.uX)(),(0,c.CE)("div",{class:"cube-box-columns",ref_key:"box",ref:t,style:(0,d.Tr)(r.cube.css),id:r.cube.id,"data-type":(0,l.R1)(a.u0).box_columns,onContextmenu:i[0]||(i[0]=e=>(0,l.R1)(pt.uz)(e,r.cube))},[(0,c.Lk)("div",{class:"box-columns-content",style:(0,d.Tr)(e.cube.attrs.column_count?{"column-count":e.cube.attrs.column_count}:e.cube.attrs.column_width?{"column-width":e.cube.attrs.column_width+"px"}:{})},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(r.cube.children,e=>((0,c.uX)(),(0,c.Wv)(S,{key:e.id,cube:e},null,8,["cube"]))),128))],4),(0,c.Lk)("div",{class:"box-columns-dragger",ref_key:"dragger",ref:n},null,512)],44,Cp))}}),Lp=(0,m.A)(Mp,[["__scopeId","data-v-622bc65f"]]);function Tp(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}class zp extends o._D{constructor(e,t){return super(e,t),this.setup(e,t)}get component(){return Lp}get css(){const{width:e}=this.data.attrs;return{...super.css,width:e+"px"}}get attrs(){return this.data.attrs}get meta(){return zp.meta}get min_width(){return 200}build_child(e){const t=g.I.build_cubes(e.info,this);this._children.push(...t)}update_data(e){return{data:e,usable:!0}}export(){const e=this.base_export();e.info=[];for(let t of this._children)e.info.push(t.export());return e}gc(){this.base_gc()}replace_id(e,t){return zp.replace_id(this.root,e,t)}on_insert_child(e){const{courier:t,history:n}=this,{data:r}=e,i=t.get_recorder();i.add_cmd(e);const s=g.I.build_cubes(e.data,this),a=this.child_count;return this._children.push(...s),i.add_recover(o.VL.delete_child(this.id,"backward",[a,this.child_count])),i}on_delete_child(e){const{courier:t,history:n}=this,{dir:r,range:i,reserve:s}=e,a=t.get_recorder(),l=this.get_valid_index(i[0]),c=this.get_valid_index(i[1]),d=[],u=this._children.splice(l,c-l);for(let e of u)d.push(e.export());return a.add_recover(o.VL.insert_child(this.id,d,l)),a}static replace_id(e,t,n){const r=t.id,i=n[r]||g.I.get_id();return n[r]=i,t.id=i,g.I.replace_id(e,t.info,n),t}static get_default(){const e=Tt.get_default(),t=Tt.get_default(),n=Tt.get_default();return{id:g.I.get_id(),type:a.u0.box_columns,info:[e,t,n],attrs:{width:400,column_count:3},css:{}}}static get meta(){return{cubename:"多列容器",type:a.u0.box_columns,block:!0,version:1,show:!0}}}Tp([(0,k.H)(a.zS.cube_insert_child)],zp.prototype,"on_insert_child",null),Tp([(0,k.H)(a.zS.cube_delete_child)],zp.prototype,"on_delete_child",null);class Ap{static reset(e,t){return{id:e,name:a.DI.reset_explanation,explanation:t}}}const Rp=["id","data-type"],Pp=(0,c.pM)({__name:"cube-rt",props:{cube:{}},setup(e){const{event:t}=e.cube;function n(){t.emit_show_cube_editor(e.cube)}return(e,t)=>((0,c.uX)(),(0,c.CE)("ruby",{class:"cube-rt",id:e.cube.id,style:(0,d.Tr)(e.cube.css),"data-type":(0,l.R1)(a.u0).rt,onClick:n},[(0,c.eW)((0,d.v_)(e.cube.info.text)+" ",1),(0,c.Lk)("rt",null,(0,d.v_)(e.cube.info.explanation),1),t[0]||(t[0]=(0,c.eW)(" ",-1))],12,Rp))}});class Np extends o._D{data;constructor(e,t){return super(e,t),this.setup(e,t)}get info(){return this.data.info}get component(){return Pp}get meta(){return Np.meta}build_child(e){}update_data(e){return{usable:!0,data:e}}export(){return this.base_export()}gc(){this.base_gc()}replace_id(e,t){return Np.replace_id(this.root,e,t)}reset_explanation(e){const{explanation:t}=e,{courier:n}=this,r=n.get_recorder();r.add_cmd(e);const i=this.info.explanation;this.info.explanation=t;const s=Ap.reset(this.id,i);return r.add_recover(s),r}static get meta(){return{cubename:"标注文本",type:a.u0.rt,block:!1,version:1,show:!1}}static get_default(e="",t="",n={}){return{id:g.I.get_id(),type:a.u0.rt,info:{text:e,explanation:t},attrs:{},css:n}}static replace_id(e,t,n){const r=t.id;return t.id=n[r]||g.I.get_id(),n[r]=t.id,t}}!function(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);s>3&&o&&Object.defineProperty(t,n,o)}([(0,k.H)(a.DI.reset_explanation)],Np.prototype,"reset_explanation",null)},4823:(e,t,n)=>{"use strict";n.d(t,{R:()=>u});var r=n(7633),i=n(4743),s=n(8606),o=n(9513),a=n(1068),l=n(8631),c=n(3923),d=n(4116);class u extends c.K{_id=(0,s.Ak)();scroll_offset=100;_freeze=(0,r.KR)(!1);get meta(){return u.meta}get id(){return this._id}pos=(0,r.Kh)({x:0,y:0,width:0,height:0});css=(0,r.Kh)({});get freeze(){return this._freeze.value}set freeze(e){this._freeze.value=e}_direction=null;get focus_cube(){return this.selection_line[this.selection_line.length-1]}get second_cube(){return this.selection_line.length<=1?void 0:this.selection_line[this.selection_line.length-2]}get len(){return this.selection_line.length}selection_line=[];constructor(e,t){super(e),this.selection_line.push(t),this.listener.check_float()}expand(e){if(!(this.focus_cube instanceof i.$u&&this._direction===e))if("up"===e){if("down"===this._direction&&this.len>1)return this.selection_line.pop(),void this.update_area();const e=this.focus_cube.prev_cube||this.focus_cube.pcube;if(!e||e instanceof d.MR)return;if("map"===e.domain)return;e===this.second_cube?(this.selection_line.pop(),this.update_area()):(null!==this._direction&&1!==this.len||(this._direction="up"),this.selection_line.push(e),this.update_area())}else{if("up"===this._direction&&this.len>1)return this.selection_line.pop(),void this.update_area();const e=this.focus_cube.next_cube||this.focus_cube.pcube;if(!e||e instanceof d.MR)return;if("map"===e.domain)return;e===this.second_cube?(this.selection_line.pop(),this.update_area()):(null!==this._direction&&1!==this.len||(this._direction="down"),this.selection_line.push(e),this.update_area())}}shrink(){1!==this.selection_line.length&&(this.selection_line.pop(),this.update_area())}update_area(e=!0){if(e){const e=[];for(let t of this.selection_line){const n=t.clientRect;n&&e.push(n)}if(0===e.length)return this.remove();const t=a.MathRect.merge(...e);this.css.width=`${t.width}px`,this.css.height=`${t.height}px`,this.css.left=t.x+"px",this.css.top=t.y+"px",this.pos.x=t.x+document.documentElement.scrollLeft,this.pos.y=t.y+document.documentElement.scrollTop,this.pos.width=t.width,this.pos.height=t.height}else{const e=this.pos.x-document.documentElement.scrollLeft,t=this.pos.y-document.documentElement.scrollTop;this.css.left=e+"px",this.css.top=t+"px"}}find_line_next(e){if(this.selection_line.indexOf(e)<this.selection_line.length)return this.selection_line[this.selection_line.length-1]}find_line_prev(e){const t=this.selection_line.indexOf(e);if(t>0)return this.selection_line[t-1]}get_scope_info(){let e=this.focus_cube.level;const t=this.focus_cube.pcube,n=[],r=[];for(let t of this.selection_line){const i=t.level,s=t.index;i===e&&(n.push(t),r.push(s))}return{cube:t,range:[Math.min(...r),Math.max(...r)+1],from:this.id}}remove(){this.root.remove_scope(this.id),this.event.emit_status_update()}find_scope_lines(){const e=this.root.get_scope_cubes(),t=[],n=[];for(let n of e)t.push(...l.I.get_flat_cube(n.cube));for(let e of t)e instanceof i.gK&&n.push(e);return n}find_inline_data(){const e=[],t=this.find_scope_lines();for(let n of t)e.push(...n.children);return e}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:o.Mu.scope,version:1}}}},4926:(e,t,n)=>{"use strict";n.d(t,{f:()=>y});var r=n(4116),i=n(9513),s=n(4089),o=n(3972),a=n(7633),l=n(3028);function c(e,t,n,r){e.stopPropagation(),e.preventDefault(),r.isdown=!0,r.dir=n,r.dom=t.dom;const i=e.currentTarget,s=i.parentElement?.parentElement;r.x=e.clientX,r.width_origin=t.css.width,t.css.width?(r.width=Number.parseInt(t.css.width.trim().slice(0,-2)),r.width_result=r.width):s&&(r.width=s?.getBoundingClientRect().width,r.width_result=r.width)}var d=n(2551),u=n(4430);const h=["id","data-type"],p={class:"tools-left"},m={class:"tools-right"},f=["src","loading"],_=(0,s.pM)({__name:"cube-img",props:{cube:{}},setup(e){const{root:t,stats:n}=e.cube,_={isdown:!1,ismove:!1,x:0,width:-1,dir:"left",width_origin:500},g=t.id,b=d.F.url,y=t=>c(t,e.cube,"left",_),v=t=>c(t,e.cube,"right",_),w=t=>function(e,t,n){if(!n.isdown||!n.dom)return;n.ismove=!0,e.preventDefault();const r="left"===n.dir?1:-1,i=e.clientX-n.x,s=Math.abs(n.width-i*r);t.data.css.width=s+"px",n.width_result=s}(t,e.cube,_),x=t=>function(e,t,n){if(n.width===n.width_result||!n.isdown||!n.ismove)return;n.isdown=!1,n.ismove=!1,t.data.css.width=n.width_origin;const{courier:i,history:s}=t.root,o=new l.vk(i);o.tell(t,r.VL.set_css(t.id,{width:n.width_result+"px"})),s.record(o)}(0,e.cube,_),k=t=>function(e,t,n){if(n.width===n.width_result||!n.isdown||!n.ismove)return;n.isdown=!1,n.ismove=!1,t.data.css.width=n.width_origin;const{courier:i,history:s}=t.root,o=new l.vk(i);o.tell(t,r.VL.set_css(t.id,{width:n.width_result+"px"})),s.record(o)}(0,e.cube,_);function S(t){const n=t.currentTarget.parentElement;Object.assign(n.style,e.cube.css),n.classList.add("cube-img-load-failed")}return(0,s.sV)(()=>{document.documentElement.addEventListener("pointermove",w),document.documentElement.addEventListener("pointerup",x),document.documentElement.addEventListener("pointercancel",k)}),(0,s.hi)(()=>{document.documentElement.removeEventListener("pointermove",w),document.documentElement.removeEventListener("pointerup",x),document.documentElement.removeEventListener("pointercancel",k)}),(r,l)=>((0,s.uX)(),(0,s.CE)("div",{class:"cube-img",style:(0,o.Tr)(r.cube.css),id:r.cube.id,"data-type":(0,a.R1)(i.u0).img,onContextmenu:l[0]||(l[0]=e=>(0,a.R1)(u.uz)(e,r.cube))},[(0,s.Lk)("div",p,[(0,s.Lk)("div",{class:"dragger",onPointerdown:y},null,32)]),(0,s.Lk)("div",m,[(0,s.Lk)("div",{class:"dragger",onPointerdown:v},null,32)]),(0,s.Lk)("img",{style:(0,o.Tr)(r.cube.css),src:t.isdev?e.cube.info:b?b(g,"image",e.cube.info):void 0,alt:"",onErrorOnce:S,loading:(0,a.R1)(n).mode===(0,a.R1)(i.fv).export?"eager":"lazy"},null,44,f),(0,s.Q3)(' <div class="tools-img">\r\n <div class="iconfont icon-floatleft" @click="() => float(\'L\')"></div>\r\n <div class="iconfont icon-floatright" @click="() => float(\'R\')"></div>\r\n <div class="iconfont icon-close" @click="clear"></div>\r\n </div> ')],44,h))}}),g=(0,n(6743).A)(_,[["__scopeId","data-v-400e35f7"]]);var b=n(8631);class y extends r._D{_component=g;_children=[];get is_empty(){return 0===this.data.info.trim().length}get children(){return this._children}get meta(){return y.meta}get component(){return this._component}constructor(e,t){super(e,t);const n=this.setup(e,t),r=this.clipboard.pasted_from;return r&&this.event.emit_asset_copy(r.noteid,"image",e.info),n}build_child(){}update_data(e){const t=this.versions[this.meta.type];return t>this.meta.version?{data:e,usable:!1}:(1===t&&e.info.startsWith("image://")&&(e.info=e.info.slice(8)),{data:e,usable:!0})}float(e){const{courier:t}=this.root,n={float:"L"===e?"inline-start":"inline-end"},i=t.get_recorder(),s=r.VL.set_css(this.id,n,!0);return i.tell(this,s),i}clear_float(){const{courier:e}=this.root,t=e.get_recorder(),n=r.VL.set_css(this.id,{float:null},!0);return t.tell(this,n),t}gc(){super.base_gc()}export(){return this.base_export()}replace_id(e,t={}){return y.replace_id(this.root,e,t)}static get meta(){return{type:i.u0.img,cubename:"图片",block:!1,version:2,show:!1}}static replace_id(e,t,n={}){const r=t.id,i=b.I.get_id();return n[r]=i,t.id=i,t}static get_default(e="",t={},n={}){return{id:b.I.get_id(),type:i.u0.img,info:e,css:t,attrs:n}}}},6517:(e,t,n)=>{"use strict";n.d(t,{F:()=>h});var r=n(4743),i=n(4116),s=n(4926),o=n(6753),a=n(3028),l=n(9513),c=n(8631),d=n(2551),u=n(4089);class h extends o.K{_copy_data=[];_img_mime=["image/png","image/jpeg","image/gif"];_paste_stack=[];get pasted_from(){return this._paste_stack[this._paste_stack.length-1]}get copy_data(){return[...this._copy_data]}get meta(){return h.meta}constructor(e){super(e)}async copy(e){const{root:t,cursor:n}=this;return t.scope_count_normal>0?this.copy_scope(e):this.copy_selection(e)}async copy_selection(e){const{root:t,cursor:n}=this;if(n.has_selection){this._copy_data=n.find_inline_data();let r=n.get_selection_text();const i={noteid:t.id,cubedata:this._copy_data},s=JSON.stringify(i);return e.setData("application/json",s),e.setData("text/plain",r),!0}{const{cube_end:r}=n;if(!r)return!1;const i=[r.export()];this._copy_data=i;let s="";for(let e of this._copy_data)e.type===l.u0.text&&(s+=e.info);const o={noteid:t.id,cubedata:i},a=JSON.stringify(o);return e.setData("application/json",a),e.setData("text/plain",s),!0}}async copy_scope(e){const t=d.F.tips;if(0===this.root.scope.size)return t?.tip_info("无块选区,未复制内容"),!1;if(0===this.root.scope_count_normal)return t?.tip_info("无正常块选区,未复制内容"),!1;const n=this.root.get_scope_cubes();this.root.clear_scope();const r=[];let i="";for(let e of n){for(let t of e.cube.children.slice(...e.range))i+=t.text;r.push(...e.cube.copy(...e.range))}this._copy_data=r;const s={noteid:this.root.id,cubedata:this._copy_data},o=JSON.stringify(s);return e.setData("application/json",o),e.setData("text/plain",i),!0}set_clipboard_cubedata(e,t){const n={noteid:this.root.id,cubedata:t},r=JSON.stringify(n),i=(new TextEncoder).encode(r),s=JSON.stringify([...i]),o=new Blob([e],{type:"text/plain"}),a=new Blob([s],{type:"text/html"}),l=new ClipboardItem({[o.type]:o,[a.type]:a});return this.set_clipboard_data(l)}async paste(e){const{cursor:t,courier:n}=this,r=e.items,i=n.get_recorder();let s=[];i.merge(this.delete()),await(0,u.dY)();for(let e=0;e<r.length;e++){const t=r[e];if(t.type.startsWith("image")){const e=t.getAsFile();e&&s.push(e)}}if(s.length>0){for(let e of s){const t=await this.paste_img(e);i.merge(t)}return i}const o=e.getData("application/json");if(o){let e=!1;try{const t=JSON.parse(o);if(t&&t.cubedata&&t.noteid)return this._paste_stack.push(t),e=!0,i.merge(this.paste_cubes(t.cubedata)),i}catch(e){}finally{e&&this._paste_stack.pop()}}const a=e.getData("text/html");if(a)try{const e=(new DOMParser).parseFromString(a,"text/html").body.textContent.trim(),t=JSON.parse(e),n=new Uint8Array(t),r=(new TextDecoder).decode(n),s=JSON.parse(r);let o=!1;try{if(s&&s.cubedata&&s.noteid)return this._paste_stack.push(s),o=!0,i.merge(this.paste_cubes(s.cubedata)),i}catch(e){}finally{o&&this._paste_stack.pop()}}catch(e){console.error("🟥paste",e)}const l=e.getData("text/plain");if(l){const e=this.get_cubedata_from_text(l);return i?.merge(),i.merge(this.paste_cubes(e)),i}return i}get_cubedata_from_text(e){const t=e.replace("\r","").split("\n"),n=[];if(1===t.length){const e=r.P6.get_default(t[0]);n.push(e)}else for(let e of t){if(!e.trim())continue;const t=r.gK.get_default_by_string(e);n.push(t)}return n}paste_cubes(e){if(0===e.length)return;const{courier:t,history:n,cursor:r}=this,s=new a.vk(t),{cube_selection:o,cube_end:l,cube_start:d,offset_start:u,offset_end:h}=r;if(!o||!l||!d)return;r.has_selection&&s.tell(o,i.VL.delete(o.id,"backward",d.id,l.id,u,h,!0));const p=c.I.replace_id(this.root,e);return s.tell(d,i.VL.insert(d.id,p,d.id,d.id,u,u)),s}async paste_img(e){const{courier:t,history:n,cursor:r}=this,o=new a.vk(t),{cube_selection:l,cube_end:c,cube_start:d,offset_start:u,offset_end:h}=r;if(!l||!c||!d)return;const p=s.f.get_default();if(this.root.isdev)p.info=URL.createObjectURL(e),o.tell(c,i.VL.insert(c.id,[p],d.id,c.id,u,h));else{const t=p.id+".png",n=t;await this.event.emit_asset_save("image",t,e),p.info=n,o.tell(c,i.VL.insert(c.id,[p],d.id,c.id,u,h))}return o}delete(){const{root:e,courier:t,cursor:n}=this;return e.scope_count_normal>0?this.delete_scope():n.has_selection?this.delete_selection():void 0}delete_selection(){const{courier:e,cursor:t,history:n}=this,r=new a.vk(e),{cube_end:s,cube_start:o,cube_selection:l,offset_start:c,offset_end:d}=t;if(!l||!s||!o)return;const u=o.id,h=s.id,p=l.id,m=i.VL.delete(p,"backward",u,h,c,d);return r.tell(l,m),r}delete_scope(){const e=d.F.tips,{root:t,courier:n,history:r,cursor:i}=this;if(0===t.scope.size)return void e?.tip_info("无块选区");if(0===t.scope_count_normal)return void e?.tip_info("无常规块选区");const s=new a.vk(n),o=this._root.get_scope_cubes(),l=new Map;for(let e of o){let t=l.get(e.cube);t?t.push(e.range):l.set(e.cube,[e.range])}const c=new Set;for(let[e,t]of l){const n=e.children;for(let e of t){const t=n.slice(e[0],e[1]);for(let e of t)c.add(e)}for(let e of c)s.merge(e.remove_self())}return this.root.clear_scope(),s}cut(e){const{root:t,courier:n,cursor:r}=this;t.scope_count_normal>0?this.cut_scope(e):this.cut_selection(e)}cut_scope(e){const{root:t,courier:n,history:r,cursor:i}=this,s=d.F.tips;if(0===t.scope.size)return s?.tip_info("无块选区"),!1;if(0===t.scope_count_normal)return s?.tip_info("无常规块选区"),!1;const o=new a.vk(n),c=this._root.get_scope_cubes(),u=new Map;for(let e of c){let t=u.get(e.cube);t?t.push(e.range):u.set(e.cube,[e.range])}const h=[];for(let[e,t]of u){const n=new Set;e.children;for(let r of t){const t=e.children.slice(r[0],r[1]);for(let e of t)n.add(e);h.push(...e.copy(...r))}for(let e of n)o.merge(e.remove_self())}this._copy_data=h;let p="";for(let e of this._copy_data)e.type===l.u0.text&&(p+=e.info);const m={noteid:this.root.id,cubedata:h},f=JSON.stringify(m);e.setData("text/plain",p),e.setData("application/json",f),this.root.clear_scope(),r.record(o)}cut_selection(e){const{courier:t,cursor:n,history:r}=this,s=new a.vk(t),{cube_end:o,cube_start:c,cube_selection:d,offset_start:u,offset_end:h}=n;if(d&&o&&c)if(n.has_selection){this._copy_data=n.find_inline_data();let t="";for(let e of this._copy_data)e.type===l.u0.text&&(t+=e.info);const a={noteid:this.root.id,cubedata:this._copy_data},p=JSON.stringify(a);e.setData("text/plain",t),e.setData("application/json",p);const m=c.id,f=o.id,_=d.id,g=i.VL.delete(_,"backward",m,f,u,h);s.tell(d,g),r.record(s)}else{const t=o.export();this._copy_data=[t];let n="";for(let e of this._copy_data)e.type===l.u0.text&&(n+=e.info);const a={noteid:this.root.id,cubedata:this._copy_data},c=JSON.stringify(a);e.setData("text/plain",n),e.setData("application/json",c);const d=o.pcube,u=o.index,h=i.VL.delete_child(d.id,"backward",[u,u+1]);s.tell(d,h),r.record(s)}}set_clipboard_data(e){return new Promise((t,n)=>{navigator.clipboard?navigator.clipboard.write([e]).then(e=>t(!0)).catch(e=>{t(!1),console.error("写入粘贴板数据失败",e)}):t(!1)})}read_clipboard(){return new Promise(e=>{navigator.clipboard?navigator.clipboard.read().then(async t=>{const n=new Map;for(let e of t)if(e instanceof ClipboardItem){const t=e.types;for(let r of t)await e.getType(r).then(async e=>n.set(e.type,e))}e(n)}):e(new Map)})}load(){}export(){return{}}update_data(...e){return{}}static get meta(){return{type:l.Mu.clipboard,version:1}}}},6743:(e,t)=>{"use strict";t.A=(e,t)=>{const n=e.__vccOpts||e;for(const[e,r]of t)n[e]=r;return n}},6753:(e,t,n)=>{"use strict";n.d(t,{K:()=>i});var r=n(4743);class i{_root;get root(){return this._root}get doc(){const e=this.root;if(e instanceof r.oY)return e}get courier(){return this.root.courier}get history(){return this.root.history}get cursor(){return this.root.cursor}get event(){return this.root.event}get listener(){return this.root.listener}get clipboard(){return this.root.clipboard}get painter(){return this.root.painter}get cubes(){return this.root.cubes}get config(){return this.root.config}get stats(){return this.root.stats}get hotkeys(){return this.root.hotkeys}constructor(e){this._root=e}}},7084:(e,t,n)=>{"use strict";n.d(t,{T:()=>k});var r=n(3923),i=n(9513),s=n(4116),o=n(7552);class a extends r.K{_interaction;scope_down=null;fig_matrix_origin;pos_down_real;flow=!1;m;constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:fig-drag"}reset_status(){this.flow=!1}down(e,t){this.scope_down=t;const{selector:n}=t;"fig"===n.type&&this.map.interaction.check_mouse_key(e,"mid")&&(e.stopPropagation(),e.preventDefault(),this.pos_down_real=this.map.view_point_to_real(t.pos),this.flow=!0,this.fig_matrix_origin={...this.map.matrix2d})}move(e){if(!this.flow||!this.scope_down||!this._interaction.check_mouse_key(e,"mid"))return;e.stopPropagation(),e.preventDefault();const{map_sum_scale:t}=this.scope_down,n=e.clientX,r=e.clientY,i=(n-this.scope_down.pos.x)/t.sx,s=(r-this.scope_down.pos.y)/t.sy;this.m=o.c.multiply(this.fig_matrix_origin,o.c.get_matrix_translate(i,s)),this.map.reset_matrix(this.m)}up(e){if(!this.flow)return this.reset_status();e.stopPropagation(),e.preventDefault();const t=this.courier.get_recorder();t.tell(this.map,s.VL.set_attr(this.map.id,{matrix2d:this.m})),this.history.record(t),this.flow=!1,this.map.check_show()}cancel(e){this.flow&&(this.flow=!1,this.map.check_show())}leave(e){this.flow&&(this.flow=!1,this.map.check_show())}wheel(e){}dblclick(e){}contextmenu(e){}}class l extends r.K{_interaction;constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:fig-scale"}down(e,t){}move(e){}up(e){}cancel(e){}leave(){}wheel(e){if(!e.ctrlKey)return;e.stopPropagation(),e.preventDefault();const{map_scale_step:t}=this.config.data,n=e.deltaY,r=-Math.sign(n),i={x:e.clientX,y:e.clientY},s=r*t;this.map.scale_by_point(i,s,s),this.map.check_show_throttle()}dblclick(e){}contextmenu(e){}}class c extends r.K{_interaction;count=0;constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:fig-wheel"}down(e,t){}move(e){}up(e){}cancel(e){}leave(){}wheel(e){e.stopPropagation(),e.preventDefault(),this.count++;const t=-Math.sign(e.deltaY)*this.config.data.scroll_distance;if(!e.ctrlKey){if(e.shiftKey){const e=o.c.multiply(this.map.matrix2d,o.c.get_matrix_translate(t,0));this.map.reset_matrix(e)}else{const e=o.c.multiply(this.map.matrix2d,o.c.get_matrix_translate(0,t));this.map.reset_matrix(e)}this.map.check_show_throttle()}}dblclick(e){}contextmenu(e){}}var d=n(4743),u=n(1068);class h extends r.K{_interaction;down_point;view_cubes=[];flow=!1;count=0;rate=5;constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:line-delete"}reset(){this.flow=!1,this.map.placeholder.line_delete="",this.view_cubes=[]}down(e,t){const{selector:n,pos:r}=t;this.stats.is_read_mode||"fig"===n.type&&this.map.interaction.check_mouse_key(e,"right")&&(e.stopPropagation(),e.preventDefault(),this.flow=!0,this.down_point=this.map.view_point_to_real(r),this.view_cubes=this.map.get_view_cube())}move(e){if(!this.flow)return;e.stopPropagation(),e.preventDefault(),this.count++;const t={x:e.clientX,y:e.clientY},n=this.map.view_point_to_real(t);if(this.map.placeholder.line_delete=d.sf.line(this.down_point,n),this.count%this.rate!==0)return;this.count=1,this.map.clear_delete_line();const r={from:this.down_point,to:n};for(let e of this.view_cubes)if(e instanceof s.wP){let t=e.sample[0];for(let n of e.sample.slice(1)){const i={from:t,to:n};if(u.MathLine.check_intersection(i,r)){this.map.put_delete_selected(e);break}t=n}}else if(e instanceof d.R$){let t=e.sample[0];for(let n of e.sample.slice(1)){const i={from:t,to:n};if(u.MathLine.check_intersection(i,r)){this.map.put_delete_selected(e);break}t=n}}}up(e){if(!this.flow)return;e.stopPropagation(),e.preventDefault();const{courier:t,history:n}=this.root,r=t.get_recorder(),i=this.map.id,o=[],a=[],l=this.map.get_delete_selected();for(let e of l)e instanceof s.wP?o.push(e.id):e instanceof d.R$&&a.push(e.id);const c=s.yc.node_remove(i,o),u=s.yc.linker_remove(i,a);r.tell(this.map,c,u),n.record(r),this.reset()}cancel(e){this.reset()}leave(){}wheel(e){}dblclick(e){}contextmenu(e){}}class p extends r.K{_interaction;flow=!1;constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:node-add"}down(e,t){}move(e){}up(e){this.flow&&(this.flow=!1)}cancel(e){this.flow}wheel(e){}leave(){}dblclick(e,t){const{selector:n,pos:r}=t;if("fig"!==n.type)return;e.stopPropagation(),e.preventDefault();const{courier:i,history:o}=this,a=s.wP.get_default_node_pos(r,this.map),l=[d.gL.get_default(a)],c=s.yc.node_add(this.map.id,l),u=i.get_recorder();u.tell(this.map,c),o.record(u)}contextmenu(e){}}class m extends r.K{_interaction;flow=!1;point_down;count=0;rate=10;constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:node-box-selected"}reset(){this.flow=!1,this.map.placeholder.box_selector=""}down(e,t){const{pos:n,selector:r}=t,{type:i,res:s}=r;"fig"===i&&this._interaction.check_mouse_key(e,"left")&&(e.preventDefault(),this.flow=!0,this.point_down=this.map.view_point_to_real(n))}move(e){if(!this.flow)return;this.count++,e.preventDefault();const t={x:e.clientX,y:e.clientY},n=this.map.view_point_to_real(t),r=this.get_rect_area(this.point_down,n);if(this.map.placeholder.box_selector=r,this.count%this.rate!==0)return;this.count=1;const i={x:Math.min(this.point_down.x,n.x),y:Math.min(this.point_down.y,n.y),width:Math.abs(n.x-this.point_down.x),height:Math.abs(n.y-this.point_down.y)},s=this.map.get_nodes_intersection(i);this.map.clear_node_selected();for(let e of s)this.map.register_node_selected(e)}up(e){this.flow&&(e.stopPropagation(),e.preventDefault(),this.reset())}cancel(e){this.flow&&this.reset()}wheel(e){}leave(){}dblclick(e,t){}contextmenu(e){}get_rect_area(e,t,n=4){const r=t.x-e.x,i=t.y-e.y,s=Math.sign(r)*n,o=Math.sign(i)*n,a=e,l=a.x+r,c=a.y,d=t,u=a.x,h=a.y+i;return`M${a.x+s} ${a.y}H${l-s}Q${l} ${c} ${l} ${c+o}V${d.y-o}Q${d.x} ${d.y} ${d.x-s} ${d.y}H ${u+s}Q${u} ${h} ${u} ${h-o}V${a.y+o}Q${a.x} ${a.y} ${a.x+s} ${a.y}Z`}check_intersection(e,t){const n=e.x+e.width/2,r=e.y+e.height/2,i=t.x+t.width/2,s=t.y+t.height/2,o=Math.abs(n-i),a=Math.abs(r-s);return o<=(e.width+t.width)/2&&a<=(e.height+t.height)/2}}class f extends r.K{_interaction;flow=!1;constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:node-click-select"}down(e,t){const{selector:n,pos:r}=t,{type:i,res:s}=n;"node"!==i||n.res.editable||(e.stopPropagation(),e.preventDefault(),e.ctrlKey||this.map.clear_node_selected(),s.pcube.toggle_node_selected(s))}move(e){this.flow}up(e){this.flow}leave(e){}cancel(e){}wheel(e){}dblclick(e){}contextmenu(e){}}class _ extends r.K{_interaction;down_node;down_pos;matrix=new Map;matrix_translate=o.c.get_matrix_translate(0,0);scope_down;flow=!1;recover_select=!1;has_down=!1;view_cubes=[];near;intention="none";constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:node-drag"}reset_status(){this.recover_select=!1,this.matrix.clear(),this.flow=!1,this.has_down=!1,this._interaction.info_node_drag.show=!1,this.view_cubes=[]}down(e,t){this.scope_down=t;const{selector:n,pos:r,selected_nodes:i,view_cubes:s}=t;if("node"===n.type&&this.map.interaction.check_mouse_key(e,"left")&&!n.res.editable)if(e.stopPropagation(),e.preventDefault(),this.reset_status(),this.has_down=!0,this.view_cubes=s,this.down_node=n.res,this.down_pos=this.map.view_point_to_real(r),i.has(this.down_node))for(let e of i)this.matrix.set(e,{...e.matrix2d});else this.matrix.set(this.down_node,{...this.down_node.matrix2d})}move(e){if(!this.has_down||!this.map.interaction.check_mouse_key(e,"left")||!this.down_pos)return;this.flow=!0,e.preventDefault();const t=this._interaction.info_node_drag,n={x:e.clientX,y:e.clientY},r=this.map.view_point_to_real(n),i=r.x-this.down_pos.x,s=r.y-this.down_pos.y;if(!this.recover_select){this.map.clear_node_selected();for(let[e]of this.matrix)this.map.register_node_selected(e);this.recover_select=!0}t.show=!1,this.matrix_translate=o.c.get_matrix_translate(i,s);for(let[e,t]of this.matrix){if(!t||e.is_captive)continue;const n=o.c.multiply(t,this.matrix_translate);e.reset_matrix(n)}}up(e){if(!this.flow)return this.reset_status();e.stopPropagation(),e.preventDefault();const{courier:t,history:n}=this,r=t.get_recorder();if(e.ctrlKey);else{const e=[];for(let[t,n]of this.matrix){if(!n)continue;t.reset_matrix(n),t.is_layout_root&&t.layout_type&&e.push(t);const i=o.c.multiply(n,this.matrix_translate);r.tell(t,s.VL.set_attr(t.id,{matrix2d:i}))}n.record(r);const t=this.map.get_view_rect();for(let n of e)n.layout_throttle(t)}this.reset_status()}cancel(e){this.flow&&this.reset_status()}leave(){}wheel(e){}dblclick(e){}contextmenu(e){}}class g extends r.K{_interaction;constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:node-edit"}down(e,t){}move(e){}up(e){}leave(){}cancel(e){}wheel(e){}dblclick(e,t){const{selector:n,pos:r}=t;"node"===n.type&&(e.stopPropagation(),e.preventDefault(),n.res.editable=!0)}contextmenu(e){}}class b extends r.K{_interaction;constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:node-edit-exit"}down(e,t){const{selector:n}=t,{type:r,res:i}=n;"fig"!==r&&"empty"!==r||(e.stopPropagation(),e.preventDefault(),this.cubes.clear_all_map_selected(),this.map.clear_node_editing())}move(e){}up(e){}leave(){}cancel(e){}wheel(e){}dblclick(e,t){}contextmenu(e){}}var y=n(2551);class v extends r.K{_interaction;down_node;flow=!1;selected_nodes=new Set;recorver_selected=!1;has_down=!1;constructor(e){super(e.root),this._interaction=e}get map(){return this._interaction.map}get name(){return"map-interaction:node-line"}reset_status(){this.flow=!1,this.has_down=!1,this.selected_nodes.clear(),this.map.placeholder.linker=[],this.recorver_selected=!1}down(e,t){const{selector:n,pos:r,selected_nodes:i}=t;if("node"===n.type&&this._interaction.check_mouse_key(e,"right"))if(this.reset_status(),this.has_down=!0,e.preventDefault(),e.stopPropagation(),this.down_node=n.res,i.has(this.down_node))for(let e of i)this.selected_nodes.add(e);else this.selected_nodes.add(this.down_node)}move(e){if(!this._interaction.check_mouse_key(e,"right")||!this.has_down)return;this.flow=!0,e.stopPropagation(),e.preventDefault();const t=this._interaction.get_map_selector(e),{res:n,type:r}=t;this.map.placeholder.linker=[];const i=this.map.config.data.map_linker_line;if(!this.recorver_selected){this.recorver_selected=!0,this.map.clear_node_selected();for(let e of this.selected_nodes)this.map.register_node_selected(e)}if("node"===r)for(let e of this.selected_nodes){const{from:t,to:r}=o.U.find_closest_points(e.sample,n.sample);this.map.placeholder.linker.push(d.sf.get_line(t,r,i))}else{const t={x:e.clientX,y:e.clientY},n=this.map.view_point_to_real(t);for(let e of this.selected_nodes){const t=o.U.find_closet_point(e.sample,n);this.map.placeholder.linker.push(d.sf.get_line(t,n,i))}}}up(e){if(!this.flow)return this.reset_status();e.preventDefault(),e.stopPropagation();const{courier:t,history:n}=this,r=this._interaction.get_map_selector(e),{res:i,type:a}=r;if("node"===a){if(i===this.down_node)return;const e=t.get_recorder();for(let t of this.selected_nodes){const n=this.map.get_linker_id(t.id,i.id);if(this.map.get_linker(n))y.F.tips?.tip_warning("已存在连接线");else{const n=o.U.create_linker_info(this.map,t.id,i.id),r=s.yc.linker_add(this.map.id,[n]);e.tell(this.map,r)}}n.record(e)}else if("fig"===a){const{courier:t,history:n}=this,r=t.get_recorder(),i=s.wP.get_default_node_pos({x:e.clientX,y:e.clientY},this.map),a=d.gL.get_default(i),l=s.yc.node_add(this.map.id,[a]);r.tell(this.map,l);for(let e of this.selected_nodes){const t=this.map.get_linker_id(e.id,a.id);if(this.map.get_linker(t)){y.F.tips?.tip_warning("已存在连接线");continue}const n=o.U.create_linker_info(this.map,e.id,a.id),i=s.yc.linker_add(this.map.id,[n]);r.tell(this.map,i)}n.record(r)}this.reset_status()}leave(){}cancel(e){this.reset_status()}wheel(e){}dblclick(e,t){}contextmenu(e){e.preventDefault()}}var w=n(7633),x=n(8631);class k extends r.K{_map;interactions_pointer=[];interaction_keyboard=[];constructor(e){super(e.root),this._map=e,this.interactions_pointer.push(new a(this)),this.interactions_pointer.push(new l(this)),this.interactions_pointer.push(new c(this)),this.interactions_pointer.push(new g(this)),this.interactions_pointer.push(new b(this)),this.interactions_pointer.push(new p(this)),this.interactions_pointer.push(new v(this)),this.interactions_pointer.push(new _(this)),this.interactions_pointer.push(new m(this)),this.interactions_pointer.push(new h(this)),this.interactions_pointer.push(new f(this))}info_node_drag=(0,w.Kh)({show:!1,count:0,x:0,y:0});get map(){return this._map}register(e){e.addEventListener("pointerdown",this.pointerdown.bind(this)),e.addEventListener("pointermove",this.pointermove.bind(this)),e.addEventListener("pointerup",this.pointerup.bind(this)),e.addEventListener("pointercancel",this.pointercancel.bind(this)),e.addEventListener("pointerleave",this.pointerleave.bind(this)),e.addEventListener("wheel",this.wheel.bind(this)),e.addEventListener("dblclick",this.dblclick.bind(this)),e.addEventListener("contextmenu",this.contextmenu.bind(this))}check_mouse_key(e,t){return x.I.check_mouse_key(e,t)}get_map_selector(e){let t=e.target;for(;t&&t!==document.body;){const e=t.dataset.type,n=t.id;if(n&&e){if(e===i.u0.node){const e=this.map.get_node(n);if(e)return{type:"node",res:e}}else if(e===i.u0.linker){const e=this.map.get_linker(n);if(e)return{type:"linker",res:e}}else if(e===i.u0.map||e===i.u0.submap)return{type:"fig",res:this.map};t=t.parentElement}else t=t.parentElement}return{type:"empty",res:void 0}}pointerdown(e){const t={selector:this.get_map_selector(e),pos:{x:e.clientX,y:e.clientY},selected_nodes:this.map.get_nodes_selected(),view_cubes:this.map.get_view_cube(),map_sum_scale:this.map.get_upstream_sum_scale()},{selector:n}=t,{res:r,type:i}=n;if("node"===i&&this.root.isdev){this.map.nodes_test[r.id]=r,console.log("------------------------------------节点信息");const t=r.bound;console.log("id",r.id),console.log("matrix:",{...t.matrix2d}),console.log("pos:",t.pos),console.log("pos_tree:",t.pos_tree),console.log("size_bound:",t.size_bound),console.log("size_tree:",t.size_tree),console.log("fig_pos:",r.pcube.real_point_to_fig(t.pos)),console.log("view_pos:",r.pcube.real_point_to_view(t.pos)),console.log("to_size",r.to.size),console.log("in_size",r.from.size),console.log("节点",r),this.check_mouse_key(e,"mid")&&r.a()}for(let n of this.interactions_pointer)n.down(e,t);"fig"===t.selector.type&&this.event.emit_fig_click(e)}pointermove(e){for(let t of this.interactions_pointer)t.move(e)}pointerup(e){for(let t of this.interactions_pointer)t.up(e)}pointercancel(e){for(let t of this.interactions_pointer)t.cancel(e)}pointerleave(e){for(let t of this.interactions_pointer)t.leave(e)}dblclick(e){const t={selector:this.get_map_selector(e),pos:{x:e.clientX,y:e.clientY},selected_nodes:this.map.get_nodes_selected(),view_cubes:this.map.get_view_cube(),map_sum_scale:this.map.get_upstream_sum_scale()};for(let n of this.interactions_pointer)n.dblclick(e,t)}wheel(e){e.preventDefault(),e.stopImmediatePropagation();for(let t of this.interactions_pointer)t.wheel(e)}contextmenu(e){for(let t of this.interactions_pointer)t.contextmenu(e)}}},7552:(e,t,n)=>{"use strict";n.d(t,{U:()=>s,c:()=>r});class r{static get_default(){return{a:1,b:0,c:0,d:1,e:0,f:0}}static to_array(e){return[e.a,e.b,e.c,e.d,e.e,e.f]}static is_default(e){return 1===e.a&&0===e.b&&0===e.c&&1===e.d&&0===e.e&&0===e.f}static get_matrix(e,t,n,r,i,s){return{a:e,b:t,c:n,d:r,e:i,f:s}}static get_matrix_translate(e,t){return{a:1,b:0,c:0,d:1,e,f:t}}static get_matrix_scale(e,t){return{a:e,b:0,c:0,d:t,e:0,f:0}}static get_matrix_reflection_horizental(){return{a:1,b:0,c:0,d:-1,e:0,f:0}}static get_matrix_reflection_vertical(){return{a:-1,b:0,c:0,d:1,e:0,f:0}}static multiply(e,t){return{a:t.a*e.a+t.c*e.b,b:t.b*e.a+t.d*e.b,c:t.a*e.c+t.c*e.d,d:t.b*e.c+t.d*e.d,e:t.a*e.e+t.c*e.f+t.e,f:t.b*e.e+t.d*e.f+t.f}}static translate(e,t,n){const r=this.get_matrix_translate(t,n);return this.multiply(e,r)}static get_dom_string(e){const{a:t,b:n,c:r,d:i,e:s,f:o}=e;return`matrix(${t.toFixed(1)},${n},${r},${i.toFixed(1)},${s.toFixed(1)},${o.toFixed(1)})`}static map_point_to_view(e,t){return{x:e.x+t.x,y:e.y+t.y}}static view_point_to_map(e,t){return{x:e.x-t.x,y:e.y-t.y}}}var i=n(4743);class s{static path=document.createElementNS("http://www.w3.org/2000/svg","path");static svg_path_sample(e,t=24){if(!e||t<2)return[];this.path.setAttribute("d",e);const n=[],r=this.path.getTotalLength()/t;for(let e=0;e<=t;e++){const t=e*r,i=this.path.getPointAtLength(t);n.push({x:i.x,y:i.y})}return n}static get_line_k(e,t){const n=t.y-e.y,r=t.x-e.x;return 0===r?Number.POSITIVE_INFINITY:n/r}static find_closet_point(e,t){let n=1/0,r=e[0];const{x:i,y:s}=t;for(let t of e){let e=(i-t.x)**2+(s-t.y)**2;e<n&&(n=e,r=t)}return r}static offset_points(e,t){const n=[],{x:r,y:i}=t;for(let t of e)n.push({x:t.x+r,y:t.y+i});return n}static find_closest_points(e,t){let n=1/0,r=e[0],i=t[0];for(let s=0;s<e.length;s++){const o=e[s];for(let e=0;e<t.length;e++){const s=t[e],a=o.x-s.x,l=o.y-s.y,c=a*a+l*l;c<n&&(n=c,r=o,i=s)}}return{from:r,to:i}}static polygonCentroid(e){let t=0,n=0,r=0;const i=e.length;for(let s=0;s<i;s++){const{x:o,y:a}=e[s],{x:l,y:c}=e[(s+1)%i],d=o*c-l*a;r+=d,t+=(o+l)*d,n+=(a+c)*d}return r*=.5,t/=6*r,n/=6*r,{x:t,y:n}}static get_polygon_area(e){let t=0;const n=e.length;for(let r=0;r<n;r++){const{x:i,y:s}=e[r],{x:o,y:a}=e[(r+1)%n];t+=i*a-o*s}return t/2}static find_line_to_layout_root(e,t=new Set){if(e.is_layout_root)return{has_root:!0,line:[e]};t.add(e.id);for(let n of e.from){if(t.has(n))continue;const r=e.pcube.get_node(n);if(r){if(r.is_layout_root)return{has_root:!0,line:[e,r]};{const n=this.find_line_to_layout_root(r,t);if(n.has_root)return n.line.unshift(e),n}}}return{has_root:!1,line:[]}}static get_linker_id(e,t){return e+"-"+t}static wait_nodes_render(e){const t=[];for(let n of e)t.push(n.wait_layout_self());return Promise.all(t)}static create_linker_info(e,t,n){const r=e.get_node(t),s=e.get_node(n),o=r?.to.size||0,a=s?.from.size||0;return{linker:i.R$.get_default(t,n),index_from:a,index_to:o}}}},7633:(e,t,n)=>{"use strict";n.d(t,{C4:()=>k,EW:()=>Pe,Gc:()=>he,IG:()=>ve,IJ:()=>Ce,KR:()=>Se,Kh:()=>ue,Pr:()=>Ae,R1:()=>Te,Tm:()=>_e,X2:()=>l,a1:()=>xe,bl:()=>S,fE:()=>ge,g8:()=>fe,hV:()=>Be,hZ:()=>O,i9:()=>ke,ju:()=>be,lJ:()=>we,qA:()=>B,u4:()=>E,ux:()=>ye,wB:()=>Ie,yC:()=>o});var r=n(3972);let i,s;class o{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=i,!e&&i&&(this.index=(i.scopes||(i.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){let e,t;if(this._isPaused=!0,this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].pause();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){let e,t;if(this._isPaused=!1,this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].resume();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].resume()}}run(e){if(this._active){const t=i;try{return i=this,e()}finally{i=t}}}on(){1===++this._on&&(this.prevScope=i,i=this)}off(){this._on>0&&0===--this._on&&(i=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){let t,n;for(this._active=!1,t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();for(this.effects.length=0,t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){const e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0}}}const a=new WeakSet;class l{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,i&&i.active&&i.effects.push(this)}pause(){this.flags|=64}resume(){64&this.flags&&(this.flags&=-65,a.has(this)&&(a.delete(this),this.trigger()))}notify(){2&this.flags&&!(32&this.flags)||8&this.flags||h(this)}run(){if(!(1&this.flags))return this.fn();this.flags|=2,C(this),f(this);const e=s,t=w;s=this,w=!0;try{return this.fn()}finally{_(this),s=e,w=t,this.flags&=-3}}stop(){if(1&this.flags){for(let e=this.deps;e;e=e.nextDep)y(e);this.deps=this.depsTail=void 0,C(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){64&this.flags?a.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){g(this)&&this.run()}get dirty(){return g(this)}}let c,d,u=0;function h(e,t=!1){if(e.flags|=8,t)return e.next=d,void(d=e);e.next=c,c=e}function p(){u++}function m(){if(--u>0)return;if(d){let e=d;for(d=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;c;){let t=c;for(c=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,1&t.flags)try{t.trigger()}catch(t){e||(e=t)}t=n}}if(e)throw e}function f(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function _(e){let t,n=e.depsTail,r=n;for(;r;){const e=r.prevDep;-1===r.version?(r===n&&(n=e),y(r),v(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function g(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(b(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function b(e){if(4&e.flags&&!(16&e.flags))return;if(e.flags&=-17,e.globalVersion===M)return;if(e.globalVersion=M,!e.isSSR&&128&e.flags&&(!e.deps&&!e._dirty||!g(e)))return;e.flags|=2;const t=e.dep,n=s,i=w;s=e,w=!0;try{f(e);const n=e.fn(e._value);(0===t.version||(0,r.$H)(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{s=n,w=i,_(e),e.flags&=-3}}function y(e,t=!1){const{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)y(e,!0)}t||--n.sc||!n.map||n.map.delete(n.key)}function v(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let w=!0;const x=[];function k(){x.push(w),w=!1}function S(){const e=x.pop();w=void 0===e||e}function C(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const e=s;s=void 0;try{t()}finally{s=e}}}let M=0;class L{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class T{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!s||!w||s===this.computed)return;let t=this.activeLink;if(void 0===t||t.sub!==s)t=this.activeLink=new L(s,this),s.deps?(t.prevDep=s.depsTail,s.depsTail.nextDep=t,s.depsTail=t):s.deps=s.depsTail=t,z(t);else if(-1===t.version&&(t.version=this.version,t.nextDep)){const e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=s.depsTail,t.nextDep=void 0,s.depsTail.nextDep=t,s.depsTail=t,s.deps===t&&(s.deps=e)}return t}trigger(e){this.version++,M++,this.notify(e)}notify(e){p();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{m()}}}function z(e){if(e.dep.sc++,4&e.sub.flags){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)z(e)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const A=new WeakMap,R=Symbol(""),P=Symbol(""),N=Symbol("");function E(e,t,n){if(w&&s){let t=A.get(e);t||A.set(e,t=new Map);let r=t.get(n);r||(t.set(n,r=new T),r.map=t,r.key=n),r.track()}}function O(e,t,n,i,s,o){const a=A.get(e);if(!a)return void M++;const l=e=>{e&&e.trigger()};if(p(),"clear"===t)a.forEach(l);else{const s=(0,r.cy)(e),o=s&&(0,r.yI)(n);if(s&&"length"===n){const e=Number(i);a.forEach((t,n)=>{("length"===n||n===N||!(0,r.Bm)(n)&&n>=e)&&l(t)})}else switch((void 0!==n||a.has(void 0))&&l(a.get(n)),o&&l(a.get(N)),t){case"add":s?o&&l(a.get("length")):(l(a.get(R)),(0,r.CE)(e)&&l(a.get(P)));break;case"delete":s||(l(a.get(R)),(0,r.CE)(e)&&l(a.get(P)));break;case"set":(0,r.CE)(e)&&l(a.get(R))}}m()}function I(e){const t=ye(e);return t===e?t:(E(t,0,N),ge(e)?t:t.map(we))}function B(e){return E(e=ye(e),0,N),e}const D={__proto__:null,[Symbol.iterator](){return V(this,Symbol.iterator,we)},concat(...e){return I(this).concat(...e.map(e=>(0,r.cy)(e)?I(e):e))},entries(){return V(this,"entries",e=>(e[1]=we(e[1]),e))},every(e,t){return j(this,"every",e,t,void 0,arguments)},filter(e,t){return j(this,"filter",e,t,e=>e.map(we),arguments)},find(e,t){return j(this,"find",e,t,we,arguments)},findIndex(e,t){return j(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return j(this,"findLast",e,t,we,arguments)},findLastIndex(e,t){return j(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return j(this,"forEach",e,t,void 0,arguments)},includes(...e){return U(this,"includes",e)},indexOf(...e){return U(this,"indexOf",e)},join(e){return I(this).join(e)},lastIndexOf(...e){return U(this,"lastIndexOf",e)},map(e,t){return j(this,"map",e,t,void 0,arguments)},pop(){return q(this,"pop")},push(...e){return q(this,"push",e)},reduce(e,...t){return F(this,"reduce",e,t)},reduceRight(e,...t){return F(this,"reduceRight",e,t)},shift(){return q(this,"shift")},some(e,t){return j(this,"some",e,t,void 0,arguments)},splice(...e){return q(this,"splice",e)},toReversed(){return I(this).toReversed()},toSorted(e){return I(this).toSorted(e)},toSpliced(...e){return I(this).toSpliced(...e)},unshift(...e){return q(this,"unshift",e)},values(){return V(this,"values",we)}};function V(e,t,n){const r=B(e),i=r[t]();return r===e||ge(e)||(i._next=i.next,i.next=()=>{const e=i._next();return e.value&&(e.value=n(e.value)),e}),i}const H=Array.prototype;function j(e,t,n,r,i,s){const o=B(e),a=o!==e&&!ge(e),l=o[t];if(l!==H[t]){const t=l.apply(e,s);return a?we(t):t}let c=n;o!==e&&(a?c=function(t,r){return n.call(this,we(t),r,e)}:n.length>2&&(c=function(t,r){return n.call(this,t,r,e)}));const d=l.call(o,c,r);return a&&i?i(d):d}function F(e,t,n,r){const i=B(e);let s=n;return i!==e&&(ge(e)?n.length>3&&(s=function(t,r,i){return n.call(this,t,r,i,e)}):s=function(t,r,i){return n.call(this,t,we(r),i,e)}),i[t](s,...r)}function U(e,t,n){const r=ye(e);E(r,0,N);const i=r[t](...n);return-1!==i&&!1!==i||!be(n[0])?i:(n[0]=ye(n[0]),r[t](...n))}function q(e,t,n=[]){k(),p();const r=ye(e)[t].apply(e,n);return m(),S(),r}const $=(0,r.pD)("__proto__,__v_isRef,__isVue"),G=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>"arguments"!==e&&"caller"!==e).map(e=>Symbol[e]).filter(r.Bm));function X(e){(0,r.Bm)(e)||(e=String(e));const t=ye(this);return E(t,0,e),t.hasOwnProperty(e)}class K{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if("__v_skip"===t)return e.__v_skip;const i=this._isReadonly,s=this._isShallow;if("__v_isReactive"===t)return!i;if("__v_isReadonly"===t)return i;if("__v_isShallow"===t)return s;if("__v_raw"===t)return n===(i?s?de:ce:s?le:ae).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const o=(0,r.cy)(e);if(!i){let e;if(o&&(e=D[t]))return e;if("hasOwnProperty"===t)return X}const a=Reflect.get(e,t,ke(e)?e:n);return((0,r.Bm)(t)?G.has(t):$(t))?a:(i||E(e,0,t),s?a:ke(a)?o&&(0,r.yI)(t)?a:a.value:(0,r.Gv)(a)?i?pe(a):ue(a):a)}}class W extends K{constructor(e=!1){super(!1,e)}set(e,t,n,i){let s=e[t];if(!this._isShallow){const t=_e(s);if(ge(n)||_e(n)||(s=ye(s),n=ye(n)),!(0,r.cy)(e)&&ke(s)&&!ke(n))return t||(s.value=n),!0}const o=(0,r.cy)(e)&&(0,r.yI)(t)?Number(t)<e.length:(0,r.$3)(e,t),a=Reflect.set(e,t,n,ke(e)?e:i);return e===ye(i)&&(o?(0,r.$H)(n,s)&&O(e,"set",t,n):O(e,"add",t,n)),a}deleteProperty(e,t){const n=(0,r.$3)(e,t),i=(e[t],Reflect.deleteProperty(e,t));return i&&n&&O(e,"delete",t,void 0),i}has(e,t){const n=Reflect.has(e,t);return(0,r.Bm)(t)&&G.has(t)||E(e,0,t),n}ownKeys(e){return E(e,0,(0,r.cy)(e)?"length":R),Reflect.ownKeys(e)}}class Y extends K{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}const Z=new W,Q=new Y,J=new W(!0),ee=e=>e,te=e=>Reflect.getPrototypeOf(e);function ne(e){return function(...t){return"delete"!==e&&("clear"===e?void 0:this)}}function re(e,t){const n=function(e,t){const n={get(n){const i=this.__v_raw,s=ye(i),o=ye(n);e||((0,r.$H)(n,o)&&E(s,0,n),E(s,0,o));const{has:a}=te(s),l=t?ee:e?xe:we;return a.call(s,n)?l(i.get(n)):a.call(s,o)?l(i.get(o)):void(i!==s&&i.get(n))},get size(){const t=this.__v_raw;return!e&&E(ye(t),0,R),t.size},has(t){const n=this.__v_raw,i=ye(n),s=ye(t);return e||((0,r.$H)(t,s)&&E(i,0,t),E(i,0,s)),t===s?n.has(t):n.has(t)||n.has(s)},forEach(n,r){const i=this,s=i.__v_raw,o=ye(s),a=t?ee:e?xe:we;return!e&&E(o,0,R),s.forEach((e,t)=>n.call(r,a(e),a(t),i))}};return(0,r.X$)(n,e?{add:ne("add"),set:ne("set"),delete:ne("delete"),clear:ne("clear")}:{add(e){t||ge(e)||_e(e)||(e=ye(e));const n=ye(this);return te(n).has.call(n,e)||(n.add(e),O(n,"add",e,e)),this},set(e,n){t||ge(n)||_e(n)||(n=ye(n));const i=ye(this),{has:s,get:o}=te(i);let a=s.call(i,e);a||(e=ye(e),a=s.call(i,e));const l=o.call(i,e);return i.set(e,n),a?(0,r.$H)(n,l)&&O(i,"set",e,n):O(i,"add",e,n),this},delete(e){const t=ye(this),{has:n,get:r}=te(t);let i=n.call(t,e);i||(e=ye(e),i=n.call(t,e)),r&&r.call(t,e);const s=t.delete(e);return i&&O(t,"delete",e,void 0),s},clear(){const e=ye(this),t=0!==e.size,n=e.clear();return t&&O(e,"clear",void 0,void 0),n}}),["keys","values","entries",Symbol.iterator].forEach(i=>{n[i]=function(e,t,n){return function(...i){const s=this.__v_raw,o=ye(s),a=(0,r.CE)(o),l="entries"===e||e===Symbol.iterator&&a,c="keys"===e&&a,d=s[e](...i),u=n?ee:t?xe:we;return!t&&E(o,0,c?P:R),{next(){const{value:e,done:t}=d.next();return t?{value:e,done:t}:{value:l?[u(e[0]),u(e[1])]:u(e),done:t}},[Symbol.iterator](){return this}}}}(i,e,t)}),n}(e,t);return(t,i,s)=>"__v_isReactive"===i?!e:"__v_isReadonly"===i?e:"__v_raw"===i?t:Reflect.get((0,r.$3)(n,i)&&i in t?n:t,i,s)}const ie={get:re(!1,!1)},se={get:re(!1,!0)},oe={get:re(!0,!1)},ae=new WeakMap,le=new WeakMap,ce=new WeakMap,de=new WeakMap;function ue(e){return _e(e)?e:me(e,!1,Z,ie,ae)}function he(e){return me(e,!1,J,se,le)}function pe(e){return me(e,!0,Q,oe,ce)}function me(e,t,n,i,s){if(!(0,r.Gv)(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const o=(a=e).__v_skip||!Object.isExtensible(a)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((0,r.Zf)(a));var a;if(0===o)return e;const l=s.get(e);if(l)return l;const c=new Proxy(e,2===o?i:n);return s.set(e,c),c}function fe(e){return _e(e)?fe(e.__v_raw):!(!e||!e.__v_isReactive)}function _e(e){return!(!e||!e.__v_isReadonly)}function ge(e){return!(!e||!e.__v_isShallow)}function be(e){return!!e&&!!e.__v_raw}function ye(e){const t=e&&e.__v_raw;return t?ye(t):e}function ve(e){return!(0,r.$3)(e,"__v_skip")&&Object.isExtensible(e)&&(0,r.yQ)(e,"__v_skip",!0),e}const we=e=>(0,r.Gv)(e)?ue(e):e,xe=e=>(0,r.Gv)(e)?pe(e):e;function ke(e){return!!e&&!0===e.__v_isRef}function Se(e){return Me(e,!1)}function Ce(e){return Me(e,!0)}function Me(e,t){return ke(e)?e:new Le(e,t)}class Le{constructor(e,t){this.dep=new T,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:ye(e),this._value=t?e:we(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,n=this.__v_isShallow||ge(e)||_e(e);e=n?e:ye(e),(0,r.$H)(e,t)&&(this._rawValue=e,this._value=n?e:we(e),this.dep.trigger())}}function Te(e){return ke(e)?e.value:e}const ze={get:(e,t,n)=>"__v_raw"===t?e:Te(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const i=e[t];return ke(i)&&!ke(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function Ae(e){return fe(e)?e:new Proxy(e,ze)}class Re{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new T(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=M-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(8&this.flags||s===this))return h(this,!0),!0}get value(){const e=this.dep.track();return b(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function Pe(e,t,n=!1){let i,s;return(0,r.Tn)(e)?i=e:(i=e.get,s=e.set),new Re(i,s,n)}const Ne={},Ee=new WeakMap;let Oe;function Ie(e,t,n=r.MZ){const{immediate:s,deep:o,once:a,scheduler:c,augmentJob:d,call:u}=n,h=e=>o?e:ge(e)||!1===o||0===o?Be(e,1):Be(e);let p,m,f,_,g=!1,b=!1;if(ke(e)?(m=()=>e.value,g=ge(e)):fe(e)?(m=()=>h(e),g=!0):(0,r.cy)(e)?(b=!0,g=e.some(e=>fe(e)||ge(e)),m=()=>e.map(e=>ke(e)?e.value:fe(e)?h(e):(0,r.Tn)(e)?u?u(e,2):e():void 0)):m=(0,r.Tn)(e)?t?u?()=>u(e,2):e:()=>{if(f){k();try{f()}finally{S()}}const t=Oe;Oe=p;try{return u?u(e,3,[_]):e(_)}finally{Oe=t}}:r.tE,t&&o){const e=m,t=!0===o?1/0:o;m=()=>Be(e(),t)}const y=i,v=()=>{p.stop(),y&&y.active&&(0,r.TF)(y.effects,p)};if(a&&t){const e=t;t=(...t)=>{e(...t),v()}}let w=b?new Array(e.length).fill(Ne):Ne;const x=e=>{if(1&p.flags&&(p.dirty||e))if(t){const e=p.run();if(o||g||(b?e.some((e,t)=>(0,r.$H)(e,w[t])):(0,r.$H)(e,w))){f&&f();const n=Oe;Oe=p;try{const n=[e,w===Ne?void 0:b&&w[0]===Ne?[]:w,_];w=e,u?u(t,3,n):t(...n)}finally{Oe=n}}}else p.run()};return d&&d(x),p=new l(m),p.scheduler=c?()=>c(x,!1):x,_=e=>function(e,t=!1,n=Oe){if(n){let t=Ee.get(n);t||Ee.set(n,t=[]),t.push(e)}}(e,!1,p),f=p.onStop=()=>{const e=Ee.get(p);if(e){if(u)u(e,4);else for(const t of e)t();Ee.delete(p)}},t?s?x(!0):w=p.run():c?c(x.bind(null,!0),!0):p.run(),v.pause=p.pause.bind(p),v.resume=p.resume.bind(p),v.stop=v,v}function Be(e,t=1/0,n){if(t<=0||!(0,r.Gv)(e)||e.__v_skip)return e;if(((n=n||new Map).get(e)||0)>=t)return e;if(n.set(e,t),t--,ke(e))Be(e.value,t,n);else if((0,r.cy)(e))for(let r=0;r<e.length;r++)Be(e[r],t,n);else if((0,r.vM)(e)||(0,r.CE)(e))e.forEach(e=>{Be(e,t,n)});else if((0,r.Qd)(e)){for(const r in e)Be(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Be(e[r],t,n)}return e}},7852:(e,t,n)=>{"use strict";n.d(t,{t:()=>i});var r=n(3923);class i extends r.K{timer_float_check=!1;constructor(e){super(e),this.init()}init(){}check_float(){const{stats:e,cubes:t}=this.root;this.timer_float_check||requestAnimationFrame(()=>{let e=!0;for(let t of this.root.scope)e=!1,t.update_area();for(let[n,r]of t.postils)r.show&&(e=!1,r.update_pos());e||this.check_float()})}}},7977:(e,t,n)=>{"use strict";n.d(t,{R:()=>r});class r{static get icons(){return{annotation:"icon-Annotation",down:"icon-cc-arrow-down-square",left:"icon-cc-arrow-left-square",right:"icon-cc-arrow-right-square",up:"icon-cc-arrow-up-square",eraser:"icon-eraser",table_merge:"icon-hebingdanyuange",table_unmerge:"icon-quxiaohebingdanyuange",img:"icon-img",table:"icon-grid",table_delete_row:"icon-shanchuhang",table_delete_col:"icon-shanchulie",table_delete_cell:"icon-list-delete-cell",table_title:"icon-a-Addheader2x",table_expand_col:"icon-expand-horizontal-1--expand-resize-bigger-horizont",table_shrink_col:"icon-shrink-horizontal-1--resize-shrink-bigger-horizont",info:"icon-info",info2:"icon-error",rename:"icon-rename",copy:"icon-copy",delete:"icon-Delete",close:"icon-close",add:"icon-add",fold:"icon-fold"}}}},8304:(e,t,n)=>{"use strict";n.d(t,{U:()=>i});var r=n(9513);class i{static in_head(e,t=0,n="none"){return{id:e,name:r.K9.cursor_in_head,offset:t,from:n}}static in_tail(e,t=0,n="none"){return{id:e,name:r.K9.cursor_in_tail,offset:t,from:n}}}},8474:(e,t,n)=>{"use strict";n.d(t,{zS:()=>s,K9:()=>o,kU:()=>a,s1:()=>l,Mu:()=>r,u0:()=>i});var r=function(e){return e.courier="courier",e.cursor="cursor",e.config="config",e.cubes="cubes",e.clipboard="clipboard",e.event="event",e.fomula="fomula",e.painter="painter",e.player="player",e.hotkeys="hotkeys",e.history="history",e.scope="scope",e.stats="stats",e}({}),i=function(e){return e.api="api",e.annotation="annotation",e.box="box",e.box_root="box-root",e.box_folder="box-folder",e.box_columns="box-columns",e.code="code",e.doc="doc",e.detail_list="detail-list",e.fomula="fomula",e.img="img",e.lost="lost",e.line="line",e.list="list",e.list_ordered="list-ordered",e.linker="linker",e.link="link",e.map="map",e.submap="submap",e.node="node",e.postil="postil",e.rt="rt",e.text="text",e.tip="tip",e.todo="todo",e.table="table",e}({}),s=function(e){return e.cube_insert_child="cube-insert-child",e.cube_delete_child="cube-delete-child",e.cube_reset="cube-reset",e.cube_delete_adjacent="cube-delete-adjacent",e.cube_set_selection_css="cube-set-selection-css",e.cube_insert="cube-insert",e.cube_delete="cube-delete",e.cube_partition="cube-partition",e.cube_reorder="cube-reorder",e.cube_set_css="cube-set-css",e.cube_set_attr="cube-set-attr",e.cube_move="cube-move",e.cube_merge="cube-merge",e.cube_postil_add="cube-postil-add",e.cube_postil_remove="cube-postil-remove",e.cube_fold="cube-fold",e.cube_resize="cube-resize",e}({}),o=function(e){return e.cursor_in_head="cursor:in-head",e.cursor_in_tail="cursor:in-tail",e}({}),a=function(e){return e.node_add="node-add",e.node_remove="node-remove",e.linker_add="linker-add",e.linker_remove="linker-remove",e}({}),l=function(e){return e.layout_update="node:layout-update",e.append_child="node:append-child",e}({})},8606:(e,t,n)=>{"use strict";n.d(t,{Ak:()=>r});let r=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[e]];return t}},8631:(e,t,n)=>{"use strict";n.d(t,{I:()=>d,J:()=>u});var r=n(8606),i=n(4116),s=n(4743),o=n(9927),a=n(9513),l=n(3028),c=n(2551);class d{static get_id(){return(0,r.Ak)()}static async sleep(e=100){return new Promise(t=>{setTimeout(t,e)})}static is_same_style(e,t){let n=new Set(Object.keys(e)),r=new Set(Object.keys(t)),i=new Set([...n,...r]);if(n.size!==i.size||n.size!==r.size)return!1;for(let r of n)if(e[r]!==t[r])return!1;return!0}static is_same_attrs(e,t){let n=new Set(Object.keys(e)),r=new Set(Object.keys(t)),i=new Set([...n,...r]);if(n.size!==i.size||n.size!==r.size)return!1;for(let r of n)if(e[r]!==t[r])return!1;return!0}async locate(e,t,n=!0){const{courier:r,history:s}=e,o=e.find_cube(t),a=c.F.tips;if(o instanceof i._D&&o.top){const e=o.top;if(o.find_upstream_untill(e)!==e.child_first){const t=r.get_recorder();t.tell(e,i.VL.fold(e.id,!1)),s.record(t)}}const l=document.getElementById(t);if(!l)return a?.tip_error("未发现书签锚点");let d=l.style.backgroundColor;l.style.backgroundColor="var(--locate-anchor-bg)",setTimeout(()=>{"var(--locate-anchor-bg)"===l.style.backgroundColor&&(l.style.backgroundColor=d)},3e3),n&&l.scrollIntoView({block:"center",behavior:"instant"})}static exports(e){const t=[];for(let n of e)t.push(n.export());return t}static build_cubes(e,t){const n=[];for(let r of e){if(!r)continue;let e=o.K.find_cube(r.type);if(e)n.push(new e(r,t));else{const e=new s.Qm(r,t,"未注册cube");n.push(e)}}return n}static get_client_rects(e){const t=document.getElementById(e);if(t)return t.getClientRects()}static pick(e,t=!1){const n=o.K.metas_cube;let r=[],i=[],l=[],c=[],d=null,u=-1,h=-1,p=e,m=[];for(let t=0;t<e.length;t++){const n=e[t];if(n.type===a.u0.box_root){p=e.slice(0,t),m=e.slice(t+1),d=n,c.push(d);break}}for(let e=0;e<p.length;e++){const t=p[e];n.get(t.type)?.block&&(u<0?u=e:h=e)}if(u>=0&&h>=0){const e=p.slice(0,u),t=p.slice(h+1),o=[];let a=s.gK.get_default();a.info=[];for(let e of p.slice(u,h+1))n.get(e.type)?.block?(o.push(e),a.info.length>0&&(o.push(a),a=s.gK.get_default(),a.info=[])):a.info.push(e);r=e,i=o,l=t}else u>=0&&h<0?(r=p.slice(0,u),i=p.slice(u,u+1),l=p.slice(u+1)):(r=p,i=[],l=[]);if(d){let e=s.gK.get_default();e.info=[];for(let t of m)t.type===a.u0.box_root?(d=t,c.push(t)):n.get(t.type)?.block?(t.type===a.u0.box?d.info.push(...t.info):d.info.push(t),e.info.length>0&&d&&(d.info.push(e),e=s.gK.get_default())):e.info.push(t);e.info.length>0&&d&&d.info.push(e)}const f=[];if(r.length>0&&f.push(s.gK.get_default(r)),i.length>0&&f.push(...i),l.length>0&&f.push(s.gK.get_default(l)),c.length>0)if(t)for(let e of c)f.push(...e.info);else f.push(...c);return{head:r,body:i,tail:l,root:c,sort:f}}static find_line(e,t="first"){if(e instanceof s.gK)return e;const n=o.K.metas_cube.get(e.type);if(!n||!n.block)return;const r="first"===t?e.children:e.children.reverse();for(let e of r){let n=this.find_line(e,t);if(n)return n}}static filter_out_empty(e){return e.filter(e=>!s.P6.is_empty_text(e))}static get_flat_cube(e,t=!0){const n=e.children,r=[];if(t)for(let e of n)r.push(e),r.push(...this.get_flat_cube(e));else{r.push(...n);for(let e of r)r.push(...e.children)}return r}static replace_id(e,t,n={}){const r=[];for(let i of t){const t=o.K.find_cube(i.type);t&&t.replace_id&&r.push(t.replace_id(e,i,n))}return r}static insert_cubes(e,t){const{courier:n,history:r,cursor:s}=e,{cube_selection:o,cube_start:a,cube_end:c,offset_end:d,offset_start:u}=s;if(!o||!a||!c)return;const h=new l.vk(n);s.has_selection&&h.tell(o,i.VL.delete(o.id,"backward",a.id,c.id,u,d)),h.tell(a,i.VL.insert(a.id,t,a.id,a.id,u,u)),r.record(h)}static check_mouse_key(e,t){let n={left:{pointermove:{button:-1,buttons:1},pointerdown:{button:0,buttons:1},pointerup:{button:0,buttons:0}},right:{pointermove:{button:-1,buttons:2},pointerdown:{button:2,buttons:2},pointerup:{button:2,buttons:0}},mid:{pointermove:{button:-1,buttons:4},pointerdown:{button:1,buttons:4},pointerup:{button:1,buttons:0}}}[t][e.type];return e.button==n.button&&e.buttons==n.buttons}}class u{ps;resolve;reject;constructor(){this.ps=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}},9204:(e,t,n)=>{"use strict";n.d(t,{_:()=>m});var r=n(7633),i=n(9513),s=n(3097),o=n(2519),a=n(8631),l=n(3028),c=n(3447),d=n(8304),u=n(4743),h=n(2332),p=n(9390);class m extends s.j{_children=(0,r.Gc)([]);_has_postil=(0,r.KR)(!1);postil=null;pcube;data;constructor(e,t){super(),this.pcube=t}get domain(){return"doc"}get text(){let e="";for(let t of this.children)e+=t.text,t instanceof u.gK&&(e+="\n");return this instanceof u.gK&&(e+="\n"),e}get top(){let e=this;for(;e;){if(e.pcube instanceof h.M)return e;e=e.pcube}return e}get is_empty(){const e=this.children;return 0===e.length||1===e.length&&this.child_first.is_empty}get children(){return[...this._children]}get has_postil(){return this._has_postil.value}set has_postil(e){this._has_postil.value=e}get dom(){return document.getElementById(this.id)}get level(){return this.pcube.level+1}get host_postil(){return this instanceof u.$u?this:this.pcube.host_postil}get host_node(){let e=this.pcube;for(;e&&e instanceof m;){if("map"===e.domain&&e instanceof p.w)return e;e=e.pcube}}get in_postil(){return this instanceof u.$u||this.pcube.in_postil}get child_count(){return this.children.length}get child_first(){return this.children[0]}get child_last(){return this.children[this.children.length-1]}get pid(){return this.pcube.id}get id(){return this.data.id}get css(){return this.data.css||(this.data.css={}),{...this.data.css,"margin-left":this.attrs.indent>0?this.attrs.indent*this.root.config.data.line_indent+"px":"0px"}}get attrs(){return this.data.attrs||(this.data.attrs={}),this.data.attrs}get info(){return this.data.info}get type(){return this.data.type}get root(){return this.pcube.root}get courier(){return this.root.courier}get config(){return this.root.config}get history(){return this.root.history}get hotkeys(){return this.root.hotkeys}get cursor(){return this.root.cursor}get event(){return this.root.event}get clipboard(){return this.root.clipboard}get painter(){return this.root.painter}get cubes(){return this.root.cubes}get stats(){return this.root.stats}get versions(){return this.root.versions}get clientRect(){return this.dom?.getBoundingClientRect()}get clientRects(){return this.dom?.getClientRects()}get prev_cube(){return this.pcube.find_prev_cube(this.id)}get next_cube(){return this.pcube.find_next_cube(this.id)}get prev_cube_deep(){let e=this;for(;e;){let t=e.prev_cube;if(t instanceof m)return t;e=e.pcube}}get next_cube_deep(){let e=this;for(;e;){let t=e.next_cube;if(t instanceof m)return t;e=e.pcube}}get index(){return this.pcube?this.pcube.find_child_index(this.id):0}_setup(){this.set_cmd_handler(i.zS.cube_set_selection_css,this.on_cube_set_selection_css.bind(this)),this.set_cmd_handler(i.zS.cube_insert,this.on_insert.bind(this)),this.set_cmd_handler(i.zS.cube_delete,this.on_cube_delete.bind(this)),this.set_cmd_handler(i.zS.cube_set_css,this.on_cube_set_css.bind(this)),this.set_cmd_handler(i.zS.cube_set_attr,this.on_cube_set_attr.bind(this)),this.set_cmd_handler(i.zS.cube_delete_adjacent,this.on_cube_delete_adjacent.bind(this)),this.set_cmd_handler(i.zS.cube_postil_add,this.on_postil_add.bind(this)),this.set_cmd_handler(i.zS.cube_postil_remove,this.on_postil_remove.bind(this)),this.set_cmd_handler(i.K9.cursor_in_head,this.on_cursor_in_head.bind(this)),this.set_cmd_handler(i.K9.cursor_in_tail,this.on_cursor_in_tail.bind(this)),o.o.init_cmd_handler(this)}setup(e,t){let n;try{n=structuredClone((0,r.ux)(e))}catch(n){return new u.Qm(e,t,"克隆数据失败")}if(!n)return new u.Qm(e,t,"克隆数据为空");try{const i=this.update_data(n);if(!i.data)return new u.Qm(e,t,"升级后数据为空");if(!i.usable)return new u.Qm(e,t,"高版本数据,请升级软件");this.data=(0,r.Kh)(i.data),this._setup(),this.build_child(i.data),this.cubes.add_cube(this)}catch(n){return new u.Qm(e,t,"数据升级失败")}return this}create_child_block(e){const t=a.I.pick(e);return a.I.build_cubes(t.sort,this)}gc(){this.base_gc()}base_gc(){this.cubes.remove_cube(this);for(let e of this.children)e.gc()}base_export(){const e=structuredClone((0,r.ux)(this.data));return this.postil&&(e.attrs.postil=this.postil.export()),e}copy(e,t){const n=this.children.slice(e,t),r=[];for(let e of n){let t=e.export();r.push(t)}return r}get_upstream_sum_scale(){const e=[];let t=this.pcube;for(;t&&((t instanceof u.gv||t instanceof u.EU)&&e.push(t),t.pcube);)t=t.pcube;let n=1,r=1;for(let t of e){const{a:e,d:i}=t.matrix2d;n*=e,r*=i}return{sx:n,sy:r}}delete_edge(e,t){const{courier:n}=this,r=new l.vk(n);if("backward"===t){const t=e.prev_cube_deep,n=t?.next_cube;let i=e.pcube;if(i.is_empty&&i instanceof m){const e=i.prev_cube_deep;return r.merge(i.remove_self()),e&&r.tell(e,d.U.in_tail(e.id)),r}if(t&&t.is_empty)return r.merge(t.remove_self()),n&&r.tell(n,d.U.in_head(n.id)),r;if(n&&t.type===n.type)return r.merge(n.merge("left"));if(t)return r.tell(t,d.U.in_tail(t.id))}else{const t=e.next_cube_deep,n=t?.prev_cube;let i=e.pcube;for(;i&&i!==this;){const e=i.next_cube_deep;if(i.is_empty&&i instanceof m)return r.merge(i.remove_self()),e&&r.tell(e,d.U.in_head(e.id)),r;i=i.pcube}if(t&&t.is_empty)return r.merge(t.remove_self()),n&&r.tell(n,d.U.in_tail(n.id)),r;if(n&&t.type===n.type)return r.merge(t.merge("left"));if(t)return r.tell(t,d.U.in_tail(t.id))}}remove_self(e="backward"){const{pcube:t,courier:n,index:r}=this,i=new l.vk(n);return i.tell(t,c.V.delete_child(t.id,e,[r,r+1])),i}merge(e){const{pcube:t,cursor:n,courier:r}=this,{cube_end:i,offset_end:s}=n;if(!i)return;const o=r.get_recorder();return o.tell(this,c.V.merge(this.id,e,i.id,s)),o}find_cube(e){if(e===this.id)return this;for(let t of this.children){if(t.id===e)return t;const n=t.find_cube(e);if(n)return n}}filter(e){const t=[];e(this)&&t.push(this);for(let n of this.children)e(n)&&t.push(n),t.push(...n.filter(e));return t}each(e){for(let t of this.children)e(t),t.each(e)}find_dom_cube(e){let t=e instanceof Element?e:e.parentElement;const n=[];for(;t;){if(t.id){let e;if(n.push(t.id),e=this.find_cube(t.id),e)return e}t=t.parentElement}}is_contains_cube(e){if(e===this)return!0;let t=e;for(;t;){if(t.pcube===this)return!0;t=t.pcube}return!1}find_upstream_untill(e){if(!e.is_contains_cube(this))return;let t=this;for(;t;){if(t instanceof m&&t.pcube===e)return t;t=t.pcube}}find_upstream_target(e){let t=this;for(;t instanceof m;)if(t=t.pcube,e(t))return t}find_child_cube(e){return this.children.find(t=>t.id===e)}find_child_index(e){return this.children.findIndex(t=>t.id===e)}find_next_cube(e){const t=this.find_child_index(e);return this.children[t+1]}find_prev_cube(e){const t=this.find_child_index(e);return this.children[t-1]}on_cube_set_selection_css(e){const{cursor:t,courier:n}=this,{css:r,start_id:i,end_id:s,offset_end:o,offset_start:a,toggle:d,replace:u}=e,h=new l.vk(n);if(i!==s||o!==a){if(s&&!i){const e=this.find_cube(s),t=e?.find_upstream_untill(this);if(!t)return;const n=this.children.slice(0,t.index);for(let e of n)h.tell(e,c.V.set_selection_css(e.id,r,e.id,e.id,"head","tail",d,u));return h.tell(t,c.V.set_selection_css(t.id,r,null,s,"head",o,d,u)),h}if(i&&!s){const e=this.find_cube(i),t=e?.find_upstream_untill(this);if(!t)return;const n=this.children.slice(t.index+1);for(let e of n)h.tell(e,c.V.set_selection_css(e.id,r,e.id,e.id,"head","tail",d,u));return h.tell(t,c.V.set_selection_css(t.id,r,i,null,a,"tail",d,u)),h}if("tail"===o&&"head"===a){for(let e of this.children)h.tell(e,c.V.set_selection_css(e.id,r,e.id,e.id,"head","tail",d,u));return h}if(s&&i){const e=this.find_cube(i),t=this.find_cube(s),n=e?.find_upstream_untill(this),l=t?.find_upstream_untill(this);if(!n||!l)return;const p=this.children.slice(n.index+1,l.index);for(let e of p)h.tell(e,c.V.set_selection_css(e.id,r,e.id,e.id,"head","tail",d,u));return h.tell(n,c.V.set_selection_css(n.id,r,i,null,a,"tail",d,u)),n!==l&&h.tell(l,c.V.set_selection_css(l.id,r,null,s,"head",o,d,u)),h}}}on_insert(e){if(0===e.data.length)return;const{courier:t,cursor:n,pid:r}=this,i=new l.vk(t),{data:s,end_id:o,start_id:a,offset_end:u,offset_start:h}=e,p=this.find_cube(a),m=this.find_cube(o),f=p?.find_upstream_untill(this),_=m?.find_upstream_untill(this);if(!f||!_)return i;if(m!==p||h!==u)if(f&&f===_)i.tell(f,c.V.delete(f.id,"backward",a,o,h,u)),i.tell(f,c.V.insert(f.id,s,a,o,h,u));else{i.tell(_,c.V.delete(_.id,"backward",null,o,"head",u)),i.tell(this,c.V.delete_child(this.id,"backward",[f.index+1,_.index])),i.tell(this,c.V.insert_child(this.id,s,f.index+1)),i.tell(f,c.V.delete(f.id,"backward",a,null,h,"tail"));let e=s[s.length-1];const t=this.top.find_cube(e.id);t&&i.tell(t,d.U.in_tail(e.id,0))}else i.tell(m,c.V.insert(o,s,a,o,h,u));return i}on_cube_delete(e){const{courier:t,cursor:n}=this,{dir:r,start_id:i,end_id:s,offset_end:o,offset_start:a,reserve:d}=e,h=new l.vk(t);if(!i&&s){const e=this.find_cube(s),t=e?.find_upstream_untill(this);if(!t||!e)return;return h.tell(this,c.V.delete_child(this.id,r,[0,t.index],d)),h.tell(t,c.V.delete(t.id,r,i,s,"head",o,d)),h}if(i&&!s){const e=this.find_cube(i),t=e?.find_upstream_untill(this);if(!t||!e)return;return h.tell(this,c.V.delete_child(this.id,r,[t.index+1,this.child_count],d)),h.tell(t,c.V.delete(t.id,r,i,s,a,o,d)),h}if("head"===a&&"tail"===o){if(d){if(this.is_empty)return;h.tell(this,c.V.delete_child(this.id,r,[1,this.child_count]));const e=this.child_first;e.meta.block?h.tell(e,c.V.delete_child(e.id,r,[0,e.child_count],d)):e instanceof u.P6?h.tell(e,u.zl.reset(e.id,"",1,1)):h.tell(e,c.V.reset(e.id,[]))}else h.tell(this.pcube,c.V.delete_child(this.pid,"backward",[this.index,this.index+1]));return h}if(i&&s){const e=this.find_cube(i),t=this.find_cube(s);if(!e||!t)return;const n=e.find_upstream_untill(this),l=t.find_upstream_untill(this);if(!n||!l)return h;const d=n.index,p=l.index;if(i!==s||a!==o)if(n===l)h.tell(n,c.V.delete(n.id,r,i,s,a,o,!0));else if(h.tell(l,c.V.delete(l.id,r,null,s,"head",o)),h.tell(this,c.V.delete_child(this.id,"backward",[d+1,p])),h.tell(n,c.V.delete(n.id,r,i,null,a,"tail",!0)),e instanceof u.P6){const t=e.get_valid_index(a);e.set_cursor_in_head(t)}return h}}on_cube_set_css(e){const{courier:t,cursor:n}=this,{css:i,toggle:s,replace:o}=e,a=t.get_recorder();if(a.add_cmd(e),o){const e=structuredClone((0,r.ux)(this.css));return this.data.css=i,a.add_recover(c.V.set_css(this.id,e,!1,!0)),a}if(0===Object.keys(i).length)return;let l=!0;const d=structuredClone((0,r.ux)(this.css)),u=structuredClone((0,r.ux)(this.css));for(let e in i){const t=i[e],n=this.css[e]||null;d[e]=n,null===t||s&&t===n?(l=!1,delete u[e]):t!==n&&(l=!1,u[e]=t)}return this.data.css=u,l?void 0:(a.add_recover(c.V.set_css(this.id,d)),a)}on_cube_set_attr(e){const{courier:t,cursor:n}=this,{attr:i}=e,s=t.get_recorder();if(s.add_cmd(e),0===Object.keys(i).length)return;const o={};for(let e in i){const t=i[e];o[e]=structuredClone((0,r.ux)(this.attrs[e]))||null,null===t?delete this.data.attrs[e]:this.data.attrs[e]=t}return s.add_recover(c.V.set_attr(this.id,o)),s}on_cube_delete_adjacent(e){const{courier:t,pcube:n,pid:r,index:i}=this,{from:s,from_id:o,offset:a}=e,u=new l.vk(t);if(this.meta.block){const e=this.child_first,t=this.child_last;this.is_empty&&u.tell(n,c.V.delete_child(r,"backward",[this.index,this.index+1])),"left"===s?u.tell(e,d.U.in_head(e.id,0,s)):u.tell(t,d.U.in_tail(t.id,0,s))}else u.tell(n,c.V.delete_child(r,"backward",[this.index,this.index+1]));return u}on_postil_add(e){const{courier:t}=this,{data:n}=e;if(this.postil){const e=new l.vk(t),r=this.postil;return e.tell(r,c.V.insert_child(r.id,n,r.child_count)),this.has_postil=!0,this.postil.show=!0,e}{const r=t.get_recorder();r.add_cmd(e);const i=u.$u.get_default(n),s=new u.$u(i,this);return this.postil=s,r.add_recover(c.V.postil_remove(this.id,[0,s.child_count])),this.postil.show=!0,this.has_postil=!0,r}}on_postil_remove(e){const{courier:t}=this,{range:n}=e,[r,i]=n,s=this.postil;if(!s)return;let o=r<0?0:r,a=i>s.child_count?s.child_count:i;if(o<=0&&a>=s.child_count){const n=t.get_recorder();n.add_cmd(e);const r=s.export();return n.add_recover(c.V.postil_add(this.id,r.info)),this.postil=null,this.has_postil=!1,s.gc(),n}{const e=new l.vk(t);return e.tell(s,c.V.delete_child(s.id,"backward",[o,a])),e}}on_cursor_in_head(e){const{offset:t,from:n}=e,{courier:r,prev_cube:i,pcube:s,next_cube:o}=this,a=new l.vk(r);if(this.meta.block){const e=this.child_first;if(!e)return a;a.tell(e,d.U.in_head(e.id,t))}else if(this instanceof u.P6)this.set_cursor_in_head(t);else if("none"===n||"right"===n)if(i&&i instanceof u.P6)i.set_cursor_in_tail();else{const e=u.P6.get_default();a.tell(s,c.V.insert_child(s.id,[e],this.index))}else if("left"===n)if(o&&o instanceof u.P6)o.set_cursor_in_head();else{const e=u.P6.get_default();a.tell(s,c.V.insert_child(s.id,[e],this.index+1))}return a}on_cursor_in_tail(e){const{offset:t,from:n}=e,{courier:r,prev_cube:i,pcube:s,next_cube:o}=this,a=new l.vk(r);if(this.meta.block){const e=this.child_last;if(!e)return a;a.tell(e,d.U.in_tail(e.id,t))}else if(this instanceof u.P6)this.set_cursor_in_tail(t);else if("none"===n||"left"===n)if(o&&o instanceof u.P6)o.set_cursor_in_head();else{const e=u.P6.get_default();a.tell(s,c.V.insert_child(s.id,[e],this.index+1))}else if("right"===n)if(i&&i instanceof u.P6)i.set_cursor_in_tail();else{const e=u.P6.get_default();a.tell(s,c.V.insert_child(s.id,[e],this.index))}return a}get_valid_index(e){return"head"===e?0:"tail"===e?this.child_count:e<0?0:e>this.child_count?this.child_count:e}get_valid_range(e){let[t,n]=e;return t<0&&(t=0),n>this.child_count&&(n=this.child_count),[t,n]}}},9390:(e,t,n)=>{"use strict";n.d(t,{w:()=>g});var r=n(7633),i=n(4089),s=n(4743),o=n(9513),a=n(7552),l=n(3028),c=n(8631),d=n(3447),u=n(8304),h=n(1068);class p{static layout_tree(e,t,n){if(0==e.count_to)return;const r=e.layout_type;return"right"===r?this.right(e,t,n):"left"===r?this.left(e,t,n):"down"===r?this.down(e,t,n):"up"===r?this.up(e,t,n):"time-down"===r?this.time_down(e,t,n):"time-right"===r?this.time_right(e,t,n):void this.layout_downstream(e,t,n)}static layout_downstream(e,t,n){for(let e of t)e.layout(n)}static right(e,t,n){const{map_node_hgap:r,map_node_vgap:i}=e.config.data,s=e.bound,{pos_tree:o,size_bound:a,size_tree:l}=s;let c=o.x+r+a.width,d=o.y,u=0;for(let e=0;e<t.length;e++){const r=t[e],s=r.bound;s.update_pos_tree(c,d+u+e*i),u+=s.size_tree.height,r.layout(n)}}static left(e,t,n){const{map_node_hgap:r,map_node_vgap:i}=e.config.data,s=e.bound,{pos_tree:o,size_bound:a,size_tree:l}=s;let c=o.x+l.width-a.width-r,d=o.y,u=0;for(let e=0;e<t.length;e++){const r=t[e],s=r.bound;s.update_pos_tree(c-s.size_tree.width,d+u+e*i),u+=s.size_tree.height,r.layout(n)}}static down(e,t,n){const{map_node_hgap:r,map_node_vgap:i}=e.config.data,s=e.bound,{pos_tree:o,size_bound:a,size_tree:l}=s;let c=o.x,d=o.y+i+a.height,u=0;for(let e=0;e<t.length;e++){const i=t[e],s=i.bound;s.update_pos_tree(c+u+e*r,d),u+=s.size_tree.width,i.layout(n)}}static up(e,t,n){const{map_node_hgap:r,map_node_vgap:i}=e.config.data,s=e.bound,{pos_tree:o,size_bound:a,size_tree:l}=s;let c=o.x,d=o.y+l.height-a.height-i,u=0;for(let e=0;e<t.length;e++){const i=t[e],s=i.bound;s.update_pos_tree(c+u+e*r,d-s.size_tree.height),u+=s.size_tree.width,i.layout(n)}}static time_right(e,t,n){const{map_node_hgap:r,map_node_vgap:i}=e.config.data,s=e.bound,{pos:o,size_bound:a,size_tree:l,pos_tree:c}=s,{sum_tree_height:d,sum_tree_width:u,max_tree_height:h,max_tree_width:p,mw_rect:m,mh_rect:f}=e.bound.stat_downstream_nodes_size(t);Math.max(f.height,a.height);let _=o.x+a.width+r,g=o.y+a.height/2,b=0;for(let e=0;e<t.length;e++){const i=t[e],s=i.bound,{size_bound:o,size_tree:a}=s,l=i.attrs.layout;"right"===l||"left"===l?s.update_pos_tree(_+b+e*r,g-a.height/2):"up"===l?s.update_pos_tree(_+b+e*r,g-(a.height-o.height/2)):s.update_pos_tree(_+b+e*r,g-o.height/2),b+=s.size_tree.width,i.layout(n)}}static time_down(e,t,n){const{map_node_hgap:r,map_node_vgap:i}=e.config.data,s=e.bound,{pos_tree:o,pos:a,size_bound:l,size_tree:c}=s,{sum_tree_height:d,sum_tree_width:u,max_tree_height:h,max_tree_width:p,mw_rect:m,mh_rect:f}=e.bound.stat_downstream_nodes_size(t);Math.max(m.width,l.width);let _=a.x+l.width/2,g=a.y+l.height+i,b=0;for(let e=0;e<t.length;e++){const r=t[e],s=r.bound,o=r.attrs.layout,{size_bound:a,size_tree:l}=s;"left"===o?s.update_pos_tree(_-(l.width-a.width/2),g+b+e*i):"down"===o||"up"===o?s.update_pos_tree(_-l.width/2,g+b+e*i):s.update_pos_tree(_-a.width/2,g+b+e*i),b+=s.size_tree.height,r.layout(n)}}}var m=n(722),f=n(3682),_=n(2698);class g extends _.M{_editable=(0,r.KR)(!1);_waiter=new Set;_layout_self_success=!1;_show=!1;bound;data;pcube;icons={right:"icon-right iconfont",left:"icon-left iconfont",up:"icon-up iconfont",down:"icon-down iconfont","time-down":"icon-time-down iconfont","time-right":"icon-time-right iconfont"};shape=(0,r.Kh)({type:"rect",path:"",sample:[]});constructor(e,t){super(e,t),this.pcube=t,this._init_handler(),this.bound=new s.yI(this,e.attrs.matrix2d||a.c.get_default()),this.shape.type=e.attrs.shape||"rect"}_init_handler(){this.set_cmd_handler(o.zS.cube_reset,this.on_reset.bind(this)),this.set_cmd_handler(o.zS.cube_insert,this.on_cube_insert.bind(this)),this.set_cmd_handler(o.zS.cube_reorder,this.on_cube_reorder.bind(this)),this.set_cmd_handler(o.zS.cube_delete_child,this.on_delete_cube.bind(this)),this.set_cmd_handler(o.zS.cube_insert_child,this.on_insert_child.bind(this)),this.set_cmd_handler(o.s1.append_child,this.on_append_child.bind(this)),this.set_cmd_handler(o.s1.layout_update,this.on_layout_update.bind(this))}get matrix2d(){return this.attrs.matrix2d}get rect(){return this.bound.get_rect()}get show(){return this._show}set show(e){this._show=e,e?this.pcube.set_graph_visible(this,!0):this.pcube.set_graph_visible(this,!1)}_layout_line=(0,i.EW)(()=>this.get_layout_line());_layout_from=(0,i.EW)(()=>this.get_layout_from());_upstream_fold=(0,i.EW)(()=>{const e=this.layout_line;for(let t of e.slice(0,-1))if(t.attrs.fold)return!0;return!1});_layout_nodes=(0,i.EW)(()=>this.get_layout_nodes());_layout_downstream_nodes=(0,i.EW)(()=>this.get_layout_downstream_nodes());_layout_upstream=(0,i.EW)(()=>{if(this.is_layout_root||0===this.count_from)return;const e=this.layout_line;return!e||e.length<2?void 0:e[e.length-2]});_sample=(0,i.EW)(()=>{if(this.is_layout_root||!this.layout_upstream){const e={x:this.matrix2d.e,y:this.matrix2d.f};return a.U.offset_points(this.shape.sample,e)}return a.U.offset_points(this.shape.sample,this.bound.pos)});get layout_upstream(){return this._layout_upstream.value}get layout_downstream_nodes(){return[...this._layout_downstream_nodes.value]}get layout_line(){return[...this._layout_line.value]}get upstream_fold(){return this._upstream_fold.value}get layout_root(){return this.layout_line?.[0]}get layout_nodes(){return this._layout_nodes.value}get is_captive(){return!this.is_layout_root&&!!this.layout_root?.attrs.layout&&!!this.layout_upstream}get layout_self_success(){return this._layout_self_success}get attrs(){return this.data.attrs}get path(){return this.shape.path}get index(){return this.layout_upstream?this.layout_upstream.layout_nodes.indexOf(this):0}get prev_node(){if(!this.layout_upstream)return;const e=this.index;return this.layout_upstream.layout_nodes[e-1]}get next_node(){if(!this.layout_upstream)return;const e=this.index;return this.layout_upstream.layout_nodes[e+1]}get sample_count(){return 8}get sample(){return this._sample.value}get editable(){return this._editable.value}set editable(e){e?this.pcube.register_node_editing(this):this.pcube.remove_node_editing(this),this._editable.value=e;const t=this.courier.get_recorder(),n=this.child_last,r=u.U.in_tail(n.id,0);t.tell(n,r),this.history.record(t)}get is_layout_root(){return this.attrs.root||!1}get domain(){return"map"}get node_level(){return this.is_layout_root||!this.layout_upstream?0:this.layout_line.length-1}get from(){const e=this.pcube.get_node_from(this.id);return new Set(e||[])}get to(){const e=this.pcube.get_node_to(this.id);return new Set(e||[])}get node_last(){const e=this.pcube.get_node_to(this.id),t=e?e[e.length-1]:this.id;return this.pcube.get_node(t)||this}get count_from(){return this.from.size}get count_to(){return this.to.size}get nodes_to(){const e=[];for(let t of this.to){const n=this.pcube.find_child_cube(t);n&&n instanceof g&&e.push(n)}return e}get nodes_from(){const e=[];for(let t of this.from){const n=this.pcube.find_child_cube(t);n&&n instanceof g&&e.push(n)}return e}get layout_type(){return this.attrs.layout||this.is_layout_root?this.attrs.layout||null:this.layout_from.get_downstream_layout_type(this)}get layout_from(){return this._layout_from.value}get matrix2d_dom_string(){const{a:e,b:t,c:n,d:r,e:i,f:s}=this.matrix2d;if(this.is_layout_root||!this.layout_upstream)return a.c.get_dom_string(this.matrix2d);{const i=this.bound.pos;return`matrix(${e.toFixed(1)},${t},${n},${r.toFixed(1)},${i.x.toFixed(1)},${i.y.toFixed(1)})`}}get matrix2d_real(){const{a:e,b:t,c:n,d:r,e:i,f:s}=this.matrix2d;if(this.is_layout_root||!this.layout_upstream)return{...this.matrix2d};{const i=this.bound.pos;return{a:e,b:t,c:n,d:r,e:i.x,f:i.y}}}get_layout_downstream_nodes(){const e=[...this.layout_nodes];for(let t of e)e.push(...t.layout_nodes);return e}get_node_layout_env(){const e=this.layout_upstream;if(!e)return;const t=e.layout_nodes,n=t.indexOf(this);return n<0?void 0:{prev:t[n-1],next:t[n+1],index:n}}get_upstream_sum_scale(){const e=[];let t=this.pcube;for(;t&&((t instanceof s.gv||t instanceof s.EU)&&e.push(t),t.pcube);)t=t.pcube;let n=1,r=1;for(let t of e){const{a:e,d:i}=t.matrix2d;n*=e,r*=i}return{sx:n,sy:r}}move_to_center(){const e=this.pcube.get_view_center(),t=this.pcube.transform_point(e),n=this.bound.pos_center,r=this.pcube.real_point_to_fig(n),i=t.x-r.x,s=t.y-r.y,o=a.c.multiply(this.pcube.matrix2d,a.c.get_matrix_translate(i,s));this.pcube.reset_matrix(o)}move_in_fig_view(){if(this.check_in_fig_view(!0))return;const e=this.pcube,t=e.get_view_rect(),{dx:n,dy:r}=h.MathRect.move_rect_in_other(this.bound.rect,t),i=a.c.multiply(e.matrix2d,a.c.get_matrix_translate(n,r));e.reset_matrix(i),e.check_show()}check_in_fig_view(e=!1){const t=this.pcube.get_view_rect();return e?h.MathRect.can_contain(t,this.rect):h.MathRect.check_intersection(t,this.rect)}layout(e){if(this.layout_type||this.is_layout_root){const t=this.get_layout_nodes();p.layout_tree(this,t,e);for(let n of t)n.check_show(e);this.is_layout_root&&this.pcube.has_layout&&this.pcube.check_show_line()}}layout_throttle=h.Notice.throttle(this.layout.bind(this),100);layout_self(e){const t=e.borderBoxSize[0];if(!t)return;const{blockSize:n,inlineSize:r}=t,i=this.bound.size;if(this.layout_self_success&&i.width===Math.ceil(r)&&i.height===Math.ceil(n))return;this._layout_self_success=!0;const o={width:Math.ceil(r),height:Math.ceil(n)};if(this.bound.update_size(o.width,o.height),this.shape.path=s.AG.get_shaple(this),this.shape.sample=this.get_sample(),!this.layout_upstream){const e=this.pcube.get_view_rect();this.check_show(e)}for(let e of this._waiter)e()}wait_layout_self(){return new Promise(e=>{this._layout_self_success?e(!0):this._waiter.add(e)})}check_show(e){return this.upstream_fold||this.pcube.perf&&!h.MathRect.check_intersection(e,this.rect)?this.show=!1:this.show=!0}check_show_line(){const e=this.id;for(let t of this.to){const n=a.U.get_linker_id(e,t),r=this.pcube.get_linker(n);r&&(this.attrs.fold?r.show=!1:r.to_node?.show||this.show?r.show=!0:r.show=!1)}for(let t of this.from){const n=a.U.get_linker_id(t,e),r=this.pcube.get_linker(n);r&&(this.show||r.from_node?.show?r.show=!0:r.show=!1)}}get_downstream_layout_type(e){const t=this.attrs.layout;if(!t)return null;if(e===this)return t;if(["down","up","left","right"].includes(t))return t;const n=e.node_level-this.node_level;return"time-right"===t?1===n?"time-down":"right":"time-down"===t?"right":t}get_sample(){if("rect"===this.shape.type){const e={x:0,y:0,...this.bound.size_bound},t=h.MathRect.get_rect_point;return[t(e,h._RectPosition.left_top),t(e,h._RectPosition.top_mid),t(e,h._RectPosition.right_top),t(e,h._RectPosition.right_mid),t(e,h._RectPosition.right_bottom),t(e,h._RectPosition.bottom_mid),t(e,h._RectPosition.left_bottom),t(e,h._RectPosition.left_mid),t(e,h._RectPosition.left_top)]}return a.U.svg_path_sample(this.shape.path,this.sample_count)}splice(e,t,...n){const r=this._children.splice(e,t,...n);for(let e of r)e.gc();const i=[];for(let e of r)i.push(e.export());return{children:r,data:i}}reset_matrix(e){Object.assign(this.matrix2d,e)}get_node(e){if(e)return this.pcube.get_node(e)}get_layout_line(){const e=a.U.find_line_to_layout_root(this);return e.has_root?e.line.toReversed():[]}get_layout_nodes(){const e=[],t=this.layout_line;if(!t)return e;const n=new Set([...t].map(e=>e.id));for(let t of this.to){if(n.has(t))continue;const r=this.get_node(t);r?r.layout_upstream===this&&e.push(r):this.to.delete(t)}return e}get_layout_index(e){return e.indexOf(this)}get_layout_from(){if(this.attrs.layout)return this;const e=this.layout_line;if(!e)return this;for(let t of e.reverse())if(t.is_layout_root||t.attrs.layout)return t;return this}translate(e,t){const n=a.c.translate(this.matrix2d,e,t);this.reset_matrix(n)}break_link_node(e){this.from.delete(e),this.to.delete(e)}remove_self(){for(let e of this.from){const t=this.pcube.find_child_cube(e);t&&t instanceof g&&t.break_link_node(this.id)}for(let e of this.to){const t=this.pcube.find_child_cube(e);t&&t instanceof g&&t.break_link_node(this.id)}return super.remove_self()}find_dom_cube(e){let t=e instanceof Element?e:e.parentElement;const n=[];for(;t;){if(t.id){let e;if(n.push(t.id),e=this.find_cube(t.id),e)return e}t=t.parentElement}}on_reset(e){const{courier:t}=this,{data:n}=e,r=t.get_recorder();r.add_cmd(e);const i=this.export().info,s=c.I.build_cubes(n,this);return this.splice(0,this.child_count,...s),r.add_recover(d.V.reset(this.id,i)),r}on_cube_reorder(e){const{courier:t,history:n,cursor:r}=this,{cubeid:i,index:s}=e,o=this.find_child_cube(i);if(!o||o.index===s)return;const a=new l.vk(t);let c=0,u=o.index;return"tail"===s?c=this.child_count:"number"==typeof s&&(c=s),this.splice(u,1),this.splice(c,0,o),a.add_recover(d.V.reorder(this.id,o.id,u)),a}on_insert_child(e){const{courier:t}=this,n=t.get_recorder();n.add_cmd(e);const{pos:r,data:i}=e;if(0===i.length)return n;const a=[];for(let e of i)e.type===o.u0.box_root&&a.push(new s.HR(e,this));let l=this.get_valid_index(r);this.splice(l,0,...a);const c=a[a.length-1];return c&&n.tell(c,u.U.in_tail(c.id,0)),n.add_recover(d.V.delete_child(this.id,"backward",[l,l+a.length])),n}on_delete_cube(e){const{courier:t,pcube:n,pid:r}=this,{dir:i,range:o}=e,[a,l]=o,c=t.get_recorder();c.add_cmd(e);const h=this.children[a-1],p=this.children[l],m=l-a;if(a!==l){if(a<=0&&l>=this.child_count){this.child_first,c.tell(this,d.V.reset(this.id,[]));const e=d.V.insert_child(this.id,[s.HR.get_default()],0);return c.tell(this,e),c}{let e=this.splice(a,m);h&&"backward"===i||!p?c.tell(h,u.U.in_tail(h.id,0)):(p&&"forward"===i||!h)&&c.tell(p,u.U.in_head(p.id,0));const t=e.data;c.add_recover(d.V.insert_child(this.id,t,a))}return c}}on_cube_insert(e){if(0===e.data.length)return;const{courier:t,cursor:n,pid:r,pcube:i}=this,s=new l.vk(t),{data:o,end_id:a,start_id:c,offset_end:h,offset_start:p}=e,m=this.find_cube(c),f=this.find_cube(a),_=m?.find_upstream_untill(this),g=f?.find_upstream_untill(this);if(!_||!g)return s;if(f!==m||p!==h)if(_&&_===g)s.tell(_,d.V.delete(_.id,"backward",c,a,p,h)),s.tell(_,d.V.insert(_.id,o,c,a,p,h));else{s.tell(g,d.V.delete(g.id,"backward",null,a,"head",h)),s.tell(this,d.V.delete_child(this.id,"backward",[_.index+1,g.index])),s.tell(this,d.V.insert_child(this.id,e.data,_.index+1)),s.tell(_,d.V.delete(_.id,"backward",c,null,p,"tail"));let t=e.data[e.data.length-1];if(t){const e=this.find_child_cube(t.id);e&&s.tell(e,u.U.in_tail(t.id,0))}}else s.tell(f,d.V.insert(a,o,c,a,p,h));return s}on_layout_update(e){const{courier:t,history:n}=this,{attrs:i}=e,s=t.get_recorder(),o=structuredClone((0,r.ux)(this.data.attrs));let a=!1;if(s.add_cmd(e),"matrix2d"in i&&i.matrix2d){const e=i.matrix2d;this.reset_matrix(e)}if("fold"in i&&this.attrs.fold!==i.fold){const e=this.pcube.get_view_rect();this.layout_root?.layout_throttle(e)}for(let e in i){const t=i[e];t!==this.attrs[e]&&(this.attrs[e]=t,a=!0)}if(a){const e=this.pcube.get_view_rect();this.layout_root?.layout_throttle(e)}const l=m.S.layout_change(this.id,o);return s.add_recover(l),s}on_append_child(e){const{courier:t,history:n,pcube:r}=this,{previd:i}=e,{map_node_hgap:o,map_node_vgap:l}=this.config.data,c=t.get_recorder(),d=this.node_last.bound,u={x:d.pos.x,y:d.pos.y+d.size_bound.height+l},h=s.gL.get_default(u),p=f.y.node_add(r.id,[h]);c.tell(r,p);const m=a.U.create_linker_info(this.pcube,this.id,h.id),_=f.y.linker_add(r.id,[m]);c.tell(r,_);const g=r.get_node_to(this.id),b=g?.indexOf(h.id);if(g&&void 0!==b&&b>=0)if(null===i)g.splice(b,1),g.unshift(h.id);else if(i){const e=g.indexOf(i);e>=0&&(g.splice(b,1),g.splice(e+1,0,h.id))}return c}static get_default_node_size(e=0){return{width:120+2*e,height:36+2*e}}static get_default_node_pos(e,t){const{map_node_padding:n}=t.config.data,r=t.view_point_to_real(e),i=g.get_default_node_size(n);return{x:r.x-i.width/2,y:r.y-i.height/2}}}},9513:(e,t,n)=>{"use strict";n.d(t,{tK:()=>l,GW:()=>h,zS:()=>r.zS,K9:()=>r.K9,J8:()=>c,QI:()=>s,nY:()=>f,$f:()=>m,ZS:()=>k,ec:()=>S,SN:()=>M,_A:()=>g,Sd:()=>b,JC:()=>d,mM:()=>u,kU:()=>r.kU,L6:()=>o,tX:()=>C,s1:()=>r.s1,Mu:()=>r.Mu,u0:()=>r.u0,dp:()=>w,fv:()=>x,yn:()=>v,DI:()=>y,BS:()=>_,lm:()=>i,gS:()=>a,Ny:()=>p});var r=n(8474),i=function(e){return e.text_reset="cube-text:text-reset",e.text_merge="cube-text:text-merge",e.text_break="cube-text:text-break",e}({}),s=function(){return{}}(),o=function(e){return e.markers="markers",e.nodes="nodes",e.linkers="linkers",e.placeholder="placeholder",e}({}),a=function(e){return e.update="text-link:update",e}({}),l=function(e){return e.reset="cube-api:reset",e}({}),c=function(e){return e.insert_row="cube-detail-list:insert-row",e.remove_row="cube-detail-list:remove-row",e.change_width_col1="cube-detail-list:change-width-col1",e}({}),d=function(e){return e.add="cube-list:add",e.remove="cube-list:remove",e.indent="cube-list:indent",e}({}),u=function(e){return e.add="cube-list-ordered:add",e.remove="cube-list-ordered:remove",e.indent="cube-list-ordered:indent",e}({}),h=function(e){return e.change_lang="cube-code:change-lang",e.change_active="cube-code:change-active",e.change_theme="cube-code:change-theme",e.code_update="cube-code:update-code",e.code_add="cube-code:code-add",e.code_remove="cube-code:code-remove",e.code_rename="cube-code:code-rename",e}({}),p=function(e){return e.add="cube-todo:add",e.remove="cube-todo:remove",e.indent="cube-todo:indent",e.status="cube-todo:status",e}({}),m=function(e){return e.h1="\\Huge ",e.h2="\\huge ",e.h3="\\Large ",e.h4="\\normalsize ",e.h5="\\small ",e.h6="\\tiny ",e}({}),f=function(e){return e.update="cube-fomula:update",e}({}),_=function(e){return e.add_title="cube-table:add-title",e.remove_title="cube-table:remove-title",e.add_cell="cube-table:add-cell",e.remove_cell="cube-table:remove-cell",e.add_row="cube-table:add-row",e.remove_row="cube-table:remove-row",e.add_col="cube-table:add-col",e.remove_col="cube-table:remove-col",e.add_grid_col="cube-table:add-grid-col",e.remove_grid_col="cube-table:remove-grid-col",e.merge="cube-table:merge",e.moveto="cube-table:moveto",e.update_area="cube-table:update-area",e.reorder="cube-table:reorder",e.col_resize="cube-table:col-resize",e}({}),g=function(e){return e.arrow="marker-arrow",e.point="marker-point",e.square="marker-square",e.rhomb="marker-rhomb",e}({}),b=function(e){return e.update="linker:update",e}({}),y=function(e){return e.reset_explanation="cube-rt:reset-explanation",e}({}),v=function(e){return e.pending="pending",e.playing="playing",e.pause="pause",e.stop="stop",e}({}),w=function(e){return e["asset-save"]="note-event:asset-save",e["asset-download"]="note-event:asset-download",e["asset-copy"]="note-event:asset-copy",e.export="note-event:export",e["replace-id"]="note-event:replace-id",e["edit-before"]="note-event:edit-before",e["edit-after"]="note-event:edit-after",e["text-merge"]="note-event:text-merge",e.esc="note-event:esc",e["selection-change"]="note-event:selection-change",e["cursor-nav-before"]="note-event:cursor-nav-before",e["cursor-nav-after"]="note-event:cursor-nav-after",e["enter-before"]="note-event:enter-before",e["enter-after"]="note-event:enter-after",e["show-cube-editor"]="note-event:show-cube-editor",e["text-link-edit"]="note-event:text-link-edit",e["doc-input-before"]="note-event:doc-input-before",e["doc-input-compositionend"]="note-event:doc-input-compositionend",e["status-update"]="note-event:status-update",e["node-status-clicked"]="note-event:node-status-clicked",e["fig-click"]="note-event:fig-click",e}({}),x=function(e){return e.read="read",e.edit="edit",e.export="export",e}({}),k=function(e){return e["break-line"]="换行",e["cursor-nav"]="光标导航",e["cursor-nav-extend"]="光标复选",e["format-brush-apply"]="应用格式刷",e["format-brush-copy"]="复制格式刷",e.undo="撤销",e.redo="重做",e["indent-line"]="缩进",e["unindent-line"]="反向缩进",e["clear-css"]="重置样式",e["scope-clear"]="清空块选区",e["scope-add"]="添加块选区",e["root-add-next"]="向后添加根级块",e["root-add-prev"]="向前添加根级块",e["break-root"]="分裂根级块",e["break-text"]="文本块换行",e["fold-block"]="折叠所在块",e["text-add-annotation"]="添加批注",e["text-italic"]="斜体",e["text-bold"]="加粗",e["text-underline"]="下划线",e["text-align-left"]="左对齐",e["text-align-center"]="居中对齐",e["text-align-right"]="右对齐",e["text-partition"]="分裂文本块",e}({}),S=function(e){return e.core="核心",e.common="通用",e.text="文本块",e.block="块",e.scope="块选区",e.dict="字典",e.bookmark="书签",e.search="搜索",e.css="样式",e.float="面板",e.other="其他",e}({}),C=function(e){return e.left="arrowleft",e.right="arrowright",e.up="arrowup",e.down="arrowdown",e.end="end",e.home="home",e}({}),M=function(e){return e.enter="Enter",e}({})},9788:(e,t,n)=>{"use strict";n.d(t,{B:()=>l});var r=n(7633),i=n(4089),s=n(3923),o=n(9513),a=n(4743);class l extends s.K{static config;cp=l.default_config;data;get meta(){return l.meta}get css_vars(){const e=this.data;return{"--text-transition":e.text_transition?"0.5s":"none","--text-family":`${e.text_family}`,"--node-max-width":`${e.map_node_max_width}px`}}constructor(e){super(e),this.data=(0,r.Kh)(l.default_config),l.config=this.data,this.watch()}init(e){Object.assign(this.data,e),this.cp=structuredClone((0,r.ux)(this.data))}watch(){(0,i.wB)(()=>this.data.map_perf,(e,t)=>{if(e){this.root instanceof a.EU&&this.root.check_show();const e=this.root.cubes.get_types_cube(o.u0.submap);for(let[t,n]of e)n.check_show()}else{this.root instanceof a.EU&&this.root.show_all();const e=this.root.cubes.get_types_cube(o.u0.submap);for(let[t,n]of e)n.show_all()}})}export(){return structuredClone((0,r.ux)(this.data))}static get meta(){return{type:o.Mu.config,version:4}}static get default_config(){return{text_transition:!0,text_family:'"Comic Sans MS"',text_fontsize:16,code_theme:"dracula",line_indent:40,history_length:1/0,player_speed:150,input_quick_prefix:"/",revert_scope:!1,map_node_hgap:40,map_node_vgap:40,map_node_padding:4,map_node_max_width:800,map_node_exit_by_esc:!0,map_scale_max:5,map_scale_min:.1,map_scale_step:.1,scroll_distance:20,map_linker_anchor_left:o._A.point,map_linker_anchor_right:o._A.arrow,map_linker_line:"bezier2",map_linker_stroke:"black",map_linker_stroke_width:2,map_perf:!0}}}},9927:(e,t,n)=>{"use strict";n.d(t,{K:()=>i});var r=n(4743);class i{static docs=new Map;static maps=new Map;static _cubes=new Map;static _metas_cube=new Map;static get metas_cube(){const e=new Map;for(let[t,n]of this._cubes)e.set(t,n.meta);return e}static init(){this.register_cube_core()}static add_doc(e){this.docs.set(e.id,e)}static add_map(e){this.maps.set(e.id,e)}static register_cube(e){const t=e.meta;t||console.error(`NoteManager: can't find static member meta in ${e}`),this._cubes.set(t.type,e)}static find_cube(e){return this._cubes.get(e)}static export_versions(){const e={[r.oY.meta.type]:r.oY.meta.version};for(const[t,n]of this._cubes)e[t]=n.meta.version;return e}static get_sdk_meta(){return{version:"1.74.0",time_publish:1762072420064}}static register_cube_core(){i.register_cube(r.P6),i.register_cube(r.gK),i.register_cube(r.fC),i.register_cube(r.$u),i.register_cube(r.ju),i.register_cube(r.vV),i.register_cube(r.HR),i.register_cube(r.Kw),i.register_cube(r.NQ),i.register_cube(r.k9),i.register_cube(r.LZ),i.register_cube(r.RQ),i.register_cube(r.Ku),i.register_cube(r.qH),i.register_cube(r.p4),i.register_cube(r.c9),i.register_cube(r.XV),i.register_cube(r.de),i.register_cube(r.gL),i.register_cube(r.R$),i.register_cube(r.mM),i.register_cube(r.gv),i.register_cube(r.at)}}}},r={};function i(e){var t=r[e];if(void 0!==t)return t.exports;var s=r[e]={exports:{}};return n[e](s,s.exports,i),s.exports}i.m=n,i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce((t,n)=>(i.f[n](e,t),t),[])),i.u=e=>"chunk/"+e+"-"+i.h()+".js",i.miniCssF=e=>{},i.h=()=>"e1fc4b00c638b8b704eb",i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="deepsky:",i.l=(n,r,s,o)=>{if(e[n])e[n].push(r);else{var a,l;if(void 0!==s)for(var c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var u=c[d];if(u.getAttribute("src")==n||u.getAttribute("data-webpack")==t+s){a=u;break}}a||(l=!0,(a=document.createElement("script")).charset="utf-8",i.nc&&a.setAttribute("nonce",i.nc),a.setAttribute("data-webpack",t+s),a.src=n),e[n]=[r];var h=(t,r)=>{a.onerror=a.onload=null,clearTimeout(p);var i=e[n];if(delete e[n],a.parentNode&&a.parentNode.removeChild(a),i&&i.forEach(e=>e(r)),t)return t(r)},p=setTimeout(h.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=h.bind(null,a.onerror),a.onload=h.bind(null,a.onload),l&&document.head.appendChild(a)}},i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;i.g.importScripts&&(e=i.g.location+"");var t=i.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&(!e||!/^http(s?):/.test(e));)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=e})(),(()=>{var e={3057:0};i.f.j=(t,n)=>{var r=i.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var s=new Promise((n,i)=>r=e[t]=[n,i]);n.push(r[2]=s);var o=i.p+i.u(t),a=new Error;i.l(o,n=>{if(i.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var s=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src;a.message="Loading chunk "+t+" failed.\n("+s+": "+o+")",a.name="ChunkLoadError",a.type=s,a.request=o,r[1](a)}},"chunk-"+t,t)}};var t=(t,n)=>{var r,s,[o,a,l]=n,c=0;if(o.some(t=>0!==e[t])){for(r in a)i.o(a,r)&&(i.m[r]=a[r]);l&&l(i)}for(t&&t(n);c<o.length;c++)s=o[c],i.o(e,s)&&e[s]&&e[s][0](),e[s]=0},n=self.webpackChunkdeepsky=self.webpackChunkdeepsky||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var s={};return(()=>{"use strict";i.r(s),i.d(s,{BoundBox:()=>r.yI,CodeLanguageMap:()=>r.UF,CommandApi:()=>r.ev,CommandBoxFolder:()=>r.$6,CommandBoxRoot:()=>r.LU,CommandCode:()=>r.DW,CommandCube:()=>o.VL,CommandCursor:()=>o.UB,CommandDetailList:()=>r.ry,CommandFomula:()=>r.OA,CommandLinker:()=>r.PL,CommandListOrdered:()=>r.LO,CommandMap:()=>o.yc,CommandNode:()=>o.Sv,CommandRt:()=>r.fl,CommandTable:()=>r.en,CommandText:()=>r.zl,CommandTextLink:()=>r.ZU,CommandTodo:()=>r.A6,CubeAnnotation:()=>r.vV,CubeApi:()=>r.c9,CubeBase:()=>o.j5,CubeBox:()=>r.XV,CubeBoxColumns:()=>r.mM,CubeBoxFolder:()=>r.de,CubeBoxRoot:()=>r.HR,CubeChild:()=>o._D,CubeCode:()=>r.p4,CubeDetailList:()=>r.RQ,CubeDoc:()=>r.oY,CubeFomula:()=>r.qH,CubeHandler:()=>a.o,CubeImg:()=>r.fC,CubeLine:()=>r.gK,CubeLinker:()=>r.R$,CubeList:()=>r.Kw,CubeListOrdered:()=>r.NQ,CubeLost:()=>r.Qm,CubeMap:()=>r.EU,CubeNode:()=>r.gL,CubePostil:()=>r.$u,CubeRoot:()=>o.MR,CubeRt:()=>r.at,CubeSubMap:()=>r.gv,CubeTable:()=>r.Ku,CubeText:()=>r.P6,CubeTextLink:()=>r.ju,CubeTip:()=>r.LZ,CubeTodo:()=>r.k9,LinkerLine:()=>r.sf,LinkerPoint:()=>r.e8,MapBase:()=>o.MT,MapInteraction:()=>C.T,MapNodeBase:()=>o.wP,MapTools:()=>S.U,Matrix2D:()=>S.c,NodeObserver:()=>r.Nj,NodeShape:()=>r.AG,NoteApi:()=>x.F,NoteBase:()=>l.K,NoteClipBoard:()=>c.F,NoteCourier:()=>d.W,NoteCubes:()=>m.h,NoteCursor:()=>u.P,NoteEvent:()=>p.z,NoteHistory:()=>f.PI,NoteHotkeys:()=>_.Wu,NoteIcons:()=>h.R,NoteListener:()=>y.t,NoteManager:()=>g.K,NotePainter:()=>b.W,NotePlayer:()=>f.C6,NoteScope:()=>v.R,NoteStats:()=>w.I,NoteTools:()=>k.I,Recorder:()=>f.vk,Waiter:()=>k.J,_ApiCommandNames:()=>n.tK,_CodeCommandNames:()=>n.GW,_CubeCommandName:()=>n.zS,_CursorCommandName:()=>n.K9,_DetaiListCommandName:()=>n.J8,_DocCommandName:()=>n.QI,_FomulaCommandNames:()=>n.nY,_FomulaSize:()=>n.$f,_HotKeys:()=>n.ZS,_HotKeysGroup:()=>n.ec,_Keys:()=>n.SN,_LinkerAnchor:()=>n._A,_LinkerCommandNames:()=>n.Sd,_ListCommandNames:()=>n.JC,_ListOrderedCommandNames:()=>n.mM,_MapCommandName:()=>n.kU,_MapGroup:()=>n.L6,_NavigationKey:()=>n.tX,_NodeCommandName:()=>n.s1,_NoteCores:()=>n.Mu,_NoteCubeTypes:()=>n.u0,_NoteEvents:()=>n.dp,_NoteMode:()=>n.fv,_PlayStatus:()=>n.yn,_RtCommandNames:()=>n.DI,_TableCommandNames:()=>n.BS,_TextCommandName:()=>n.lm,_TextLinkCommandNames:()=>n.gS,_TodoCommandNames:()=>n.Ny,cmd:()=>a.H,key:()=>_.Eb,keymap:()=>_.w4,node_observer:()=>r.iO});var e=i(1068),t={};for(const n in e)"default"!==n&&(t[n]=()=>e[n]);i.d(s,t);var n=i(9513),r=i(4743),o=i(4116),a=i(2519),l=i(3923),c=i(6517),d=i(4e3),u=i(3347),h=i(2160),p=i(1490),m=i(2411),f=i(3028),_=i(539),g=i(9927),b=i(2773),y=i(7852),v=i(4823),w=i(685),x=i(2551),k=i(8631),S=i(7552),C=i(7084)})(),s})());
|