@design-edito/tools 0.1.72 → 0.1.73
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/agnostic/arrays/find-duplicates/index.js +1 -1
- package/agnostic/arrays/index.js +8 -8
- package/agnostic/arrays/is-array-of/index.js +1 -1
- package/agnostic/arrays/make/index.js +1 -1
- package/agnostic/arrays/random-pick/index.js +5 -5
- package/agnostic/arrays/shuffle/index.js +1 -1
- package/agnostic/booleans/index.js +1 -1
- package/agnostic/booleans/is-falsy/index.js +1 -1
- package/agnostic/colors/complement-color/index.js +1 -1
- package/agnostic/colors/hex-to-rgb/index.js +1 -1
- package/agnostic/colors/hsl-to-rgb/index.js +1 -1
- package/agnostic/colors/index.js +4 -4
- package/agnostic/colors/lighten-color/index.js +1 -1
- package/agnostic/colors/rgb-to-hex/index.js +1 -1
- package/agnostic/colors/rgb-to-hsl/index.js +1 -1
- package/agnostic/colors/saturate-color/index.js +1 -1
- package/agnostic/css/bem/index.js +3 -3
- package/agnostic/css/generate-nice-color/index.js +1 -1
- package/agnostic/css/index.js +14 -14
- package/agnostic/css/is-valid-css-class-name/index.js +1 -1
- package/agnostic/css/styles-set/index.js +5 -5
- package/agnostic/errors/index.js +1 -1
- package/agnostic/errors/register/index.js +1 -1
- package/agnostic/errors/unknown-to-string/index.js +1 -1
- package/agnostic/html/get-node-ancestors/index.js +1 -1
- package/agnostic/html/get-position-inside-parent/index.js +1 -1
- package/agnostic/html/hyper-json/cast/index.js +9 -9
- package/agnostic/html/hyper-json/index.js +10 -10
- package/agnostic/html/hyper-json/method/index.js +1 -1
- package/agnostic/html/hyper-json/serialize/index.js +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/add/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/addclass/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/and/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/append/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/at/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/call/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/clone/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/deleteproperties/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/equals/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/getattribute/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/getproperties/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/getproperty/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/if/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/initialize/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/join/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/length/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/map/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/negate/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/notrailing/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/or/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/pickrandom/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/populate/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/print/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/push/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/pusheach/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/recordtoarray/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/removeattribute/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/removeclass/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/renameproperty/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/replace/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/select/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/set/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/setattribute/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/setproperty/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/sorton/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/split/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/spread/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/toarray/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/toboolean/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/toelement/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/toggleclass/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/tonodelist/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/tonull/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/tonumber/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/torecord/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/toref/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/tostring/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/totext/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/transformselected/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/trim/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/index.js +1 -1
- package/agnostic/html/hyper-json/smart-tags/isolated/any/index.js +1 -1
- package/agnostic/html/hyper-json/smart-tags/isolated/array/index.js +1 -1
- package/agnostic/html/hyper-json/smart-tags/isolated/boolean/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/isolated/element/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/isolated/get/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/isolated/global/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/isolated/guess/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/isolated/nodelist/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/isolated/null/index.js +1 -1
- package/agnostic/html/hyper-json/smart-tags/isolated/number/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/isolated/record/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/isolated/ref/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/isolated/string/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/isolated/text/index.js +9 -9
- package/agnostic/html/hyper-json/transformer/index.js +1 -1
- package/agnostic/html/hyper-json/tree/index.js +9 -9
- package/agnostic/html/hyper-json/types/index.js +1 -1
- package/agnostic/html/hyper-json/utils/index.js +9 -9
- package/agnostic/html/index.js +19 -19
- package/agnostic/html/insert-node/index.js +1 -1
- package/agnostic/html/placeholders/index.js +1 -1
- package/agnostic/html/replace-in-element/index.js +1 -1
- package/agnostic/html/sanitize/index.js +5 -5
- package/agnostic/html/selector-to-element/index.js +5 -5
- package/agnostic/html/string-to-nodes/index.js +6 -6
- package/agnostic/misc/assert/index.js +1 -1
- package/agnostic/misc/cast/index.js +1 -1
- package/agnostic/misc/crawler/index.js +1 -1
- package/agnostic/misc/crossenv/detect-runtime/index.js +1 -1
- package/agnostic/misc/crossenv/index.js +3 -3
- package/agnostic/misc/crossenv/types/index.js +1 -1
- package/agnostic/misc/crossenv/window/index.js +1 -1
- package/agnostic/misc/data-size/index.js +2 -2
- package/agnostic/misc/elo/index.js +1 -1
- package/agnostic/misc/get-current-downlink/index.js +1 -1
- package/agnostic/misc/index.js +20 -20
- package/agnostic/misc/is-constructor-function/index.js +1 -1
- package/agnostic/misc/is-nullish/index.js +1 -1
- package/agnostic/misc/logs/index.js +1 -1
- package/agnostic/misc/logs/logger/index.js +1 -1
- package/agnostic/misc/logs/make-text-block/index.js +1 -1
- package/agnostic/misc/logs/styles/index.js +1 -1
- package/agnostic/misc/lorem-ipsum/index.js +9 -9
- package/agnostic/misc/normalize-extension/index.js +1 -1
- package/agnostic/misc/outcome/index.js +1 -1
- package/agnostic/numbers/absolute-modulo/index.js +1 -1
- package/agnostic/numbers/clamp/index.js +1 -1
- package/agnostic/numbers/index.js +4 -4
- package/agnostic/numbers/interpolate/index.js +1 -1
- package/agnostic/numbers/responsive-harmonics/index.js +1 -1
- package/agnostic/numbers/round/index.js +1 -1
- package/agnostic/objects/deep-get-property/index.js +1 -1
- package/agnostic/objects/enums/index.js +1 -1
- package/agnostic/objects/enums/is-in-enum/index.js +1 -1
- package/agnostic/objects/flatten-getters/index.js +1 -1
- package/agnostic/objects/index.js +15 -15
- package/agnostic/objects/is-object/index.js +1 -1
- package/agnostic/objects/is-record/index.js +1 -1
- package/agnostic/objects/record-format/index.js +1 -1
- package/agnostic/objects/record-map/index.js +1 -1
- package/agnostic/objects/validation/index.js +1 -1
- package/agnostic/optim/index.js +1 -1
- package/agnostic/optim/memoize/index.js +1 -1
- package/agnostic/optim/throttle-debounce/index.js +1 -1
- package/agnostic/random/hex-char/index.js +1 -1
- package/agnostic/random/index.js +1 -1
- package/agnostic/random/random/index.js +1 -1
- package/agnostic/random/uuid/index.js +1 -1
- package/agnostic/regexps/index.js +1 -1
- package/agnostic/sanitization/index.js +4 -1280
- package/agnostic/strings/char-codes/index.js +1 -1
- package/agnostic/strings/index.js +8 -8
- package/agnostic/strings/matches/index.js +1 -1
- package/agnostic/strings/normalize-indent/index.js +1 -1
- package/agnostic/strings/replace-all/index.js +1 -1
- package/agnostic/strings/to-alphanum/index.js +1 -1
- package/agnostic/strings/trim/index.js +1 -1
- package/agnostic/time/dates/format-date/index.js +1 -1
- package/agnostic/time/dates/index.js +1 -1
- package/agnostic/time/duration/index.js +1 -1
- package/agnostic/time/index.js +7 -7
- package/agnostic/time/timeout/index.js +1 -1
- package/agnostic/time/transitions/index.js +1 -1
- package/agnostic/time/wait/index.js +1 -1
- package/chunks/{chunk-OYUM24PM.js → chunk-24ZUWYIR.js} +6 -6
- package/chunks/chunk-26QQ56SS.js +36 -0
- package/chunks/{chunk-KBOL3LMK.js → chunk-2EEVPIJE.js} +35 -35
- package/chunks/chunk-2H5RIOJO.js +16 -0
- package/chunks/{chunk-ZB73RE7P.js → chunk-2HU2AWWJ.js} +1 -1
- package/chunks/{chunk-MPYCQ5IF.js → chunk-2JH4TCT2.js} +1 -1
- package/chunks/{chunk-LUETT72P.js → chunk-2JKV6KXE.js} +1 -1
- package/chunks/chunk-2M5P5V6U.js +56 -0
- package/chunks/chunk-2PNFMIXN.js +20 -0
- package/chunks/{chunk-6RJY3F7A.js → chunk-2VJ4QISD.js} +7 -7
- package/chunks/chunk-2VXYXVV2.js +164 -0
- package/chunks/{chunk-2COSSNOE.js → chunk-32FNUJVW.js} +7 -7
- package/chunks/chunk-334MFRHI.js +56 -0
- package/chunks/{chunk-YU5NILJC.js → chunk-336RBB5E.js} +3 -3
- package/chunks/chunk-33YK4WOA.js +18 -0
- package/chunks/{chunk-CEY7OIFX.js → chunk-37TRFYZT.js} +1 -1
- package/chunks/{chunk-24O4C4HG.js → chunk-3CGRUS5C.js} +4 -4
- package/chunks/{chunk-26V5RC4U.js → chunk-3CLGBOHN.js} +1 -1
- package/chunks/chunk-3CQON3DO.js +56 -0
- package/chunks/{chunk-M6B5J46K.js → chunk-3CZNTEF7.js} +3 -3
- package/chunks/{chunk-UU35YSBK.js → chunk-3DL3U7UR.js} +11 -11
- package/chunks/{chunk-AOWLA5T2.js → chunk-3G7KHSKB.js} +18 -18
- package/chunks/{chunk-NCLB3UH3.js → chunk-3KN4IIQU.js} +1 -1
- package/chunks/chunk-3LPD7IXF.js +56 -0
- package/chunks/{chunk-LBDZQNBM.js → chunk-3TKBCG7Y.js} +5 -9
- package/chunks/{chunk-BVCNQIKY.js → chunk-3UM5CZA5.js} +1 -1
- package/chunks/chunk-3XNFVOJF.js +20 -0
- package/chunks/chunk-422KBDRV.js +203 -0
- package/chunks/{chunk-6STIUASQ.js → chunk-42K3MQQ5.js} +1 -1
- package/chunks/chunk-454MZ5UE.js +239 -0
- package/chunks/{chunk-KOBZRZBX.js → chunk-45LGGA3Z.js} +7 -3
- package/chunks/chunk-45WKBXSF.js +39 -0
- package/chunks/chunk-46HTGOCE.js +56 -0
- package/chunks/{chunk-B5OUYMUU.js → chunk-476BHNJO.js} +4 -4
- package/chunks/{chunk-34C35EX6.js → chunk-4A2IILES.js} +1 -1
- package/chunks/chunk-4ARTWFW5.js +164 -0
- package/chunks/chunk-4CAHGPFA.js +32 -0
- package/chunks/{chunk-FNIJLHH2.js → chunk-4DNPGCIM.js} +3 -3
- package/chunks/chunk-4HLAM4RP.js +191 -0
- package/chunks/chunk-4OCP2WZM.js +100 -0
- package/chunks/chunk-4PJWXOLA.js +16 -0
- package/chunks/{chunk-MQ4Y3GBI.js → chunk-4QHGUANF.js} +3 -3
- package/chunks/chunk-4TGRV2AB.js +18 -0
- package/chunks/{chunk-N7FA7QJK.js → chunk-4WM6K5IZ.js} +1 -1
- package/chunks/chunk-4WZEYD3R.js +56 -0
- package/chunks/{chunk-5WARYKLO.js → chunk-4XBUJAQU.js} +10 -10
- package/chunks/{chunk-LF4VYSOT.js → chunk-4XSDRT23.js} +8 -9
- package/chunks/{chunk-7647NLB2.js → chunk-55EDDDIA.js} +1 -1
- package/chunks/chunk-55MT7BMY.js +16 -0
- package/chunks/{chunk-GZWZ5SSG.js → chunk-56OEXCBD.js} +19 -19
- package/chunks/{chunk-JZ6Z7V7F.js → chunk-5B7VSD44.js} +1 -1
- package/chunks/{chunk-NP5UEOSJ.js → chunk-5GBYBDYQ.js} +2 -2
- package/chunks/chunk-5IPSIDXB.js +31 -0
- package/chunks/chunk-5J7H5WYC.js +82 -0
- package/chunks/chunk-5JAITHS2.js +48 -0
- package/chunks/{chunk-EAV5YDBD.js → chunk-5JNJVGDX.js} +3 -3
- package/chunks/chunk-5M7ZTA56.js +43 -0
- package/chunks/chunk-5OBHNGEH.js +20 -0
- package/chunks/chunk-5RGHYFQH.js +70 -0
- package/chunks/chunk-5SWBMXLR.js +98 -0
- package/chunks/chunk-5TRAENM3.js +31 -0
- package/chunks/{chunk-BTJ2JXDV.js → chunk-5VHFXWFM.js} +1 -1
- package/chunks/{chunk-JFWEEBSR.js → chunk-5YIC7NDS.js} +1 -1
- package/chunks/{chunk-FWR7ZA4M.js → chunk-5ZJ3KJPK.js} +1 -1
- package/chunks/{chunk-QP5GNEJY.js → chunk-646R6BQZ.js} +6 -6
- package/chunks/chunk-662SOZWA.js +19 -0
- package/chunks/{chunk-5HW7QLTB.js → chunk-6EIF24H5.js} +1 -1
- package/chunks/{chunk-V7FJOKAC.js → chunk-6ET4XJLF.js} +12 -12
- package/chunks/chunk-6HPXM6ED.js +20 -0
- package/chunks/{chunk-XIMUZN5X.js → chunk-6IYUA43Q.js} +1 -1
- package/chunks/{chunk-N4EJZLME.js → chunk-6IZ5HUJJ.js} +1 -1
- package/chunks/{chunk-YXIFWOKO.js → chunk-6NLNUGBI.js} +6 -6
- package/chunks/{chunk-P5CBBXGK.js → chunk-6PIGLFM3.js} +3 -3
- package/chunks/chunk-6SXCNPJ2.js +177 -0
- package/chunks/chunk-6V7VQ32U.js +56 -0
- package/chunks/chunk-6WVNJVBE.js +34 -0
- package/chunks/chunk-6Y7RZ5WD.js +48 -0
- package/chunks/{chunk-UWAMSJ2X.js → chunk-6Z6GDMOR.js} +2 -2
- package/chunks/chunk-6ZBDBWLW.js +164 -0
- package/chunks/{chunk-FVPFKY5G.js → chunk-766BSKLU.js} +158 -93
- package/chunks/chunk-76QORXDC.js +19 -0
- package/chunks/chunk-7BCQCDGQ.js +31 -0
- package/chunks/chunk-7DDXALPH.js +49 -0
- package/chunks/{chunk-VSYAOEKE.js → chunk-7DV4CM2Z.js} +1 -1
- package/chunks/chunk-7FJKDVBE.js +49 -0
- package/chunks/{chunk-2RFYHF6F.js → chunk-7J7CYOXU.js} +1 -1
- package/chunks/{chunk-BOJEVEPB.js → chunk-7JUKBN7P.js} +1 -1
- package/chunks/chunk-7KCMLH6B.js +22 -0
- package/chunks/chunk-7N7BJA6C.js +36 -0
- package/chunks/chunk-7OK5NZTY.js +18 -0
- package/chunks/chunk-7SS2R4B6.js +82 -0
- package/chunks/{chunk-HP722G2E.js → chunk-7SZ3QPTM.js} +2 -22
- package/chunks/chunk-7U5NS3AR.js +151 -0
- package/chunks/chunk-7UDN6KBA.js +151 -0
- package/chunks/chunk-7YSTZ7GY.js +31 -0
- package/chunks/chunk-7Z7CKAOH.js +98 -0
- package/chunks/chunk-A5XT7AXP.js +151 -0
- package/chunks/chunk-A6OSVHIK.js +20 -0
- package/chunks/chunk-ADTQQNIQ.js +47 -0
- package/chunks/{chunk-XKMSDS3Z.js → chunk-AHSYVIOF.js} +1 -1
- package/chunks/chunk-AIESW26U.js +47 -0
- package/chunks/chunk-AMXIZUFB.js +16 -0
- package/chunks/{chunk-J467ZNXE.js → chunk-ANPXBD2G.js} +1 -1
- package/chunks/chunk-AQTNG5G4.js +2456 -0
- package/chunks/chunk-AUJB3IJD.js +20 -0
- package/chunks/chunk-AZLVQV5A.js +39 -0
- package/chunks/chunk-AZOSX3LU.js +191 -0
- package/chunks/{chunk-S4FNXSMM.js → chunk-B4XUXE7E.js} +3 -3
- package/chunks/chunk-B5XLWFTJ.js +20 -0
- package/chunks/chunk-BANYGSW4.js +20 -0
- package/chunks/{chunk-HY7RNBYE.js → chunk-BD56ZAYF.js} +7 -7
- package/chunks/{chunk-5HE6JLK7.js → chunk-BE7OXZRK.js} +1 -1
- package/chunks/chunk-BGSJ5XCH.js +20 -0
- package/chunks/chunk-BGZ5OVVN.js +20 -0
- package/chunks/chunk-BONBND7I.js +239 -0
- package/chunks/chunk-BPBWY4OT.js +191 -0
- package/chunks/{chunk-IY44AG73.js → chunk-BQMQIW77.js} +5 -5
- package/chunks/{chunk-EHLTUOGZ.js → chunk-BSUQNHAM.js} +1 -1
- package/chunks/chunk-BWKM2VQJ.js +191 -0
- package/chunks/chunk-BWXVJB4I.js +20 -0
- package/chunks/{chunk-TQZ46CBX.js → chunk-BWYH445G.js} +1 -1
- package/chunks/chunk-BZHH4R64.js +20 -0
- package/chunks/{chunk-YMPNQJ4Z.js → chunk-C3ZKLONL.js} +1 -1
- package/chunks/{chunk-3G4NTP23.js → chunk-C6QTHDDM.js} +8 -9
- package/chunks/{chunk-WQD2VKTO.js → chunk-CA3UPHYO.js} +6 -6
- package/chunks/chunk-CHA42BGS.js +48 -0
- package/chunks/chunk-CKCTYZF7.js +48 -0
- package/chunks/chunk-CM6AHRTS.js +16 -0
- package/chunks/chunk-CMWR77VW.js +54 -0
- package/chunks/{chunk-FR3BXMR5.js → chunk-CNYSX2L2.js} +1 -1
- package/chunks/chunk-CSZFW4R5.js +69 -0
- package/chunks/{chunk-FTOEQNF6.js → chunk-CVDCTI7F.js} +1 -1
- package/chunks/{chunk-4XS5UIQF.js → chunk-CWZFRUBS.js} +1 -1
- package/chunks/chunk-CYIUZX2T.js +31 -0
- package/chunks/chunk-D33KC6NN.js +18 -0
- package/chunks/{chunk-HNFSETMT.js → chunk-D47ZPEUU.js} +1 -1
- package/chunks/chunk-D5E2CIDK.js +20 -0
- package/chunks/{chunk-ESUBE7BB.js → chunk-DABLUUMY.js} +4 -4
- package/chunks/chunk-DAOJPBZ6.js +18 -0
- package/chunks/chunk-DEQ5N53D.js +21 -0
- package/chunks/chunk-DHCDZVLA.js +19 -0
- package/chunks/{chunk-4MLQ42IU.js → chunk-DPQRXSZH.js} +6 -6
- package/chunks/{chunk-45S766KF.js → chunk-DTETQT5O.js} +1 -1
- package/chunks/chunk-DW4ILX77.js +28 -0
- package/chunks/chunk-E2BDKTLL.js +48 -0
- package/chunks/{chunk-ME7RF24X.js → chunk-E3F7QTXR.js} +2 -2
- package/chunks/{chunk-FTGHUU73.js → chunk-E3GK7YZ7.js} +1 -1
- package/chunks/chunk-E4RVKTMW.js +56 -0
- package/chunks/chunk-E6HDM2M4.js +191 -0
- package/chunks/chunk-E7J4E6OB.js +65 -0
- package/chunks/chunk-EA4L7AGZ.js +48 -0
- package/chunks/chunk-EBVYO2TY.js +48 -0
- package/chunks/chunk-ECGOI4MT.js +20 -0
- package/chunks/chunk-ECWDSMDZ.js +20 -0
- package/chunks/chunk-EM37BFXO.js +35 -0
- package/chunks/{chunk-ZWWJ52EY.js → chunk-EOTOFHUR.js} +6 -6
- package/chunks/chunk-F6CB5TEO.js +151 -0
- package/chunks/{chunk-MP6CL7F7.js → chunk-FB3GNE2B.js} +1 -1
- package/chunks/chunk-FCLAFRIW.js +177 -0
- package/chunks/chunk-FCMQVBJW.js +20 -0
- package/chunks/chunk-FD5WR2A5.js +63 -0
- package/chunks/{chunk-NX2FQWHA.js → chunk-FE4DECBU.js} +1 -1
- package/chunks/{chunk-QKK6WQDI.js → chunk-FF5NURFO.js} +1 -1
- package/chunks/chunk-FFNIZRZU.js +31 -0
- package/chunks/chunk-FHHXI6WC.js +31 -0
- package/chunks/chunk-FIVB3FON.js +56 -0
- package/chunks/chunk-FJ3NTVCG.js +18 -0
- package/chunks/chunk-FMRPJBUC.js +20 -0
- package/chunks/{chunk-EZW6DNPL.js → chunk-FNJX5BML.js} +2 -2
- package/chunks/chunk-FRP47Y6H.js +2456 -0
- package/chunks/{chunk-JJA4KGAD.js → chunk-FS6LRTDK.js} +6 -6
- package/chunks/{chunk-Z566RJUU.js → chunk-FTT6ZCCS.js} +1 -1
- package/chunks/chunk-FVFYLT5T.js +31 -0
- package/chunks/chunk-FZJUZYTP.js +177 -0
- package/chunks/chunk-G2M3VECP.js +20 -0
- package/chunks/{chunk-2YGNPA2R.js → chunk-G3HAKMUB.js} +3 -3
- package/chunks/{chunk-UBJACMOZ.js → chunk-G5RRNREY.js} +4 -4
- package/chunks/chunk-G5UR6736.js +31 -0
- package/chunks/chunk-G66DWXF3.js +31 -0
- package/chunks/chunk-GCHQD7MH.js +63 -0
- package/chunks/chunk-GD6Y5QJV.js +98 -0
- package/chunks/chunk-GE7DNPF6.js +63 -0
- package/chunks/chunk-GOTTGEXI.js +23 -0
- package/chunks/chunk-GRDFCI63.js +21 -0
- package/chunks/{chunk-LVPFSXKA.js → chunk-GSZSM3BU.js} +1 -1
- package/chunks/chunk-GVS2ZPGJ.js +2456 -0
- package/chunks/chunk-GXICX4F6.js +31 -0
- package/chunks/{chunk-DJ7ABCYK.js → chunk-H4LW6FP3.js} +6 -6
- package/chunks/{chunk-3J4WAVX6.js → chunk-H5O26IRG.js} +7 -7
- package/chunks/chunk-H73SGDQI.js +20 -0
- package/chunks/chunk-H7LDIXVY.js +48 -0
- package/chunks/chunk-HALUZA2X.js +16 -0
- package/chunks/chunk-HBKSSDSX.js +20 -0
- package/chunks/chunk-HDK7W7GS.js +20 -0
- package/chunks/chunk-HFH6DXXC.js +2456 -0
- package/chunks/chunk-HFIE4SBE.js +16 -0
- package/chunks/chunk-HFV7VACE.js +191 -0
- package/chunks/chunk-HGQGQLLC.js +4430 -0
- package/chunks/chunk-HGSQCJ55.js +65 -0
- package/chunks/chunk-HKTNK262.js +23 -0
- package/chunks/chunk-HNKD4ZRZ.js +177 -0
- package/chunks/{chunk-54B7VIY6.js → chunk-HRNDUTZE.js} +1 -1
- package/chunks/chunk-HUC2IRGW.js +205 -0
- package/chunks/chunk-HV2AHV5R.js +164 -0
- package/chunks/{chunk-5RA25FYM.js → chunk-HWEGQVBQ.js} +1 -1
- package/chunks/{chunk-G2XDDBWE.js → chunk-HWVEI3RH.js} +1 -1
- package/chunks/{chunk-RUCTSKYQ.js → chunk-HZGGYNZ5.js} +41 -63
- package/chunks/chunk-I37MGRCT.js +20 -0
- package/chunks/chunk-IARWH6LC.js +34 -0
- package/chunks/chunk-IH25CV3F.js +20 -0
- package/chunks/{chunk-AXTDGCSY.js → chunk-IIMP6YT7.js} +15 -15
- package/chunks/chunk-IJAFLBHD.js +16 -0
- package/chunks/{chunk-KPYPESIY.js → chunk-INGSSBWK.js} +11 -11
- package/chunks/{chunk-MYCT3HYF.js → chunk-IPLOZP7L.js} +3 -3
- package/chunks/chunk-ISFXCV7D.js +20 -0
- package/chunks/chunk-IUURENUN.js +22 -0
- package/chunks/{chunk-H4NHF72W.js → chunk-IV75M3KE.js} +6 -8
- package/chunks/{chunk-YVUJ4WBL.js → chunk-IWWAMCNR.js} +1 -1
- package/chunks/{chunk-OSZCNQBA.js → chunk-IWZAUQGO.js} +10 -10
- package/chunks/chunk-IXM6DCIE.js +151 -0
- package/chunks/chunk-IYV3EEYX.js +20 -0
- package/chunks/chunk-J35QFU6O.js +21 -0
- package/chunks/chunk-JBDWHJ4Q.js +31 -0
- package/chunks/chunk-JBUM5Q5C.js +48 -0
- package/chunks/chunk-JBZR6R5B.js +15 -0
- package/chunks/chunk-JJ7PBKSG.js +37 -0
- package/chunks/chunk-JJWKHBXD.js +68 -0
- package/chunks/chunk-JLXITDAV.js +48 -0
- package/chunks/chunk-JMA64OLZ.js +191 -0
- package/chunks/chunk-JMJZCVSA.js +141 -0
- package/chunks/chunk-JQRLQUMJ.js +16 -0
- package/chunks/chunk-JR76DLSV.js +151 -0
- package/chunks/chunk-JS3NE4VI.js +2456 -0
- package/chunks/chunk-JSKVNOTW.js +56 -0
- package/chunks/chunk-JTJA7DGW.js +36 -0
- package/chunks/chunk-JUF5GSDE.js +37 -0
- package/chunks/chunk-JX45LILQ.js +164 -0
- package/chunks/chunk-JYYW4KOZ.js +72 -0
- package/chunks/chunk-K4Q2MG65.js +56 -0
- package/chunks/chunk-K66UXFDQ.js +63 -0
- package/chunks/chunk-KBCULP7X.js +177 -0
- package/chunks/{chunk-LUZ7ZWWJ.js → chunk-KBFSUJ57.js} +10 -10
- package/chunks/chunk-KC76PUJY.js +48 -0
- package/chunks/chunk-KDTKA3SG.js +31 -0
- package/chunks/chunk-KFMYB672.js +31 -0
- package/chunks/chunk-KH5JTC2N.js +49 -0
- package/chunks/{chunk-5CYREVPP.js → chunk-KJAEVOIW.js} +1 -1
- package/chunks/chunk-KL6EJPC3.js +35 -0
- package/chunks/chunk-KN23H4CI.js +20 -0
- package/chunks/chunk-KTK3BMX2.js +56 -0
- package/chunks/chunk-L7EUEQZP.js +0 -0
- package/chunks/{chunk-WHGU2Q46.js → chunk-LFSYWGO5.js} +2 -2
- package/chunks/chunk-LH6Z6NJY.js +191 -0
- package/chunks/chunk-LMPEBXSU.js +31 -0
- package/chunks/{chunk-UQVDRQ77.js → chunk-LOAOXFA2.js} +39 -61
- package/chunks/chunk-LOY7C5BP.js +151 -0
- package/chunks/{chunk-NQNEYA4Z.js → chunk-LSOHLSF5.js} +2 -2
- package/chunks/chunk-LVBXPZUO.js +104 -0
- package/chunks/chunk-LXZULGNN.js +37 -0
- package/chunks/chunk-LZ4P3AYG.js +2456 -0
- package/chunks/chunk-MAE5XZGF.js +37 -0
- package/chunks/{chunk-V7JZNA6N.js → chunk-MAOVZE34.js} +3 -3
- package/chunks/chunk-MDVYILPB.js +56 -0
- package/chunks/chunk-MFK63FMI.js +31 -0
- package/chunks/chunk-MFWKY3DT.js +32 -0
- package/chunks/chunk-MKHTR43Q.js +231 -0
- package/chunks/chunk-MOBGB2PH.js +54 -0
- package/chunks/chunk-MTGZYBK2.js +129 -0
- package/chunks/{chunk-WECTUHS5.js → chunk-MTT7TVR3.js} +1 -1
- package/chunks/chunk-MV2LDBDF.js +164 -0
- package/chunks/chunk-MVNQWIVH.js +151 -0
- package/chunks/chunk-MW3KNVTG.js +29 -0
- package/chunks/chunk-MXGGOCLX.js +56 -0
- package/chunks/chunk-MZKZI6JL.js +37 -0
- package/chunks/chunk-MZZOFFFT.js +21 -0
- package/chunks/{chunk-A3VTK5UF.js → chunk-N2T672IG.js} +1 -1
- package/chunks/{chunk-O4AEYNFT.js → chunk-N32W4UQ6.js} +1 -1
- package/chunks/chunk-N5QAGJXV.js +49 -0
- package/chunks/chunk-NA3M6VUU.js +20 -0
- package/chunks/chunk-NA7PT2KE.js +21 -0
- package/chunks/chunk-NAP2XNYN.js +23 -0
- package/chunks/chunk-NFIEXASV.js +164 -0
- package/chunks/chunk-NJ4ANCLV.js +65 -0
- package/chunks/{chunk-Z2VDSEND.js → chunk-NMYVJJXV.js} +1 -1
- package/chunks/chunk-NOBTN4IW.js +4471 -0
- package/chunks/{chunk-4PAHEIPV.js → chunk-NOLQR5RW.js} +6 -6
- package/chunks/chunk-NSM7QLE4.js +20 -0
- package/chunks/{chunk-KH45J4DC.js → chunk-NZLE2WMY.js} +2 -15
- package/chunks/chunk-O7UEQQ6H.js +49 -0
- package/chunks/{chunk-TOGOF74B.js → chunk-OA7Y2A5T.js} +6 -6
- package/chunks/chunk-OD33BN4K.js +32 -0
- package/chunks/{chunk-2DYDNCZK.js → chunk-OD7GR6ZF.js} +18 -18
- package/chunks/{chunk-2UPQ73EE.js → chunk-ON6LC3HE.js} +12 -11
- package/chunks/chunk-OPU4CANL.js +35 -0
- package/chunks/chunk-OSCBZIZF.js +28 -0
- package/chunks/chunk-OSZ4BWDE.js +32 -0
- package/chunks/chunk-OUJTDMHK.js +16 -0
- package/chunks/chunk-OWCPJD6O.js +16 -0
- package/chunks/chunk-OXV3LVNK.js +191 -0
- package/chunks/chunk-P3QFJTAE.js +129 -0
- package/chunks/chunk-P5OGBBGM.js +37 -0
- package/chunks/{chunk-6NZOSESD.js → chunk-PAIUCLVK.js} +1 -1
- package/chunks/chunk-PCTJ7TUG.js +191 -0
- package/chunks/chunk-PDHAMES3.js +20 -0
- package/chunks/chunk-PENYZ6S7.js +31 -0
- package/chunks/chunk-PEUWFUEZ.js +98 -0
- package/chunks/chunk-PLIJVLAB.js +173 -0
- package/chunks/chunk-PSP2DKDH.js +151 -0
- package/chunks/chunk-Q2ZS3QNB.js +151 -0
- package/chunks/chunk-Q4MSGUKR.js +37 -0
- package/chunks/chunk-QAE3OWOI.js +79 -0
- package/chunks/chunk-QCOO4PV5.js +54 -0
- package/chunks/{chunk-IOZR2LGL.js → chunk-QDVDHFMZ.js} +1 -1
- package/chunks/{chunk-SSJ5YQMJ.js → chunk-QH64MYGA.js} +1 -1
- package/chunks/chunk-QHQPS7EU.js +31 -0
- package/chunks/{chunk-6SSGHEQX.js → chunk-QLDN574K.js} +1 -1
- package/chunks/{chunk-TLYXVMR5.js → chunk-QLOMT4DL.js} +2 -2
- package/chunks/chunk-QN3UAKIU.js +21 -0
- package/chunks/{chunk-T4KFB6QN.js → chunk-QPHK5QI7.js} +1 -1
- package/chunks/chunk-QPT6R6CL.js +100 -0
- package/chunks/chunk-QSSQOTGV.js +20 -0
- package/chunks/chunk-QUDIXNB2.js +18 -0
- package/chunks/chunk-QVIRBFMQ.js +31 -0
- package/chunks/{chunk-ZO5FRL3M.js → chunk-QVPS2BCJ.js} +1 -1
- package/chunks/chunk-QWFEYLHG.js +79 -0
- package/chunks/{chunk-QQAPFSMW.js → chunk-QWZ4ZNFA.js} +10 -10
- package/chunks/chunk-R6F2MFZZ.js +173 -0
- package/chunks/chunk-R7J7Q2UL.js +20 -0
- package/chunks/{chunk-PUPASUMS.js → chunk-RCWLMVSZ.js} +4 -4
- package/chunks/chunk-RDIF5NJQ.js +151 -0
- package/chunks/chunk-REN2I723.js +98 -0
- package/chunks/{chunk-CXU3QPN2.js → chunk-REZC75LB.js} +1 -1
- package/chunks/chunk-RGGOIE34.js +20 -0
- package/chunks/chunk-RLTBF5FT.js +23 -0
- package/chunks/chunk-RPWYARS3.js +18 -0
- package/chunks/chunk-RQECU6DI.js +56 -0
- package/chunks/{chunk-TEQE3HY3.js → chunk-RTUTFCLC.js} +12 -12
- package/chunks/chunk-RVZ32GPI.js +55 -0
- package/chunks/{chunk-GKTDEHC6.js → chunk-RWO53U4X.js} +1 -1
- package/chunks/chunk-S2PB2PLY.js +191 -0
- package/chunks/chunk-SARTUWB5.js +20 -0
- package/chunks/chunk-SC54OKBX.js +43 -0
- package/chunks/chunk-SDFTYOAK.js +20 -0
- package/chunks/chunk-SJFY537W.js +84 -0
- package/chunks/chunk-SLCGLOYM.js +37 -0
- package/chunks/chunk-SNRRHDIZ.js +31 -0
- package/chunks/chunk-SUWMOLXI.js +191 -0
- package/chunks/{chunk-SCOY7PVB.js → chunk-SX4DSRPU.js} +4 -4
- package/chunks/chunk-SZQHLC4K.js +31 -0
- package/chunks/chunk-T2T5BYTW.js +18 -0
- package/chunks/chunk-T55QIYYV.js +32 -0
- package/chunks/chunk-T6IC7JVI.js +37 -0
- package/chunks/chunk-TC7A4P5S.js +34 -0
- package/chunks/chunk-TDOBYMTK.js +56 -0
- package/chunks/chunk-TEBR4NTW.js +37 -0
- package/chunks/{chunk-PPJYUWHH.js → chunk-TGVYEQIA.js} +1 -1
- package/chunks/chunk-TP6V6CBV.js +177 -0
- package/chunks/chunk-TPMYILTC.js +191 -0
- package/chunks/chunk-TU3UWOAE.js +56 -0
- package/chunks/chunk-TXGV4KJD.js +31 -0
- package/chunks/chunk-TZ7MNWDS.js +20 -0
- package/chunks/chunk-U3L3X27Q.js +177 -0
- package/chunks/chunk-U4UHXVMV.js +37 -0
- package/chunks/chunk-U5WEI3QA.js +18 -0
- package/chunks/chunk-U7CF7IDN.js +35 -0
- package/chunks/chunk-U7R6TPHR.js +15 -0
- package/chunks/chunk-UBCUVSEV.js +35 -0
- package/chunks/chunk-UERX6XGZ.js +21 -0
- package/chunks/chunk-UJN2WZGO.js +32 -0
- package/chunks/{chunk-7WUVBSIC.js → chunk-UK2F7CWI.js} +1 -1
- package/chunks/{chunk-EEZ3NV4Q.js → chunk-UK4HNSEJ.js} +6 -6
- package/chunks/chunk-UNHNZAVP.js +18 -0
- package/chunks/chunk-UODICVLG.js +173 -0
- package/chunks/chunk-UUSZJMJB.js +37 -0
- package/chunks/chunk-UUU6DWRQ.js +79 -0
- package/chunks/chunk-UVSTFYSD.js +28 -0
- package/chunks/chunk-UYRX3PTS.js +2456 -0
- package/chunks/chunk-UZPXYAJR.js +177 -0
- package/chunks/{chunk-4IHBBNAG.js → chunk-V3GX7SIJ.js} +4 -8
- package/chunks/{chunk-YCNUTWOG.js → chunk-V3L55I2S.js} +1 -1
- package/chunks/chunk-V4KSJHTU.js +20 -0
- package/chunks/chunk-V4S34MIM.js +32 -0
- package/chunks/chunk-VDT6ODFV.js +20 -0
- package/chunks/chunk-VHAGPTVR.js +37 -0
- package/chunks/chunk-VHPX7UA3.js +177 -0
- package/chunks/chunk-VLC7LRED.js +191 -0
- package/chunks/chunk-VLHSIIPO.js +20 -0
- package/chunks/chunk-VQUF2TSY.js +191 -0
- package/chunks/chunk-VR5JHUKK.js +32 -0
- package/chunks/{chunk-IIXTJZ6G.js → chunk-VROZGPC5.js} +6 -8
- package/chunks/chunk-VSBRIQPH.js +48 -0
- package/chunks/chunk-VWLJ5IEE.js +31 -0
- package/chunks/{chunk-JKAHSFJD.js → chunk-W3RXHN5I.js} +1 -1
- package/chunks/chunk-W5LE6YQ5.js +16 -0
- package/chunks/chunk-W6JPRXQ4.js +16 -0
- package/chunks/{chunk-HGDSHJEX.js → chunk-WAHPAZQS.js} +1 -1
- package/chunks/{chunk-EAY65ZP6.js → chunk-WC2LQPQP.js} +5 -1
- package/chunks/chunk-WDXNM5YB.js +20 -0
- package/chunks/chunk-WGQHXHXS.js +31 -0
- package/chunks/chunk-WH5V6GK7.js +56 -0
- package/chunks/chunk-WHAUJMMG.js +32 -0
- package/chunks/chunk-WIJBRYJ6.js +20 -0
- package/chunks/{chunk-J5TWVAJJ.js → chunk-WJ3XV35I.js} +7 -7
- package/chunks/chunk-WJYMX7SS.js +21 -0
- package/chunks/chunk-WLGIDY6A.js +2456 -0
- package/chunks/chunk-WMSE5GRO.js +63 -0
- package/chunks/chunk-WO2R3QFK.js +20 -0
- package/chunks/chunk-WOGRENMM.js +31 -0
- package/chunks/chunk-WQKFVIUF.js +37 -0
- package/chunks/chunk-WR64YJNW.js +20 -0
- package/chunks/chunk-WRRA3BN4.js +31 -0
- package/chunks/chunk-WSFCRVEQ.js +9 -0
- package/chunks/chunk-WTILPGGX.js +69 -0
- package/chunks/chunk-WU3JQC7W.js +164 -0
- package/chunks/chunk-WU7NORZV.js +191 -0
- package/chunks/chunk-X244JGZD.js +69 -0
- package/chunks/chunk-X24BLY5H.js +31 -0
- package/chunks/{chunk-AVVDAISH.js → chunk-X33GT7VY.js} +7 -7
- package/chunks/chunk-X34YXAEL.js +31 -0
- package/chunks/chunk-X4XXZ44B.js +37 -0
- package/chunks/chunk-X5FAZBWL.js +130 -0
- package/chunks/chunk-X6WCMUOP.js +18 -0
- package/chunks/chunk-XAZT2MME.js +56 -0
- package/chunks/chunk-XB3YCG6I.js +48 -0
- package/chunks/chunk-XB3ZOIHH.js +2456 -0
- package/chunks/chunk-XEAHMN2T.js +4063 -0
- package/chunks/chunk-XEMFIV2W.js +177 -0
- package/chunks/chunk-XF5QBETN.js +48 -0
- package/chunks/chunk-XJ23DJY4.js +173 -0
- package/chunks/chunk-XN44EWRS.js +21 -0
- package/chunks/chunk-XQMUFSLU.js +16 -0
- package/chunks/chunk-XRUSQWPJ.js +173 -0
- package/chunks/chunk-XSVBWVVC.js +20 -0
- package/chunks/chunk-XTOAQTLP.js +98 -0
- package/chunks/chunk-XVYKCWPR.js +48 -0
- package/chunks/chunk-XZ7II65Z.js +31 -0
- package/chunks/chunk-Y5GGIBPI.js +31 -0
- package/chunks/chunk-Y7YEYHRZ.js +69 -0
- package/chunks/chunk-YCSC7QNV.js +30 -0
- package/chunks/chunk-YE67BQQN.js +4072 -0
- package/chunks/chunk-YEYXAV23.js +16 -0
- package/chunks/{chunk-NXV33ZSC.js → chunk-YKPA3MQL.js} +1 -1
- package/chunks/chunk-YLJBKSLO.js +56 -0
- package/chunks/chunk-YLKBLE6G.js +30 -0
- package/chunks/chunk-YMF7CUJA.js +20 -0
- package/chunks/chunk-YMRAUWRW.js +20 -0
- package/chunks/chunk-YMRGCRQ4.js +48 -0
- package/chunks/chunk-YRQ7LODK.js +177 -0
- package/chunks/chunk-YSDPTGYO.js +31 -0
- package/chunks/chunk-YUJJEKYY.js +144 -0
- package/chunks/chunk-YVEMIEOT.js +203 -0
- package/chunks/chunk-YVLZX2JQ.js +164 -0
- package/chunks/chunk-YW5ASSIQ.js +31 -0
- package/chunks/chunk-YXJXNTCV.js +65 -0
- package/chunks/{chunk-XDTFPTMG.js → chunk-YY6DTDMO.js} +33 -33
- package/chunks/chunk-YYA5VRE4.js +177 -0
- package/chunks/chunk-YZYA7LFK.js +20 -0
- package/chunks/chunk-Z2CU55CF.js +20 -0
- package/chunks/chunk-Z4PVE6SR.js +21 -0
- package/chunks/chunk-Z6ZTRJ67.js +177 -0
- package/chunks/chunk-ZBQEB3X7.js +4430 -0
- package/chunks/{chunk-NHMEZ6ZP.js → chunk-ZEZCYPLQ.js} +6 -8
- package/chunks/{chunk-B7E3DQ4Z.js → chunk-ZJTWDCNZ.js} +1 -1
- package/chunks/chunk-ZLNDBNP4.js +31 -0
- package/chunks/chunk-ZMMNN3QA.js +16 -0
- package/chunks/chunk-ZNA7SWFK.js +29 -0
- package/chunks/chunk-ZQ7ZC7TZ.js +56 -0
- package/chunks/chunk-ZSPOYMNQ.js +151 -0
- package/chunks/{chunk-ZAIWJI6A.js → chunk-ZSUG52DO.js} +6 -8
- package/chunks/chunk-ZVBMPJLH.js +48 -0
- package/chunks/chunk-ZVZAGTIT.js +151 -0
- package/chunks/chunk-ZZH6RUS3.js +48 -0
- package/components/Comp/index.js +1 -1
- package/node/@aws-s3/index.js +15 -16
- package/node/@aws-s3/storage/directory/copy-dir/index.js +2 -3
- package/node/@aws-s3/storage/directory/index.js +8 -9
- package/node/@aws-s3/storage/directory/list/index.js +2 -3
- package/node/@aws-s3/storage/directory/move-dir/index.js +2 -3
- package/node/@aws-s3/storage/directory/remove-dir/index.js +2 -3
- package/node/@aws-s3/storage/file/copy/index.js +2 -3
- package/node/@aws-s3/storage/file/download/index.js +2 -3
- package/node/@aws-s3/storage/file/exists/index.js +2 -3
- package/node/@aws-s3/storage/file/index.js +12 -13
- package/node/@aws-s3/storage/file/move/index.js +2 -3
- package/node/@aws-s3/storage/file/remove/index.js +2 -3
- package/node/@aws-s3/storage/file/stat/index.js +2 -3
- package/node/@aws-s3/storage/file/upload/index.js +2 -3
- package/node/@aws-s3/storage/index.js +15 -16
- package/node/@design-edito/index.js +1 -1
- package/node/@design-edito/thumbnails/colors/index.d.ts +38 -0
- package/node/@design-edito/thumbnails/colors/index.js +33 -0
- package/node/@design-edito/thumbnails/common/index.d.ts +5 -0
- package/node/@design-edito/thumbnails/common/index.js +15 -0
- package/node/@design-edito/thumbnails/easings/index.d.ts +8 -0
- package/node/@design-edito/thumbnails/easings/index.js +21 -0
- package/node/@design-edito/thumbnails/layout/index.d.ts +63 -0
- package/node/@design-edito/thumbnails/layout/index.js +31 -0
- package/node/@express/@multer/index.js +2 -2
- package/node/@express/index.js +2 -2
- package/node/@google-cloud/index.js +22 -22
- package/node/@google-cloud/storage/bucket/get-metadata/index.js +2 -2
- package/node/@google-cloud/storage/bucket/index.js +8 -8
- package/node/@google-cloud/storage/bucket/list/index.d.ts +17 -0
- package/node/@google-cloud/storage/bucket/list/index.js +9 -0
- package/node/@google-cloud/storage/directory/copy-dir/index.js +2 -2
- package/node/@google-cloud/storage/directory/index.js +8 -8
- package/node/@google-cloud/storage/directory/list/index.js +2 -2
- package/node/@google-cloud/storage/directory/move-dir/index.js +2 -2
- package/node/@google-cloud/storage/directory/remove-dir/index.js +2 -2
- package/node/@google-cloud/storage/file/copy/index.js +2 -2
- package/node/@google-cloud/storage/file/download/index.js +2 -2
- package/node/@google-cloud/storage/file/erase/index.d.ts +20 -0
- package/node/@google-cloud/storage/file/erase/index.js +9 -0
- package/node/@google-cloud/storage/file/exists/index.js +2 -2
- package/node/@google-cloud/storage/file/generate-signed-url/index.js +2 -2
- package/node/@google-cloud/storage/file/get-metadata/index.js +2 -2
- package/node/@google-cloud/storage/file/get-permissions/index.js +2 -2
- package/node/@google-cloud/storage/file/index.js +19 -19
- package/node/@google-cloud/storage/file/move/index.js +2 -2
- package/node/@google-cloud/storage/file/remove/index.js +2 -2
- package/node/@google-cloud/storage/file/revoke-signed-urls/index.js +5 -5
- package/node/@google-cloud/storage/file/stat/index.js +2 -2
- package/node/@google-cloud/storage/file/update-metadata/index.js +2 -2
- package/node/@google-cloud/storage/file/upload/index.js +2 -2
- package/node/@google-cloud/storage/index.js +22 -22
- package/node/cloud-storage/client/index.d.ts +14 -0
- package/node/cloud-storage/client/index.js +20 -0
- package/node/cloud-storage/clients/index.js +2 -3
- package/node/cloud-storage/credentials/index.d.ts +39 -0
- package/node/cloud-storage/credentials/index.js +18 -0
- package/node/cloud-storage/endpoint/index.d.ts +24 -0
- package/node/cloud-storage/endpoint/index.js +13 -0
- package/node/cloud-storage/index.js +58 -59
- package/node/cloud-storage/operations/copy-dir/index.js +7 -8
- package/node/cloud-storage/operations/copy-file/index.js +7 -8
- package/node/cloud-storage/operations/download/index.d.ts +5 -0
- package/node/cloud-storage/operations/download/index.js +14 -0
- package/node/cloud-storage/operations/download-file/index.js +7 -8
- package/node/cloud-storage/operations/exists-file/index.js +7 -8
- package/node/cloud-storage/operations/index.js +65 -66
- package/node/cloud-storage/operations/list-dir/index.js +7 -8
- package/node/cloud-storage/operations/move-dir/index.js +7 -8
- package/node/cloud-storage/operations/move-file/index.js +7 -8
- package/node/cloud-storage/operations/remove-dir/index.js +7 -8
- package/node/cloud-storage/operations/remove-file/index.js +7 -8
- package/node/cloud-storage/operations/stat-file/index.js +7 -8
- package/node/cloud-storage/operations/upload/index.d.ts +5 -0
- package/node/cloud-storage/operations/upload/index.js +14 -0
- package/node/cloud-storage/operations/upload-file/index.js +7 -8
- package/node/encryption/@aes-256-gcm/buffer/index.js +3 -3
- package/node/encryption/@aes-256-gcm/index.js +4 -4
- package/node/encryption/@aes-256-gcm/uint8-array/index.js +2 -2
- package/node/encryption/index.js +5 -5
- package/node/encryption/key/index.js +2 -2
- package/node/files/index.js +4 -4
- package/node/files/is-in-directory/index.js +1 -1
- package/node/files/read-write/index.js +1 -1
- package/node/files/subpaths/index.js +1 -1
- package/node/ftps/directory/copy-dir/index.js +2 -2
- package/node/ftps/directory/index.js +8 -8
- package/node/ftps/directory/list/index.js +2 -2
- package/node/ftps/directory/move-dir/index.js +2 -2
- package/node/ftps/directory/remove-dir/index.js +2 -2
- package/node/ftps/file/copy/index.js +2 -2
- package/node/ftps/file/download/index.js +2 -2
- package/node/ftps/file/exists/index.js +2 -2
- package/node/ftps/file/index.js +12 -12
- package/node/ftps/file/move/index.js +2 -2
- package/node/ftps/file/remove/index.js +2 -2
- package/node/ftps/file/stat/index.js +2 -2
- package/node/ftps/file/upload/index.js +2 -2
- package/node/ftps/index.js +14 -14
- package/node/images/exports/index.d.ts +15 -0
- package/node/images/exports/index.js +9 -0
- package/node/images/format/index.js +3 -3
- package/node/images/index.js +31 -31
- package/node/images/prepare/index.js +31 -31
- package/node/images/transform/_utils/color-schema/index.js +3 -3
- package/node/images/transform/_utils/operation-names/index.js +1 -1
- package/node/images/transform/_utils/positions/index.js +3 -3
- package/node/images/transform/area-composition/index.d.ts +60 -0
- package/node/images/transform/area-composition/index.js +15 -0
- package/node/images/transform/blur/index.js +3 -3
- package/node/images/transform/brighten/index.js +3 -3
- package/node/images/transform/compose/index.js +5 -5
- package/node/images/transform/extend/index.js +4 -4
- package/node/images/transform/extract/index.js +3 -3
- package/node/images/transform/flatten/index.js +4 -4
- package/node/images/transform/flip/index.js +3 -3
- package/node/images/transform/flop/index.js +3 -3
- package/node/images/transform/frame/backgrounds/create-line-background/index.js +3 -3
- package/node/images/transform/frame/backgrounds/create-tile-background/index.js +3 -3
- package/node/images/transform/frame/index.js +7 -7
- package/node/images/transform/hue-rotate/index.js +3 -3
- package/node/images/transform/index.js +29 -29
- package/node/images/transform/lighten/index.js +3 -3
- package/node/images/transform/lineate-levels/index.js +3 -3
- package/node/images/transform/modulate/index.js +3 -3
- package/node/images/transform/normalize/index.js +3 -3
- package/node/images/transform/operations/_utils/compose/index.js +1 -1
- package/node/images/transform/operations/_utils/frame/backgrounds/create-line-background/index.js +1 -1
- package/node/images/transform/operations/_utils/frame/backgrounds/create-tile-background/index.js +1 -1
- package/node/images/transform/operations/_utils/frame/create-color-palette/index.js +3 -3
- package/node/images/transform/operations/_utils/frame/extract-colors-from-image/index.js +1 -1
- package/node/images/transform/operations/_utils/frame/index.js +4 -4
- package/node/images/transform/operations/_utils/positions/index.js +1 -1
- package/node/images/transform/operations/_utils/scale/index.js +1 -1
- package/node/images/transform/operations/area-composition/area-line-composition/index.d.ts +19 -0
- package/node/images/transform/operations/area-composition/area-line-composition/index.js +14 -0
- package/node/images/transform/operations/area-composition/area-tile-composition/index.d.ts +30 -0
- package/node/images/transform/operations/area-composition/area-tile-composition/index.js +15 -0
- package/node/images/transform/operations/area-composition/index.d.ts +31 -0
- package/node/images/transform/operations/area-composition/index.js +15 -0
- package/node/images/transform/operations/inner-resize/index.d.ts +25 -0
- package/node/images/transform/operations/inner-resize/index.js +13 -0
- package/node/images/transform/resize/index.js +4 -4
- package/node/images/transform/rotate/index.js +3 -3
- package/node/images/transform/saturate/index.js +3 -3
- package/node/images/transform/scale/index.js +4 -4
- package/node/process/index.js +1 -1
- package/node/process/on-exit/index.js +1 -1
- package/node/sftp/directory/copy-dir/index.js +2 -2
- package/node/sftp/directory/index.js +8 -8
- package/node/sftp/directory/list/index.js +2 -2
- package/node/sftp/directory/move-dir/index.js +2 -2
- package/node/sftp/directory/remove-dir/index.js +2 -2
- package/node/sftp/file/copy/index.js +2 -2
- package/node/sftp/file/download/index.js +2 -2
- package/node/sftp/file/exists/index.js +2 -2
- package/node/sftp/file/index.js +12 -12
- package/node/sftp/file/move/index.js +2 -2
- package/node/sftp/file/remove/index.js +2 -2
- package/node/sftp/file/stat/index.js +2 -2
- package/node/sftp/file/upload/index.js +2 -2
- package/node/sftp/index.js +14 -14
- package/package.json +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/setproperties/index.d.ts +0 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/setproperties/index.js +0 -21
- package/agnostic/misc/crossenv/get-document/index.d.ts +0 -2
- package/agnostic/misc/crossenv/get-document/index.js +0 -7
- package/agnostic/misc/crossenv/get-window/browser.d.ts +0 -2
- package/agnostic/misc/crossenv/get-window/index.d.ts +0 -2
- package/agnostic/misc/crossenv/get-window/index.js +0 -6
- package/agnostic/misc/crossenv/types.d.ts +0 -3
- package/chunks/chunk-2ALVFCSP.js +0 -211
- package/chunks/chunk-2NXYSAFE.js +0 -67
- package/chunks/chunk-4GUDL44X.js +0 -13
- package/chunks/chunk-4QQBKBYH.js +0 -59
- package/chunks/chunk-5IR2PWO6.js +0 -211
- package/chunks/chunk-73FTH5T3.js +0 -211
- package/chunks/chunk-73V5RDSG.js +0 -13
- package/chunks/chunk-BEZTX3QU.js +0 -1
- package/chunks/chunk-BW5CY5YB.js +0 -1
- package/chunks/chunk-DIPJ73JH.js +0 -1
- package/chunks/chunk-DRH7Q4FL.js +0 -127
- package/chunks/chunk-E3NHW6J4.js +0 -211
- package/chunks/chunk-EFFU6KXJ.js +0 -1
- package/chunks/chunk-EW46EXFB.js +0 -8
- package/chunks/chunk-EWQZUF22.js +0 -211
- package/chunks/chunk-FCU6IHKD.js +0 -15
- package/chunks/chunk-FTDA7PRI.js +0 -2405
- package/chunks/chunk-GDYVCEWA.js +0 -38
- package/chunks/chunk-HCNRPWKW.js +0 -63
- package/chunks/chunk-HDGHODNO.js +0 -28
- package/chunks/chunk-HEJV6JIO.js +0 -133
- package/chunks/chunk-HL6LO6QF.js +0 -28
- package/chunks/chunk-HLUWFMD7.js +0 -67
- package/chunks/chunk-HRWQ4TUA.js +0 -2405
- package/chunks/chunk-HZJY7N36.js +0 -2405
- package/chunks/chunk-IJIE2SLT.js +0 -211
- package/chunks/chunk-IPB3U2PD.js +0 -278
- package/chunks/chunk-IQUEVQBN.js +0 -28
- package/chunks/chunk-IZP4VIFZ.js +0 -35933
- package/chunks/chunk-JEYO7UP7.js +0 -44
- package/chunks/chunk-JKISSFTR.js +0 -211
- package/chunks/chunk-KNE7WIIW.js +0 -1
- package/chunks/chunk-LCFDDWJR.js +0 -278
- package/chunks/chunk-LCLAV6Q2.js +0 -1
- package/chunks/chunk-LYMZZ4BB.js +0 -22
- package/chunks/chunk-MF56TTC5.js +0 -15
- package/chunks/chunk-OO5SJJDW.js +0 -35
- package/chunks/chunk-P5TKDJ4T.js +0 -37
- package/chunks/chunk-PCAKH6ZJ.js +0 -1
- package/chunks/chunk-PO3V3I57.js +0 -23
- package/chunks/chunk-Q7XL3D4H.js +0 -37
- package/chunks/chunk-QQRJPDR7.js +0 -1
- package/chunks/chunk-R2H52CYP.js +0 -44
- package/chunks/chunk-R6KCN6CK.js +0 -40
- package/chunks/chunk-S23WCXQK.js +0 -211
- package/chunks/chunk-SQZGZ3VT.js +0 -15
- package/chunks/chunk-UOWPJDWO.js +0 -37
- package/chunks/chunk-V4YB22WN.js +0 -28
- package/chunks/chunk-VA6HXRX4.js +0 -211
- package/chunks/chunk-VDNIN3V5.js +0 -23
- package/chunks/chunk-W3MRYBZJ.js +0 -37
- package/chunks/chunk-W7YBGJ4H.js +0 -28
- package/chunks/chunk-WTAMA5WX.js +0 -37
- package/chunks/chunk-WZ2EV5JB.js +0 -211
- package/chunks/chunk-WZBNXYN3.js +0 -1
- package/chunks/chunk-X2DODW4G.js +0 -211
- package/chunks/chunk-XCKXCF4A.js +0 -1
- package/chunks/chunk-XI2XIH6L.js +0 -2391
- package/chunks/chunk-XYNIGHGL.js +0 -654
- package/chunks/chunk-YCX3R64F.js +0 -211
- package/chunks/chunk-YQ7FI6RT.js +0 -28
- package/chunks/chunk-YYE2MVZO.js +0 -211
- package/chunks/chunk-ZONKYNKA.js +0 -28
- package/chunks/chunk-ZUWQPR2N.js +0 -37
- package/chunks/chunk-ZVJO36JU.js +0 -1
- package/index.d.ts +0 -3
- package/index.js +0 -96
- package/utils/agnostic/absolute-modulo/index.d.ts +0 -1
- package/utils/agnostic/absolute-modulo/index.js +0 -1
- package/utils/agnostic/array/index.d.ts +0 -7
- package/utils/agnostic/array/index.js +0 -1
- package/utils/agnostic/assert/index.d.ts +0 -3
- package/utils/agnostic/assert/index.js +0 -1
- package/utils/agnostic/await-timeout/index.d.ts +0 -2
- package/utils/agnostic/await-timeout/index.js +0 -1
- package/utils/agnostic/bem/BEM.d.ts +0 -29
- package/utils/agnostic/bem/getNamesArr.d.ts +0 -2
- package/utils/agnostic/bem/index.d.ts +0 -5
- package/utils/agnostic/bem/index.js +0 -1
- package/utils/agnostic/cast/index.d.ts +0 -7
- package/utils/agnostic/cast/index.js +0 -1
- package/utils/agnostic/charcode-string/index.d.ts +0 -2
- package/utils/agnostic/charcode-string/index.js +0 -1
- package/utils/agnostic/clamp/index.d.ts +0 -1
- package/utils/agnostic/clamp/index.js +0 -1
- package/utils/agnostic/clientside-html-sanitizer/index.d.ts +0 -22
- package/utils/agnostic/clientside-html-sanitizer/index.js +0 -1
- package/utils/agnostic/crossenv/index.d.ts +0 -11
- package/utils/agnostic/crossenv/index.js +0 -1
- package/utils/agnostic/flatten-getters/index.d.ts +0 -1
- package/utils/agnostic/flatten-getters/index.js +0 -1
- package/utils/agnostic/generate-html-placeholders/index.d.ts +0 -7
- package/utils/agnostic/generate-html-placeholders/index.js +0 -5
- package/utils/agnostic/generate-nice-color/index.d.ts +0 -3
- package/utils/agnostic/generate-nice-color/index.js +0 -1
- package/utils/agnostic/insert-node/index.d.ts +0 -2
- package/utils/agnostic/insert-node/index.js +0 -1
- package/utils/agnostic/interpolate/index.d.ts +0 -3
- package/utils/agnostic/interpolate/index.js +0 -1
- package/utils/agnostic/is-array-of/index.d.ts +0 -5
- package/utils/agnostic/is-array-of/index.js +0 -1
- package/utils/agnostic/is-constructor-function/index.d.ts +0 -2
- package/utils/agnostic/is-constructor-function/index.js +0 -1
- package/utils/agnostic/is-falsy/index.d.ts +0 -8
- package/utils/agnostic/is-falsy/index.js +0 -1
- package/utils/agnostic/is-in-enum/index.d.ts +0 -1
- package/utils/agnostic/is-in-enum/index.js +0 -1
- package/utils/agnostic/is-nullish/index.d.ts +0 -5
- package/utils/agnostic/is-nullish/index.js +0 -1
- package/utils/agnostic/is-object/index.d.ts +0 -1
- package/utils/agnostic/is-object/index.js +0 -1
- package/utils/agnostic/is-record/index.d.ts +0 -1
- package/utils/agnostic/is-record/index.js +0 -1
- package/utils/agnostic/is-valid-css-class-name/index.d.ts +0 -2
- package/utils/agnostic/is-valid-css-class-name/index.js +0 -1
- package/utils/agnostic/memoize/index.d.ts +0 -3
- package/utils/agnostic/memoize/index.js +0 -1
- package/utils/agnostic/object-validate-from-partial/index.d.ts +0 -1
- package/utils/agnostic/object-validate-from-partial/index.js +0 -1
- package/utils/agnostic/random/index.d.ts +0 -9
- package/utils/agnostic/random/index.js +0 -1
- package/utils/agnostic/record-format/index.d.ts +0 -11
- package/utils/agnostic/record-format/index.js +0 -1
- package/utils/agnostic/regexp/index.d.ts +0 -21
- package/utils/agnostic/regexp/index.js +0 -1
- package/utils/agnostic/replace-all/index.d.ts +0 -1
- package/utils/agnostic/replace-all/index.js +0 -1
- package/utils/agnostic/responsive-harmonics/index.d.ts +0 -10
- package/utils/agnostic/responsive-harmonics/index.js +0 -1
- package/utils/agnostic/round-numbers/index.d.ts +0 -1
- package/utils/agnostic/round-numbers/index.js +0 -1
- package/utils/agnostic/selector-to-element/index.d.ts +0 -1
- package/utils/agnostic/selector-to-element/index.js +0 -1
- package/utils/agnostic/silent-log/index.d.ts +0 -53
- package/utils/agnostic/silent-log/index.js +0 -9
- package/utils/agnostic/str-to-nodes/index.d.ts +0 -7
- package/utils/agnostic/str-to-nodes/index.js +0 -1
- package/utils/agnostic/string-matches/index.d.ts +0 -4
- package/utils/agnostic/string-matches/index.js +0 -1
- package/utils/agnostic/string-normalize-indent/index.d.ts +0 -1
- package/utils/agnostic/string-normalize-indent/index.js +0 -3
- package/utils/agnostic/throttle-debounce/index.d.ts +0 -30
- package/utils/agnostic/throttle-debounce/index.js +0 -1
- package/utils/agnostic/throttle-debounce/types.d.ts +0 -3
- package/utils/agnostic/to-alphanum/index.d.ts +0 -1
- package/utils/agnostic/to-alphanum/index.js +0 -1
- package/utils/agnostic/transition/index.d.ts +0 -39
- package/utils/agnostic/transition/index.js +0 -1
- package/utils/agnostic/wait/index.d.ts +0 -1
- package/utils/agnostic/wait/index.js +0 -1
- package/utils/browser/dynamic-css/index.d.ts +0 -4
- package/utils/browser/dynamic-css/index.js +0 -2
- package/utils/browser/get-current-downlink/index.d.ts +0 -1
- package/utils/browser/get-current-downlink/index.js +0 -1
- package/utils/browser/get-node-ancestors/index.d.ts +0 -1
- package/utils/browser/get-node-ancestors/index.js +0 -1
- package/utils/node/is-in-directory/index.d.ts +0 -1
- package/utils/node/is-in-directory/index.js +0 -1
- package/utils/node/list-subpaths/index.d.ts +0 -33
- package/utils/node/list-subpaths/index.js +0 -1
- package/utils/node/process-exit/index.d.ts +0 -5
- package/utils/node/process-exit/index.js +0 -1
- package/utils/node/read-write-file/index.d.ts +0 -12
- package/utils/node/read-write-file/index.js +0 -1
- package/chunks/{chunk-LMF52IW7.js → chunk-236C4IHT.js} +6 -6
- package/chunks/{chunk-33GNX62K.js → chunk-2RUBEK4A.js} +18 -18
- package/chunks/{chunk-6LY5FJXY.js → chunk-4Y5XR6WC.js} +17 -17
- package/chunks/{chunk-S3GEV44K.js → chunk-DPBYDWV3.js} +14 -14
- package/chunks/{chunk-DCKTGQOX.js → chunk-OVG5RGI3.js} +4 -4
- package/chunks/{chunk-H5HM5EBO.js → chunk-SAFV7TBT.js} +4 -4
package/chunks/chunk-HRWQ4TUA.js
DELETED
@@ -1,2405 +0,0 @@
|
|
1
|
-
import {
|
2
|
-
array
|
3
|
-
} from "./chunk-VDNIN3V5.js";
|
4
|
-
import {
|
5
|
-
nullFunc
|
6
|
-
} from "./chunk-QAVYONH6.js";
|
7
|
-
import {
|
8
|
-
any
|
9
|
-
} from "./chunk-FHLCPVND.js";
|
10
|
-
import {
|
11
|
-
SmartTags
|
12
|
-
} from "./chunk-UT2J62LH.js";
|
13
|
-
import {
|
14
|
-
Serialize
|
15
|
-
} from "./chunk-SXRWMH3U.js";
|
16
|
-
import {
|
17
|
-
Transformer
|
18
|
-
} from "./chunk-BKO7GLC2.js";
|
19
|
-
import {
|
20
|
-
Method
|
21
|
-
} from "./chunk-RW7VAKJW.js";
|
22
|
-
import {
|
23
|
-
Types
|
24
|
-
} from "./chunk-XEQ2PBT2.js";
|
25
|
-
import {
|
26
|
-
insertNode
|
27
|
-
} from "./chunk-XA4HVHJ4.js";
|
28
|
-
import {
|
29
|
-
Outcome
|
30
|
-
} from "./chunk-JMU5PDBD.js";
|
31
|
-
import {
|
32
|
-
recordMap
|
33
|
-
} from "./chunk-XNF5MLCQ.js";
|
34
|
-
import {
|
35
|
-
isRecord
|
36
|
-
} from "./chunk-YDIBNEGA.js";
|
37
|
-
import {
|
38
|
-
isInEnum
|
39
|
-
} from "./chunk-E6MSDKON.js";
|
40
|
-
import {
|
41
|
-
replaceAll
|
42
|
-
} from "./chunk-ZTDVUXPR.js";
|
43
|
-
import {
|
44
|
-
Window
|
45
|
-
} from "./chunk-RLJOYG64.js";
|
46
|
-
|
47
|
-
// src/agnostic/html/hyper-json/cast/index.ts
|
48
|
-
var Cast;
|
49
|
-
((Cast2) => {
|
50
|
-
Cast2.toNull = () => null;
|
51
|
-
Cast2.toBoolean = (input) => {
|
52
|
-
const { Text: Text2 } = Window.get();
|
53
|
-
if (input === null) return false;
|
54
|
-
if (typeof input === "boolean") return input;
|
55
|
-
if (typeof input === "number") return input !== 0;
|
56
|
-
if (typeof input === "string" || input instanceof Text2) {
|
57
|
-
const strInput = (0, Cast2.toString)(input);
|
58
|
-
if (strInput.trim() === "") return false;
|
59
|
-
if (strInput.trim().toLowerCase() === "false") return false;
|
60
|
-
return true;
|
61
|
-
}
|
62
|
-
return true;
|
63
|
-
};
|
64
|
-
Cast2.toNumber = (input) => {
|
65
|
-
const { Text: Text2 } = Window.get();
|
66
|
-
if (typeof input === "boolean") return input ? 1 : 0;
|
67
|
-
if (typeof input === "number") return input;
|
68
|
-
if (typeof input === "string") return parseFloat(`${input}`);
|
69
|
-
if (input instanceof Text2) return parseFloat(`${input.textContent}`);
|
70
|
-
return 0;
|
71
|
-
};
|
72
|
-
Cast2.toString = (input) => {
|
73
|
-
if (typeof input === "string") return input;
|
74
|
-
if (typeof input === "number" || typeof input === "boolean" || input === null) return `${input}`;
|
75
|
-
const { Element: Element2, Text: Text2, NodeList } = Window.get();
|
76
|
-
if (input instanceof Element2) return input.outerHTML;
|
77
|
-
if (input instanceof Text2) return input.textContent ?? "";
|
78
|
-
if (input instanceof NodeList) return Array.from(input).map((e) => {
|
79
|
-
if (e instanceof Element2) return e.outerHTML;
|
80
|
-
return e.textContent;
|
81
|
-
}).join("");
|
82
|
-
if (Array.isArray(input)) return input.map(Cast2.toString).join("");
|
83
|
-
if (input instanceof Method) return `[Method:${input.transformer.name}]`;
|
84
|
-
return `{${Object.entries(input).map(([key, val]) => `${key}:"${(0, Cast2.toString)(val)}"`).join(",")}}`;
|
85
|
-
};
|
86
|
-
Cast2.toText = (input) => {
|
87
|
-
const { Text: Text2, document: document2 } = Window.get();
|
88
|
-
if (input instanceof Text2) return input.cloneNode(true);
|
89
|
-
return document2.createTextNode((0, Cast2.toString)(input));
|
90
|
-
};
|
91
|
-
Cast2.toElement = (input) => {
|
92
|
-
const { Element: Element2, Text: Text2, NodeList, document: document2 } = Window.get();
|
93
|
-
if (input instanceof Element2) return input.cloneNode(true);
|
94
|
-
const returned = document2.createElement("div");
|
95
|
-
if (input instanceof Text2) {
|
96
|
-
returned.append(input.cloneNode(true));
|
97
|
-
return returned;
|
98
|
-
}
|
99
|
-
if (input instanceof NodeList) {
|
100
|
-
returned.append(...Array.from(input).map((e) => e.cloneNode(true)));
|
101
|
-
return returned;
|
102
|
-
}
|
103
|
-
if (Array.isArray(input)) return returned;
|
104
|
-
if (isRecord(input)) return returned;
|
105
|
-
returned.innerHTML = `${input}`;
|
106
|
-
return returned;
|
107
|
-
};
|
108
|
-
Cast2.toNodeList = (input) => {
|
109
|
-
const { Element: Element2, Text: Text2, NodeList, document: document2 } = Window.get();
|
110
|
-
const parentDiv = document2.createElement("div");
|
111
|
-
if (input instanceof NodeList) {
|
112
|
-
parentDiv.append(...Array.from(input).map((i) => i.cloneNode(true)));
|
113
|
-
return parentDiv.childNodes;
|
114
|
-
}
|
115
|
-
if (input instanceof Element2 || input instanceof Text2) {
|
116
|
-
parentDiv.append(input.cloneNode(true));
|
117
|
-
return parentDiv.childNodes;
|
118
|
-
}
|
119
|
-
if (Array.isArray(input)) {
|
120
|
-
input.forEach((item) => {
|
121
|
-
if (typeof item === "number" || typeof item === "boolean" || item === null) parentDiv.append(`${item}`);
|
122
|
-
else if (typeof item === "string" || item instanceof Text2 || item instanceof Element2) parentDiv.append(item);
|
123
|
-
else if (item instanceof NodeList) parentDiv.append(...Array.from(item));
|
124
|
-
else if (Array.isArray(item)) parentDiv.append(...Array.from((0, Cast2.toNodeList)(item)));
|
125
|
-
else parentDiv.append((0, Cast2.toString)(item));
|
126
|
-
});
|
127
|
-
return parentDiv.childNodes;
|
128
|
-
}
|
129
|
-
if (isRecord(input)) {
|
130
|
-
parentDiv.append((0, Cast2.toString)(input));
|
131
|
-
return parentDiv.childNodes;
|
132
|
-
}
|
133
|
-
parentDiv.innerHTML = `${input}`;
|
134
|
-
return parentDiv.childNodes;
|
135
|
-
};
|
136
|
-
Cast2.toArray = (input) => {
|
137
|
-
const { NodeList } = Window.get();
|
138
|
-
if (Array.isArray(input)) return [...input];
|
139
|
-
if (input instanceof NodeList) return Array.from(input);
|
140
|
-
return [input];
|
141
|
-
};
|
142
|
-
Cast2.toRecord = (input) => {
|
143
|
-
const isRecord2 = Utils.Tree.TypeChecks.typeCheck(input, "record");
|
144
|
-
if (isRecord2.success) return { ...isRecord2.payload };
|
145
|
-
return {};
|
146
|
-
};
|
147
|
-
})(Cast || (Cast = {}));
|
148
|
-
|
149
|
-
// src/agnostic/html/hyper-json/smart-tags/isolated/element/index.ts
|
150
|
-
var element = SmartTags.makeSmartTag({
|
151
|
-
name: "element",
|
152
|
-
defaultMode: "isolation",
|
153
|
-
isolationInitType: "array",
|
154
|
-
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "string", "text"),
|
155
|
-
argsValueCheck: (a) => Utils.Tree.TypeChecks.typeCheckMany(a, "null", "boolean", "number", "string", "text", "element", "nodelist"),
|
156
|
-
func: (main, args) => {
|
157
|
-
const tagName = Cast.toString(main).trim().toLowerCase();
|
158
|
-
const { document: document2, NodeList } = Window.get();
|
159
|
-
const elt = document2.createElement(tagName);
|
160
|
-
for (const argVal of args) {
|
161
|
-
if (argVal instanceof NodeList) elt.append(...Array.from(argVal));
|
162
|
-
else if (argVal instanceof Element) elt.append(argVal);
|
163
|
-
else elt.append(Cast.toText(argVal));
|
164
|
-
}
|
165
|
-
return Outcome.makeSuccess(elt);
|
166
|
-
}
|
167
|
-
});
|
168
|
-
|
169
|
-
// src/agnostic/html/hyper-json/smart-tags/isolated/get/index.ts
|
170
|
-
var get = SmartTags.makeSmartTag({
|
171
|
-
name: "get",
|
172
|
-
defaultMode: "isolation",
|
173
|
-
isolationInitType: "array",
|
174
|
-
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "string", "text"),
|
175
|
-
argsValueCheck: (a) => Utils.SmartTags.expectEmptyArgs(a),
|
176
|
-
func: (main, _args, { sourceTree }) => {
|
177
|
-
const { makeSuccess, makeFailure } = Outcome;
|
178
|
-
const { makeTransformationError } = Utils.SmartTags;
|
179
|
-
const strName = Cast.toString(main);
|
180
|
-
const found = sourceTree.getVariable(strName);
|
181
|
-
if (found === void 0) return makeFailure(makeTransformationError(`No variable stored under the name '${strName}'`));
|
182
|
-
return makeSuccess(found);
|
183
|
-
}
|
184
|
-
});
|
185
|
-
|
186
|
-
// src/agnostic/html/hyper-json/smart-tags/isolated/global/index.ts
|
187
|
-
var global = SmartTags.makeSmartTag({
|
188
|
-
name: "global",
|
189
|
-
defaultMode: "isolation",
|
190
|
-
isolationInitType: "array",
|
191
|
-
mainValueCheck: (m) => Outcome.makeSuccess(m),
|
192
|
-
argsValueCheck: (a) => Utils.SmartTags.expectEmptyArgs(a),
|
193
|
-
func: (_m, _a, { sourceTree }) => {
|
194
|
-
const globalObject = sourceTree.options.globalObject ?? {};
|
195
|
-
return Outcome.makeSuccess({ ...globalObject });
|
196
|
-
}
|
197
|
-
});
|
198
|
-
|
199
|
-
// src/agnostic/html/hyper-json/smart-tags/isolated/guess/index.ts
|
200
|
-
var guess = SmartTags.makeSmartTag({
|
201
|
-
name: "guess",
|
202
|
-
defaultMode: "isolation",
|
203
|
-
isolationInitType: "string",
|
204
|
-
mainValueCheck: (m) => Outcome.makeSuccess(m),
|
205
|
-
argsValueCheck: (a) => Outcome.makeSuccess(a),
|
206
|
-
func: (main, args) => {
|
207
|
-
const { typeCheck } = Utils.Tree.TypeChecks;
|
208
|
-
const { makeSuccess } = Outcome;
|
209
|
-
let coalesced = main;
|
210
|
-
for (const arg of args) coalesced = Utils.coalesceValues(coalesced, 0, arg);
|
211
|
-
const { Text: Text2, Element: Element2, document: document2 } = Window.get();
|
212
|
-
if (typeof coalesced !== "string" && !(coalesced instanceof Text2)) return makeSuccess(coalesced);
|
213
|
-
const strCoalesced = Cast.toString(coalesced);
|
214
|
-
if (strCoalesced.trim().toLowerCase() === "true") return makeSuccess(true);
|
215
|
-
if (strCoalesced.trim().toLowerCase() === "false") return makeSuccess(false);
|
216
|
-
if (strCoalesced.trim().toLowerCase().match(/^\s*-?\s*(\d+(\.\d*)?|\.\d+)\s*$/)) return makeSuccess(parseFloat(strCoalesced));
|
217
|
-
if (strCoalesced.trim().toLowerCase() === "null") return makeSuccess(null);
|
218
|
-
try {
|
219
|
-
const parsed = JSON.parse(strCoalesced);
|
220
|
-
const arrayChecked = typeCheck(parsed, "array");
|
221
|
-
const recordChecked = typeCheck(parsed, "record");
|
222
|
-
if (arrayChecked.success) return makeSuccess(arrayChecked.payload);
|
223
|
-
if (recordChecked.success) return makeSuccess(recordChecked.payload);
|
224
|
-
} catch (err) {
|
225
|
-
}
|
226
|
-
const div = document2.createElement("div");
|
227
|
-
div.innerHTML = strCoalesced;
|
228
|
-
const divChildren = div.childNodes;
|
229
|
-
if (divChildren.length === 0) return makeSuccess(coalesced);
|
230
|
-
const validDivChildren = Cast.toNodeList(Array.from(divChildren).filter((e) => {
|
231
|
-
if (e instanceof Element2) return true;
|
232
|
-
if (e instanceof Text2) return true;
|
233
|
-
return false;
|
234
|
-
}));
|
235
|
-
if (validDivChildren.length > 1) return makeSuccess(validDivChildren);
|
236
|
-
const validDivFirstchild = validDivChildren.item(0);
|
237
|
-
if (validDivChildren.length === 1 && validDivFirstchild instanceof Element2) return makeSuccess(validDivFirstchild);
|
238
|
-
return makeSuccess(coalesced);
|
239
|
-
}
|
240
|
-
});
|
241
|
-
|
242
|
-
// src/agnostic/html/hyper-json/smart-tags/isolated/nodelist/index.ts
|
243
|
-
var nodelist = SmartTags.makeSmartTag({
|
244
|
-
name: "nodelist",
|
245
|
-
defaultMode: "isolation",
|
246
|
-
isolationInitType: "nodelist",
|
247
|
-
mainValueCheck: (m) => Outcome.makeSuccess(m),
|
248
|
-
argsValueCheck: (a) => Outcome.makeSuccess(a),
|
249
|
-
func: (main, args) => {
|
250
|
-
const { document: document2 } = Window.get();
|
251
|
-
const returnedParent = document2.createDocumentFragment();
|
252
|
-
returnedParent.append(
|
253
|
-
...Array.from(Cast.toNodeList(main)),
|
254
|
-
...Array.from(Cast.toNodeList(args))
|
255
|
-
);
|
256
|
-
const returned = returnedParent.childNodes;
|
257
|
-
return Outcome.makeSuccess(returned);
|
258
|
-
}
|
259
|
-
});
|
260
|
-
|
261
|
-
// src/agnostic/html/hyper-json/smart-tags/isolated/number/index.ts
|
262
|
-
var number = SmartTags.makeSmartTag({
|
263
|
-
name: "number",
|
264
|
-
defaultMode: "isolation",
|
265
|
-
isolationInitType: "number",
|
266
|
-
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "null", "boolean", "number", "string", "text"),
|
267
|
-
argsValueCheck: (a) => Utils.Tree.TypeChecks.typeCheckMany(a, "null", "boolean", "number", "string", "text"),
|
268
|
-
func: (main, args) => {
|
269
|
-
const all = [main, ...args];
|
270
|
-
const reduced = all.reduce((reduced2, curr) => {
|
271
|
-
return reduced2 + Cast.toNumber(curr);
|
272
|
-
}, 0);
|
273
|
-
return Outcome.makeSuccess(reduced);
|
274
|
-
}
|
275
|
-
});
|
276
|
-
|
277
|
-
// src/agnostic/html/hyper-json/smart-tags/isolated/record/index.ts
|
278
|
-
var record = SmartTags.makeSmartTag({
|
279
|
-
name: "record",
|
280
|
-
defaultMode: "isolation",
|
281
|
-
isolationInitType: "record",
|
282
|
-
mainValueCheck: (i) => Utils.Tree.TypeChecks.typeCheck(i, "record"),
|
283
|
-
argsValueCheck: (a) => Utils.Tree.TypeChecks.typeCheckMany(a, "record"),
|
284
|
-
func: (main, args) => Outcome.makeSuccess(args.reduce((reduced, current) => ({
|
285
|
-
...reduced,
|
286
|
-
...current
|
287
|
-
}), main))
|
288
|
-
});
|
289
|
-
|
290
|
-
// src/agnostic/html/hyper-json/smart-tags/isolated/ref/index.ts
|
291
|
-
var func = (main, _args, { sourceTree }) => {
|
292
|
-
const { makeFailure, makeSuccess } = Outcome;
|
293
|
-
const { makeTransformationError } = Utils.SmartTags;
|
294
|
-
const strMain = Cast.toString(main);
|
295
|
-
const resolveFrom = strMain.startsWith("/") ? sourceTree.root : sourceTree;
|
296
|
-
const splitted = strMain.split("/").filter((e) => e.trim() !== "").map((e) => {
|
297
|
-
const looksLikeNumber = e.match(/^\d+$/igm);
|
298
|
-
if (looksLikeNumber === null) return e;
|
299
|
-
const parsed = parseInt(e);
|
300
|
-
if (Number.isNaN(parsed)) return e;
|
301
|
-
return parsed;
|
302
|
-
});
|
303
|
-
const resolved = resolveFrom.resolve(splitted);
|
304
|
-
if (resolved === void 0) return makeFailure(makeTransformationError(`No value was found at path: ${strMain}`));
|
305
|
-
if (resolved === sourceTree) return makeFailure(makeTransformationError("A ref node cannot reference itself."));
|
306
|
-
if (resolved.parents.includes(sourceTree)) return makeFailure(makeTransformationError("A ref node cannot reference one of its parents."));
|
307
|
-
if (sourceTree.parents.includes(resolved)) return makeFailure(makeTransformationError("A ref node cannot reference one of its children."));
|
308
|
-
const evaluated = resolved.evaluate();
|
309
|
-
const { getType } = Utils.Tree.TypeChecks;
|
310
|
-
if (getType(evaluated) === "transformer") {
|
311
|
-
const transformer = evaluated;
|
312
|
-
return makeSuccess(transformer.toMethod());
|
313
|
-
}
|
314
|
-
return makeSuccess(evaluated);
|
315
|
-
};
|
316
|
-
var ref = SmartTags.makeSmartTag({
|
317
|
-
name: "ref",
|
318
|
-
defaultMode: "isolation",
|
319
|
-
isolationInitType: "array",
|
320
|
-
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "string", "text"),
|
321
|
-
argsValueCheck: (a) => Utils.SmartTags.expectEmptyArgs(a),
|
322
|
-
func
|
323
|
-
});
|
324
|
-
|
325
|
-
// src/agnostic/html/hyper-json/smart-tags/isolated/string/index.ts
|
326
|
-
var string = SmartTags.makeSmartTag({
|
327
|
-
name: "string",
|
328
|
-
defaultMode: "isolation",
|
329
|
-
isolationInitType: "string",
|
330
|
-
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "null", "boolean", "number", "string", "text", "element", "nodelist"),
|
331
|
-
argsValueCheck: (a) => Utils.Tree.TypeChecks.typeCheckMany(a, "null", "boolean", "number", "string", "text", "element", "nodelist"),
|
332
|
-
func: (main, args) => {
|
333
|
-
const all = [main, ...args];
|
334
|
-
const reduced = all.reduce((reduced2, curr) => {
|
335
|
-
return `${reduced2}${Cast.toString(curr)}`;
|
336
|
-
}, "");
|
337
|
-
return Outcome.makeSuccess(reduced);
|
338
|
-
}
|
339
|
-
});
|
340
|
-
|
341
|
-
// src/agnostic/html/hyper-json/smart-tags/isolated/text/index.ts
|
342
|
-
var text = SmartTags.makeSmartTag({
|
343
|
-
name: "text",
|
344
|
-
defaultMode: "isolation",
|
345
|
-
isolationInitType: "text",
|
346
|
-
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "null", "boolean", "number", "string", "text", "element", "nodelist"),
|
347
|
-
argsValueCheck: (a) => Utils.Tree.TypeChecks.typeCheckMany(a, "null", "boolean", "number", "string", "text", "element", "nodelist"),
|
348
|
-
func: (main, args) => {
|
349
|
-
const all = [main, ...args];
|
350
|
-
const reduced = all.reduce((reduced2, curr) => {
|
351
|
-
return Cast.toText(`${reduced2}${Cast.toText(curr)}`);
|
352
|
-
}, Cast.toText(""));
|
353
|
-
return Outcome.makeSuccess(reduced);
|
354
|
-
}
|
355
|
-
});
|
356
|
-
|
357
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/add/index.ts
|
358
|
-
var add = SmartTags.makeSmartTag({
|
359
|
-
name: "add",
|
360
|
-
defaultMode: "coalescion",
|
361
|
-
isolationInitType: "array",
|
362
|
-
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "number", "string", "text"),
|
363
|
-
argsValueCheck: (a) => Utils.Tree.TypeChecks.typeCheckMany(a, "number", "string", "text"),
|
364
|
-
func: (main, args) => {
|
365
|
-
const numMain = Cast.toNumber(main);
|
366
|
-
const numArgs = args.map(Cast.toNumber);
|
367
|
-
return Outcome.makeSuccess(numArgs.reduce((reduced, arg) => reduced + arg, numMain));
|
368
|
-
}
|
369
|
-
});
|
370
|
-
|
371
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/addclass/index.ts
|
372
|
-
var addclass = SmartTags.makeSmartTag({
|
373
|
-
name: "addclass",
|
374
|
-
defaultMode: "coalescion",
|
375
|
-
isolationInitType: "array",
|
376
|
-
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "element"),
|
377
|
-
argsValueCheck: (a) => Utils.Tree.TypeChecks.typeCheckMany(a, "string", "text"),
|
378
|
-
func: (main, args) => {
|
379
|
-
main.classList.add(...args.map((arg) => Cast.toString(arg)));
|
380
|
-
return Outcome.makeSuccess(main);
|
381
|
-
}
|
382
|
-
});
|
383
|
-
|
384
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/and/index.ts
|
385
|
-
var and = SmartTags.makeSmartTag({
|
386
|
-
name: "and",
|
387
|
-
defaultMode: "coalescion",
|
388
|
-
isolationInitType: "array",
|
389
|
-
mainValueCheck: (m) => Outcome.makeSuccess(m),
|
390
|
-
argsValueCheck: (a) => Outcome.makeSuccess(a),
|
391
|
-
func: (main, args) => {
|
392
|
-
const all = [main, ...args];
|
393
|
-
const returned = all.every(Cast.toBoolean);
|
394
|
-
return Outcome.makeSuccess(returned);
|
395
|
-
}
|
396
|
-
});
|
397
|
-
|
398
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/append/index.ts
|
399
|
-
var append = SmartTags.makeSmartTag({
|
400
|
-
name: "append",
|
401
|
-
defaultMode: "coalescion",
|
402
|
-
isolationInitType: "array",
|
403
|
-
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "string", "text", "nodelist", "element", "array"),
|
404
|
-
argsValueCheck: (a) => Utils.Tree.TypeChecks.typeCheckMany(a, "string", "text", "nodelist", "element", "array"),
|
405
|
-
func: (main, args) => {
|
406
|
-
const { makeSuccess } = Outcome;
|
407
|
-
const { Text: Text2, Element: Element2, NodeList, document: document2 } = Window.get();
|
408
|
-
if (Array.isArray(main)) return makeSuccess([...main, ...args]);
|
409
|
-
if (main instanceof Element2) {
|
410
|
-
main.append(...Array.from(Cast.toNodeList(args)));
|
411
|
-
return makeSuccess(main);
|
412
|
-
}
|
413
|
-
if (main instanceof NodeList) {
|
414
|
-
const frag = document2.createDocumentFragment();
|
415
|
-
frag.append(
|
416
|
-
...Array.from(main),
|
417
|
-
...Array.from(Cast.toNodeList(args))
|
418
|
-
);
|
419
|
-
return makeSuccess(frag.childNodes);
|
420
|
-
}
|
421
|
-
if (main instanceof Text2) {
|
422
|
-
const reducedString = args.reduce((reduced, arg) => {
|
423
|
-
return `${reduced}${Cast.toString(arg)}`;
|
424
|
-
}, Cast.toString(main));
|
425
|
-
return makeSuccess(Cast.toText(reducedString));
|
426
|
-
}
|
427
|
-
return makeSuccess(args.reduce((reduced, arg) => {
|
428
|
-
return `${reduced}${Cast.toString(arg)}`;
|
429
|
-
}, main));
|
430
|
-
}
|
431
|
-
});
|
432
|
-
|
433
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/at/index.ts
|
434
|
-
var at = SmartTags.makeSmartTag({
|
435
|
-
name: "at",
|
436
|
-
defaultMode: "coalescion",
|
437
|
-
isolationInitType: "array",
|
438
|
-
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "string", "text", "array", "nodelist"),
|
439
|
-
argsValueCheck: (a) => {
|
440
|
-
const { makeFailure, makeSuccess } = Outcome;
|
441
|
-
const { makeArgsValueError } = Utils.SmartTags;
|
442
|
-
const { getType, typeCheckMany } = Utils.Tree.TypeChecks;
|
443
|
-
if (a.length === 0) return makeFailure(makeArgsValueError("number | string | text", "undefined", 0));
|
444
|
-
if (a.length > 1) return makeFailure(makeArgsValueError("undefined", getType(a[1]) ?? "undefined", 1));
|
445
|
-
const checked = typeCheckMany(a, "number", "string", "text");
|
446
|
-
if (checked.success) return makeSuccess(a);
|
447
|
-
return checked;
|
448
|
-
},
|
449
|
-
func: (main, args) => {
|
450
|
-
const { makeFailure, makeSuccess } = Outcome;
|
451
|
-
const { makeTransformationError } = Utils.SmartTags;
|
452
|
-
const pos = args[0];
|
453
|
-
const numPos = Cast.toNumber(pos);
|
454
|
-
let found;
|
455
|
-
const { NodeList } = Window.get();
|
456
|
-
if (typeof main === "string" || Array.isArray(main) || main instanceof NodeList) {
|
457
|
-
found = main[numPos];
|
458
|
-
} else {
|
459
|
-
const strMain = Cast.toString(main);
|
460
|
-
found = strMain[numPos];
|
461
|
-
}
|
462
|
-
if (found === void 0) return makeFailure(makeTransformationError({
|
463
|
-
message: "Property does not exist"
|
464
|
-
// [WIP] maybe more details here ?
|
465
|
-
}));
|
466
|
-
return makeSuccess(found);
|
467
|
-
}
|
468
|
-
});
|
469
|
-
|
470
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/call/index.ts
|
471
|
-
var call = SmartTags.makeSmartTag({
|
472
|
-
name: "call",
|
473
|
-
defaultMode: "coalescion",
|
474
|
-
isolationInitType: "array",
|
475
|
-
mainValueCheck: (m) => {
|
476
|
-
const { makeFailure } = Outcome;
|
477
|
-
const { typeCheck, typeCheckMany, getType } = Utils.Tree.TypeChecks;
|
478
|
-
const { makeMainValueError } = Utils.SmartTags;
|
479
|
-
const isMethodCheck = typeCheck(m, "method");
|
480
|
-
if (isMethodCheck.success) return isMethodCheck;
|
481
|
-
if (!Array.isArray(m)) return makeFailure({
|
482
|
-
expected: "method[]",
|
483
|
-
found: getType(m) ?? "undefined"
|
484
|
-
});
|
485
|
-
const isMethodsArrayCheck = typeCheckMany(m, "method");
|
486
|
-
if (isMethodsArrayCheck.success) return isMethodsArrayCheck;
|
487
|
-
return makeFailure(makeMainValueError("method | method[]", getType(m) ?? "undefined"));
|
488
|
-
},
|
489
|
-
argsValueCheck: (a) => Utils.Tree.TypeChecks.typeCheckMany(a, "array"),
|
490
|
-
func: (main, args) => {
|
491
|
-
const { makeFailure, makeSuccess } = Outcome;
|
492
|
-
const { makeTransformationError } = Utils.SmartTags;
|
493
|
-
const mainArr = Array.isArray(main) ? main : [main];
|
494
|
-
let reduced = args;
|
495
|
-
for (const method of mainArr) {
|
496
|
-
const { transformer } = method;
|
497
|
-
const applied = transformer.apply(reduced);
|
498
|
-
if (applied.success) {
|
499
|
-
reduced = applied.payload;
|
500
|
-
}
|
501
|
-
return makeFailure(makeTransformationError({
|
502
|
-
message: "Subtransformation failure.",
|
503
|
-
onTransformed: reduced,
|
504
|
-
transformerAt: mainArr.indexOf(method),
|
505
|
-
transformerName: transformer.name,
|
506
|
-
transformerOutput: applied
|
507
|
-
}));
|
508
|
-
}
|
509
|
-
return makeSuccess(reduced);
|
510
|
-
}
|
511
|
-
});
|
512
|
-
|
513
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/clone/index.ts
|
514
|
-
var clone = SmartTags.makeSmartTag({
|
515
|
-
name: "clone",
|
516
|
-
defaultMode: "coalescion",
|
517
|
-
isolationInitType: "array",
|
518
|
-
mainValueCheck: (m) => Outcome.makeSuccess(m),
|
519
|
-
argsValueCheck: (a) => Utils.SmartTags.expectEmptyArgs(a),
|
520
|
-
func: (main) => Outcome.makeSuccess(Utils.clone(main))
|
521
|
-
});
|
522
|
-
|
523
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/deleteproperties/index.ts
|
524
|
-
var deleteproperties = SmartTags.makeSmartTag({
|
525
|
-
name: "deleteproperties",
|
526
|
-
defaultMode: "coalescion",
|
527
|
-
isolationInitType: "array",
|
528
|
-
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "record"),
|
529
|
-
argsValueCheck: (a) => Utils.Tree.TypeChecks.typeCheckMany(a, "string", "text"),
|
530
|
-
func: (main, args) => {
|
531
|
-
const { makeFailure, makeSuccess } = Outcome;
|
532
|
-
const { makeTransformationError } = Utils.SmartTags;
|
533
|
-
let returned = Utils.clone(main);
|
534
|
-
for (const arg of args) {
|
535
|
-
const strArg = Cast.toString(arg);
|
536
|
-
try {
|
537
|
-
returned = deepDeleteProperty(returned, strArg);
|
538
|
-
} catch (err) {
|
539
|
-
return makeFailure(makeTransformationError(`Cannot access ${strArg} from input record`));
|
540
|
-
}
|
541
|
-
}
|
542
|
-
return makeSuccess(returned);
|
543
|
-
}
|
544
|
-
});
|
545
|
-
function deepDeleteProperty(record2, pathString) {
|
546
|
-
const cloned = Utils.clone(record2);
|
547
|
-
const pathChunks = pathString.split(".");
|
548
|
-
let currentRecord = cloned;
|
549
|
-
pathChunks.forEach((chunk, pos) => {
|
550
|
-
const isLast = pos === pathChunks.length - 1;
|
551
|
-
if (isLast) delete currentRecord[chunk];
|
552
|
-
else {
|
553
|
-
const found = currentRecord[chunk];
|
554
|
-
if (isRecord(found)) currentRecord = found;
|
555
|
-
else throw "not a record";
|
556
|
-
}
|
557
|
-
});
|
558
|
-
return cloned;
|
559
|
-
}
|
560
|
-
|
561
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/equals/index.ts
|
562
|
-
var equals = SmartTags.makeSmartTag({
|
563
|
-
name: "equals",
|
564
|
-
defaultMode: "coalescion",
|
565
|
-
isolationInitType: "array",
|
566
|
-
mainValueCheck: (m) => Outcome.makeSuccess(m),
|
567
|
-
argsValueCheck: (a) => {
|
568
|
-
const [first, ...others] = a;
|
569
|
-
if (first === void 0) return Outcome.makeFailure(Utils.SmartTags.makeArgsValueError(
|
570
|
-
"value",
|
571
|
-
"undefined",
|
572
|
-
0
|
573
|
-
));
|
574
|
-
const returned = [first, ...others];
|
575
|
-
return Outcome.makeSuccess(returned);
|
576
|
-
},
|
577
|
-
func: (main, args) => {
|
578
|
-
const { Text: Text2 } = Window.get();
|
579
|
-
const normalizedMain = main instanceof Text2 ? Cast.toString(main) : main;
|
580
|
-
const normalizedArgs = args.map((a) => a instanceof Text2 ? Cast.toString(a) : a);
|
581
|
-
return Outcome.makeSuccess(normalizedArgs.every((arg) => arg === normalizedMain));
|
582
|
-
}
|
583
|
-
});
|
584
|
-
|
585
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/getattribute/index.ts
|
586
|
-
var getattribute = SmartTags.makeSmartTag({
|
587
|
-
name: "getattribute",
|
588
|
-
defaultMode: "coalescion",
|
589
|
-
isolationInitType: "array",
|
590
|
-
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "element"),
|
591
|
-
argsValueCheck: (a) => {
|
592
|
-
const { makeFailure, makeSuccess } = Outcome;
|
593
|
-
const { typeCheckMany, getType } = Utils.Tree.TypeChecks;
|
594
|
-
const { makeArgsValueError } = Utils.SmartTags;
|
595
|
-
if (a.length === 0) return makeFailure(makeArgsValueError("string | Text", "undefined", 0));
|
596
|
-
if (a.length > 1) return makeFailure(makeArgsValueError("undefined", getType(a[2]) ?? "undefined", 1));
|
597
|
-
const checked = typeCheckMany(a, "string", "text");
|
598
|
-
if (checked.success) return makeSuccess(checked.payload);
|
599
|
-
return checked;
|
600
|
-
},
|
601
|
-
func: (main, args) => {
|
602
|
-
const name = Cast.toString(args[0]);
|
603
|
-
const found = main.getAttribute(name);
|
604
|
-
return Outcome.makeSuccess(found);
|
605
|
-
}
|
606
|
-
});
|
607
|
-
|
608
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/getproperties/index.ts
|
609
|
-
var getproperties = SmartTags.makeSmartTag({
|
610
|
-
name: "getproperties",
|
611
|
-
defaultMode: "coalescion",
|
612
|
-
isolationInitType: "array",
|
613
|
-
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "record"),
|
614
|
-
argsValueCheck: (a) => Utils.Tree.TypeChecks.typeCheckMany(a, "string", "text"),
|
615
|
-
func: (main, args) => {
|
616
|
-
const reduced = args.reduce((reduced2, curr) => {
|
617
|
-
const key = Cast.toString(curr);
|
618
|
-
const val = main[key];
|
619
|
-
if (val === void 0) return { ...reduced2 };
|
620
|
-
return { ...reduced2, [key]: val };
|
621
|
-
}, {});
|
622
|
-
return Outcome.makeSuccess(reduced);
|
623
|
-
}
|
624
|
-
});
|
625
|
-
|
626
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/getproperty/index.ts
|
627
|
-
var getproperty = SmartTags.makeSmartTag({
|
628
|
-
name: "getproperty",
|
629
|
-
defaultMode: "coalescion",
|
630
|
-
isolationInitType: "array",
|
631
|
-
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "record"),
|
632
|
-
argsValueCheck: (a) => {
|
633
|
-
const { makeFailure, makeSuccess } = Outcome;
|
634
|
-
const { makeArgsValueError } = Utils.SmartTags;
|
635
|
-
const { getType, typeCheckMany } = Utils.Tree.TypeChecks;
|
636
|
-
if (a.length === 0) return makeFailure(makeArgsValueError("string | Text", "undefined", 0));
|
637
|
-
if (a.length !== 1) return makeFailure(makeArgsValueError("undefined", getType(a.at(1)) ?? "undefined", 1));
|
638
|
-
const checked = typeCheckMany(a, "string", "text");
|
639
|
-
if (!checked.success) return checked;
|
640
|
-
return makeSuccess(checked.payload);
|
641
|
-
},
|
642
|
-
func: (main, args) => {
|
643
|
-
const { getType } = Utils.Tree.TypeChecks;
|
644
|
-
const { makeTransformationError } = Utils.SmartTags;
|
645
|
-
const { makeFailure, makeSuccess } = Outcome;
|
646
|
-
const [propName] = args;
|
647
|
-
const strPropName = Cast.toString(propName);
|
648
|
-
try {
|
649
|
-
const found = deepGetProperty(main, strPropName);
|
650
|
-
const foundType = getType(found);
|
651
|
-
if (foundType !== "transformer") return makeSuccess(found);
|
652
|
-
return makeFailure(makeTransformationError(`Forbidden access to key: '${strPropName}'`));
|
653
|
-
} catch (err) {
|
654
|
-
return makeFailure(makeTransformationError(`Impossible to access ${strPropName}`));
|
655
|
-
}
|
656
|
-
}
|
657
|
-
});
|
658
|
-
function deepGetProperty(record2, pathString) {
|
659
|
-
const pathChunks = pathString.split(".").map((e) => e.trim()).filter((e) => e !== "");
|
660
|
-
let currentRecord = record2;
|
661
|
-
let returned = currentRecord;
|
662
|
-
pathChunks.forEach((chunk, pos) => {
|
663
|
-
const isLast = pos === pathChunks.length - 1;
|
664
|
-
if (isLast) {
|
665
|
-
const val = currentRecord[chunk];
|
666
|
-
if (val === void 0) throw "PROP_UNDEFINED";
|
667
|
-
returned = val;
|
668
|
-
} else {
|
669
|
-
const found = currentRecord[chunk];
|
670
|
-
if (isRecord(found)) currentRecord = found;
|
671
|
-
else throw "NOT_A_RECORD";
|
672
|
-
}
|
673
|
-
});
|
674
|
-
return returned;
|
675
|
-
}
|
676
|
-
|
677
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/if/index.ts
|
678
|
-
var ifFunc = SmartTags.makeSmartTag({
|
679
|
-
name: "if",
|
680
|
-
defaultMode: "coalescion",
|
681
|
-
isolationInitType: "array",
|
682
|
-
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "boolean"),
|
683
|
-
argsValueCheck: (a) => {
|
684
|
-
const { makeFailure, makeSuccess } = Outcome;
|
685
|
-
const { makeArgsValueError } = Utils.SmartTags;
|
686
|
-
if (a.length > 2) return makeFailure(makeArgsValueError("value", "undefined", a.length));
|
687
|
-
if (a.length < 2) return makeFailure(makeArgsValueError("undefined", "value", 2));
|
688
|
-
return makeSuccess(a);
|
689
|
-
},
|
690
|
-
func: (main, args) => {
|
691
|
-
const [then, otherwise] = args;
|
692
|
-
return Outcome.makeSuccess(main ? then : otherwise);
|
693
|
-
}
|
694
|
-
});
|
695
|
-
|
696
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/initialize/index.ts
|
697
|
-
var initialize = SmartTags.makeSmartTag({
|
698
|
-
name: "initialize",
|
699
|
-
defaultMode: "coalescion",
|
700
|
-
isolationInitType: "array",
|
701
|
-
mainValueCheck: (m) => Outcome.makeSuccess(m),
|
702
|
-
argsValueCheck: (a) => {
|
703
|
-
const { makeFailure, makeSuccess } = Outcome;
|
704
|
-
const { getType, typeCheck } = Utils.Tree.TypeChecks;
|
705
|
-
const { makeArgsValueError } = Utils.SmartTags;
|
706
|
-
const first = a[0];
|
707
|
-
if (first === void 0) return makeFailure(makeArgsValueError("string | text", "undefined", 0));
|
708
|
-
if (a.length > 1) return makeFailure(makeArgsValueError("undefined", getType(a[1]) ?? "undefined", 1));
|
709
|
-
const firstChecked = typeCheck(first, "string", "text");
|
710
|
-
if (!firstChecked.success) return makeFailure(makeArgsValueError(firstChecked.error.expected, firstChecked.error.found, 0));
|
711
|
-
return makeSuccess(a);
|
712
|
-
},
|
713
|
-
func: (_main, args) => {
|
714
|
-
const { makeFailure, makeSuccess } = Outcome;
|
715
|
-
const { makeTransformationError } = Utils.SmartTags;
|
716
|
-
const { getInitialValueFromTypeName } = Utils.Tree;
|
717
|
-
const { isValueTypeName } = Utils.Tree.TypeChecks;
|
718
|
-
const firstArg = args[0];
|
719
|
-
const strFirstArg = Cast.toString(firstArg).trim().toLowerCase();
|
720
|
-
const isValueType = isValueTypeName(strFirstArg);
|
721
|
-
if (!isValueType || strFirstArg === "transformer" || strFirstArg === "method") return makeFailure(makeTransformationError(`${strFirstArg} is not a valid type`));
|
722
|
-
const initialized = getInitialValueFromTypeName(strFirstArg);
|
723
|
-
return makeSuccess(initialized);
|
724
|
-
}
|
725
|
-
});
|
726
|
-
|
727
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/join/index.ts
|
728
|
-
var join = SmartTags.makeSmartTag({
|
729
|
-
name: "join",
|
730
|
-
defaultMode: "coalescion",
|
731
|
-
isolationInitType: "array",
|
732
|
-
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "array", "nodelist"),
|
733
|
-
argsValueCheck: (a) => Utils.Tree.TypeChecks.typeCheckMany(a, "string", "text"),
|
734
|
-
func: (main, args) => {
|
735
|
-
const { makeSuccess } = Outcome;
|
736
|
-
const joiner = Cast.toString(args);
|
737
|
-
if (Array.isArray(main)) return makeSuccess(main.map(Cast.toString).join(joiner));
|
738
|
-
return makeSuccess(Array.from(main).map(Cast.toString).join(joiner));
|
739
|
-
}
|
740
|
-
});
|
741
|
-
|
742
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/length/index.ts
|
743
|
-
var length = SmartTags.makeSmartTag({
|
744
|
-
name: "length",
|
745
|
-
defaultMode: "coalescion",
|
746
|
-
isolationInitType: "array",
|
747
|
-
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "string", "nodelist"),
|
748
|
-
argsValueCheck: (a) => Utils.SmartTags.expectEmptyArgs(a),
|
749
|
-
func: (main) => {
|
750
|
-
const { makeSuccess } = Outcome;
|
751
|
-
const { Text: Text2, NodeList, Element: Element2 } = Window.get();
|
752
|
-
if (typeof main === "string" || main instanceof NodeList || main instanceof Text2 || Array.isArray(main)) return makeSuccess(main.length);
|
753
|
-
if (main instanceof Element2) return makeSuccess(main.childNodes.length);
|
754
|
-
return makeSuccess(Object.keys(main).length);
|
755
|
-
}
|
756
|
-
});
|
757
|
-
|
758
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/map/index.ts
|
759
|
-
var map = SmartTags.makeSmartTag({
|
760
|
-
name: "map",
|
761
|
-
defaultMode: "coalescion",
|
762
|
-
isolationInitType: "array",
|
763
|
-
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "array"),
|
764
|
-
argsValueCheck: (a) => Utils.Tree.TypeChecks.typeCheckMany(a, "method"),
|
765
|
-
func: (main, args) => {
|
766
|
-
const { makeTransformationError } = Utils.SmartTags;
|
767
|
-
let mapped = [];
|
768
|
-
for (const val of main) {
|
769
|
-
let reduced = val;
|
770
|
-
for (const arg of args) {
|
771
|
-
const { transformer } = arg;
|
772
|
-
const applied = transformer.apply(reduced);
|
773
|
-
if (!applied.success) return Outcome.makeFailure(makeTransformationError({
|
774
|
-
message: "Subtransformation failure.",
|
775
|
-
onTransformed: reduced,
|
776
|
-
transformerAt: args.indexOf(arg),
|
777
|
-
transformerName: transformer.name,
|
778
|
-
transformerInput: reduced,
|
779
|
-
transformerOutput: applied
|
780
|
-
}));
|
781
|
-
reduced = applied.payload;
|
782
|
-
}
|
783
|
-
mapped.push(reduced);
|
784
|
-
}
|
785
|
-
return Outcome.makeSuccess(mapped);
|
786
|
-
}
|
787
|
-
});
|
788
|
-
|
789
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/negate/index.ts
|
790
|
-
var negate = SmartTags.makeSmartTag({
|
791
|
-
name: "negate",
|
792
|
-
defaultMode: "coalescion",
|
793
|
-
isolationInitType: "array",
|
794
|
-
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "boolean"),
|
795
|
-
argsValueCheck: (a) => Utils.SmartTags.expectEmptyArgs(a),
|
796
|
-
func: (main) => Outcome.makeSuccess(!main)
|
797
|
-
});
|
798
|
-
|
799
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/notrailing/index.ts
|
800
|
-
var notrailing = SmartTags.makeSmartTag({
|
801
|
-
name: "notrailing",
|
802
|
-
defaultMode: "coalescion",
|
803
|
-
isolationInitType: "array",
|
804
|
-
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "string", "text"),
|
805
|
-
argsValueCheck: (a) => {
|
806
|
-
const { makeSuccess, makeFailure } = Outcome;
|
807
|
-
const { makeArgsValueError } = Utils.SmartTags;
|
808
|
-
const { getType, typeCheck } = Utils.Tree.TypeChecks;
|
809
|
-
if (a.length === 0) return makeSuccess([]);
|
810
|
-
if (a.length > 1) return makeFailure(makeArgsValueError("undefined", getType(a[1]) ?? "undefined", 1));
|
811
|
-
const [first] = a;
|
812
|
-
const firstChecked = typeCheck(first, "string", "text");
|
813
|
-
if (!firstChecked.success) return makeFailure(makeArgsValueError(
|
814
|
-
firstChecked.error.expected,
|
815
|
-
firstChecked.error.found,
|
816
|
-
0
|
817
|
-
));
|
818
|
-
return makeSuccess([firstChecked.payload]);
|
819
|
-
},
|
820
|
-
func: (main, args) => {
|
821
|
-
const strMain = Cast.toString(main);
|
822
|
-
const firstArg = args[0];
|
823
|
-
const strFirstArg = Cast.toString(firstArg ?? "/");
|
824
|
-
let strOutput = strMain;
|
825
|
-
while (strOutput.endsWith(strFirstArg)) strOutput = strOutput.slice(0, -1);
|
826
|
-
if (typeof main === "string") return Outcome.makeSuccess(strOutput);
|
827
|
-
return Outcome.makeSuccess(Cast.toText(strOutput));
|
828
|
-
}
|
829
|
-
});
|
830
|
-
|
831
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/or/index.ts
|
832
|
-
var or = SmartTags.makeSmartTag({
|
833
|
-
name: "or",
|
834
|
-
defaultMode: "coalescion",
|
835
|
-
isolationInitType: "array",
|
836
|
-
mainValueCheck: (m) => Outcome.makeSuccess(m),
|
837
|
-
argsValueCheck: (a) => Outcome.makeSuccess(a),
|
838
|
-
func: (main, args) => {
|
839
|
-
const all = [main, ...args];
|
840
|
-
const returned = all.some(Cast.toBoolean);
|
841
|
-
return Outcome.makeSuccess(returned);
|
842
|
-
}
|
843
|
-
});
|
844
|
-
|
845
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/pickrandom/index.ts
|
846
|
-
var pickrandom = SmartTags.makeSmartTag({
|
847
|
-
name: "pickrandom",
|
848
|
-
defaultMode: "coalescion",
|
849
|
-
isolationInitType: "array",
|
850
|
-
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "array"),
|
851
|
-
argsValueCheck: (a) => Utils.SmartTags.expectEmptyArgs(a),
|
852
|
-
func: (main) => {
|
853
|
-
const { makeSuccess, makeFailure } = Outcome;
|
854
|
-
const { makeTransformationError } = Utils.SmartTags;
|
855
|
-
const pos = Math.floor(Math.random() * main.length);
|
856
|
-
const found = main[pos];
|
857
|
-
if (found === void 0) return makeFailure(makeTransformationError("Cannot pick inside empty array"));
|
858
|
-
return makeSuccess(found);
|
859
|
-
}
|
860
|
-
});
|
861
|
-
|
862
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/print/index.ts
|
863
|
-
var print = SmartTags.makeSmartTag({
|
864
|
-
name: "print",
|
865
|
-
defaultMode: "coalescion",
|
866
|
-
isolationInitType: "array",
|
867
|
-
mainValueCheck: (m) => {
|
868
|
-
const { getType } = Utils.Tree.TypeChecks;
|
869
|
-
const { makeSuccess, makeFailure } = Outcome;
|
870
|
-
const { makeMainValueError } = Utils.SmartTags;
|
871
|
-
return getType(m) === "transformer" ? makeFailure(makeMainValueError("Exclude<value, transformer>", "transformer")) : makeSuccess(m);
|
872
|
-
},
|
873
|
-
argsValueCheck: (a) => Outcome.makeSuccess(a),
|
874
|
-
func: (main, args, details) => {
|
875
|
-
console.group("print");
|
876
|
-
console.log("Main:", main);
|
877
|
-
console.log("Args:", ...args);
|
878
|
-
console.log("Tree:", details.sourceTree);
|
879
|
-
console.groupEnd();
|
880
|
-
return Outcome.makeSuccess(main);
|
881
|
-
}
|
882
|
-
});
|
883
|
-
|
884
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/populate/index.ts
|
885
|
-
var populate = SmartTags.makeSmartTag({
|
886
|
-
name: "populate",
|
887
|
-
defaultMode: "coalescion",
|
888
|
-
isolationInitType: "array",
|
889
|
-
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "record"),
|
890
|
-
argsValueCheck: (a) => {
|
891
|
-
const [first, ...others] = a;
|
892
|
-
const { makeFailure, makeSuccess } = Outcome;
|
893
|
-
const { makeArgsValueError } = Utils.SmartTags;
|
894
|
-
const { typeCheck, typeCheckMany, getType } = Utils.Tree.TypeChecks;
|
895
|
-
const firstChecked = typeCheck(first, "string", "text", "nodelist", "element");
|
896
|
-
if (!firstChecked.success) return makeFailure(makeArgsValueError(
|
897
|
-
firstChecked.error.expected,
|
898
|
-
firstChecked.error.found,
|
899
|
-
0
|
900
|
-
));
|
901
|
-
const othersChecked = typeCheckMany(others, "array");
|
902
|
-
if (!othersChecked.success) return makeFailure(makeArgsValueError(
|
903
|
-
othersChecked.error.expected,
|
904
|
-
othersChecked.error.found,
|
905
|
-
othersChecked.error.position + 1
|
906
|
-
));
|
907
|
-
for (const [argPos, arg] of Object.entries(othersChecked.payload)) {
|
908
|
-
const argPosNum = parseInt(argPos);
|
909
|
-
const [first2, second] = arg;
|
910
|
-
const firstChecked2 = typeCheck(first2, "string", "text");
|
911
|
-
const secondChecked = typeCheck(second, "string", "text");
|
912
|
-
if (!firstChecked2.success || !secondChecked.success) return makeFailure(makeArgsValueError(
|
913
|
-
"[string | Text, string | Text]",
|
914
|
-
`[${getType(first2)}, ${getType(second)}]`,
|
915
|
-
argPosNum + 1
|
916
|
-
));
|
917
|
-
}
|
918
|
-
return makeSuccess(a);
|
919
|
-
},
|
920
|
-
func: (main, args) => {
|
921
|
-
const { makeSuccess, makeFailure } = Outcome;
|
922
|
-
const { makeTransformationError } = Utils.SmartTags;
|
923
|
-
const record2 = main;
|
924
|
-
const [template, ...actions] = args;
|
925
|
-
let returnedStr = Cast.toString(template);
|
926
|
-
for (const [propName, toReplace] of actions) {
|
927
|
-
try {
|
928
|
-
const value = deepGetProperty(record2, Cast.toString(propName));
|
929
|
-
const replaced = replaceAll(returnedStr, Cast.toString(toReplace), Cast.toString(value));
|
930
|
-
returnedStr = replaced;
|
931
|
-
} catch (err) {
|
932
|
-
return makeFailure(makeTransformationError({
|
933
|
-
message: "Something went wrong",
|
934
|
-
subTransformerError: err
|
935
|
-
}));
|
936
|
-
}
|
937
|
-
}
|
938
|
-
const { Text: Text2, NodeList } = Window.get();
|
939
|
-
if (typeof template === "string") return makeSuccess(returnedStr);
|
940
|
-
if (template instanceof Text2) return makeSuccess(Cast.toText(returnedStr));
|
941
|
-
if (template instanceof NodeList) return makeSuccess(Cast.toNodeList(returnedStr));
|
942
|
-
return makeSuccess(Cast.toElement(returnedStr));
|
943
|
-
}
|
944
|
-
});
|
945
|
-
|
946
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/push/index.ts
|
947
|
-
var push = SmartTags.makeSmartTag({
|
948
|
-
name: "push",
|
949
|
-
defaultMode: "coalescion",
|
950
|
-
isolationInitType: "array",
|
951
|
-
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "array"),
|
952
|
-
argsValueCheck: (a) => Outcome.makeSuccess(a),
|
953
|
-
func: (main, args) => Outcome.makeSuccess([...main, ...args])
|
954
|
-
});
|
955
|
-
|
956
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/pusheach/index.ts
|
957
|
-
var pusheach = SmartTags.makeSmartTag({
|
958
|
-
name: "pusheach",
|
959
|
-
defaultMode: "coalescion",
|
960
|
-
isolationInitType: "array",
|
961
|
-
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "array"),
|
962
|
-
argsValueCheck: (a) => {
|
963
|
-
const { makeSuccess, makeFailure } = Outcome;
|
964
|
-
const { typeCheck } = Utils.Tree.TypeChecks;
|
965
|
-
const { makeArgsValueError } = Utils.SmartTags;
|
966
|
-
for (const [argPos, arg] of Object.entries(a)) {
|
967
|
-
const numPos = parseInt(argPos);
|
968
|
-
const checked = typeCheck(arg, "array");
|
969
|
-
if (!checked.success) return makeFailure(makeArgsValueError(
|
970
|
-
checked.error.expected,
|
971
|
-
checked.error.found,
|
972
|
-
numPos
|
973
|
-
));
|
974
|
-
}
|
975
|
-
return makeSuccess(a);
|
976
|
-
},
|
977
|
-
func: (main, args) => {
|
978
|
-
const returned = [...main];
|
979
|
-
for (const arg of args) {
|
980
|
-
returned.push(...arg);
|
981
|
-
}
|
982
|
-
return Outcome.makeSuccess(returned);
|
983
|
-
}
|
984
|
-
});
|
985
|
-
|
986
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/recordtoarray/index.ts
|
987
|
-
var recordtoarray = SmartTags.makeSmartTag({
|
988
|
-
name: "recordtoarray",
|
989
|
-
defaultMode: "coalescion",
|
990
|
-
isolationInitType: "array",
|
991
|
-
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "record"),
|
992
|
-
argsValueCheck: (a) => Utils.SmartTags.expectEmptyArgs(a),
|
993
|
-
func: (main) => Outcome.makeSuccess(Object.values(main))
|
994
|
-
});
|
995
|
-
|
996
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/removeattribute/index.ts
|
997
|
-
var removeattribute = SmartTags.makeSmartTag({
|
998
|
-
name: "removeattribute",
|
999
|
-
defaultMode: "coalescion",
|
1000
|
-
isolationInitType: "array",
|
1001
|
-
mainValueCheck: (m) => {
|
1002
|
-
const { typeCheck, typeCheckMany } = Utils.Tree.TypeChecks;
|
1003
|
-
if (Array.isArray(m)) return typeCheckMany(m, "element");
|
1004
|
-
return typeCheck(m, "element");
|
1005
|
-
},
|
1006
|
-
argsValueCheck: (a) => {
|
1007
|
-
const { makeFailure, makeSuccess } = Outcome;
|
1008
|
-
const { typeCheckMany, getType } = Utils.Tree.TypeChecks;
|
1009
|
-
const { makeArgsValueError } = Utils.SmartTags;
|
1010
|
-
if (a.length === 0) return makeFailure(makeArgsValueError("string | Text", "undefined", 0));
|
1011
|
-
if (a.length > 1) return makeFailure(makeArgsValueError("undefined", getType(a[2]) ?? "undefined", 1));
|
1012
|
-
const checked = typeCheckMany(a, "string", "text");
|
1013
|
-
if (checked.success) return makeSuccess(checked.payload);
|
1014
|
-
return checked;
|
1015
|
-
},
|
1016
|
-
func: (main, args) => {
|
1017
|
-
const { makeSuccess } = Outcome;
|
1018
|
-
const mainArr = Array.isArray(main) ? main : [main];
|
1019
|
-
const mainArrCloned = mainArr.map((e) => Utils.clone(e));
|
1020
|
-
const name = Cast.toString(args[0]);
|
1021
|
-
mainArrCloned.forEach((e) => e.removeAttribute(name));
|
1022
|
-
if (Array.isArray(main)) return makeSuccess(mainArrCloned);
|
1023
|
-
return makeSuccess(mainArrCloned[0]);
|
1024
|
-
}
|
1025
|
-
});
|
1026
|
-
|
1027
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/removeclass/index.ts
|
1028
|
-
var removeclass = SmartTags.makeSmartTag({
|
1029
|
-
name: "removeclass",
|
1030
|
-
defaultMode: "coalescion",
|
1031
|
-
isolationInitType: "array",
|
1032
|
-
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "element"),
|
1033
|
-
argsValueCheck: (a) => Utils.Tree.TypeChecks.typeCheckMany(a, "string", "text"),
|
1034
|
-
func: (main, args) => {
|
1035
|
-
main.classList.remove(...args.map((arg) => Cast.toString(arg)));
|
1036
|
-
return Outcome.makeSuccess(main);
|
1037
|
-
}
|
1038
|
-
});
|
1039
|
-
|
1040
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/renameproperty/index.ts
|
1041
|
-
var renameproperty = SmartTags.makeSmartTag({
|
1042
|
-
name: "renameproperty",
|
1043
|
-
defaultMode: "coalescion",
|
1044
|
-
isolationInitType: "array",
|
1045
|
-
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "record"),
|
1046
|
-
argsValueCheck: (a) => {
|
1047
|
-
const { makeFailure, makeSuccess } = Outcome;
|
1048
|
-
const { typeCheck, typeCheckMany } = Utils.Tree.TypeChecks;
|
1049
|
-
const checked = typeCheckMany(a, "string", "text");
|
1050
|
-
if (!checked.success) return checked;
|
1051
|
-
const [first, second] = a;
|
1052
|
-
const firstChecked = typeCheck(first, "string", "text");
|
1053
|
-
if (!firstChecked.success) return makeFailure(Utils.SmartTags.makeArgsValueError(
|
1054
|
-
firstChecked.error.expected,
|
1055
|
-
firstChecked.error.found,
|
1056
|
-
0
|
1057
|
-
));
|
1058
|
-
const secondChecked = typeCheck(second, "string", "text");
|
1059
|
-
if (!secondChecked.success) return makeFailure(Utils.SmartTags.makeArgsValueError(
|
1060
|
-
secondChecked.error.expected,
|
1061
|
-
secondChecked.error.found,
|
1062
|
-
0
|
1063
|
-
));
|
1064
|
-
return makeSuccess([firstChecked.payload, secondChecked.payload]);
|
1065
|
-
},
|
1066
|
-
func: (main, args) => {
|
1067
|
-
const [oldKey, newKey] = args.map(Cast.toString);
|
1068
|
-
const returned = {};
|
1069
|
-
Object.entries(main).forEach(([key, value]) => {
|
1070
|
-
const targetKey = key === oldKey ? newKey : key;
|
1071
|
-
returned[targetKey] = value;
|
1072
|
-
});
|
1073
|
-
return Outcome.makeSuccess(returned);
|
1074
|
-
}
|
1075
|
-
});
|
1076
|
-
|
1077
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/replace/index.ts
|
1078
|
-
var replace = SmartTags.makeSmartTag({
|
1079
|
-
name: "replace",
|
1080
|
-
defaultMode: "coalescion",
|
1081
|
-
isolationInitType: "array",
|
1082
|
-
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "string", "text", "nodelist", "element"),
|
1083
|
-
argsValueCheck: (a) => {
|
1084
|
-
const { makeFailure, makeSuccess } = Outcome;
|
1085
|
-
const { getType, typeCheckMany } = Utils.Tree.TypeChecks;
|
1086
|
-
const { makeArgsValueError } = Utils.SmartTags;
|
1087
|
-
const expectedStr = "string | Text | NodeListOf<Element | Text> | Element";
|
1088
|
-
if (a.length === 0) return makeFailure(makeArgsValueError(expectedStr, "undefined", 0));
|
1089
|
-
if (a.length === 1) return makeFailure(makeArgsValueError(expectedStr, "undefined", 1));
|
1090
|
-
if (a.length > 2) return makeFailure(makeArgsValueError("undefined", getType(a.at(2)) ?? "undefined", 3));
|
1091
|
-
const checked = typeCheckMany(a, "string", "text", "nodelist", "element");
|
1092
|
-
if (!checked.success) return checked;
|
1093
|
-
return makeSuccess(checked.payload);
|
1094
|
-
},
|
1095
|
-
func: (main, args) => {
|
1096
|
-
const [toReplace, replacer] = args;
|
1097
|
-
const strMain = Cast.toString(main);
|
1098
|
-
const strToReplace = Cast.toString(toReplace);
|
1099
|
-
const strReplacer = Cast.toString(replacer);
|
1100
|
-
const strReplaced = replaceAll(strMain, strToReplace, strReplacer);
|
1101
|
-
let returned;
|
1102
|
-
if (typeof main === "string") {
|
1103
|
-
returned = strReplaced;
|
1104
|
-
} else if (main instanceof Text) {
|
1105
|
-
returned = Cast.toText(strReplaced);
|
1106
|
-
} else if (main instanceof Element) {
|
1107
|
-
returned = Cast.toElement(strReplaced);
|
1108
|
-
} else {
|
1109
|
-
returned = Cast.toNodeList(strReplaced);
|
1110
|
-
}
|
1111
|
-
return Outcome.makeSuccess(returned);
|
1112
|
-
}
|
1113
|
-
});
|
1114
|
-
|
1115
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/select/index.ts
|
1116
|
-
var select = SmartTags.makeSmartTag({
|
1117
|
-
name: "select",
|
1118
|
-
defaultMode: "coalescion",
|
1119
|
-
isolationInitType: "array",
|
1120
|
-
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "nodelist", "element"),
|
1121
|
-
argsValueCheck: (a) => Utils.Tree.TypeChecks.typeCheckMany(a, "string", "text"),
|
1122
|
-
func: (main, args) => {
|
1123
|
-
const selectedFragment = document.createDocumentFragment();
|
1124
|
-
if (main instanceof Window.get().Element) {
|
1125
|
-
for (const arg of args) {
|
1126
|
-
const selector = Cast.toString(arg);
|
1127
|
-
const found = main.querySelectorAll(selector);
|
1128
|
-
selectedFragment.append(...Array.from(found));
|
1129
|
-
}
|
1130
|
-
} else {
|
1131
|
-
const divWrapper = Window.get().document.createElement("div");
|
1132
|
-
divWrapper.append(...Array.from(main));
|
1133
|
-
for (const arg of args) {
|
1134
|
-
const selector = Cast.toString(arg);
|
1135
|
-
const found = divWrapper.querySelectorAll(selector);
|
1136
|
-
selectedFragment.append(...Array.from(found));
|
1137
|
-
}
|
1138
|
-
}
|
1139
|
-
const selected = selectedFragment.childNodes;
|
1140
|
-
return Outcome.makeSuccess(selected);
|
1141
|
-
}
|
1142
|
-
});
|
1143
|
-
|
1144
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/set/index.ts
|
1145
|
-
var set = SmartTags.makeSmartTag({
|
1146
|
-
name: "set",
|
1147
|
-
defaultMode: "coalescion",
|
1148
|
-
isolationInitType: "array",
|
1149
|
-
mainValueCheck: (m) => Outcome.makeSuccess(m),
|
1150
|
-
argsValueCheck: (a) => {
|
1151
|
-
const { makeFailure, makeSuccess } = Outcome;
|
1152
|
-
const { makeArgsValueError } = Utils.SmartTags;
|
1153
|
-
const { getType, typeCheck } = Utils.Tree.TypeChecks;
|
1154
|
-
const first = a[0];
|
1155
|
-
if (first === void 0) return makeFailure(makeArgsValueError("string | text", "undefined", 0));
|
1156
|
-
if (a.length > 2) return makeFailure(makeArgsValueError("undefined", getType(a[2]) ?? "undefined", 2));
|
1157
|
-
const firstChecked = typeCheck(first, "string", "text");
|
1158
|
-
if (!firstChecked.success) return firstChecked;
|
1159
|
-
else return makeSuccess(a);
|
1160
|
-
},
|
1161
|
-
func: (main, args, { sourceTree }) => {
|
1162
|
-
const [first, second] = args;
|
1163
|
-
const strFirst = Cast.toString(first);
|
1164
|
-
sourceTree.setVariable(strFirst, second === void 0 ? main : second);
|
1165
|
-
return Outcome.makeSuccess(main);
|
1166
|
-
}
|
1167
|
-
});
|
1168
|
-
|
1169
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/setattribute/index.ts
|
1170
|
-
var setattribute = SmartTags.makeSmartTag({
|
1171
|
-
name: "setattribute",
|
1172
|
-
defaultMode: "coalescion",
|
1173
|
-
isolationInitType: "array",
|
1174
|
-
mainValueCheck: (m) => {
|
1175
|
-
const { typeCheck, typeCheckMany } = Utils.Tree.TypeChecks;
|
1176
|
-
if (Array.isArray(m)) return typeCheckMany(m, "element");
|
1177
|
-
return typeCheck(m, "element");
|
1178
|
-
},
|
1179
|
-
argsValueCheck: (a) => {
|
1180
|
-
const { makeFailure, makeSuccess } = Outcome;
|
1181
|
-
const { typeCheckMany, getType } = Utils.Tree.TypeChecks;
|
1182
|
-
const { makeArgsValueError } = Utils.SmartTags;
|
1183
|
-
if (a.length === 0) return makeFailure(makeArgsValueError("string | Text", "undefined", 0));
|
1184
|
-
if (a.length > 2) return makeFailure(makeArgsValueError("undefined", getType(a[2]) ?? "undefined", 2));
|
1185
|
-
const checked = typeCheckMany(a, "string", "text");
|
1186
|
-
if (checked.success) return makeSuccess(checked.payload);
|
1187
|
-
return checked;
|
1188
|
-
},
|
1189
|
-
func: (main, args) => {
|
1190
|
-
const mainArr = Array.isArray(main) ? main : [main];
|
1191
|
-
const mainArrCloned = mainArr.map((e) => Utils.clone(e));
|
1192
|
-
const argsStr = args.map((e) => Cast.toString(e));
|
1193
|
-
const [name, value = ""] = argsStr;
|
1194
|
-
mainArrCloned.forEach((e) => e.setAttribute(name, value));
|
1195
|
-
if (Array.isArray(main)) return Outcome.makeSuccess(mainArrCloned);
|
1196
|
-
return Outcome.makeSuccess(mainArrCloned[0]);
|
1197
|
-
}
|
1198
|
-
});
|
1199
|
-
|
1200
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/setproperties/index.ts
|
1201
|
-
var setproperties = SmartTags.makeSmartTag({
|
1202
|
-
name: "setproperties",
|
1203
|
-
defaultMode: "coalescion",
|
1204
|
-
isolationInitType: "array",
|
1205
|
-
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "record"),
|
1206
|
-
argsValueCheck: (a) => {
|
1207
|
-
const { makeFailure, makeSuccess } = Outcome;
|
1208
|
-
const { makeArgsValueError } = Utils.SmartTags;
|
1209
|
-
const { getType, typeCheck } = Utils.Tree.TypeChecks;
|
1210
|
-
if (a.length === 0) return makeFailure(makeArgsValueError("record", "undefined", 0));
|
1211
|
-
if (a.length > 1) return makeFailure(makeArgsValueError("undefined", getType(a.at(1)) ?? "undefined", 1));
|
1212
|
-
const [first] = a;
|
1213
|
-
const firstChecked = typeCheck(first, "record");
|
1214
|
-
if (!firstChecked.success) return makeFailure(makeArgsValueError(firstChecked.error.expected, firstChecked.error.found, 0));
|
1215
|
-
return makeSuccess([firstChecked.payload]);
|
1216
|
-
},
|
1217
|
-
func: (main, args) => Outcome.makeSuccess({ ...main, ...args[0] })
|
1218
|
-
});
|
1219
|
-
|
1220
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/setproperty/index.ts
|
1221
|
-
var setproperty = SmartTags.makeSmartTag({
|
1222
|
-
name: "setproperty",
|
1223
|
-
defaultMode: "coalescion",
|
1224
|
-
isolationInitType: "array",
|
1225
|
-
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "record"),
|
1226
|
-
argsValueCheck: (a) => {
|
1227
|
-
const { makeFailure, makeSuccess } = Outcome;
|
1228
|
-
const { makeArgsValueError } = Utils.SmartTags;
|
1229
|
-
const { getType, typeCheck } = Utils.Tree.TypeChecks;
|
1230
|
-
if (a.length === 0) return makeFailure(makeArgsValueError("string | Text", "undefined", 0));
|
1231
|
-
if (a.length === 1) return makeFailure(makeArgsValueError("value", "undefined", 1));
|
1232
|
-
if (a.length !== 2) return makeFailure(makeArgsValueError("undefined", getType(a.at(2)) ?? "undefined", 2));
|
1233
|
-
const [first, second] = a;
|
1234
|
-
const firstChecked = typeCheck(first, "string", "text");
|
1235
|
-
if (!firstChecked.success) return makeFailure(makeArgsValueError(firstChecked.error.expected, firstChecked.error.found, 0));
|
1236
|
-
return makeSuccess([firstChecked.payload, second]);
|
1237
|
-
},
|
1238
|
-
func: (main, args) => {
|
1239
|
-
const [key, val] = args;
|
1240
|
-
const { makeSuccess, makeFailure } = Outcome;
|
1241
|
-
const { makeTransformationError } = Utils.SmartTags;
|
1242
|
-
try {
|
1243
|
-
const withPropertySet = deepSetProperty(
|
1244
|
-
Utils.clone(main),
|
1245
|
-
Cast.toString(key),
|
1246
|
-
val
|
1247
|
-
);
|
1248
|
-
return makeSuccess(withPropertySet);
|
1249
|
-
} catch (err) {
|
1250
|
-
return makeFailure(makeTransformationError(`Impossible to access property :${key}`));
|
1251
|
-
}
|
1252
|
-
}
|
1253
|
-
});
|
1254
|
-
function deepSetProperty(record2, pathString, value) {
|
1255
|
-
const pathChunks = pathString.split(".");
|
1256
|
-
const clone2 = Utils.clone(record2);
|
1257
|
-
let currentRecord = clone2;
|
1258
|
-
pathChunks.forEach((chunk, pos) => {
|
1259
|
-
const isLast = pos === pathChunks.length - 1;
|
1260
|
-
if (isLast) {
|
1261
|
-
currentRecord[chunk] = value;
|
1262
|
-
} else {
|
1263
|
-
const found = currentRecord[chunk];
|
1264
|
-
if (isRecord(found)) currentRecord = found;
|
1265
|
-
else throw "NOT_A_RECORD";
|
1266
|
-
}
|
1267
|
-
});
|
1268
|
-
return clone2;
|
1269
|
-
}
|
1270
|
-
|
1271
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/sorton/index.ts
|
1272
|
-
var sorton = SmartTags.makeSmartTag({
|
1273
|
-
name: "sorton",
|
1274
|
-
defaultMode: "coalescion",
|
1275
|
-
isolationInitType: "array",
|
1276
|
-
mainValueCheck: (m) => {
|
1277
|
-
const { makeMainValueError } = Utils.SmartTags;
|
1278
|
-
const { getType } = Utils.Tree.TypeChecks;
|
1279
|
-
const { makeFailure, makeSuccess } = Outcome;
|
1280
|
-
if (!Array.isArray(m)) return makeFailure(makeMainValueError("array<record>", getType(m) ?? "undefined"));
|
1281
|
-
for (const [itemPos, itemVal] of Object.entries(m)) {
|
1282
|
-
if (isRecord(itemVal)) continue;
|
1283
|
-
return makeFailure(makeMainValueError("record", getType(itemVal), `At position ${parseInt(itemPos)} in main value`));
|
1284
|
-
}
|
1285
|
-
return makeSuccess(m);
|
1286
|
-
},
|
1287
|
-
argsValueCheck: (a) => {
|
1288
|
-
const { makeFailure, makeSuccess } = Outcome;
|
1289
|
-
const { makeArgsValueError } = Utils.SmartTags;
|
1290
|
-
const { getType, typeCheckMany } = Utils.Tree.TypeChecks;
|
1291
|
-
if (a.length === 0) return makeFailure(makeArgsValueError("[string | text]", "[]", 0));
|
1292
|
-
if (a.length > 1) return makeFailure(makeArgsValueError("undefined", getType(a[1]) ?? "undefined", 2));
|
1293
|
-
const checked = typeCheckMany(a, "string", "text");
|
1294
|
-
if (checked.success) return makeSuccess(checked.payload);
|
1295
|
-
return checked;
|
1296
|
-
},
|
1297
|
-
func: (main, args) => {
|
1298
|
-
const { makeFailure, makeSuccess } = Outcome;
|
1299
|
-
const strPropName = Cast.toString(args[0]);
|
1300
|
-
const { getType } = Utils.Tree.TypeChecks;
|
1301
|
-
const { makeTransformationError } = Utils.SmartTags;
|
1302
|
-
const map2 = main.map((record2) => {
|
1303
|
-
const prop = record2[strPropName];
|
1304
|
-
const type = getType(prop);
|
1305
|
-
return { record: record2, prop, type };
|
1306
|
-
});
|
1307
|
-
const firstItem = map2[0];
|
1308
|
-
if (firstItem === void 0) return makeSuccess([]);
|
1309
|
-
const firstItemType = firstItem.type;
|
1310
|
-
if (firstItemType === void 0) return makeFailure(makeTransformationError({
|
1311
|
-
message: "Invalid property type",
|
1312
|
-
onItem: 0,
|
1313
|
-
found: firstItemType
|
1314
|
-
}));
|
1315
|
-
for (const [daytumPos, daytumVal] of Object.entries(map2)) {
|
1316
|
-
if (daytumVal.type !== firstItemType) return makeFailure(makeTransformationError({
|
1317
|
-
message: "Invalid property type",
|
1318
|
-
onItem: parseInt(daytumPos),
|
1319
|
-
expected: firstItemType,
|
1320
|
-
found: daytumVal.type
|
1321
|
-
}));
|
1322
|
-
}
|
1323
|
-
const sorted = main.sort((a, b) => {
|
1324
|
-
const { Text: Text2, NodeList } = Window.get();
|
1325
|
-
const aProp = a[strPropName];
|
1326
|
-
const bProp = b[strPropName];
|
1327
|
-
if (aProp === null) return 0;
|
1328
|
-
if (typeof aProp === "boolean") {
|
1329
|
-
if (aProp === bProp) return 0;
|
1330
|
-
if (aProp) return 1;
|
1331
|
-
return -1;
|
1332
|
-
}
|
1333
|
-
if (typeof aProp === "string") return aProp.localeCompare(Cast.toString(bProp));
|
1334
|
-
if (aProp instanceof Text2) return Cast.toString(aProp).localeCompare(Cast.toString(bProp));
|
1335
|
-
if (typeof aProp === "number") return aProp - Cast.toNumber(bProp);
|
1336
|
-
if (Array.isArray(aProp)) return aProp.length - Cast.toArray(bProp).length;
|
1337
|
-
if (aProp instanceof NodeList) return aProp.length - Cast.toNodeList(bProp).length;
|
1338
|
-
return 0;
|
1339
|
-
});
|
1340
|
-
return makeSuccess(sorted);
|
1341
|
-
}
|
1342
|
-
});
|
1343
|
-
|
1344
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/split/index.ts
|
1345
|
-
var split = SmartTags.makeSmartTag({
|
1346
|
-
name: "split",
|
1347
|
-
defaultMode: "coalescion",
|
1348
|
-
isolationInitType: "array",
|
1349
|
-
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "string", "text"),
|
1350
|
-
argsValueCheck: (a) => Utils.Tree.TypeChecks.typeCheckMany(a, "string", "text"),
|
1351
|
-
func: (main, args) => {
|
1352
|
-
let strReturnedArr = [Cast.toString(main)];
|
1353
|
-
for (const arg of args) {
|
1354
|
-
strReturnedArr = strReturnedArr.map((e) => e.split(Cast.toString(arg))).flat();
|
1355
|
-
}
|
1356
|
-
if (typeof main === "string") return Outcome.makeSuccess(strReturnedArr);
|
1357
|
-
return Outcome.makeSuccess(strReturnedArr.map(Cast.toText));
|
1358
|
-
}
|
1359
|
-
});
|
1360
|
-
|
1361
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/toarray/index.ts
|
1362
|
-
var toarray = SmartTags.makeSmartTag({
|
1363
|
-
name: "toarray",
|
1364
|
-
defaultMode: "coalescion",
|
1365
|
-
isolationInitType: "array",
|
1366
|
-
mainValueCheck: (m) => Outcome.makeSuccess(m),
|
1367
|
-
argsValueCheck: (a) => Utils.SmartTags.expectEmptyArgs(a),
|
1368
|
-
func: (main) => Outcome.makeSuccess(Cast.toArray(main))
|
1369
|
-
});
|
1370
|
-
|
1371
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/toboolean/index.ts
|
1372
|
-
var toboolean = SmartTags.makeSmartTag({
|
1373
|
-
name: "toboolean",
|
1374
|
-
defaultMode: "coalescion",
|
1375
|
-
isolationInitType: "array",
|
1376
|
-
mainValueCheck: (m) => Outcome.makeSuccess(m),
|
1377
|
-
argsValueCheck: (a) => Utils.SmartTags.expectEmptyArgs(a),
|
1378
|
-
func: (m) => Outcome.makeSuccess(Cast.toBoolean(m))
|
1379
|
-
});
|
1380
|
-
|
1381
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/toelement/index.ts
|
1382
|
-
var toelement = SmartTags.makeSmartTag({
|
1383
|
-
name: "toelement",
|
1384
|
-
defaultMode: "coalescion",
|
1385
|
-
isolationInitType: "array",
|
1386
|
-
mainValueCheck: (m) => Outcome.makeSuccess(m),
|
1387
|
-
argsValueCheck: (a) => Utils.SmartTags.expectEmptyArgs(a),
|
1388
|
-
func: (m) => Outcome.makeSuccess(Cast.toElement(m))
|
1389
|
-
});
|
1390
|
-
|
1391
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/toggleclass/index.ts
|
1392
|
-
var toggleclass = SmartTags.makeSmartTag({
|
1393
|
-
name: "toggleclass",
|
1394
|
-
defaultMode: "coalescion",
|
1395
|
-
isolationInitType: "array",
|
1396
|
-
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "element"),
|
1397
|
-
argsValueCheck: (a) => Utils.Tree.TypeChecks.typeCheckMany(a, "string", "text"),
|
1398
|
-
func: (main, args) => {
|
1399
|
-
for (const arg of args) main.classList.toggle(Cast.toString(arg));
|
1400
|
-
return Outcome.makeSuccess(main);
|
1401
|
-
}
|
1402
|
-
});
|
1403
|
-
|
1404
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/tonodelist/index.ts
|
1405
|
-
var tonodelist = SmartTags.makeSmartTag({
|
1406
|
-
name: "tonodelist",
|
1407
|
-
defaultMode: "coalescion",
|
1408
|
-
isolationInitType: "array",
|
1409
|
-
mainValueCheck: (m) => Outcome.makeSuccess(m),
|
1410
|
-
argsValueCheck: (a) => Utils.SmartTags.expectEmptyArgs(a),
|
1411
|
-
func: (m) => Outcome.makeSuccess(Cast.toNodeList(m))
|
1412
|
-
});
|
1413
|
-
|
1414
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/tonull/index.ts
|
1415
|
-
var tonull = SmartTags.makeSmartTag({
|
1416
|
-
name: "tonull",
|
1417
|
-
defaultMode: "coalescion",
|
1418
|
-
isolationInitType: "array",
|
1419
|
-
mainValueCheck: (m) => Outcome.makeSuccess(m),
|
1420
|
-
argsValueCheck: (a) => Utils.SmartTags.expectEmptyArgs(a),
|
1421
|
-
func: () => Outcome.makeSuccess(null)
|
1422
|
-
});
|
1423
|
-
|
1424
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/tonumber/index.ts
|
1425
|
-
var tonumber = SmartTags.makeSmartTag({
|
1426
|
-
name: "tonumber",
|
1427
|
-
defaultMode: "coalescion",
|
1428
|
-
isolationInitType: "array",
|
1429
|
-
mainValueCheck: (m) => Outcome.makeSuccess(m),
|
1430
|
-
argsValueCheck: (a) => Utils.SmartTags.expectEmptyArgs(a),
|
1431
|
-
func: (m) => Outcome.makeSuccess(Cast.toNumber(m))
|
1432
|
-
});
|
1433
|
-
|
1434
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/torecord/index.ts
|
1435
|
-
var torecord = SmartTags.makeSmartTag({
|
1436
|
-
name: "torecord",
|
1437
|
-
defaultMode: "coalescion",
|
1438
|
-
isolationInitType: "array",
|
1439
|
-
mainValueCheck: (m) => Outcome.makeSuccess(m),
|
1440
|
-
argsValueCheck: (a) => Utils.SmartTags.expectEmptyArgs(a),
|
1441
|
-
func: (main) => Outcome.makeSuccess(Cast.toRecord(main))
|
1442
|
-
});
|
1443
|
-
|
1444
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/toref/index.ts
|
1445
|
-
var toref = SmartTags.makeSmartTag({
|
1446
|
-
name: "toref",
|
1447
|
-
defaultMode: "coalescion",
|
1448
|
-
isolationInitType: "array",
|
1449
|
-
mainValueCheck: (m) => Outcome.makeSuccess(m),
|
1450
|
-
argsValueCheck: (a) => Utils.SmartTags.expectEmptyArgs(a),
|
1451
|
-
func: (main, args, details) => func(Cast.toString(main), args, details)
|
1452
|
-
});
|
1453
|
-
|
1454
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/tostring/index.ts
|
1455
|
-
var tostring = SmartTags.makeSmartTag({
|
1456
|
-
name: "tostring",
|
1457
|
-
defaultMode: "coalescion",
|
1458
|
-
isolationInitType: "array",
|
1459
|
-
mainValueCheck: (m) => Outcome.makeSuccess(m),
|
1460
|
-
argsValueCheck: (a) => Utils.SmartTags.expectEmptyArgs(a),
|
1461
|
-
func: (m) => Outcome.makeSuccess(Cast.toString(m))
|
1462
|
-
});
|
1463
|
-
|
1464
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/totext/index.ts
|
1465
|
-
var totext = SmartTags.makeSmartTag({
|
1466
|
-
name: "totext",
|
1467
|
-
defaultMode: "coalescion",
|
1468
|
-
isolationInitType: "array",
|
1469
|
-
mainValueCheck: (m) => Outcome.makeSuccess(m),
|
1470
|
-
argsValueCheck: (a) => Utils.SmartTags.expectEmptyArgs(a),
|
1471
|
-
func: (m) => Outcome.makeSuccess(Cast.toText(m))
|
1472
|
-
});
|
1473
|
-
|
1474
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/transformselected/index.ts
|
1475
|
-
var transformselected = SmartTags.makeSmartTag({
|
1476
|
-
name: "transformselected",
|
1477
|
-
defaultMode: "coalescion",
|
1478
|
-
isolationInitType: "array",
|
1479
|
-
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "element", "nodelist"),
|
1480
|
-
argsValueCheck: (a) => {
|
1481
|
-
const { makeFailure, makeSuccess } = Outcome;
|
1482
|
-
const { typeCheck, typeCheckMany } = Utils.Tree.TypeChecks;
|
1483
|
-
const [first, ...others] = a;
|
1484
|
-
const firstChecked = typeCheck(first, "string", "text");
|
1485
|
-
if (!firstChecked.success) return makeFailure({ ...firstChecked.error, position: 0 });
|
1486
|
-
const othersChecked = typeCheckMany(others, "method");
|
1487
|
-
if (!othersChecked.success) return makeFailure({
|
1488
|
-
...othersChecked.error,
|
1489
|
-
position: othersChecked.error.position + 1
|
1490
|
-
});
|
1491
|
-
const returned = [firstChecked.payload, ...othersChecked.payload];
|
1492
|
-
return makeSuccess(returned);
|
1493
|
-
},
|
1494
|
-
func: (main, args) => {
|
1495
|
-
const { makeFailure, makeSuccess } = Outcome;
|
1496
|
-
const { makeTransformationError } = Utils.SmartTags;
|
1497
|
-
const { typeCheck } = Utils.Tree.TypeChecks;
|
1498
|
-
const mainClone = Cast.toElement(main);
|
1499
|
-
const [selector, ...methods] = args;
|
1500
|
-
const selectedElements = Array.from(mainClone.querySelectorAll(Cast.toString(selector)));
|
1501
|
-
const transformationMap = new Map(selectedElements.map((s) => [s, Utils.clone(s)]));
|
1502
|
-
for (const method of methods) {
|
1503
|
-
for (const [selected, value] of Array.from(transformationMap)) {
|
1504
|
-
const transformer = method.transformer;
|
1505
|
-
const applied = transformer.apply(value);
|
1506
|
-
if (!applied.success) return makeFailure(makeTransformationError({
|
1507
|
-
// [WIP] maybe a custom makeSubTransformationError ?
|
1508
|
-
message: "Subtransformation failure.",
|
1509
|
-
onSelected: selected,
|
1510
|
-
onTransformed: value,
|
1511
|
-
transformerAt: methods.indexOf(method),
|
1512
|
-
transformerName: transformer.name,
|
1513
|
-
transformerOutput: applied
|
1514
|
-
}));
|
1515
|
-
transformationMap.set(selected, applied.payload);
|
1516
|
-
}
|
1517
|
-
}
|
1518
|
-
for (const [selected, transformed] of Array.from(transformationMap)) {
|
1519
|
-
const transformedChecked = typeCheck(transformed, "element", "nodelist", "text", "string", "number", "boolean", "null");
|
1520
|
-
if (!transformedChecked.success) return makeFailure(makeTransformationError({
|
1521
|
-
// [WIP] maybe a custom makeBadTransformationOutputError ?
|
1522
|
-
message: "Bad transformation output",
|
1523
|
-
onSelected: selected,
|
1524
|
-
onTransformed: transformed,
|
1525
|
-
details: { ...transformedChecked.error }
|
1526
|
-
}));
|
1527
|
-
const { Element: Element2, NodeList, Text: Text2 } = Window.get();
|
1528
|
-
const replacer = transformedChecked.payload;
|
1529
|
-
if (replacer instanceof Element2 || replacer instanceof Text2) {
|
1530
|
-
insertNode(replacer, "after", selected);
|
1531
|
-
selected.remove();
|
1532
|
-
} else if (replacer instanceof NodeList) {
|
1533
|
-
replacer.forEach((item) => insertNode(item, "before", selected));
|
1534
|
-
selected.remove();
|
1535
|
-
} else {
|
1536
|
-
insertNode(Cast.toText(replacer), "after", selected);
|
1537
|
-
selected.remove();
|
1538
|
-
}
|
1539
|
-
transformedChecked.payload;
|
1540
|
-
}
|
1541
|
-
if (main instanceof Element) return makeSuccess(mainClone);
|
1542
|
-
const safeChildren = Array.from(mainClone.childNodes).filter((e) => e instanceof Element || e instanceof Text);
|
1543
|
-
return main instanceof Element ? makeSuccess(mainClone) : makeSuccess(Cast.toNodeList(safeChildren));
|
1544
|
-
}
|
1545
|
-
});
|
1546
|
-
|
1547
|
-
// src/agnostic/html/hyper-json/smart-tags/coalesced/trim/index.ts
|
1548
|
-
var trim = SmartTags.makeSmartTag({
|
1549
|
-
name: "trim",
|
1550
|
-
defaultMode: "coalescion",
|
1551
|
-
isolationInitType: "array",
|
1552
|
-
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "string", "text"),
|
1553
|
-
argsValueCheck: (a) => Utils.SmartTags.expectEmptyArgs(a),
|
1554
|
-
func: (main) => {
|
1555
|
-
return typeof main === "string" ? Outcome.makeSuccess(main.trim()) : Outcome.makeSuccess(Cast.toText(`${main}`.trim()));
|
1556
|
-
}
|
1557
|
-
});
|
1558
|
-
|
1559
|
-
// src/agnostic/html/hyper-json/tree/index.ts
|
1560
|
-
var Tree;
|
1561
|
-
((_Tree) => {
|
1562
|
-
class Tree2 {
|
1563
|
-
node;
|
1564
|
-
options;
|
1565
|
-
parent;
|
1566
|
-
parents;
|
1567
|
-
pathFromParent;
|
1568
|
-
root;
|
1569
|
-
isRoot;
|
1570
|
-
path;
|
1571
|
-
pathString;
|
1572
|
-
attributes;
|
1573
|
-
isMethod;
|
1574
|
-
tagName;
|
1575
|
-
smartTagName;
|
1576
|
-
smartTagsRegister;
|
1577
|
-
smartTagData;
|
1578
|
-
mode;
|
1579
|
-
isPreserved;
|
1580
|
-
isLiteral;
|
1581
|
-
isolationInitType;
|
1582
|
-
subtrees = /* @__PURE__ */ new Map();
|
1583
|
-
static actionAttribute = "_action";
|
1584
|
-
static keyAttribute = "_key";
|
1585
|
-
static methodAttribute = "_method";
|
1586
|
-
static initAttribute = "_init";
|
1587
|
-
static modeAttribute = "_mode";
|
1588
|
-
static preserveAttribute = "_preserve";
|
1589
|
-
static literalAttribute = "_literal";
|
1590
|
-
static defaultOptions = {
|
1591
|
-
globalObject: {},
|
1592
|
-
logger: null,
|
1593
|
-
loggerThread: "hyperjson"
|
1594
|
-
};
|
1595
|
-
static from(nodes, options) {
|
1596
|
-
const merged = Utils.Tree.mergeNodes(nodes);
|
1597
|
-
return new Tree2(merged, null, null, options);
|
1598
|
-
}
|
1599
|
-
constructor(node, parent, pathFromParent, options) {
|
1600
|
-
const { Element: Element2, Text: Text2 } = Window.get();
|
1601
|
-
this.resolve = this.resolve.bind(this);
|
1602
|
-
this.setVariable = this.setVariable.bind(this);
|
1603
|
-
this.getVariable = this.getVariable.bind(this);
|
1604
|
-
this.performSafetyChecks = this.performSafetyChecks.bind(this);
|
1605
|
-
this.computeValue = this.computeValue.bind(this);
|
1606
|
-
this.enforceEvaluation = this.enforceEvaluation.bind(this);
|
1607
|
-
this.getCachedValue = this.getCachedValue.bind(this);
|
1608
|
-
this.setCachedValue = this.setCachedValue.bind(this);
|
1609
|
-
this.getPerformanceData = this.getPerformanceData.bind(this);
|
1610
|
-
this.evaluate = this.evaluate.bind(this);
|
1611
|
-
this.node = node;
|
1612
|
-
this.options = options ?? Tree2.defaultOptions;
|
1613
|
-
if (parent !== null && pathFromParent !== null) {
|
1614
|
-
this.isRoot = false;
|
1615
|
-
this.parent = parent;
|
1616
|
-
this.parents = [parent, ...parent.parents];
|
1617
|
-
this.pathFromParent = pathFromParent;
|
1618
|
-
this.root = this.parent.root;
|
1619
|
-
} else {
|
1620
|
-
this.isRoot = true;
|
1621
|
-
this.parent = null;
|
1622
|
-
this.parents = [];
|
1623
|
-
this.pathFromParent = null;
|
1624
|
-
this.root = this;
|
1625
|
-
}
|
1626
|
-
this.path = this.isRoot ? [] : [...this.parent.path, this.pathFromParent];
|
1627
|
-
this.pathString = `/${this.path.join("/")}`;
|
1628
|
-
this.attributes = node instanceof Element2 ? Array.from(node.attributes) : null;
|
1629
|
-
if (node instanceof Element2) {
|
1630
|
-
const rawTagName = node.tagName.trim().toLowerCase();
|
1631
|
-
const hasTrailingUnderscore = rawTagName.endsWith("_");
|
1632
|
-
const hasMethodAttribute = this.attributes?.find((attr) => attr.name === Tree2.methodAttribute) !== void 0;
|
1633
|
-
const isMethod = hasTrailingUnderscore || hasMethodAttribute;
|
1634
|
-
this.isMethod = isMethod;
|
1635
|
-
this.tagName = rawTagName;
|
1636
|
-
this.smartTagName = hasTrailingUnderscore ? rawTagName.replace(/_+$/g, "") : rawTagName;
|
1637
|
-
} else {
|
1638
|
-
this.isMethod = false;
|
1639
|
-
this.tagName = null;
|
1640
|
-
this.smartTagName = null;
|
1641
|
-
}
|
1642
|
-
this.smartTagsRegister = new Map([
|
1643
|
-
any,
|
1644
|
-
array,
|
1645
|
-
boolean,
|
1646
|
-
element,
|
1647
|
-
get,
|
1648
|
-
global,
|
1649
|
-
guess,
|
1650
|
-
nodelist,
|
1651
|
-
nullFunc,
|
1652
|
-
number,
|
1653
|
-
record,
|
1654
|
-
ref,
|
1655
|
-
string,
|
1656
|
-
text,
|
1657
|
-
add,
|
1658
|
-
addclass,
|
1659
|
-
and,
|
1660
|
-
append,
|
1661
|
-
at,
|
1662
|
-
call,
|
1663
|
-
clone,
|
1664
|
-
deleteproperties,
|
1665
|
-
equals,
|
1666
|
-
getattribute,
|
1667
|
-
getproperties,
|
1668
|
-
getproperty,
|
1669
|
-
ifFunc,
|
1670
|
-
initialize,
|
1671
|
-
join,
|
1672
|
-
length,
|
1673
|
-
map,
|
1674
|
-
negate,
|
1675
|
-
notrailing,
|
1676
|
-
or,
|
1677
|
-
pickrandom,
|
1678
|
-
print,
|
1679
|
-
populate,
|
1680
|
-
push,
|
1681
|
-
pusheach,
|
1682
|
-
recordtoarray,
|
1683
|
-
removeattribute,
|
1684
|
-
removeclass,
|
1685
|
-
renameproperty,
|
1686
|
-
replace,
|
1687
|
-
select,
|
1688
|
-
set,
|
1689
|
-
setattribute,
|
1690
|
-
setproperties,
|
1691
|
-
setproperty,
|
1692
|
-
sorton,
|
1693
|
-
split,
|
1694
|
-
toarray,
|
1695
|
-
toboolean,
|
1696
|
-
toelement,
|
1697
|
-
toggleclass,
|
1698
|
-
tonodelist,
|
1699
|
-
tonull,
|
1700
|
-
tonumber,
|
1701
|
-
toref,
|
1702
|
-
torecord,
|
1703
|
-
tostring,
|
1704
|
-
totext,
|
1705
|
-
transformselected,
|
1706
|
-
trim
|
1707
|
-
]);
|
1708
|
-
if (this.smartTagName === null) {
|
1709
|
-
this.smartTagData = null;
|
1710
|
-
} else {
|
1711
|
-
this.smartTagData = this.smartTagsRegister.get(this.smartTagName) ?? null;
|
1712
|
-
}
|
1713
|
-
const hasModeAttribute = this.attributes?.find((attr) => {
|
1714
|
-
return attr.name === Tree2.modeAttribute && Utils.Tree.TypeChecks.isTreeMode(attr.value);
|
1715
|
-
});
|
1716
|
-
this.mode = hasModeAttribute?.value ?? this.smartTagData?.defaultMode ?? "isolation";
|
1717
|
-
const hasLiteralAttribute = this.attributes?.find((attr) => attr.name === Tree2.literalAttribute) !== void 0;
|
1718
|
-
this.isLiteral = hasLiteralAttribute;
|
1719
|
-
const hasPreservedAttribute = this.attributes?.find((attr) => attr.name === Tree2.preserveAttribute) !== void 0;
|
1720
|
-
this.isPreserved = hasPreservedAttribute;
|
1721
|
-
const hasInitAttribute = this.attributes?.find((attr) => {
|
1722
|
-
if (attr.name !== Tree2.initAttribute) return false;
|
1723
|
-
const val = attr.value.trim().toLowerCase();
|
1724
|
-
if (!Utils.Tree.TypeChecks.isValueTypeName(val)) return false;
|
1725
|
-
if (val === "transformer") return false;
|
1726
|
-
if (val === "method") return false;
|
1727
|
-
return true;
|
1728
|
-
});
|
1729
|
-
if (this.mode === "coalescion") {
|
1730
|
-
this.isolationInitType = "array";
|
1731
|
-
} else {
|
1732
|
-
const initAttributeValue = hasInitAttribute?.value;
|
1733
|
-
if (initAttributeValue !== void 0) {
|
1734
|
-
this.isolationInitType = initAttributeValue;
|
1735
|
-
} else if (this.smartTagData !== null) {
|
1736
|
-
this.isolationInitType = this.smartTagData?.isolationInitType ?? "array";
|
1737
|
-
} else {
|
1738
|
-
this.isolationInitType = "nodelist";
|
1739
|
-
}
|
1740
|
-
}
|
1741
|
-
const { childNodes } = node;
|
1742
|
-
let positionnedChildrenCount = 0;
|
1743
|
-
const mutableSubtrees = /* @__PURE__ */ new Map();
|
1744
|
-
Array.from(childNodes).filter((child, _, childNodes2) => {
|
1745
|
-
if (child instanceof Element2) return true;
|
1746
|
-
if (!(child instanceof Text2)) return false;
|
1747
|
-
const hasContent = (child.textContent ?? "").trim() !== "";
|
1748
|
-
if (hasContent) return true;
|
1749
|
-
if (childNodes2.some((n) => n instanceof Element2)) return false;
|
1750
|
-
return true;
|
1751
|
-
}).forEach((childNode) => {
|
1752
|
-
if (childNode instanceof Text2) {
|
1753
|
-
const hasContent = (childNode.textContent ?? "").trim() !== "";
|
1754
|
-
if (hasContent) {
|
1755
|
-
childNode.textContent = childNode.textContent?.trim() ?? "";
|
1756
|
-
}
|
1757
|
-
mutableSubtrees.set(
|
1758
|
-
positionnedChildrenCount,
|
1759
|
-
new Tree2(childNode, this, positionnedChildrenCount, this.options)
|
1760
|
-
);
|
1761
|
-
positionnedChildrenCount += 1;
|
1762
|
-
} else {
|
1763
|
-
const propertyName = childNode.getAttribute(Tree2.keyAttribute);
|
1764
|
-
if (propertyName === null) {
|
1765
|
-
mutableSubtrees.set(
|
1766
|
-
positionnedChildrenCount,
|
1767
|
-
new Tree2(childNode, this, positionnedChildrenCount, this.options)
|
1768
|
-
);
|
1769
|
-
positionnedChildrenCount += 1;
|
1770
|
-
} else {
|
1771
|
-
mutableSubtrees.set(
|
1772
|
-
propertyName,
|
1773
|
-
new Tree2(childNode, this, propertyName, this.options)
|
1774
|
-
);
|
1775
|
-
}
|
1776
|
-
}
|
1777
|
-
});
|
1778
|
-
this.subtrees = mutableSubtrees;
|
1779
|
-
}
|
1780
|
-
resolve = function(path) {
|
1781
|
-
let currentTree = this;
|
1782
|
-
for (const chunk of path) {
|
1783
|
-
if (chunk === ".") continue;
|
1784
|
-
if (chunk === "..") {
|
1785
|
-
currentTree = currentTree.parent ?? this;
|
1786
|
-
continue;
|
1787
|
-
}
|
1788
|
-
const { subtrees } = currentTree;
|
1789
|
-
const foundSubtree = subtrees.get(chunk);
|
1790
|
-
if (foundSubtree === void 0) return void 0;
|
1791
|
-
currentTree = foundSubtree;
|
1792
|
-
}
|
1793
|
-
return currentTree;
|
1794
|
-
};
|
1795
|
-
// [WIP] variablesStore is actually only used on root Tree
|
1796
|
-
variablesStore = /* @__PURE__ */ new Map();
|
1797
|
-
setVariable(name, value) {
|
1798
|
-
const { root, isRoot, variablesStore } = this;
|
1799
|
-
if (!isRoot) return root.setVariable(name, value);
|
1800
|
-
variablesStore.set(name, Serialize.serialize(value));
|
1801
|
-
}
|
1802
|
-
getVariable(name) {
|
1803
|
-
const { root } = this;
|
1804
|
-
const found = root.variablesStore.get(name);
|
1805
|
-
if (found === void 0) return void 0;
|
1806
|
-
const deserialized = Serialize.deserialize(found);
|
1807
|
-
if (deserialized instanceof Transformer) throw "A transformer should not be stored as a variable, this happening denotes an implementation error.";
|
1808
|
-
return deserialized;
|
1809
|
-
}
|
1810
|
-
performSafetyChecks() {
|
1811
|
-
const { node, smartTagData, isMethod, mode, isRoot } = this;
|
1812
|
-
const { Text: Text2 } = Window.get();
|
1813
|
-
if (node instanceof Text2 || smartTagData === null) {
|
1814
|
-
if (isMethod) throw new Error(`A Text or HTMLElement node cannot be used as a method @ ${this.pathString}`);
|
1815
|
-
if (mode === "coalescion") throw new Error(`A Text or HTMLElement node cannot be used in coalescion mode @ ${this.pathString}`);
|
1816
|
-
}
|
1817
|
-
if (isRoot && mode === "coalescion") throw new Error(`The root node cannot be used in coalescion mode @ ${this.pathString}`);
|
1818
|
-
}
|
1819
|
-
computeValue() {
|
1820
|
-
const {
|
1821
|
-
isolationInitType,
|
1822
|
-
subtrees,
|
1823
|
-
node,
|
1824
|
-
smartTagData,
|
1825
|
-
isMethod,
|
1826
|
-
mode,
|
1827
|
-
performSafetyChecks
|
1828
|
-
} = this;
|
1829
|
-
performSafetyChecks();
|
1830
|
-
const { Text: Text2 } = Window.get();
|
1831
|
-
if (node instanceof Text2) return node.cloneNode(true);
|
1832
|
-
const initialInnerValue = Utils.Tree.getInitialValueFromTypeName(isolationInitType);
|
1833
|
-
const innerValue = Array.from(subtrees).reduce((reduced, [subpath, subtree]) => {
|
1834
|
-
const subvalue = subtree.evaluate();
|
1835
|
-
const coalesced = Utils.coalesceValues(reduced, subpath, subvalue);
|
1836
|
-
return coalesced;
|
1837
|
-
}, initialInnerValue);
|
1838
|
-
if (smartTagData === null) {
|
1839
|
-
const nodelist2 = Cast.toNodeList(innerValue);
|
1840
|
-
const clone2 = node.cloneNode();
|
1841
|
-
clone2.append(...Array.from(nodelist2));
|
1842
|
-
return clone2;
|
1843
|
-
}
|
1844
|
-
const { transformer, method } = smartTagData.generator(innerValue, mode, this);
|
1845
|
-
if (isMethod) return method;
|
1846
|
-
if (mode === "isolation") {
|
1847
|
-
const applied = transformer.apply(null);
|
1848
|
-
if (applied.success) return applied.payload;
|
1849
|
-
throw {
|
1850
|
-
error: "Transformation error",
|
1851
|
-
details: applied.error,
|
1852
|
-
transformer: transformer.name,
|
1853
|
-
path: this.pathString
|
1854
|
-
};
|
1855
|
-
}
|
1856
|
-
return transformer;
|
1857
|
-
}
|
1858
|
-
enforceEvaluation() {
|
1859
|
-
const { isPreserved, node, computeValue, isLiteral, attributes } = this;
|
1860
|
-
const { Element: Element2 } = Window.get();
|
1861
|
-
if (isPreserved) return Utils.clone(node);
|
1862
|
-
const evaluated = computeValue();
|
1863
|
-
if (!isLiteral) return evaluated;
|
1864
|
-
const asLiteral = Utils.toHyperJson(evaluated);
|
1865
|
-
if (asLiteral instanceof Element2) attributes?.forEach(({ name, value }) => asLiteral.setAttribute(name, value));
|
1866
|
-
return asLiteral;
|
1867
|
-
}
|
1868
|
-
cachedValue = void 0;
|
1869
|
-
getCachedValue() {
|
1870
|
-
const { cachedValue } = this;
|
1871
|
-
if (cachedValue === void 0) return void 0;
|
1872
|
-
const deserialized = Serialize.deserialize(cachedValue);
|
1873
|
-
return deserialized;
|
1874
|
-
}
|
1875
|
-
setCachedValue(evaluated) {
|
1876
|
-
this.cachedValue = Serialize.serialize(evaluated);
|
1877
|
-
}
|
1878
|
-
perfCounters = {
|
1879
|
-
evaluations: 0,
|
1880
|
-
computeTime: 0,
|
1881
|
-
computeTimeAvg: 0,
|
1882
|
-
cached: 0,
|
1883
|
-
cacheTime: 0,
|
1884
|
-
cacheTimeAvg: 0,
|
1885
|
-
totalTime: 0
|
1886
|
-
};
|
1887
|
-
// [WIP] bind this
|
1888
|
-
getPerformanceData() {
|
1889
|
-
const { subtrees, cachedValue, tagName, perfCounters } = this;
|
1890
|
-
const subCounters = [];
|
1891
|
-
subCounters.push([this.pathString, {
|
1892
|
-
...perfCounters,
|
1893
|
-
tagName: tagName ?? "#text",
|
1894
|
-
evaluated: cachedValue
|
1895
|
-
}]);
|
1896
|
-
subtrees.forEach((subtree) => subCounters.push(...subtree.getPerformanceData()));
|
1897
|
-
return subCounters.sort((a, b) => {
|
1898
|
-
const aCalls = a[1].evaluations + a[1].cached;
|
1899
|
-
const bCalls = b[1].evaluations + b[1].cached;
|
1900
|
-
return bCalls - aCalls;
|
1901
|
-
});
|
1902
|
-
}
|
1903
|
-
evaluate() {
|
1904
|
-
const start = Date.now();
|
1905
|
-
const {
|
1906
|
-
getCachedValue,
|
1907
|
-
setCachedValue,
|
1908
|
-
enforceEvaluation,
|
1909
|
-
perfCounters
|
1910
|
-
} = this;
|
1911
|
-
const cached = getCachedValue();
|
1912
|
-
if (cached !== void 0) {
|
1913
|
-
const end2 = Date.now();
|
1914
|
-
const time2 = end2 - start;
|
1915
|
-
perfCounters.cached++;
|
1916
|
-
perfCounters.cacheTime += time2;
|
1917
|
-
perfCounters.cacheTimeAvg = perfCounters.cacheTime / perfCounters.cached;
|
1918
|
-
perfCounters.totalTime = perfCounters.computeTime + perfCounters.cacheTime;
|
1919
|
-
return cached;
|
1920
|
-
}
|
1921
|
-
const evaluated = enforceEvaluation();
|
1922
|
-
setCachedValue(evaluated);
|
1923
|
-
const end = Date.now();
|
1924
|
-
const time = end - start;
|
1925
|
-
perfCounters.evaluations++;
|
1926
|
-
perfCounters.computeTime += time;
|
1927
|
-
perfCounters.computeTimeAvg = perfCounters.computeTime / perfCounters.evaluations;
|
1928
|
-
perfCounters.totalTime = perfCounters.computeTime + perfCounters.cacheTime;
|
1929
|
-
return evaluated;
|
1930
|
-
}
|
1931
|
-
}
|
1932
|
-
_Tree.Tree = Tree2;
|
1933
|
-
})(Tree || (Tree = {}));
|
1934
|
-
|
1935
|
-
// src/agnostic/html/hyper-json/utils/index.ts
|
1936
|
-
var Utils;
|
1937
|
-
((Utils2) => {
|
1938
|
-
function clone2(value) {
|
1939
|
-
const { Element: Element2, Text: Text2, NodeList, document: document2 } = Window.get();
|
1940
|
-
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || value === null) return value;
|
1941
|
-
if (value instanceof Text2) return value.cloneNode(true);
|
1942
|
-
if (value instanceof NodeList) {
|
1943
|
-
const frag = document2.createDocumentFragment();
|
1944
|
-
const nodes = Array.from(value).map((e) => e.cloneNode(true));
|
1945
|
-
frag.append(...nodes);
|
1946
|
-
return frag.childNodes;
|
1947
|
-
}
|
1948
|
-
if (value instanceof Element2) return value.cloneNode(true);
|
1949
|
-
if (value instanceof Transformer) return Transformer.clone(value);
|
1950
|
-
if (value instanceof Method) return Method.clone(value);
|
1951
|
-
if (Array.isArray(value)) return [...value.map(clone2)];
|
1952
|
-
if (isRecord(value)) return recordMap(value, (prop) => clone2(prop));
|
1953
|
-
throw new Error(`Cannot clone value: ${value}`);
|
1954
|
-
}
|
1955
|
-
Utils2.clone = clone2;
|
1956
|
-
function coalesceValues(currentValue, subpath, subvalue) {
|
1957
|
-
const { Element: Element2, Text: Text2, NodeList, document: document2 } = Window.get();
|
1958
|
-
let actualSubvalue = subvalue;
|
1959
|
-
if (actualSubvalue instanceof Transformer) {
|
1960
|
-
const transformer = actualSubvalue;
|
1961
|
-
const transformationResult = transformer.apply(currentValue);
|
1962
|
-
if (!transformationResult.success) {
|
1963
|
-
console.warn({ ...transformationResult.error });
|
1964
|
-
return currentValue;
|
1965
|
-
}
|
1966
|
-
const evaluated = transformationResult.payload;
|
1967
|
-
if (transformer.mode === "isolation") {
|
1968
|
-
actualSubvalue = evaluated;
|
1969
|
-
} else {
|
1970
|
-
return evaluated;
|
1971
|
-
}
|
1972
|
-
}
|
1973
|
-
if (Array.isArray(currentValue)) return [...currentValue, actualSubvalue];
|
1974
|
-
if (currentValue === null) return actualSubvalue;
|
1975
|
-
if (typeof currentValue === "boolean") return actualSubvalue;
|
1976
|
-
if (typeof currentValue === "number") return actualSubvalue;
|
1977
|
-
if (currentValue instanceof Transformer) return actualSubvalue;
|
1978
|
-
if (currentValue instanceof Method) return actualSubvalue;
|
1979
|
-
if (typeof currentValue === "string") {
|
1980
|
-
if (actualSubvalue === null || typeof actualSubvalue === "boolean" || typeof actualSubvalue === "number" || typeof actualSubvalue === "string") return `${currentValue}${actualSubvalue}`;
|
1981
|
-
if (actualSubvalue instanceof Text2) return `${currentValue}${actualSubvalue.textContent}`;
|
1982
|
-
if (actualSubvalue instanceof Element2) {
|
1983
|
-
const frag = document2.createDocumentFragment();
|
1984
|
-
frag.append(currentValue, Utils2.clone(actualSubvalue));
|
1985
|
-
return frag.childNodes;
|
1986
|
-
}
|
1987
|
-
if (actualSubvalue instanceof NodeList) {
|
1988
|
-
const frag = document2.createDocumentFragment();
|
1989
|
-
frag.append(currentValue, ...Array.from(Utils2.clone(actualSubvalue)));
|
1990
|
-
return frag.childNodes;
|
1991
|
-
}
|
1992
|
-
return actualSubvalue;
|
1993
|
-
}
|
1994
|
-
if (currentValue instanceof Text2) {
|
1995
|
-
if (actualSubvalue === null || typeof actualSubvalue === "boolean" || typeof actualSubvalue === "number" || typeof actualSubvalue === "string") return document2.createTextNode(`${currentValue.textContent}${actualSubvalue}`);
|
1996
|
-
if (actualSubvalue instanceof Text2) return document2.createTextNode(`${currentValue.textContent}${actualSubvalue.textContent}`);
|
1997
|
-
if (actualSubvalue instanceof Element2) {
|
1998
|
-
const frag = document2.createDocumentFragment();
|
1999
|
-
frag.append(clone2(currentValue), clone2(actualSubvalue));
|
2000
|
-
return frag.childNodes;
|
2001
|
-
}
|
2002
|
-
if (actualSubvalue instanceof NodeList) {
|
2003
|
-
const frag = document2.createDocumentFragment();
|
2004
|
-
frag.append(clone2(currentValue), ...Array.from(clone2(actualSubvalue)));
|
2005
|
-
return frag.childNodes;
|
2006
|
-
}
|
2007
|
-
return actualSubvalue;
|
2008
|
-
}
|
2009
|
-
if (currentValue instanceof Element2) {
|
2010
|
-
if (actualSubvalue === null || typeof actualSubvalue === "boolean" || typeof actualSubvalue === "number" || typeof actualSubvalue === "string") {
|
2011
|
-
const frag = document2.createDocumentFragment();
|
2012
|
-
frag.append(clone2(currentValue), `${actualSubvalue}`);
|
2013
|
-
return frag.childNodes;
|
2014
|
-
}
|
2015
|
-
if (actualSubvalue instanceof Text2 || actualSubvalue instanceof Element2) {
|
2016
|
-
const frag = document2.createDocumentFragment();
|
2017
|
-
frag.append(clone2(currentValue), clone2(actualSubvalue));
|
2018
|
-
return frag.childNodes;
|
2019
|
-
}
|
2020
|
-
if (actualSubvalue instanceof NodeList) {
|
2021
|
-
const frag = document2.createDocumentFragment();
|
2022
|
-
frag.append(clone2(currentValue), ...Array.from(clone2(actualSubvalue)));
|
2023
|
-
return frag.childNodes;
|
2024
|
-
}
|
2025
|
-
return actualSubvalue;
|
2026
|
-
}
|
2027
|
-
if (currentValue instanceof NodeList) {
|
2028
|
-
if (actualSubvalue === null || typeof actualSubvalue === "boolean" || typeof actualSubvalue === "number" || typeof actualSubvalue === "string") {
|
2029
|
-
const frag = document2.createDocumentFragment();
|
2030
|
-
frag.append(...Array.from(clone2(currentValue)), `${actualSubvalue}`);
|
2031
|
-
return frag.childNodes;
|
2032
|
-
}
|
2033
|
-
if (actualSubvalue instanceof Text2 || actualSubvalue instanceof Element2) {
|
2034
|
-
const frag = document2.createDocumentFragment();
|
2035
|
-
frag.append(...Array.from(clone2(currentValue)), clone2(actualSubvalue));
|
2036
|
-
return frag.childNodes;
|
2037
|
-
}
|
2038
|
-
if (actualSubvalue instanceof NodeList) {
|
2039
|
-
const frag = document2.createDocumentFragment();
|
2040
|
-
frag.append(...Array.from(clone2(currentValue)), ...Array.from(clone2(actualSubvalue)));
|
2041
|
-
return frag.childNodes;
|
2042
|
-
}
|
2043
|
-
return actualSubvalue;
|
2044
|
-
}
|
2045
|
-
if (typeof subpath === "number") return { ...currentValue };
|
2046
|
-
return {
|
2047
|
-
...currentValue,
|
2048
|
-
[subpath]: actualSubvalue
|
2049
|
-
};
|
2050
|
-
}
|
2051
|
-
Utils2.coalesceValues = coalesceValues;
|
2052
|
-
Utils2.toHyperJson = (value) => {
|
2053
|
-
const { document: document2, Element: Element2, Text: Text2, NodeList } = Window.get();
|
2054
|
-
if (value instanceof Text2) {
|
2055
|
-
const elt2 = document2.createElement("text");
|
2056
|
-
elt2.innerHTML = value.textContent ?? "";
|
2057
|
-
return elt2;
|
2058
|
-
}
|
2059
|
-
if (value instanceof Element2) return value.cloneNode(true);
|
2060
|
-
if (value instanceof NodeList) {
|
2061
|
-
const elt2 = document2.createElement("nodelist");
|
2062
|
-
elt2.append(...Array.from(value).map((e) => e.cloneNode(true)));
|
2063
|
-
return elt2;
|
2064
|
-
}
|
2065
|
-
if (value === null) return document2.createElement("null");
|
2066
|
-
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
2067
|
-
const elt2 = document2.createElement(typeof value);
|
2068
|
-
elt2.innerHTML = `${value}`;
|
2069
|
-
return elt2;
|
2070
|
-
}
|
2071
|
-
if (Array.isArray(value)) {
|
2072
|
-
const elt2 = document2.createElement("array");
|
2073
|
-
elt2.append(...value.map((e) => (0, Utils2.toHyperJson)(e)));
|
2074
|
-
return elt2;
|
2075
|
-
}
|
2076
|
-
if (value instanceof Transformer) return clone2(value.sourceTree.node);
|
2077
|
-
if (value instanceof Method) return clone2(value.transformer.sourceTree.node);
|
2078
|
-
const elt = document2.createElement("record");
|
2079
|
-
Object.entries(value).forEach(([key, val]) => {
|
2080
|
-
const hjVal = (0, Utils2.toHyperJson)(val);
|
2081
|
-
if (hjVal instanceof Text2) return;
|
2082
|
-
hjVal.setAttribute(Tree.Tree.keyAttribute, key);
|
2083
|
-
elt.append(hjVal);
|
2084
|
-
});
|
2085
|
-
return elt;
|
2086
|
-
};
|
2087
|
-
let Transformations;
|
2088
|
-
((Transformations2) => {
|
2089
|
-
let TypeChecks;
|
2090
|
-
((TypeChecks2) => {
|
2091
|
-
function getType(value) {
|
2092
|
-
if (singleTypeCheck(value, "null")) return "null";
|
2093
|
-
if (singleTypeCheck(value, "boolean")) return "boolean";
|
2094
|
-
if (singleTypeCheck(value, "number")) return "number";
|
2095
|
-
if (singleTypeCheck(value, "string")) return "string";
|
2096
|
-
if (singleTypeCheck(value, "element")) return "element";
|
2097
|
-
if (singleTypeCheck(value, "text")) return "text";
|
2098
|
-
if (singleTypeCheck(value, "nodelist")) return "nodelist";
|
2099
|
-
if (singleTypeCheck(value, "method")) return "method";
|
2100
|
-
if (singleTypeCheck(value, "array")) return "array";
|
2101
|
-
if (singleTypeCheck(value, "record")) return "record";
|
2102
|
-
return void 0;
|
2103
|
-
}
|
2104
|
-
TypeChecks2.getType = getType;
|
2105
|
-
TypeChecks2.everyTypeName = [
|
2106
|
-
"null",
|
2107
|
-
"boolean",
|
2108
|
-
"number",
|
2109
|
-
"string",
|
2110
|
-
"text",
|
2111
|
-
"nodelist",
|
2112
|
-
"element",
|
2113
|
-
"method",
|
2114
|
-
"array",
|
2115
|
-
"record"
|
2116
|
-
];
|
2117
|
-
function singleTypeCheck(value, type) {
|
2118
|
-
const { Element: Element2, Text: Text2, NodeList } = Window.get();
|
2119
|
-
if (type === "null" && value === null) return true;
|
2120
|
-
if (type === "boolean" && typeof value === "boolean") return true;
|
2121
|
-
if (type === "number" && typeof value === "number") return true;
|
2122
|
-
if (type === "string" && typeof value === "string") return true;
|
2123
|
-
if (type === "element" && value instanceof Element2) return true;
|
2124
|
-
if (type === "text" && value instanceof Text2) return true;
|
2125
|
-
if (type === "nodelist" && value instanceof NodeList) {
|
2126
|
-
const children = Array.from(value);
|
2127
|
-
return children.every((child) => child instanceof Element2 || child instanceof Text2);
|
2128
|
-
}
|
2129
|
-
if (type === "method" && value instanceof Method) return true;
|
2130
|
-
if (type === "array" && Array.isArray(value)) {
|
2131
|
-
const childrenOk = value.every((child) => typeCheck(child, ...TypeChecks2.everyTypeName).success);
|
2132
|
-
return childrenOk;
|
2133
|
-
}
|
2134
|
-
if (type === "record" && isRecord(value)) {
|
2135
|
-
const childrenOk = Object.values(value).every((child) => typeCheck(child, ...TypeChecks2.everyTypeName).success);
|
2136
|
-
return childrenOk;
|
2137
|
-
}
|
2138
|
-
return false;
|
2139
|
-
}
|
2140
|
-
TypeChecks2.singleTypeCheck = singleTypeCheck;
|
2141
|
-
function typeCheck(value, ...types) {
|
2142
|
-
const matchesOneType = types.some((type) => singleTypeCheck(value, type));
|
2143
|
-
if (matchesOneType) return Outcome.makeSuccess(value);
|
2144
|
-
return Outcome.makeFailure({
|
2145
|
-
expected: types.join(" | "),
|
2146
|
-
found: getType(value) ?? "undefined"
|
2147
|
-
});
|
2148
|
-
}
|
2149
|
-
TypeChecks2.typeCheck = typeCheck;
|
2150
|
-
function typeCheckMany(values, ...types) {
|
2151
|
-
for (const [pos, val] of Object.entries(values)) {
|
2152
|
-
const checked = typeCheck(val, ...types);
|
2153
|
-
if (checked.success) continue;
|
2154
|
-
return Outcome.makeFailure({ position: parseInt(pos), ...checked.error });
|
2155
|
-
}
|
2156
|
-
return Outcome.makeSuccess(values);
|
2157
|
-
}
|
2158
|
-
TypeChecks2.typeCheckMany = typeCheckMany;
|
2159
|
-
})(TypeChecks = Transformations2.TypeChecks || (Transformations2.TypeChecks = {}));
|
2160
|
-
})(Transformations = Utils2.Transformations || (Utils2.Transformations = {}));
|
2161
|
-
let Tree2;
|
2162
|
-
((Tree3) => {
|
2163
|
-
function mergeNodes(nodes) {
|
2164
|
-
const clones = nodes.map((node) => node.cloneNode(true));
|
2165
|
-
const allChildren = [];
|
2166
|
-
clones.forEach((node) => {
|
2167
|
-
const actionAttribute = node.getAttribute(Tree.Tree.actionAttribute)?.trim().toLowerCase();
|
2168
|
-
const actionAttrIsValid = isInEnum(Types.Tree.Merge.Action, actionAttribute ?? "");
|
2169
|
-
const nodeAction = actionAttrIsValid ? actionAttribute : Types.Tree.Merge.Action.APPEND;
|
2170
|
-
const { Element: Element2, Text: Text2 } = Window.get();
|
2171
|
-
const children = Array.from(node.childNodes).filter((child) => child instanceof Text2 || child instanceof Element2).map((child) => {
|
2172
|
-
if (child instanceof Text2) return { node: child, key: void 0 };
|
2173
|
-
const childKey = child.getAttribute(Tree.Tree.keyAttribute) ?? void 0;
|
2174
|
-
return { node: child, key: childKey };
|
2175
|
-
});
|
2176
|
-
if (nodeAction === Types.Tree.Merge.Action.REPLACE) {
|
2177
|
-
allChildren.splice(0, allChildren.length);
|
2178
|
-
} else if (nodeAction === Types.Tree.Merge.Action.PREPEND) {
|
2179
|
-
allChildren.unshift(...children);
|
2180
|
-
} else {
|
2181
|
-
allChildren.push(...children);
|
2182
|
-
}
|
2183
|
-
});
|
2184
|
-
const mergedChildren = [];
|
2185
|
-
allChildren.forEach((childData) => {
|
2186
|
-
if (childData.key === void 0) mergedChildren.push(childData);
|
2187
|
-
else {
|
2188
|
-
const childKey = childData.key;
|
2189
|
-
const alreadyMerged = mergedChildren.find((dat) => dat.key === childKey);
|
2190
|
-
if (alreadyMerged) return;
|
2191
|
-
const toMerge = allChildren.filter((dat) => dat.key === childKey);
|
2192
|
-
if (toMerge.length === 0) return;
|
2193
|
-
const merged = mergeNodes(toMerge.map((dat) => dat.node));
|
2194
|
-
mergedChildren.push({ node: merged, key: childKey });
|
2195
|
-
}
|
2196
|
-
});
|
2197
|
-
const allAttributes = clones.reduce((attributes, node) => [
|
2198
|
-
...Array.from(attributes),
|
2199
|
-
...Array.from(node.attributes)
|
2200
|
-
], []);
|
2201
|
-
const outWrapper = clones[0]?.cloneNode() ?? document.createElement("div");
|
2202
|
-
allAttributes.forEach((attr) => outWrapper.setAttribute(attr.name, attr.value));
|
2203
|
-
outWrapper.append(...mergedChildren.map((e) => e.node));
|
2204
|
-
return outWrapper;
|
2205
|
-
}
|
2206
|
-
Tree3.mergeNodes = mergeNodes;
|
2207
|
-
function getInitialValueFromTypeName(name) {
|
2208
|
-
const { document: document2 } = Window.get();
|
2209
|
-
if (name === "null") return null;
|
2210
|
-
if (name === "boolean") return false;
|
2211
|
-
if (name === "number") return 0;
|
2212
|
-
if (name === "string") return "";
|
2213
|
-
if (name === "text") return document2.createTextNode("");
|
2214
|
-
if (name === "nodelist") return document2.createDocumentFragment().childNodes;
|
2215
|
-
if (name === "element") return document2.createElement("div");
|
2216
|
-
if (name === "array") return [];
|
2217
|
-
if (name === "record") return {};
|
2218
|
-
throw new Error(`Unknown value type name: ${name}`);
|
2219
|
-
}
|
2220
|
-
Tree3.getInitialValueFromTypeName = getInitialValueFromTypeName;
|
2221
|
-
let TypeChecks;
|
2222
|
-
((TypeChecks2) => {
|
2223
|
-
function getType(value) {
|
2224
|
-
if (singleTypeCheck(value, "null")) return "null";
|
2225
|
-
if (singleTypeCheck(value, "boolean")) return "boolean";
|
2226
|
-
if (singleTypeCheck(value, "number")) return "number";
|
2227
|
-
if (singleTypeCheck(value, "string")) return "string";
|
2228
|
-
if (singleTypeCheck(value, "element")) return "element";
|
2229
|
-
if (singleTypeCheck(value, "text")) return "text";
|
2230
|
-
if (singleTypeCheck(value, "nodelist")) return "nodelist";
|
2231
|
-
if (singleTypeCheck(value, "transformer")) return "transformer";
|
2232
|
-
if (singleTypeCheck(value, "method")) return "method";
|
2233
|
-
if (singleTypeCheck(value, "array")) return "array";
|
2234
|
-
if (singleTypeCheck(value, "record")) return "record";
|
2235
|
-
return void 0;
|
2236
|
-
}
|
2237
|
-
TypeChecks2.getType = getType;
|
2238
|
-
TypeChecks2.everyTypeName = [
|
2239
|
-
"null",
|
2240
|
-
"boolean",
|
2241
|
-
"number",
|
2242
|
-
"string",
|
2243
|
-
"text",
|
2244
|
-
"nodelist",
|
2245
|
-
"element",
|
2246
|
-
"transformer",
|
2247
|
-
"method",
|
2248
|
-
"array",
|
2249
|
-
"record"
|
2250
|
-
];
|
2251
|
-
function singleTypeCheck(value, type) {
|
2252
|
-
const { Element: Element2, Text: Text2, NodeList } = Window.get();
|
2253
|
-
if (type === "null" && value === null) return true;
|
2254
|
-
if (type === "boolean" && typeof value === "boolean") return true;
|
2255
|
-
if (type === "number" && typeof value === "number") return true;
|
2256
|
-
if (type === "string" && typeof value === "string") return true;
|
2257
|
-
if (type === "element" && value instanceof Element2) return true;
|
2258
|
-
if (type === "text" && value instanceof Text2) return true;
|
2259
|
-
if (type === "nodelist" && value instanceof NodeList) {
|
2260
|
-
const children = Array.from(value);
|
2261
|
-
return children.every((child) => child instanceof Element2 || child instanceof Text2);
|
2262
|
-
}
|
2263
|
-
if (type === "transformer" && value instanceof Transformer) return true;
|
2264
|
-
if (type === "method" && value instanceof Method) return true;
|
2265
|
-
if (type === "array" && Array.isArray(value)) {
|
2266
|
-
const childrenOk = value.every((child) => typeCheck(child, ...TypeChecks2.everyTypeName).success);
|
2267
|
-
return childrenOk;
|
2268
|
-
}
|
2269
|
-
if (type === "record" && isRecord(value)) {
|
2270
|
-
const childrenOk = Object.values(value).every((child) => typeCheck(child, ...TypeChecks2.everyTypeName).success);
|
2271
|
-
return childrenOk;
|
2272
|
-
}
|
2273
|
-
return false;
|
2274
|
-
}
|
2275
|
-
TypeChecks2.singleTypeCheck = singleTypeCheck;
|
2276
|
-
function typeCheck(value, ...types) {
|
2277
|
-
const matchesOneType = types.some((type) => singleTypeCheck(value, type));
|
2278
|
-
if (matchesOneType) return Outcome.makeSuccess(value);
|
2279
|
-
return Outcome.makeFailure({
|
2280
|
-
expected: types.join(" | "),
|
2281
|
-
found: getType(value) ?? "undefined"
|
2282
|
-
});
|
2283
|
-
}
|
2284
|
-
TypeChecks2.typeCheck = typeCheck;
|
2285
|
-
function typeCheckMany(values, ...types) {
|
2286
|
-
for (const [pos, val] of Object.entries(values)) {
|
2287
|
-
const checked = typeCheck(val, ...types);
|
2288
|
-
if (checked.success) continue;
|
2289
|
-
return Outcome.makeFailure({ position: parseInt(pos), ...checked.error });
|
2290
|
-
}
|
2291
|
-
return Outcome.makeSuccess(values);
|
2292
|
-
}
|
2293
|
-
TypeChecks2.typeCheckMany = typeCheckMany;
|
2294
|
-
TypeChecks2.isTreeMode = (name) => name === "isolation" || name === "coalescion";
|
2295
|
-
TypeChecks2.isValueTypeName = (name) => {
|
2296
|
-
const list = [
|
2297
|
-
"null",
|
2298
|
-
"boolean",
|
2299
|
-
"number",
|
2300
|
-
"string",
|
2301
|
-
"text",
|
2302
|
-
"nodelist",
|
2303
|
-
"element",
|
2304
|
-
"transformer",
|
2305
|
-
"method",
|
2306
|
-
"array",
|
2307
|
-
"record"
|
2308
|
-
];
|
2309
|
-
return list.includes(name);
|
2310
|
-
};
|
2311
|
-
})(TypeChecks = Tree3.TypeChecks || (Tree3.TypeChecks = {}));
|
2312
|
-
})(Tree2 = Utils2.Tree || (Utils2.Tree = {}));
|
2313
|
-
let SmartTags2;
|
2314
|
-
((SmartTags3) => {
|
2315
|
-
SmartTags3.expectEmptyArgs = (args) => {
|
2316
|
-
if (args.length === 0) return Outcome.makeSuccess([]);
|
2317
|
-
return Outcome.makeFailure({
|
2318
|
-
expected: "length: 0",
|
2319
|
-
found: `length: ${args.length}`
|
2320
|
-
});
|
2321
|
-
};
|
2322
|
-
SmartTags3.makeMainValueError = (expected, found, details) => ({ expected, found, details });
|
2323
|
-
SmartTags3.makeArgsValueError = (expected, found, position, details) => ({ expected, found, position, details });
|
2324
|
-
SmartTags3.makeTransformationError = (details) => ({ details });
|
2325
|
-
})(SmartTags2 = Utils2.SmartTags || (Utils2.SmartTags = {}));
|
2326
|
-
})(Utils || (Utils = {}));
|
2327
|
-
|
2328
|
-
// src/agnostic/html/hyper-json/smart-tags/isolated/boolean/index.ts
|
2329
|
-
var boolean = SmartTags.makeSmartTag({
|
2330
|
-
name: "boolean",
|
2331
|
-
defaultMode: "isolation",
|
2332
|
-
isolationInitType: "boolean",
|
2333
|
-
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "null", "boolean", "number", "string", "text"),
|
2334
|
-
argsValueCheck: (a) => Utils.Tree.TypeChecks.typeCheckMany(a, "null", "boolean", "number", "string", "text"),
|
2335
|
-
func: (main, args) => Outcome.makeSuccess([main, ...args].every((item) => Cast.toBoolean(item)))
|
2336
|
-
});
|
2337
|
-
|
2338
|
-
export {
|
2339
|
-
boolean,
|
2340
|
-
element,
|
2341
|
-
get,
|
2342
|
-
global,
|
2343
|
-
guess,
|
2344
|
-
nodelist,
|
2345
|
-
number,
|
2346
|
-
record,
|
2347
|
-
func,
|
2348
|
-
ref,
|
2349
|
-
string,
|
2350
|
-
text,
|
2351
|
-
add,
|
2352
|
-
addclass,
|
2353
|
-
and,
|
2354
|
-
append,
|
2355
|
-
at,
|
2356
|
-
call,
|
2357
|
-
clone,
|
2358
|
-
deleteproperties,
|
2359
|
-
equals,
|
2360
|
-
getattribute,
|
2361
|
-
getproperties,
|
2362
|
-
getproperty,
|
2363
|
-
deepGetProperty,
|
2364
|
-
ifFunc,
|
2365
|
-
initialize,
|
2366
|
-
join,
|
2367
|
-
length,
|
2368
|
-
map,
|
2369
|
-
negate,
|
2370
|
-
notrailing,
|
2371
|
-
or,
|
2372
|
-
pickrandom,
|
2373
|
-
print,
|
2374
|
-
populate,
|
2375
|
-
push,
|
2376
|
-
pusheach,
|
2377
|
-
recordtoarray,
|
2378
|
-
removeattribute,
|
2379
|
-
removeclass,
|
2380
|
-
renameproperty,
|
2381
|
-
replace,
|
2382
|
-
select,
|
2383
|
-
set,
|
2384
|
-
setattribute,
|
2385
|
-
setproperties,
|
2386
|
-
setproperty,
|
2387
|
-
sorton,
|
2388
|
-
split,
|
2389
|
-
toarray,
|
2390
|
-
toboolean,
|
2391
|
-
toelement,
|
2392
|
-
toggleclass,
|
2393
|
-
tonodelist,
|
2394
|
-
tonull,
|
2395
|
-
tonumber,
|
2396
|
-
torecord,
|
2397
|
-
toref,
|
2398
|
-
tostring,
|
2399
|
-
totext,
|
2400
|
-
transformselected,
|
2401
|
-
trim,
|
2402
|
-
Tree,
|
2403
|
-
Utils,
|
2404
|
-
Cast
|
2405
|
-
};
|