@midscene/shared 0.13.1 → 0.13.2-beta-20250401015137.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -575,472 +575,6 @@ var midscene_element_inspector = (() => {
575
575
  }
576
576
  });
577
577
 
578
- // ../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js
579
- var require_ms = __commonJS({
580
- "../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js"(exports, module) {
581
- "use strict";
582
- var s = 1e3;
583
- var m = s * 60;
584
- var h = m * 60;
585
- var d = h * 24;
586
- var w = d * 7;
587
- var y = d * 365.25;
588
- module.exports = function(val, options) {
589
- options = options || {};
590
- var type = typeof val;
591
- if (type === "string" && val.length > 0) {
592
- return parse(val);
593
- } else if (type === "number" && isFinite(val)) {
594
- return options.long ? fmtLong(val) : fmtShort(val);
595
- }
596
- throw new Error(
597
- "val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
598
- );
599
- };
600
- function parse(str) {
601
- str = String(str);
602
- if (str.length > 100) {
603
- return;
604
- }
605
- var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
606
- str
607
- );
608
- if (!match) {
609
- return;
610
- }
611
- var n = parseFloat(match[1]);
612
- var type = (match[2] || "ms").toLowerCase();
613
- switch (type) {
614
- case "years":
615
- case "year":
616
- case "yrs":
617
- case "yr":
618
- case "y":
619
- return n * y;
620
- case "weeks":
621
- case "week":
622
- case "w":
623
- return n * w;
624
- case "days":
625
- case "day":
626
- case "d":
627
- return n * d;
628
- case "hours":
629
- case "hour":
630
- case "hrs":
631
- case "hr":
632
- case "h":
633
- return n * h;
634
- case "minutes":
635
- case "minute":
636
- case "mins":
637
- case "min":
638
- case "m":
639
- return n * m;
640
- case "seconds":
641
- case "second":
642
- case "secs":
643
- case "sec":
644
- case "s":
645
- return n * s;
646
- case "milliseconds":
647
- case "millisecond":
648
- case "msecs":
649
- case "msec":
650
- case "ms":
651
- return n;
652
- default:
653
- return void 0;
654
- }
655
- }
656
- function fmtShort(ms) {
657
- var msAbs = Math.abs(ms);
658
- if (msAbs >= d) {
659
- return Math.round(ms / d) + "d";
660
- }
661
- if (msAbs >= h) {
662
- return Math.round(ms / h) + "h";
663
- }
664
- if (msAbs >= m) {
665
- return Math.round(ms / m) + "m";
666
- }
667
- if (msAbs >= s) {
668
- return Math.round(ms / s) + "s";
669
- }
670
- return ms + "ms";
671
- }
672
- function fmtLong(ms) {
673
- var msAbs = Math.abs(ms);
674
- if (msAbs >= d) {
675
- return plural(ms, msAbs, d, "day");
676
- }
677
- if (msAbs >= h) {
678
- return plural(ms, msAbs, h, "hour");
679
- }
680
- if (msAbs >= m) {
681
- return plural(ms, msAbs, m, "minute");
682
- }
683
- if (msAbs >= s) {
684
- return plural(ms, msAbs, s, "second");
685
- }
686
- return ms + " ms";
687
- }
688
- function plural(ms, msAbs, n, name) {
689
- var isPlural = msAbs >= n * 1.5;
690
- return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
691
- }
692
- }
693
- });
694
-
695
- // ../../node_modules/.pnpm/debug@4.4.0_supports-color@5.5.0/node_modules/debug/src/common.js
696
- var require_common = __commonJS({
697
- "../../node_modules/.pnpm/debug@4.4.0_supports-color@5.5.0/node_modules/debug/src/common.js"(exports, module) {
698
- "use strict";
699
- function setup(env) {
700
- createDebug.debug = createDebug;
701
- createDebug.default = createDebug;
702
- createDebug.coerce = coerce;
703
- createDebug.disable = disable;
704
- createDebug.enable = enable;
705
- createDebug.enabled = enabled;
706
- createDebug.humanize = require_ms();
707
- createDebug.destroy = destroy;
708
- Object.keys(env).forEach((key) => {
709
- createDebug[key] = env[key];
710
- });
711
- createDebug.names = [];
712
- createDebug.skips = [];
713
- createDebug.formatters = {};
714
- function selectColor(namespace) {
715
- let hash = 0;
716
- for (let i = 0; i < namespace.length; i++) {
717
- hash = (hash << 5) - hash + namespace.charCodeAt(i);
718
- hash |= 0;
719
- }
720
- return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
721
- }
722
- createDebug.selectColor = selectColor;
723
- function createDebug(namespace) {
724
- let prevTime;
725
- let enableOverride = null;
726
- let namespacesCache;
727
- let enabledCache;
728
- function debug2(...args) {
729
- if (!debug2.enabled) {
730
- return;
731
- }
732
- const self2 = debug2;
733
- const curr = Number(/* @__PURE__ */ new Date());
734
- const ms = curr - (prevTime || curr);
735
- self2.diff = ms;
736
- self2.prev = prevTime;
737
- self2.curr = curr;
738
- prevTime = curr;
739
- args[0] = createDebug.coerce(args[0]);
740
- if (typeof args[0] !== "string") {
741
- args.unshift("%O");
742
- }
743
- let index = 0;
744
- args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
745
- if (match === "%%") {
746
- return "%";
747
- }
748
- index++;
749
- const formatter = createDebug.formatters[format];
750
- if (typeof formatter === "function") {
751
- const val = args[index];
752
- match = formatter.call(self2, val);
753
- args.splice(index, 1);
754
- index--;
755
- }
756
- return match;
757
- });
758
- createDebug.formatArgs.call(self2, args);
759
- const logFn = self2.log || createDebug.log;
760
- logFn.apply(self2, args);
761
- }
762
- debug2.namespace = namespace;
763
- debug2.useColors = createDebug.useColors();
764
- debug2.color = createDebug.selectColor(namespace);
765
- debug2.extend = extend;
766
- debug2.destroy = createDebug.destroy;
767
- Object.defineProperty(debug2, "enabled", {
768
- enumerable: true,
769
- configurable: false,
770
- get: () => {
771
- if (enableOverride !== null) {
772
- return enableOverride;
773
- }
774
- if (namespacesCache !== createDebug.namespaces) {
775
- namespacesCache = createDebug.namespaces;
776
- enabledCache = createDebug.enabled(namespace);
777
- }
778
- return enabledCache;
779
- },
780
- set: (v) => {
781
- enableOverride = v;
782
- }
783
- });
784
- if (typeof createDebug.init === "function") {
785
- createDebug.init(debug2);
786
- }
787
- return debug2;
788
- }
789
- function extend(namespace, delimiter) {
790
- const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
791
- newDebug.log = this.log;
792
- return newDebug;
793
- }
794
- function enable(namespaces) {
795
- createDebug.save(namespaces);
796
- createDebug.namespaces = namespaces;
797
- createDebug.names = [];
798
- createDebug.skips = [];
799
- const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(" ", ",").split(",").filter(Boolean);
800
- for (const ns of split) {
801
- if (ns[0] === "-") {
802
- createDebug.skips.push(ns.slice(1));
803
- } else {
804
- createDebug.names.push(ns);
805
- }
806
- }
807
- }
808
- function matchesTemplate(search, template) {
809
- let searchIndex = 0;
810
- let templateIndex = 0;
811
- let starIndex = -1;
812
- let matchIndex = 0;
813
- while (searchIndex < search.length) {
814
- if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
815
- if (template[templateIndex] === "*") {
816
- starIndex = templateIndex;
817
- matchIndex = searchIndex;
818
- templateIndex++;
819
- } else {
820
- searchIndex++;
821
- templateIndex++;
822
- }
823
- } else if (starIndex !== -1) {
824
- templateIndex = starIndex + 1;
825
- matchIndex++;
826
- searchIndex = matchIndex;
827
- } else {
828
- return false;
829
- }
830
- }
831
- while (templateIndex < template.length && template[templateIndex] === "*") {
832
- templateIndex++;
833
- }
834
- return templateIndex === template.length;
835
- }
836
- function disable() {
837
- const namespaces = [
838
- ...createDebug.names,
839
- ...createDebug.skips.map((namespace) => "-" + namespace)
840
- ].join(",");
841
- createDebug.enable("");
842
- return namespaces;
843
- }
844
- function enabled(name) {
845
- for (const skip of createDebug.skips) {
846
- if (matchesTemplate(name, skip)) {
847
- return false;
848
- }
849
- }
850
- for (const ns of createDebug.names) {
851
- if (matchesTemplate(name, ns)) {
852
- return true;
853
- }
854
- }
855
- return false;
856
- }
857
- function coerce(val) {
858
- if (val instanceof Error) {
859
- return val.stack || val.message;
860
- }
861
- return val;
862
- }
863
- function destroy() {
864
- console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
865
- }
866
- createDebug.enable(createDebug.load());
867
- return createDebug;
868
- }
869
- module.exports = setup;
870
- }
871
- });
872
-
873
- // ../../node_modules/.pnpm/debug@4.4.0_supports-color@5.5.0/node_modules/debug/src/browser.js
874
- var require_browser = __commonJS({
875
- "../../node_modules/.pnpm/debug@4.4.0_supports-color@5.5.0/node_modules/debug/src/browser.js"(exports, module) {
876
- "use strict";
877
- exports.formatArgs = formatArgs;
878
- exports.save = save;
879
- exports.load = load;
880
- exports.useColors = useColors;
881
- exports.storage = localstorage();
882
- exports.destroy = (() => {
883
- let warned = false;
884
- return () => {
885
- if (!warned) {
886
- warned = true;
887
- console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
888
- }
889
- };
890
- })();
891
- exports.colors = [
892
- "#0000CC",
893
- "#0000FF",
894
- "#0033CC",
895
- "#0033FF",
896
- "#0066CC",
897
- "#0066FF",
898
- "#0099CC",
899
- "#0099FF",
900
- "#00CC00",
901
- "#00CC33",
902
- "#00CC66",
903
- "#00CC99",
904
- "#00CCCC",
905
- "#00CCFF",
906
- "#3300CC",
907
- "#3300FF",
908
- "#3333CC",
909
- "#3333FF",
910
- "#3366CC",
911
- "#3366FF",
912
- "#3399CC",
913
- "#3399FF",
914
- "#33CC00",
915
- "#33CC33",
916
- "#33CC66",
917
- "#33CC99",
918
- "#33CCCC",
919
- "#33CCFF",
920
- "#6600CC",
921
- "#6600FF",
922
- "#6633CC",
923
- "#6633FF",
924
- "#66CC00",
925
- "#66CC33",
926
- "#9900CC",
927
- "#9900FF",
928
- "#9933CC",
929
- "#9933FF",
930
- "#99CC00",
931
- "#99CC33",
932
- "#CC0000",
933
- "#CC0033",
934
- "#CC0066",
935
- "#CC0099",
936
- "#CC00CC",
937
- "#CC00FF",
938
- "#CC3300",
939
- "#CC3333",
940
- "#CC3366",
941
- "#CC3399",
942
- "#CC33CC",
943
- "#CC33FF",
944
- "#CC6600",
945
- "#CC6633",
946
- "#CC9900",
947
- "#CC9933",
948
- "#CCCC00",
949
- "#CCCC33",
950
- "#FF0000",
951
- "#FF0033",
952
- "#FF0066",
953
- "#FF0099",
954
- "#FF00CC",
955
- "#FF00FF",
956
- "#FF3300",
957
- "#FF3333",
958
- "#FF3366",
959
- "#FF3399",
960
- "#FF33CC",
961
- "#FF33FF",
962
- "#FF6600",
963
- "#FF6633",
964
- "#FF9900",
965
- "#FF9933",
966
- "#FFCC00",
967
- "#FFCC33"
968
- ];
969
- function useColors() {
970
- if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
971
- return true;
972
- }
973
- if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
974
- return false;
975
- }
976
- let m;
977
- return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
978
- typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
979
- // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
980
- typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
981
- typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
982
- }
983
- function formatArgs(args) {
984
- args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff);
985
- if (!this.useColors) {
986
- return;
987
- }
988
- const c = "color: " + this.color;
989
- args.splice(1, 0, c, "color: inherit");
990
- let index = 0;
991
- let lastC = 0;
992
- args[0].replace(/%[a-zA-Z%]/g, (match) => {
993
- if (match === "%%") {
994
- return;
995
- }
996
- index++;
997
- if (match === "%c") {
998
- lastC = index;
999
- }
1000
- });
1001
- args.splice(lastC, 0, c);
1002
- }
1003
- exports.log = console.debug || console.log || (() => {
1004
- });
1005
- function save(namespaces) {
1006
- try {
1007
- if (namespaces) {
1008
- exports.storage.setItem("debug", namespaces);
1009
- } else {
1010
- exports.storage.removeItem("debug");
1011
- }
1012
- } catch (error) {
1013
- }
1014
- }
1015
- function load() {
1016
- let r;
1017
- try {
1018
- r = exports.storage.getItem("debug");
1019
- } catch (error) {
1020
- }
1021
- if (!r && typeof process !== "undefined" && "env" in process) {
1022
- r = process.env.DEBUG;
1023
- }
1024
- return r;
1025
- }
1026
- function localstorage() {
1027
- try {
1028
- return localStorage;
1029
- } catch (error) {
1030
- }
1031
- }
1032
- module.exports = require_common()(exports);
1033
- var { formatters } = module.exports;
1034
- formatters.j = function(v) {
1035
- try {
1036
- return JSON.stringify(v);
1037
- } catch (error) {
1038
- return "[UnexpectedJSONParseError]: " + error.message;
1039
- }
1040
- };
1041
- }
1042
- });
1043
-
1044
578
  // src/extractor/index.ts
1045
579
  var extractor_exports = {};
1046
580
  __export(extractor_exports, {
@@ -1249,7 +783,6 @@ ${indentStr}${after}`;
1249
783
 
1250
784
  // src/utils.ts
1251
785
  var import_js_sha256 = __toESM(require_sha256());
1252
- var import_debug = __toESM(require_browser());
1253
786
  var hashMap = {};
1254
787
  function generateHashId(rect, content = "") {
1255
788
  const combined = JSON.stringify({