Plugin Directory

Changeset 3783821


Ignore:
Timestamp:
11/04/2026 11:41:14 AM (3 weeks ago)
Author:
A5hleyRich
Message:

Update to version 1.3.0 from GitHub

Location:
debughawk
Files:
2 added
2 deleted
44 edited
1 copied

Legend:

Unmodified
Added
Removed
  • debughawk/tags/1.3.0/composer.json

    r3318985 r3783821  
    1515      "DebugHawk\\": "src/"
    1616    }
     17  },
     18  "require-dev": {
     19    "phpunit/phpunit": "^9.6"
     20  },
     21  "autoload-dev": {
     22    "psr-4": {
     23      "DebugHawk\\Tests\\": "tests/"
     24    }
     25  },
     26  "scripts": {
     27    "test": "phpunit"
    1728  }
    1829}
  • debughawk/tags/1.3.0/composer.lock

    r3433055 r3783821  
    55        "This file is @generated automatically"
    66    ],
    7     "content-hash": "d67bb9a850b07076247c035eb166d44b",
     7    "content-hash": "99e243e48dfa2f20c2daa51d807bd3a6",
    88    "packages": [],
    9     "packages-dev": [],
     9    "packages-dev": [
     10        {
     11            "name": "doctrine/instantiator",
     12            "version": "2.0.0",
     13            "source": {
     14                "type": "git",
     15                "url": "https://github.com/doctrine/instantiator.git",
     16                "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0"
     17            },
     18            "dist": {
     19                "type": "zip",
     20                "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0",
     21                "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0",
     22                "shasum": ""
     23            },
     24            "require": {
     25                "php": "^8.1"
     26            },
     27            "require-dev": {
     28                "doctrine/coding-standard": "^11",
     29                "ext-pdo": "*",
     30                "ext-phar": "*",
     31                "phpbench/phpbench": "^1.2",
     32                "phpstan/phpstan": "^1.9.4",
     33                "phpstan/phpstan-phpunit": "^1.3",
     34                "phpunit/phpunit": "^9.5.27",
     35                "vimeo/psalm": "^5.4"
     36            },
     37            "type": "library",
     38            "autoload": {
     39                "psr-4": {
     40                    "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
     41                }
     42            },
     43            "notification-url": "https://packagist.org/downloads/",
     44            "license": [
     45                "MIT"
     46            ],
     47            "authors": [
     48                {
     49                    "name": "Marco Pivetta",
     50                    "email": "ocramius@gmail.com",
     51                    "homepage": "https://ocramius.github.io/"
     52                }
     53            ],
     54            "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
     55            "homepage": "https://www.doctrine-project.org/projects/instantiator.html",
     56            "keywords": [
     57                "constructor",
     58                "instantiate"
     59            ],
     60            "support": {
     61                "issues": "https://github.com/doctrine/instantiator/issues",
     62                "source": "https://github.com/doctrine/instantiator/tree/2.0.0"
     63            },
     64            "funding": [
     65                {
     66                    "url": "https://www.doctrine-project.org/sponsorship.html",
     67                    "type": "custom"
     68                },
     69                {
     70                    "url": "https://www.patreon.com/phpdoctrine",
     71                    "type": "patreon"
     72                },
     73                {
     74                    "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator",
     75                    "type": "tidelift"
     76                }
     77            ],
     78            "time": "2022-12-30T00:23:10+00:00"
     79        },
     80        {
     81            "name": "myclabs/deep-copy",
     82            "version": "1.14.0",
     83            "source": {
     84                "type": "git",
     85                "url": "https://github.com/myclabs/DeepCopy.git",
     86                "reference": "8680aa248f8e07bc8fb43f56f0f5fc77a0c96aae"
     87            },
     88            "dist": {
     89                "type": "zip",
     90                "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/8680aa248f8e07bc8fb43f56f0f5fc77a0c96aae",
     91                "reference": "8680aa248f8e07bc8fb43f56f0f5fc77a0c96aae",
     92                "shasum": ""
     93            },
     94            "require": {
     95                "php": "^8.0"
     96            },
     97            "conflict": {
     98                "doctrine/collections": "<1.6.8",
     99                "doctrine/common": "<2.13.3 || >=3 <3.2.2"
     100            },
     101            "require-dev": {
     102                "doctrine/collections": "^1.6.8",
     103                "doctrine/common": "^2.13.3 || ^3.2.2",
     104                "phpspec/prophecy": "^1.10",
     105                "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13"
     106            },
     107            "type": "library",
     108            "autoload": {
     109                "files": [
     110                    "src/DeepCopy/deep_copy.php"
     111                ],
     112                "psr-4": {
     113                    "DeepCopy\\": "src/DeepCopy/"
     114                }
     115            },
     116            "notification-url": "https://packagist.org/downloads/",
     117            "license": [
     118                "MIT"
     119            ],
     120            "description": "Create deep copies (clones) of your objects",
     121            "keywords": [
     122                "clone",
     123                "copy",
     124                "duplicate",
     125                "object",
     126                "object graph"
     127            ],
     128            "support": {
     129                "issues": "https://github.com/myclabs/DeepCopy/issues",
     130                "source": "https://github.com/myclabs/DeepCopy/tree/1.14.0"
     131            },
     132            "funding": [
     133                {
     134                    "url": "https://github.com/mnapoli",
     135                    "type": "github"
     136                }
     137            ],
     138            "time": "2026-08-11T10:17:44+00:00"
     139        },
     140        {
     141            "name": "nikic/php-parser",
     142            "version": "v5.9.0",
     143            "source": {
     144                "type": "git",
     145                "url": "https://github.com/nikic/PHP-Parser.git",
     146                "reference": "9e33da9553fe7786f0962b35f4e4ecf01be89def"
     147            },
     148            "dist": {
     149                "type": "zip",
     150                "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/9e33da9553fe7786f0962b35f4e4ecf01be89def",
     151                "reference": "9e33da9553fe7786f0962b35f4e4ecf01be89def",
     152                "shasum": ""
     153            },
     154            "require": {
     155                "ext-json": "*",
     156                "ext-tokenizer": "*",
     157                "php": ">=7.4"
     158            },
     159            "require-dev": {
     160                "ircmaxell/php-yacc": "^0.0.7",
     161                "phpunit/phpunit": "^9.0"
     162            },
     163            "bin": [
     164                "bin/php-parse"
     165            ],
     166            "type": "library",
     167            "extra": {
     168                "branch-alias": {
     169                    "dev-master": "5.x-dev"
     170                }
     171            },
     172            "autoload": {
     173                "psr-4": {
     174                    "PhpParser\\": "lib/PhpParser"
     175                }
     176            },
     177            "notification-url": "https://packagist.org/downloads/",
     178            "license": [
     179                "BSD-3-Clause"
     180            ],
     181            "authors": [
     182                {
     183                    "name": "Nikita Popov"
     184                }
     185            ],
     186            "description": "A PHP parser written in PHP",
     187            "keywords": [
     188                "parser",
     189                "php"
     190            ],
     191            "support": {
     192                "issues": "https://github.com/nikic/PHP-Parser/issues",
     193                "source": "https://github.com/nikic/PHP-Parser/tree/v5.9.0"
     194            },
     195            "time": "2026-09-13T18:51:52+00:00"
     196        },
     197        {
     198            "name": "phar-io/manifest",
     199            "version": "2.0.4",
     200            "source": {
     201                "type": "git",
     202                "url": "https://github.com/phar-io/manifest.git",
     203                "reference": "54750ef60c58e43759730615a392c31c80e23176"
     204            },
     205            "dist": {
     206                "type": "zip",
     207                "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176",
     208                "reference": "54750ef60c58e43759730615a392c31c80e23176",
     209                "shasum": ""
     210            },
     211            "require": {
     212                "ext-dom": "*",
     213                "ext-libxml": "*",
     214                "ext-phar": "*",
     215                "ext-xmlwriter": "*",
     216                "phar-io/version": "^3.0.1",
     217                "php": "^7.2 || ^8.0"
     218            },
     219            "type": "library",
     220            "extra": {
     221                "branch-alias": {
     222                    "dev-master": "2.0.x-dev"
     223                }
     224            },
     225            "autoload": {
     226                "classmap": [
     227                    "src/"
     228                ]
     229            },
     230            "notification-url": "https://packagist.org/downloads/",
     231            "license": [
     232                "BSD-3-Clause"
     233            ],
     234            "authors": [
     235                {
     236                    "name": "Arne Blankerts",
     237                    "email": "arne@blankerts.de",
     238                    "role": "Developer"
     239                },
     240                {
     241                    "name": "Sebastian Heuer",
     242                    "email": "sebastian@phpeople.de",
     243                    "role": "Developer"
     244                },
     245                {
     246                    "name": "Sebastian Bergmann",
     247                    "email": "sebastian@phpunit.de",
     248                    "role": "Developer"
     249                }
     250            ],
     251            "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)",
     252            "support": {
     253                "issues": "https://github.com/phar-io/manifest/issues",
     254                "source": "https://github.com/phar-io/manifest/tree/2.0.4"
     255            },
     256            "funding": [
     257                {
     258                    "url": "https://github.com/theseer",
     259                    "type": "github"
     260                }
     261            ],
     262            "time": "2024-03-03T12:33:53+00:00"
     263        },
     264        {
     265            "name": "phar-io/version",
     266            "version": "3.2.1",
     267            "source": {
     268                "type": "git",
     269                "url": "https://github.com/phar-io/version.git",
     270                "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74"
     271            },
     272            "dist": {
     273                "type": "zip",
     274                "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74",
     275                "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74",
     276                "shasum": ""
     277            },
     278            "require": {
     279                "php": "^7.2 || ^8.0"
     280            },
     281            "type": "library",
     282            "autoload": {
     283                "classmap": [
     284                    "src/"
     285                ]
     286            },
     287            "notification-url": "https://packagist.org/downloads/",
     288            "license": [
     289                "BSD-3-Clause"
     290            ],
     291            "authors": [
     292                {
     293                    "name": "Arne Blankerts",
     294                    "email": "arne@blankerts.de",
     295                    "role": "Developer"
     296                },
     297                {
     298                    "name": "Sebastian Heuer",
     299                    "email": "sebastian@phpeople.de",
     300                    "role": "Developer"
     301                },
     302                {
     303                    "name": "Sebastian Bergmann",
     304                    "email": "sebastian@phpunit.de",
     305                    "role": "Developer"
     306                }
     307            ],
     308            "description": "Library for handling version information and constraints",
     309            "support": {
     310                "issues": "https://github.com/phar-io/version/issues",
     311                "source": "https://github.com/phar-io/version/tree/3.2.1"
     312            },
     313            "time": "2022-02-21T01:04:05+00:00"
     314        },
     315        {
     316            "name": "phpunit/php-code-coverage",
     317            "version": "9.2.32",
     318            "source": {
     319                "type": "git",
     320                "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
     321                "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5"
     322            },
     323            "dist": {
     324                "type": "zip",
     325                "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/85402a822d1ecf1db1096959413d35e1c37cf1a5",
     326                "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5",
     327                "shasum": ""
     328            },
     329            "require": {
     330                "ext-dom": "*",
     331                "ext-libxml": "*",
     332                "ext-xmlwriter": "*",
     333                "nikic/php-parser": "^4.19.1 || ^5.1.0",
     334                "php": ">=7.3",
     335                "phpunit/php-file-iterator": "^3.0.6",
     336                "phpunit/php-text-template": "^2.0.4",
     337                "sebastian/code-unit-reverse-lookup": "^2.0.3",
     338                "sebastian/complexity": "^2.0.3",
     339                "sebastian/environment": "^5.1.5",
     340                "sebastian/lines-of-code": "^1.0.4",
     341                "sebastian/version": "^3.0.2",
     342                "theseer/tokenizer": "^1.2.3"
     343            },
     344            "require-dev": {
     345                "phpunit/phpunit": "^9.6"
     346            },
     347            "suggest": {
     348                "ext-pcov": "PHP extension that provides line coverage",
     349                "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage"
     350            },
     351            "type": "library",
     352            "extra": {
     353                "branch-alias": {
     354                    "dev-main": "9.2.x-dev"
     355                }
     356            },
     357            "autoload": {
     358                "classmap": [
     359                    "src/"
     360                ]
     361            },
     362            "notification-url": "https://packagist.org/downloads/",
     363            "license": [
     364                "BSD-3-Clause"
     365            ],
     366            "authors": [
     367                {
     368                    "name": "Sebastian Bergmann",
     369                    "email": "sebastian@phpunit.de",
     370                    "role": "lead"
     371                }
     372            ],
     373            "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
     374            "homepage": "https://github.com/sebastianbergmann/php-code-coverage",
     375            "keywords": [
     376                "coverage",
     377                "testing",
     378                "xunit"
     379            ],
     380            "support": {
     381                "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
     382                "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy",
     383                "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.32"
     384            },
     385            "funding": [
     386                {
     387                    "url": "https://github.com/sebastianbergmann",
     388                    "type": "github"
     389                }
     390            ],
     391            "time": "2024-08-22T04:23:01+00:00"
     392        },
     393        {
     394            "name": "phpunit/php-file-iterator",
     395            "version": "3.0.6",
     396            "source": {
     397                "type": "git",
     398                "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
     399                "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf"
     400            },
     401            "dist": {
     402                "type": "zip",
     403                "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf",
     404                "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf",
     405                "shasum": ""
     406            },
     407            "require": {
     408                "php": ">=7.3"
     409            },
     410            "require-dev": {
     411                "phpunit/phpunit": "^9.3"
     412            },
     413            "type": "library",
     414            "extra": {
     415                "branch-alias": {
     416                    "dev-master": "3.0-dev"
     417                }
     418            },
     419            "autoload": {
     420                "classmap": [
     421                    "src/"
     422                ]
     423            },
     424            "notification-url": "https://packagist.org/downloads/",
     425            "license": [
     426                "BSD-3-Clause"
     427            ],
     428            "authors": [
     429                {
     430                    "name": "Sebastian Bergmann",
     431                    "email": "sebastian@phpunit.de",
     432                    "role": "lead"
     433                }
     434            ],
     435            "description": "FilterIterator implementation that filters files based on a list of suffixes.",
     436            "homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
     437            "keywords": [
     438                "filesystem",
     439                "iterator"
     440            ],
     441            "support": {
     442                "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues",
     443                "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6"
     444            },
     445            "funding": [
     446                {
     447                    "url": "https://github.com/sebastianbergmann",
     448                    "type": "github"
     449                }
     450            ],
     451            "time": "2021-12-02T12:48:52+00:00"
     452        },
     453        {
     454            "name": "phpunit/php-invoker",
     455            "version": "3.1.1",
     456            "source": {
     457                "type": "git",
     458                "url": "https://github.com/sebastianbergmann/php-invoker.git",
     459                "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67"
     460            },
     461            "dist": {
     462                "type": "zip",
     463                "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67",
     464                "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67",
     465                "shasum": ""
     466            },
     467            "require": {
     468                "php": ">=7.3"
     469            },
     470            "require-dev": {
     471                "ext-pcntl": "*",
     472                "phpunit/phpunit": "^9.3"
     473            },
     474            "suggest": {
     475                "ext-pcntl": "*"
     476            },
     477            "type": "library",
     478            "extra": {
     479                "branch-alias": {
     480                    "dev-master": "3.1-dev"
     481                }
     482            },
     483            "autoload": {
     484                "classmap": [
     485                    "src/"
     486                ]
     487            },
     488            "notification-url": "https://packagist.org/downloads/",
     489            "license": [
     490                "BSD-3-Clause"
     491            ],
     492            "authors": [
     493                {
     494                    "name": "Sebastian Bergmann",
     495                    "email": "sebastian@phpunit.de",
     496                    "role": "lead"
     497                }
     498            ],
     499            "description": "Invoke callables with a timeout",
     500            "homepage": "https://github.com/sebastianbergmann/php-invoker/",
     501            "keywords": [
     502                "process"
     503            ],
     504            "support": {
     505                "issues": "https://github.com/sebastianbergmann/php-invoker/issues",
     506                "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1"
     507            },
     508            "funding": [
     509                {
     510                    "url": "https://github.com/sebastianbergmann",
     511                    "type": "github"
     512                }
     513            ],
     514            "time": "2020-09-28T05:58:55+00:00"
     515        },
     516        {
     517            "name": "phpunit/php-text-template",
     518            "version": "2.0.4",
     519            "source": {
     520                "type": "git",
     521                "url": "https://github.com/sebastianbergmann/php-text-template.git",
     522                "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28"
     523            },
     524            "dist": {
     525                "type": "zip",
     526                "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28",
     527                "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28",
     528                "shasum": ""
     529            },
     530            "require": {
     531                "php": ">=7.3"
     532            },
     533            "require-dev": {
     534                "phpunit/phpunit": "^9.3"
     535            },
     536            "type": "library",
     537            "extra": {
     538                "branch-alias": {
     539                    "dev-master": "2.0-dev"
     540                }
     541            },
     542            "autoload": {
     543                "classmap": [
     544                    "src/"
     545                ]
     546            },
     547            "notification-url": "https://packagist.org/downloads/",
     548            "license": [
     549                "BSD-3-Clause"
     550            ],
     551            "authors": [
     552                {
     553                    "name": "Sebastian Bergmann",
     554                    "email": "sebastian@phpunit.de",
     555                    "role": "lead"
     556                }
     557            ],
     558            "description": "Simple template engine.",
     559            "homepage": "https://github.com/sebastianbergmann/php-text-template/",
     560            "keywords": [
     561                "template"
     562            ],
     563            "support": {
     564                "issues": "https://github.com/sebastianbergmann/php-text-template/issues",
     565                "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4"
     566            },
     567            "funding": [
     568                {
     569                    "url": "https://github.com/sebastianbergmann",
     570                    "type": "github"
     571                }
     572            ],
     573            "time": "2020-10-26T05:33:50+00:00"
     574        },
     575        {
     576            "name": "phpunit/php-timer",
     577            "version": "5.0.3",
     578            "source": {
     579                "type": "git",
     580                "url": "https://github.com/sebastianbergmann/php-timer.git",
     581                "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2"
     582            },
     583            "dist": {
     584                "type": "zip",
     585                "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2",
     586                "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2",
     587                "shasum": ""
     588            },
     589            "require": {
     590                "php": ">=7.3"
     591            },
     592            "require-dev": {
     593                "phpunit/phpunit": "^9.3"
     594            },
     595            "type": "library",
     596            "extra": {
     597                "branch-alias": {
     598                    "dev-master": "5.0-dev"
     599                }
     600            },
     601            "autoload": {
     602                "classmap": [
     603                    "src/"
     604                ]
     605            },
     606            "notification-url": "https://packagist.org/downloads/",
     607            "license": [
     608                "BSD-3-Clause"
     609            ],
     610            "authors": [
     611                {
     612                    "name": "Sebastian Bergmann",
     613                    "email": "sebastian@phpunit.de",
     614                    "role": "lead"
     615                }
     616            ],
     617            "description": "Utility class for timing",
     618            "homepage": "https://github.com/sebastianbergmann/php-timer/",
     619            "keywords": [
     620                "timer"
     621            ],
     622            "support": {
     623                "issues": "https://github.com/sebastianbergmann/php-timer/issues",
     624                "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3"
     625            },
     626            "funding": [
     627                {
     628                    "url": "https://github.com/sebastianbergmann",
     629                    "type": "github"
     630                }
     631            ],
     632            "time": "2020-10-26T13:16:10+00:00"
     633        },
     634        {
     635            "name": "phpunit/phpunit",
     636            "version": "9.6.38",
     637            "source": {
     638                "type": "git",
     639                "url": "https://github.com/sebastianbergmann/phpunit.git",
     640                "reference": "8b5f757e8e92071bfdbfa93943f94f84c4e31007"
     641            },
     642            "dist": {
     643                "type": "zip",
     644                "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/8b5f757e8e92071bfdbfa93943f94f84c4e31007",
     645                "reference": "8b5f757e8e92071bfdbfa93943f94f84c4e31007",
     646                "shasum": ""
     647            },
     648            "require": {
     649                "doctrine/instantiator": "^1.5.0 || ^2",
     650                "ext-dom": "*",
     651                "ext-filter": "*",
     652                "ext-json": "*",
     653                "ext-libxml": "*",
     654                "ext-mbstring": "*",
     655                "ext-xmlwriter": "*",
     656                "myclabs/deep-copy": "^1.13.4",
     657                "phar-io/manifest": "^2.0.4",
     658                "phar-io/version": "^3.2.1",
     659                "php": ">=7.3",
     660                "phpunit/php-code-coverage": "^9.2.32",
     661                "phpunit/php-file-iterator": "^3.0.6",
     662                "phpunit/php-invoker": "^3.1.1",
     663                "phpunit/php-text-template": "^2.0.4",
     664                "phpunit/php-timer": "^5.0.3",
     665                "sebastian/cli-parser": "^1.0.2",
     666                "sebastian/code-unit": "^1.0.8",
     667                "sebastian/comparator": "^4.0.10",
     668                "sebastian/diff": "^4.0.6",
     669                "sebastian/environment": "^5.1.5",
     670                "sebastian/exporter": "^4.0.9",
     671                "sebastian/global-state": "^5.0.8",
     672                "sebastian/object-enumerator": "^4.0.4",
     673                "sebastian/resource-operations": "^3.0.4",
     674                "sebastian/type": "^3.2.1",
     675                "sebastian/version": "^3.0.2"
     676            },
     677            "suggest": {
     678                "ext-soap": "To be able to generate mocks based on WSDL files",
     679                "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage"
     680            },
     681            "bin": [
     682                "phpunit"
     683            ],
     684            "type": "library",
     685            "extra": {
     686                "branch-alias": {
     687                    "dev-master": "9.6-dev"
     688                }
     689            },
     690            "autoload": {
     691                "files": [
     692                    "src/Framework/Assert/Functions.php"
     693                ],
     694                "classmap": [
     695                    "src/"
     696                ]
     697            },
     698            "notification-url": "https://packagist.org/downloads/",
     699            "license": [
     700                "BSD-3-Clause"
     701            ],
     702            "authors": [
     703                {
     704                    "name": "Sebastian Bergmann",
     705                    "email": "sebastian@phpunit.de",
     706                    "role": "lead"
     707                }
     708            ],
     709            "description": "The PHP Unit Testing framework.",
     710            "homepage": "https://phpunit.de/",
     711            "keywords": [
     712                "phpunit",
     713                "testing",
     714                "xunit"
     715            ],
     716            "support": {
     717                "issues": "https://github.com/sebastianbergmann/phpunit/issues",
     718                "security": "https://github.com/sebastianbergmann/phpunit/security/policy",
     719                "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.38"
     720            },
     721            "funding": [
     722                {
     723                    "url": "https://phpunit.de/sponsoring.html",
     724                    "type": "other"
     725                }
     726            ],
     727            "time": "2026-10-05T05:44:26+00:00"
     728        },
     729        {
     730            "name": "sebastian/cli-parser",
     731            "version": "1.0.2",
     732            "source": {
     733                "type": "git",
     734                "url": "https://github.com/sebastianbergmann/cli-parser.git",
     735                "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b"
     736            },
     737            "dist": {
     738                "type": "zip",
     739                "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2b56bea83a09de3ac06bb18b92f068e60cc6f50b",
     740                "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b",
     741                "shasum": ""
     742            },
     743            "require": {
     744                "php": ">=7.3"
     745            },
     746            "require-dev": {
     747                "phpunit/phpunit": "^9.3"
     748            },
     749            "type": "library",
     750            "extra": {
     751                "branch-alias": {
     752                    "dev-master": "1.0-dev"
     753                }
     754            },
     755            "autoload": {
     756                "classmap": [
     757                    "src/"
     758                ]
     759            },
     760            "notification-url": "https://packagist.org/downloads/",
     761            "license": [
     762                "BSD-3-Clause"
     763            ],
     764            "authors": [
     765                {
     766                    "name": "Sebastian Bergmann",
     767                    "email": "sebastian@phpunit.de",
     768                    "role": "lead"
     769                }
     770            ],
     771            "description": "Library for parsing CLI options",
     772            "homepage": "https://github.com/sebastianbergmann/cli-parser",
     773            "support": {
     774                "issues": "https://github.com/sebastianbergmann/cli-parser/issues",
     775                "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.2"
     776            },
     777            "funding": [
     778                {
     779                    "url": "https://github.com/sebastianbergmann",
     780                    "type": "github"
     781                }
     782            ],
     783            "time": "2024-03-02T06:27:43+00:00"
     784        },
     785        {
     786            "name": "sebastian/code-unit",
     787            "version": "1.0.8",
     788            "source": {
     789                "type": "git",
     790                "url": "https://github.com/sebastianbergmann/code-unit.git",
     791                "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120"
     792            },
     793            "dist": {
     794                "type": "zip",
     795                "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120",
     796                "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120",
     797                "shasum": ""
     798            },
     799            "require": {
     800                "php": ">=7.3"
     801            },
     802            "require-dev": {
     803                "phpunit/phpunit": "^9.3"
     804            },
     805            "type": "library",
     806            "extra": {
     807                "branch-alias": {
     808                    "dev-master": "1.0-dev"
     809                }
     810            },
     811            "autoload": {
     812                "classmap": [
     813                    "src/"
     814                ]
     815            },
     816            "notification-url": "https://packagist.org/downloads/",
     817            "license": [
     818                "BSD-3-Clause"
     819            ],
     820            "authors": [
     821                {
     822                    "name": "Sebastian Bergmann",
     823                    "email": "sebastian@phpunit.de",
     824                    "role": "lead"
     825                }
     826            ],
     827            "description": "Collection of value objects that represent the PHP code units",
     828            "homepage": "https://github.com/sebastianbergmann/code-unit",
     829            "support": {
     830                "issues": "https://github.com/sebastianbergmann/code-unit/issues",
     831                "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8"
     832            },
     833            "funding": [
     834                {
     835                    "url": "https://github.com/sebastianbergmann",
     836                    "type": "github"
     837                }
     838            ],
     839            "time": "2020-10-26T13:08:54+00:00"
     840        },
     841        {
     842            "name": "sebastian/code-unit-reverse-lookup",
     843            "version": "2.0.3",
     844            "source": {
     845                "type": "git",
     846                "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git",
     847                "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5"
     848            },
     849            "dist": {
     850                "type": "zip",
     851                "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5",
     852                "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5",
     853                "shasum": ""
     854            },
     855            "require": {
     856                "php": ">=7.3"
     857            },
     858            "require-dev": {
     859                "phpunit/phpunit": "^9.3"
     860            },
     861            "type": "library",
     862            "extra": {
     863                "branch-alias": {
     864                    "dev-master": "2.0-dev"
     865                }
     866            },
     867            "autoload": {
     868                "classmap": [
     869                    "src/"
     870                ]
     871            },
     872            "notification-url": "https://packagist.org/downloads/",
     873            "license": [
     874                "BSD-3-Clause"
     875            ],
     876            "authors": [
     877                {
     878                    "name": "Sebastian Bergmann",
     879                    "email": "sebastian@phpunit.de"
     880                }
     881            ],
     882            "description": "Looks up which function or method a line of code belongs to",
     883            "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/",
     884            "support": {
     885                "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues",
     886                "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3"
     887            },
     888            "funding": [
     889                {
     890                    "url": "https://github.com/sebastianbergmann",
     891                    "type": "github"
     892                }
     893            ],
     894            "time": "2020-09-28T05:30:19+00:00"
     895        },
     896        {
     897            "name": "sebastian/comparator",
     898            "version": "4.0.10",
     899            "source": {
     900                "type": "git",
     901                "url": "https://github.com/sebastianbergmann/comparator.git",
     902                "reference": "e4df00b9b3571187db2831ae9aada2c6efbd715d"
     903            },
     904            "dist": {
     905                "type": "zip",
     906                "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/e4df00b9b3571187db2831ae9aada2c6efbd715d",
     907                "reference": "e4df00b9b3571187db2831ae9aada2c6efbd715d",
     908                "shasum": ""
     909            },
     910            "require": {
     911                "php": ">=7.3",
     912                "sebastian/diff": "^4.0",
     913                "sebastian/exporter": "^4.0"
     914            },
     915            "require-dev": {
     916                "phpunit/phpunit": "^9.3"
     917            },
     918            "type": "library",
     919            "extra": {
     920                "branch-alias": {
     921                    "dev-master": "4.0-dev"
     922                }
     923            },
     924            "autoload": {
     925                "classmap": [
     926                    "src/"
     927                ]
     928            },
     929            "notification-url": "https://packagist.org/downloads/",
     930            "license": [
     931                "BSD-3-Clause"
     932            ],
     933            "authors": [
     934                {
     935                    "name": "Sebastian Bergmann",
     936                    "email": "sebastian@phpunit.de"
     937                },
     938                {
     939                    "name": "Jeff Welch",
     940                    "email": "whatthejeff@gmail.com"
     941                },
     942                {
     943                    "name": "Volker Dusch",
     944                    "email": "github@wallbash.com"
     945                },
     946                {
     947                    "name": "Bernhard Schussek",
     948                    "email": "bschussek@2bepublished.at"
     949                }
     950            ],
     951            "description": "Provides the functionality to compare PHP values for equality",
     952            "homepage": "https://github.com/sebastianbergmann/comparator",
     953            "keywords": [
     954                "comparator",
     955                "compare",
     956                "equality"
     957            ],
     958            "support": {
     959                "issues": "https://github.com/sebastianbergmann/comparator/issues",
     960                "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.10"
     961            },
     962            "funding": [
     963                {
     964                    "url": "https://github.com/sebastianbergmann",
     965                    "type": "github"
     966                },
     967                {
     968                    "url": "https://liberapay.com/sebastianbergmann",
     969                    "type": "liberapay"
     970                },
     971                {
     972                    "url": "https://thanks.dev/u/gh/sebastianbergmann",
     973                    "type": "thanks_dev"
     974                },
     975                {
     976                    "url": "https://tidelift.com/funding/github/packagist/sebastian/comparator",
     977                    "type": "tidelift"
     978                }
     979            ],
     980            "time": "2026-01-24T09:22:56+00:00"
     981        },
     982        {
     983            "name": "sebastian/complexity",
     984            "version": "2.0.3",
     985            "source": {
     986                "type": "git",
     987                "url": "https://github.com/sebastianbergmann/complexity.git",
     988                "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a"
     989            },
     990            "dist": {
     991                "type": "zip",
     992                "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/25f207c40d62b8b7aa32f5ab026c53561964053a",
     993                "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a",
     994                "shasum": ""
     995            },
     996            "require": {
     997                "nikic/php-parser": "^4.18 || ^5.0",
     998                "php": ">=7.3"
     999            },
     1000            "require-dev": {
     1001                "phpunit/phpunit": "^9.3"
     1002            },
     1003            "type": "library",
     1004            "extra": {
     1005                "branch-alias": {
     1006                    "dev-master": "2.0-dev"
     1007                }
     1008            },
     1009            "autoload": {
     1010                "classmap": [
     1011                    "src/"
     1012                ]
     1013            },
     1014            "notification-url": "https://packagist.org/downloads/",
     1015            "license": [
     1016                "BSD-3-Clause"
     1017            ],
     1018            "authors": [
     1019                {
     1020                    "name": "Sebastian Bergmann",
     1021                    "email": "sebastian@phpunit.de",
     1022                    "role": "lead"
     1023                }
     1024            ],
     1025            "description": "Library for calculating the complexity of PHP code units",
     1026            "homepage": "https://github.com/sebastianbergmann/complexity",
     1027            "support": {
     1028                "issues": "https://github.com/sebastianbergmann/complexity/issues",
     1029                "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.3"
     1030            },
     1031            "funding": [
     1032                {
     1033                    "url": "https://github.com/sebastianbergmann",
     1034                    "type": "github"
     1035                }
     1036            ],
     1037            "time": "2023-12-22T06:19:30+00:00"
     1038        },
     1039        {
     1040            "name": "sebastian/diff",
     1041            "version": "4.0.6",
     1042            "source": {
     1043                "type": "git",
     1044                "url": "https://github.com/sebastianbergmann/diff.git",
     1045                "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc"
     1046            },
     1047            "dist": {
     1048                "type": "zip",
     1049                "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc",
     1050                "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc",
     1051                "shasum": ""
     1052            },
     1053            "require": {
     1054                "php": ">=7.3"
     1055            },
     1056            "require-dev": {
     1057                "phpunit/phpunit": "^9.3",
     1058                "symfony/process": "^4.2 || ^5"
     1059            },
     1060            "type": "library",
     1061            "extra": {
     1062                "branch-alias": {
     1063                    "dev-master": "4.0-dev"
     1064                }
     1065            },
     1066            "autoload": {
     1067                "classmap": [
     1068                    "src/"
     1069                ]
     1070            },
     1071            "notification-url": "https://packagist.org/downloads/",
     1072            "license": [
     1073                "BSD-3-Clause"
     1074            ],
     1075            "authors": [
     1076                {
     1077                    "name": "Sebastian Bergmann",
     1078                    "email": "sebastian@phpunit.de"
     1079                },
     1080                {
     1081                    "name": "Kore Nordmann",
     1082                    "email": "mail@kore-nordmann.de"
     1083                }
     1084            ],
     1085            "description": "Diff implementation",
     1086            "homepage": "https://github.com/sebastianbergmann/diff",
     1087            "keywords": [
     1088                "diff",
     1089                "udiff",
     1090                "unidiff",
     1091                "unified diff"
     1092            ],
     1093            "support": {
     1094                "issues": "https://github.com/sebastianbergmann/diff/issues",
     1095                "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6"
     1096            },
     1097            "funding": [
     1098                {
     1099                    "url": "https://github.com/sebastianbergmann",
     1100                    "type": "github"
     1101                }
     1102            ],
     1103            "time": "2024-03-02T06:30:58+00:00"
     1104        },
     1105        {
     1106            "name": "sebastian/environment",
     1107            "version": "5.1.5",
     1108            "source": {
     1109                "type": "git",
     1110                "url": "https://github.com/sebastianbergmann/environment.git",
     1111                "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed"
     1112            },
     1113            "dist": {
     1114                "type": "zip",
     1115                "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed",
     1116                "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed",
     1117                "shasum": ""
     1118            },
     1119            "require": {
     1120                "php": ">=7.3"
     1121            },
     1122            "require-dev": {
     1123                "phpunit/phpunit": "^9.3"
     1124            },
     1125            "suggest": {
     1126                "ext-posix": "*"
     1127            },
     1128            "type": "library",
     1129            "extra": {
     1130                "branch-alias": {
     1131                    "dev-master": "5.1-dev"
     1132                }
     1133            },
     1134            "autoload": {
     1135                "classmap": [
     1136                    "src/"
     1137                ]
     1138            },
     1139            "notification-url": "https://packagist.org/downloads/",
     1140            "license": [
     1141                "BSD-3-Clause"
     1142            ],
     1143            "authors": [
     1144                {
     1145                    "name": "Sebastian Bergmann",
     1146                    "email": "sebastian@phpunit.de"
     1147                }
     1148            ],
     1149            "description": "Provides functionality to handle HHVM/PHP environments",
     1150            "homepage": "http://www.github.com/sebastianbergmann/environment",
     1151            "keywords": [
     1152                "Xdebug",
     1153                "environment",
     1154                "hhvm"
     1155            ],
     1156            "support": {
     1157                "issues": "https://github.com/sebastianbergmann/environment/issues",
     1158                "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5"
     1159            },
     1160            "funding": [
     1161                {
     1162                    "url": "https://github.com/sebastianbergmann",
     1163                    "type": "github"
     1164                }
     1165            ],
     1166            "time": "2023-02-03T06:03:51+00:00"
     1167        },
     1168        {
     1169            "name": "sebastian/exporter",
     1170            "version": "4.0.9",
     1171            "source": {
     1172                "type": "git",
     1173                "url": "https://github.com/sebastianbergmann/exporter.git",
     1174                "reference": "4352c1a3df741a7ba9e61af6fed51d1fee41cbf7"
     1175            },
     1176            "dist": {
     1177                "type": "zip",
     1178                "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/4352c1a3df741a7ba9e61af6fed51d1fee41cbf7",
     1179                "reference": "4352c1a3df741a7ba9e61af6fed51d1fee41cbf7",
     1180                "shasum": ""
     1181            },
     1182            "require": {
     1183                "php": ">=7.3",
     1184                "sebastian/recursion-context": "^4.0"
     1185            },
     1186            "require-dev": {
     1187                "ext-mbstring": "*",
     1188                "phpunit/phpunit": "^9.3"
     1189            },
     1190            "type": "library",
     1191            "extra": {
     1192                "branch-alias": {
     1193                    "dev-master": "4.0-dev"
     1194                }
     1195            },
     1196            "autoload": {
     1197                "classmap": [
     1198                    "src/"
     1199                ]
     1200            },
     1201            "notification-url": "https://packagist.org/downloads/",
     1202            "license": [
     1203                "BSD-3-Clause"
     1204            ],
     1205            "authors": [
     1206                {
     1207                    "name": "Sebastian Bergmann",
     1208                    "email": "sebastian@phpunit.de"
     1209                },
     1210                {
     1211                    "name": "Jeff Welch",
     1212                    "email": "whatthejeff@gmail.com"
     1213                },
     1214                {
     1215                    "name": "Volker Dusch",
     1216                    "email": "github@wallbash.com"
     1217                },
     1218                {
     1219                    "name": "Adam Harvey",
     1220                    "email": "aharvey@php.net"
     1221                },
     1222                {
     1223                    "name": "Bernhard Schussek",
     1224                    "email": "bschussek@gmail.com"
     1225                }
     1226            ],
     1227            "description": "Provides the functionality to export PHP variables for visualization",
     1228            "homepage": "https://www.github.com/sebastianbergmann/exporter",
     1229            "keywords": [
     1230                "export",
     1231                "exporter"
     1232            ],
     1233            "support": {
     1234                "issues": "https://github.com/sebastianbergmann/exporter/issues",
     1235                "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.9"
     1236            },
     1237            "funding": [
     1238                {
     1239                    "url": "https://github.com/sebastianbergmann",
     1240                    "type": "github"
     1241                },
     1242                {
     1243                    "url": "https://liberapay.com/sebastianbergmann",
     1244                    "type": "liberapay"
     1245                },
     1246                {
     1247                    "url": "https://thanks.dev/u/gh/sebastianbergmann",
     1248                    "type": "thanks_dev"
     1249                },
     1250                {
     1251                    "url": "https://tidelift.com/funding/github/packagist/sebastian/exporter",
     1252                    "type": "tidelift"
     1253                }
     1254            ],
     1255            "time": "2026-08-11T04:55:59+00:00"
     1256        },
     1257        {
     1258            "name": "sebastian/global-state",
     1259            "version": "5.0.8",
     1260            "source": {
     1261                "type": "git",
     1262                "url": "https://github.com/sebastianbergmann/global-state.git",
     1263                "reference": "b6781316bdcd28260904e7cc18ec983d0d2ef4f6"
     1264            },
     1265            "dist": {
     1266                "type": "zip",
     1267                "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/b6781316bdcd28260904e7cc18ec983d0d2ef4f6",
     1268                "reference": "b6781316bdcd28260904e7cc18ec983d0d2ef4f6",
     1269                "shasum": ""
     1270            },
     1271            "require": {
     1272                "php": ">=7.3",
     1273                "sebastian/object-reflector": "^2.0",
     1274                "sebastian/recursion-context": "^4.0"
     1275            },
     1276            "require-dev": {
     1277                "ext-dom": "*",
     1278                "phpunit/phpunit": "^9.3"
     1279            },
     1280            "suggest": {
     1281                "ext-uopz": "*"
     1282            },
     1283            "type": "library",
     1284            "extra": {
     1285                "branch-alias": {
     1286                    "dev-master": "5.0-dev"
     1287                }
     1288            },
     1289            "autoload": {
     1290                "classmap": [
     1291                    "src/"
     1292                ]
     1293            },
     1294            "notification-url": "https://packagist.org/downloads/",
     1295            "license": [
     1296                "BSD-3-Clause"
     1297            ],
     1298            "authors": [
     1299                {
     1300                    "name": "Sebastian Bergmann",
     1301                    "email": "sebastian@phpunit.de"
     1302                }
     1303            ],
     1304            "description": "Snapshotting of global state",
     1305            "homepage": "http://www.github.com/sebastianbergmann/global-state",
     1306            "keywords": [
     1307                "global state"
     1308            ],
     1309            "support": {
     1310                "issues": "https://github.com/sebastianbergmann/global-state/issues",
     1311                "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.8"
     1312            },
     1313            "funding": [
     1314                {
     1315                    "url": "https://github.com/sebastianbergmann",
     1316                    "type": "github"
     1317                },
     1318                {
     1319                    "url": "https://liberapay.com/sebastianbergmann",
     1320                    "type": "liberapay"
     1321                },
     1322                {
     1323                    "url": "https://thanks.dev/u/gh/sebastianbergmann",
     1324                    "type": "thanks_dev"
     1325                },
     1326                {
     1327                    "url": "https://tidelift.com/funding/github/packagist/sebastian/global-state",
     1328                    "type": "tidelift"
     1329                }
     1330            ],
     1331            "time": "2025-08-10T07:10:35+00:00"
     1332        },
     1333        {
     1334            "name": "sebastian/lines-of-code",
     1335            "version": "1.0.4",
     1336            "source": {
     1337                "type": "git",
     1338                "url": "https://github.com/sebastianbergmann/lines-of-code.git",
     1339                "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5"
     1340            },
     1341            "dist": {
     1342                "type": "zip",
     1343                "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e1e4a170560925c26d424b6a03aed157e7dcc5c5",
     1344                "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5",
     1345                "shasum": ""
     1346            },
     1347            "require": {
     1348                "nikic/php-parser": "^4.18 || ^5.0",
     1349                "php": ">=7.3"
     1350            },
     1351            "require-dev": {
     1352                "phpunit/phpunit": "^9.3"
     1353            },
     1354            "type": "library",
     1355            "extra": {
     1356                "branch-alias": {
     1357                    "dev-master": "1.0-dev"
     1358                }
     1359            },
     1360            "autoload": {
     1361                "classmap": [
     1362                    "src/"
     1363                ]
     1364            },
     1365            "notification-url": "https://packagist.org/downloads/",
     1366            "license": [
     1367                "BSD-3-Clause"
     1368            ],
     1369            "authors": [
     1370                {
     1371                    "name": "Sebastian Bergmann",
     1372                    "email": "sebastian@phpunit.de",
     1373                    "role": "lead"
     1374                }
     1375            ],
     1376            "description": "Library for counting the lines of code in PHP source code",
     1377            "homepage": "https://github.com/sebastianbergmann/lines-of-code",
     1378            "support": {
     1379                "issues": "https://github.com/sebastianbergmann/lines-of-code/issues",
     1380                "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.4"
     1381            },
     1382            "funding": [
     1383                {
     1384                    "url": "https://github.com/sebastianbergmann",
     1385                    "type": "github"
     1386                }
     1387            ],
     1388            "time": "2023-12-22T06:20:34+00:00"
     1389        },
     1390        {
     1391            "name": "sebastian/object-enumerator",
     1392            "version": "4.0.4",
     1393            "source": {
     1394                "type": "git",
     1395                "url": "https://github.com/sebastianbergmann/object-enumerator.git",
     1396                "reference": "5c9eeac41b290a3712d88851518825ad78f45c71"
     1397            },
     1398            "dist": {
     1399                "type": "zip",
     1400                "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71",
     1401                "reference": "5c9eeac41b290a3712d88851518825ad78f45c71",
     1402                "shasum": ""
     1403            },
     1404            "require": {
     1405                "php": ">=7.3",
     1406                "sebastian/object-reflector": "^2.0",
     1407                "sebastian/recursion-context": "^4.0"
     1408            },
     1409            "require-dev": {
     1410                "phpunit/phpunit": "^9.3"
     1411            },
     1412            "type": "library",
     1413            "extra": {
     1414                "branch-alias": {
     1415                    "dev-master": "4.0-dev"
     1416                }
     1417            },
     1418            "autoload": {
     1419                "classmap": [
     1420                    "src/"
     1421                ]
     1422            },
     1423            "notification-url": "https://packagist.org/downloads/",
     1424            "license": [
     1425                "BSD-3-Clause"
     1426            ],
     1427            "authors": [
     1428                {
     1429                    "name": "Sebastian Bergmann",
     1430                    "email": "sebastian@phpunit.de"
     1431                }
     1432            ],
     1433            "description": "Traverses array structures and object graphs to enumerate all referenced objects",
     1434            "homepage": "https://github.com/sebastianbergmann/object-enumerator/",
     1435            "support": {
     1436                "issues": "https://github.com/sebastianbergmann/object-enumerator/issues",
     1437                "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4"
     1438            },
     1439            "funding": [
     1440                {
     1441                    "url": "https://github.com/sebastianbergmann",
     1442                    "type": "github"
     1443                }
     1444            ],
     1445            "time": "2020-10-26T13:12:34+00:00"
     1446        },
     1447        {
     1448            "name": "sebastian/object-reflector",
     1449            "version": "2.0.4",
     1450            "source": {
     1451                "type": "git",
     1452                "url": "https://github.com/sebastianbergmann/object-reflector.git",
     1453                "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7"
     1454            },
     1455            "dist": {
     1456                "type": "zip",
     1457                "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7",
     1458                "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7",
     1459                "shasum": ""
     1460            },
     1461            "require": {
     1462                "php": ">=7.3"
     1463            },
     1464            "require-dev": {
     1465                "phpunit/phpunit": "^9.3"
     1466            },
     1467            "type": "library",
     1468            "extra": {
     1469                "branch-alias": {
     1470                    "dev-master": "2.0-dev"
     1471                }
     1472            },
     1473            "autoload": {
     1474                "classmap": [
     1475                    "src/"
     1476                ]
     1477            },
     1478            "notification-url": "https://packagist.org/downloads/",
     1479            "license": [
     1480                "BSD-3-Clause"
     1481            ],
     1482            "authors": [
     1483                {
     1484                    "name": "Sebastian Bergmann",
     1485                    "email": "sebastian@phpunit.de"
     1486                }
     1487            ],
     1488            "description": "Allows reflection of object attributes, including inherited and non-public ones",
     1489            "homepage": "https://github.com/sebastianbergmann/object-reflector/",
     1490            "support": {
     1491                "issues": "https://github.com/sebastianbergmann/object-reflector/issues",
     1492                "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4"
     1493            },
     1494            "funding": [
     1495                {
     1496                    "url": "https://github.com/sebastianbergmann",
     1497                    "type": "github"
     1498                }
     1499            ],
     1500            "time": "2020-10-26T13:14:26+00:00"
     1501        },
     1502        {
     1503            "name": "sebastian/recursion-context",
     1504            "version": "4.0.7",
     1505            "source": {
     1506                "type": "git",
     1507                "url": "https://github.com/sebastianbergmann/recursion-context.git",
     1508                "reference": "c85be6922b7fd365942b986b9a50397d65407611"
     1509            },
     1510            "dist": {
     1511                "type": "zip",
     1512                "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/c85be6922b7fd365942b986b9a50397d65407611",
     1513                "reference": "c85be6922b7fd365942b986b9a50397d65407611",
     1514                "shasum": ""
     1515            },
     1516            "require": {
     1517                "php": ">=7.3"
     1518            },
     1519            "require-dev": {
     1520                "phpunit/phpunit": "^9.3"
     1521            },
     1522            "type": "library",
     1523            "extra": {
     1524                "branch-alias": {
     1525                    "dev-master": "4.0-dev"
     1526                }
     1527            },
     1528            "autoload": {
     1529                "classmap": [
     1530                    "src/"
     1531                ]
     1532            },
     1533            "notification-url": "https://packagist.org/downloads/",
     1534            "license": [
     1535                "BSD-3-Clause"
     1536            ],
     1537            "authors": [
     1538                {
     1539                    "name": "Sebastian Bergmann",
     1540                    "email": "sebastian@phpunit.de"
     1541                },
     1542                {
     1543                    "name": "Jeff Welch",
     1544                    "email": "whatthejeff@gmail.com"
     1545                },
     1546                {
     1547                    "name": "Adam Harvey",
     1548                    "email": "aharvey@php.net"
     1549                }
     1550            ],
     1551            "description": "Provides functionality to recursively process PHP variables",
     1552            "homepage": "https://github.com/sebastianbergmann/recursion-context",
     1553            "support": {
     1554                "issues": "https://github.com/sebastianbergmann/recursion-context/issues",
     1555                "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.7"
     1556            },
     1557            "funding": [
     1558                {
     1559                    "url": "https://github.com/sebastianbergmann",
     1560                    "type": "github"
     1561                },
     1562                {
     1563                    "url": "https://liberapay.com/sebastianbergmann",
     1564                    "type": "liberapay"
     1565                },
     1566                {
     1567                    "url": "https://thanks.dev/u/gh/sebastianbergmann",
     1568                    "type": "thanks_dev"
     1569                },
     1570                {
     1571                    "url": "https://tidelift.com/funding/github/packagist/sebastian/recursion-context",
     1572                    "type": "tidelift"
     1573                }
     1574            ],
     1575            "time": "2026-08-11T05:25:24+00:00"
     1576        },
     1577        {
     1578            "name": "sebastian/resource-operations",
     1579            "version": "3.0.4",
     1580            "source": {
     1581                "type": "git",
     1582                "url": "https://github.com/sebastianbergmann/resource-operations.git",
     1583                "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e"
     1584            },
     1585            "dist": {
     1586                "type": "zip",
     1587                "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e",
     1588                "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e",
     1589                "shasum": ""
     1590            },
     1591            "require": {
     1592                "php": ">=7.3"
     1593            },
     1594            "require-dev": {
     1595                "phpunit/phpunit": "^9.0"
     1596            },
     1597            "type": "library",
     1598            "extra": {
     1599                "branch-alias": {
     1600                    "dev-main": "3.0-dev"
     1601                }
     1602            },
     1603            "autoload": {
     1604                "classmap": [
     1605                    "src/"
     1606                ]
     1607            },
     1608            "notification-url": "https://packagist.org/downloads/",
     1609            "license": [
     1610                "BSD-3-Clause"
     1611            ],
     1612            "authors": [
     1613                {
     1614                    "name": "Sebastian Bergmann",
     1615                    "email": "sebastian@phpunit.de"
     1616                }
     1617            ],
     1618            "description": "Provides a list of PHP built-in functions that operate on resources",
     1619            "homepage": "https://www.github.com/sebastianbergmann/resource-operations",
     1620            "support": {
     1621                "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.4"
     1622            },
     1623            "funding": [
     1624                {
     1625                    "url": "https://github.com/sebastianbergmann",
     1626                    "type": "github"
     1627                }
     1628            ],
     1629            "time": "2024-03-14T16:00:52+00:00"
     1630        },
     1631        {
     1632            "name": "sebastian/type",
     1633            "version": "3.2.1",
     1634            "source": {
     1635                "type": "git",
     1636                "url": "https://github.com/sebastianbergmann/type.git",
     1637                "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7"
     1638            },
     1639            "dist": {
     1640                "type": "zip",
     1641                "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7",
     1642                "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7",
     1643                "shasum": ""
     1644            },
     1645            "require": {
     1646                "php": ">=7.3"
     1647            },
     1648            "require-dev": {
     1649                "phpunit/phpunit": "^9.5"
     1650            },
     1651            "type": "library",
     1652            "extra": {
     1653                "branch-alias": {
     1654                    "dev-master": "3.2-dev"
     1655                }
     1656            },
     1657            "autoload": {
     1658                "classmap": [
     1659                    "src/"
     1660                ]
     1661            },
     1662            "notification-url": "https://packagist.org/downloads/",
     1663            "license": [
     1664                "BSD-3-Clause"
     1665            ],
     1666            "authors": [
     1667                {
     1668                    "name": "Sebastian Bergmann",
     1669                    "email": "sebastian@phpunit.de",
     1670                    "role": "lead"
     1671                }
     1672            ],
     1673            "description": "Collection of value objects that represent the types of the PHP type system",
     1674            "homepage": "https://github.com/sebastianbergmann/type",
     1675            "support": {
     1676                "issues": "https://github.com/sebastianbergmann/type/issues",
     1677                "source": "https://github.com/sebastianbergmann/type/tree/3.2.1"
     1678            },
     1679            "funding": [
     1680                {
     1681                    "url": "https://github.com/sebastianbergmann",
     1682                    "type": "github"
     1683                }
     1684            ],
     1685            "time": "2023-02-03T06:13:03+00:00"
     1686        },
     1687        {
     1688            "name": "sebastian/version",
     1689            "version": "3.0.2",
     1690            "source": {
     1691                "type": "git",
     1692                "url": "https://github.com/sebastianbergmann/version.git",
     1693                "reference": "c6c1022351a901512170118436c764e473f6de8c"
     1694            },
     1695            "dist": {
     1696                "type": "zip",
     1697                "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c",
     1698                "reference": "c6c1022351a901512170118436c764e473f6de8c",
     1699                "shasum": ""
     1700            },
     1701            "require": {
     1702                "php": ">=7.3"
     1703            },
     1704            "type": "library",
     1705            "extra": {
     1706                "branch-alias": {
     1707                    "dev-master": "3.0-dev"
     1708                }
     1709            },
     1710            "autoload": {
     1711                "classmap": [
     1712                    "src/"
     1713                ]
     1714            },
     1715            "notification-url": "https://packagist.org/downloads/",
     1716            "license": [
     1717                "BSD-3-Clause"
     1718            ],
     1719            "authors": [
     1720                {
     1721                    "name": "Sebastian Bergmann",
     1722                    "email": "sebastian@phpunit.de",
     1723                    "role": "lead"
     1724                }
     1725            ],
     1726            "description": "Library that helps with managing the version number of Git-hosted PHP projects",
     1727            "homepage": "https://github.com/sebastianbergmann/version",
     1728            "support": {
     1729                "issues": "https://github.com/sebastianbergmann/version/issues",
     1730                "source": "https://github.com/sebastianbergmann/version/tree/3.0.2"
     1731            },
     1732            "funding": [
     1733                {
     1734                    "url": "https://github.com/sebastianbergmann",
     1735                    "type": "github"
     1736                }
     1737            ],
     1738            "time": "2020-09-28T06:39:44+00:00"
     1739        },
     1740        {
     1741            "name": "theseer/tokenizer",
     1742            "version": "1.3.1",
     1743            "source": {
     1744                "type": "git",
     1745                "url": "https://github.com/theseer/tokenizer.git",
     1746                "reference": "b7489ce515e168639d17feec34b8847c326b0b3c"
     1747            },
     1748            "dist": {
     1749                "type": "zip",
     1750                "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b7489ce515e168639d17feec34b8847c326b0b3c",
     1751                "reference": "b7489ce515e168639d17feec34b8847c326b0b3c",
     1752                "shasum": ""
     1753            },
     1754            "require": {
     1755                "ext-dom": "*",
     1756                "ext-tokenizer": "*",
     1757                "ext-xmlwriter": "*",
     1758                "php": "^7.2 || ^8.0"
     1759            },
     1760            "type": "library",
     1761            "autoload": {
     1762                "classmap": [
     1763                    "src/"
     1764                ]
     1765            },
     1766            "notification-url": "https://packagist.org/downloads/",
     1767            "license": [
     1768                "BSD-3-Clause"
     1769            ],
     1770            "authors": [
     1771                {
     1772                    "name": "Arne Blankerts",
     1773                    "email": "arne@blankerts.de",
     1774                    "role": "Developer"
     1775                }
     1776            ],
     1777            "description": "A small library for converting tokenized PHP source code into XML and potentially other formats",
     1778            "support": {
     1779                "issues": "https://github.com/theseer/tokenizer/issues",
     1780                "source": "https://github.com/theseer/tokenizer/tree/1.3.1"
     1781            },
     1782            "funding": [
     1783                {
     1784                    "url": "https://github.com/theseer",
     1785                    "type": "github"
     1786                }
     1787            ],
     1788            "time": "2025-11-17T20:03:58+00:00"
     1789        }
     1790    ],
    101791    "aliases": [],
    111792    "minimum-stability": "stable",
  • debughawk/tags/1.3.0/debughawk.php

    r3433055 r3783821  
    66 * Author: DebugHawk
    77 * Author URI: https://debughawk.com/
    8  * Version: 1.2.0
     8 * Version: 1.3.0
    99 * Requires PHP: 7.4
    1010 * Requires WP: 6.3
    … …  
    2525
    2626$config  = defined( 'DEBUGHAWK_CONFIG' ) ? DEBUGHAWK_CONFIG : [];
    27 $version = '1.2.0';
     27$version = '1.3.0';
    2828
    2929( new Plugin(
  • debughawk/tags/1.3.0/readme.txt

    r3433055 r3783821  
    11=== DebugHawk - WordPress Performance Monitoring & Debugging ===
    22Contributors: A5hleyRich
    3 Tags: performance, monitoring, debug, slow, speed, database, queries, core web vitals, optimization, profiling, cache, site health
    4 Tested up to: 6.9
    5 Stable tag: 1.2.0
     3Tags: performance, monitoring, debug, core web vitals, profiling
     4Tested up to: 7.1
     5Stable tag: 1.3.0
    66Requires at least: 6.3
    77Requires PHP: 7.4
    … …  
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
    1010
    11 Monitor WordPress performance, debug slow sites, track Core Web Vitals, database queries, memory usage, and cache effectiveness. Performance monitoring built specifically for WordPress.
     11Performance monitoring built specifically for WordPress. Track Core Web Vitals, slow database queries, external API calls and cache effectiveness.
    1212
    1313== Description ==
    … …  
    3636* **Object Cache Performance** - Hit ratio, cache effectiveness
    3737* **Page Cache Effectiveness** - Cache hits vs misses
    38 * **Redirect Detection** - Unnecessary redirects slowing page loads
    3938
    4039= Debug Slow WordPress Sites =
    … …  
    148147
    149148== Changelog ==
     149
     150= 1.3.0 =
     151* Slow queries and external requests are now attributed to the plugin or theme that made them, including code run from hooks, symlinked plugins and themes, and custom layouts such as Bedrock
     152* Slow query values, such as emails, IDs and search terms, are replaced with placeholders before they leave your site
     153* Query values and credentials are removed from page and external request URLs before they're sent
     154* Up to 10 slow queries are now reported per page, up from 3, and long queries are kept up to 2,048 characters
     155* Failed and timed-out external requests now show how long they held up the page, along with their error message
     156* Lower memory use and overhead on pages that run thousands of database queries
     157* More accurate database time on pages that run nested queries
     158* Response caching plugins now work as expected for external requests while DebugHawk is active
     159* Admin screens shown in a popup, such as plugin details, no longer count as separate page views
     160* Customizer previews and the Site Editor are now excluded correctly, including on subdirectory installs
     161* An error collecting one metric no longer stops the rest of the page from loading
     162* Pages with unusual characters in a URL or query are now reported instead of being skipped
     163* Pages with many external requests now report the slowest 20, so the data stays within the browser's size limit
     164* Removed redirect monitoring and the "Monitor Redirects" setting
    150165
    151166= 1.2.0 =
    … …  
    183198== Upgrade Notice ==
    184199
     200= 1.3.0 =
     201More accurate plugin and theme attribution for slow queries and external requests, and query values are no longer sent. Redirect monitoring has been removed.
     202
    185203= 1.1.1 =
    186204Important update: Ensures db.php drop-in is properly managed during plugin deactivation.
  • debughawk/tags/1.3.0/resources/dist/beacon.js

    r3372612 r3783821  
    1 (function(){"use strict";var O,z=-1,v=function(r){addEventListener("pageshow",function(e){e.persisted&&(z=e.timeStamp,r(e))},!0)},P=function(){var r=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(r&&r.responseStart>0&&r.responseStart<performance.now())return r},S=function(){var r=P();return r&&r.activationStart||0},p=function(r,e){var t=P(),i="navigate";return z>=0?i="back-forward-cache":t&&(document.prerendering||S()>0?i="prerender":document.wasDiscarded?i="restore":t.type&&(i=t.type.replace(/_/g,"-"))),{name:r,value:e===void 0?-1:e,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},M=function(r,e,t){try{if(PerformanceObserver.supportedEntryTypes.includes(r)){var i=new PerformanceObserver(function(n){Promise.resolve().then(function(){e(n.getEntries())})});return i.observe(Object.assign({type:r,buffered:!0},t||{})),i}}catch{}},g=function(r,e,t,i){var n,o;return function(c){e.value>=0&&(c||i)&&((o=e.value-(n||0))||n===void 0)&&(n=e.value,e.delta=o,e.rating=function(d,a){return d>a[1]?"poor":d>a[0]?"needs-improvement":"good"}(e.value,t),r(e))}},A=function(r){requestAnimationFrame(function(){return requestAnimationFrame(function(){return r()})})},B=function(r){document.addEventListener("visibilitychange",function(){document.visibilityState==="hidden"&&r()})},T=function(r){var e=!1;return function(){e||(r(),e=!0)}},y=-1,L=function(){return document.visibilityState!=="hidden"||document.prerendering?1/0:0},_=function(r){document.visibilityState==="hidden"&&y>-1&&(y=r.type==="visibilitychange"?r.timeStamp:0,$())},R=function(){addEventListener("visibilitychange",_,!0),addEventListener("prerenderingchange",_,!0)},$=function(){removeEventListener("visibilitychange",_,!0),removeEventListener("prerenderingchange",_,!0)},D=function(){return y<0&&(y=L(),R(),v(function(){setTimeout(function(){y=L(),R()},0)})),{get firstHiddenTime(){return y}}},F=function(r){document.prerendering?addEventListener("prerenderingchange",function(){return r()},!0):r()},V=[1800,3e3],W=function(r,e){e=e||{},F(function(){var t,i=D(),n=p("FCP"),o=M("paint",function(c){c.forEach(function(d){d.name==="first-contentful-paint"&&(o.disconnect(),d.startTime<i.firstHiddenTime&&(n.value=Math.max(d.startTime-S(),0),n.entries.push(d),t(!0)))})});o&&(t=g(r,n,V,e.reportAllChanges),v(function(c){n=p("FCP"),t=g(r,n,V,e.reportAllChanges),A(function(){n.value=performance.now()-c.timeStamp,t(!0)})}))})},I=[.1,.25],q=function(r,e){e=e||{},W(T(function(){var t,i=p("CLS",0),n=0,o=[],c=function(a){a.forEach(function(f){if(!f.hadRecentInput){var m=o[0],x=o[o.length-1];n&&f.startTime-x.startTime<1e3&&f.startTime-m.startTime<5e3?(n+=f.value,o.push(f)):(n=f.value,o=[f])}}),n>i.value&&(i.value=n,i.entries=o,t())},d=M("layout-shift",c);d&&(t=g(r,i,I,e.reportAllChanges),B(function(){c(d.takeRecords()),t(!0)}),v(function(){n=0,i=p("CLS",0),t=g(r,i,I,e.reportAllChanges),A(function(){return t()})}),setTimeout(t,0))}))},j=0,N=1/0,k=0,ee=function(r){r.forEach(function(e){e.interactionId&&(N=Math.min(N,e.interactionId),k=Math.max(k,e.interactionId),j=k?(k-N)/7+1:0)})},G=function(){return O?j:performance.interactionCount||0},te=function(){"interactionCount"in performance||O||(O=M("event",ee,{type:"event",buffered:!0,durationThreshold:0}))},b=[],E=new Map,Q=0,re=function(){var r=Math.min(b.length-1,Math.floor((G()-Q)/50));return b[r]},ie=[],se=function(r){if(ie.forEach(function(n){return n(r)}),r.interactionId||r.entryType==="first-input"){var e=b[b.length-1],t=E.get(r.interactionId);if(t||b.length<10||r.duration>e.latency){if(t)r.duration>t.latency?(t.entries=[r],t.latency=r.duration):r.duration===t.latency&&r.startTime===t.entries[0].startTime&&t.entries.push(r);else{var i={id:r.interactionId,latency:r.duration,entries:[r]};E.set(i.id,i),b.push(i)}b.sort(function(n,o){return o.latency-n.latency}),b.length>10&&b.splice(10).forEach(function(n){return E.delete(n.id)})}}},H=function(r){var e=self.requestIdleCallback||self.setTimeout,t=-1;return r=T(r),document.visibilityState==="hidden"?r():(t=e(r),B(r)),t},U=[200,500],ne=function(r,e){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(e=e||{},F(function(){var t;te();var i,n=p("INP"),o=function(d){H(function(){d.forEach(se);var a=re();a&&a.latency!==n.value&&(n.value=a.latency,n.entries=a.entries,i())})},c=M("event",o,{durationThreshold:(t=e.durationThreshold)!==null&&t!==void 0?t:40});i=g(r,n,U,e.reportAllChanges),c&&(c.observe({type:"first-input",buffered:!0}),B(function(){o(c.takeRecords()),i(!0)}),v(function(){Q=G(),b.length=0,E.clear(),n=p("INP"),i=g(r,n,U,e.reportAllChanges)}))}))},K=[2500,4e3],C={},oe=function(r,e){e=e||{},F(function(){var t,i=D(),n=p("LCP"),o=function(a){e.reportAllChanges||(a=a.slice(-1)),a.forEach(function(f){f.startTime<i.firstHiddenTime&&(n.value=Math.max(f.startTime-S(),0),n.entries=[f],t())})},c=M("largest-contentful-paint",o);if(c){t=g(r,n,K,e.reportAllChanges);var d=T(function(){C[n.id]||(o(c.takeRecords()),c.disconnect(),C[n.id]=!0,t(!0))});["keydown","click"].forEach(function(a){addEventListener(a,function(){return H(d)},{once:!0,capture:!0})}),B(d),v(function(a){n=p("LCP"),t=g(r,n,K,e.reportAllChanges),A(function(){n.value=performance.now()-a.timeStamp,C[n.id]=!0,t(!0)})})}})},J=[800,1800],ae=function r(e){document.prerendering?F(function(){return r(e)}):document.readyState!=="complete"?addEventListener("load",function(){return r(e)},!0):setTimeout(e,0)},ce=function(r,e){e=e||{};var t=p("TTFB"),i=g(r,t,J,e.reportAllChanges);ae(function(){var n=P();n&&(t.value=Math.max(n.responseStart-S(),0),t.entries=[n],i(!0),v(function(){t=p("TTFB",0),(i=g(r,t,J,e.reportAllChanges))(!0)}))})};const de={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},Z={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},l={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},h={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},w={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"};class s{static getFirstMatch(e,t){const i=t.match(e);return i&&i.length>0&&i[1]||""}static getSecondMatch(e,t){const i=t.match(e);return i&&i.length>1&&i[2]||""}static matchAndReturnConst(e,t,i){if(e.test(t))return i}static getWindowsVersionName(e){switch(e){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}static getMacOSVersionName(e){const t=e.split(".").splice(0,2).map(i=>parseInt(i,10)||0);if(t.push(0),t[0]===10)switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}}static getAndroidVersionName(e){const t=e.split(".").splice(0,2).map(i=>parseInt(i,10)||0);if(t.push(0),!(t[0]===1&&t[1]<5)){if(t[0]===1&&t[1]<6)return"Cupcake";if(t[0]===1&&t[1]>=6)return"Donut";if(t[0]===2&&t[1]<2)return"Eclair";if(t[0]===2&&t[1]===2)return"Froyo";if(t[0]===2&&t[1]>2)return"Gingerbread";if(t[0]===3)return"Honeycomb";if(t[0]===4&&t[1]<1)return"Ice Cream Sandwich";if(t[0]===4&&t[1]<4)return"Jelly Bean";if(t[0]===4&&t[1]>=4)return"KitKat";if(t[0]===5)return"Lollipop";if(t[0]===6)return"Marshmallow";if(t[0]===7)return"Nougat";if(t[0]===8)return"Oreo";if(t[0]===9)return"Pie"}}static getVersionPrecision(e){return e.split(".").length}static compareVersions(e,t,i=!1){const n=s.getVersionPrecision(e),o=s.getVersionPrecision(t);let c=Math.max(n,o),d=0;const a=s.map([e,t],f=>{const m=c-s.getVersionPrecision(f),x=f+new Array(m+1).join(".0");return s.map(x.split("."),Y=>new Array(20-Y.length).join("0")+Y).reverse()});for(i&&(d=c-Math.min(n,o)),c-=1;c>=d;){if(a[0][c]>a[1][c])return 1;if(a[0][c]===a[1][c]){if(c===d)return 0;c-=1}else if(a[0][c]<a[1][c])return-1}}static map(e,t){const i=[];let n;if(Array.prototype.map)return Array.prototype.map.call(e,t);for(n=0;n<e.length;n+=1)i.push(t(e[n]));return i}static find(e,t){let i,n;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(i=0,n=e.length;i<n;i+=1){const o=e[i];if(t(o,i))return o}}static assign(e,...t){const i=e;let n,o;if(Object.assign)return Object.assign(e,...t);for(n=0,o=t.length;n<o;n+=1){const c=t[n];typeof c=="object"&&c!==null&&Object.keys(c).forEach(a=>{i[a]=c[a]})}return e}static getBrowserAlias(e){return de[e]}static getBrowserTypeByAlias(e){return Z[e]||""}}const u=/version\/(\d+(\.?_?\d+)+)/i,ue=[{test:[/googlebot/i],describe(r){const e={name:"Googlebot"},t=s.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/opera/i],describe(r){const e={name:"Opera"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/opr\/|opios/i],describe(r){const e={name:"Opera"},t=s.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/SamsungBrowser/i],describe(r){const e={name:"Samsung Internet for Android"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/Whale/i],describe(r){const e={name:"NAVER Whale Browser"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/MZBrowser/i],describe(r){const e={name:"MZ Browser"},t=s.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/focus/i],describe(r){const e={name:"Focus"},t=s.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/swing/i],describe(r){const e={name:"Swing"},t=s.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/coast/i],describe(r){const e={name:"Opera Coast"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(r){const e={name:"Opera Touch"},t=s.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/yabrowser/i],describe(r){const e={name:"Yandex Browser"},t=s.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/ucbrowser/i],describe(r){const e={name:"UC Browser"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/Maxthon|mxios/i],describe(r){const e={name:"Maxthon"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/epiphany/i],describe(r){const e={name:"Epiphany"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/puffin/i],describe(r){const e={name:"Puffin"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/sleipnir/i],describe(r){const e={name:"Sleipnir"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/k-meleon/i],describe(r){const e={name:"K-Meleon"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/micromessenger/i],describe(r){const e={name:"WeChat"},t=s.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/qqbrowser/i],describe(r){const e={name:/qqbrowserlite/i.test(r)?"QQ Browser Lite":"QQ Browser"},t=s.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/msie|trident/i],describe(r){const e={name:"Internet Explorer"},t=s.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/\sedg\//i],describe(r){const e={name:"Microsoft Edge"},t=s.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/edg([ea]|ios)/i],describe(r){const e={name:"Microsoft Edge"},t=s.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/vivaldi/i],describe(r){const e={name:"Vivaldi"},t=s.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/seamonkey/i],describe(r){const e={name:"SeaMonkey"},t=s.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/sailfish/i],describe(r){const e={name:"Sailfish"},t=s.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,r);return t&&(e.version=t),e}},{test:[/silk/i],describe(r){const e={name:"Amazon Silk"},t=s.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/phantom/i],describe(r){const e={name:"PhantomJS"},t=s.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/slimerjs/i],describe(r){const e={name:"SlimerJS"},t=s.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(r){const e={name:"BlackBerry"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/(web|hpw)[o0]s/i],describe(r){const e={name:"WebOS Browser"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/bada/i],describe(r){const e={name:"Bada"},t=s.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/tizen/i],describe(r){const e={name:"Tizen"},t=s.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/qupzilla/i],describe(r){const e={name:"QupZilla"},t=s.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/firefox|iceweasel|fxios/i],describe(r){const e={name:"Firefox"},t=s.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/electron/i],describe(r){const e={name:"Electron"},t=s.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/MiuiBrowser/i],describe(r){const e={name:"Miui"},t=s.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/chromium/i],describe(r){const e={name:"Chromium"},t=s.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/chrome|crios|crmo/i],describe(r){const e={name:"Chrome"},t=s.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/GSA/i],describe(r){const e={name:"Google Search"},t=s.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test(r){const e=!r.test(/like android/i),t=r.test(/android/i);return e&&t},describe(r){const e={name:"Android Browser"},t=s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/playstation 4/i],describe(r){const e={name:"PlayStation 4"},t=s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/safari|applewebkit/i],describe(r){const e={name:"Safari"},t=s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/.*/i],describe(r){const e=/^(.*)\/(.*) /,t=/^(.*)\/(.*)[ \t]\((.*)/,n=r.search("\\(")!==-1?t:e;return{name:s.getFirstMatch(n,r),version:s.getSecondMatch(n,r)}}}],le=[{test:[/Roku\/DVP/],describe(r){const e=s.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,r);return{name:h.Roku,version:e}}},{test:[/windows phone/i],describe(r){const e=s.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,r);return{name:h.WindowsPhone,version:e}}},{test:[/windows /i],describe(r){const e=s.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,r),t=s.getWindowsVersionName(e);return{name:h.Windows,version:e,versionName:t}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(r){const e={name:h.iOS},t=s.getSecondMatch(/(Version\/)(\d[\d.]+)/,r);return t&&(e.version=t),e}},{test:[/macintosh/i],describe(r){const e=s.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,r).replace(/[_\s]/g,"."),t=s.getMacOSVersionName(e),i={name:h.MacOS,version:e};return t&&(i.versionName=t),i}},{test:[/(ipod|iphone|ipad)/i],describe(r){const e=s.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,r).replace(/[_\s]/g,".");return{name:h.iOS,version:e}}},{test(r){const e=!r.test(/like android/i),t=r.test(/android/i);return e&&t},describe(r){const e=s.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,r),t=s.getAndroidVersionName(e),i={name:h.Android,version:e};return t&&(i.versionName=t),i}},{test:[/(web|hpw)[o0]s/i],describe(r){const e=s.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,r),t={name:h.WebOS};return e&&e.length&&(t.version=e),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(r){const e=s.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,r)||s.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,r)||s.getFirstMatch(/\bbb(\d+)/i,r);return{name:h.BlackBerry,version:e}}},{test:[/bada/i],describe(r){const e=s.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,r);return{name:h.Bada,version:e}}},{test:[/tizen/i],describe(r){const e=s.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,r);return{name:h.Tizen,version:e}}},{test:[/linux/i],describe(){return{name:h.Linux}}},{test:[/CrOS/],describe(){return{name:h.ChromeOS}}},{test:[/PlayStation 4/],describe(r){const e=s.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,r);return{name:h.PlayStation4,version:e}}}],fe=[{test:[/googlebot/i],describe(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe(r){const e=s.getFirstMatch(/(can-l01)/i,r)&&"Nova",t={type:l.mobile,vendor:"Huawei"};return e&&(t.model=e),t}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe(){return{type:l.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe(){return{type:l.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(){return{type:l.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe(){return{type:l.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe(){return{type:l.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe(){return{type:l.tablet}}},{test(r){const e=r.test(/ipod|iphone/i),t=r.test(/like (ipod|iphone)/i);return e&&!t},describe(r){const e=s.getFirstMatch(/(ipod|iphone)/i,r);return{type:l.mobile,vendor:"Apple",model:e}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe(){return{type:l.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe(){return{type:l.mobile}}},{test(r){return r.getBrowserName(!0)==="blackberry"},describe(){return{type:l.mobile,vendor:"BlackBerry"}}},{test(r){return r.getBrowserName(!0)==="bada"},describe(){return{type:l.mobile}}},{test(r){return r.getBrowserName()==="windows phone"},describe(){return{type:l.mobile,vendor:"Microsoft"}}},{test(r){const e=Number(String(r.getOSVersion()).split(".")[0]);return r.getOSName(!0)==="android"&&e>=3},describe(){return{type:l.tablet}}},{test(r){return r.getOSName(!0)==="android"},describe(){return{type:l.mobile}}},{test(r){return r.getOSName(!0)==="macos"},describe(){return{type:l.desktop,vendor:"Apple"}}},{test(r){return r.getOSName(!0)==="windows"},describe(){return{type:l.desktop}}},{test(r){return r.getOSName(!0)==="linux"},describe(){return{type:l.desktop}}},{test(r){return r.getOSName(!0)==="playstation 4"},describe(){return{type:l.tv}}},{test(r){return r.getOSName(!0)==="roku"},describe(){return{type:l.tv}}}],he=[{test(r){return r.getBrowserName(!0)==="microsoft edge"},describe(r){if(/\sedg\//i.test(r))return{name:w.Blink};const t=s.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,r);return{name:w.EdgeHTML,version:t}}},{test:[/trident/i],describe(r){const e={name:w.Trident},t=s.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test(r){return r.test(/presto/i)},describe(r){const e={name:w.Presto},t=s.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test(r){const e=r.test(/gecko/i),t=r.test(/like gecko/i);return e&&!t},describe(r){const e={name:w.Gecko},t=s.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/(apple)?webkit\/537\.36/i],describe(){return{name:w.Blink}}},{test:[/(apple)?webkit/i],describe(r){const e={name:w.WebKit},t=s.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}}];class X{constructor(e,t=!1){if(e==null||e==="")throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},t!==!0&&this.parse()}getUA(){return this._ua}test(e){return e.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const e=s.find(ue,t=>{if(typeof t.test=="function")return t.test(this);if(t.test instanceof Array)return t.test.some(i=>this.test(i));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.browser=e.describe(this.getUA())),this.parsedResult.browser}getBrowser(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}getBrowserName(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""}getBrowserVersion(){return this.getBrowser().version}getOS(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()}parseOS(){this.parsedResult.os={};const e=s.find(le,t=>{if(typeof t.test=="function")return t.test(this);if(t.test instanceof Array)return t.test.some(i=>this.test(i));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.os=e.describe(this.getUA())),this.parsedResult.os}getOSName(e){const{name:t}=this.getOS();return e?String(t).toLowerCase()||"":t||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(e=!1){const{type:t}=this.getPlatform();return e?String(t).toLowerCase()||"":t||""}parsePlatform(){this.parsedResult.platform={};const e=s.find(fe,t=>{if(typeof t.test=="function")return t.test(this);if(t.test instanceof Array)return t.test.some(i=>this.test(i));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.platform=e.describe(this.getUA())),this.parsedResult.platform}getEngine(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}getEngineName(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}parseEngine(){this.parsedResult.engine={};const e=s.find(he,t=>{if(typeof t.test=="function")return t.test(this);if(t.test instanceof Array)return t.test.some(i=>this.test(i));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.engine=e.describe(this.getUA())),this.parsedResult.engine}parse(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}getResult(){return s.assign({},this.parsedResult)}satisfies(e){const t={};let i=0;const n={};let o=0;if(Object.keys(e).forEach(d=>{const a=e[d];typeof a=="string"?(n[d]=a,o+=1):typeof a=="object"&&(t[d]=a,i+=1)}),i>0){const d=Object.keys(t),a=s.find(d,m=>this.isOS(m));if(a){const m=this.satisfies(t[a]);if(m!==void 0)return m}const f=s.find(d,m=>this.isPlatform(m));if(f){const m=this.satisfies(t[f]);if(m!==void 0)return m}}if(o>0){const d=Object.keys(n),a=s.find(d,f=>this.isBrowser(f,!0));if(a!==void 0)return this.compareVersion(n[a])}}isBrowser(e,t=!1){const i=this.getBrowserName().toLowerCase();let n=e.toLowerCase();const o=s.getBrowserTypeByAlias(n);return t&&o&&(n=o.toLowerCase()),n===i}compareVersion(e){let t=[0],i=e,n=!1;const o=this.getBrowserVersion();if(typeof o=="string")return e[0]===">"||e[0]==="<"?(i=e.substr(1),e[1]==="="?(n=!0,i=e.substr(2)):t=[],e[0]===">"?t.push(1):t.push(-1)):e[0]==="="?i=e.substr(1):e[0]==="~"&&(n=!0,i=e.substr(1)),t.indexOf(s.compareVersions(o,i,n))>-1}isOS(e){return this.getOSName(!0)===String(e).toLowerCase()}isPlatform(e){return this.getPlatformType(!0)===String(e).toLowerCase()}isEngine(e){return this.getEngineName(!0)===String(e).toLowerCase()}is(e,t=!1){return this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)}some(e=[]){return e.some(t=>this.is(t))}}/*!
     1(function(){"use strict";var O,z=-1,v=function(r){addEventListener("pageshow",function(e){e.persisted&&(z=e.timeStamp,r(e))},!0)},P=function(){var r=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(r&&r.responseStart>0&&r.responseStart<performance.now())return r},S=function(){var r=P();return r&&r.activationStart||0},p=function(r,e){var t=P(),i="navigate";return z>=0?i="back-forward-cache":t&&(document.prerendering||S()>0?i="prerender":document.wasDiscarded?i="restore":t.type&&(i=t.type.replace(/_/g,"-"))),{name:r,value:e===void 0?-1:e,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},M=function(r,e,t){try{if(PerformanceObserver.supportedEntryTypes.includes(r)){var i=new PerformanceObserver(function(n){Promise.resolve().then(function(){e(n.getEntries())})});return i.observe(Object.assign({type:r,buffered:!0},t||{})),i}}catch{}},g=function(r,e,t,i){var n,o;return function(c){e.value>=0&&(c||i)&&((o=e.value-(n||0))||n===void 0)&&(n=e.value,e.delta=o,e.rating=function(d,a){return d>a[1]?"poor":d>a[0]?"needs-improvement":"good"}(e.value,t),r(e))}},A=function(r){requestAnimationFrame(function(){return requestAnimationFrame(function(){return r()})})},B=function(r){document.addEventListener("visibilitychange",function(){document.visibilityState==="hidden"&&r()})},T=function(r){var e=!1;return function(){e||(r(),e=!0)}},y=-1,L=function(){return document.visibilityState!=="hidden"||document.prerendering?1/0:0},_=function(r){document.visibilityState==="hidden"&&y>-1&&(y=r.type==="visibilitychange"?r.timeStamp:0,$())},R=function(){addEventListener("visibilitychange",_,!0),addEventListener("prerenderingchange",_,!0)},$=function(){removeEventListener("visibilitychange",_,!0),removeEventListener("prerenderingchange",_,!0)},W=function(){return y<0&&(y=L(),R(),v(function(){setTimeout(function(){y=L(),R()},0)})),{get firstHiddenTime(){return y}}},F=function(r){document.prerendering?addEventListener("prerenderingchange",function(){return r()},!0):r()},D=[1800,3e3],V=function(r,e){e=e||{},F(function(){var t,i=W(),n=p("FCP"),o=M("paint",function(c){c.forEach(function(d){d.name==="first-contentful-paint"&&(o.disconnect(),d.startTime<i.firstHiddenTime&&(n.value=Math.max(d.startTime-S(),0),n.entries.push(d),t(!0)))})});o&&(t=g(r,n,D,e.reportAllChanges),v(function(c){n=p("FCP"),t=g(r,n,D,e.reportAllChanges),A(function(){n.value=performance.now()-c.timeStamp,t(!0)})}))})},I=[.1,.25],q=function(r,e){e=e||{},V(T(function(){var t,i=p("CLS",0),n=0,o=[],c=function(a){a.forEach(function(f){if(!f.hadRecentInput){var m=o[0],x=o[o.length-1];n&&f.startTime-x.startTime<1e3&&f.startTime-m.startTime<5e3?(n+=f.value,o.push(f)):(n=f.value,o=[f])}}),n>i.value&&(i.value=n,i.entries=o,t())},d=M("layout-shift",c);d&&(t=g(r,i,I,e.reportAllChanges),B(function(){c(d.takeRecords()),t(!0)}),v(function(){n=0,i=p("CLS",0),t=g(r,i,I,e.reportAllChanges),A(function(){return t()})}),setTimeout(t,0))}))},j=0,N=1/0,k=0,ee=function(r){r.forEach(function(e){e.interactionId&&(N=Math.min(N,e.interactionId),k=Math.max(k,e.interactionId),j=k?(k-N)/7+1:0)})},G=function(){return O?j:performance.interactionCount||0},te=function(){"interactionCount"in performance||O||(O=M("event",ee,{type:"event",buffered:!0,durationThreshold:0}))},b=[],E=new Map,Q=0,re=function(){var r=Math.min(b.length-1,Math.floor((G()-Q)/50));return b[r]},ie=[],se=function(r){if(ie.forEach(function(n){return n(r)}),r.interactionId||r.entryType==="first-input"){var e=b[b.length-1],t=E.get(r.interactionId);if(t||b.length<10||r.duration>e.latency){if(t)r.duration>t.latency?(t.entries=[r],t.latency=r.duration):r.duration===t.latency&&r.startTime===t.entries[0].startTime&&t.entries.push(r);else{var i={id:r.interactionId,latency:r.duration,entries:[r]};E.set(i.id,i),b.push(i)}b.sort(function(n,o){return o.latency-n.latency}),b.length>10&&b.splice(10).forEach(function(n){return E.delete(n.id)})}}},H=function(r){var e=self.requestIdleCallback||self.setTimeout,t=-1;return r=T(r),document.visibilityState==="hidden"?r():(t=e(r),B(r)),t},U=[200,500],ne=function(r,e){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(e=e||{},F(function(){var t;te();var i,n=p("INP"),o=function(d){H(function(){d.forEach(se);var a=re();a&&a.latency!==n.value&&(n.value=a.latency,n.entries=a.entries,i())})},c=M("event",o,{durationThreshold:(t=e.durationThreshold)!==null&&t!==void 0?t:40});i=g(r,n,U,e.reportAllChanges),c&&(c.observe({type:"first-input",buffered:!0}),B(function(){o(c.takeRecords()),i(!0)}),v(function(){Q=G(),b.length=0,E.clear(),n=p("INP"),i=g(r,n,U,e.reportAllChanges)}))}))},K=[2500,4e3],C={},oe=function(r,e){e=e||{},F(function(){var t,i=W(),n=p("LCP"),o=function(a){e.reportAllChanges||(a=a.slice(-1)),a.forEach(function(f){f.startTime<i.firstHiddenTime&&(n.value=Math.max(f.startTime-S(),0),n.entries=[f],t())})},c=M("largest-contentful-paint",o);if(c){t=g(r,n,K,e.reportAllChanges);var d=T(function(){C[n.id]||(o(c.takeRecords()),c.disconnect(),C[n.id]=!0,t(!0))});["keydown","click"].forEach(function(a){addEventListener(a,function(){return H(d)},{once:!0,capture:!0})}),B(d),v(function(a){n=p("LCP"),t=g(r,n,K,e.reportAllChanges),A(function(){n.value=performance.now()-a.timeStamp,C[n.id]=!0,t(!0)})})}})},J=[800,1800],ae=function r(e){document.prerendering?F(function(){return r(e)}):document.readyState!=="complete"?addEventListener("load",function(){return r(e)},!0):setTimeout(e,0)},ce=function(r,e){e=e||{};var t=p("TTFB"),i=g(r,t,J,e.reportAllChanges);ae(function(){var n=P();n&&(t.value=Math.max(n.responseStart-S(),0),t.entries=[n],i(!0),v(function(){t=p("TTFB",0),(i=g(r,t,J,e.reportAllChanges))(!0)}))})};const de={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},Z={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},l={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},h={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},w={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"};class s{static getFirstMatch(e,t){const i=t.match(e);return i&&i.length>0&&i[1]||""}static getSecondMatch(e,t){const i=t.match(e);return i&&i.length>1&&i[2]||""}static matchAndReturnConst(e,t,i){if(e.test(t))return i}static getWindowsVersionName(e){switch(e){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}static getMacOSVersionName(e){const t=e.split(".").splice(0,2).map(i=>parseInt(i,10)||0);if(t.push(0),t[0]===10)switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}}static getAndroidVersionName(e){const t=e.split(".").splice(0,2).map(i=>parseInt(i,10)||0);if(t.push(0),!(t[0]===1&&t[1]<5)){if(t[0]===1&&t[1]<6)return"Cupcake";if(t[0]===1&&t[1]>=6)return"Donut";if(t[0]===2&&t[1]<2)return"Eclair";if(t[0]===2&&t[1]===2)return"Froyo";if(t[0]===2&&t[1]>2)return"Gingerbread";if(t[0]===3)return"Honeycomb";if(t[0]===4&&t[1]<1)return"Ice Cream Sandwich";if(t[0]===4&&t[1]<4)return"Jelly Bean";if(t[0]===4&&t[1]>=4)return"KitKat";if(t[0]===5)return"Lollipop";if(t[0]===6)return"Marshmallow";if(t[0]===7)return"Nougat";if(t[0]===8)return"Oreo";if(t[0]===9)return"Pie"}}static getVersionPrecision(e){return e.split(".").length}static compareVersions(e,t,i=!1){const n=s.getVersionPrecision(e),o=s.getVersionPrecision(t);let c=Math.max(n,o),d=0;const a=s.map([e,t],f=>{const m=c-s.getVersionPrecision(f),x=f+new Array(m+1).join(".0");return s.map(x.split("."),Y=>new Array(20-Y.length).join("0")+Y).reverse()});for(i&&(d=c-Math.min(n,o)),c-=1;c>=d;){if(a[0][c]>a[1][c])return 1;if(a[0][c]===a[1][c]){if(c===d)return 0;c-=1}else if(a[0][c]<a[1][c])return-1}}static map(e,t){const i=[];let n;if(Array.prototype.map)return Array.prototype.map.call(e,t);for(n=0;n<e.length;n+=1)i.push(t(e[n]));return i}static find(e,t){let i,n;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(i=0,n=e.length;i<n;i+=1){const o=e[i];if(t(o,i))return o}}static assign(e,...t){const i=e;let n,o;if(Object.assign)return Object.assign(e,...t);for(n=0,o=t.length;n<o;n+=1){const c=t[n];typeof c=="object"&&c!==null&&Object.keys(c).forEach(a=>{i[a]=c[a]})}return e}static getBrowserAlias(e){return de[e]}static getBrowserTypeByAlias(e){return Z[e]||""}}const u=/version\/(\d+(\.?_?\d+)+)/i,ue=[{test:[/googlebot/i],describe(r){const e={name:"Googlebot"},t=s.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/opera/i],describe(r){const e={name:"Opera"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/opr\/|opios/i],describe(r){const e={name:"Opera"},t=s.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/SamsungBrowser/i],describe(r){const e={name:"Samsung Internet for Android"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/Whale/i],describe(r){const e={name:"NAVER Whale Browser"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/MZBrowser/i],describe(r){const e={name:"MZ Browser"},t=s.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/focus/i],describe(r){const e={name:"Focus"},t=s.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/swing/i],describe(r){const e={name:"Swing"},t=s.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/coast/i],describe(r){const e={name:"Opera Coast"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(r){const e={name:"Opera Touch"},t=s.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/yabrowser/i],describe(r){const e={name:"Yandex Browser"},t=s.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/ucbrowser/i],describe(r){const e={name:"UC Browser"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/Maxthon|mxios/i],describe(r){const e={name:"Maxthon"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/epiphany/i],describe(r){const e={name:"Epiphany"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/puffin/i],describe(r){const e={name:"Puffin"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/sleipnir/i],describe(r){const e={name:"Sleipnir"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/k-meleon/i],describe(r){const e={name:"K-Meleon"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/micromessenger/i],describe(r){const e={name:"WeChat"},t=s.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/qqbrowser/i],describe(r){const e={name:/qqbrowserlite/i.test(r)?"QQ Browser Lite":"QQ Browser"},t=s.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/msie|trident/i],describe(r){const e={name:"Internet Explorer"},t=s.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/\sedg\//i],describe(r){const e={name:"Microsoft Edge"},t=s.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/edg([ea]|ios)/i],describe(r){const e={name:"Microsoft Edge"},t=s.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/vivaldi/i],describe(r){const e={name:"Vivaldi"},t=s.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/seamonkey/i],describe(r){const e={name:"SeaMonkey"},t=s.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/sailfish/i],describe(r){const e={name:"Sailfish"},t=s.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,r);return t&&(e.version=t),e}},{test:[/silk/i],describe(r){const e={name:"Amazon Silk"},t=s.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/phantom/i],describe(r){const e={name:"PhantomJS"},t=s.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/slimerjs/i],describe(r){const e={name:"SlimerJS"},t=s.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(r){const e={name:"BlackBerry"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/(web|hpw)[o0]s/i],describe(r){const e={name:"WebOS Browser"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/bada/i],describe(r){const e={name:"Bada"},t=s.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/tizen/i],describe(r){const e={name:"Tizen"},t=s.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/qupzilla/i],describe(r){const e={name:"QupZilla"},t=s.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/firefox|iceweasel|fxios/i],describe(r){const e={name:"Firefox"},t=s.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/electron/i],describe(r){const e={name:"Electron"},t=s.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/MiuiBrowser/i],describe(r){const e={name:"Miui"},t=s.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/chromium/i],describe(r){const e={name:"Chromium"},t=s.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/chrome|crios|crmo/i],describe(r){const e={name:"Chrome"},t=s.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/GSA/i],describe(r){const e={name:"Google Search"},t=s.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test(r){const e=!r.test(/like android/i),t=r.test(/android/i);return e&&t},describe(r){const e={name:"Android Browser"},t=s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/playstation 4/i],describe(r){const e={name:"PlayStation 4"},t=s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/safari|applewebkit/i],describe(r){const e={name:"Safari"},t=s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/.*/i],describe(r){const e=/^(.*)\/(.*) /,t=/^(.*)\/(.*)[ \t]\((.*)/,n=r.search("\\(")!==-1?t:e;return{name:s.getFirstMatch(n,r),version:s.getSecondMatch(n,r)}}}],le=[{test:[/Roku\/DVP/],describe(r){const e=s.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,r);return{name:h.Roku,version:e}}},{test:[/windows phone/i],describe(r){const e=s.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,r);return{name:h.WindowsPhone,version:e}}},{test:[/windows /i],describe(r){const e=s.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,r),t=s.getWindowsVersionName(e);return{name:h.Windows,version:e,versionName:t}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(r){const e={name:h.iOS},t=s.getSecondMatch(/(Version\/)(\d[\d.]+)/,r);return t&&(e.version=t),e}},{test:[/macintosh/i],describe(r){const e=s.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,r).replace(/[_\s]/g,"."),t=s.getMacOSVersionName(e),i={name:h.MacOS,version:e};return t&&(i.versionName=t),i}},{test:[/(ipod|iphone|ipad)/i],describe(r){const e=s.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,r).replace(/[_\s]/g,".");return{name:h.iOS,version:e}}},{test(r){const e=!r.test(/like android/i),t=r.test(/android/i);return e&&t},describe(r){const e=s.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,r),t=s.getAndroidVersionName(e),i={name:h.Android,version:e};return t&&(i.versionName=t),i}},{test:[/(web|hpw)[o0]s/i],describe(r){const e=s.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,r),t={name:h.WebOS};return e&&e.length&&(t.version=e),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(r){const e=s.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,r)||s.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,r)||s.getFirstMatch(/\bbb(\d+)/i,r);return{name:h.BlackBerry,version:e}}},{test:[/bada/i],describe(r){const e=s.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,r);return{name:h.Bada,version:e}}},{test:[/tizen/i],describe(r){const e=s.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,r);return{name:h.Tizen,version:e}}},{test:[/linux/i],describe(){return{name:h.Linux}}},{test:[/CrOS/],describe(){return{name:h.ChromeOS}}},{test:[/PlayStation 4/],describe(r){const e=s.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,r);return{name:h.PlayStation4,version:e}}}],fe=[{test:[/googlebot/i],describe(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe(r){const e=s.getFirstMatch(/(can-l01)/i,r)&&"Nova",t={type:l.mobile,vendor:"Huawei"};return e&&(t.model=e),t}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe(){return{type:l.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe(){return{type:l.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(){return{type:l.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe(){return{type:l.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe(){return{type:l.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe(){return{type:l.tablet}}},{test(r){const e=r.test(/ipod|iphone/i),t=r.test(/like (ipod|iphone)/i);return e&&!t},describe(r){const e=s.getFirstMatch(/(ipod|iphone)/i,r);return{type:l.mobile,vendor:"Apple",model:e}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe(){return{type:l.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe(){return{type:l.mobile}}},{test(r){return r.getBrowserName(!0)==="blackberry"},describe(){return{type:l.mobile,vendor:"BlackBerry"}}},{test(r){return r.getBrowserName(!0)==="bada"},describe(){return{type:l.mobile}}},{test(r){return r.getBrowserName()==="windows phone"},describe(){return{type:l.mobile,vendor:"Microsoft"}}},{test(r){const e=Number(String(r.getOSVersion()).split(".")[0]);return r.getOSName(!0)==="android"&&e>=3},describe(){return{type:l.tablet}}},{test(r){return r.getOSName(!0)==="android"},describe(){return{type:l.mobile}}},{test(r){return r.getOSName(!0)==="macos"},describe(){return{type:l.desktop,vendor:"Apple"}}},{test(r){return r.getOSName(!0)==="windows"},describe(){return{type:l.desktop}}},{test(r){return r.getOSName(!0)==="linux"},describe(){return{type:l.desktop}}},{test(r){return r.getOSName(!0)==="playstation 4"},describe(){return{type:l.tv}}},{test(r){return r.getOSName(!0)==="roku"},describe(){return{type:l.tv}}}],he=[{test(r){return r.getBrowserName(!0)==="microsoft edge"},describe(r){if(/\sedg\//i.test(r))return{name:w.Blink};const t=s.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,r);return{name:w.EdgeHTML,version:t}}},{test:[/trident/i],describe(r){const e={name:w.Trident},t=s.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test(r){return r.test(/presto/i)},describe(r){const e={name:w.Presto},t=s.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test(r){const e=r.test(/gecko/i),t=r.test(/like gecko/i);return e&&!t},describe(r){const e={name:w.Gecko},t=s.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/(apple)?webkit\/537\.36/i],describe(){return{name:w.Blink}}},{test:[/(apple)?webkit/i],describe(r){const e={name:w.WebKit},t=s.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}}];class X{constructor(e,t=!1){if(e==null||e==="")throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},t!==!0&&this.parse()}getUA(){return this._ua}test(e){return e.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const e=s.find(ue,t=>{if(typeof t.test=="function")return t.test(this);if(t.test instanceof Array)return t.test.some(i=>this.test(i));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.browser=e.describe(this.getUA())),this.parsedResult.browser}getBrowser(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}getBrowserName(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""}getBrowserVersion(){return this.getBrowser().version}getOS(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()}parseOS(){this.parsedResult.os={};const e=s.find(le,t=>{if(typeof t.test=="function")return t.test(this);if(t.test instanceof Array)return t.test.some(i=>this.test(i));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.os=e.describe(this.getUA())),this.parsedResult.os}getOSName(e){const{name:t}=this.getOS();return e?String(t).toLowerCase()||"":t||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(e=!1){const{type:t}=this.getPlatform();return e?String(t).toLowerCase()||"":t||""}parsePlatform(){this.parsedResult.platform={};const e=s.find(fe,t=>{if(typeof t.test=="function")return t.test(this);if(t.test instanceof Array)return t.test.some(i=>this.test(i));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.platform=e.describe(this.getUA())),this.parsedResult.platform}getEngine(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}getEngineName(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}parseEngine(){this.parsedResult.engine={};const e=s.find(he,t=>{if(typeof t.test=="function")return t.test(this);if(t.test instanceof Array)return t.test.some(i=>this.test(i));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.engine=e.describe(this.getUA())),this.parsedResult.engine}parse(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}getResult(){return s.assign({},this.parsedResult)}satisfies(e){const t={};let i=0;const n={};let o=0;if(Object.keys(e).forEach(d=>{const a=e[d];typeof a=="string"?(n[d]=a,o+=1):typeof a=="object"&&(t[d]=a,i+=1)}),i>0){const d=Object.keys(t),a=s.find(d,m=>this.isOS(m));if(a){const m=this.satisfies(t[a]);if(m!==void 0)return m}const f=s.find(d,m=>this.isPlatform(m));if(f){const m=this.satisfies(t[f]);if(m!==void 0)return m}}if(o>0){const d=Object.keys(n),a=s.find(d,f=>this.isBrowser(f,!0));if(a!==void 0)return this.compareVersion(n[a])}}isBrowser(e,t=!1){const i=this.getBrowserName().toLowerCase();let n=e.toLowerCase();const o=s.getBrowserTypeByAlias(n);return t&&o&&(n=o.toLowerCase()),n===i}compareVersion(e){let t=[0],i=e,n=!1;const o=this.getBrowserVersion();if(typeof o=="string")return e[0]===">"||e[0]==="<"?(i=e.substr(1),e[1]==="="?(n=!0,i=e.substr(2)):t=[],e[0]===">"?t.push(1):t.push(-1)):e[0]==="="?i=e.substr(1):e[0]==="~"&&(n=!0,i=e.substr(1)),t.indexOf(s.compareVersions(o,i,n))>-1}isOS(e){return this.getOSName(!0)===String(e).toLowerCase()}isPlatform(e){return this.getPlatformType(!0)===String(e).toLowerCase()}isEngine(e){return this.getEngineName(!0)===String(e).toLowerCase()}is(e,t=!1){return this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)}some(e=[]){return e.some(t=>this.is(t))}}/*!
    22 * Bowser - a browser detector
    33 * https://github.com/lancedikson/bowser
    44 * MIT License | (c) Dustin Diaz 2012-2015
    55 * MIT License | (c) Denis Demchenko 2015-2019
    6  */class me{static getParser(e,t=!1){if(typeof e!="string")throw new Error("UserAgent should be a string");return new X(e,t)}static parse(e){return new X(e).getResult()}static get BROWSER_MAP(){return Z}static get ENGINE_MAP(){return w}static get OS_MAP(){return h}static get PLATFORMS_MAP(){return l}}class pe{constructor(e){this.beaconSent=!1,this.config=e,this.sessionStart=performance.now(),this.timestamp_ms=Math.floor(Date.now()),this.queue=new Set,this.shouldSendBeacon()&&(this.initBrowserMetrics(),addEventListener("visibilitychange",()=>this.sendBeacon()))}shouldSendBeacon(){const e=Number(this.config.sample_rate);return e<0||e>1?(console.warn("DebugHawk: Invalid sampling rate, defaulting to sending metrics"),!0):e===1?!0:e===0?!1:Math.random()<e}sendBeacon(){if(this.beaconSent||typeof window.DebugHawk>"u"||document.visibilityState==="visible")return;const e=this.preparePayload(),t=JSON.stringify(e);this.shouldUseBeaconApi()?(navigator.sendBeacon(this.config.endpoint,t),this.beaconSent=!0):fetch(this.config.endpoint,{method:"POST",body:t,keepalive:!0,headers:{"Content-Type":"application/json"}}).then(()=>{this.beaconSent=!0}).catch(i=>{console.warn("DebugHawk: Fetch error",i)})}shouldUseBeaconApi(){return this.isBraveBrowser()?!1:"sendBeacon"in navigator}isBraveBrowser(){return"brave"in navigator}preparePayload(){return{server:window.DebugHawk,browser:this.getBrowserMetrics(),user:this.getUserInfo()}}getBrowserMetrics(){let e={title:document.title,requests:this.processNetworkRequests(),timestamp_ms:this.timestamp_ms};return this.queue.forEach(t=>{const i=t.name.toLowerCase();if(i!=="cls"?e[i+"_ms"]=this.roundToDecimals(t.value):e[i]=this.roundToDecimals(t.value,5),i==="ttfb"&&t.entries[0]){const n=this.calculateTtfbMetrics(t.entries[0]);Object.assign(e,n)}}),e}calculateTtfbMetrics(e){let t={};return e.domainLookupStart&&e.connectStart&&(t.dns_ms=this.roundToDecimals(e.connectStart-e.domainLookupStart)),e.connectStart&&e.connectEnd&&(t.connect_ms=this.roundToDecimals(e.connectEnd-e.connectStart)),e.decodedBodySize&&(t.html_body_size=e.decodedBodySize),e.encodedBodySize&&(t.html_transfer_size=e.encodedBodySize),t}processNetworkRequests(){const e=new Set;performance.getEntriesByType("navigation").forEach(i=>e.add(this.processPerformanceEntry(i))),performance.getEntriesByType("resource").forEach(i=>e.add(this.processPerformanceEntry(i)));let t={count:e.size,total_body_size:0,total_transfer_size:0,by_type:{},by_domain:{},by_component:{}};return e.forEach(i=>{t.total_body_size+=i.body_size||0,t.total_transfer_size+=i.transfer_size||0,t.by_type[i.type]||(t.by_type[i.type]={count:0,blocking:0,body_size:0,transfer_size:0}),t.by_type[i.type].count++,t.by_type[i.type].body_size+=i.body_size||0,t.by_type[i.type].transfer_size+=i.transfer_size||0,i.blocking&&t.by_type[i.type].blocking++;const n=this.getDomainFromUrl(i.url);if(t.by_domain[n]||(t.by_domain[n]={count:0,blocking:0,body_size:0,transfer_size:0}),t.by_domain[n].count++,t.by_domain[n].body_size+=i.body_size||0,t.by_domain[n].transfer_size+=i.transfer_size||0,i.blocking&&t.by_domain[n].blocking++,!i.url.startsWith(this.config.urls.home)||i.type==="html"||i.type==="other"||i.type==="xhr")return;const o=this.getComponentFromNetworkRequest(i);t.by_component[o]||(t.by_component[o]={}),t.by_component[o][i.type]||(t.by_component[o][i.type]={count:0,blocking:0,body_size:0,transfer_size:0}),t.by_component[o][i.type].count++,t.by_component[o][i.type].body_size+=i.body_size||0,t.by_component[o][i.type].transfer_size+=i.transfer_size||0,i.blocking&&t.by_component[o][i.type].blocking++}),t}processPerformanceEntry(e){return{url:e.name,type:this.getTypeFromPerformanceEntry(e),body_size:e.decodedBodySize,transfer_size:e.encodedBodySize,blocking:e.renderBlockingStatus==="blocking",status:e.responseStatus}}getComponentFromNetworkRequest(e){return e.url.startsWith(this.config.urls.plugin)?`plugin:${e.url.slice(this.config.urls.plugin.length).split("/")[0]}`:e.url.startsWith(this.config.urls.theme)?`theme:${e.url.slice(this.config.urls.theme.length).split("/")[0]}`:e.url.startsWith(this.config.urls.admin)||e.url.startsWith(this.config.urls.includes)?"core":e.url.startsWith(this.config.urls.uploads)?"upload":"other"}getDomainFromUrl(e){try{return new URL(e).hostname}catch{return"unknown"}}getFileExtensionFromUrl(e){try{const i=new URL(e).pathname,n=i.lastIndexOf(".");if(n===-1||n===i.length-1)return"";const o=i.substring(n+1);return o.includes("/")?"":o.toLowerCase()}catch{return""}}getTypeFromPerformanceEntry(e){if(e.initiatorType==="navigation"||e.initiatorType==="iframe")return"html";if(e.initiatorType==="script")return"js";if(e.initiatorType==="img")return"img";if(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")return"xhr";const t=this.getFileExtensionFromUrl(e.name);return{css:"css",js:"js",mjs:"js",woff:"font",woff2:"font",ttf:"font",otf:"font",eot:"font",png:"img",jpg:"img",jpeg:"img",gif:"img",svg:"img",webp:"img",ico:"img",avif:"img",mp4:"media",webm:"media",ogv:"media",mp3:"media",ogg:"media",wav:"media",flac:"media"}[t]||"other"}getUserInfo(){var i,n;const e=me.getParser(window.navigator.userAgent),t=performance.now();return{browser:{name:this.isBraveBrowser()?"Brave":e.getBrowserName(),version:this.isBraveBrowser()?null:e.getBrowserVersion(),viewport:{width:((i=window.visualViewport)==null?void 0:i.width)??null,height:((n=window.visualViewport)==null?void 0:n.height)??null}},os:{name:e.getOSName(),version:e.getOSVersion()},platform:e.getPlatformType(),session_duration_ms:this.roundToDecimals(t-this.sessionStart)}}addToQueue(e){this.queue.add(e)}initBrowserMetrics(){const e=this.addToQueue.bind(this);q(e),W(e),ne(e),oe(e),ce(e)}roundToDecimals(e,t=1){const i=Math.pow(10,t);return Math.round(e*i)/i}}typeof window.DebugHawkConfig<"u"&&new pe(window.DebugHawkConfig)})();
     6 */class me{static getParser(e,t=!1){if(typeof e!="string")throw new Error("UserAgent should be a string");return new X(e,t)}static parse(e){return new X(e).getResult()}static get BROWSER_MAP(){return Z}static get ENGINE_MAP(){return w}static get OS_MAP(){return h}static get PLATFORMS_MAP(){return l}}class pe{constructor(e){this.beaconSent=!1,this.config=e,this.sessionStart=performance.now(),this.timestamp_ms=Math.floor(Date.now()),this.queue=new Set,this.shouldSendBeacon()&&(this.initBrowserMetrics(),addEventListener("visibilitychange",()=>this.sendBeacon()))}shouldSendBeacon(){const e=Number(this.config.sample_rate);return e<0||e>1?(console.warn("DebugHawk: Invalid sampling rate, defaulting to sending metrics"),!0):e===1?!0:e===0?!1:Math.random()<e}sendBeacon(){if(this.beaconSent||typeof window.DebugHawk>"u"||document.visibilityState==="visible")return;const e=this.preparePayload(),t=JSON.stringify(e);this.shouldUseBeaconApi()?(navigator.sendBeacon(this.config.endpoint,t),this.beaconSent=!0):(this.beaconSent=!0,fetch(this.config.endpoint,{method:"POST",body:t,keepalive:!0}).catch(i=>{console.warn("DebugHawk: Fetch error",i)}))}shouldUseBeaconApi(){return this.isBraveBrowser()?!1:"sendBeacon"in navigator}isBraveBrowser(){return"brave"in navigator}preparePayload(){return{server:window.DebugHawk,browser:this.getBrowserMetrics(),user:this.getUserInfo()}}getBrowserMetrics(){let e={title:document.title,requests:this.processNetworkRequests(),timestamp_ms:this.timestamp_ms};return this.queue.forEach(t=>{const i=t.name.toLowerCase();if(i!=="cls"?e[i+"_ms"]=this.roundToDecimals(t.value):e[i]=this.roundToDecimals(t.value,5),i==="ttfb"&&t.entries[0]){const n=this.calculateTtfbMetrics(t.entries[0]);Object.assign(e,n)}}),e}calculateTtfbMetrics(e){let t={};return e.domainLookupStart&&e.connectStart&&(t.dns_ms=this.roundToDecimals(e.connectStart-e.domainLookupStart)),e.connectStart&&e.connectEnd&&(t.connect_ms=this.roundToDecimals(e.connectEnd-e.connectStart)),e.decodedBodySize&&(t.html_body_size=e.decodedBodySize),e.encodedBodySize&&(t.html_transfer_size=e.encodedBodySize),t}processNetworkRequests(){const e=new Set;performance.getEntriesByType("navigation").forEach(i=>e.add(this.processPerformanceEntry(i))),performance.getEntriesByType("resource").forEach(i=>e.add(this.processPerformanceEntry(i)));let t={count:e.size,total_body_size:0,total_transfer_size:0,by_type:{},by_domain:{},by_component:{}};return e.forEach(i=>{t.total_body_size+=i.body_size||0,t.total_transfer_size+=i.transfer_size||0,t.by_type[i.type]||(t.by_type[i.type]={count:0,blocking:0,body_size:0,transfer_size:0}),t.by_type[i.type].count++,t.by_type[i.type].body_size+=i.body_size||0,t.by_type[i.type].transfer_size+=i.transfer_size||0,i.blocking&&t.by_type[i.type].blocking++;const n=this.getDomainFromUrl(i.url);if(t.by_domain[n]||(t.by_domain[n]={count:0,blocking:0,body_size:0,transfer_size:0}),t.by_domain[n].count++,t.by_domain[n].body_size+=i.body_size||0,t.by_domain[n].transfer_size+=i.transfer_size||0,i.blocking&&t.by_domain[n].blocking++,!this.isWithin(i.url,this.config.urls.home)||i.type==="html"||i.type==="other"||i.type==="xhr")return;const o=this.getComponentFromNetworkRequest(i);t.by_component[o]||(t.by_component[o]={}),t.by_component[o][i.type]||(t.by_component[o][i.type]={count:0,blocking:0,body_size:0,transfer_size:0}),t.by_component[o][i.type].count++,t.by_component[o][i.type].body_size+=i.body_size||0,t.by_component[o][i.type].transfer_size+=i.transfer_size||0,i.blocking&&t.by_component[o][i.type].blocking++}),t}processPerformanceEntry(e){return{url:e.name,type:this.getTypeFromPerformanceEntry(e),body_size:e.decodedBodySize,transfer_size:e.encodedBodySize,blocking:e.renderBlockingStatus==="blocking",status:e.responseStatus}}getComponentFromNetworkRequest(e){return this.isWithin(e.url,this.config.urls.plugin)?`plugin:${e.url.slice(this.config.urls.plugin.length).split("/")[0]}`:this.isWithin(e.url,this.config.urls.theme)?`theme:${e.url.slice(this.config.urls.theme.length).split("/")[0]}`:this.isWithin(e.url,this.config.urls.admin)||this.isWithin(e.url,this.config.urls.includes)?"core":this.isWithin(e.url,this.config.urls.uploads)?"upload":"other"}isWithin(e,t){const i=t.endsWith("/")?t:t+"/";return e===t||e.startsWith(i)}getDomainFromUrl(e){try{return new URL(e).hostname}catch{return"unknown"}}getFileExtensionFromUrl(e){try{const i=new URL(e).pathname,n=i.lastIndexOf(".");if(n===-1||n===i.length-1)return"";const o=i.substring(n+1);return o.includes("/")?"":o.toLowerCase()}catch{return""}}getTypeFromPerformanceEntry(e){if(e.initiatorType==="navigation"||e.initiatorType==="iframe")return"html";if(e.initiatorType==="script")return"js";if(e.initiatorType==="img")return"img";if(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")return"xhr";const t=this.getFileExtensionFromUrl(e.name);return{css:"css",js:"js",mjs:"js",woff:"font",woff2:"font",ttf:"font",otf:"font",eot:"font",png:"img",jpg:"img",jpeg:"img",gif:"img",svg:"img",webp:"img",ico:"img",avif:"img",mp4:"media",webm:"media",ogv:"media",mp3:"media",ogg:"media",wav:"media",flac:"media"}[t]||"other"}getUserInfo(){var i,n;const e=me.getParser(window.navigator.userAgent),t=performance.now();return{browser:{name:this.isBraveBrowser()?"Brave":e.getBrowserName(),version:this.isBraveBrowser()?null:e.getBrowserVersion(),viewport:{width:((i=window.visualViewport)==null?void 0:i.width)??null,height:((n=window.visualViewport)==null?void 0:n.height)??null}},os:{name:e.getOSName(),version:e.getOSVersion()},platform:e.getPlatformType(),session_duration_ms:this.roundToDecimals(t-this.sessionStart)}}addToQueue(e){this.queue.add(e)}initBrowserMetrics(){const e=this.addToQueue.bind(this);q(e),V(e),ne(e),oe(e),ce(e)}roundToDecimals(e,t=1){const i=Math.pow(10,t);return Math.round(e*i)/i}}typeof window.DebugHawkConfig<"u"&&new pe(window.DebugHawkConfig)})();
  • debughawk/tags/1.3.0/resources/src/beacon.ts

    r3372612 r3783821  
    5454            this.beaconSent = true;
    5555        } else {
     56            // Marked as sent straight away, so another visibilitychange before
     57            // the request finishes doesn't send it twice.
     58            this.beaconSent = true;
     59
     60            // No JSON Content-Type: a plain-text body, like sendBeacon's, keeps
     61            // this a simple request with no CORS preflight while the page closes.
    5662            fetch(this.config.endpoint, {
    5763                method: 'POST',
    5864                body: payloadJson,
    5965                keepalive: true,
    60                 headers: {
    61                     'Content-Type': 'application/json'
    62                 }
    63             })
    64                 .then(() => {
    65                     this.beaconSent = true;
    66                 })
    67                 .catch(error => {
    68                     console.warn('DebugHawk: Fetch error', error);
    69                 });
     66            }).catch(error => {
     67                console.warn('DebugHawk: Fetch error', error);
     68            });
    7069        }
    7170    }
    … …  
    197196            }
    198197
    199             if (!request.url.startsWith(this.config.urls.home)) {
     198            if (!this.isWithin(request.url, this.config.urls.home)) {
    200199                return;
    201200            }
    … …  
    244243
    245244    private getComponentFromNetworkRequest(networkRequest: NetworkRequest): string {
    246         if (networkRequest.url.startsWith(this.config.urls.plugin)) {
     245        if (this.isWithin(networkRequest.url, this.config.urls.plugin)) {
    247246            const pluginName = networkRequest.url.slice(this.config.urls.plugin.length).split('/')[0];
    248247
    … …  
    250249        }
    251250
    252         if (networkRequest.url.startsWith(this.config.urls.theme)) {
     251        if (this.isWithin(networkRequest.url, this.config.urls.theme)) {
    253252            const themeName = networkRequest.url.slice(this.config.urls.theme.length).split('/')[0];
    254253
    … …  
    256255        }
    257256
    258         if (networkRequest.url.startsWith(this.config.urls.admin) || networkRequest.url.startsWith(this.config.urls.includes)) {
     257        if (this.isWithin(networkRequest.url, this.config.urls.admin) || this.isWithin(networkRequest.url, this.config.urls.includes)) {
    259258            return 'core';
    260259        }
    261260
    262         if (networkRequest.url.startsWith(this.config.urls.uploads)) {
     261        if (this.isWithin(networkRequest.url, this.config.urls.uploads)) {
    263262            return 'upload';
    264263        }
    265264
    266265        return 'other';
     266    }
     267
     268    /**
     269     * Whether a URL is a base URL or inside it. The base is compared as a
     270     * directory, so https://example.com doesn't match
     271     * https://example.com.evil.com, and .../uploads doesn't match .../uploads-old.
     272     */
     273    private isWithin(url: string, base: string): boolean {
     274        const directory = base.endsWith('/') ? base : base + '/';
     275
     276        return url === base || url.startsWith(directory);
    267277    }
    268278
  • debughawk/tags/1.3.0/src/Backtrace.php

    r3358840 r3783821  
    3232        ];
    3333
     34        /** wpdb drop-in classes, reported as wpdb. */
     35        protected const WPDB_DROPINS = [ 'DebugHawkDB', 'QM_DB' ];
     36
     37        /** Path prefixes, rebuilt only when the directories they came from change. */
     38        protected static ?array $prefixes = null;
     39
     40        protected static ?array $prefixes_directories = null;
     41
    3442        public function __construct( ?array $trace = null ) {
    3543                if ( is_null( $trace ) ) {
    … …  
    4048        }
    4149
     50        /**
     51         * Finds the code responsible for the current call (a query or request).
     52         *
     53         * Walks the stack from the innermost frame outward and returns the first
     54         * frame whose file belongs to a plugin, mu-plugin, theme or other
     55         * wp-content code: the line where that code called into WordPress or
     56         * wpdb. Core files, DebugHawk itself, the db.php drop-in and files outside
     57         * WordPress (such as Composer libraries) are skipped, so the call is
     58         * attributed to the plugin or theme that made it however it got there,
     59         * including from hook callbacks.
     60         *
     61         * A hook dispatch is a boundary: if the walk reaches one before finding
     62         * any such frame, the call was made by a hook callback made only of core
     63         * code (such as a core callback on wp_head, fired from a theme's
     64         * header.php), so it's attributed to core rather than to whoever fired
     65         * the hook. The hooks DebugHawk itself listens on, at the start of the
     66         * stack, don't count.
     67         *
     68         * Only when no such frame exists is the call attributed to core.
     69         */
    4270        public function parse(): ?array {
    43                 $found_frame = null;
    44 
    45                 foreach ( $this->trace as $frame ) {
    46                         if ( isset( $frame['class'] ) && in_array( $frame['class'], $this->ignored_classes ) ) {
     71                $prefixes    = $this->prefixes();
     72                $trace       = array_values( $this->trace );
     73                $core_index  = null;
     74                $other       = null;
     75                $in_plumbing = true;
     76
     77                foreach ( $trace as $index => $frame ) {
     78                        $is_ignored = $this->is_ignored( $frame );
     79
     80                        if ( $core_index === null && ! $is_ignored ) {
     81                                $core_index = $index;
     82                        }
     83
     84                        // The frames at the start are DebugHawk, the hook it listens on and
     85                        // wpdb or WP_Http. The first frame after them is where the caller is.
     86                        if ( $in_plumbing && ! $is_ignored ) {
     87                                $in_plumbing = false;
     88                        }
     89
     90                        if ( ! empty( $frame['file'] ) ) {
     91                                $component = $this->classify( $frame['file'], $prefixes );
     92
     93                                if ( $component !== null && $component['component'] === 'other' ) {
     94                                        // Drop-ins such as object-cache.php usually run on behalf of a
     95                                        // plugin or theme further out, so they're only a fallback.
     96                                        $other = $other ?? $this->describe( $frame, $component );
     97                                } elseif ( $component !== null && $component['component'] !== 'core' ) {
     98                                        return $this->describe( $frame, $component );
     99                                }
     100                        }
     101
     102                        if ( ! $in_plumbing && $this->is_hook_dispatch( $frame ) ) {
     103                                break;
     104                        }
     105                }
     106
     107                if ( $other !== null ) {
     108                        return $other;
     109                }
     110
     111                return $core_index !== null
     112                        ? $this->describe_core( $trace, $core_index, $prefixes )
     113                        : null;
     114        }
     115
     116        /**
     117         * Describes the most useful place in core: the first frame outside the
     118         * hook, HTTP and wpdb plumbing. When that frame is a hook callback, its
     119         * file and line are WP_Hook's, so they're taken from inside the callback
     120         * instead (where it made its next call), keeping the callback as the
     121         * function.
     122         */
     123        protected function describe_core( array $trace, int $index, array $prefixes ): ?array {
     124                $frame    = $trace[ $index ];
     125                $location = $frame;
     126
     127                if ( $index > 0 && ! empty( $trace[ $index - 1 ]['file'] ) && $this->is_hook_dispatch( $trace[ $index + 1 ] ?? [] ) ) {
     128                        $location = $trace[ $index - 1 ];
     129                }
     130
     131                foreach ( [ $location, $frame ] as $candidate ) {
     132                        if ( empty( $candidate['file'] ) ) {
    47133                                continue;
    48134                        }
    49135
    50                         if ( isset( $frame['function'] ) && in_array( $frame['function'], $this->ignored_functions ) ) {
     136                        $component = $this->classify( $candidate['file'], $prefixes );
     137
     138                        if ( $component !== null ) {
     139                                return $this->describe( $frame, $component, $candidate );
     140                        }
     141                }
     142
     143                return null;
     144        }
     145
     146        protected function is_hook_dispatch( array $frame ): bool {
     147                return ( $frame['class'] ?? null ) === 'WP_Hook'
     148                        && in_array( $frame['function'] ?? null, [ 'apply_filters', 'do_action', 'do_all_hook' ], true );
     149        }
     150
     151        protected function is_ignored( array $frame ): bool {
     152                if ( isset( $frame['class'] ) && in_array( $frame['class'], $this->ignored_classes, true ) ) {
     153                        return true;
     154                }
     155
     156                return isset( $frame['function'] ) && in_array( $frame['function'], $this->ignored_functions, true );
     157        }
     158
     159        /**
     160         * @return array{component: string, slug: ?string}|null Null for files that
     161         *                                                      are never responsible.
     162         */
     163        protected function classify( string $file, array $prefixes ): ?array {
     164                $path = DIRECTORY_SEPARATOR === '\\' ? str_replace( '\\', '/', $file ) : $file;
     165
     166                $match = $this->match_prefix( $path, $prefixes );
     167
     168                // A symlinked plugin outside every known directory: WordPress records
     169                // where its real path maps to, so try again with that.
     170                if ( $match === false ) {
     171                        foreach ( $GLOBALS['wp_plugin_paths'] ?? [] as $plugin_path => $real_path ) {
     172                                if ( strpos( $path, $real_path . '/' ) === 0 ) {
     173                                        $match = $this->match_prefix( $plugin_path . substr( $path, strlen( $real_path ) ), $prefixes );
     174                                        break;
     175                                }
     176                        }
     177                }
     178
     179                return $match === false ? null : $match;
     180        }
     181
     182        /**
     183         * @return array{component: string, slug: ?string}|false|null The component,
     184         *         false if no prefix matched, or null for files that are never responsible.
     185         */
     186        protected function match_prefix( string $path, array $prefixes ) {
     187                // Longest prefix first, so the most specific directory wins.
     188                foreach ( $prefixes as [ $prefix, $component, $slug ] ) {
     189                        if ( strpos( $path, $prefix ) !== 0 ) {
    51190                                continue;
    52191                        }
    53192
    54                         $found_frame = $frame;
    55                         break;
    56                 }
    57 
    58                 return $found_frame
    59                         ? $this->determine_component( $found_frame )
    60                         : null;
    61         }
    62 
    63         protected function determine_component( array $frame ): ?array {
    64                 if ( empty( $frame['file'] ) ) {
     193                        if ( $component === null ) {
     194                                return null;
     195                        }
     196
     197                        return [
     198                                'component' => $component,
     199                                'slug'      => $slug ?? $this->slug( $component, substr( $path, strlen( $prefix ) ) ),
     200                        ];
     201                }
     202
     203                return false;
     204        }
     205
     206        /**
     207         * The first path segment under the plugins or theme directory: the plugin
     208         * or theme folder, or the file name for a single-file plugin.
     209         */
     210        protected function slug( string $component, string $relative_path ): ?string {
     211                if ( $component !== 'plugin' && $component !== 'theme' ) {
    65212                        return null;
    66213                }
    67214
    68                 $component = null;
    69 
    70                 foreach ( $this->component_dirs() as $type => $dir ) {
    71                         if ( strpos( $frame['file'], trailingslashit( $dir ) ) === 0 ) {
    72                                 $component = $type;
    73                                 break;
    74                         }
    75                 }
    76 
    77                 if ( ! $component ) {
    78                         return null;
    79                 }
    80 
    81                 $component = in_array( $component, [ 'stylesheet', 'template' ] ) ? 'theme' : $component;
     215                $slash = strpos( $relative_path, '/' );
     216
     217                return $slash === false ? $relative_path : substr( $relative_path, 0, $slash );
     218        }
     219
     220        /**
     221         * @param array|null $location The frame to take the file and line from,
     222         *                             if not the frame itself.
     223         */
     224        protected function describe( array $frame, array $component, ?array $location = null ): array {
     225                $class    = $frame['class'] ?? null;
     226                $location = $location ?? $frame;
     227
     228                if ( in_array( $class, self::WPDB_DROPINS, true ) ) {
     229                        $class = 'wpdb';
     230                }
    82231
    83232                return array_filter( [
    84                         'component' => $component,
    85                         'file'      => $frame['file'],
    86                         'line'      => $frame['line'] ?? null,
     233                        'component' => $component['component'],
     234                        'file'      => $location['file'],
     235                        'line'      => $location['line'] ?? null,
    87236                        'function'  => $frame['function'] ?? null,
    88                         'class'     => $frame['class'] ?? null,
    89                         'slug'      => $this->determine_slug( $component, $frame['file'] ),
     237                        'class'     => $class,
     238                        'slug'      => $component['slug'],
    90239                ] );
    91240        }
    92241
    93         protected function component_dirs(): array {
     242        /**
     243         * The directories WordPress code lives in, from its constants and globals,
     244         * so any layout works: WordPress in a subdirectory, a moved wp-content,
     245         * plugins or mu-plugins directory, or extra theme directories.
     246         */
     247        protected function directories(): array {
     248                $content     = defined( 'WP_CONTENT_DIR' ) ? WP_CONTENT_DIR : null;
     249                $theme_roots = $GLOBALS['wp_theme_directories'] ?? [];
     250
     251                if ( ! $theme_roots && $content !== null ) {
     252                        $theme_roots = [ $content . '/themes' ];
     253                }
     254
    94255                return [
    95                         'plugin'     => WP_PLUGIN_DIR,
    96                         'mu-plugin'  => WPMU_PLUGIN_DIR,
    97                         'stylesheet' => get_stylesheet_directory(),
    98                         'template'   => get_template_directory(),
    99                         'other'      => WP_CONTENT_DIR,
    100                         'core'       => ABSPATH,
     256                        'abspath'     => defined( 'ABSPATH' ) ? ABSPATH : null,
     257                        'content'     => $content,
     258                        'plugins'     => defined( 'WP_PLUGIN_DIR' ) ? WP_PLUGIN_DIR : null,
     259                        'mu_plugins'  => defined( 'WPMU_PLUGIN_DIR' ) ? WPMU_PLUGIN_DIR : null,
     260                        'theme_roots' => array_values( $theme_roots ),
     261                        'debughawk'   => dirname( __DIR__ ),
    101262                ];
    102263        }
    103264
    104         protected function determine_slug( string $component, string $file ): ?string {
    105                 if ( $component === 'plugin' ) {
    106                         return $this->determine_plugin_slug( $file );
    107                 }
    108 
    109                 if ( $component === 'theme' ) {
    110                         return $this->determine_theme_slug( $file );
    111                 }
    112 
    113                 return null;
    114         }
    115 
    116         protected function determine_plugin_slug( string $file ): ?string {
    117                 $plugin = plugin_basename( $file );
    118 
    119                 if ( strpos( $plugin, '/' ) ) {
    120                         $plugin = explode( '/', $plugin );
    121                         $plugin = reset( $plugin );
    122                 } else {
    123                         $plugin = basename( $plugin );
    124                 }
    125 
    126                 return $plugin;
    127         }
    128 
    129         protected function determine_theme_slug( string $file ): ?string {
    130                 $theme_root = get_theme_root();
    131 
    132                 if ( strpos( $file, $theme_root ) !== 0 ) {
    133                         return null;
    134                 }
    135 
    136                 $relative_path = str_replace( trailingslashit( $theme_root ), '', $file );
    137                 $parts         = explode( '/', $relative_path );
    138 
    139                 return $parts[0] ?? null;
     265        /**
     266         * Path prefixes, longest first, each with its component (null for files
     267         * that are never responsible) and a fixed slug where the path can't give one.
     268         *
     269         * @return array<int, array{0: string, 1: ?string, 2: ?string}>
     270         */
     271        protected function prefixes(): array {
     272                $directories = $this->directories();
     273
     274                if ( self::$prefixes !== null && self::$prefixes_directories === $directories ) {
     275                        return self::$prefixes;
     276                }
     277
     278                $prefixes = $this->directory_prefixes( $directories['debughawk'], null );
     279
     280                if ( $directories['content'] !== null ) {
     281                        array_push(
     282                                $prefixes,
     283                                ...$this->file_prefixes( $directories['content'] . '/db.php', null ),
     284                                ...$this->directory_prefixes( $directories['content'], 'other' )
     285                        );
     286                }
     287
     288                if ( $directories['plugins'] !== null ) {
     289                        array_push(
     290                                $prefixes,
     291                                ...$this->directory_prefixes( $directories['plugins'], 'plugin' ),
     292                                ...$this->symlink_prefixes( $directories['plugins'], 'plugin' )
     293                        );
     294                }
     295
     296                if ( $directories['mu_plugins'] !== null ) {
     297                        array_push(
     298                                $prefixes,
     299                                ...$this->directory_prefixes( $directories['mu_plugins'], 'mu-plugin' ),
     300                                ...$this->symlink_prefixes( $directories['mu_plugins'], 'mu-plugin' )
     301                        );
     302                }
     303
     304                foreach ( $directories['theme_roots'] as $theme_root ) {
     305                        array_push(
     306                                $prefixes,
     307                                ...$this->directory_prefixes( $theme_root, 'theme' ),
     308                                ...$this->symlink_prefixes( $theme_root, 'theme' )
     309                        );
     310                }
     311
     312                if ( $directories['abspath'] !== null ) {
     313                        array_push( $prefixes, ...$this->directory_prefixes( $directories['abspath'], 'core' ) );
     314                }
     315
     316                // Longest first. On a tie, files that are never responsible win, so
     317                // DebugHawk is skipped even when it's a symlinked plugin itself.
     318                usort( $prefixes, static function ( array $a, array $b ): int {
     319                        return ( strlen( $b[0] ) <=> strlen( $a[0] ) ) ?: ( ( $a[1] !== null ) <=> ( $b[1] !== null ) );
     320                } );
     321
     322                self::$prefixes_directories = $directories;
     323
     324                return self::$prefixes = $prefixes;
     325        }
     326
     327        /**
     328         * A directory as a prefix with a trailing slash, plus its real path if
     329         * it's symlinked, since PHP reports real paths in backtraces.
     330         */
     331        protected function directory_prefixes( string $directory, ?string $component ): array {
     332                $prefixes = [];
     333
     334                foreach ( array_unique( [ $directory, (string) realpath( $directory ) ] ) as $path ) {
     335                        if ( $path !== '' ) {
     336                                $prefixes[] = [ rtrim( str_replace( '\\', '/', $path ), '/' ) . '/', $component, null ];
     337                        }
     338                }
     339
     340                return $prefixes;
     341        }
     342
     343        /**
     344         * A single file, plus its real path if it's symlinked.
     345         */
     346        protected function file_prefixes( string $file, ?string $component ): array {
     347                $prefixes = [];
     348
     349                foreach ( array_unique( [ $file, (string) realpath( $file ) ] ) as $path ) {
     350                        if ( $path !== '' ) {
     351                                $prefixes[] = [ str_replace( '\\', '/', $path ), $component, null ];
     352                        }
     353                }
     354
     355                return $prefixes;
     356        }
     357
     358        /**
     359         * Real paths of symlinked plugins, themes or mu-plugins in a directory,
     360         * so each gets its folder or file name as its slug. WordPress records
     361         * symlinked plugins in $wp_plugin_paths, but not themes or mu-plugins
     362         * (which managed hosts often symlink), and its mapping names a symlinked
     363         * single-file plugin after its target.
     364         */
     365        protected function symlink_prefixes( string $directory, string $component ): array {
     366                $entries = is_dir( $directory ) ? scandir( $directory ) : false;
     367
     368                if ( ! $entries ) {
     369                        return [];
     370                }
     371
     372                $prefixes = [];
     373
     374                foreach ( $entries as $entry ) {
     375                        $path = $directory . '/' . $entry;
     376
     377                        if ( $entry === '.' || $entry === '..' || ! is_link( $path ) ) {
     378                                continue;
     379                        }
     380
     381                        $real_path = realpath( $path );
     382
     383                        if ( $real_path === false ) {
     384                                continue;
     385                        }
     386
     387                        $real_path = str_replace( '\\', '/', $real_path );
     388
     389                        $prefixes[] = [
     390                                is_dir( $real_path ) ? rtrim( $real_path, '/' ) . '/' : $real_path,
     391                                $component,
     392                                $component === 'mu-plugin' ? null : $entry,
     393                        ];
     394                }
     395
     396                return $prefixes;
    140397        }
    141398}
  • debughawk/tags/1.3.0/src/CollectorManager.php

    r3318985 r3783821  
    2424        }
    2525
     26        /**
     27         * Runs every collector. One that fails is sent as null rather than
     28         * stopping the rest, since this runs while the page is being output.
     29         */
    2630        public function gather(): array {
    2731                $data = [];
    2832
    2933                foreach ( $this->collectors as $collector ) {
    30                         $data[ $collector->key ] = $collector->gather();
     34                        try {
     35                                $data[ $collector->key ] = $collector->gather();
     36                        } catch ( \Throwable $e ) {
     37                                $data[ $collector->key ] = null;
     38
     39                                Util::log_error( sprintf( 'The %s collector failed: %s', $collector->key, $e->getMessage() ) );
     40                        }
    3141                }
    3242
  • debughawk/tags/1.3.0/src/Collectors/DatabaseCollector.php

    r3318985 r3783821  
    55use DebugHawk\Backtrace;
    66use DebugHawk\NeedsInitiatingInterface;
     7use DebugHawk\QueryNormalizer;
    78use DebugHawk\Util;
    89
    … …  
    1011        public string $key = 'database';
    1112
     13        /** Normalized SQL longer than this is truncated before sending. */
     14        protected const MAX_SQL_LENGTH = 2048;
     15
    1216        protected ?float $execution_time = null;
    1317
     18        /** The slowest queries, up to slow_queries_limit of them. */
    1419        protected ?array $slow_queries = null;
    1520
     21        /** How many slow queries ran, including ones not kept. */
     22        protected ?int $slow_query_count = null;
     23
     24        /** The fastest kept query's duration, once the list is full. */
     25        protected ?float $fastest_kept_time = null;
     26
    1627        protected ?array $query_types = null;
    1728
     29        /** Whether the DebugHawk drop-in is keeping running totals of every query. */
     30        protected bool $uses_dropin_stats = false;
     31
     32        /** Read once from the config, as the fallback path checks it for every query. */
     33        protected float $slow_threshold_seconds = 0.0;
     34
     35        protected int $slow_queries_limit = 0;
     36
    1837        public function init(): void {
    19                 add_filter( 'log_query_custom_data', [ $this, 'track_slow_queries' ], 10, 5 );
     38                global $wpdb;
     39
     40                $this->slow_threshold_seconds = (float) $this->config->slow_queries_threshold / 1000;
     41                $this->slow_queries_limit     = max( 0, (int) $this->config->slow_queries_limit );
     42
     43                if ( isset( $wpdb ) && property_exists( $wpdb, 'debughawk_stats' ) ) {
     44                        // The drop-in counts every query itself and only calls back for slow ones.
     45                        $this->uses_dropin_stats            = true;
     46                        $wpdb->debughawk_slow_threshold     = $this->slow_threshold_seconds;
     47                        $wpdb->debughawk_slow_query_handler = [ $this, 'track_slow_query' ];
     48
     49                        return;
     50                }
     51
     52                // Older DebugHawk drop-ins, Query Monitor's drop-in and SAVEQUERIES store
     53                // every query in $wpdb->queries and pass each one through this filter.
     54                add_filter( 'log_query_custom_data', [ $this, 'track_logged_query' ], 10, 5 );
    2055        }
    2156
    … …  
    2358                global $wpdb;
    2459
    25                 $this->parse_queries();
     60                if ( $this->uses_dropin_stats ) {
     61                        $this->read_dropin_stats();
     62                } else {
     63                        $this->parse_queries();
     64                }
     65
     66                $slow_queries = null;
    2667
    2768                if ( is_array( $this->slow_queries ) ) {
    28                         usort( $this->slow_queries, static function ( $a, $b ) {
     69                        $slow_queries = $this->slow_queries;
     70
     71                        usort( $slow_queries, static function ( $a, $b ) {
    2972                                return $b['duration_ms'] <=> $a['duration_ms'];
    3073                        } );
     74
     75                        $slow_queries = array_map( [ $this, 'normalize_slow_query' ], $slow_queries );
    3176                }
    3277
    … …  
    3479                        'duration_ms'      => $this->execution_time,
    3580                        'query_count'      => $wpdb->num_queries ?? null,
    36                         'slow_query_count' => is_array( $this->slow_queries )
    37                                 ? count( $this->slow_queries )
    38                                 : null,
    39                         'slow_queries'     => is_array( $this->slow_queries )
    40                                 ? array_slice( $this->slow_queries, 0, $this->config->slow_queries_limit )
    41                                 : null,
     81                        'slow_query_count' => $this->slow_query_count,
     82                        'slow_queries'     => $slow_queries,
    4283                        'query_types'      => $this->query_types,
    4384                ];
    4485        }
    4586
    46         public function track_slow_queries( $query_data, $query, $query_time, $query_callstack, $query_start ): array {
    47                 $query_time = Util::seconds_to_milliseconds( $query_time );
    48 
    49                 if ( $query_time > $this->config->slow_queries_threshold ) {
    50                         $query = trim( $query );
    51 
    52                         if ( is_null( $this->slow_queries ) ) {
    53                                 $this->slow_queries = [];
     87        /**
     88         * Called by the drop-in for queries over the slow threshold.
     89         */
     90        public function track_slow_query( string $query, float $query_time, float $query_start ): void {
     91                $this->add_slow_query( $query, Util::seconds_to_milliseconds( $query_time ), $query_start );
     92        }
     93
     94        /**
     95         * Called for every query when queries are stored in $wpdb->queries.
     96         */
     97        public function track_logged_query( $query_data, $query, $query_time, $query_callstack, $query_start ) {
     98                // Compare in seconds, as the drop-in does, so fast queries skip the conversion.
     99                if ( $query_time > $this->slow_threshold_seconds ) {
     100                        $this->add_slow_query( $query, Util::seconds_to_milliseconds( $query_time ), $query_start );
     101                }
     102
     103                return $query_data;
     104        }
     105
     106        /**
     107         * Keeps only the slowest queries, so memory stays flat and queries that
     108         * won't be sent don't pay for a backtrace.
     109         */
     110        protected function add_slow_query( string $query, float $query_time, $query_start ): void {
     111                $limit = $this->slow_queries_limit;
     112
     113                $this->slow_query_count = ( $this->slow_query_count ?? 0 ) + 1;
     114
     115                if ( is_null( $this->slow_queries ) ) {
     116                        $this->slow_queries = [];
     117                }
     118
     119                // Once the list is full, only a slower query can get in. On a tie, the
     120                // earlier query stays, as it did when the whole list was sorted.
     121                if ( count( $this->slow_queries ) >= $limit && ( $limit === 0 || $query_time <= $this->fastest_kept_time ) ) {
     122                        return;
     123                }
     124
     125                $query      = trim( $query );
     126                $backtrace  = new Backtrace();
     127                $query_type = $this->determine_query_type( $query );
     128
     129                $this->slow_queries[] = [
     130                        // Raw SQL, normalized in gather() before anything is sent.
     131                        'sql'         => $query,
     132                        'start_time'  => $query_start,
     133                        'duration_ms' => $query_time,
     134                        'type'        => $query_type,
     135                        'backtrace'   => $backtrace->parse(),
     136                ];
     137
     138                if ( count( $this->slow_queries ) > $limit ) {
     139                        $this->drop_fastest_slow_query();
     140                }
     141
     142                if ( count( $this->slow_queries ) === $limit ) {
     143                        $this->fastest_kept_time = min( array_column( $this->slow_queries, 'duration_ms' ) );
     144                }
     145        }
     146
     147        /**
     148         * On a tie, drops the most recent query, which a stable sort puts last.
     149         */
     150        protected function drop_fastest_slow_query(): void {
     151                $fastest = null;
     152
     153                foreach ( $this->slow_queries as $index => $slow_query ) {
     154                        if ( $fastest === null || $slow_query['duration_ms'] <= $this->slow_queries[ $fastest ]['duration_ms'] ) {
     155                                $fastest = $index;
    54156                        }
    55 
    56                         $backtrace  = new Backtrace();
    57                         $query_type = $this->determine_query_type( $query );
    58 
    59                         $this->slow_queries[] = [
    60                                 'sql'         => strlen( $query ) > 1024
    61                                         ? substr( $query, 0, 1024 )
    62                                         : $query,
    63                                 'sql_hash'    => md5( $query ),
    64                                 'start_time'  => $query_start,
    65                                 'duration_ms' => $query_time,
    66                                 'type'        => $query_type,
    67                                 'backtrace'   => $backtrace->parse(),
     157                }
     158
     159                unset( $this->slow_queries[ $fastest ] );
     160
     161                $this->slow_queries = array_values( $this->slow_queries );
     162        }
     163
     164        /**
     165         * Replaces literal values so they never leave the site.
     166         */
     167        protected function normalize_slow_query( array $slow_query ): array {
     168                $sql = QueryNormalizer::normalize( $slow_query['sql'] );
     169
     170                $slow_query['sql']      = Util::truncate( $sql, self::MAX_SQL_LENGTH );
     171                $slow_query['sql_hash'] = md5( $sql );
     172
     173                return $slow_query;
     174        }
     175
     176        protected function read_dropin_stats(): void {
     177                global $wpdb;
     178
     179                $stats = $wpdb->debughawk_stats;
     180
     181                if ( $stats['count'] === 0 ) {
     182                        return;
     183                }
     184
     185                $this->execution_time = Util::seconds_to_milliseconds( $stats['time'] );
     186                $this->query_types    = array_map( static function ( array $type ): array {
     187                        return [
     188                                'count' => $type['count'],
     189                                'time'  => Util::seconds_to_milliseconds( $type['time'] ),
    68190                        ];
    69                 }
    70 
    71                 return $query_data;
     191                }, $stats['types'] );
    72192        }
    73193
  • debughawk/tags/1.3.0/src/Collectors/OutgoingRequestsCollector.php

    r3318985 r3783821  
    1010        public string $key = 'outgoing_requests';
    1111
     12        /**
     13         * Only the slowest requests are sent, so the payload stays within
     14         * sendBeacon's 64 KB limit however many requests a page makes.
     15         */
     16        protected const MAX_REQUESTS = 20;
     17
    1218        protected array $requests = [];
    1319
     20        /** How many requests were made, including ones not kept. */
     21        protected int $request_count = 0;
     22
     23        /**
     24         * Requests that have started but not finished, newest last, each with the
     25         * URL and method used to match its end.
     26         *
     27         * @var array<int, array{key: int, url: string, method: string}>
     28         */
     29        protected array $in_flight = [];
     30
     31        /**
     32         * Request arguments are never changed: another plugin may key a response
     33         * cache on them. Starting last means a request another plugin answers
     34         * (with a mock or a cached response) is never timed, and ending first
     35         * means other plugins' http_api_debug callbacks aren't timed with it.
     36         */
    1437        public function init(): void {
    15                 add_filter( 'http_request_args', [ $this, 'make_request_traceable' ], 9999, 2 );
    16                 add_filter( 'pre_http_request', [ $this, 'track_request_start' ], 9999, 3 );
    17                 add_filter( 'http_response', [ $this, 'track_request_end' ], 9999, 3 );
     38                add_filter( 'pre_http_request', [ $this, 'track_request_start' ], PHP_INT_MAX, 3 );
     39                add_action( 'http_api_debug', [ $this, 'track_request_end' ], PHP_INT_MIN, 5 );
    1840        }
    1941
    2042        public function gather(): array {
     43                $requests = array_values( $this->requests );
     44
     45                // Slowest first. Non-blocking requests have no duration, since they
     46                // don't hold up the page, so they go last.
     47                usort( $requests, static function ( $a, $b ) {
     48                        return ( $b['duration_ms'] ?? -1 ) <=> ( $a['duration_ms'] ?? -1 );
     49                } );
     50
    2151                return [
    22                         'request_count' => count( $this->requests ),
     52                        'request_count' => $this->request_count,
    2353                        'requests'      => array_map( static function ( $request ) {
    24                                 $request['url'] = strlen( $request['url'] ) > 256
    25                                         ? substr( $request['url'], 0, 256 )
    26                                         : $request['url'];
     54                                $request['url'] = Util::truncate( $request['url'], 256 );
    2755
    2856                                return $request;
    29                         }, $this->requests ),
     57                        }, array_slice( $requests, 0, self::MAX_REQUESTS ) ),
    3058                ];
    3159        }
    3260
    33         public function make_request_traceable( $args, $url ) {
    34                 $args['_debughawk_request_id'] = uniqid( 'http_', true );
    35 
    36                 return $args;
    37         }
    38 
    3961        public function track_request_start( $preempt, $args, $url ) {
    40                 $request_id = $args['_debughawk_request_id'] ?? null;
    41 
    42                 if ( ! $request_id ) {
     62                // Another plugin answered it, so it never goes over the network.
     63                if ( $preempt !== false ) {
    4364                        return $preempt;
    4465                }
    4566
     67                $key    = ++ $this->request_count;
     68                $method = $args['method'] ?? 'GET';
     69
    4670                $backtrace = new Backtrace();
    4771
    48                 $this->requests[ $request_id ] = [
    49                         'url'         => $url,
    50                         'blocking'    => $args['blocking'],
     72                $this->requests[ $key ] = [
     73                        'url'         => Util::redact_url( (string) $url ),
     74                        'blocking'    => $args['blocking'] ?? true,
    5175                        'start_time'  => microtime( true ),
    52                         'http_method' => $args['method'] ?? 'GET',
     76                        'http_method' => $method,
    5377                        'backtrace'   => $backtrace->parse(),
     78                ];
     79
     80                $this->in_flight[] = [
     81                        'key'    => $key,
     82                        'url'    => (string) $url,
     83                        'method' => $method,
    5484                ];
    5585
    … …  
    5787        }
    5888
    59         public function track_request_end( $response, $args, $url ) {
    60                 $request_id = $args['_debughawk_request_id'] ?? null;
     89        /**
     90         * Runs on http_api_debug, which fires for every outcome. Failed blocking
     91         * requests, such as timeouts, hold up the page for as long as they take
     92         * but never reach the http_response filter, so they had no duration.
     93         *
     94         * Non-blocking requests return straight away without slowing the page,
     95         * so they're left without a duration.
     96         */
     97        public function track_request_end( $response, $context, $class, $args, $url ): void {
     98                $key = $this->finish_in_flight( (string) $url, $args['method'] ?? 'GET' );
    6199
    62                 if ( ! $request_id || ! isset( $this->requests[ $request_id ] ) ) {
    63                         return $response;
     100                if ( $key === null || ! isset( $this->requests[ $key ] ) || empty( $args['blocking'] ) ) {
     101                        return;
    64102                }
    65103
    66                 $duration = microtime( true ) - $this->requests[ $request_id ]['start_time'];
     104                $duration = microtime( true ) - $this->requests[ $key ]['start_time'];
    67105
    68                 $this->requests[ $request_id ]['duration_ms'] = Util::seconds_to_milliseconds( $duration );
    69                 $this->requests[ $request_id ]['http_status'] = wp_remote_retrieve_response_code( $response );
     106                $this->requests[ $key ]['duration_ms'] = Util::seconds_to_milliseconds( $duration );
    70107
    71                 return $response;
     108                if ( is_wp_error( $response ) ) {
     109                        // Such as "cURL error 28: Operation timed out after 5001 milliseconds".
     110                        $this->requests[ $key ]['error'] = Util::truncate( $response->get_error_message(), 256 );
     111                } else {
     112                        $this->requests[ $key ]['http_status'] = wp_remote_retrieve_response_code( $response );
     113                }
     114
     115                $this->drop_fastest_finished_request();
     116        }
     117
     118        /**
     119         * Finds which in-flight request has ended. Requests through WP_Http never
     120         * overlap, since each call returns only once its request is done, so it's
     121         * the newest one. Preferring a request with the same URL and method means
     122         * an unusual interleaving can't pair an end with the wrong start.
     123         *
     124         * WordPress can empty or change the URL while validating it, before
     125         * failing the request, so with no URL match the newest request with the
     126         * same method is used.
     127         */
     128        protected function finish_in_flight( string $url, string $method ): ?int {
     129                $match = null;
     130
     131                for ( $index = count( $this->in_flight ) - 1; $index >= 0; $index -- ) {
     132                        if ( $this->in_flight[ $index ]['method'] !== $method ) {
     133                                continue;
     134                        }
     135
     136                        if ( $this->in_flight[ $index ]['url'] === $url ) {
     137                                $match = $index;
     138                                break;
     139                        }
     140
     141                        $match = $match ?? $index;
     142                }
     143
     144                if ( $match === null ) {
     145                        return null;
     146                }
     147
     148                $key = $this->in_flight[ $match ]['key'];
     149
     150                array_splice( $this->in_flight, $match, 1 );
     151
     152                return $key;
     153        }
     154
     155        /**
     156         * Keeps memory flat on requests that make many HTTP calls, such as
     157         * imports: once more than MAX_REQUESTS have finished, the fastest goes.
     158         */
     159        protected function drop_fastest_finished_request(): void {
     160                $finished = array_filter( $this->requests, static function ( $request ) {
     161                        return isset( $request['duration_ms'] );
     162                } );
     163
     164                if ( count( $finished ) <= self::MAX_REQUESTS ) {
     165                        return;
     166                }
     167
     168                uasort( $finished, static function ( $a, $b ) {
     169                        return $a['duration_ms'] <=> $b['duration_ms'];
     170                } );
     171
     172                unset( $this->requests[ array_key_first( $finished ) ] );
    72173        }
    73174}
  • debughawk/tags/1.3.0/src/Collectors/RequestCollector.php

    r3318985 r3783821  
    33namespace DebugHawk\Collectors;
    44
    5 use DebugHawk\NeedsInitiatingInterface;
     5use DebugHawk\Util;
    66
    7 class RequestCollector extends Collector implements NeedsInitiatingInterface {
     7class RequestCollector extends Collector {
    88        public string $key = 'request';
    9 
    10         public ?int $http_status_code = null;
    11 
    12         public ?string $redirect_location = null;
    13 
    14         public function init(): void {
    15                 add_filter( 'wp_redirect', [ $this, 'capture_redirect' ], 9999 );
    16                 add_filter( 'wp_redirect_status', [ $this, 'capture_redirect_status' ], 9999 );
    17         }
    189
    1910        public function gather(): array {
    … …  
    2516
    2617                return array_filter( [
    27                         'url'               => sprintf( '%s://%s%s', $scheme, $host, $request_uri ),
    28                         'method'            => $method,
    29                         'status'            => $this->http_status_code ?? http_response_code(),
    30                         'redirect_location' => $this->redirect_location,
    31                         'identifier'        => uniqid(),
    32                         'timestamp_ms'      => date_create()->format( 'Uv' ),
     18                        'url'          => Util::redact_url( sprintf( '%s://%s%s', $scheme, $host, $request_uri ) ),
     19                        'method'       => $method,
     20                        'status'       => http_response_code(),
     21                        'identifier'   => uniqid(),
     22                        // A number, like the browser's timestamp_ms, not a string.
     23                        'timestamp_ms' => (int) floor( microtime( true ) * 1000 ),
    3324                ] );
    3425        }
    35 
    36         public function capture_redirect( $location ) {
    37                 $this->redirect_location = $location;
    38 
    39                 return $location;
    40         }
    41 
    42         public function capture_redirect_status( $status ) {
    43                 $this->http_status_code = $status;
    44 
    45                 return $status;
    46         }
    47 
    48         public function is_redirect(): bool {
    49                 return is_int( $this->http_status_code ) && $this->http_status_code >= 300 && $this->http_status_code < 400;
    50         }
    5126}
  • debughawk/tags/1.3.0/src/Config.php

    r3372612 r3783821  
    1010 * @property string $secret
    1111 * @property boolean $trace_admin_pages
    12  * @property boolean $trace_redirects
    1312 * @property int $slow_queries_threshold
    1413 * @property int $slow_queries_limit
    … …  
    2019                'sample_rate'            => 1,
    2120                'trace_admin_pages'      => true,
    22                 'trace_redirects'        => true,
    2321                'slow_queries_threshold' => 50, // 50 ms
    24                 'slow_queries_limit'     => 3,
     22                'slow_queries_limit'     => 10,
    2523        ];
    2624
    … …  
    6058        }
    6159
    62         public function is_within_sample_range(): bool {
    63                 return random_int( 1, 100 ) <= ( $this->sample_rate * 100 );
    64         }
    65 
    6660        public function to_array(): array {
    6761                $config = [];
  • debughawk/tags/1.3.0/src/Dispatchers/BeaconDispatcher.php

    r3372612 r3783821  
    2222
    2323        public function output_beacon_metrics(): void {
     24                // Without the beacon script nothing sends the payload, so don't spend
     25                // time gathering it. That covers login pages when admin pages aren't
     26                // traced, and embed pages, which never enqueue scripts.
     27                if ( $this->is_excluded_screen() || ! wp_script_is( 'debughawk-beacon', 'enqueued' ) ) {
     28                        return;
     29                }
     30
     31                $payload = $this->gather_and_encrypt();
     32
     33                // Preparing it failed. Without window.DebugHawk the beacon sends nothing,
     34                // rather than an event with no server data.
     35                if ( $payload === '' ) {
     36                        return;
     37                }
     38
    2439                echo '<!-- DebugHawk -->' . "\n\n";
    25                 wp_print_inline_script_tag( "window.DebugHawk = '" . esc_js( $this->gather_and_encrypt() ) . "';" );
     40                wp_print_inline_script_tag( "window.DebugHawk = '" . esc_js( $payload ) . "';" );
    2641        }
    2742
    … …  
    3146                }
    3247
    33                 // Don't dispatch during a Customizer preview request:
    34                 if ( function_exists( 'is_customize_preview' ) && is_customize_preview() ) {
    35                         return false;
    36                 }
    37 
    38                 // Don't dispatch inside the Site Editor:
    39                 if ( isset( $_SERVER['SCRIPT_NAME'] ) && $_SERVER['SCRIPT_NAME'] === '/wp-admin/site-editor.php' ) {
    40                         return false;
    41                 }
    42 
    4348                return apply_filters( 'debughawk_should_output_beacon', true );
    4449        }
    4550
     51        /**
     52         * Screens that aren't real page views. Checked when the page is output,
     53         * not when the plugin loads: the Customizer isn't set up until
     54         * plugins_loaded, so checking any earlier never matched.
     55         */
     56        protected function is_excluded_screen(): bool {
     57                // A Customizer preview.
     58                if ( function_exists( 'is_customize_preview' ) && is_customize_preview() ) {
     59                        return true;
     60                }
     61
     62                // Admin screens shown in an iframe, such as the plugin details modal,
     63                // the theme installer and the media upload screen. Each would
     64                // otherwise be counted as a separate page view.
     65                if ( $this->is_iframe_request() ) {
     66                        return true;
     67                }
     68
     69                // The Site Editor. $pagenow works wherever WordPress is installed,
     70                // unlike matching the script path against /wp-admin/site-editor.php.
     71                return is_admin() && ( $GLOBALS['pagenow'] ?? '' ) === 'site-editor.php';
     72        }
     73
     74        protected function is_iframe_request(): bool {
     75                return defined( 'IFRAME_REQUEST' ) && IFRAME_REQUEST;
     76        }
     77
    4678        public function enqueue_beacon(): void {
     79                if ( $this->is_excluded_screen() ) {
     80                        return;
     81                }
     82
    4783                wp_enqueue_script( 'debughawk-beacon', $this->config->script_url, [], null, [
    4884                        'strategy' => 'async',
  • debughawk/tags/1.3.0/src/Dispatchers/Dispatcher.php

    r3318985 r3783821  
    55use DebugHawk\CollectorManager;
    66use DebugHawk\Config;
    7 use Exception;
     7use DebugHawk\Util;
    88
    99abstract class Dispatcher {
    … …  
    1919        protected function gather_and_encrypt(): string {
    2020                try {
    21                         $payload = json_encode( $this->collectors->gather(), JSON_THROW_ON_ERROR );
     21                        // Invalid UTF-8 (from a URL or SQL, say) is replaced rather than
     22                        // failing the whole payload.
     23                        $payload = json_encode( $this->collectors->gather(), JSON_THROW_ON_ERROR | JSON_INVALID_UTF8_SUBSTITUTE );
    2224
    2325                        $algo  = 'aes-128-ctr';
    … …  
    2830
    2931                        return base64_encode( $iv . $encrypted );
    30                 } catch ( Exception $e ) {
     32                } catch ( \Throwable $e ) {
     33                        // Never break the page DebugHawk is measuring.
     34                        Util::log_error( 'Could not prepare metrics: ' . $e->getMessage() );
     35
    3136                        return '';
    3237                }
  • debughawk/tags/1.3.0/src/Plugin.php

    r3433055 r3783821  
    1111use DebugHawk\Collectors\WordpressCollector;
    1212use DebugHawk\Dispatchers\BeaconDispatcher;
    13 use DebugHawk\Dispatchers\RedirectDispatcher;
    1413
    1514class Plugin {
    … …  
    4847                $dispatchers
    4948                        ->add( new BeaconDispatcher( $this->config, $collectors ) )
    50                         ->add( new RedirectDispatcher( $this->config, $collectors ) )
    5149                        ->init();
    5250        }
  • debughawk/tags/1.3.0/src/Settings.php

    r3433055 r3783821  
    6666                $this->add_settings_field( 'sample_rate', __( 'Sample Rate', 'debughawk' ), 'render_number_field' );
    6767                $this->add_settings_field( 'trace_admin_pages', __( 'Monitor Admin Pages', 'debughawk' ), 'render_checkbox_field' );
    68                 $this->add_settings_field( 'trace_redirects', __( 'Monitor Redirects', 'debughawk' ), 'render_checkbox_field' );
    6968                $this->add_settings_field( 'slow_queries_threshold', __( 'Slow Queries Threshold (ms)', 'debughawk' ), 'render_number_field' );
    7069        }
    … …  
    230229                        'sample_rate'            => __( 'Percentage of requests to monitor (0-1). For example, 0.1 means 10% of requests.', 'debughawk' ),
    231230                        'trace_admin_pages'      => __( 'Also monitor WordPress admin pages.', 'debughawk' ),
    232                         'trace_redirects'        => __( 'Also monitor redirect responses.', 'debughawk' ),
    233231                        'slow_queries_threshold' => __( 'Queries taking longer than this (in milliseconds) will be flagged as slow.', 'debughawk' ),
    234232                ];
    … …  
    259257                $sanitized['sample_rate']            = min( 1, max( 0, floatval( $input['sample_rate'] ?? 1 ) ) );
    260258                $sanitized['trace_admin_pages']      = ! empty( $input['trace_admin_pages'] );
    261                 $sanitized['trace_redirects']        = ! empty( $input['trace_redirects'] );
    262259                $sanitized['slow_queries_threshold'] = max( 0, intval( $input['slow_queries_threshold'] ?? 50 ) );
    263260
  • debughawk/tags/1.3.0/src/Util.php

    r3318985 r3783821  
    77                return round( $seconds * 1000, $precision );
    88        }
     9
     10        /**
     11         * Shortens a string to at most $max_bytes without splitting a UTF-8
     12         * character, which would make it invalid.
     13         */
     14        public static function truncate( string $string, int $max_bytes ): string {
     15                if ( strlen( $string ) <= $max_bytes ) {
     16                        return $string;
     17                }
     18
     19                $end = $max_bytes;
     20
     21                // Back up past continuation bytes (10xxxxxx) to the start of the
     22                // character being cut. UTF-8 characters are at most 4 bytes.
     23                for ( $i = 0; $i < 3 && $end > 0 && ( ord( $string[ $end ] ) & 0xC0 ) === 0x80; $i ++ ) {
     24                        $end --;
     25                }
     26
     27                return substr( $string, 0, $end );
     28        }
     29
     30        /**
     31         * Removes values that could be secret or personal from a URL before it's
     32         * sent: query values (API keys, password reset keys, order keys, search
     33         * terms, emails) become ?, credentials are removed and the fragment is
     34         * dropped. Query keys are kept, so the URL is still recognisable.
     35         *
     36         * For example, https://user:pass@api.example.com/v1/items?key=abc&page=2#top
     37         * becomes https://api.example.com/v1/items?key=?&page=?
     38         */
     39        public static function redact_url( string $url ): string {
     40                $hash = strpos( $url, '#' );
     41
     42                if ( $hash !== false ) {
     43                        $url = substr( $url, 0, $hash );
     44                }
     45
     46                $url = (string) preg_replace( '#^([a-z][a-z0-9+.-]*://)[^/?@]*@#i', '$1', $url );
     47
     48                $question = strpos( $url, '?' );
     49
     50                if ( $question === false ) {
     51                        return $url;
     52                }
     53
     54                $parameters = explode( '&', substr( $url, $question + 1 ) );
     55
     56                foreach ( $parameters as $index => $parameter ) {
     57                        $equals = strpos( $parameter, '=' );
     58
     59                        if ( $equals !== false ) {
     60                                $parameters[ $index ] = substr( $parameter, 0, $equals ) . '=?';
     61                        }
     62                }
     63
     64                return substr( $url, 0, $question + 1 ) . implode( '&', $parameters );
     65        }
     66
     67        /**
     68         * Logs an error when WP_DEBUG is on, so failures are visible while
     69         * debugging without filling production logs.
     70         */
     71        public static function log_error( string $message ): void {
     72                if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
     73                        error_log( 'DebugHawk: ' . $message );
     74                }
     75        }
    976}
  • debughawk/tags/1.3.0/vendor/autoload.php

    r3318985 r3783821  
    2020require_once __DIR__ . '/composer/autoload_real.php';
    2121
    22 return ComposerAutoloaderInitd67bb9a850b07076247c035eb166d44b::getLoader();
     22return ComposerAutoloaderInit99e243e48dfa2f20c2daa51d807bd3a6::getLoader();
  • debughawk/tags/1.3.0/vendor/composer/autoload_real.php

    r3318985 r3783821  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInitd67bb9a850b07076247c035eb166d44b
     5class ComposerAutoloaderInit99e243e48dfa2f20c2daa51d807bd3a6
    66{
    77    private static $loader;
    … …  
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInitd67bb9a850b07076247c035eb166d44b', 'loadClassLoader'), true, true);
     27        spl_autoload_register(array('ComposerAutoloaderInit99e243e48dfa2f20c2daa51d807bd3a6', 'loadClassLoader'), true, true);
    2828        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
    29         spl_autoload_unregister(array('ComposerAutoloaderInitd67bb9a850b07076247c035eb166d44b', 'loadClassLoader'));
     29        spl_autoload_unregister(array('ComposerAutoloaderInit99e243e48dfa2f20c2daa51d807bd3a6', 'loadClassLoader'));
    3030
    3131        require __DIR__ . '/autoload_static.php';
    32         call_user_func(\Composer\Autoload\ComposerStaticInitd67bb9a850b07076247c035eb166d44b::getInitializer($loader));
     32        call_user_func(\Composer\Autoload\ComposerStaticInit99e243e48dfa2f20c2daa51d807bd3a6::getInitializer($loader));
    3333
    3434        $loader->register(true);
  • debughawk/tags/1.3.0/vendor/composer/autoload_static.php

    r3433055 r3783821  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInitd67bb9a850b07076247c035eb166d44b
     7class ComposerStaticInit99e243e48dfa2f20c2daa51d807bd3a6
    88{
    99    public static $prefixLengthsPsr4 = array (
    … …  
    2828    {
    2929        return \Closure::bind(function () use ($loader) {
    30             $loader->prefixLengthsPsr4 = ComposerStaticInitd67bb9a850b07076247c035eb166d44b::$prefixLengthsPsr4;
    31             $loader->prefixDirsPsr4 = ComposerStaticInitd67bb9a850b07076247c035eb166d44b::$prefixDirsPsr4;
    32             $loader->classMap = ComposerStaticInitd67bb9a850b07076247c035eb166d44b::$classMap;
     30            $loader->prefixLengthsPsr4 = ComposerStaticInit99e243e48dfa2f20c2daa51d807bd3a6::$prefixLengthsPsr4;
     31            $loader->prefixDirsPsr4 = ComposerStaticInit99e243e48dfa2f20c2daa51d807bd3a6::$prefixDirsPsr4;
     32            $loader->classMap = ComposerStaticInit99e243e48dfa2f20c2daa51d807bd3a6::$classMap;
    3333
    3434        }, null, ClassLoader::class);
  • debughawk/tags/1.3.0/vendor/composer/installed.php

    r3433055 r3783821  
    22    'root' => array(
    33        'name' => 'debughawk/debughawk-plugin',
    4         'pretty_version' => 'v1.2.0',
    5         'version' => '1.2.0.0',
    6         'reference' => 'fff2867ce754f93f58f85bc52a75c290c7072c82',
     4        'pretty_version' => 'v1.3.0',
     5        'version' => '1.3.0.0',
     6        'reference' => 'b950bd8d753de45a4de05d0b3f43feb529cbeb10',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
    … …  
    1212    'versions' => array(
    1313        'debughawk/debughawk-plugin' => array(
    14             'pretty_version' => 'v1.2.0',
    15             'version' => '1.2.0.0',
    16             'reference' => 'fff2867ce754f93f58f85bc52a75c290c7072c82',
     14            'pretty_version' => 'v1.3.0',
     15            'version' => '1.3.0.0',
     16            'reference' => 'b950bd8d753de45a4de05d0b3f43feb529cbeb10',
    1717            'type' => 'wordpress-plugin',
    1818            'install_path' => __DIR__ . '/../../',
  • debughawk/tags/1.3.0/wp-content/db.php

    r3433055 r3783821  
    55 * Description: Database drop-in for DebugHawk to capture database metrics and slow queries.
    66 * Author: DebugHawk
    7  * Version: 1.2.0
     7 * Version: 1.3.0
    88 * Requires PHP: 7.4
    99 * Requires WP: 6.3
    … …  
    4343
    4444class DebugHawkDB extends wpdb {
     45        /**
     46         * Running totals for every query, read by DebugHawk's database collector.
     47         * Kept as totals rather than in $this->queries, so memory stays flat
     48         * however many queries a request runs.
     49         */
     50        public array $debughawk_stats = [
     51                'count' => 0,
     52                'time'  => 0.0,
     53                'types' => [],
     54        ];
     55
     56        /**
     57         * Queries slower than $debughawk_slow_threshold seconds are passed to this
     58         * callable. Both are set by the plugin once it loads. It's called directly,
     59         * not through an action, so slow query backtraces match those from
     60         * $wpdb->queries and fast queries never touch the hook system.
     61         *
     62         * @var callable|null
     63         */
     64        public $debughawk_slow_query_handler = null;
     65
     66        public float $debughawk_slow_threshold = 0.0;
     67
     68        /**
     69         * Time spent in queries run from inside the current query, such as the
     70         * charset lookup wpdb makes for queries containing non-ASCII text.
     71         */
     72        protected float $debughawk_nested_time = 0.0;
    4573
    4674        public function query( $query ) {
    47                 if ( ! defined( 'SAVEQUERIES' ) || ! SAVEQUERIES ) {
    48                         $this->timer_start();
     75                // Time each call locally: wpdb's shared timer is reset by nested queries.
     76                $outer_nested_time           = $this->debughawk_nested_time;
     77                $this->debughawk_nested_time = 0.0;
     78
     79                $start   = microtime( true );
     80                $result  = parent::query( $query );
     81                $elapsed = microtime( true ) - $start;
     82
     83                // Each query's time excludes its nested queries, which are counted
     84                // separately, so the times add up to the real total.
     85                $query_time                  = $elapsed - $this->debughawk_nested_time;
     86                $this->debughawk_nested_time = $outer_nested_time + $elapsed;
     87
     88                $type = preg_match( '/^\s*([A-Za-z]+)\b/', $query, $matches ) ? strtoupper( $matches[1] ) : 'OTHER';
     89
     90                if ( ! isset( $this->debughawk_stats['types'][ $type ] ) ) {
     91                        $this->debughawk_stats['types'][ $type ] = [
     92                                'count' => 0,
     93                                'time'  => 0.0,
     94                        ];
    4995                }
    5096
    51                 $result = parent::query( $query );
     97                $this->debughawk_stats['count'] ++;
     98                $this->debughawk_stats['time']                    += $query_time;
     99                $this->debughawk_stats['types'][ $type ]['count'] ++;
     100                $this->debughawk_stats['types'][ $type ]['time']  += $query_time;
    52101
    53                 if ( ! defined( 'SAVEQUERIES' ) || ! SAVEQUERIES ) {
    54                         $this->log_query(
    55                                 $query,
    56                                 $this->timer_stop(),
    57                                 '',
    58                                 $this->time_start,
    59                                 [],
    60                         );
     102                if ( $this->debughawk_slow_query_handler !== null && $query_time > $this->debughawk_slow_threshold ) {
     103                        ( $this->debughawk_slow_query_handler )( $query, $query_time, $start );
    61104                }
    62105
  • debughawk/trunk/composer.json

    r3318985 r3783821  
    1515      "DebugHawk\\": "src/"
    1616    }
     17  },
     18  "require-dev": {
     19    "phpunit/phpunit": "^9.6"
     20  },
     21  "autoload-dev": {
     22    "psr-4": {
     23      "DebugHawk\\Tests\\": "tests/"
     24    }
     25  },
     26  "scripts": {
     27    "test": "phpunit"
    1728  }
    1829}
  • debughawk/trunk/composer.lock

    r3433055 r3783821  
    55        "This file is @generated automatically"
    66    ],
    7     "content-hash": "d67bb9a850b07076247c035eb166d44b",
     7    "content-hash": "99e243e48dfa2f20c2daa51d807bd3a6",
    88    "packages": [],
    9     "packages-dev": [],
     9    "packages-dev": [
     10        {
     11            "name": "doctrine/instantiator",
     12            "version": "2.0.0",
     13            "source": {
     14                "type": "git",
     15                "url": "https://github.com/doctrine/instantiator.git",
     16                "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0"
     17            },
     18            "dist": {
     19                "type": "zip",
     20                "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0",
     21                "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0",
     22                "shasum": ""
     23            },
     24            "require": {
     25                "php": "^8.1"
     26            },
     27            "require-dev": {
     28                "doctrine/coding-standard": "^11",
     29                "ext-pdo": "*",
     30                "ext-phar": "*",
     31                "phpbench/phpbench": "^1.2",
     32                "phpstan/phpstan": "^1.9.4",
     33                "phpstan/phpstan-phpunit": "^1.3",
     34                "phpunit/phpunit": "^9.5.27",
     35                "vimeo/psalm": "^5.4"
     36            },
     37            "type": "library",
     38            "autoload": {
     39                "psr-4": {
     40                    "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
     41                }
     42            },
     43            "notification-url": "https://packagist.org/downloads/",
     44            "license": [
     45                "MIT"
     46            ],
     47            "authors": [
     48                {
     49                    "name": "Marco Pivetta",
     50                    "email": "ocramius@gmail.com",
     51                    "homepage": "https://ocramius.github.io/"
     52                }
     53            ],
     54            "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
     55            "homepage": "https://www.doctrine-project.org/projects/instantiator.html",
     56            "keywords": [
     57                "constructor",
     58                "instantiate"
     59            ],
     60            "support": {
     61                "issues": "https://github.com/doctrine/instantiator/issues",
     62                "source": "https://github.com/doctrine/instantiator/tree/2.0.0"
     63            },
     64            "funding": [
     65                {
     66                    "url": "https://www.doctrine-project.org/sponsorship.html",
     67                    "type": "custom"
     68                },
     69                {
     70                    "url": "https://www.patreon.com/phpdoctrine",
     71                    "type": "patreon"
     72                },
     73                {
     74                    "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator",
     75                    "type": "tidelift"
     76                }
     77            ],
     78            "time": "2022-12-30T00:23:10+00:00"
     79        },
     80        {
     81            "name": "myclabs/deep-copy",
     82            "version": "1.14.0",
     83            "source": {
     84                "type": "git",
     85                "url": "https://github.com/myclabs/DeepCopy.git",
     86                "reference": "8680aa248f8e07bc8fb43f56f0f5fc77a0c96aae"
     87            },
     88            "dist": {
     89                "type": "zip",
     90                "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/8680aa248f8e07bc8fb43f56f0f5fc77a0c96aae",
     91                "reference": "8680aa248f8e07bc8fb43f56f0f5fc77a0c96aae",
     92                "shasum": ""
     93            },
     94            "require": {
     95                "php": "^8.0"
     96            },
     97            "conflict": {
     98                "doctrine/collections": "<1.6.8",
     99                "doctrine/common": "<2.13.3 || >=3 <3.2.2"
     100            },
     101            "require-dev": {
     102                "doctrine/collections": "^1.6.8",
     103                "doctrine/common": "^2.13.3 || ^3.2.2",
     104                "phpspec/prophecy": "^1.10",
     105                "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13"
     106            },
     107            "type": "library",
     108            "autoload": {
     109                "files": [
     110                    "src/DeepCopy/deep_copy.php"
     111                ],
     112                "psr-4": {
     113                    "DeepCopy\\": "src/DeepCopy/"
     114                }
     115            },
     116            "notification-url": "https://packagist.org/downloads/",
     117            "license": [
     118                "MIT"
     119            ],
     120            "description": "Create deep copies (clones) of your objects",
     121            "keywords": [
     122                "clone",
     123                "copy",
     124                "duplicate",
     125                "object",
     126                "object graph"
     127            ],
     128            "support": {
     129                "issues": "https://github.com/myclabs/DeepCopy/issues",
     130                "source": "https://github.com/myclabs/DeepCopy/tree/1.14.0"
     131            },
     132            "funding": [
     133                {
     134                    "url": "https://github.com/mnapoli",
     135                    "type": "github"
     136                }
     137            ],
     138            "time": "2026-08-11T10:17:44+00:00"
     139        },
     140        {
     141            "name": "nikic/php-parser",
     142            "version": "v5.9.0",
     143            "source": {
     144                "type": "git",
     145                "url": "https://github.com/nikic/PHP-Parser.git",
     146                "reference": "9e33da9553fe7786f0962b35f4e4ecf01be89def"
     147            },
     148            "dist": {
     149                "type": "zip",
     150                "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/9e33da9553fe7786f0962b35f4e4ecf01be89def",
     151                "reference": "9e33da9553fe7786f0962b35f4e4ecf01be89def",
     152                "shasum": ""
     153            },
     154            "require": {
     155                "ext-json": "*",
     156                "ext-tokenizer": "*",
     157                "php": ">=7.4"
     158            },
     159            "require-dev": {
     160                "ircmaxell/php-yacc": "^0.0.7",
     161                "phpunit/phpunit": "^9.0"
     162            },
     163            "bin": [
     164                "bin/php-parse"
     165            ],
     166            "type": "library",
     167            "extra": {
     168                "branch-alias": {
     169                    "dev-master": "5.x-dev"
     170                }
     171            },
     172            "autoload": {
     173                "psr-4": {
     174                    "PhpParser\\": "lib/PhpParser"
     175                }
     176            },
     177            "notification-url": "https://packagist.org/downloads/",
     178            "license": [
     179                "BSD-3-Clause"
     180            ],
     181            "authors": [
     182                {
     183                    "name": "Nikita Popov"
     184                }
     185            ],
     186            "description": "A PHP parser written in PHP",
     187            "keywords": [
     188                "parser",
     189                "php"
     190            ],
     191            "support": {
     192                "issues": "https://github.com/nikic/PHP-Parser/issues",
     193                "source": "https://github.com/nikic/PHP-Parser/tree/v5.9.0"
     194            },
     195            "time": "2026-09-13T18:51:52+00:00"
     196        },
     197        {
     198            "name": "phar-io/manifest",
     199            "version": "2.0.4",
     200            "source": {
     201                "type": "git",
     202                "url": "https://github.com/phar-io/manifest.git",
     203                "reference": "54750ef60c58e43759730615a392c31c80e23176"
     204            },
     205            "dist": {
     206                "type": "zip",
     207                "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176",
     208                "reference": "54750ef60c58e43759730615a392c31c80e23176",
     209                "shasum": ""
     210            },
     211            "require": {
     212                "ext-dom": "*",
     213                "ext-libxml": "*",
     214                "ext-phar": "*",
     215                "ext-xmlwriter": "*",
     216                "phar-io/version": "^3.0.1",
     217                "php": "^7.2 || ^8.0"
     218            },
     219            "type": "library",
     220            "extra": {
     221                "branch-alias": {
     222                    "dev-master": "2.0.x-dev"
     223                }
     224            },
     225            "autoload": {
     226                "classmap": [
     227                    "src/"
     228                ]
     229            },
     230            "notification-url": "https://packagist.org/downloads/",
     231            "license": [
     232                "BSD-3-Clause"
     233            ],
     234            "authors": [
     235                {
     236                    "name": "Arne Blankerts",
     237                    "email": "arne@blankerts.de",
     238                    "role": "Developer"
     239                },
     240                {
     241                    "name": "Sebastian Heuer",
     242                    "email": "sebastian@phpeople.de",
     243                    "role": "Developer"
     244                },
     245                {
     246                    "name": "Sebastian Bergmann",
     247                    "email": "sebastian@phpunit.de",
     248                    "role": "Developer"
     249                }
     250            ],
     251            "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)",
     252            "support": {
     253                "issues": "https://github.com/phar-io/manifest/issues",
     254                "source": "https://github.com/phar-io/manifest/tree/2.0.4"
     255            },
     256            "funding": [
     257                {
     258                    "url": "https://github.com/theseer",
     259                    "type": "github"
     260                }
     261            ],
     262            "time": "2024-03-03T12:33:53+00:00"
     263        },
     264        {
     265            "name": "phar-io/version",
     266            "version": "3.2.1",
     267            "source": {
     268                "type": "git",
     269                "url": "https://github.com/phar-io/version.git",
     270                "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74"
     271            },
     272            "dist": {
     273                "type": "zip",
     274                "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74",
     275                "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74",
     276                "shasum": ""
     277            },
     278            "require": {
     279                "php": "^7.2 || ^8.0"
     280            },
     281            "type": "library",
     282            "autoload": {
     283                "classmap": [
     284                    "src/"
     285                ]
     286            },
     287            "notification-url": "https://packagist.org/downloads/",
     288            "license": [
     289                "BSD-3-Clause"
     290            ],
     291            "authors": [
     292                {
     293                    "name": "Arne Blankerts",
     294                    "email": "arne@blankerts.de",
     295                    "role": "Developer"
     296                },
     297                {
     298                    "name": "Sebastian Heuer",
     299                    "email": "sebastian@phpeople.de",
     300                    "role": "Developer"
     301                },
     302                {
     303                    "name": "Sebastian Bergmann",
     304                    "email": "sebastian@phpunit.de",
     305                    "role": "Developer"
     306                }
     307            ],
     308            "description": "Library for handling version information and constraints",
     309            "support": {
     310                "issues": "https://github.com/phar-io/version/issues",
     311                "source": "https://github.com/phar-io/version/tree/3.2.1"
     312            },
     313            "time": "2022-02-21T01:04:05+00:00"
     314        },
     315        {
     316            "name": "phpunit/php-code-coverage",
     317            "version": "9.2.32",
     318            "source": {
     319                "type": "git",
     320                "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
     321                "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5"
     322            },
     323            "dist": {
     324                "type": "zip",
     325                "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/85402a822d1ecf1db1096959413d35e1c37cf1a5",
     326                "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5",
     327                "shasum": ""
     328            },
     329            "require": {
     330                "ext-dom": "*",
     331                "ext-libxml": "*",
     332                "ext-xmlwriter": "*",
     333                "nikic/php-parser": "^4.19.1 || ^5.1.0",
     334                "php": ">=7.3",
     335                "phpunit/php-file-iterator": "^3.0.6",
     336                "phpunit/php-text-template": "^2.0.4",
     337                "sebastian/code-unit-reverse-lookup": "^2.0.3",
     338                "sebastian/complexity": "^2.0.3",
     339                "sebastian/environment": "^5.1.5",
     340                "sebastian/lines-of-code": "^1.0.4",
     341                "sebastian/version": "^3.0.2",
     342                "theseer/tokenizer": "^1.2.3"
     343            },
     344            "require-dev": {
     345                "phpunit/phpunit": "^9.6"
     346            },
     347            "suggest": {
     348                "ext-pcov": "PHP extension that provides line coverage",
     349                "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage"
     350            },
     351            "type": "library",
     352            "extra": {
     353                "branch-alias": {
     354                    "dev-main": "9.2.x-dev"
     355                }
     356            },
     357            "autoload": {
     358                "classmap": [
     359                    "src/"
     360                ]
     361            },
     362            "notification-url": "https://packagist.org/downloads/",
     363            "license": [
     364                "BSD-3-Clause"
     365            ],
     366            "authors": [
     367                {
     368                    "name": "Sebastian Bergmann",
     369                    "email": "sebastian@phpunit.de",
     370                    "role": "lead"
     371                }
     372            ],
     373            "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
     374            "homepage": "https://github.com/sebastianbergmann/php-code-coverage",
     375            "keywords": [
     376                "coverage",
     377                "testing",
     378                "xunit"
     379            ],
     380            "support": {
     381                "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
     382                "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy",
     383                "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.32"
     384            },
     385            "funding": [
     386                {
     387                    "url": "https://github.com/sebastianbergmann",
     388                    "type": "github"
     389                }
     390            ],
     391            "time": "2024-08-22T04:23:01+00:00"
     392        },
     393        {
     394            "name": "phpunit/php-file-iterator",
     395            "version": "3.0.6",
     396            "source": {
     397                "type": "git",
     398                "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
     399                "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf"
     400            },
     401            "dist": {
     402                "type": "zip",
     403                "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf",
     404                "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf",
     405                "shasum": ""
     406            },
     407            "require": {
     408                "php": ">=7.3"
     409            },
     410            "require-dev": {
     411                "phpunit/phpunit": "^9.3"
     412            },
     413            "type": "library",
     414            "extra": {
     415                "branch-alias": {
     416                    "dev-master": "3.0-dev"
     417                }
     418            },
     419            "autoload": {
     420                "classmap": [
     421                    "src/"
     422                ]
     423            },
     424            "notification-url": "https://packagist.org/downloads/",
     425            "license": [
     426                "BSD-3-Clause"
     427            ],
     428            "authors": [
     429                {
     430                    "name": "Sebastian Bergmann",
     431                    "email": "sebastian@phpunit.de",
     432                    "role": "lead"
     433                }
     434            ],
     435            "description": "FilterIterator implementation that filters files based on a list of suffixes.",
     436            "homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
     437            "keywords": [
     438                "filesystem",
     439                "iterator"
     440            ],
     441            "support": {
     442                "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues",
     443                "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6"
     444            },
     445            "funding": [
     446                {
     447                    "url": "https://github.com/sebastianbergmann",
     448                    "type": "github"
     449                }
     450            ],
     451            "time": "2021-12-02T12:48:52+00:00"
     452        },
     453        {
     454            "name": "phpunit/php-invoker",
     455            "version": "3.1.1",
     456            "source": {
     457                "type": "git",
     458                "url": "https://github.com/sebastianbergmann/php-invoker.git",
     459                "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67"
     460            },
     461            "dist": {
     462                "type": "zip",
     463                "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67",
     464                "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67",
     465                "shasum": ""
     466            },
     467            "require": {
     468                "php": ">=7.3"
     469            },
     470            "require-dev": {
     471                "ext-pcntl": "*",
     472                "phpunit/phpunit": "^9.3"
     473            },
     474            "suggest": {
     475                "ext-pcntl": "*"
     476            },
     477            "type": "library",
     478            "extra": {
     479                "branch-alias": {
     480                    "dev-master": "3.1-dev"
     481                }
     482            },
     483            "autoload": {
     484                "classmap": [
     485                    "src/"
     486                ]
     487            },
     488            "notification-url": "https://packagist.org/downloads/",
     489            "license": [
     490                "BSD-3-Clause"
     491            ],
     492            "authors": [
     493                {
     494                    "name": "Sebastian Bergmann",
     495                    "email": "sebastian@phpunit.de",
     496                    "role": "lead"
     497                }
     498            ],
     499            "description": "Invoke callables with a timeout",
     500            "homepage": "https://github.com/sebastianbergmann/php-invoker/",
     501            "keywords": [
     502                "process"
     503            ],
     504            "support": {
     505                "issues": "https://github.com/sebastianbergmann/php-invoker/issues",
     506                "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1"
     507            },
     508            "funding": [
     509                {
     510                    "url": "https://github.com/sebastianbergmann",
     511                    "type": "github"
     512                }
     513            ],
     514            "time": "2020-09-28T05:58:55+00:00"
     515        },
     516        {
     517            "name": "phpunit/php-text-template",
     518            "version": "2.0.4",
     519            "source": {
     520                "type": "git",
     521                "url": "https://github.com/sebastianbergmann/php-text-template.git",
     522                "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28"
     523            },
     524            "dist": {
     525                "type": "zip",
     526                "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28",
     527                "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28",
     528                "shasum": ""
     529            },
     530            "require": {
     531                "php": ">=7.3"
     532            },
     533            "require-dev": {
     534                "phpunit/phpunit": "^9.3"
     535            },
     536            "type": "library",
     537            "extra": {
     538                "branch-alias": {
     539                    "dev-master": "2.0-dev"
     540                }
     541            },
     542            "autoload": {
     543                "classmap": [
     544                    "src/"
     545                ]
     546            },
     547            "notification-url": "https://packagist.org/downloads/",
     548            "license": [
     549                "BSD-3-Clause"
     550            ],
     551            "authors": [
     552                {
     553                    "name": "Sebastian Bergmann",
     554                    "email": "sebastian@phpunit.de",
     555                    "role": "lead"
     556                }
     557            ],
     558            "description": "Simple template engine.",
     559            "homepage": "https://github.com/sebastianbergmann/php-text-template/",
     560            "keywords": [
     561                "template"
     562            ],
     563            "support": {
     564                "issues": "https://github.com/sebastianbergmann/php-text-template/issues",
     565                "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4"
     566            },
     567            "funding": [
     568                {
     569                    "url": "https://github.com/sebastianbergmann",
     570                    "type": "github"
     571                }
     572            ],
     573            "time": "2020-10-26T05:33:50+00:00"
     574        },
     575        {
     576            "name": "phpunit/php-timer",
     577            "version": "5.0.3",
     578            "source": {
     579                "type": "git",
     580                "url": "https://github.com/sebastianbergmann/php-timer.git",
     581                "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2"
     582            },
     583            "dist": {
     584                "type": "zip",
     585                "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2",
     586                "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2",
     587                "shasum": ""
     588            },
     589            "require": {
     590                "php": ">=7.3"
     591            },
     592            "require-dev": {
     593                "phpunit/phpunit": "^9.3"
     594            },
     595            "type": "library",
     596            "extra": {
     597                "branch-alias": {
     598                    "dev-master": "5.0-dev"
     599                }
     600            },
     601            "autoload": {
     602                "classmap": [
     603                    "src/"
     604                ]
     605            },
     606            "notification-url": "https://packagist.org/downloads/",
     607            "license": [
     608                "BSD-3-Clause"
     609            ],
     610            "authors": [
     611                {
     612                    "name": "Sebastian Bergmann",
     613                    "email": "sebastian@phpunit.de",
     614                    "role": "lead"
     615                }
     616            ],
     617            "description": "Utility class for timing",
     618            "homepage": "https://github.com/sebastianbergmann/php-timer/",
     619            "keywords": [
     620                "timer"
     621            ],
     622            "support": {
     623                "issues": "https://github.com/sebastianbergmann/php-timer/issues",
     624                "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3"
     625            },
     626            "funding": [
     627                {
     628                    "url": "https://github.com/sebastianbergmann",
     629                    "type": "github"
     630                }
     631            ],
     632            "time": "2020-10-26T13:16:10+00:00"
     633        },
     634        {
     635            "name": "phpunit/phpunit",
     636            "version": "9.6.38",
     637            "source": {
     638                "type": "git",
     639                "url": "https://github.com/sebastianbergmann/phpunit.git",
     640                "reference": "8b5f757e8e92071bfdbfa93943f94f84c4e31007"
     641            },
     642            "dist": {
     643                "type": "zip",
     644                "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/8b5f757e8e92071bfdbfa93943f94f84c4e31007",
     645                "reference": "8b5f757e8e92071bfdbfa93943f94f84c4e31007",
     646                "shasum": ""
     647            },
     648            "require": {
     649                "doctrine/instantiator": "^1.5.0 || ^2",
     650                "ext-dom": "*",
     651                "ext-filter": "*",
     652                "ext-json": "*",
     653                "ext-libxml": "*",
     654                "ext-mbstring": "*",
     655                "ext-xmlwriter": "*",
     656                "myclabs/deep-copy": "^1.13.4",
     657                "phar-io/manifest": "^2.0.4",
     658                "phar-io/version": "^3.2.1",
     659                "php": ">=7.3",
     660                "phpunit/php-code-coverage": "^9.2.32",
     661                "phpunit/php-file-iterator": "^3.0.6",
     662                "phpunit/php-invoker": "^3.1.1",
     663                "phpunit/php-text-template": "^2.0.4",
     664                "phpunit/php-timer": "^5.0.3",
     665                "sebastian/cli-parser": "^1.0.2",
     666                "sebastian/code-unit": "^1.0.8",
     667                "sebastian/comparator": "^4.0.10",
     668                "sebastian/diff": "^4.0.6",
     669                "sebastian/environment": "^5.1.5",
     670                "sebastian/exporter": "^4.0.9",
     671                "sebastian/global-state": "^5.0.8",
     672                "sebastian/object-enumerator": "^4.0.4",
     673                "sebastian/resource-operations": "^3.0.4",
     674                "sebastian/type": "^3.2.1",
     675                "sebastian/version": "^3.0.2"
     676            },
     677            "suggest": {
     678                "ext-soap": "To be able to generate mocks based on WSDL files",
     679                "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage"
     680            },
     681            "bin": [
     682                "phpunit"
     683            ],
     684            "type": "library",
     685            "extra": {
     686                "branch-alias": {
     687                    "dev-master": "9.6-dev"
     688                }
     689            },
     690            "autoload": {
     691                "files": [
     692                    "src/Framework/Assert/Functions.php"
     693                ],
     694                "classmap": [
     695                    "src/"
     696                ]
     697            },
     698            "notification-url": "https://packagist.org/downloads/",
     699            "license": [
     700                "BSD-3-Clause"
     701            ],
     702            "authors": [
     703                {
     704                    "name": "Sebastian Bergmann",
     705                    "email": "sebastian@phpunit.de",
     706                    "role": "lead"
     707                }
     708            ],
     709            "description": "The PHP Unit Testing framework.",
     710            "homepage": "https://phpunit.de/",
     711            "keywords": [
     712                "phpunit",
     713                "testing",
     714                "xunit"
     715            ],
     716            "support": {
     717                "issues": "https://github.com/sebastianbergmann/phpunit/issues",
     718                "security": "https://github.com/sebastianbergmann/phpunit/security/policy",
     719                "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.38"
     720            },
     721            "funding": [
     722                {
     723                    "url": "https://phpunit.de/sponsoring.html",
     724                    "type": "other"
     725                }
     726            ],
     727            "time": "2026-10-05T05:44:26+00:00"
     728        },
     729        {
     730            "name": "sebastian/cli-parser",
     731            "version": "1.0.2",
     732            "source": {
     733                "type": "git",
     734                "url": "https://github.com/sebastianbergmann/cli-parser.git",
     735                "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b"
     736            },
     737            "dist": {
     738                "type": "zip",
     739                "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2b56bea83a09de3ac06bb18b92f068e60cc6f50b",
     740                "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b",
     741                "shasum": ""
     742            },
     743            "require": {
     744                "php": ">=7.3"
     745            },
     746            "require-dev": {
     747                "phpunit/phpunit": "^9.3"
     748            },
     749            "type": "library",
     750            "extra": {
     751                "branch-alias": {
     752                    "dev-master": "1.0-dev"
     753                }
     754            },
     755            "autoload": {
     756                "classmap": [
     757                    "src/"
     758                ]
     759            },
     760            "notification-url": "https://packagist.org/downloads/",
     761            "license": [
     762                "BSD-3-Clause"
     763            ],
     764            "authors": [
     765                {
     766                    "name": "Sebastian Bergmann",
     767                    "email": "sebastian@phpunit.de",
     768                    "role": "lead"
     769                }
     770            ],
     771            "description": "Library for parsing CLI options",
     772            "homepage": "https://github.com/sebastianbergmann/cli-parser",
     773            "support": {
     774                "issues": "https://github.com/sebastianbergmann/cli-parser/issues",
     775                "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.2"
     776            },
     777            "funding": [
     778                {
     779                    "url": "https://github.com/sebastianbergmann",
     780                    "type": "github"
     781                }
     782            ],
     783            "time": "2024-03-02T06:27:43+00:00"
     784        },
     785        {
     786            "name": "sebastian/code-unit",
     787            "version": "1.0.8",
     788            "source": {
     789                "type": "git",
     790                "url": "https://github.com/sebastianbergmann/code-unit.git",
     791                "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120"
     792            },
     793            "dist": {
     794                "type": "zip",
     795                "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120",
     796                "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120",
     797                "shasum": ""
     798            },
     799            "require": {
     800                "php": ">=7.3"
     801            },
     802            "require-dev": {
     803                "phpunit/phpunit": "^9.3"
     804            },
     805            "type": "library",
     806            "extra": {
     807                "branch-alias": {
     808                    "dev-master": "1.0-dev"
     809                }
     810            },
     811            "autoload": {
     812                "classmap": [
     813                    "src/"
     814                ]
     815            },
     816            "notification-url": "https://packagist.org/downloads/",
     817            "license": [
     818                "BSD-3-Clause"
     819            ],
     820            "authors": [
     821                {
     822                    "name": "Sebastian Bergmann",
     823                    "email": "sebastian@phpunit.de",
     824                    "role": "lead"
     825                }
     826            ],
     827            "description": "Collection of value objects that represent the PHP code units",
     828            "homepage": "https://github.com/sebastianbergmann/code-unit",
     829            "support": {
     830                "issues": "https://github.com/sebastianbergmann/code-unit/issues",
     831                "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8"
     832            },
     833            "funding": [
     834                {
     835                    "url": "https://github.com/sebastianbergmann",
     836                    "type": "github"
     837                }
     838            ],
     839            "time": "2020-10-26T13:08:54+00:00"
     840        },
     841        {
     842            "name": "sebastian/code-unit-reverse-lookup",
     843            "version": "2.0.3",
     844            "source": {
     845                "type": "git",
     846                "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git",
     847                "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5"
     848            },
     849            "dist": {
     850                "type": "zip",
     851                "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5",
     852                "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5",
     853                "shasum": ""
     854            },
     855            "require": {
     856                "php": ">=7.3"
     857            },
     858            "require-dev": {
     859                "phpunit/phpunit": "^9.3"
     860            },
     861            "type": "library",
     862            "extra": {
     863                "branch-alias": {
     864                    "dev-master": "2.0-dev"
     865                }
     866            },
     867            "autoload": {
     868                "classmap": [
     869                    "src/"
     870                ]
     871            },
     872            "notification-url": "https://packagist.org/downloads/",
     873            "license": [
     874                "BSD-3-Clause"
     875            ],
     876            "authors": [
     877                {
     878                    "name": "Sebastian Bergmann",
     879                    "email": "sebastian@phpunit.de"
     880                }
     881            ],
     882            "description": "Looks up which function or method a line of code belongs to",
     883            "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/",
     884            "support": {
     885                "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues",
     886                "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3"
     887            },
     888            "funding": [
     889                {
     890                    "url": "https://github.com/sebastianbergmann",
     891                    "type": "github"
     892                }
     893            ],
     894            "time": "2020-09-28T05:30:19+00:00"
     895        },
     896        {
     897            "name": "sebastian/comparator",
     898            "version": "4.0.10",
     899            "source": {
     900                "type": "git",
     901                "url": "https://github.com/sebastianbergmann/comparator.git",
     902                "reference": "e4df00b9b3571187db2831ae9aada2c6efbd715d"
     903            },
     904            "dist": {
     905                "type": "zip",
     906                "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/e4df00b9b3571187db2831ae9aada2c6efbd715d",
     907                "reference": "e4df00b9b3571187db2831ae9aada2c6efbd715d",
     908                "shasum": ""
     909            },
     910            "require": {
     911                "php": ">=7.3",
     912                "sebastian/diff": "^4.0",
     913                "sebastian/exporter": "^4.0"
     914            },
     915            "require-dev": {
     916                "phpunit/phpunit": "^9.3"
     917            },
     918            "type": "library",
     919            "extra": {
     920                "branch-alias": {
     921                    "dev-master": "4.0-dev"
     922                }
     923            },
     924            "autoload": {
     925                "classmap": [
     926                    "src/"
     927                ]
     928            },
     929            "notification-url": "https://packagist.org/downloads/",
     930            "license": [
     931                "BSD-3-Clause"
     932            ],
     933            "authors": [
     934                {
     935                    "name": "Sebastian Bergmann",
     936                    "email": "sebastian@phpunit.de"
     937                },
     938                {
     939                    "name": "Jeff Welch",
     940                    "email": "whatthejeff@gmail.com"
     941                },
     942                {
     943                    "name": "Volker Dusch",
     944                    "email": "github@wallbash.com"
     945                },
     946                {
     947                    "name": "Bernhard Schussek",
     948                    "email": "bschussek@2bepublished.at"
     949                }
     950            ],
     951            "description": "Provides the functionality to compare PHP values for equality",
     952            "homepage": "https://github.com/sebastianbergmann/comparator",
     953            "keywords": [
     954                "comparator",
     955                "compare",
     956                "equality"
     957            ],
     958            "support": {
     959                "issues": "https://github.com/sebastianbergmann/comparator/issues",
     960                "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.10"
     961            },
     962            "funding": [
     963                {
     964                    "url": "https://github.com/sebastianbergmann",
     965                    "type": "github"
     966                },
     967                {
     968                    "url": "https://liberapay.com/sebastianbergmann",
     969                    "type": "liberapay"
     970                },
     971                {
     972                    "url": "https://thanks.dev/u/gh/sebastianbergmann",
     973                    "type": "thanks_dev"
     974                },
     975                {
     976                    "url": "https://tidelift.com/funding/github/packagist/sebastian/comparator",
     977                    "type": "tidelift"
     978                }
     979            ],
     980            "time": "2026-01-24T09:22:56+00:00"
     981        },
     982        {
     983            "name": "sebastian/complexity",
     984            "version": "2.0.3",
     985            "source": {
     986                "type": "git",
     987                "url": "https://github.com/sebastianbergmann/complexity.git",
     988                "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a"
     989            },
     990            "dist": {
     991                "type": "zip",
     992                "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/25f207c40d62b8b7aa32f5ab026c53561964053a",
     993                "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a",
     994                "shasum": ""
     995            },
     996            "require": {
     997                "nikic/php-parser": "^4.18 || ^5.0",
     998                "php": ">=7.3"
     999            },
     1000            "require-dev": {
     1001                "phpunit/phpunit": "^9.3"
     1002            },
     1003            "type": "library",
     1004            "extra": {
     1005                "branch-alias": {
     1006                    "dev-master": "2.0-dev"
     1007                }
     1008            },
     1009            "autoload": {
     1010                "classmap": [
     1011                    "src/"
     1012                ]
     1013            },
     1014            "notification-url": "https://packagist.org/downloads/",
     1015            "license": [
     1016                "BSD-3-Clause"
     1017            ],
     1018            "authors": [
     1019                {
     1020                    "name": "Sebastian Bergmann",
     1021                    "email": "sebastian@phpunit.de",
     1022                    "role": "lead"
     1023                }
     1024            ],
     1025            "description": "Library for calculating the complexity of PHP code units",
     1026            "homepage": "https://github.com/sebastianbergmann/complexity",
     1027            "support": {
     1028                "issues": "https://github.com/sebastianbergmann/complexity/issues",
     1029                "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.3"
     1030            },
     1031            "funding": [
     1032                {
     1033                    "url": "https://github.com/sebastianbergmann",
     1034                    "type": "github"
     1035                }
     1036            ],
     1037            "time": "2023-12-22T06:19:30+00:00"
     1038        },
     1039        {
     1040            "name": "sebastian/diff",
     1041            "version": "4.0.6",
     1042            "source": {
     1043                "type": "git",
     1044                "url": "https://github.com/sebastianbergmann/diff.git",
     1045                "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc"
     1046            },
     1047            "dist": {
     1048                "type": "zip",
     1049                "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc",
     1050                "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc",
     1051                "shasum": ""
     1052            },
     1053            "require": {
     1054                "php": ">=7.3"
     1055            },
     1056            "require-dev": {
     1057                "phpunit/phpunit": "^9.3",
     1058                "symfony/process": "^4.2 || ^5"
     1059            },
     1060            "type": "library",
     1061            "extra": {
     1062                "branch-alias": {
     1063                    "dev-master": "4.0-dev"
     1064                }
     1065            },
     1066            "autoload": {
     1067                "classmap": [
     1068                    "src/"
     1069                ]
     1070            },
     1071            "notification-url": "https://packagist.org/downloads/",
     1072            "license": [
     1073                "BSD-3-Clause"
     1074            ],
     1075            "authors": [
     1076                {
     1077                    "name": "Sebastian Bergmann",
     1078                    "email": "sebastian@phpunit.de"
     1079                },
     1080                {
     1081                    "name": "Kore Nordmann",
     1082                    "email": "mail@kore-nordmann.de"
     1083                }
     1084            ],
     1085            "description": "Diff implementation",
     1086            "homepage": "https://github.com/sebastianbergmann/diff",
     1087            "keywords": [
     1088                "diff",
     1089                "udiff",
     1090                "unidiff",
     1091                "unified diff"
     1092            ],
     1093            "support": {
     1094                "issues": "https://github.com/sebastianbergmann/diff/issues",
     1095                "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6"
     1096            },
     1097            "funding": [
     1098                {
     1099                    "url": "https://github.com/sebastianbergmann",
     1100                    "type": "github"
     1101                }
     1102            ],
     1103            "time": "2024-03-02T06:30:58+00:00"
     1104        },
     1105        {
     1106            "name": "sebastian/environment",
     1107            "version": "5.1.5",
     1108            "source": {
     1109                "type": "git",
     1110                "url": "https://github.com/sebastianbergmann/environment.git",
     1111                "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed"
     1112            },
     1113            "dist": {
     1114                "type": "zip",
     1115                "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed",
     1116                "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed",
     1117                "shasum": ""
     1118            },
     1119            "require": {
     1120                "php": ">=7.3"
     1121            },
     1122            "require-dev": {
     1123                "phpunit/phpunit": "^9.3"
     1124            },
     1125            "suggest": {
     1126                "ext-posix": "*"
     1127            },
     1128            "type": "library",
     1129            "extra": {
     1130                "branch-alias": {
     1131                    "dev-master": "5.1-dev"
     1132                }
     1133            },
     1134            "autoload": {
     1135                "classmap": [
     1136                    "src/"
     1137                ]
     1138            },
     1139            "notification-url": "https://packagist.org/downloads/",
     1140            "license": [
     1141                "BSD-3-Clause"
     1142            ],
     1143            "authors": [
     1144                {
     1145                    "name": "Sebastian Bergmann",
     1146                    "email": "sebastian@phpunit.de"
     1147                }
     1148            ],
     1149            "description": "Provides functionality to handle HHVM/PHP environments",
     1150            "homepage": "http://www.github.com/sebastianbergmann/environment",
     1151            "keywords": [
     1152                "Xdebug",
     1153                "environment",
     1154                "hhvm"
     1155            ],
     1156            "support": {
     1157                "issues": "https://github.com/sebastianbergmann/environment/issues",
     1158                "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5"
     1159            },
     1160            "funding": [
     1161                {
     1162                    "url": "https://github.com/sebastianbergmann",
     1163                    "type": "github"
     1164                }
     1165            ],
     1166            "time": "2023-02-03T06:03:51+00:00"
     1167        },
     1168        {
     1169            "name": "sebastian/exporter",
     1170            "version": "4.0.9",
     1171            "source": {
     1172                "type": "git",
     1173                "url": "https://github.com/sebastianbergmann/exporter.git",
     1174                "reference": "4352c1a3df741a7ba9e61af6fed51d1fee41cbf7"
     1175            },
     1176            "dist": {
     1177                "type": "zip",
     1178                "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/4352c1a3df741a7ba9e61af6fed51d1fee41cbf7",
     1179                "reference": "4352c1a3df741a7ba9e61af6fed51d1fee41cbf7",
     1180                "shasum": ""
     1181            },
     1182            "require": {
     1183                "php": ">=7.3",
     1184                "sebastian/recursion-context": "^4.0"
     1185            },
     1186            "require-dev": {
     1187                "ext-mbstring": "*",
     1188                "phpunit/phpunit": "^9.3"
     1189            },
     1190            "type": "library",
     1191            "extra": {
     1192                "branch-alias": {
     1193                    "dev-master": "4.0-dev"
     1194                }
     1195            },
     1196            "autoload": {
     1197                "classmap": [
     1198                    "src/"
     1199                ]
     1200            },
     1201            "notification-url": "https://packagist.org/downloads/",
     1202            "license": [
     1203                "BSD-3-Clause"
     1204            ],
     1205            "authors": [
     1206                {
     1207                    "name": "Sebastian Bergmann",
     1208                    "email": "sebastian@phpunit.de"
     1209                },
     1210                {
     1211                    "name": "Jeff Welch",
     1212                    "email": "whatthejeff@gmail.com"
     1213                },
     1214                {
     1215                    "name": "Volker Dusch",
     1216                    "email": "github@wallbash.com"
     1217                },
     1218                {
     1219                    "name": "Adam Harvey",
     1220                    "email": "aharvey@php.net"
     1221                },
     1222                {
     1223                    "name": "Bernhard Schussek",
     1224                    "email": "bschussek@gmail.com"
     1225                }
     1226            ],
     1227            "description": "Provides the functionality to export PHP variables for visualization",
     1228            "homepage": "https://www.github.com/sebastianbergmann/exporter",
     1229            "keywords": [
     1230                "export",
     1231                "exporter"
     1232            ],
     1233            "support": {
     1234                "issues": "https://github.com/sebastianbergmann/exporter/issues",
     1235                "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.9"
     1236            },
     1237            "funding": [
     1238                {
     1239                    "url": "https://github.com/sebastianbergmann",
     1240                    "type": "github"
     1241                },
     1242                {
     1243                    "url": "https://liberapay.com/sebastianbergmann",
     1244                    "type": "liberapay"
     1245                },
     1246                {
     1247                    "url": "https://thanks.dev/u/gh/sebastianbergmann",
     1248                    "type": "thanks_dev"
     1249                },
     1250                {
     1251                    "url": "https://tidelift.com/funding/github/packagist/sebastian/exporter",
     1252                    "type": "tidelift"
     1253                }
     1254            ],
     1255            "time": "2026-08-11T04:55:59+00:00"
     1256        },
     1257        {
     1258            "name": "sebastian/global-state",
     1259            "version": "5.0.8",
     1260            "source": {
     1261                "type": "git",
     1262                "url": "https://github.com/sebastianbergmann/global-state.git",
     1263                "reference": "b6781316bdcd28260904e7cc18ec983d0d2ef4f6"
     1264            },
     1265            "dist": {
     1266                "type": "zip",
     1267                "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/b6781316bdcd28260904e7cc18ec983d0d2ef4f6",
     1268                "reference": "b6781316bdcd28260904e7cc18ec983d0d2ef4f6",
     1269                "shasum": ""
     1270            },
     1271            "require": {
     1272                "php": ">=7.3",
     1273                "sebastian/object-reflector": "^2.0",
     1274                "sebastian/recursion-context": "^4.0"
     1275            },
     1276            "require-dev": {
     1277                "ext-dom": "*",
     1278                "phpunit/phpunit": "^9.3"
     1279            },
     1280            "suggest": {
     1281                "ext-uopz": "*"
     1282            },
     1283            "type": "library",
     1284            "extra": {
     1285                "branch-alias": {
     1286                    "dev-master": "5.0-dev"
     1287                }
     1288            },
     1289            "autoload": {
     1290                "classmap": [
     1291                    "src/"
     1292                ]
     1293            },
     1294            "notification-url": "https://packagist.org/downloads/",
     1295            "license": [
     1296                "BSD-3-Clause"
     1297            ],
     1298            "authors": [
     1299                {
     1300                    "name": "Sebastian Bergmann",
     1301                    "email": "sebastian@phpunit.de"
     1302                }
     1303            ],
     1304            "description": "Snapshotting of global state",
     1305            "homepage": "http://www.github.com/sebastianbergmann/global-state",
     1306            "keywords": [
     1307                "global state"
     1308            ],
     1309            "support": {
     1310                "issues": "https://github.com/sebastianbergmann/global-state/issues",
     1311                "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.8"
     1312            },
     1313            "funding": [
     1314                {
     1315                    "url": "https://github.com/sebastianbergmann",
     1316                    "type": "github"
     1317                },
     1318                {
     1319                    "url": "https://liberapay.com/sebastianbergmann",
     1320                    "type": "liberapay"
     1321                },
     1322                {
     1323                    "url": "https://thanks.dev/u/gh/sebastianbergmann",
     1324                    "type": "thanks_dev"
     1325                },
     1326                {
     1327                    "url": "https://tidelift.com/funding/github/packagist/sebastian/global-state",
     1328                    "type": "tidelift"
     1329                }
     1330            ],
     1331            "time": "2025-08-10T07:10:35+00:00"
     1332        },
     1333        {
     1334            "name": "sebastian/lines-of-code",
     1335            "version": "1.0.4",
     1336            "source": {
     1337                "type": "git",
     1338                "url": "https://github.com/sebastianbergmann/lines-of-code.git",
     1339                "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5"
     1340            },
     1341            "dist": {
     1342                "type": "zip",
     1343                "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e1e4a170560925c26d424b6a03aed157e7dcc5c5",
     1344                "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5",
     1345                "shasum": ""
     1346            },
     1347            "require": {
     1348                "nikic/php-parser": "^4.18 || ^5.0",
     1349                "php": ">=7.3"
     1350            },
     1351            "require-dev": {
     1352                "phpunit/phpunit": "^9.3"
     1353            },
     1354            "type": "library",
     1355            "extra": {
     1356                "branch-alias": {
     1357                    "dev-master": "1.0-dev"
     1358                }
     1359            },
     1360            "autoload": {
     1361                "classmap": [
     1362                    "src/"
     1363                ]
     1364            },
     1365            "notification-url": "https://packagist.org/downloads/",
     1366            "license": [
     1367                "BSD-3-Clause"
     1368            ],
     1369            "authors": [
     1370                {
     1371                    "name": "Sebastian Bergmann",
     1372                    "email": "sebastian@phpunit.de",
     1373                    "role": "lead"
     1374                }
     1375            ],
     1376            "description": "Library for counting the lines of code in PHP source code",
     1377            "homepage": "https://github.com/sebastianbergmann/lines-of-code",
     1378            "support": {
     1379                "issues": "https://github.com/sebastianbergmann/lines-of-code/issues",
     1380                "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.4"
     1381            },
     1382            "funding": [
     1383                {
     1384                    "url": "https://github.com/sebastianbergmann",
     1385                    "type": "github"
     1386                }
     1387            ],
     1388            "time": "2023-12-22T06:20:34+00:00"
     1389        },
     1390        {
     1391            "name": "sebastian/object-enumerator",
     1392            "version": "4.0.4",
     1393            "source": {
     1394                "type": "git",
     1395                "url": "https://github.com/sebastianbergmann/object-enumerator.git",
     1396                "reference": "5c9eeac41b290a3712d88851518825ad78f45c71"
     1397            },
     1398            "dist": {
     1399                "type": "zip",
     1400                "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71",
     1401                "reference": "5c9eeac41b290a3712d88851518825ad78f45c71",
     1402                "shasum": ""
     1403            },
     1404            "require": {
     1405                "php": ">=7.3",
     1406                "sebastian/object-reflector": "^2.0",
     1407                "sebastian/recursion-context": "^4.0"
     1408            },
     1409            "require-dev": {
     1410                "phpunit/phpunit": "^9.3"
     1411            },
     1412            "type": "library",
     1413            "extra": {
     1414                "branch-alias": {
     1415                    "dev-master": "4.0-dev"
     1416                }
     1417            },
     1418            "autoload": {
     1419                "classmap": [
     1420                    "src/"
     1421                ]
     1422            },
     1423            "notification-url": "https://packagist.org/downloads/",
     1424            "license": [
     1425                "BSD-3-Clause"
     1426            ],
     1427            "authors": [
     1428                {
     1429                    "name": "Sebastian Bergmann",
     1430                    "email": "sebastian@phpunit.de"
     1431                }
     1432            ],
     1433            "description": "Traverses array structures and object graphs to enumerate all referenced objects",
     1434            "homepage": "https://github.com/sebastianbergmann/object-enumerator/",
     1435            "support": {
     1436                "issues": "https://github.com/sebastianbergmann/object-enumerator/issues",
     1437                "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4"
     1438            },
     1439            "funding": [
     1440                {
     1441                    "url": "https://github.com/sebastianbergmann",
     1442                    "type": "github"
     1443                }
     1444            ],
     1445            "time": "2020-10-26T13:12:34+00:00"
     1446        },
     1447        {
     1448            "name": "sebastian/object-reflector",
     1449            "version": "2.0.4",
     1450            "source": {
     1451                "type": "git",
     1452                "url": "https://github.com/sebastianbergmann/object-reflector.git",
     1453                "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7"
     1454            },
     1455            "dist": {
     1456                "type": "zip",
     1457                "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7",
     1458                "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7",
     1459                "shasum": ""
     1460            },
     1461            "require": {
     1462                "php": ">=7.3"
     1463            },
     1464            "require-dev": {
     1465                "phpunit/phpunit": "^9.3"
     1466            },
     1467            "type": "library",
     1468            "extra": {
     1469                "branch-alias": {
     1470                    "dev-master": "2.0-dev"
     1471                }
     1472            },
     1473            "autoload": {
     1474                "classmap": [
     1475                    "src/"
     1476                ]
     1477            },
     1478            "notification-url": "https://packagist.org/downloads/",
     1479            "license": [
     1480                "BSD-3-Clause"
     1481            ],
     1482            "authors": [
     1483                {
     1484                    "name": "Sebastian Bergmann",
     1485                    "email": "sebastian@phpunit.de"
     1486                }
     1487            ],
     1488            "description": "Allows reflection of object attributes, including inherited and non-public ones",
     1489            "homepage": "https://github.com/sebastianbergmann/object-reflector/",
     1490            "support": {
     1491                "issues": "https://github.com/sebastianbergmann/object-reflector/issues",
     1492                "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4"
     1493            },
     1494            "funding": [
     1495                {
     1496                    "url": "https://github.com/sebastianbergmann",
     1497                    "type": "github"
     1498                }
     1499            ],
     1500            "time": "2020-10-26T13:14:26+00:00"
     1501        },
     1502        {
     1503            "name": "sebastian/recursion-context",
     1504            "version": "4.0.7",
     1505            "source": {
     1506                "type": "git",
     1507                "url": "https://github.com/sebastianbergmann/recursion-context.git",
     1508                "reference": "c85be6922b7fd365942b986b9a50397d65407611"
     1509            },
     1510            "dist": {
     1511                "type": "zip",
     1512                "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/c85be6922b7fd365942b986b9a50397d65407611",
     1513                "reference": "c85be6922b7fd365942b986b9a50397d65407611",
     1514                "shasum": ""
     1515            },
     1516            "require": {
     1517                "php": ">=7.3"
     1518            },
     1519            "require-dev": {
     1520                "phpunit/phpunit": "^9.3"
     1521            },
     1522            "type": "library",
     1523            "extra": {
     1524                "branch-alias": {
     1525                    "dev-master": "4.0-dev"
     1526                }
     1527            },
     1528            "autoload": {
     1529                "classmap": [
     1530                    "src/"
     1531                ]
     1532            },
     1533            "notification-url": "https://packagist.org/downloads/",
     1534            "license": [
     1535                "BSD-3-Clause"
     1536            ],
     1537            "authors": [
     1538                {
     1539                    "name": "Sebastian Bergmann",
     1540                    "email": "sebastian@phpunit.de"
     1541                },
     1542                {
     1543                    "name": "Jeff Welch",
     1544                    "email": "whatthejeff@gmail.com"
     1545                },
     1546                {
     1547                    "name": "Adam Harvey",
     1548                    "email": "aharvey@php.net"
     1549                }
     1550            ],
     1551            "description": "Provides functionality to recursively process PHP variables",
     1552            "homepage": "https://github.com/sebastianbergmann/recursion-context",
     1553            "support": {
     1554                "issues": "https://github.com/sebastianbergmann/recursion-context/issues",
     1555                "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.7"
     1556            },
     1557            "funding": [
     1558                {
     1559                    "url": "https://github.com/sebastianbergmann",
     1560                    "type": "github"
     1561                },
     1562                {
     1563                    "url": "https://liberapay.com/sebastianbergmann",
     1564                    "type": "liberapay"
     1565                },
     1566                {
     1567                    "url": "https://thanks.dev/u/gh/sebastianbergmann",
     1568                    "type": "thanks_dev"
     1569                },
     1570                {
     1571                    "url": "https://tidelift.com/funding/github/packagist/sebastian/recursion-context",
     1572                    "type": "tidelift"
     1573                }
     1574            ],
     1575            "time": "2026-08-11T05:25:24+00:00"
     1576        },
     1577        {
     1578            "name": "sebastian/resource-operations",
     1579            "version": "3.0.4",
     1580            "source": {
     1581                "type": "git",
     1582                "url": "https://github.com/sebastianbergmann/resource-operations.git",
     1583                "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e"
     1584            },
     1585            "dist": {
     1586                "type": "zip",
     1587                "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e",
     1588                "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e",
     1589                "shasum": ""
     1590            },
     1591            "require": {
     1592                "php": ">=7.3"
     1593            },
     1594            "require-dev": {
     1595                "phpunit/phpunit": "^9.0"
     1596            },
     1597            "type": "library",
     1598            "extra": {
     1599                "branch-alias": {
     1600                    "dev-main": "3.0-dev"
     1601                }
     1602            },
     1603            "autoload": {
     1604                "classmap": [
     1605                    "src/"
     1606                ]
     1607            },
     1608            "notification-url": "https://packagist.org/downloads/",
     1609            "license": [
     1610                "BSD-3-Clause"
     1611            ],
     1612            "authors": [
     1613                {
     1614                    "name": "Sebastian Bergmann",
     1615                    "email": "sebastian@phpunit.de"
     1616                }
     1617            ],
     1618            "description": "Provides a list of PHP built-in functions that operate on resources",
     1619            "homepage": "https://www.github.com/sebastianbergmann/resource-operations",
     1620            "support": {
     1621                "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.4"
     1622            },
     1623            "funding": [
     1624                {
     1625                    "url": "https://github.com/sebastianbergmann",
     1626                    "type": "github"
     1627                }
     1628            ],
     1629            "time": "2024-03-14T16:00:52+00:00"
     1630        },
     1631        {
     1632            "name": "sebastian/type",
     1633            "version": "3.2.1",
     1634            "source": {
     1635                "type": "git",
     1636                "url": "https://github.com/sebastianbergmann/type.git",
     1637                "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7"
     1638            },
     1639            "dist": {
     1640                "type": "zip",
     1641                "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7",
     1642                "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7",
     1643                "shasum": ""
     1644            },
     1645            "require": {
     1646                "php": ">=7.3"
     1647            },
     1648            "require-dev": {
     1649                "phpunit/phpunit": "^9.5"
     1650            },
     1651            "type": "library",
     1652            "extra": {
     1653                "branch-alias": {
     1654                    "dev-master": "3.2-dev"
     1655                }
     1656            },
     1657            "autoload": {
     1658                "classmap": [
     1659                    "src/"
     1660                ]
     1661            },
     1662            "notification-url": "https://packagist.org/downloads/",
     1663            "license": [
     1664                "BSD-3-Clause"
     1665            ],
     1666            "authors": [
     1667                {
     1668                    "name": "Sebastian Bergmann",
     1669                    "email": "sebastian@phpunit.de",
     1670                    "role": "lead"
     1671                }
     1672            ],
     1673            "description": "Collection of value objects that represent the types of the PHP type system",
     1674            "homepage": "https://github.com/sebastianbergmann/type",
     1675            "support": {
     1676                "issues": "https://github.com/sebastianbergmann/type/issues",
     1677                "source": "https://github.com/sebastianbergmann/type/tree/3.2.1"
     1678            },
     1679            "funding": [
     1680                {
     1681                    "url": "https://github.com/sebastianbergmann",
     1682                    "type": "github"
     1683                }
     1684            ],
     1685            "time": "2023-02-03T06:13:03+00:00"
     1686        },
     1687        {
     1688            "name": "sebastian/version",
     1689            "version": "3.0.2",
     1690            "source": {
     1691                "type": "git",
     1692                "url": "https://github.com/sebastianbergmann/version.git",
     1693                "reference": "c6c1022351a901512170118436c764e473f6de8c"
     1694            },
     1695            "dist": {
     1696                "type": "zip",
     1697                "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c",
     1698                "reference": "c6c1022351a901512170118436c764e473f6de8c",
     1699                "shasum": ""
     1700            },
     1701            "require": {
     1702                "php": ">=7.3"
     1703            },
     1704            "type": "library",
     1705            "extra": {
     1706                "branch-alias": {
     1707                    "dev-master": "3.0-dev"
     1708                }
     1709            },
     1710            "autoload": {
     1711                "classmap": [
     1712                    "src/"
     1713                ]
     1714            },
     1715            "notification-url": "https://packagist.org/downloads/",
     1716            "license": [
     1717                "BSD-3-Clause"
     1718            ],
     1719            "authors": [
     1720                {
     1721                    "name": "Sebastian Bergmann",
     1722                    "email": "sebastian@phpunit.de",
     1723                    "role": "lead"
     1724                }
     1725            ],
     1726            "description": "Library that helps with managing the version number of Git-hosted PHP projects",
     1727            "homepage": "https://github.com/sebastianbergmann/version",
     1728            "support": {
     1729                "issues": "https://github.com/sebastianbergmann/version/issues",
     1730                "source": "https://github.com/sebastianbergmann/version/tree/3.0.2"
     1731            },
     1732            "funding": [
     1733                {
     1734                    "url": "https://github.com/sebastianbergmann",
     1735                    "type": "github"
     1736                }
     1737            ],
     1738            "time": "2020-09-28T06:39:44+00:00"
     1739        },
     1740        {
     1741            "name": "theseer/tokenizer",
     1742            "version": "1.3.1",
     1743            "source": {
     1744                "type": "git",
     1745                "url": "https://github.com/theseer/tokenizer.git",
     1746                "reference": "b7489ce515e168639d17feec34b8847c326b0b3c"
     1747            },
     1748            "dist": {
     1749                "type": "zip",
     1750                "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b7489ce515e168639d17feec34b8847c326b0b3c",
     1751                "reference": "b7489ce515e168639d17feec34b8847c326b0b3c",
     1752                "shasum": ""
     1753            },
     1754            "require": {
     1755                "ext-dom": "*",
     1756                "ext-tokenizer": "*",
     1757                "ext-xmlwriter": "*",
     1758                "php": "^7.2 || ^8.0"
     1759            },
     1760            "type": "library",
     1761            "autoload": {
     1762                "classmap": [
     1763                    "src/"
     1764                ]
     1765            },
     1766            "notification-url": "https://packagist.org/downloads/",
     1767            "license": [
     1768                "BSD-3-Clause"
     1769            ],
     1770            "authors": [
     1771                {
     1772                    "name": "Arne Blankerts",
     1773                    "email": "arne@blankerts.de",
     1774                    "role": "Developer"
     1775                }
     1776            ],
     1777            "description": "A small library for converting tokenized PHP source code into XML and potentially other formats",
     1778            "support": {
     1779                "issues": "https://github.com/theseer/tokenizer/issues",
     1780                "source": "https://github.com/theseer/tokenizer/tree/1.3.1"
     1781            },
     1782            "funding": [
     1783                {
     1784                    "url": "https://github.com/theseer",
     1785                    "type": "github"
     1786                }
     1787            ],
     1788            "time": "2025-11-17T20:03:58+00:00"
     1789        }
     1790    ],
    101791    "aliases": [],
    111792    "minimum-stability": "stable",
  • debughawk/trunk/debughawk.php

    r3433055 r3783821  
    66 * Author: DebugHawk
    77 * Author URI: https://debughawk.com/
    8  * Version: 1.2.0
     8 * Version: 1.3.0
    99 * Requires PHP: 7.4
    1010 * Requires WP: 6.3
    … …  
    2525
    2626$config  = defined( 'DEBUGHAWK_CONFIG' ) ? DEBUGHAWK_CONFIG : [];
    27 $version = '1.2.0';
     27$version = '1.3.0';
    2828
    2929( new Plugin(
  • debughawk/trunk/readme.txt

    r3433055 r3783821  
    11=== DebugHawk - WordPress Performance Monitoring & Debugging ===
    22Contributors: A5hleyRich
    3 Tags: performance, monitoring, debug, slow, speed, database, queries, core web vitals, optimization, profiling, cache, site health
    4 Tested up to: 6.9
    5 Stable tag: 1.2.0
     3Tags: performance, monitoring, debug, core web vitals, profiling
     4Tested up to: 7.1
     5Stable tag: 1.3.0
    66Requires at least: 6.3
    77Requires PHP: 7.4
    … …  
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
    1010
    11 Monitor WordPress performance, debug slow sites, track Core Web Vitals, database queries, memory usage, and cache effectiveness. Performance monitoring built specifically for WordPress.
     11Performance monitoring built specifically for WordPress. Track Core Web Vitals, slow database queries, external API calls and cache effectiveness.
    1212
    1313== Description ==
    … …  
    3636* **Object Cache Performance** - Hit ratio, cache effectiveness
    3737* **Page Cache Effectiveness** - Cache hits vs misses
    38 * **Redirect Detection** - Unnecessary redirects slowing page loads
    3938
    4039= Debug Slow WordPress Sites =
    … …  
    148147
    149148== Changelog ==
     149
     150= 1.3.0 =
     151* Slow queries and external requests are now attributed to the plugin or theme that made them, including code run from hooks, symlinked plugins and themes, and custom layouts such as Bedrock
     152* Slow query values, such as emails, IDs and search terms, are replaced with placeholders before they leave your site
     153* Query values and credentials are removed from page and external request URLs before they're sent
     154* Up to 10 slow queries are now reported per page, up from 3, and long queries are kept up to 2,048 characters
     155* Failed and timed-out external requests now show how long they held up the page, along with their error message
     156* Lower memory use and overhead on pages that run thousands of database queries
     157* More accurate database time on pages that run nested queries
     158* Response caching plugins now work as expected for external requests while DebugHawk is active
     159* Admin screens shown in a popup, such as plugin details, no longer count as separate page views
     160* Customizer previews and the Site Editor are now excluded correctly, including on subdirectory installs
     161* An error collecting one metric no longer stops the rest of the page from loading
     162* Pages with unusual characters in a URL or query are now reported instead of being skipped
     163* Pages with many external requests now report the slowest 20, so the data stays within the browser's size limit
     164* Removed redirect monitoring and the "Monitor Redirects" setting
    150165
    151166= 1.2.0 =
    … …  
    183198== Upgrade Notice ==
    184199
     200= 1.3.0 =
     201More accurate plugin and theme attribution for slow queries and external requests, and query values are no longer sent. Redirect monitoring has been removed.
     202
    185203= 1.1.1 =
    186204Important update: Ensures db.php drop-in is properly managed during plugin deactivation.
  • debughawk/trunk/resources/dist/beacon.js

    r3372612 r3783821  
    1 (function(){"use strict";var O,z=-1,v=function(r){addEventListener("pageshow",function(e){e.persisted&&(z=e.timeStamp,r(e))},!0)},P=function(){var r=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(r&&r.responseStart>0&&r.responseStart<performance.now())return r},S=function(){var r=P();return r&&r.activationStart||0},p=function(r,e){var t=P(),i="navigate";return z>=0?i="back-forward-cache":t&&(document.prerendering||S()>0?i="prerender":document.wasDiscarded?i="restore":t.type&&(i=t.type.replace(/_/g,"-"))),{name:r,value:e===void 0?-1:e,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},M=function(r,e,t){try{if(PerformanceObserver.supportedEntryTypes.includes(r)){var i=new PerformanceObserver(function(n){Promise.resolve().then(function(){e(n.getEntries())})});return i.observe(Object.assign({type:r,buffered:!0},t||{})),i}}catch{}},g=function(r,e,t,i){var n,o;return function(c){e.value>=0&&(c||i)&&((o=e.value-(n||0))||n===void 0)&&(n=e.value,e.delta=o,e.rating=function(d,a){return d>a[1]?"poor":d>a[0]?"needs-improvement":"good"}(e.value,t),r(e))}},A=function(r){requestAnimationFrame(function(){return requestAnimationFrame(function(){return r()})})},B=function(r){document.addEventListener("visibilitychange",function(){document.visibilityState==="hidden"&&r()})},T=function(r){var e=!1;return function(){e||(r(),e=!0)}},y=-1,L=function(){return document.visibilityState!=="hidden"||document.prerendering?1/0:0},_=function(r){document.visibilityState==="hidden"&&y>-1&&(y=r.type==="visibilitychange"?r.timeStamp:0,$())},R=function(){addEventListener("visibilitychange",_,!0),addEventListener("prerenderingchange",_,!0)},$=function(){removeEventListener("visibilitychange",_,!0),removeEventListener("prerenderingchange",_,!0)},D=function(){return y<0&&(y=L(),R(),v(function(){setTimeout(function(){y=L(),R()},0)})),{get firstHiddenTime(){return y}}},F=function(r){document.prerendering?addEventListener("prerenderingchange",function(){return r()},!0):r()},V=[1800,3e3],W=function(r,e){e=e||{},F(function(){var t,i=D(),n=p("FCP"),o=M("paint",function(c){c.forEach(function(d){d.name==="first-contentful-paint"&&(o.disconnect(),d.startTime<i.firstHiddenTime&&(n.value=Math.max(d.startTime-S(),0),n.entries.push(d),t(!0)))})});o&&(t=g(r,n,V,e.reportAllChanges),v(function(c){n=p("FCP"),t=g(r,n,V,e.reportAllChanges),A(function(){n.value=performance.now()-c.timeStamp,t(!0)})}))})},I=[.1,.25],q=function(r,e){e=e||{},W(T(function(){var t,i=p("CLS",0),n=0,o=[],c=function(a){a.forEach(function(f){if(!f.hadRecentInput){var m=o[0],x=o[o.length-1];n&&f.startTime-x.startTime<1e3&&f.startTime-m.startTime<5e3?(n+=f.value,o.push(f)):(n=f.value,o=[f])}}),n>i.value&&(i.value=n,i.entries=o,t())},d=M("layout-shift",c);d&&(t=g(r,i,I,e.reportAllChanges),B(function(){c(d.takeRecords()),t(!0)}),v(function(){n=0,i=p("CLS",0),t=g(r,i,I,e.reportAllChanges),A(function(){return t()})}),setTimeout(t,0))}))},j=0,N=1/0,k=0,ee=function(r){r.forEach(function(e){e.interactionId&&(N=Math.min(N,e.interactionId),k=Math.max(k,e.interactionId),j=k?(k-N)/7+1:0)})},G=function(){return O?j:performance.interactionCount||0},te=function(){"interactionCount"in performance||O||(O=M("event",ee,{type:"event",buffered:!0,durationThreshold:0}))},b=[],E=new Map,Q=0,re=function(){var r=Math.min(b.length-1,Math.floor((G()-Q)/50));return b[r]},ie=[],se=function(r){if(ie.forEach(function(n){return n(r)}),r.interactionId||r.entryType==="first-input"){var e=b[b.length-1],t=E.get(r.interactionId);if(t||b.length<10||r.duration>e.latency){if(t)r.duration>t.latency?(t.entries=[r],t.latency=r.duration):r.duration===t.latency&&r.startTime===t.entries[0].startTime&&t.entries.push(r);else{var i={id:r.interactionId,latency:r.duration,entries:[r]};E.set(i.id,i),b.push(i)}b.sort(function(n,o){return o.latency-n.latency}),b.length>10&&b.splice(10).forEach(function(n){return E.delete(n.id)})}}},H=function(r){var e=self.requestIdleCallback||self.setTimeout,t=-1;return r=T(r),document.visibilityState==="hidden"?r():(t=e(r),B(r)),t},U=[200,500],ne=function(r,e){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(e=e||{},F(function(){var t;te();var i,n=p("INP"),o=function(d){H(function(){d.forEach(se);var a=re();a&&a.latency!==n.value&&(n.value=a.latency,n.entries=a.entries,i())})},c=M("event",o,{durationThreshold:(t=e.durationThreshold)!==null&&t!==void 0?t:40});i=g(r,n,U,e.reportAllChanges),c&&(c.observe({type:"first-input",buffered:!0}),B(function(){o(c.takeRecords()),i(!0)}),v(function(){Q=G(),b.length=0,E.clear(),n=p("INP"),i=g(r,n,U,e.reportAllChanges)}))}))},K=[2500,4e3],C={},oe=function(r,e){e=e||{},F(function(){var t,i=D(),n=p("LCP"),o=function(a){e.reportAllChanges||(a=a.slice(-1)),a.forEach(function(f){f.startTime<i.firstHiddenTime&&(n.value=Math.max(f.startTime-S(),0),n.entries=[f],t())})},c=M("largest-contentful-paint",o);if(c){t=g(r,n,K,e.reportAllChanges);var d=T(function(){C[n.id]||(o(c.takeRecords()),c.disconnect(),C[n.id]=!0,t(!0))});["keydown","click"].forEach(function(a){addEventListener(a,function(){return H(d)},{once:!0,capture:!0})}),B(d),v(function(a){n=p("LCP"),t=g(r,n,K,e.reportAllChanges),A(function(){n.value=performance.now()-a.timeStamp,C[n.id]=!0,t(!0)})})}})},J=[800,1800],ae=function r(e){document.prerendering?F(function(){return r(e)}):document.readyState!=="complete"?addEventListener("load",function(){return r(e)},!0):setTimeout(e,0)},ce=function(r,e){e=e||{};var t=p("TTFB"),i=g(r,t,J,e.reportAllChanges);ae(function(){var n=P();n&&(t.value=Math.max(n.responseStart-S(),0),t.entries=[n],i(!0),v(function(){t=p("TTFB",0),(i=g(r,t,J,e.reportAllChanges))(!0)}))})};const de={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},Z={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},l={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},h={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},w={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"};class s{static getFirstMatch(e,t){const i=t.match(e);return i&&i.length>0&&i[1]||""}static getSecondMatch(e,t){const i=t.match(e);return i&&i.length>1&&i[2]||""}static matchAndReturnConst(e,t,i){if(e.test(t))return i}static getWindowsVersionName(e){switch(e){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}static getMacOSVersionName(e){const t=e.split(".").splice(0,2).map(i=>parseInt(i,10)||0);if(t.push(0),t[0]===10)switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}}static getAndroidVersionName(e){const t=e.split(".").splice(0,2).map(i=>parseInt(i,10)||0);if(t.push(0),!(t[0]===1&&t[1]<5)){if(t[0]===1&&t[1]<6)return"Cupcake";if(t[0]===1&&t[1]>=6)return"Donut";if(t[0]===2&&t[1]<2)return"Eclair";if(t[0]===2&&t[1]===2)return"Froyo";if(t[0]===2&&t[1]>2)return"Gingerbread";if(t[0]===3)return"Honeycomb";if(t[0]===4&&t[1]<1)return"Ice Cream Sandwich";if(t[0]===4&&t[1]<4)return"Jelly Bean";if(t[0]===4&&t[1]>=4)return"KitKat";if(t[0]===5)return"Lollipop";if(t[0]===6)return"Marshmallow";if(t[0]===7)return"Nougat";if(t[0]===8)return"Oreo";if(t[0]===9)return"Pie"}}static getVersionPrecision(e){return e.split(".").length}static compareVersions(e,t,i=!1){const n=s.getVersionPrecision(e),o=s.getVersionPrecision(t);let c=Math.max(n,o),d=0;const a=s.map([e,t],f=>{const m=c-s.getVersionPrecision(f),x=f+new Array(m+1).join(".0");return s.map(x.split("."),Y=>new Array(20-Y.length).join("0")+Y).reverse()});for(i&&(d=c-Math.min(n,o)),c-=1;c>=d;){if(a[0][c]>a[1][c])return 1;if(a[0][c]===a[1][c]){if(c===d)return 0;c-=1}else if(a[0][c]<a[1][c])return-1}}static map(e,t){const i=[];let n;if(Array.prototype.map)return Array.prototype.map.call(e,t);for(n=0;n<e.length;n+=1)i.push(t(e[n]));return i}static find(e,t){let i,n;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(i=0,n=e.length;i<n;i+=1){const o=e[i];if(t(o,i))return o}}static assign(e,...t){const i=e;let n,o;if(Object.assign)return Object.assign(e,...t);for(n=0,o=t.length;n<o;n+=1){const c=t[n];typeof c=="object"&&c!==null&&Object.keys(c).forEach(a=>{i[a]=c[a]})}return e}static getBrowserAlias(e){return de[e]}static getBrowserTypeByAlias(e){return Z[e]||""}}const u=/version\/(\d+(\.?_?\d+)+)/i,ue=[{test:[/googlebot/i],describe(r){const e={name:"Googlebot"},t=s.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/opera/i],describe(r){const e={name:"Opera"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/opr\/|opios/i],describe(r){const e={name:"Opera"},t=s.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/SamsungBrowser/i],describe(r){const e={name:"Samsung Internet for Android"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/Whale/i],describe(r){const e={name:"NAVER Whale Browser"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/MZBrowser/i],describe(r){const e={name:"MZ Browser"},t=s.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/focus/i],describe(r){const e={name:"Focus"},t=s.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/swing/i],describe(r){const e={name:"Swing"},t=s.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/coast/i],describe(r){const e={name:"Opera Coast"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(r){const e={name:"Opera Touch"},t=s.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/yabrowser/i],describe(r){const e={name:"Yandex Browser"},t=s.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/ucbrowser/i],describe(r){const e={name:"UC Browser"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/Maxthon|mxios/i],describe(r){const e={name:"Maxthon"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/epiphany/i],describe(r){const e={name:"Epiphany"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/puffin/i],describe(r){const e={name:"Puffin"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/sleipnir/i],describe(r){const e={name:"Sleipnir"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/k-meleon/i],describe(r){const e={name:"K-Meleon"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/micromessenger/i],describe(r){const e={name:"WeChat"},t=s.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/qqbrowser/i],describe(r){const e={name:/qqbrowserlite/i.test(r)?"QQ Browser Lite":"QQ Browser"},t=s.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/msie|trident/i],describe(r){const e={name:"Internet Explorer"},t=s.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/\sedg\//i],describe(r){const e={name:"Microsoft Edge"},t=s.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/edg([ea]|ios)/i],describe(r){const e={name:"Microsoft Edge"},t=s.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/vivaldi/i],describe(r){const e={name:"Vivaldi"},t=s.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/seamonkey/i],describe(r){const e={name:"SeaMonkey"},t=s.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/sailfish/i],describe(r){const e={name:"Sailfish"},t=s.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,r);return t&&(e.version=t),e}},{test:[/silk/i],describe(r){const e={name:"Amazon Silk"},t=s.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/phantom/i],describe(r){const e={name:"PhantomJS"},t=s.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/slimerjs/i],describe(r){const e={name:"SlimerJS"},t=s.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(r){const e={name:"BlackBerry"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/(web|hpw)[o0]s/i],describe(r){const e={name:"WebOS Browser"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/bada/i],describe(r){const e={name:"Bada"},t=s.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/tizen/i],describe(r){const e={name:"Tizen"},t=s.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/qupzilla/i],describe(r){const e={name:"QupZilla"},t=s.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/firefox|iceweasel|fxios/i],describe(r){const e={name:"Firefox"},t=s.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/electron/i],describe(r){const e={name:"Electron"},t=s.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/MiuiBrowser/i],describe(r){const e={name:"Miui"},t=s.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/chromium/i],describe(r){const e={name:"Chromium"},t=s.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/chrome|crios|crmo/i],describe(r){const e={name:"Chrome"},t=s.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/GSA/i],describe(r){const e={name:"Google Search"},t=s.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test(r){const e=!r.test(/like android/i),t=r.test(/android/i);return e&&t},describe(r){const e={name:"Android Browser"},t=s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/playstation 4/i],describe(r){const e={name:"PlayStation 4"},t=s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/safari|applewebkit/i],describe(r){const e={name:"Safari"},t=s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/.*/i],describe(r){const e=/^(.*)\/(.*) /,t=/^(.*)\/(.*)[ \t]\((.*)/,n=r.search("\\(")!==-1?t:e;return{name:s.getFirstMatch(n,r),version:s.getSecondMatch(n,r)}}}],le=[{test:[/Roku\/DVP/],describe(r){const e=s.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,r);return{name:h.Roku,version:e}}},{test:[/windows phone/i],describe(r){const e=s.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,r);return{name:h.WindowsPhone,version:e}}},{test:[/windows /i],describe(r){const e=s.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,r),t=s.getWindowsVersionName(e);return{name:h.Windows,version:e,versionName:t}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(r){const e={name:h.iOS},t=s.getSecondMatch(/(Version\/)(\d[\d.]+)/,r);return t&&(e.version=t),e}},{test:[/macintosh/i],describe(r){const e=s.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,r).replace(/[_\s]/g,"."),t=s.getMacOSVersionName(e),i={name:h.MacOS,version:e};return t&&(i.versionName=t),i}},{test:[/(ipod|iphone|ipad)/i],describe(r){const e=s.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,r).replace(/[_\s]/g,".");return{name:h.iOS,version:e}}},{test(r){const e=!r.test(/like android/i),t=r.test(/android/i);return e&&t},describe(r){const e=s.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,r),t=s.getAndroidVersionName(e),i={name:h.Android,version:e};return t&&(i.versionName=t),i}},{test:[/(web|hpw)[o0]s/i],describe(r){const e=s.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,r),t={name:h.WebOS};return e&&e.length&&(t.version=e),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(r){const e=s.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,r)||s.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,r)||s.getFirstMatch(/\bbb(\d+)/i,r);return{name:h.BlackBerry,version:e}}},{test:[/bada/i],describe(r){const e=s.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,r);return{name:h.Bada,version:e}}},{test:[/tizen/i],describe(r){const e=s.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,r);return{name:h.Tizen,version:e}}},{test:[/linux/i],describe(){return{name:h.Linux}}},{test:[/CrOS/],describe(){return{name:h.ChromeOS}}},{test:[/PlayStation 4/],describe(r){const e=s.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,r);return{name:h.PlayStation4,version:e}}}],fe=[{test:[/googlebot/i],describe(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe(r){const e=s.getFirstMatch(/(can-l01)/i,r)&&"Nova",t={type:l.mobile,vendor:"Huawei"};return e&&(t.model=e),t}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe(){return{type:l.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe(){return{type:l.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(){return{type:l.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe(){return{type:l.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe(){return{type:l.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe(){return{type:l.tablet}}},{test(r){const e=r.test(/ipod|iphone/i),t=r.test(/like (ipod|iphone)/i);return e&&!t},describe(r){const e=s.getFirstMatch(/(ipod|iphone)/i,r);return{type:l.mobile,vendor:"Apple",model:e}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe(){return{type:l.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe(){return{type:l.mobile}}},{test(r){return r.getBrowserName(!0)==="blackberry"},describe(){return{type:l.mobile,vendor:"BlackBerry"}}},{test(r){return r.getBrowserName(!0)==="bada"},describe(){return{type:l.mobile}}},{test(r){return r.getBrowserName()==="windows phone"},describe(){return{type:l.mobile,vendor:"Microsoft"}}},{test(r){const e=Number(String(r.getOSVersion()).split(".")[0]);return r.getOSName(!0)==="android"&&e>=3},describe(){return{type:l.tablet}}},{test(r){return r.getOSName(!0)==="android"},describe(){return{type:l.mobile}}},{test(r){return r.getOSName(!0)==="macos"},describe(){return{type:l.desktop,vendor:"Apple"}}},{test(r){return r.getOSName(!0)==="windows"},describe(){return{type:l.desktop}}},{test(r){return r.getOSName(!0)==="linux"},describe(){return{type:l.desktop}}},{test(r){return r.getOSName(!0)==="playstation 4"},describe(){return{type:l.tv}}},{test(r){return r.getOSName(!0)==="roku"},describe(){return{type:l.tv}}}],he=[{test(r){return r.getBrowserName(!0)==="microsoft edge"},describe(r){if(/\sedg\//i.test(r))return{name:w.Blink};const t=s.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,r);return{name:w.EdgeHTML,version:t}}},{test:[/trident/i],describe(r){const e={name:w.Trident},t=s.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test(r){return r.test(/presto/i)},describe(r){const e={name:w.Presto},t=s.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test(r){const e=r.test(/gecko/i),t=r.test(/like gecko/i);return e&&!t},describe(r){const e={name:w.Gecko},t=s.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/(apple)?webkit\/537\.36/i],describe(){return{name:w.Blink}}},{test:[/(apple)?webkit/i],describe(r){const e={name:w.WebKit},t=s.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}}];class X{constructor(e,t=!1){if(e==null||e==="")throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},t!==!0&&this.parse()}getUA(){return this._ua}test(e){return e.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const e=s.find(ue,t=>{if(typeof t.test=="function")return t.test(this);if(t.test instanceof Array)return t.test.some(i=>this.test(i));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.browser=e.describe(this.getUA())),this.parsedResult.browser}getBrowser(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}getBrowserName(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""}getBrowserVersion(){return this.getBrowser().version}getOS(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()}parseOS(){this.parsedResult.os={};const e=s.find(le,t=>{if(typeof t.test=="function")return t.test(this);if(t.test instanceof Array)return t.test.some(i=>this.test(i));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.os=e.describe(this.getUA())),this.parsedResult.os}getOSName(e){const{name:t}=this.getOS();return e?String(t).toLowerCase()||"":t||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(e=!1){const{type:t}=this.getPlatform();return e?String(t).toLowerCase()||"":t||""}parsePlatform(){this.parsedResult.platform={};const e=s.find(fe,t=>{if(typeof t.test=="function")return t.test(this);if(t.test instanceof Array)return t.test.some(i=>this.test(i));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.platform=e.describe(this.getUA())),this.parsedResult.platform}getEngine(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}getEngineName(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}parseEngine(){this.parsedResult.engine={};const e=s.find(he,t=>{if(typeof t.test=="function")return t.test(this);if(t.test instanceof Array)return t.test.some(i=>this.test(i));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.engine=e.describe(this.getUA())),this.parsedResult.engine}parse(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}getResult(){return s.assign({},this.parsedResult)}satisfies(e){const t={};let i=0;const n={};let o=0;if(Object.keys(e).forEach(d=>{const a=e[d];typeof a=="string"?(n[d]=a,o+=1):typeof a=="object"&&(t[d]=a,i+=1)}),i>0){const d=Object.keys(t),a=s.find(d,m=>this.isOS(m));if(a){const m=this.satisfies(t[a]);if(m!==void 0)return m}const f=s.find(d,m=>this.isPlatform(m));if(f){const m=this.satisfies(t[f]);if(m!==void 0)return m}}if(o>0){const d=Object.keys(n),a=s.find(d,f=>this.isBrowser(f,!0));if(a!==void 0)return this.compareVersion(n[a])}}isBrowser(e,t=!1){const i=this.getBrowserName().toLowerCase();let n=e.toLowerCase();const o=s.getBrowserTypeByAlias(n);return t&&o&&(n=o.toLowerCase()),n===i}compareVersion(e){let t=[0],i=e,n=!1;const o=this.getBrowserVersion();if(typeof o=="string")return e[0]===">"||e[0]==="<"?(i=e.substr(1),e[1]==="="?(n=!0,i=e.substr(2)):t=[],e[0]===">"?t.push(1):t.push(-1)):e[0]==="="?i=e.substr(1):e[0]==="~"&&(n=!0,i=e.substr(1)),t.indexOf(s.compareVersions(o,i,n))>-1}isOS(e){return this.getOSName(!0)===String(e).toLowerCase()}isPlatform(e){return this.getPlatformType(!0)===String(e).toLowerCase()}isEngine(e){return this.getEngineName(!0)===String(e).toLowerCase()}is(e,t=!1){return this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)}some(e=[]){return e.some(t=>this.is(t))}}/*!
     1(function(){"use strict";var O,z=-1,v=function(r){addEventListener("pageshow",function(e){e.persisted&&(z=e.timeStamp,r(e))},!0)},P=function(){var r=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(r&&r.responseStart>0&&r.responseStart<performance.now())return r},S=function(){var r=P();return r&&r.activationStart||0},p=function(r,e){var t=P(),i="navigate";return z>=0?i="back-forward-cache":t&&(document.prerendering||S()>0?i="prerender":document.wasDiscarded?i="restore":t.type&&(i=t.type.replace(/_/g,"-"))),{name:r,value:e===void 0?-1:e,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},M=function(r,e,t){try{if(PerformanceObserver.supportedEntryTypes.includes(r)){var i=new PerformanceObserver(function(n){Promise.resolve().then(function(){e(n.getEntries())})});return i.observe(Object.assign({type:r,buffered:!0},t||{})),i}}catch{}},g=function(r,e,t,i){var n,o;return function(c){e.value>=0&&(c||i)&&((o=e.value-(n||0))||n===void 0)&&(n=e.value,e.delta=o,e.rating=function(d,a){return d>a[1]?"poor":d>a[0]?"needs-improvement":"good"}(e.value,t),r(e))}},A=function(r){requestAnimationFrame(function(){return requestAnimationFrame(function(){return r()})})},B=function(r){document.addEventListener("visibilitychange",function(){document.visibilityState==="hidden"&&r()})},T=function(r){var e=!1;return function(){e||(r(),e=!0)}},y=-1,L=function(){return document.visibilityState!=="hidden"||document.prerendering?1/0:0},_=function(r){document.visibilityState==="hidden"&&y>-1&&(y=r.type==="visibilitychange"?r.timeStamp:0,$())},R=function(){addEventListener("visibilitychange",_,!0),addEventListener("prerenderingchange",_,!0)},$=function(){removeEventListener("visibilitychange",_,!0),removeEventListener("prerenderingchange",_,!0)},W=function(){return y<0&&(y=L(),R(),v(function(){setTimeout(function(){y=L(),R()},0)})),{get firstHiddenTime(){return y}}},F=function(r){document.prerendering?addEventListener("prerenderingchange",function(){return r()},!0):r()},D=[1800,3e3],V=function(r,e){e=e||{},F(function(){var t,i=W(),n=p("FCP"),o=M("paint",function(c){c.forEach(function(d){d.name==="first-contentful-paint"&&(o.disconnect(),d.startTime<i.firstHiddenTime&&(n.value=Math.max(d.startTime-S(),0),n.entries.push(d),t(!0)))})});o&&(t=g(r,n,D,e.reportAllChanges),v(function(c){n=p("FCP"),t=g(r,n,D,e.reportAllChanges),A(function(){n.value=performance.now()-c.timeStamp,t(!0)})}))})},I=[.1,.25],q=function(r,e){e=e||{},V(T(function(){var t,i=p("CLS",0),n=0,o=[],c=function(a){a.forEach(function(f){if(!f.hadRecentInput){var m=o[0],x=o[o.length-1];n&&f.startTime-x.startTime<1e3&&f.startTime-m.startTime<5e3?(n+=f.value,o.push(f)):(n=f.value,o=[f])}}),n>i.value&&(i.value=n,i.entries=o,t())},d=M("layout-shift",c);d&&(t=g(r,i,I,e.reportAllChanges),B(function(){c(d.takeRecords()),t(!0)}),v(function(){n=0,i=p("CLS",0),t=g(r,i,I,e.reportAllChanges),A(function(){return t()})}),setTimeout(t,0))}))},j=0,N=1/0,k=0,ee=function(r){r.forEach(function(e){e.interactionId&&(N=Math.min(N,e.interactionId),k=Math.max(k,e.interactionId),j=k?(k-N)/7+1:0)})},G=function(){return O?j:performance.interactionCount||0},te=function(){"interactionCount"in performance||O||(O=M("event",ee,{type:"event",buffered:!0,durationThreshold:0}))},b=[],E=new Map,Q=0,re=function(){var r=Math.min(b.length-1,Math.floor((G()-Q)/50));return b[r]},ie=[],se=function(r){if(ie.forEach(function(n){return n(r)}),r.interactionId||r.entryType==="first-input"){var e=b[b.length-1],t=E.get(r.interactionId);if(t||b.length<10||r.duration>e.latency){if(t)r.duration>t.latency?(t.entries=[r],t.latency=r.duration):r.duration===t.latency&&r.startTime===t.entries[0].startTime&&t.entries.push(r);else{var i={id:r.interactionId,latency:r.duration,entries:[r]};E.set(i.id,i),b.push(i)}b.sort(function(n,o){return o.latency-n.latency}),b.length>10&&b.splice(10).forEach(function(n){return E.delete(n.id)})}}},H=function(r){var e=self.requestIdleCallback||self.setTimeout,t=-1;return r=T(r),document.visibilityState==="hidden"?r():(t=e(r),B(r)),t},U=[200,500],ne=function(r,e){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(e=e||{},F(function(){var t;te();var i,n=p("INP"),o=function(d){H(function(){d.forEach(se);var a=re();a&&a.latency!==n.value&&(n.value=a.latency,n.entries=a.entries,i())})},c=M("event",o,{durationThreshold:(t=e.durationThreshold)!==null&&t!==void 0?t:40});i=g(r,n,U,e.reportAllChanges),c&&(c.observe({type:"first-input",buffered:!0}),B(function(){o(c.takeRecords()),i(!0)}),v(function(){Q=G(),b.length=0,E.clear(),n=p("INP"),i=g(r,n,U,e.reportAllChanges)}))}))},K=[2500,4e3],C={},oe=function(r,e){e=e||{},F(function(){var t,i=W(),n=p("LCP"),o=function(a){e.reportAllChanges||(a=a.slice(-1)),a.forEach(function(f){f.startTime<i.firstHiddenTime&&(n.value=Math.max(f.startTime-S(),0),n.entries=[f],t())})},c=M("largest-contentful-paint",o);if(c){t=g(r,n,K,e.reportAllChanges);var d=T(function(){C[n.id]||(o(c.takeRecords()),c.disconnect(),C[n.id]=!0,t(!0))});["keydown","click"].forEach(function(a){addEventListener(a,function(){return H(d)},{once:!0,capture:!0})}),B(d),v(function(a){n=p("LCP"),t=g(r,n,K,e.reportAllChanges),A(function(){n.value=performance.now()-a.timeStamp,C[n.id]=!0,t(!0)})})}})},J=[800,1800],ae=function r(e){document.prerendering?F(function(){return r(e)}):document.readyState!=="complete"?addEventListener("load",function(){return r(e)},!0):setTimeout(e,0)},ce=function(r,e){e=e||{};var t=p("TTFB"),i=g(r,t,J,e.reportAllChanges);ae(function(){var n=P();n&&(t.value=Math.max(n.responseStart-S(),0),t.entries=[n],i(!0),v(function(){t=p("TTFB",0),(i=g(r,t,J,e.reportAllChanges))(!0)}))})};const de={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},Z={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},l={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},h={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},w={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"};class s{static getFirstMatch(e,t){const i=t.match(e);return i&&i.length>0&&i[1]||""}static getSecondMatch(e,t){const i=t.match(e);return i&&i.length>1&&i[2]||""}static matchAndReturnConst(e,t,i){if(e.test(t))return i}static getWindowsVersionName(e){switch(e){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}static getMacOSVersionName(e){const t=e.split(".").splice(0,2).map(i=>parseInt(i,10)||0);if(t.push(0),t[0]===10)switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}}static getAndroidVersionName(e){const t=e.split(".").splice(0,2).map(i=>parseInt(i,10)||0);if(t.push(0),!(t[0]===1&&t[1]<5)){if(t[0]===1&&t[1]<6)return"Cupcake";if(t[0]===1&&t[1]>=6)return"Donut";if(t[0]===2&&t[1]<2)return"Eclair";if(t[0]===2&&t[1]===2)return"Froyo";if(t[0]===2&&t[1]>2)return"Gingerbread";if(t[0]===3)return"Honeycomb";if(t[0]===4&&t[1]<1)return"Ice Cream Sandwich";if(t[0]===4&&t[1]<4)return"Jelly Bean";if(t[0]===4&&t[1]>=4)return"KitKat";if(t[0]===5)return"Lollipop";if(t[0]===6)return"Marshmallow";if(t[0]===7)return"Nougat";if(t[0]===8)return"Oreo";if(t[0]===9)return"Pie"}}static getVersionPrecision(e){return e.split(".").length}static compareVersions(e,t,i=!1){const n=s.getVersionPrecision(e),o=s.getVersionPrecision(t);let c=Math.max(n,o),d=0;const a=s.map([e,t],f=>{const m=c-s.getVersionPrecision(f),x=f+new Array(m+1).join(".0");return s.map(x.split("."),Y=>new Array(20-Y.length).join("0")+Y).reverse()});for(i&&(d=c-Math.min(n,o)),c-=1;c>=d;){if(a[0][c]>a[1][c])return 1;if(a[0][c]===a[1][c]){if(c===d)return 0;c-=1}else if(a[0][c]<a[1][c])return-1}}static map(e,t){const i=[];let n;if(Array.prototype.map)return Array.prototype.map.call(e,t);for(n=0;n<e.length;n+=1)i.push(t(e[n]));return i}static find(e,t){let i,n;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(i=0,n=e.length;i<n;i+=1){const o=e[i];if(t(o,i))return o}}static assign(e,...t){const i=e;let n,o;if(Object.assign)return Object.assign(e,...t);for(n=0,o=t.length;n<o;n+=1){const c=t[n];typeof c=="object"&&c!==null&&Object.keys(c).forEach(a=>{i[a]=c[a]})}return e}static getBrowserAlias(e){return de[e]}static getBrowserTypeByAlias(e){return Z[e]||""}}const u=/version\/(\d+(\.?_?\d+)+)/i,ue=[{test:[/googlebot/i],describe(r){const e={name:"Googlebot"},t=s.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/opera/i],describe(r){const e={name:"Opera"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/opr\/|opios/i],describe(r){const e={name:"Opera"},t=s.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/SamsungBrowser/i],describe(r){const e={name:"Samsung Internet for Android"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/Whale/i],describe(r){const e={name:"NAVER Whale Browser"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/MZBrowser/i],describe(r){const e={name:"MZ Browser"},t=s.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/focus/i],describe(r){const e={name:"Focus"},t=s.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/swing/i],describe(r){const e={name:"Swing"},t=s.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/coast/i],describe(r){const e={name:"Opera Coast"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(r){const e={name:"Opera Touch"},t=s.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/yabrowser/i],describe(r){const e={name:"Yandex Browser"},t=s.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/ucbrowser/i],describe(r){const e={name:"UC Browser"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/Maxthon|mxios/i],describe(r){const e={name:"Maxthon"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/epiphany/i],describe(r){const e={name:"Epiphany"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/puffin/i],describe(r){const e={name:"Puffin"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/sleipnir/i],describe(r){const e={name:"Sleipnir"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/k-meleon/i],describe(r){const e={name:"K-Meleon"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/micromessenger/i],describe(r){const e={name:"WeChat"},t=s.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/qqbrowser/i],describe(r){const e={name:/qqbrowserlite/i.test(r)?"QQ Browser Lite":"QQ Browser"},t=s.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/msie|trident/i],describe(r){const e={name:"Internet Explorer"},t=s.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/\sedg\//i],describe(r){const e={name:"Microsoft Edge"},t=s.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/edg([ea]|ios)/i],describe(r){const e={name:"Microsoft Edge"},t=s.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/vivaldi/i],describe(r){const e={name:"Vivaldi"},t=s.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/seamonkey/i],describe(r){const e={name:"SeaMonkey"},t=s.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/sailfish/i],describe(r){const e={name:"Sailfish"},t=s.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,r);return t&&(e.version=t),e}},{test:[/silk/i],describe(r){const e={name:"Amazon Silk"},t=s.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/phantom/i],describe(r){const e={name:"PhantomJS"},t=s.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/slimerjs/i],describe(r){const e={name:"SlimerJS"},t=s.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(r){const e={name:"BlackBerry"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/(web|hpw)[o0]s/i],describe(r){const e={name:"WebOS Browser"},t=s.getFirstMatch(u,r)||s.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/bada/i],describe(r){const e={name:"Bada"},t=s.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/tizen/i],describe(r){const e={name:"Tizen"},t=s.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/qupzilla/i],describe(r){const e={name:"QupZilla"},t=s.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/firefox|iceweasel|fxios/i],describe(r){const e={name:"Firefox"},t=s.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/electron/i],describe(r){const e={name:"Electron"},t=s.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/MiuiBrowser/i],describe(r){const e={name:"Miui"},t=s.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/chromium/i],describe(r){const e={name:"Chromium"},t=s.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,r)||s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/chrome|crios|crmo/i],describe(r){const e={name:"Chrome"},t=s.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/GSA/i],describe(r){const e={name:"Google Search"},t=s.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test(r){const e=!r.test(/like android/i),t=r.test(/android/i);return e&&t},describe(r){const e={name:"Android Browser"},t=s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/playstation 4/i],describe(r){const e={name:"PlayStation 4"},t=s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/safari|applewebkit/i],describe(r){const e={name:"Safari"},t=s.getFirstMatch(u,r);return t&&(e.version=t),e}},{test:[/.*/i],describe(r){const e=/^(.*)\/(.*) /,t=/^(.*)\/(.*)[ \t]\((.*)/,n=r.search("\\(")!==-1?t:e;return{name:s.getFirstMatch(n,r),version:s.getSecondMatch(n,r)}}}],le=[{test:[/Roku\/DVP/],describe(r){const e=s.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,r);return{name:h.Roku,version:e}}},{test:[/windows phone/i],describe(r){const e=s.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,r);return{name:h.WindowsPhone,version:e}}},{test:[/windows /i],describe(r){const e=s.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,r),t=s.getWindowsVersionName(e);return{name:h.Windows,version:e,versionName:t}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(r){const e={name:h.iOS},t=s.getSecondMatch(/(Version\/)(\d[\d.]+)/,r);return t&&(e.version=t),e}},{test:[/macintosh/i],describe(r){const e=s.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,r).replace(/[_\s]/g,"."),t=s.getMacOSVersionName(e),i={name:h.MacOS,version:e};return t&&(i.versionName=t),i}},{test:[/(ipod|iphone|ipad)/i],describe(r){const e=s.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,r).replace(/[_\s]/g,".");return{name:h.iOS,version:e}}},{test(r){const e=!r.test(/like android/i),t=r.test(/android/i);return e&&t},describe(r){const e=s.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,r),t=s.getAndroidVersionName(e),i={name:h.Android,version:e};return t&&(i.versionName=t),i}},{test:[/(web|hpw)[o0]s/i],describe(r){const e=s.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,r),t={name:h.WebOS};return e&&e.length&&(t.version=e),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(r){const e=s.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,r)||s.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,r)||s.getFirstMatch(/\bbb(\d+)/i,r);return{name:h.BlackBerry,version:e}}},{test:[/bada/i],describe(r){const e=s.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,r);return{name:h.Bada,version:e}}},{test:[/tizen/i],describe(r){const e=s.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,r);return{name:h.Tizen,version:e}}},{test:[/linux/i],describe(){return{name:h.Linux}}},{test:[/CrOS/],describe(){return{name:h.ChromeOS}}},{test:[/PlayStation 4/],describe(r){const e=s.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,r);return{name:h.PlayStation4,version:e}}}],fe=[{test:[/googlebot/i],describe(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe(r){const e=s.getFirstMatch(/(can-l01)/i,r)&&"Nova",t={type:l.mobile,vendor:"Huawei"};return e&&(t.model=e),t}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe(){return{type:l.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe(){return{type:l.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(){return{type:l.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe(){return{type:l.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe(){return{type:l.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe(){return{type:l.tablet}}},{test(r){const e=r.test(/ipod|iphone/i),t=r.test(/like (ipod|iphone)/i);return e&&!t},describe(r){const e=s.getFirstMatch(/(ipod|iphone)/i,r);return{type:l.mobile,vendor:"Apple",model:e}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe(){return{type:l.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe(){return{type:l.mobile}}},{test(r){return r.getBrowserName(!0)==="blackberry"},describe(){return{type:l.mobile,vendor:"BlackBerry"}}},{test(r){return r.getBrowserName(!0)==="bada"},describe(){return{type:l.mobile}}},{test(r){return r.getBrowserName()==="windows phone"},describe(){return{type:l.mobile,vendor:"Microsoft"}}},{test(r){const e=Number(String(r.getOSVersion()).split(".")[0]);return r.getOSName(!0)==="android"&&e>=3},describe(){return{type:l.tablet}}},{test(r){return r.getOSName(!0)==="android"},describe(){return{type:l.mobile}}},{test(r){return r.getOSName(!0)==="macos"},describe(){return{type:l.desktop,vendor:"Apple"}}},{test(r){return r.getOSName(!0)==="windows"},describe(){return{type:l.desktop}}},{test(r){return r.getOSName(!0)==="linux"},describe(){return{type:l.desktop}}},{test(r){return r.getOSName(!0)==="playstation 4"},describe(){return{type:l.tv}}},{test(r){return r.getOSName(!0)==="roku"},describe(){return{type:l.tv}}}],he=[{test(r){return r.getBrowserName(!0)==="microsoft edge"},describe(r){if(/\sedg\//i.test(r))return{name:w.Blink};const t=s.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,r);return{name:w.EdgeHTML,version:t}}},{test:[/trident/i],describe(r){const e={name:w.Trident},t=s.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test(r){return r.test(/presto/i)},describe(r){const e={name:w.Presto},t=s.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test(r){const e=r.test(/gecko/i),t=r.test(/like gecko/i);return e&&!t},describe(r){const e={name:w.Gecko},t=s.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}},{test:[/(apple)?webkit\/537\.36/i],describe(){return{name:w.Blink}}},{test:[/(apple)?webkit/i],describe(r){const e={name:w.WebKit},t=s.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,r);return t&&(e.version=t),e}}];class X{constructor(e,t=!1){if(e==null||e==="")throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},t!==!0&&this.parse()}getUA(){return this._ua}test(e){return e.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const e=s.find(ue,t=>{if(typeof t.test=="function")return t.test(this);if(t.test instanceof Array)return t.test.some(i=>this.test(i));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.browser=e.describe(this.getUA())),this.parsedResult.browser}getBrowser(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}getBrowserName(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""}getBrowserVersion(){return this.getBrowser().version}getOS(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()}parseOS(){this.parsedResult.os={};const e=s.find(le,t=>{if(typeof t.test=="function")return t.test(this);if(t.test instanceof Array)return t.test.some(i=>this.test(i));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.os=e.describe(this.getUA())),this.parsedResult.os}getOSName(e){const{name:t}=this.getOS();return e?String(t).toLowerCase()||"":t||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(e=!1){const{type:t}=this.getPlatform();return e?String(t).toLowerCase()||"":t||""}parsePlatform(){this.parsedResult.platform={};const e=s.find(fe,t=>{if(typeof t.test=="function")return t.test(this);if(t.test instanceof Array)return t.test.some(i=>this.test(i));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.platform=e.describe(this.getUA())),this.parsedResult.platform}getEngine(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}getEngineName(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}parseEngine(){this.parsedResult.engine={};const e=s.find(he,t=>{if(typeof t.test=="function")return t.test(this);if(t.test instanceof Array)return t.test.some(i=>this.test(i));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.engine=e.describe(this.getUA())),this.parsedResult.engine}parse(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}getResult(){return s.assign({},this.parsedResult)}satisfies(e){const t={};let i=0;const n={};let o=0;if(Object.keys(e).forEach(d=>{const a=e[d];typeof a=="string"?(n[d]=a,o+=1):typeof a=="object"&&(t[d]=a,i+=1)}),i>0){const d=Object.keys(t),a=s.find(d,m=>this.isOS(m));if(a){const m=this.satisfies(t[a]);if(m!==void 0)return m}const f=s.find(d,m=>this.isPlatform(m));if(f){const m=this.satisfies(t[f]);if(m!==void 0)return m}}if(o>0){const d=Object.keys(n),a=s.find(d,f=>this.isBrowser(f,!0));if(a!==void 0)return this.compareVersion(n[a])}}isBrowser(e,t=!1){const i=this.getBrowserName().toLowerCase();let n=e.toLowerCase();const o=s.getBrowserTypeByAlias(n);return t&&o&&(n=o.toLowerCase()),n===i}compareVersion(e){let t=[0],i=e,n=!1;const o=this.getBrowserVersion();if(typeof o=="string")return e[0]===">"||e[0]==="<"?(i=e.substr(1),e[1]==="="?(n=!0,i=e.substr(2)):t=[],e[0]===">"?t.push(1):t.push(-1)):e[0]==="="?i=e.substr(1):e[0]==="~"&&(n=!0,i=e.substr(1)),t.indexOf(s.compareVersions(o,i,n))>-1}isOS(e){return this.getOSName(!0)===String(e).toLowerCase()}isPlatform(e){return this.getPlatformType(!0)===String(e).toLowerCase()}isEngine(e){return this.getEngineName(!0)===String(e).toLowerCase()}is(e,t=!1){return this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)}some(e=[]){return e.some(t=>this.is(t))}}/*!
    22 * Bowser - a browser detector
    33 * https://github.com/lancedikson/bowser
    44 * MIT License | (c) Dustin Diaz 2012-2015
    55 * MIT License | (c) Denis Demchenko 2015-2019
    6  */class me{static getParser(e,t=!1){if(typeof e!="string")throw new Error("UserAgent should be a string");return new X(e,t)}static parse(e){return new X(e).getResult()}static get BROWSER_MAP(){return Z}static get ENGINE_MAP(){return w}static get OS_MAP(){return h}static get PLATFORMS_MAP(){return l}}class pe{constructor(e){this.beaconSent=!1,this.config=e,this.sessionStart=performance.now(),this.timestamp_ms=Math.floor(Date.now()),this.queue=new Set,this.shouldSendBeacon()&&(this.initBrowserMetrics(),addEventListener("visibilitychange",()=>this.sendBeacon()))}shouldSendBeacon(){const e=Number(this.config.sample_rate);return e<0||e>1?(console.warn("DebugHawk: Invalid sampling rate, defaulting to sending metrics"),!0):e===1?!0:e===0?!1:Math.random()<e}sendBeacon(){if(this.beaconSent||typeof window.DebugHawk>"u"||document.visibilityState==="visible")return;const e=this.preparePayload(),t=JSON.stringify(e);this.shouldUseBeaconApi()?(navigator.sendBeacon(this.config.endpoint,t),this.beaconSent=!0):fetch(this.config.endpoint,{method:"POST",body:t,keepalive:!0,headers:{"Content-Type":"application/json"}}).then(()=>{this.beaconSent=!0}).catch(i=>{console.warn("DebugHawk: Fetch error",i)})}shouldUseBeaconApi(){return this.isBraveBrowser()?!1:"sendBeacon"in navigator}isBraveBrowser(){return"brave"in navigator}preparePayload(){return{server:window.DebugHawk,browser:this.getBrowserMetrics(),user:this.getUserInfo()}}getBrowserMetrics(){let e={title:document.title,requests:this.processNetworkRequests(),timestamp_ms:this.timestamp_ms};return this.queue.forEach(t=>{const i=t.name.toLowerCase();if(i!=="cls"?e[i+"_ms"]=this.roundToDecimals(t.value):e[i]=this.roundToDecimals(t.value,5),i==="ttfb"&&t.entries[0]){const n=this.calculateTtfbMetrics(t.entries[0]);Object.assign(e,n)}}),e}calculateTtfbMetrics(e){let t={};return e.domainLookupStart&&e.connectStart&&(t.dns_ms=this.roundToDecimals(e.connectStart-e.domainLookupStart)),e.connectStart&&e.connectEnd&&(t.connect_ms=this.roundToDecimals(e.connectEnd-e.connectStart)),e.decodedBodySize&&(t.html_body_size=e.decodedBodySize),e.encodedBodySize&&(t.html_transfer_size=e.encodedBodySize),t}processNetworkRequests(){const e=new Set;performance.getEntriesByType("navigation").forEach(i=>e.add(this.processPerformanceEntry(i))),performance.getEntriesByType("resource").forEach(i=>e.add(this.processPerformanceEntry(i)));let t={count:e.size,total_body_size:0,total_transfer_size:0,by_type:{},by_domain:{},by_component:{}};return e.forEach(i=>{t.total_body_size+=i.body_size||0,t.total_transfer_size+=i.transfer_size||0,t.by_type[i.type]||(t.by_type[i.type]={count:0,blocking:0,body_size:0,transfer_size:0}),t.by_type[i.type].count++,t.by_type[i.type].body_size+=i.body_size||0,t.by_type[i.type].transfer_size+=i.transfer_size||0,i.blocking&&t.by_type[i.type].blocking++;const n=this.getDomainFromUrl(i.url);if(t.by_domain[n]||(t.by_domain[n]={count:0,blocking:0,body_size:0,transfer_size:0}),t.by_domain[n].count++,t.by_domain[n].body_size+=i.body_size||0,t.by_domain[n].transfer_size+=i.transfer_size||0,i.blocking&&t.by_domain[n].blocking++,!i.url.startsWith(this.config.urls.home)||i.type==="html"||i.type==="other"||i.type==="xhr")return;const o=this.getComponentFromNetworkRequest(i);t.by_component[o]||(t.by_component[o]={}),t.by_component[o][i.type]||(t.by_component[o][i.type]={count:0,blocking:0,body_size:0,transfer_size:0}),t.by_component[o][i.type].count++,t.by_component[o][i.type].body_size+=i.body_size||0,t.by_component[o][i.type].transfer_size+=i.transfer_size||0,i.blocking&&t.by_component[o][i.type].blocking++}),t}processPerformanceEntry(e){return{url:e.name,type:this.getTypeFromPerformanceEntry(e),body_size:e.decodedBodySize,transfer_size:e.encodedBodySize,blocking:e.renderBlockingStatus==="blocking",status:e.responseStatus}}getComponentFromNetworkRequest(e){return e.url.startsWith(this.config.urls.plugin)?`plugin:${e.url.slice(this.config.urls.plugin.length).split("/")[0]}`:e.url.startsWith(this.config.urls.theme)?`theme:${e.url.slice(this.config.urls.theme.length).split("/")[0]}`:e.url.startsWith(this.config.urls.admin)||e.url.startsWith(this.config.urls.includes)?"core":e.url.startsWith(this.config.urls.uploads)?"upload":"other"}getDomainFromUrl(e){try{return new URL(e).hostname}catch{return"unknown"}}getFileExtensionFromUrl(e){try{const i=new URL(e).pathname,n=i.lastIndexOf(".");if(n===-1||n===i.length-1)return"";const o=i.substring(n+1);return o.includes("/")?"":o.toLowerCase()}catch{return""}}getTypeFromPerformanceEntry(e){if(e.initiatorType==="navigation"||e.initiatorType==="iframe")return"html";if(e.initiatorType==="script")return"js";if(e.initiatorType==="img")return"img";if(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")return"xhr";const t=this.getFileExtensionFromUrl(e.name);return{css:"css",js:"js",mjs:"js",woff:"font",woff2:"font",ttf:"font",otf:"font",eot:"font",png:"img",jpg:"img",jpeg:"img",gif:"img",svg:"img",webp:"img",ico:"img",avif:"img",mp4:"media",webm:"media",ogv:"media",mp3:"media",ogg:"media",wav:"media",flac:"media"}[t]||"other"}getUserInfo(){var i,n;const e=me.getParser(window.navigator.userAgent),t=performance.now();return{browser:{name:this.isBraveBrowser()?"Brave":e.getBrowserName(),version:this.isBraveBrowser()?null:e.getBrowserVersion(),viewport:{width:((i=window.visualViewport)==null?void 0:i.width)??null,height:((n=window.visualViewport)==null?void 0:n.height)??null}},os:{name:e.getOSName(),version:e.getOSVersion()},platform:e.getPlatformType(),session_duration_ms:this.roundToDecimals(t-this.sessionStart)}}addToQueue(e){this.queue.add(e)}initBrowserMetrics(){const e=this.addToQueue.bind(this);q(e),W(e),ne(e),oe(e),ce(e)}roundToDecimals(e,t=1){const i=Math.pow(10,t);return Math.round(e*i)/i}}typeof window.DebugHawkConfig<"u"&&new pe(window.DebugHawkConfig)})();
     6 */class me{static getParser(e,t=!1){if(typeof e!="string")throw new Error("UserAgent should be a string");return new X(e,t)}static parse(e){return new X(e).getResult()}static get BROWSER_MAP(){return Z}static get ENGINE_MAP(){return w}static get OS_MAP(){return h}static get PLATFORMS_MAP(){return l}}class pe{constructor(e){this.beaconSent=!1,this.config=e,this.sessionStart=performance.now(),this.timestamp_ms=Math.floor(Date.now()),this.queue=new Set,this.shouldSendBeacon()&&(this.initBrowserMetrics(),addEventListener("visibilitychange",()=>this.sendBeacon()))}shouldSendBeacon(){const e=Number(this.config.sample_rate);return e<0||e>1?(console.warn("DebugHawk: Invalid sampling rate, defaulting to sending metrics"),!0):e===1?!0:e===0?!1:Math.random()<e}sendBeacon(){if(this.beaconSent||typeof window.DebugHawk>"u"||document.visibilityState==="visible")return;const e=this.preparePayload(),t=JSON.stringify(e);this.shouldUseBeaconApi()?(navigator.sendBeacon(this.config.endpoint,t),this.beaconSent=!0):(this.beaconSent=!0,fetch(this.config.endpoint,{method:"POST",body:t,keepalive:!0}).catch(i=>{console.warn("DebugHawk: Fetch error",i)}))}shouldUseBeaconApi(){return this.isBraveBrowser()?!1:"sendBeacon"in navigator}isBraveBrowser(){return"brave"in navigator}preparePayload(){return{server:window.DebugHawk,browser:this.getBrowserMetrics(),user:this.getUserInfo()}}getBrowserMetrics(){let e={title:document.title,requests:this.processNetworkRequests(),timestamp_ms:this.timestamp_ms};return this.queue.forEach(t=>{const i=t.name.toLowerCase();if(i!=="cls"?e[i+"_ms"]=this.roundToDecimals(t.value):e[i]=this.roundToDecimals(t.value,5),i==="ttfb"&&t.entries[0]){const n=this.calculateTtfbMetrics(t.entries[0]);Object.assign(e,n)}}),e}calculateTtfbMetrics(e){let t={};return e.domainLookupStart&&e.connectStart&&(t.dns_ms=this.roundToDecimals(e.connectStart-e.domainLookupStart)),e.connectStart&&e.connectEnd&&(t.connect_ms=this.roundToDecimals(e.connectEnd-e.connectStart)),e.decodedBodySize&&(t.html_body_size=e.decodedBodySize),e.encodedBodySize&&(t.html_transfer_size=e.encodedBodySize),t}processNetworkRequests(){const e=new Set;performance.getEntriesByType("navigation").forEach(i=>e.add(this.processPerformanceEntry(i))),performance.getEntriesByType("resource").forEach(i=>e.add(this.processPerformanceEntry(i)));let t={count:e.size,total_body_size:0,total_transfer_size:0,by_type:{},by_domain:{},by_component:{}};return e.forEach(i=>{t.total_body_size+=i.body_size||0,t.total_transfer_size+=i.transfer_size||0,t.by_type[i.type]||(t.by_type[i.type]={count:0,blocking:0,body_size:0,transfer_size:0}),t.by_type[i.type].count++,t.by_type[i.type].body_size+=i.body_size||0,t.by_type[i.type].transfer_size+=i.transfer_size||0,i.blocking&&t.by_type[i.type].blocking++;const n=this.getDomainFromUrl(i.url);if(t.by_domain[n]||(t.by_domain[n]={count:0,blocking:0,body_size:0,transfer_size:0}),t.by_domain[n].count++,t.by_domain[n].body_size+=i.body_size||0,t.by_domain[n].transfer_size+=i.transfer_size||0,i.blocking&&t.by_domain[n].blocking++,!this.isWithin(i.url,this.config.urls.home)||i.type==="html"||i.type==="other"||i.type==="xhr")return;const o=this.getComponentFromNetworkRequest(i);t.by_component[o]||(t.by_component[o]={}),t.by_component[o][i.type]||(t.by_component[o][i.type]={count:0,blocking:0,body_size:0,transfer_size:0}),t.by_component[o][i.type].count++,t.by_component[o][i.type].body_size+=i.body_size||0,t.by_component[o][i.type].transfer_size+=i.transfer_size||0,i.blocking&&t.by_component[o][i.type].blocking++}),t}processPerformanceEntry(e){return{url:e.name,type:this.getTypeFromPerformanceEntry(e),body_size:e.decodedBodySize,transfer_size:e.encodedBodySize,blocking:e.renderBlockingStatus==="blocking",status:e.responseStatus}}getComponentFromNetworkRequest(e){return this.isWithin(e.url,this.config.urls.plugin)?`plugin:${e.url.slice(this.config.urls.plugin.length).split("/")[0]}`:this.isWithin(e.url,this.config.urls.theme)?`theme:${e.url.slice(this.config.urls.theme.length).split("/")[0]}`:this.isWithin(e.url,this.config.urls.admin)||this.isWithin(e.url,this.config.urls.includes)?"core":this.isWithin(e.url,this.config.urls.uploads)?"upload":"other"}isWithin(e,t){const i=t.endsWith("/")?t:t+"/";return e===t||e.startsWith(i)}getDomainFromUrl(e){try{return new URL(e).hostname}catch{return"unknown"}}getFileExtensionFromUrl(e){try{const i=new URL(e).pathname,n=i.lastIndexOf(".");if(n===-1||n===i.length-1)return"";const o=i.substring(n+1);return o.includes("/")?"":o.toLowerCase()}catch{return""}}getTypeFromPerformanceEntry(e){if(e.initiatorType==="navigation"||e.initiatorType==="iframe")return"html";if(e.initiatorType==="script")return"js";if(e.initiatorType==="img")return"img";if(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")return"xhr";const t=this.getFileExtensionFromUrl(e.name);return{css:"css",js:"js",mjs:"js",woff:"font",woff2:"font",ttf:"font",otf:"font",eot:"font",png:"img",jpg:"img",jpeg:"img",gif:"img",svg:"img",webp:"img",ico:"img",avif:"img",mp4:"media",webm:"media",ogv:"media",mp3:"media",ogg:"media",wav:"media",flac:"media"}[t]||"other"}getUserInfo(){var i,n;const e=me.getParser(window.navigator.userAgent),t=performance.now();return{browser:{name:this.isBraveBrowser()?"Brave":e.getBrowserName(),version:this.isBraveBrowser()?null:e.getBrowserVersion(),viewport:{width:((i=window.visualViewport)==null?void 0:i.width)??null,height:((n=window.visualViewport)==null?void 0:n.height)??null}},os:{name:e.getOSName(),version:e.getOSVersion()},platform:e.getPlatformType(),session_duration_ms:this.roundToDecimals(t-this.sessionStart)}}addToQueue(e){this.queue.add(e)}initBrowserMetrics(){const e=this.addToQueue.bind(this);q(e),V(e),ne(e),oe(e),ce(e)}roundToDecimals(e,t=1){const i=Math.pow(10,t);return Math.round(e*i)/i}}typeof window.DebugHawkConfig<"u"&&new pe(window.DebugHawkConfig)})();
  • debughawk/trunk/resources/src/beacon.ts

    r3372612 r3783821  
    5454            this.beaconSent = true;
    5555        } else {
     56            // Marked as sent straight away, so another visibilitychange before
     57            // the request finishes doesn't send it twice.
     58            this.beaconSent = true;
     59
     60            // No JSON Content-Type: a plain-text body, like sendBeacon's, keeps
     61            // this a simple request with no CORS preflight while the page closes.
    5662            fetch(this.config.endpoint, {
    5763                method: 'POST',
    5864                body: payloadJson,
    5965                keepalive: true,
    60                 headers: {
    61                     'Content-Type': 'application/json'
    62                 }
    63             })
    64                 .then(() => {
    65                     this.beaconSent = true;
    66                 })
    67                 .catch(error => {
    68                     console.warn('DebugHawk: Fetch error', error);
    69                 });
     66            }).catch(error => {
     67                console.warn('DebugHawk: Fetch error', error);
     68            });
    7069        }
    7170    }
    … …  
    197196            }
    198197
    199             if (!request.url.startsWith(this.config.urls.home)) {
     198            if (!this.isWithin(request.url, this.config.urls.home)) {
    200199                return;
    201200            }
    … …  
    244243
    245244    private getComponentFromNetworkRequest(networkRequest: NetworkRequest): string {
    246         if (networkRequest.url.startsWith(this.config.urls.plugin)) {
     245        if (this.isWithin(networkRequest.url, this.config.urls.plugin)) {
    247246            const pluginName = networkRequest.url.slice(this.config.urls.plugin.length).split('/')[0];
    248247
    … …  
    250249        }
    251250
    252         if (networkRequest.url.startsWith(this.config.urls.theme)) {
     251        if (this.isWithin(networkRequest.url, this.config.urls.theme)) {
    253252            const themeName = networkRequest.url.slice(this.config.urls.theme.length).split('/')[0];
    254253
    … …  
    256255        }
    257256
    258         if (networkRequest.url.startsWith(this.config.urls.admin) || networkRequest.url.startsWith(this.config.urls.includes)) {
     257        if (this.isWithin(networkRequest.url, this.config.urls.admin) || this.isWithin(networkRequest.url, this.config.urls.includes)) {
    259258            return 'core';
    260259        }
    261260
    262         if (networkRequest.url.startsWith(this.config.urls.uploads)) {
     261        if (this.isWithin(networkRequest.url, this.config.urls.uploads)) {
    263262            return 'upload';
    264263        }
    265264
    266265        return 'other';
     266    }
     267
     268    /**
     269     * Whether a URL is a base URL or inside it. The base is compared as a
     270     * directory, so https://example.com doesn't match
     271     * https://example.com.evil.com, and .../uploads doesn't match .../uploads-old.
     272     */
     273    private isWithin(url: string, base: string): boolean {
     274        const directory = base.endsWith('/') ? base : base + '/';
     275
     276        return url === base || url.startsWith(directory);
    267277    }
    268278
  • debughawk/trunk/src/Backtrace.php

    r3358840 r3783821  
    3232        ];
    3333
     34        /** wpdb drop-in classes, reported as wpdb. */
     35        protected const WPDB_DROPINS = [ 'DebugHawkDB', 'QM_DB' ];
     36
     37        /** Path prefixes, rebuilt only when the directories they came from change. */
     38        protected static ?array $prefixes = null;
     39
     40        protected static ?array $prefixes_directories = null;
     41
    3442        public function __construct( ?array $trace = null ) {
    3543                if ( is_null( $trace ) ) {
    … …  
    4048        }
    4149
     50        /**
     51         * Finds the code responsible for the current call (a query or request).
     52         *
     53         * Walks the stack from the innermost frame outward and returns the first
     54         * frame whose file belongs to a plugin, mu-plugin, theme or other
     55         * wp-content code: the line where that code called into WordPress or
     56         * wpdb. Core files, DebugHawk itself, the db.php drop-in and files outside
     57         * WordPress (such as Composer libraries) are skipped, so the call is
     58         * attributed to the plugin or theme that made it however it got there,
     59         * including from hook callbacks.
     60         *
     61         * A hook dispatch is a boundary: if the walk reaches one before finding
     62         * any such frame, the call was made by a hook callback made only of core
     63         * code (such as a core callback on wp_head, fired from a theme's
     64         * header.php), so it's attributed to core rather than to whoever fired
     65         * the hook. The hooks DebugHawk itself listens on, at the start of the
     66         * stack, don't count.
     67         *
     68         * Only when no such frame exists is the call attributed to core.
     69         */
    4270        public function parse(): ?array {
    43                 $found_frame = null;
    44 
    45                 foreach ( $this->trace as $frame ) {
    46                         if ( isset( $frame['class'] ) && in_array( $frame['class'], $this->ignored_classes ) ) {
     71                $prefixes    = $this->prefixes();
     72                $trace       = array_values( $this->trace );
     73                $core_index  = null;
     74                $other       = null;
     75                $in_plumbing = true;
     76
     77                foreach ( $trace as $index => $frame ) {
     78                        $is_ignored = $this->is_ignored( $frame );
     79
     80                        if ( $core_index === null && ! $is_ignored ) {
     81                                $core_index = $index;
     82                        }
     83
     84                        // The frames at the start are DebugHawk, the hook it listens on and
     85                        // wpdb or WP_Http. The first frame after them is where the caller is.
     86                        if ( $in_plumbing && ! $is_ignored ) {
     87                                $in_plumbing = false;
     88                        }
     89
     90                        if ( ! empty( $frame['file'] ) ) {
     91                                $component = $this->classify( $frame['file'], $prefixes );
     92
     93                                if ( $component !== null && $component['component'] === 'other' ) {
     94                                        // Drop-ins such as object-cache.php usually run on behalf of a
     95                                        // plugin or theme further out, so they're only a fallback.
     96                                        $other = $other ?? $this->describe( $frame, $component );
     97                                } elseif ( $component !== null && $component['component'] !== 'core' ) {
     98                                        return $this->describe( $frame, $component );
     99                                }
     100                        }
     101
     102                        if ( ! $in_plumbing && $this->is_hook_dispatch( $frame ) ) {
     103                                break;
     104                        }
     105                }
     106
     107                if ( $other !== null ) {
     108                        return $other;
     109                }
     110
     111                return $core_index !== null
     112                        ? $this->describe_core( $trace, $core_index, $prefixes )
     113                        : null;
     114        }
     115
     116        /**
     117         * Describes the most useful place in core: the first frame outside the
     118         * hook, HTTP and wpdb plumbing. When that frame is a hook callback, its
     119         * file and line are WP_Hook's, so they're taken from inside the callback
     120         * instead (where it made its next call), keeping the callback as the
     121         * function.
     122         */
     123        protected function describe_core( array $trace, int $index, array $prefixes ): ?array {
     124                $frame    = $trace[ $index ];
     125                $location = $frame;
     126
     127                if ( $index > 0 && ! empty( $trace[ $index - 1 ]['file'] ) && $this->is_hook_dispatch( $trace[ $index + 1 ] ?? [] ) ) {
     128                        $location = $trace[ $index - 1 ];
     129                }
     130
     131                foreach ( [ $location, $frame ] as $candidate ) {
     132                        if ( empty( $candidate['file'] ) ) {
    47133                                continue;
    48134                        }
    49135
    50                         if ( isset( $frame['function'] ) && in_array( $frame['function'], $this->ignored_functions ) ) {
     136                        $component = $this->classify( $candidate['file'], $prefixes );
     137
     138                        if ( $component !== null ) {
     139                                return $this->describe( $frame, $component, $candidate );
     140                        }
     141                }
     142
     143                return null;
     144        }
     145
     146        protected function is_hook_dispatch( array $frame ): bool {
     147                return ( $frame['class'] ?? null ) === 'WP_Hook'
     148                        && in_array( $frame['function'] ?? null, [ 'apply_filters', 'do_action', 'do_all_hook' ], true );
     149        }
     150
     151        protected function is_ignored( array $frame ): bool {
     152                if ( isset( $frame['class'] ) && in_array( $frame['class'], $this->ignored_classes, true ) ) {
     153                        return true;
     154                }
     155
     156                return isset( $frame['function'] ) && in_array( $frame['function'], $this->ignored_functions, true );
     157        }
     158
     159        /**
     160         * @return array{component: string, slug: ?string}|null Null for files that
     161         *                                                      are never responsible.
     162         */
     163        protected function classify( string $file, array $prefixes ): ?array {
     164                $path = DIRECTORY_SEPARATOR === '\\' ? str_replace( '\\', '/', $file ) : $file;
     165
     166                $match = $this->match_prefix( $path, $prefixes );
     167
     168                // A symlinked plugin outside every known directory: WordPress records
     169                // where its real path maps to, so try again with that.
     170                if ( $match === false ) {
     171                        foreach ( $GLOBALS['wp_plugin_paths'] ?? [] as $plugin_path => $real_path ) {
     172                                if ( strpos( $path, $real_path . '/' ) === 0 ) {
     173                                        $match = $this->match_prefix( $plugin_path . substr( $path, strlen( $real_path ) ), $prefixes );
     174                                        break;
     175                                }
     176                        }
     177                }
     178
     179                return $match === false ? null : $match;
     180        }
     181
     182        /**
     183         * @return array{component: string, slug: ?string}|false|null The component,
     184         *         false if no prefix matched, or null for files that are never responsible.
     185         */
     186        protected function match_prefix( string $path, array $prefixes ) {
     187                // Longest prefix first, so the most specific directory wins.
     188                foreach ( $prefixes as [ $prefix, $component, $slug ] ) {
     189                        if ( strpos( $path, $prefix ) !== 0 ) {
    51190                                continue;
    52191                        }
    53192
    54                         $found_frame = $frame;
    55                         break;
    56                 }
    57 
    58                 return $found_frame
    59                         ? $this->determine_component( $found_frame )
    60                         : null;
    61         }
    62 
    63         protected function determine_component( array $frame ): ?array {
    64                 if ( empty( $frame['file'] ) ) {
     193                        if ( $component === null ) {
     194                                return null;
     195                        }
     196
     197                        return [
     198                                'component' => $component,
     199                                'slug'      => $slug ?? $this->slug( $component, substr( $path, strlen( $prefix ) ) ),
     200                        ];
     201                }
     202
     203                return false;
     204        }
     205
     206        /**
     207         * The first path segment under the plugins or theme directory: the plugin
     208         * or theme folder, or the file name for a single-file plugin.
     209         */
     210        protected function slug( string $component, string $relative_path ): ?string {
     211                if ( $component !== 'plugin' && $component !== 'theme' ) {
    65212                        return null;
    66213                }
    67214
    68                 $component = null;
    69 
    70                 foreach ( $this->component_dirs() as $type => $dir ) {
    71                         if ( strpos( $frame['file'], trailingslashit( $dir ) ) === 0 ) {
    72                                 $component = $type;
    73                                 break;
    74                         }
    75                 }
    76 
    77                 if ( ! $component ) {
    78                         return null;
    79                 }
    80 
    81                 $component = in_array( $component, [ 'stylesheet', 'template' ] ) ? 'theme' : $component;
     215                $slash = strpos( $relative_path, '/' );
     216
     217                return $slash === false ? $relative_path : substr( $relative_path, 0, $slash );
     218        }
     219
     220        /**
     221         * @param array|null $location The frame to take the file and line from,
     222         *                             if not the frame itself.
     223         */
     224        protected function describe( array $frame, array $component, ?array $location = null ): array {
     225                $class    = $frame['class'] ?? null;
     226                $location = $location ?? $frame;
     227
     228                if ( in_array( $class, self::WPDB_DROPINS, true ) ) {
     229                        $class = 'wpdb';
     230                }
    82231
    83232                return array_filter( [
    84                         'component' => $component,
    85                         'file'      => $frame['file'],
    86                         'line'      => $frame['line'] ?? null,
     233                        'component' => $component['component'],
     234                        'file'      => $location['file'],
     235                        'line'      => $location['line'] ?? null,
    87236                        'function'  => $frame['function'] ?? null,
    88                         'class'     => $frame['class'] ?? null,
    89                         'slug'      => $this->determine_slug( $component, $frame['file'] ),
     237                        'class'     => $class,
     238                        'slug'      => $component['slug'],
    90239                ] );
    91240        }
    92241
    93         protected function component_dirs(): array {
     242        /**
     243         * The directories WordPress code lives in, from its constants and globals,
     244         * so any layout works: WordPress in a subdirectory, a moved wp-content,
     245         * plugins or mu-plugins directory, or extra theme directories.
     246         */
     247        protected function directories(): array {
     248                $content     = defined( 'WP_CONTENT_DIR' ) ? WP_CONTENT_DIR : null;
     249                $theme_roots = $GLOBALS['wp_theme_directories'] ?? [];
     250
     251                if ( ! $theme_roots && $content !== null ) {
     252                        $theme_roots = [ $content . '/themes' ];
     253                }
     254
    94255                return [
    95                         'plugin'     => WP_PLUGIN_DIR,
    96                         'mu-plugin'  => WPMU_PLUGIN_DIR,
    97                         'stylesheet' => get_stylesheet_directory(),
    98                         'template'   => get_template_directory(),
    99                         'other'      => WP_CONTENT_DIR,
    100                         'core'       => ABSPATH,
     256                        'abspath'     => defined( 'ABSPATH' ) ? ABSPATH : null,
     257                        'content'     => $content,
     258                        'plugins'     => defined( 'WP_PLUGIN_DIR' ) ? WP_PLUGIN_DIR : null,
     259                        'mu_plugins'  => defined( 'WPMU_PLUGIN_DIR' ) ? WPMU_PLUGIN_DIR : null,
     260                        'theme_roots' => array_values( $theme_roots ),
     261                        'debughawk'   => dirname( __DIR__ ),
    101262                ];
    102263        }
    103264
    104         protected function determine_slug( string $component, string $file ): ?string {
    105                 if ( $component === 'plugin' ) {
    106                         return $this->determine_plugin_slug( $file );
    107                 }
    108 
    109                 if ( $component === 'theme' ) {
    110                         return $this->determine_theme_slug( $file );
    111                 }
    112 
    113                 return null;
    114         }
    115 
    116         protected function determine_plugin_slug( string $file ): ?string {
    117                 $plugin = plugin_basename( $file );
    118 
    119                 if ( strpos( $plugin, '/' ) ) {
    120                         $plugin = explode( '/', $plugin );
    121                         $plugin = reset( $plugin );
    122                 } else {
    123                         $plugin = basename( $plugin );
    124                 }
    125 
    126                 return $plugin;
    127         }
    128 
    129         protected function determine_theme_slug( string $file ): ?string {
    130                 $theme_root = get_theme_root();
    131 
    132                 if ( strpos( $file, $theme_root ) !== 0 ) {
    133                         return null;
    134                 }
    135 
    136                 $relative_path = str_replace( trailingslashit( $theme_root ), '', $file );
    137                 $parts         = explode( '/', $relative_path );
    138 
    139                 return $parts[0] ?? null;
     265        /**
     266         * Path prefixes, longest first, each with its component (null for files
     267         * that are never responsible) and a fixed slug where the path can't give one.
     268         *
     269         * @return array<int, array{0: string, 1: ?string, 2: ?string}>
     270         */
     271        protected function prefixes(): array {
     272                $directories = $this->directories();
     273
     274                if ( self::$prefixes !== null && self::$prefixes_directories === $directories ) {
     275                        return self::$prefixes;
     276                }
     277
     278                $prefixes = $this->directory_prefixes( $directories['debughawk'], null );
     279
     280                if ( $directories['content'] !== null ) {
     281                        array_push(
     282                                $prefixes,
     283                                ...$this->file_prefixes( $directories['content'] . '/db.php', null ),
     284                                ...$this->directory_prefixes( $directories['content'], 'other' )
     285                        );
     286                }
     287
     288                if ( $directories['plugins'] !== null ) {
     289                        array_push(
     290                                $prefixes,
     291                                ...$this->directory_prefixes( $directories['plugins'], 'plugin' ),
     292                                ...$this->symlink_prefixes( $directories['plugins'], 'plugin' )
     293                        );
     294                }
     295
     296                if ( $directories['mu_plugins'] !== null ) {
     297                        array_push(
     298                                $prefixes,
     299                                ...$this->directory_prefixes( $directories['mu_plugins'], 'mu-plugin' ),
     300                                ...$this->symlink_prefixes( $directories['mu_plugins'], 'mu-plugin' )
     301                        );
     302                }
     303
     304                foreach ( $directories['theme_roots'] as $theme_root ) {
     305                        array_push(
     306                                $prefixes,
     307                                ...$this->directory_prefixes( $theme_root, 'theme' ),
     308                                ...$this->symlink_prefixes( $theme_root, 'theme' )
     309                        );
     310                }
     311
     312                if ( $directories['abspath'] !== null ) {
     313                        array_push( $prefixes, ...$this->directory_prefixes( $directories['abspath'], 'core' ) );
     314                }
     315
     316                // Longest first. On a tie, files that are never responsible win, so
     317                // DebugHawk is skipped even when it's a symlinked plugin itself.
     318                usort( $prefixes, static function ( array $a, array $b ): int {
     319                        return ( strlen( $b[0] ) <=> strlen( $a[0] ) ) ?: ( ( $a[1] !== null ) <=> ( $b[1] !== null ) );
     320                } );
     321
     322                self::$prefixes_directories = $directories;
     323
     324                return self::$prefixes = $prefixes;
     325        }
     326
     327        /**
     328         * A directory as a prefix with a trailing slash, plus its real path if
     329         * it's symlinked, since PHP reports real paths in backtraces.
     330         */
     331        protected function directory_prefixes( string $directory, ?string $component ): array {
     332                $prefixes = [];
     333
     334                foreach ( array_unique( [ $directory, (string) realpath( $directory ) ] ) as $path ) {
     335                        if ( $path !== '' ) {
     336                                $prefixes[] = [ rtrim( str_replace( '\\', '/', $path ), '/' ) . '/', $component, null ];
     337                        }
     338                }
     339
     340                return $prefixes;
     341        }
     342
     343        /**
     344         * A single file, plus its real path if it's symlinked.
     345         */
     346        protected function file_prefixes( string $file, ?string $component ): array {
     347                $prefixes = [];
     348
     349                foreach ( array_unique( [ $file, (string) realpath( $file ) ] ) as $path ) {
     350                        if ( $path !== '' ) {
     351                                $prefixes[] = [ str_replace( '\\', '/', $path ), $component, null ];
     352                        }
     353                }
     354
     355                return $prefixes;
     356        }
     357
     358        /**
     359         * Real paths of symlinked plugins, themes or mu-plugins in a directory,
     360         * so each gets its folder or file name as its slug. WordPress records
     361         * symlinked plugins in $wp_plugin_paths, but not themes or mu-plugins
     362         * (which managed hosts often symlink), and its mapping names a symlinked
     363         * single-file plugin after its target.
     364         */
     365        protected function symlink_prefixes( string $directory, string $component ): array {
     366                $entries = is_dir( $directory ) ? scandir( $directory ) : false;
     367
     368                if ( ! $entries ) {
     369                        return [];
     370                }
     371
     372                $prefixes = [];
     373
     374                foreach ( $entries as $entry ) {
     375                        $path = $directory . '/' . $entry;
     376
     377                        if ( $entry === '.' || $entry === '..' || ! is_link( $path ) ) {
     378                                continue;
     379                        }
     380
     381                        $real_path = realpath( $path );
     382
     383                        if ( $real_path === false ) {
     384                                continue;
     385                        }
     386
     387                        $real_path = str_replace( '\\', '/', $real_path );
     388
     389                        $prefixes[] = [
     390                                is_dir( $real_path ) ? rtrim( $real_path, '/' ) . '/' : $real_path,
     391                                $component,
     392                                $component === 'mu-plugin' ? null : $entry,
     393                        ];
     394                }
     395
     396                return $prefixes;
    140397        }
    141398}
  • debughawk/trunk/src/CollectorManager.php

    r3318985 r3783821  
    2424        }
    2525
     26        /**
     27         * Runs every collector. One that fails is sent as null rather than
     28         * stopping the rest, since this runs while the page is being output.
     29         */
    2630        public function gather(): array {
    2731                $data = [];
    2832
    2933                foreach ( $this->collectors as $collector ) {
    30                         $data[ $collector->key ] = $collector->gather();
     34                        try {
     35                                $data[ $collector->key ] = $collector->gather();
     36                        } catch ( \Throwable $e ) {
     37                                $data[ $collector->key ] = null;
     38
     39                                Util::log_error( sprintf( 'The %s collector failed: %s', $collector->key, $e->getMessage() ) );
     40                        }
    3141                }
    3242
  • debughawk/trunk/src/Collectors/DatabaseCollector.php

    r3318985 r3783821  
    55use DebugHawk\Backtrace;
    66use DebugHawk\NeedsInitiatingInterface;
     7use DebugHawk\QueryNormalizer;
    78use DebugHawk\Util;
    89
    … …  
    1011        public string $key = 'database';
    1112
     13        /** Normalized SQL longer than this is truncated before sending. */
     14        protected const MAX_SQL_LENGTH = 2048;
     15
    1216        protected ?float $execution_time = null;
    1317
     18        /** The slowest queries, up to slow_queries_limit of them. */
    1419        protected ?array $slow_queries = null;
    1520
     21        /** How many slow queries ran, including ones not kept. */
     22        protected ?int $slow_query_count = null;
     23
     24        /** The fastest kept query's duration, once the list is full. */
     25        protected ?float $fastest_kept_time = null;
     26
    1627        protected ?array $query_types = null;
    1728
     29        /** Whether the DebugHawk drop-in is keeping running totals of every query. */
     30        protected bool $uses_dropin_stats = false;
     31
     32        /** Read once from the config, as the fallback path checks it for every query. */
     33        protected float $slow_threshold_seconds = 0.0;
     34
     35        protected int $slow_queries_limit = 0;
     36
    1837        public function init(): void {
    19                 add_filter( 'log_query_custom_data', [ $this, 'track_slow_queries' ], 10, 5 );
     38                global $wpdb;
     39
     40                $this->slow_threshold_seconds = (float) $this->config->slow_queries_threshold / 1000;
     41                $this->slow_queries_limit     = max( 0, (int) $this->config->slow_queries_limit );
     42
     43                if ( isset( $wpdb ) && property_exists( $wpdb, 'debughawk_stats' ) ) {
     44                        // The drop-in counts every query itself and only calls back for slow ones.
     45                        $this->uses_dropin_stats            = true;
     46                        $wpdb->debughawk_slow_threshold     = $this->slow_threshold_seconds;
     47                        $wpdb->debughawk_slow_query_handler = [ $this, 'track_slow_query' ];
     48
     49                        return;
     50                }
     51
     52                // Older DebugHawk drop-ins, Query Monitor's drop-in and SAVEQUERIES store
     53                // every query in $wpdb->queries and pass each one through this filter.
     54                add_filter( 'log_query_custom_data', [ $this, 'track_logged_query' ], 10, 5 );
    2055        }
    2156
    … …  
    2358                global $wpdb;
    2459
    25                 $this->parse_queries();
     60                if ( $this->uses_dropin_stats ) {
     61                        $this->read_dropin_stats();
     62                } else {
     63                        $this->parse_queries();
     64                }
     65
     66                $slow_queries = null;
    2667
    2768                if ( is_array( $this->slow_queries ) ) {
    28                         usort( $this->slow_queries, static function ( $a, $b ) {
     69                        $slow_queries = $this->slow_queries;
     70
     71                        usort( $slow_queries, static function ( $a, $b ) {
    2972                                return $b['duration_ms'] <=> $a['duration_ms'];
    3073                        } );
     74
     75                        $slow_queries = array_map( [ $this, 'normalize_slow_query' ], $slow_queries );
    3176                }
    3277
    … …  
    3479                        'duration_ms'      => $this->execution_time,
    3580                        'query_count'      => $wpdb->num_queries ?? null,
    36                         'slow_query_count' => is_array( $this->slow_queries )
    37                                 ? count( $this->slow_queries )
    38                                 : null,
    39                         'slow_queries'     => is_array( $this->slow_queries )
    40                                 ? array_slice( $this->slow_queries, 0, $this->config->slow_queries_limit )
    41                                 : null,
     81                        'slow_query_count' => $this->slow_query_count,
     82                        'slow_queries'     => $slow_queries,
    4283                        'query_types'      => $this->query_types,
    4384                ];
    4485        }
    4586
    46         public function track_slow_queries( $query_data, $query, $query_time, $query_callstack, $query_start ): array {
    47                 $query_time = Util::seconds_to_milliseconds( $query_time );
    48 
    49                 if ( $query_time > $this->config->slow_queries_threshold ) {
    50                         $query = trim( $query );
    51 
    52                         if ( is_null( $this->slow_queries ) ) {
    53                                 $this->slow_queries = [];
     87        /**
     88         * Called by the drop-in for queries over the slow threshold.
     89         */
     90        public function track_slow_query( string $query, float $query_time, float $query_start ): void {
     91                $this->add_slow_query( $query, Util::seconds_to_milliseconds( $query_time ), $query_start );
     92        }
     93
     94        /**
     95         * Called for every query when queries are stored in $wpdb->queries.
     96         */
     97        public function track_logged_query( $query_data, $query, $query_time, $query_callstack, $query_start ) {
     98                // Compare in seconds, as the drop-in does, so fast queries skip the conversion.
     99                if ( $query_time > $this->slow_threshold_seconds ) {
     100                        $this->add_slow_query( $query, Util::seconds_to_milliseconds( $query_time ), $query_start );
     101                }
     102
     103                return $query_data;
     104        }
     105
     106        /**
     107         * Keeps only the slowest queries, so memory stays flat and queries that
     108         * won't be sent don't pay for a backtrace.
     109         */
     110        protected function add_slow_query( string $query, float $query_time, $query_start ): void {
     111                $limit = $this->slow_queries_limit;
     112
     113                $this->slow_query_count = ( $this->slow_query_count ?? 0 ) + 1;
     114
     115                if ( is_null( $this->slow_queries ) ) {
     116                        $this->slow_queries = [];
     117                }
     118
     119                // Once the list is full, only a slower query can get in. On a tie, the
     120                // earlier query stays, as it did when the whole list was sorted.
     121                if ( count( $this->slow_queries ) >= $limit && ( $limit === 0 || $query_time <= $this->fastest_kept_time ) ) {
     122                        return;
     123                }
     124
     125                $query      = trim( $query );
     126                $backtrace  = new Backtrace();
     127                $query_type = $this->determine_query_type( $query );
     128
     129                $this->slow_queries[] = [
     130                        // Raw SQL, normalized in gather() before anything is sent.
     131                        'sql'         => $query,
     132                        'start_time'  => $query_start,
     133                        'duration_ms' => $query_time,
     134                        'type'        => $query_type,
     135                        'backtrace'   => $backtrace->parse(),
     136                ];
     137
     138                if ( count( $this->slow_queries ) > $limit ) {
     139                        $this->drop_fastest_slow_query();
     140                }
     141
     142                if ( count( $this->slow_queries ) === $limit ) {
     143                        $this->fastest_kept_time = min( array_column( $this->slow_queries, 'duration_ms' ) );
     144                }
     145        }
     146
     147        /**
     148         * On a tie, drops the most recent query, which a stable sort puts last.
     149         */
     150        protected function drop_fastest_slow_query(): void {
     151                $fastest = null;
     152
     153                foreach ( $this->slow_queries as $index => $slow_query ) {
     154                        if ( $fastest === null || $slow_query['duration_ms'] <= $this->slow_queries[ $fastest ]['duration_ms'] ) {
     155                                $fastest = $index;
    54156                        }
    55 
    56                         $backtrace  = new Backtrace();
    57                         $query_type = $this->determine_query_type( $query );
    58 
    59                         $this->slow_queries[] = [
    60                                 'sql'         => strlen( $query ) > 1024
    61                                         ? substr( $query, 0, 1024 )
    62                                         : $query,
    63                                 'sql_hash'    => md5( $query ),
    64                                 'start_time'  => $query_start,
    65                                 'duration_ms' => $query_time,
    66                                 'type'        => $query_type,
    67                                 'backtrace'   => $backtrace->parse(),
     157                }
     158
     159                unset( $this->slow_queries[ $fastest ] );
     160
     161                $this->slow_queries = array_values( $this->slow_queries );
     162        }
     163
     164        /**
     165         * Replaces literal values so they never leave the site.
     166         */
     167        protected function normalize_slow_query( array $slow_query ): array {
     168                $sql = QueryNormalizer::normalize( $slow_query['sql'] );
     169
     170                $slow_query['sql']      = Util::truncate( $sql, self::MAX_SQL_LENGTH );
     171                $slow_query['sql_hash'] = md5( $sql );
     172
     173                return $slow_query;
     174        }
     175
     176        protected function read_dropin_stats(): void {
     177                global $wpdb;
     178
     179                $stats = $wpdb->debughawk_stats;
     180
     181                if ( $stats['count'] === 0 ) {
     182                        return;
     183                }
     184
     185                $this->execution_time = Util::seconds_to_milliseconds( $stats['time'] );
     186                $this->query_types    = array_map( static function ( array $type ): array {
     187                        return [
     188                                'count' => $type['count'],
     189                                'time'  => Util::seconds_to_milliseconds( $type['time'] ),
    68190                        ];
    69                 }
    70 
    71                 return $query_data;
     191                }, $stats['types'] );
    72192        }
    73193
  • debughawk/trunk/src/Collectors/OutgoingRequestsCollector.php

    r3318985 r3783821  
    1010        public string $key = 'outgoing_requests';
    1111
     12        /**
     13         * Only the slowest requests are sent, so the payload stays within
     14         * sendBeacon's 64 KB limit however many requests a page makes.
     15         */
     16        protected const MAX_REQUESTS = 20;
     17
    1218        protected array $requests = [];
    1319
     20        /** How many requests were made, including ones not kept. */
     21        protected int $request_count = 0;
     22
     23        /**
     24         * Requests that have started but not finished, newest last, each with the
     25         * URL and method used to match its end.
     26         *
     27         * @var array<int, array{key: int, url: string, method: string}>
     28         */
     29        protected array $in_flight = [];
     30
     31        /**
     32         * Request arguments are never changed: another plugin may key a response
     33         * cache on them. Starting last means a request another plugin answers
     34         * (with a mock or a cached response) is never timed, and ending first
     35         * means other plugins' http_api_debug callbacks aren't timed with it.
     36         */
    1437        public function init(): void {
    15                 add_filter( 'http_request_args', [ $this, 'make_request_traceable' ], 9999, 2 );
    16                 add_filter( 'pre_http_request', [ $this, 'track_request_start' ], 9999, 3 );
    17                 add_filter( 'http_response', [ $this, 'track_request_end' ], 9999, 3 );
     38                add_filter( 'pre_http_request', [ $this, 'track_request_start' ], PHP_INT_MAX, 3 );
     39                add_action( 'http_api_debug', [ $this, 'track_request_end' ], PHP_INT_MIN, 5 );
    1840        }
    1941
    2042        public function gather(): array {
     43                $requests = array_values( $this->requests );
     44
     45                // Slowest first. Non-blocking requests have no duration, since they
     46                // don't hold up the page, so they go last.
     47                usort( $requests, static function ( $a, $b ) {
     48                        return ( $b['duration_ms'] ?? -1 ) <=> ( $a['duration_ms'] ?? -1 );
     49                } );
     50
    2151                return [
    22                         'request_count' => count( $this->requests ),
     52                        'request_count' => $this->request_count,
    2353                        'requests'      => array_map( static function ( $request ) {
    24                                 $request['url'] = strlen( $request['url'] ) > 256
    25                                         ? substr( $request['url'], 0, 256 )
    26                                         : $request['url'];
     54                                $request['url'] = Util::truncate( $request['url'], 256 );
    2755
    2856                                return $request;
    29                         }, $this->requests ),
     57                        }, array_slice( $requests, 0, self::MAX_REQUESTS ) ),
    3058                ];
    3159        }
    3260
    33         public function make_request_traceable( $args, $url ) {
    34                 $args['_debughawk_request_id'] = uniqid( 'http_', true );
    35 
    36                 return $args;
    37         }
    38 
    3961        public function track_request_start( $preempt, $args, $url ) {
    40                 $request_id = $args['_debughawk_request_id'] ?? null;
    41 
    42                 if ( ! $request_id ) {
     62                // Another plugin answered it, so it never goes over the network.
     63                if ( $preempt !== false ) {
    4364                        return $preempt;
    4465                }
    4566
     67                $key    = ++ $this->request_count;
     68                $method = $args['method'] ?? 'GET';
     69
    4670                $backtrace = new Backtrace();
    4771
    48                 $this->requests[ $request_id ] = [
    49                         'url'         => $url,
    50                         'blocking'    => $args['blocking'],
     72                $this->requests[ $key ] = [
     73                        'url'         => Util::redact_url( (string) $url ),
     74                        'blocking'    => $args['blocking'] ?? true,
    5175                        'start_time'  => microtime( true ),
    52                         'http_method' => $args['method'] ?? 'GET',
     76                        'http_method' => $method,
    5377                        'backtrace'   => $backtrace->parse(),
     78                ];
     79
     80                $this->in_flight[] = [
     81                        'key'    => $key,
     82                        'url'    => (string) $url,
     83                        'method' => $method,
    5484                ];
    5585
    … …  
    5787        }
    5888
    59         public function track_request_end( $response, $args, $url ) {
    60                 $request_id = $args['_debughawk_request_id'] ?? null;
     89        /**
     90         * Runs on http_api_debug, which fires for every outcome. Failed blocking
     91         * requests, such as timeouts, hold up the page for as long as they take
     92         * but never reach the http_response filter, so they had no duration.
     93         *
     94         * Non-blocking requests return straight away without slowing the page,
     95         * so they're left without a duration.
     96         */
     97        public function track_request_end( $response, $context, $class, $args, $url ): void {
     98                $key = $this->finish_in_flight( (string) $url, $args['method'] ?? 'GET' );
    6199
    62                 if ( ! $request_id || ! isset( $this->requests[ $request_id ] ) ) {
    63                         return $response;
     100                if ( $key === null || ! isset( $this->requests[ $key ] ) || empty( $args['blocking'] ) ) {
     101                        return;
    64102                }
    65103
    66                 $duration = microtime( true ) - $this->requests[ $request_id ]['start_time'];
     104                $duration = microtime( true ) - $this->requests[ $key ]['start_time'];
    67105
    68                 $this->requests[ $request_id ]['duration_ms'] = Util::seconds_to_milliseconds( $duration );
    69                 $this->requests[ $request_id ]['http_status'] = wp_remote_retrieve_response_code( $response );
     106                $this->requests[ $key ]['duration_ms'] = Util::seconds_to_milliseconds( $duration );
    70107
    71                 return $response;
     108                if ( is_wp_error( $response ) ) {
     109                        // Such as "cURL error 28: Operation timed out after 5001 milliseconds".
     110                        $this->requests[ $key ]['error'] = Util::truncate( $response->get_error_message(), 256 );
     111                } else {
     112                        $this->requests[ $key ]['http_status'] = wp_remote_retrieve_response_code( $response );
     113                }
     114
     115                $this->drop_fastest_finished_request();
     116        }
     117
     118        /**
     119         * Finds which in-flight request has ended. Requests through WP_Http never
     120         * overlap, since each call returns only once its request is done, so it's
     121         * the newest one. Preferring a request with the same URL and method means
     122         * an unusual interleaving can't pair an end with the wrong start.
     123         *
     124         * WordPress can empty or change the URL while validating it, before
     125         * failing the request, so with no URL match the newest request with the
     126         * same method is used.
     127         */
     128        protected function finish_in_flight( string $url, string $method ): ?int {
     129                $match = null;
     130
     131                for ( $index = count( $this->in_flight ) - 1; $index >= 0; $index -- ) {
     132                        if ( $this->in_flight[ $index ]['method'] !== $method ) {
     133                                continue;
     134                        }
     135
     136                        if ( $this->in_flight[ $index ]['url'] === $url ) {
     137                                $match = $index;
     138                                break;
     139                        }
     140
     141                        $match = $match ?? $index;
     142                }
     143
     144                if ( $match === null ) {
     145                        return null;
     146                }
     147
     148                $key = $this->in_flight[ $match ]['key'];
     149
     150                array_splice( $this->in_flight, $match, 1 );
     151
     152                return $key;
     153        }
     154
     155        /**
     156         * Keeps memory flat on requests that make many HTTP calls, such as
     157         * imports: once more than MAX_REQUESTS have finished, the fastest goes.
     158         */
     159        protected function drop_fastest_finished_request(): void {
     160                $finished = array_filter( $this->requests, static function ( $request ) {
     161                        return isset( $request['duration_ms'] );
     162                } );
     163
     164                if ( count( $finished ) <= self::MAX_REQUESTS ) {
     165                        return;
     166                }
     167
     168                uasort( $finished, static function ( $a, $b ) {
     169                        return $a['duration_ms'] <=> $b['duration_ms'];
     170                } );
     171
     172                unset( $this->requests[ array_key_first( $finished ) ] );
    72173        }
    73174}
  • debughawk/trunk/src/Collectors/RequestCollector.php

    r3318985 r3783821  
    33namespace DebugHawk\Collectors;
    44
    5 use DebugHawk\NeedsInitiatingInterface;
     5use DebugHawk\Util;
    66
    7 class RequestCollector extends Collector implements NeedsInitiatingInterface {
     7class RequestCollector extends Collector {
    88        public string $key = 'request';
    9 
    10         public ?int $http_status_code = null;
    11 
    12         public ?string $redirect_location = null;
    13 
    14         public function init(): void {
    15                 add_filter( 'wp_redirect', [ $this, 'capture_redirect' ], 9999 );
    16                 add_filter( 'wp_redirect_status', [ $this, 'capture_redirect_status' ], 9999 );
    17         }
    189
    1910        public function gather(): array {
    … …  
    2516
    2617                return array_filter( [
    27                         'url'               => sprintf( '%s://%s%s', $scheme, $host, $request_uri ),
    28                         'method'            => $method,
    29                         'status'            => $this->http_status_code ?? http_response_code(),
    30                         'redirect_location' => $this->redirect_location,
    31                         'identifier'        => uniqid(),
    32                         'timestamp_ms'      => date_create()->format( 'Uv' ),
     18                        'url'          => Util::redact_url( sprintf( '%s://%s%s', $scheme, $host, $request_uri ) ),
     19                        'method'       => $method,
     20                        'status'       => http_response_code(),
     21                        'identifier'   => uniqid(),
     22                        // A number, like the browser's timestamp_ms, not a string.
     23                        'timestamp_ms' => (int) floor( microtime( true ) * 1000 ),
    3324                ] );
    3425        }
    35 
    36         public function capture_redirect( $location ) {
    37                 $this->redirect_location = $location;
    38 
    39                 return $location;
    40         }
    41 
    42         public function capture_redirect_status( $status ) {
    43                 $this->http_status_code = $status;
    44 
    45                 return $status;
    46         }
    47 
    48         public function is_redirect(): bool {
    49                 return is_int( $this->http_status_code ) && $this->http_status_code >= 300 && $this->http_status_code < 400;
    50         }
    5126}
  • debughawk/trunk/src/Config.php

    r3372612 r3783821  
    1010 * @property string $secret
    1111 * @property boolean $trace_admin_pages
    12  * @property boolean $trace_redirects
    1312 * @property int $slow_queries_threshold
    1413 * @property int $slow_queries_limit
    … …  
    2019                'sample_rate'            => 1,
    2120                'trace_admin_pages'      => true,
    22                 'trace_redirects'        => true,
    2321                'slow_queries_threshold' => 50, // 50 ms
    24                 'slow_queries_limit'     => 3,
     22                'slow_queries_limit'     => 10,
    2523        ];
    2624
    … …  
    6058        }
    6159
    62         public function is_within_sample_range(): bool {
    63                 return random_int( 1, 100 ) <= ( $this->sample_rate * 100 );
    64         }
    65 
    6660        public function to_array(): array {
    6761                $config = [];
  • debughawk/trunk/src/Dispatchers/BeaconDispatcher.php

    r3372612 r3783821  
    2222
    2323        public function output_beacon_metrics(): void {
     24                // Without the beacon script nothing sends the payload, so don't spend
     25                // time gathering it. That covers login pages when admin pages aren't
     26                // traced, and embed pages, which never enqueue scripts.
     27                if ( $this->is_excluded_screen() || ! wp_script_is( 'debughawk-beacon', 'enqueued' ) ) {
     28                        return;
     29                }
     30
     31                $payload = $this->gather_and_encrypt();
     32
     33                // Preparing it failed. Without window.DebugHawk the beacon sends nothing,
     34                // rather than an event with no server data.
     35                if ( $payload === '' ) {
     36                        return;
     37                }
     38
    2439                echo '<!-- DebugHawk -->' . "\n\n";
    25                 wp_print_inline_script_tag( "window.DebugHawk = '" . esc_js( $this->gather_and_encrypt() ) . "';" );
     40                wp_print_inline_script_tag( "window.DebugHawk = '" . esc_js( $payload ) . "';" );
    2641        }
    2742
    … …  
    3146                }
    3247
    33                 // Don't dispatch during a Customizer preview request:
    34                 if ( function_exists( 'is_customize_preview' ) && is_customize_preview() ) {
    35                         return false;
    36                 }
    37 
    38                 // Don't dispatch inside the Site Editor:
    39                 if ( isset( $_SERVER['SCRIPT_NAME'] ) && $_SERVER['SCRIPT_NAME'] === '/wp-admin/site-editor.php' ) {
    40                         return false;
    41                 }
    42 
    4348                return apply_filters( 'debughawk_should_output_beacon', true );
    4449        }
    4550
     51        /**
     52         * Screens that aren't real page views. Checked when the page is output,
     53         * not when the plugin loads: the Customizer isn't set up until
     54         * plugins_loaded, so checking any earlier never matched.
     55         */
     56        protected function is_excluded_screen(): bool {
     57                // A Customizer preview.
     58                if ( function_exists( 'is_customize_preview' ) && is_customize_preview() ) {
     59                        return true;
     60                }
     61
     62                // Admin screens shown in an iframe, such as the plugin details modal,
     63                // the theme installer and the media upload screen. Each would
     64                // otherwise be counted as a separate page view.
     65                if ( $this->is_iframe_request() ) {
     66                        return true;
     67                }
     68
     69                // The Site Editor. $pagenow works wherever WordPress is installed,
     70                // unlike matching the script path against /wp-admin/site-editor.php.
     71                return is_admin() && ( $GLOBALS['pagenow'] ?? '' ) === 'site-editor.php';
     72        }
     73
     74        protected function is_iframe_request(): bool {
     75                return defined( 'IFRAME_REQUEST' ) && IFRAME_REQUEST;
     76        }
     77
    4678        public function enqueue_beacon(): void {
     79                if ( $this->is_excluded_screen() ) {
     80                        return;
     81                }
     82
    4783                wp_enqueue_script( 'debughawk-beacon', $this->config->script_url, [], null, [
    4884                        'strategy' => 'async',
  • debughawk/trunk/src/Dispatchers/Dispatcher.php

    r3318985 r3783821  
    55use DebugHawk\CollectorManager;
    66use DebugHawk\Config;
    7 use Exception;
     7use DebugHawk\Util;
    88
    99abstract class Dispatcher {
    … …  
    1919        protected function gather_and_encrypt(): string {
    2020                try {
    21                         $payload = json_encode( $this->collectors->gather(), JSON_THROW_ON_ERROR );
     21                        // Invalid UTF-8 (from a URL or SQL, say) is replaced rather than
     22                        // failing the whole payload.
     23                        $payload = json_encode( $this->collectors->gather(), JSON_THROW_ON_ERROR | JSON_INVALID_UTF8_SUBSTITUTE );
    2224
    2325                        $algo  = 'aes-128-ctr';
    … …  
    2830
    2931                        return base64_encode( $iv . $encrypted );
    30                 } catch ( Exception $e ) {
     32                } catch ( \Throwable $e ) {
     33                        // Never break the page DebugHawk is measuring.
     34                        Util::log_error( 'Could not prepare metrics: ' . $e->getMessage() );
     35
    3136                        return '';
    3237                }
  • debughawk/trunk/src/Plugin.php

    r3433055 r3783821  
    1111use DebugHawk\Collectors\WordpressCollector;
    1212use DebugHawk\Dispatchers\BeaconDispatcher;
    13 use DebugHawk\Dispatchers\RedirectDispatcher;
    1413
    1514class Plugin {
    … …  
    4847                $dispatchers
    4948                        ->add( new BeaconDispatcher( $this->config, $collectors ) )
    50                         ->add( new RedirectDispatcher( $this->config, $collectors ) )
    5149                        ->init();
    5250        }
  • debughawk/trunk/src/Settings.php

    r3433055 r3783821  
    6666                $this->add_settings_field( 'sample_rate', __( 'Sample Rate', 'debughawk' ), 'render_number_field' );
    6767                $this->add_settings_field( 'trace_admin_pages', __( 'Monitor Admin Pages', 'debughawk' ), 'render_checkbox_field' );
    68                 $this->add_settings_field( 'trace_redirects', __( 'Monitor Redirects', 'debughawk' ), 'render_checkbox_field' );
    6968                $this->add_settings_field( 'slow_queries_threshold', __( 'Slow Queries Threshold (ms)', 'debughawk' ), 'render_number_field' );
    7069        }
    … …  
    230229                        'sample_rate'            => __( 'Percentage of requests to monitor (0-1). For example, 0.1 means 10% of requests.', 'debughawk' ),
    231230                        'trace_admin_pages'      => __( 'Also monitor WordPress admin pages.', 'debughawk' ),
    232                         'trace_redirects'        => __( 'Also monitor redirect responses.', 'debughawk' ),
    233231                        'slow_queries_threshold' => __( 'Queries taking longer than this (in milliseconds) will be flagged as slow.', 'debughawk' ),
    234232                ];
    … …  
    259257                $sanitized['sample_rate']            = min( 1, max( 0, floatval( $input['sample_rate'] ?? 1 ) ) );
    260258                $sanitized['trace_admin_pages']      = ! empty( $input['trace_admin_pages'] );
    261                 $sanitized['trace_redirects']        = ! empty( $input['trace_redirects'] );
    262259                $sanitized['slow_queries_threshold'] = max( 0, intval( $input['slow_queries_threshold'] ?? 50 ) );
    263260
  • debughawk/trunk/src/Util.php

    r3318985 r3783821  
    77                return round( $seconds * 1000, $precision );
    88        }
     9
     10        /**
     11         * Shortens a string to at most $max_bytes without splitting a UTF-8
     12         * character, which would make it invalid.
     13         */
     14        public static function truncate( string $string, int $max_bytes ): string {
     15                if ( strlen( $string ) <= $max_bytes ) {
     16                        return $string;
     17                }
     18
     19                $end = $max_bytes;
     20
     21                // Back up past continuation bytes (10xxxxxx) to the start of the
     22                // character being cut. UTF-8 characters are at most 4 bytes.
     23                for ( $i = 0; $i < 3 && $end > 0 && ( ord( $string[ $end ] ) & 0xC0 ) === 0x80; $i ++ ) {
     24                        $end --;
     25                }
     26
     27                return substr( $string, 0, $end );
     28        }
     29
     30        /**
     31         * Removes values that could be secret or personal from a URL before it's
     32         * sent: query values (API keys, password reset keys, order keys, search
     33         * terms, emails) become ?, credentials are removed and the fragment is
     34         * dropped. Query keys are kept, so the URL is still recognisable.
     35         *
     36         * For example, https://user:pass@api.example.com/v1/items?key=abc&page=2#top
     37         * becomes https://api.example.com/v1/items?key=?&page=?
     38         */
     39        public static function redact_url( string $url ): string {
     40                $hash = strpos( $url, '#' );
     41
     42                if ( $hash !== false ) {
     43                        $url = substr( $url, 0, $hash );
     44                }
     45
     46                $url = (string) preg_replace( '#^([a-z][a-z0-9+.-]*://)[^/?@]*@#i', '$1', $url );
     47
     48                $question = strpos( $url, '?' );
     49
     50                if ( $question === false ) {
     51                        return $url;
     52                }
     53
     54                $parameters = explode( '&', substr( $url, $question + 1 ) );
     55
     56                foreach ( $parameters as $index => $parameter ) {
     57                        $equals = strpos( $parameter, '=' );
     58
     59                        if ( $equals !== false ) {
     60                                $parameters[ $index ] = substr( $parameter, 0, $equals ) . '=?';
     61                        }
     62                }
     63
     64                return substr( $url, 0, $question + 1 ) . implode( '&', $parameters );
     65        }
     66
     67        /**
     68         * Logs an error when WP_DEBUG is on, so failures are visible while
     69         * debugging without filling production logs.
     70         */
     71        public static function log_error( string $message ): void {
     72                if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
     73                        error_log( 'DebugHawk: ' . $message );
     74                }
     75        }
    976}
  • debughawk/trunk/vendor/autoload.php

    r3318985 r3783821  
    2020require_once __DIR__ . '/composer/autoload_real.php';
    2121
    22 return ComposerAutoloaderInitd67bb9a850b07076247c035eb166d44b::getLoader();
     22return ComposerAutoloaderInit99e243e48dfa2f20c2daa51d807bd3a6::getLoader();
  • debughawk/trunk/vendor/composer/autoload_real.php

    r3318985 r3783821  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInitd67bb9a850b07076247c035eb166d44b
     5class ComposerAutoloaderInit99e243e48dfa2f20c2daa51d807bd3a6
    66{
    77    private static $loader;
    … …  
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInitd67bb9a850b07076247c035eb166d44b', 'loadClassLoader'), true, true);
     27        spl_autoload_register(array('ComposerAutoloaderInit99e243e48dfa2f20c2daa51d807bd3a6', 'loadClassLoader'), true, true);
    2828        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
    29         spl_autoload_unregister(array('ComposerAutoloaderInitd67bb9a850b07076247c035eb166d44b', 'loadClassLoader'));
     29        spl_autoload_unregister(array('ComposerAutoloaderInit99e243e48dfa2f20c2daa51d807bd3a6', 'loadClassLoader'));
    3030
    3131        require __DIR__ . '/autoload_static.php';
    32         call_user_func(\Composer\Autoload\ComposerStaticInitd67bb9a850b07076247c035eb166d44b::getInitializer($loader));
     32        call_user_func(\Composer\Autoload\ComposerStaticInit99e243e48dfa2f20c2daa51d807bd3a6::getInitializer($loader));
    3333
    3434        $loader->register(true);
  • debughawk/trunk/vendor/composer/autoload_static.php

    r3433055 r3783821  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInitd67bb9a850b07076247c035eb166d44b
     7class ComposerStaticInit99e243e48dfa2f20c2daa51d807bd3a6
    88{
    99    public static $prefixLengthsPsr4 = array (
    … …  
    2828    {
    2929        return \Closure::bind(function () use ($loader) {
    30             $loader->prefixLengthsPsr4 = ComposerStaticInitd67bb9a850b07076247c035eb166d44b::$prefixLengthsPsr4;
    31             $loader->prefixDirsPsr4 = ComposerStaticInitd67bb9a850b07076247c035eb166d44b::$prefixDirsPsr4;
    32             $loader->classMap = ComposerStaticInitd67bb9a850b07076247c035eb166d44b::$classMap;
     30            $loader->prefixLengthsPsr4 = ComposerStaticInit99e243e48dfa2f20c2daa51d807bd3a6::$prefixLengthsPsr4;
     31            $loader->prefixDirsPsr4 = ComposerStaticInit99e243e48dfa2f20c2daa51d807bd3a6::$prefixDirsPsr4;
     32            $loader->classMap = ComposerStaticInit99e243e48dfa2f20c2daa51d807bd3a6::$classMap;
    3333
    3434        }, null, ClassLoader::class);
  • debughawk/trunk/vendor/composer/installed.php

    r3433055 r3783821  
    22    'root' => array(
    33        'name' => 'debughawk/debughawk-plugin',
    4         'pretty_version' => 'v1.2.0',
    5         'version' => '1.2.0.0',
    6         'reference' => 'fff2867ce754f93f58f85bc52a75c290c7072c82',
     4        'pretty_version' => 'v1.3.0',
     5        'version' => '1.3.0.0',
     6        'reference' => 'b950bd8d753de45a4de05d0b3f43feb529cbeb10',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
    … …  
    1212    'versions' => array(
    1313        'debughawk/debughawk-plugin' => array(
    14             'pretty_version' => 'v1.2.0',
    15             'version' => '1.2.0.0',
    16             'reference' => 'fff2867ce754f93f58f85bc52a75c290c7072c82',
     14            'pretty_version' => 'v1.3.0',
     15            'version' => '1.3.0.0',
     16            'reference' => 'b950bd8d753de45a4de05d0b3f43feb529cbeb10',
    1717            'type' => 'wordpress-plugin',
    1818            'install_path' => __DIR__ . '/../../',
  • debughawk/trunk/wp-content/db.php

    r3433055 r3783821  
    55 * Description: Database drop-in for DebugHawk to capture database metrics and slow queries.
    66 * Author: DebugHawk
    7  * Version: 1.2.0
     7 * Version: 1.3.0
    88 * Requires PHP: 7.4
    99 * Requires WP: 6.3
    … …  
    4343
    4444class DebugHawkDB extends wpdb {
     45        /**
     46         * Running totals for every query, read by DebugHawk's database collector.
     47         * Kept as totals rather than in $this->queries, so memory stays flat
     48         * however many queries a request runs.
     49         */
     50        public array $debughawk_stats = [
     51                'count' => 0,
     52                'time'  => 0.0,
     53                'types' => [],
     54        ];
     55
     56        /**
     57         * Queries slower than $debughawk_slow_threshold seconds are passed to this
     58         * callable. Both are set by the plugin once it loads. It's called directly,
     59         * not through an action, so slow query backtraces match those from
     60         * $wpdb->queries and fast queries never touch the hook system.
     61         *
     62         * @var callable|null
     63         */
     64        public $debughawk_slow_query_handler = null;
     65
     66        public float $debughawk_slow_threshold = 0.0;
     67
     68        /**
     69         * Time spent in queries run from inside the current query, such as the
     70         * charset lookup wpdb makes for queries containing non-ASCII text.
     71         */
     72        protected float $debughawk_nested_time = 0.0;
    4573
    4674        public function query( $query ) {
    47                 if ( ! defined( 'SAVEQUERIES' ) || ! SAVEQUERIES ) {
    48                         $this->timer_start();
     75                // Time each call locally: wpdb's shared timer is reset by nested queries.
     76                $outer_nested_time           = $this->debughawk_nested_time;
     77                $this->debughawk_nested_time = 0.0;
     78
     79                $start   = microtime( true );
     80                $result  = parent::query( $query );
     81                $elapsed = microtime( true ) - $start;
     82
     83                // Each query's time excludes its nested queries, which are counted
     84                // separately, so the times add up to the real total.
     85                $query_time                  = $elapsed - $this->debughawk_nested_time;
     86                $this->debughawk_nested_time = $outer_nested_time + $elapsed;
     87
     88                $type = preg_match( '/^\s*([A-Za-z]+)\b/', $query, $matches ) ? strtoupper( $matches[1] ) : 'OTHER';
     89
     90                if ( ! isset( $this->debughawk_stats['types'][ $type ] ) ) {
     91                        $this->debughawk_stats['types'][ $type ] = [
     92                                'count' => 0,
     93                                'time'  => 0.0,
     94                        ];
    4995                }
    5096
    51                 $result = parent::query( $query );
     97                $this->debughawk_stats['count'] ++;
     98                $this->debughawk_stats['time']                    += $query_time;
     99                $this->debughawk_stats['types'][ $type ]['count'] ++;
     100                $this->debughawk_stats['types'][ $type ]['time']  += $query_time;
    52101
    53                 if ( ! defined( 'SAVEQUERIES' ) || ! SAVEQUERIES ) {
    54                         $this->log_query(
    55                                 $query,
    56                                 $this->timer_stop(),
    57                                 '',
    58                                 $this->time_start,
    59                                 [],
    60                         );
     102                if ( $this->debughawk_slow_query_handler !== null && $query_time > $this->debughawk_slow_threshold ) {
     103                        ( $this->debughawk_slow_query_handler )( $query, $query_time, $start );
    61104                }
    62105
Note: See TracChangeset for help on using the changeset viewer.