@visulima/vis 3.0.0 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/LICENSE.md +5760 -4562
- package/dashboard/dist/index.html +12 -12
- package/dist/bin.js +1 -1
- package/dist/binx.js +2 -2
- package/dist/config/index.js +1 -1
- package/dist/packem_chunks/CONFIG_FILES.js +6 -6
- package/dist/packem_chunks/DEFAULT_CLEAN_KEEP.js +1 -1
- package/dist/packem_chunks/agent-instructions.js +7 -7
- package/dist/packem_chunks/bloom-status.js +2 -2
- package/dist/packem_chunks/bloom-sync.js +2 -2
- package/dist/packem_chunks/cache-attestation.js +1 -1
- package/dist/packem_chunks/catalog-detector.js +1 -1
- package/dist/packem_chunks/catalog.js +87 -111
- package/dist/packem_chunks/cli-exec.js +1 -1
- package/dist/packem_chunks/cli-main.js +192 -217
- package/dist/packem_chunks/defineReleasePlugin.js +3 -3
- package/dist/packem_chunks/detect.js +8 -3
- package/dist/packem_chunks/devtools.js +1 -1
- package/dist/packem_chunks/discord.js +4 -4
- package/dist/packem_chunks/dispatch.js +4 -4
- package/dist/packem_chunks/doctor-probe.js +2 -2
- package/dist/packem_chunks/extra-files.js +3 -3
- package/dist/packem_chunks/fix.js +11 -11
- package/dist/packem_chunks/git.js +3 -3
- package/dist/packem_chunks/group-tags.js +1 -1
- package/dist/packem_chunks/handler.js +1 -1
- package/dist/packem_chunks/handler10.js +5 -5
- package/dist/packem_chunks/handler11.js +1 -1
- package/dist/packem_chunks/handler12.js +16 -16
- package/dist/packem_chunks/handler13.js +5 -5
- package/dist/packem_chunks/handler14.js +1 -1
- package/dist/packem_chunks/handler15.js +1 -1
- package/dist/packem_chunks/handler16.js +1 -1
- package/dist/packem_chunks/handler17.js +1 -1
- package/dist/packem_chunks/handler18.js +1 -1
- package/dist/packem_chunks/handler19.js +5 -5
- package/dist/packem_chunks/handler2.js +1 -1
- package/dist/packem_chunks/handler20.js +2 -2
- package/dist/packem_chunks/handler21.js +2 -2
- package/dist/packem_chunks/handler22.js +8 -8
- package/dist/packem_chunks/handler23.js +1 -1
- package/dist/packem_chunks/handler24.js +1 -1
- package/dist/packem_chunks/handler25.js +1 -1
- package/dist/packem_chunks/handler26.js +5 -5
- package/dist/packem_chunks/handler27.js +1 -1
- package/dist/packem_chunks/handler28.js +3 -3
- package/dist/packem_chunks/handler29.js +1 -1
- package/dist/packem_chunks/handler3.js +2 -2
- package/dist/packem_chunks/handler30.js +1 -1
- package/dist/packem_chunks/handler31.js +2 -2
- package/dist/packem_chunks/handler32.js +2 -2
- package/dist/packem_chunks/handler33.js +2 -2
- package/dist/packem_chunks/handler34.js +3 -3
- package/dist/packem_chunks/handler35.js +5 -5
- package/dist/packem_chunks/handler36.js +1 -1
- package/dist/packem_chunks/handler37.js +2 -2
- package/dist/packem_chunks/handler38.js +6 -6
- package/dist/packem_chunks/handler39.js +8 -8
- package/dist/packem_chunks/handler4.js +4 -4
- package/dist/packem_chunks/handler40.js +34 -34
- package/dist/packem_chunks/handler41.js +5 -5
- package/dist/packem_chunks/handler42.js +4 -4
- package/dist/packem_chunks/handler43.js +3 -3
- package/dist/packem_chunks/handler44.js +2 -2
- package/dist/packem_chunks/handler45.js +1 -1
- package/dist/packem_chunks/handler46.js +1 -1
- package/dist/packem_chunks/handler47.js +1 -1
- package/dist/packem_chunks/handler48.js +3 -3
- package/dist/packem_chunks/handler49.js +1 -1
- package/dist/packem_chunks/handler5.js +6 -6
- package/dist/packem_chunks/handler50.js +6 -6
- package/dist/packem_chunks/handler51.js +13 -13
- package/dist/packem_chunks/handler52.js +3 -3
- package/dist/packem_chunks/handler53.js +5 -5
- package/dist/packem_chunks/handler54.js +2 -2
- package/dist/packem_chunks/handler55.js +1 -1
- package/dist/packem_chunks/handler56.js +4 -4
- package/dist/packem_chunks/handler57.js +5 -5
- package/dist/packem_chunks/handler58.js +5 -5
- package/dist/packem_chunks/handler59.js +8 -8
- package/dist/packem_chunks/handler6.js +7 -7
- package/dist/packem_chunks/handler60.js +3 -3
- package/dist/packem_chunks/handler61.js +21 -21
- package/dist/packem_chunks/handler62.js +12 -12
- package/dist/packem_chunks/handler63.js +3 -3
- package/dist/packem_chunks/handler64.js +5 -5
- package/dist/packem_chunks/handler65.js +8 -8
- package/dist/packem_chunks/handler66.js +2 -2
- package/dist/packem_chunks/handler67.js +25 -24
- package/dist/packem_chunks/handler68.js +153 -25
- package/dist/packem_chunks/handler69.js +10 -153
- package/dist/packem_chunks/handler7.js +1 -1
- package/dist/packem_chunks/handler70.js +22 -10
- package/dist/packem_chunks/handler71.js +17 -17
- package/dist/packem_chunks/handler72.js +104 -104
- package/dist/packem_chunks/handler73.js +20 -20
- package/dist/packem_chunks/handler74.js +45 -45
- package/dist/packem_chunks/handler75.js +27 -3
- package/dist/packem_chunks/handler76.js +3 -27
- package/dist/packem_chunks/handler77.js +68 -68
- package/dist/packem_chunks/handler78.js +30 -30
- package/dist/packem_chunks/handler8.js +1 -1
- package/dist/packem_chunks/handler9.js +1 -1
- package/dist/packem_chunks/heal-accept.js +9 -9
- package/dist/packem_chunks/heal.js +11 -11
- package/dist/packem_chunks/help-command.js +7 -63
- package/dist/packem_chunks/index.js +1 -1
- package/dist/packem_chunks/index2.js +48 -804
- package/dist/packem_chunks/index3.js +3 -7
- package/dist/packem_chunks/index4.js +801 -134
- package/dist/packem_chunks/index5.js +7 -73
- package/dist/packem_chunks/index6.js +73 -0
- package/dist/packem_chunks/index7.js +135 -0
- package/dist/packem_chunks/interface.js +2 -2
- package/dist/packem_chunks/keys-refresh.js +4 -4
- package/dist/packem_chunks/lean.js +3 -3
- package/dist/packem_chunks/list.js +3 -3
- package/dist/packem_chunks/loader.js +4 -4
- package/dist/packem_chunks/loader2.js +1 -1
- package/dist/packem_chunks/orchestrator.js +27 -27
- package/dist/packem_chunks/pre-mode.js +2 -2
- package/dist/packem_chunks/print-config.js +1 -1
- package/dist/packem_chunks/prompts.js +7 -7
- package/dist/packem_chunks/prune.js +3 -3
- package/dist/packem_chunks/publish-guards.js +1 -1
- package/dist/packem_chunks/resolveFormatter.js +5 -5
- package/dist/packem_chunks/run.js +1 -1
- package/dist/packem_chunks/security.js +1 -1
- package/dist/packem_chunks/shell-runner.js +1 -1
- package/dist/packem_chunks/slack.js +2 -2
- package/dist/packem_chunks/snapshot.js +2 -2
- package/dist/packem_chunks/stage-publisher.js +1 -1
- package/dist/packem_chunks/staged-registry.js +2 -2
- package/dist/packem_chunks/state.js +3 -3
- package/dist/packem_chunks/status.js +2 -2
- package/dist/packem_chunks/success-walk.js +4 -4
- package/dist/packem_chunks/sync.js +2 -2
- package/dist/packem_chunks/sync2.js +2 -2
- package/dist/packem_chunks/tar.js +3 -3
- package/dist/packem_chunks/tripwire.js +2 -2
- package/dist/packem_chunks/ts-loader.js +5 -9
- package/dist/packem_chunks/verify-lockfile.js +2 -2
- package/dist/packem_chunks/version-resolver.js +2 -2
- package/dist/packem_chunks/webhook.js +1 -1
- package/dist/packem_chunks/workflow-templates.js +5 -5
- package/dist/packem_chunks/workspace.js +2 -2
- package/dist/packem_shared/ReleaseClient-DAvbxCdo.js +1 -0
- package/dist/packem_shared/Table-DyORjLji-CC9cYgCG.js +11 -0
- package/dist/packem_shared/{VisReleaseError-DMGRBTNO.js → VisReleaseError-DZtgcKf8.js} +1 -1
- package/dist/packem_shared/_commonjsHelpers-DTfxOvZk.js +1 -0
- package/dist/packem_shared/advisories-DZd1uGqa.js +1 -0
- package/dist/packem_shared/affected-selection-CoRXp5H4.js +1 -0
- package/dist/packem_shared/affected-shas-Dd0P7fGD.js +1 -0
- package/dist/packem_shared/ai-analysis-DSQQDFU9.js +68 -0
- package/dist/packem_shared/ai-fix-6nXZbecQ.js +43 -0
- package/dist/packem_shared/augment-COAiXSIx.js +4 -0
- package/dist/packem_shared/bin-C2eYtJ_N.js +1 -0
- package/dist/packem_shared/build-scripts-pdVmqXRm.js +1 -0
- package/dist/packem_shared/clean-DRiLimTx.js +1 -0
- package/dist/packem_shared/command-runtime-CiLVo4ED.js +1 -0
- package/dist/packem_shared/{compile-cache-B_Vf_WxT.js → compile-cache-DoMHRsRZ.js} +1 -1
- package/dist/packem_shared/createAdapter-F7GidOzU.js +1 -0
- package/dist/packem_shared/createVersionActions-ByaJ1Nbv.js +1 -0
- package/dist/packem_shared/cyclonedx-B1vzerwP.js +4 -0
- package/dist/packem_shared/dependency-scan-DBH2Qo4I.js +1 -0
- package/dist/packem_shared/docker-Bex05Qcn.js +59 -0
- package/dist/packem_shared/failure-log-D92tM0ie.js +2 -0
- package/dist/packem_shared/formatBytes-BHAzNIrn-DFIppnY0.js +4 -0
- package/dist/packem_shared/getRandomSpinner-4ZEcbTYv-DCyIuj19.js +1 -0
- package/dist/packem_shared/giget-D8Kwb0kD.js +2 -0
- package/dist/packem_shared/glob-Cyk1H9ZL-ox19CSsT.js +1 -0
- package/dist/packem_shared/index-B4AjSxHU.js +1 -0
- package/dist/packem_shared/index-BisalDCf.js +39 -0
- package/dist/packem_shared/{index-BWl4DbMp.js → index-BjdW45xX.js} +1 -1
- package/dist/packem_shared/index-DHD8wb6Z.js +22 -0
- package/dist/packem_shared/index-DXPSWMbG.js +1 -0
- package/dist/packem_shared/index.server-BAjDJSEu.js +2 -0
- package/dist/packem_shared/isAccessibleSync-DYKTrrvc-CSnBISfV.js +1 -0
- package/dist/packem_shared/license-DvlYdo6T.js +1 -0
- package/dist/packem_shared/lifecycle-CfTZQHOG.js +2 -0
- package/dist/packem_shared/lockfile-35RFsJDs.js +1 -0
- package/dist/packem_shared/lockfile-DhHAaHN5.js +1 -0
- package/dist/packem_shared/main-BP-w-K-6.js +1 -0
- package/dist/packem_shared/manifests-BNSmpPF_.js +1 -0
- package/dist/packem_shared/min-release-age-ChzTC7_I.js +34 -0
- package/dist/packem_shared/missing-package-json-C0keIt78.js +1 -0
- package/dist/packem_shared/native-config-sync-BSzU4qUO.js +21 -0
- package/dist/packem_shared/osv-bloom-1JS__1or.js +2 -0
- package/dist/packem_shared/otelPlugin-D8LL2-4L.js +1 -0
- package/dist/packem_shared/package-version-Bb7KGF36.js +4 -0
- package/dist/packem_shared/packument-C55kVxcQ.js +1 -0
- package/dist/packem_shared/{peer-warnings-BXAzXqY3.js → peer-warnings-CmYSxvql.js} +1 -1
- package/dist/packem_shared/pm-runner-de-jCq8q.js +1 -0
- package/dist/packem_shared/project-name-filter-DYaIbrXa.js +7 -0
- package/dist/packem_shared/{prompt-BSAy8SMH.js → prompt-DMzaQEVa.js} +1 -1
- package/dist/packem_shared/provenance-CvfQEJPQ.js +1 -0
- package/dist/packem_shared/readJsonSync-CbryXYxN-B2aSeDpC.js +1 -0
- package/dist/packem_shared/registry-keys-DmBrAlhg.js +1 -0
- package/dist/packem_shared/resolve-explicit-DYaHAVDg.js +5 -0
- package/dist/packem_shared/resolve-runtime-C7NBCA1C.js +1 -0
- package/dist/packem_shared/run-file-jMngGQhs.js +1 -0
- package/dist/packem_shared/runtime-check-BklgEMkC.js +1 -0
- package/dist/packem_shared/s1ngularity-C8sva2SO.js +1 -0
- package/dist/packem_shared/scan-progress-aVHGZYWf.js +2 -0
- package/dist/packem_shared/selectors-B7lSFz7l.js +3 -0
- package/dist/packem_shared/signatures-oZ_2IneN.js +2 -0
- package/dist/packem_shared/{slug-DoueYuLo.js → slug-OBHcH7wV.js} +1 -1
- package/dist/packem_shared/spinner-CbJfWYwB.js +1 -0
- package/dist/packem_shared/sticky-comment-DjhyCIZt.js +1 -0
- package/dist/packem_shared/subtree-DtmcKAJK.js +2 -0
- package/dist/packem_shared/symbols-BXDZ_sKt.js +1 -0
- package/dist/packem_shared/tabs-BilwonkM.js +1 -0
- package/dist/packem_shared/target-merge-DCGow6Kw.js +4 -0
- package/dist/packem_shared/target-options-d_rIrLyq.js +1 -0
- package/dist/packem_shared/toolchain-DY11tPCw.js +5 -0
- package/dist/packem_shared/typosquats-Cdsnf6aN.js +1 -0
- package/dist/packem_shared/use-measured-height-BPQg2q_p.js +1 -0
- package/dist/packem_shared/utils-DQFHJn72.js +1 -0
- package/dist/packem_shared/verify-D8wYvB85.js +1 -0
- package/dist/packem_shared/vis-update-app-ngwL2mRv.js +1 -0
- package/dist/packem_shared/vis-user-error-CAu9wIbe.js +30 -0
- package/dist/packem_shared/watch-Dswvj6Zp.js +1 -0
- package/dist/packem_shared/watch-loop-COWvvSbR.js +11 -0
- package/dist/packem_shared/writeFileSync-DJoHk3Ks-CgQ-VNNT.js +1 -0
- package/dist/release/core/changelog/index.d.ts +62 -2
- package/dist/release/core/package-managers/index.d.ts +25 -1
- package/dist/release/core/package-managers/index.js +1 -1
- package/dist/release/core/version-actions/index.d.ts +47 -2
- package/dist/release/core/version-actions/index.js +1 -1
- package/dist/release/index.d.ts +100 -1
- package/dist/release/index.js +1 -1
- package/dist/release/plugin-sdk.d.ts +16 -1
- package/dist/release/plugin-sdk.js +1 -1
- package/dist/release/presets.js +1 -1
- package/dist/release/types.js +1 -1
- package/dist/runtime/preload.js +1 -1
- package/index.js +26 -26
- package/package.json +14 -14
- package/dist/packem_chunks/detect2.js +0 -8
- package/dist/packem_chunks/registry.js +0 -48
- package/dist/packem_shared/ReleaseClient-BY4OZNCK.js +0 -1
- package/dist/packem_shared/_commonjsHelpers-B5Y90VFO.js +0 -1
- package/dist/packem_shared/advisories-DsXRmIA5.js +0 -1
- package/dist/packem_shared/affected-selection-BE6VFCDV.js +0 -1
- package/dist/packem_shared/affected-shas-BKEu4RZc.js +0 -1
- package/dist/packem_shared/ai-analysis-DikAj6rX.js +0 -68
- package/dist/packem_shared/ai-fix-bfWo0cZX.js +0 -43
- package/dist/packem_shared/augment-BkJxi_GW.js +0 -4
- package/dist/packem_shared/bin-B-TytgzW.js +0 -1
- package/dist/packem_shared/build-scripts-DWypBQ--.js +0 -1
- package/dist/packem_shared/clean-DWjQl14S.js +0 -1
- package/dist/packem_shared/command-runtime-DQ7ZpLYL.js +0 -1
- package/dist/packem_shared/createAdapter-bU4DIP3F.js +0 -1
- package/dist/packem_shared/createVersionActions-BK43SNDH.js +0 -1
- package/dist/packem_shared/cyclonedx-DLBi65MV.js +0 -4
- package/dist/packem_shared/dependency-scan-ZLOuLkGN.js +0 -1
- package/dist/packem_shared/docker-B4zAZCZG.js +0 -59
- package/dist/packem_shared/en-BDYMmM2_.js +0 -27
- package/dist/packem_shared/failure-log-DyhWPqno.js +0 -2
- package/dist/packem_shared/giget-CAxjpwew.js +0 -2
- package/dist/packem_shared/glob-BUjyjdE8-Dp_QcayW.js +0 -1
- package/dist/packem_shared/index-BAe6e0XE.js +0 -1
- package/dist/packem_shared/index-BLtnel38.js +0 -35
- package/dist/packem_shared/index-CuKDxOCI.js +0 -1
- package/dist/packem_shared/index-tNFGWxc0.js +0 -39
- package/dist/packem_shared/index.server-CusjRLCh.js +0 -2
- package/dist/packem_shared/license-t5KnNX6v.js +0 -1
- package/dist/packem_shared/lifecycle-KY9umOg6.js +0 -2
- package/dist/packem_shared/lockfile-YAuZf1gh.js +0 -1
- package/dist/packem_shared/main-D_cam4hv.js +0 -1
- package/dist/packem_shared/manifests-BwTn_1ad.js +0 -1
- package/dist/packem_shared/min-release-age-6avfn81h.js +0 -34
- package/dist/packem_shared/missing-package-json-Cl0vdz6K.js +0 -1
- package/dist/packem_shared/native-config-sync-CHMCJx7H.js +0 -21
- package/dist/packem_shared/osv-bloom-DdqDnLCt.js +0 -2
- package/dist/packem_shared/otelPlugin-DmKDBaPo.js +0 -1
- package/dist/packem_shared/package-version-BNRJ3o9C.js +0 -4
- package/dist/packem_shared/packument-B9-WqReu.js +0 -1
- package/dist/packem_shared/pm-runner-DRybtzOV.js +0 -1
- package/dist/packem_shared/project-name-filter-Dw0fC6IO.js +0 -7
- package/dist/packem_shared/provenance-CLxuqCfL.js +0 -1
- package/dist/packem_shared/readJsonSync-DweZd5ZA-CtrDlqpb.js +0 -1
- package/dist/packem_shared/registry-keys-cTN24144.js +0 -1
- package/dist/packem_shared/resolve-explicit-Uw6WQl9R.js +0 -5
- package/dist/packem_shared/resolve-runtime-DztanwkZ.js +0 -1
- package/dist/packem_shared/run-file-CaE5_xBY.js +0 -1
- package/dist/packem_shared/runtime-check-C32yE57I.js +0 -1
- package/dist/packem_shared/s1ngularity-BIYhg82u.js +0 -1
- package/dist/packem_shared/scan-progress-DWfY4zkp.js +0 -2
- package/dist/packem_shared/selectors-D2j4M9Ul.js +0 -3
- package/dist/packem_shared/signatures-C8iQ5fUq.js +0 -2
- package/dist/packem_shared/sticky-comment-D6_7-w8T.js +0 -1
- package/dist/packem_shared/subtree-DSm0QEoE.js +0 -2
- package/dist/packem_shared/symbols-DPTlrJ3B.js +0 -1
- package/dist/packem_shared/target-merge-DLxJTcxn.js +0 -11
- package/dist/packem_shared/target-options-3t4-2F-F.js +0 -1
- package/dist/packem_shared/toolchain-BPzbahcQ.js +0 -5
- package/dist/packem_shared/typosquats-BWrmhh36.js +0 -1
- package/dist/packem_shared/use-measured-height-BwAwGHjw.js +0 -1
- package/dist/packem_shared/utils-CRueU43T.js +0 -1
- package/dist/packem_shared/verify-CzUPT6Uk.js +0 -1
- package/dist/packem_shared/vis-update-app-D6Wq8ZHM.js +0 -1
- package/dist/packem_shared/vis-user-error-CfM4_ORo.js +0 -30
- package/dist/packem_shared/watch-D_oAxW_Z.js +0 -1
- package/dist/packem_shared/watch-loop-BrjblOz5.js +0 -11
|
@@ -1,73 +1,7 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
9
|
-
* list of conditions and the following disclaimer.
|
|
10
|
-
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
11
|
-
* this list of conditions and the following disclaimer in the
|
|
12
|
-
* documentation and/or other materials provided with the distribution.
|
|
13
|
-
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
14
|
-
* may be used to endorse or promote products derived from this software without
|
|
15
|
-
* specific prior written permission.
|
|
16
|
-
*
|
|
17
|
-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
18
|
-
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
19
|
-
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
20
|
-
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
21
|
-
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
22
|
-
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
23
|
-
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
24
|
-
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
25
|
-
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
26
|
-
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
27
|
-
*/let _=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i;class w extends Date{#t=!1;#r=!1;#e=null;constructor(t){let r=!0,i=!0,o="Z";if(typeof t=="string"){let l=t.match(_);l?(l[1]||(r=!1,t=`0000-01-01T${t}`),i=!!l[2],i&&t[10]===" "&&(t=t.replace(" ","T")),l[2]&&+l[2]>23?t="":(o=l[3]||null,t=t.toUpperCase(),!o&&i&&(t+="Z"))):t=""}super(t),isNaN(this.getTime())||(this.#t=r,this.#r=i,this.#e=o)}isDateTime(){return this.#t&&this.#r}isLocal(){return!this.#t||!this.#r||!this.#e}isDate(){return this.#t&&!this.#r}isTime(){return this.#r&&!this.#t}isValid(){return this.#t||this.#r}toISOString(){let t=super.toISOString();if(this.isDate())return t.slice(0,10);if(this.isTime())return t.slice(11,23);if(this.#e===null)return t.slice(0,-1);if(this.#e==="Z")return t;let r=+this.#e.slice(1,3)*60+ +this.#e.slice(4,6);return r=this.#e[0]==="-"?r:-r,new Date(this.getTime()-r*6e4).toISOString().slice(0,-1)+this.#e}static wrapAsOffsetDateTime(t,r="Z"){let i=new w(t);return i.#e=r,i}static wrapAsLocalDateTime(t){let r=new w(t);return r.#e=null,r}static wrapAsLocalDate(t){let r=new w(t);return r.#r=!1,r.#e=null,r}static wrapAsLocalTime(t){let r=new w(t);return r.#t=!1,r.#e=null,r}}/*!
|
|
28
|
-
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
29
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
30
|
-
*
|
|
31
|
-
* Redistribution and use in source and binary forms, with or without
|
|
32
|
-
* modification, are permitted provided that the following conditions are met:
|
|
33
|
-
*
|
|
34
|
-
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
35
|
-
* list of conditions and the following disclaimer.
|
|
36
|
-
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
37
|
-
* this list of conditions and the following disclaimer in the
|
|
38
|
-
* documentation and/or other materials provided with the distribution.
|
|
39
|
-
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
40
|
-
* may be used to endorse or promote products derived from this software without
|
|
41
|
-
* specific prior written permission.
|
|
42
|
-
*
|
|
43
|
-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
44
|
-
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
45
|
-
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
46
|
-
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
47
|
-
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
48
|
-
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
49
|
-
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
50
|
-
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
51
|
-
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
52
|
-
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
53
|
-
*/function S(e,t){let r=e.slice(0,t).split(/\r\n|\n|\r/g);return[r.length,r.pop().length+1]}function T(e,t,r){let i=e.split(/\r\n|\n|\r/g),o="",l=(Math.log10(t+1)|0)+1;for(let n=t-1;n<=t+1;n++){let a=i[n-1];a&&(o+=n.toString().padEnd(l," "),o+=": ",o+=a,o+=`
|
|
54
|
-
`,n===t&&(o+=" ".repeat(l+r+2),o+=`^
|
|
55
|
-
`))}return o}class u extends Error{line;column;codeblock;constructor(t,r){const[i,o]=S(r.toml,r.ptr),l=T(r.toml,i,o);super(`Invalid TOML document: ${t}
|
|
56
|
-
|
|
57
|
-
${l}`,r),this.line=i,this.column=o,this.codeblock=l}}let A=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,I=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,N=/^[+-]?0[0-9_]/;function k(e,t){let r=e[t++],i=r,o=r==="'",l=r===e[t]&&r===e[t+1];l&&(e[t+=2]===`
|
|
58
|
-
`?t++:e[t]==="\r"&&e[t+1]===`
|
|
59
|
-
`&&(t+=2));let n="",a=t,f=0;for(let s=t;s<e.length;s++)if(r=e[s],l&&(r===`
|
|
60
|
-
`||r==="\r"&&e[s+1]===`
|
|
61
|
-
`))f=f&&3;else{if(r<" "&&r!==" "||r==="")throw new u("control characters are not allowed in strings",{toml:e,ptr:s});if((!f||f===3)&&r===i&&(!l||e[s+1]===i&&e[s+2]===i))return l&&(e[s+3]===i&&s++,e[s+3]===i&&s++),[f?n:n+e.slice(a,s),s+(l?3:1)];if(!f)!o&&r==="\\"&&(n+=e.slice(a,a=s),f=1);else if(f===1)if(r==="x"||r==="u"||r==="U"){let d=0,b=r==="x"?2:r==="u"?4:8;for(let m=0;m<b;m++,s++){let c=e.charCodeAt(s+1),h=c>=48&&c<=57?c-48:c>=65&&c<=70?c-65+10:c>=97&&c<=102?c-97+10:-1;if(h<0)throw new u("invalid non-hex character in unicode escape",{toml:e,ptr:s+1});d=d<<4|h}if(d<0||d>1114111||d>=55296&&d<=57343)throw new u("invalid unicode escape",{toml:e,ptr:s});n+=String.fromCodePoint(d),a=s+1,f=0}else if(r===" "||r===" ")f=2;else{if(r==="b")n+="\b";else if(r==="t")n+=" ";else if(r==="n")n+=`
|
|
62
|
-
`;else if(r==="f")n+="\f";else if(r==="r")n+="\r";else if(r==="e")n+="\x1B";else if(r==='"')n+='"';else if(r==="\\")n+="\\";else throw new u("unrecognized escape sequence",{toml:e,ptr:s});a=s+1,f=0}else if(r!==" "&&r!==" "){if(f===2)throw new u("invalid escape: only line-ending whitespace may be escaped",{toml:e,ptr:a});f=!o&&r==="\\"?1:0,a=s}}throw new u("unfinished string",{toml:e,ptr:t})}function $(e,t,r,i){if(e==="true")return!0;if(e==="false")return!1;if(e==="-inf")return-1/0;if(e==="inf"||e==="+inf")return 1/0;if(e==="nan"||e==="+nan"||e==="-nan")return NaN;if(e==="-0")return i?0n:0;let o=A.test(e);if(o||I.test(e)){if(N.test(e))throw new u("leading zeroes are not allowed",{toml:t,ptr:r});e=e.replace(/_/g,"");let n=+e;if(isNaN(n))throw new u("invalid number",{toml:t,ptr:r});if(o){if((o=!Number.isSafeInteger(n))&&!i)throw new u("integer value cannot be represented losslessly",{toml:t,ptr:r});(o||i===!0)&&(n=BigInt(e))}return n}const l=new w(e);if(!l.isValid())throw new u("invalid value",{toml:t,ptr:r});return l}function y(e,t=0,r=e.length){let i=e.indexOf(`
|
|
63
|
-
`,t);return e[i-1]==="\r"&&i--,i<=r?i:-1}function g(e,t){for(let r=t;r<e.length;r++){let i=e[r];if(i===`
|
|
64
|
-
`)return r;if(i==="\r"&&e[r+1]===`
|
|
65
|
-
`)return r+1;if(i<" "&&i!==" "||i==="")throw new u("control characters are not allowed in comments",{toml:e,ptr:t})}return e.length}function p(e,t,r,i){let o;for(;;){for(;(o=e[t])===" "||o===" "||!r&&(o===`
|
|
66
|
-
`||o==="\r"&&e[t+1]===`
|
|
67
|
-
`);)t++;if(i||o!=="#")break;t=g(e,t)}return t}function j(e,t,r,i,o=!1){if(!i)return t=y(e,t),t<0?e.length:t;for(let l=t;l<e.length;l++){let n=e[l];if(n==="#")l=y(e,l);else{if(n===r)return l+1;if(n===i||o&&(n===`
|
|
68
|
-
`||n==="\r"&&e[l+1]===`
|
|
69
|
-
`))return l}}throw new u("cannot find end of structure",{toml:e,ptr:t})}function D(e,t,r){let i=e.slice(t,r),o=i.indexOf("#");return o>-1&&(g(e,o),i=i.slice(0,o)),[i.trimEnd(),o]}function v(e,t,r,i,o){if(i===0)throw new u("document contains excessively nested structures. aborting.",{toml:e,ptr:t});let l=e[t];if(l==="["||l==="{"){let[f,s]=l==="["?L(e,t,i,o):Z(e,t,i,o);if(r){if(s=p(e,s),e[s]===",")s++;else if(e[s]!==r)throw new u("expected comma or end of structure",{toml:e,ptr:s})}return[f,s]}if(l==='"'||l==="'"){let[f,s]=k(e,t);if(r){if(s=p(e,s),e[s]&&e[s]!==","&&e[s]!==r&&e[s]!==`
|
|
70
|
-
`&&e[s]!=="\r")throw new u("unexpected character encountered",{toml:e,ptr:s});e[s]===","&&s++}return[f,s]}let n=j(e,t,",",r),a=D(e,t,n-(e[n-1]===","?1:0));if(!a[0])throw new u("incomplete key-value declaration: no value specified",{toml:e,ptr:t});return r&&a[1]>-1&&(n=p(e,t+a[1]),e[n]===","&&n++),[$(a[0],e,t,o),n]}let E=/^[a-zA-Z0-9-_]+[ \t]*$/;function x(e,t,r="="){let i=t-1,o=[],l=e.indexOf(r,t);if(l<0)throw new u("incomplete key-value: cannot find end of key",{toml:e,ptr:t});do{let n=e[t=++i];if(n!==" "&&n!==" ")if(n==='"'||n==="'"){if(n===e[t+1]&&n===e[t+2])throw new u("multiline strings are not allowed in keys",{toml:e,ptr:t});let[a,f]=k(e,t);i=e.indexOf(".",f);let s=e.slice(f,i<0||i>l?l:i),d=y(s);if(d>-1)throw new u("newlines are not allowed in keys",{toml:e,ptr:t+i+d});if(s.trimStart())throw new u("found extra tokens after the string part",{toml:e,ptr:f});if(l<f&&(l=e.indexOf(r,f),l<0))throw new u("incomplete key-value: cannot find end of key",{toml:e,ptr:t});o.push(a)}else{i=e.indexOf(".",t);let a=e.slice(t,i<0||i>l?l:i);if(!E.test(a))throw new u("only letter, numbers, dashes and underscores are allowed in keys",{toml:e,ptr:t});o.push(a.trimEnd())}}while(i+1&&i<l);return[o,p(e,l+1,!0,!0)]}function Z(e,t,r,i){let o={},l=new Set,n;for(t++;(n=e[t++])!=="}"&&n;){if(n===",")throw new u("expected value, found comma",{toml:e,ptr:t-1});if(n==="#")t=g(e,t);else if(n!==" "&&n!==" "&&n!==`
|
|
71
|
-
`&&n!=="\r"){let a,f=o,s=!1,[d,b]=x(e,t-1);for(let h=0;h<d.length;h++){if(h&&(f=s?f[a]:f[a]={}),a=d[h],(s=Object.hasOwn(f,a))&&(typeof f[a]!="object"||l.has(f[a])))throw new u("trying to redefine an already defined value",{toml:e,ptr:t});!s&&a==="__proto__"&&Object.defineProperty(f,a,{enumerable:!0,configurable:!0,writable:!0})}if(s)throw new u("trying to redefine an already defined value",{toml:e,ptr:t});let[m,c]=v(e,b,"}",r-1,i);l.add(m),f[a]=m,t=c}}if(!n)throw new u("unfinished table encountered",{toml:e,ptr:t});return[o,t]}function L(e,t,r,i){let o=[],l;for(t++;(l=e[t++])!=="]"&&l;){if(l===",")throw new u("expected value, found comma",{toml:e,ptr:t-1});if(l==="#")t=g(e,t);else if(l!==" "&&l!==" "&&l!==`
|
|
72
|
-
`&&l!=="\r"){let n=v(e,t-1,"]",r-1,i);o.push(n[0]),t=n[1]}}if(!l)throw new u("unfinished array encountered",{toml:e,ptr:t});return[o,t]}function O(e,t,r,i){let o=t,l=r,n,a=!1,f;for(let s=0;s<e.length;s++){if(s){if(o=a?o[n]:o[n]={},l=(f=l[n]).c,i===0&&(f.t===1||f.t===2))return null;if(f.t===2){let d=o.length-1;o=o[d],l=l[d].c}}if(n=e[s],(a=Object.hasOwn(o,n))&&l[n]?.t===0&&l[n]?.d)return null;a||(n==="__proto__"&&(Object.defineProperty(o,n,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(l,n,{enumerable:!0,configurable:!0,writable:!0})),l[n]={t:s<e.length-1&&i===2?3:i,d:!1,i:0,c:{}})}if(f=l[n],f.t!==i&&!(i===1&&f.t===3)||(i===2&&(f.d||(f.d=!0,o[n]=[]),o[n].push(o={}),f.c[f.i++]=f={t:1,d:!1,i:0,c:{}}),f.d))return null;if(f.d=!0,i===1)o=a?o[n]:o[n]={};else if(i===0&&a)return null;return[n,o,f.c]}function V(e,{maxDepth:t=1e3,integersAsBigInt:r}={}){let i={},o={},l=i,n=o;for(let a=p(e,0);a<e.length;){if(e[a]==="["){let f=e[++a]==="[",s=x(e,a+=+f,"]");if(f){if(e[s[1]-1]!=="]")throw new u("expected end of table declaration",{toml:e,ptr:s[1]-1});s[1]++}let d=O(s[0],i,o,f?2:1);if(!d)throw new u("trying to redefine an already defined table or value",{toml:e,ptr:a});n=d[2],l=d[1],a=s[1]}else{let f=x(e,a),s=O(f[0],l,n,0);if(!s)throw new u("trying to redefine an already defined table or value",{toml:e,ptr:a});let d=v(e,f[1],void 0,t,r);s[1][s[0]]=d[0],a=d[1]}if(a=p(e,a,!0),e[a]&&e[a]!==`
|
|
73
|
-
`&&e[a]!=="\r")throw new u("each key-value declaration must be followed by an end-of-line",{toml:e,ptr:a});a=p(e,a)}return i}export{w as TomlDate,u as TomlError,V as parse};
|
|
1
|
+
import{a as nt,e as st,l as At,z as O}from"../packem_shared/index-DHD8wb6Z.js";import{L as Et}from"../packem_shared/index-BisalDCf.js";import{p as bt}from"./cli-main.js";import{X as xt,O as Ct,H as S,q as L,M as W,r as E,F as N,t as G,Q as V,Y as jt,U as K,u as kt,W as D,v as J,C as Y,w as Lt,G as Wt,P as Ut,x as St,y as Tt,z as Ot,Z as Pt,A as _t,B as It,E as Rt,I as zt,J as Nt,K as vt,L as Ft,N as Mt,V as Bt}from"../packem_shared/formatBytes-BHAzNIrn-DFIppnY0.js";import{P as I,L as qt}from"./catalog.js";const Qt=(t,e)=>typeof t!="string"||t===""?"":t[0].toLowerCase()+t.slice(1),Gt=new RegExp("[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))","g"),Vt=t=>{if(typeof t!="string")throw new TypeError(`The "value" argument must be of type string. Received ${typeof t}`);return t.replaceAll(Gt,"")},v=new I(1e3),Kt=/[.*+?^${}()|[\]\\]/g,Dt=t=>{const e=t.join("");if(v.has(e)){const r=v.get(e);return r.lastIndex=0,r}const s=t.map(r=>r.replaceAll(Kt,String.raw`\$&`)).join("|"),n=new RegExp(s,"g");return v.set(e,n),n},Jt=t=>{const e=[];let s=0,n;for(L.lastIndex=0;(n=L.exec(t))!==null;)n.index>s&&e.push(t.slice(s,n.index)),e.push(n[0]),s=L.lastIndex;return s<t.length&&e.push(t.slice(s)),e.filter(Boolean)},Yt=/[ČŠŽĐ]/i,rt=new Uint8Array(128),ot=new Uint8Array(128),it=new Uint8Array(128);for(let t=0;t<128;t++)rt[t]=t>=65&&t<=90?1:0,ot[t]=t>=97&&t<=122?1:0,it[t]=t>=48&&t<=57?1:0;const F=t=>rt[t],X=t=>ot[t],M=t=>it[t],j=(t,e,s,n,r)=>{if(t.length===0)return[];let o=!1;const a=Object.values(e);for(const u of a)if(u(t[0])){o=!0;break}if(!o&&!s)return[t];const l=[...t],h=[];let i=l[0],p="other";const d=Object.entries(e);for(const u of d){const[f,g]=u;if(g(l[0])){p=f;break}}let c=s&&n?l[0]===l[0].toLocaleUpperCase(n):!1;for(let u=1;u<l.length;u++){const f=l[u];let g="other";for(const w of d){const[$,A]=w;if(A(f)){g=$;break}}const y=s&&n?f===f.toLocaleUpperCase(n):!1;let m=!1;r?m=r(p,g,c,y,f,u,l):(p!==g&&p!=="other"&&g!=="other"&&(m=!0),s&&g!=="other"&&!c&&y&&(m=!0)),m?(h.push(i),i=f):i+=f,p=g,s&&(c=y)}return i&&i.length>0&&h.push(i),h.length>0?h:[t]},Xt=(t,e,s,n)=>{if(s.size===0)return e;for(const r of s)if(t.startsWith(r,e))return n.push(r),e+r.length;return e},lt=(t,e=new Set)=>{if(t.length===0)return[];if(t.toUpperCase()===t)return[t];let s=0;const n=[],r=t.length;for(let o=1;o<r;o++){const a=Xt(t,s,e,n);if(a!==s){s=a,o=s-1;continue}const l=t.codePointAt(o-1),h=t.codePointAt(o),i=l&&l<128&&F(l),p=h&&h<128&&F(h),d=l&&l<128&&X(l),c=l&&l<128&&M(l),u=h&&h<128&&M(h);if(d&&p){n.push(t.slice(s,o)),s=o;continue}if(c&&!u||!c&&u){n.push(t.slice(s,o)),s=o;continue}if(u&&!c){let f=!1,g=!1;if(o+1<r){const y=t.codePointAt(o+1);f=y&&y<128&&F(y),g=y&&y<128&&M(y)}if(!g&&f){n.push(t.slice(s,o),t.slice(o,o+1)),s=o+1;continue}}if(o+1<r){const f=t.codePointAt(o+1),g=f&&f<128&&X(f);if(i&&p&&g){const y=t.slice(s,o+1);e.has(y)||(n.push(t.slice(s,o)),s=o)}}}return s<r&&n.push(t.slice(s)),n.filter(o=>o!=="")},at=(t,e,s)=>{if(t.length===0)return[];const n=t===t.toLocaleUpperCase(e);if(e.startsWith("de")){if(!n&&t.replaceAll("ß","SS")===t.toLocaleUpperCase(e))return[t];const i=[...t],p=i.length,d=[];let c=i[0],u=i[0]===i[0].toLocaleUpperCase(e),f=u,g=u?0:-1;for(let y=1;y<p;y++){const m=i[y],w=m===m.toLocaleUpperCase(e);if(w===u)c+=m;else if(w)c&&c.length>0&&(d.push(c),c=m),f=!0,g=y;else{if(f&&y-g>1){const $=i[y-1],A=c.slice(0,-1);A&&A.length>0&&d.push(A),c=$+m}else c+=m;f=!1,g=-1}u=w}return c&&c.length>0&&d.push(c),d}if(e.startsWith("uk")||e.startsWith("ru")||e.startsWith("bg")||e.startsWith("sr")||e.startsWith("mk")||e.startsWith("be")){if(!W.test(t)&&!E.test(t))return[t];const i=[...t],p=i.length,d=[];let c=i[0];const u=i[0];let f;W.test(u)?f=1:E.test(u)?f=2:f=0;let g=u===u.toLocaleUpperCase(e);for(let m=1;m<p;m++){const w=i[m];let $;W.test(w)?$=1:E.test(w)?$=2:$=0;const A=w===w.toLocaleUpperCase(e);f!==$&&(f===1||f===2)&&($===1||$===2)||$===f&&!g&&A?(d.push(c),c=w):c+=w,f=$,g=A}c&&c.length>0&&d.push(c);const y=[];for(let m=0;m<d.length;m++)m<d.length-1&&d[m].length===1&&E.test(d[m])&&W.test(d[m+1][0])?(y.push(d[m]+d[m+1]),m+=1):y.push(d[m]);return y}if(e.startsWith("el")){if(!N.test(t)&&!E.test(t))return[t];const i=[];G.lastIndex=0;let p;for(;(p=G.exec(t))!==null;)i.push(p[0]);i.length===0&&i.push(t);const d=[];if(i.length===1){const c=i[0];if(!c||!N.test(c[0])||c.length===1)return[c??t]}for(const c of i){if(!c)continue;if(!N.test(c[0])||c.length===1){d.push(c);continue}const u=c.length;let f=c[0],g=c[0]===c[0].toLocaleUpperCase(e);for(let y=1;y<u;y++){const m=c[y],w=m===m.toLocaleUpperCase(e);!g&&w?(d.push(f),f=m):f+=m,g=w}f&&d.push(f)}return d}if(e.startsWith("ja")||e.startsWith("ko")){const i=e.startsWith("ja"),p=i?{hiragana:c=>kt.test(c),kanji:c=>K.test(c),katakana:c=>jt.test(c),latin:c=>E.test(c)}:{hangul:c=>D.test(c),latin:c=>E.test(c)},d=new Set(["が","で","と","に","の","は","へ","も","や","を"]);if(i){const c=j(t,p,!1,e,(f,g)=>f==="hiragana"&&g==="katakana"||f==="katakana"&&g==="hiragana"||f==="hiragana"&&g==="latin"||f==="katakana"&&g==="latin"||f==="kanji"&&g==="latin"||f==="latin"&&(g==="hiragana"||g==="katakana"||g==="kanji")),u=[];for(const f of c){const g=f;g.length===1&&d.has(g)&&u.length>0?u[u.length-1]=u.at(-1)+g:u.push(g)}return u.length>0?u:[t]}return j(t,p,!1,e,(c,u)=>c==="hangul"&&u==="latin"||c==="latin"&&u==="hangul")}if(e.startsWith("sl")){const i=[...t],p=i.length,d=[];let c=i[0],u=i[0]===i[0].toLocaleUpperCase(e);for(let f=1;f<p;f++){const g=i[f],y=g===g.toLocaleUpperCase(e),m=Yt.test(g),w=f<p-1&&i[f+1]===i[f+1].toLocaleUpperCase(e);!u&&y||m&&w?(d.push(c),c=g,m&&w&&(d.push(c),c="")):c+=g,u=y}return c&&c.length>0&&d.push(c),d}if(e.startsWith("zh"))return j(t,{han:i=>K.test(i),latin:i=>E.test(i)},!1,e);if(["ar","fa","he","ur"].includes(e.split("-")[0])){const i=p=>J.test(p)||Y.test(p);return j(t,{latin:p=>E.test(p),rtl:p=>i(p)},!1,e)}if(["am","bn","gu","hi","km","kn","lo","ml","mr","ne","or","pa","si","ta","te","th"].includes(e.split("-")[0])){const i=p=>Lt.test(p)||Wt.test(p)||Ut.test(p)||St.test(p)||Tt.test(p)||Ot.test(p)||Pt.test(p)||_t.test(p)||It.test(p)||Rt.test(p)||zt.test(p)||Nt.test(p)||vt.test(p)||Ft.test(p)||Mt.test(p)||Bt.test(p);return j(t,{indic:p=>i(p),latin:p=>E.test(p)},!1,e)}if(["be","bg","ru","sr","uk"].includes(e))return j(t,{cyrillic:i=>W.test(i),latin:i=>E.test(i)},!0,e);if(["ar","fa","he"].includes(e))return j(t,{latin:i=>E.test(i),rtl:i=>J.test(i)||Y.test(i)},!1,e);if(e.startsWith("ko"))return j(t,{hangul:i=>D.test(i),latin:i=>E.test(i)},!1,e);if(e.startsWith("uz")){if(!W.test(t)&&!E.test(t))return[t];const i=[...t],p=i.length,d=[];let c=i[0],u=i[0]===i[0].toLocaleUpperCase(e);for(let f=1;f<p;f++){const g=i[f],y=g===g.toLocaleUpperCase(e);if(V.test(g)||V.test(i[f-1])){c+=g;continue}!u&&y?(d.push(c),c=g):c+=g,u=y}return c&&c.length>0&&d.push(c),d}const r=[...t],o=r.length,a=[];let l=r[0],h=r[0]===r[0].toLocaleUpperCase(e);for(const i of s)if(t.startsWith(i)){a.push(i),l=r[i.length],h=l===l.toLocaleUpperCase(e);break}for(let i=1;i<o;i++){const p=r[i],d=p===p.toLocaleUpperCase(e);let c=0;for(const u of s)if(t.startsWith(u,i)){a.push(l,u),c=u.length,l="";const f=u.at(-1);f&&(h=f===f.toLocaleUpperCase(e));break}if(c>0){i+=c-1;continue}!h&&d?(a.push(l),l=p):l+=p,h=d}return l&&a.push(l),a},Zt=(t,e,s)=>{const n=[],r=S.test(t)?t.split(S).filter(Boolean):[t];for(const o of r){const a=o;if(S.test(a))n.push(a);else{L.lastIndex=0;const l=L.test(a)?Jt(a).filter(Boolean):[a];for(const h of l)if(L.lastIndex=0,L.test(h))n.push(h);else if(e){const i=e.toLowerCase().split("-")[0];n.push(...at(h,i,s))}else n.push(...lt(h,s))}}return n},R=(t,e={})=>{if(!t||typeof t!="string")return[];const{handleAnsi:s=!1,handleEmoji:n=!1,knownAcronyms:r=[],locale:o,normalize:a=!1,separators:l,stripAnsi:h=!1,stripEmoji:i=!1}=e,p=new Set([...r].toSorted((m,w)=>w.length-m.length));let d=t;h&&(d=Vt(d)),i&&(d=xt(d));let c;Array.isArray(l)?c=Dt(l):l instanceof RegExp?c=l:c=Ct;const u=[];let f=d;const g=c.flags.includes("g")?c:new RegExp(c.source,`${c.flags}g`);for(;f.length>0;){const m=g.exec(f);if(!m){f===".."?u.push(".."):f==="."?u.push("."):f.length>0&&u.push(f);break}const w=m.index,$=m[0],A=$.length,T=f.slice(0,w),$t=f.slice(w+A);if($.startsWith("../"))u.push(".."),f=f.slice(w+3);else if($.startsWith("./"))u.push("."),f=f.slice(w+2);else if(w===0&&$==="..")u.push(".."),f=f.slice(2);else if(w===0&&$===".")u.push("."),f=f.slice(1);else{T.length>0&&u.push(T);let x=0;for(;(x=$.indexOf("../",x))!==-1;)u.push(".."),x+=3;for(x=0;(x=$.indexOf("./",x))!==-1;)(x===0||$[x-1]!==".")&&u.push("."),x+=2;let C=$t;for(;C.startsWith("../");)u.push(".."),C=C.slice(3);for(;C.startsWith("./");)u.push("."),C=C.slice(2);if(C===".."){u.push("..");break}else if(C==="."){u.push(".");break}else f=C}g.lastIndex=0}if(u.length===0){const m=d.split(c).filter(Boolean);u.push(...m)}let y=[];for(const m of u)s||n?y.push(...Zt(m,o,p)):o?y.push(...at(m,o,p)):y.push(...lt(m,p));return a&&(y=y.map(m=>p.has(m)?m:o&&m===m.toLocaleUpperCase(o)?m[0]+m.slice(1).toLocaleLowerCase(o):m.toUpperCase()===m&&!p.has(m)?m.slice(0,1)+m.slice(1).toLowerCase():m)),y},q=(t,e)=>typeof t!="string"||t===""?"":(e?.locale?t[0].toLocaleUpperCase(e.locale):t[0].toUpperCase())+t.slice(1),Ht=(t,e)=>`${t}::${e?.joiner??""}::${e?.locale??""}::${e?.knownAcronyms?.join(",")??""}::${e?.normalize?"true":"false"}::${e?.stripAnsi?"true":"false"}::${e?.stripEmoji?"true":"false"}::${e?.handleAnsi?"true":"false"}::${e?.handleEmoji?"true":"false"}`,z=(t,e)=>{const{length:s}=t;if(s===0)return"";if(s===1)return t[0];const n=[];let r="",o="";for(let a=0;a<s;a++){const l=t[a];if(S.test(l)){r?(n.push(r+o+l),r="",o=""):(n.length>0&&n.push(e),r=l);continue}r?(o&&(o+=e),o+=l):(n.length>0&&n.push(e),n.push(l))}return n.join("")},te=/(?<![a-zß])SS(?![a-z])/g,ee=t=>t.replaceAll(te,"ß"),ne=(t,e)=>{if(typeof t!="string"||!t)return"";let s=!0;return z(R(t,{handleAnsi:e?.handleAnsi,handleEmoji:e?.handleEmoji,knownAcronyms:e?.knownAcronyms,locale:e?.locale,normalize:e?.normalize,separators:void 0,stripAnsi:e?.stripAnsi,stripEmoji:e?.stripEmoji}).map(r=>{const o=r,a=o.toLowerCase();return s?(s=!1,Qt(a)):q(a,e)}),"")},se=new I(1e3),Q=(t,e)=>{if(typeof t!="string")return"";const s=e?.cache??!1,n=e?.cacheStore??se;let r;if(s&&(r=Ht(t,e)),s&&r&&n.has(r))return n.get(r);const o=R(t,{handleAnsi:e?.handleAnsi,handleEmoji:e?.handleEmoji,knownAcronyms:e?.knownAcronyms,locale:e?.locale,normalize:e?.normalize,separators:void 0,stripAnsi:e?.stripAnsi,stripEmoji:e?.stripEmoji}).map(l=>{if(e?.handleAnsi&&S.test(l))return l;if(e?.toUpperCase)return e.locale?l.toLocaleUpperCase(e.locale):l.toUpperCase();const h=e?.locale?.startsWith("de")?ee(l):l;return e?.locale?h.toLocaleLowerCase(e.locale):h.toLowerCase()}),a=z(o,e?.joiner??"-");return s&&r&&n.set(r,a),a},re=new I(1e3),oe=(t,e)=>Q(t,{cacheStore:re,...e,joiner:"_",toUpperCase:!0}),ie=(t,e)=>typeof t!="string"||!t?"":z(R(t,{handleAnsi:e?.handleAnsi,handleEmoji:e?.handleEmoji,knownAcronyms:e?.knownAcronyms,locale:e?.locale,normalize:e?.normalize,separators:void 0,stripAnsi:e?.stripAnsi,stripEmoji:e?.stripEmoji}).map(n=>q(n.toLowerCase(),{locale:e?.locale})),""),le=new I(1e3),ae=(t,e)=>Q(t,{cacheStore:le,...e,joiner:"_"}),ce=(t,e)=>typeof t!="string"?"":z(R(t,{handleAnsi:e?.handleAnsi,handleEmoji:e?.handleEmoji,knownAcronyms:e?.knownAcronyms,locale:e?.locale,normalize:e?.normalize,separators:void 0,stripAnsi:e?.stripAnsi,stripEmoji:e?.stripEmoji}).map(n=>q(n,{locale:e?.locale})),"-"),b=t=>t==null?"":typeof t=="string"?t:typeof t=="number"||typeof t=="boolean"||typeof t=="bigint"?String(t):JSON.stringify(t),Z={camel_case:t=>ne(b(t)),kebab_case:t=>Q(b(t)),lower_case:t=>b(t).toLowerCase(),pascal_case:t=>ie(b(t)),path_join:(t,...e)=>{const s=[b(t),...e.map(n=>b(n))];return st(...s)},path_relative:(t,e)=>nt(b(e),b(t)),snake_case:t=>ae(b(t)),upper_case:t=>b(t).toUpperCase(),upper_kebab_case:t=>ce(b(t)),upper_snake_case:t=>oe(b(t))},ct=(t,e,s=[])=>{const n=Z[t];if(!n)throw new Error(`Unknown filter "${t}". Known filters: ${Object.keys(Z).sort().join(", ")}.`);return n(e,...s)},ft=t=>{const e=[];let s=0,n=0,r,o=-1;for(const a of t){if(o+=1,r){a===r&&(r=void 0);continue}if(a==='"'||a==="'"){r=a;continue}a==="("?s+=1:a===")"?s-=1:a===","&&s===0&&(e.push(t.slice(n,o)),n=o+1)}return e.push(t.slice(n)),e},fe=t=>{if(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))return t.slice(1,-1)},ue=/\[([^\]]+)\]/g,pe=t=>{const e=t.trim(),s=e.indexOf("(");if(s===-1)return{args:[],name:e};if(!e.endsWith(")"))throw new Error(`Filter call "${t}" missing closing ")"`);const n=e.slice(0,s).trim(),r=e.slice(s+1,-1).trim();return r===""?{args:[],name:n}:{args:ft(r).map(a=>{const l=a.trim();return fe(l)??l}),name:n}},he=t=>{const e=t.split("|").map(r=>r.trim()),s=e[0]??"";if(!s)throw new Error(`Empty variable name in expression "${t}"`);return{filters:e.slice(1).map(r=>pe(r)),name:s}},de=t=>t==null?"":typeof t=="string"?t:typeof t=="number"||typeof t=="boolean"||typeof t=="bigint"?String(t):JSON.stringify(t),me=(t,e)=>{const s=t.replaceAll(ue,(n,r)=>{const{filters:o,name:a}=he(r);if(!Object.hasOwn(e,a))throw new Error(`Variable "${a}" used in filename "${t}" but not defined`);let l=e[a];for(const h of o)l=ct(h.name,l,h.args);return de(l)});return ut(s)},ut=t=>t.split("/").map(e=>e.endsWith(".tera")||e.endsWith(".twig")?e.slice(0,-5):e).join("/"),ge=t=>t.endsWith(".raw")?t.slice(0,-4):t,ye=t=>{const e=t.split("/");return(e.at(-1)??"").startsWith("_")?!0:e.slice(0,-1).includes("partials")},k="---",we=(t,e)=>{if(!t.startsWith(`${k}
|
|
2
|
+
`)&&!t.startsWith(`${k}\r
|
|
3
|
+
`))return{body:t};const s=t.indexOf(`
|
|
4
|
+
${k}`,k.length);if(s===-1)return{body:t};let n=s+1+k.length;t[n]==="\r"&&(n+=1),t[n]===`
|
|
5
|
+
`&&(n+=1);const r=t.startsWith(`${k}\r
|
|
6
|
+
`)?k.length+2:k.length+1,o=t.slice(r,s).replaceAll("\r","");let a;try{a=e(o)}catch(l){const h=l instanceof Error?l.message:String(l);throw new Error(`Failed to parse frontmatter YAML: ${h}`,{cause:l})}if(a==null)return{body:t.slice(n)};if(typeof a!="object"||Array.isArray(a))throw new TypeError(`Frontmatter must be a YAML mapping, got ${Array.isArray(a)?"array":typeof a}`);return{body:t.slice(n),frontmatter:a}},$e=/\{\{-?(.+?)-?\}\}|\{%-?(.+?)-?%\}/gs,pt=t=>{const e=[];let s=0,n=1;const r=o=>{for(const a of o)a===`
|
|
7
|
+
`&&(n+=1)};for(const o of t.matchAll($e)){const a=o.index??0;if(a>s){const i=t.slice(s,a);e.push({line:n,type:"text",value:i}),r(i)}const l=n,h=o[0];h.startsWith("{{")?e.push({line:l,type:"expr",value:(o[1]??"").trim()}):e.push({line:l,type:"stmt",value:(o[2]??"").trim()}),r(h),s=a+h.length}if(s<t.length){const o=t.slice(s);e.push({line:n,type:"text",value:o})}return e},Ae=new Set(["block","endblock","endfilter","endmacro","extends","filter","import","macro","set"]),ht=(t,e)=>{let s=0;const n=(o,a)=>{throw new Error(`${e}:${o}: ${a}`)},r=o=>{const a=[];for(;s<t.length;){const l=t[s];if(l.type==="text"){a.push({type:"text",value:l.value}),s+=1;continue}if(l.type==="expr"){a.push({expression:l.value,line:l.line,type:"expr"}),s+=1;continue}const h=l.value.split(/\s+/)[0]??"";if(o.includes(h))return a;if(Ae.has(h)&&n(l.line,`Tera feature "{% ${h} %}" is not supported. Supported: if/else/endif, for/endfor, include. Rewrite the template to avoid macros, set, extends, block, and import.`),h==="if"){s+=1;const i=l.value.slice(2).trim(),p=r(["else","endif"]);let d;s<t.length&&t[s].type==="stmt"&&t[s].value.split(/\s+/)[0]==="else"&&(s+=1,d=r(["endif"])),(s>=t.length||t[s].type!=="stmt"||t[s].value.split(/\s+/)[0]!=="endif")&&n(l.line,"Unterminated {% if %} — missing {% endif %}"),s+=1,a.push({alternate:d,condition:i,consequent:p,line:l.line,type:"if"});continue}if(h==="for"){s+=1;const i=l.value.slice(3).trim(),p=i.indexOf(" in ");p===-1&&n(l.line,"Malformed {% for %} — expected `for <name> in <collection>`");const d=i.slice(0,p).trim(),c=i.slice(p+4).trim();(!d||!c)&&n(l.line,"Malformed {% for %} — missing binding or collection");const u=r(["endfor"]);(s>=t.length||t[s].type!=="stmt"||t[s].value.split(/\s+/)[0]!=="endfor")&&n(l.line,"Unterminated {% for %} — missing {% endfor %}"),s+=1,a.push({binding:d,body:u,collection:c,line:l.line,type:"for"});continue}if(h==="include"){s+=1;const i=l.value.slice(7).trim(),p=dt(i);p===void 0&&n(l.line,"Malformed {% include %} — expected a quoted partial name"),a.push({line:l.line,name:p,type:"include"});continue}n(l.line,`Unknown tag "{% ${h} %}". Supported: if, for, include.`)}return a};return r([])},dt=t=>{if(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))return t.slice(1,-1)},Ee=t=>t==null?"":typeof t=="boolean"||typeof t=="number"?String(t):typeof t=="string"?t:JSON.stringify(t),be=t=>t==null||t===!1||t===0||t===""?!1:Array.isArray(t)?t.length>0:!0,mt=(t,e,s,n,r=!0)=>{const o=t.split(".");if(r&&o.length>0&&!Object.hasOwn(e,o[0]))throw new Error(`${n}:${s}: Variable "${t}" is not defined`);let a=e;for(const l of o){if(a==null)return;if(typeof a!="object")throw new TypeError(`${n}:${s}: Cannot read "${l}" on non-object value`);a=a[l]}return a},xe=t=>{const e=[];let s=0,n=0,r;for(let o=0;o<t.length;o+=1){const a=t[o];if(r){a===r&&(r=void 0);continue}if(a==='"'||a==="'"){r=a;continue}a==="("?s+=1:a===")"?s-=1:a==="|"&&s===0&&(e.push(t.slice(n,o)),n=o+1)}return e.push(t.slice(n)),e},Ce=t=>{const e=t.trim(),s=e.indexOf("(");if(s===-1)return{args:[],name:e};if(!e.endsWith(")"))throw new Error(`Filter call "${t}" missing closing ")"`);const n=e.slice(0,s).trim(),r=e.slice(s+1,-1).trim();return r?{args:ft(r).map(o=>o.trim()),name:n}:{args:[],name:n}},_=(t,e,s,n,r=!0)=>{const o=t.trim();if(o==="true")return!0;if(o==="false")return!1;if(o==="null"||o==="none")return null;const a=dt(o);return a!==void 0?a:/^-?\d+(?:\.\d+)?$/.test(o)?Number(o):mt(o,e,s,n,r)},gt=(t,e,s,n,r=!0)=>{const o=xe(t),a=o[0].trim();let l=_(a,e,s,n,r);for(let h=1;h<o.length;h+=1){const i=o[h].trim(),{args:p,name:d}=Ce(i),c=p.map(u=>_(u,e,s,n,r));try{l=ct(d,l,c)}catch(u){const f=u instanceof Error?u.message:String(u);throw new Error(`${n}:${s}: ${f}`,{cause:u})}}return l},yt=(t,e)=>{let s,n=0;for(let r=0;r<=t.length-e.length;r+=1){const o=t[r];if(s){o===s&&(s=void 0);continue}if(o==='"'||o==="'"){s=o;continue}if(o==="("){n+=1;continue}if(o===")"){n-=1;continue}if(n===0&&t.slice(r,r+e.length)===e)return r}return-1},H=(t,e)=>{const s=[];let n=0,r=0;for(;r<=t.length-e.length;){const o=yt(t.slice(r),e);if(o===-1)break;s.push(t.slice(n,r+o)),r+=o+e.length,n=r}return s.push(t.slice(n)),s},U=(t,e,s,n)=>{const r=t.trim();if(r==="")return!1;if(r.startsWith("(")&&r.endsWith(")")&&je(r)===r.length-1)return U(r.slice(1,-1),e,s,n);const o=H(r," or ");if(o.length>1)return o.some(l=>U(l,e,s,n));const a=H(r," and ");if(a.length>1)return a.every(l=>U(l,e,s,n));if(r.startsWith("not "))return!U(r.slice(4),e,s,n);for(const l of["==","!="]){const h=yt(r,l);if(h!==-1){const i=_(r.slice(0,h),e,n,s,!1),p=_(r.slice(h+l.length),e,n,s,!1),d=i===p;return l==="=="?d:!d}}return be(gt(r,e,n,s,!1))},je=t=>{if(t[0]!=="(")return-1;let e=0,s,n=-1;for(const r of t){if(n+=1,s){r===s&&(s=void 0);continue}if(r==='"'||r==="'"){s=r;continue}if(r==="(")e+=1;else if(r===")"&&(e-=1,e===0))return n}return-1},P=(t,e)=>{let s="";for(const n of t){if(n.type==="text"){s+=n.value;continue}if(n.type==="expr"){s+=Ee(gt(n.expression,e.scope,n.line,e.filename));continue}if(n.type==="if"){const r=U(n.condition,e.scope,e.filename,n.line)?n.consequent:n.alternate??[];s+=P(r,e);continue}if(n.type==="for"){const r=mt(n.collection,e.scope,n.line,e.filename,!1);if(r==null)continue;if(!Array.isArray(r))throw new TypeError(`${e.filename}:${n.line}: {% for %} expected an array, got ${typeof r}`);for(const o of r){const a={...e.scope,[n.binding]:o};s+=P(n.body,{...e,scope:a})}continue}if(n.type==="include"){const r=e.partials?.get(n.name);if(!r)throw new Error(`${e.filename}:${n.line}: Partial "${n.name}" not found. Available: ${[...e.partials?.keys()??[]].join(", ")||"(none)"}`);const o=e.includeStack??new Set;if(o.has(n.name)){const a=[...o,n.name].join(" → ");throw new Error(`${e.filename}:${n.line}: Circular partial include detected: ${a}`)}o.add(n.name);try{s+=P(r,{...e,filename:`<partial:${n.name}>`,includeStack:o})}finally{o.delete(n.name)}}}return s},ke=(t,e)=>ht(pt(t),e),B=(t,e)=>P(ht(pt(t),e.filename),e),tt="template.yml",Le=".raw",We=new Set([".cjs",".css",".env",".gitattributes",".gitignore",".graphql",".html",".ini",".js",".json",".json5",".jsonc",".jsx",".lock",".md",".mdx",".mjs",".prettierrc",".raw",".rs",".scss",".sh",".sql",".svg",".tera",".toml",".ts",".tsx",".twig",".txt",".vue",".xml",".yaml",".yml"]),Ue=new Set(["Brewfile","CHANGELOG","CODEOWNERS","CONTRIBUTING","COPYING","Dockerfile","Gemfile","LICENCE","LICENSE","Makefile","NOTICE","Procfile","Rakefile","README","VERSION"]),Se=t=>{const e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\")),s=e===-1?t:t.slice(e+1),n=s.lastIndexOf(".");return n===-1||n===0?"":s.slice(n).toLowerCase()},wt=t=>{const e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return e===-1?t:t.slice(e+1)},Te=t=>{const e=Se(t);if(e!=="")return We.has(e);const s=wt(t);return Ue.has(s)},Oe=t=>{const e={default:t.default,internal:t.internal,order:t.order,prompt:t.prompt,required:t.required};switch(t.type){case"array":return{...e,type:"array"};case"boolean":return{...e,default:typeof e.default=="boolean"?e.default:void 0,type:"boolean"};case"enum":return{...e,multiple:t.multiple,type:"enum",values:t.values??[]};case"number":return{...e,type:"number"};case"string":return{...e,type:"string"};default:throw new Error(`Unsupported variable type "${String(t.type)}"`)}},Pe=t=>t.replaceAll("\\","/").replace(/^\.\//,"").replaceAll(/\/+/g,"/"),_e=(t,e,s)=>{const n=e.split("/").filter(Boolean);if(n.length===0)throw new Error("Empty destination path for value");let r=t;for(let o=0;o<n.length-1;o+=1){const a=n[o],l=r[a];if(l===void 0){const h={};r[a]=h,r=h}else if(typeof l=="object"&&!Buffer.isBuffer(l))r=l;else throw new TypeError(`Path conflict: "${n.slice(0,o+1).join("/")}" is both a file and a directory`)}r[n.at(-1)]=s},et=(t,e,s)=>{if(typeof t!="string")return Ie(t);const n=t.includes("{{")||t.includes("{%")?B(t,{filename:`${s}#frontmatter`,scope:e}):t;return U(n,e,`${s}#frontmatter`,1)},Ie=t=>t==null||t===!1||t===0||t===""?!1:Array.isArray(t)?t.length>0:typeof t=="string"?t!=="false"&&t!=="0":!0,Be=(t,e)=>{const s=st(t,tt),n=At(s);if(!n||typeof n!="object")throw new Error(`${s}: must contain a YAML mapping`);const r={};if(n.variables)for(const[h,i]of Object.entries(n.variables))r[h]=Oe(i);const o=new Map,a=[];for(const h of qt(t,{includeDirs:!1,includeSymlinks:!1})){if(h.path===s)continue;const i=nt(t,h.path).replaceAll("\\","/");if(i===tt)continue;if(ye(i)){const c=O(h.path),u=ke(c,i);for(const f of Re(i))o.has(f)&&o.get(f)!==u&&bt.warn(`partial name "${f}" is declared by multiple files — last one wins. Use distinct names or fully-qualified includes.`),o.set(f,u);continue}if(i.endsWith(Le)){const c=O(h.path);a.push({binary:null,isRaw:!0,rawText:c,relativePath:i});continue}if(Te(i)){const c=O(h.path);a.push({binary:null,isRaw:!1,rawText:c,relativePath:i});continue}const d=O(h.path,{buffer:!0});a.push({binary:d,isRaw:!1,rawText:null,relativePath:i})}const l=h=>{const i={...h.builtins,...h.options},p={},d={};for(const u of a){const f=u.relativePath;let g,y,m=!1;if(u.binary)g=u.binary;else if(u.isRaw)g=u.rawText??"";else{const $=u.rawText??"",A=we($,T=>Et(T));if(A.frontmatter){if(A.frontmatter.skip!==void 0&&et(A.frontmatter.skip,i,f)||A.frontmatter.if!==void 0&&!et(A.frontmatter.if,i,f))continue;typeof A.frontmatter.to=="string"&&(y=B(A.frontmatter.to,{filename:`${f}#frontmatter.to`,partials:o,scope:i})),A.frontmatter.force===!0&&(m=!0)}g=B(A.body,{filename:f,partials:o,scope:i})}const w=Pe(y??me(ge(f),i));_e(p,w,g),m&&(d[w]={force:!0})}const c={files:p};return Object.keys(d).length>0&&(c.filesMeta=d),c};return{about:{description:n.description??`Moon-format template at ${t}`,name:n.title??e},destination:n.destination,options:r,produce:l}},Re=t=>{const e=ut(t),s=wt(e),n=new Set([s,e]);if(s.startsWith("_")){n.add(s.replace(/^_+/,""));const r=e.slice(0,e.length-s.length);n.add(`${r}${s.replace(/^_+/,"")}`)}return[...n]};export{Be as loadMoonTemplate};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
3
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
4
|
+
*
|
|
5
|
+
* Redistribution and use in source and binary forms, with or without
|
|
6
|
+
* modification, are permitted provided that the following conditions are met:
|
|
7
|
+
*
|
|
8
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
9
|
+
* list of conditions and the following disclaimer.
|
|
10
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
11
|
+
* this list of conditions and the following disclaimer in the
|
|
12
|
+
* documentation and/or other materials provided with the distribution.
|
|
13
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
14
|
+
* may be used to endorse or promote products derived from this software without
|
|
15
|
+
* specific prior written permission.
|
|
16
|
+
*
|
|
17
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
18
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
19
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
20
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
21
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
22
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
23
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
24
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
25
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
26
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
27
|
+
*/let _=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i;class m extends Date{#n=!1;#i=!1;#e=null;constructor(n){let i=!0,l=!0,o="Z";if(typeof n=="string"){let f=n.match(_);f?(f[1]||(i=!1,n=`0000-01-01T${n}`),l=!!f[2],l&&n[10]===" "&&(n=n.replace(" ","T")),f[2]&&+f[2]>23?n="":(o=f[3]||null,n=n.toUpperCase(),!o&&l&&(n+="Z"))):n=""}super(n),isNaN(this.getTime())||(this.#n=i,this.#i=l,this.#e=o)}isDateTime(){return this.#n&&this.#i}isLocal(){return!this.#n||!this.#i||!this.#e}isDate(){return this.#n&&!this.#i}isTime(){return this.#i&&!this.#n}isValid(){return this.#n||this.#i}toISOString(){let n=super.toISOString();if(this.isDate())return n.slice(0,10);if(this.isTime())return n.slice(11,23);if(this.#e===null)return n.slice(0,-1);if(this.#e==="Z")return n;let i=+this.#e.slice(1,3)*60+ +this.#e.slice(4,6);return i=this.#e[0]==="-"?i:-i,new Date(this.getTime()-i*6e4).toISOString().slice(0,-1)+this.#e}static wrapAsOffsetDateTime(n,i="Z"){let l=new m(n);return l.#e=i,l}static wrapAsLocalDateTime(n){let i=new m(n);return i.#e=null,i}static wrapAsLocalDate(n){let i=new m(n);return i.#i=!1,i.#e=null,i}static wrapAsLocalTime(n){let i=new m(n);return i.#n=!1,i.#e=null,i}}/*!
|
|
28
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
29
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
30
|
+
*
|
|
31
|
+
* Redistribution and use in source and binary forms, with or without
|
|
32
|
+
* modification, are permitted provided that the following conditions are met:
|
|
33
|
+
*
|
|
34
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
35
|
+
* list of conditions and the following disclaimer.
|
|
36
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
37
|
+
* this list of conditions and the following disclaimer in the
|
|
38
|
+
* documentation and/or other materials provided with the distribution.
|
|
39
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
40
|
+
* may be used to endorse or promote products derived from this software without
|
|
41
|
+
* specific prior written permission.
|
|
42
|
+
*
|
|
43
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
44
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
45
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
46
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
47
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
48
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
49
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
50
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
51
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
52
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
53
|
+
*/function S(e,n){let i=e.slice(0,n).split(/\r\n|\n|\r/g);return[i.length,i.pop().length+1]}function P(e,n,i){let l=e.split(/\r\n|\n|\r/g),o="",f=(Math.log10(n+1)|0)+1;for(let t=n-1;t<=n+1;t++){let u=l[t-1];u&&(o+=t.toString().padEnd(f," "),o+=": ",o+=u,o+=`
|
|
54
|
+
`,t===n&&(o+=" ".repeat(f+i+2),o+=`^
|
|
55
|
+
`))}return o}class c extends Error{line;column;codeblock;constructor(n,i){const[l,o]=S(i.toml,i.ptr),f=P(i.toml,l,o);super(`Invalid TOML document: ${n}
|
|
56
|
+
|
|
57
|
+
${f}`,i),this.line=l,this.column=o,this.codeblock=f}}let v=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,A=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,D=/^[+-]?0[0-9_]/;function T(e,n){let i=e[n++],l=i,o=i==="'",f=i===e[n]&&i===e[n+1];f&&(e[n+=2]===`
|
|
58
|
+
`?n++:e[n]==="\r"&&e[n+1]===`
|
|
59
|
+
`&&(n+=2));let t="",u=n,a=0;for(let r=n;r<e.length;r++)if(i=e[r],f&&(i===`
|
|
60
|
+
`||i==="\r"&&e[r+1]===`
|
|
61
|
+
`))a=a&&3;else{if(i<" "&&i!==" "||i==="")throw new c("control characters are not allowed in strings",{toml:e,ptr:r});if((!a||a===3)&&i===l&&(!f||e[r+1]===l&&e[r+2]===l))return f&&(e[r+3]===l&&r++,e[r+3]===l&&r++),[a?t:t+e.slice(u,r),r+(f?3:1)];if(!a)!o&&i==="\\"&&(t+=e.slice(u,u=r),a=1);else if(a===1)if(i==="x"||i==="u"||i==="U"){let d=0,y=i==="x"?2:i==="u"?4:8;for(let b=0;b<y;b++,r++){let s=e.charCodeAt(r+1),h=s>=48&&s<=57?s-48:s>=65&&s<=70?s-65+10:s>=97&&s<=102?s-97+10:-1;if(h<0)throw new c("invalid non-hex character in unicode escape",{toml:e,ptr:r+1});d=d<<4|h}if(d<0||d>1114111||d>=55296&&d<=57343)throw new c("invalid unicode escape",{toml:e,ptr:r});t+=String.fromCodePoint(d),u=r+1,a=0}else if(i===" "||i===" ")a=2;else{if(i==="b")t+="\b";else if(i==="t")t+=" ";else if(i==="n")t+=`
|
|
62
|
+
`;else if(i==="f")t+="\f";else if(i==="r")t+="\r";else if(i==="e")t+="\x1B";else if(i==='"')t+='"';else if(i==="\\")t+="\\";else throw new c("unrecognized escape sequence",{toml:e,ptr:r});u=r+1,a=0}else if(i!==" "&&i!==" "){if(a===2)throw new c("invalid escape: only line-ending whitespace may be escaped",{toml:e,ptr:u});a=!o&&i==="\\"?1:0,u=r}}throw new c("unfinished string",{toml:e,ptr:n})}function L(e,n,i,l){if(e==="true")return!0;if(e==="false")return!1;if(e==="-inf")return-1/0;if(e==="inf"||e==="+inf")return 1/0;if(e==="nan"||e==="+nan"||e==="-nan")return NaN;if(e==="-0")return l?0n:0;let o=v.test(e);if(o||A.test(e)){if(D.test(e))throw new c("leading zeroes are not allowed",{toml:n,ptr:i});e=e.replace(/_/g,"");let t=+e;if(isNaN(t))throw new c("invalid number",{toml:n,ptr:i});if(o){if((o=!Number.isSafeInteger(t))&&!l)throw new c("integer value cannot be represented losslessly",{toml:n,ptr:i});(o||l===!0)&&(t=BigInt(e))}return t}const f=new m(e);if(!f.isValid())throw new c("invalid value",{toml:n,ptr:i});return f}function k(e,n=0,i=e.length){let l=e.indexOf(`
|
|
63
|
+
`,n);return e[l-1]==="\r"&&l--,l<=i?l:-1}function g(e,n){for(let i=n;i<e.length;i++){let l=e[i];if(l===`
|
|
64
|
+
`)return i;if(l==="\r"&&e[i+1]===`
|
|
65
|
+
`)return i+1;if(l<" "&&l!==" "||l==="")throw new c("control characters are not allowed in comments",{toml:e,ptr:n})}return e.length}function w(e,n,i,l){let o;for(;;){for(;(o=e[n])===" "||o===" "||!i&&(o===`
|
|
66
|
+
`||o==="\r"&&e[n+1]===`
|
|
67
|
+
`);)n++;if(l||o!=="#")break;n=g(e,n)}return n}function I(e,n,i,l,o=!1){if(!l)return n=k(e,n),n<0?e.length:n;for(let f=n;f<e.length;f++){let t=e[f];if(t==="#"){if(f=k(e,f),f<0)break}else{if(t===i)return f+1;if(t===l||o&&(t===`
|
|
68
|
+
`||t==="\r"&&e[f+1]===`
|
|
69
|
+
`))return f}}throw new c("cannot find end of structure",{toml:e,ptr:n})}function N(e,n,i){let l=e.slice(n,i),o=l.indexOf("#");return o>-1&&(g(e,o),l=l.slice(0,o)),[l.trimEnd(),o]}function O(e,n,i,l,o){if(l===0)throw new c("document contains excessively nested structures. aborting.",{toml:e,ptr:n});let f=e[n];if(f==="["||f==="{"){let[a,r]=f==="["?$(e,n,l,o):Z(e,n,l,o);if(i){if(r=w(e,r),e[r]===",")r++;else if(e[r]!==i)throw new c("expected comma or end of structure",{toml:e,ptr:r})}return[a,r]}if(f==='"'||f==="'"){let[a,r]=T(e,n);if(i){if(r=w(e,r),e[r]&&e[r]!==","&&e[r]!==i&&e[r]!==`
|
|
70
|
+
`&&e[r]!=="\r")throw new c("unexpected character encountered",{toml:e,ptr:r});e[r]===","&&r++}return[a,r]}let t=I(e,n,",",i),u=N(e,n,t-(e[t-1]===","?1:0));if(!u[0])throw new c("incomplete key-value declaration: no value specified",{toml:e,ptr:n});return i&&u[1]>-1&&(t=w(e,n+u[1]),e[t]===","&&t++),[L(u[0],e,n,o),t]}let j=/^[a-zA-Z0-9-_]+[ \t]*$/;function x(e,n,i="="){let l=n-1,o=[],f=e.indexOf(i,n);if(f<0)throw new c("incomplete key-value: cannot find end of key",{toml:e,ptr:n});do{let t=e[n=++l];if(t!==" "&&t!==" ")if(t==='"'||t==="'"){if(t===e[n+1]&&t===e[n+2])throw new c("multiline strings are not allowed in keys",{toml:e,ptr:n});let[u,a]=T(e,n);l=e.indexOf(".",a);let r=e.slice(a,l<0||l>f?f:l),d=k(r);if(d>-1)throw new c("newlines are not allowed in keys",{toml:e,ptr:n+l+d});if(r.trimStart())throw new c("found extra tokens after the string part",{toml:e,ptr:a});if(f<a&&(f=e.indexOf(i,a),f<0))throw new c("incomplete key-value: cannot find end of key",{toml:e,ptr:n});o.push(u)}else{l=e.indexOf(".",n);let u=e.slice(n,l<0||l>f?f:l);if(!j.test(u))throw new c("only letter, numbers, dashes and underscores are allowed in keys",{toml:e,ptr:n});o.push(u.trimEnd())}}while(l+1&&l<f);return[o,w(e,f+1,!0,!0)]}function Z(e,n,i,l){let o={},f=new Set,t;for(n++;(t=e[n++])!=="}"&&t;){if(t===",")throw new c("expected value, found comma",{toml:e,ptr:n-1});if(t==="#")n=g(e,n);else if(t!==" "&&t!==" "&&t!==`
|
|
71
|
+
`&&t!=="\r"){let u,a=o,r=!1,[d,y]=x(e,n-1);for(let h=0;h<d.length;h++){if(h&&(a=r?a[u]:a[u]={}),u=d[h],(r=Object.hasOwn(a,u))&&(typeof a[u]!="object"||f.has(a[u])))throw new c("trying to redefine an already defined value",{toml:e,ptr:n});!r&&u==="__proto__"&&Object.defineProperty(a,u,{enumerable:!0,configurable:!0,writable:!0})}if(r)throw new c("trying to redefine an already defined value",{toml:e,ptr:n});let[b,s]=O(e,y,"}",i-1,l);f.add(b),a[u]=b,n=s}}if(!t)throw new c("unfinished table encountered",{toml:e,ptr:n});return[o,n]}function $(e,n,i,l){let o=[],f;for(n++;(f=e[n++])!=="]"&&f;){if(f===",")throw new c("expected value, found comma",{toml:e,ptr:n-1});if(f==="#")n=g(e,n);else if(f!==" "&&f!==" "&&f!==`
|
|
72
|
+
`&&f!=="\r"){let t=O(e,n-1,"]",i-1,l);o.push(t[0]),n=t[1]}}if(!f)throw new c("unfinished array encountered",{toml:e,ptr:n});return[o,n]}function E(e,n,i,l){let o=n,f=i,t,u=!1,a;for(let r=0;r<e.length;r++){if(r){if(o=u?o[t]:o[t]={},f=(a=f[t]).c,l===0&&(a.t===1||a.t===2))return null;if(a.t===2){let d=o.length-1;o=o[d],f=f[d].c}}if(t=e[r],(u=Object.hasOwn(o,t))&&f[t]?.t===0&&f[t]?.d)return null;u||(t==="__proto__"&&(Object.defineProperty(o,t,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(f,t,{enumerable:!0,configurable:!0,writable:!0})),f[t]={t:r<e.length-1&&l===2?3:l,d:!1,i:0,c:{}})}if(a=f[t],a.t!==l&&!(l===1&&a.t===3)||(l===2&&(a.d||(a.d=!0,o[t]=[]),o[t].push(o={}),a.c[a.i++]=a={t:1,d:!1,i:0,c:{}}),a.d))return null;if(a.d=!0,l===1)o=u?o[t]:o[t]={};else if(l===0&&u)return null;return[t,o,a.c]}function C(e,{maxDepth:n=1e3,integersAsBigInt:i}={}){let l={},o={},f=l,t=o;for(let u=w(e,0);u<e.length;){if(e[u]==="["){let a=e[++u]==="[",r=x(e,u+=+a,"]");if(a){if(e[r[1]-1]!=="]")throw new c("expected end of table declaration",{toml:e,ptr:r[1]-1});r[1]++}let d=E(r[0],l,o,a?2:1);if(!d)throw new c("trying to redefine an already defined table or value",{toml:e,ptr:u});t=d[2],f=d[1],u=r[1]}else{let a=x(e,u),r=E(a[0],f,t,0);if(!r)throw new c("trying to redefine an already defined table or value",{toml:e,ptr:u});let d=O(e,a[1],void 0,n,i);r[1][r[0]]=d[0],u=d[1]}if(u=w(e,u,!0),e[u]&&e[u]!==`
|
|
73
|
+
`&&e[u]!=="\r")throw new c("each key-value declaration must be followed by an end-of-line",{toml:e,ptr:u});u=w(e,u)}return l}export{m as TomlDate,c as TomlError,C as parse};
|